@arbidocs/blocks 0.5.43 → 0.5.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +14 -0
  2. package/dist/agents/definitions/agentTasks.d.ts +4 -0
  3. package/dist/agents/definitions/index.d.ts +1 -0
  4. package/dist/agents/index.cjs +14 -10
  5. package/dist/agents/index.js +1 -1
  6. package/dist/calls/index.cjs +73 -696
  7. package/dist/calls/index.cjs.map +1 -1
  8. package/dist/calls/index.js +10 -666
  9. package/dist/calls/index.js.map +1 -1
  10. package/dist/{chunk-6AJJJ5HR.cjs → chunk-5R256EMF.cjs} +671 -3
  11. package/dist/chunk-5R256EMF.cjs.map +1 -0
  12. package/dist/{chunk-E3IEZMRK.cjs → chunk-ET42AFEJ.cjs} +15 -2
  13. package/dist/chunk-ET42AFEJ.cjs.map +1 -0
  14. package/dist/{chunk-FOIDBAZB.js → chunk-OQMWTEM2.js} +15 -3
  15. package/dist/chunk-OQMWTEM2.js.map +1 -0
  16. package/dist/{chunk-4U4NXFV5.js → chunk-TKTNXFAB.js} +666 -9
  17. package/dist/chunk-TKTNXFAB.js.map +1 -0
  18. package/dist/connect/index.cjs +1736 -482
  19. package/dist/connect/index.cjs.map +1 -1
  20. package/dist/connect/index.d.ts +2 -0
  21. package/dist/connect/index.js +1729 -479
  22. package/dist/connect/index.js.map +1 -1
  23. package/dist/connection/ConnectedFilterDropdown.d.ts +6 -0
  24. package/dist/connection/agents/useConnectedAgentManagement.d.ts +60 -0
  25. package/dist/connection/conversation/ConnectedConversation.d.ts +7 -9
  26. package/dist/connection/conversation/ConnectedConversationPage.d.ts +30 -0
  27. package/dist/connection/conversation/SemanticSearchButton.d.ts +12 -0
  28. package/dist/connection/files/imports/ConnectedAccountsImport.d.ts +16 -0
  29. package/dist/connection/files/imports/DriveImportPanel.d.ts +10 -0
  30. package/dist/connection/files/imports/EmailImportPanel.d.ts +21 -0
  31. package/dist/connection/files/imports/ImportHandoff.d.ts +24 -0
  32. package/dist/connection/files/imports/useDriveSyncTrigger.d.ts +11 -0
  33. package/dist/connection/files/imports/useEmailSyncTrigger.d.ts +11 -0
  34. package/dist/connection/files/imports/useImportHandoff.d.ts +20 -0
  35. package/dist/connection/files/index.d.ts +1 -0
  36. package/dist/index.cjs +14 -10
  37. package/dist/index.js +1 -1
  38. package/dist/workflow-canvas/index.cjs +2 -2
  39. package/dist/workflow-canvas/index.js +1 -1
  40. package/node_modules/@arbidocs/coedit/package.json +1 -1
  41. package/package.json +5 -5
  42. package/dist/chunk-4U4NXFV5.js.map +0 -1
  43. package/dist/chunk-6AJJJ5HR.cjs.map +0 -1
  44. package/dist/chunk-E3IEZMRK.cjs.map +0 -1
  45. package/dist/chunk-FOIDBAZB.js.map +0 -1
