@burdenoff/fe-libs 2026.1028.5 → 2026.1028.7

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.
@@ -49,69 +49,70 @@ import { getAssistantDisplayContent as rn } from "../displayContent.js";
49
49
  import { NO_FIRST_TEXT as an, buildAssistantProgress as on, readAheadFor as sn, snapshotReplyFloor as cn, startSessionReadAhead as ln, trackFirstText as un } from "../turnProgress.js";
50
50
  import { parseToolActivity as dn } from "./AssistantToolActivity.js";
51
51
  import { countSpokenTurns as fn, spokenMessagesSinceContinueNote as pn, spokenTurnText as mn } from "../spokenTurns.js";
52
- import { beginTurn as hn, describeTurn as gn, detectTurnDevice as _n, markTurn as w, restartAttempt as vn, turnClockMs as yn } from "../turnTimeline.js";
53
- import { useAssistantSpeech as bn } from "./AssistantSpeechProvider.js";
54
- import { useLiveAvatarTab as xn, useLiveAvatarTabSeam as Sn } from "./assistantLiveAvatarSeam.js";
55
- import { useVoiceSession as Cn } from "./useVoiceSession.js";
56
- import { isMultimodalBodyRejection as wn, isRecoverableAssistantError as Tn } from "../transportErrors.js";
57
- import { createReadinessTracker as En, planAfterTransportFailure as Dn, planTrustedSandboxFailure as On } from "../sandboxReadiness.js";
58
- import { AssistantAiDisclaimer as kn } from "./AssistantAiDisclaimer.js";
59
- import { writeProposalConfirmState as An } from "./writeProposalPresentation.js";
60
- import { writeProposalUsesDialog as jn } from "./AssistantWriteProposalCard.js";
61
- import { AssistantWriteConfirmDialog as Mn } from "./AssistantWriteConfirmDialog.js";
62
- import { useWriteProposalConfirm as Nn } from "./useWriteProposalConfirm.js";
63
- import { AssistantWriteProposalSlot as Pn } from "./AssistantWriteProposalSlot.js";
64
- import { readWriteProposalRefs as Fn, writeProposalsEnabledFor as In } from "../writeProposalDiscovery.js";
65
- import { planWriteReply as Ln, promptWriteApproval as Rn } from "../writeReplySend.js";
66
- import { useWriteProposals as zn } from "./useWriteProposals.js";
67
- import { AssistantSpokenTurnsNotice as Bn } from "./AssistantSpokenTurnsNotice.js";
68
- import { AssistantHistoryArchivedNotice as Vn, AssistantHistoryDeletedNotice as Hn, AssistantHistoryLoadState as Un, AssistantHistoryReadOnlyBanner as Wn, AssistantHistoryShowEarlier as Gn } from "./AssistantHistoryNotices.js";
69
- import { VoiceTranscriptDrawer as Kn } from "./voice/VoiceTranscriptDrawer.js";
70
- import { downloadFile as qn } from "../exportConversation.js";
71
- import { conversationHasHistory as Jn, isOtherScopeHistoryConversation as Yn, isReadOnlyHistoryConversation as Xn, isReusableHistoryDraft as Zn } from "../history/historyList.js";
72
- import { useAssistantHistoryStatus as Qn } from "../history/historyStatus.js";
73
- import { assistantHistory as $n } from "../history/historyEngine.js";
74
- import { AssistantEmptyState as er } from "./AssistantEmptyState.js";
75
- import { AssistantNothingToDeleteNotice as tr } from "./AssistantDeleteConversationDialog.js";
76
- import { assistantHistoryIsOn as nr } from "./conversationDelete.js";
77
- import { useConversationDeleteDialog as rr } from "./conversationDeleteDialog.js";
78
- import { useControlConfirmDialog as ir } from "./controlConfirmDialog.js";
79
- import { useLeaveConfirmAsking as ar } from "./leaveConfirm.js";
80
- import { startFocusReturnAfterKeep as or } from "./leaveConfirmFocus.js";
81
- import { resolveConversationDeleteTarget as sr } from "../conversationDeleteCommand.js";
82
- import { resumeContextFor as cr } from "../history/historyResume.js";
83
- import { useHistoryRowControlsFor as lr } from "../history/useHistoryRowControls.js";
84
- import { liveCoverage as ur } from "../liveDeltas.js";
85
- import { createLiveRender as dr } from "../liveOverlay.js";
86
- import { AssistantMessageList as fr } from "./AssistantMessageList.js";
87
- import { AssistantUiOfferLinks as pr } from "./AssistantUiOfferLink.js";
88
- import { AssistantVoiceSession as mr } from "./voice/AssistantVoiceSession.js";
89
- import { voiceStartBlocker as hr, voiceStartBlockerLasts as gr } from "./voice/voiceStartGate.js";
90
- import { avatarAskBlocker as _r, avatarAskWrites as vr, avatarTabAskLine as yr } from "./avatar/avatarAskGate.js";
91
- import { createAvatarTabDraft as br } from "./avatar/avatarTabDraft.js";
92
- import { AssistantAvatarTab as xr } from "./avatar/AssistantAvatarTab.js";
93
- import { useAssistantApiAccess as Sr } from "../useAssistantApiAccess.js";
94
- import { useConversationTurns as Cr } from "../useConversationTurns.js";
95
- import { openTurnStream as wr, turnStreamAvailable as Tr } from "../turnStream.js";
96
- import { createSnapshotPoller as Er } from "../snapshotPoller.js";
97
- import { sendAssistantTurnTimings as Dr, startTurnTimingReporting as Or } from "../turnTimingReporter.js";
98
- import { QuarantineSet as kr, WarmCancelled as Ar, claimPreopenedSession as jr, consumeWarm as Mr, preopenKey as Nr, preopenWanted as Pr, prewarmTarget as Fr, settleWarmBeforeSend as Ir, startPreopen as Lr, startWarm as Rr, warmState as zr } from "../prewarm.js";
99
- import { navEntryIds as Br } from "../uiActions/resolveTarget.js";
100
- import { lookupNamedRecords as Vr } from "../uiActions/recordNames.js";
101
- import { couldBeLocalUiCommand as Hr, isAlreadyThere as Ur, matchLocalUiCommand as Wr, mayBeNavigationFollowUp as Gr, navDestinations as Kr, planThemeChange as qr } from "../localUiCommands.js";
102
- import { offerAssentFor as Jr } from "../localeCommands/assent.js";
103
- import { readControlSnapshot as Yr } from "../appControls/snapshot.js";
104
- import { runNavigation as Xr } from "../uiActions/navigationOutcome.js";
105
- import { assistantBackStack as Zr, isBackRunnable as Qr } from "../uiActions/backStack.js";
106
- import { subscribeDraftPathname as $r } from "../uiActions/draftPathname.js";
107
- import { buildNavigateAction as ei, destinationForPath as ti, labelForPath as ni, newestAssistantOnSurface as ri } from "../uiActions/navigateAction.js";
108
- import { buildNavigationContext as ii, latestReplyOnSurface as ai, rememberPresentedList as oi } from "../uiActions/linkContext.js";
109
- import { buildUiCatalogue as si, markUiCatalogueSent as ci, uiCatalogueSent as li, uiCatalogueSessionKey as ui } from "../uiActions/uiCatalogue.js";
110
- import { offerYesOnSurface as di } from "../uiActions/offerYesOnSurface.js";
111
- import { parseNavIntent as fi } from "../uiActions/navIntent.js";
112
- import { decideActOnResolve as pi, n4LeaveGuard as mi } from "../uiActions/actOnResolve.js";
113
- import { planAppControl as hi } from "../appControls/plan.js";
114
- import { dispatchAssistantQuotaExhausted as gi, notifyAiCreditsUpdated as _i } from "../aiCredits.js";
52
+ import { beginTurn as hn, describeTurn as w, detectTurnDevice as gn, markTurn as T, restartAttempt as _n, turnClockMs as vn } from "../turnTimeline.js";
53
+ import { useAssistantSpeech as yn } from "./AssistantSpeechProvider.js";
54
+ import { useLiveAvatarTab as bn, useLiveAvatarTabSeam as xn } from "./assistantLiveAvatarSeam.js";
55
+ import { useVoiceSession as Sn } from "./useVoiceSession.js";
56
+ import { isMultimodalBodyRejection as Cn, isRecoverableAssistantError as wn } from "../transportErrors.js";
57
+ import { createReadinessTracker as Tn, planAfterTransportFailure as En, planTrustedSandboxFailure as Dn } from "../sandboxReadiness.js";
58
+ import { AssistantAiDisclaimer as On } from "./AssistantAiDisclaimer.js";
59
+ import { writeProposalConfirmState as kn } from "./writeProposalPresentation.js";
60
+ import { writeProposalUsesDialog as An } from "./AssistantWriteProposalCard.js";
61
+ import { dispatchAssistantQuotaExhausted as jn, notifyAiCreditsUpdated as Mn } from "../aiCredits.js";
62
+ import { AiCreditBalance as Nn } from "./AiCreditBalance.js";
63
+ import { AssistantWriteConfirmDialog as Pn } from "./AssistantWriteConfirmDialog.js";
64
+ import { useWriteProposalConfirm as Fn } from "./useWriteProposalConfirm.js";
65
+ import { AssistantWriteProposalSlot as In } from "./AssistantWriteProposalSlot.js";
66
+ import { readWriteProposalRefs as Ln, writeProposalsEnabledFor as Rn } from "../writeProposalDiscovery.js";
67
+ import { planWriteReply as zn, promptWriteApproval as Bn } from "../writeReplySend.js";
68
+ import { useWriteProposals as Vn } from "./useWriteProposals.js";
69
+ import { AssistantSpokenTurnsNotice as Hn } from "./AssistantSpokenTurnsNotice.js";
70
+ import { AssistantHistoryArchivedNotice as Un, AssistantHistoryDeletedNotice as Wn, AssistantHistoryLoadState as Gn, AssistantHistoryReadOnlyBanner as Kn, AssistantHistoryShowEarlier as qn } from "./AssistantHistoryNotices.js";
71
+ import { VoiceTranscriptDrawer as Jn } from "./voice/VoiceTranscriptDrawer.js";
72
+ import { downloadFile as Yn } from "../exportConversation.js";
73
+ import { conversationHasHistory as Xn, isOtherScopeHistoryConversation as Zn, isReadOnlyHistoryConversation as Qn, isReusableHistoryDraft as $n } from "../history/historyList.js";
74
+ import { useAssistantHistoryStatus as er } from "../history/historyStatus.js";
75
+ import { assistantHistory as tr } from "../history/historyEngine.js";
76
+ import { AssistantEmptyState as nr } from "./AssistantEmptyState.js";
77
+ import { AssistantNothingToDeleteNotice as rr } from "./AssistantDeleteConversationDialog.js";
78
+ import { assistantHistoryIsOn as ir } from "./conversationDelete.js";
79
+ import { useConversationDeleteDialog as ar } from "./conversationDeleteDialog.js";
80
+ import { useControlConfirmDialog as or } from "./controlConfirmDialog.js";
81
+ import { useLeaveConfirmAsking as sr } from "./leaveConfirm.js";
82
+ import { startFocusReturnAfterKeep as cr } from "./leaveConfirmFocus.js";
83
+ import { resolveConversationDeleteTarget as lr } from "../conversationDeleteCommand.js";
84
+ import { resumeContextFor as ur } from "../history/historyResume.js";
85
+ import { useHistoryRowControlsFor as dr } from "../history/useHistoryRowControls.js";
86
+ import { liveCoverage as fr } from "../liveDeltas.js";
87
+ import { createLiveRender as pr } from "../liveOverlay.js";
88
+ import { AssistantMessageList as mr } from "./AssistantMessageList.js";
89
+ import { AssistantUiOfferLinks as hr } from "./AssistantUiOfferLink.js";
90
+ import { AssistantVoiceSession as gr } from "./voice/AssistantVoiceSession.js";
91
+ import { voiceStartBlocker as _r, voiceStartBlockerLasts as vr } from "./voice/voiceStartGate.js";
92
+ import { avatarAskBlocker as yr, avatarAskWrites as br, avatarTabAskLine as xr } from "./avatar/avatarAskGate.js";
93
+ import { createAvatarTabDraft as Sr } from "./avatar/avatarTabDraft.js";
94
+ import { AssistantAvatarTab as Cr } from "./avatar/AssistantAvatarTab.js";
95
+ import { useAssistantApiAccess as wr } from "../useAssistantApiAccess.js";
96
+ import { useConversationTurns as Tr } from "../useConversationTurns.js";
97
+ import { openTurnStream as Er, turnStreamAvailable as Dr } from "../turnStream.js";
98
+ import { createSnapshotPoller as Or } from "../snapshotPoller.js";
99
+ import { sendAssistantTurnTimings as kr, startTurnTimingReporting as Ar } from "../turnTimingReporter.js";
100
+ import { QuarantineSet as jr, WarmCancelled as Mr, claimPreopenedSession as Nr, consumeWarm as Pr, preopenKey as Fr, preopenWanted as Ir, prewarmTarget as Lr, settleWarmBeforeSend as Rr, startPreopen as zr, startWarm as Br, warmState as Vr } from "../prewarm.js";
101
+ import { navEntryIds as Hr } from "../uiActions/resolveTarget.js";
102
+ import { lookupNamedRecords as Ur } from "../uiActions/recordNames.js";
103
+ import { couldBeLocalUiCommand as Wr, isAlreadyThere as Gr, matchLocalUiCommand as Kr, mayBeNavigationFollowUp as qr, navDestinations as Jr, planThemeChange as Yr } from "../localUiCommands.js";
104
+ import { offerAssentFor as Xr } from "../localeCommands/assent.js";
105
+ import { readControlSnapshot as Zr } from "../appControls/snapshot.js";
106
+ import { runNavigation as Qr } from "../uiActions/navigationOutcome.js";
107
+ import { assistantBackStack as $r, isBackRunnable as ei } from "../uiActions/backStack.js";
108
+ import { subscribeDraftPathname as ti } from "../uiActions/draftPathname.js";
109
+ import { buildNavigateAction as ni, destinationForPath as ri, labelForPath as ii, newestAssistantOnSurface as ai } from "../uiActions/navigateAction.js";
110
+ import { buildNavigationContext as oi, latestReplyOnSurface as si, rememberPresentedList as ci } from "../uiActions/linkContext.js";
111
+ import { buildUiCatalogue as li, markUiCatalogueSent as ui, uiCatalogueSent as di, uiCatalogueSessionKey as fi } from "../uiActions/uiCatalogue.js";
112
+ import { offerYesOnSurface as pi } from "../uiActions/offerYesOnSurface.js";
113
+ import { parseNavIntent as mi } from "../uiActions/navIntent.js";
114
+ import { decideActOnResolve as hi, n4LeaveGuard as gi } from "../uiActions/actOnResolve.js";
115
+ import { planAppControl as _i } from "../appControls/plan.js";
115
116
  import { useAssistantAttachments as vi } from "../useAssistantAttachments.js";
116
117
  import { AssistantComposer as yi } from "./composer/AssistantComposer.js";
117
118
  import { isProdRuntime as bi } from "../env.js";
@@ -119,78 +120,78 @@ import { AssistantApiCallsConsentDialog as xi } from "./AssistantApiCallsConsent
119
120
  import { createDraftCommandCheck as Si } from "./draftCommandCheck.js";
120
121
  import { createClientToolRunner as Ci, offerClientTools as wi } from "../../agent-tools/adapters/assistant.js";
121
122
  import { useVisibleNavItems as Ti } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
122
- import { useCallback as T, useEffect as E, useLayoutEffect as Ei, useMemo as D, useRef as O, useState as k, useSyncExternalStore as Di } from "react";
123
- import { jsx as A, jsxs as Oi } from "react/jsx-runtime";
123
+ import { useCallback as E, useEffect as D, useLayoutEffect as Ei, useMemo as O, useRef as k, useState as A, useSyncExternalStore as Di } from "react";
124
+ import { jsx as j, jsxs as Oi } from "react/jsx-runtime";
124
125
  //#region src/shared/assistant/ui/AssistantChatArea.tsx
125
126
  var ki = 2500, Ai = 600, ji = 2e4, Mi = 1e4, Ni = 1e4, Pi = !1, Fi = {
126
127
  committing: !1,
127
128
  dictating: !1
128
129
  }, Ii = 6e3;
