@burdenoff/microfe-healthybowl 2026.727.1 → 2026.727.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,21 +3,23 @@ import { useTr as t } from "../../shared/hooks/useTr.js";
3
3
  import { checkAssistantAiCredits as n, createAssistantSandbox as r, createAssistantSession as i, extendAssistantSandboxTTL as a, findExistingSandbox as o, getAssistantArtifacts as s, getAssistantMessages as c, getAssistantSession as l, reportAssistantAiTokenUsage as u, sendAssistantPromptAsync as d, waitForAssistantServiceReady as f, waitForSandboxReady as p } from "../../services/assistantApi.js";
4
4
  import { gatherPageContext as m } from "../../utils/pageContext.js";
5
5
  import { getOrganizationId as h, getWorkspaceId as g } from "../../utils/assistantContext.js";
6
- import { buildPromptParts as ee, buildPromptWithAttachments as te, toMessageAttachment as _ } from "../../utils/assistantAttachments.js";
7
- import { AssistantMessageList as v } from "./AssistantMessageList.js";
8
- import { AssistantApiCallsConsentDialog as y } from "./AssistantApiCallsConsentDialog.js";
9
- import { ASSISTANT_MODES as b } from "../../types/assistant.js";
10
- import { AssistantEmptyState as x } from "./AssistantEmptyState.js";
11
- import { AssistantComposer as ne } from "./composer/AssistantComposer.js";
12
- import { useAssistantApiAccess as re } from "../../hooks/useAssistantApiAccess.js";
13
- import { isQuotaExhaustedError as ie } from "../../utils/quotaUtils.js";
14
- import { dispatchAssistantQuotaExhausted as ae, notifyAiCreditsUpdated as oe } from "../../utils/aiCredits.js";
15
- import { buildPromptForMode as se } from "../../utils/assistantPrompt.js";
16
- import { useCallback as S, useEffect as C, useMemo as ce, useRef as le, useState as ue } from "react";
17
- import { jsx as w, jsxs as de } from "react/jsx-runtime";
6
+ import { buildPromptParts as ee, buildPromptWithAttachments as te, countInlineImageCandidates as ne, countInlinedImageParts as re, toMessageAttachment as ie } from "../../utils/assistantAttachments.js";
7
+ import { AssistantMessageList as _ } from "./AssistantMessageList.js";
8
+ import { AssistantApiCallsConsentDialog as v } from "./AssistantApiCallsConsentDialog.js";
9
+ import { ASSISTANT_MODES as y } from "../../types/assistant.js";
10
+ import { AssistantEmptyState as b } from "./AssistantEmptyState.js";
11
+ import { AssistantComposer as x } from "./composer/AssistantComposer.js";
12
+ import { useAssistantApiAccess as S } from "../../hooks/useAssistantApiAccess.js";
13
+ import { isQuotaExhaustedError as C } from "../../utils/quotaUtils.js";
14
+ import { dispatchAssistantQuotaExhausted as w, notifyAiCreditsUpdated as ae } from "../../utils/aiCredits.js";
15
+ import { buildPromptForMode as oe } from "../../utils/assistantPrompt.js";
16
+ import { isMultimodalBodyRejection as se } from "../../utils/assistantTransportErrors.js";
17
+ import { isTurnInFlight as T } from "../../utils/assistantTurnState.js";
18
+ import { useCallback as E, useEffect as D, useMemo as ce, useRef as le, useState as ue } from "react";
19
+ import { jsx as O, jsxs as de } from "react/jsx-runtime";
18
20
  import { useGatewayClient as fe } from "@burdenoff/fe-libs/shared/graphql";
19
21
  import { useAuthToken as pe } from "@burdenoff/fe-libs/shared/providers/shell";
20
- import { getAssistantMedia as T } from "@burdenoff/fe-libs/shared/assistant";
22
+ import { getAssistantMedia as k } from "@burdenoff/fe-libs/shared/assistant";
21
23
  //#region src/components/assistant/AssistantChatArea.tsx
