@burdenoff/fe-libs 2026.1115.8 → 2026.1115.9

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.
@@ -100,186 +100,187 @@ import { buildContinuedFromVoiceNote as rr, buildVoiceTranscriptMarkdown as ir,
100
100
  import { downloadFile as or } from "../exportConversation.js";
101
101
  import { chatTurns as sr, isVoiceTurn as cr, voiceMarker as lr, voiceSessionIdOf as ur } from "../voice/turnVisibility.js";
102
102
  import { VoiceChatEnded as dr, VoiceTurnTag as fr } from "./voice/VoiceTurnMarks.js";
103
- import { isAwaitingOwnConversation as pr, maySendSpokenTurn as mr, planTranscriptAutoOpen as hr, planVoiceSessionBinding as gr, planVoiceSessionStart as _r, planVoiceSpokenEntry as vr, voiceBindingAtStart as yr, voiceBindingConversationId as br } from "../voice/voiceReopen.js";
104
- import { transcriptAutoOpenSlot as xr } from "./transcriptAutoOpenSlot.js";
105
- import { toVoiceReply as Sr } from "../voice/voiceReply.js";
106
- import { beginApprovalInFlight as Cr, endApprovalInFlight as wr, getApprovalInFlight as Tr, markLiveTurn as Er, newestModelReplyId as Dr, resolveApprovablePendingWrite as Or, resolveRetryableMessageId as kr, subscribeApprovalInFlight as Ar } from "../liveTurns.js";
107
- import { createReadinessTracker as jr, planAfterTransportFailure as Mr, planTrustedSandboxFailure as Nr } from "../sandboxReadiness.js";
108
- import { couldBeLocalUiCommand as Pr, isAlreadyThere as Fr, matchLocalUiCommand as Ir, mayBeNavigationFollowUp as Lr, navDestinations as Rr, planThemeChange as zr } from "../localUiCommands.js";
109
- import { backDoneCopy as Br, chooseDestinationCopy as Vr, chooseLinkedCopy as Hr, entityNounText as Ur, linkNotOpenableCopy as Wr, navigationCommandCopy as Gr, navigationOutcomeCopy as Kr, offerExpiredCopy as qr, offerKeptForUnsavedCopy as Jr, offerNotAvailableCopy as Yr, pickFromListCopy as Xr, recordChoiceCopy as Zr, recordKindsCopy as Qr, themeCommandCopy as $r } from "../localUiCommandCopy.js";
110
- import { offerAssentFor as ei } from "../localeCommands/assent.js";
111
- import { appControlCopy as ti } from "../appControls/copy.js";
112
- import { LANGUAGE_REPLY_DEADLINE_MS as ni, languageConfirmationCopy as ri, languageReplyStep as ii } from "../appControls/languageReply.js";
113
- import { planAppControl as ai } from "../appControls/plan.js";
114
- import { readControlSnapshot as oi } from "../appControls/snapshot.js";
115
- import { subscribeAssistantControls as si } from "../appControls/registry.js";
116
- import { useAssistantControl as ci } from "../appControls/useAssistantControl.js";
117
- import { useControlConfirmDialog as li } from "./controlConfirmDialog.js";
118
- import { useLeaveConfirmAsking as ui } from "./leaveConfirm.js";
119
- import { startFocusReturnAfterKeep as di } from "./leaveConfirmFocus.js";
120
- import { buildNavigationContext as fi, latestReplyOnSurface as pi, rememberPresentedList as mi } from "../uiActions/linkContext.js";
121
- import { lookupNamedRecords as hi } from "../uiActions/recordNames.js";
122
- import { navEntryIds as gi } from "../uiActions/resolveTarget.js";
123
- import { buildUiCatalogue as _i, markUiCatalogueSent as vi, uiCatalogueSent as yi, uiCatalogueSessionKey as bi } from "../uiActions/uiCatalogue.js";
124
- import { offerYesOnSurface as xi } from "../uiActions/offerYesOnSurface.js";
125
- import { UiOfferSession as Si, sandboxServesUiOffers as Ci, uiOfferHintKind as wi, uiOfferInTime as Ti } from "../uiActions/uiOffers.js";
126
- import { parseNavIntent as Ei } from "../uiActions/navIntent.js";
127
- import { decideActOnResolve as Di, n4LeaveGuard as Oi } from "../uiActions/actOnResolve.js";
128
- import { AssistantUiOfferLinks as ki } from "./AssistantUiOfferLink.js";
129
- import { assistantBackStack as Ai, isBackRunnable as ji } from "../uiActions/backStack.js";
130
- import { subscribeDraftPathname as Mi } from "../uiActions/draftPathname.js";
131
- import { buildNavigateAction as Ni, destinationForPath as Pi, labelForPath as Fi, newestAssistantOnSurface as Ii } from "../uiActions/navigateAction.js";
132
- import { runNavigation as Li } from "../uiActions/navigationOutcome.js";
133
- import { assistantHistory as Ri } from "../history/historyEngine.js";
134
- import { conversationHasHistory as zi, isOtherScopeHistoryConversation as Bi, isReadOnlyHistoryConversation as Vi, isReusableHistoryDraft as Hi } from "../history/historyList.js";
135
- import { resumeContextFor as Ui } from "../history/historyResume.js";
136
- import { useAssistantHistoryStatus as Wi } from "../history/historyStatus.js";
137
- import { useHistoryRowControlsFor as Gi } from "../history/useHistoryRowControls.js";
138
- import { getHistoryStamp as Ki, setHistoryBusyProbe as qi } from "../history/stampRegistry.js";
139
- import { resolveConversationDeleteTarget as Ji } from "../conversationDeleteCommand.js";
140
- import { useAssistantNavigate as Yi } from "./AssistantMarkdownRenderer.js";
141
- import { useAssistantSpeech as Xi } from "./AssistantSpeechProvider.js";
142
- import { useAssistantStopTurnLabel as Zi } from "../../providers/shell/useAssistantShellLabels.js";
143
- import { useThemeOrNull as Qi } from "../../providers/shell/ThemeProvider.js";
144
- import { useVisibleNavItems as $i } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
145
- import { useAskAboutStore as ea } from "../askAbout/askAboutStore.js";
146
- import { readMessageFocus as ta, withFocusNote as na } from "../askAbout/focus.js";
147
- import { useCallback as D, useEffect as O, useLayoutEffect as ra, useMemo as k, useRef as A, useState as j, useSyncExternalStore as ia } from "react";
148
- import { Fragment as aa, jsx as M, jsxs as oa } from "react/jsx-runtime";
103
+ import { revealSpokenMarkdown as pr } from "../voice/revealSpoken.js";
104
+ import { isAwaitingOwnConversation as mr, maySendSpokenTurn as hr, planTranscriptAutoOpen as gr, planVoiceSessionBinding as _r, planVoiceSessionStart as vr, planVoiceSpokenEntry as yr, voiceBindingAtStart as br, voiceBindingConversationId as xr } from "../voice/voiceReopen.js";
105
+ import { transcriptAutoOpenSlot as Sr } from "./transcriptAutoOpenSlot.js";
106
+ import { toVoiceReply as Cr } from "../voice/voiceReply.js";
107
+ import { beginApprovalInFlight as wr, endApprovalInFlight as Tr, getApprovalInFlight as Er, markLiveTurn as Dr, newestModelReplyId as Or, resolveApprovablePendingWrite as kr, resolveRetryableMessageId as Ar, subscribeApprovalInFlight as jr } from "../liveTurns.js";
108
+ import { createReadinessTracker as Mr, planAfterTransportFailure as Nr, planTrustedSandboxFailure as Pr } from "../sandboxReadiness.js";
109
+ import { couldBeLocalUiCommand as Fr, isAlreadyThere as Ir, matchLocalUiCommand as Lr, mayBeNavigationFollowUp as Rr, navDestinations as zr, planThemeChange as Br } from "../localUiCommands.js";
110
+ import { backDoneCopy as Vr, chooseDestinationCopy as Hr, chooseLinkedCopy as Ur, entityNounText as Wr, linkNotOpenableCopy as Gr, navigationCommandCopy as Kr, navigationOutcomeCopy as qr, offerExpiredCopy as Jr, offerKeptForUnsavedCopy as Yr, offerNotAvailableCopy as Xr, pickFromListCopy as Zr, recordChoiceCopy as Qr, recordKindsCopy as $r, themeCommandCopy as ei } from "../localUiCommandCopy.js";
111
+ import { offerAssentFor as ti } from "../localeCommands/assent.js";
112
+ import { appControlCopy as ni } from "../appControls/copy.js";
113
+ import { LANGUAGE_REPLY_DEADLINE_MS as ri, languageConfirmationCopy as ii, languageReplyStep as ai } from "../appControls/languageReply.js";
114
+ import { planAppControl as oi } from "../appControls/plan.js";
115
+ import { readControlSnapshot as si } from "../appControls/snapshot.js";
116
+ import { subscribeAssistantControls as ci } from "../appControls/registry.js";
117
+ import { useAssistantControl as li } from "../appControls/useAssistantControl.js";
118
+ import { useControlConfirmDialog as ui } from "./controlConfirmDialog.js";
119
+ import { useLeaveConfirmAsking as di } from "./leaveConfirm.js";
120
+ import { startFocusReturnAfterKeep as fi } from "./leaveConfirmFocus.js";
121
+ import { buildNavigationContext as pi, latestReplyOnSurface as mi, rememberPresentedList as hi } from "../uiActions/linkContext.js";
122
+ import { lookupNamedRecords as gi } from "../uiActions/recordNames.js";
123
+ import { navEntryIds as _i } from "../uiActions/resolveTarget.js";
124
+ import { buildUiCatalogue as vi, markUiCatalogueSent as yi, uiCatalogueSent as bi, uiCatalogueSessionKey as xi } from "../uiActions/uiCatalogue.js";
125
+ import { offerYesOnSurface as Si } from "../uiActions/offerYesOnSurface.js";
126
+ import { UiOfferSession as Ci, sandboxServesUiOffers as wi, uiOfferHintKind as Ti, uiOfferInTime as Ei } from "../uiActions/uiOffers.js";
127
+ import { parseNavIntent as Di } from "../uiActions/navIntent.js";
128
+ import { decideActOnResolve as Oi, n4LeaveGuard as ki } from "../uiActions/actOnResolve.js";
129
+ import { AssistantUiOfferLinks as Ai } from "./AssistantUiOfferLink.js";
130
+ import { assistantBackStack as ji, isBackRunnable as Mi } from "../uiActions/backStack.js";
131
+ import { subscribeDraftPathname as Ni } from "../uiActions/draftPathname.js";
132
+ import { buildNavigateAction as Pi, destinationForPath as Fi, labelForPath as Ii, newestAssistantOnSurface as Li } from "../uiActions/navigateAction.js";
133
+ import { runNavigation as Ri } from "../uiActions/navigationOutcome.js";
134
+ import { assistantHistory as zi } from "../history/historyEngine.js";
135
+ import { conversationHasHistory as Bi, isOtherScopeHistoryConversation as Vi, isReadOnlyHistoryConversation as Hi, isReusableHistoryDraft as Ui } from "../history/historyList.js";
136
+ import { resumeContextFor as Wi } from "../history/historyResume.js";
137
+ import { useAssistantHistoryStatus as Gi } from "../history/historyStatus.js";
138
+ import { useHistoryRowControlsFor as Ki } from "../history/useHistoryRowControls.js";
139
+ import { getHistoryStamp as qi, setHistoryBusyProbe as Ji } from "../history/stampRegistry.js";
140
+ import { resolveConversationDeleteTarget as Yi } from "../conversationDeleteCommand.js";
141
+ import { useAssistantNavigate as Xi } from "./AssistantMarkdownRenderer.js";
142
+ import { useAssistantSpeech as Zi } from "./AssistantSpeechProvider.js";
143
+ import { useAssistantStopTurnLabel as Qi } from "../../providers/shell/useAssistantShellLabels.js";
144
+ import { useThemeOrNull as $i } from "../../providers/shell/ThemeProvider.js";
145
+ import { useVisibleNavItems as ea } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
146
+ import { useAskAboutStore as ta } from "../askAbout/askAboutStore.js";
147
+ import { readMessageFocus as na, withFocusNote as ra } from "../askAbout/focus.js";
148
+ import { useCallback as D, useEffect as O, useLayoutEffect as ia, useMemo as k, useRef as A, useState as j, useSyncExternalStore as aa } from "react";
149
+ import { Fragment as oa, jsx as M, jsxs as sa } from "react/jsx-runtime";
149
150
  // src/shared/assistant/ui/AssistantChatArea.tsx
150
- var sa = 2500, ca = 300, la = 2e4, ua = 1e4, da = 1e4, fa = !1, pa = {
151
+ var ca = 2500, la = 300, ua = 2e4, da = 1e4, fa = 1e4, pa = !1, ma = {
151
152
  committing: !1,
152
153
  dictating: !1
153
- }, ma = 6e3;
154
+ }, ha = 6e3;
154
155
  function N() {
155
156
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
156
157
  }
157
- var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ visible: va = !0, writeAccess: ya = "unknown", presentation: ba = "classic", inputRef: xa, onDraftDirtyChange: Sa, surface: Ca, onWindowVoiceChange: wa, onOpenFull: Ta, onContinuedInChat: Ea }) => {
158
- let P = jn(), Da = Zi(), F = ba === "compact", I = ze(), Oa = Ve(), ka = D((e) => Be("above", e), []), Aa = D((e) => Be("below", e), []), ja = F && Ca === "window", { product: L, modes: R, gatherPageContext: Ma, buildPrompt: Na, reportTurnTimings: Pa, reportTokenUsage: Fa, localUiCommands: Ia } = Nn(), z = Ct(Nn().writeApproval), La = D((e, t) => {
158
+ var ga = () => () => {}, _a = () => "off", va = { overflowY: "auto" }, ya = ({ visible: ya = !0, writeAccess: ba = "unknown", presentation: xa = "classic", inputRef: Sa, onDraftDirtyChange: Ca, surface: wa, onWindowVoiceChange: Ta, onOpenFull: Ea, onContinuedInChat: Da }) => {
159
+ let P = jn(), Oa = Qi(), F = xa === "compact", I = ze(), ka = Ve(), Aa = D((e) => Be("above", e), []), ja = D((e) => Be("below", e), []), Ma = F && wa === "window", { product: L, modes: R, gatherPageContext: Na, buildPrompt: Pa, reportTurnTimings: Fa, reportTokenUsage: Ia, localUiCommands: La } = Nn(), z = Ct(Nn().writeApproval), Ra = D((e, t) => {
159
160
  let n = w.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
160
161
  return g({
161
162
  mode: e,
162
163
  productWriteApproval: z,
163
164
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
164
165
  });
165
- }, [z]), { getAccessToken: Ra, getWorkspaceToken: za, userId: B } = r(), { locale: V, isLocaleLoading: Ba } = n(), Va = w((e) => e.voiceGraceMs), Ha = w((e) => e.handsFreeInterrupt), Ua = w((e) => e.handsFreeStreamNoticeAccepted), Wa = w((e) => e.acceptHandsFreeStreamNotice), Ga = w((e) => e.assistantLanguage), Ka = w((e) => e.replyLanguage), qa = k(() => s(Ga, Ka, V), [
166
- Ga,
166
+ }, [z]), { getAccessToken: za, getWorkspaceToken: Ba, userId: B } = r(), { locale: V, isLocaleLoading: Va } = n(), Ha = w((e) => e.voiceGraceMs), Ua = w((e) => e.handsFreeInterrupt), Wa = w((e) => e.handsFreeStreamNoticeAccepted), Ga = w((e) => e.acceptHandsFreeStreamNotice), Ka = w((e) => e.assistantLanguage), qa = w((e) => e.replyLanguage), Ja = k(() => s(Ka, qa, V), [
167
167
  Ka,
168
+ qa,
168
169
  V
169
- ]), Ja = qa.reply.english, Ya = qa.replyIsExplicit, Xa = qa.reply.code, { conversations: Za, activeConversationId: H, mode: U, processingByConversationId: Qa, setMode: $a, setConversationMode: eo, setActiveConversation: to, createConversation: no, addMessage: W, updateMessage: ro, patchMessage: io, mergeMessageMetadata: ao, setConversationProcessing: oo, clearConversationProcessing: so, setBackendSessionId: co, clearBackendSessionId: lo, setSandbox: uo, clearSandbox: fo, acknowledgedWriteModes: po, acknowledgeWriteMode: mo, autoRouting: ho, setAutoRouting: go, routeConversation: _o } = w(), G = Za.find((e) => e.id === H), vo = at(G), yo = vo.all, bo = H ? Qa[H] : void 0, xo = On(bo?.status), So = xo ? bo?.messageId ?? null : null, Co = bo?.status === "error" ? bo.messageId : null, wo = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: To, retiredSandboxes: Eo } = ee({
170
+ ]), Ya = Ja.reply.english, Xa = Ja.replyIsExplicit, Za = Ja.reply.code, { conversations: Qa, activeConversationId: H, mode: U, processingByConversationId: $a, setMode: eo, setConversationMode: to, setActiveConversation: no, createConversation: ro, addMessage: W, updateMessage: io, patchMessage: ao, mergeMessageMetadata: oo, setConversationProcessing: so, clearConversationProcessing: co, setBackendSessionId: lo, clearBackendSessionId: uo, setSandbox: fo, clearSandbox: po, acknowledgedWriteModes: mo, acknowledgeWriteMode: ho, autoRouting: go, setAutoRouting: _o, routeConversation: vo } = w(), G = Qa.find((e) => e.id === H), yo = at(G), bo = yo.all, xo = H ? $a[H] : void 0, So = On(xo?.status), Co = So ? xo?.messageId ?? null : null, wo = xo?.status === "error" ? xo.messageId : null, To = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: Eo, retiredSandboxes: Do } = ee({
170
171
  tr: P,
171
172
  productWriteApproval: z
172
- }), Do = p({
173
+ }), Oo = p({
173
174
  approve: (e, t) => K.approve(e, t),
174
175
  decline: (e, t, n) => K.decline(e, t, n),
175
176
  presented: (e, t) => K.presented(e, t)
176
- }), Oo = Do.dismiss, ko = A(null);
177
+ }), ko = Oo.dismiss, Ao = A(null);
177
178
  O(() => {
178
- Oo();
179
- let e = ko.current;
180
- ko.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
179
+ ko();
180
+ let e = Ao.current;
181
+ Ao.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
181
182
  }, [
182
183
  H,
183
184
  K,
184
- Oo
185
+ ko
185
186
  ]);
186
- let Ao = Vi(G), jo = Gi(G)?.archivedAt != null, Mo = Wi((e) => H !== null && H in e.loadingIds), No = Wi((e) => H !== null && H in e.loadErrorIds), Po = Wi((e) => e.remoteDelete), [Fo, Io] = j(() => Wi.getState().remoteDelete?.at ?? null), Lo = Po?.wasActive === !0 && Po.at !== Fo ? Po.at : null;
187
+ let jo = Hi(G), Mo = Ki(G)?.archivedAt != null, No = Gi((e) => H !== null && H in e.loadingIds), Po = Gi((e) => H !== null && H in e.loadErrorIds), Fo = Gi((e) => e.remoteDelete), [Io, Lo] = j(() => Gi.getState().remoteDelete?.at ?? null), Ro = Fo?.wasActive === !0 && Fo.at !== Io ? Fo.at : null;
187
188
  O(() => {
188
- if (Lo === null) return;
189
- let e = window.setTimeout(() => Io(Lo), da);
189
+ if (Ro === null) return;
190
+ let e = window.setTimeout(() => Lo(Ro), fa);
190
191
  return () => window.clearTimeout(e);
191
- }, [Lo]);
192
- let Ro = T(), { canUseApiCalls: zo, loading: Bo } = Qe(Ro, B), Vo = A(Xn({
193
- loading: Bo,
194
- canUseAdminModes: zo
195
- })).current, Ho = A(R);
192
+ }, [Ro]);
193
+ let zo = T(), { canUseApiCalls: Bo, loading: Vo } = Qe(zo, B), Ho = A(Xn({
194
+ loading: Vo,
195
+ canUseAdminModes: Bo
196
+ })).current, Uo = A(R);
196
197
  O(() => {
197
- Ho.current = R;
198
+ Uo.current = R;
198
199
  }, [R]);