@@ -14,7 +14,7 @@ import { useConnectedWorkspaceRole, ConnectedWorkflowLauncher, useConnectedWorkf
14
14
  export { ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useDocxCommentTarget, useNativeDocxSupport } from '../chunk-REHG7VRQ.js';
15
15
  import { ConnectedMarkdown, InternalDocLink, ExternalLink, DocumentWorkspaceContext } from '../chunk-4DDPMLGU.js';
16
16
  export { ConnectedDocumentToolsProvider, ConnectedMarkdown, DocumentChip, DocumentWorkspaceContext, ExternalLink, InternalDocLink, MailChip, MermaidDiagram, WorkspaceDocumentReference, useDocumentViewerSupport, useDocumentWorkspace, useViewerDraftDocument, useViewerIsDetached, useViewerPassageCitation, useViewerStreamingDocument } from '../chunk-4DDPMLGU.js';
17
- import { ExplorerFileTile, formatFolderSegment, hasFolderProviderIcon, FolderProviderIcon, ExplorerFolderTile, StatusPill, FailedStageIcon, DocumentNameCellFrame, DocumentRowMenu, visibilityToggleTooltip, FolderCell, FolderCommandList, RelatedDocsCell, FilterButton, DOCUMENTS_ROW_HEIGHT_INITIAL, searchExplorerDocuments, buildExplorerEntries, collectFolderDocs, joinFolderPath, getExplorerDisplayName, RECENTLY_DELETED_HINT, RECENTLY_DELETED_HINT_PLURAL, canDeleteDocument, ExplorerFrame, ExplorerStage, ExplorerScroller, ExplorerLoadingTiles, ExplorerEmpty, ExplorerMarquee, ExplorerDropOverlay, ExplorerDragPreview, CheckboxCell, TagColumnHeader, ExplorerFileTooltip, visibilityAudience, TagFormRoot, TagFormNameField, TagFormSelectField, TagFormNote, TagFormOptionsEditor, TagFormInstructionField, TagFormMeta, TagFormFooter, TagFormSharedToggle, FilesViewCenter, FilesFilterBar, TransferProgressView, TransferResumeBanner, ExportResultsReport, TransferScopeChooser, TransferKindsPicker, TransferReferencesChooser, ExportMethodChooser, ExportWorkspacePicker, TransferConflictChooser, TransferPlanSummary, ExportFooter, ExportModalTitle, ROW_MIN, rowHeightForLines, linesForRowHeight, RowDensityControl, VendorLogo, FolderFilterButton, FolderPickerRow, UploadFrame, UploadContainer, SelectedFilesList, RejectedFilesList, UploadErrorMessage, UploadProgress, PrivacyExplainerModal, MultiSelectCellEditor, DOCUMENT_TYPE_OPTIONS, DEFAULT_DOCUMENT_COLUMNS, shareStateOf, BulkActionsBar, shareTooltipFor, parseFolderSegments, AiReviewDialogView, MoveToFolderDialog, sortFields, filterFieldsByName, fieldsApplyBarCopy, FieldsEditorRoot, FieldsEditorToolbar, FieldsEditorList, FieldRow, FieldsEmptyState, fieldsEmptyText, FieldsApplyBar, FieldsManagerDefinition, FieldsManagerBody, FieldsManagerTitle, BulkTagEditorDialog, BulkReplaceDialog, FieldValue, FieldFolderSelect, FieldFolderValue, FieldNativeSelect, FieldWithAttribution, EMAIL_VIEW_COLUMNS, useGridViews, ViewSelectorMenu, FilesAddMenu, applyColumnLayout, applyViewColumns, sortExplorerFiles, FilesPage, UrlInputDialog, FilesPageHeader, FilesToolbar, ExplorerFileNavigator, NavigatorPickerBar, FilesPageMain, DocumentGrid, resolveDocumentGridLayout, FilesModalFooter, BulkLabelSelectView, confirmHideFromMembers, DocumentsFolderButton, FilesTagsButton, UploadSourceSection, UploadSourcePicker, UploadBrowseButtons, canEditDocumentFields, FieldLabelsSelect, ShareToggle, FieldAttribution, UploadDropArea, canChangeVisibility, UploadUrlButton } from '../chunk-P6MVDOCL.js';
17
+ import { ExplorerFileTile, formatFolderSegment, hasFolderProviderIcon, FolderProviderIcon, ExplorerFolderTile, StatusPill, FailedStageIcon, DocumentNameCellFrame, DocumentRowMenu, visibilityToggleTooltip, FolderCell, FolderCommandList, RelatedDocsCell, FilterButton, DOCUMENTS_ROW_HEIGHT_INITIAL, searchExplorerDocuments, buildExplorerEntries, collectFolderDocs, joinFolderPath, getExplorerDisplayName, RECENTLY_DELETED_HINT, RECENTLY_DELETED_HINT_PLURAL, canDeleteDocument, ExplorerFrame, ExplorerStage, ExplorerScroller, ExplorerLoadingTiles, ExplorerEmpty, ExplorerMarquee, ExplorerDropOverlay, ExplorerDragPreview, CheckboxCell, TagColumnHeader, ExplorerFileTooltip, visibilityAudience, TagFormRoot, TagFormNameField, TagFormSelectField, TagFormNote, TagFormOptionsEditor, TagFormInstructionField, TagFormMeta, TagFormFooter, TagFormSharedToggle, FilesViewCenter, FilesFilterBar, TransferProgressView, TransferResumeBanner, ExportResultsReport, TransferScopeChooser, TransferKindsPicker, TransferReferencesChooser, ExportMethodChooser, ExportWorkspacePicker, TransferConflictChooser, TransferPlanSummary, ExportFooter, ExportModalTitle, ROW_MIN, rowHeightForLines, linesForRowHeight, RowDensityControl, VendorLogo, FolderFilterButton, FolderPickerRow, UploadFrame, UploadContainer, SelectedFilesList, RejectedFilesList, UploadErrorMessage, UploadProgress, PrivacyExplainerModal, MultiSelectCellEditor, DOCUMENT_TYPE_OPTIONS, DEFAULT_DOCUMENT_COLUMNS, shareStateOf, BulkActionsBar, shareTooltipFor, parseFolderSegments, AiReviewDialogView, MoveToFolderDialog, sortFields, filterFieldsByName, fieldsApplyBarCopy, FieldsEditorRoot, FieldsEditorToolbar, FieldsEditorList, FieldRow, FieldsEmptyState, fieldsEmptyText, FieldsApplyBar, FieldsManagerDefinition, FieldsManagerBody, FieldsManagerTitle, BulkTagEditorDialog, BulkReplaceDialog, FieldValue, FieldFolderSelect, FieldFolderValue, FieldNativeSelect, FieldWithAttribution, EMAIL_VIEW_COLUMNS, useGridViews, ViewSelectorMenu, FilesAddMenu, applyColumnLayout, applyViewColumns, sortExplorerFiles, FilesPage, UrlInputDialog, FilesPageHeader, FilesToolbar, ExplorerFileNavigator, NavigatorPickerBar, FilesPageMain, DocumentGrid, resolveDocumentGridLayout, FilesModalFooter, BulkLabelSelectView, confirmHideFromMembers, DocumentsFolderButton, FilesTagsButton, UploadSourceSection, UploadSourcePicker, UploadBrowseButtons, canEditDocumentFields, FieldLabelsSelect, ShareToggle, FieldAttribution, ImportPanel, ImportFamilySection, ImportList, ImportRow, UploadDropArea, canChangeVisibility, ImportSummary, ImportAside, FolderSummary, ImportProgress, ImportRunActions, ImportHint, ImportActionButton, UploadUrlButton } from '../chunk-P6MVDOCL.js';
18
18
  import { ViewToggle, DocumentViewToggle } from '../chunk-JJA6GQKH.js';
19
19
  import { ModalBreadcrumbHeader, ModalCrumbs } from '../chunk-RC6VTY2H.js';
20
20
  import { DatabaseList, NewDatabaseDialog, DatabaseToolbar, DatabaseTable, DatabaseRowDetail, DatabaseColumnDialog, rowTitle, OPEN_ROW_COL_ID, ADD_COLUMN_COL_ID } from '../chunk-PTYERKEU.js';
@@ -45,7 +45,7 @@ import '../chunk-K4BGOPGG.js';
45
45
  import '../chunk-ZCOVDK2E.js';
46
46
  import { isDefinitionsLabel, DOCX_MIME_TYPE, toDefinitionSource, definitionLabels } from '../chunk-IYUKJESY.js';
47
47
  import { decodeWhitespaceEntities } from '../chunk-AF6RDAJF.js';
48
- import { EntityChip, StepTraceSummary, StepTrace, getCurrentAgentStepPresentation, AssistantEntity, ThreadActivity, SubAgentLane, getAgentStepPresentation, stepAccent, MODEL_TIER_ICON_MAP, StepRow, StepNarration, StepSummary, StepDetail, StepOutcome, StepParams, GoalCriteria, SubStepGroup, MODEL_TIER_LABELS, fromPlanSteps, latestMessageTime, isSupersededStop, compactThreadActivity, unnotifiedMentions, notifiedLabel, linkedRunsFromActivity, getModelIcon, SubagentRoster, buildLibrarySkills, filterLibrarySkills, SKILL_SOURCE_LABELS, SKILL_TYPE_LABELS, SkillViewToggle, SkillFilterChips, SkillTile, SkillGenerateForm, SkillLibraryDetail, parseSkillFrontmatter, SKILL_MAIN_FILENAME, SkillEditForm, DEFAULT_AGENT_CAPABILITIES, stripPersonaPreamble, AgentCreator, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TEMPLATES, AgentAvatarField, isValidAgentName, AgentConnectInstructions, TaskRunsDialog, TaskActivityDialog, WorkflowStepBar, ConsentPage, ConsentCard, ConsentHeader, ConsentNotice, ConsentSection, ConsentBulletList, ConsentStrong, ConsentText, ConfigForm, AgentEditView, AgentMainView, AgentCreatedView, AgentCreateView, GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO, taskComposerToCreateRequest, taskComposerToUpdateRequest, composerToWorkflowUpdate, deriveAnnotationName, ANNOTATE_ID, recordWorkflowUse, renderWorkflowIcon, useWorkflowUsage, WEB_WORKFLOWS, DASHBOARD_PINNED, CUSTOM_TASK, REMIND_TASK, DASHBOARD_OPERATIONS, sortByRecentUse, openWorkflowLaunch, useWorkflowLaunchRequest, WorkflowRunStatus, ThreadStatusLine, WorkflowThreadStrip, WorkflowStepAction, WorkflowThreadStartedBy, TaskFlow, moveTargets, workflowToComposerValues, REMIND_TASK_ID, CUSTOM_TASK_ID, taskToComposerValues, TaskComposer, AUTOMATION_EVENTS, TaskPlan, TaskStartDialog, ThreadLauncher, NewThreadDialog, AgentBar, AgentBarNotes, AgentBarQueuedNote, AgentBarProbeAnswer, BUILTIN_SKILLS, TaskEmptyState, ConsentMessage, CopyableUrl, ConsentPermissionList, ConsentActions, ConsentFootnote, ConversationListView, ConversationTurnSpeaker, TaskInbox, AgentBarStatus, AgentBarIconButton, AgentBarMenu, composePersona, newThreadToRequest, importSkillFile, importSkillFromUrl, WorkflowRunner, skillSlug, serializeSkill, toPlanSteps, useWorkflowView, STATUS_LABELS, asTaskStatus, workflowToSkillMarkdown, closeWorkflowLaunch } from '../chunk-YAGSGBVM.js';
48
+ import { EntityChip, StepTraceSummary, StepTrace, getCurrentAgentStepPresentation, AssistantEntity, ThreadActivity, SubAgentLane, getAgentStepPresentation, stepAccent, MODEL_TIER_ICON_MAP, StepRow, StepNarration, StepSummary, StepDetail, StepOutcome, StepParams, GoalCriteria, SubStepGroup, MODEL_TIER_LABELS, fromPlanSteps, latestMessageTime, isSupersededStop, compactThreadActivity, unnotifiedMentions, notifiedLabel, linkedRunsFromActivity, getModelIcon, SubagentRoster, buildLibrarySkills, filterLibrarySkills, SKILL_SOURCE_LABELS, SKILL_TYPE_LABELS, SkillViewToggle, SkillFilterChips, SkillTile, SkillGenerateForm, SkillLibraryDetail, parseSkillFrontmatter, SKILL_MAIN_FILENAME, SkillEditForm, DEFAULT_AGENT_CAPABILITIES, stripPersonaPreamble, AgentCreator, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TEMPLATES, AgentAvatarField, isValidAgentName, AgentConnectInstructions, TaskRunsDialog, TaskActivityDialog, WorkflowStepBar, ConsentPage, ConsentCard, ConsentHeader, ConsentNotice, ConsentSection, ConsentBulletList, ConsentStrong, ConsentText, ConfigForm, AgentEditView, AgentMainView, AgentCreatedView, AgentCreateView, GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO, taskComposerToCreateRequest, taskComposerToUpdateRequest, composerToWorkflowUpdate, deriveAnnotationName, ANNOTATE_ID, recordWorkflowUse, renderWorkflowIcon, useWorkflowUsage, WEB_WORKFLOWS, DASHBOARD_PINNED, CUSTOM_TASK, REMIND_TASK, DASHBOARD_OPERATIONS, sortByRecentUse, openWorkflowLaunch, useWorkflowLaunchRequest, WorkflowRunStatus, ThreadStatusLine, WorkflowThreadStrip, WorkflowStepAction, WorkflowThreadStartedBy, TaskFlow, moveTargets, workflowToComposerValues, REMIND_TASK_ID, CUSTOM_TASK_ID, taskToComposerValues, TaskComposer, AUTOMATION_EVENTS, TaskPlan, TaskStartDialog, ThreadLauncher, NewThreadDialog, AgentBar, AgentBarNotes, AgentBarQueuedNote, AgentBarProbeAnswer, ConversationListView, ConversationTurnSpeaker, TaskInbox, ConsentMessage, CopyableUrl, ConsentPermissionList, ConsentActions, ConsentFootnote, AgentBarStatus, AgentBarIconButton, AgentBarMenu, composePersona, newThreadToRequest, importSkillFile, importSkillFromUrl, WorkflowRunner, skillSlug, serializeSkill, toPlanSteps, useWorkflowView, STATUS_LABELS, asTaskStatus, filterConversationRows, BUILTIN_SKILLS, TaskEmptyState, workflowToSkillMarkdown, closeWorkflowLaunch } from '../chunk-YAGSGBVM.js';
49
49
  import { MultiSelect } from '../chunk-CQCC7LE7.js';
50
50
  import { PersonPill, documentScopeLabels, matchWorkflowScope } from '../chunk-7CHI36EP.js';
51
51
  import { SectionLabel } from '../chunk-2C3I27VI.js';
@@ -63,8 +63,8 @@ import { PasswordStrengthInput } from '../chunk-P6OLZGQA.js';
63
63
  import { attendeeKey, upcomingOf, conferenceUrl, isWebinarConference, canJoinEvent, calendarToListItem, buildGridEvents, pendingCreateToGrid, newEventDraft, MiniMonth, CalendarList, CalendarGrid, printCalendar, EventDetails, ScopeDialog, CalendarFormDialog, ProposeTimeDialog, isCalendarAttachment, parseIcsInvite, formatEventWhen, groupSlotsByDay, publicBookingMessage, formatSlotRange, zoneOptions, buildTimeChangeRequest, eventToDraft, needsScope, validateDraft, CALENDAR_DEFAULT_LABELS, buildCreateBody, buildDeleteTarget, EventEditor, toSettingsValue, CalendarSettingsForm, describeCalendarError, normalizeFeedUrl, parseOverlayLink, isAllDayDraft, draftRangeUtc, freeBusyToRows, SchedulingAssistant, applySuggestion, toSuggestionViews, bookingLink, defaultRoomWindow, bookingToForm, emptyBookingForm, slugify, WeeklyHoursEditor, validateBookingForm, formToBookingBody, WEEKDAY_NAMES, formatBusy, buildEditRequest } from '../chunk-AWVGKHJT.js';
64
64
  import { detectTimeZone, utcToDate, formatPlainDate, formatInZone, safeZone, todayInZone, addDays, listTimeZones, wallToUtc } from '../chunk-OJIX5NBN.js';
65
65
  import { DocumentPicker } from '../chunk-WNDIVNPT.js';
66
- import { useTranscriptRuns, TranscriptEntry, ThreadCallLogCard, RecordingCard, useMeetingThreadMessages, threadTranscriptRuns, useProvisionalSpeakers, TranscriptRunsContext, ProvisionalSpeakers, CallConversationEmpty } from '../chunk-4U4NXFV5.js';
67
- export { useMeetingThreadMessages } from '../chunk-4U4NXFV5.js';
66
+ import { useTranscriptRuns, TranscriptEntry, ThreadCallLogCard, RecordingCard, ConnectedConversationCallActions, useMeetingThreadMessages, threadTranscriptRuns, useProvisionalSpeakers, TranscriptRunsContext, ProvisionalSpeakers, CallConversationEmpty } from '../chunk-TKTNXFAB.js';
67
+ export { useMeetingThreadMessages } from '../chunk-TKTNXFAB.js';
68
68
  import { parseCallLogDetail } from '../chunk-S3YRRD54.js';
69
69
  import { useDocumentFilter, useConnectedTags, useConnectedDocuments, useConnectedConversations, useListedDocuments, listedDocuments } from '../chunk-SYP2A4GQ.js';
70
70
  export { isListedDocument, useConnectedConversations, useConnectedDocuments, useConnectedTags, useDocumentFilter, useListedDocuments } from '../chunk-SYP2A4GQ.js';
@@ -74,8 +74,8 @@ import { DmThreadHeader, DmInviteChip } from '../chunk-2S3LT5KE.js';
74
74
  import { useHost, ArbiHost } from '../chunk-ILBBV2ZY.js';
75
75
  import { TabHeader } from '../chunk-ABEKUV6L.js';
76
76
  import { EmptyState } from '../chunk-P6GHJSLR.js';
77
- import { useLongPaste, useRecipientDraft, SlashMenu, ContextUsageBar, findMessageDocument, getParticipantTints, flashMessage, parseSlashTokenInProgress, buildSlashItems, filterSlashItems, copyMessageToClipboard, BranchControls, ThreadVisualizer, downloadTableAsCsv, useOpenCitation, ModelAutoIcon, ModelTierIcon, ModelDot, ModelPricingTip, ModelPickerPopover, ModelOption, ModelMenuDivider, ModelTierOption, ModelConfigureButton, ModelMenuMessage, ModelPickerTrigger, ModelTriggerContent, ModelOptionLabel, ConversationBody, ConversationMain, ConversationLoading, PendingAnswerBar, ComposerTools, PaModeBadge, ComposerAccessories, DraftingDocChip, groupOutputsByConversation, ConversationSearchView } from '../chunk-SEZEEHLU.js';
78
- import { ComposerSend, ComposerVoiceButton, Composer, MessageActionMenu, MessageActionButton, MessageFooter, MessageRoot, MessageContent, MessageAuthor, MessageBubble, MessageByline, MessageSubagentBadge, MessageBody, MessageNarration, useStreamAnnouncement, MessageList, WorkflowStepChip, MessageSources, ChatPage, ConversationEmpty, MessageAlert, ComposerDock, ComposerContainer, ScrollToBottom } from '../chunk-AL7EXOX5.js';
77
+ import { useLongPaste, useRecipientDraft, SlashMenu, ContextUsageBar, findMessageDocument, getParticipantTints, flashMessage, parseSlashTokenInProgress, buildSlashItems, filterSlashItems, copyMessageToClipboard, BranchControls, ThreadVisualizer, downloadTableAsCsv, useOpenCitation, ModelAutoIcon, ModelTierIcon, ModelDot, ModelPricingTip, ModelPickerPopover, ModelOption, ModelMenuDivider, ModelTierOption, ModelConfigureButton, ModelMenuMessage, ModelPickerTrigger, ModelTriggerContent, ModelOptionLabel, groupOutputsByConversation, ConversationSearchView, ConversationRoot, ConversationHeader, ConversationHeaderActions, NewChatButton, NewPaChatButton, ConversationSettingsButton, ConversationHistoryPane, ConversationBody, ConversationMain, ConversationLoading, PendingAnswerBar, ComposerTools, PaModeBadge, ComposerAccessories, DraftingDocChip } from '../chunk-SEZEEHLU.js';
78
+ import { ComposerSend, ComposerVoiceButton, Composer, MessageActionMenu, MessageActionButton, MessageFooter, MessageRoot, MessageContent, MessageAuthor, MessageBubble, MessageByline, MessageSubagentBadge, MessageBody, MessageNarration, useStreamAnnouncement, MessageList, WorkflowStepChip, MessageSources, ChatPage, ConversationEmpty, MessageAlert, ComposerContainer, ComposerDock, ScrollToBottom } from '../chunk-AL7EXOX5.js';
79
79
  import { workspaceDocIdFromHref } from '../chunk-DDCMLHXF.js';
80
80
  import { PageContainer, Shell } from '../chunk-7XF5SFJ2.js';
81
81
  import { useMentionAutocomplete, stepStatesFromActivity, stepDocuments, splitDocRef, stepPhase, stepKindOf, STEP_KIND_ICONS, stepLevels, canAssign, assigneeName, runFieldsOf, initialRunInputs, workflowSteps, runThreadTitle, stepFields } from '../chunk-THNTNAYI.js';
@@ -94,17 +94,17 @@ import { ModalSection, ModalHeader, ModalScaffold, ModalSectionTitle } from '../
94
94
  import '../chunk-7F6CBP3Z.js';
95
95
  import '../chunk-VUNV25KB.js';
96
96
  import { QueryClient, useQueryClient, QueryClientProvider } from '@tanstack/react-query';
97
- import { useWorkspaces, ArbiBotHeadIcon, IN_FLIGHT_DOCUMENT_STATUSES, useOfflineDocumentIds, useOpenViewerDocumentId, FINISHED_DOCUMENT_STATUSES, useMailPolicy, useProcessingTasks, resolveDocumentStatus, useArbi, useIsCreatingTag, useUpdateDocuments, useDeleteDocuments, useRenameFolder, useDownloadDocuments, useTags, useDocumentHostActions, useDocumentThumbnails, HtmlIcon, useArbiSessionState, selectDraft, useArbiSessionStore, useAudioRecorder, MicRecordingOverlay, useArbiWsStatus, useArbiWsStore, useUserSettings, useProcessingTask, useDocumentPendingSync, useWorkspaceUsers, useMessageTimer, useDocuments, useAvailableModels, formatGbp, CitationRenderer, useArbiSession, buildMentionCandidates, useConversations, ASSISTANT_MENTION_LABEL, useConversationItems, useDeleteMessage, useArbiHost, transcriptSegmentOf, useConfig, useThinkingContent, useCreateFact, useCreateFacts, workflowStepOf, stripSpeakerPrefix, MessageArtifactCard, useConversationData, useBranchNavigation, useSkills, useBuiltinCommands, useDocumentsSupport, useConversationActivity, useMessageDetails, useWorkflows, getWorkspaceKind, resolveConfigModel, useRunConversation, useWorkspaceActivity, callLink, openCall, startDmCall, calendarQueryKeys, mailQueryKeys, arbiQueryKeys, invalidateConversationLists, isWorkspaceNotificationType, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useCallsEnabled, serverNotificationBellEntry, documentDisplayName, useArbiWebSocket, isNotificationRow, usePendingSyncItems, useCancelManyPendingSync, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, useSaveSkill, useSetSkillVisibility, useDeleteSkill, useSkillSource, useAgentModels, useMcpTools, useAgentConfig, useAgentWorkspaces, useCreateAgent, useSaveAgentConfig, useGrantAgentAccess, useRevokeAgentAccess, useGenerateAgentAvatar, useWorkflowRuns, useAgents, ArtifactCanvas, ConversationScope, useConversation, useTagKindSchema, useCreateTag, useSetTagValues, useUpdateTagKindSchema, useUpdateTag, useFacts, useDeleteTag, useExtractEntities, useEntityExtractionDocIds, useStartWorkspaceTransfer, useResumeWorkspaceTransfer, useCancelWorkspaceTransfer, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceExportDownload, usePlanWorkspaceTransfer, isTransferResumable, isTransferFinished, useShellWorkspaces, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailAccounts, useUpdateUserSettings, useDismissedTips, useConnectorVendorVisibility, useConnectorCatalog, useMyConnectors, useDisconnectConnector, useSlackConnection, useDisconnectSlack, isMailboxSyncVendor, isSharePointVendor, useWorkspaceTrash, useInvalidateStorage, useStorageActions, useStorageItems, useStorageItemNames, useStorageProjects, useUserUsageToday, useStorageSnapshots, useUpdateWorkspace, useAddWorkspaceMembers, useRemoveWorkspaceMembers, useSetWorkspaceMemberRoles, toShellWorkspace, useIsSlow, useProducts, useCreateProject, useDeleteProject, useCanCreateProjects, PROJECT_CREATION_DENIED_REASON, useEnableMailboxSync, useMailboxFolders, useEnableDriveSync, useDriveFolderChildren, connectorErrorStatus, useProjectInvoices, useProjects, useUpdateProjectFields, useChargeWatch, useAddonQuote, STILL_WORKING, useProjectBillingPortal, useProjectUsage, useRefreshProject, useBoxRole, useContacts, useInviteContacts, useDeleteWorkspaces, useCreateContact, useUpdateContact, useLinkContact, useEntitlements, useImportContacts, entitlementRefusal, useDeleteContact, MAX_RETRIEVE_DOC_IDS, useSemanticSearch, useAssignDocTags, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useCalendarEvents, useCalendars, useCanHostCalls, useOpenCallMeetingChat, usePeople, useFetchCalendarEvent, useCalendarSettings, useCalendarOverlays, useCalendarOutbox, useCalendarAccounts, useSyncAccountsOnOpen, useResumeCalendarAccountConnect, useCreateEvent, useUpdateEvent, useDeleteEvent, useMoveEvent, useRespondToEvent, useCreateCalendar, useUpdateCalendar, useDeleteCalendar, useImportCalendar, useSaveCalendarSettings, useRefreshCalendar, useCalendarEvent, useMailAttachmentText, useCalendarEventByUid, getPublicBookingPage, bookPublicSlot, PublicBookingError, isZipFile, prepareUploadFiles, UPLOAD_MAX_FILE_SIZE, filesFromDrop, UPLOAD_ACCEPT, useUploadFromUrls, useUploadFiles, useUpdateDocTag, useRemoveDocTags, useKeepDocumentsOffline, useRemoveDocumentsOffline, subscribeDocumentRows, useGenerateDocTags, useRefreshDocuments, useDocumentsLoading, selectViewingDocumentId, useRelatedDocuments, useDatabases, useCreateDatabase, useImportDatabase, myChatId, useChatThread, useChatPost, useDeleteChatMessage, useMarkChatRead, setOpenChat, useAgentDmStatus, annotateThread, userDisplayName, DmComposer, TypingIndicator, useRenameChat, useAddChatMembers, useRemoveChatMember, useChats, useChatSummaries, useCreateGroupChat, useChatArrivals, useApplyChatModel, AUTO_CHAT_MODEL, formatGbpPerMillionTokens, useConfigSchema, useSaveConfig, useConversationPendingAuth, openAccessRequest, useRequestWorkspaceAccess, useIsEntitled, ImageCropper, useCreateWork, useRunWorkflow, useStartTaskQuery, useCreateWorkflow, useUpdateConversation, useUpdateWorkflow, usePeopleSearch, threadTabId, useCanEditShared, useActOnStep, usePlanWork, useWorkItems, TaskThreadPendingError, useMentionCandidates, useAgentRunControl, useConnectRunStream, useAnswerAgentQuestion, useConversationIsShared, useWorkspaceRole, buildPendingFirstTurn, useConversationTurn, useAskAgain, getOrphanedLastMessage, refuseChatWhenOffline, useThreadDocument, useDocumentAutoAdd, useAutoSendDraft, READ_ONLY_MEETING_TEXT, useAgentSession, useStartAgentSession, useCloseAgentSession, downloadRecoveryFile, LinkedInIcon, GoogleIcon, AppleIcon, useCurrentUser, useTransientView, useDeleteConversation, useIsWorkspaceOwner, isQueuedCalendarWrite, DateSeparator, ChatBubble, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, connectorReturnTo, DmAvatar, ConversationList, GitHubIcon, cropImage, getRelatedTotal, isDeploymentUserNotification, describeServerNotification, getWorkspaceActionText, getWorkspaceSentPhrase, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_TITLE, documentActivityPhrase, isSignatureNotificationType, inputRequestTitle, WORK_NOTIFICATION_LABELS, useConversationThreads, usePassageQuotes, useUpdateFact, useDeleteFact, useAccountClient, usePlanQuote, useCreateProjectCheckout, useInvalidateProjects, useCreateWorkspace, useDriveFolderDocCount, useChangeProjectPlan, useCancelProjectSubscription, usePreviewProjectPlanChange, useAddProjectAddonBlock, useSwitchWorkspace, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, useCalendarInvitations, useDecideCounter, useSearchContacts, usePublishCalendar, useCalendarShares, useShareCalendar, useUnshareCalendar, useSubscribeCalendar, useHolidayCountries, useAddHolidayCalendar, cancelPublicBooking, useDatabase, useDatabaseRows, useUpdateDatabase, useDeleteDatabase, useAddDatabaseRows, useUpdateDatabaseRow, useDeleteDatabaseRows, useImportDatabaseRows, useExportDatabase, DATABASE_ROWS_PAGE, useInvalidateAfterTransfer, useConfigs, useSaveConfigField, useDeleteConfig, isFullConfig, useChatUnreadTotal, useUnreadByPeer, useMarkDocumentShared, useConversationSearch, useProjectConversationUsage, AiAnswer, ArbiWebSocketProvider, signatureNotificationPhrase, signatureRequestMeta, getNotificationTypeMeta, useMailDraftEditor, useFreeBusy, useFindTime, useCalendarSupport, useStartCalendarAccountOAuth, useConnectOAuthAccount, useBookingPages, useDeleteBookingPage, useRooms, useSearchDatabaseRows, isReplayableArbiMutation, SHAREPOINT_VENDORS, useUpdateProjectNextPeriodAddons, useUpdateProjectAddonSettings, useSyncCalendarAccount, useUpdateCalendarAccount, useDisconnectCalendarAccount, ACCOUNT_VENDOR, useCalDavProfiles, useConnectCalDavAccount, useSaveBookingPage, useCreateRoom } from '@arbidocs/react';
97
+ import { useWorkspaces, ArbiBotHeadIcon, IN_FLIGHT_DOCUMENT_STATUSES, useOfflineDocumentIds, useOpenViewerDocumentId, FINISHED_DOCUMENT_STATUSES, useMailPolicy, useProcessingTasks, resolveDocumentStatus, useArbi, useIsCreatingTag, useUpdateDocuments, useDeleteDocuments, useRenameFolder, useDownloadDocuments, useTags, useDocumentHostActions, useDocumentThumbnails, HtmlIcon, useArbiSessionState, selectDraft, useArbiSessionStore, useAudioRecorder, MicRecordingOverlay, useArbiWsStatus, useArbiWsStore, useUserSettings, useProcessingTask, useDocumentPendingSync, useWorkspaceUsers, useMessageTimer, useDocuments, useAvailableModels, formatGbp, CitationRenderer, useArbiSession, buildMentionCandidates, useConversations, ASSISTANT_MENTION_LABEL, useConversationItems, useDeleteMessage, useArbiHost, transcriptSegmentOf, useConfig, useThinkingContent, useCreateFact, useCreateFacts, workflowStepOf, stripSpeakerPrefix, MessageArtifactCard, useConversationData, useBranchNavigation, useSkills, useBuiltinCommands, useDocumentsSupport, useConversationActivity, useMessageDetails, useWorkflows, getWorkspaceKind, resolveConfigModel, useRunConversation, useWorkspaceActivity, callLink, openCall, startDmCall, calendarQueryKeys, mailQueryKeys, arbiQueryKeys, invalidateConversationLists, isWorkspaceNotificationType, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useCallsEnabled, serverNotificationBellEntry, documentDisplayName, useArbiWebSocket, isNotificationRow, usePendingSyncItems, useCancelManyPendingSync, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, useSaveSkill, useSetSkillVisibility, useDeleteSkill, useSkillSource, useAgentModels, useMcpTools, useAgentConfig, useAgentWorkspaces, useCreateAgent, useSaveAgentConfig, useGrantAgentAccess, useRevokeAgentAccess, useGenerateAgentAvatar, useAgents, useDeleteAgents, useWorkflowRuns, ArtifactCanvas, ConversationScope, useConversation, useTagKindSchema, useCreateTag, useSetTagValues, useUpdateTagKindSchema, useUpdateTag, useFacts, useDeleteTag, useExtractEntities, useEntityExtractionDocIds, useStartWorkspaceTransfer, useResumeWorkspaceTransfer, useCancelWorkspaceTransfer, useWorkspaceTransfer, useWorkspaceTransfers, useWorkspaceExportDownload, usePlanWorkspaceTransfer, isTransferResumable, isTransferFinished, useShellWorkspaces, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailAccounts, useUpdateUserSettings, useDismissedTips, useConnectorVendorVisibility, useConnectorCatalog, useMyConnectors, useDisconnectConnector, useSlackConnection, useDisconnectSlack, isMailboxSyncVendor, isSharePointVendor, useWorkspaceTrash, useInvalidateStorage, useStorageActions, useStorageItems, useStorageItemNames, useStorageProjects, useUserUsageToday, useStorageSnapshots, useUpdateWorkspace, useAddWorkspaceMembers, useRemoveWorkspaceMembers, useSetWorkspaceMemberRoles, toShellWorkspace, useIsSlow, useProducts, useCreateProject, useDeleteProject, useCanCreateProjects, PROJECT_CREATION_DENIED_REASON, useEnableMailboxSync, useMailboxFolders, useEnableDriveSync, useDriveFolderChildren, connectorErrorStatus, useProjectInvoices, useProjects, useUpdateProjectFields, useChargeWatch, useAddonQuote, STILL_WORKING, useProjectBillingPortal, useProjectUsage, useRefreshProject, useBoxRole, useContacts, useInviteContacts, useDeleteWorkspaces, useCreateContact, useUpdateContact, useLinkContact, useEntitlements, useImportContacts, entitlementRefusal, useDeleteContact, MAX_RETRIEVE_DOC_IDS, useSemanticSearch, useAssignDocTags, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useCalendarEvents, useCalendars, useCanHostCalls, useOpenCallMeetingChat, usePeople, useFetchCalendarEvent, useCalendarSettings, useCalendarOverlays, useCalendarOutbox, useCalendarAccounts, useSyncAccountsOnOpen, useResumeCalendarAccountConnect, useCreateEvent, useUpdateEvent, useDeleteEvent, useMoveEvent, useRespondToEvent, useCreateCalendar, useUpdateCalendar, useDeleteCalendar, useImportCalendar, useSaveCalendarSettings, useRefreshCalendar, useCalendarEvent, useMailAttachmentText, useCalendarEventByUid, getPublicBookingPage, bookPublicSlot, PublicBookingError, isZipFile, prepareUploadFiles, UPLOAD_MAX_FILE_SIZE, filesFromDrop, UPLOAD_ACCEPT, useUploadFromUrls, useUploadFiles, useUpdateDocTag, useRemoveDocTags, useKeepDocumentsOffline, useRemoveDocumentsOffline, subscribeDocumentRows, useGenerateDocTags, useRefreshDocuments, useDocumentsLoading, selectViewingDocumentId, useRelatedDocuments, useDatabases, useCreateDatabase, useImportDatabase, myChatId, useChatThread, useChatPost, useDeleteChatMessage, useMarkChatRead, setOpenChat, useAgentDmStatus, annotateThread, userDisplayName, DmComposer, TypingIndicator, useRenameChat, useAddChatMembers, useRemoveChatMember, useChats, useChatSummaries, useCreateGroupChat, useChatArrivals, useApplyChatModel, AUTO_CHAT_MODEL, formatGbpPerMillionTokens, useConfigSchema, useSaveConfig, useConversationPendingAuth, openAccessRequest, useRequestWorkspaceAccess, useIsEntitled, ImageCropper, useCreateWork, useRunWorkflow, useStartTaskQuery, useCreateWorkflow, useUpdateConversation, useUpdateWorkflow, usePeopleSearch, threadTabId, useCanEditShared, useActOnStep, usePlanWork, useWorkItems, TaskThreadPendingError, useMentionCandidates, useAgentRunControl, useTransientView, useDeleteConversation, useIsWorkspaceOwner, useConversationTurn, useAgentSession, useStartAgentSession, useCloseAgentSession, downloadRecoveryFile, LinkedInIcon, GoogleIcon, AppleIcon, useCurrentUser, isQueuedCalendarWrite, DateSeparator, ChatBubble, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, connectorReturnTo, DmAvatar, ConversationList, GitHubIcon, cropImage, getRelatedTotal, isDeploymentUserNotification, describeServerNotification, getWorkspaceActionText, getWorkspaceSentPhrase, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_TITLE, documentActivityPhrase, isSignatureNotificationType, inputRequestTitle, WORK_NOTIFICATION_LABELS, useConversationThreads, usePassageQuotes, useUpdateFact, useDeleteFact, useAccountClient, usePlanQuote, useCreateProjectCheckout, useInvalidateProjects, useCreateWorkspace, useDriveFolderDocCount, useChangeProjectPlan, useCancelProjectSubscription, usePreviewProjectPlanChange, useAddProjectAddonBlock, useSwitchWorkspace, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, useCalendarInvitations, useDecideCounter, useSearchContacts, usePublishCalendar, useCalendarShares, useShareCalendar, useUnshareCalendar, useSubscribeCalendar, useHolidayCountries, useAddHolidayCalendar, cancelPublicBooking, SHAREPOINT_VENDORS, isDriveSyncVendor, useDatabase, useDatabaseRows, useUpdateDatabase, useDeleteDatabase, useAddDatabaseRows, useUpdateDatabaseRow, useDeleteDatabaseRows, useImportDatabaseRows, useExportDatabase, DATABASE_ROWS_PAGE, useInvalidateAfterTransfer, useConfigs, useSaveConfigField, useDeleteConfig, isFullConfig, useChatUnreadTotal, useUnreadByPeer, useMarkDocumentShared, useConversationSearch, useWorkspaceRole, useConversationDocuments, useConnectRunStream, useAnswerAgentQuestion, useConversationIsShared, buildPendingFirstTurn, useAskAgain, getOrphanedLastMessage, refuseChatWhenOffline, useThreadDocument, useDocumentAutoAdd, useAutoSendDraft, READ_ONLY_MEETING_TEXT, useProjectConversationUsage, AiAnswer, ArbiWebSocketProvider, signatureNotificationPhrase, signatureRequestMeta, getNotificationTypeMeta, useMailDraftEditor, useFreeBusy, useFindTime, useCalendarSupport, useStartCalendarAccountOAuth, useConnectOAuthAccount, useBookingPages, useDeleteBookingPage, useRooms, useCancelMailboxSync, useMailboxSyncProgress, useRefreshConnectorsOnRunEnd, useCancelDriveSync, useDriveFolders, useDriveSyncProgress, useDriveSyncEstimate, useSearchDatabaseRows, isReplayableArbiMutation, useUpdateProjectNextPeriodAddons, useUpdateProjectAddonSettings, useSyncCalendarAccount, useUpdateCalendarAccount, useDisconnectCalendarAccount, ACCOUNT_VENDOR, useCalDavProfiles, useConnectCalDavAccount, useSaveBookingPage, useCreateRoom, useTriggerMailboxSync, useTriggerDriveSync } from '@arbidocs/react';
98
98
  import { mergeAgentSteps, extractSubagentLanes, getCurrentStep, computeRunStats, formatTokens, isNearAiUsageBudget, getSubagentBranchRecord, buildCitationChunkData, topLevelAgentSteps, findMainSiblingLeaf, sliceToSubagentThread, getAgentStepLabel, subagentJobLabel, getStepDisplay, getStepTool, findLeafForTaskMessage, Arbi, FLAT_TAG_KINDS, getEligibleParentTags, canTagHaveParent, isFlatKind, TAG_NESTING_MAX_DEPTH, TAG_KINDS, formatFileSize, filterDocumentTags, isLabelTag, refusalReason, isPresenceTag, isAnnotationTag, flattenTagTree, tagsForScope, tagsOfGroup, chats, buildRetrievalFullContextTool, buildRetrievalChunkTool, getChildTags, tagUseCount, ArbiApiError, PRESENCE_KINDS, isEntityTag, DuplicateContactError, wouldCreateTagCycle, getTagDescendantIds } from '@arbidocs/sdk/browser';
99
99
  import { isAbortError, browserSessionStateStorage, parseCallFragment, isMessageType, validateRecoveryKeyFile, RECOVERY_KEY_ERRORS, parseRecoveryUrl, prewarmKeyPairs, decryptRecoveryKey, unlockIdentityWithPassword, createRecoveryUrl, bytesToBase64, initSodium } from '@arbidocs/client';
100
100
  import React9, { memo, useMemo, lazy, useRef, useEffect, useCallback, useState, forwardRef, useLayoutEffect, useImperativeHandle, createContext, useContext, Suspense, useSyncExternalStore, createElement, Fragment as Fragment$1, useId } from 'react';
101
- import { Users, MessageCircleMore, SquarePen, BookOpen, MessagesSquare, Pencil, Download, Mail, FolderInput, Trash2, Eye, Sparkles, Play, ArrowDownToLine, RefreshCw, Zap, AlertTriangle, FileX, SkipForward, Loader2, Clock, CheckCircle, ArrowUpRight, Send, Settings, Edit3, Copy, Link, Share2, Check, Milestone, RotateCcw, FileText, Network, ChevronRight, Bell, Activity, Info, UserCheck, WifiOff, CircleCheck, Upload, Link2, Search, Plus, ArrowLeft, ExternalLink as ExternalLink$1, Tags, CheckCircle2, Monitor, UserCircle, KeyRound, Radio, LogOut, Wifi, Lock, HardDrive, User, HatGlasses, MessageSquare, PlugZap, Gauge, Cloud, XCircle, Building2, Palette, Type, Printer, SquareStack, Table, FolderKanban, Cake, X, UserRound, Star, Tag, Video, CalendarDays, MapPin, Globe, Calendar, Hash, File as File$1, FileType, FolderOpen, Fingerprint, Paperclip, TriangleAlert, LoaderCircle, NotebookPen, Columns3, EyeOff, ArrowUp, ArrowDown, ZoomOut, Camera, FilePlus2, UserMinus, UserPlus, UsersRound, Code2, Infinity, Bug, Crop, Undo2, ImageUp, ChevronDown, MoreHorizontal, Wrench, RotateCw, Square, BadgeCheck, Shield, ClipboardList, Table2, CheckCheck, FolderUp, ArrowUpCircle, Contact, Scale, BookA, Quote, Inbox, CalendarX, CalendarCheck, Phone, LogIn, Pause, Workflow, Minimize2, Maximize2, Minus, CalendarSearch, DoorOpen, AlertCircle } from 'lucide-react';
101
+ import { Users, MessageCircleMore, SquarePen, BookOpen, MessagesSquare, Pencil, Download, Mail, FolderInput, Trash2, Eye, Sparkles, Play, ArrowDownToLine, RefreshCw, Zap, AlertTriangle, FileX, SkipForward, Loader2, Clock, CheckCircle, ArrowUpRight, Send, Settings, Edit3, Copy, Link, Share2, Check, Milestone, RotateCcw, FileText, Network, ChevronRight, Bell, Activity, Info, UserCheck, WifiOff, CircleCheck, Upload, Link2, Search, Plus, ArrowLeft, ExternalLink as ExternalLink$1, Tags, CheckCircle2, Monitor, UserCircle, KeyRound, Radio, LogOut, Wifi, Lock, HardDrive, User, HatGlasses, MessageSquare, PlugZap, Gauge, Cloud, XCircle, Building2, Palette, Type, Printer, SquareStack, Table, FolderKanban, Cake, X, UserRound, Star, Tag, Video, CalendarDays, MapPin, Globe, Calendar, Hash, File as File$1, FileType, FolderOpen, Fingerprint, Paperclip, TriangleAlert, LoaderCircle, NotebookPen, Columns3, EyeOff, ArrowUp, ArrowDown, ZoomOut, Camera, FilePlus2, UserMinus, UserPlus, UsersRound, Code2, Infinity, Bug, Crop, Undo2, ImageUp, ChevronDown, MoreHorizontal, Wrench, RotateCw, Square, BadgeCheck, Shield, ClipboardList, Table2, CheckCheck, FolderUp, ArrowUpCircle, Contact, Scale, BookA, Quote, Inbox, CalendarX, CalendarCheck, Phone, LogIn, Pause, Workflow, Minimize2, Maximize2, Minus, CalendarSearch, DoorOpen, AlertCircle, ClockFading } from 'lucide-react';
102
102
  import { isAgent, UserEntity, getUserInitials, getUserDisplayName, getUserAvatarColor, agentAvatarColors, Avatar, AvatarImage, AvatarFallback, cn, ShieldIcon, getWorkspaceColor, getFileTypeIcon, DocumentEntity, getDocumentTitle, formatFolderLabel, getEntityLabel, getEntityColor, VisibilityIcon, formatFriendlyDate, getDocumentSubject, Badge, getTagTypeIcon, getTagTypeLabel, VisibilityToggle, TagEntity, ThreadVisibilityIcon, Button, isImageDocument, Tooltip, TooltipTrigger, TooltipContent, Dialog, DialogContent, formatRelativeTime, ProviderIcon, EntityIcon, createUserAvatarIcon, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Label, Input, Textarea, tagKindNouns, tagKindTitle, IconToggle, Switch, Checkbox, entityNoun, DialogTrigger, EntityPill, ProjectEntity, Tabs, TabsList, TabsTrigger, TabsContent, getDocIcon, getDocumentNature, getDocumentAuthor, markdownToPlainText, formatDocDate, getDocumentDate, friendlyFileType, canonicalFolderPath, DebouncedInput, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Slider, AgentBadge, PresenceLabel, TooltipProvider, UserMenu, CommandGroup, CommandItem, Popover, PopoverAnchor, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, ScrollArea, ArbiIcon, ARBI_MARK_SRC, Card, CardHeader, CardTitle, CardContent, VerifiedToggle, Progress } from '@arbidocs/react/ui';
103
103
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
104
104
  import { hasMessageBody, notify, linkMentions, useNotify, sharedSearchSession, takePendingSearch, selectUnread, NotificationBell, useTurnDocumentId, useOpenDocumentId, useRegisterOpenDocument } from '@arbidocs/react/shell';
105
105
  import { SIGNED_LOCKED_REASON, isSignedVersion, currentHasMarkup, fetchMarkupPdf, downloadBlob, useIsOnline, DocumentToolsProvider, useOptionalDocumentTools, fetchDocumentPdf, useSignatureVerification, SignatureVerificationError } from '@arbidocs/react/document-tools';
106
106
  import { create } from 'zustand';
107
- import { artifactKindFromFileName, viewerTabForArtifactMode, useStreamedArtifact } from '@arbidocs/react/artifacts';
107
+ import { artifactKindFromFileName, viewerTabForArtifactMode, useStreamedArtifact, parseVersionRef } from '@arbidocs/react/artifacts';
108
108
  import { useDraggable, useDroppable, useSensors, useSensor, MouseSensor, TouchSensor, pointerWithin, rectIntersection, DndContext, DragOverlay } from '@dnd-kit/core';
109
109
  import { useVirtualizer } from '@tanstack/react-virtual';
110
110
  import { persist, createJSONStorage } from 'zustand/middleware';
@@ -2289,6 +2289,76 @@ function ConnectedAgentCreator({
2289
2289
  ) })