22
24
  var me = {
23
25
  general: 18e4,
@@ -45,25 +47,25 @@ function _e(e) {
45
47
  function ve(e) {
46
48
  return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
47
49
  }
48
- function E(e) {
50
+ function A(e) {
49
51
  return e.info?.time?.created ?? 0;
50
52
  }
51
- function D(e) {
53
+ function j(e) {
52
54
  return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
53
55
  }
54
- function O(e) {
56
+ function M(e) {
55
57
  return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
56
58
  let t = e.state?.status ?? "running", n = e.tool ?? "tool";
57
59
  return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
58
60
  });
59
61
  }
60
- function k(e, t) {
61
- let n = e.filter((e) => e.info?.role === "assistant" && E(e) > t).sort((e, t) => E(e) - E(t));
62
+ function ye(e, t) {
63
+ let n = e.filter((e) => e.info?.role === "assistant" && A(e) > t).sort((e, t) => A(e) - A(t));
62
64
  if (n.length === 0) return {
63
65
  content: "Thinking...",
64
66
  done: !1
65
67
  };
66
- let r = n[n.length - 1], i = D(r.parts), a = T(r.parts), o = O(r.parts);
68
+ let r = n[n.length - 1], i = j(r.parts), a = k(r.parts), o = M(r.parts);
67
69
  return {
68
70
  content: [
69
71
  i,
@@ -74,7 +76,7 @@ function k(e, t) {
74
76
  tokens: r.info?.tokens
75
77
  };
76
78
  }
77
- function ye(e) {
79
+ function be(e) {
78
80
  switch (e) {
79
81
  case "provisioning": return "Starting assistant environment...";
80
82
  case "connecting": return "Connecting to assistant...";
@@ -82,171 +84,182 @@ function ye(e) {
82
84
  default: return "";
83
85
  }
84
86
  }
85
- var A = () => {
86
- let T = t(), D = fe("workspace"), { getAccessToken: O, getWorkspaceToken: A, userId: j } = pe(), { conversations: be, activeConversationId: M, mode: N, processingByConversationId: P, setMode: F, setConversationMode: I, setActiveConversation: xe, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, setConversationProcessing: V, clearConversationProcessing: Se, setBackendSessionId: H, clearBackendSessionId: U, setSandbox: W, clearSandbox: Ce, acknowledgeApiCalls: we } = e(), G = be.find((e) => e.id === M)?.messages ?? [], K = M ? P[M] : void 0, Te = K?.status === "provisioning" || K?.status === "connecting" || K?.status === "streaming" ? K.messageId ?? null : null, Ee = K?.status === "provisioning" || K?.status === "connecting" || K?.status === "streaming", De = K?.status === "error" ? K.messageId : null, { canUseApiCalls: q, loading: Oe } = re(h()), ke = ce(() => b.filter((e) => !e.requiresAdmin || q), [q]), [J, Y] = ue(null), Ae = le({});
87
- C(() => {
88
- if (Oe) return;
89
- let e = b.find((e) => e.id === N);
90
- (!e || e.requiresAdmin && !q) && N !== "general" && F("general");
87
+ var N = () => {
88
+ let k = t(), j = fe("workspace"), { getAccessToken: M, getWorkspaceToken: N, userId: xe } = pe(), { conversations: Se, activeConversationId: P, mode: F, processingByConversationId: Ce, setMode: I, setConversationMode: L, setActiveConversation: we, createConversation: R, addMessage: z, updateMessage: B, patchMessage: V, setConversationProcessing: H, clearConversationProcessing: Te, setBackendSessionId: U, clearBackendSessionId: W, setSandbox: G, clearSandbox: Ee, acknowledgeApiCalls: De } = e(), K = Se.find((e) => e.id === P)?.messages ?? [], q = P ? Ce[P] : void 0, Oe = T(q?.status), ke = Oe ? q?.messageId ?? null : null, Ae = q?.status === "error" ? q.messageId : null, { canUseApiCalls: J, loading: je } = S(h()), Me = ce(() => y.filter((e) => !e.requiresAdmin || J), [J]), [Ne, Pe] = ue(null), Fe = le({}), Y = le(/* @__PURE__ */ new Set());
89
+ D(() => {
90
+ if (je) return;
91
+ let e = y.find((e) => e.id === F);
92
+ (!e || e.requiresAdmin && !J) && F !== "general" && I("general");
91
93
  }, [
92
- N,
93
- q,
94
- Oe,
95
- F
94
+ F,
95
+ J,
96
+ je,
97
+ I
96
98
  ]);
97
- let X = S((e, t, n, r) => {
98
- V(e, n, t, null), r ? z(e, t, r) : z(e, t, ye(n));
99
- }, [V, z]), je = S(async (t, n, a, s, c) => {
99
+ let X = E((e, t, n, r) => {
100
+ H(e, n, t, null), r ? B(e, t, r) : B(e, t, be(n));
101
+ }, [H, B]), Ie = E(async (t, n, a, s, c) => {
100
102
  let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
101
103
  try {
102
- return await p(D, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(D, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), !0;
104
+ return await p(j, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(j, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), !0;
103
105
  } catch {
104
106
  return !1;
105
107
  }
106
108
  };
107
- if (u && (W(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (W(a, null, "provisioning"), u = null)), !u) {
109
+ if (u && (G(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (G(a, null, "provisioning"), u = null)), !u) {
108
110
  X(t, n, "provisioning", "Looking for existing environment...");
109
- let e = await o(D, s, a, c);
110
- e && (W(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : W(a, null, "provisioning"));
111
+ let e = await o(j, s, a, c);
112
+ e && (G(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : G(a, null, "provisioning"));
111
113
  }
112
114
  if (!u) {
113
- if (a === "api-calls" && !O()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
114
- X(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(D, a, s, c), W(a, u, "provisioning"), await p(D, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(D, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
115
+ if (a === "api-calls" && !M()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
116
+ X(t, n, "provisioning", "Starting assistant environment..."), G(a, null, "provisioning"), u = await r(j, a, s, c), G(a, u, "provisioning"), await p(j, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(j, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
115
117
  }
116
- W(a, u, "running");
118
+ G(a, u, "running");
117
119
  let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
118
120
  if (m) try {
119
- let e = await l(D, u, s, m, c);
121
+ let e = await l(j, u, s, m, c);
120
122
  if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
121
123
  } catch {
122
- U(t), m = null;
124
+ W(t), m = null;
123
125
  }
124
- return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(D, u, s, a, c)).sessionId, H(t, m)), {
126
+ return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(j, u, s, a, c)).sessionId, U(t, m)), {
125
127
  sandboxId: u,
126
128
  sessionId: m
127
129
  };
128
130
  }, [
129
- D,
130
- U,
131
- O,
132
- H,
131
+ j,
133
132
  W,
133
+ M,
134
+ U,
135
+ G,
134
136
  X
135
- ]), Z = S(async (t, r = []) => {
136
- if (M) {
137
- let e = P[M]?.status;
138
- if (e === "provisioning" || e === "connecting" || e === "streaming") return;
139
- }
140
- let i = e.getState().mode, o = M, l = o ? e.getState().conversations.find((e) => e.id === o) : void 0;
141
- if (o ? l && l.mode !== i && (l.messages.length > 0 || l.backendSessionId) ? o = L(void 0, i) : l && l.mode !== i && I(o, i) : o = L(void 0, i), !o) return;
142
- Ae.current[o] = r;
143
- let f = g(), p = {
144
- accessToken: O(),
145
- workspaceToken: A(),
146
- userId: j,
137
+ ]), Z = E(async (t, r = []) => {
138
+ let i = e.getState(), o = i.activeConversationId ?? P;
139
+ if (o && (T(i.processingByConversationId[o]?.status) || Y.current.has(o))) return;
140
+ let l = i.mode, f = P, p = f ? e.getState().conversations.find((e) => e.id === f) : void 0;
141
+ if (f ? p && p.mode !== l && (p.messages.length > 0 || p.backendSessionId) ? f = R(void 0, l) : p && p.mode !== l && L(f, l) : f = R(void 0, l), !f) return;
142
+ Fe.current[f] = r;
143
+ let _ = g(), v = {
144
+ accessToken: M(),
145
+ workspaceToken: N(),
146
+ userId: xe,
147
147
  organizationId: h()
148
- }, v = {
148
+ }, y = {
149
149
  id: ge(),
150
150
  role: "user",
151
151
  content: t,
152
152
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
153
- metadata: r.length ? { attachments: r.map(_) } : void 0
153
+ metadata: r.length ? { attachments: r.map(ie) } : void 0
154
154
  };
155
- R(o, v);
156
- let y = ge();
157
- R(o, {
158
- id: y,
155
+ z(f, y);
156
+ let b = ge();
157
+ z(f, {
158
+ id: b,
159
159
  role: "assistant",
160
160
  content: "",
161
161
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
162
- });
163
- let b = (e, t, n, r) => {
164
- B(o, y, {
162
+ }), H(f, "provisioning", b, null);
163
+ let x = (e, t, n, r) => {
164
+ V(f, b, {
165
165
  content: ve(e),
166
166
  metadata: t?.length || n || r ? {
167
167
  artifacts: t,
168
- mode: i,
168
+ mode: l,
169
169
  sessionId: n,
170
170
  sandboxId: r
171
171
  } : void 0
172
172
  });
173
- }, x = async (e = 1) => {
173
+ }, S = async (e = 1) => {
174
+ let i = !1;
174
175
  try {
175
- await n(D, f, p);
176
+ await n(j, _, v);
176
177
  } catch (e) {
177
- if (ie(e)) {
178
- ae("ai-credits"), b("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), V(o, "error", y, null);
178
+ if (C(e)) {
179
+ w("ai-credits"), x("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), H(f, "error", b, null);
179
180
  return;
180
181
  }
181
182
  console.warn("[assistant] AI-credit pre-flight check failed with a non-quota error; proceeding — gateway @usage(checkQuota) still enforces the real budget downstream", e);
182
183
  }
183
184
  try {
184
- let { sandboxId: e, sessionId: n } = await je(o, y, i, f, p), l = (await c(D, e, f, n, p, 50).catch(() => [])).reduce((e, t) => Math.max(e, E(t)), 0);
185
- X(o, y, "streaming", "Thinking...");
186
- let h = se(i, te(t, r));
187
- await d(D, e, f, n, h, i, m(), p, ee(h, r));
188
- let g = k([], l), _ = Date.now() + (me[i] ?? he), v = Date.now();
189
- for (; Date.now() < _ && (g = k(await c(D, e, f, n, p, 50), l), B(o, y, { content: ve(g.content) }), !g.done);) Date.now() - v > 3e4 && (await a(D, e, f, 600, p).catch(() => void 0), v = Date.now()), await new Promise((e) => setTimeout(e, 1500));
190
- if (!g.done && i !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
191
- let x = i === "vibe-plugins" ? await s(D, e, f, n, p).catch(() => []) : void 0;
192
- if (g.done || (g = {
193
- ...g,
194
- content: `${g.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
195
- }), b(g.content, x, n, e), g.tokens) {
196
- B(o, y, { tokens: g.tokens });
185
+ let { sandboxId: e, sessionId: n } = await Ie(f, b, l, _, v), o = (await c(j, e, _, n, v, 50).catch(() => [])).reduce((e, t) => Math.max(e, A(t)), 0);
186
+ X(f, b, "streaming", "Thinking...");
187
+ let p = oe(l, te(t, r)), h = ee(p, r), g = re(h), ie = g > 0, y = m();
188
+ i = ne(r) > g;
189
+ try {
190
+ await d(j, e, _, n, p, l, y, v, h);
191
+ } catch (t) {
192
+ if (!h || !se(t)) throw t;
193
+ await d(j, e, _, n, p, l, y, v, void 0), i ||= ie;
194
+ }
195
+ let S = ye([], o), C = Date.now() + (me[l] ?? he), w = Date.now();
196
+ for (; Date.now() < C && (S = ye(await c(j, e, _, n, v, 50), o), V(f, b, { content: ve(S.content) }), !S.done);) Date.now() - w > 3e4 && (await a(j, e, _, 600, v).catch(() => void 0), w = Date.now()), await new Promise((e) => setTimeout(e, 1500));
197
+ if (!S.done && l !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
198
+ let T = l === "vibe-plugins" ? await s(j, e, _, n, v).catch(() => []) : void 0;
199
+ if (S.done || (S = {
200
+ ...S,
201
+ content: `${S.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
202
+ }), i && (S = {
203
+ ...S,
204
+ content: `${S.content}\n\n${k("healthybowl.assistant.attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}`
205
+ }), x(S.content, T, n, e), S.tokens) {
206
+ V(f, b, { tokens: S.tokens });
197
207
  try {
198
- await u(D, f, n, g.tokens, p), oe();
208
+ await u(j, _, n, S.tokens, v), ae();
199
209
  } catch {}
200
210
  }
201
- V(o, "complete", y, null);
211
+ H(f, "complete", b, null);
202
212
  } catch (t) {
203
- if (e === 1 && _e(t)) return U(o), Ce(i), x(2);
213
+ if (e === 1 && _e(t)) return W(f), Ee(l), S(2);
204
214
  throw t;
205
215
  }
206
- };
216
+ }, E = f;
217
+ Y.current.add(E);
207
218
  try {
208
- if (!f) throw Error("Assistant backend is unavailable without an active workspace context.");
209
- await x();
219
+ if (!_) throw Error("Assistant backend is unavailable without an active workspace context.");
220
+ await S();
210
221
  } catch (e) {
211
- if (ie(e)) {
212
- ae("sandbox"), b("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), V(o, "error", y, null);
222
+ if (C(e)) {
223
+ w("sandbox"), x("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), H(f, "error", b, null);
213
224
  return;
214
225
  }
215
226
  let t = e instanceof Error ? e.message : "Something went wrong";
216
- V(o, "error", y, t), z(o, y, `Sorry, an error occurred: ${t}. Please try again.`);
227
+ H(f, "error", b, t), B(f, b, `Sorry, an error occurred: ${t}. Please try again.`);
228
+ } finally {
229
+ Y.current.delete(E);
217
230
  }
218
231
  }, [
219
- M,
232
+ P,
233
+ z,
234
+ j,
235
+ W,
236
+ Ee,
237
+ Se,
220
238
  R,
221
- D,
239
+ Ie,
240
+ M,
241
+ N,
242
+ V,
222
243
  U,
223
- Ce,
224
- be,
225
244
  L,
226
- je,
227
- O,
228
- A,
229
- B,
230
- P,
231
245
  H,
232
- I,
233
- V,
246
+ k,
234
247
  X,
235
- z,
236
- j
237
- ]), Me = S((e) => {
248
+ B,
249
+ xe
250
+ ]), Le = E((e) => {
238
251
  Z(e);
239
- }, [Z]), Ne = S(() => {
240
- let e = [...G].reverse().find((e) => e.role === "user"), t = M ? Ae.current[M] ?? [] : [];
252
+ }, [Z]), Re = E(() => {
253
+ let e = [...K].reverse().find((e) => e.role === "user"), t = P ? Fe.current[P] ?? [] : [];
241
254
  e && Z(e.content, t);
242
255
  }, [
243
- G,
256
+ K,
244
257
  Z,
245
- M
258
+ P
246
259
  ]), Q = le(Z);
247
- C(() => {
260
+ D(() => {
248
261
  Q.current = Z;
249
- }, [Z]), C(() => {
262
+ }, [Z]), D(() => {
250
263
  let t = e.getState().consumePendingPrompt();
251
264
  return t && Q.current(t), e.subscribe((t, n) => {
252
265
  if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
@@ -255,69 +268,69 @@ var A = () => {
255
268
  }
256
269
  });
257
270
  }, []);
258
- let $ = S((t) => {
259
- let n = M ? e.getState().conversations.find((e) => e.id === M) : void 0;
271
+ let $ = E((t) => {
272
+ let n = P ? e.getState().conversations.find((e) => e.id === P) : void 0;
260
273
  if (n && (n.messages.length > 0 || n.backendSessionId)) {
261
274
  if (n.mode !== t) {
262
275
  let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
263
- n ? xe(n.id) : L(void 0, t);
276
+ n ? we(n.id) : R(void 0, t);
264
277
  }
265
- } else M && I(M, t);
266
- F(t);
278
+ } else P && L(P, t);
279
+ I(t);
267
280
  }, [
268
- M,
281
+ P,
282
+ R,
283
+ we,
269
284
  L,
270
- xe,
271
- I,
272
- F
273
- ]), Pe = S((t) => {
274
- if (b.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
275
- Y(t);
285
+ I
286
+ ]), ze = E((t) => {
287
+ if (y.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
288
+ Pe(t);
276
289
  return;
277
290
  }
278
291
  $(t);
279
- }, [$]), Fe = S(() => {
280
- let e = J;
281
- Y(null), we(), e && $(e);
292
+ }, [$]), Be = E(() => {
293
+ let e = Ne;
294
+ Pe(null), De(), e && $(e);
282
295
  }, [
283
- J,
284
- we,
296
+ Ne,
297
+ De,
285
298
  $
286
- ]), Ie = S(() => {
287
- Y(null);
299
+ ]), Ve = E(() => {
300
+ Pe(null);
288
301
  }, []);
289
302
  return /* @__PURE__ */ de("div", {
290
303
  className: "flex flex-1 flex-col overflow-hidden",
291
304
  children: [
292
- G.length === 0 ? /* @__PURE__ */ w(x, {
293
- mode: N,
294
- onSuggestionClick: Me
295
- }) : /* @__PURE__ */ w("div", {
305
+ K.length === 0 ? /* @__PURE__ */ O(b, {
306
+ mode: F,
307
+ onSuggestionClick: Le
308
+ }) : /* @__PURE__ */ O("div", {
296
309
  className: "flex min-h-0 flex-1 flex-col",
297
- children: /* @__PURE__ */ w(v, {
298
- messages: G,
299
- streamingMessageId: Te,
300
- failedMessageId: De,
301
- onRetry: Ne
310
+ children: /* @__PURE__ */ O(_, {
311
+ messages: K,
312
+ streamingMessageId: ke,
313
+ failedMessageId: Ae,
314
+ onRetry: Re
302
315
  })
303
316
  }),
304
- /* @__PURE__ */ w(ne, {
317
+ /* @__PURE__ */ O(x, {
305
318
  onSend: (e, t) => void Z(e, t),
306
- disabled: Ee,
307
- placeholder: N === "api-calls" ? T("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : T("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
308
- mode: N,
309
- availableModes: ke,
310
- onModeChange: Pe
319
+ disabled: Oe,
320
+ placeholder: F === "api-calls" ? k("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : k("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
321
+ mode: F,
322
+ availableModes: Me,
323
+ onModeChange: ze
311
324
  }),
312
- /* @__PURE__ */ w(y, {
313
- open: J !== null,
314
- onConfirm: Fe,
315
- onCancel: Ie
325
+ /* @__PURE__ */ O(v, {
326
+ open: Ne !== null,
327
+ onConfirm: Be,
328
+ onCancel: Ve
316
329
  })
317
330
  ]
318
331
  });
319
332
  };
320
333
  //#endregion
321
- export { A as AssistantChatArea };
334
+ export { N as AssistantChatArea };
322
335
 
323
336
  //# sourceMappingURL=AssistantChatArea.js.map