@burdenoff/fe-libs 2026.1027.13 → 2026.1028.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.
@@ -2,38 +2,39 @@ import { useVoiceInput as e } from "../voice/useVoiceInput.js";
2
2
  import { useWorkflowAssistantLabels as t } from "../../providers/shell/useAssistantShellLabels.js";
3
3
  import { getSpeechEngine as n, subscribeSpeechEngine as r } from "../speech/createSpeechEngine.js";
4
4
  import { chunkForSpeech as i, toSpeakableText as a } from "../voice/speakableText.js";
5
- import { AssistantWorkflowClient as o, isWorkflowAssistantAdmissionRefusal as ee } from "../workflowApi.js";
6
- import { useCallback as te, useEffect as s, useRef as c, useState as l, useSyncExternalStore as ne } from "react";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
+ import { AssistantAiDisclaimer as o } from "./AssistantAiDisclaimer.js";
6
+ import { AssistantWorkflowClient as ee, isWorkflowAssistantAdmissionRefusal as te } from "../workflowApi.js";
7
+ import { useCallback as s, useEffect as c, useRef as l, useState as u, useSyncExternalStore as ne } from "react";
8
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
9
  //#region src/shared/assistant/ui/WorkflowAssistantPanel.tsx
9
- function f(e) {
10
+ function p(e) {
10
11
  let t = e.target.kind === "botmanor" ? e.target.agentId : e.target.courseId;
11
- return /* @__PURE__ */ u(p, { ...e }, `${e.context.workspaceId}:${e.ownerId}:${e.target.kind}:${t}`);
12
+ return /* @__PURE__ */ d(m, { ...e }, `${e.context.workspaceId}:${e.ownerId}:${e.target.kind}:${t}`);
12
13
  }
13
- function p({ target: f, context: p, ownerId: m, title: re, description: h, client: ie, voiceLanguage: ae }) {
14
- let g = t(), _ = re ?? g.title, oe = {
15
- savedPending: g.savedPending,
16
- conversationUnavailable: g.conversationUnavailable,
17
- historyUnavailable: g.historyUnavailable,
18
- olderUnavailable: g.olderUnavailable,
19
- audioUnavailable: g.audioUnavailable,
20
- unknownTurn: g.unknownTurn,
21
- cancelledTurn: g.cancelledTurn,
22
- failedTurn: g.failedTurn,
23
- answerPending: g.answerPending,
24
- admissionRefused: g.admissionRefused,
25
- interrupted: g.interrupted,
26
- cancelUnconfirmed: g.cancelUnconfirmed
27
- }, v = c(ie ?? new o()), y = c(crypto.randomUUID()), se = c({
28
- target: f,
29
- context: p,
30
- ownerId: m
31
- }), b = c(null), [x, S] = l(!0), [C, w] = l(!1), T = c(null), E = c(!1), D = c(!1), [O, k] = l(!1), [A, j] = l([]), [M, N] = l(""), [ce, P] = l(null), [F, I] = l(!1), [L, R] = l(null), [z, B] = l(!1), [V, H] = l(null), [U, W] = l(null), G = te((e) => {
32
- if (P(null), I(!!e?.turns.length), !e) {
33
- y.current = crypto.randomUUID(), j([]), H(null);
14
+ function m({ target: p, context: m, ownerId: h, title: re, description: g, client: ie, voiceLanguage: ae }) {
15
+ let _ = t(), v = re ?? _.title, oe = {
16
+ savedPending: _.savedPending,
17
+ conversationUnavailable: _.conversationUnavailable,
18
+ historyUnavailable: _.historyUnavailable,
19
+ olderUnavailable: _.olderUnavailable,
20
+ audioUnavailable: _.audioUnavailable,
21
+ unknownTurn: _.unknownTurn,
22
+ cancelledTurn: _.cancelledTurn,
23
+ failedTurn: _.failedTurn,
24
+ answerPending: _.answerPending,
25
+ admissionRefused: _.admissionRefused,
26
+ interrupted: _.interrupted,
27
+ cancelUnconfirmed: _.cancelUnconfirmed
28
+ }, y = l(ie ?? new ee()), b = l(crypto.randomUUID()), se = l({
29
+ target: p,
30
+ context: m,
31
+ ownerId: h
32
+ }), x = l(null), [S, C] = u(!0), [w, T] = u(!1), E = l(null), D = l(!1), O = l(!1), [k, A] = u(!1), [j, M] = u([]), [N, P] = u(""), [ce, F] = u(null), [I, L] = u(!1), [R, z] = u(null), [B, V] = u(!1), [H, U] = u(null), [W, G] = u(null), K = s((e) => {
33
+ if (F(null), L(!!e?.turns.length), !e) {
34
+ b.current = crypto.randomUUID(), M([]), U(null);
34
35
  return;
35
36
  }
36
- y.current = e.clientConversationId;
37
+ b.current = e.clientConversationId;
37
38
  let t = e.turns.map((t) => ({
38
39
  input: {
39
40
  clientTurnId: t.receipt.clientTurnId,
@@ -45,77 +46,77 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
45
46
  e.pending && t.push({
46
47
  input: e.pending,
47
48
  receipt: null
48
- }), j(t), H(e.pending), e.pending && W("savedPending");
49
- }, []), K = te(async (e, t, n = null) => {
49
+ }), M(t), U(e.pending), e.pending && G("savedPending");
50
+ }, []), q = s(async (e, t, n = null) => {
50
51
  let r = new AbortController();
51
- b.current?.abort(), b.current = r, S(!0), w(!1), W(null);
52
+ x.current?.abort(), x.current = r, C(!0), T(!1), G(null);
52
53
  try {
53
- let i = await v.current.conversation(e, {
54
+ let i = await y.current.conversation(e, {
54
55
  ...t,
55
56
  signal: r.signal
56
57
  }, n);
57
58
  if (n !== null && i === null) throw Error("Conversation unavailable");
58
- r.signal.aborted || G(i);
59
+ r.signal.aborted || K(i);
59
60
  } catch {
60
- r.signal.aborted || (w(!0), W("conversationUnavailable"));
61
+ r.signal.aborted || (T(!0), G("conversationUnavailable"));
61
62
  } finally {
62
- b.current === r && !r.signal.aborted && S(!1);
63
+ x.current === r && !r.signal.aborted && C(!1);
63
64
  }
64
- }, [G]);
65
- s(() => {
66
- let e = se.current;
67
- return e.context.workspaceId && e.ownerId ? K(e.target, e.context) : S(!1), () => b.current?.abort();
68
65
  }, [K]);
69
- let q = async (e = null) => {
70
- if (E.current || D.current || x || V || $.isActive) return;
66
+ c(() => {
67
+ let e = se.current;
68
+ return e.context.workspaceId && e.ownerId ? q(e.target, e.context) : C(!1), () => x.current?.abort();
69
+ }, [q]);
70
+ let le = async (e = null) => {
71
+ if (D.current || O.current || S || H || $.isActive) return;
71
72
  let t = new AbortController();
72
- b.current?.abort(), b.current = t, S(!0);
73
+ x.current?.abort(), x.current = t, C(!0);
73
74
  try {
74
- let n = await v.current.conversations(f, {
75
- ...p,
75
+ let n = await y.current.conversations(p, {
76
+ ...m,
76
77
  signal: t.signal
77
78
  }, e);
78
- t.signal.aborted || R((t) => ({
79
+ t.signal.aborted || z((t) => ({
79
80
  nodes: e && t ? [...t.nodes, ...n.nodes.filter((e) => !t.nodes.some((t) => t.clientConversationId === e.clientConversationId))].slice(-100) : n.nodes,
80
81
  nextCursor: n.nextCursor
81
82
  }));
82
83
  } catch {
83
- t.signal.aborted || W("historyUnavailable");
84
+ t.signal.aborted || G("historyUnavailable");
84
85
  } finally {
85
- !t.signal.aborted && b.current === t && S(!1);
86
+ !t.signal.aborted && x.current === t && C(!1);
86
87
  }
87
- }, le = async () => {
88
- if (E.current || D.current || x || V || $.isActive || !F || A.length >= 200) return;
88
+ }, ue = async () => {
89
+ if (D.current || O.current || S || H || $.isActive || !I || j.length >= 200) return;
89
90
  let e = new AbortController();
90
- b.current?.abort(), b.current = e;
91
- let t = y.current;
92
- S(!0);
91
+ x.current?.abort(), x.current = e;
92
+ let t = b.current;
93
+ C(!0);
93
94
  try {
94
- let n = await v.current.messages(f, {
95
- ...p,
95
+ let n = await y.current.messages(p, {
96
+ ...m,
96
97
  signal: e.signal
97
98
  }, t, ce);
98
- !e.signal.aborted && t === y.current && (j((e) => [...n.turns.filter((t) => !e.some((e) => e.input.clientTurnId === t.receipt.clientTurnId)).map((e) => ({
99
+ !e.signal.aborted && t === b.current && (M((e) => [...n.turns.filter((t) => !e.some((e) => e.input.clientTurnId === t.receipt.clientTurnId)).map((e) => ({
99
100
  input: {
100
101
  clientTurnId: e.receipt.clientTurnId,
101
102
  clientConversationId: t,
102
103
  message: e.message
103
104
  },
104
105
  receipt: e.receipt
105
- })), ...e]), P(n.nextCursor), I(n.nextCursor !== null));
106
+ })), ...e]), F(n.nextCursor), L(n.nextCursor !== null));
106
107
  } catch {
107
- e.signal.aborted || W("olderUnavailable");
108
+ e.signal.aborted || G("olderUnavailable");
108
109
  } finally {
109
- !e.signal.aborted && b.current === e && S(!1);
110
+ !e.signal.aborted && x.current === e && C(!1);
110
111
  }
111
- }, J = c(null), Y = ne(r, n, n), X = c(!1), Z = c(0), [ue, Q] = l(!1), $ = e({
112
+ }, J = l(null), Y = ne(r, n, n), X = l(!1), Z = l(0), [de, Q] = u(!1), $ = e({
112
113
  language: ae,
113
- onFinalize: (e) => N((t) => `${t}${t.trim() ? " " : ""}${e}`.slice(0, 8192))
114
+ onFinalize: (e) => P((t) => `${t}${t.trim() ? " " : ""}${e}`.slice(0, 8192))
114
115
  });
115
- s(() => () => {
116
+ c(() => () => {
116
117
  X.current && (Z.current += 1, X.current = !1, Y.cancel());
117
118
  }, [Y]);
118
- let de = (e) => {
119
+ let fe = (e) => {
119
120
  if ($.isActive) return;
120
121
  let t = ++Z.current;
121
122
  X.current = !0, Q(!0), Y.speak(i(a(e)), {
@@ -126,63 +127,63 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
126
127
  t === Z.current && (X.current = !1, Q(!1));
127
128
  },
128
129
  onError: (e) => {
129
- t === Z.current && (X.current = !1, Q(!1), e !== "cancelled" && W("audioUnavailable"));
130
+ t === Z.current && (X.current = !1, Q(!1), e !== "cancelled" && G("audioUnavailable"));
130
131
  }
131
132
  });
132
- }, fe = () => {
133
+ }, pe = () => {
133
134
  X.current && Y.cancel(), $.toggle();
134
135
  };
135
- s(() => () => T.current?.abort(), []), s(() => {
136
+ c(() => () => E.current?.abort(), []), c(() => {
136
137
  J.current?.scrollTo({
137
138
  top: J.current.scrollHeight,
138
139
  behavior: "smooth"
139
140
  });
140
- }, [A, z]);
141
- let pe = (e, t) => {
142
- j((n) => n.map((n) => n.input.clientTurnId === e.clientTurnId ? {
141
+ }, [j, B]);
142
+ let me = (e, t) => {
143
+ M((n) => n.map((n) => n.input.clientTurnId === e.clientTurnId ? {
143
144
  ...n,
144
145
  receipt: t
145
146
  } : n));
146
- }, me = async (e, t = !1) => {
147
- if (E.current || D.current || !p.workspaceId || !m) return;
148
- E.current = !0, B(!0), W(null), H(e);
147
+ }, he = async (e, t = !1) => {
148
+ if (D.current || O.current || !m.workspaceId || !h) return;
149
+ D.current = !0, V(!0), G(null), U(e);
149
150
  let n = new AbortController();
150
- T.current = n;
151
+ E.current = n;
151
152
  let r = {
152
- ...p,
153
+ ...m,
153
154
  signal: n.signal
154
155
  }, i = !0;
155
156
  try {
156
- let a = t ? await v.current.read(f, e.clientTurnId, r) : null;
157
- (!a || a.status === "READY") && await v.current.start(f, e, r), i = !1;
158
- let o = await v.current.wait(f, e.clientTurnId, r, { onProgress: (t) => {
159
- n.signal.aborted || pe(e, t);
157
+ let a = t ? await y.current.read(p, e.clientTurnId, r) : null;
158
+ (!a || a.status === "READY") && await y.current.start(p, e, r), i = !1;
159
+ let o = await y.current.wait(p, e.clientTurnId, r, { onProgress: (t) => {
160
+ n.signal.aborted || me(e, t);
160
161
  } });
161
162
  if (n.signal.aborted) return;
162
- o.kind === "completed" ? H(null) : o.kind === "terminal" ? (H(null), W(o.receipt.status === "UNKNOWN" ? "unknownTurn" : o.receipt.status === "CANCELLED" ? "cancelledTurn" : "failedTurn")) : W("answerPending");
163
+ o.kind === "completed" ? U(null) : o.kind === "terminal" ? (U(null), G(o.receipt.status === "UNKNOWN" ? "unknownTurn" : o.receipt.status === "CANCELLED" ? "cancelledTurn" : "failedTurn")) : G("answerPending");
163
164
  } catch (e) {
164
- n.signal.aborted || (i && ee(e) ? (H(null), W("admissionRefused")) : W("interrupted"));
165
+ n.signal.aborted || (i && te(e) ? (U(null), G("admissionRefused")) : G("interrupted"));
165
166
  } finally {
166
- T.current === n && (T.current = null, E.current = !1, B(!1));
167
+ E.current === n && (E.current = null, D.current = !1, V(!1));
167
168
  }
168
- }, he = () => {
169
- if (x || C || !M.trim() || E.current || D.current || $.isActive || V || M.length > 8192) return;
169
+ }, ge = () => {
170
+ if (S || w || !N.trim() || D.current || O.current || $.isActive || H || N.length > 8192) return;
170
171
  X.current && Y.cancel();
171
172
  let e = {
172
173
  clientTurnId: crypto.randomUUID(),
173
- clientConversationId: y.current,
174
- message: M.trim()
174
+ clientConversationId: b.current,
175
+ message: N.trim()
175
176
  };
176
- j((t) => [...t, {
177
+ M((t) => [...t, {
177
178
  input: e,
178
179
  receipt: null
179
- }]), N(""), me(e);
180
- }, ge = async () => {
181
- let e = V;
182
- if (!(!e || D.current)) {
183
- D.current = !0, k(!0), T.current?.abort();
180
+ }]), P(""), he(e);
181
+ }, _e = async () => {
182
+ let e = H;
183
+ if (!(!e || O.current)) {
184
+ O.current = !0, A(!0), E.current?.abort();
184
185
  try {
185
- await v.current.cancel(e.clientTurnId, p) ? (j((t) => t.map((t) => t.input.clientTurnId === e.clientTurnId && t.receipt ? {
186
+ await y.current.cancel(e.clientTurnId, m) ? (M((t) => t.map((t) => t.input.clientTurnId === e.clientTurnId && t.receipt ? {
186
187
  ...t,
187
188
  receipt: {
188
189
  ...t.receipt,
@@ -190,147 +191,147 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
190
191
  partialMessage: null,
191
192
  result: null
192
193
  }
193
- } : t)), H(null), W("cancelledTurn")) : W("cancelUnconfirmed");
194
+ } : t)), U(null), G("cancelledTurn")) : G("cancelUnconfirmed");
194
195
  } catch {
195
- W("cancelUnconfirmed");
196
+ G("cancelUnconfirmed");
196
197
  } finally {
197
- D.current = !1, k(!1);
198
+ O.current = !1, A(!1);
198
199
  }
199
200
  }
200
201
  };
201
- return /* @__PURE__ */ d("section", {
202
- "aria-label": _,
202
+ return /* @__PURE__ */ f("section", {
203
+ "aria-label": v,
203
204
  className: "flex flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface",
204
205
  children: [
205
- /* @__PURE__ */ d("header", {
206
+ /* @__PURE__ */ f("header", {
206
207
  className: "border-b border-border-seam px-4 py-3",
207
208
  children: [
208
- /* @__PURE__ */ u("h2", {
209
+ /* @__PURE__ */ d("h2", {
209
210
  className: "text-sm font-semibold text-text-primary",
210
- children: _
211
+ children: v
211
212
  }),
212
- h && /* @__PURE__ */ u("p", {
213
+ g && /* @__PURE__ */ d("p", {
213
214
  className: "text-xs text-text-secondary",
214
- children: h
215
+ children: g
215
216
  }),
216
- /* @__PURE__ */ d("div", {
217
+ /* @__PURE__ */ f("div", {
217
218
  className: "mt-2 flex flex-wrap gap-2",
218
- children: [/* @__PURE__ */ u("button", {
219
+ children: [/* @__PURE__ */ d("button", {
219
220
  type: "button",
220
- disabled: x || z || O || !!V || $.isActive || !p.workspaceId || !m,
221
+ disabled: S || B || k || !!H || $.isActive || !m.workspaceId || !h,
221
222
  onClick: () => {
222
- b.current?.abort(), X.current && Y.cancel(), G(null), N(""), W(null), w(!1), R(null);
223
+ x.current?.abort(), X.current && Y.cancel(), K(null), P(""), G(null), T(!1), z(null);
223
224
  },
224
225
  className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
225
- children: g.newChat
226
- }), /* @__PURE__ */ u("button", {
226
+ children: _.newChat
227
+ }), /* @__PURE__ */ d("button", {
227
228
  type: "button",
228
- disabled: x || z || O || !!V || $.isActive || !p.workspaceId || !m,
229
- onClick: () => void q(),
229
+ disabled: S || B || k || !!H || $.isActive || !m.workspaceId || !h,
230
+ onClick: () => void le(),
230
231
  className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
231
- children: g.savedConversations
232
+ children: _.savedConversations
232
233
  })]
233
234
  }),
234
- L && /* @__PURE__ */ d("nav", {
235
- "aria-label": g.savedAssistantConversations,
235
+ R && /* @__PURE__ */ f("nav", {
236
+ "aria-label": _.savedAssistantConversations,
236
237
  className: "mt-2 max-h-40 overflow-auto",
237
238
  children: [
238
- /* @__PURE__ */ u("ul", { children: L.nodes.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
239
+ /* @__PURE__ */ d("ul", { children: R.nodes.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d("button", {
239
240
  type: "button",
240
- disabled: x || z || O || !!V || $.isActive,
241
- "aria-current": e.clientConversationId === y.current ? "true" : void 0,
241
+ disabled: S || B || k || !!H || $.isActive,
242
+ "aria-current": e.clientConversationId === b.current ? "true" : void 0,
242
243
  onClick: () => {
243
- X.current && Y.cancel(), N(""), K(f, p, e.clientConversationId);
244
+ X.current && Y.cancel(), P(""), q(p, m, e.clientConversationId);
244
245
  },
245
246
  className: "rounded-lg px-2 py-1 text-xs",
246
247
  children: new Date(e.createdAt).toLocaleString()
247
248
  }) }, e.clientConversationId)) }),
248
- L.nodes.length === 0 && /* @__PURE__ */ u("p", {
249
+ R.nodes.length === 0 && /* @__PURE__ */ d("p", {
249
250
  className: "text-xs",
250
- children: g.noSavedConversations
251
+ children: _.noSavedConversations
251
252
  }),
252
- L.nextCursor && /* @__PURE__ */ u("button", {
253
+ R.nextCursor && /* @__PURE__ */ d("button", {
253
254
  type: "button",
254
- disabled: x || z || O || !!V || $.isActive,
255
- onClick: () => void q(L.nextCursor),
255
+ disabled: S || B || k || !!H || $.isActive,
256
+ onClick: () => void le(R.nextCursor),
256
257
  className: "rounded-lg border border-border-seam px-2 py-1 text-xs",
257
- children: g.loadOlderConversations
258
+ children: _.loadOlderConversations
258
259
  })
259
260
  ]
260
261
  })
261
262
  ]
262
263
  }),
263
- /* @__PURE__ */ d("div", {
264
+ /* @__PURE__ */ f("div", {
264
265
  ref: J,
265
266
  role: "log",
266
- "aria-label": g.assistantConversation,
267
+ "aria-label": _.assistantConversation,
267
268
  "aria-live": "polite",
268
269
  className: "max-h-96 min-h-40 overflow-y-auto p-4",
269
270
  children: [
270
- x && /* @__PURE__ */ u("p", {
271
+ S && /* @__PURE__ */ d("p", {
271
272
  role: "status",
272
273
  className: "text-sm text-text-secondary",
273
- children: g.loadingYourConversation
274
+ children: _.loadingYourConversation
274
275
  }),
275
- !x && A.length === 0 && /* @__PURE__ */ u("p", {
276
+ !S && j.length === 0 && /* @__PURE__ */ d("p", {
276
277
  className: "text-sm text-text-secondary",
277
- children: g.emptyHint
278
+ children: _.emptyHint
278
279
  }),
279
- F && A.length < 200 && /* @__PURE__ */ u("button", {
280
+ I && j.length < 200 && /* @__PURE__ */ d("button", {
280
281
  type: "button",
281
- onClick: () => void le(),
282
- disabled: x || z || O || !!V || $.isActive,
282
+ onClick: () => void ue(),
283
+ disabled: S || B || k || !!H || $.isActive,
283
284
  className: "mb-4 text-sm underline",
284
- children: g.loadOlderMessages
285
+ children: _.loadOlderMessages
285
286
  }),
286
- /* @__PURE__ */ u("ol", {
287
+ /* @__PURE__ */ d("ol", {
287
288
  className: "space-y-4",
288
- children: A.map((e) => /* @__PURE__ */ d("li", { children: [
289
- /* @__PURE__ */ u("p", {
289
+ children: j.map((e) => /* @__PURE__ */ f("li", { children: [
290
+ /* @__PURE__ */ d("p", {
290
291
  className: "text-xs font-semibold text-text-primary",
291
- children: g.you
292
+ children: _.you
292
293
  }),
293
- /* @__PURE__ */ u("p", {
294
+ /* @__PURE__ */ d("p", {
294
295
  className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
295
296
  children: e.input.message
296
297
  }),
297
- e.receipt?.status === "RUNNING" && e.receipt.partialMessage && /* @__PURE__ */ d("div", {
298
+ e.receipt?.status === "RUNNING" && e.receipt.partialMessage && /* @__PURE__ */ f("div", {
298
299
  className: "mt-3",
299
- children: [/* @__PURE__ */ u("p", {
300
+ children: [/* @__PURE__ */ d("p", {
300
301
  className: "text-xs text-text-secondary",
301
- children: g.generatingAnswer
302
- }), /* @__PURE__ */ u("p", {
302
+ children: _.generatingAnswer
303
+ }), /* @__PURE__ */ d("p", {
303
304
  className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
304
305
  children: e.receipt.partialMessage
305
306
  })]
306
307
  }),
307
- e.receipt?.status === "COMPLETED" && e.receipt.result && /* @__PURE__ */ d("div", {
308
+ e.receipt?.status === "COMPLETED" && e.receipt.result && /* @__PURE__ */ f("div", {
308
309
  className: "mt-3",
309
310
  children: [
310
- /* @__PURE__ */ u("p", {
311
+ /* @__PURE__ */ d("p", {
311
312
  className: "text-xs font-semibold text-text-primary",
312
- children: _
313
+ children: v
313
314
  }),
314
- /* @__PURE__ */ u("p", {
315
+ /* @__PURE__ */ d("p", {
315
316
  className: "whitespace-pre-wrap break-words text-sm text-text-secondary",
316
317
  children: e.receipt.result.message
317
318
  }),
318
- Y.isSupported() && /* @__PURE__ */ u("button", {
319
+ Y.isSupported() && /* @__PURE__ */ d("button", {
319
320
  type: "button",
320
321
  onClick: () => {
321
322
  let t = e.receipt?.result;
322
- t && de(t.message);
323
+ t && fe(t.message);
323
324
  },
324
325
  disabled: $.isActive,
325
326
  className: "mt-2 rounded-lg border border-border-seam px-2 py-1 text-xs",
326
- children: g.readAnswerAloud
327
+ children: _.readAnswerAloud
327
328
  }),
328
- e.receipt.result.sources.length > 0 && /* @__PURE__ */ u("ul", {
329
- "aria-label": g.answerSources,
329
+ e.receipt.result.sources.length > 0 && /* @__PURE__ */ d("ul", {
330
+ "aria-label": _.answerSources,
330
331
  className: "mt-2 space-y-1 text-xs text-text-secondary",
331
- children: e.receipt.result.sources.map((e) => /* @__PURE__ */ u("li", {
332
+ children: e.receipt.result.sources.map((e) => /* @__PURE__ */ d("li", {
332
333
  title: e.documentId,
333
- children: g.sourceReference({
334
+ children: _.sourceReference({
334
335
  reference: e.reference,
335
336
  documentId: e.documentId
336
337
  })
@@ -340,98 +341,99 @@ function p({ target: f, context: p, ownerId: m, title: re, description: h, clien
340
341
  })
341
342
  ] }, e.input.clientTurnId))
342
343
  }),
343
- z && /* @__PURE__ */ u("p", {
344
+ B && /* @__PURE__ */ d("p", {
344
345
  role: "status",
345
346
  className: "mt-3 text-sm text-text-secondary",
346
- children: g.preparingYourAnswer
347
+ children: _.preparingYourAnswer
347
348
  })
348
349
  ]
349
350
  }),
350
- /* @__PURE__ */ d("div", {
351
+ /* @__PURE__ */ f("div", {
351
352
  className: "border-t border-border-seam p-3",
352
353
  children: [
353
- $.interim && /* @__PURE__ */ u("p", {
354
+ $.interim && /* @__PURE__ */ d("p", {
354
355
  role: "status",
355
356
  className: "mb-2 text-sm text-text-secondary",
356
357
  children: $.interim
357
358
  }),
358
- $.error && /* @__PURE__ */ u("p", {
359
+ $.error && /* @__PURE__ */ d("p", {
359
360
  role: "status",
360
361
  className: "mb-2 text-sm text-text-secondary",
361
- children: g.dictationUnavailable
362
+ children: _.dictationUnavailable
362
363
  }),
363
- U && /* @__PURE__ */ u("p", {
364
+ W && /* @__PURE__ */ d("p", {
364
365
  role: "status",
365
366
  className: "mb-2 text-sm text-text-secondary",
366
- children: oe[U]
367
+ children: oe[W]
367
368
  }),
368
- /* @__PURE__ */ u("label", {
369
+ /* @__PURE__ */ d("label", {
369
370
  className: "sr-only",
370
- htmlFor: `assistant-question-${y.current}`,
371
- children: g.question
371
+ htmlFor: `assistant-question-${b.current}`,
372
+ children: _.question
372
373
  }),
373
- /* @__PURE__ */ u("textarea", {
374
- id: `assistant-question-${y.current}`,
375
- value: M,
376
- onChange: (e) => N(e.target.value),
374
+ /* @__PURE__ */ d("textarea", {
375
+ id: `assistant-question-${b.current}`,
376
+ value: N,
377
+ onChange: (e) => P(e.target.value),
377
378
  onKeyDown: (e) => {
378
- e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), he());
379
+ e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), ge());
379
380
  },
380
381
  maxLength: 8192,
381
382
  rows: 2,
382
- placeholder: g.askAQuestion,
383
- disabled: x || C || z || O || !!V || !p.workspaceId || !m,
383
+ placeholder: _.askAQuestion,
384
+ disabled: S || w || B || k || !!H || !m.workspaceId || !h,
384
385
  className: "w-full rounded-lg border border-border-seam bg-bg-sunken p-2 text-sm text-text-primary"
385
386
  }),
386
- /* @__PURE__ */ d("div", {
387
+ /* @__PURE__ */ f("div", {
387
388
  className: "mt-2 flex flex-wrap justify-end gap-2",
388
389
  children: [
389
- $.isSupported && /* @__PURE__ */ u("button", {
390
+ $.isSupported && /* @__PURE__ */ d("button", {
390
391
  type: "button",
391
- onClick: fe,
392
- disabled: x || C || z || O || !!V,
392
+ onClick: pe,
393
+ disabled: S || w || B || k || !!H,
393
394
  "aria-pressed": $.isActive,
394
395
  className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
395
- children: $.isActive ? g.stopDictation : g.dictateQuestion
396
+ children: $.isActive ? _.stopDictation : _.dictateQuestion
396
397
  }),
397
- ue && /* @__PURE__ */ u("button", {
398
+ de && /* @__PURE__ */ d("button", {
398
399
  type: "button",
399
400
  onClick: () => Y.cancel(),
400
401
  className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
401
- children: g.stopAudio
402
+ children: _.stopAudio
402
403
  }),
403
- C && !x && /* @__PURE__ */ u("button", {
404
+ w && !S && /* @__PURE__ */ d("button", {
404
405
  type: "button",
405
- onClick: () => void K(f, p),
406
+ onClick: () => void q(p, m),
406
407
  className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
407
- children: g.reloadConversation
408
+ children: _.reloadConversation
408
409
  }),
409
- V && !z && !O && /* @__PURE__ */ u("button", {
410
+ H && !B && !k && /* @__PURE__ */ d("button", {
410
411
  type: "button",
411
- onClick: () => void me(V, !0),
412
+ onClick: () => void he(H, !0),
412
413
  className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
413
- children: g.recoverTurn
414
+ children: _.recoverTurn
414
415
  }),
415
- V && /* @__PURE__ */ u("button", {
416
+ H && /* @__PURE__ */ d("button", {
416
417
  type: "button",
417
- onClick: () => void ge(),
418
- disabled: O,
418
+ onClick: () => void _e(),
419
+ disabled: k,
419
420
  className: "rounded-lg border border-border-seam px-3 py-2 text-sm",
420
- children: g.cancelTurn
421
+ children: _.cancelTurn
421
422
  }),
422
- /* @__PURE__ */ u("button", {
423
+ /* @__PURE__ */ d("button", {
423
424
  type: "button",
424
- onClick: he,
425
- disabled: !M.trim() || $.isActive || O || x || C || z || !!V || !p.workspaceId || !m,
425
+ onClick: ge,
426
+ disabled: !N.trim() || $.isActive || k || S || w || B || !!H || !m.workspaceId || !h,
426
427
  className: "rounded-lg bg-[var(--color-accent-soft)] px-3 py-2 text-sm disabled:opacity-50",
427
- children: g.ask
428
+ children: _.ask
428
429
  })
429
430
  ]
430
- })
431
+ }),
432
+ /* @__PURE__ */ d(o, { className: "mt-2" })
431
433
  ]
432
434
  })
433
435
  ]
434
436
  });
435
437
  }
436
438
  //#endregion
437
- export { f as WorkflowAssistantPanel };
439
+ export { p as WorkflowAssistantPanel };