2290
2290
  ] });
2291
2291
  }
2292
+ var DEFAULT_LABELS = {
2293
+ addressCopied: "Agent address copied",
2294
+ addressCopyFailed: "Could not copy the address",
2295
+ deleted: (agent) => `Agent "${agent.given_name}" deleted.`,
2296
+ deleteFailed: (error) => `Delete failed: ${error instanceof Error ? error.message : error}`
2297
+ };
2298
+ function useConnectedAgentManagement({
2299
+ confirmDelete,
2300
+ onAssignTask,
2301
+ labels
2302
+ } = {}) {
2303
+ const { data: agents = [], isLoading } = useAgents();
2304
+ const deletion = useDeleteAgents();
2305
+ const { notify: notify18 } = useBlocksEnvironment();
2306
+ const l = { ...DEFAULT_LABELS, ...labels };
2307
+ const [editorOpen, setEditorOpen] = useState(false);
2308
+ const [editing, setEditing] = useState(null);
2309
+ const [assignFor, setAssignFor] = useState(null);
2310
+ const onEditorOpenChange = (open) => {
2311
+ setEditorOpen(open);
2312
+ };
2313
+ const create4 = () => {
2314
+ setEditing(null);
2315
+ setEditorOpen(true);
2316
+ };
2317
+ const edit = (agent) => {
2318
+ setEditing(agent);
2319
+ setEditorOpen(true);
2320
+ };
2321
+ const assign = (agent) => {
2322
+ if (onAssignTask) onAssignTask(agent);
2323
+ else setAssignFor(agent);
2324
+ };
2325
+ const remove = async (agent) => {
2326
+ try {
2327
+ if (confirmDelete && !await confirmDelete(agent)) return false;
2328
+ await deletion.mutateAsync({ agentExtIds: [agent.external_id] });
2329
+ notify18(l.deleted(agent), "success");
2330
+ return true;
2331
+ } catch (error) {
2332
+ notify18(l.deleteFailed(error), "error");
2333
+ return false;
2334
+ }
2335
+ };
2336
+ const copyAddress = async (address) => {
2337
+ try {
2338
+ await navigator.clipboard.writeText(address);
2339
+ notify18(l.addressCopied, "success");
2340
+ } catch {
2341
+ if (l.addressCopyFailed !== null) notify18(l.addressCopyFailed, "error");
2342
+ }
2343
+ };
2344
+ return {
2345
+ agents,
2346
+ isLoading,
2347
+ create: create4,
2348
+ edit,
2349
+ assign,
2350
+ remove,
2351
+ copyAddress,
2352
+ editorProps: { open: editorOpen, onOpenChange: onEditorOpenChange, agent: editing },
2353
+ assignmentProps: assignFor ? {
2354
+ open: true,
2355
+ onOpenChange: (open) => {
2356
+ if (!open) setAssignFor(null);
2357
+ },
2358
+ initialAgentExtId: assignFor.external_id
2359
+ } : null
2360
+ };
2361
+ }
2292
2362
  var RUN_KIND = {
2293
2363
  email_documents: "Email",
2294
2364
  annotate_documents: "AI Review",
@@ -29005,6 +29075,870 @@ function ConnectedGridView(props) {
29005
29075
  );
29006
29076
  return /* @__PURE__ */ jsx(GridView, { ...props, gridState, onGridStateChange });
29007
29077
  }
