@burdenoff/fe-libs 2026.1118.6 → 2026.1118.8

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