199
- let Uo = () => {
200
+ let Wo = () => {
200
201
  let e = w.getState().activeConversationId;
201
- e && Ri.openConversation(e, { modes: Ho.current });
202
- }, Wo = () => {
202
+ e && zi.openConversation(e, { modes: Uo.current });
203
+ }, Go = () => {
203
204
  let e = w.getState().activeConversationId;
204
- e && Ri.loadEarlier(e);
205
- }, Go = A(Ra);
205
+ e && zi.loadEarlier(e);
206
+ }, Ko = A(za);
206
207
  O(() => {
207
- Go.current = Ra;
208
- }, [Ra]);
209
- let Ko = !!L && Pa !== !1;
208
+ Ko.current = za;
209
+ }, [za]);
210
+ let qo = !!L && Fa !== !1;
210
211
  O(() => {
211
- if (Ko) return pn({ send: (e) => fn(e, {
212
+ if (qo) return pn({ send: (e) => fn(e, {
212
213
  workspaceId: T(),
213
214
  authContext: {
214
- accessToken: Go.current(),
215
+ accessToken: Ko.current(),
215
216
  organizationId: Vt()
216
217
  }
217
218
  }) });
218
- }, [Ko]), O(() => {
219
- Vo.update({
220
- loading: Bo,
221
- canUseAdminModes: zo
219
+ }, [qo]), O(() => {
220
+ Ho.update({
221
+ loading: Vo,
222
+ canUseAdminModes: Bo
222
223
  });
223
224
  }, [
225
+ Ho,
224
226
  Vo,
225
- Bo,
226
- zo
227
+ Bo
227
228
  ]), O(() => () => {
228
- Vo.abandon();
229
- }, [Vo]);
230
- let qo = k(() => R.filter((e) => !e.requiresAdmin || zo), [R, zo]), Jo = fe(qo), Yo = ho && Jo, Xo = A(Jo);
229
+ Ho.abandon();
230
+ }, [Ho]);
231
+ let Jo = k(() => R.filter((e) => !e.requiresAdmin || Bo), [R, Bo]), Yo = fe(Jo), Xo = go && Yo, Zo = A(Yo);
231
232
  O(() => {
232
- Xo.current = Jo;
233
- }, [Jo]);
234
- let Zo = A(null), Qo = A(!1), [$o, es] = j(!1), ts = gn(R), [ns, rs] = j(null), [is, as] = j(() => xr.openFor());
233
+ Zo.current = Yo;
234
+ }, [Yo]);
235
+ let Qo = A(null), $o = A(!1), [es, ts] = j(!1), ns = gn(R), [rs, is] = j(null), [as, os] = j(() => Sr.openFor());
235
236
  O(() => {
236
- xr.setOpenFor(is);
237
- }, [is]);
238
- let os = is !== null && is === H, q = He(), ss = Ue(), J = q.open && ss !== null, cs = q.close, ls = A(J);
239
- ra(() => {
240
- ls.current = J;
237
+ Sr.setOpenFor(as);
238
+ }, [as]);
239
+ let ss = as !== null && as === H, q = He(), cs = Ue(), J = q.open && cs !== null, ls = q.close, us = A(J);
240
+ ia(() => {
241
+ us.current = J;
241
242
  }, [J]);
242
- let us = D((e) => {
243
- e && ls.current || e && I || as(e ? w.getState().activeConversationId : null);
243
+ let ds = D((e) => {
244
+ e && us.current || e && I || os(e ? w.getState().activeConversationId : null);
244
245
  }, [I]);
245
246
  O(() => {
246
- as((e) => e !== null && e !== H ? null : e);
247
+ os((e) => e !== null && e !== H ? null : e);
247
248
  }, [H]);
248
- let ds = A(void 0), [fs, ps] = j(!1), [ms, hs] = j(!1), gs = D((e) => {
249
- ds.current = e, ps(pr(e));
250
- }, []), _s = A(null), vs = A(!1), ys = D(() => {
249
+ let fs = A(void 0), [ps, ms] = j(!1), [hs, gs] = j(!1), _s = D((e) => {
250
+ fs.current = e, ms(mr(e));
251
+ }, []), vs = A(null), ys = A(!1), bs = D(() => {
251
252
  let e = w.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
252
253
  return !t || !n ? null : {
253
254
  id: t,
254
- reusableDraft: Hi(n, Ki()),
255
+ reusableDraft: Ui(n, qi()),
255
256
  liveProposals: K.liveFor(t).count,
256
257
  turnInFlight: On(e.processingByConversationId[t]?.status)
257
258
  };
258
- }, [K]), bs = A({}), xs = A(on(jr())), Ss = A(new Jt()), Cs = A(/* @__PURE__ */ new Set()), ws = k(() => R.find((e) => e.id === U), [R, U]), Ts = w((e) => {
259
+ }, [K]), xs = A({}), Ss = A(on(Mr())), Cs = A(new Jt()), ws = A(/* @__PURE__ */ new Set()), Ts = k(() => R.find((e) => e.id === U), [R, U]), Es = w((e) => {
259
260
  let t = e.sandboxesByMode[U]?.sandboxId;
260
261
  return t ? e.sandboxWriteCapabilities[t] : void 0;
261
- }), Es = ws !== void 0 && g({
262
+ }), Ds = Ts !== void 0 && g({
262
263
  mode: U,
263
264
  productWriteApproval: z,
264
- capabilities: Ts
265
- }), Ds = U === "assistant" || ws !== void 0 && !ws.writeCapable && !gt(U) || Es;
265
+ capabilities: Es
266
+ }), Os = U === "assistant" || Ts !== void 0 && !Ts.writeCapable && !gt(U) || Ds;
266
267
  O(() => {
267
- let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || zo)?.id ?? R[0]?.id ?? "assistant";
268
- U !== "assistant" && ws?.writeCapable && !Jn(po, U) ? $a(e) : Bo || (!ws || ws.requiresAdmin && !zo) && U !== e && $a(e);
268
+ let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || Bo)?.id ?? R[0]?.id ?? "assistant";
269
+ U !== "assistant" && Ts?.writeCapable && !Jn(mo, U) ? eo(e) : Vo || (!Ts || Ts.requiresAdmin && !Bo) && U !== e && eo(e);
269
270
  }, [
270
271
  U,
271
- ws,
272
- zo,
272
+ Ts,
273
273
  Bo,
274
- $a,
275
- po,
274
+ Vo,
275
+ eo,
276
+ mo,
276
277
  R
277
278
  ]);
278
- let Os = D((e, t, n, r) => {
279
- oo(e, n, t, null, r);
280
- }, [oo]), ks = D(async (e, t, n, r, i, a = null) => {
279
+ let ks = D((e, t, n, r) => {
280
+ so(e, n, t, null, r);
281
+ }, [so]), As = D(async (e, t, n, r, i, a = null) => {
281
282
  let o = (e, t) => {
282
- r && Os(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
283
+ r && ks(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
283
284
  }, s = (e) => {
284
285
  r && E(r.assistantMessageId, e);
285
286
  }, c = () => {
@@ -287,7 +288,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
287
288
  }, l = () => a !== null && (a.signal.aborted || T() !== t), u = () => {
288
289
  if (l()) throw new Yt("cancelled");
289
290
  }, d = w.getState().sandboxesByMode[e]?.sandboxId ?? null, f = !1, p = !1, ee = !1, m = !1, h = !1, g = async (r) => {
290
- if (i && !Ss.current.has(r) && xs.current.isFresh(r)) return f = !0, !0;
291
+ if (i && !Cs.current.has(r) && Ss.current.isFresh(r)) return f = !0, !0;
291
292
  ee = !0;
292
293
  let o = !1;
293
294
  try {
@@ -296,42 +297,42 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
296
297
  });
297
298
  } catch {
298
299
  if (l()) throw new Yt("cancelled");
299
- return xs.current.invalidate(r), Ss.current.add(r), a?.dead.push(r), h = !0, !1;
300
+ return Ss.current.invalidate(r), Cs.current.add(r), a?.dead.push(r), h = !0, !1;
300
301
  }
301
- return u(), xs.current.markVerified(r), o && (m = !0), !0;
302
+ return u(), Ss.current.markVerified(r), o && (m = !0), !0;
302
303
  };
303
- if (d && (uo(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (uo(e, null, "provisioning"), d = null)), !d) {
304
+ if (d && (fo(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (fo(e, null, "provisioning"), d = null)), !d) {
304
305
  o("provisioning", "lookingForEnvironment");
305
- let r = await dt(t, L, e, Mn(), n, Ss.current, z);
306
+ let r = await dt(t, L, e, Mn(), n, Cs.current, z);
306
307
  u();
307
308
  let i = r?.id ?? null;
308
309
  if (i) {
309
- uo(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
310
+ fo(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
310
311
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
311
- t && c(), await g(i) ? (d = i, t && (m = !0)) : uo(e, null, "provisioning");
312
+ t && c(), await g(i) ? (d = i, t && (m = !0)) : fo(e, null, "provisioning");
312
313
  }
313
314
  }
314
315
  if (!d) {
315
316
  if (a && !a.mayCreate) throw new Yt("no-create");
316
- if (s("provisionStarted"), e === "api-calls" && !Ra()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
317
- o("provisioning", "startingEnvironment"), uo(e, null, "provisioning");
318
- let r = a ? [] : await yt(t, L, e, Mn(), n, Ss.current, z);
317
+ if (s("provisionStarted"), e === "api-calls" && !za()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
318
+ o("provisioning", "startingEnvironment"), fo(e, null, "provisioning");
319
+ let r = a ? [] : await yt(t, L, e, Mn(), n, Cs.current, z);
319
320
  if (r.length > 0) {
320
321
  let e = new Set(r);
321
- for (let e of r) xs.current.invalidate(e), Ss.current.add(e);
322
+ for (let e of r) Ss.current.invalidate(e), Cs.current.add(e);
322
323
  let t = w.getState().sandboxesByMode;
323
- for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && fo(n);
324
+ for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && po(n);
324
325
  }
325
326
  s("createRequested");
326
327
  let i = a?.beginCreate();
327
328
  try {
328
- d = await lt(L, e, t, Mn(), ca, n, { writeApproval: z });
329
+ d = await lt(L, e, t, Mn(), la, n, { writeApproval: z });
329
330
  } finally {
330
331
  i?.();
331
332
  }
332
- p = !0, u(), uo(e, d, "provisioning"), await St(d, t, n, 3e5), u(), s("sandboxRunning"), await xt(d, t, e, n, 9e4), u(), s("serviceReady"), xs.current.markVerified(d);
333
+ p = !0, u(), fo(e, d, "provisioning"), await St(d, t, n, 3e5), u(), s("sandboxRunning"), await xt(d, t, e, n, 9e4), u(), s("serviceReady"), Ss.current.markVerified(d);
333
334
  }
334
- return uo(e, d, "running"), {
335
+ return fo(e, d, "running"), {
335
336
  sandboxId: d,
336
337
  sandboxIsNew: p,
337
338
  sandboxProbed: ee,
@@ -340,17 +341,17 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
340
341
  trustedFromCache: f
341
342
  };
342
343
  }, [
343
- fo,
344
- Ra,
344
+ po,
345
+ za,
345
346
  L,
346
347
  z,
347
- uo,
348
- Os
349
- ]), As = D(async function e(t, n, r, i, a, o = {}) {
350
- let s = await tn(i, r, (e) => Os(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
351
- for (let e of s.dead) xs.current.invalidate(e), Ss.current.add(e);
352
- s.verified && !Ss.current.has(s.verified) && xs.current.markVerified(s.verified), s.joined && cn(n, { prewarm: s.joined });
353
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await ks(r, i, a, {
348
+ fo,
349
+ ks
350
+ ]), js = D(async function e(t, n, r, i, a, o = {}) {
351
+ let s = await tn(i, r, (e) => ks(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
352
+ for (let e of s.dead) Ss.current.invalidate(e), Cs.current.add(e);
353
+ s.verified && !Cs.current.has(s.verified) && Ss.current.markVerified(s.verified), s.joined && cn(n, { prewarm: s.joined });
354
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await As(r, i, a, {
354
355
  conversationId: t,
355
356
  assistantMessageId: n
356
357
  }, o.trustCache !== !1), ee = Zt(i, r, c);
@@ -363,7 +364,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
363
364
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
364
365
  g = e;
365
366
  } catch {
366
- lo(t), m = null;
367
+ uo(t), m = null;
367
368
  }
368
369
  }
369
370
  let te = !1;
@@ -375,24 +376,24 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
375
376
  userId: B
376
377
  }), Date.now());
377
378
  if (e) {
378
- "pending" in e && Os(t, n, "connecting", "preparingSession");
379
+ "pending" in e && ks(t, n, "connecting", "preparingSession");
379
380
  let o = "sessionId" in e ? e.sessionId : await e.pending;
380
- if (o && !Ss.current.has(c)) try {
381
- (await mt(c, i, o, r, a)).mode === r && (m = o, te = !0, co(t, m), h = !0);
381
+ if (o && !Cs.current.has(c)) try {
382
+ (await mt(c, i, o, r, a)).mode === r && (m = o, te = !0, lo(t, m), h = !0);
382
383
  } catch {}
383
384
  }
384
385
  }
385
386
  if (!m) {
386
- Os(t, n, "connecting", "preparingSession");
387
+ ks(t, n, "connecting", "preparingSession");
387
388
  let s;
388
389
  try {
389
390
  s = await ut(c, i, r, a);
390
391
  } catch (s) {
391
392
  if (p) {
392
- xs.current.invalidate(c);
393
- let l = Nr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
394
- if (l === "check-network" && (l = await Mr(() => dt(i, L, r, Mn(), a, Ss.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
395
- p || cn(n, { cacheProofFailed: !0 }), l === "replace" && (Ss.current.add(c), lo(t), fo(r), K.retireSandbox(c));
393
+ Ss.current.invalidate(c);
394
+ let l = Pr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
395
+ if (l === "check-network" && (l = await Nr(() => dt(i, L, r, Mn(), a, Cs.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
396
+ p || cn(n, { cacheProofFailed: !0 }), l === "replace" && (Cs.current.add(c), uo(t), po(r), K.retireSandbox(c));
396
397
  let s = await e(t, n, r, i, a, {
397
398
  ...o,
398
399
  trustCache: !1
@@ -407,7 +408,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
407
408
  }
408
409
  throw s;
409
410
  }
410
- m = s.sessionId, co(t, m), h = !0;
411
+ m = s.sessionId, lo(t, m), h = !0;
411
412
  }
412
413
  return {
413
414
  sandboxId: c,
@@ -422,55 +423,55 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
422
423
  knownFloor: _
423
424
  };
424
425
  }, [
425
- ks,
426
- lo,
427
- fo,
426
+ As,
427
+ uo,
428
+ po,
428
429
  L,
429
430
  z,
430
- co,
431
- Os,
431
+ lo,
432
+ ks,
432
433
  B,
433
434
  K
434
- ]), js = D((e, t = !1) => {
435
+ ]), Ms = D((e, t = !1) => {
435
436
  let n = T();
436
437
  if (!n) return;
437
438
  let r = w.getState(), i = Date.now(), a = en({
438
439
  autoRouting: r.autoRouting,
439
- autoOffered: Xo.current,
440
+ autoOffered: Zo.current,
440
441
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
441
442
  selectedMode: r.mode,
442
443
  autoReadMode: b,
443
- modes: Ho.current,
444
+ modes: Uo.current,
444
445
  acknowledgedWriteModes: r.acknowledgedWriteModes,
445
- adminAccess: Vo.read(),
446
+ adminAccess: Ho.read(),
446
447
  dictated: e,
447
- voiceProposalBound: (e) => La(e),
448
+ voiceProposalBound: (e) => Ra(e),
448
449
  turnInFlight: Object.values(r.processingByConversationId).some((e) => On(e?.status)),
449
450
  ...an(n),
450
451
  now: i
451
452
  });
452
453
  if (!a) return;
453
454
  let o = rn(n, a, i), s = {
454
- accessToken: Ra(),
455
- workspaceToken: za(),
455
+ accessToken: za(),
456
+ workspaceToken: Ba(),
456
457
  userId: B,
457
458
  organizationId: Vt()
458
459
  };
459
- ks(a.mode, n, s, null, !0, o).then((e) => {
460
+ As(a.mode, n, s, null, !0, o).then((e) => {
460
461
  if (o.finish({
461
462
  ok: !0,
462
463
  sandboxId: e.sandboxId,
463
464
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
464
465
  booted: e.sandboxIsNew || e.sandboxAdopted,
465
466
  dead: o.dead
466
- }), o.signal.aborted || T() !== n || Ss.current.has(e.sandboxId)) return;
467
- let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = Ki();
467
+ }), o.signal.aborted || T() !== n || Cs.current.has(e.sandboxId)) return;
468
+ let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = qi();
468
469
  $t({
469
470
  active: i ? {
470
471
  mode: i.mode,
471
472
  backendSessionId: i.backendSessionId,
472
- continuable: !Vi(i) && !Bi(i, c),
473
- hasHistory: zi(i)
473
+ continuable: !Hi(i) && !Vi(i, c),
474
+ hasHistory: Bi(i)
474
475
  } : void 0,
475
476
  mode: a.mode
476
477
  }) && nn(Qt({
@@ -482,7 +483,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
482
483
  }, (e) => {
483
484
  if (!(e instanceof Yt) && !o.signal.aborted && T() === n) {
484
485
  let e = w.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
485
- e && (xs.current.invalidate(e), Ss.current.add(e), o.dead.push(e), fo(a.mode));
486
+ e && (Ss.current.invalidate(e), Cs.current.add(e), o.dead.push(e), po(a.mode));
486
487
  }
487
488
  o.finish({
488
489
  ok: !1,
@@ -492,68 +493,68 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
492
493
  });
493
494
  });
494
495
  }, [
495
- ks,
496
- Vo,
497
- fo,
498
- Ra,
496
+ As,
497
+ Ho,
498
+ po,
499
499
  za,
500
+ Ba,
500
501
  B,
501
- La
502
- ]), Ms = A(!1), Ns = A(null), Ps = k(() => a(), []);
503
- O(() => () => Ps.cancel(), [Ps]);
504
- let Fs = ia(Ar, Tr, Tr)?.reference ?? null, [Is, Ls] = j(0), Rs = A(/* @__PURE__ */ new Set()), zs = A(null), Bs = D(() => {
502
+ Ra
503
+ ]), Ns = A(!1), Ps = A(null), Fs = k(() => a(), []);
504
+ O(() => () => Fs.cancel(), [Fs]);
505
+ let Is = aa(jr, Er, Er)?.reference ?? null, [Ls, Rs] = j(0), zs = A(/* @__PURE__ */ new Set()), Bs = A(null), Vs = D(() => {
505
506
  let e = w.getState(), t = e.activeConversationId;
506
507
  if (!t) return null;
507
508
  let n = e.processingByConversationId[t], r = On(n?.status) ? n?.messageId ?? null : null;
508
509
  if (!An({
509
510
  interruptedTurnId: r,
510
511
  activeTurnId: r,
511
- alreadyRequested: r ? Rs.current.has(r) : !1
512
+ alreadyRequested: r ? zs.current.has(r) : !1
512
513
  }).send || !r) return null;
513
- Rs.current.add(r);
514
+ zs.current.add(r);
514
515
  let i = ot(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
515
516
  return i && a && o && st(i.sandboxId, a, o, i.mode, {
516
- accessToken: Ra(),
517
- workspaceToken: za(),
517
+ accessToken: za(),
518
+ workspaceToken: Ba(),
518
519
  userId: B,
519
520
  organizationId: Vt()
520
521
  }), r;
521
522
  }, [
522
523
  B,
523
- Ra,
524
- za
525
- ]), Vs = D(() => {
526
- let e = Bs();
524
+ za,
525
+ Ba
526
+ ]), Hs = D(() => {
527
+ let e = Vs();
527
528
  return e && (Mt(e), kt.abort(e)), e;
528
- }, [Bs]), Hs = D(() => {
529
+ }, [Vs]), Us = D(() => {
529
530
  let e = w.getState().activeConversationId;
530
- Vs(), e && K.declineForReply(e, "corrected", "spoken");
531
- }, [Vs, K]), Us = D(async (e) => {
531
+ Hs(), e && K.declineForReply(e, "corrected", "spoken");
532
+ }, [Hs, K]), Ws = D(async (e) => {
532
533
  let t = w.getState(), n = ot(t), r = T(), i = t.activeConversationId;
533
534
  if (!n || !r || !i || oe(t.sandboxWriteCapabilities[n.sandboxId])) return;
534
- let a = t.conversations.find((e) => e.id === i), o = a ? Or(sr(a.messages), {
535
+ let a = t.conversations.find((e) => e.id === i), o = a ? kr(sr(a.messages), {
535
536
  sessionId: a.backendSessionId,
536
537
  sandboxId: n.sandboxId,
537
538
  nowMs: Date.now()
538
539
  }) : null;
539
540
  if (o?.reference !== e) {
540
- Ls((e) => e + 1);
541
+ Rs((e) => e + 1);
541
542
  return;
542
543
  }
543
544
  let s = {
544
545
  conversationId: i,
545
546
  reference: e
546
547
  };
547
- if (!Cr(s)) return;
548
+ if (!wr(s)) return;
548
549
  try {
549
550
  await ct(n.sandboxId, r, e, n.mode, {
550
- accessToken: Ra(),
551
- workspaceToken: za(),
551
+ accessToken: za(),
552
+ workspaceToken: Ba(),
552
553
  userId: B,
553
554
  organizationId: Vt()
554
555
  });
555
556
  } catch (e) {
556
- wr(s), W(i, {
557
+ Tr(s), W(i, {
557
558
  id: N(),
558
559
  role: "system",
559
560
  content: e instanceof Error ? e.message : "The change could not be approved.",
@@ -561,69 +562,69 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
561
562
  });
562
563
  return;
563
564
  }
564
- wr(s), ao(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
565
+ Tr(s), oo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
565
566
  let c = w.getState(), l = c.conversations.find((e) => e.id === i);
566
- c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && ot(c)?.sandboxId === n.sandboxId && !On(c.processingByConversationId[i]?.status) && Dr(sr(l.messages)) === o.messageId && Jc.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
567
+ c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && ot(c)?.sandboxId === n.sandboxId && !On(c.processingByConversationId[i]?.status) && Or(sr(l.messages)) === o.messageId && Yc.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
567
568
  approvalFollowUp: { approvedReplyId: o.messageId },
568
569
  targetConversationId: i
569
570
  });
570
571
  }, [
571
572
  B,
572
573
  W,
573
- ao,
574
+ oo,
574
575
  P
575
- ]), Ws = Qi(), { speakFinishedReply: Gs, speakingMessageId: Ks, stop: qs } = Xi(), Js = A(null), Ys = D((e, t) => {
576
- let n = Js.current;
576
+ ]), Gs = $i(), { speakFinishedReply: Ks, speakingMessageId: qs, stop: Js } = Zi(), Ys = A(null), Xs = D((e, t) => {
577
+ let n = Ys.current;
577
578
  n?.token === e && n.exchange === null && (n.exchange = t);
578
- }, []), Xs = D((e) => {
579
- let t = Js.current;
579
+ }, []), Zs = D((e) => {
580
+ let t = Ys.current;
580
581
  e !== void 0 && t?.token === e && (t.handled = !0);
581
- }, []), Zs = D((e, t) => {
582
- Ys(e, t), ls.current && At(t);
583
- }, [Ys]), Qs = Yi(), { items: $s, permissionsSettled: ec, simulating: tc } = $i(), Y = A({
584
- theme: Ws,
585
- navigate: Qs,
586
- navItems: $s,
587
- options: Ia ?? {},
588
- navPermissionsSettled: ec,
589
- navSimulating: tc
582
+ }, []), Qs = D((e, t) => {
583
+ Xs(e, t), us.current && At(t);
584
+ }, [Xs]), $s = Xi(), { items: ec, permissionsSettled: tc, simulating: nc } = ea(), Y = A({
585
+ theme: Gs,
586
+ navigate: $s,
587
+ navItems: ec,
588
+ options: La ?? {},
589
+ navPermissionsSettled: tc,
590
+ navSimulating: nc
590
591
  });
591
592
  O(() => {
592
593
  Y.current = {
593
- theme: Ws,
594
- navigate: Qs,
595
- navItems: $s,
596
- options: Ia ?? {},
597
- navPermissionsSettled: ec,
598
- navSimulating: tc
594
+ theme: Gs,
595
+ navigate: $s,
596
+ navItems: ec,
597
+ options: La ?? {},
598
+ navPermissionsSettled: tc,
599
+ navSimulating: nc
599
600
  };
600
601
  }, [
601
- Ws,
602
- Qs,
602
+ Gs,
603
603
  $s,
604
- Ia,
605
604
  ec,
606
- tc
605
+ La,
606
+ tc,
607
+ nc
607
608
  ]);
608
609
  let X = A(!0);
609
610
  O(() => (X.current = !0, () => {
610
611
  X.current = !1;
611
612
  }), []);
612
- let nc = A({
613
+ let rc = A({
613
614
  tr: P,
614
615
  locale: V
615
- }), rc = A(null), [ic, ac] = j(null), oc = A(null), sc = D((e) => {
616
- oc.current !== null && (window.clearTimeout(oc.current), oc.current = null);
617
- let t = rc.current;
618
- t && (rc.current = null, window.clearTimeout(t.deadline), X.current && ac(null), e && X.current && (oc.current = window.setTimeout(() => {
619
- if (oc.current = null, !X.current) return;
616
+ }), ic = A(null), [ac, oc] = j(null), sc = A(null), cc = D((e) => {
617
+ sc.current !== null && (window.clearTimeout(sc.current), sc.current = null);
618
+ let t = ic.current;
619
+ t && (ic.current = null, window.clearTimeout(t.deadline), X.current && oc(null), e && X.current && (sc.current = window.setTimeout(() => {
620
+ if (sc.current = null, !X.current) return;
620
621
  let e = w.getState();
621
622
  if (e.activeConversationId !== t.conversationId) return;
622
623
  let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
623
624
  if (!n) return;
624
- let r = nc.current, i = Qn(n, null, r.tr);
625
+ let r = rc.current, i = Qn(n, null, r.tr);
625
626
  if (i.kind !== "output") return;
626
- let a = ri(n, r.tr);
627
+ let a = ii(n, r.tr);
627
628
  kt.publish(n.id, {
628
629
  conversationId: t.conversationId,
629
630
  channel: n.metadata?.voice === !0 ? "voice" : "chat",
@@ -633,44 +634,44 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
633
634
  final: !0
634
635
  });
635
636
  }, 0)));
636
- }, []), cc = D(() => sc(!0), [sc]);
637
+ }, []), lc = D(() => cc(!0), [cc]);
637
638
  O(() => {
638
- nc.current = {
639
+ rc.current = {
639
640
  tr: P,
640
641
  locale: V
641
642
  };
642
- let e = rc.current;
643
+ let e = ic.current;
643
644
  if (!e) return;
644
- let t = ii({
645
+ let t = ai({
645
646
  wanted: e.wanted,
646
647
  locale: V,
647
- isLoading: Ba(e.wanted),
648
- translatedNow: ti(P, e.reply).translated
648
+ isLoading: Va(e.wanted),
649
+ translatedNow: ni(P, e.reply).translated
649
650
  });
650
- if (t === "write") cc();
651
+ if (t === "write") lc();
651
652
  else if (t === "grace") {
652
- let e = window.setTimeout(cc, 400);
653
+ let e = window.setTimeout(lc, 400);
653
654
  return () => window.clearTimeout(e);
654
655
  }
655
656
  }, [
656
657
  P,
657
658
  V,
658
- Ba,
659
- ic,
660
- cc
661
- ]), O(() => () => sc(!1), [sc]);
662
- let lc = A(null), [uc, dc] = j(!1), [fc, pc] = j(null), [Z] = j(() => new Si()), [mc, hc] = j(0), gc = D(() => hc((e) => e + 1), []), _c = D(() => {
659
+ Va,
660
+ ac,
661
+ lc
662
+ ]), O(() => () => cc(!1), [cc]);
663
+ let uc = A(null), [dc, fc] = j(!1), [pc, mc] = j(null), [Z] = j(() => new Ci()), [hc, gc] = j(0), _c = D(() => gc((e) => e + 1), []), vc = D(() => {
663
664
  let e = Y.current;
664
665
  return {
665
- destinations: Rr(e.navItems),
666
+ destinations: zr(e.navItems),
666
667
  permissionsSettled: e.navPermissionsSettled,
667
668
  simulating: e.navSimulating
668
669
  };
669
- }, []), vc = A(B);
670
+ }, []), yc = A(B);
670
671
  O(() => {
671
- vc.current = B;
672
+ yc.current = B;
672
673
  }, [B]);
673
- let yc = D((e, t) => {
674
+ let bc = D((e, t) => {
674
675
  let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
675
676
  ok: !1,
676
677
  reason: "gone",
@@ -682,22 +683,22 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
682
683
  let o = r.conversationId, s = w.getState().conversations.find((e) => e.id === o);
683
684
  if (!s) return a;
684
685
  let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
685
- registry: _c(),
686
- actorId: vc.current,
686
+ registry: vc(),
687
+ actorId: yc.current,
687
688
  conversationId: o,
688
689
  perfNow: performance.now()
689
690
  }).find((t) => t.offer.offerId === e);
690
691
  if (!u) {
691
- let e = Ti(i, performance.now());
692
+ let e = Ei(i, performance.now());
692
693
  return {
693
694
  ok: !1,
694
695
  reason: e ? "unavailable" : "expired",
695
- copy: e ? Yr(P, t || null) : qr(P),
696
+ copy: e ? Xr(P, t || null) : Jr(P),
696
697
  conversationId: o,
697
698
  voiceSessionId: l
698
699
  };
699
700
  }
700
- return Z.markUsed(e) ? (gc(), {
701
+ return Z.markUsed(e) ? (_c(), {
701
702
  ok: !0,
702
703
  target: u.target,
703
704
  conversationId: o,
@@ -705,10 +706,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
705
706
  }) : a;
706
707
  }, [
707
708
  Z,
708
- _c,
709
+ vc,
709
710
  P,
710
- gc
711
- ]), bc = D((e, t, n, r, i) => {
711
+ _c
712
+ ]), xc = D((e, t, n, r, i) => {
712
713
  let a = N();
713
714
  W(e, {
714
715
  id: a,
@@ -720,18 +721,18 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
720
721
  ...i ? { localAction: i } : {},
721
722
  ...lr(t)
722
723
  }
723
- }), i && Ri.recordCommittedEntries(e, [a], "NOTE", r);
724
- }, [W, V]), xc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Sc = A(null);
724
+ }), i && zi.recordCommittedEntries(e, [a], "NOTE", r);
725
+ }, [W, V]), Sc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Cc = A(null);
725
726
  O(() => () => {
726
- Sc.current?.(), Sc.current = null;
727
+ Cc.current?.(), Cc.current = null;
727
728
  }, []);
728
- let Cc = D((e) => {
729
- Sc.current?.(), Sc.current = X.current ? di(document, e) : null;
730
- }, []), wc = D((e, t, n, r = !1) => {
731
- if (lc.current !== null) return;
732
- let i = yc(e, n), a = T(), o = (e, t, n, r) => bc(e, t, n, a, r);
729
+ let wc = D((e) => {
730
+ Cc.current?.(), Cc.current = X.current ? fi(document, e) : null;
731
+ }, []), Tc = D((e, t, n, r = !1) => {
732
+ if (uc.current !== null) return;
733
+ let i = bc(e, n), a = T(), o = (e, t, n, r) => xc(e, t, n, a, r);
733
734
  if (!i.ok) {
734
- i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), gc();
735
+ i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), _c();
735
736
  return;
736
737
  }
737
738
  let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
@@ -739,7 +740,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
739
740
  offerId: e
740
741
  };
741
742
  if (r) {
742
- o(c, l, Gr(P, s.label, !0), Ni({
743
+ o(c, l, Kr(P, s.label, !0), Pi({
743
744
  destinationId: s.id,
744
745
  path: s.path,
745
746
  alreadyHere: !0,
@@ -749,16 +750,16 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
749
750
  return;
750
751
  }
751
752
  let d = N();
752
- lc.current = d, dc(!0);
753
+ uc.current = d, fc(!0);
753
754
  let f = (t) => {
754
755
  try {
755
- if (xc(e, t) && (gc(), t.status === "kept" && Cc(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
756
+ if (Sc(e, t) && (_c(), t.status === "kept" && wc(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
756
757
  let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
757
- o(c, l, Kr(P, t, {
758
+ o(c, l, qr(P, t, {
758
759
  page: s.label,
759
- landed: n === null ? null : Fi(Rr(Y.current.navItems), n),
760
+ landed: n === null ? null : Ii(zr(Y.current.navItems), n),
760
761
  path: s.path
761
- }), Ni({
762
+ }), Pi({
762
763
  destinationId: s.id,
763
764
  path: s.path,
764
765
  alreadyHere: !1,
@@ -767,10 +768,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
767
768
  offer: u
768
769
  }));
769
770
  } finally {
770
- lc.current === d && (lc.current = null, X.current && dc(!1));
771
+ uc.current === d && (uc.current = null, X.current && fc(!1));
771
772
  }
772
773
  };
773
- Li(Y.current.navigate, s.path, {
774
+ Ri(Y.current.navigate, s.path, {
774
775
  readPath: () => window.location.pathname + window.location.search,
775
776
  now: () => Date.now(),
776
777
  schedule: (e, t) => {
@@ -781,20 +782,20 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
781
782
  surface: "offer"
782
783
  }).then(f, () => f({ status: "unconfirmed" }));
783
784
  }, [
784
- yc,
785
785
  bc,
786
- P,
787
- gc,
788
786
  xc,
789
- Cc
790
- ]), Tc = D((e, t) => wc(e, "tap", t || null), [wc]), Ec = D((e) => {
787
+ P,
788
+ _c,
789
+ Sc,
790
+ wc
791
+ ]), Ec = D((e, t) => Tc(e, "tap", t || null), [Tc]), Dc = D((e) => {
791
792
  let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
792
793
  if (!r) return;
793
- let i = window.location.pathname + window.location.search, a = Rr(Y.current.navItems), o = Di({
794
+ let i = window.location.pathname + window.location.search, a = zr(Y.current.navItems), o = Oi({
794
795
  intent: e.intent,
795
796
  live: Z.liveOffersFor(t, {
796
- registry: _c(),
797
- actorId: vc.current,
797
+ registry: vc(),
798
+ actorId: yc.current,
798
799
  conversationId: n,
799
800
  perfNow: performance.now()
800
801
  }),
@@ -806,50 +807,50 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
806
807
  location: i,
807
808
  conversationId: w.getState().activeConversationId,
808
809
  workspaceId: T(),
809
- actorId: vc.current ?? null
810
+ actorId: yc.current ?? null
810
811
  },
811
812
  mounted: X.current,
812
813
  visible: document.visibilityState === "visible",
813
- unsavedChanges: Oi(Y.current.options),
814
+ unsavedChanges: ki(Y.current.options),
814
815
  alreadyThere: ({ target: e }) => {
815
816
  let t = a.find((t) => t.id === e.id);
816
- return t ? Fr(t, i, a) : !1;
817
+ return t ? Ir(t, i, a) : !1;
817
818
  }
818
819
  });
819
820
  if (o.act === "navigate" || o.act === "already-here") {
820
- wc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
821
+ Tc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
821
822
  return;
822
823
  }
823
824
  let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
824
- registry: _c(),
825
- actorId: vc.current,
825
+ registry: vc(),
826
+ actorId: yc.current,
826
827
  conversationId: n,
827
828
  perfNow: performance.now()
828
829
  });
829
- o.hold === "R5-unsaved" && s && c && bc(n, e.voiceSessionId, Jr(P, s.label, c.target.label), T());
830
+ o.hold === "R5-unsaved" && s && c && xc(n, e.voiceSessionId, Yr(P, s.label, c.target.label), T());
830
831
  }, [
831
832
  Z,
832
- _c,
833
+ vc,
833
834
  K,
834
- wc,
835
- bc,
835
+ Tc,
836
+ xc,
836
837
  P
837
- ]), Dc = D((e) => {
838
+ ]), Oc = D((e) => {
838
839
  let t = w.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
839
- return n ? ji(Ai, window.location.pathname, Ii(n.messages, e)) : !1;
840
- }, []), Oc = be(), kc = li(), Ac = Oc?.request ?? null, jc = D((e, t, n = !1, r = !1) => {
841
- let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Rr(i), l = null, u = {
840
+ return n ? Mi(ji, window.location.pathname, Li(n.messages, e)) : !1;
841
+ }, []), kc = be(), Ac = ui(), jc = kc?.request ?? null, Mc = D((e, t, n = !1, r = !1) => {
842
+ let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = zr(i), l = null, u = {
842
843
  ...a,
843
- locale: t === void 0 ? V : qa.input.code,
844
+ locale: t === void 0 ? V : Ja.input.code,
844
845
  uiLocale: V,
845
- inputLocale: qa.input.code
846
+ inputLocale: Ja.input.code
846
847
  };
847
- if (r || Lr(e, u)) {
848
- let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? pi(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && On(o.status);
848
+ if (r || Rr(e, u)) {
849
+ let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? mi(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && On(o.status);
849
850
  if (n && r && !s) {
850
851
  let e = Z.liveOffersFor(r.id, {
851
- registry: _c(),
852
- actorId: vc.current,
852
+ registry: vc(),
853
+ actorId: yc.current,
853
854
  conversationId: n.id,
854
855
  perfNow: performance.now()
855
856
  }).flatMap(({ offer: e, target: t }) => {
@@ -859,14 +860,14 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
859
860
  target: n
860
861
  }] : [];
861
862
  });
862
- l = fi({
863
+ l = pi({
863
864
  reply: r,
864
865
  text: tr(r, o, P),
865
866
  resolve: {
866
867
  destinations: c,
867
868
  entityRoutes: a.entityRoutes,
868
- visibleNavIds: gi(i),
869
- nounLabel: (e) => Ur(P, e)
869
+ visibleNavIds: _i(i),
870
+ nounLabel: (e) => Wr(P, e)
870
871
  },
871
872
  offers: e
872
873
  });
@@ -876,18 +877,18 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
876
877
  destinations: c,
877
878
  sentenceOptions: u,
878
879
  context: {
879
- backRunnable: Dc(t),
880
+ backRunnable: Oc(t),
880
881
  navigation: l,
881
882
  skipRecords: n,
882
- controls: oi(),
883
+ controls: si(),
883
884
  executors: {
884
885
  theme: o !== null,
885
886
  navigation: s !== null,
886
- conversationDelete: Ac !== null,
887
+ conversationDelete: jc !== null,
887
888
  appControl: (e) => {
888
889
  try {
889
- let n = ai(e, { voiceLive: t !== void 0 || Vl.current });
890
- return n !== null && (n.kind !== "confirm" || kc !== null);
890
+ let n = oi(e, { voiceLive: t !== void 0 || Hl.current });
891
+ return n !== null && (n.kind !== "confirm" || Ac !== null);
891
892
  } catch {
892
893
  return !1;
893
894
  }
@@ -896,34 +897,34 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
896
897
  }
897
898
  };
898
899
  }, [
899
- Dc,
900
- qa,
900
+ Oc,
901
+ Ja,
901
902
  V,
902
903
  P,
903
904
  Z,
904
- _c,
905
- Ac,
906
- kc
907
- ]), Mc = D((e, t, n = !1) => {
908
- let { destinations: r, sentenceOptions: i, context: a } = jc(e, t, n);
909
- return Ir(e, r, i, a);
910
- }, [jc]), Nc = D((e) => {
911
- if (Ns.current = e, Sa?.(Te(e)), Ps.cancel(), !e.text.trim() && !e.hasAttachments) {
912
- Ms.current = !1;
905
+ vc,
906
+ jc,
907
+ Ac
908
+ ]), Nc = D((e, t, n = !1) => {
909
+ let { destinations: r, sentenceOptions: i, context: a } = Mc(e, t, n);
910
+ return Lr(e, r, i, a);
911
+ }, [Mc]), Pc = D((e) => {
912
+ if (Ps.current = e, Ca?.(Te(e)), Fs.cancel(), !e.text.trim() && !e.hasAttachments) {
913
+ Ns.current = !1;
913
914
  return;
914
915
  }
915
- if (Ms.current) return;
916
+ if (Ns.current) return;
916
917
  let t = () => {
917
- Ms.current = !0, js(!1);
918
+ Ns.current = !0, Ms(!1);
918
919
  };
919
- e.hasAttachments || e.dictated ? t() : Ps.schedule(() => {
920
- if (!Ms.current) {
920
+ e.hasAttachments || e.dictated ? t() : Fs.schedule(() => {
921
+ if (!Ns.current) {
921
922
  try {
922
- let { destinations: t, sentenceOptions: n, context: r } = jc(e.text, void 0, !1, !0);
923
- if (Pr(e.text, t, n, r)) return;
923
+ let { destinations: t, sentenceOptions: n, context: r } = Mc(e.text, void 0, !1, !0);
924
+ if (Fr(e.text, t, n, r)) return;
924
925
  } catch {
925
- if (!fa) {
926
- fa = !0;
926
+ if (!pa) {
927
+ pa = !0;
927
928
  try {
928
929
  i.getLogger("assistant").warn("Draft command classification failed; using standard warm-up.");
929
930
  } catch {}
@@ -933,36 +934,36 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
933
934
  }
934
935
  });
935
936
  }, [
936
- Ps,
937
- Sa,
938
- js,
939
- jc
937
+ Fs,
938
+ Ca,
939
+ Ms,
940
+ Mc
940
941
  ]);
941
942
  O(() => {
942
943
  let e = () => {
943
- Ns.current && Nc(Ns.current);
944
- }, t = si(e), n = Mi(window, e), r = Ai.subscribe(e);
944
+ Ps.current && Pc(Ps.current);
945
+ }, t = ci(e), n = Ni(window, e), r = ji.subscribe(e);
945
946
  return () => {
946
- t(), n(), r(), Ps.cancel();
947
+ t(), n(), r(), Fs.cancel();
947
948
  };
948
- }, [Ps, Nc]), O(() => {
949
- Ns.current && Nc(Ns.current);
949
+ }, [Fs, Pc]), O(() => {
950
+ Ps.current && Pc(Ps.current);
950
951
  }, [
951
- Nc,
952
- $s,
953
- Ia,
952
+ Pc,
954
953
  ec,
954
+ La,
955
955
  tc,
956
- Ws,
957
- Qs,
956
+ nc,
957
+ Gs,
958
+ $s,
958
959
  U,
959
- mc,
960
+ hc,
960
961
  H,
961
962
  G?.messages,
962
- bo
963
+ xo
963
964
  ]);
964
- let Pc = D((e, t) => {
965
- let n = Mc(e, t);
965
+ let Fc = D((e, t) => {
966
+ let n = Nc(e, t);
966
967
  if (!n) return !1;
967
968
  let { theme: r, navigate: i } = Y.current;
968
969
  switch (n.kind) {
@@ -974,14 +975,14 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
974
975
  case "link-not-openable":
975
976
  case "back": return i !== null;
976
977
  case "conversation-delete": return !1;
977
- case "app-control": return ai(n.request, { voiceLive: t !== void 0 || Vl.current }) !== null;
978
+ case "app-control": return oi(n.request, { voiceLive: t !== void 0 || Hl.current }) !== null;
978
979
  case "open-record": return !1;
979
980
  }
980
- }, [Mc]), Fc = A(Pc);
981
+ }, [Nc]), Ic = A(Fc);
981
982
  O(() => {
982
- Fc.current = Pc;
983
- }, [Pc]);
984
- let Ic = D((e, t) => {
983
+ Ic.current = Fc;
984
+ }, [Fc]);
985
+ let Lc = D((e, t) => {
985
986
  let n = {
986
987
  state: "none",
987
988
  accept: null
@@ -990,11 +991,11 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
990
991
  let o = w.getState(), s = o.conversations.find((t) => t.id === e);
991
992
  if (!s) return n;
992
993
  let c = o.processingByConversationId[s.id] ?? null, l = {
993
- registry: _c(),
994
- actorId: vc.current,
994
+ registry: vc(),
995
+ actorId: yc.current,
995
996
  conversationId: s.id,
996
997
  perfNow: performance.now()
997
- }, { state: u, reply: d } = xi(Z, {
998
+ }, { state: u, reply: d } = Si(Z, {
998
999
  ...l,
999
1000
  messages: s.messages,
1000
1001
  voiceSessionId: t,
@@ -1007,7 +1008,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1007
1008
  state: u,
1008
1009
  accept: null
1009
1010
  };
1010
- let [f] = Z.liveOffersFor(d.id, l), p = f ? Rr(a).find((e) => e.id === f.target.id) : void 0;
1011
+ let [f] = Z.liveOffersFor(d.id, l), p = f ? zr(a).find((e) => e.id === f.target.id) : void 0;
1011
1012
  return !f || !p ? n : {
1012
1013
  state: u,
1013
1014
  accept: {
@@ -1017,10 +1018,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1017
1018
  };
1018
1019
  }, [
1019
1020
  Z,
1020
- _c,
1021
+ vc,
1021
1022
  z,
1022
1023
  P
1023
- ]), Lc = D((e, t, n, r, i, a) => {
1024
+ ]), Rc = D((e, t, n, r, i, a) => {
1024
1025
  let o = P(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
1025
1026
  kind: "write-reply",
1026
1027
  line: n.key
@@ -1046,53 +1047,53 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1046
1047
  localAction: c,
1047
1048
  ...lr(i)
1048
1049
  }
1049
- }), Ri.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && Zs(a, {
1050
+ }), zi.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && Qs(a, {
1050
1051
  conversationId: e,
1051
1052
  questionId: u,
1052
1053
  replyId: d
1053
- }), Gs(e, d);
1054
+ }), Ks(e, d);
1054
1055
  }, [
1055
1056
  W,
1056
1057
  V,
1057
- Zs,
1058
- Gs,
1058
+ Qs,
1059
+ Ks,
1059
1060
  P
1060
- ]), Rc = A(() => void 0), [zc, Bc] = j(null);
1061
+ ]), zc = A(() => void 0), [Bc, Vc] = j(null);
1061
1062
  O(() => {
1062
- if (zc === null) return;
1063
- let e = window.setTimeout(() => Bc(null), ma);
1063
+ if (Bc === null) return;
1064
+ let e = window.setTimeout(() => Vc(null), ha);
1064
1065
  return () => window.clearTimeout(e);
1065
- }, [zc]);
1066
- let Vc = D(() => {
1066
+ }, [Bc]);
1067
+ let Hc = D(() => {
1067
1068
  let e = w.getState();
1068
- return no(void 0, e.autoRouting && Xo.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1069
- }, [no]), Hc = D((e) => {
1070
- if (!Ac) return !1;
1071
- let t = e !== void 0, n = w.getState(), r = Ji({
1069
+ return ro(void 0, e.autoRouting && Zo.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1070
+ }, [ro]), Uc = D((e) => {
1071
+ if (!jc) return !1;
1072
+ let t = e !== void 0, n = w.getState(), r = Yi({
1072
1073
  spoken: t,
1073
- bound: ds.current,
1074
+ bound: fs.current,
1074
1075
  activeConversationId: n.activeConversationId,
1075
1076
  conversations: n.conversations,
1076
1077
  historyOn: xe()
1077
1078
  });
1078
- if (r && Ac(r), t) {
1079
+ if (r && jc(r), t) {
1079
1080
  let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? P("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : P("deleteConversation.nothing", "There is no conversation to delete.");
1080
- Rc.current({
1081
+ zc.current({
1081
1082
  id: `conversation-delete:${N()}`,
1082
1083
  text: t,
1083
1084
  lang: t === e ? "en" : V
1084
1085
  });
1085
- } else r || Bc(Date.now());
1086
+ } else r || Vc(Date.now());
1086
1087
  return !0;
1087
1088
  }, [
1088
- Ac,
1089
+ jc,
1089
1090
  V,
1090
1091
  P
1091
- ]), Uc = D((e, t, n, r = !1, i) => {
1092
- if (e.kind === "conversation-delete") return Hc(n);
1092
+ ]), Wc = D((e, t, n, r = !1, i) => {
1093
+ if (e.kind === "conversation-delete") return Uc(n);
1093
1094
  let { theme: a, navigate: o } = Y.current, s = null, c = () => {
1094
- let e = (r ? null : s ?? w.getState().activeConversationId) ?? Vc();
1095
- return r && gs(e), e;
1095
+ let e = (r ? null : s ?? w.getState().activeConversationId) ?? Hc();
1096
+ return r && _s(e), e;
1096
1097
  }, l = (e, r) => {
1097
1098
  let i = N();
1098
1099
  return W(e, {
@@ -1117,33 +1118,33 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1117
1118
  localAction: a,
1118
1119
  ...lr(n)
1119
1120
  }
1120
- }), Ri.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && Zs(i, {
1121
+ }), zi.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && Qs(i, {
1121
1122
  conversationId: e,
1122
1123
  questionId: t,
1123
1124
  replyId: l
1124
- }), s && Gs(e, l), l;
1125
+ }), s && Ks(e, l), l;
1125
1126
  }, d = (e, t, n) => {
1126
1127
  let r = c(), i = l(r, t), a = u(r, i, e, t, T(), !0);
1127
1128
  return n?.(a), !0;
1128
1129
  }, f = (e) => {
1129
- let t = c(), n = T(), r = window.location.pathname, a = Ni({
1130
+ let t = c(), n = T(), r = window.location.pathname, a = Pi({
1130
1131
  destinationId: e.destinationId,
1131
1132
  path: e.registryPath,
1132
1133
  alreadyHere: !1,
1133
1134
  via: e.via,
1134
1135
  offer: e.offer
1135
1136
  }), s = l(t, a), d = i === void 0 ? void 0 : N();
1136
- i !== void 0 && d !== void 0 && (Ys(i, {
1137
+ i !== void 0 && d !== void 0 && (Xs(i, {
1137
1138
  conversationId: t,
1138
1139
  questionId: s,
1139
1140
  replyId: d
1140
- }), pc(d));
1141
+ }), mc(d));
1141
1142
  let f = N();
1142
- lc.current = f, dc(!0);
1143
+ uc.current = f, fc(!0);
1143
1144
  let p = (i) => {
1144
1145
  try {
1145
- if (e.offer && xc(e.offer.offerId, i) && gc(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1146
- let a = Rr(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Ni({
1146
+ if (e.offer && Sc(e.offer.offerId, i) && _c(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
1147
+ let a = zr(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Pi({
1147
1148
  destinationId: e.destinationId,
1148
1149
  path: e.registryPath,
1149
1150
  alreadyHere: !1,
@@ -1151,10 +1152,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1151
1152
  outcome: i,
1152
1153
  offer: e.offer
1153
1154
  });
1154
- ao(t, s, { localAction: c });
1155
- let l = e.via === "back" && i.status === "arrived" ? Br(P, e.pageLabel()) : Kr(P, i, {
1155
+ oo(t, s, { localAction: c });
1156
+ let l = e.via === "back" && i.status === "arrived" ? Vr(P, e.pageLabel()) : qr(P, i, {
1156
1157
  page: e.pageLabel(),
1157
- landed: o === null ? null : Fi(a, o),
1158
+ landed: o === null ? null : Ii(a, o),
1158
1159
  path: e.target
1159
1160
  }), f = u(t, s, l, c, n, X.current, d);
1160
1161
  i.status === "arrived" && e.onArrived?.({
@@ -1163,10 +1164,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1163
1164
  landedPath: i.landedPath
1164
1165
  });
1165
1166
  } finally {
1166
- lc.current === f && (lc.current = null, X.current && dc(!1)), d !== void 0 && X.current && pc((e) => e === d ? null : e);
1167
+ uc.current === f && (uc.current = null, X.current && fc(!1)), d !== void 0 && X.current && mc((e) => e === d ? null : e);
1167
1168
  }
1168
1169
  };
1169
- return Li(o, e.target, {
1170
+ return Ri(o, e.target, {
1170
1171
  readPath: () => window.location.pathname + window.location.search,
1171
1172
  now: () => Date.now(),
1172
1173
  schedule: (e, t) => {
@@ -1174,7 +1175,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1174
1175
  },
1175
1176
  isShellLess: () => !X.current
1176
1177
  }).then(p, () => p({ status: "unconfirmed" })), !0;
1177
- }, p = ({ replyId: e, fromPath: t, landedPath: n }) => Ai.push({
1178
+ }, p = ({ replyId: e, fromPath: t, landedPath: n }) => ji.push({
1178
1179
  fromPath: t,
1179
1180
  toPath: n,
1180
1181
  replyMessageId: e,
@@ -1182,21 +1183,21 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1182
1183
  });
1183
1184
  if (e.kind === "theme") {
1184
1185
  if (!a) return !1;
1185
- let t = zr(e.request, {
1186
+ let t = Br(e.request, {
1186
1187
  mode: a.mode,
1187
1188
  resolvedTheme: a.resolvedTheme
1188
1189
  });
1189
1190
  if (!t.alreadyApplied) try {
1190
1191
  a.setMode(t.mode);
1191
1192
  } catch {}
1192
- return d($r(P, t, e.request.kind === "family"), {
1193
+ return d(ei(P, t, e.request.kind === "family"), {
1193
1194
  kind: "theme",
1194
1195
  mode: t.mode,
1195
1196
  alreadyApplied: t.alreadyApplied
1196
1197
  });
1197
1198
  }
1198
1199
  if (e.kind === "app-control") {
1199
- let t = ai(e.request, { voiceLive: n !== void 0 || Vl.current });
1200
+ let t = oi(e.request, { voiceLive: n !== void 0 || Hl.current });
1200
1201
  if (!t) return !1;
1201
1202
  let r = (e) => ({
1202
1203
  kind: "app-control",
@@ -1204,34 +1205,34 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1204
1205
  outcome: e.outcome,
1205
1206
  ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
1206
1207
  }), i = (t) => {
1207
- if (e.request.control === "language" && sc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1208
- let n = c(), i = r(t), a = l(n, i), o = u(n, a, ti((e, t) => t, t.reply), i, T(), !1);
1209
- return rc.current = {
1208
+ if (e.request.control === "language" && cc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1209
+ let n = c(), i = r(t), a = l(n, i), o = u(n, a, ni((e, t) => t, t.reply), i, T(), !1);
1210
+ return ic.current = {
1210
1211
  wanted: e.request.code,
1211
1212
  reply: t.reply,
1212
1213
  conversationId: n,
1213
1214
  messageId: o,
1214
- deadline: window.setTimeout(cc, ni)
1215
- }, ac(o), !0;
1215
+ deadline: window.setTimeout(lc, ri)
1216
+ }, oc(o), !0;
1216
1217
  }
1217
- return d(ti(P, t.reply), r(t));
1218
+ return d(ni(P, t.reply), r(t));
1218
1219
  };
1219
1220
  if (t.kind === "reply") return i(t.run);
1220
1221
  if (t.kind === "run") {
1221
1222
  let e = t.run();
1222
1223
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
1223
1224
  }
1224
- let a = kc;
1225
+ let a = Ac;
1225
1226
  if (!a) return !1;
1226
1227
  let o = null;
1227
- return d(ti(P, t.ask.reply), r(t.ask), (e) => {
1228
+ return d(ni(P, t.ask.reply), r(t.ask), (e) => {
1228
1229
  o = w.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1229
1230
  }), a.request({
1230
1231
  prompt: t.prompt,
1231
1232
  onConfirm: () => {
1232
1233
  let e = t.confirmed(), i = o, a = i !== null && w.getState().conversations.some((e) => e.id === i);
1233
1234
  if (!i || !a) return;
1234
- let s = ti(P, e.reply);
1235
+ let s = ni(P, e.reply);
1235
1236
  W(i, {
1236
1237
  id: N(),
1237
1238
  role: "assistant",
@@ -1247,23 +1248,23 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1247
1248
  }), !0;
1248
1249
  }
1249
1250
  if (!o) return !1;
1250
- if (e.kind === "choose-destination") return d(Vr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1251
+ if (e.kind === "choose-destination") return d(Hr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
1251
1252
  kind: "choose-destination",
1252
1253
  candidateIds: e.candidates.map((e) => e.id)
1253
- }, (t) => mi(t, e.candidates));
1254
- if (e.kind === "choose-linked") return d(Hr(P, e.candidates), {
1254
+ }, (t) => hi(t, e.candidates));
1255
+ if (e.kind === "choose-linked") return d(Ur(P, e.candidates), {
1255
1256
  kind: "choose-destination",
1256
1257
  candidateIds: e.candidates.map((e) => e.id)
1257
- }, (t) => mi(t, e.candidates));
1258
+ }, (t) => hi(t, e.candidates));
1258
1259
  if (e.kind === "pick-from-list") {
1259
1260
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
1260
- return d(Xr(P), t ? {
1261
+ return d(Zr(P), t ? {
1261
1262
  kind: "choose-destination",
1262
1263
  candidateIds: t.map((e) => e.id)
1263
1264
  } : e.candidateIds.length > 0 ? {
1264
1265
  kind: "choose-destination",
1265
1266
  candidateIds: [...e.candidateIds]
1266
- } : Ni({
1267
+ } : Pi({
1267
1268
  destinationId: "",
1268
1269
  path: "",
1269
1270
  alreadyHere: !1,
@@ -1272,9 +1273,9 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1272
1273
  status: "refused",
1273
1274
  reason: "not-routable"
1274
1275
  }
1275
- }), t ? (e) => mi(e, t) : void 0);
1276
+ }), t ? (e) => hi(e, t) : void 0);
1276
1277
  }
1277
- if (e.kind === "link-not-openable") return d(Wr(P), Ni({
1278
+ if (e.kind === "link-not-openable") return d(Gr(P), Pi({
1278
1279
  destinationId: "",
1279
1280
  path: "",
1280
1281
  alreadyHere: !1,
@@ -1287,7 +1288,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1287
1288
  if (e.kind === "open-record") {
1288
1289
  let r;
1289
1290
  try {
1290
- let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = gi(n);
1291
+ let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = _i(n);
1291
1292
  r = (t.records ?? []).flatMap((t) => {
1292
1293
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
1293
1294
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -1300,18 +1301,18 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1300
1301
  }
1301
1302
  if (r.length === 0) return !1;
1302
1303
  let i = w.getState().activeConversationId, a = N();
1303
- lc.current = a, dc(!0);
1304
+ uc.current = a, fc(!0);
1304
1305
  let o = () => {
1305
- lc.current === a && (lc.current = null, X.current && dc(!1));
1306
+ uc.current === a && (uc.current = null, X.current && fc(!1));
1306
1307
  };
1307
1308
  return (async () => {
1308
1309
  let a = { kind: "none" }, c = !0;
1309
1310
  try {
1310
- a = await hi({
1311
+ a = await gi({
1311
1312
  name: e.request.name,
1312
1313
  usable: r,
1313
- nounOf: (e) => Ur(P, e.noun),
1314
- timeoutMs: sa
1314
+ nounOf: (e) => Wr(P, e.noun),
1315
+ timeoutMs: ca
1315
1316
  }), c = w.getState().conversations.some((e) => e.id === i);
1316
1317
  } catch {
1317
1318
  a = { kind: "none" };
@@ -1320,7 +1321,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1320
1321
  }
1321
1322
  if (!X.current) return;
1322
1323
  if (a.kind === "none") {
1323
- Jc.current(t, [], {
1324
+ Yc.current(t, [], {
1324
1325
  fromPerson: !0,
1325
1326
  ...n === void 0 ? {} : { voiceSessionId: n },
1326
1327
  localRecordsChecked: !0
@@ -1341,16 +1342,16 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1341
1342
  return;
1342
1343
  }
1343
1344
  let l = a.candidates[0];
1344
- d(a.why === "kinds" ? Qr(P, a.nouns, a.candidates) : Zr(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1345
+ d(a.why === "kinds" ? $r(P, a.nouns, a.candidates) : Qr(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1345
1346
  kind: "choose-destination",
1346
1347
  candidateIds: a.candidates.map((e) => e.id)
1347
- }, (e) => mi(e, a.candidates));
1348
+ }, (e) => hi(e, a.candidates));
1348
1349
  })().catch(() => void 0), !0;
1349
1350
  }
1350
1351
  if (e.kind === "back") {
1351
- let e = Ai.top();
1352
+ let e = ji.top();
1352
1353
  if (!e) return !1;
1353
- let t = Rr(Y.current.navItems), n = Pi(t, e.fromPath);
1354
+ let t = zr(Y.current.navItems), n = Fi(t, e.fromPath);
1354
1355
  return f({
1355
1356
  target: e.fromPath,
1356
1357
  destinationId: n?.id ?? "",
@@ -1358,27 +1359,27 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1358
1359
  via: "back",
1359
1360
  pageLabel: () => n?.label ?? null,
1360
1361
  onArrived: () => {
1361
- Ai.top() === e && Ai.pop();
1362
+ ji.top() === e && ji.pop();
1362
1363
  }
1363
1364
  });
1364
1365
  }
1365
1366
  let ee, m = e.destination;
1366
1367
  if (e.via === "offer") {
1367
- let t = yc(e.offerId, e.destination.label);
1368
- if (!t.ok) return d(t.copy ?? qr(P), {
1368
+ let t = bc(e.offerId, e.destination.label);
1369
+ if (!t.ok) return d(t.copy ?? Jr(P), {
1369
1370
  kind: "write-reply",
1370
1371
  line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
1371
1372
  });
1372
1373
  ee = {
1373
1374
  trigger: e.trigger,
1374
1375
  offerId: e.offerId
1375
- }, m = Rr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1376
+ }, m = zr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1376
1377
  id: t.target.id,
1377
1378
  label: t.target.label,
1378
1379
  path: t.target.path
1379
1380
  };
1380
1381
  }
1381
- return Fr(m, window.location.pathname + window.location.search, Rr(Y.current.navItems)) ? d(Gr(P, m.label, !0), Ni({
1382
+ return Ir(m, window.location.pathname + window.location.search, zr(Y.current.navItems)) ? d(Kr(P, m.label, !0), Pi({
1382
1383
  destinationId: m.id,
1383
1384
  path: m.path,
1384
1385
  alreadyHere: !0,
@@ -1395,44 +1396,44 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1395
1396
  });
1396
1397
  }, [
1397
1398
  W,
1398
- gs,
1399
- kc,
1400
- Vc,
1401
- cc,
1402
- V,
1403
- ao,
1404
- Ys,
1399
+ _s,
1400
+ Ac,
1405
1401
  Hc,
1406
- Zs,
1407
- sc,
1408
- Gs,
1402
+ lc,
1403
+ V,
1404
+ oo,
1405
+ Xs,
1406
+ Uc,
1407
+ Qs,
1408
+ cc,
1409
+ Ks,
1409
1410
  P,
1410
- yc,
1411
- xc,
1412
- gc
1413
- ]), Wc = D(async (e) => {
1414
- Qo.current = !0, es(!0);
1411
+ bc,
1412
+ Sc,
1413
+ _c
1414
+ ]), Gc = D(async (e) => {
1415
+ $o.current = !0, ts(!0);
1415
1416
  try {
1416
1417
  await K.declineForReply(e.conversationId, e.reason, e.origin);
1417
1418
  } finally {
1418
- Qo.current = !1, X.current && es(!1);
1419
+ $o.current = !1, X.current && ts(!1);
1419
1420
  }
1420
1421
  if (e.commandText !== null) {
1421
- let t = Mc(e.commandText, e.options.voiceSessionId);
1422
- if (t && Uc(t, e.content, e.options.voiceSessionId)) return;
1422
+ let t = Nc(e.commandText, e.options.voiceSessionId);
1423
+ if (t && Wc(t, e.content, e.options.voiceSessionId)) return;
1423
1424
  }
1424
- await Jc.current(e.content, e.attachments, e.options);
1425
+ await Yc.current(e.content, e.attachments, e.options);
1425
1426
  }, [
1426
- Mc,
1427
- Uc,
1427
+ Nc,
1428
+ Wc,
1428
1429
  K
1429
1430
  ]), Q = D(async (n, r = [], i = {}) => {
1430
- let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = ds.current;
1431
- if (a && pr(c)) {
1432
- let e = vr(c, o.activeConversationId, ys());
1431
+ let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = fs.current;
1432
+ if (a && mr(c)) {
1433
+ let e = yr(c, o.activeConversationId, bs());
1433
1434
  if (e.kind === "gone") return;
1434
1435
  let t = i.voiceEntry ?? e;
1435
- t.kind === "adopt" && gs(t.conversationId), s = t.kind === "own", i = {
1436
+ t.kind === "adopt" && _s(t.conversationId), s = t.kind === "own", i = {
1436
1437
  ...i,
1437
1438
  voiceEntry: t
1438
1439
  };
@@ -1442,7 +1443,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1442
1443
  if (On(o.processingByConversationId[u]?.status)) {
1443
1444
  if (i.avatarTabAsk !== void 0) return;
1444
1445
  let e = o.processingByConversationId[u]?.messageId ?? null;
1445
- e && i.correctsInFlightTurn === !0 && !Rs.current.has(e) && Vs(), e && Rs.current.has(e) && (zs.current = {
1446
+ e && i.correctsInFlightTurn === !0 && !zs.current.has(e) && Hs(), e && zs.current.has(e) && (Bs.current = {
1446
1447
  conversationId: u,
1447
1448
  content: n,
1448
1449
  attachments: r,
@@ -1450,10 +1451,10 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1450
1451
  });
1451
1452
  return;
1452
1453
  }
1453
- if (Cs.current.has(u)) return;
1454
+ if (ws.current.has(u)) return;
1454
1455
  }
1455
- if (Zo.current || Tr() !== null || Qo.current || lc.current !== null) return;
1456
- let d = i.targetConversationId, f = Ki(), p = (e) => Vi(e) || Bi(e, f);
1456
+ if (Qo.current || Er() !== null || $o.current || uc.current !== null) return;
1457
+ let d = i.targetConversationId, f = qi(), p = (e) => Hi(e) || Vi(e, f);
1457
1458
  if (d !== void 0) {
1458
1459
  let e = o.conversations.find((e) => e.id === d);
1459
1460
  if (o.activeConversationId !== d || !e || e.mode !== o.mode || p(e)) return;
@@ -1461,29 +1462,29 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1461
1462
  if (i.avatarTabAsk !== void 0) {
1462
1463
  let e = l ? o.conversations.find((e) => e.id === l) : void 0, t = e && !p(e) ? e : void 0;
1463
1464
  if (qe({
1464
- auto: o.autoRouting && Xo.current && d === void 0,
1465
+ auto: o.autoRouting && Zo.current && d === void 0,
1465
1466
  selectedMode: o.mode,
1466
1467
  conversation: t ? {
1467
1468
  mode: t.mode,
1468
1469
  routedBy: t.routedBy,
1469
- hasHistory: zi(t)
1470
+ hasHistory: Bi(t)
1470
1471
  } : null,
1471
- modeWrites: (e) => Ho.current.find((t) => t.id === e)?.writeCapable === !0 || gt(e)
1472
+ modeWrites: (e) => Uo.current.find((t) => t.id === e)?.writeCapable === !0 || gt(e)
1472
1473
  }) !== null) return;
1473
1474
  }
1474
1475
  if (i.fromPerson && i.writeReplyBound === void 0) {
1475
- let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Ic(e, i.voiceSessionId), o = se({
1476
+ let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Lc(e, i.voiceSessionId), o = se({
1476
1477
  text: n,
1477
- locale: t === "spoken" ? qa.input.code : V,
1478
+ locale: t === "spoken" ? Ja.input.code : V,
1478
1479
  origin: t,
1479
1480
  hasAttachments: r.length > 0 || i.focus !== void 0,
1480
1481
  live: K.liveFor(e),
1481
- matchesLocalCommand: (e) => Mc(e, i.voiceSessionId) !== null,
1482
+ matchesLocalCommand: (e) => Nc(e, i.voiceSessionId) !== null,
1482
1483
  offer: a.state,
1483
- offerAssent: a.state !== "none" && ei({
1484
+ offerAssent: a.state !== "none" && ti({
1484
1485
  text: n,
1485
1486
  uiLocale: V,
1486
- inputLocale: qa.input.code,
1487
+ inputLocale: Ja.input.code,
1487
1488
  commandLocales: Y.current.options.commandLocales,
1488
1489
  manifest: Y.current.options.commandManifest,
1489
1490
  leaveGuard: Y.current.options.leaveGuard
@@ -1491,14 +1492,14 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1491
1492
  });
1492
1493
  if (o.kind === "accept_offer") {
1493
1494
  let e = a.accept;
1494
- if (e && Uc({
1495
+ if (e && Wc({
1495
1496
  kind: "navigate",
1496
1497
  destination: e.destination,
1497
1498
  via: "offer",
1498
1499
  offerId: e.offerId,
1499
1500
  trigger: "yes"
1500
1501
  }, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1501
- Xs(i.avatarTabAsk);
1502
+ Zs(i.avatarTabAsk);
1502
1503
  return;
1503
1504
  }
1504
1505
  o = {
@@ -1515,11 +1516,11 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1515
1516
  };
1516
1517
  }
1517
1518
  if (o.kind === "local_reply") {
1518
- e && Lc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1519
+ e && Rc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
1519
1520
  return;
1520
1521
  }
1521
1522
  let c = o.kind === "local" ? o.fallback : o.bound, u = o.declineAll;
1522
- if (u !== null && e) return i.avatarTabAsk === void 0 ? Wc({
1523
+ if (u !== null && e) return i.avatarTabAsk === void 0 ? Gc({
1523
1524
  conversationId: e,
1524
1525
  reason: u,
1525
1526
  origin: t,
@@ -1538,50 +1539,50 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1538
1539
  }
1539
1540
  let ee = i.writeReplyBound?.promptText ?? n;
1540
1541
  if (i.fromPerson && r.length === 0 && i.focus === void 0 && i.writeReplyBound?.localCommands !== !1) {
1541
- let e = Mc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1542
- if (e && Uc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1543
- Xs(i.avatarTabAsk);
1542
+ let e = Nc(n, i.voiceSessionId, i.localRecordsChecked === !0);
1543
+ if (e && Wc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
1544
+ Zs(i.avatarTabAsk);
1544
1545
  return;
1545
1546
  }
1546
1547
  }
1547
- let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && Xo.current && d === void 0 ? pe({
1548
+ let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && Zo.current && d === void 0 ? pe({
1548
1549
  intent: i.avatarTabAsk === void 0 ? i.autoIntent ?? ue(n) : "read",
1549
1550
  dictated: a,
1550
- voiceProposalBound: a && La("api-calls") && Jn(o.acknowledgedWriteModes, "api-calls"),
1551
+ voiceProposalBound: a && Ra("api-calls") && Jn(o.acknowledgedWriteModes, "api-calls"),
1551
1552
  conversation: h ? {
1552
1553
  mode: h.mode,
1553
1554
  routedBy: h.routedBy,
1554
- hasHistory: zi(h)
1555
+ hasHistory: Bi(h)
1555
1556
  } : null
1556
1557
  }) : null;
1557
- if (g && Ho.current.find((e) => e.id === g.mode)?.writeCapable && !Jn(o.acknowledgedWriteModes, g.mode)) {
1558
- Zo.current = {
1558
+ if (g && Uo.current.find((e) => e.id === g.mode)?.writeCapable && !Jn(o.acknowledgedWriteModes, g.mode)) {
1559
+ Qo.current = {
1559
1560
  content: n,
1560
1561
  attachments: r,
1561
1562
  options: i
1562
- }, rs(g.mode);
1563
+ }, is(g.mode);
1563
1564
  return;
1564
1565
  }
1565
1566
  let _ = g ? g.mode : o.mode, te, ne, v = d ?? (s ? null : H), re = v ? w.getState().conversations.find((e) => e.id === v) : void 0, ie = g?.action === "escalate" && h ? {
1566
1567
  mode: h.mode,
1567
1568
  backendSessionId: h.backendSessionId ?? null
1568
1569
  } : null;
1569
- if (g) g.action === "new" || !h ? v = no(void 0, _, { routedBy: "auto" }) : (v = h.id, _o(v, _));
1570
+ if (g) g.action === "new" || !h ? v = ro(void 0, _, { routedBy: "auto" }) : (v = h.id, vo(v, _));
1570
1571
  else {
1571
1572
  let e = o.autoRouting ? { routedBy: "auto" } : void 0;
1572
- !v || p(re) || re && re.mode !== _ && zi(re) ? v = no(void 0, _, e) : re && re.mode !== _ && (e ? _o(v, _) : eo(v, _));
1573
+ !v || p(re) || re && re.mode !== _ && Bi(re) ? v = ro(void 0, _, e) : re && re.mode !== _ && (e ? vo(v, _) : to(v, _));
1573
1574
  }
1574
1575
  if (!v) return;
1575
- a && ds.current !== void 0 && v !== o.activeConversationId && gs(v), i.approvalFollowUp || (bs.current[v] = r);
1576
+ a && fs.current !== void 0 && v !== o.activeConversationId && _s(v), i.approvalFollowUp || (xs.current[v] = r);
1576
1577
  let ae = () => w.getState().conversations.some((e) => e.id === v), y = T(), b = {
1577
- accessToken: Ra(),
1578
- workspaceToken: za(),
1578
+ accessToken: za(),
1579
+ workspaceToken: Ba(),
1579
1580
  userId: B,
1580
1581
  organizationId: Vt()
1581
1582
  }, le = (e, t) => {
1582
1583
  !ae() && y && st(e, y, t, _, {
1583
- accessToken: Ra(),
1584
- workspaceToken: za(),
1584
+ accessToken: za(),
1585
+ workspaceToken: Ba(),
1585
1586
  userId: B,
1586
1587
  organizationId: Vt()
1587
1588
  });
@@ -1601,7 +1602,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1601
1602
  }
1602
1603
  };
1603
1604
  W(v, fe);
1604
- let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? Ei(n, a ? qa.input.code : V) : null, he = {
1605
+ let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? Di(n, a ? Ja.input.code : V) : null, he = {
1605
1606
  location: window.location.pathname + window.location.search,
1606
1607
  conversationId: w.getState().activeConversationId,
1607
1608
  workspaceId: T(),
@@ -1613,17 +1614,17 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1613
1614
  content: "",
1614
1615
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1615
1616
  metadata: {
1616
- lang: Xa,
1617
+ lang: Za,
1617
1618
  ...lr(i.voiceSessionId)
1618
1619
  }
1619
1620
  }), sn(x, {
1620
1621
  channel: a ? "voice" : "chat",
1621
1622
  mode: _,
1622
1623
  product: L,
1623
- language: Xa,
1624
+ language: Za,
1624
1625
  device: ln(),
1625
1626
  routedByAuto: !!g
1626
- }, i.voiceTiming), E(x, "accepted"), oo(v, "provisioning", x, null), Er(x), i.avatarTabAsk !== void 0 && Zs(i.avatarTabAsk, {
1627
+ }, i.voiceTiming), E(x, "accepted"), so(v, "provisioning", x, null), Dr(x), i.avatarTabAsk !== void 0 && Qs(i.avatarTabAsk, {
1627
1628
  conversationId: v,
1628
1629
  questionId: fe.id,
1629
1630
  replyId: x
@@ -1631,13 +1632,13 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1631
1632
  let ge = () => {
1632
1633
  let e = kn({
1633
1634
  turnId: x,
1634
- abortRequested: Rs.current.has(x),
1635
+ abortRequested: zs.current.has(x),
1635
1636
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1636
1637
  conversationExists: ae()
1637
1638
  });
1638
1639
  return e.abandon && ye(), e;
1639
- }, _e = (e, t, n, r, a = !1, o = Xa) => {
1640
- io(v, x, { content: Et(e) }), ao(v, x, {
1640
+ }, _e = (e, t, n, r, a = !1, o = Za) => {
1641
+ ao(v, x, { content: Et(e) }), oo(v, x, {
1641
1642
  lang: o,
1642
1643
  ...t?.length ? { artifacts: t } : {},
1643
1644
  ...t?.length || n || r ? { mode: _ } : {},
@@ -1660,17 +1661,17 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1660
1661
  E(x, "attemptStarted");
1661
1662
  let s = null, c = null, l = !1;
1662
1663
  try {
1663
- let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await As(v, x, _, y, b, {
1664
+ let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await js(v, x, _, y, b, {
1664
1665
  isAbandoned: () => kn({
1665
1666
  turnId: x,
1666
- abortRequested: Rs.current.has(x),
1667
+ abortRequested: zs.current.has(x),
1667
1668
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1668
1669
  conversationExists: ae()
1669
1670
  }).abandon,
1670
1671
  ...o ? { verifySession: !0 } : {}
1671
1672
  });
1672
1673
  if (s = e, we(), we = t(e, () => {
1673
- Rs.current.add(x), Mt(x), kt.abort(x);
1674
+ zs.current.add(x), Mt(x), kt.abort(x);
1674
1675
  }), E(x, "runtimeReady"), cn(x, {
1675
1676
  runtime: p ? "cold" : h ? "adopted" : m ? "probed" : re ? "preopened" : d ? "new-session" : "warm",
1676
1677
  deadSandboxProbe: g
@@ -1680,22 +1681,22 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1680
1681
  }, F) {
1681
1682
  let e = ge();
1682
1683
  if (e.abandon) {
1683
- e.clearProcessing && so(v);
1684
+ e.clearProcessing && co(v);
1684
1685
  return;
1685
1686
  }
1686
1687
  }
1687
1688
  if (Yn(_, te, w.getState().acknowledgedWriteModes, {
1688
1689
  dictated: a,
1689
1690
  confirmsWrites: gt(_),
1690
- proposalBound: La(_, e)
1691
+ proposalBound: Ra(_, e)
1691
1692
  }) === "voice-in-write-mode") throw new Wt("voice-in-write-mode", "Voice in a write mode");
1692
- let se = Ui({
1693
+ let se = Wi({
1693
1694
  conversation: w.getState().conversations.find((e) => e.id === v),
1694
1695
  content: n,
1695
1696
  sessionIsNew: d,
1696
1697
  sendingMode: _,
1697
1698
  sendingModeConfig: te,
1698
- modes: Ho.current,
1699
+ modes: Uo.current,
1699
1700
  answerText: (e) => Xe(e).text
1700
1701
  });
1701
1702
  if (be(), Kn()) {
@@ -1710,7 +1711,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1710
1711
  channel: "voice",
1711
1712
  voiceSessionId: i.voiceSessionId,
1712
1713
  text: t,
1713
- lang: Xa,
1714
+ lang: Za,
1714
1715
  final: !1
1715
1716
  }, e));
1716
1717
  },
@@ -1727,21 +1728,21 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1727
1728
  });
1728
1729
  }
1729
1730
  let ue = ie ?? await Lt(() => pt(e, y, u, _, b, { limit: 50 }), d, Ft(f, e, u));
1730
- Os(v, x, "streaming", "thinking");
1731
- let de = Ma?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = bi(e, u), Ee = Se.options.uiCatalogue ? _i(Rr(Se.navItems), {
1731
+ ks(v, x, "streaming", "thinking");
1732
+ let de = Na?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = xi(e, u), Ee = Se.options.uiCatalogue ? vi(zr(Se.navItems), {
1732
1733
  permissionsSettled: Se.navPermissionsSettled,
1733
1734
  simulating: Se.navSimulating,
1734
- sentBefore: yi(Te)
1735
+ sentBefore: bi(Te)
1735
1736
  }) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? Tt({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
1736
1737
  conversationId: v,
1737
1738
  writeReply: pe === "proposal-v1" ? i.writeReplyBound?.writeReply ?? null : null,
1738
1739
  ...Ee ? { uiCatalogue: Ee } : {},
1739
1740
  ...Oe.length > 0 ? { clientTools: Oe } : {}
1740
1741
  }, { prompt: Ae, parts: je } = yn({
1741
- content: na(se ? `${se}${ee}` : ee, i.focus),
1742
+ content: ra(se ? `${se}${ee}` : ee, i.focus),
1742
1743
  attachments: r,
1743
1744
  limits: _n(te),
1744
- wrapPrompt: (e) => Na?.(_, e, Ja, Ya, a, { writeApproval: pe }) ?? e,
1745
+ wrapPrompt: (e) => Pa?.(_, e, Ya, Xa, a, { writeApproval: pe }) ?? e,
1745
1746
  requestBytes: (t, n) => vt({
1746
1747
  sandboxId: e,
1747
1748
  workspaceId: y,
@@ -1757,7 +1758,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1757
1758
  l = mn(r) > Me;
1758
1759
  let Pe = ge();
1759
1760
  if (Pe.abandon) {
1760
- Pe.clearProcessing && so(v);
1761
+ Pe.clearProcessing && co(v);
1761
1762
  return;
1762
1763
  }
1763
1764
  let Fe = (t) => Ce.dispatch({
@@ -1776,8 +1777,8 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1776
1777
  if (!Ce.canFailover() || !je || !En(e)) throw e;
1777
1778
  await Fe(void 0), l ||= Ne;
1778
1779
  }
1779
- Ee && vi(Te);
1780
- let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && Ci(Ie) ? B : null, Re = !!Le;
1780
+ Ee && yi(Te);
1781
+ let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && wi(Ie) ? B : null, Re = !!Le;
1781
1782
  Le && Z.recordTurn({
1782
1783
  replyId: x,
1783
1784
  conversationId: v,
@@ -1792,8 +1793,8 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1792
1793
  tools: De.tools,
1793
1794
  post: (t, n) => _t(e, y, u, t, n, _, b)
1794
1795
  }) : null, Be = ze ? (e) => ze.receive(e) : void 0, Ve = Re ? (e, t) => {
1795
- Z.receive(x, e, t, performance.now()) && gc();
1796
- } : void 0, He = (e) => io(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("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._")}` : e;
1796
+ Z.receive(x, e, t, performance.now()) && _c();
1797
+ } : void 0, He = (e) => ao(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("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._")}` : e;
1797
1798
  E(x, "promptSent");
1798
1799
  let We = null, Ge = !1, Ke = Nt, C = Pt([], ue);
1799
1800
  S.render?.arm(ue);
@@ -1812,28 +1813,28 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1812
1813
  le(e, u);
1813
1814
  let t = ge();
1814
1815
  if (t.abandon) {
1815
- t.clearProcessing && so(v);
1816
+ t.clearProcessing && co(v);
1816
1817
  return;
1817
1818
  }
1818
1819
  let n = Date.now(), r = await et.next();
1819
- Re && Z.observeMessages(x, r) && gc(), C = Pt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1820
+ Re && Z.observeMessages(x, r) && _c(), C = Pt(r, ue, { accumulateNarration: ne.accumulatesNarration });
1820
1821
  let i = Ot(Qe, C.done, Ze, Date.now());
1821
1822
  if (i !== C.done && (C = {
1822
1823
  ...C,
1823
1824
  done: i
1824
- }), io(v, x, { content: Et(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = dn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1825
+ }), ao(v, x, { content: Et(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = dn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
1825
1826
  else {
1826
1827
  let e = Bt(Ke, C, dn());
1827
1828
  Ke = e.tracker, e.confirmedAt !== null && E(x, "firstText", e.confirmedAt);
1828
1829
  }
1829
- if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && ao(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? cn(x, {
1830
+ if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && oo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? cn(x, {
1830
1831
  transport: S.stream.reachedOpen ? "sse" : "poll",
1831
1832
  live: Bn(S.stream.live)
1832
1833
  }) : cn(x, {
1833
1834
  transport: "poll",
1834
1835
  live: "none"
1835
1836
  }), ye()), C.done) {
1836
- E(x, "answerDone"), xs.current.markVerified(e), ne.continuesInBackground || It(e, u, r);
1837
+ E(x, "answerDone"), Ss.current.markVerified(e), ne.continuesInBackground || It(e, u, r);
1837
1838
  break;
1838
1839
  }
1839
1840
  if (S.render?.refresh(r), Date.now() - Je > 3e4 && (zn(e, y, b), Je = Date.now()), !et.hasPending()) {
@@ -1854,7 +1855,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1854
1855
  channel: "voice",
1855
1856
  voiceSessionId: i.voiceSessionId,
1856
1857
  text: e,
1857
- lang: Xa,
1858
+ lang: Za,
1858
1859
  final: !0
1859
1860
  }));
1860
1861
  }
@@ -1864,21 +1865,21 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1864
1865
  content: Ue(C.content)
1865
1866
  });
1866
1867
  let rt = !C.done;
1867
- _e(C.content, nt, u, e, rt), C.tokens && (io(v, x, { tokens: C.tokens }), Fa && Sn({
1868
+ _e(C.content, nt, u, e, rt), C.tokens && (ao(v, x, { tokens: C.tokens }), Ia && Sn({
1868
1869
  workspaceId: y,
1869
1870
  sessionId: u,
1870
1871
  messageId: C.messageId,
1871
1872
  model: C.model,
1872
1873
  tokens: C.tokens
1873
- }, Fa, { ledger: bn("panel", L) }).then((e) => {
1874
+ }, Ia, { ledger: bn("panel", L) }).then((e) => {
1874
1875
  e.ok && Ut(L);
1875
1876
  })), C.done || le(e, u);
1876
1877
  let it = ge();
1877
1878
  if (it.abandon) {
1878
- it.clearProcessing && so(v);
1879
+ it.clearProcessing && co(v);
1879
1880
  return;
1880
1881
  }
1881
- E(x, "complete"), cn(x, { outcome: "answered" }), oo(v, "complete", x, null), Ri.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Ec({
1882
+ E(x, "complete"), cn(x, { outcome: "answered" }), so(v, "complete", x, null), zi.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Dc({
1882
1883
  replyId: x,
1883
1884
  conversationId: v,
1884
1885
  voiceSessionId: i.voiceSessionId,
@@ -1887,27 +1888,27 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1887
1888
  });
1888
1889
  } catch (t) {
1889
1890
  let n = t instanceof In;
1890
- n || xs.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1891
+ n || Ss.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
1891
1892
  let r = kn({
1892
1893
  turnId: x,
1893
- abortRequested: Rs.current.has(x),
1894
+ abortRequested: zs.current.has(x),
1894
1895
  activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
1895
1896
  conversationExists: ae()
1896
1897
  });
1897
1898
  if (ye(), s && c && le(s, c), r.abandon) {
1898
- r.clearProcessing && so(v);
1899
+ r.clearProcessing && co(v);
1899
1900
  return;
1900
1901
  }
1901
- if (n) return we(), lo(v), be(), un(x), Te(e, !0);
1902
+ if (n) return we(), uo(v), be(), un(x), Te(e, !0);
1902
1903
  if (e === 1 && Ce.canFailover() && Dn(t)) {
1903
1904
  we();
1904
1905
  let e = s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null;
1905
- return e && (Ss.current.add(e), xs.current.invalidate(e)), lo(v), fo(_), ro(v, x, ""), ao(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), un(x), Te(2);
1906
+ return e && (Cs.current.add(e), Ss.current.invalidate(e)), uo(v), po(_), io(v, x, ""), oo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), un(x), Te(2);
1906
1907
  }
1907
1908
  throw t;
1908
1909
  }
1909
1910
  }, Ee = v;
1910
- Cs.current.add(Ee);
1911
+ ws.current.add(Ee);
1911
1912
  let De = Fn();
1912
1913
  Rn();
1913
1914
  try {
@@ -1915,33 +1916,33 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1915
1916
  code: "UNAUTHENTICATED",
1916
1917
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1917
1918
  } });
1918
- let e = await Zn(_, () => Ho.current.find((e) => e.id === _), Vo);
1919
+ let e = await Zn(_, () => Uo.current.find((e) => e.id === _), Ho);
1919
1920
  te = e.config, ne = e.capabilities;
1920
1921
  let t = te, n = ge();
1921
1922
  if (n.abandon) {
1922
- n.clearProcessing && so(v);
1923
+ n.clearProcessing && co(v);
1923
1924
  return;
1924
1925
  }
1925
1926
  let r = Yn(_, t, w.getState().acknowledgedWriteModes, {
1926
1927
  dictated: a,
1927
1928
  confirmsWrites: gt(_),
1928
- proposalBound: La(_)
1929
+ proposalBound: Ra(_)
1929
1930
  });
1930
1931
  if (r) throw new Wt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1931
1932
  let i = bn("panel", L);
1932
- if (Fa && await wn(i, y), Fa && xn(i, y)) {
1933
- let e = await Cn(i, y, Fa);
1933
+ if (Ia && await wn(i, y), Ia && xn(i, y)) {
1934
+ let e = await Cn(i, y, Ia);
1934
1935
  if (!e.ok) throw Tn(e.kind);
1935
1936
  let t = ge();
1936
1937
  if (t.abandon) {
1937
- t.clearProcessing && so(v);
1938
+ t.clearProcessing && co(v);
1938
1939
  return;
1939
1940
  }
1940
1941
  }
1941
1942
  E(x, "cleared"), await Te();
1942
1943
  } catch (e) {
1943
- if (xs.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1944
- so(v);
1944
+ if (Ss.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
1945
+ co(v);
1945
1946
  return;
1946
1947
  }
1947
1948
  let t = ve.session?.sandboxId ?? null, n = Gt(e, { confirmsNoAction: Kt({
@@ -1950,76 +1951,76 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
1950
1951
  }) });
1951
1952
  cn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Ht(L, "sandbox");
1952
1953
  let r = qt(n, P, { locale: V });
1953
- oo(v, "error", x, r.headline), io(v, x, { content: r.text }), ao(v, x, {
1954
+ so(v, "error", x, r.headline), ao(v, x, { content: r.text }), oo(v, x, {
1954
1955
  lang: r.translated ? V : "en",
1955
1956
  ...lr(i.voiceSessionId)
1956
1957
  });
1957
1958
  } finally {
1958
- we(), Cs.current.delete(Ee), cn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1959
+ we(), ws.current.delete(Ee), cn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
1959
1960
  let e = w.getState(), t = de(ie, _, e.conversations.find((e) => e.id === Ee), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1960
- t && (_o(Ee, t.mode), t.backendSessionId && co(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1961
+ t && (vo(Ee, t.mode), t.backendSessionId && lo(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
1961
1962
  ...ve.session,
1962
1963
  conversationId: Ee
1963
1964
  }, x);
1964
- let n = zs.current;
1965
- zs.current = null, n && n.conversationId === Ee && ae() && Jc.current(n.content, n.attachments, n.options), De();
1965
+ let n = Bs.current;
1966
+ Bs.current = null, n && n.conversationId === Ee && ae() && Yc.current(n.content, n.attachments, n.options), De();
1966
1967
  }
1967
1968
  }, [
1968
1969
  H,
1969
1970
  W,
1970
- Na,
1971
- lo,
1972
- fo,
1973
- Za,
1974
- no,
1975
- As,
1971
+ Pa,
1972
+ uo,
1973
+ po,
1974
+ Qa,
1975
+ ro,
1976
+ js,
1976
1977
  K,
1977
- Vs,
1978
- Lc,
1979
- Wc,
1978
+ Hs,
1979
+ Rc,
1980
+ Gc,
1980
1981
  V,
1981
- qa,
1982
- La,
1983
- Ma,
1982
+ Ja,
1984
1983
  Ra,
1984
+ Na,
1985
1985
  za,
1986
- io,
1986
+ Ba,
1987
+ ao,
1987
1988
  L,
1988
- Vo,
1989
- Fa,
1990
- Ya,
1991
- V,
1989
+ Ho,
1990
+ Ia,
1992
1991
  Xa,
1993
- Ja,
1994
- _o,
1995
- Uc,
1996
- Mc,
1997
- gs,
1998
- ys,
1999
- co,
2000
- eo,
2001
- oo,
1992
+ V,
1993
+ Za,
1994
+ Ya,
1995
+ vo,
1996
+ Wc,
1997
+ Nc,
1998
+ _s,
1999
+ bs,
2000
+ lo,
2001
+ to,
2002
2002
  so,
2003
+ co,
2003
2004
  P,
2004
- Os,
2005
- ro,
2005
+ ks,
2006
+ io,
2006
2007
  B,
2007
2008
  Z,
2008
- gc,
2009
- Ic,
2010
- Ec,
2009
+ _c,
2010
+ Lc,
2011
+ Dc,
2012
+ Qs,
2011
2013
  Zs,
2012
- Xs,
2013
2014
  F
2014
- ]), Gc = D((e, t) => {
2015
+ ]), Kc = D((e, t) => {
2015
2016
  Q(e, [], t ? { autoIntent: t } : {});
2016
- }, [Q]), Kc = et(), qc = D(() => {
2017
- let e = [...vo.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2017
+ }, [Q]), qc = et(), Jc = D(() => {
2018
+ let e = [...yo.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
2018
2019
  if (!e || e.metadata?.approvalFollowUp) return;
2019
- let t = H ? bs.current[H] ?? [] : [], n = ta(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2020
+ let t = H ? xs.current[H] ?? [] : [], n = na(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
2020
2021
  if (t.some((e) => rt(e, Date.now()))) {
2021
2022
  let n = H ?? void 0;
2022
- it(t, Kc).then((t) => {
2023
+ it(t, qc).then((t) => {
2023
2024
  Q(e.content, t, {
2024
2025
  ...n === void 0 ? {} : { targetConversationId: n },
2025
2026
  ...r
@@ -2027,113 +2028,113 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2027
2028
  });
2028
2029
  } else Q(e.content, t, r);
2029
2030
  }, [
2030
- yo,
2031
+ bo,
2031
2032
  Q,
2032
2033
  H,
2033
- Kc
2034
- ]), Jc = A(Q);
2034
+ qc
2035
+ ]), Yc = A(Q);
2035
2036
  O(() => {
2036
- Jc.current = Q;
2037
+ Yc.current = Q;
2037
2038
  }, [Q]);
2038
- let Yc = k(() => {
2039
- if (xo) return null;
2040
- for (let e = yo.length - 1; e >= 0; --e) {
2041
- let t = yo[e];
2039
+ let Xc = k(() => {
2040
+ if (So) return null;
2041
+ for (let e = bo.length - 1; e >= 0; --e) {
2042
+ let t = bo[e];
2042
2043
  if (t?.role !== "assistant") continue;
2043
- if (t.id === ic) return null;
2044
- if (!cr(t) || Rs.current.has(t.id) || jt(t.id)) continue;
2045
- let n = Qn(t, bo, P);
2044
+ if (t.id === ac) return null;
2045
+ if (!cr(t) || zs.current.has(t.id) || jt(t.id)) continue;
2046
+ let n = Qn(t, xo, P);
2046
2047
  if (n.kind !== "output") return null;
2047
2048
  let r = Xe(n.text).text.trim();
2048
- return r ? Sr(t, r, bo) : null;
2049
+ return r ? Cr(t, r, xo) : null;
2049
2050
  }
2050
2051
  return null;
2051
2052
  }, [
2052
- yo,
2053
- xo,
2054
2053
  bo,
2055
- ic,
2054
+ So,
2055
+ xo,
2056
+ ac,
2056
2057
  P
2057
- ]), Xc = k(() => Yc ? nr(Yc.text) : null, [Yc]), Zc = k(() => vo.chat.filter((e) => e.id !== ic), [vo.chat, ic]), Qc = k(() => I ? vo.all.filter((e) => e.id !== ic) : Zc, [
2058
+ ]), Zc = k(() => Xc ? nr(Xc.text) : null, [Xc]), Qc = k(() => yo.chat.filter((e) => e.id !== ac), [yo.chat, ac]), $c = k(() => I ? yo.all.filter((e) => e.id !== ac) : Qc, [
2058
2059
  I,
2059
- vo.all,
2060
- ic,
2061
- Zc
2062
- ]), [$c, el] = j(null), tl = w((e) => ot(e)?.sandboxId ?? null), nl = Or(Zc, {
2060
+ yo.all,
2061
+ ac,
2062
+ Qc
2063
+ ]), [el, tl] = j(null), nl = w((e) => ot(e)?.sandboxId ?? null), rl = kr(Qc, {
2063
2064
  sessionId: G?.backendSessionId,
2064
- sandboxId: tl,
2065
+ sandboxId: nl,
2065
2066
  nowMs: Date.now()
2066
- }), rl = kr(Zc), il = (e) => {
2067
+ }), il = Ar(Qc), al = (e) => {
2067
2068
  if (ae(e.metadata).length > 0) return !0;
2068
2069
  let t = e.metadata?.sandboxId;
2069
- return oe(t ? wo[t] : null);
2070
- }, al = (e) => {
2070
+ return oe(t ? To[t] : null);
2071
+ }, ol = (e) => {
2071
2072
  let t = ae(e.metadata);
2072
2073
  return t.length === 0 || !H ? null : /* @__PURE__ */ M(d, {
2073
2074
  refs: t,
2074
2075
  conversationId: H,
2075
2076
  panel: K,
2076
- entries: To,
2077
- capabilitiesOf: (e) => wo[e],
2078
- turnInFlight: xo,
2077
+ entries: Eo,
2078
+ capabilitiesOf: (e) => To[e],
2079
+ turnInFlight: So,
2079
2080
  tr: P,
2080
- onReview: Do.review,
2081
- retiredSandboxes: Eo,
2081
+ onReview: Oo.review,
2082
+ retiredSandboxes: Do,
2082
2083
  onReapply: () => void Q(P("writeProposal.reapplyPrompt", "That change wasn't saved because it changed after you read it. Fetch the latest version and reapply only your change on top of it."))
2083
2084
  });
2084
- }, ol = (e) => {
2085
+ }, sl = (e) => {
2085
2086
  if (!H) return null;
2086
2087
  let t = Z.liveOffersFor(e, {
2087
2088
  registry: {
2088
- destinations: Rr($s),
2089
- permissionsSettled: ec,
2090
- simulating: tc
2089
+ destinations: zr(ec),
2090
+ permissionsSettled: tc,
2091
+ simulating: nc
2091
2092
  },
2092
2093
  actorId: B,
2093
2094
  conversationId: H,
2094
2095
  perfNow: performance.now()
2095
2096
  }), n = t[0];
2096
- return n ? /* @__PURE__ */ M(ki, {
2097
+ return n ? /* @__PURE__ */ M(Ai, {
2097
2098
  offers: t.map(({ offer: e, target: t }) => ({
2098
2099
  offerId: e.offerId,
2099
2100
  label: t.label,
2100
2101
  path: t.path
2101
2102
  })),
2102
- hint: t.length === 1 && z === "proposal-v1" ? wi(n.offer, Z.turnFor(e)) : "link",
2103
- onOpen: Tc
2103
+ hint: t.length === 1 && z === "proposal-v1" ? Ti(n.offer, Z.turnFor(e)) : "link",
2104
+ onOpen: Ec
2104
2105
  }, n.offer.offerId) : null;
2105
- }, sl = (e) => e.role === "assistant" ? ol(e.id) : null;
2106
+ }, cl = (e) => e.role === "assistant" ? sl(e.id) : null;
2106
2107
  O(() => {
2107
2108
  let e = Z.nextExpiryInMs(performance.now());
2108
2109
  if (e === null) return;
2109
- let t = window.setTimeout(gc, e + 1);
2110
+ let t = window.setTimeout(_c, e + 1);
2110
2111
  return () => window.clearTimeout(t);
2111
2112
  }, [
2112
2113
  Z,
2113
- mc,
2114
- gc
2114
+ hc,
2115
+ _c
2115
2116
  ]);
2116
- let cl = Do.dialog.view ? To[Do.dialog.view.proposalId] : void 0, ll = nl?.expiresAtMs ?? null;
2117
+ let ll = Oo.dialog.view ? Eo[Oo.dialog.view.proposalId] : void 0, ul = rl?.expiresAtMs ?? null;
2117
2118
  O(() => {
2118
- if (ll === null) return;
2119
- let e = window.setTimeout(() => Ls((e) => e + 1), Math.max(0, ll - Date.now()));
2119
+ if (ul === null) return;
2120
+ let e = window.setTimeout(() => Rs((e) => e + 1), Math.max(0, ul - Date.now()));
2120
2121
  return () => window.clearTimeout(e);
2121
- }, [ll, Is]);
2122
- let ul = k(() => vo.voice.filter((e) => e.id !== ic && (e.role === "user" || e.role === "assistant")).map((e) => ({
2122
+ }, [ul, Ls]);
2123
+ let dl = k(() => yo.voice.filter((e) => e.id !== ac && (e.role === "user" || e.role === "assistant")).map((e) => ({
2123
2124
  id: e.id,
2124
2125
  role: e.role,
2125
- text: tr(e, bo, P),
2126
+ text: tr(e, xo, P),
2126
2127
  sessionId: ur(e),
2127
2128
  timestamp: e.timestamp
2128
2129
  })).filter((e) => e.text.length > 0), [
2129
- vo.voice,
2130
- bo,
2131
- ic,
2130
+ yo.voice,
2131
+ xo,
2132
+ ac,
2132
2133
  P
2133
- ]), dl = D(() => {
2134
- if (ul.length === 0) return;
2134
+ ]), fl = D(() => {
2135
+ if (dl.length === 0) return;
2135
2136
  let e = /* @__PURE__ */ new Date();
2136
- or(ir(ul, {
2137
+ or(ir(dl, {
2137
2138
  title: P("voiceSession.transcript", "Voice conversation"),
2138
2139
  savedAt: P("voiceSession.savedAt", "Saved"),
2139
2140
  session: P("voiceSession.sessionLabel", "Session"),
@@ -2143,27 +2144,27 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2143
2144
  }, e), ar(L, e), "text/markdown");
2144
2145
  }, [
2145
2146
  L,
2146
- ul,
2147
+ dl,
2147
2148
  P
2148
- ]), fl = $e({ perFileChars: ts }), pl = A(fl);
2149
- pl.current = fl;
2150
- let [ml, hl] = j(null), gl = ml === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: ml });
2149
+ ]), pl = $e({ perFileChars: ns }), ml = A(pl);
2150
+ ml.current = pl;
2151
+ let [hl, gl] = j(null), _l = hl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: hl });
2151
2152
  O(() => {
2152
- if (ml === null) return;
2153
- let e = window.setTimeout(() => hl(null), ua);
2153
+ if (hl === null) return;
2154
+ let e = window.setTimeout(() => gl(null), da);
2154
2155
  return () => window.clearTimeout(e);
2155
- }, [ml]);
2156
- let _l = A(/* @__PURE__ */ new Set()), vl = A(() => !1), yl = D((e, t, n, r) => {
2157
- let i = ds.current, a = br(i), o = () => {
2156
+ }, [hl]);
2157
+ let vl = A(/* @__PURE__ */ new Set()), yl = A(() => !1), bl = D((e, t, n, r) => {
2158
+ let i = fs.current, a = xr(i), o = () => {
2158
2159
  let e = w.getState();
2159
- return mr({
2160
- sessionLive: vl.current(t),
2160
+ return hr({
2161
+ sessionLive: yl.current(t),
2161
2162
  boundAtSubmit: i,
2162
2163
  activeConversationId: e.activeConversationId,
2163
2164
  boundConversationExists: e.conversations.some((e) => e.id === a)
2164
2165
  });
2165
2166
  }, s = () => {
2166
- let i = pl.current;
2167
+ let i = ml.current;
2167
2168
  nt({
2168
2169
  draft: i,
2169
2170
  maySend: o,
@@ -2173,18 +2174,18 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2173
2174
  ...n,
2174
2175
  handedOver: dn()
2175
2176
  };
2176
- Jc.current(e, i, {
2177
+ Yc.current(e, i, {
2177
2178
  fromPerson: !0,
2178
2179
  voiceSessionId: t,
2179
2180
  voiceTiming: a,
2180
2181
  ...r.correction ? { correctsInFlightTurn: !0 } : {}
2181
2182
  });
2182
2183
  },
2183
- announceDropped: (e) => hl(e)
2184
+ announceDropped: (e) => gl(e)
2184
2185
  });
2185
2186
  };
2186
- if (o() && Fc.current(e, t)) {
2187
- Jc.current(e, [], {
2187
+ if (o() && Ic.current(e, t)) {
2188
+ Yc.current(e, [], {
2188
2189
  fromPerson: !0,
2189
2190
  voiceSessionId: t,
2190
2191
  voiceTiming: {
@@ -2194,107 +2195,107 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2194
2195
  });
2195
2196
  return;
2196
2197
  }
2197
- if (!pl.current.isBusy) {
2198
+ if (!ml.current.isBusy) {
2198
2199
  s();
2199
2200
  return;
2200
2201
  }
2201
- let c = Date.now(), l = _l.current, u = window.setInterval(() => {
2202
- let e = pl.current.isBusy;
2203
- pl.current.isCommitting || e && Date.now() - c < la || (window.clearInterval(u), l.delete(u), s());
2202
+ let c = Date.now(), l = vl.current, u = window.setInterval(() => {
2203
+ let e = ml.current.isBusy;
2204
+ ml.current.isCommitting || e && Date.now() - c < ua || (window.clearInterval(u), l.delete(u), s());
2204
2205
  }, 200);
2205
2206
  l.add(u);
2206
- }, []), bl = A(() => void 0), $ = Ze({
2207
- onSubmit: yl,
2208
- latestReply: Yc,
2209
- language: o(Ga, V).tag,
2210
- graceMs: Va,
2211
- onSupersede: Hs,
2212
- handsFreeStreamNoticeAccepted: Ua,
2213
- onAcceptHandsFreeStreamNotice: Wa,
2214
- handsFreeInterrupt: Ha,
2207
+ }, []), xl = A(() => void 0), $ = Ze({
2208
+ onSubmit: bl,
2209
+ latestReply: Xc,
2210
+ language: o(Ka, V).tag,
2211
+ graceMs: Ha,
2212
+ onSupersede: Us,
2213
+ handsFreeStreamNoticeAccepted: Wa,
2214
+ onAcceptHandsFreeStreamNotice: Ga,
2215
+ handsFreeInterrupt: Ua,
2215
2216
  onBargeIn: () => {
2216
- bl.current(), Vs();
2217
+ xl.current(), Hs();
2217
2218
  }
2218
2219
  });
2219
- vl.current = $.isCurrentSession;
2220
- let xl = fs ? ul.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : ul, Sl = $.answerLocally;
2220
+ yl.current = $.isCurrentSession;
2221
+ let Sl = ps ? dl.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : dl, Cl = $.answerLocally;
2221
2222
  O(() => {
2222
- Rc.current = Sl;
2223
- }, [Sl]);
2224
- let Cl = $.active, wl = k(() => v(Object.values(To), H, Eo), [
2225
- To,
2223
+ zc.current = Cl;
2224
+ }, [Cl]);
2225
+ let wl = $.active, Tl = k(() => v(Object.values(Eo), H, Do), [
2226
+ Eo,
2226
2227
  H,
2227
- Eo
2228
- ]), [Tl, El] = j(null);
2228
+ Do
2229
+ ]), [El, Dl] = j(null);
2229
2230
  O(() => {
2230
- Cl || El(null);
2231
- }, [Cl]);
2232
- let Dl = Do.review, Ol = D(() => {
2233
- let e = wl[wl.length - 1];
2231
+ wl || Dl(null);
2232
+ }, [wl]);
2233
+ let Ol = Oo.review, kl = D(() => {
2234
+ let e = Tl[Tl.length - 1];
2234
2235
  if (!e) return;
2235
2236
  let { view: t } = e;
2236
- f(t) && m(t, wo[e.session.sandboxId]).offerConfirm ? Dl(t) : El(t.proposalId);
2237
+ f(t) && m(t, To[e.session.sandboxId]).offerConfirm ? Ol(t) : Dl(t.proposalId);
2237
2238
  }, [
2238
- wl,
2239
- wo,
2240
- Dl
2241
- ]), kl = Cl ? _(wl) : null, Al = Tl ? To[Tl] : void 0, jl = Cl && Al && Al.session.conversationId === H ? {
2239
+ Tl,
2240
+ To,
2241
+ Ol
2242
+ ]), Al = wl ? _(Tl) : null, jl = El ? Eo[El] : void 0, Ml = wl && jl && jl.session.conversationId === H ? {
2242
2243
  content: /* @__PURE__ */ M(d, {
2243
2244
  refs: [{
2244
- proposalId: Al.view.proposalId,
2245
- sandboxId: Al.session.sandboxId,
2246
- sessionId: Al.session.sessionId
2245
+ proposalId: jl.view.proposalId,
2246
+ sandboxId: jl.session.sandboxId,
2247
+ sessionId: jl.session.sessionId
2247
2248
  }],
2248
- conversationId: Al.session.conversationId,
2249
+ conversationId: jl.session.conversationId,
2249
2250
  panel: K,
2250
- entries: To,
2251
- capabilitiesOf: (e) => wo[e],
2252
- turnInFlight: xo,
2251
+ entries: Eo,
2252
+ capabilitiesOf: (e) => To[e],
2253
+ turnInFlight: So,
2253
2254
  tr: P,
2254
- onReview: Dl,
2255
- retiredSandboxes: Eo
2255
+ onReview: Ol,
2256
+ retiredSandboxes: Do
2256
2257
  }),
2257
2258
  closeLabel: re(P, h.trayClose),
2258
- onClose: () => El(null)
2259
- } : null, Ml = Do.asking, Nl = Oc?.asking === !0, Pl = kc?.asking === !0, Fl = ui(), Il = $.holdListening, Ll = k(() => Cl || J ? null : { run: () => os ? { status: "already" } : (us(!0), { status: "done" }) }, [
2260
- Cl,
2259
+ onClose: () => Dl(null)
2260
+ } : null, Nl = Oo.asking, Pl = kc?.asking === !0, Fl = Ac?.asking === !0, Il = di(), Ll = $.holdListening, Rl = k(() => wl || J ? null : { run: () => ss ? { status: "already" } : (ds(!0), { status: "done" }) }, [
2261
+ wl,
2261
2262
  J,
2262
- os,
2263
- us
2263
+ ss,
2264
+ ds
2264
2265
  ]);
2265
- ci("assistant.transcript", Ll);
2266
- let Rl = k(() => Cl ? null : { run: () => {
2266
+ li("assistant.transcript", Rl);
2267
+ let zl = k(() => wl ? null : { run: () => {
2267
2268
  let e = w.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2268
2269
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
2269
- } }, [Cl]);
2270
- ci("assistant.conversation.new", Rl), O(() => {
2271
- Il(Cl && (Ml || Nl || Pl || Fl));
2270
+ } }, [wl]);
2271
+ li("assistant.conversation.new", zl), O(() => {
2272
+ Ll(wl && (Nl || Pl || Fl || Il));
2272
2273
  }, [
2273
- Cl,
2274
- Ml,
2274
+ wl,
2275
2275
  Nl,
2276
2276
  Pl,
2277
2277
  Fl,
2278
- Il
2278
+ Il,
2279
+ Ll
2279
2280
  ]);
2280
- let zl = A(null), Bl = $.announce;
2281
+ let Bl = A(null), Vl = $.announce;
2281
2282
  O(() => {
2282
- if (!Cl) {
2283
- zl.current = null;
2283
+ if (!wl) {
2284
+ Bl.current = null;
2284
2285
  return;
2285
2286
  }
2286
- let e = zl.current;
2287
- if (e === null) zl.current = new Set(Object.keys(To));
2288
- else for (let { view: t, session: n } of ne(wl, e)) {
2287
+ let e = Bl.current;
2288
+ if (e === null) Bl.current = new Set(Object.keys(Eo));
2289
+ else for (let { view: t, session: n } of ne(Tl, e)) {
2289
2290
  e.add(t.proposalId);
2290
- let r = wo[n.sandboxId];
2291
+ let r = To[n.sandboxId];
2291
2292
  if (!g({
2292
2293
  mode: "api-calls",
2293
2294
  productWriteApproval: z,
2294
2295
  capabilities: r
2295
2296
  })) continue;
2296
2297
  let i = ie(t, m(t, r).offerConfirm, P), a = t.proposalId;
2297
- Bl({
2298
+ Vl({
2298
2299
  id: `write-readback:${a}`,
2299
2300
  text: i.text,
2300
2301
  lang: i.translated ? V : "en",
@@ -2302,439 +2303,439 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2302
2303
  });
2303
2304
  }
2304
2305
  }, [
2305
- Cl,
2306
2306
  wl,
2307
+ Tl,
2308
+ Eo,
2307
2309
  To,
2308
- wo,
2309
2310
  z,
2310
2311
  P,
2311
2312
  V,
2312
- Bl,
2313
+ Vl,
2313
2314
  K
2314
2315
  ]);
2315
- let Vl = A(!1);
2316
+ let Hl = A(!1);
2316
2317
  O(() => {
2317
- Vl.current = $.active;
2318
- }, [$.active]), O(() => qi((e) => {
2319
- if (!Vl.current) return !1;
2320
- let t = ds.current;
2318
+ Hl.current = $.active;
2319
+ }, [$.active]), O(() => Ji((e) => {
2320
+ if (!Hl.current) return !1;
2321
+ let t = fs.current;
2321
2322
  return typeof t == "string" ? t === e : w.getState().activeConversationId === e;
2322
2323
  }), []);
2323
- let Hl = $.start, Ul = D(() => {
2324
- let e = w.getState().activeConversationId, t = _r(ys());
2325
- gs(yr(t, e)), js(!0, t.kind === "own"), Hl();
2324
+ let Ul = $.start, Wl = D(() => {
2325
+ let e = w.getState().activeConversationId, t = vr(bs());
2326
+ _s(br(t, e)), Ms(!0, t.kind === "own"), Ul();
2326
2327
  }, [
2327
- gs,
2328
- js,
2329
- ys,
2330
- Hl
2331
- ]), Wl = k(() => er(G?.messages ?? []), [G?.messages]), Gl = $n(vo.voice, bo, P), Kl = $n(Wl, bo, P) > 0, ql = D(() => {
2328
+ _s,
2329
+ Ms,
2330
+ bs,
2331
+ Ul
2332
+ ]), Gl = k(() => er(G?.messages ?? []), [G?.messages]), Kl = $n(yo.voice, xo, P), ql = $n(Gl, xo, P) > 0, Jl = D(() => {
2332
2333
  let e = w.getState().activeConversationId;
2333
- if (!e || ul.length === 0) return;
2334
- let t = new Set(Wl.map((e) => e.id)), n = N();
2334
+ if (!e || dl.length === 0) return;
2335
+ let t = new Set(Gl.map((e) => e.id)), n = N();
2335
2336
  W(e, {
2336
2337
  id: n,
2337
2338
  role: "system",
2338
- content: rr(ul.filter((e) => t.has(e.id)), {
2339
+ content: rr(dl.filter((e) => t.has(e.id)), {
2339
2340
  intro: P("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2340
2341
  nothing: P("voiceSession.continuedNothing", "Continued from a voice conversation."),
2341
2342
  more: (e) => P("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2342
2343
  }),
2343
2344
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2344
- metadata: { continuedVoiceTurns: Gl }
2345
- }), Ri.recordCommittedEntries(e, [n], "NOTE", T()), us(!1), $.end(), cs(), Ea?.();
2345
+ metadata: { continuedVoiceTurns: Kl }
2346
+ }), zi.recordCommittedEntries(e, [n], "NOTE", T()), ds(!1), $.end(), ls(), Da?.();
2346
2347
  }, [
2347
- ul,
2348
+ dl,
2349
+ Kl,
2348
2350
  Gl,
2349
- Wl,
2350
2351
  W,
2351
2352
  P,
2352
2353
  $,
2353
- us,
2354
- cs,
2355
- Ea
2356
- ]), Jl = A({
2354
+ ds,
2355
+ ls,
2356
+ Da
2357
+ ]), Yl = A({
2357
2358
  conversationId: null,
2358
2359
  count: 0
2359
2360
  });
2360
2361
  O(() => {
2361
- $.active && (Jl.current = {
2362
+ $.active && (Yl.current = {
2362
2363
  conversationId: H,
2363
- count: Gl
2364
+ count: Kl
2364
2365
  });
2365
2366
  }, [$.active]);
2366
- let [Yl, Xl] = j({}), [Zl, Ql] = j({}), $l = A(null), eu = $.active;
2367
+ let [Xl, Zl] = j({}), [Ql, $l] = j({}), eu = A(null), tu = $.active;
2367
2368
  O(() => {
2368
2369
  if (!I) return;
2369
- if (eu) {
2370
- $l.current ??= {
2370
+ if (tu) {
2371
+ eu.current ??= {
2371
2372
  startedAt: Date.now(),
2372
2373
  sessionId: null
2373
2374
  };
2374
2375
  return;
2375
2376
  }
2376
- let e = $l.current;
2377
- $l.current = null;
2377
+ let e = eu.current;
2378
+ eu.current = null;
2378
2379
  let t = e?.sessionId;
2379
2380
  if (e && t) {
2380
2381
  let n = Math.max(1, Math.round((Date.now() - e.startedAt) / 1e3));
2381
- Ql((e) => ({
2382
+ $l((e) => ({
2382
2383
  ...e,
2383
2384
  [t]: n
2384
2385
  }));
2385
2386
  }
2386
- }, [I, eu]);
2387
- let tu = $.isCurrentSession;
2387
+ }, [I, tu]);
2388
+ let nu = $.isCurrentSession;
2388
2389
  O(() => {
2389
- let e = $l.current;
2390
+ let e = eu.current;
2390
2391
  if (!I || !e || e.sessionId) return;
2391
- let t = ul.find((e) => e.sessionId !== void 0 && tu(e.sessionId));
2392
+ let t = dl.find((e) => e.sessionId !== void 0 && nu(e.sessionId));
2392
2393
  t?.sessionId && (e.sessionId = t.sessionId);
2393
2394
  }, [
2394
2395
  I,
2395
- ul,
2396
- tu
2396
+ dl,
2397
+ nu
2397
2398
  ]);
2398
- let nu = $.session.phase, ru = Qc[Qc.length - 1], iu = I && $.active && (nu === "thinking" || nu === "speaking") && ru?.role === "assistant" && cr(ru) ? ru.id : null, au = $.spokenChunks, ou = iu !== null && Ks === iu && au ? au.chunks.slice(0, au.index + 1).join(" ") : null, [su, cu] = j({});
2399
- iu !== null && ou !== null && ou.length > (su[iu]?.length ?? 0) && cu({
2400
- ...su,
2401
- [iu]: ou
2399
+ let ru = $.session.phase, iu = $c[$c.length - 1], au = I && $.active && (ru === "thinking" || ru === "speaking") && iu?.role === "assistant" && cr(iu) ? iu.id : null, ou = $.spokenChunks, su = au !== null && qs === au && ou ? pr(iu?.content ?? "", ou.chunks.slice(0, ou.index + 1).join(" ").length) : null, [cu, lu] = j({});
2400
+ au !== null && su !== null && su.length > (cu[au]?.length ?? 0) && lu({
2401
+ ...cu,
2402
+ [au]: su
2402
2403
  });
2403
- let lu = iu === null ? null : su[iu] ?? "", uu = D(() => {
2404
- if (iu === null || lu === null || !H) return;
2404
+ let uu = au === null ? null : cu[au] ?? "", du = D(() => {
2405
+ if (au === null || uu === null || !H) return;
2405
2406
  let e = w.getState();
2406
- if (lu === "") {
2407
- e.mergeMessageMetadata(H, iu, { voiceNotSpoken: !0 });
2407
+ if (uu === "") {
2408
+ e.mergeMessageMetadata(H, au, { voiceNotSpoken: !0 });
2408
2409
  return;
2409
2410
  }
2410
- if (Ks !== iu) return;
2411
- let t = lu;
2412
- Xl((e) => ({
2411
+ if (qs !== au) return;
2412
+ let t = uu;
2413
+ Zl((e) => ({
2413
2414
  ...e,
2414
- [iu]: t
2415
- })), e.mergeMessageMetadata(H, iu, {
2415
+ [au]: t
2416
+ })), e.mergeMessageMetadata(H, au, {
2416
2417
  voiceInterrupted: !0,
2417
2418
  voiceSpokenText: t
2418
2419
  });
2419
2420
  }, [
2420
- iu,
2421
- lu,
2421
+ au,
2422
+ uu,
2422
2423
  H,
2423
- Ks
2424
+ qs
2424
2425
  ]);
2425
2426
  O(() => {
2426
- bl.current = uu;
2427
- }, [uu]);
2428
- let du = (e, t, n) => {
2427
+ xl.current = du;
2428
+ }, [du]);
2429
+ let fu = (e, t, n) => {
2429
2430
  if (!cr(e)) return;
2430
- let r = ur(e), i = n[t + 1], a = $.active && r !== void 0 && tu(r), o = (!i || !cr(i) || ur(i) !== r) && !a ? /* @__PURE__ */ M(dr, { seconds: r ? Zl[r] : void 0 }) : null;
2431
- if (e.role === "user") return { below: /* @__PURE__ */ oa(aa, { children: [/* @__PURE__ */ M(fr, { mark: "spoken" }), o] }) };
2431
+ let r = ur(e), i = n[t + 1], a = $.active && r !== void 0 && nu(r), o = (!i || !cr(i) || ur(i) !== r) && !a ? /* @__PURE__ */ M(dr, { seconds: r ? Ql[r] : void 0 }) : null;
2432
+ if (e.role === "user") return { below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "spoken" }), o] }) };
2432
2433
  if (e.role !== "assistant") return o ? { below: o } : void 0;
2433
- let s = Yl[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2434
+ let s = Xl[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
2434
2435
  if (s !== void 0) return {
2435
2436
  content: s,
2436
- below: /* @__PURE__ */ oa(aa, { children: [/* @__PURE__ */ M(fr, { mark: "interrupted" }), o] })
2437
+ below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "interrupted" }), o] })
2437
2438
  };
2438
- if (e.id === iu && lu !== null) return { content: lu };
2439
- let c = a || r !== void 0 && Zl[r] !== void 0;
2440
- return e.content.trim() !== "" && (c ? su[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ oa(aa, { children: [/* @__PURE__ */ M(fr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2441
- }, fu = D(() => {
2442
- let e = Jl.current, t = e.conversationId === H ? e.count : 0, n = Gl > t;
2443
- $.end(), n && us(!0), uu();
2439
+ if (e.id === au && uu !== null) return { content: uu };
2440
+ let c = a || r !== void 0 && Ql[r] !== void 0;
2441
+ return e.content.trim() !== "" && (c ? cu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(fr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
2442
+ }, pu = D(() => {
2443
+ let e = Yl.current, t = e.conversationId === H ? e.count : 0, n = Kl > t;
2444
+ $.end(), n && ds(!0), du();
2444
2445
  }, [
2445
2446
  H,
2446
- Gl,
2447
+ Kl,
2447
2448
  $,
2448
- us,
2449
- uu
2449
+ ds,
2450
+ du
2450
2451
  ]);
2451
2452
  O(() => {
2452
- va && Ds || !$.active || $.end();
2453
+ ya && Os || !$.active || $.end();
2453
2454
  }, [
2454
- va,
2455
- Ds,
2455
+ ya,
2456
+ Os,
2456
2457
  $
2457
2458
  ]);
2458
- let [pu, mu] = j(pa), hu = Ge({
2459
+ let [mu, hu] = j(ma), gu = Ge({
2459
2460
  available: $.available,
2460
- allowedInMode: Ds,
2461
- readOnly: Ao,
2462
- busy: xo || Fs !== null || Mo || uc,
2463
- committing: pu.committing,
2464
- dictating: pu.dictating
2465
- }), gu = We();
2466
- ra(() => {
2467
- wa?.({ live: $.active });
2468
- }, [wa, $.active]);
2469
- let _u = A(!1), vu = D(() => {
2470
- _u.current = !0, Ta?.({ review: !0 });
2471
- }, [Ta]);
2461
+ allowedInMode: Os,
2462
+ readOnly: jo,
2463
+ busy: So || Is !== null || No || dc,
2464
+ committing: mu.committing,
2465
+ dictating: mu.dictating
2466
+ }), _u = We();
2467
+ ia(() => {
2468
+ Ta?.({ live: $.active });
2469
+ }, [Ta, $.active]);
2470
+ let vu = A(!1), yu = D(() => {
2471
+ vu.current = !0, Ea?.({ review: !0 });
2472
+ }, [Ea]);
2472
2473
  O(() => {
2473
- !ja && _u.current && (_u.current = !1, ke(sd.current));
2474
- }, [ja]);
2475
- let yu = $.active;
2474
+ !Ma && vu.current && (vu.current = !1, ke(cd.current));
2475
+ }, [Ma]);
2476
+ let bu = $.active;
2476
2477
  O(() => {
2477
- if (!yu) vs.current = !1, _s.current = null;
2478
- else if (fs) {
2479
- let e = ds.current;
2480
- pr(e) && (_s.current = e.openAtStart), vs.current = !0;
2481
- } else vs.current && (vs.current = !1, F && De({
2478
+ if (!bu) ys.current = !1, vs.current = null;
2479
+ else if (ps) {
2480
+ let e = fs.current;
2481
+ mr(e) && (vs.current = e.openAtStart), ys.current = !0;
2482
+ } else ys.current && (ys.current = !1, F && De({
2482
2483
  pending: "own",
2483
- openAtStart: _s.current
2484
- }, ds.current) && hs(!0));
2484
+ openAtStart: vs.current
2485
+ }, fs.current) && gs(!0));
2485
2486
  }, [
2486
- fs,
2487
- yu,
2487
+ ps,
2488
+ bu,
2488
2489
  F
2489
- ]), ms && !$.active && hs(!1);
2490
- let [bu, xu] = j(null);
2490
+ ]), hs && !$.active && gs(!1);
2491
+ let [xu, Su] = j(null);
2491
2492
  O(() => {
2492
- bu !== null && (J && bu.conversationId === H || xu(null));
2493
+ xu !== null && (J && xu.conversationId === H || Su(null));
2493
2494
  }, [
2494
2495
  J,
2495
2496
  H,
2496
- bu
2497
+ xu
2497
2498
  ]);
2498
- let Su = bu !== null && Ks === bu.replyId, Cu = A(!1), wu = D(() => {
2499
- Cu.current = !0, Su && qs(), Ul();
2499
+ let Cu = xu !== null && qs === xu.replyId, wu = A(!1), Tu = D(() => {
2500
+ wu.current = !0, Cu && Js(), Wl();
2500
2501
  }, [
2501
- Ul,
2502
- Su,
2503
- qs
2504
- ]), Tu = D(() => {
2505
- Su && qs(), Ul();
2502
+ Wl,
2503
+ Cu,
2504
+ Js
2505
+ ]), Eu = D(() => {
2506
+ Cu && Js(), Wl();
2506
2507
  }, [
2507
- Ul,
2508
- Su,
2509
- qs
2508
+ Wl,
2509
+ Cu,
2510
+ Js
2510
2511
  ]);
2511
2512
  O(() => {
2512
- $.active || (Cu.current = !1);
2513
+ $.active || (wu.current = !1);
2513
2514
  }, [$.active]), O(() => {
2514
- !J && Cu.current && (Cu.current = !1, $.active && fu());
2515
+ !J && wu.current && (wu.current = !1, $.active && pu());
2515
2516
  }, [
2516
2517
  J,
2517
2518
  $.active,
2518
- fu
2519
+ pu
2519
2520
  ]), O(() => {
2520
- J && us(!1);
2521
- }, [J, us]);
2522
- let Eu = k(() => ({
2521
+ J && ds(!1);
2522
+ }, [J, ds]);
2523
+ let Du = k(() => ({
2523
2524
  live: $.active,
2524
- blocked: hu === null ? null : gu.voiceStartBlocked(hu),
2525
- impossible: Ke(hu),
2526
- start: F ? Tu : wu
2525
+ blocked: gu === null ? null : _u.voiceStartBlocked(gu),
2526
+ impossible: Ke(gu),
2527
+ start: F ? Eu : Tu
2527
2528
  }), [
2528
2529
  $.active,
2529
- hu,
2530
2530
  gu,
2531
+ _u,
2531
2532
  F,
2532
- Tu,
2533
- wu
2534
- ]), [Du, Ou] = j("mini"), [ku, Au] = j(!1), ju = ja && $.active && (ku || J);
2535
- ju !== ku && Au(ju);
2536
- let Mu = F && !I && $.active && !J && (!ja || ku), Nu = va && q.covered !== !0 && !($.active && Du !== "mini") && !(os && !$.active) && !(Ml || Nl || Pl || Fl), Pu = ss?.ask, Fu = ia(Pu?.subscribe ?? ha, Pu?.getSnapshot ?? ga, Pu?.getSnapshot ?? ga), Iu = C({
2533
+ Eu,
2534
+ Tu
2535
+ ]), [Ou, ku] = j("mini"), [Au, ju] = j(!1), Mu = Ma && $.active && (Au || J);
2536
+ Mu !== Au && ju(Mu);
2537
+ let Nu = F && !I && $.active && !J && (!Ma || Au), Pu = ya && q.covered !== !0 && !($.active && Ou !== "mini") && !(ss && !$.active) && !(Nl || Pl || Fl || Il), Fu = cs?.ask, Iu = aa(Fu?.subscribe ?? ga, Fu?.getSnapshot ?? _a, Fu?.getSnapshot ?? _a), Lu = C({
2537
2538
  voiceLive: $.active,
2538
- readOnly: Ao,
2539
+ readOnly: jo,
2539
2540
  writes: qe({
2540
- auto: Yo,
2541
+ auto: Xo,
2541
2542
  selectedMode: U,
2542
- conversation: G && !Ao ? {
2543
+ conversation: G && !jo ? {
2543
2544
  mode: G.mode,
2544
2545
  routedBy: G.routedBy,
2545
- hasHistory: zi(G)
2546
+ hasHistory: Bi(G)
2546
2547
  } : null,
2547
2548
  modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || gt(e)
2548
2549
  }),
2549
- avatar: Fu,
2550
- busy: xo || Fs !== null || Mo || uc || ns !== null || $o,
2551
- committing: pu.committing
2552
- }), Lu = A(Iu);
2553
- ra(() => {
2554
- Lu.current = Iu;
2555
- }, [Iu]);
2556
- let Ru = D((e) => {
2550
+ avatar: Iu,
2551
+ busy: So || Is !== null || No || dc || rs !== null || es,
2552
+ committing: mu.committing
2553
+ }), Ru = A(Lu);
2554
+ ia(() => {
2555
+ Ru.current = Lu;
2556
+ }, [Lu]);
2557
+ let zu = D((e) => {
2557
2558
  let t = e.trim();
2558
- if (t === "" || Lu.current !== null) return { accepted: !1 };
2559
- Su && qs();
2559
+ if (t === "" || Ru.current !== null) return { accepted: !1 };
2560
+ Cu && Js();
2560
2561
  let n = {
2561
2562
  token: N(),
2562
2563
  exchange: null,
2563
2564
  handled: !1
2564
2565
  };
2565
- Js.current = n;
2566
+ Ys.current = n;
2566
2567
  try {
2567
2568
  Q(t, [], {
2568
2569
  fromPerson: !0,
2569
2570
  avatarTabAsk: n.token,
2570
2571
  localRecordsChecked: !0,
2571
- ...Yo ? { autoIntent: "read" } : {}
2572
+ ...Xo ? { autoIntent: "read" } : {}
2572
2573
  });
2573
2574
  } finally {
2574
- Js.current = null;
2575
+ Ys.current = null;
2575
2576
  }
2576
2577
  let r = n.exchange;
2577
2578
  return r === null ? n.handled ? {
2578
2579
  accepted: !0,
2579
2580
  recorded: !1
2580
- } : { accepted: !1 } : (xu(r), {
2581
+ } : { accepted: !1 } : (Su(r), {
2581
2582
  accepted: !0,
2582
2583
  recorded: !0,
2583
2584
  ...r
2584
2585
  });
2585
2586
  }, [
2586
- Yo,
2587
+ Xo,
2587
2588
  Q,
2588
- qs,
2589
- Su
2590
- ]), [zu] = j(() => Ye()), Bu = k(() => ({
2591
- blocker: Iu,
2592
- line: Je(Iu, hu),
2593
- send: Ru,
2594
- last: bu,
2595
- navigatingReplyId: fc,
2596
- draft: zu
2589
+ Js,
2590
+ Cu
2591
+ ]), [Bu] = j(() => Ye()), Vu = k(() => ({
2592
+ blocker: Lu,
2593
+ line: Je(Lu, gu),
2594
+ send: zu,
2595
+ last: xu,
2596
+ navigatingReplyId: pc,
2597
+ draft: Bu
2597
2598
  }), [
2598
- Iu,
2599
- hu,
2600
- Ru,
2601
- bu,
2602
- fc,
2603
- zu
2604
- ]), Vu = q.setReplyEscape, Hu = J && Nu && Su;
2599
+ Lu,
2600
+ gu,
2601
+ zu,
2602
+ xu,
2603
+ pc,
2604
+ Bu
2605
+ ]), Hu = q.setReplyEscape, Uu = J && Pu && Cu;
2605
2606
  O(() => {
2606
- if (Vu && Hu) return Vu(qs), () => Vu(null);
2607
+ if (Hu && Uu) return Hu(Js), () => Hu(null);
2607
2608
  }, [
2608
- Vu,
2609
2609
  Hu,
2610
- qs
2610
+ Uu,
2611
+ Js
2611
2612
  ]), O(() => {
2612
- let e = ds.current, t = br(e), n = w.getState(), r = gr({
2613
+ let e = fs.current, t = xr(e), n = w.getState(), r = _r({
2613
2614
  sessionLive: $.active,
2614
2615
  bound: e,
2615
2616
  activeConversationId: n.activeConversationId,
2616
2617
  boundConversationExists: n.conversations.some((e) => e.id === t)
2617
2618
  });
2618
- gs(r.bound), r.end && $.end();
2619
+ _s(r.bound), r.end && $.end();
2619
2620
  }, [
2620
2621
  $,
2621
2622
  H,
2622
- Za,
2623
- gs
2623
+ Qa,
2624
+ _s
2624
2625
  ]), O(() => {
2625
- let e = hr(xr.read(), {
2626
+ let e = gr(Sr.read(), {
2626
2627
  activeConversationId: H,
2627
- chatTurnCount: Zc.length,
2628
- voiceTurnCount: ul.length,
2628
+ chatTurnCount: Qc.length,
2629
+ voiceTurnCount: dl.length,
2629
2630
  sessionLive: $.active,
2630
- sessionBoundTo: ds.current,
2631
- turnInFlight: xo
2631
+ sessionBoundTo: fs.current,
2632
+ turnInFlight: So
2632
2633
  });
2633
- xr.write(e.state), e.open && us(!0);
2634
+ Sr.write(e.state), e.open && ds(!0);
2634
2635
  }, [
2635
2636
  H,
2636
- Zc.length,
2637
- ul.length,
2637
+ Qc.length,
2638
+ dl.length,
2638
2639
  $.active,
2639
- xo,
2640
- us
2640
+ So,
2641
+ ds
2641
2642
  ]), O(() => {
2642
2643
  if (!$.active) {
2643
- pl.current.clear(), hl(null), zs.current = null;
2644
- for (let e of _l.current) window.clearInterval(e);
2645
- _l.current.clear();
2644
+ ml.current.clear(), gl(null), Bs.current = null;
2645
+ for (let e of vl.current) window.clearInterval(e);
2646
+ vl.current.clear();
2646
2647
  }
2647
2648
  }, [$.active]), O(() => {
2648
- let e = _l.current;
2649
+ let e = vl.current;
2649
2650
  return () => {
2650
2651
  for (let t of e) window.clearInterval(t);
2651
2652
  e.clear();
2652
2653
  };
2653
2654
  }, []), O(() => {
2654
2655
  let e = w.getState().consumePendingPrompt();
2655
- return e && Jc.current(e), w.subscribe((e, t) => {
2656
+ return e && Yc.current(e), w.subscribe((e, t) => {
2656
2657
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
2657
2658
  let e = w.getState().consumePendingPrompt();
2658
- e && Jc.current(e);
2659
+ e && Yc.current(e);
2659
2660
  }
2660
2661
  });
2661
2662
  }, []);
2662
- let Uu = D((e) => {
2663
+ let Wu = D((e) => {
2663
2664
  let t = H ? w.getState().conversations.find((e) => e.id === H) : void 0;
2664
- if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && zi(t)) {
2665
+ if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Bi(t)) {
2665
2666
  if (t.mode !== e) {
2666
- let t = Ki(), n = w.getState().conversations.find((n) => n.mode === e && Hi(n, t) && !w.getState().processingByConversationId[n.id]);
2667
- n ? to(n.id) : no(void 0, e);
2667
+ let t = qi(), n = w.getState().conversations.find((n) => n.mode === e && Ui(n, t) && !w.getState().processingByConversationId[n.id]);
2668
+ n ? no(n.id) : ro(void 0, e);
2668
2669
  }
2669
- } else H && eo(H, e);
2670
+ } else H && to(H, e);
2670
2671
  let n = w.getState().activeConversationId;
2671
- n ? eo(n, e) : go(!1), $a(e);
2672
+ n ? to(n, e) : _o(!1), eo(e);
2672
2673
  }, [
2673
2674
  H,
2675
+ ro,
2674
2676
  no,
2677
+ _o,
2675
2678
  to,
2676
- go,
2677
2679
  eo,
2678
- $a,
2679
2680
  K
2680
- ]), Wu = D(() => {
2681
+ ]), Gu = D(() => {
2681
2682
  let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2682
2683
  if (!t) {
2683
- go(!0), $a(b);
2684
+ _o(!0), eo(b);
2684
2685
  return;
2685
2686
  }
2686
2687
  if (t.routedBy === "auto") {
2687
- go(!0);
2688
+ _o(!0);
2688
2689
  return;
2689
2690
  }
2690
- if (!zi(t)) {
2691
- _o(t.id, b);
2691
+ if (!Bi(t)) {
2692
+ vo(t.id, b);
2692
2693
  return;
2693
2694
  }
2694
2695
  K.withdraw(t.id, "mode_switched");
2695
- let n = Ki(), r = e.conversations.find((t) => t.routedBy === "auto" && Hi(t, n) && !e.processingByConversationId[t.id]);
2696
- r ? (to(r.id), _o(r.id, b)) : no(void 0, b, { routedBy: "auto" });
2696
+ let n = qi(), r = e.conversations.find((t) => t.routedBy === "auto" && Ui(t, n) && !e.processingByConversationId[t.id]);
2697
+ r ? (no(r.id), vo(r.id, b)) : ro(void 0, b, { routedBy: "auto" });
2697
2698
  }, [
2699
+ ro,
2700
+ vo,
2698
2701
  no,
2699
2702
  _o,
2700
- to,
2701
- go,
2702
- $a,
2703
+ eo,
2703
2704
  K
2704
- ]), Gu = D((e) => {
2705
- R.find((t) => t.id === e)?.writeCapable && !Jn(w.getState().acknowledgedWriteModes, e) ? rs(e) : Uu(e);
2706
- }, [Uu, R]), Ku = D(() => {
2707
- let e = ns;
2708
- if (rs(null), !e) return;
2709
- let t = Zo.current;
2710
- Zo.current = null, t ? (mo(e), Q(t.content, t.attachments, t.options)) : (mo(e), Uu(e));
2705
+ ]), Ku = D((e) => {
2706
+ R.find((t) => t.id === e)?.writeCapable && !Jn(w.getState().acknowledgedWriteModes, e) ? is(e) : Wu(e);
2707
+ }, [Wu, R]), qu = D(() => {
2708
+ let e = rs;
2709
+ if (is(null), !e) return;
2710
+ let t = Qo.current;
2711
+ Qo.current = null, t ? (ho(e), Q(t.content, t.attachments, t.options)) : (ho(e), Wu(e));
2711
2712
  }, [
2712
- ns,
2713
- mo,
2714
- Uu,
2713
+ rs,
2714
+ ho,
2715
+ Wu,
2715
2716
  Q
2716
- ]), qu = ns === null ? void 0 : R.find((e) => e.id === ns) ?? { id: ns }, Ju = D(() => {
2717
- rs(null);
2718
- let e = Zo.current;
2719
- Zo.current = null, e && Q(e.content, e.attachments, {
2717
+ ]), Ju = rs === null ? void 0 : R.find((e) => e.id === rs) ?? { id: rs }, Yu = D(() => {
2718
+ is(null);
2719
+ let e = Qo.current;
2720
+ Qo.current = null, e && Q(e.content, e.attachments, {
2720
2721
  ...e.options,
2721
2722
  autoIntent: "read"
2722
2723
  });
2723
- }, [Q]), Yu = D(() => Vs(), [Vs]), [Xu, Zu] = j(null), Qu = D(() => {
2724
- let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Ns.current;
2724
+ }, [Q]), Xu = D(() => Hs(), [Hs]), [Zu, Qu] = j(null), $u = D(() => {
2725
+ let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Ps.current;
2725
2726
  return {
2726
2727
  state: e,
2727
2728
  conversation: t ? {
2728
2729
  mode: t.mode,
2729
- hasHistory: zi(t),
2730
+ hasHistory: Bi(t),
2730
2731
  routedByAuto: t.routedBy === "auto"
2731
2732
  } : null,
2732
2733
  waitingCount: t ? K.liveFor(t.id).count : 0,
2733
2734
  hasDraft: n !== null && (n.text.trim() !== "" || n.hasAttachments)
2734
2735
  };
2735
- }, [K]), $u = Yo ? P("modeSelector.auto", "Auto") : void 0, ed = D((e) => {
2736
- if (ns !== null) return;
2737
- let { state: t, conversation: n, waitingCount: r, hasDraft: i } = Qu(), a = R.find((t) => t.id === e), o = Ae({
2736
+ }, [K]), ed = Xo ? P("modeSelector.auto", "Auto") : void 0, td = D((e) => {
2737
+ if (rs !== null) return;
2738
+ let { state: t, conversation: n, waitingCount: r, hasDraft: i } = $u(), a = R.find((t) => t.id === e), o = Ae({
2738
2739
  target: {
2739
2740
  kind: "mode",
2740
2741
  mode: e,
@@ -2744,7 +2745,7 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2744
2745
  waitingCount: r,
2745
2746
  hasDraft: i
2746
2747
  });
2747
- o.needsDialog ? Zu({
2748
+ o.needsDialog ? Qu({
2748
2749
  open: !0,
2749
2750
  target: {
2750
2751
  kind: "mode",
@@ -2752,116 +2753,116 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2752
2753
  },
2753
2754
  plan: o,
2754
2755
  targetName: we(P, a ?? { id: e }),
2755
- currentName: $u
2756
- }) : Uu(e);
2756
+ currentName: ed
2757
+ }) : Wu(e);
2757
2758
  }, [
2759
+ ed,
2758
2760
  $u,
2759
- Qu,
2760
- ns,
2761
- Uu,
2761
+ rs,
2762
+ Wu,
2762
2763
  R,
2763
2764
  P
2764
- ]), td = D(() => {
2765
- if (ns !== null) return;
2766
- let { conversation: e, waitingCount: t, hasDraft: n } = Qu(), r = Ae({
2765
+ ]), nd = D(() => {
2766
+ if (rs !== null) return;
2767
+ let { conversation: e, waitingCount: t, hasDraft: n } = $u(), r = Ae({
2767
2768
  target: { kind: "auto" },
2768
2769
  conversation: e,
2769
2770
  waitingCount: t,
2770
2771
  hasDraft: n
2771
2772
  });
2772
- r.needsDialog ? Zu({
2773
+ r.needsDialog ? Qu({
2773
2774
  open: !0,
2774
2775
  target: { kind: "auto" },
2775
2776
  plan: r,
2776
2777
  targetName: P("modeSelector.auto", "Auto")
2777
- }) : Wu();
2778
+ }) : Gu();
2778
2779
  }, [
2779
- Wu,
2780
- Qu,
2781
- ns,
2780
+ Gu,
2781
+ $u,
2782
+ rs,
2782
2783
  P
2783
- ]), nd = D(() => {
2784
- let e = Xu;
2785
- e?.open && (Zu({
2784
+ ]), rd = D(() => {
2785
+ let e = Zu;
2786
+ e?.open && (Qu({
2786
2787
  ...e,
2787
2788
  open: !1
2788
- }), e.target.kind === "auto" ? Wu() : (e.plan.consent && mo(e.target.mode), Uu(e.target.mode)));
2789
+ }), e.target.kind === "auto" ? Gu() : (e.plan.consent && ho(e.target.mode), Wu(e.target.mode)));
2789
2790
  }, [
2790
- mo,
2791
- Wu,
2792
- Xu,
2793
- Uu
2794
- ]), rd = D(() => {
2795
- Zu((e) => e && {
2791
+ ho,
2792
+ Gu,
2793
+ Zu,
2794
+ Wu
2795
+ ]), id = D(() => {
2796
+ Qu((e) => e && {
2796
2797
  ...e,
2797
2798
  open: !1
2798
2799
  });
2799
- }, []), id = Xu ? {
2800
- consent: Xu.plan.consent,
2801
- withdrawnCount: Xu.plan.withdrawnCount,
2802
- movesToNewConversation: Xu.plan.movesToNewConversation,
2803
- draftKept: Xu.plan.draftKept,
2804
- targetName: Xu.targetName,
2805
- ...Xu.currentName === void 0 ? {} : { currentName: Xu.currentName }
2806
- } : void 0, ad = Xu?.target.kind === "mode" ? Xu.target.mode : null, od = ad === null ? void 0 : R.find((e) => e.id === ad) ?? { id: ad }, sd = A(null), cd = k(() => {
2800
+ }, []), ad = Zu ? {
2801
+ consent: Zu.plan.consent,
2802
+ withdrawnCount: Zu.plan.withdrawnCount,
2803
+ movesToNewConversation: Zu.plan.movesToNewConversation,
2804
+ draftKept: Zu.plan.draftKept,
2805
+ targetName: Zu.targetName,
2806
+ ...Zu.currentName === void 0 ? {} : { currentName: Zu.currentName }
2807
+ } : void 0, od = Zu?.target.kind === "mode" ? Zu.target.mode : null, sd = od === null ? void 0 : R.find((e) => e.id === od) ?? { id: od }, cd = A(null), ld = k(() => {
2807
2808
  if (!F) return 0;
2808
- let e = new Set(Qc.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2809
- return Oe(To, H, Eo, e);
2809
+ let e = new Set($c.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
2810
+ return Oe(Eo, H, Do, e);
2810
2811
  }, [
2811
2812
  F,
2812
- Qc,
2813
+ $c,
2813
2814
  H,
2814
- To,
2815
- Eo
2816
- ]), ld = D(() => {
2817
- ke(sd.current);
2818
- }, []), ud = I && Oa && Qc.length === 0 && !Mo && !No && !G?.sync?.hasOlder, dd = ud ? /* @__PURE__ */ M("div", {
2819
- ref: ka,
2815
+ Eo,
2816
+ Do
2817
+ ]), ud = D(() => {
2818
+ ke(cd.current);
2819
+ }, []), dd = I && ka && $c.length === 0 && !No && !Po && !G?.sync?.hasOlder, fd = dd ? /* @__PURE__ */ M("div", {
2820
+ ref: Aa,
2820
2821
  className: "w-full shrink-0",
2821
2822
  "data-testid": "assistant-page-start-above"
2822
- }) : Qc.length === 0 && (Mo || No) ? /* @__PURE__ */ M(_e, {
2823
- state: Mo ? "loading" : "failed",
2824
- onRetry: Uo
2825
- }) : Qc.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2823
+ }) : $c.length === 0 && (No || Po) ? /* @__PURE__ */ M(_e, {
2824
+ state: No ? "loading" : "failed",
2825
+ onRetry: Wo
2826
+ }) : $c.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
2826
2827
  className: "flex min-h-0 flex-1 flex-col",
2827
2828
  children: /* @__PURE__ */ M(S, {
2828
- onShowEarlier: Wo,
2829
- disabled: Mo
2829
+ onShowEarlier: Go,
2830
+ disabled: No
2830
2831
  })
2831
- }) : Qc.length === 0 ? /* @__PURE__ */ M(me, {
2832
+ }) : $c.length === 0 ? /* @__PURE__ */ M(me, {
2832
2833
  mode: U,
2833
- onSuggestionClick: Gc,
2834
- explainsAuto: Yo,
2835
- suggestions: Yo && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2836
- }) : /* @__PURE__ */ oa("div", {
2834
+ onSuggestionClick: Kc,
2835
+ explainsAuto: Xo,
2836
+ suggestions: Xo && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2837
+ }) : /* @__PURE__ */ sa("div", {
2837
2838
  className: "flex min-h-0 flex-1 flex-col",
2838
2839
  children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(S, {
2839
- onShowEarlier: Wo,
2840
- disabled: Mo
2840
+ onShowEarlier: Go,
2841
+ disabled: No
2841
2842
  }) : null, /* @__PURE__ */ M(c, {
2842
- onApprovePendingWrite: Us,
2843
- approvingWriteRef: Fs,
2844
- approvableMessageId: nl?.messageId ?? null,
2845
- retryableMessageId: rl,
2846
- messages: Qc,
2847
- decorate: I ? du : void 0,
2848
- processing: bo ?? null,
2849
- streamingMessageId: So,
2850
- failedMessageId: Co,
2851
- onRetry: Fs === null ? qc : void 0,
2852
- renderWriteProposals: al,
2853
- hidesLegacyWriteCard: il,
2854
- renderUiOffers: sl,
2855
- onStopTurn: F ? void 0 : Yu,
2856
- stopTurnLabel: F ? void 0 : Da
2843
+ onApprovePendingWrite: Ws,
2844
+ approvingWriteRef: Is,
2845
+ approvableMessageId: rl?.messageId ?? null,
2846
+ retryableMessageId: il,
2847
+ messages: $c,
2848
+ decorate: I ? fu : void 0,
2849
+ processing: xo ?? null,
2850
+ streamingMessageId: Co,
2851
+ failedMessageId: wo,
2852
+ onRetry: Is === null ? Jc : void 0,
2853
+ renderWriteProposals: ol,
2854
+ hidesLegacyWriteCard: al,
2855
+ renderUiOffers: cl,
2856
+ onStopTurn: F ? void 0 : Xu,
2857
+ stopTurnLabel: F ? void 0 : Oa
2857
2858
  })]
2858
2859
  });
2859
- return /* @__PURE__ */ oa("div", {
2860
- ref: sd,
2860
+ return /* @__PURE__ */ sa("div", {
2861
+ ref: cd,
2861
2862
  className: "relative flex flex-1 flex-col overflow-hidden",
2862
- style: ud ? _a : void 0,
2863
+ style: dd ? va : void 0,
2863
2864
  children: [
2864
- /* @__PURE__ */ oa("div", {
2865
+ /* @__PURE__ */ sa("div", {
2865
2866
  className: "contents",
2866
2867
  inert: $.active && !I || J || void 0,
2867
2868
  ...q.ids ? F ? { id: q.ids.chatPanel } : {
@@ -2870,123 +2871,123 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
2870
2871
  "aria-labelledby": q.ids.chatTab
2871
2872
  } : {},
2872
2873
  children: [
2873
- Lo === null ? null : /* @__PURE__ */ M(ge, { onDismiss: () => Io(Lo) }),
2874
- ul.length > 0 && !$.active && !I ? /* @__PURE__ */ M(he, {
2875
- count: ul.length,
2876
- onOpenTranscript: () => us(!0)
2874
+ Ro === null ? null : /* @__PURE__ */ M(ge, { onDismiss: () => Lo(Ro) }),
2875
+ dl.length > 0 && !$.active && !I ? /* @__PURE__ */ M(he, {
2876
+ count: dl.length,
2877
+ onOpenTranscript: () => ds(!0)
2877
2878
  }) : null,
2878
- dd,
2879
- Ao ? /* @__PURE__ */ M(ve, { onStartNew: () => no() }) : null,
2880
- jo && H ? /* @__PURE__ */ M(x, { onUnarchive: () => Ri.updateConversation(H, { archived: !1 }) }) : null,
2881
- zc === null ? null : /* @__PURE__ */ M(ye, {
2879
+ fd,
2880
+ jo ? /* @__PURE__ */ M(ve, { onStartNew: () => ro() }) : null,
2881
+ Mo && H ? /* @__PURE__ */ M(x, { onUnarchive: () => zi.updateConversation(H, { archived: !1 }) }) : null,
2882
+ Bc === null ? null : /* @__PURE__ */ M(ye, {
2882
2883
  tr: P,
2883
- onDismiss: () => Bc(null)
2884
+ onDismiss: () => Vc(null)
2884
2885
  }),
2885
- Qc.length > 0 && (Mo || No) ? /* @__PURE__ */ M(_e, {
2886
- state: Mo ? "loading" : "failed",
2887
- onRetry: Uo,
2886
+ $c.length > 0 && (No || Po) ? /* @__PURE__ */ M(_e, {
2887
+ state: No ? "loading" : "failed",
2888
+ onRetry: Wo,
2888
2889
  compact: !0
2889
2890
  }) : null,
2890
2891
  /* @__PURE__ */ M(Ce, {
2891
- onStartVoiceSession: $.available && Ds ? Ul : void 0,
2892
+ onStartVoiceSession: $.available && Os ? Wl : void 0,
2892
2893
  onSend: (e, t) => {
2893
- let n = ea.getState().actions.take();
2894
+ let n = ta.getState().actions.take();
2894
2895
  Q(e, t, {
2895
2896
  fromPerson: !0,
2896
2897
  ...n ? { focus: n } : {}
2897
2898
  });
2898
2899
  },
2899
- onDraftChange: Nc,
2900
- inputRef: F ? xa : void 0,
2901
- viewSwitch: F && !I && q.ids && q.compact && !Mu ? /* @__PURE__ */ M(Le, {
2900
+ onDraftChange: Pc,
2901
+ inputRef: F ? Sa : void 0,
2902
+ viewSwitch: F && !I && q.ids && q.compact && !Nu ? /* @__PURE__ */ M(Le, {
2902
2903
  selected: q.compact.view,
2903
2904
  onSelect: q.compact.selectView,
2904
2905
  ids: q.ids,
2905
2906
  instance: "chat"
2906
2907
  }) : void 0,
2907
- aboveCard: cd > 0 ? /* @__PURE__ */ M(Ee, {
2908
- count: cd,
2909
- onReview: ja && Ta ? vu : ld,
2910
- opensFull: ja && Ta !== void 0
2908
+ aboveCard: ld > 0 ? /* @__PURE__ */ M(Ee, {
2909
+ count: ld,
2910
+ onReview: Ma && Ea ? yu : ud,
2911
+ opensFull: Ma && Ea !== void 0
2911
2912
  }) : void 0,
2912
- disabled: xo || Fs !== null || Mo || uc,
2913
- readOnly: Ao,
2913
+ disabled: So || Is !== null || No || dc,
2914
+ readOnly: jo,
2914
2915
  placeholder: U === "api-calls" ? P("chatArea.placeholderActions", "What would you like me to do?") : P("chatArea.placeholderGeneral", "Ask me anything…"),
2915
2916
  mode: U,
2916
- writeAccessDenied: ya === "denied" && !!ws?.writeCapable,
2917
- availableModes: qo,
2918
- attachmentCharsPerFile: ts,
2919
- onModeChange: F ? ed : Gu,
2920
- auto: Jo ? {
2921
- active: Yo,
2922
- onSelect: F ? td : Wu
2917
+ writeAccessDenied: ba === "denied" && !!Ts?.writeCapable,
2918
+ availableModes: Jo,
2919
+ attachmentCharsPerFile: ns,
2920
+ onModeChange: F ? td : Ku,
2921
+ auto: Yo ? {
2922
+ active: Xo,
2923
+ onSelect: F ? nd : Gu
2923
2924
  } : void 0,
2924
- suspendDictation: J || F && !va,
2925
- onVoiceStateChange: q.ids || ja ? mu : void 0,
2926
- modeReadOnly: ja || void 0,
2925
+ suspendDictation: J || F && !ya,
2926
+ onVoiceStateChange: q.ids || Ma ? hu : void 0,
2927
+ modeReadOnly: Ma || void 0,
2927
2928
  voiceSessionActive: F ? $.active : void 0,
2928
2929
  concealed: I && $.active,
2929
- presentation: ba,
2930
- turnInFlight: xo,
2931
- turnId: xo ? bo?.messageId ?? null : null,
2932
- onStop: F ? Yu : void 0,
2933
- modeDisabledReason: xo ? "replying" : "busy"
2930
+ presentation: xa,
2931
+ turnInFlight: So,
2932
+ turnId: So ? xo?.messageId ?? null : null,
2933
+ onStop: F ? Xu : void 0,
2934
+ modeDisabledReason: So ? "replying" : "busy"
2934
2935
  }),
2935
- I ? /* @__PURE__ */ oa(aa, { children: [ud && !$.active ? /* @__PURE__ */ M("div", {
2936
- ref: Aa,
2936
+ I ? /* @__PURE__ */ sa(oa, { children: [dd && !$.active ? /* @__PURE__ */ M("div", {
2937
+ ref: ja,
2937
2938
  className: "w-full shrink-0",
2938
2939
  "data-testid": "assistant-page-start-below"
2939
2940
  }) : null, /* @__PURE__ */ M("div", {
2940
- ref: el,
2941
+ ref: tl,
2941
2942
  className: "contents",
2942
2943
  "data-testid": "assistant-page-voice-slot"
2943
2944
  })] }) : null,
2944
2945
  F ? /* @__PURE__ */ M(Me, { children: /* @__PURE__ */ M(Ne, {
2945
2946
  productKey: L,
2946
- enabled: !!Fa,
2947
+ enabled: !!Ia,
2947
2948
  testId: "assistant-ai-credit-balance"
2948
- }) }) : /* @__PURE__ */ oa(aa, { children: [/* @__PURE__ */ M(Ne, {
2949
+ }) }) : /* @__PURE__ */ sa(oa, { children: [/* @__PURE__ */ M(Ne, {
2949
2950
  productKey: L,
2950
- enabled: !!Fa,
2951
+ enabled: !!Ia,
2951
2952
  className: "px-3 pt-1 text-center",
2952
2953
  testId: "assistant-ai-credit-balance"
2953
2954
  }), /* @__PURE__ */ M(je, { className: "px-3 pb-2 pt-1" })] })
2954
2955
  ]
2955
2956
  }),
2956
- os && !$.active ? /* @__PURE__ */ M(Se, {
2957
- turns: ul,
2958
- onClose: () => us(!1),
2959
- onSave: dl,
2960
- onContinueInChat: Kl ? ql : void 0,
2957
+ ss && !$.active ? /* @__PURE__ */ M(Se, {
2958
+ turns: dl,
2959
+ onClose: () => ds(!1),
2960
+ onSave: fl,
2961
+ onContinueInChat: ql ? Jl : void 0,
2961
2962
  closeOnEscape: !0,
2962
- onShowEarlier: G?.sync?.hasOlder ? Wo : void 0,
2963
- showEarlierDisabled: Mo,
2964
- renderAfterTurn: ol
2963
+ onShowEarlier: G?.sync?.hasOlder ? Go : void 0,
2964
+ showEarlierDisabled: No,
2965
+ renderAfterTurn: sl
2965
2966
  }) : null,
2966
- Mu && q.ids && q.compact ? /* @__PURE__ */ M(Re, {
2967
+ Nu && q.ids && q.compact ? /* @__PURE__ */ M(Re, {
2967
2968
  ids: q.ids,
2968
2969
  compact: q.compact
2969
- }) : J && ss && q.ids ? F && q.compact && ss.CompactView ? /* @__PURE__ */ M(Ie, {
2970
- tab: ss,
2971
- CompactView: ss.CompactView,
2970
+ }) : J && cs && q.ids ? F && q.compact && cs.CompactView ? /* @__PURE__ */ M(Ie, {
2971
+ tab: cs,
2972
+ CompactView: cs.CompactView,
2972
2973
  ids: q.ids,
2973
2974
  compact: q.compact,
2974
- shown: Nu,
2975
- voice: Eu,
2975
+ shown: Pu,
2976
+ voice: Du,
2976
2977
  ...$.active ? { mute: {
2977
2978
  muted: $.session.muted,
2978
2979
  toggle: $.toggleMute
2979
2980
  } } : {},
2980
- ...Pu ? { ask: Bu } : {},
2981
+ ...Fu ? { ask: Vu } : {},
2981
2982
  footer: /* @__PURE__ */ M(Me, {})
2982
2983
  }) : /* @__PURE__ */ M(Fe, {
2983
- tab: ss,
2984
+ tab: cs,
2984
2985
  id: q.ids.avatarPanel,
2985
2986
  labelledBy: q.ids.avatarTab,
2986
2987
  leaveHintId: q.ids.leaveHint,
2987
- shown: Nu,
2988
- voice: Eu,
2989
- ...Pu ? { ask: Bu } : {}
2988
+ shown: Pu,
2989
+ voice: Du,
2990
+ ...Fu ? { ask: Vu } : {}
2990
2991
  }) : null,
2991
2992
  $.active && /* @__PURE__ */ M(Pe, {
2992
2993
  session: $.session,
@@ -3000,66 +3001,66 @@ var ha = () => () => {}, ga = () => "off", _a = { overflowY: "auto" }, va = ({ v
3000
3001
  correcting: $.correcting,
3001
3002
  onLetMeFinish: $.letMeFinish,
3002
3003
  onImDone: $.imDone,
3003
- turns: xl,
3004
+ turns: Sl,
3004
3005
  spokenChunks: $.spokenChunks,
3005
- attachments: fl.attachments,
3006
- onAttachFiles: fl.addFiles,
3007
- onRemoveAttachment: fl.remove,
3008
- onRetryAttachment: fl.retry,
3009
- canAttachMore: fl.canAddMore,
3010
- preparingAttachments: fl.preparingCount,
3011
- attachmentsLocked: fl.isCommitting,
3012
- attachmentNotice: gl,
3013
- onSaveTranscript: dl,
3014
- onContinueInChat: ql,
3006
+ attachments: pl.attachments,
3007
+ onAttachFiles: pl.addFiles,
3008
+ onRemoveAttachment: pl.remove,
3009
+ onRetryAttachment: pl.retry,
3010
+ canAttachMore: pl.canAddMore,
3011
+ preparingAttachments: pl.preparingCount,
3012
+ attachmentsLocked: pl.isCommitting,
3013
+ attachmentNotice: _l,
3014
+ onSaveTranscript: fl,
3015
+ onContinueInChat: Jl,
3015
3016
  onInterrupt: () => {
3016
- uu(), $.interrupt(), Vs();
3017
+ du(), $.interrupt(), Hs();
3017
3018
  },
3018
- spoken: Xc,
3019
+ spoken: Zc,
3019
3020
  onToggleMute: $.toggleMute,
3020
- onEnd: fu,
3021
- proposalChip: kl ? ja && Ta ? {
3021
+ onEnd: pu,
3022
+ proposalChip: Al ? Ma && Ea ? {
3022
3023
  label: P("waitingChange.reviewInFull", "Review in full assistant"),
3023
- status: te(kl, P),
3024
- onOpen: Ta
3024
+ status: te(Al, P),
3025
+ onOpen: Ea
3025
3026
  } : {
3026
- label: te(kl, P),
3027
- onOpen: Ol
3027
+ label: te(Al, P),
3028
+ onOpen: kl
3028
3029
  } : null,
3029
- proposalTray: ja ? null : jl,
3030
- renderAfterTurn: ol,
3031
- onViewChange: q.ids ? Ou : void 0,
3032
- ...ja ? { view: J || ku ? "mini" : "compact" } : I ? {
3030
+ proposalTray: Ma ? null : Ml,
3031
+ renderAfterTurn: sl,
3032
+ onViewChange: q.ids ? ku : void 0,
3033
+ ...Ma ? { view: J || Au ? "mini" : "compact" } : I ? {
3033
3034
  view: "page",
3034
- pageSlot: $c
3035
+ pageSlot: el
3035
3036
  } : {},
3036
- startedCue: F ? ms ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3037
+ startedCue: F ? hs ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
3037
3038
  }),
3038
3039
  /* @__PURE__ */ M(l, {
3039
- open: ns !== null,
3040
- mode: qu,
3041
- currentMode: ws ?? { id: U },
3042
- onConfirm: Ku,
3043
- onCancel: Ju
3040
+ open: rs !== null,
3041
+ mode: Ju,
3042
+ currentMode: Ts ?? { id: U },
3043
+ onConfirm: qu,
3044
+ onCancel: Yu
3044
3045
  }),
3045
3046
  F ? /* @__PURE__ */ M(l, {
3046
- open: Xu?.open === !0,
3047
- mode: od,
3048
- currentMode: ws ?? { id: U },
3049
- switchPlan: id,
3050
- onConfirm: nd,
3051
- onCancel: rd
3047
+ open: Zu?.open === !0,
3048
+ mode: sd,
3049
+ currentMode: Ts ?? { id: U },
3050
+ switchPlan: ad,
3051
+ onConfirm: rd,
3052
+ onCancel: id
3052
3053
  }) : null,
3053
3054
  /* @__PURE__ */ M(u, {
3054
- ...Do.dialog,
3055
- view: cl?.view ?? Do.dialog.view,
3056
- serverNow: cl?.serverNow ?? NaN,
3057
- arrivedAt: cl?.arrivedAt ?? NaN,
3058
- capabilities: cl ? wo[cl.session.sandboxId] : null,
3059
- turnInFlight: xo,
3055
+ ...Oo.dialog,
3056
+ view: ll?.view ?? Oo.dialog.view,
3057
+ serverNow: ll?.serverNow ?? NaN,
3058
+ arrivedAt: ll?.arrivedAt ?? NaN,
3059
+ capabilities: ll ? To[ll.session.sandboxId] : null,
3060
+ turnInFlight: So,
3060
3061
  tr: P
3061
3062
  })
3062
3063
  ]
3063
3064
  });
3064
3065
  };
3065
- export { va as AssistantChatArea };
3066
+ export { ya as AssistantChatArea };