29078
+ function useEmailSyncTrigger() {
29079
+ const arbi = useArbi();
29080
+ const { notify: notify18 } = useBlocksEnvironment();
29081
+ const triggerSync = useTriggerMailboxSync();
29082
+ const runSync = useCallback(
29083
+ async ({
29084
+ vendorKey,
29085
+ workspaceExtId,
29086
+ workspaceLabel = "the workspace"
29087
+ }) => {
29088
+ await arbi.connectors.bridgeTokens({ vendor: vendorKey });
29089
+ if (workspaceExtId) {
29090
+ await arbi.workspaces.open(workspaceExtId).catch(() => {
29091
+ });
29092
+ }
29093
+ triggerSync.mutate(
29094
+ { vendorKey, workspaceExtId },
29095
+ {
29096
+ onSuccess: (res) => {
29097
+ const n = res?.estimated_count;
29098
+ if (n === 0) {
29099
+ notify18("You\u2019re up to date \u2014 no new emails to sync.", "success");
29100
+ } else if (n != null && n > 0) {
29101
+ notify18(
29102
+ `Fetching ${n} new email${n === 1 ? "" : "s"} to ${workspaceLabel}.`,
29103
+ "success"
29104
+ );
29105
+ } else {
29106
+ notify18("Sync started \u2014 fetching new emails\u2026", "success");
29107
+ }
29108
+ },
29109
+ onError: (err) => {
29110
+ if (connectorErrorStatus(err) === 425) {
29111
+ notify18("Still preparing your session \u2014 please try Sync now again.", "error");
29112
+ } else if (connectorErrorStatus(err) === 409) {
29113
+ notify18("Reconnect needed \u2014 your account needs to be re-authorized.", "error");
29114
+ } else if (connectorErrorStatus(err) === 404) {
29115
+ notify18("Email sync is not enabled for this connector yet.", "error");
29116
+ } else {
29117
+ notify18("Could not start sync. Please try again.", "error");
29118
+ }
29119
+ }
29120
+ }
29121
+ );
29122
+ },
29123
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- triggerSync.mutate is a stable TanStack Query reference
29124
+ [arbi, notify18, triggerSync.mutate]
29125
+ );
29126
+ return { runSync, isPending: triggerSync.isPending };
29127
+ }
29128
+ function useImportHandoff(running, processed) {
29129
+ const [lastRunCount, setLastRunCount] = useState(null);
29130
+ const seenWhileRunning = useRef(null);
29131
+ useEffect(() => {
29132
+ if (running) {
29133
+ setLastRunCount(null);
29134
+ if (typeof processed === "number") seenWhileRunning.current = processed;
29135
+ return;
29136
+ }
29137
+ if (seenWhileRunning.current !== null) {
29138
+ setLastRunCount(seenWhileRunning.current);
29139
+ seenWhileRunning.current = null;
29140
+ }
29141
+ }, [running, processed]);
29142
+ return {
29143
+ lastRunCount,
29144
+ dismiss: () => setLastRunCount(null)
29145
+ };
29146
+ }
29147
+ function ImportHandoff({
29148
+ count: count2,
29149
+ noun,
29150
+ onDismiss,
29151
+ onViewProgress,
29152
+ "data-testid": testId
29153
+ }) {
29154
+ if (count2 <= 0) return null;
29155
+ return /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-start justify-between gap-3", "data-testid": testId, children: [
29156
+ /* @__PURE__ */ jsxs("div", { className: "ml-[34px] text-sm leading-snug text-muted-foreground", children: [
29157
+ "Imported ",
29158
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: count2.toLocaleString() }),
29159
+ " ",
29160
+ count2 === 1 ? noun : `${noun}s`,
29161
+ " \xB7 indexing in the background"
29162
+ ] }),
29163
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5", children: [
29164
+ onViewProgress && /* @__PURE__ */ jsxs(
29165
+ Button,
29166
+ {
29167
+ variant: "outline",
29168
+ size: "sm",
29169
+ className: "h-7 gap-1.5",
29170
+ onClick: onViewProgress,
29171
+ "data-testid": testId ? `${testId}-view` : void 0,
29172
+ children: [
29173
+ /* @__PURE__ */ jsx(ClockFading, { className: "h-3.5 w-3.5" }),
29174
+ "View progress"
29175
+ ]
29176
+ }
29177
+ ),
29178
+ /* @__PURE__ */ jsx(
29179
+ Button,
29180
+ {
29181
+ variant: "ghost",
29182
+ size: "sm",
29183
+ className: "h-7 px-2 text-muted-foreground",
29184
+ onClick: onDismiss,
29185
+ "aria-label": "Dismiss import summary",
29186
+ "data-testid": testId ? `${testId}-dismiss` : void 0,
29187
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
29188
+ }
29189
+ )
29190
+ ] })
29191
+ ] });
29192
+ }
29193
+ var PROVIDER_FAMILIES = [
29194
+ { key: "microsoft", label: "Microsoft", vendors: ["microsoft"] },
29195
+ { key: "google", label: "Google", vendors: ["gmail"] }
29196
+ ];
29197
+ function VendorGlyph({ catalog }) {
29198
+ return /* @__PURE__ */ jsx(VendorLogo, { vendorKey: catalog.vendor_key, className: "h-7 w-7" });
29199
+ }
29200
+ function mailboxProductName(catalog) {
29201
+ if (catalog.vendor_key === "microsoft") return "Outlook";
29202
+ if (catalog.vendor_key === "gmail") return "Gmail";
29203
+ return catalog.display_name;
29204
+ }
29205
+ function EmailProviderRow({
29206
+ catalog,
29207
+ userConnector,
29208
+ workspaceExtId,
29209
+ workspaceName,
29210
+ onViewProgress,
29211
+ onNeedsReconnectChange
29212
+ }) {
29213
+ const [settingsOpen, setSettingsOpen] = useState(false);
29214
+ const { runSync, isPending: syncPending } = useEmailSyncTrigger();
29215
+ const cancelSync = useCancelMailboxSync();
29216
+ const arbi = useArbi();
29217
+ const isConnected = !!userConnector?.is_connected;
29218
+ const thisSync = userConnector?.syncs?.find((s) => s.workspace_ext_id === workspaceExtId);
29219
+ const syncingHere = isConnected && !!thisSync && thisSync.enabled;
29220
+ const [tokensBridged, setTokensBridged] = useState(false);
29221
+ useEffect(() => {
29222
+ if (!isConnected) {
29223
+ setTokensBridged(false);
29224
+ return;
29225
+ }
29226
+ let cancelled = false;
29227
+ void arbi.connectors.bridgeTokens({ vendor: catalog.vendor_key, autoSyncWorkspaceExtId: workspaceExtId }).finally(() => {
29228
+ if (!cancelled) setTokensBridged(true);
29229
+ });
29230
+ return () => {
29231
+ cancelled = true;
29232
+ };
29233
+ }, [isConnected, arbi, catalog.vendor_key, workspaceExtId]);
29234
+ const { data: mailboxFolders, error: foldersError } = useMailboxFolders(
29235
+ catalog.vendor_key,
29236
+ isConnected && tokensBridged
29237
+ );
29238
+ const needsReconnect = isConnected && !!foldersError;
29239
+ useEffect(() => {
29240
+ onNeedsReconnectChange(catalog.vendor_key, needsReconnect);
29241
+ }, [needsReconnect, catalog.vendor_key, onNeedsReconnectChange]);
29242
+ const { data: progress, refetch: refetchProgress } = useMailboxSyncProgress(
29243
+ catalog.vendor_key,
29244
+ workspaceExtId,
29245
+ syncingHere
29246
+ );
29247
+ const running = !!progress?.running;
29248
+ const { lastRunCount, dismiss: dismissHandoff } = useImportHandoff(running, progress?.processed);
29249
+ useRefreshConnectorsOnRunEnd(running);
29250
+ const busy = syncPending;
29251
+ const kickProgressPolling = () => {
29252
+ [500, 1400, 2800].forEach((ms) => window.setTimeout(() => void refetchProgress(), ms));
29253
+ };
29254
+ const syncNow = () => {
29255
+ void runSync({ vendorKey: catalog.vendor_key, workspaceExtId, workspaceLabel: workspaceName });
29256
+ kickProgressPolling();
29257
+ };
29258
+ const stopSync = () => cancelSync.mutate(
29259
+ { vendorKey: catalog.vendor_key, workspaceExtId },
29260
+ { onSettled: () => void refetchProgress() }
29261
+ );
29262
+ const emailNoun = (n) => n === 1 ? "email" : "emails";
29263
+ const syncedCount = thisSync?.synced_count ?? 0;
29264
+ return /* @__PURE__ */ jsxs(
29265
+ ImportRow,
29266
+ {
29267
+ testId: `email-provider-row-${catalog.vendor_key}`,
29268
+ logo: /* @__PURE__ */ jsx(VendorGlyph, { catalog }),
29269
+ name: mailboxProductName(catalog),
29270
+ actions: (
29271
+ // Connecting AND reconnecting are owned by the family header, so a
29272
+ // not-connected or needs-reconnect row shows no button of its own.
29273
+ !isConnected || needsReconnect ? null : /* @__PURE__ */ jsx(
29274
+ ImportRunActions,
29275
+ {
29276
+ isRunning: running,
29277
+ isStopping: cancelSync.isPending,
29278
+ isBusy: busy,
29279
+ onImport: syncingHere ? syncNow : () => setSettingsOpen(true),
29280
+ onStop: stopSync,
29281
+ onSettings: () => setSettingsOpen(true),
29282
+ settingsLabel: `${mailboxProductName(catalog)} sync settings`,
29283
+ stopButton: { testId: `email-stop-${catalog.vendor_key}` }
29284
+ }
29285
+ )
29286
+ ),
29287
+ children: [
29288
+ isConnected && !needsReconnect && !running && /* @__PURE__ */ jsxs(
29289
+ ImportSummary,
29290
+ {
29291
+ aside: /* @__PURE__ */ jsx(ImportAside, { children: thisSync && thisSync.folders.length > 0 && /* @__PURE__ */ jsx(
29292
+ FolderSummary,
29293
+ {
29294
+ names: thisSync.folders.map(
29295
+ (id) => mailboxFolders?.find((f) => f.id === id)?.name
29296
+ ),
29297
+ testId: `email-folders-${catalog.vendor_key}`
29298
+ }
29299
+ ) }),
29300
+ children: [
29301
+ /* @__PURE__ */ jsxs("div", { children: [
29302
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: syncedCount.toLocaleString() }),
29303
+ " ",
29304
+ emailNoun(syncedCount),
29305
+ " in this workspace"
29306
+ ] }),
29307
+ /* @__PURE__ */ jsxs("div", { "data-testid": `email-last-sync-${catalog.vendor_key}`, children: [
29308
+ thisSync?.last_sync_at ? `Last synced ${formatRelativeTime(thisSync.last_sync_at, { style: "compact" })}` : "Not synced yet",
29309
+ thisSync?.backfill_since ? ` \xB7 Backfill: since ${new Date(thisSync.backfill_since).toLocaleDateString()}` : thisSync?.backfill_window != null && ` \xB7 Backfill: ${windowLabel(thisSync.backfill_window)}`
29310
+ ] })
29311
+ ]
29312
+ }
29313
+ ),
29314
+ running && /* @__PURE__ */ jsx(
29315
+ ImportProgress,
29316
+ {
29317
+ processed: progress?.processed ?? 0,
29318
+ total: progress?.total,
29319
+ noun: "emails",
29320
+ testId: `email-progress-${catalog.vendor_key}`
29321
+ }
29322
+ ),
29323
+ !running && lastRunCount !== null && /* @__PURE__ */ jsx(
29324
+ ImportHandoff,
29325
+ {
29326
+ count: lastRunCount,
29327
+ noun: "email",
29328
+ onDismiss: dismissHandoff,
29329
+ onViewProgress,
29330
+ "data-testid": `email-handoff-${catalog.vendor_key}`
29331
+ }
29332
+ ),
29333
+ /* @__PURE__ */ jsx(
29334
+ ConnectedMailboxSyncDialog,
29335
+ {
29336
+ catalog,
29337
+ userConnector,
29338
+ open: settingsOpen,
29339
+ onOpenChange: setSettingsOpen,
29340
+ lockedWorkspaceExtId: workspaceExtId
29341
+ }
29342
+ )
29343
+ ]
29344
+ }
29345
+ );
29346
+ }
29347
+ function EmailImportPanel({
29348
+ workspaceExtId,
29349
+ workspaceName,
29350
+ onViewProgress,
29351
+ microsoftExtra,
29352
+ googleExtra
29353
+ }) {
29354
+ const arbi = useArbi();
29355
+ const { confirm, notify: notify18 } = useBlocksEnvironment();
29356
+ const { data: catalog = [] } = useConnectorCatalog();
29357
+ const { data: myConnectors = [] } = useMyConnectors();
29358
+ const disconnect = useDisconnectConnector();
29359
+ const isVendorVisible = useConnectorVendorVisibility();
29360
+ const [reconnectByVendor, setReconnectByVendor] = useState({});
29361
+ const handleNeedsReconnectChange = useCallback((vendorKey, needs) => {
29362
+ setReconnectByVendor(
29363
+ (prev) => prev[vendorKey] === needs ? prev : { ...prev, [vendorKey]: needs }
29364
+ );
29365
+ }, []);
29366
+ const mailboxCatalog = catalog.filter(
29367
+ (c) => isMailboxSyncVendor(c.vendor_key) && isVendorVisible(c.vendor_key)
29368
+ );
29369
+ const connectedByVendor = Object.fromEntries(myConnectors.map((uc) => [uc.vendor_key, uc]));
29370
+ const byVendor = Object.fromEntries(mailboxCatalog.map((c) => [c.vendor_key, c]));
29371
+ const connectFamily = async (vendorKey) => {
29372
+ try {
29373
+ window.location.href = await arbi.connectors.authorize(
29374
+ vendorKey,
29375
+ connectorReturnTo("accounts")
29376
+ );
29377
+ } catch {
29378
+ notify18("Could not start the connection. Please try again.", "error");
29379
+ }
29380
+ };
29381
+ const reconnectFamily = async (vendorKey) => {
29382
+ try {
29383
+ await disconnect.mutateAsync({ vendorKey });
29384
+ } catch {
29385
+ }
29386
+ try {
29387
+ window.location.href = await arbi.connectors.authorize(
29388
+ vendorKey,
29389
+ connectorReturnTo("accounts")
29390
+ );
29391
+ } catch {
29392
+ notify18("Could not start reconnection. Please try again.", "error");
29393
+ }
29394
+ };
29395
+ const extraByFamily = {
29396
+ microsoft: isVendorVisible("microsoft") ? microsoftExtra : null,
29397
+ google: isVendorVisible("gmail") ? googleExtra : null
29398
+ };
29399
+ const disconnectFamily = useCallback(
29400
+ async (family, connectVendor, identity) => {
29401
+ const who = identity ? `${identity} will be disconnected.` : "This account will be disconnected.";
29402
+ const ok = await confirm({
29403
+ message: `${who} Documents already imported stay in the workspace, but nothing further will sync until you connect again.`,
29404
+ title: `Disconnect ${family.label}?`
29405
+ });
29406
+ if (!ok) return;
29407
+ await disconnect.mutateAsync({ vendorKey: connectVendor });
29408
+ if (connectVendor === "microsoft") {
29409
+ for (const spVendor of SHAREPOINT_VENDORS) {
29410
+ if (connectedByVendor[spVendor]) {
29411
+ await disconnect.mutateAsync({ vendorKey: spVendor }).catch(() => {
29412
+ });
29413
+ }
29414
+ }
29415
+ }
29416
+ notify18(`Disconnected ${family.label}`, "success");
29417
+ },
29418
+ [confirm, disconnect, connectedByVendor, notify18]
29419
+ );
29420
+ const groups = PROVIDER_FAMILIES.map((family) => {
29421
+ const entries = family.vendors.map((v) => byVendor[v]).filter(Boolean);
29422
+ const extra = extraByFamily[family.key] ?? null;
29423
+ const connectVendor = family.vendors[0];
29424
+ const connectUc = connectedByVendor[connectVendor];
29425
+ const connected = !!connectUc?.is_connected;
29426
+ const identity = family.vendors.map((v) => connectedByVendor[v]).find((uc) => uc?.is_connected && uc?.vendor_user_identity)?.vendor_user_identity;
29427
+ const mailboxNeedsReconnect = family.vendors.some((v) => reconnectByVendor[v]);
29428
+ const needsReconnect = connected && (isDriveSyncVendor(connectVendor) && !!connectUc?.drive_needs_reconsent || mailboxNeedsReconnect);
29429
+ return { family, entries, extra, identity, connectVendor, connected, needsReconnect };
29430
+ }).filter((g) => g.entries.length > 0 || g.extra);
29431
+ if (groups.length === 0) return null;
29432
+ return /* @__PURE__ */ jsx(ImportPanel, { "data-testid": "email-import-panel", children: groups.map(
29433
+ ({ family, entries, extra, identity, connectVendor, connected, needsReconnect }) => /* @__PURE__ */ jsx(
29434
+ ImportFamilySection,
29435
+ {
29436
+ label: family.label,
29437
+ identity,
29438
+ action: !connected ? "connect" : needsReconnect ? "reconnect" : "disconnect",
29439
+ isActionPending: disconnect.isPending,
29440
+ onAction: () => void (!connected ? connectFamily(connectVendor) : needsReconnect ? reconnectFamily(connectVendor) : disconnectFamily(family, connectVendor, identity)),
29441
+ testId: `import-family-${family.key}`,
29442
+ actionButton: !connected ? { testId: `import-family-connect-${family.key}` } : needsReconnect ? { testId: `import-family-reconnect-${family.key}` } : { testId: `import-family-disconnect-${family.key}` },
29443
+ children: /* @__PURE__ */ jsxs(ImportList, { children: [
29444
+ entries.map((entry) => /* @__PURE__ */ jsx(
29445
+ EmailProviderRow,
29446
+ {
29447
+ catalog: entry,
29448
+ userConnector: connectedByVendor[entry.vendor_key],
29449
+ workspaceExtId,
29450
+ workspaceName,
29451
+ onViewProgress,
29452
+ onNeedsReconnectChange: handleNeedsReconnectChange
29453
+ },
29454
+ entry.vendor_key
29455
+ )),
29456
+ extra
29457
+ ] })
29458
+ },
29459
+ family.key
29460
+ )
29461
+ ) });
29462
+ }
29463
+ function useDriveSyncTrigger() {
29464
+ const arbi = useArbi();
29465
+ const { notify: notify18 } = useBlocksEnvironment();
29466
+ const triggerSync = useTriggerDriveSync();
29467
+ const runSync = useCallback(
29468
+ async ({
29469
+ vendorKey,
29470
+ workspaceExtId,
29471
+ workspaceLabel = "the workspace"
29472
+ }) => {
29473
+ await arbi.connectors.bridgeTokens({ vendor: vendorKey });
29474
+ if (workspaceExtId) {
29475
+ await arbi.workspaces.open(workspaceExtId).catch(() => {
29476
+ });
29477
+ }
29478
+ triggerSync.mutate(
29479
+ { vendorKey },
29480
+ {
29481
+ onSuccess: (res) => {
29482
+ const n = res?.estimated_count;
29483
+ if (n === 0) {
29484
+ notify18("You\u2019re up to date \u2014 no new documents to sync.", "success");
29485
+ } else if (n != null && n > 0) {
29486
+ notify18(
29487
+ `Fetching ${n} new document${n === 1 ? "" : "s"} to ${workspaceLabel}.`,
29488
+ "success"
29489
+ );
29490
+ } else {
29491
+ notify18("Sync started \u2014 fetching new documents\u2026", "success");
29492
+ }
29493
+ },
29494
+ onError: (err) => {
29495
+ if (connectorErrorStatus(err) === 425) {
29496
+ notify18("Still preparing your session \u2014 please try Sync now again.", "error");
29497
+ } else if (connectorErrorStatus(err) === 409) {
29498
+ notify18("Reconnect needed \u2014 your account needs to be re-authorized.", "error");
29499
+ } else if (connectorErrorStatus(err) === 404) {
29500
+ notify18("Drive sync is not enabled for this connector yet.", "error");
29501
+ } else {
29502
+ notify18("Could not start sync. Please try again.", "error");
29503
+ }
29504
+ }
29505
+ }
29506
+ );
29507
+ },
29508
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- triggerSync.mutate is a stable TanStack Query reference
29509
+ [arbi, notify18, triggerSync.mutate]
29510
+ );
29511
+ return { runSync, isPending: triggerSync.isPending };
29512
+ }
29513
+ var DRIVE_PRODUCT = {
29514
+ microsoft: { name: "OneDrive", glyph: "onedrive" },
29515
+ gmail: { name: "Google Drive", glyph: "googledrive" },
29516
+ microsoft_sharepoint: { name: "SharePoint", glyph: "sharepoint" },
29517
+ box: { name: "Box", glyph: "box" },
29518
+ dropbox: { name: "Dropbox", glyph: "dropbox" },
29519
+ onenote: { name: "OneNote", glyph: "onenote" },
29520
+ clio: { name: "Clio", glyph: "clio" }
29521
+ };
29522
+ function driveProduct(vendorKey) {
29523
+ return DRIVE_PRODUCT[vendorKey] ?? { name: "Drive", glyph: "onedrive" };
29524
+ }
29525
+ function VendorGlyph2({ catalog }) {
29526
+ return /* @__PURE__ */ jsx(
29527
+ VendorLogo,
29528
+ {
29529
+ vendorKey: catalog.vendor_key,
29530
+ product: driveProduct(catalog.vendor_key).glyph,
29531
+ className: "h-7 w-7"
29532
+ }
29533
+ );
29534
+ }
29535
+ function OneDriveProviderRow({
29536
+ catalog,
29537
+ userConnector,
29538
+ workspaceExtId,
29539
+ workspaceName,
29540
+ onViewProgress
29541
+ }) {
29542
+ const [settingsOpen, setSettingsOpen] = useState(false);
29543
+ const { runSync, isPending: syncPending } = useDriveSyncTrigger();
29544
+ const cancelSync = useCancelDriveSync();
29545
+ const arbi = useArbi();
29546
+ const { notify: notify18 } = useBlocksEnvironment();
29547
+ const isConnected = !!userConnector?.is_connected;
29548
+ const product = driveProduct(catalog.vendor_key);
29549
+ const status = userConnector?.drive_sync_status ?? null;
29550
+ const configuredHere = status != null && userConnector?.drive_sync_workspace_ext_id === workspaceExtId;
29551
+ const folderCount = userConnector?.drive_sync_folders?.length ?? 0;
29552
+ const needsReconsent = isConnected && !!userConnector?.drive_needs_reconsent;
29553
+ const [tokensBridged, setTokensBridged] = useState(false);
29554
+ useEffect(() => {
29555
+ if (!isConnected) {
29556
+ setTokensBridged(false);
29557
+ return;
29558
+ }
29559
+ let cancelled = false;
29560
+ void arbi.connectors.bridgeTokens({ vendor: catalog.vendor_key, autoSyncWorkspaceExtId: workspaceExtId }).finally(() => {
29561
+ if (!cancelled) setTokensBridged(true);
29562
+ });
29563
+ return () => {
29564
+ cancelled = true;
29565
+ };
29566
+ }, [isConnected, arbi, catalog.vendor_key, workspaceExtId]);
29567
+ const { error: foldersError } = useDriveFolders(
29568
+ catalog.vendor_key,
29569
+ isConnected && tokensBridged && !needsReconsent
29570
+ );
29571
+ const needsReconnect = needsReconsent || isConnected && connectorErrorStatus(foldersError) === 409;
29572
+ const { data: progress, refetch: refetchProgress } = useDriveSyncProgress(
29573
+ catalog.vendor_key,
29574
+ configuredHere && !needsReconnect
29575
+ );
29576
+ const running = !!progress?.running;
29577
+ const { lastRunCount, dismiss: dismissHandoff } = useImportHandoff(running, progress?.processed);
29578
+ useRefreshConnectorsOnRunEnd(running);
29579
+ const { data: estimate, refetch: refetchEstimate } = useDriveSyncEstimate(
29580
+ catalog.vendor_key,
29581
+ configuredHere && tokensBridged && !needsReconnect && !running
29582
+ );
29583
+ const lastSummaryRef = useRef(null);
29584
+ const baselinedRef = useRef(false);
29585
+ useEffect(() => {
29586
+ if (progress === void 0) return;
29587
+ const s = progress.summary;
29588
+ const finishedAt = s?.finished_at ?? null;
29589
+ if (!baselinedRef.current) {
29590
+ baselinedRef.current = true;
29591
+ lastSummaryRef.current = finishedAt;
29592
+ return;
29593
+ }
29594
+ if (!s?.finished_at || lastSummaryRef.current === s.finished_at) return;
29595
+ lastSummaryRef.current = s.finished_at;
29596
+ const total = s.attempted || s.ingested;
29597
+ const importedMsg = `Imported ${s.ingested} of ${total} document${total === 1 ? "" : "s"} from ${product.name}.`;
29598
+ const skipped = s.skipped ?? [];
29599
+ if (skipped.length === 0) {
29600
+ notify18(importedMsg, "success");
29601
+ } else {
29602
+ notify18(`${importedMsg} ${skipped.length} couldn\u2019t be imported:`, "warning", {
29603
+ duration: 12e3,
29604
+ description: /* @__PURE__ */ jsx("ul", { className: "mt-1 max-h-56 space-y-0.5 overflow-y-auto pr-1 text-xs", children: skipped.map((f, i) => /* @__PURE__ */ jsxs("li", { className: "break-all", children: [
29605
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: f.name }),
29606
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
29607
+ " \u2014 ",
29608
+ f.reason
29609
+ ] })
29610
+ ] }, i)) })
29611
+ });
29612
+ }
29613
+ void refetchEstimate();
29614
+ }, [progress, refetchEstimate, product.name, notify18]);
29615
+ const pendingCount = estimate?.estimated_count;
29616
+ const busy = syncPending;
29617
+ const ownsAuth = catalog.vendor_key === "microsoft_sharepoint";
29618
+ const [reauthPending, setReauthPending] = useState(false);
29619
+ const reconnectSelf = async () => {
29620
+ setReauthPending(true);
29621
+ try {
29622
+ window.location.href = await arbi.connectors.authorize(
29623
+ catalog.vendor_key,
29624
+ connectorReturnTo("accounts")
29625
+ );
29626
+ } catch {
29627
+ setReauthPending(false);
29628
+ notify18("Could not start reconnection. Please try again.", "error");
29629
+ }
29630
+ };
29631
+ const kickProgressPolling = () => {
29632
+ [500, 1400, 2800].forEach((ms) => window.setTimeout(() => void refetchProgress(), ms));
29633
+ };
29634
+ const syncNow = () => {
29635
+ void runSync({
29636
+ vendorKey: catalog.vendor_key,
29637
+ workspaceExtId,
29638
+ workspaceLabel: workspaceName
29639
+ });
29640
+ kickProgressPolling();
29641
+ [1500, 4e3].forEach((ms) => window.setTimeout(() => void refetchEstimate(), ms));
29642
+ };
29643
+ const stopSync = () => cancelSync.mutate(
29644
+ { vendorKey: catalog.vendor_key },
29645
+ { onSettled: () => void refetchProgress() }
29646
+ );
29647
+ const driveNoun = (n) => n === 1 ? "document" : "documents";
29648
+ const showRunActions = isConnected && !needsReconnect;
29649
+ const reconnectAction = ownsAuth && needsReconnect ? /* @__PURE__ */ jsx(
29650
+ ImportActionButton,
29651
+ {
29652
+ onClick: () => void reconnectSelf(),
29653
+ disabled: reauthPending,
29654
+ "data-testid": `onedrive-reconnect-${catalog.vendor_key}`,
29655
+ children: reauthPending ? "Reconnecting\u2026" : "Reconnect"
29656
+ }
29657
+ ) : null;
29658
+ return /* @__PURE__ */ jsxs(
29659
+ ImportRow,
29660
+ {
29661
+ testId: `onedrive-provider-row-${catalog.vendor_key}`,
29662
+ logo: /* @__PURE__ */ jsx(VendorGlyph2, { catalog }),
29663
+ name: product.name,
29664
+ actions: (
29665
+ // OneDrive/Google Drive: connecting AND reconnecting are owned by the family header.
29666
+ // SharePoint (ownsAuth) is a separate grant, so its row renders its OWN Reconnect (D1).
29667
+ showRunActions ? (
29668
+ // Until folders are configured here (or when nothing new is pending), Import now
29669
+ // stays disabled; the gear opens the folder picker.
29670
+ /* @__PURE__ */ jsx(
29671
+ ImportRunActions,
29672
+ {
29673
+ isRunning: running,
29674
+ isStopping: cancelSync.isPending,
29675
+ isBusy: busy,
29676
+ importDisabled: !configuredHere || pendingCount === 0,
29677
+ importTitle: !configuredHere ? `Choose ${product.name} folders in settings first` : pendingCount === 0 ? "No new documents to import" : void 0,
29678
+ onImport: syncNow,
29679
+ onStop: stopSync,
29680
+ onSettings: () => setSettingsOpen(true),
29681
+ settingsLabel: `${product.name} import settings`,
29682
+ importButton: { testId: `onedrive-sync-${catalog.vendor_key}` },
29683
+ settingsButton: { testId: `onedrive-settings-${catalog.vendor_key}` },
29684
+ stopButton: { testId: `onedrive-stop-${catalog.vendor_key}` }
29685
+ }
29686
+ )
29687
+ ) : reconnectAction
29688
+ ),
29689
+ children: [
29690
+ ownsAuth && needsReconnect && /* @__PURE__ */ jsxs(ImportHint, { "data-testid": `onedrive-reconnect-hint-${catalog.vendor_key}`, children: [
29691
+ "Couldn\u2019t reach SharePoint. Click ",
29692
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Reconnect" }),
29693
+ " \u2014 if it keeps happening, log out and back in to refresh the connection."
29694
+ ] }),
29695
+ configuredHere && !needsReconnect && !running && /* @__PURE__ */ jsxs(
29696
+ ImportSummary,
29697
+ {
29698
+ className: "mt-2",
29699
+ aside: typeof pendingCount === "number" ? /* @__PURE__ */ jsx(ImportAside, { className: "max-w-none shrink-0", children: /* @__PURE__ */ jsx("span", { "data-testid": `drive-pending-${catalog.vendor_key}`, children: pendingCount > 0 ? `${pendingCount.toLocaleString()} new ${driveNoun(pendingCount)} to sync` : "No new documents to sync" }) }) : void 0,
29700
+ children: [
29701
+ /* @__PURE__ */ jsxs("div", { children: [
29702
+ "Syncing ",
29703
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: folderCount }),
29704
+ " folder",
29705
+ folderCount === 1 ? "" : "s",
29706
+ " into this workspace"
29707
+ ] }),
29708
+ /* @__PURE__ */ jsx("div", { "data-testid": `drive-last-sync-${catalog.vendor_key}`, children: userConnector?.drive_last_sync_at ? `Last synced ${formatRelativeTime(userConnector.drive_last_sync_at, { style: "compact" })}` : "Not synced yet" })
29709
+ ]
29710
+ }
29711
+ ),
29712
+ isConnected && !needsReconnect && !running && !configuredHere && /* @__PURE__ */ jsxs(
29713
+ "button",
29714
+ {
29715
+ type: "button",
29716
+ className: "ml-[34px] mt-2 text-left text-sm leading-snug text-muted-foreground hover:text-foreground pointer-coarse:min-h-11",
29717
+ onClick: () => setSettingsOpen(true),
29718
+ "data-testid": `onedrive-choose-folders-${catalog.vendor_key}`,
29719
+ children: [
29720
+ "Choose folders in ",
29721
+ /* @__PURE__ */ jsx("span", { className: "underline", children: "settings" }),
29722
+ " to start syncing"
29723
+ ]
29724
+ }
29725
+ ),
29726
+ running && /* @__PURE__ */ jsx(
29727
+ ImportProgress,
29728
+ {
29729
+ processed: progress?.processed ?? 0,
29730
+ total: progress?.total,
29731
+ noun: "documents",
29732
+ testId: `onedrive-progress-${catalog.vendor_key}`
29733
+ }
29734
+ ),
29735
+ !running && lastRunCount !== null && /* @__PURE__ */ jsx(
29736
+ ImportHandoff,
29737
+ {
29738
+ count: lastRunCount,
29739
+ noun: "document",
29740
+ onDismiss: dismissHandoff,
29741
+ onViewProgress,
29742
+ "data-testid": `onedrive-handoff-${catalog.vendor_key}`
29743
+ }
29744
+ ),
29745
+ /* @__PURE__ */ jsx(
29746
+ ConnectedDriveSyncDialog,
29747
+ {
29748
+ catalog,
29749
+ userConnector,
29750
+ open: settingsOpen,
29751
+ onOpenChange: setSettingsOpen,
29752
+ lockedWorkspaceExtId: workspaceExtId,
29753
+ onEnabled: () => void refetchEstimate()
29754
+ }
29755
+ )
29756
+ ]
29757
+ }
29758
+ );
29759
+ }
29760
+ function SharePointEnableRow({
29761
+ catalog,
29762
+ sharePointAdminUrl
29763
+ }) {
29764
+ const arbi = useArbi();
29765
+ const { notify: notify18 } = useBlocksEnvironment();
29766
+ const [pending, setPending] = useState(false);
29767
+ const product = driveProduct(catalog.vendor_key);
29768
+ const enable = async () => {
29769
+ setPending(true);
29770
+ try {
29771
+ window.location.href = await arbi.connectors.authorize(
29772
+ catalog.vendor_key,
29773
+ connectorReturnTo("accounts")
29774
+ );
29775
+ } catch {
29776
+ setPending(false);
29777
+ notify18("Could not start the connection. Please try again.", "error");
29778
+ }
29779
+ };
29780
+ const copyAdminLink = async () => {
29781
+ const link = sharePointAdminUrl;
29782
+ if (!link) return;
29783
+ try {
29784
+ await navigator.clipboard.writeText(link);
29785
+ notify18("Approval link copied \u2014 send it to your Microsoft admin.", "success");
29786
+ } catch {
29787
+ notify18(`Copy this link for your Microsoft admin: ${link}`, "info");
29788
+ }
29789
+ };
29790
+ return /* @__PURE__ */ jsx(
29791
+ ImportRow,
29792
+ {
29793
+ testId: `onedrive-provider-row-${catalog.vendor_key}`,
29794
+ logo: /* @__PURE__ */ jsx(VendorLogo, { vendorKey: catalog.vendor_key, product: product.glyph, className: "h-7 w-7" }),
29795
+ name: product.name,
29796
+ actions: /* @__PURE__ */ jsx(
29797
+ ImportActionButton,
29798
+ {
29799
+ onClick: () => void enable(),
29800
+ disabled: pending,
29801
+ "data-testid": `onedrive-enable-${catalog.vendor_key}`,
29802
+ children: pending ? "Enabling\u2026" : `Enable ${product.name}`
29803
+ }
29804
+ ),
29805
+ children: sharePointAdminUrl && /* @__PURE__ */ jsxs(ImportHint, { children: [
29806
+ "Does your organization require admin approval?",
29807
+ " ",
29808
+ /* @__PURE__ */ jsx(
29809
+ "button",
29810
+ {
29811
+ type: "button",
29812
+ className: "underline hover:text-foreground",
29813
+ onClick: () => void copyAdminLink(),
29814
+ "data-testid": "sharepoint-copy-admin-link",
29815
+ children: "Copy the approval link"
29816
+ }
29817
+ ),
29818
+ " ",
29819
+ "and send it to your Microsoft admin \u2014 they won't need an ARBI account."
29820
+ ] })
29821
+ }
29822
+ );
29823
+ }
29824
+ function DriveImportPanel({
29825
+ workspaceExtId,
29826
+ workspaceName,
29827
+ onViewProgress,
29828
+ only,
29829
+ sharePointAdminUrl
29830
+ }) {
29831
+ const { data: catalog = [] } = useConnectorCatalog();
29832
+ const { data: myConnectors = [] } = useMyConnectors();
29833
+ const driveCatalog = catalog.filter(
29834
+ (c) => isDriveSyncVendor(c.vendor_key) && (!only || c.vendor_key === only)
29835
+ );
29836
+ if (driveCatalog.length === 0) return null;
29837
+ const connectedByVendor = Object.fromEntries(myConnectors.map((uc) => [uc.vendor_key, uc]));
29838
+ const microsoftConnected = !!connectedByVendor["microsoft"]?.is_connected;
29839
+ const rows = driveCatalog.map((entry) => {
29840
+ const uc = connectedByVendor[entry.vendor_key];
29841
+ if (entry.vendor_key === "microsoft_sharepoint" && !uc) {
29842
+ if (microsoftConnected) {
29843
+ return /* @__PURE__ */ jsx(
29844
+ SharePointEnableRow,
29845
+ {
29846
+ catalog: entry,
29847
+ sharePointAdminUrl
29848
+ },
29849
+ entry.vendor_key
29850
+ );
29851
+ }
29852
+ const product = driveProduct(entry.vendor_key);
29853
+ return /* @__PURE__ */ jsx(
29854
+ ImportRow,
29855
+ {
29856
+ testId: `onedrive-provider-row-${entry.vendor_key}`,
29857
+ logo: /* @__PURE__ */ jsx(
29858
+ VendorLogo,
29859
+ {
29860
+ vendorKey: entry.vendor_key,
29861
+ product: product.glyph,
29862
+ className: "h-7 w-7"
29863
+ }
29864
+ ),
29865
+ name: product.name
29866
+ },
29867
+ entry.vendor_key
29868
+ );
29869
+ }
29870
+ return /* @__PURE__ */ jsx(
29871
+ OneDriveProviderRow,
29872
+ {
29873
+ catalog: entry,
29874
+ userConnector: uc,
29875
+ workspaceExtId,
29876
+ workspaceName,
29877
+ onViewProgress
29878
+ },
29879
+ entry.vendor_key
29880
+ );
29881
+ }).filter(Boolean);
29882
+ if (rows.length === 0) return null;
29883
+ return /* @__PURE__ */ jsx(ImportList, { "data-testid": "onedrive-import-panel", children: rows });
29884
+ }
29885
+ function useHasAccountsImport() {
29886
+ const isVendorVisible = useConnectorVendorVisibility();
29887
+ return isVendorVisible("microsoft") || isVendorVisible("gmail");
29888
+ }
29889
+ function ConnectedAccountsImport({
29890
+ workspaceExtId,
29891
+ workspaceName,
29892
+ onViewProgress,
29893
+ sharePointAdminUrl
29894
+ }) {
29895
+ const isVendorVisible = useConnectorVendorVisibility();
29896
+ if (!isVendorVisible("microsoft") && !isVendorVisible("gmail")) return null;
29897
+ return /* @__PURE__ */ jsx(
29898
+ EmailImportPanel,
29899
+ {
29900
+ workspaceExtId,
29901
+ workspaceName,
29902
+ onViewProgress,
29903
+ microsoftExtra: (
29904
+ // Two drive products ride Microsoft: OneDrive (the `microsoft` grant) and SharePoint
29905
+ // (its own grant, behind its own visibility toggle).
29906
+ /* @__PURE__ */ jsxs("div", { className: "divide-y divide-border", "data-testid": "upload-source-onedrive", children: [
29907
+ /* @__PURE__ */ jsx(
29908
+ DriveImportPanel,
29909
+ {
29910
+ workspaceExtId,
29911
+ workspaceName,
29912
+ onViewProgress,
29913
+ sharePointAdminUrl,
29914
+ only: "microsoft"
29915
+ }
29916
+ ),
29917
+ isVendorVisible("microsoft_sharepoint") && /* @__PURE__ */ jsx("div", { "data-testid": "upload-source-sharepoint", children: /* @__PURE__ */ jsx(
29918
+ DriveImportPanel,
29919
+ {
29920
+ workspaceExtId,
29921
+ workspaceName,
29922
+ onViewProgress,
29923
+ sharePointAdminUrl,
29924
+ only: "microsoft_sharepoint"
29925
+ }
29926
+ ) })
29927
+ ] })
29928
+ ),
29929
+ googleExtra: /* @__PURE__ */ jsx("div", { "data-testid": "upload-source-googledrive", children: /* @__PURE__ */ jsx(
29930
+ DriveImportPanel,
29931
+ {
29932
+ workspaceExtId,
29933
+ workspaceName,
29934
+ onViewProgress,
29935
+ sharePointAdminUrl,
29936
+ only: "gmail"
29937
+ }
29938
+ ) })
29939
+ }
29940
+ );
29941
+ }
29008
29942
  var UNTITLED = "Untitled";
