@burdenoff/fe-libs 2026.1114.5 → 2026.1114.6

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