129
- function j() {
130
+ function M() {
130
131
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
131
132
  }
132
133
  var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess: Bi = "unknown" }) => {
133
- let M = s(), { product: N, modes: P, gatherPageContext: Vi, buildPrompt: Hi, reportTurnTimings: Ui, reportTokenUsage: Wi, localUiCommands: Gi } = o(), F = b(o().writeApproval), Ki = T((e, t) => {
134
+ let N = s(), { product: P, modes: F, gatherPageContext: Vi, buildPrompt: Hi, reportTurnTimings: Ui, reportTokenUsage: Wi, localUiCommands: Gi } = o(), I = b(o().writeApproval), Ki = E((e, t) => {
134
135
  let n = v.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
135
136
  return bt({
136
137
  mode: e,
137
- productWriteApproval: F,
138
+ productWriteApproval: I,
138
139
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
139
140
  });
140
- }, [F]), { getAccessToken: I, getWorkspaceToken: qi, userId: L } = r(), { locale: R, isLocaleLoading: Ji } = e(), Yi = v((e) => e.voiceGraceMs), Xi = v((e) => e.handsFreeInterrupt), Zi = v((e) => e.handsFreeStreamNoticeAccepted), Qi = v((e) => e.acceptHandsFreeStreamNotice), $i = v((e) => e.assistantLanguage), ea = v((e) => e.replyLanguage), ta = D(() => it($i, ea, R), [
141
+ }, [I]), { getAccessToken: L, getWorkspaceToken: qi, userId: R } = r(), { locale: z, isLocaleLoading: Ji } = e(), Yi = v((e) => e.voiceGraceMs), Xi = v((e) => e.handsFreeInterrupt), Zi = v((e) => e.handsFreeStreamNoticeAccepted), Qi = v((e) => e.acceptHandsFreeStreamNotice), $i = v((e) => e.assistantLanguage), ea = v((e) => e.replyLanguage), ta = O(() => it($i, ea, z), [
141
142
  $i,
142
143
  ea,
143
- R
144
- ]), na = ta.reply.english, ra = ta.replyIsExplicit, ia = ta.reply.code, { conversations: aa, activeConversationId: z, mode: B, processingByConversationId: oa, setMode: sa, setConversationMode: ca, setActiveConversation: la, createConversation: ua, addMessage: V, updateMessage: da, patchMessage: fa, mergeMessageMetadata: pa, setConversationProcessing: ma, clearConversationProcessing: ha, setBackendSessionId: ga, clearBackendSessionId: _a, setSandbox: va, clearSandbox: ya, acknowledgedWriteModes: ba, acknowledgeWriteMode: xa, autoRouting: Sa, setAutoRouting: Ca, routeConversation: wa } = v(), H = aa.find((e) => e.id === z), Ta = Cr(H), Ea = Ta.all, U = z ? oa[z] : void 0, Da = It(U?.status), Oa = Da ? U?.messageId ?? null : null, ka = U?.status === "error" ? U.messageId : null, Aa = v((e) => e.sandboxWriteCapabilities), { panel: W, entries: ja, retiredSandboxes: Ma } = zn({
145
- tr: M,
146
- productWriteApproval: F
147
- }), Na = Nn({
148
- approve: (e, t) => W.approve(e, t),
149
- decline: (e, t, n) => W.decline(e, t, n),
150
- presented: (e, t) => W.presented(e, t)
151
- }), Pa = Na.dismiss, Fa = O(null);
152
- E(() => {
144
+ z
145
+ ]), na = ta.reply.english, ra = ta.replyIsExplicit, ia = ta.reply.code, { conversations: aa, activeConversationId: B, mode: V, processingByConversationId: oa, setMode: sa, setConversationMode: ca, setActiveConversation: la, createConversation: ua, addMessage: H, updateMessage: da, patchMessage: fa, mergeMessageMetadata: pa, setConversationProcessing: ma, clearConversationProcessing: ha, setBackendSessionId: ga, clearBackendSessionId: _a, setSandbox: va, clearSandbox: ya, acknowledgedWriteModes: ba, acknowledgeWriteMode: xa, autoRouting: Sa, setAutoRouting: Ca, routeConversation: wa } = v(), U = aa.find((e) => e.id === B), Ta = Tr(U), Ea = Ta.all, W = B ? oa[B] : void 0, Da = It(W?.status), Oa = Da ? W?.messageId ?? null : null, ka = W?.status === "error" ? W.messageId : null, Aa = v((e) => e.sandboxWriteCapabilities), { panel: G, entries: ja, retiredSandboxes: Ma } = Vn({
146
+ tr: N,
147
+ productWriteApproval: I
148
+ }), Na = Fn({
149
+ approve: (e, t) => G.approve(e, t),
150
+ decline: (e, t, n) => G.decline(e, t, n),
151
+ presented: (e, t) => G.presented(e, t)
152
+ }), Pa = Na.dismiss, Fa = k(null);
153
+ D(() => {
153
154
  Pa();
154
155
  let e = Fa.current;
155
- Fa.current = z, e && e !== z && W.withdraw(e, "conversation_closed"), z && W.openConversation(z);
156
+ Fa.current = B, e && e !== B && G.withdraw(e, "conversation_closed"), B && G.openConversation(B);
156
157
  }, [
157
- z,
158
- W,
158
+ B,
159
+ G,
159
160
  Pa
160
161
  ]);
161
- let Ia = Xn(H), La = lr(H)?.archivedAt != null, Ra = Qn((e) => z !== null && z in e.loadingIds), za = Qn((e) => z !== null && z in e.loadErrorIds), Ba = Qn((e) => e.remoteDelete), [Va, Ha] = k(() => Qn.getState().remoteDelete?.at ?? null), Ua = Ba?.wasActive === !0 && Ba.at !== Va ? Ba.at : null;
162
- E(() => {
162
+ let Ia = Qn(U), La = dr(U)?.archivedAt != null, Ra = er((e) => B !== null && B in e.loadingIds), za = er((e) => B !== null && B in e.loadErrorIds), Ba = er((e) => e.remoteDelete), [Va, Ha] = A(() => er.getState().remoteDelete?.at ?? null), Ua = Ba?.wasActive === !0 && Ba.at !== Va ? Ba.at : null;
163
+ D(() => {
163
164
  if (Ua === null) return;
164
165
  let e = window.setTimeout(() => Ha(Ua), Ni);
165
166
  return () => window.clearTimeout(e);
166
167
  }, [Ua]);
167
- let { canUseApiCalls: Wa, loading: Ga } = Sr(C(), L), Ka = O(Dt({
168
+ let { canUseApiCalls: Wa, loading: Ga } = wr(C(), R), Ka = k(Dt({
168
169
  loading: Ga,
169
170
  canUseAdminModes: Wa
170
- })).current, qa = O(P);
171
- E(() => {
172
- qa.current = P;
173
- }, [P]);
171
+ })).current, qa = k(F);
172
+ D(() => {
173
+ qa.current = F;
174
+ }, [F]);
174
175
  let Ja = () => {
175
176
  let e = v.getState().activeConversationId;
176
- e && $n.openConversation(e, { modes: qa.current });
177
+ e && tr.openConversation(e, { modes: qa.current });
177
178
  }, Ya = () => {
178
179
  let e = v.getState().activeConversationId;
179
- e && $n.loadEarlier(e);
180
- }, Xa = O(I);
181
- E(() => {
182
- Xa.current = I;
183
- }, [I]);
184
- let Za = !!N && Ui !== !1;
185
- E(() => {
186
- if (Za) return Or({ send: (e) => Dr(e, {
180
+ e && tr.loadEarlier(e);
181
+ }, Xa = k(L);
182
+ D(() => {
183
+ Xa.current = L;
184
+ }, [L]);
185
+ let Za = !!P && Ui !== !1;
186
+ D(() => {
187
+ if (Za) return Ar({ send: (e) => kr(e, {
187
188
  workspaceId: C(),
188
189
  authContext: {
189
190
  accessToken: Xa.current(),
190
191
  organizationId: Pt()
191
192
  }
192
193
  }) });
193
- }, [Za]), E(() => {
194
+ }, [Za]), D(() => {
194
195
  Ka.update({
195
196
  loading: Ga,
196
197
  canUseAdminModes: Wa
@@ -199,66 +200,66 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
199
200
  Ka,
200
201
  Ga,
201
202
  Wa
202
- ]), E(() => () => {
203
+ ]), D(() => () => {
203
204
  Ka.abandon();
204
205
  }, [Ka]);
205
- let Qa = D(() => P.filter((e) => !e.requiresAdmin || Wa), [P, Wa]), $a = ne(Qa), eo = Sa && $a, to = O($a);
206
- E(() => {
206
+ let Qa = O(() => F.filter((e) => !e.requiresAdmin || Wa), [F, Wa]), $a = ne(Qa), eo = Sa && $a, to = k($a);
207
+ D(() => {
207
208
  to.current = $a;
208
209
  }, [$a]);
209
- let no = O(null), ro = O(!1), [io, ao] = k(!1), oo = ht(P), [so, co] = k(null), [lo, uo] = k(null), fo = lo !== null && lo === z, G = xn(), po = Sn(), K = G.open && po !== null, mo = G.close, ho = O(K);
210
+ let no = k(null), ro = k(!1), [io, ao] = A(!1), oo = ht(F), [so, co] = A(null), [lo, uo] = A(null), fo = lo !== null && lo === B, po = bn(), mo = xn(), K = po.open && mo !== null, ho = po.close, go = k(K);
210
211
  Ei(() => {
211
- ho.current = K;
212
+ go.current = K;
212
213
  }, [K]);
213
- let go = T((e) => {
214
- e && ho.current || uo(e ? v.getState().activeConversationId : null);
214
+ let _o = E((e) => {
215
+ e && go.current || uo(e ? v.getState().activeConversationId : null);
215
216
  }, []);
216
- E(() => {
217
- uo((e) => e !== null && e !== z ? null : e);
218
- }, [z]);
219
- let _o = O(void 0), [vo, yo] = k(!1), bo = T((e) => {
220
- _o.current = e, yo(ot(e));
221
- }, []), xo = T(() => {
217
+ D(() => {
218
+ uo((e) => e !== null && e !== B ? null : e);
219
+ }, [B]);
220
+ let vo = k(void 0), [yo, bo] = A(!1), xo = E((e) => {
221
+ vo.current = e, bo(ot(e));
222
+ }, []), So = E(() => {
222
223
  let e = v.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
223
224
  return !t || !n ? null : {
224
225
  id: t,
225
- reusableDraft: Zn(n, ie()),
226
- liveProposals: W.liveFor(t).count,
226
+ reusableDraft: $n(n, ie()),
227
+ liveProposals: G.liveFor(t).count,
227
228
  turnInFlight: It(e.processingByConversationId[t]?.status)
228
229
  };
229
- }, [W]), So = O({}), q = O(En()), J = O(new kr()), Co = O(/* @__PURE__ */ new Set()), wo = D(() => P.find((e) => e.id === B), [P, B]), To = v((e) => {
230
- let t = e.sandboxesByMode[B]?.sandboxId;
230
+ }, [G]), Co = k({}), q = k(Tn()), J = k(new jr()), wo = k(/* @__PURE__ */ new Set()), To = O(() => F.find((e) => e.id === V), [F, V]), Eo = v((e) => {
231
+ let t = e.sandboxesByMode[V]?.sandboxId;
231
232
  return t ? e.sandboxWriteCapabilities[t] : void 0;
232
- }), Eo = wo !== void 0 && bt({
233
- mode: B,
234
- productWriteApproval: F,
235
- capabilities: To
236
- }), Do = B === "assistant" || wo !== void 0 && !wo.writeCapable && !Ce(B) || Eo;
237
- E(() => {
238
- if (B !== "assistant" && wo?.writeCapable && !de(ba, B)) {
233
+ }), Do = To !== void 0 && bt({
234
+ mode: V,
235
+ productWriteApproval: I,
236
+ capabilities: Eo
237
+ }), Oo = V === "assistant" || To !== void 0 && !To.writeCapable && !Ce(V) || Do;
238
+ D(() => {
239
+ if (V !== "assistant" && To?.writeCapable && !de(ba, V)) {
239
240
  sa("assistant");
240
241
  return;
241
242
  }
242
- Ga || (!wo || wo.requiresAdmin && !Wa) && B !== "assistant" && sa("assistant");
243
+ Ga || (!To || To.requiresAdmin && !Wa) && V !== "assistant" && sa("assistant");
243
244
  }, [
244
- B,
245
- wo,
245
+ V,
246
+ To,
246
247
  Wa,
247
248
  Ga,
248
249
  sa,
249
250
  ba
250
251
  ]);
251
- let Oo = T((e, t, n, r) => {
252
+ let ko = E((e, t, n, r) => {
252
253
  ma(e, n, t, null, r);
253
- }, [ma]), ko = T(async (e, t, n, r, i, a = null) => {
254
+ }, [ma]), Ao = E(async (e, t, n, r, i, a = null) => {
254
255
  let o = (e, t) => {
255
- r && Oo(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
256
+ r && ko(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
256
257
  }, s = (e) => {
257
- r && w(r.assistantMessageId, e);
258
+ r && T(r.assistantMessageId, e);
258
259
  }, c = () => {
259
260
  s("bootAdopted"), a?.beginBoot();
260
261
  }, l = () => a !== null && (a.signal.aborted || C() !== t), u = () => {
261
- if (l()) throw new Ar("cancelled");
262
+ if (l()) throw new Mr("cancelled");
262
263
  }, d = v.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, te = !1, ne = !1, re = async (r) => {
263
264
  if (i && !J.current.has(r) && q.current.isFresh(r)) return p = !0, !0;
264
265
  m = !0;
@@ -268,14 +269,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
268
269
  o = !0, c();
269
270
  });
270
271
  } catch {
271
- if (l()) throw new Ar("cancelled");
272
+ if (l()) throw new Mr("cancelled");
272
273
  return q.current.invalidate(r), J.current.add(r), a?.dead.push(r), ne = !0, !1;
273
274
  }
274
275
  return u(), q.current.markVerified(r), o && (te = !0), !0;
275
276
  };
276
277
  if (d && (va(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await re(d) || (va(e, null, "provisioning"), d = null)), !d) {
277
278
  o("provisioning", "lookingForEnvironment");
278
- let r = await ve(t, N, e, bi(), n, J.current, F);
279
+ let r = await ve(t, P, e, bi(), n, J.current, I);
279
280
  u();
280
281
  let i = r?.id ?? null;
281
282
  if (i) {
@@ -285,10 +286,10 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
285
286
  }
286
287
  }
287
288
  if (!d) {
288
- if (a && !a.mayCreate) throw new Ar("no-create");
289
- if (s("provisionStarted"), e === "api-calls" && !I()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
289
+ if (a && !a.mayCreate) throw new Mr("no-create");
290
+ if (s("provisionStarted"), e === "api-calls" && !L()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
290
291
  o("provisioning", "startingEnvironment"), va(e, null, "provisioning");
291
- let r = a ? [] : await Ee(t, N, e, bi(), n, J.current, F);
292
+ let r = a ? [] : await Ee(t, P, e, bi(), n, J.current, I);
292
293
  if (r.length > 0) {
293
294
  let e = new Set(r);
294
295
  for (let e of r) q.current.invalidate(e), J.current.add(e);
@@ -298,7 +299,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
298
299
  s("createRequested");
299
300
  let i = a?.beginCreate();
300
301
  try {
301
- d = await ge(N, e, t, bi(), Ai, n, { writeApproval: F });
302
+ d = await ge(P, e, t, bi(), Ai, n, { writeApproval: I });
302
303
  } finally {
303
304
  i?.();
304
305
  }
@@ -314,20 +315,20 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
314
315
  };
315
316
  }, [
316
317
  ya,
318
+ L,
319
+ P,
317
320
  I,
318
- N,
319
- F,
320
321
  va,
321
- Oo
322
- ]), Ao = T(async function e(t, n, r, i, a, o = {}) {
323
- let s = await Ir(i, r, (e) => Oo(t, n, "provisioning", e), () => w(n, "prewarmJoined"));
322
+ ko
323
+ ]), jo = E(async function e(t, n, r, i, a, o = {}) {
324
+ let s = await Rr(i, r, (e) => ko(t, n, "provisioning", e), () => T(n, "prewarmJoined"));
324
325
  for (let e of s.dead) q.current.invalidate(e), J.current.add(e);
325
- s.verified && !J.current.has(s.verified) && q.current.markVerified(s.verified), s.joined && gn(n, { prewarm: s.joined });
326
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await ko(r, i, a, {
326
+ s.verified && !J.current.has(s.verified) && q.current.markVerified(s.verified), s.joined && w(n, { prewarm: s.joined });
327
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Ao(r, i, a, {
327
328
  conversationId: t,
328
329
  assistantMessageId: n
329
- }, o.trustCache !== !1), ee = Mr(i, r, c);
330
- !s.waited && ee && gn(n, { prewarm: "hit" });
330
+ }, o.trustCache !== !1), ee = Pr(i, r, c);
331
+ !s.waited && ee && w(n, { prewarm: "hit" });
331
332
  let m = v.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, te = !1, ne = null;
332
333
  if (m) {
333
334
  let e = ln(c, m, (e, t) => be(e, i, t, r, a, { limit: 50 }));
@@ -341,14 +342,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
341
342
  }
342
343
  let re = !1;
343
344
  if (!m) {
344
- let e = jr(Nr({
345
+ let e = Nr(Fr({
345
346
  workspaceId: i,
346
347
  mode: r,
347
348
  sandboxId: c,
348
- userId: L
349
+ userId: R
349
350
  }), Date.now());
350
351
  if (e) {
351
- "pending" in e && Oo(t, n, "connecting", "preparingSession");
352
+ "pending" in e && ko(t, n, "connecting", "preparingSession");
352
353
  let o = "sessionId" in e ? e.sessionId : await e.pending;
353
354
  if (o && !J.current.has(c)) try {
354
355
  (await xe(c, i, o, r, a)).mode === r && (m = o, re = !0, ga(t, m), te = !0);
@@ -356,21 +357,21 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
356
357
  }
357
358
  }
358
359
  if (!m) {
359
- Oo(t, n, "connecting", "preparingSession");
360
+ ko(t, n, "connecting", "preparingSession");
360
361
  let s;
361
362
  try {
362
363
  s = await y(c, i, r, a);
363
364
  } catch (s) {
364
365
  if (p) {
365
366
  q.current.invalidate(c);
366
- let l = On(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
367
- if (l === "check-network" && (l = await Dn(() => ve(i, N, r, bi(), a, J.current, F))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
368
- p || gn(n, { cacheProofFailed: !0 }), l === "replace" && (J.current.add(c), _a(t), ya(r), W.retireSandbox(c));
367
+ let l = Dn(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
368
+ if (l === "check-network" && (l = await En(() => ve(i, P, r, bi(), a, J.current, I))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
369
+ p || w(n, { cacheProofFailed: !0 }), l === "replace" && (J.current.add(c), _a(t), ya(r), G.retireSandbox(c));
369
370
  let s = await e(t, n, r, i, a, {
370
371
  ...o,
371
372
  trustCache: !1
372
373
  });
373
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && gn(n, { cacheProofFailed: !0 }), {
374
+ return p && (s.deadSandboxProbe || s.sandboxId !== c) && w(n, { cacheProofFailed: !0 }), {
374
375
  ...s,
375
376
  sandboxProbed: s.sandboxProbed || u,
376
377
  sandboxAdopted: s.sandboxAdopted || d,
@@ -394,19 +395,19 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
394
395
  sessionPreopened: re
395
396
  };
396
397
  }, [
397
- ko,
398
+ Ao,
398
399
  _a,
399
400
  ya,
400
- N,
401
- F,
401
+ P,
402
+ I,
402
403
  ga,
403
- Oo,
404
- L,
405
- W
406
- ]), jo = T((e, t = !1) => {
404
+ ko,
405
+ R,
406
+ G
407
+ ]), Mo = E((e, t = !1) => {
407
408
  let n = C();
408
409
  if (!n) return;
409
- let r = v.getState(), i = Date.now(), a = Fr({
410
+ let r = v.getState(), i = Date.now(), a = Lr({
410
411
  autoRouting: r.autoRouting,
411
412
  autoOffered: to.current,
412
413
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
@@ -418,17 +419,17 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
418
419
  dictated: e,
419
420
  voiceProposalBound: (e) => Ki(e),
420
421
  turnInFlight: Object.values(r.processingByConversationId).some((e) => It(e?.status)),
421
- ...zr(n),
422
+ ...Vr(n),
422
423
  now: i
423
424
  });
424
425
  if (!a) return;
425
- let o = Rr(n, a, i), s = {
426
- accessToken: I(),
426
+ let o = Br(n, a, i), s = {
427
+ accessToken: L(),
427
428
  workspaceToken: qi(),
428
- userId: L,
429
+ userId: R,
429
430
  organizationId: Pt()
430
431
  };
431
- ko(a.mode, n, s, null, !0, o).then((e) => {
432
+ Ao(a.mode, n, s, null, !0, o).then((e) => {
432
433
  if (o.finish({
433
434
  ok: !0,
434
435
  sandboxId: e.sandboxId,
@@ -437,22 +438,22 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
437
438
  dead: o.dead
438
439
  }), o.signal.aborted || C() !== n || J.current.has(e.sandboxId)) return;
439
440
  let r = v.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = ie();
440
- Pr({
441
+ Ir({
441
442
  active: i ? {
442
443
  mode: i.mode,
443
444
  backendSessionId: i.backendSessionId,
444
- continuable: !Xn(i) && !Yn(i, c),
445
- hasHistory: Jn(i)
445
+ continuable: !Qn(i) && !Zn(i, c),
446
+ hasHistory: Xn(i)
446
447
  } : void 0,
447
448
  mode: a.mode
448
- }) && Lr(Nr({
449
+ }) && zr(Fr({
449
450
  workspaceId: n,
450
451
  mode: a.mode,
451
452
  sandboxId: e.sandboxId,
452
- userId: L
453
+ userId: R
453
454
  }), () => y(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
454
455
  }, (e) => {
455
- if (!(e instanceof Ar) && !o.signal.aborted && C() === n) {
456
+ if (!(e instanceof Mr) && !o.signal.aborted && C() === n) {
456
457
  let e = v.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
457
458
  e && (q.current.invalidate(e), J.current.add(e), o.dead.push(e), ya(a.mode));
458
459
  }
@@ -464,52 +465,52 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
464
465
  });
465
466
  });
466
467
  }, [
467
- ko,
468
+ Ao,
468
469
  Ka,
469
470
  ya,
470
- I,
471
- qi,
472
471
  L,
472
+ qi,
473
+ R,
473
474
  Ki
474
- ]), Mo = O(!1), No = O(null), Po = D(() => Si(), []);
475
- E(() => () => Po.cancel(), [Po]);
476
- let Fo = Di(_, se, se)?.reference ?? null, [Io, Lo] = k(0), Ro = O(/* @__PURE__ */ new Set()), zo = O(null), Bo = T(() => {
475
+ ]), No = k(!1), Po = k(null), Fo = O(() => Si(), []);
476
+ D(() => () => Fo.cancel(), [Fo]);
477
+ let Io = Di(_, se, se)?.reference ?? null, [Lo, Ro] = A(0), zo = k(/* @__PURE__ */ new Set()), Bo = k(null), Vo = E(() => {
477
478
  let e = v.getState(), t = e.activeConversationId;
478
479
  if (!t) return null;
479
480
  let n = e.processingByConversationId[t], r = It(n?.status) ? n?.messageId ?? null : null;
480
481
  if (!Rt({
481
482
  interruptedTurnId: r,
482
483
  activeTurnId: r,
483
- alreadyRequested: r ? Ro.current.has(r) : !1
484
+ alreadyRequested: r ? zo.current.has(r) : !1
484
485
  }).send || !r) return null;
485
- Ro.current.add(r);
486
+ zo.current.add(r);
486
487
  let i = pe(e), a = C(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
487
488
  return !i || !a || !o || me(i.sandboxId, a, o, i.mode, {
488
- accessToken: I(),
489
+ accessToken: L(),
489
490
  workspaceToken: qi(),
490
- userId: L,
491
+ userId: R,
491
492
  organizationId: Pt()
492
493
  }), r;
493
494
  }, [
495
+ R,
494
496
  L,
495
- I,
496
497
  qi
497
- ]), Vo = T(() => {
498
- let e = Bo();
498
+ ]), Ho = E(() => {
499
+ let e = Vo();
499
500
  return e && (Ze(e), qe.abort(e)), e;
500
- }, [Bo]), Ho = T(() => {
501
+ }, [Vo]), Uo = E(() => {
501
502
  let e = v.getState().activeConversationId;
502
- Vo(), e && W.declineForReply(e, "corrected", "spoken");
503
- }, [Vo, W]), Uo = T(async (e) => {
503
+ Ho(), e && G.declineForReply(e, "corrected", "spoken");
504
+ }, [Ho, G]), Wo = E(async (e) => {
504
505
  let t = v.getState(), n = pe(t), r = C(), i = t.activeConversationId;
505
- if (!n || !r || !i || In(t.sandboxWriteCapabilities[n.sandboxId])) return;
506
+ if (!n || !r || !i || Rn(t.sandboxWriteCapabilities[n.sandboxId])) return;
506
507
  let a = t.conversations.find((e) => e.id === i), o = a ? le(x(a.messages), {
507
508
  sessionId: a.backendSessionId,
508
509
  sandboxId: n.sandboxId,
509
510
  nowMs: Date.now()
510
511
  }) : null;
511
512
  if (o?.reference !== e) {
512
- Lo((e) => e + 1);
513
+ Ro((e) => e + 1);
513
514
  return;
514
515
  }
515
516
  let s = {
@@ -519,14 +520,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
519
520
  if (!oe(s)) return;
520
521
  try {
521
522
  await he(n.sandboxId, r, e, n.mode, {
522
- accessToken: I(),
523
+ accessToken: L(),
523
524
  workspaceToken: qi(),
524
- userId: L,
525
+ userId: R,
525
526
  organizationId: Pt()
526
527
  });
527
528
  } catch (e) {
528
- h(s), V(i, {
529
- id: j(),
529
+ h(s), H(i, {
530
+ id: M(),
530
531
  role: "system",
531
532
  content: e instanceof Error ? e.message : "The change could not be approved.",
532
533
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
@@ -535,65 +536,65 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
535
536
  }
536
537
  h(s), pa(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
537
538
  let c = v.getState(), l = c.conversations.find((e) => e.id === i);
538
- c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || pe(c)?.sandboxId !== n.sandboxId || It(c.processingByConversationId[i]?.status) || g(x(l.messages)) !== o.messageId || Js.current(M("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
539
+ c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || pe(c)?.sandboxId !== n.sandboxId || It(c.processingByConversationId[i]?.status) || g(x(l.messages)) !== o.messageId || Ys.current(N("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
539
540
  approvalFollowUp: { approvedReplyId: o.messageId },
540
541
  targetConversationId: i
541
542
  });
542
543
  }, [
543
- L,
544
- V,
544
+ R,
545
+ H,
545
546
  pa,
546
- M
547
- ]), Wo = n(), { speakFinishedReply: Go, speakingMessageId: Ko, stop: qo } = bn(), Jo = O(null), Yo = T((e, t) => {
548
- let n = Jo.current;
547
+ N
548
+ ]), Go = n(), { speakFinishedReply: Ko, speakingMessageId: qo, stop: Jo } = yn(), Yo = k(null), Xo = E((e, t) => {
549
+ let n = Yo.current;
549
550
  n?.token === e && n.exchange === null && (n.exchange = t);
550
- }, []), Xo = T((e) => {
551
- let t = Jo.current;
551
+ }, []), Zo = E((e) => {
552
+ let t = Yo.current;
552
553
  e !== void 0 && t?.token === e && (t.handled = !0);
553
- }, []), Zo = T((e, t) => {
554
- Yo(e, t), ho.current && Je(t);
555
- }, [Yo]), Qo = c(), { items: $o, permissionsSettled: es, simulating: ts } = Ti(), Y = O({
556
- theme: Wo,
557
- navigate: Qo,
558
- navItems: $o,
554
+ }, []), Qo = E((e, t) => {
555
+ Xo(e, t), go.current && Je(t);
556
+ }, [Xo]), $o = c(), { items: es, permissionsSettled: ts, simulating: ns } = Ti(), Y = k({
557
+ theme: Go,
558
+ navigate: $o,
559
+ navItems: es,
559
560
  options: Gi ?? {},
560
- navPermissionsSettled: es,
561
- navSimulating: ts
561
+ navPermissionsSettled: ts,
562
+ navSimulating: ns
562
563
  });
563
- E(() => {
564
+ D(() => {
564
565
  Y.current = {
565
- theme: Wo,
566
- navigate: Qo,
567
- navItems: $o,
566
+ theme: Go,
567
+ navigate: $o,
568
+ navItems: es,
568
569
  options: Gi ?? {},
569
- navPermissionsSettled: es,
570
- navSimulating: ts
570
+ navPermissionsSettled: ts,
571
+ navSimulating: ns
571
572
  };
572
573
  }, [
573
- Wo,
574
- Qo,
574
+ Go,
575
575
  $o,
576
- Gi,
577
576
  es,
578
- ts
577
+ Gi,
578
+ ts,
579
+ ns
579
580
  ]);
580
- let X = O(!0);
581
- E(() => (X.current = !0, () => {
581
+ let X = k(!0);
582
+ D(() => (X.current = !0, () => {
582
583
  X.current = !1;
583
584
  }), []);
584
- let ns = O({
585
- tr: M,
586
- locale: R
587
- }), rs = O(null), [is, as] = k(null), os = O(null), ss = T((e) => {
588
- os.current !== null && (window.clearTimeout(os.current), os.current = null);
589
- let t = rs.current;
590
- t && (rs.current = null, window.clearTimeout(t.deadline), X.current && as(null), !(!e || !X.current) && (os.current = window.setTimeout(() => {
591
- if (os.current = null, !X.current) return;
585
+ let rs = k({
586
+ tr: N,
587
+ locale: z
588
+ }), is = k(null), [as, os] = A(null), ss = k(null), cs = E((e) => {
589
+ ss.current !== null && (window.clearTimeout(ss.current), ss.current = null);
590
+ let t = is.current;
591
+ t && (is.current = null, window.clearTimeout(t.deadline), X.current && os(null), !(!e || !X.current) && (ss.current = window.setTimeout(() => {
592
+ if (ss.current = null, !X.current) return;
592
593
  let e = v.getState();
593
594
  if (e.activeConversationId !== t.conversationId) return;
594
595
  let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
595
596
  if (!n) return;
596
- let r = ns.current, i = rn(n, null, r.tr);
597
+ let r = rs.current, i = rn(n, null, r.tr);
597
598
  if (i.kind !== "output") return;
598
599
  let a = tn(n, r.tr);
599
600
  qe.publish(n.id, {
@@ -605,47 +606,47 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
605
606
  final: !0
606
607
  });
607
608
  }, 0)));
608
- }, []), cs = T(() => ss(!0), [ss]);
609
- E(() => {
610
- ns.current = {
611
- tr: M,
612
- locale: R
609
+ }, []), ls = E(() => cs(!0), [cs]);
610
+ D(() => {
611
+ rs.current = {
612
+ tr: N,
613
+ locale: z
613
614
  };
614
- let e = rs.current;
615
+ let e = is.current;
615
616
  if (!e) return;
616
617
  let t = nn({
617
618
  wanted: e.wanted,
618
- locale: R,
619
+ locale: z,
619
620
  isLoading: Ji(e.wanted),
620
- translatedNow: $t(M, e.reply).translated
621
+ translatedNow: $t(N, e.reply).translated
621
622
  });
622
623
  if (t === "write") {
623
- cs();
624
+ ls();
624
625
  return;
625
626
  }
626
627
  if (t === "grace") {
627
- let e = window.setTimeout(cs, 400);
628
+ let e = window.setTimeout(ls, 400);
628
629
  return () => window.clearTimeout(e);
629
630
  }
630
631
  }, [
631
- M,
632
- R,
632
+ N,
633
+ z,
633
634
  Ji,
634
- is,
635
- cs
636
- ]), E(() => () => ss(!1), [ss]);
637
- let ls = O(null), [us, ds] = k(!1), [fs, ps] = k(null), [Z] = k(() => new Ae()), [ms, hs] = k(0), gs = T(() => hs((e) => e + 1), []), _s = T(() => {
635
+ as,
636
+ ls
637
+ ]), D(() => () => cs(!1), [cs]);
638
+ let us = k(null), [ds, fs] = A(!1), [ps, ms] = A(null), [Z] = A(() => new Ae()), [hs, gs] = A(0), _s = E(() => gs((e) => e + 1), []), vs = E(() => {
638
639
  let e = Y.current;
639
640
  return {
640
- destinations: Kr(e.navItems),
641
+ destinations: Jr(e.navItems),
641
642
  permissionsSettled: e.navPermissionsSettled,
642
643
  simulating: e.navSimulating
643
644
  };
644
- }, []), vs = O(L);
645
- E(() => {
646
- vs.current = L;
647
- }, [L]);
648
- let ys = T((e, t) => {
645
+ }, []), ys = k(R);
646
+ D(() => {
647
+ ys.current = R;
648
+ }, [R]);
649
+ let bs = E((e, t) => {
649
650
  let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
650
651
  ok: !1,
651
652
  reason: "gone",
@@ -657,8 +658,8 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
657
658
  let o = r.conversationId, s = v.getState().conversations.find((e) => e.id === o);
658
659
  if (!s) return a;
659
660
  let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
660
- registry: _s(),
661
- actorId: vs.current,
661
+ registry: vs(),
662
+ actorId: ys.current,
662
663
  conversationId: o,
663
664
  perfNow: performance.now()
664
665
  }).find((t) => t.offer.offerId === e);
@@ -667,12 +668,12 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
667
668
  return {
668
669
  ok: !1,
669
670
  reason: e ? "unavailable" : "expired",
670
- copy: e ? Jt(M, t || null) : Kt(M),
671
+ copy: e ? Jt(N, t || null) : Kt(N),
671
672
  conversationId: o,
672
673
  voiceSessionId: l
673
674
  };
674
675
  }
675
- return Z.markUsed(e) ? (gs(), {
676
+ return Z.markUsed(e) ? (_s(), {
676
677
  ok: !0,
677
678
  target: u.target,
678
679
  conversationId: o,
@@ -680,33 +681,33 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
680
681
  }) : a;
681
682
  }, [
682
683
  Z,
683
- _s,
684
- M,
685
- gs
686
- ]), bs = T((e, t, n, r, i) => {
687
- let a = j();
688
- V(e, {
684
+ vs,
685
+ N,
686
+ _s
687
+ ]), xs = E((e, t, n, r, i) => {
688
+ let a = M();
689
+ H(e, {
689
690
  id: a,
690
691
  role: "system",
691
692
  content: n.text,
692
693
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
693
694
  metadata: {
694
- lang: n.translated ? R : "en",
695
+ lang: n.translated ? z : "en",
695
696
  ...i ? { localAction: i } : {},
696
697
  ...Ge(t)
697
698
  }
698
- }), i && $n.recordCommittedEntries(e, [a], "NOTE", r);
699
- }, [V, R]), xs = T((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Ss = O(null);
700
- E(() => () => {
701
- Ss.current?.(), Ss.current = null;
699
+ }), i && tr.recordCommittedEntries(e, [a], "NOTE", r);
700
+ }, [H, z]), Ss = E((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Cs = k(null);
701
+ D(() => () => {
702
+ Cs.current?.(), Cs.current = null;
702
703
  }, []);
703
- let Cs = T((e) => {
704
- Ss.current?.(), Ss.current = X.current ? or(document, e) : null;
705
- }, []), ws = T((e, t, n, r = !1) => {
706
- if (ls.current !== null) return;
707
- let i = ys(e, n), a = C(), o = (e, t, n, r) => bs(e, t, n, a, r);
704
+ let ws = E((e) => {
705
+ Cs.current?.(), Cs.current = X.current ? cr(document, e) : null;
706
+ }, []), Ts = E((e, t, n, r = !1) => {
707
+ if (us.current !== null) return;
708
+ let i = bs(e, n), a = C(), o = (e, t, n, r) => xs(e, t, n, a, r);
708
709
  if (!i.ok) {
709
- i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), gs();
710
+ i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), _s();
710
711
  return;
711
712
  }
712
713
  let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
@@ -714,7 +715,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
714
715
  offerId: e
715
716
  };
716
717
  if (r) {
717
- o(c, l, Wt(M, s.label, !0), ei({
718
+ o(c, l, Wt(N, s.label, !0), ni({
718
719
  destinationId: s.id,
719
720
  path: s.path,
720
721
  alreadyHere: !0,
@@ -723,17 +724,17 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
723
724
  }));
724
725
  return;
725
726
  }
726
- let d = j();
727
- ls.current = d, ds(!0);
727
+ let d = M();
728
+ us.current = d, fs(!0);
728
729
  let f = (t) => {
729
730
  try {
730
- if (xs(e, t) && (gs(), t.status === "kept" && Cs(e)), t.status === "kept" || !v.getState().conversations.some((e) => e.id === c)) return;
731
+ if (Ss(e, t) && (_s(), t.status === "kept" && ws(e)), t.status === "kept" || !v.getState().conversations.some((e) => e.id === c)) return;
731
732
  let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
732
- o(c, l, Gt(M, t, {
733
+ o(c, l, Gt(N, t, {
733
734
  page: s.label,
734
- landed: n === null ? null : ni(Kr(Y.current.navItems), n),
735
+ landed: n === null ? null : ii(Jr(Y.current.navItems), n),
735
736
  path: s.path
736
- }), ei({
737
+ }), ni({
737
738
  destinationId: s.id,
738
739
  path: s.path,
739
740
  alreadyHere: !1,
@@ -742,10 +743,10 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
742
743
  offer: u
743
744
  }));
744
745
  } finally {
745
- ls.current === d && (ls.current = null, X.current && ds(!1));
746
+ us.current === d && (us.current = null, X.current && fs(!1));
746
747
  }
747
748
  };
748
- Xr(Y.current.navigate, s.path, {
749
+ Qr(Y.current.navigate, s.path, {
749
750
  readPath: () => window.location.pathname + window.location.search,
750
751
  now: () => Date.now(),
751
752
  schedule: (e, t) => {
@@ -756,75 +757,75 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
756
757
  surface: "offer"
757
758
  }).then(f, () => f({ status: "unconfirmed" }));
758
759
  }, [
759
- ys,
760
760
  bs,
761
- M,
762
- gs,
763
761
  xs,
764
- Cs
765
- ]), Ts = T((e, t) => ws(e, "tap", t || null), [ws]), Es = T((e) => {
762
+ N,
763
+ _s,
764
+ Ss,
765
+ ws
766
+ ]), Es = E((e, t) => Ts(e, "tap", t || null), [Ts]), Ds = E((e) => {
766
767
  let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
767
768
  if (!r) return;
768
- let i = window.location.pathname + window.location.search, a = Kr(Y.current.navItems), o = pi({
769
+ let i = window.location.pathname + window.location.search, a = Jr(Y.current.navItems), o = hi({
769
770
  intent: e.intent,
770
771
  live: Z.liveOffersFor(t, {
771
- registry: _s(),
772
- actorId: vs.current,
772
+ registry: vs(),
773
+ actorId: ys.current,
773
774
  conversationId: n,
774
775
  perfNow: performance.now()
775
776
  }),
776
777
  unusedCount: Z.offersFor(t).filter((e) => !e.used).length,
777
- pendingProposals: W.liveFor(n).count,
778
+ pendingProposals: G.liveFor(n).count,
778
779
  turnWriteCapable: r.writeCapable,
779
780
  atSend: e.atSend,
780
781
  now: {
781
782
  location: i,
782
783
  conversationId: v.getState().activeConversationId,
783
784
  workspaceId: C(),
784
- actorId: vs.current ?? null
785
+ actorId: ys.current ?? null
785
786
  },
786
787
  mounted: X.current,
787
788
  visible: document.visibilityState === "visible",
788
- unsavedChanges: mi(Y.current.options),
789
+ unsavedChanges: gi(Y.current.options),
789
790
  alreadyThere: ({ target: e }) => {
790
791
  let t = a.find((t) => t.id === e.id);
791
- return t ? Ur(t, i, a) : !1;
792
+ return t ? Gr(t, i, a) : !1;
792
793
  }
793
794
  });
794
795
  if (o.act === "navigate" || o.act === "already-here") {
795
- ws(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
796
+ Ts(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
796
797
  return;
797
798
  }
798
799
  let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
799
- registry: _s(),
800
- actorId: vs.current,
800
+ registry: vs(),
801
+ actorId: ys.current,
801
802
  conversationId: n,
802
803
  perfNow: performance.now()
803
804
  });
804
- o.hold === "R5-unsaved" && s && c && bs(n, e.voiceSessionId, qt(M, s.label, c.target.label), C());
805
+ o.hold === "R5-unsaved" && s && c && xs(n, e.voiceSessionId, qt(N, s.label, c.target.label), C());
805
806
  }, [
806
807
  Z,
807
- _s,
808
- W,
809
- ws,
810
- bs,
811
- M
812
- ]), Ds = T((e) => {
808
+ vs,
809
+ G,
810
+ Ts,
811
+ xs,
812
+ N
813
+ ]), Os = E((e) => {
813
814
  let t = v.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
814
- return n ? Qr(Zr, window.location.pathname, ri(n.messages, e)) : !1;
815
- }, []), Os = rr(), ks = ir(), As = Os?.request ?? null, js = T((e, t, n = !1, r = !1) => {
816
- let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Kr(i), l = null, u = {
815
+ return n ? ei($r, window.location.pathname, ai(n.messages, e)) : !1;
816
+ }, []), ks = ar(), As = or(), js = ks?.request ?? null, Ms = E((e, t, n = !1, r = !1) => {
817
+ let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Jr(i), l = null, u = {
817
818
  ...a,
818
- locale: t === void 0 ? R : ta.input.code,
819
- uiLocale: R,
819
+ locale: t === void 0 ? z : ta.input.code,
820
+ uiLocale: z,
820
821
  inputLocale: ta.input.code
821
822
  };
822
- if (r || Gr(e, u)) {
823
- let e = v.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? ai(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 && It(o.status);
823
+ if (r || qr(e, u)) {
824
+ let e = v.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? si(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 && It(o.status);
824
825
  if (n && r && !s) {
825
826
  let e = Z.liveOffersFor(r.id, {
826
- registry: _s(),
827
- actorId: vs.current,
827
+ registry: vs(),
828
+ actorId: ys.current,
828
829
  conversationId: n.id,
829
830
  perfNow: performance.now()
830
831
  }).flatMap(({ offer: e, target: t }) => {
@@ -834,14 +835,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
834
835
  target: n
835
836
  }] : [];
836
837
  });
837
- l = ii({
838
+ l = oi({
838
839
  reply: r,
839
- text: mn(r, o, M),
840
+ text: mn(r, o, N),
840
841
  resolve: {
841
842
  destinations: c,
842
843
  entityRoutes: a.entityRoutes,
843
- visibleNavIds: Br(i),
844
- nounLabel: (e) => Ht(M, e)
844
+ visibleNavIds: Hr(i),
845
+ nounLabel: (e) => Ht(N, e)
845
846
  },
846
847
  offers: e
847
848
  });
@@ -851,18 +852,18 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
851
852
  destinations: c,
852
853
  sentenceOptions: u,
853
854
  context: {
854
- backRunnable: Ds(t),
855
+ backRunnable: Os(t),
855
856
  navigation: l,
856
857
  skipRecords: n,
857
- controls: Yr(),
858
+ controls: Zr(),
858
859
  executors: {
859
860
  theme: o !== null,
860
861
  navigation: s !== null,
861
- conversationDelete: As !== null,
862
+ conversationDelete: js !== null,
862
863
  appControl: (e) => {
863
864
  try {
864
- let n = hi(e, { voiceLive: t !== void 0 || Pc.current });
865
- return n !== null && (n.kind !== "confirm" || ks !== null);
865
+ let n = _i(e, { voiceLive: t !== void 0 || Fc.current });
866
+ return n !== null && (n.kind !== "confirm" || As !== null);
866
867
  } catch {
867
868
  return !1;
868
869
  }
@@ -871,35 +872,35 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
871
872
  }
872
873
  };
873
874
  }, [
874
- Ds,
875
+ Os,
875
876
  ta,
876
- R,
877
- M,
877
+ z,
878
+ N,
878
879
  Z,
879
- _s,
880
- As,
881
- ks
882
- ]), Ms = T((e, t, n = !1) => {
883
- let { destinations: r, sentenceOptions: i, context: a } = js(e, t, n);
884
- return Wr(e, r, i, a);
885
- }, [js]), Ns = T((e) => {
886
- if (No.current = e, Po.cancel(), !e.text.trim() && !e.hasAttachments) {
887
- Mo.current = !1;
880
+ vs,
881
+ js,
882
+ As
883
+ ]), Ns = E((e, t, n = !1) => {
884
+ let { destinations: r, sentenceOptions: i, context: a } = Ms(e, t, n);
885
+ return Kr(e, r, i, a);
886
+ }, [Ms]), Ps = E((e) => {
887
+ if (Po.current = e, Fo.cancel(), !e.text.trim() && !e.hasAttachments) {
888
+ No.current = !1;
888
889
  return;
889
890
  }
890
- if (Mo.current) return;
891
+ if (No.current) return;
891
892
  let n = () => {
892
- Mo.current = !0, jo(!1);
893
+ No.current = !0, Mo(!1);
893
894
  };
894
895
  if (e.hasAttachments || e.dictated) {
895
896
  n();
896
897
  return;
897
898
  }
898
- Po.schedule(() => {
899
- if (!Mo.current) {
899
+ Fo.schedule(() => {
900
+ if (!No.current) {
900
901
  try {
901
- let { destinations: t, sentenceOptions: n, context: r } = js(e.text, void 0, !1, !0);
902
- if (Hr(e.text, t, n, r)) return;
902
+ let { destinations: t, sentenceOptions: n, context: r } = Ms(e.text, void 0, !1, !0);
903
+ if (Wr(e.text, t, n, r)) return;
903
904
  } catch {
904
905
  if (!Pi) {
905
906
  Pi = !0;
@@ -912,35 +913,35 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
912
913
  }
913
914
  });
914
915
  }, [
915
- Po,
916
- jo,
917
- js
916
+ Fo,
917
+ Mo,
918
+ Ms
918
919
  ]);
919
- E(() => {
920
+ D(() => {
920
921
  let e = () => {
921
- No.current && Ns(No.current);
922
- }, t = i(e), n = $r(window, e), r = Zr.subscribe(e);
922
+ Po.current && Ps(Po.current);
923
+ }, t = i(e), n = ti(window, e), r = $r.subscribe(e);
923
924
  return () => {
924
- t(), n(), r(), Po.cancel();
925
+ t(), n(), r(), Fo.cancel();
925
926
  };
926
- }, [Po, Ns]), E(() => {
927
- No.current && Ns(No.current);
927
+ }, [Fo, Ps]), D(() => {
928
+ Po.current && Ps(Po.current);
928
929
  }, [
929
- Ns,
930
- $o,
931
- Gi,
930
+ Ps,
932
931
  es,
932
+ Gi,
933
933
  ts,
934
- Wo,
935
- Qo,
934
+ ns,
935
+ Go,
936
+ $o,
937
+ V,
938
+ hs,
936
939
  B,
937
- ms,
938
- z,
939
- H?.messages,
940
- U
940
+ U?.messages,
941
+ W
941
942
  ]);
942
- let Ps = T((e, t) => {
943
- let n = Ms(e, t);
943
+ let Fs = E((e, t) => {
944
+ let n = Ns(e, t);
944
945
  if (!n) return !1;
945
946
  let { theme: r, navigate: i } = Y.current;
946
947
  switch (n.kind) {
@@ -952,14 +953,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
952
953
  case "link-not-openable":
953
954
  case "back": return i !== null;
954
955
  case "conversation-delete": return !1;
955
- case "app-control": return hi(n.request, { voiceLive: t !== void 0 || Pc.current }) !== null;
956
+ case "app-control": return _i(n.request, { voiceLive: t !== void 0 || Fc.current }) !== null;
956
957
  case "open-record": return !1;
957
958
  }
958
- }, [Ms]), Fs = O(Ps);
959
- E(() => {
960
- Fs.current = Ps;
961
- }, [Ps]);
962
- let Is = T((e, t) => {
959
+ }, [Ns]), Is = k(Fs);
960
+ D(() => {
961
+ Is.current = Fs;
962
+ }, [Fs]);
963
+ let Ls = E((e, t) => {
963
964
  let n = {
964
965
  state: "none",
965
966
  accept: null
@@ -968,24 +969,24 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
968
969
  let o = v.getState(), s = o.conversations.find((t) => t.id === e);
969
970
  if (!s) return n;
970
971
  let c = o.processingByConversationId[s.id] ?? null, l = {
971
- registry: _s(),
972
- actorId: vs.current,
972
+ registry: vs(),
973
+ actorId: ys.current,
973
974
  conversationId: s.id,
974
975
  perfNow: performance.now()
975
- }, { state: u, reply: d } = di(Z, {
976
+ }, { state: u, reply: d } = pi(Z, {
976
977
  ...l,
977
978
  messages: s.messages,
978
979
  voiceSessionId: t,
979
980
  processing: c,
980
- displayedText: (e) => mn(e, c, M),
981
- productWriteApproval: F,
981
+ displayedText: (e) => mn(e, c, N),
982
+ productWriteApproval: I,
982
983
  capabilitiesOf: (e) => v.getState().sandboxWriteCapabilities[e]
983
984
  });
984
985
  if (u !== "acceptable" || !d) return {
985
986
  state: u,
986
987
  accept: null
987
988
  };
988
- let [f] = Z.liveOffersFor(d.id, l), p = f ? Kr(a).find((e) => e.id === f.target.id) : void 0;
989
+ let [f] = Z.liveOffersFor(d.id, l), p = f ? Jr(a).find((e) => e.id === f.target.id) : void 0;
989
990
  return !f || !p ? n : {
990
991
  state: u,
991
992
  accept: {
@@ -995,15 +996,15 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
995
996
  };
996
997
  }, [
997
998
  Z,
998
- _s,
999
- F,
1000
- M
1001
- ]), Ls = T((e, t, n, r, i, a) => {
1002
- let o = M(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
999
+ vs,
1000
+ I,
1001
+ N
1002
+ ]), Rs = E((e, t, n, r, i, a) => {
1003
+ let o = N(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
1003
1004
  kind: "write-reply",
1004
1005
  line: n.key
1005
- }, l = (/* @__PURE__ */ new Date()).toISOString(), u = j();
1006
- V(e, {
1006
+ }, l = (/* @__PURE__ */ new Date()).toISOString(), u = M();
1007
+ H(e, {
1007
1008
  id: u,
1008
1009
  role: "user",
1009
1010
  content: t,
@@ -1013,67 +1014,67 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1013
1014
  ...Ge(i)
1014
1015
  }
1015
1016
  });
1016
- let d = j();
1017
- V(e, {
1017
+ let d = M();
1018
+ H(e, {
1018
1019
  id: d,
1019
1020
  role: "assistant",
1020
1021
  content: o,
1021
1022
  timestamp: l,
1022
1023
  metadata: {
1023
- lang: o === s ? "en" : R,
1024
+ lang: o === s ? "en" : z,
1024
1025
  localAction: c,
1025
1026
  ...Ge(i)
1026
1027
  }
1027
- }), $n.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", C()), a !== void 0 && Zo(a, {
1028
+ }), tr.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", C()), a !== void 0 && Qo(a, {
1028
1029
  conversationId: e,
1029
1030
  questionId: u,
1030
1031
  replyId: d
1031
- }), Go(e, d);
1032
+ }), Ko(e, d);
1032
1033
  }, [
1033
- V,
1034
- R,
1035
- Zo,
1036
- Go,
1037
- M
1038
- ]), Rs = O(() => void 0), [zs, Bs] = k(null);
1039
- E(() => {
1040
- if (zs === null) return;
1041
- let e = window.setTimeout(() => Bs(null), Ii);
1034
+ H,
1035
+ z,
1036
+ Qo,
1037
+ Ko,
1038
+ N
1039
+ ]), zs = k(() => void 0), [Bs, Vs] = A(null);
1040
+ D(() => {
1041
+ if (Bs === null) return;
1042
+ let e = window.setTimeout(() => Vs(null), Ii);
1042
1043
  return () => window.clearTimeout(e);
1043
- }, [zs]);
1044
- let Vs = T(() => {
1044
+ }, [Bs]);
1045
+ let Hs = E(() => {
1045
1046
  let e = v.getState();
1046
1047
  return ua(void 0, e.autoRouting && to.current ? p : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
1047
- }, [ua]), Hs = T((e) => {
1048
- if (!As) return !1;
1049
- let t = e !== void 0, n = v.getState(), r = sr({
1048
+ }, [ua]), Us = E((e) => {
1049
+ if (!js) return !1;
1050
+ let t = e !== void 0, n = v.getState(), r = lr({
1050
1051
  spoken: t,
1051
- bound: _o.current,
1052
+ bound: vo.current,
1052
1053
  activeConversationId: n.activeConversationId,
1053
1054
  conversations: n.conversations,
1054
- historyOn: nr()
1055
+ historyOn: ir()
1055
1056
  });
1056
- if (r && As(r), t) {
1057
- let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? M("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : M("deleteConversation.nothing", "There is no conversation to delete.");
1058
- Rs.current({
1059
- id: `conversation-delete:${j()}`,
1057
+ if (r && js(r), t) {
1058
+ let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? N("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : N("deleteConversation.nothing", "There is no conversation to delete.");
1059
+ zs.current({
1060
+ id: `conversation-delete:${M()}`,
1060
1061
  text: t,
1061
- lang: t === e ? "en" : R
1062
+ lang: t === e ? "en" : z
1062
1063
  });
1063
- } else r || Bs(Date.now());
1064
+ } else r || Vs(Date.now());
1064
1065
  return !0;
1065
1066
  }, [
1066
- As,
1067
- R,
1068
- M
1069
- ]), Us = T((e, t, n, r = !1, i) => {
1070
- if (e.kind === "conversation-delete") return Hs(n);
1067
+ js,
1068
+ z,
1069
+ N
1070
+ ]), Ws = E((e, t, n, r = !1, i) => {
1071
+ if (e.kind === "conversation-delete") return Us(n);
1071
1072
  let { theme: a, navigate: o } = Y.current, s = null, c = () => {
1072
- let e = (r ? null : s ?? v.getState().activeConversationId) ?? Vs();
1073
- return r && bo(e), e;
1073
+ let e = (r ? null : s ?? v.getState().activeConversationId) ?? Hs();
1074
+ return r && xo(e), e;
1074
1075
  }, l = (e, r) => {
1075
- let i = j();
1076
- return V(e, {
1076
+ let i = M();
1077
+ return H(e, {
1077
1078
  id: i,
1078
1079
  role: "user",
1079
1080
  content: t,
@@ -1084,44 +1085,44 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1084
1085
  }
1085
1086
  }), i;
1086
1087
  }, u = (e, t, r, a, o, s, c) => {
1087
- let l = c ?? j();
1088
- return V(e, {
1088
+ let l = c ?? M();
1089
+ return H(e, {
1089
1090
  id: l,
1090
1091
  role: "assistant",
1091
1092
  content: r.text,
1092
1093
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1093
1094
  metadata: {
1094
- lang: r.translated ? R : "en",
1095
+ lang: r.translated ? z : "en",
1095
1096
  localAction: a,
1096
1097
  ...Ge(n)
1097
1098
  }
1098
- }), $n.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && Zo(i, {
1099
+ }), tr.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && Qo(i, {
1099
1100
  conversationId: e,
1100
1101
  questionId: t,
1101
1102
  replyId: l
1102
- }), s && Go(e, l), l;
1103
+ }), s && Ko(e, l), l;
1103
1104
  }, d = (e, t, n) => {
1104
1105
  let r = c(), i = u(r, l(r, t), e, t, C(), !0);
1105
1106
  return n?.(i), !0;
1106
1107
  }, f = (e) => {
1107
- let t = c(), n = C(), r = window.location.pathname, a = l(t, ei({
1108
+ let t = c(), n = C(), r = window.location.pathname, a = l(t, ni({
1108
1109
  destinationId: e.destinationId,
1109
1110
  path: e.registryPath,
1110
1111
  alreadyHere: !1,
1111
1112
  via: e.via,
1112
1113
  offer: e.offer
1113
- })), s = i === void 0 ? void 0 : j();
1114
- i !== void 0 && s !== void 0 && (Yo(i, {
1114
+ })), s = i === void 0 ? void 0 : M();
1115
+ i !== void 0 && s !== void 0 && (Xo(i, {
1115
1116
  conversationId: t,
1116
1117
  questionId: a,
1117
1118
  replyId: s
1118
- }), ps(s));
1119
- let d = j();
1120
- ls.current = d, ds(!0);
1119
+ }), ms(s));
1120
+ let d = M();
1121
+ us.current = d, fs(!0);
1121
1122
  let f = (i) => {
1122
1123
  try {
1123
- if (e.offer && xs(e.offer.offerId, i) && gs(), i.status === "kept" || !v.getState().conversations.some((e) => e.id === t)) return;
1124
- let o = Kr(Y.current.navItems), c = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, l = ei({
1124
+ if (e.offer && Ss(e.offer.offerId, i) && _s(), i.status === "kept" || !v.getState().conversations.some((e) => e.id === t)) return;
1125
+ let o = Jr(Y.current.navItems), c = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, l = ni({
1125
1126
  destinationId: e.destinationId,
1126
1127
  path: e.registryPath,
1127
1128
  alreadyHere: !1,
@@ -1130,9 +1131,9 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1130
1131
  offer: e.offer
1131
1132
  });
1132
1133
  pa(t, a, { localAction: l });
1133
- let d = u(t, a, e.via === "back" && i.status === "arrived" ? zt(M, e.pageLabel()) : Gt(M, i, {
1134
+ let d = u(t, a, e.via === "back" && i.status === "arrived" ? zt(N, e.pageLabel()) : Gt(N, i, {
1134
1135
  page: e.pageLabel(),
1135
- landed: c === null ? null : ni(o, c),
1136
+ landed: c === null ? null : ii(o, c),
1136
1137
  path: e.target
1137
1138
  }), l, n, X.current, s);
1138
1139
  i.status === "arrived" && e.onArrived?.({
@@ -1141,10 +1142,10 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1141
1142
  landedPath: i.landedPath
1142
1143
  });
1143
1144
  } finally {
1144
- ls.current === d && (ls.current = null, X.current && ds(!1)), s !== void 0 && X.current && ps((e) => e === s ? null : e);
1145
+ us.current === d && (us.current = null, X.current && fs(!1)), s !== void 0 && X.current && ms((e) => e === s ? null : e);
1145
1146
  }
1146
1147
  };
1147
- return Xr(o, e.target, {
1148
+ return Qr(o, e.target, {
1148
1149
  readPath: () => window.location.pathname + window.location.search,
1149
1150
  now: () => Date.now(),
1150
1151
  schedule: (e, t) => {
@@ -1152,7 +1153,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1152
1153
  },
1153
1154
  isShellLess: () => !X.current
1154
1155
  }).then(f, () => f({ status: "unconfirmed" })), !0;
1155
- }, p = ({ replyId: e, fromPath: t, landedPath: n }) => Zr.push({
1156
+ }, p = ({ replyId: e, fromPath: t, landedPath: n }) => $r.push({
1156
1157
  fromPath: t,
1157
1158
  toPath: n,
1158
1159
  replyMessageId: e,
@@ -1160,21 +1161,21 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1160
1161
  });
1161
1162
  if (e.kind === "theme") {
1162
1163
  if (!a) return !1;
1163
- let t = qr(e.request, {
1164
+ let t = Yr(e.request, {
1164
1165
  mode: a.mode,
1165
1166
  resolvedTheme: a.resolvedTheme
1166
1167
  });
1167
1168
  if (!t.alreadyApplied) try {
1168
1169
  a.setMode(t.mode);
1169
1170
  } catch {}
1170
- return d(Qt(M, t, e.request.kind === "family"), {
1171
+ return d(Qt(N, t, e.request.kind === "family"), {
1171
1172
  kind: "theme",
1172
1173
  mode: t.mode,
1173
1174
  alreadyApplied: t.alreadyApplied
1174
1175
  });
1175
1176
  }
1176
1177
  if (e.kind === "app-control") {
1177
- let t = hi(e.request, { voiceLive: n !== void 0 || Pc.current });
1178
+ let t = _i(e.request, { voiceLive: n !== void 0 || Fc.current });
1178
1179
  if (!t) return !1;
1179
1180
  let r = (e) => ({
1180
1181
  kind: "app-control",
@@ -1182,41 +1183,41 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1182
1183
  outcome: e.outcome,
1183
1184
  ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
1184
1185
  }), i = (t) => {
1185
- if (e.request.control === "language" && ss(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1186
+ if (e.request.control === "language" && cs(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
1186
1187
  let n = c(), i = r(t), a = u(n, l(n, i), $t((e, t) => t, t.reply), i, C(), !1);
1187
- return rs.current = {
1188
+ return is.current = {
1188
1189
  wanted: e.request.code,
1189
1190
  reply: t.reply,
1190
1191
  conversationId: n,
1191
1192
  messageId: a,
1192
- deadline: window.setTimeout(cs, en)
1193
- }, as(a), !0;
1193
+ deadline: window.setTimeout(ls, en)
1194
+ }, os(a), !0;
1194
1195
  }
1195
- return d($t(M, t.reply), r(t));
1196
+ return d($t(N, t.reply), r(t));
1196
1197
  };
1197
1198
  if (t.kind === "reply") return i(t.run);
1198
1199
  if (t.kind === "run") {
1199
1200
  let e = t.run();
1200
1201
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
1201
1202
  }
1202
- let a = ks;
1203
+ let a = As;
1203
1204
  if (!a) return !1;
1204
1205
  let o = null;
1205
- return d($t(M, t.ask.reply), r(t.ask), (e) => {
1206
+ return d($t(N, t.ask.reply), r(t.ask), (e) => {
1206
1207
  o = v.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
1207
1208
  }), a.request({
1208
1209
  prompt: t.prompt,
1209
1210
  onConfirm: () => {
1210
1211
  let e = t.confirmed(), i = o, a = i !== null && v.getState().conversations.some((e) => e.id === i);
1211
1212
  if (!i || !a) return;
1212
- let s = $t(M, e.reply);
1213
- V(i, {
1214
- id: j(),
1213
+ let s = $t(N, e.reply);
1214
+ H(i, {
1215
+ id: M(),
1215
1216
  role: "assistant",
1216
1217
  content: s.text,
1217
1218
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1218
1219
  metadata: {
1219
- lang: s.translated ? R : "en",
1220
+ lang: s.translated ? z : "en",
1220
1221
  localAction: r(e),
1221
1222
  ...Ge(n)
1222
1223
  }
@@ -1225,23 +1226,23 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1225
1226
  }), !0;
1226
1227
  }
1227
1228
  if (!o) return !1;
1228
- if (e.kind === "choose-destination") return d(Bt(M, e.candidates[0]?.label ?? e.query, e.candidates), {
1229
+ if (e.kind === "choose-destination") return d(Bt(N, e.candidates[0]?.label ?? e.query, e.candidates), {
1229
1230
  kind: "choose-destination",
1230
1231
  candidateIds: e.candidates.map((e) => e.id)
1231
- }, (t) => oi(t, e.candidates));
1232
- if (e.kind === "choose-linked") return d(Vt(M, e.candidates), {
1232
+ }, (t) => ci(t, e.candidates));
1233
+ if (e.kind === "choose-linked") return d(Vt(N, e.candidates), {
1233
1234
  kind: "choose-destination",
1234
1235
  candidateIds: e.candidates.map((e) => e.id)
1235
- }, (t) => oi(t, e.candidates));
1236
+ }, (t) => ci(t, e.candidates));
1236
1237
  if (e.kind === "pick-from-list") {
1237
1238
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
1238
- return d(Yt(M), t ? {
1239
+ return d(Yt(N), t ? {
1239
1240
  kind: "choose-destination",
1240
1241
  candidateIds: t.map((e) => e.id)
1241
1242
  } : e.candidateIds.length > 0 ? {
1242
1243
  kind: "choose-destination",
1243
1244
  candidateIds: [...e.candidateIds]
1244
- } : ei({
1245
+ } : ni({
1245
1246
  destinationId: "",
1246
1247
  path: "",
1247
1248
  alreadyHere: !1,
@@ -1250,9 +1251,9 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1250
1251
  status: "refused",
1251
1252
  reason: "not-routable"
1252
1253
  }
1253
- }), t ? (e) => oi(e, t) : void 0);
1254
+ }), t ? (e) => ci(e, t) : void 0);
1254
1255
  }
1255
- if (e.kind === "link-not-openable") return d(Ut(M), ei({
1256
+ if (e.kind === "link-not-openable") return d(Ut(N), ni({
1256
1257
  destinationId: "",
1257
1258
  path: "",
1258
1259
  alreadyHere: !1,
@@ -1265,7 +1266,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1265
1266
  if (e.kind === "open-record") {
1266
1267
  let r;
1267
1268
  try {
1268
- let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = Br(n);
1269
+ let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = Hr(n);
1269
1270
  r = (t.records ?? []).flatMap((t) => {
1270
1271
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
1271
1272
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -1277,18 +1278,18 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1277
1278
  return !1;
1278
1279
  }
1279
1280
  if (r.length === 0) return !1;
1280
- let i = v.getState().activeConversationId, a = j();
1281
- ls.current = a, ds(!0);
1281
+ let i = v.getState().activeConversationId, a = M();
1282
+ us.current = a, fs(!0);
1282
1283
  let o = () => {
1283
- ls.current === a && (ls.current = null, X.current && ds(!1));
1284
+ us.current === a && (us.current = null, X.current && fs(!1));
1284
1285
  };
1285
1286
  return (async () => {
1286
1287
  let a = { kind: "none" }, c = !0;
1287
1288
  try {
1288
- a = await Vr({
1289
+ a = await Ur({
1289
1290
  name: e.request.name,
1290
1291
  usable: r,
1291
- nounOf: (e) => Ht(M, e.noun),
1292
+ nounOf: (e) => Ht(N, e.noun),
1292
1293
  timeoutMs: ki
1293
1294
  }), c = v.getState().conversations.some((e) => e.id === i);
1294
1295
  } catch {
@@ -1298,7 +1299,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1298
1299
  }
1299
1300
  if (!X.current) return;
1300
1301
  if (a.kind === "none") {
1301
- Js.current(t, [], {
1302
+ Ys.current(t, [], {
1302
1303
  fromPerson: !0,
1303
1304
  ...n === void 0 ? {} : { voiceSessionId: n },
1304
1305
  localRecordsChecked: !0
@@ -1319,16 +1320,16 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1319
1320
  return;
1320
1321
  }
1321
1322
  let l = a.candidates[0];
1322
- d(a.why === "kinds" ? Zt(M, a.nouns, a.candidates) : Xt(M, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1323
+ d(a.why === "kinds" ? Zt(N, a.nouns, a.candidates) : Xt(N, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
1323
1324
  kind: "choose-destination",
1324
1325
  candidateIds: a.candidates.map((e) => e.id)
1325
- }, (e) => oi(e, a.candidates));
1326
+ }, (e) => ci(e, a.candidates));
1326
1327
  })().catch(() => void 0), !0;
1327
1328
  }
1328
1329
  if (e.kind === "back") {
1329
- let e = Zr.top();
1330
+ let e = $r.top();
1330
1331
  if (!e) return !1;
1331
- let t = ti(Kr(Y.current.navItems), e.fromPath);
1332
+ let t = ri(Jr(Y.current.navItems), e.fromPath);
1332
1333
  return f({
1333
1334
  target: e.fromPath,
1334
1335
  destinationId: t?.id ?? "",
@@ -1336,27 +1337,27 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1336
1337
  via: "back",
1337
1338
  pageLabel: () => t?.label ?? null,
1338
1339
  onArrived: () => {
1339
- Zr.top() === e && Zr.pop();
1340
+ $r.top() === e && $r.pop();
1340
1341
  }
1341
1342
  });
1342
1343
  }
1343
1344
  let ee, m = e.destination;
1344
1345
  if (e.via === "offer") {
1345
- let t = ys(e.offerId, e.destination.label);
1346
- if (!t.ok) return d(t.copy ?? Kt(M), {
1346
+ let t = bs(e.offerId, e.destination.label);
1347
+ if (!t.ok) return d(t.copy ?? Kt(N), {
1347
1348
  kind: "write-reply",
1348
1349
  line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
1349
1350
  });
1350
1351
  ee = {
1351
1352
  trigger: e.trigger,
1352
1353
  offerId: e.offerId
1353
- }, m = Kr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1354
+ }, m = Jr(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
1354
1355
  id: t.target.id,
1355
1356
  label: t.target.label,
1356
1357
  path: t.target.path
1357
1358
  };
1358
1359
  }
1359
- return Ur(m, window.location.pathname + window.location.search, Kr(Y.current.navItems)) ? d(Wt(M, m.label, !0), ei({
1360
+ return Gr(m, window.location.pathname + window.location.search, Jr(Y.current.navItems)) ? d(Wt(N, m.label, !0), ni({
1360
1361
  destinationId: m.id,
1361
1362
  path: m.path,
1362
1363
  alreadyHere: !0,
@@ -1372,55 +1373,55 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1372
1373
  onArrived: p
1373
1374
  });
1374
1375
  }, [
1375
- V,
1376
- bo,
1377
- ks,
1378
- Vs,
1379
- cs,
1380
- R,
1381
- pa,
1382
- Yo,
1376
+ H,
1377
+ xo,
1378
+ As,
1383
1379
  Hs,
1384
- Zo,
1385
- ss,
1386
- Go,
1387
- M,
1388
- ys,
1389
- xs,
1390
- gs
1391
- ]), Ws = T(async (e) => {
1380
+ ls,
1381
+ z,
1382
+ pa,
1383
+ Xo,
1384
+ Us,
1385
+ Qo,
1386
+ cs,
1387
+ Ko,
1388
+ N,
1389
+ bs,
1390
+ Ss,
1391
+ _s
1392
+ ]), Gs = E(async (e) => {
1392
1393
  ro.current = !0, ao(!0);
1393
1394
  try {
1394
- await W.declineForReply(e.conversationId, e.reason, e.origin);
1395
+ await G.declineForReply(e.conversationId, e.reason, e.origin);
1395
1396
  } finally {
1396
1397
  ro.current = !1, X.current && ao(!1);
1397
1398
  }
1398
1399
  if (e.commandText !== null) {
1399
- let t = Ms(e.commandText, e.options.voiceSessionId);
1400
- if (t && Us(t, e.content, e.options.voiceSessionId)) return;
1400
+ let t = Ns(e.commandText, e.options.voiceSessionId);
1401
+ if (t && Ws(t, e.content, e.options.voiceSessionId)) return;
1401
1402
  }
1402
- await Js.current(e.content, e.attachments, e.options);
1403
+ await Ys.current(e.content, e.attachments, e.options);
1403
1404
  }, [
1404
- Ms,
1405
- Us,
1406
- W
1407
- ]), Q = T(async (e, t = [], n = {}) => {
1408
- let r = n.voiceSessionId !== void 0, i = v.getState(), a = !1, o = _o.current;
1405
+ Ns,
1406
+ Ws,
1407
+ G
1408
+ ]), Q = E(async (e, t = [], n = {}) => {
1409
+ let r = n.voiceSessionId !== void 0, i = v.getState(), a = !1, o = vo.current;
1409
1410
  if (r && ot(o)) {
1410
- let e = ut(o, i.activeConversationId, xo());
1411
+ let e = ut(o, i.activeConversationId, So());
1411
1412
  if (e.kind === "gone") return;
1412
1413
  let t = n.voiceEntry ?? e;
1413
- t.kind === "adopt" && bo(t.conversationId), a = t.kind === "own", n = {
1414
+ t.kind === "adopt" && xo(t.conversationId), a = t.kind === "own", n = {
1414
1415
  ...n,
1415
1416
  voiceEntry: t
1416
1417
  };
1417
1418
  }
1418
- let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? z;
1419
+ let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? B;
1419
1420
  if (c) {
1420
1421
  if (It(i.processingByConversationId[c]?.status)) {
1421
1422
  if (n.avatarTabAsk !== void 0) return;
1422
1423
  let r = i.processingByConversationId[c]?.messageId ?? null;
1423
- r && n.correctsInFlightTurn === !0 && !Ro.current.has(r) && Vo(), r && Ro.current.has(r) && (zo.current = {
1424
+ r && n.correctsInFlightTurn === !0 && !zo.current.has(r) && Ho(), r && zo.current.has(r) && (Bo.current = {
1424
1425
  conversationId: c,
1425
1426
  content: e,
1426
1427
  attachments: t,
@@ -1428,39 +1429,39 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1428
1429
  });
1429
1430
  return;
1430
1431
  }
1431
- if (Co.current.has(c)) return;
1432
+ if (wo.current.has(c)) return;
1432
1433
  }
1433
- if (no.current || se() !== null || ro.current || ls.current !== null) return;
1434
- let f = n.targetConversationId, p = ie(), ee = (e) => Xn(e) || Yn(e, p);
1434
+ if (no.current || se() !== null || ro.current || us.current !== null) return;
1435
+ let f = n.targetConversationId, p = ie(), ee = (e) => Qn(e) || Zn(e, p);
1435
1436
  if (f !== void 0) {
1436
1437
  let e = i.conversations.find((e) => e.id === f);
1437
1438
  if (i.activeConversationId !== f || !e || e.mode !== i.mode || ee(e)) return;
1438
1439
  }
1439
1440
  if (n.avatarTabAsk !== void 0) {
1440
1441
  let e = s ? i.conversations.find((e) => e.id === s) : void 0, t = e && !ee(e) ? e : void 0;
1441
- if (vr({
1442
+ if (br({
1442
1443
  auto: i.autoRouting && to.current && f === void 0,
1443
1444
  selectedMode: i.mode,
1444
1445
  conversation: t ? {
1445
1446
  mode: t.mode,
1446
1447
  routedBy: t.routedBy,
1447
- hasHistory: Jn(t)
1448
+ hasHistory: Xn(t)
1448
1449
  } : null,
1449
1450
  modeWrites: (e) => qa.current.find((t) => t.id === e)?.writeCapable === !0 || Ce(e)
1450
1451
  }) !== null) return;
1451
1452
  }
1452
1453
  if (n.fromPerson && n.writeReplyBound === void 0) {
1453
- let r = f ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = Is(r, n.voiceSessionId), c = Ln({
1454
+ let r = f ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = Ls(r, n.voiceSessionId), c = zn({
1454
1455
  text: e,
1455
- locale: i === "spoken" ? ta.input.code : R,
1456
+ locale: i === "spoken" ? ta.input.code : z,
1456
1457
  origin: i,
1457
1458
  hasAttachments: t.length > 0,
1458
- live: W.liveFor(r),
1459
- matchesLocalCommand: (e) => Ms(e, n.voiceSessionId) !== null,
1459
+ live: G.liveFor(r),
1460
+ matchesLocalCommand: (e) => Ns(e, n.voiceSessionId) !== null,
1460
1461
  offer: o.state,
1461
- offerAssent: o.state !== "none" && Jr({
1462
+ offerAssent: o.state !== "none" && Xr({
1462
1463
  text: e,
1463
- uiLocale: R,
1464
+ uiLocale: z,
1464
1465
  inputLocale: ta.input.code,
1465
1466
  commandLocales: Y.current.options.commandLocales,
1466
1467
  manifest: Y.current.options.commandManifest,
@@ -1469,14 +1470,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1469
1470
  });
1470
1471
  if (c.kind === "accept_offer") {
1471
1472
  let t = o.accept;
1472
- if (t && Us({
1473
+ if (t && Ws({
1473
1474
  kind: "navigate",
1474
1475
  destination: t.destination,
1475
1476
  via: "offer",
1476
1477
  offerId: t.offerId,
1477
1478
  trigger: "yes"
1478
1479
  }, e, n.voiceSessionId, a, n.avatarTabAsk)) {
1479
- Xo(n.avatarTabAsk);
1480
+ Zo(n.avatarTabAsk);
1480
1481
  return;
1481
1482
  }
1482
1483
  c = {
@@ -1493,11 +1494,11 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1493
1494
  };
1494
1495
  }
1495
1496
  if (c.kind === "local_reply") {
1496
- r && Ls(r, e, c.line, c.values, n.voiceSessionId, n.avatarTabAsk);
1497
+ r && Rs(r, e, c.line, c.values, n.voiceSessionId, n.avatarTabAsk);
1497
1498
  return;
1498
1499
  }
1499
1500
  let l = c.kind === "local" ? c.fallback : c.bound, u = c.declineAll;
1500
- if (u !== null && r) return n.avatarTabAsk === void 0 ? Ws({
1501
+ if (u !== null && r) return n.avatarTabAsk === void 0 ? Gs({
1501
1502
  conversationId: r,
1502
1503
  reason: u,
1503
1504
  origin: i,
@@ -1516,9 +1517,9 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1516
1517
  }
1517
1518
  let ne = n.writeReplyBound?.promptText ?? e;
1518
1519
  if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
1519
- let t = Ms(e, n.voiceSessionId, n.localRecordsChecked === !0);
1520
- if (t && Us(t, e, n.voiceSessionId, a, n.avatarTabAsk)) {
1521
- Xo(n.avatarTabAsk);
1520
+ let t = Ns(e, n.voiceSessionId, n.localRecordsChecked === !0);
1521
+ if (t && Ws(t, e, n.voiceSessionId, a, n.avatarTabAsk)) {
1522
+ Zo(n.avatarTabAsk);
1522
1523
  return;
1523
1524
  }
1524
1525
  }
@@ -1529,7 +1530,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1529
1530
  conversation: oe ? {
1530
1531
  mode: oe.mode,
1531
1532
  routedBy: oe.routedBy,
1532
- hasHistory: Jn(oe)
1533
+ hasHistory: Xn(oe)
1533
1534
  } : null
1534
1535
  }) : null;
1535
1536
  if (h && qa.current.find((e) => e.id === h.mode)?.writeCapable && !de(i.acknowledgedWriteModes, h.mode)) {
@@ -1540,31 +1541,31 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1540
1541
  }, co(h.mode);
1541
1542
  return;
1542
1543
  }
1543
- let g = h ? h.mode : i.mode, le, ue, _ = f ?? (a ? null : z), pe = _ ? v.getState().conversations.find((e) => e.id === _) : void 0, he = h?.action === "escalate" && oe ? {
1544
+ let g = h ? h.mode : i.mode, le, ue, _ = f ?? (a ? null : B), pe = _ ? v.getState().conversations.find((e) => e.id === _) : void 0, he = h?.action === "escalate" && oe ? {
1544
1545
  mode: oe.mode,
1545
1546
  backendSessionId: oe.backendSessionId ?? null
1546
1547
  } : null;
1547
1548
  if (h) h.action === "new" || !oe ? _ = ua(void 0, g, { routedBy: "auto" }) : (_ = oe.id, wa(_, g));
1548
1549
  else {
1549
1550
  let e = i.autoRouting ? { routedBy: "auto" } : void 0;
1550
- !_ || ee(pe) || pe && pe.mode !== g && Jn(pe) ? _ = ua(void 0, g, e) : pe && pe.mode !== g && (e ? wa(_, g) : ca(_, g));
1551
+ !_ || ee(pe) || pe && pe.mode !== g && Xn(pe) ? _ = ua(void 0, g, e) : pe && pe.mode !== g && (e ? wa(_, g) : ca(_, g));
1551
1552
  }
1552
1553
  if (!_) return;
1553
- r && _o.current !== void 0 && _ !== i.activeConversationId && bo(_), n.approvalFollowUp || (So.current[_] = t);
1554
+ r && vo.current !== void 0 && _ !== i.activeConversationId && xo(_), n.approvalFollowUp || (Co.current[_] = t);
1554
1555
  let ge = () => v.getState().conversations.some((e) => e.id === _), y = C(), ve = {
1555
- accessToken: I(),
1556
+ accessToken: L(),
1556
1557
  workspaceToken: qi(),
1557
- userId: L,
1558
+ userId: R,
1558
1559
  organizationId: Pt()
1559
1560
  }, xe = (e, t) => {
1560
1561
  ge() || !y || me(e, y, t, g, {
1561
- accessToken: I(),
1562
+ accessToken: L(),
1562
1563
  workspaceToken: qi(),
1563
- userId: L,
1564
+ userId: R,
1564
1565
  organizationId: Pt()
1565
1566
  });
1566
1567
  }, Ee = {
1567
- id: j(),
1568
+ id: M(),
1568
1569
  role: "user",
1569
1570
  content: e,
1570
1571
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -1577,14 +1578,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1577
1578
  ...Ge(n.voiceSessionId)
1578
1579
  }
1579
1580
  };
1580
- V(_, Ee);
1581
- let Oe = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && ne === e ? fi(e, r ? ta.input.code : R) : null, ke = {
1581
+ H(_, Ee);
1582
+ let Oe = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && ne === e ? mi(e, r ? ta.input.code : z) : null, ke = {
1582
1583
  location: window.location.pathname + window.location.search,
1583
1584
  conversationId: v.getState().activeConversationId,
1584
1585
  workspaceId: C(),
1585
- actorId: L ?? null
1586
- }, b = j();
1587
- V(_, {
1586
+ actorId: R ?? null
1587
+ }, b = M();
1588
+ H(_, {
1588
1589
  id: b,
1589
1590
  role: "assistant",
1590
1591
  content: "",
@@ -1596,11 +1597,11 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1596
1597
  }), hn(b, {
1597
1598
  channel: r ? "voice" : "chat",
1598
1599
  mode: g,
1599
- product: N,
1600
+ product: P,
1600
1601
  language: ia,
1601
- device: _n(),
1602
+ device: gn(),
1602
1603
  routedByAuto: !!h
1603
- }, n.voiceTiming), w(b, "accepted"), ma(_, "provisioning", b, null), ce(b), n.avatarTabAsk !== void 0 && Zo(n.avatarTabAsk, {
1604
+ }, n.voiceTiming), T(b, "accepted"), ma(_, "provisioning", b, null), ce(b), n.avatarTabAsk !== void 0 && Qo(n.avatarTabAsk, {
1604
1605
  conversationId: _,
1605
1606
  questionId: Ee.id,
1606
1607
  replyId: b
@@ -1608,7 +1609,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1608
1609
  let Ae = () => {
1609
1610
  let e = Lt({
1610
1611
  turnId: b,
1611
- abortRequested: Ro.current.has(b),
1612
+ abortRequested: zo.current.has(b),
1612
1613
  activeTurnId: v.getState().processingByConversationId[_]?.messageId ?? null,
1613
1614
  conversationExists: ge()
1614
1615
  });
@@ -1633,21 +1634,21 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1633
1634
  }, Je = !1, Ye = () => {
1634
1635
  Je && (Je = !1, qe.abort(b));
1635
1636
  }, Xe = new u(), Qe = () => {}, $e = async (i = 1) => {
1636
- w(b, "attemptStarted");
1637
+ T(b, "attemptStarted");
1637
1638
  let a = null, o = null, s = !1;
1638
1639
  try {
1639
- let { sandboxId: i, sessionId: c, sessionIsNew: u, readAhead: f, sandboxIsNew: p, sandboxProbed: ee, sandboxAdopted: m, deadSandboxProbe: te, sessionPreopened: re } = await Ao(_, b, g, y, ve, { isAbandoned: () => Lt({
1640
+ let { sandboxId: i, sessionId: c, sessionIsNew: u, readAhead: f, sandboxIsNew: p, sandboxProbed: ee, sandboxAdopted: m, deadSandboxProbe: te, sessionPreopened: re } = await jo(_, b, g, y, ve, { isAbandoned: () => Lt({
1640
1641
  turnId: b,
1641
- abortRequested: Ro.current.has(b),
1642
+ abortRequested: zo.current.has(b),
1642
1643
  activeTurnId: v.getState().processingByConversationId[_]?.messageId ?? null,
1643
1644
  conversationExists: ge()
1644
1645
  }).abandon });
1645
1646
  if (a = i, Qe(), Qe = d(i, () => {
1646
- Ro.current.add(b), Ze(b), qe.abort(b);
1647
- }), w(b, "runtimeReady"), gn(b, {
1647
+ zo.current.add(b), Ze(b), qe.abort(b);
1648
+ }), T(b, "runtimeReady"), w(b, {
1648
1649
  runtime: p ? "cold" : m ? "adopted" : ee ? "probed" : re ? "preopened" : u ? "new-session" : "warm",
1649
1650
  deadSandboxProbe: te
1650
- }), gn(b, { session: re ? "preopened" : u ? "created" : "reused" }), o = c, Ne.session = {
1651
+ }), w(b, { session: re ? "preopened" : u ? "created" : "reused" }), o = c, Ne.session = {
1651
1652
  sandboxId: i,
1652
1653
  sessionId: c
1653
1654
  }, fe(g, le, v.getState().acknowledgedWriteModes, {
@@ -1655,7 +1656,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1655
1656
  confirmsWrites: Ce(g),
1656
1657
  proposalBound: Ki(g, i)
1657
1658
  }) === "voice-in-write-mode") throw new Pe("voice-in-write-mode", "Voice in a write mode");
1658
- let ie = cr({
1659
+ let ie = ur({
1659
1660
  conversation: v.getState().conversations.find((e) => e.id === _),
1660
1661
  content: e,
1661
1662
  sessionIsNew: u,
@@ -1664,26 +1665,26 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1664
1665
  modes: qa.current,
1665
1666
  answerText: (e) => dn(e).text
1666
1667
  });
1667
- if (Ke(), Tr()) {
1668
- let e = wr({
1668
+ if (Ke(), Dr()) {
1669
+ let e = Er({
1669
1670
  mint: () => Se(i, y, c, g, ve),
1670
- mark: (e) => w(b, e)
1671
+ mark: (e) => T(b, e)
1671
1672
  });
1672
- x.stream = e, x.render = dr({
1673
+ x.stream = e, x.render = pr({
1673
1674
  stream: e,
1674
1675
  conversationId: _,
1675
1676
  messageId: b,
1676
1677
  build: (e, t) => l(on(e, t, { accumulateNarration: ue.accumulatesNarration }).content),
1677
- onFirstDelta: () => w(b, "firstDelta"),
1678
- onFirstVisible: () => w(b, "firstOutput")
1678
+ onFirstDelta: () => T(b, "firstDelta"),
1679
+ onFirstVisible: () => T(b, "firstOutput")
1679
1680
  });
1680
1681
  }
1681
1682
  let ae = await cn(() => be(i, y, c, g, ve, { limit: 50 }), u, sn(f, i, c));
1682
- Oo(_, b, "streaming", "thinking");
1683
- let oe = Vi?.(), h = Rn(v.getState().sandboxWriteCapabilities[i]), se = Y.current, ce = ui(i, c), de = se.options.uiCatalogue ? si(Kr(se.navItems), {
1683
+ ko(_, b, "streaming", "thinking");
1684
+ let oe = Vi?.(), h = Bn(v.getState().sandboxWriteCapabilities[i]), se = Y.current, ce = fi(i, c), de = se.options.uiCatalogue ? li(Jr(se.navItems), {
1684
1685
  permissionsSettled: se.navPermissionsSettled,
1685
1686
  simulating: se.navSimulating,
1686
- sentBefore: li(ce)
1687
+ sentBefore: di(ce)
1687
1688
  }) : null, pe = v.getState().sandboxWriteCapabilities[i]?.clientTools === !0 ? wi({ writeCapable: le?.writeCapable === !0 || g === "api-calls" }) : null, me = pe?.manifest ?? [], he = {
1688
1689
  conversationId: _,
1689
1690
  writeReply: h === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
@@ -1724,11 +1725,11 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1724
1725
  try {
1725
1726
  await He(Ie);
1726
1727
  } catch (e) {
1727
- if (!Xe.canFailover() || !Ie || !wn(e)) throw e;
1728
+ if (!Xe.canFailover() || !Ie || !Cn(e)) throw e;
1728
1729
  await He(void 0), s ||= ze;
1729
1730
  }
1730
- de && ci(ce);
1731
- let Ge = v.getState().sandboxWriteCapabilities[i], Ye = se.options.uiOffers === !0 && je(Ge) ? L : null, $e = !!Ye;
1731
+ de && ui(ce);
1732
+ let Ge = v.getState().sandboxWriteCapabilities[i], Ye = se.options.uiOffers === !0 && je(Ge) ? R : null, $e = !!Ye;
1732
1733
  Ye && Z.recordTurn({
1733
1734
  replyId: b,
1734
1735
  conversationId: _,
@@ -1743,12 +1744,12 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1743
1744
  tools: pe.tools,
1744
1745
  post: (e, t) => we(i, y, c, e, t, g, ve)
1745
1746
  }) : null, nt = et ? (e) => et.receive(e) : void 0, rt = $e ? (e, t) => {
1746
- Z.receive(b, e, t, performance.now()) && gs();
1747
- } : void 0, it = (e) => fa(_, b, { content: e }), at = (e) => s ? `${e}\n\n${M("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;
1748
- w(b, "promptSent");
1747
+ Z.receive(b, e, t, performance.now()) && _s();
1748
+ } : void 0, it = (e) => fa(_, b, { content: e }), at = (e) => s ? `${e}\n\n${N("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;
1749
+ T(b, "promptSent");
1749
1750
  let ot = null, st = !1, ct = an, S = on([], ae);
1750
1751
  x.render?.arm(ae);
1751
- let lt = Date.now() + ue.streamBudgetMs, ut = Date.now(), dt = Date.now(), ft = Er(() => be(i, y, c, g, ve, {
1752
+ let lt = Date.now() + ue.streamBudgetMs, ut = Date.now(), dt = Date.now(), ft = Or(() => be(i, y, c, g, ve, {
1752
1753
  limit: 50,
1753
1754
  sinceMs: ae,
1754
1755
  surfaceTurnTerminal: !0,
@@ -1764,19 +1765,19 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1764
1765
  return;
1765
1766
  }
1766
1767
  let t = await ft.next();
1767
- if ($e && Z.observeMessages(b, t) && gs(), S = on(t, ae, { accumulateNarration: ue.accumulatesNarration }), fa(_, b, { content: l(S.content) }), S.hasRenderableOutput ? st || (st = !0, ot !== null && w(b, "lastQuietPoll", ot), w(b, "firstOutput")) : ot = yn(), ue.accumulatesNarration) S.hasText && w(b, "firstText");
1768
+ if ($e && Z.observeMessages(b, t) && _s(), S = on(t, ae, { accumulateNarration: ue.accumulatesNarration }), fa(_, b, { content: l(S.content) }), S.hasRenderableOutput ? st || (st = !0, ot !== null && T(b, "lastQuietPoll", ot), T(b, "firstOutput")) : ot = vn(), ue.accumulatesNarration) S.hasText && T(b, "firstText");
1768
1769
  else {
1769
- let e = un(ct, S, yn());
1770
- ct = e.tracker, e.confirmedAt !== null && w(b, "firstText", e.confirmedAt);
1770
+ let e = un(ct, S, vn());
1771
+ ct = e.tracker, e.confirmedAt !== null && T(b, "firstText", e.confirmedAt);
1771
1772
  }
1772
- if (S.pendingWrite && !In(v.getState().sandboxWriteCapabilities[i]) && pa(_, b, { pendingWrite: S.pendingWrite }), S.done && (x.stream ? gn(b, {
1773
+ if (S.pendingWrite && !Rn(v.getState().sandboxWriteCapabilities[i]) && pa(_, b, { pendingWrite: S.pendingWrite }), S.done && (x.stream ? w(b, {
1773
1774
  transport: x.stream.reachedOpen ? "sse" : "poll",
1774
- live: ur(x.stream.live)
1775
- }) : gn(b, {
1775
+ live: fr(x.stream.live)
1776
+ }) : w(b, {
1776
1777
  transport: "poll",
1777
1778
  live: "none"
1778
1779
  }), We()), S.done) {
1779
- w(b, "answerDone"), q.current.markVerified(i);
1780
+ T(b, "answerDone"), q.current.markVerified(i);
1780
1781
  break;
1781
1782
  }
1782
1783
  if (x.render?.refresh(t), Date.now() - ut > 3e4 && (await _e(i, y, 600, ve).catch(() => void 0), ut = Date.now()), !ft.hasPending()) {
@@ -1789,7 +1790,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1789
1790
  }
1790
1791
  if (ht?.(), Ke(), S.done && n.voiceSessionId !== void 0 && !Ae().abandon) {
1791
1792
  let e = l(at(S.content));
1792
- e.trim() && (s && it(e), w(b, "speechQueued"), Je = !0, qe.publish(b, {
1793
+ e.trim() && (s && it(e), T(b, "speechQueued"), Je = !0, qe.publish(b, {
1793
1794
  conversationId: _,
1794
1795
  channel: "voice",
1795
1796
  voiceSessionId: n.voiceSessionId,
@@ -1799,9 +1800,9 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1799
1800
  }));
1800
1801
  }
1801
1802
  let _t = ue.producesArtifacts ? await ye(i, y, c, g, ve).then((e) => e).catch(() => []) : void 0;
1802
- S.usedTools !== void 0 && gn(b, { usedTools: S.usedTools }), S.done || (gn(b, { outcome: "timedOut" }), S = {
1803
+ S.usedTools !== void 0 && w(b, { usedTools: S.usedTools }), S.done || (w(b, { outcome: "timedOut" }), S = {
1803
1804
  ...S,
1804
- content: Ue(S.content, g, M, le)
1805
+ content: Ue(S.content, g, N, le)
1805
1806
  }), s && (S = {
1806
1807
  ...S,
1807
1808
  content: at(S.content)
@@ -1813,13 +1814,13 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1813
1814
  messageId: S.messageId,
1814
1815
  model: S.model,
1815
1816
  tokens: S.tokens
1816
- }, Wi, { ledger: Re("panel", N) }) : { ok: !0 }).ok && _i(N)), S.done || xe(i, c);
1817
+ }, Wi, { ledger: Re("panel", P) }) : { ok: !0 }).ok && Mn(P)), S.done || xe(i, c);
1817
1818
  let yt = Ae();
1818
1819
  if (yt.abandon) {
1819
1820
  yt.clearProcessing && ha(_);
1820
1821
  return;
1821
1822
  }
1822
- w(b, "complete"), gn(b, { outcome: "answered" }), ma(_, "complete", b, null), $n.recordCommittedEntries(_, [Ee.id, b], "TURN", y), Je = !1, $e && Oe && S.done && Es({
1823
+ T(b, "complete"), w(b, { outcome: "answered" }), ma(_, "complete", b, null), tr.recordCommittedEntries(_, [Ee.id, b], "TURN", y), Je = !1, $e && Oe && S.done && Ds({
1823
1824
  replyId: b,
1824
1825
  conversationId: _,
1825
1826
  voiceSessionId: n.voiceSessionId,
@@ -1830,7 +1831,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1830
1831
  q.current.invalidate(a ?? v.getState().sandboxesByMode[g]?.sandboxId ?? null);
1831
1832
  let t = Lt({
1832
1833
  turnId: b,
1833
- abortRequested: Ro.current.has(b),
1834
+ abortRequested: zo.current.has(b),
1834
1835
  activeTurnId: v.getState().processingByConversationId[_]?.messageId ?? null,
1835
1836
  conversationExists: ge()
1836
1837
  });
@@ -1838,15 +1839,15 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1838
1839
  t.clearProcessing && ha(_);
1839
1840
  return;
1840
1841
  }
1841
- if (i === 1 && Xe.canFailover() && Tn(e)) {
1842
+ if (i === 1 && Xe.canFailover() && wn(e)) {
1842
1843
  Qe();
1843
1844
  let e = a ?? v.getState().sandboxesByMode[g]?.sandboxId ?? null;
1844
- return e && (J.current.add(e), q.current.invalidate(e)), _a(_), ya(g), da(_, b, ""), pa(_, b, { pendingWrite: void 0 }), e && W.retireSandbox(e), Ke(), Ye(), vn(b), $e(2);
1845
+ return e && (J.current.add(e), q.current.invalidate(e)), _a(_), ya(g), da(_, b, ""), pa(_, b, { pendingWrite: void 0 }), e && G.retireSandbox(e), Ke(), Ye(), _n(b), $e(2);
1845
1846
  }
1846
1847
  throw e;
1847
1848
  }
1848
1849
  }, et = _;
1849
- Co.current.add(et);
1850
+ wo.current.add(et);
1850
1851
  try {
1851
1852
  if (!y) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1852
1853
  code: "UNAUTHENTICATED",
@@ -1865,7 +1866,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1865
1866
  proposalBound: Ki(g)
1866
1867
  });
1867
1868
  if (i) throw new Pe(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1868
- let a = Re("panel", N);
1869
+ let a = Re("panel", P);
1869
1870
  if (Wi && ze(a, y)) {
1870
1871
  let e = await Ve(a, y, Wi);
1871
1872
  if (!e.ok) throw He(e.kind);
@@ -1875,7 +1876,7 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1875
1876
  return;
1876
1877
  }
1877
1878
  }
1878
- w(b, "cleared"), await $e();
1879
+ T(b, "cleared"), await $e();
1879
1880
  } catch (e) {
1880
1881
  if (q.current.invalidate(v.getState().sandboxesByMode[g]?.sandboxId ?? null), !ge()) {
1881
1882
  ha(_);
@@ -1885,77 +1886,77 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1885
1886
  mode: g,
1886
1887
  capabilities: t ? v.getState().sandboxWriteCapabilities[t] : null
1887
1888
  }) });
1888
- gn(b, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && gi(N, "sandbox");
1889
- let i = Le(r, M, { locale: R });
1889
+ w(b, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && jn(P, "sandbox");
1890
+ let i = Le(r, N, { locale: z });
1890
1891
  ma(_, "error", b, i.headline), fa(_, b, { content: i.text }), pa(_, b, {
1891
- lang: i.translated ? R : "en",
1892
+ lang: i.translated ? z : "en",
1892
1893
  ...Ge(n.voiceSessionId)
1893
1894
  });
1894
1895
  } finally {
1895
- Qe(), Co.current.delete(et), gn(b, { outcome: "stopped" }), w(b, "complete"), Ye(), Ke();
1896
+ Qe(), wo.current.delete(et), w(b, { outcome: "stopped" }), T(b, "complete"), Ye(), Ke();
1896
1897
  let e = v.getState(), t = te(he, g, e.conversations.find((e) => e.id === et), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1897
- t && (wa(et, t.mode), t.backendSessionId && ga(et, t.backendSessionId)), Ne.session && ge() && W.afterTurn({
1898
+ t && (wa(et, t.mode), t.backendSessionId && ga(et, t.backendSessionId)), Ne.session && ge() && G.afterTurn({
1898
1899
  ...Ne.session,
1899
1900
  conversationId: et
1900
1901
  }, b);
1901
- let n = zo.current;
1902
- zo.current = null, n && n.conversationId === et && ge() && Js.current(n.content, n.attachments, n.options);
1902
+ let n = Bo.current;
1903
+ Bo.current = null, n && n.conversationId === et && ge() && Ys.current(n.content, n.attachments, n.options);
1903
1904
  }
1904
1905
  }, [
1905
- z,
1906
- V,
1906
+ B,
1907
+ H,
1907
1908
  Hi,
1908
1909
  _a,
1909
1910
  ya,
1910
1911
  aa,
1911
1912
  ua,
1912
- Ao,
1913
- W,
1914
- Vo,
1915
- Ls,
1916
- Ws,
1917
- R,
1913
+ jo,
1914
+ G,
1915
+ Ho,
1916
+ Rs,
1917
+ Gs,
1918
+ z,
1918
1919
  ta,
1919
1920
  Ki,
1920
1921
  Vi,
1921
- I,
1922
+ L,
1922
1923
  qi,
1923
1924
  fa,
1924
- N,
1925
+ P,
1925
1926
  Ka,
1926
1927
  Wi,
1927
1928
  ra,
1928
- R,
1929
+ z,
1929
1930
  ia,
1930
1931
  na,
1931
1932
  wa,
1932
- Us,
1933
- Ms,
1934
- bo,
1933
+ Ws,
1934
+ Ns,
1935
1935
  xo,
1936
+ So,
1936
1937
  ga,
1937
1938
  ca,
1938
1939
  ma,
1939
1940
  ha,
1940
- M,
1941
- Oo,
1941
+ N,
1942
+ ko,
1942
1943
  da,
1943
- L,
1944
+ R,
1944
1945
  Z,
1945
- gs,
1946
- Is,
1947
- Es,
1948
- Zo,
1949
- Xo
1950
- ]), Gs = T((e, t) => {
1946
+ _s,
1947
+ Ls,
1948
+ Ds,
1949
+ Qo,
1950
+ Zo
1951
+ ]), Ks = E((e, t) => {
1951
1952
  Q(e, [], t ? { autoIntent: t } : {});
1952
- }, [Q]), Ks = Ft(), qs = T(() => {
1953
+ }, [Q]), qs = Ft(), Js = E(() => {
1953
1954
  let e = [...Ta.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1954
1955
  if (!e || e.metadata?.approvalFollowUp) return;
1955
- let t = z ? So.current[z] ?? [] : [];
1956
+ let t = B ? Co.current[B] ?? [] : [];
1956
1957
  if (t.some((e) => At(e, Date.now()))) {
1957
- let n = z ?? void 0;
1958
- jt(t, Ks).then((t) => {
1958
+ let n = B ?? void 0;
1959
+ jt(t, qs).then((t) => {
1959
1960
  Q(e.content, t, n === void 0 ? void 0 : { targetConversationId: n });
1960
1961
  });
1961
1962
  return;
@@ -1964,136 +1965,136 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
1964
1965
  }, [
1965
1966
  Ea,
1966
1967
  Q,
1967
- z,
1968
- Ks
1969
- ]), Js = O(Q);
1970
- E(() => {
1971
- Js.current = Q;
1968
+ B,
1969
+ qs
1970
+ ]), Ys = k(Q);
1971
+ D(() => {
1972
+ Ys.current = Q;
1972
1973
  }, [Q]);
1973
- let Ys = D(() => {
1974
+ let Xs = O(() => {
1974
1975
  if (Da) return null;
1975
1976
  for (let e = Ea.length - 1; e >= 0; --e) {
1976
1977
  let t = Ea[e];
1977
1978
  if (t?.role !== "assistant") continue;
1978
- if (t.id === is) return null;
1979
- if (!We(t) || Ro.current.has(t.id) || Xe(t.id)) continue;
1980
- let n = rn(t, U, M);
1979
+ if (t.id === as) return null;
1980
+ if (!We(t) || zo.current.has(t.id) || Xe(t.id)) continue;
1981
+ let n = rn(t, W, N);
1981
1982
  if (n.kind !== "output") return null;
1982
1983
  let r = dn(n.text).text.trim();
1983
- return r ? Ye(t, r, U) : null;
1984
+ return r ? Ye(t, r, W) : null;
1984
1985
  }
1985
1986
  return null;
1986
1987
  }, [
1987
1988
  Ea,
1988
1989
  Da,
1989
- U,
1990
- is,
1991
- M
1992
- ]), Xs = D(() => Ys ? nt(Ys.text) : null, [Ys]), Zs = D(() => Ta.chat.filter((e) => e.id !== is), [Ta.chat, is]), Qs = v((e) => pe(e)?.sandboxId ?? null), $s = le(Zs, {
1993
- sessionId: H?.backendSessionId,
1994
- sandboxId: Qs,
1990
+ W,
1991
+ as,
1992
+ N
1993
+ ]), Zs = O(() => Xs ? nt(Xs.text) : null, [Xs]), Qs = O(() => Ta.chat.filter((e) => e.id !== as), [Ta.chat, as]), $s = v((e) => pe(e)?.sandboxId ?? null), ec = le(Qs, {
1994
+ sessionId: U?.backendSessionId,
1995
+ sandboxId: $s,
1995
1996
  nowMs: Date.now()
1996
- }), ec = ue(Zs), tc = (e) => {
1997
- if (Fn(e.metadata).length > 0) return !0;
1997
+ }), tc = ue(Qs), nc = (e) => {
1998
+ if (Ln(e.metadata).length > 0) return !0;
1998
1999
  let t = e.metadata?.sandboxId;
1999
- return In(t ? Aa[t] : null);
2000
- }, nc = (e) => {
2001
- let t = Fn(e.metadata);
2002
- return t.length === 0 || !z ? null : /* @__PURE__ */ A(Pn, {
2000
+ return Rn(t ? Aa[t] : null);
2001
+ }, rc = (e) => {
2002
+ let t = Ln(e.metadata);
2003
+ return t.length === 0 || !B ? null : /* @__PURE__ */ j(In, {
2003
2004
  refs: t,
2004
- conversationId: z,
2005
- panel: W,
2005
+ conversationId: B,
2006
+ panel: G,
2006
2007
  entries: ja,
2007
2008
  capabilitiesOf: (e) => Aa[e],
2008
2009
  turnInFlight: Da,
2009
- tr: M,
2010
+ tr: N,
2010
2011
  onReview: Na.review,
2011
2012
  retiredSandboxes: Ma
2012
2013
  });
2013
- }, rc = (e) => {
2014
- if (!z) return null;
2014
+ }, ic = (e) => {
2015
+ if (!B) return null;
2015
2016
  let t = Z.liveOffersFor(e, {
2016
2017
  registry: {
2017
- destinations: Kr($o),
2018
- permissionsSettled: es,
2019
- simulating: ts
2018
+ destinations: Jr(es),
2019
+ permissionsSettled: ts,
2020
+ simulating: ns
2020
2021
  },
2021
- actorId: L,
2022
- conversationId: z,
2022
+ actorId: R,
2023
+ conversationId: B,
2023
2024
  perfNow: performance.now()
2024
2025
  }), n = t[0];
2025
- return n ? /* @__PURE__ */ A(pr, {
2026
+ return n ? /* @__PURE__ */ j(hr, {
2026
2027
  offers: t.map(({ offer: e, target: t }) => ({
2027
2028
  offerId: e.offerId,
2028
2029
  label: t.label,
2029
2030
  path: t.path
2030
2031
  })),
2031
- hint: t.length === 1 && F === "proposal-v1" ? Me(n.offer, Z.turnFor(e)) : "link",
2032
- onOpen: Ts
2032
+ hint: t.length === 1 && I === "proposal-v1" ? Me(n.offer, Z.turnFor(e)) : "link",
2033
+ onOpen: Es
2033
2034
  }, n.offer.offerId) : null;
2034
- }, ic = (e) => e.role === "assistant" ? rc(e.id) : null;
2035
- E(() => {
2035
+ }, ac = (e) => e.role === "assistant" ? ic(e.id) : null;
2036
+ D(() => {
2036
2037
  let e = Z.nextExpiryInMs(performance.now());
2037
2038
  if (e === null) return;
2038
- let t = window.setTimeout(gs, e + 1);
2039
+ let t = window.setTimeout(_s, e + 1);
2039
2040
  return () => window.clearTimeout(t);
2040
2041
  }, [
2041
2042
  Z,
2042
- ms,
2043
- gs
2043
+ hs,
2044
+ _s
2044
2045
  ]);
2045
- let ac = Na.dialog.view ? ja[Na.dialog.view.proposalId] : void 0, oc = $s?.expiresAtMs ?? null;
2046
- E(() => {
2047
- if (oc === null) return;
2048
- let e = window.setTimeout(() => Lo((e) => e + 1), Math.max(0, oc - Date.now()));
2046
+ let oc = Na.dialog.view ? ja[Na.dialog.view.proposalId] : void 0, sc = ec?.expiresAtMs ?? null;
2047
+ D(() => {
2048
+ if (sc === null) return;
2049
+ let e = window.setTimeout(() => Ro((e) => e + 1), Math.max(0, sc - Date.now()));
2049
2050
  return () => window.clearTimeout(e);
2050
- }, [oc, Io]);
2051
- let sc = D(() => Ta.voice.filter((e) => e.id !== is && (e.role === "user" || e.role === "assistant")).map((e) => ({
2051
+ }, [sc, Lo]);
2052
+ let cc = O(() => Ta.voice.filter((e) => e.id !== as && (e.role === "user" || e.role === "assistant")).map((e) => ({
2052
2053
  id: e.id,
2053
2054
  role: e.role,
2054
- text: mn(e, U, M),
2055
+ text: mn(e, W, N),
2055
2056
  sessionId: Ke(e),
2056
2057
  timestamp: e.timestamp
2057
2058
  })).filter((e) => e.text.length > 0), [
2058
2059
  Ta.voice,
2059
- U,
2060
- is,
2061
- M
2062
- ]), cc = T(() => {
2063
- if (sc.length === 0) return;
2060
+ W,
2061
+ as,
2062
+ N
2063
+ ]), lc = E(() => {
2064
+ if (cc.length === 0) return;
2064
2065
  let e = /* @__PURE__ */ new Date();
2065
- qn($e(sc, {
2066
- title: M("voiceSession.transcript", "Voice conversation"),
2067
- savedAt: M("voiceSession.savedAt", "Saved"),
2068
- session: M("voiceSession.sessionLabel", "Session"),
2069
- earlier: M("voiceSession.earlierLabel", "Earlier"),
2070
- you: M("voiceSession.speakerYou", "You"),
2071
- assistant: M("voiceSession.speakerAssistant", "Assistant")
2072
- }, e), et(N, e), "text/markdown");
2066
+ Yn($e(cc, {
2067
+ title: N("voiceSession.transcript", "Voice conversation"),
2068
+ savedAt: N("voiceSession.savedAt", "Saved"),
2069
+ session: N("voiceSession.sessionLabel", "Session"),
2070
+ earlier: N("voiceSession.earlierLabel", "Earlier"),
2071
+ you: N("voiceSession.speakerYou", "You"),
2072
+ assistant: N("voiceSession.speakerAssistant", "Assistant")
2073
+ }, e), et(P, e), "text/markdown");
2073
2074
  }, [
2074
- N,
2075
- sc,
2076
- M
2077
- ]), lc = vi({ perFileChars: oo }), uc = O(lc);
2078
- uc.current = lc;
2079
- let [dc, fc] = k(null), pc = dc === null ? null : M("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: dc });
2080
- E(() => {
2081
- if (dc === null) return;
2082
- let e = window.setTimeout(() => fc(null), Mi);
2075
+ P,
2076
+ cc,
2077
+ N
2078
+ ]), uc = vi({ perFileChars: oo }), dc = k(uc);
2079
+ dc.current = uc;
2080
+ let [fc, pc] = A(null), mc = fc === null ? null : N("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: fc });
2081
+ D(() => {
2082
+ if (fc === null) return;
2083
+ let e = window.setTimeout(() => pc(null), Mi);
2083
2084
  return () => window.clearTimeout(e);
2084
- }, [dc]);
2085
- let mc = O(/* @__PURE__ */ new Set()), hc = O(() => !1), $ = Cn({
2086
- onSubmit: T((e, t, n, r) => {
2087
- let i = _o.current, a = ft(i), o = () => {
2085
+ }, [fc]);
2086
+ let hc = k(/* @__PURE__ */ new Set()), gc = k(() => !1), $ = Sn({
2087
+ onSubmit: E((e, t, n, r) => {
2088
+ let i = vo.current, a = ft(i), o = () => {
2088
2089
  let e = v.getState();
2089
2090
  return st({
2090
- sessionLive: hc.current(t),
2091
+ sessionLive: gc.current(t),
2091
2092
  boundAtSubmit: i,
2092
2093
  activeConversationId: e.activeConversationId,
2093
2094
  boundConversationExists: e.conversations.some((e) => e.id === a)
2094
2095
  });
2095
2096
  }, s = () => {
2096
- let i = uc.current;
2097
+ let i = dc.current;
2097
2098
  Nt({
2098
2099
  draft: i,
2099
2100
  maySend: o,
@@ -2101,288 +2102,288 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2101
2102
  sendTurn: (i) => {
2102
2103
  let a = {
2103
2104
  ...n,
2104
- handedOver: yn()
2105
+ handedOver: vn()
2105
2106
  };
2106
- Js.current(e, i, {
2107
+ Ys.current(e, i, {
2107
2108
  fromPerson: !0,
2108
2109
  voiceSessionId: t,
2109
2110
  voiceTiming: a,
2110
2111
  ...r.correction ? { correctsInFlightTurn: !0 } : {}
2111
2112
  });
2112
2113
  },
2113
- announceDropped: (e) => fc(e)
2114
+ announceDropped: (e) => pc(e)
2114
2115
  });
2115
2116
  };
2116
- if (o() && Fs.current(e, t)) {
2117
- Js.current(e, [], {
2117
+ if (o() && Is.current(e, t)) {
2118
+ Ys.current(e, [], {
2118
2119
  fromPerson: !0,
2119
2120
  voiceSessionId: t,
2120
2121
  voiceTiming: {
2121
2122
  ...n,
2122
- handedOver: yn()
2123
+ handedOver: vn()
2123
2124
  }
2124
2125
  });
2125
2126
  return;
2126
2127
  }
2127
- if (!uc.current.isBusy) {
2128
+ if (!dc.current.isBusy) {
2128
2129
  s();
2129
2130
  return;
2130
2131
  }
2131
- let c = Date.now(), l = mc.current, u = window.setInterval(() => {
2132
- let e = uc.current.isBusy;
2133
- uc.current.isCommitting || e && Date.now() - c < ji || (window.clearInterval(u), l.delete(u), s());
2132
+ let c = Date.now(), l = hc.current, u = window.setInterval(() => {
2133
+ let e = dc.current.isBusy;
2134
+ dc.current.isCommitting || e && Date.now() - c < ji || (window.clearInterval(u), l.delete(u), s());
2134
2135
  }, 200);
2135
2136
  l.add(u);
2136
2137
  }, []),
2137
- latestReply: Ys,
2138
- language: rt($i, R).tag,
2138
+ latestReply: Xs,
2139
+ language: rt($i, z).tag,
2139
2140
  graceMs: Yi,
2140
- onSupersede: Ho,
2141
+ onSupersede: Uo,
2141
2142
  handsFreeStreamNoticeAccepted: Zi,
2142
2143
  onAcceptHandsFreeStreamNotice: Qi,
2143
2144
  handsFreeInterrupt: Xi,
2144
- onBargeIn: Vo
2145
+ onBargeIn: Ho
2145
2146
  });
2146
- hc.current = $.isCurrentSession;
2147
- let gc = vo ? sc.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : sc, _c = $.answerLocally;
2148
- E(() => {
2149
- Rs.current = _c;
2150
- }, [_c]);
2151
- let vc = $.active, yc = D(() => wt(Object.values(ja), z, Ma), [
2147
+ gc.current = $.isCurrentSession;
2148
+ let _c = yo ? cc.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : cc, vc = $.answerLocally;
2149
+ D(() => {
2150
+ zs.current = vc;
2151
+ }, [vc]);
2152
+ let yc = $.active, bc = O(() => wt(Object.values(ja), B, Ma), [
2152
2153
  ja,
2153
- z,
2154
+ B,
2154
2155
  Ma
2155
- ]), [bc, xc] = k(null);
2156
- E(() => {
2157
- vc || xc(null);
2158
- }, [vc]);
2159
- let Sc = Na.review, Cc = T(() => {
2160
- let e = yc[yc.length - 1];
2156
+ ]), [xc, Sc] = A(null);
2157
+ D(() => {
2158
+ yc || Sc(null);
2159
+ }, [yc]);
2160
+ let Cc = Na.review, wc = E(() => {
2161
+ let e = bc[bc.length - 1];
2161
2162
  if (!e) return;
2162
2163
  let { view: t } = e;
2163
- if (jn(t) && An(t, Aa[e.session.sandboxId]).offerConfirm) {
2164
- Sc(t);
2164
+ if (An(t) && kn(t, Aa[e.session.sandboxId]).offerConfirm) {
2165
+ Cc(t);
2165
2166
  return;
2166
2167
  }
2167
- xc(t.proposalId);
2168
+ Sc(t.proposalId);
2168
2169
  }, [
2169
- yc,
2170
+ bc,
2170
2171
  Aa,
2171
- Sc
2172
- ]), wc = vc ? xt(yc) : null, Tc = bc ? ja[bc] : void 0, Ec = vc && Tc && Tc.session.conversationId === z ? {
2173
- content: /* @__PURE__ */ A(Pn, {
2172
+ Cc
2173
+ ]), Tc = yc ? xt(bc) : null, Ec = xc ? ja[xc] : void 0, Dc = yc && Ec && Ec.session.conversationId === B ? {
2174
+ content: /* @__PURE__ */ j(In, {
2174
2175
  refs: [{
2175
- proposalId: Tc.view.proposalId,
2176
- sandboxId: Tc.session.sandboxId,
2177
- sessionId: Tc.session.sessionId
2176
+ proposalId: Ec.view.proposalId,
2177
+ sandboxId: Ec.session.sandboxId,
2178
+ sessionId: Ec.session.sessionId
2178
2179
  }],
2179
- conversationId: Tc.session.conversationId,
2180
- panel: W,
2180
+ conversationId: Ec.session.conversationId,
2181
+ panel: G,
2181
2182
  entries: ja,
2182
2183
  capabilitiesOf: (e) => Aa[e],
2183
2184
  turnInFlight: Da,
2184
- tr: M,
2185
- onReview: Sc,
2185
+ tr: N,
2186
+ onReview: Cc,
2186
2187
  retiredSandboxes: Ma
2187
2188
  }),
2188
- closeLabel: Tt(M, yt.trayClose),
2189
- onClose: () => xc(null)
2190
- } : null, Dc = Na.asking, Oc = Os?.asking === !0, kc = ks?.asking === !0, Ac = ar(), jc = $.holdListening;
2191
- a("assistant.transcript", D(() => vc || K ? null : { run: () => fo ? { status: "already" } : (go(!0), { status: "done" }) }, [
2192
- vc,
2189
+ closeLabel: Tt(N, yt.trayClose),
2190
+ onClose: () => Sc(null)
2191
+ } : null, Oc = Na.asking, kc = ks?.asking === !0, Ac = As?.asking === !0, jc = sr(), Mc = $.holdListening;
2192
+ a("assistant.transcript", O(() => yc || K ? null : { run: () => fo ? { status: "already" } : (_o(!0), { status: "done" }) }, [
2193
+ yc,
2193
2194
  K,
2194
2195
  fo,
2195
- go
2196
- ])), a("assistant.conversation.new", D(() => vc ? null : { run: () => {
2196
+ _o
2197
+ ])), a("assistant.conversation.new", O(() => yc ? null : { run: () => {
2197
2198
  let e = v.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
2198
2199
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
2199
- } }, [vc])), E(() => {
2200
- jc(vc && (Dc || Oc || kc || Ac));
2200
+ } }, [yc])), D(() => {
2201
+ Mc(yc && (Oc || kc || Ac || jc));
2201
2202
  }, [
2202
- vc,
2203
- Dc,
2203
+ yc,
2204
2204
  Oc,
2205
2205
  kc,
2206
2206
  Ac,
2207
- jc
2207
+ jc,
2208
+ Mc
2208
2209
  ]);
2209
- let Mc = O(null), Nc = $.announce;
2210
- E(() => {
2211
- if (!vc) {
2212
- Mc.current = null;
2210
+ let Nc = k(null), Pc = $.announce;
2211
+ D(() => {
2212
+ if (!yc) {
2213
+ Nc.current = null;
2213
2214
  return;
2214
2215
  }
2215
- let e = Mc.current;
2216
+ let e = Nc.current;
2216
2217
  if (e === null) {
2217
- Mc.current = new Set(Object.keys(ja));
2218
+ Nc.current = new Set(Object.keys(ja));
2218
2219
  return;
2219
2220
  }
2220
- for (let { view: t, session: n } of Ct(yc, e)) {
2221
+ for (let { view: t, session: n } of Ct(bc, e)) {
2221
2222
  e.add(t.proposalId);
2222
2223
  let r = Aa[n.sandboxId];
2223
2224
  if (!bt({
2224
2225
  mode: "api-calls",
2225
- productWriteApproval: F,
2226
+ productWriteApproval: I,
2226
2227
  capabilities: r
2227
2228
  })) continue;
2228
- let i = Et(t, An(t, r).offerConfirm, M), a = t.proposalId;
2229
- Nc({
2229
+ let i = Et(t, kn(t, r).offerConfirm, N), a = t.proposalId;
2230
+ Pc({
2230
2231
  id: `write-readback:${a}`,
2231
2232
  text: i.text,
2232
- lang: i.translated ? R : "en",
2233
- stillWanted: () => W.entry(a)?.view.status === "pending"
2233
+ lang: i.translated ? z : "en",
2234
+ stillWanted: () => G.entry(a)?.view.status === "pending"
2234
2235
  });
2235
2236
  }
2236
2237
  }, [
2237
- vc,
2238
2238
  yc,
2239
+ bc,
2239
2240
  ja,
2240
2241
  Aa,
2241
- F,
2242
- M,
2243
- R,
2244
- Nc,
2245
- W
2242
+ I,
2243
+ N,
2244
+ z,
2245
+ Pc,
2246
+ G
2246
2247
  ]);
2247
- let Pc = O(!1);
2248
- E(() => {
2249
- Pc.current = $.active;
2250
- }, [$.active]), E(() => ae((e) => {
2251
- if (!Pc.current) return !1;
2252
- let t = _o.current;
2248
+ let Fc = k(!1);
2249
+ D(() => {
2250
+ Fc.current = $.active;
2251
+ }, [$.active]), D(() => ae((e) => {
2252
+ if (!Fc.current) return !1;
2253
+ let t = vo.current;
2253
2254
  return typeof t == "string" ? t === e : v.getState().activeConversationId === e;
2254
2255
  }), []);
2255
- let Fc = $.start, Ic = T(() => {
2256
- let e = v.getState().activeConversationId, t = lt(xo());
2257
- bo(dt(t, e)), jo(!0, t.kind === "own"), Fc();
2256
+ let Ic = $.start, Lc = E(() => {
2257
+ let e = v.getState().activeConversationId, t = lt(So());
2258
+ xo(dt(t, e)), Mo(!0, t.kind === "own"), Ic();
2258
2259
  }, [
2259
- bo,
2260
- jo,
2261
2260
  xo,
2262
- Fc
2263
- ]), Lc = D(() => pn(H?.messages ?? []), [H?.messages]), Rc = fn(Ta.voice, U, M), zc = fn(Lc, U, M) > 0, Bc = T(() => {
2261
+ Mo,
2262
+ So,
2263
+ Ic
2264
+ ]), Rc = O(() => pn(U?.messages ?? []), [U?.messages]), zc = fn(Ta.voice, W, N), Bc = fn(Rc, W, N) > 0, Vc = E(() => {
2264
2265
  let e = v.getState().activeConversationId;
2265
- if (!e || sc.length === 0) return;
2266
- let t = new Set(Lc.map((e) => e.id)), n = j();
2267
- V(e, {
2266
+ if (!e || cc.length === 0) return;
2267
+ let t = new Set(Rc.map((e) => e.id)), n = M();
2268
+ H(e, {
2268
2269
  id: n,
2269
2270
  role: "system",
2270
- content: Qe(sc.filter((e) => t.has(e.id)), {
2271
- intro: M("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2272
- nothing: M("voiceSession.continuedNothing", "Continued from a voice conversation."),
2273
- more: (e) => M("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2271
+ content: Qe(cc.filter((e) => t.has(e.id)), {
2272
+ intro: N("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
2273
+ nothing: N("voiceSession.continuedNothing", "Continued from a voice conversation."),
2274
+ more: (e) => N("voiceSession.continuedMore", "…and {{count}} more", { count: e })
2274
2275
  }),
2275
2276
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2276
- metadata: { continuedVoiceTurns: Rc }
2277
- }), $n.recordCommittedEntries(e, [n], "NOTE", C()), go(!1), $.end(), mo();
2277
+ metadata: { continuedVoiceTurns: zc }
2278
+ }), tr.recordCommittedEntries(e, [n], "NOTE", C()), _o(!1), $.end(), ho();
2278
2279
  }, [
2279
- sc,
2280
+ cc,
2281
+ zc,
2280
2282
  Rc,
2281
- Lc,
2282
- V,
2283
- M,
2283
+ H,
2284
+ N,
2284
2285
  $,
2285
- go,
2286
- mo
2287
- ]), Vc = O({
2286
+ _o,
2287
+ ho
2288
+ ]), Hc = k({
2288
2289
  conversationId: null,
2289
2290
  count: 0
2290
2291
  });
2291
- E(() => {
2292
- $.active && (Vc.current = {
2293
- conversationId: z,
2294
- count: Rc
2292
+ D(() => {
2293
+ $.active && (Hc.current = {
2294
+ conversationId: B,
2295
+ count: zc
2295
2296
  });
2296
2297
  }, [$.active]);
2297
- let Hc = T(() => {
2298
- let e = Vc.current, t = Rc > (e.conversationId === z ? e.count : 0);
2299
- $.end(), t && go(!0);
2298
+ let Uc = E(() => {
2299
+ let e = Hc.current, t = zc > (e.conversationId === B ? e.count : 0);
2300
+ $.end(), t && _o(!0);
2300
2301
  }, [
2301
- z,
2302
- Rc,
2302
+ B,
2303
+ zc,
2303
2304
  $,
2304
- go
2305
+ _o
2305
2306
  ]);
2306
- E(() => {
2307
- (!zi || !Do) && $.active && $.end();
2307
+ D(() => {
2308
+ (!zi || !Oo) && $.active && $.end();
2308
2309
  }, [
2309
2310
  zi,
2310
- Do,
2311
+ Oo,
2311
2312
  $
2312
2313
  ]);
2313
- let [Uc, Wc] = k(Fi), Gc = hr({
2314
+ let [Wc, Gc] = A(Fi), Kc = _r({
2314
2315
  available: $.available,
2315
- allowedInMode: Do,
2316
+ allowedInMode: Oo,
2316
2317
  readOnly: Ia,
2317
- busy: Da || Fo !== null || Ra || us,
2318
- committing: Uc.committing,
2319
- dictating: Uc.dictating
2320
- }), Kc = vt(), [qc, Jc] = k(null);
2321
- E(() => {
2322
- qc !== null && (!K || qc.conversationId !== z) && Jc(null);
2318
+ busy: Da || Io !== null || Ra || ds,
2319
+ committing: Wc.committing,
2320
+ dictating: Wc.dictating
2321
+ }), qc = vt(), [Jc, Yc] = A(null);
2322
+ D(() => {
2323
+ Jc !== null && (!K || Jc.conversationId !== B) && Yc(null);
2323
2324
  }, [
2324
2325
  K,
2325
- z,
2326
- qc
2326
+ B,
2327
+ Jc
2327
2328
  ]);
2328
- let Yc = qc !== null && Ko === qc.replyId, Xc = O(!1), Zc = T(() => {
2329
- Xc.current = !0, Yc && qo(), Ic();
2329
+ let Xc = Jc !== null && qo === Jc.replyId, Zc = k(!1), Qc = E(() => {
2330
+ Zc.current = !0, Xc && Jo(), Lc();
2330
2331
  }, [
2331
- Ic,
2332
- Yc,
2333
- qo
2332
+ Lc,
2333
+ Xc,
2334
+ Jo
2334
2335
  ]);
2335
- E(() => {
2336
- $.active || (Xc.current = !1);
2337
- }, [$.active]), E(() => {
2338
- K || !Xc.current || (Xc.current = !1, $.active && Hc());
2336
+ D(() => {
2337
+ $.active || (Zc.current = !1);
2338
+ }, [$.active]), D(() => {
2339
+ K || !Zc.current || (Zc.current = !1, $.active && Uc());
2339
2340
  }, [
2340
2341
  K,
2341
2342
  $.active,
2342
- Hc
2343
- ]), E(() => {
2344
- K && go(!1);
2345
- }, [K, go]);
2346
- let Qc = D(() => ({
2343
+ Uc
2344
+ ]), D(() => {
2345
+ K && _o(!1);
2346
+ }, [K, _o]);
2347
+ let $c = O(() => ({
2347
2348
  live: $.active,
2348
- blocked: Gc === null ? null : Kc.voiceStartBlocked(Gc),
2349
- impossible: gr(Gc),
2350
- start: Zc
2349
+ blocked: Kc === null ? null : qc.voiceStartBlocked(Kc),
2350
+ impossible: vr(Kc),
2351
+ start: Qc
2351
2352
  }), [
2352
2353
  $.active,
2353
- Gc,
2354
2354
  Kc,
2355
- Zc
2356
- ]), [$c, el] = k("mini"), tl = zi && G.covered !== !0 && !($.active && $c !== "mini") && !(fo && !$.active) && !(Dc || Oc || kc || Ac), nl = po?.ask, rl = Di(nl?.subscribe ?? Li, nl?.getSnapshot ?? Ri, nl?.getSnapshot ?? Ri), il = _r({
2355
+ qc,
2356
+ Qc
2357
+ ]), [el, tl] = A("mini"), nl = zi && po.covered !== !0 && !($.active && el !== "mini") && !(fo && !$.active) && !(Oc || kc || Ac || jc), rl = mo?.ask, il = Di(rl?.subscribe ?? Li, rl?.getSnapshot ?? Ri, rl?.getSnapshot ?? Ri), al = yr({
2357
2358
  voiceLive: $.active,
2358
2359
  readOnly: Ia,
2359
- writes: vr({
2360
+ writes: br({
2360
2361
  auto: eo,
2361
- selectedMode: B,
2362
- conversation: H && !Ia ? {
2363
- mode: H.mode,
2364
- routedBy: H.routedBy,
2365
- hasHistory: Jn(H)
2362
+ selectedMode: V,
2363
+ conversation: U && !Ia ? {
2364
+ mode: U.mode,
2365
+ routedBy: U.routedBy,
2366
+ hasHistory: Xn(U)
2366
2367
  } : null,
2367
- modeWrites: (e) => P.find((t) => t.id === e)?.writeCapable === !0 || Ce(e)
2368
+ modeWrites: (e) => F.find((t) => t.id === e)?.writeCapable === !0 || Ce(e)
2368
2369
  }),
2369
- avatar: rl,
2370
- busy: Da || Fo !== null || Ra || us || so !== null || io,
2371
- committing: Uc.committing
2372
- }), al = O(il);
2370
+ avatar: il,
2371
+ busy: Da || Io !== null || Ra || ds || so !== null || io,
2372
+ committing: Wc.committing
2373
+ }), ol = k(al);
2373
2374
  Ei(() => {
2374
- al.current = il;
2375
- }, [il]);
2376
- let ol = T((e) => {
2375
+ ol.current = al;
2376
+ }, [al]);
2377
+ let sl = E((e) => {
2377
2378
  let t = e.trim();
2378
- if (t === "" || al.current !== null) return { accepted: !1 };
2379
- Yc && qo();
2379
+ if (t === "" || ol.current !== null) return { accepted: !1 };
2380
+ Xc && Jo();
2380
2381
  let n = {
2381
- token: j(),
2382
+ token: M(),
2382
2383
  exchange: null,
2383
2384
  handled: !1
2384
2385
  };
2385
- Jo.current = n;
2386
+ Yo.current = n;
2386
2387
  try {
2387
2388
  Q(t, [], {
2388
2389
  fromPerson: !0,
@@ -2391,13 +2392,13 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2391
2392
  ...eo ? { autoIntent: "read" } : {}
2392
2393
  });
2393
2394
  } finally {
2394
- Jo.current = null;
2395
+ Yo.current = null;
2395
2396
  }
2396
2397
  let r = n.exchange;
2397
2398
  return r === null ? n.handled ? {
2398
2399
  accepted: !0,
2399
2400
  recorded: !1
2400
- } : { accepted: !1 } : (Jc(r), {
2401
+ } : { accepted: !1 } : (Yc(r), {
2401
2402
  accepted: !0,
2402
2403
  recorded: !0,
2403
2404
  ...r
@@ -2405,101 +2406,101 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2405
2406
  }, [
2406
2407
  eo,
2407
2408
  Q,
2408
- qo,
2409
- Yc
2410
- ]), [sl] = k(() => br()), cl = D(() => ({
2411
- blocker: il,
2412
- line: yr(il, Gc),
2413
- send: ol,
2414
- last: qc,
2415
- navigatingReplyId: fs,
2416
- draft: sl
2409
+ Jo,
2410
+ Xc
2411
+ ]), [cl] = A(() => Sr()), ll = O(() => ({
2412
+ blocker: al,
2413
+ line: xr(al, Kc),
2414
+ send: sl,
2415
+ last: Jc,
2416
+ navigatingReplyId: ps,
2417
+ draft: cl
2417
2418
  }), [
2418
- il,
2419
- Gc,
2420
- ol,
2421
- qc,
2422
- fs,
2423
- sl
2424
- ]), ll = G.setReplyEscape, ul = K && tl && Yc;
2425
- E(() => {
2426
- if (!(!ll || !ul)) return ll(qo), () => ll(null);
2419
+ al,
2420
+ Kc,
2421
+ sl,
2422
+ Jc,
2423
+ ps,
2424
+ cl
2425
+ ]), ul = po.setReplyEscape, dl = K && nl && Xc;
2426
+ D(() => {
2427
+ if (!(!ul || !dl)) return ul(Jo), () => ul(null);
2427
2428
  }, [
2428
- ll,
2429
2429
  ul,
2430
- qo
2431
- ]), E(() => {
2432
- let e = _o.current, t = ft(e), n = v.getState(), r = S({
2430
+ dl,
2431
+ Jo
2432
+ ]), D(() => {
2433
+ let e = vo.current, t = ft(e), n = v.getState(), r = S({
2433
2434
  sessionLive: $.active,
2434
2435
  bound: e,
2435
2436
  activeConversationId: n.activeConversationId,
2436
2437
  boundConversationExists: n.conversations.some((e) => e.id === t)
2437
2438
  });
2438
- bo(r.bound), r.end && $.end();
2439
+ xo(r.bound), r.end && $.end();
2439
2440
  }, [
2440
2441
  $,
2441
- z,
2442
+ B,
2442
2443
  aa,
2443
- bo
2444
+ xo
2444
2445
  ]);
2445
- let dl = O(at);
2446
- E(() => {
2447
- let e = ct(dl.current, {
2448
- activeConversationId: z,
2449
- chatTurnCount: Zs.length,
2450
- voiceTurnCount: sc.length,
2446
+ let fl = k(at);
2447
+ D(() => {
2448
+ let e = ct(fl.current, {
2449
+ activeConversationId: B,
2450
+ chatTurnCount: Qs.length,
2451
+ voiceTurnCount: cc.length,
2451
2452
  sessionLive: $.active,
2452
- sessionBoundTo: _o.current,
2453
+ sessionBoundTo: vo.current,
2453
2454
  turnInFlight: Da
2454
2455
  });
2455
- dl.current = e.state, e.open && go(!0);
2456
+ fl.current = e.state, e.open && _o(!0);
2456
2457
  }, [
2457
- z,
2458
- Zs.length,
2459
- sc.length,
2458
+ B,
2459
+ Qs.length,
2460
+ cc.length,
2460
2461
  $.active,
2461
2462
  Da,
2462
- go
2463
- ]), E(() => {
2463
+ _o
2464
+ ]), D(() => {
2464
2465
  if (!$.active) {
2465
- uc.current.clear(), fc(null), zo.current = null;
2466
- for (let e of mc.current) window.clearInterval(e);
2467
- mc.current.clear();
2466
+ dc.current.clear(), pc(null), Bo.current = null;
2467
+ for (let e of hc.current) window.clearInterval(e);
2468
+ hc.current.clear();
2468
2469
  }
2469
- }, [$.active]), E(() => {
2470
- let e = mc.current;
2470
+ }, [$.active]), D(() => {
2471
+ let e = hc.current;
2471
2472
  return () => {
2472
2473
  for (let t of e) window.clearInterval(t);
2473
2474
  e.clear();
2474
2475
  };
2475
- }, []), E(() => {
2476
+ }, []), D(() => {
2476
2477
  let e = v.getState().consumePendingPrompt();
2477
- return e && Js.current(e), v.subscribe((e, t) => {
2478
+ return e && Ys.current(e), v.subscribe((e, t) => {
2478
2479
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
2479
2480
  let e = v.getState().consumePendingPrompt();
2480
- e && Js.current(e);
2481
+ e && Ys.current(e);
2481
2482
  }
2482
2483
  });
2483
2484
  }, []);
2484
- let fl = T((e) => {
2485
- let t = z ? v.getState().conversations.find((e) => e.id === z) : void 0;
2486
- if (t && t.mode !== e && W.withdraw(t.id, "mode_switched"), t && Jn(t)) {
2485
+ let pl = E((e) => {
2486
+ let t = B ? v.getState().conversations.find((e) => e.id === B) : void 0;
2487
+ if (t && t.mode !== e && G.withdraw(t.id, "mode_switched"), t && Xn(t)) {
2487
2488
  if (t.mode !== e) {
2488
- let t = ie(), n = v.getState().conversations.find((n) => n.mode === e && Zn(n, t) && !v.getState().processingByConversationId[n.id]);
2489
+ let t = ie(), n = v.getState().conversations.find((n) => n.mode === e && $n(n, t) && !v.getState().processingByConversationId[n.id]);
2489
2490
  n ? la(n.id) : ua(void 0, e);
2490
2491
  }
2491
- } else z && ca(z, e);
2492
+ } else B && ca(B, e);
2492
2493
  let n = v.getState().activeConversationId;
2493
2494
  n ? ca(n, e) : Ca(!1), sa(e);
2494
2495
  }, [
2495
- z,
2496
+ B,
2496
2497
  ua,
2497
2498
  la,
2498
2499
  Ca,
2499
2500
  ca,
2500
2501
  sa,
2501
- W
2502
- ]), pl = T(() => {
2502
+ G
2503
+ ]), ml = E(() => {
2503
2504
  let e = v.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
2504
2505
  if (!t) {
2505
2506
  Ca(!0), sa(p);
@@ -2509,12 +2510,12 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2509
2510
  Ca(!0);
2510
2511
  return;
2511
2512
  }
2512
- if (!Jn(t)) {
2513
+ if (!Xn(t)) {
2513
2514
  wa(t.id, p);
2514
2515
  return;
2515
2516
  }
2516
- W.withdraw(t.id, "mode_switched");
2517
- let n = ie(), r = e.conversations.find((t) => t.routedBy === "auto" && Zn(t, n) && !e.processingByConversationId[t.id]);
2517
+ G.withdraw(t.id, "mode_switched");
2518
+ let n = ie(), r = e.conversations.find((t) => t.routedBy === "auto" && $n(t, n) && !e.processingByConversationId[t.id]);
2518
2519
  r ? (la(r.id), wa(r.id, p)) : ua(void 0, p, { routedBy: "auto" });
2519
2520
  }, [
2520
2521
  ua,
@@ -2522,14 +2523,14 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2522
2523
  la,
2523
2524
  Ca,
2524
2525
  sa,
2525
- W
2526
- ]), ml = T((e) => {
2527
- if (P.find((t) => t.id === e)?.writeCapable && !de(v.getState().acknowledgedWriteModes, e)) {
2526
+ G
2527
+ ]), hl = E((e) => {
2528
+ if (F.find((t) => t.id === e)?.writeCapable && !de(v.getState().acknowledgedWriteModes, e)) {
2528
2529
  co(e);
2529
2530
  return;
2530
2531
  }
2531
- fl(e);
2532
- }, [fl, P]), hl = T(() => {
2532
+ pl(e);
2533
+ }, [pl, F]), gl = E(() => {
2533
2534
  let e = so;
2534
2535
  if (co(null), !e) return;
2535
2536
  let t = no.current;
@@ -2537,13 +2538,13 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2537
2538
  xa(e), Q(t.content, t.attachments, t.options);
2538
2539
  return;
2539
2540
  }
2540
- xa(e), fl(e);
2541
+ xa(e), pl(e);
2541
2542
  }, [
2542
2543
  so,
2543
2544
  xa,
2544
- fl,
2545
+ pl,
2545
2546
  Q
2546
- ]), gl = so === null ? void 0 : P.find((e) => e.id === so) ?? { id: so }, _l = T(() => {
2547
+ ]), _l = so === null ? void 0 : F.find((e) => e.id === so) ?? { id: so }, vl = E(() => {
2547
2548
  co(null);
2548
2549
  let e = no.current;
2549
2550
  no.current = null, e && Q(e.content, e.attachments, {
@@ -2557,104 +2558,110 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2557
2558
  /* @__PURE__ */ Oi("div", {
2558
2559
  className: "contents",
2559
2560
  inert: $.active || K || void 0,
2560
- ...G.ids ? {
2561
+ ...po.ids ? {
2561
2562
  role: "tabpanel",
2562
- id: G.ids.chatPanel,
2563
- "aria-labelledby": G.ids.chatTab
2563
+ id: po.ids.chatPanel,
2564
+ "aria-labelledby": po.ids.chatTab
2564
2565
  } : {},
2565
2566
  children: [
2566
- Ua === null ? null : /* @__PURE__ */ A(Hn, { onDismiss: () => Ha(Ua) }),
2567
- sc.length > 0 && !$.active ? /* @__PURE__ */ A(Bn, {
2568
- count: sc.length,
2569
- onOpenTranscript: () => go(!0)
2567
+ Ua === null ? null : /* @__PURE__ */ j(Wn, { onDismiss: () => Ha(Ua) }),
2568
+ cc.length > 0 && !$.active ? /* @__PURE__ */ j(Hn, {
2569
+ count: cc.length,
2570
+ onOpenTranscript: () => _o(!0)
2570
2571
  }) : null,
2571
- Zs.length === 0 && (Ra || za) ? /* @__PURE__ */ A(Un, {
2572
+ Qs.length === 0 && (Ra || za) ? /* @__PURE__ */ j(Gn, {
2572
2573
  state: Ra ? "loading" : "failed",
2573
2574
  onRetry: Ja
2574
- }) : Zs.length === 0 && H?.sync?.hasOlder ? /* @__PURE__ */ A("div", {
2575
+ }) : Qs.length === 0 && U?.sync?.hasOlder ? /* @__PURE__ */ j("div", {
2575
2576
  className: "flex min-h-0 flex-1 flex-col",
2576
- children: /* @__PURE__ */ A(Gn, {
2577
+ children: /* @__PURE__ */ j(qn, {
2577
2578
  onShowEarlier: Ya,
2578
2579
  disabled: Ra
2579
2580
  })
2580
- }) : Zs.length === 0 ? /* @__PURE__ */ A(er, {
2581
- mode: B,
2582
- onSuggestionClick: Gs,
2581
+ }) : Qs.length === 0 ? /* @__PURE__ */ j(nr, {
2582
+ mode: V,
2583
+ onSuggestionClick: Ks,
2583
2584
  explainsAuto: eo,
2584
- suggestions: eo && B === "assistant" ? ee(P.find((e) => e.id === "assistant")?.suggestions ?? [], P.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2585
+ suggestions: eo && V === "assistant" ? ee(F.find((e) => e.id === "assistant")?.suggestions ?? [], F.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
2585
2586
  }) : /* @__PURE__ */ Oi("div", {
2586
2587
  className: "flex min-h-0 flex-1 flex-col",
2587
- children: [H?.sync?.hasOlder ? /* @__PURE__ */ A(Gn, {
2588
+ children: [U?.sync?.hasOlder ? /* @__PURE__ */ j(qn, {
2588
2589
  onShowEarlier: Ya,
2589
2590
  disabled: Ra
2590
- }) : null, /* @__PURE__ */ A(fr, {
2591
- onApprovePendingWrite: Uo,
2592
- approvingWriteRef: Fo,
2593
- approvableMessageId: $s?.messageId ?? null,
2594
- retryableMessageId: ec,
2595
- messages: Zs,
2596
- processing: U ?? null,
2591
+ }) : null, /* @__PURE__ */ j(mr, {
2592
+ onApprovePendingWrite: Wo,
2593
+ approvingWriteRef: Io,
2594
+ approvableMessageId: ec?.messageId ?? null,
2595
+ retryableMessageId: tc,
2596
+ messages: Qs,
2597
+ processing: W ?? null,
2597
2598
  streamingMessageId: Oa,
2598
2599
  failedMessageId: ka,
2599
- onRetry: Fo === null ? qs : void 0,
2600
- renderWriteProposals: nc,
2601
- hidesLegacyWriteCard: tc,
2602
- renderUiOffers: ic
2600
+ onRetry: Io === null ? Js : void 0,
2601
+ renderWriteProposals: rc,
2602
+ hidesLegacyWriteCard: nc,
2603
+ renderUiOffers: ac
2603
2604
  })]
2604
2605
  }),
2605
- Ia ? /* @__PURE__ */ A(Wn, { onStartNew: () => ua() }) : null,
2606
- La && z ? /* @__PURE__ */ A(Vn, { onUnarchive: () => $n.updateConversation(z, { archived: !1 }) }) : null,
2607
- zs === null ? null : /* @__PURE__ */ A(tr, {
2608
- tr: M,
2609
- onDismiss: () => Bs(null)
2606
+ Ia ? /* @__PURE__ */ j(Kn, { onStartNew: () => ua() }) : null,
2607
+ La && B ? /* @__PURE__ */ j(Un, { onUnarchive: () => tr.updateConversation(B, { archived: !1 }) }) : null,
2608
+ Bs === null ? null : /* @__PURE__ */ j(rr, {
2609
+ tr: N,
2610
+ onDismiss: () => Vs(null)
2610
2611
  }),
2611
- Zs.length > 0 && (Ra || za) ? /* @__PURE__ */ A(Un, {
2612
+ Qs.length > 0 && (Ra || za) ? /* @__PURE__ */ j(Gn, {
2612
2613
  state: Ra ? "loading" : "failed",
2613
2614
  onRetry: Ja,
2614
2615
  compact: !0
2615
2616
  }) : null,
2616
- /* @__PURE__ */ A(yi, {
2617
- onStartVoiceSession: $.available && Do ? Ic : void 0,
2617
+ /* @__PURE__ */ j(yi, {
2618
+ onStartVoiceSession: $.available && Oo ? Lc : void 0,
2618
2619
  onSend: (e, t) => void Q(e, t, { fromPerson: !0 }),
2619
- onDraftChange: Ns,
2620
- disabled: Da || Fo !== null || Ra || us,
2620
+ onDraftChange: Ps,
2621
+ disabled: Da || Io !== null || Ra || ds,
2621
2622
  readOnly: Ia,
2622
- placeholder: B === "api-calls" ? M("chatArea.placeholderActions", "What would you like me to do?") : M("chatArea.placeholderGeneral", "Ask me anything…"),
2623
- mode: B,
2624
- writeAccessDenied: Bi === "denied" && !!wo?.writeCapable,
2623
+ placeholder: V === "api-calls" ? N("chatArea.placeholderActions", "What would you like me to do?") : N("chatArea.placeholderGeneral", "Ask me anything…"),
2624
+ mode: V,
2625
+ writeAccessDenied: Bi === "denied" && !!To?.writeCapable,
2625
2626
  availableModes: Qa,
2626
2627
  attachmentCharsPerFile: oo,
2627
- onModeChange: ml,
2628
+ onModeChange: hl,
2628
2629
  auto: $a ? {
2629
2630
  active: eo,
2630
- onSelect: pl
2631
+ onSelect: ml
2631
2632
  } : void 0,
2632
2633
  suspendDictation: K,
2633
- onVoiceStateChange: G.ids ? Wc : void 0
2634
+ onVoiceStateChange: po.ids ? Gc : void 0
2635
+ }),
2636
+ /* @__PURE__ */ j(Nn, {
2637
+ productKey: P,
2638
+ enabled: !!Wi,
2639
+ className: "px-3 pt-1 text-center",
2640
+ testId: "assistant-ai-credit-balance"
2634
2641
  }),
2635
- /* @__PURE__ */ A(kn, { className: "px-3 pb-2 pt-1" })
2642
+ /* @__PURE__ */ j(On, { className: "px-3 pb-2 pt-1" })
2636
2643
  ]
2637
2644
  }),
2638
- fo && !$.active ? /* @__PURE__ */ A(Kn, {
2639
- turns: sc,
2640
- onClose: () => go(!1),
2641
- onSave: cc,
2642
- onContinueInChat: zc ? Bc : void 0,
2645
+ fo && !$.active ? /* @__PURE__ */ j(Jn, {
2646
+ turns: cc,
2647
+ onClose: () => _o(!1),
2648
+ onSave: lc,
2649
+ onContinueInChat: Bc ? Vc : void 0,
2643
2650
  closeOnEscape: !0,
2644
- onShowEarlier: H?.sync?.hasOlder ? Ya : void 0,
2651
+ onShowEarlier: U?.sync?.hasOlder ? Ya : void 0,
2645
2652
  showEarlierDisabled: Ra,
2646
- renderAfterTurn: rc
2653
+ renderAfterTurn: ic
2647
2654
  }) : null,
2648
- K && po && G.ids ? /* @__PURE__ */ A(xr, {
2649
- tab: po,
2650
- id: G.ids.avatarPanel,
2651
- labelledBy: G.ids.avatarTab,
2652
- leaveHintId: G.ids.leaveHint,
2653
- shown: tl,
2654
- voice: Qc,
2655
- ...nl ? { ask: cl } : {}
2655
+ K && mo && po.ids ? /* @__PURE__ */ j(Cr, {
2656
+ tab: mo,
2657
+ id: po.ids.avatarPanel,
2658
+ labelledBy: po.ids.avatarTab,
2659
+ leaveHintId: po.ids.leaveHint,
2660
+ shown: nl,
2661
+ voice: $c,
2662
+ ...rl ? { ask: ll } : {}
2656
2663
  }) : null,
2657
- $.active && /* @__PURE__ */ A(mr, {
2664
+ $.active && /* @__PURE__ */ j(gr, {
2658
2665
  session: $.session,
2659
2666
  notice: $.notice,
2660
2667
  privacyNotice: $.handsFree.privacyNotice,
@@ -2665,47 +2672,47 @@ var Li = () => () => {}, Ri = () => "off", zi = ({ visible: zi = !0, writeAccess
2665
2672
  correcting: $.correcting,
2666
2673
  onLetMeFinish: $.letMeFinish,
2667
2674
  onImDone: $.imDone,
2668
- turns: gc,
2675
+ turns: _c,
2669
2676
  spokenChunks: $.spokenChunks,
2670
- attachments: lc.attachments,
2671
- onAttachFiles: lc.addFiles,
2672
- onRemoveAttachment: lc.remove,
2673
- onRetryAttachment: lc.retry,
2674
- canAttachMore: lc.canAddMore,
2675
- preparingAttachments: lc.preparingCount,
2676
- attachmentsLocked: lc.isCommitting,
2677
- attachmentNotice: pc,
2678
- onSaveTranscript: cc,
2679
- onContinueInChat: Bc,
2677
+ attachments: uc.attachments,
2678
+ onAttachFiles: uc.addFiles,
2679
+ onRemoveAttachment: uc.remove,
2680
+ onRetryAttachment: uc.retry,
2681
+ canAttachMore: uc.canAddMore,
2682
+ preparingAttachments: uc.preparingCount,
2683
+ attachmentsLocked: uc.isCommitting,
2684
+ attachmentNotice: mc,
2685
+ onSaveTranscript: lc,
2686
+ onContinueInChat: Vc,
2680
2687
  onInterrupt: () => {
2681
- $.interrupt(), Vo();
2688
+ $.interrupt(), Ho();
2682
2689
  },
2683
- spoken: Xs,
2690
+ spoken: Zs,
2684
2691
  onToggleMute: $.toggleMute,
2685
- onEnd: Hc,
2686
- proposalChip: wc ? {
2687
- label: St(wc, M),
2688
- onOpen: Cc
2692
+ onEnd: Uc,
2693
+ proposalChip: Tc ? {
2694
+ label: St(Tc, N),
2695
+ onOpen: wc
2689
2696
  } : null,
2690
- proposalTray: Ec,
2691
- renderAfterTurn: rc,
2692
- onViewChange: G.ids ? el : void 0
2697
+ proposalTray: Dc,
2698
+ renderAfterTurn: ic,
2699
+ onViewChange: po.ids ? tl : void 0
2693
2700
  }),
2694
- /* @__PURE__ */ A(xi, {
2701
+ /* @__PURE__ */ j(xi, {
2695
2702
  open: so !== null,
2696
- mode: gl,
2697
- currentMode: wo ?? { id: B },
2698
- onConfirm: hl,
2699
- onCancel: _l
2703
+ mode: _l,
2704
+ currentMode: To ?? { id: V },
2705
+ onConfirm: gl,
2706
+ onCancel: vl
2700
2707
  }),
2701
- /* @__PURE__ */ A(Mn, {
2708
+ /* @__PURE__ */ j(Pn, {
2702
2709
  ...Na.dialog,
2703
- view: ac?.view ?? Na.dialog.view,
2704
- serverNow: ac?.serverNow ?? NaN,
2705
- arrivedAt: ac?.arrivedAt ?? NaN,
2706
- capabilities: ac ? Aa[ac.session.sandboxId] : null,
2710
+ view: oc?.view ?? Na.dialog.view,
2711
+ serverNow: oc?.serverNow ?? NaN,
2712
+ arrivedAt: oc?.arrivedAt ?? NaN,
2713
+ capabilities: oc ? Aa[oc.session.sandboxId] : null,
2707
2714
  turnInFlight: Da,
2708
- tr: M
2715
+ tr: N
2709
2716
  })
2710
2717
  ]
2711
2718
  });