29009
29943
  function useDatabaseCellSources(databases) {
29010
29944
  const workspaceId = useArbiSessionState((state) => state.workspaceId);
@@ -37699,6 +38633,763 @@ function ConnectedMessageList({ messages }) {
37699
38633
  /* @__PURE__ */ jsx(ConnectedThreadsPreview, { open: previewOpen, onOpenChange: setPreviewOpen })
37700
38634
  ] });
37701
38635
  }
38636
+ function ThreadSearch({ children, ResultsBoundary = ErrorBoundary }) {
38637
+ const [query, setQuery] = useState("");
38638
+ const [submitted, setSubmitted] = useState("");
38639
+ const selectedWorkspaceId = useArbiSessionState((s) => s.workspaceId);
38640
+ const { notify: notify18, openConversation } = useBlocksEnvironment();
38641
+ const search = useConversationSearch();
38642
+ const isSearching = search.isPending;
38643
+ const groups = useMemo(
38644
+ () => search.isError ? [] : (search.data?.results ?? []).map((g) => ({
38645
+ id: g.conversation_ext_id,
38646
+ title: g.title,
38647
+ matches: g.messages.map((m) => ({
38648
+ id: m.message_ext_id,
38649
+ role: m.role,
38650
+ score: m.score,
38651
+ snippet: m.snippet
38652
+ }))
38653
+ })),
38654
+ [search.data, search.isError]
38655
+ );
38656
+ const handleSearch = useCallback(() => {
38657
+ const q = query.trim();
38658
+ if (!q || !selectedWorkspaceId || isSearching) return;
38659
+ setSubmitted(q);
38660
+ search.mutate(
38661
+ { query: q, search_mode: "hybrid", limit: 20 },
38662
+ {
38663
+ onError: (err) => {
38664
+ console.error("Conversation search failed", err);
38665
+ notify18("Conversation search failed", "error");
38666
+ }
38667
+ }
38668
+ );
38669
+ }, [query, selectedWorkspaceId, isSearching, search, notify18]);
38670
+ const clearSearch = useCallback(() => {
38671
+ setQuery("");
38672
+ setSubmitted("");
38673
+ }, []);
38674
+ const openHit = useCallback(
38675
+ (conversationId, messageId) => {
38676
+ openConversation(conversationId, messageId ? { messageId } : void 0);
38677
+ },
38678
+ [openConversation]
38679
+ );
38680
+ return /* @__PURE__ */ jsx(
38681
+ ConversationSearchView,
38682
+ {
38683
+ query,
38684
+ onQueryChange: setQuery,
38685
+ onSubmit: handleSearch,
38686
+ canSubmit: !!query.trim() && !!selectedWorkspaceId && !isSearching,
38687
+ isSearching,
38688
+ submittedQuery: submitted,
38689
+ groups,
38690
+ onOpenConversation: openHit,
38691
+ onClear: clearSearch,
38692
+ ResultsBoundary,
38693
+ children
38694
+ }
38695
+ );
38696
+ }
38697
+ var DEFAULT_THREAD_VISIBILITY = { me: null, workspace: null };
38698
+ var relativeTime2 = (iso) => formatRelativeTime(iso, { style: "short" });
38699
+ var LIST_LABELS = {
38700
+ emptyTitle: "Nothing here yet",
38701
+ emptyMessage: "Use New: just type what you need, or fill in an owner and a due date. You always decide when a thread is done.",
38702
+ untitled: `Untitled ${getEntityLabel("CONVERSATION").toLowerCase()}`,
38703
+ noMatches: `No ${getEntityLabel("CONVERSATION", "PLURAL").toLowerCase()} match.`,
38704
+ selectAll: "Select all"
38705
+ };
38706
+ var RENAME_DIALOG = { testId: "rename-conversation-modal" };
38707
+ function useStableRecencyOrder(rows) {
38708
+ const orderRef = useRef([]);
38709
+ return useMemo(() => {
38710
+ const byRecency = [...rows].sort(
38711
+ (a, b) => new Date(b.updated_at || b.created_at || 0).getTime() - new Date(a.updated_at || a.created_at || 0).getTime()
38712
+ );
38713
+ const present = new Set(byRecency.map((r) => r.external_id));
38714
+ const known = new Set(orderRef.current);
38715
+ const added = byRecency.map((r) => r.external_id).filter((id) => !known.has(id));
38716
+ orderRef.current = [...added, ...orderRef.current.filter((id) => present.has(id))];
38717
+ const byId = new Map(byRecency.map((r) => [r.external_id, r]));
38718
+ return orderRef.current.flatMap((id) => byId.get(id) ?? []);
38719
+ }, [rows]);
38720
+ }
38721
+ function ConnectedThreadsPage({
38722
+ showHeader = true,
38723
+ search = false,
38724
+ ResultsBoundary,
38725
+ focusLauncher,
38726
+ layout = "list",
38727
+ workflowActions
38728
+ }) {
38729
+ const mode = layout === "inbox" ? "tasks" : "threads";
38730
+ const { confirm, notify: notify18, openConversation, openDocument } = useBlocksEnvironment();
38731
+ const { conversations: all, isLoading } = useConversationItems();
38732
+ const [doneFilter] = useTransientView("threads.done", "exclude");
38733
+ const [visibilityFilters] = useTransientView("threads.visibility", DEFAULT_THREAD_VISIBILITY);
38734
+ const [meetingFilter] = useTransientView("threads.meetings", null);
38735
+ const [topbarFilterQuery, setTopbarFilterQuery] = useTransientView("topbar.filter", "");
38736
+ const currentUserExtId = useArbiSession().user?.external_id;
38737
+ const listed = useMemo(
38738
+ () => all.filter((c) => mode === "threads" || c.status != null),
38739
+ [all, mode]
38740
+ );
38741
+ const tasks = useStableRecencyOrder(listed);
38742
+ const updateConversation = useUpdateConversation();
38743
+ const deleteConversation = useDeleteConversation();
38744
+ const people = useTaskPeople();
38745
+ const renderPerson = useRenderTaskPerson();
38746
+ const canEditShared = useCanEditShared();
38747
+ const isWorkspaceOwner = useIsWorkspaceOwner();
38748
+ const { data: agents = [] } = useAgents();
38749
+ const { data: workflows = [] } = useWorkflows();
38750
+ const agentNames = useMemo(
38751
+ () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),
38752
+ [agents]
38753
+ );
38754
+ const workflowNames = useMemo(
38755
+ () => Object.fromEntries(workflows.map((w) => [w.external_id, w.name])),
38756
+ [workflows]
38757
+ );
38758
+ const runConversation = useRunConversation();
38759
+ const [busyId, setBusyId] = useState(null);
38760
+ const [editorOpen, setEditorOpen] = useState(false);
38761
+ const [editing, setEditing] = useState(null);
38762
+ const [startOpen, setStartOpen] = useState(false);
38763
+ const [parentForNew, setParentForNew] = useState(void 0);
38764
+ const nameOf = (task) => task.title?.trim() || task.workflow_ext_id && workflowNames[task.workflow_ext_id] || "Untitled task";
38765
+ const openCreate = () => {
38766
+ setParentForNew(void 0);
38767
+ setStartOpen(true);
38768
+ };
38769
+ const openAddSubtask = (parent) => {
38770
+ setParentForNew(parent.external_id);
38771
+ setStartOpen(true);
38772
+ };
38773
+ const [renaming, setRenaming] = useState(null);
38774
+ const [newTitle, setNewTitle] = useState("");
38775
+ const [isExportOpen, setIsExportOpen] = useState(false);
38776
+ const [exportRows, setExportRows] = useState([]);
38777
+ const openEdit = (task) => {
38778
+ if (mode === "threads" || !task.status) {
38779
+ setRenaming(task);
38780
+ setNewTitle(task.title ?? "");
38781
+ return;
38782
+ }
38783
+ setEditing(task);
38784
+ setEditorOpen(true);
38785
+ };
38786
+ const act = async (task, action, success, failure) => {
38787
+ setBusyId(task.external_id);
38788
+ try {
38789
+ await action();
38790
+ if (success) notify18(success, "success");
38791
+ } catch (error) {
38792
+ notify18(
38793
+ error instanceof ArbiApiError && error.detail ? `${failure}: ${error.detail}` : failure,
38794
+ "error"
38795
+ );
38796
+ } finally {
38797
+ setBusyId(null);
38798
+ }
38799
+ };
38800
+ const patch = (task, body) => updateConversation.mutateAsync({ conversationId: task.external_id, patch: body });
38801
+ const setStatus = (task, status, success) => act(task, () => patch(task, { status }), success, "Failed to update task");
38802
+ const handleToggleShared = (task, shouldShare) => act(
38803
+ task,
38804
+ () => patch(task, { shared: shouldShare }),
38805
+ shouldShare ? `Shared \u201C${nameOf(task)}\u201D with the workspace` : `Made \u201C${nameOf(task)}\u201D private`,
38806
+ "Failed to change who can see the task"
38807
+ );
38808
+ const handleMove = (task, parentId) => act(
38809
+ task,
38810
+ () => patch(task, { parent_conversation_ext_id: parentId }),
38811
+ parentId ? `Moved \u201C${nameOf(task)}\u201D` : `Moved \u201C${nameOf(task)}\u201D to the top level`,
38812
+ "Failed to move task"
38813
+ );
38814
+ const handleDelete = async (task) => {
38815
+ const subtasks = tasks.filter((t) => t.parent_conversation_ext_id === task.external_id).length;
38816
+ const confirmed = await confirm({
38817
+ message: `Delete \u201C${nameOf(task)}\u201D? This can't be undone from here.${subtasks ? ` Its ${subtasks === 1 ? "sub-task stays" : `${subtasks} sub-tasks stay`} and ${subtasks === 1 ? "moves" : "move"} to the top level.` : ""}`,
38818
+ title: "Delete task"
38819
+ });
38820
+ if (!confirmed) return;
38821
+ await act(
38822
+ task,
38823
+ () => deleteConversation.mutateAsync(task.external_id),
38824
+ `Deleted \u201C${nameOf(task)}\u201D`,
38825
+ "Failed to delete task"
38826
+ );
38827
+ };
38828
+ const forEach = async (rows, one, done) => {
38829
+ let failed = 0;
38830
+ for (const task of rows) {
38831
+ try {
38832
+ await one(task);
38833
+ } catch {
38834
+ failed += 1;
38835
+ }
38836
+ }
38837
+ notify18(
38838
+ failed ? `${failed} of ${rows.length} could not be changed: you may not be allowed to change them` : done,
38839
+ failed ? "error" : "success"
38840
+ );
38841
+ };
38842
+ const handleMarkDoneMany = (rows) => forEach(rows, (task) => patch(task, { status: "done" }), `Marked ${rows.length} done`);
38843
+ const handleDeleteMany = async (rows) => {
38844
+ const named = rows.slice(0, 3).map((task) => `"${nameOf(task)}"`).join(", ");
38845
+ const more = rows.length - 3;
38846
+ const confirmed = await confirm({
38847
+ message: `Delete ${more > 0 ? `${named} and ${more} more` : named}? This cannot be undone.`,
38848
+ title: `Delete ${rows.length} item${rows.length === 1 ? "" : "s"}`
38849
+ });
38850
+ if (!confirmed) return;
38851
+ await forEach(
38852
+ rows,
38853
+ (task) => deleteConversation.mutateAsync(task.external_id),
38854
+ `Deleted ${rows.length}`
38855
+ );
38856
+ };
38857
+ const handleSaveRename = useCallback(() => {
38858
+ if (!renaming || !newTitle.trim()) return;
38859
+ updateConversation.mutate(
38860
+ { conversationId: renaming.external_id, patch: { title: newTitle.trim() } },
38861
+ {
38862
+ onSuccess: () => {
38863
+ notify18("Conversation renamed successfully", "success");
38864
+ setRenaming(null);
38865
+ setNewTitle("");
38866
+ },
38867
+ onError: (error) => {
38868
+ console.error("Failed to rename conversation:", error);
38869
+ notify18("Failed to rename conversation", "error");
38870
+ }
38871
+ }
38872
+ );
38873
+ }, [renaming, newTitle, updateConversation, notify18]);
38874
+ const handleBulkShare = async (rows) => {
38875
+ const unshared = rows.filter((c) => !c.is_shared);
38876
+ if (unshared.length === 0) {
38877
+ await confirm({
38878
+ message: "All selected conversations are already shared",
38879
+ title: "Info",
38880
+ kind: "alert"
38881
+ });
38882
+ return;
38883
+ }
38884
+ const noun = getEntityLabel("CONVERSATION", unshared.length > 1 ? "PLURAL" : "SINGULAR");
38885
+ const confirmed = await confirm({
38886
+ message: `Are you sure you want to share ${unshared.length} ${noun.toLowerCase()} with everyone in the current ${getEntityLabel("WORKSPACE").toLowerCase()}? You can make them private again later.`,
38887
+ title: `Share ${getEntityLabel("CONVERSATION", "PLURAL")}`
38888
+ });
38889
+ if (!confirmed) return;
38890
+ try {
38891
+ await Promise.all(
38892
+ unshared.map(
38893
+ (c) => updateConversation.mutateAsync({ conversationId: c.external_id, patch: { shared: true } })
38894
+ )
38895
+ );
38896
+ notify18(`${unshared.length} ${noun.toLowerCase()} shared successfully`, "success");
38897
+ } catch (error) {
38898
+ console.error("Failed to share conversations:", error);
38899
+ notify18("Failed to share some conversations", "error");
38900
+ }
38901
+ };
38902
+ const { data: workspaceDocs } = useDocuments();
38903
+ const outputsByTask = useMemo(() => {
38904
+ const out = {};
38905
+ for (const [conversationId, docs] of Object.entries(
38906
+ groupOutputsByConversation(workspaceDocs ?? [])
38907
+ )) {
38908
+ out[conversationId] = docs.map((d) => ({
38909
+ id: d.external_id,
38910
+ name: getDocumentTitle(d, d.external_id)
38911
+ }));
38912
+ }
38913
+ return out;
38914
+ }, [workspaceDocs]);
38915
+ const handleOpenOutput = (documentId) => openDocument(documentId);
38916
+ const handleGrantAccess = (task) => act(
38917
+ task,
38918
+ () => runConversation.mutateAsync(task.external_id),
38919
+ `Running \u201C${nameOf(task)}\u201D`,
38920
+ "Failed to run task"
38921
+ );
38922
+ const threadLabels = useThreadLabels(canEditShared);
38923
+ const selectionActions = (selected, isCompact) => {
38924
+ const mine = selected.every((c) => c.created_by_ext_id === currentUserExtId);
38925
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
38926
+ mode === "threads" && selected.every((row2) => row2.is_owner || row2.is_shared && canEditShared) && selected.some((row2) => row2.status !== "done") && !selected.some((row2) => row2.in_progress || row2.status === "generating") && /* @__PURE__ */ jsx(
38927
+ SelectionBarAction,
38928
+ {
38929
+ icon: CheckCheck,
38930
+ label: "Mark Done",
38931
+ onClick: () => void handleMarkDoneMany(selected),
38932
+ isCompact,
38933
+ testId: "threads-bulk-done"
38934
+ }
38935
+ ),
38936
+ threadLabels.renderBulkLabels(selected, isCompact),
38937
+ mine && selected.some((c) => !c.is_shared) && /* @__PURE__ */ jsx(
38938
+ VisibilityToggle,
38939
+ {
38940
+ items: selected,
38941
+ onToggle: () => void handleBulkShare(selected),
38942
+ disablePrivate: true,
38943
+ showLabel: false,
38944
+ tooltipInactive: "Share all with workspace members",
38945
+ tooltipMixed: "Share all with workspace members (some already shared)",
38946
+ "data-testid": "bulk-shared-toggle"
38947
+ }
38948
+ ),
38949
+ /* @__PURE__ */ jsx(
38950
+ SelectionBarAction,
38951
+ {
38952
+ icon: FolderUp,
38953
+ label: "Export",
38954
+ onClick: () => {
38955
+ setExportRows(selected);
38956
+ setIsExportOpen(true);
38957
+ },
38958
+ isCompact,
38959
+ tooltip: `Export the selected ${getEntityLabel("CONVERSATION", "PLURAL").toLowerCase()} to another ${getEntityLabel("WORKSPACE").toLowerCase()}`,
38960
+ testId: "export-chats-button"
38961
+ }
38962
+ ),
38963
+ mode === "threads" && selected.every((row2) => row2.is_owner || isWorkspaceOwner) && /* @__PURE__ */ jsx(
38964
+ SelectionBarAction,
38965
+ {
38966
+ icon: Trash2,
38967
+ label: "Delete",
38968
+ className: "text-red-text hover:bg-red-bg hover:text-red-text",
38969
+ onClick: () => void handleDeleteMany(selected),
38970
+ isCompact,
38971
+ testId: "threads-bulk-delete"
38972
+ }
38973
+ )
38974
+ ] });
38975
+ };
38976
+ const page = /* @__PURE__ */ jsxs(
38977
+ "div",
38978
+ {
38979
+ className: "flex h-full min-h-0 flex-col",
38980
+ "data-testid": mode === "tasks" ? "tasks-page" : "threads-page",
38981
+ children: [
38982
+ /* @__PURE__ */ jsx("main", { className: "flex min-h-0 flex-1 flex-col bg-background", children: mode === "threads" ? /* @__PURE__ */ jsx(
38983
+ ConversationListView,
38984
+ {
38985
+ showHeader,
38986
+ conversations: tasks,
38987
+ doneFilter,
38988
+ visibilityFilters,
38989
+ meetingFilter,
38990
+ renderThread: (row2) => /* @__PURE__ */ jsx(
38991
+ ConversationEntity,
38992
+ {
38993
+ conversation: row2,
38994
+ showRePrefix: false,
38995
+ labelMaxWidth: "max-w-full",
38996
+ className: "w-full max-w-full [&_.truncate]:line-clamp-2 [&_.truncate]:whitespace-normal [&_.truncate]:break-words [&_.truncate]:text-left",
38997
+ "data-testid": `thread-open-${row2.external_id}`
38998
+ }
38999
+ ),
39000
+ renderLabels: threadLabels.renderLabels,
39001
+ labelText: threadLabels.labelText,
39002
+ renderBy: (row2) => /* @__PURE__ */ jsx(
39003
+ ConversationTurnSpeaker,
39004
+ {
39005
+ variant: "icon",
39006
+ role: row2.last_message_role,
39007
+ actor: row2.last_message_actor,
39008
+ currentUserId: currentUserExtId,
39009
+ colorClass: row2.last_message_actor ? getUserAvatarColor(row2.last_message_actor.external_id) : void 0
39010
+ }
39011
+ ),
39012
+ renderStatus: (row2) => /* @__PURE__ */ jsx(ConversationStatusCell, { conversation: row2 }),
39013
+ isLoading,
39014
+ filterText: topbarFilterQuery ?? "",
39015
+ formatDate: relativeTime2,
39016
+ onOpen: (c) => openConversation(c.external_id),
39017
+ onRename: openEdit,
39018
+ onDelete: handleDelete,
39019
+ canEditShared,
39020
+ isWorkspaceOwner,
39021
+ selectionActions,
39022
+ footer: /* @__PURE__ */ jsx(ConnectedThreadLauncher, { autoFocus: focusLauncher })
39023
+ }
39024
+ ) : /* @__PURE__ */ jsx(
39025
+ TaskInbox,
39026
+ {
39027
+ tasks,
39028
+ isLoading,
39029
+ ...workflowActions,
39030
+ onCreate: openCreate,
39031
+ filterText: topbarFilterQuery ?? "",
39032
+ labels: LIST_LABELS,
39033
+ gridId: "conversation-list-grid-v4",
39034
+ onFilterTextChange: (text2) => setTopbarFilterQuery(text2),
39035
+ outputsByTask,
39036
+ onOpenActivity: (task) => openConversation(task.external_id),
39037
+ formatRelative: relativeTime2,
39038
+ onOpenOutput: handleOpenOutput,
39039
+ busyId,
39040
+ formatDate: formatFriendlyDate,
39041
+ onOpenThread: (conversationId) => openConversation(conversationId),
39042
+ onMarkDone: (task) => setStatus(task, "done", `Marked \u201C${nameOf(task)}\u201D done`),
39043
+ onReopen: (task) => setStatus(task, "todo", `Reopened \u201C${nameOf(task)}\u201D`),
39044
+ people,
39045
+ agentNames,
39046
+ workflowNames,
39047
+ canEditShared,
39048
+ isWorkspaceOwner,
39049
+ renderPerson,
39050
+ onToggleShared: handleToggleShared,
39051
+ onEdit: openEdit,
39052
+ onDelete: handleDelete,
39053
+ onAddSubtask: openAddSubtask,
39054
+ onMove: handleMove,
39055
+ onMarkDoneMany: handleMarkDoneMany,
39056
+ onDeleteMany: handleDeleteMany,
39057
+ onGrantAccess: handleGrantAccess,
39058
+ selectionActions
39059
+ }
39060
+ ) }),
39061
+ /* @__PURE__ */ jsx(
39062
+ ConnectedTaskStartDialog,
39063
+ {
39064
+ open: startOpen,
39065
+ onOpenChange: setStartOpen,
39066
+ initialParentId: parentForNew
39067
+ }
39068
+ ),
39069
+ /* @__PURE__ */ jsx(ConnectedTaskComposer, { open: editorOpen, onOpenChange: setEditorOpen, task: editing }),
39070
+ /* @__PURE__ */ jsx(
39071
+ ConnectedExportDialog,
39072
+ {
39073
+ open: isExportOpen,
39074
+ onOpenChange: setIsExportOpen,
39075
+ items: exportRows.map((c) => ({ extId: c.external_id, label: nameOf(c) })),
39076
+ entityType: "CONVERSATION",
39077
+ testId: "export-chats-modal"
39078
+ }
39079
+ ),
39080
+ /* @__PURE__ */ jsx(
39081
+ RenameDialog,
39082
+ {
39083
+ open: !!renaming,
39084
+ onClose: () => {
39085
+ setRenaming(null);
39086
+ setNewTitle("");
39087
+ },
39088
+ title: `Rename ${getEntityLabel("CONVERSATION")}`,
39089
+ labels: { description: "Rename the conversation title" },
39090
+ fieldLabel: `${getEntityLabel("CONVERSATION")} Title`,
39091
+ placeholder: "Enter title",
39092
+ value: newTitle,
39093
+ onChange: setNewTitle,
39094
+ onSave: handleSaveRename,
39095
+ canSave: !!newTitle.trim(),
39096
+ dialogTestId: RENAME_DIALOG.testId
39097
+ }
39098
+ )
39099
+ ]
39100
+ }
39101
+ );
39102
+ return search ? /* @__PURE__ */ jsx(ThreadSearch, { ResultsBoundary, children: page }) : page;
39103
+ }
39104
+ function ConnectedFilterDropdown({
39105
+ stateKey,
39106
+ ...props
39107
+ }) {
39108
+ const [open, setOpen] = useTransientView(`filter.dropdown.${stateKey}`, false);
39109
+ return /* @__PURE__ */ jsx(
39110
+ TriStateFilterMenu,
39111
+ {
39112
+ ...props,
39113
+ testId: `${stateKey}-filter-button`,
39114
+ open,
39115
+ onOpenChange: setOpen
39116
+ }
39117
+ );
39118
+ }
39119
+ function SearchSparkleIcon({ className }) {
39120
+ return /* @__PURE__ */ jsxs(
39121
+ "svg",
39122
+ {
39123
+ viewBox: "0 0 24 24",
39124
+ fill: "none",
39125
+ stroke: "currentColor",
39126
+ strokeWidth: "2",
39127
+ strokeLinecap: "round",
39128
+ strokeLinejoin: "round",
39129
+ "aria-hidden": "true",
39130
+ className,
39131
+ children: [
39132
+ /* @__PURE__ */ jsx("circle", { cx: "10.5", cy: "10.5", r: "7.5" }),
39133
+ /* @__PURE__ */ jsx("path", { d: "m21 21-5.2-5.2" }),
39134
+ /* @__PURE__ */ jsx(
39135
+ "path",
39136
+ {
39137
+ d: "M10.5 6.8c.35 2.1 1.6 3.35 3.7 3.7-2.1.35-3.35 1.6-3.7 3.7-.35-2.1-1.6-3.35-3.7-3.7 2.1-.35 3.35-1.6 3.7-3.7Z",
39138
+ fill: "currentColor",
39139
+ strokeWidth: "1"
39140
+ }
39141
+ )
39142
+ ]
39143
+ }
39144
+ );
39145
+ }
39146
+ function SemanticSearchButton({ active, onClick }) {
39147
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
39148
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
39149
+ Button,
39150
+ {
39151
+ type: "button",
39152
+ variant: "ghost",
39153
+ size: "icon",
39154
+ onClick,
39155
+ "aria-label": "Semantic search",
39156
+ "aria-pressed": active,
39157
+ "data-testid": "semantic-search-button",
39158
+ className: active ? "bg-muted text-primary" : "text-muted-foreground hover:text-foreground",
39159
+ children: /* @__PURE__ */ jsx(SearchSparkleIcon, { className: "size-5" })
39160
+ }
39161
+ ) }),
39162
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Semantic search" }) })
39163
+ ] });
39164
+ }
39165
+ var DEFAULT_THREAD_VISIBILITY2 = { me: null, workspace: null };
39166
+ function ConnectedConversationPage({
39167
+ renderComposerAccessory,
39168
+ ResultsBoundary,
39169
+ onGoToDocuments,
39170
+ modelSelector,
39171
+ composerAccessory,
39172
+ composerTools,
39173
+ ConversationThread: ConversationThread2
39174
+ }) {
39175
+ const session = useArbiSessionStore();
39176
+ const { openFiles } = useBlocksEnvironment();
39177
+ useEffect(() => () => session.setActiveCitationKey(null), [session]);
39178
+ const { isInChat, setActiveTab } = useThreadTabs();
39179
+ const [doneFilter, setDoneFilter] = useTransientView(
39180
+ "threads.done",
39181
+ "exclude"
39182
+ );
39183
+ const [visibilityFilters, setVisibilityFilters] = useTransientView(
39184
+ "threads.visibility",
39185
+ DEFAULT_THREAD_VISIBILITY2
39186
+ );
39187
+ const [meetingFilter, setMeetingFilter] = useTransientView(
39188
+ "threads.meetings",
39189
+ null
39190
+ );
39191
+ const [threadFilter, setThreadFilter] = useTransientView("topbar.filter", "");
39192
+ const { data: userSettings } = useUserSettings();
39193
+ const isDeveloper = userSettings?.developer === true;
39194
+ const showPaMode = userSettings?.show_pa_mode ?? false;
39195
+ const searchEnabled = userSettings?.show_conversation_search === true;
39196
+ const [semanticSearchOpen, setSemanticSearchOpen] = useState(false);
39197
+ const handleSelectSource = (source) => {
39198
+ if (source === "internet") {
39199
+ setUrlDialogOpen(true);
39200
+ return;
39201
+ }
39202
+ openDialog("upload", { tab: "upload", source });
39203
+ };
39204
+ const handleGoToDocuments = () => {
39205
+ closeDialog("conversationDocuments");
39206
+ if (onGoToDocuments) onGoToDocuments();
39207
+ else openFiles();
39208
+ };
39209
+ const handleStatusClick = () => {
39210
+ openDialog("conversationDocuments");
39211
+ };
39212
+ const currentConversationId = useArbiSessionState((state) => state.conversationId);
39213
+ const { conversations: taskItems } = useConversationItems();
39214
+ const conversations = taskItems;
39215
+ const workspaceId = useArbiSessionState((state) => state.workspaceId);
39216
+ const { data: workspaces = [] } = useWorkspaces();
39217
+ const workspace = workspaces.find((item) => item.external_id === workspaceId);
39218
+ const workspaceRole = useWorkspaceRole();
39219
+ const isGuest = workspaceRole === "guest";
39220
+ const canUpload = workspaceRole !== null && !isGuest;
39221
+ const [urlDialogOpen, setUrlDialogOpen] = useState(false);
39222
+ const [focusLauncher, setFocusLauncher] = useState(false);
39223
+ useEffect(() => {
39224
+ if (isInChat) setFocusLauncher(false);
39225
+ }, [isInChat]);
39226
+ const uploadUrls = useAddFromUrls({
39227
+ onZipFiles: (files) => openDialog("upload", { tab: "upload", files, source: "computer" })
39228
+ });
39229
+ const uploadDisabledReason = isGuest ? "Guests cannot upload documents in this workspace" : "You cannot upload to this workspace";
39230
+ const { data: allWorkspaceDocuments = [] } = useDocuments();
39231
+ const { data: conversationDocuments } = useConversationDocuments();
39232
+ const pinnedDocumentId = useArbiSessionState((state) => state.pinnedDocumentId);
39233
+ const pinnedRef = parseVersionRef(pinnedDocumentId);
39234
+ const pinnedDocument = conversationDocuments?.find((d) => d.external_id === pinnedRef.docId) ?? allWorkspaceDocuments?.find((d) => d.external_id === pinnedRef.docId);
39235
+ const pinnedTitle = pinnedDocument ? `${getDocumentTitle(pinnedDocument)}${pinnedRef.version ? ` (version ${pinnedRef.version})` : ""}` : null;
39236
+ const startNewChat = (asPaChat) => {
39237
+ session.clearConversationError(currentConversationId || "new");
39238
+ session.startNewConversation();
39239
+ session.openThreadTab(null);
39240
+ session.setPaMode(true);
39241
+ };
39242
+ const threadFilterDropdown = /* @__PURE__ */ jsx(
39243
+ ConnectedFilterDropdown,
39244
+ {
39245
+ stateKey: "threads",
39246
+ filterStates: /* @__PURE__ */ new Map([
39247
+ ["done", doneFilter],
39248
+ ["me", visibilityFilters.me],
39249
+ ["workspace", visibilityFilters.workspace],
39250
+ ["meeting", meetingFilter]
39251
+ ]),
39252
+ onFiltersChange: (filters) => {
39253
+ setDoneFilter(filters.get("done") ?? null);
39254
+ setMeetingFilter(filters.get("meeting") ?? null);
39255
+ setVisibilityFilters({
39256
+ me: filters.get("me") ?? null,
39257
+ workspace: filters.get("workspace") ?? null
39258
+ });
39259
+ },
39260
+ options: [
39261
+ {
39262
+ id: "me",
39263
+ label: "Only Me",
39264
+ count: conversations.filter((thread) => !thread.is_shared).length
39265
+ },
39266
+ {
39267
+ id: "workspace",
39268
+ label: "Workspace",
39269
+ count: conversations.filter((thread) => thread.is_shared).length
39270
+ },
39271
+ {
39272
+ id: "meeting",
39273
+ label: "Meetings",
39274
+ count: conversations.filter((thread) => !!thread.meeting_call_ext_id).length
39275
+ },
39276
+ {
39277
+ id: "done",
39278
+ label: "Done",
39279
+ count: conversations.filter((thread) => thread.status === "done").length
39280
+ }
39281
+ ],
39282
+ hasExternalActiveState: Boolean(threadFilter.trim()),
39283
+ renderChevron: true,
39284
+ disableHoverOpen: true,
39285
+ align: "start"
39286
+ }
39287
+ );
39288
+ const threadFilterBox = /* @__PURE__ */ jsx(
39289
+ FilterInput,
39290
+ {
39291
+ filter: threadFilterDropdown,
39292
+ borderless: true,
39293
+ value: threadFilter,
39294
+ onChange: setThreadFilter,
39295
+ fields: ["text"],
39296
+ onFieldsChange: () => {
39297
+ },
39298
+ hideFieldPicker: true,
39299
+ ariaLabel: "Filter threads",
39300
+ labels: doneFilter === "exclude" ? { placeholder: "Done hidden" } : void 0,
39301
+ className: "w-44 max-w-[40vw]"
39302
+ }
39303
+ );
39304
+ const { data: workspaceTags = [] } = useTags();
39305
+ const historyCount = filterConversationRows(
39306
+ conversations,
39307
+ threadFilter,
39308
+ (row2) => workspaceTags.filter((tag) => row2.label_ext_ids?.includes(tag.external_id)).map((tag) => tag.name).join(" "),
39309
+ doneFilter,
39310
+ visibilityFilters,
39311
+ meetingFilter
39312
+ ).length;
39313
+ const historyFiltered = Boolean(threadFilter.trim()) || doneFilter !== null || meetingFilter !== null || Object.values(visibilityFilters).some(Boolean);
39314
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39315
+ /* @__PURE__ */ jsxs(ConversationRoot, { children: [
39316
+ /* @__PURE__ */ jsxs(ConversationHeader, { children: [
39317
+ /* @__PURE__ */ jsx(
39318
+ ConnectedThreadTabs,
39319
+ {
39320
+ historyCount,
39321
+ historyFiltered,
39322
+ historyActions: threadFilterBox,
39323
+ rightContent: (isCompact) => /* @__PURE__ */ jsxs(ConversationHeaderActions, { children: [
39324
+ searchEnabled && /* @__PURE__ */ jsx(
39325
+ SemanticSearchButton,
39326
+ {
39327
+ active: semanticSearchOpen && !isInChat,
39328
+ onClick: () => {
39329
+ if (isInChat) {
39330
+ setActiveTab("history");
39331
+ setSemanticSearchOpen(true);
39332
+ } else {
39333
+ setSemanticSearchOpen((open) => !open);
39334
+ }
39335
+ }
39336
+ }
39337
+ ),
39338
+ isInChat && /* @__PURE__ */ jsx(ConnectedConversationCallActions, {}),
39339
+ isInChat && /* @__PURE__ */ jsx(
39340
+ NewChatButton,
39341
+ {
39342
+ entityLabel: "Task",
39343
+ labels: { newEntity: () => "New Task" },
39344
+ isCompact,
39345
+ onClick: () => {
39346
+ setFocusLauncher(true);
39347
+ setActiveTab("history");
39348
+ }
39349
+ }
39350
+ ),
39351
+ showPaMode && /* @__PURE__ */ jsx(NewPaChatButton, { isCompact, onClick: () => startNewChat() })
39352
+ ] })
39353
+ }
39354
+ ),
39355
+ isInChat && /* @__PURE__ */ jsx(ConnectedThreadTaskBar, { conversationId: currentConversationId })
39356
+ ] }),
39357
+ isInChat && /* @__PURE__ */ jsx(
39358
+ ConversationThread2,
39359
+ {
39360
+ modelSelector,
39361
+ composerAccessory: renderComposerAccessory ? renderComposerAccessory({
39362
+ documents: conversationDocuments || [],
39363
+ pinnedTitle,
39364
+ onStatusClick: handleStatusClick,
39365
+ onSelectSource: handleSelectSource,
39366
+ onAddFromSources: handleGoToDocuments,
39367
+ canUpload,
39368
+ uploadDisabledReason
39369
+ }) : composerAccessory,
39370
+ composerTools: composerTools !== void 0 ? composerTools : isDeveloper && /* @__PURE__ */ jsx(
39371
+ ConversationSettingsButton,
39372
+ {
39373
+ label: `${getEntityLabel("CONVERSATION")} Settings`,
39374
+ onClick: () => openDialog("conversationSettings")
39375
+ }
39376
+ )
39377
+ }
39378
+ ),
39379
+ !isInChat && /* @__PURE__ */ jsx(ConversationHistoryPane, { children: searchEnabled && semanticSearchOpen ? /* @__PURE__ */ jsx(ConnectedThreadsPage, { showHeader: false, search: true, ResultsBoundary }) : /* @__PURE__ */ jsx(ConnectedThreadsPage, { showHeader: false, focusLauncher }) })
39380
+ ] }),
39381
+ /* @__PURE__ */ jsx(
39382
+ UrlInputDialog,
39383
+ {
39384
+ open: urlDialogOpen,
39385
+ onOpenChange: setUrlDialogOpen,
39386
+ onUrlsSubmit: uploadUrls,
39387
+ titleWorkspaceName: workspace?.name,
39388
+ titleIcon: workspace && /* @__PURE__ */ jsx(ConnectedWorkspaceEntity, { workspace, size: 24, variant: "icon" })
39389
+ }
39390
+ )
39391
+ ] });
39392
+ }
37702
39393
  function useStartRequestedDraft(enabled = true) {
37703
39394
  const session = useArbiSessionStore();
37704
39395
  useIntentRequest(
@@ -38289,7 +39980,7 @@ function useThreadScroll({
38289
39980
  scrollToBottom
38290
39981
  };
38291
39982
  }
38292
- function ConnectedConversation({
39983
+ function ConversationThread({
38293
39984
  modelSelector,
38294
39985
  composerAccessory,
38295
39986
  composerTools
@@ -38745,6 +40436,33 @@ function ConnectedConversation({
38745
40436
  slashWorkflows.launcher
38746
40437
  ] });
38747
40438
  }
40439
+ function ConnectedConversation({
40440
+ layout = "thread",
40441
+ page,
40442
+ conversationId,
40443
+ ...props
40444
+ }) {
40445
+ const session = useArbiSessionStore();
40446
+ useEffect(() => {
40447
+ if (conversationId === void 0) return;
40448
+ if (layout === "page") {
40449
+ const tabId = conversationId ?? "new";
40450
+ if (session.getState().activeThreadTabId !== tabId) session.openThreadTab(conversationId);
40451
+ } else if (session.getState().conversationId !== conversationId) {
40452
+ session.setConversationId(conversationId);
40453
+ }
40454
+ }, [conversationId, layout, session]);
40455
+ return layout === "page" ? /* @__PURE__ */ jsx(
40456
+ ConnectedConversationPage,
40457
+ {
40458
+ ...page,
40459
+ modelSelector: props.modelSelector,
40460
+ composerAccessory: props.composerAccessory,
40461
+ composerTools: props.composerTools,
40462
+ ConversationThread
40463
+ }
40464
+ ) : /* @__PURE__ */ jsx(ConversationThread, { ...props });
40465
+ }
38748
40466
  function ConnectedCompactConversation() {
38749
40467
  const containerRef = useRef(null);
38750
40468
  const inputRef = useRef(null);
@@ -41507,474 +43225,6 @@ function ConnectedAccountAccessBadge() {
41507
43225
  /* @__PURE__ */ jsx(PopoverContent, { className: "max-w-xs text-sm", align: "end", children: explanation })
41508
43226
  ] });
41509
43227
  }
41510
- function ThreadSearch({ children, ResultsBoundary = ErrorBoundary }) {
41511
- const [query, setQuery] = useState("");
41512
- const [submitted, setSubmitted] = useState("");
41513
- const selectedWorkspaceId = useArbiSessionState((s) => s.workspaceId);
41514
- const { notify: notify18, openConversation } = useBlocksEnvironment();
41515
- const search = useConversationSearch();
41516
- const isSearching = search.isPending;
41517
- const groups = useMemo(
41518
- () => search.isError ? [] : (search.data?.results ?? []).map((g) => ({
41519
- id: g.conversation_ext_id,
41520
- title: g.title,
41521
- matches: g.messages.map((m) => ({
41522
- id: m.message_ext_id,
41523
- role: m.role,
41524
- score: m.score,
41525
- snippet: m.snippet
41526
- }))
41527
- })),
41528
- [search.data, search.isError]
41529
- );
41530
- const handleSearch = useCallback(() => {
41531
- const q = query.trim();
41532
- if (!q || !selectedWorkspaceId || isSearching) return;
41533
- setSubmitted(q);
41534
- search.mutate(
41535
- { query: q, search_mode: "hybrid", limit: 20 },
41536
- {
41537
- onError: (err) => {
41538
- console.error("Conversation search failed", err);
41539
- notify18("Conversation search failed", "error");
41540
- }
41541
- }
41542
- );
41543
- }, [query, selectedWorkspaceId, isSearching, search, notify18]);
41544
- const clearSearch = useCallback(() => {
41545
- setQuery("");
41546
- setSubmitted("");
41547
- }, []);
41548
- const openHit = useCallback(
41549
- (conversationId, messageId) => {
41550
- openConversation(conversationId, messageId ? { messageId } : void 0);
41551
- },
41552
- [openConversation]
41553
- );
41554
- return /* @__PURE__ */ jsx(
41555
- ConversationSearchView,
41556
- {
41557
- query,
41558
- onQueryChange: setQuery,
41559
- onSubmit: handleSearch,
41560
- canSubmit: !!query.trim() && !!selectedWorkspaceId && !isSearching,
41561
- isSearching,
41562
- submittedQuery: submitted,
41563
- groups,
41564
- onOpenConversation: openHit,
41565
- onClear: clearSearch,
41566
- ResultsBoundary,
41567
- children
41568
- }
41569
- );
41570
- }
41571
- var DEFAULT_THREAD_VISIBILITY = { me: null, workspace: null };
41572
- var relativeTime2 = (iso) => formatRelativeTime(iso, { style: "short" });
41573
- var LIST_LABELS = {
41574
- emptyTitle: "Nothing here yet",
41575
- emptyMessage: "Use New: just type what you need, or fill in an owner and a due date. You always decide when a thread is done.",
41576
- untitled: `Untitled ${getEntityLabel("CONVERSATION").toLowerCase()}`,
41577
- noMatches: `No ${getEntityLabel("CONVERSATION", "PLURAL").toLowerCase()} match.`,
41578
- selectAll: "Select all"
41579
- };
41580
- var RENAME_DIALOG = { testId: "rename-conversation-modal" };
41581
- function useStableRecencyOrder(rows) {
41582
- const orderRef = useRef([]);
41583
- return useMemo(() => {
41584
- const byRecency = [...rows].sort(
41585
- (a, b) => new Date(b.updated_at || b.created_at || 0).getTime() - new Date(a.updated_at || a.created_at || 0).getTime()
41586
- );
41587
- const present = new Set(byRecency.map((r) => r.external_id));
41588
- const known = new Set(orderRef.current);
41589
- const added = byRecency.map((r) => r.external_id).filter((id) => !known.has(id));
41590
- orderRef.current = [...added, ...orderRef.current.filter((id) => present.has(id))];
41591
- const byId = new Map(byRecency.map((r) => [r.external_id, r]));
41592
- return orderRef.current.flatMap((id) => byId.get(id) ?? []);
41593
- }, [rows]);
41594
- }
41595
- function ConnectedThreadsPage({
41596
- showHeader = true,
41597
- search = false,
41598
- ResultsBoundary,
41599
- focusLauncher,
41600
- layout = "list",
41601
- workflowActions
41602
- }) {
41603
- const mode = layout === "inbox" ? "tasks" : "threads";
41604
- const { confirm, notify: notify18, openConversation, openDocument } = useBlocksEnvironment();
41605
- const { conversations: all, isLoading } = useConversationItems();
41606
- const [doneFilter] = useTransientView("threads.done", "exclude");
41607
- const [visibilityFilters] = useTransientView("threads.visibility", DEFAULT_THREAD_VISIBILITY);
41608
- const [meetingFilter] = useTransientView("threads.meetings", null);
41609
- const [topbarFilterQuery, setTopbarFilterQuery] = useTransientView("topbar.filter", "");
41610
- const currentUserExtId = useArbiSession().user?.external_id;
41611
- const listed = useMemo(
41612
- () => all.filter((c) => mode === "threads" || c.status != null),
41613
- [all, mode]
41614
- );
41615
- const tasks = useStableRecencyOrder(listed);
41616
- const updateConversation = useUpdateConversation();
41617
- const deleteConversation = useDeleteConversation();
41618
- const people = useTaskPeople();
41619
- const renderPerson = useRenderTaskPerson();
41620
- const canEditShared = useCanEditShared();
41621
- const isWorkspaceOwner = useIsWorkspaceOwner();
41622
- const { data: agents = [] } = useAgents();
41623
- const { data: workflows = [] } = useWorkflows();
41624
- const agentNames = useMemo(
41625
- () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),
41626
- [agents]
41627
- );
41628
- const workflowNames = useMemo(
41629
- () => Object.fromEntries(workflows.map((w) => [w.external_id, w.name])),
41630
- [workflows]
41631
- );
41632
- const runConversation = useRunConversation();
41633
- const [busyId, setBusyId] = useState(null);
41634
- const [editorOpen, setEditorOpen] = useState(false);
41635
- const [editing, setEditing] = useState(null);
41636
- const [startOpen, setStartOpen] = useState(false);
41637
- const [parentForNew, setParentForNew] = useState(void 0);
41638
- const nameOf = (task) => task.title?.trim() || task.workflow_ext_id && workflowNames[task.workflow_ext_id] || "Untitled task";
41639
- const openCreate = () => {
41640
- setParentForNew(void 0);
41641
- setStartOpen(true);
41642
- };
41643
- const openAddSubtask = (parent) => {
41644
- setParentForNew(parent.external_id);
41645
- setStartOpen(true);
41646
- };
41647
- const [renaming, setRenaming] = useState(null);
41648
- const [newTitle, setNewTitle] = useState("");
41649
- const [isExportOpen, setIsExportOpen] = useState(false);
41650
- const [exportRows, setExportRows] = useState([]);
41651
- const openEdit = (task) => {
41652
- if (mode === "threads" || !task.status) {
41653
- setRenaming(task);
41654
- setNewTitle(task.title ?? "");
41655
- return;
41656
- }
41657
- setEditing(task);
41658
- setEditorOpen(true);
41659
- };
41660
- const act = async (task, action, success, failure) => {
41661
- setBusyId(task.external_id);
41662
- try {
41663
- await action();
41664
- if (success) notify18(success, "success");
41665
- } catch (error) {
41666
- notify18(
41667
- error instanceof ArbiApiError && error.detail ? `${failure}: ${error.detail}` : failure,
41668
- "error"
41669
- );
41670
- } finally {
41671
- setBusyId(null);
41672
- }
41673
- };
41674
- const patch = (task, body) => updateConversation.mutateAsync({ conversationId: task.external_id, patch: body });
41675
- const setStatus = (task, status, success) => act(task, () => patch(task, { status }), success, "Failed to update task");
41676
- const handleToggleShared = (task, shouldShare) => act(
41677
- task,
41678
- () => patch(task, { shared: shouldShare }),
41679
- shouldShare ? `Shared \u201C${nameOf(task)}\u201D with the workspace` : `Made \u201C${nameOf(task)}\u201D private`,
41680
- "Failed to change who can see the task"
41681
- );
41682
- const handleMove = (task, parentId) => act(
41683
- task,
41684
- () => patch(task, { parent_conversation_ext_id: parentId }),
41685
- parentId ? `Moved \u201C${nameOf(task)}\u201D` : `Moved \u201C${nameOf(task)}\u201D to the top level`,
41686
- "Failed to move task"
41687
- );
41688
- const handleDelete = async (task) => {
41689
- const subtasks = tasks.filter((t) => t.parent_conversation_ext_id === task.external_id).length;
41690
- const confirmed = await confirm({
41691
- message: `Delete \u201C${nameOf(task)}\u201D? This can't be undone from here.${subtasks ? ` Its ${subtasks === 1 ? "sub-task stays" : `${subtasks} sub-tasks stay`} and ${subtasks === 1 ? "moves" : "move"} to the top level.` : ""}`,
41692
- title: "Delete task"
41693
- });
41694
- if (!confirmed) return;
41695
- await act(
41696
- task,
41697
- () => deleteConversation.mutateAsync(task.external_id),
41698
- `Deleted \u201C${nameOf(task)}\u201D`,
41699
- "Failed to delete task"
41700
- );
41701
- };
41702
- const forEach = async (rows, one, done) => {
41703
- let failed = 0;
41704
- for (const task of rows) {
41705
- try {
41706
- await one(task);
41707
- } catch {
41708
- failed += 1;
41709
- }
41710
- }
41711
- notify18(
41712
- failed ? `${failed} of ${rows.length} could not be changed: you may not be allowed to change them` : done,
41713
- failed ? "error" : "success"
41714
- );
41715
- };
41716
- const handleMarkDoneMany = (rows) => forEach(rows, (task) => patch(task, { status: "done" }), `Marked ${rows.length} done`);
41717
- const handleDeleteMany = async (rows) => {
41718
- const named = rows.slice(0, 3).map((task) => `"${nameOf(task)}"`).join(", ");
41719
- const more = rows.length - 3;
41720
- const confirmed = await confirm({
41721
- message: `Delete ${more > 0 ? `${named} and ${more} more` : named}? This cannot be undone.`,
41722
- title: `Delete ${rows.length} item${rows.length === 1 ? "" : "s"}`
41723
- });
41724
- if (!confirmed) return;
41725
- await forEach(
41726
- rows,
41727
- (task) => deleteConversation.mutateAsync(task.external_id),
41728
- `Deleted ${rows.length}`
41729
- );
41730
- };
41731
- const handleSaveRename = useCallback(() => {
41732
- if (!renaming || !newTitle.trim()) return;
41733
- updateConversation.mutate(
41734
- { conversationId: renaming.external_id, patch: { title: newTitle.trim() } },
41735
- {
41736
- onSuccess: () => {
41737
- notify18("Conversation renamed successfully", "success");
41738
- setRenaming(null);
41739
- setNewTitle("");
41740
- },
41741
- onError: (error) => {
41742
- console.error("Failed to rename conversation:", error);
41743
- notify18("Failed to rename conversation", "error");
41744
- }
41745
- }
41746
- );
41747
- }, [renaming, newTitle, updateConversation, notify18]);
41748
- const handleBulkShare = async (rows) => {
41749
- const unshared = rows.filter((c) => !c.is_shared);
41750
- if (unshared.length === 0) {
41751
- await confirm({
41752
- message: "All selected conversations are already shared",
41753
- title: "Info",
41754
- kind: "alert"
41755
- });
41756
- return;
41757
- }
41758
- const noun = getEntityLabel("CONVERSATION", unshared.length > 1 ? "PLURAL" : "SINGULAR");
41759
- const confirmed = await confirm({
41760
- message: `Are you sure you want to share ${unshared.length} ${noun.toLowerCase()} with everyone in the current ${getEntityLabel("WORKSPACE").toLowerCase()}? You can make them private again later.`,
41761
- title: `Share ${getEntityLabel("CONVERSATION", "PLURAL")}`
41762
- });
41763
- if (!confirmed) return;
41764
- try {
41765
- await Promise.all(
41766
- unshared.map(
41767
- (c) => updateConversation.mutateAsync({ conversationId: c.external_id, patch: { shared: true } })
41768
- )
41769
- );
41770
- notify18(`${unshared.length} ${noun.toLowerCase()} shared successfully`, "success");
41771
- } catch (error) {
41772
- console.error("Failed to share conversations:", error);
41773
- notify18("Failed to share some conversations", "error");
41774
- }
41775
- };
41776
- const { data: workspaceDocs } = useDocuments();
41777
- const outputsByTask = useMemo(() => {
41778
- const out = {};
41779
- for (const [conversationId, docs] of Object.entries(
41780
- groupOutputsByConversation(workspaceDocs ?? [])
41781
- )) {
41782
- out[conversationId] = docs.map((d) => ({
41783
- id: d.external_id,
41784
- name: getDocumentTitle(d, d.external_id)
41785
- }));
41786
- }
41787
- return out;
41788
- }, [workspaceDocs]);
41789
- const handleOpenOutput = (documentId) => openDocument(documentId);
41790
- const handleGrantAccess = (task) => act(
41791
- task,
41792
- () => runConversation.mutateAsync(task.external_id),
41793
- `Running \u201C${nameOf(task)}\u201D`,
41794
- "Failed to run task"
41795
- );
41796
- const threadLabels = useThreadLabels(canEditShared);
41797
- const selectionActions = (selected, isCompact) => {
41798
- const mine = selected.every((c) => c.created_by_ext_id === currentUserExtId);
41799
- return /* @__PURE__ */ jsxs(Fragment, { children: [
41800
- mode === "threads" && selected.every((row2) => row2.is_owner || row2.is_shared && canEditShared) && selected.some((row2) => row2.status !== "done") && !selected.some((row2) => row2.in_progress || row2.status === "generating") && /* @__PURE__ */ jsx(
41801
- SelectionBarAction,
41802
- {
41803
- icon: CheckCheck,
41804
- label: "Mark Done",
41805
- onClick: () => void handleMarkDoneMany(selected),
41806
- isCompact,
41807
- testId: "threads-bulk-done"
41808
- }
41809
- ),
41810
- threadLabels.renderBulkLabels(selected, isCompact),
41811
- mine && selected.some((c) => !c.is_shared) && /* @__PURE__ */ jsx(
41812
- VisibilityToggle,
41813
- {
41814
- items: selected,
41815
- onToggle: () => void handleBulkShare(selected),
41816
- disablePrivate: true,
41817
- showLabel: false,
41818
- tooltipInactive: "Share all with workspace members",
41819
- tooltipMixed: "Share all with workspace members (some already shared)",
41820
- "data-testid": "bulk-shared-toggle"
41821
- }
41822
- ),
41823
- /* @__PURE__ */ jsx(
41824
- SelectionBarAction,
41825
- {
41826
- icon: FolderUp,
41827
- label: "Export",
41828
- onClick: () => {
41829
- setExportRows(selected);
41830
- setIsExportOpen(true);
41831
- },
41832
- isCompact,
41833
- tooltip: `Export the selected ${getEntityLabel("CONVERSATION", "PLURAL").toLowerCase()} to another ${getEntityLabel("WORKSPACE").toLowerCase()}`,
41834
- testId: "export-chats-button"
41835
- }
41836
- ),
41837
- mode === "threads" && selected.every((row2) => row2.is_owner || isWorkspaceOwner) && /* @__PURE__ */ jsx(
41838
- SelectionBarAction,
41839
- {
41840
- icon: Trash2,
41841
- label: "Delete",
41842
- className: "text-red-text hover:bg-red-bg hover:text-red-text",
41843
- onClick: () => void handleDeleteMany(selected),
41844
- isCompact,
41845
- testId: "threads-bulk-delete"
41846
- }
41847
- )
41848
- ] });
41849
- };
41850
- const page = /* @__PURE__ */ jsxs(
41851
- "div",
41852
- {
41853
- className: "flex h-full min-h-0 flex-col",
41854
- "data-testid": mode === "tasks" ? "tasks-page" : "threads-page",
41855
- children: [
41856
- /* @__PURE__ */ jsx("main", { className: "flex min-h-0 flex-1 flex-col bg-background", children: mode === "threads" ? /* @__PURE__ */ jsx(
41857
- ConversationListView,
41858
- {
41859
- showHeader,
41860
- conversations: tasks,
41861
- doneFilter,
41862
- visibilityFilters,
41863
- meetingFilter,
41864
- renderThread: (row2) => /* @__PURE__ */ jsx(
41865
- ConversationEntity,
41866
- {
41867
- conversation: row2,
41868
- showRePrefix: false,
41869
- labelMaxWidth: "max-w-full",
41870
- className: "w-full max-w-full [&_.truncate]:line-clamp-2 [&_.truncate]:whitespace-normal [&_.truncate]:break-words [&_.truncate]:text-left",
41871
- "data-testid": `thread-open-${row2.external_id}`
41872
- }
41873
- ),
41874
- renderLabels: threadLabels.renderLabels,
41875
- labelText: threadLabels.labelText,
41876
- renderBy: (row2) => /* @__PURE__ */ jsx(
41877
- ConversationTurnSpeaker,
41878
- {
41879
- variant: "icon",
41880
- role: row2.last_message_role,
41881
- actor: row2.last_message_actor,
41882
- currentUserId: currentUserExtId,
41883
- colorClass: row2.last_message_actor ? getUserAvatarColor(row2.last_message_actor.external_id) : void 0
41884
- }
41885
- ),
41886
- renderStatus: (row2) => /* @__PURE__ */ jsx(ConversationStatusCell, { conversation: row2 }),
41887
- isLoading,
41888
- filterText: topbarFilterQuery ?? "",
41889
- formatDate: relativeTime2,
41890
- onOpen: (c) => openConversation(c.external_id),
41891
- onRename: openEdit,
41892
- onDelete: handleDelete,
41893
- canEditShared,
41894
- isWorkspaceOwner,
41895
- selectionActions,
41896
- footer: /* @__PURE__ */ jsx(ConnectedThreadLauncher, { autoFocus: focusLauncher })
41897
- }
41898
- ) : /* @__PURE__ */ jsx(
41899
- TaskInbox,
41900
- {
41901
- tasks,
41902
- isLoading,
41903
- ...workflowActions,
41904
- onCreate: openCreate,
41905
- filterText: topbarFilterQuery ?? "",
41906
- labels: LIST_LABELS,
41907
- gridId: "conversation-list-grid-v4",
41908
- onFilterTextChange: (text2) => setTopbarFilterQuery(text2),
41909
- outputsByTask,
41910
- onOpenActivity: (task) => openConversation(task.external_id),
41911
- formatRelative: relativeTime2,
41912
- onOpenOutput: handleOpenOutput,
41913
- busyId,
41914
- formatDate: formatFriendlyDate,
41915
- onOpenThread: (conversationId) => openConversation(conversationId),
41916
- onMarkDone: (task) => setStatus(task, "done", `Marked \u201C${nameOf(task)}\u201D done`),
41917
- onReopen: (task) => setStatus(task, "todo", `Reopened \u201C${nameOf(task)}\u201D`),
41918
- people,
41919
- agentNames,
41920
- workflowNames,
41921
- canEditShared,
41922
- isWorkspaceOwner,
41923
- renderPerson,
41924
- onToggleShared: handleToggleShared,
41925
- onEdit: openEdit,
41926
- onDelete: handleDelete,
41927
- onAddSubtask: openAddSubtask,
41928
- onMove: handleMove,
41929
- onMarkDoneMany: handleMarkDoneMany,
41930
- onDeleteMany: handleDeleteMany,
41931
- onGrantAccess: handleGrantAccess,
41932
- selectionActions
41933
- }
41934
- ) }),
41935
- /* @__PURE__ */ jsx(
41936
- ConnectedTaskStartDialog,
41937
- {
41938
- open: startOpen,
41939
- onOpenChange: setStartOpen,
41940
- initialParentId: parentForNew
41941
- }
41942
- ),
41943
- /* @__PURE__ */ jsx(ConnectedTaskComposer, { open: editorOpen, onOpenChange: setEditorOpen, task: editing }),
41944
- /* @__PURE__ */ jsx(
41945
- ConnectedExportDialog,
41946
- {
41947
- open: isExportOpen,
41948
- onOpenChange: setIsExportOpen,
41949
- items: exportRows.map((c) => ({ extId: c.external_id, label: nameOf(c) })),
41950
- entityType: "CONVERSATION",
41951
- testId: "export-chats-modal"
41952
- }
41953
- ),
41954
- /* @__PURE__ */ jsx(
41955
- RenameDialog,
41956
- {
41957
- open: !!renaming,
41958
- onClose: () => {
41959
- setRenaming(null);
41960
- setNewTitle("");
41961
- },
41962
- title: `Rename ${getEntityLabel("CONVERSATION")}`,
41963
- labels: { description: "Rename the conversation title" },
41964
- fieldLabel: `${getEntityLabel("CONVERSATION")} Title`,
41965
- placeholder: "Enter title",
41966
- value: newTitle,
41967
- onChange: setNewTitle,
41968
- onSave: handleSaveRename,
41969
- canSave: !!newTitle.trim(),
41970
- dialogTestId: RENAME_DIALOG.testId
41971
- }
41972
- )
41973
- ]
41974
- }
41975
- );
41976
- return search ? /* @__PURE__ */ jsx(ThreadSearch, { ResultsBoundary, children: page }) : page;
41977
- }
41978
43228
  function useSessionPanelMode(panelId, defaultMode = "docked", isOpen = true) {
41979
43229
  const panelModes = useArbiSessionState((s) => s.shell.panels.modes);
41980
43230
  const setPanelModeStore = useArbiSessionStore().setPanelMode;
@@ -42190,6 +43440,6 @@ function useContextualHints() {
42190
43440
  };
42191
43441
  }
42192
43442
 
42193
- export { AddAddonDialog, AddFromAccountsButton, AgentBarShell, AgentControlBar, AgentSteps, AnswerTable, AskAgainContext, BACKFILL_OPTIONS, BUILTIN_GLOBAL_DIALOGS, BULK_REPROCESS_LIMIT, BillingProjectEntity, CaptureBar, ChangePlanDialog, ChatAttachmentList, ConnectedAccountAccessBadge, ConnectedAccountCluster, ConnectedAccountSettings, ConnectedAddContacts, ConnectedAgentChat, ConnectedAgentChatPanel, ConnectedAgentConfigForm, ConnectedAgentCreator, ConnectedAiReview, ConnectedAppRuntime, ConnectedAppShell, ConnectedAppsSettings, ConnectedAuthorizeAgent, ConnectedBranchControls, ConnectedBulkTagEditor, ConnectedCalendar, ConnectedChatThread, ConnectedCitationRenderer, ConnectedCompactConversation, ConnectedConfigForm, ConnectedContactCardForm, ConnectedContactToggle, ConnectedContactsDirectory, ConnectedConversation, ConnectedConversationDocumentPicker, ConnectedConversationEmpty, ConnectedConversationStart, ConnectedDangerZone, ConnectedDatabasesPage, ConnectedDeploymentStorage, ConnectedDeveloperConfig, ConnectedDriveSyncDialog, ConnectedExportDialog, ConnectedExportPanel, ConnectedFactsPage, ConnectedFieldsEditor, ConnectedFieldsManager, ConnectedFilesBulkActions, ConnectedFilesExplorer, ConnectedFilesPage, ConnectedForgotPassword, ConnectedGlobalDialogs, ConnectedGrantWorkspaceAccessDialog, ConnectedGridView, ConnectedGroupMembers, ConnectedIdentityVerification, ConnectedLoginPage, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSettings, ConnectedMailSetup, ConnectedMailbox, ConnectedMailboxSyncDialog, ConnectedMessage, ConnectedMessageArea, ConnectedMessageList, ConnectedMessenger, ConnectedModelSelector, ConnectedMoveToFolder, ConnectedNewThreadDialog, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedOAuthConsentPage, ConnectedPanelHost, ConnectedPasswordChangeDialog, ConnectedPendingSyncDialog, ConnectedPeopleMultiSelect, ConnectedPremiumModels, ConnectedPrivacySettings, ConnectedProfileCard, ConnectedProjectEntity, ConnectedProjectPage, ConnectedProjectSelector, ConnectedProjectStorage, ConnectedProjectsPanel, ConnectedPublicBooking, ConnectedQuotaDialog, ConnectedRecentlyDeletedButton, ConnectedRecoveryKeyDialog, ConnectedReportProblem, ConnectedRequestWorkspaceAccess, ConnectedRequireVerified, ConnectedSearchPage, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSettingsPage, ConnectedShareDialog, ConnectedSharePointAdminConsentPage, ConnectedSharedFilesPage, ConnectedSignatureVerifyPage, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedSsoCallback, ConnectedStorageProjectCard, ConnectedStorageSettings, ConnectedTagEditorDialog, ConnectedTagEntity, ConnectedTagForm, ConnectedTagTable, ConnectedTagsPage, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedTaskComposer, ConnectedTaskStartDialog, ConnectedThreadFollow, ConnectedThreadLauncher, ConnectedThreadTabs, ConnectedThreadTaskBar, ConnectedThreadsPage, ConnectedThreadsPreview, ConnectedTransferWatcher, ConnectedUpcomingEvents, ConnectedUpload, ConnectedUploadDropzone, ConnectedUserEntity, ConnectedWelcomeDialog, ConnectedWorkflowHistory, ConnectedWorkflowRunner, ConnectedWorkflowStart, ConnectedWorkspaceActivity, ConnectedWorkspaceDashboard, ConnectedWorkspaceEntity, ConnectedWorkspaceFormModal, ConnectedWorkspaceList, ConnectedWorkspaceMembers, ConnectedWorkspaceNotificationMenu, ConnectedWorkspaceSettings, ConnectedWorkspaceTrash, ConversationAlert, ConversationComposer2 as ConversationComposer, ConversationEntity, ConversationSendButton, ConversationStatusCell, DEFAULT_CONNECTED_SEARCH_PAGE_LABELS, DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, DEFAULT_OAUTH_PERMISSIONS, DEFAULT_PROJECTS_LIST_LABELS, DEFAULT_PROJECT_DETAILS_LABELS, DEFAULT_PROJECT_DETAIL_FIELDS, DEFAULT_PROJECT_LIST_COLUMNS, DEFAULT_PROJECT_PAGE_LABELS, DEFAULT_SEARCH_FIELDS, DEFAULT_SEARCH_ROW_LABELS, DEFAULT_SETTINGS_SECTIONS, DEFAULT_TIMELINE_LABEL_WIDTH, DEFAULT_WORKSPACE_LIST_LABELS, DeveloperFooter, DocumentFolderCell, DocumentLabelsCell, DocumentNameCell, DocumentSharedCell, DocumentStatusGlyph, DocumentSyncGlyph, DocumentUser, DocumentsFilterBarActions, DocumentsUploadButton, EmptyWorkspaceUpload, FACTS_GRID_ID, FILES_PREFS_KEY, FileTooltipContent, ImportVcfButton, ImportVcfSummary, InvoicesModal, LOOK_AGAIN_LABEL, MessageDetailsModal, MessageLiveSeconds, MicButton, NewProjectFlow, NotificationCenter, NotificationEvent, PENDING_LOOKUP_MS, PENDING_RECOVERY_KEY, PENDING_TASK_MESSAGE, PREMIUM_TIER_TAG, PROJECTS_BASE_TAB_ID, PROMPT_BINDINGS, PersistedGridView, ProgressiveLoadingChip, ProjectDetail, ProjectUsageContent, ProjectsTable, REFERRAL_OFFER, RecoveryKeyDownload, RelatedDocumentsCell, ReportProblemDialog, RunStatsBadges, RunningSubagents, SEARCH_FIELD_OPTIONS, SETTINGS_SECTION_IDS, STANDARD_TIER_TAG, SessionStatusIcon, SharedProjects, SourceChips, SsoResendVerificationButton, StatusCell2 as StatusCell, StorageBreakdown, StorageItemsTable, StorageTiers, StreamedArtifact, TILE_DEFAULT, TILE_MAX, TILE_MIN, ThreadSwitcher, UserAvatar, ViewSelector, WORKSPACES_TAB_ID, WorkflowLaunchHost, WorkflowRunStatusCell, WorkflowRunThread, WorkflowStepMessage, accountSettingsSection, appearanceSettingsSection, backUpOnSignup, bookingCancelLink, buildNotificationCenterItems, buildProjectSummaries, chatSettingsSection, closeAccessRequestReview, connectedAppsSettingsSection, connectionSettingsSection, countNotificationTypes, createDocumentColumns, createEventCall, createNotificationTargetOpener, createTagColumn, deduplicateByContentHash, defaultHost, describePlan, distinctPeers, documentFamilyMeta, documentFieldContent, filesViewMode, filterNotificationCenterItems, formatStorageGb, groupFallbackName, identifyOAuthClient, isActiveDocumentStatus, joinEventMeeting, loadEventWebinar, mailSettingsSection, openMeetingLink, openPendingSyncDialog, openSsoPopup, organisationSettingsSection, parseArbiCallUrl, parseOAuthConsentRequest, parseQuotaError, parseTypedSkill, primaryProjectWorkspace, privacySettingsSection, renderConnectedUser, renderSessionStatusIcon, requestProjectBillingFocus, resolveAttendeeUsers, resolveAttendeeUsersRemote, resolveCallPeers, resolveCallPeersRemote, resolveLaunchInputs, resolveMailbox, resolveSsoName, reviewAccessRequest, reviewProgress, shareEventCall, startMenuItem, storageSettingsSection, suppliedKinds, threadStateOf, toWorkspaceSummary, transferOutcome, updateEventWebinarRoles, usageSettingsSection, useAccessRequestUnderReview, useAddFromUrls, useAiReviewLiveUpdates, useAiReviewStore, useAppShell, useAuthPages, useAutoRefreshPendingProjects, useBatchCompleteToasts, useChatMessageToasts, useConnectedCalendarCalls, useConnectedNotificationBell, useConnectedShellWorkspaces, useConnectedThreadActivity, useConnectedWorkspaceList, useConnectedWorkspaceSettings, useContextualHints, useDocumentBulkActions, useDocumentFilters, useDocumentFolders, useDocumentGridSync, useDocumentNavigation, useDocumentTable, useExportStore, useFilesDialogs, useFilesGridStates, useFilesPrefs, useFilesStore, useLaunchWorkflow, useMemberLookup, useMessengerRows, useModelPicker, useNotificationBellEntry, useNotificationToasts, useOpenBillingPortal, useOpenChunk, useOpenNotificationTarget, useOpenWorkspaceActivityTarget, useOpenWorkspaceIcon, usePendingFolders, usePendingTaskThread, useProjectBillingFocus, useProjectSummaries, useProjectSummary, useReferralReward, useRenderTaskPerson, useReportProblem, useResolvedDocStatus, useSessionPanelMode, useSessionSidebar, useSkillsEnabled, useSlashItems, useSlashSkillWorkflows, useSsoSignIn, useStartRequestedDraft, useTableViews, useTaskPeople, useTaskStart, useThreadLabels, useThreadTabs, useWorkflowDefinitions, useWorkflowLaunch, useWorkflowTasks, useWorkflowsPageState, useWorkspaceDocTitles, viewsOfTable, webinarRolesByUser, windowLabel, withMissingTableViews, withTableView, withoutTableView, workflowRunView };
43443
+ export { AddAddonDialog, AddFromAccountsButton, AgentBarShell, AgentControlBar, AgentSteps, AnswerTable, AskAgainContext, BACKFILL_OPTIONS, BUILTIN_GLOBAL_DIALOGS, BULK_REPROCESS_LIMIT, BillingProjectEntity, CaptureBar, ChangePlanDialog, ChatAttachmentList, ConnectedAccountAccessBadge, ConnectedAccountCluster, ConnectedAccountSettings, ConnectedAccountsImport, ConnectedAddContacts, ConnectedAgentChat, ConnectedAgentChatPanel, ConnectedAgentConfigForm, ConnectedAgentCreator, ConnectedAiReview, ConnectedAppRuntime, ConnectedAppShell, ConnectedAppsSettings, ConnectedAuthorizeAgent, ConnectedBranchControls, ConnectedBulkTagEditor, ConnectedCalendar, ConnectedChatThread, ConnectedCitationRenderer, ConnectedCompactConversation, ConnectedConfigForm, ConnectedContactCardForm, ConnectedContactToggle, ConnectedContactsDirectory, ConnectedConversation, ConnectedConversationDocumentPicker, ConnectedConversationEmpty, ConnectedConversationStart, ConnectedDangerZone, ConnectedDatabasesPage, ConnectedDeploymentStorage, ConnectedDeveloperConfig, ConnectedDriveSyncDialog, ConnectedExportDialog, ConnectedExportPanel, ConnectedFactsPage, ConnectedFieldsEditor, ConnectedFieldsManager, ConnectedFilesBulkActions, ConnectedFilesExplorer, ConnectedFilesPage, ConnectedFilterDropdown, ConnectedForgotPassword, ConnectedGlobalDialogs, ConnectedGrantWorkspaceAccessDialog, ConnectedGridView, ConnectedGroupMembers, ConnectedIdentityVerification, ConnectedLoginPage, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSettings, ConnectedMailSetup, ConnectedMailbox, ConnectedMailboxSyncDialog, ConnectedMessage, ConnectedMessageArea, ConnectedMessageList, ConnectedMessenger, ConnectedModelSelector, ConnectedMoveToFolder, ConnectedNewThreadDialog, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedOAuthConsentPage, ConnectedPanelHost, ConnectedPasswordChangeDialog, ConnectedPendingSyncDialog, ConnectedPeopleMultiSelect, ConnectedPremiumModels, ConnectedPrivacySettings, ConnectedProfileCard, ConnectedProjectEntity, ConnectedProjectPage, ConnectedProjectSelector, ConnectedProjectStorage, ConnectedProjectsPanel, ConnectedPublicBooking, ConnectedQuotaDialog, ConnectedRecentlyDeletedButton, ConnectedRecoveryKeyDialog, ConnectedReportProblem, ConnectedRequestWorkspaceAccess, ConnectedRequireVerified, ConnectedSearchPage, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSettingsPage, ConnectedShareDialog, ConnectedSharePointAdminConsentPage, ConnectedSharedFilesPage, ConnectedSignatureVerifyPage, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedSsoCallback, ConnectedStorageProjectCard, ConnectedStorageSettings, ConnectedTagEditorDialog, ConnectedTagEntity, ConnectedTagForm, ConnectedTagTable, ConnectedTagsPage, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedTaskComposer, ConnectedTaskStartDialog, ConnectedThreadFollow, ConnectedThreadLauncher, ConnectedThreadTabs, ConnectedThreadTaskBar, ConnectedThreadsPage, ConnectedThreadsPreview, ConnectedTransferWatcher, ConnectedUpcomingEvents, ConnectedUpload, ConnectedUploadDropzone, ConnectedUserEntity, ConnectedWelcomeDialog, ConnectedWorkflowHistory, ConnectedWorkflowRunner, ConnectedWorkflowStart, ConnectedWorkspaceActivity, ConnectedWorkspaceDashboard, ConnectedWorkspaceEntity, ConnectedWorkspaceFormModal, ConnectedWorkspaceList, ConnectedWorkspaceMembers, ConnectedWorkspaceNotificationMenu, ConnectedWorkspaceSettings, ConnectedWorkspaceTrash, ConversationAlert, ConversationComposer2 as ConversationComposer, ConversationEntity, ConversationSendButton, ConversationStatusCell, DEFAULT_CONNECTED_SEARCH_PAGE_LABELS, DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, DEFAULT_OAUTH_PERMISSIONS, DEFAULT_PROJECTS_LIST_LABELS, DEFAULT_PROJECT_DETAILS_LABELS, DEFAULT_PROJECT_DETAIL_FIELDS, DEFAULT_PROJECT_LIST_COLUMNS, DEFAULT_PROJECT_PAGE_LABELS, DEFAULT_SEARCH_FIELDS, DEFAULT_SEARCH_ROW_LABELS, DEFAULT_SETTINGS_SECTIONS, DEFAULT_TIMELINE_LABEL_WIDTH, DEFAULT_WORKSPACE_LIST_LABELS, DeveloperFooter, DocumentFolderCell, DocumentLabelsCell, DocumentNameCell, DocumentSharedCell, DocumentStatusGlyph, DocumentSyncGlyph, DocumentUser, DocumentsFilterBarActions, DocumentsUploadButton, EmptyWorkspaceUpload, FACTS_GRID_ID, FILES_PREFS_KEY, FileTooltipContent, ImportVcfButton, ImportVcfSummary, InvoicesModal, LOOK_AGAIN_LABEL, MessageDetailsModal, MessageLiveSeconds, MicButton, NewProjectFlow, NotificationCenter, NotificationEvent, PENDING_LOOKUP_MS, PENDING_RECOVERY_KEY, PENDING_TASK_MESSAGE, PREMIUM_TIER_TAG, PROJECTS_BASE_TAB_ID, PROMPT_BINDINGS, PersistedGridView, ProgressiveLoadingChip, ProjectDetail, ProjectUsageContent, ProjectsTable, REFERRAL_OFFER, RecoveryKeyDownload, RelatedDocumentsCell, ReportProblemDialog, RunStatsBadges, RunningSubagents, SEARCH_FIELD_OPTIONS, SETTINGS_SECTION_IDS, STANDARD_TIER_TAG, SessionStatusIcon, SharedProjects, SourceChips, SsoResendVerificationButton, StatusCell2 as StatusCell, StorageBreakdown, StorageItemsTable, StorageTiers, StreamedArtifact, TILE_DEFAULT, TILE_MAX, TILE_MIN, ThreadSwitcher, UserAvatar, ViewSelector, WORKSPACES_TAB_ID, WorkflowLaunchHost, WorkflowRunStatusCell, WorkflowRunThread, WorkflowStepMessage, accountSettingsSection, appearanceSettingsSection, backUpOnSignup, bookingCancelLink, buildNotificationCenterItems, buildProjectSummaries, chatSettingsSection, closeAccessRequestReview, connectedAppsSettingsSection, connectionSettingsSection, countNotificationTypes, createDocumentColumns, createEventCall, createNotificationTargetOpener, createTagColumn, deduplicateByContentHash, defaultHost, describePlan, distinctPeers, documentFamilyMeta, documentFieldContent, filesViewMode, filterNotificationCenterItems, formatStorageGb, groupFallbackName, identifyOAuthClient, isActiveDocumentStatus, joinEventMeeting, loadEventWebinar, mailSettingsSection, openMeetingLink, openPendingSyncDialog, openSsoPopup, organisationSettingsSection, parseArbiCallUrl, parseOAuthConsentRequest, parseQuotaError, parseTypedSkill, primaryProjectWorkspace, privacySettingsSection, renderConnectedUser, renderSessionStatusIcon, requestProjectBillingFocus, resolveAttendeeUsers, resolveAttendeeUsersRemote, resolveCallPeers, resolveCallPeersRemote, resolveLaunchInputs, resolveMailbox, resolveSsoName, reviewAccessRequest, reviewProgress, shareEventCall, startMenuItem, storageSettingsSection, suppliedKinds, threadStateOf, toWorkspaceSummary, transferOutcome, updateEventWebinarRoles, usageSettingsSection, useAccessRequestUnderReview, useAddFromUrls, useAiReviewLiveUpdates, useAiReviewStore, useAppShell, useAuthPages, useAutoRefreshPendingProjects, useBatchCompleteToasts, useChatMessageToasts, useConnectedAgentManagement, useConnectedCalendarCalls, useConnectedNotificationBell, useConnectedShellWorkspaces, useConnectedThreadActivity, useConnectedWorkspaceList, useConnectedWorkspaceSettings, useContextualHints, useDocumentBulkActions, useDocumentFilters, useDocumentFolders, useDocumentGridSync, useDocumentNavigation, useDocumentTable, useExportStore, useFilesDialogs, useFilesGridStates, useFilesPrefs, useFilesStore, useHasAccountsImport, useLaunchWorkflow, useMemberLookup, useMessengerRows, useModelPicker, useNotificationBellEntry, useNotificationToasts, useOpenBillingPortal, useOpenChunk, useOpenNotificationTarget, useOpenWorkspaceActivityTarget, useOpenWorkspaceIcon, usePendingFolders, usePendingTaskThread, useProjectBillingFocus, useProjectSummaries, useProjectSummary, useReferralReward, useRenderTaskPerson, useReportProblem, useResolvedDocStatus, useSessionPanelMode, useSessionSidebar, useSkillsEnabled, useSlashItems, useSlashSkillWorkflows, useSsoSignIn, useStartRequestedDraft, useTableViews, useTaskPeople, useTaskStart, useThreadLabels, useThreadTabs, useWorkflowDefinitions, useWorkflowLaunch, useWorkflowTasks, useWorkflowsPageState, useWorkspaceDocTitles, viewsOfTable, webinarRolesByUser, windowLabel, withMissingTableViews, withTableView, withoutTableView, workflowRunView };
42194
43444
  //# sourceMappingURL=index.js.map
42195
43445
  //# sourceMappingURL=index.js.map