@burdenoff/microfe-integrations 2026.624.1 → 2026.624.2

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 (35) hide show
  1. package/dist/integrations/IntegrationsAdminRoutes.js +5 -5
  2. package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
  3. package/dist/integrations/IntegrationsUserRoutes.js +5 -5
  4. package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
  5. package/dist/integrations/components/AddConnectionDialog.js +64 -64
  6. package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
  7. package/dist/integrations/components/ConfirmDialog.js +5 -5
  8. package/dist/integrations/components/ConfirmDialog.js.map +1 -1
  9. package/dist/integrations/components/ConnectionCard.js +15 -15
  10. package/dist/integrations/components/ConnectionCard.js.map +1 -1
  11. package/dist/integrations/components/CredentialStorageSelector.js +19 -19
  12. package/dist/integrations/components/CredentialStorageSelector.js.map +1 -1
  13. package/dist/integrations/components/ProviderCard.js +15 -15
  14. package/dist/integrations/components/ProviderCard.js.map +1 -1
  15. package/dist/integrations/pages/AddConnectionWizard.js +49 -49
  16. package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
  17. package/dist/integrations/pages/ConnectionDetail.js +53 -53
  18. package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
  19. package/dist/integrations/pages/ConnectionLogs.js +35 -35
  20. package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
  21. package/dist/integrations/pages/ConnectionsList.js +27 -27
  22. package/dist/integrations/pages/ConnectionsList.js.map +1 -1
  23. package/dist/integrations/pages/IntegrationsOverview.js +33 -33
  24. package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
  25. package/dist/integrations/pages/IntegrationsSettings.js +26 -26
  26. package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
  27. package/dist/integrations/pages/ProviderCatalog.js +29 -29
  28. package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
  29. package/dist/integrations/pages/ProviderDetail.js +46 -46
  30. package/dist/integrations/pages/ProviderDetail.js.map +1 -1
  31. package/dist/integrations/pages/ProviderEditorPage.js +44 -44
  32. package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
  33. package/dist/integrations/utils/appearance.js +7 -7
  34. package/dist/integrations/utils/appearance.js.map +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionDetail.js","names":[],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { joinPath } from '../utils/navigation';\nimport { formatDate, formatLastUsed, getAuthTypeLabel } from '../utils/integrationsHelpers';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon } from '../components/ProviderIcon';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n if (loading || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-muted-foreground\">\n {tx('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n if (error || !connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tx(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />{' '}\n {tx('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tx('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n const handleRefresh = async () => {\n await refreshToken(connection.id);\n showNotification(\n 'success',\n tx(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n refetch();\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tx('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tx(\n 'integrations.connectionDetail.deleteDialog.message',\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tx('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tx('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {deleteDialogOpen && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-foreground/40 px-4\">\n <div className=\"w-full max-w-md rounded-xl border border-border bg-background p-6 shadow-2xl space-y-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-foreground\">Delete connection</h2>\n <p className=\"text-sm text-muted-foreground mt-1\">\n This removes the connection record immediately. You can also remove the mapped vault\n secret if you no longer need it.\n </p>\n </div>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border/60 bg-card px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label=\"Also remove mapped vault secret\"\n />\n <div>\n <p className=\"text-sm font-medium text-foreground\">\n Also remove mapped vault secret\n </p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n Use this only if no other connections rely on the same secret.\n </p>\n </div>\n </label>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n className=\"px-4 py-2 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={confirmDelete}\n disabled={deleting}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-destructive text-primary-foreground disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n Delete connection\n </button>\n </div>\n </div>\n </div>\n )}\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tx('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tx(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tx('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-foreground\">{connection.name}</h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n </div>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info */}\n <div className=\"rounded-xl border border-border/50 bg-card p-5 space-y-4\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border/50\">\n <span className=\"text-xs text-muted-foreground uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-foreground mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border/50\">\n <span className=\"text-sm text-muted-foreground\">\n {tx('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-foreground\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border/50\">\n <span className=\"text-sm text-muted-foreground flex items-center gap-1\">\n <Mail size={14} /> {tx('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-foreground\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border/50\">\n <span className=\"text-sm text-muted-foreground flex items-center gap-1\">\n <User size={14} /> {tx('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-foreground\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border/50\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border/50\">\n <span className=\"text-sm text-muted-foreground flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tx('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-foreground\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border/50\">\n <span className=\"text-sm text-muted-foreground\">\n {tx('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-foreground\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-muted-foreground\">\n {tx('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-foreground\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </div>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <div className=\"rounded-xl border border-border/50 bg-card p-5\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-muted text-muted-foreground font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n ) : (\n <p className=\"text-sm text-muted-foreground\">\n {tx('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tx('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tx('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-muted-foreground mt-1\">\n {tx('integrations.connectionDetail.testResult.latency', 'Latency: {latency}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <div className=\"rounded-xl border border-border/50 bg-card p-5\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n Credential Storage\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-muted-foreground\">Vault</span>\n <span className=\"font-medium text-foreground break-all\">\n {connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-muted-foreground\">Secret</span>\n <span className=\"font-medium text-foreground break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-muted-foreground\">Secret ID</span>\n <span className=\"font-mono text-xs text-foreground break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete) && (\n <div className=\"rounded-xl border border-border/50 bg-card p-5\">\n <h2 className=\"font-semibold text-foreground flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors disabled:opacity-50\"\n >\n {testing ? <Loader2 size={14} className=\"animate-spin\" /> : <Zap size={14} />}\n {tx('integrations.connectionDetail.actions.test', 'Test Connection')}\n </button>\n {canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken && (\n <button\n type=\"button\"\n onClick={handleRefresh}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors disabled:opacity-50\"\n >\n {refreshing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <RotateCcw size={14} />\n )}\n {tx('integrations.connectionDetail.actions.refreshToken', 'Refresh Token')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleRevoke}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors disabled:opacity-50\"\n >\n {revoking ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Shield size={14} />\n )}\n {tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n {deleting ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Trash2 size={14} />\n )}\n {tx('integrations.connectionDetail.actions.delete', 'Delete')}\n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A,EAErB,EAAG,gDAAgD,SAAS,CACtD;;SAEP;UACF;;MAEJ;OACF;;GACF"}
1
+ {"version":3,"file":"ConnectionDetail.js","names":[],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { joinPath } from '../utils/navigation';\nimport { formatDate, formatLastUsed, getAuthTypeLabel } from '../utils/integrationsHelpers';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon } from '../components/ProviderIcon';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n if (loading || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tx('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n if (error || !connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tx(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />{' '}\n {tx('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tx('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n const handleRefresh = async () => {\n await refreshToken(connection.id);\n showNotification(\n 'success',\n tx(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n refetch();\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tx('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tx(\n 'integrations.connectionDetail.deleteDialog.message',\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tx('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tx('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {deleteDialogOpen && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-foreground/40 px-4\">\n <div className=\"w-full max-w-md rounded-xl border border-border-subtle bg-bg-surface p-6 shadow-2xl space-y-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Delete connection</h2>\n <p className=\"text-sm text-text-secondary mt-1\">\n This removes the connection record immediately. You can also remove the mapped vault\n secret if you no longer need it.\n </p>\n </div>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label=\"Also remove mapped vault secret\"\n />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Also remove mapped vault secret\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Use this only if no other connections rely on the same secret.\n </p>\n </div>\n </label>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n className=\"px-4 py-2 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={confirmDelete}\n disabled={deleting}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-status-error-bg text-action-primary-text disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n Delete connection\n </button>\n </div>\n </div>\n </div>\n )}\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tx('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tx(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tx('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">{connection.name}</h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Mail size={14} /> {tx('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <User size={14} /> {tx('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tx('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-text-primary\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </div>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tx('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tx('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx('integrations.connectionDetail.testResult.latency', 'Latency: {latency}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n Credential Storage\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Vault</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret ID</span>\n <span className=\"font-mono text-xs text-text-primary break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete) && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {testing ? <Loader2 size={14} className=\"animate-spin\" /> : <Zap size={14} />}\n {tx('integrations.connectionDetail.actions.test', 'Test Connection')}\n </button>\n {canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken && (\n <button\n type=\"button\"\n onClick={handleRefresh}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors disabled:opacity-50\"\n >\n {refreshing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <RotateCcw size={14} />\n )}\n {tx('integrations.connectionDetail.actions.refreshToken', 'Refresh Token')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleRevoke}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors disabled:opacity-50\"\n >\n {revoking ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Shield size={14} />\n )}\n {tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n {deleting ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Trash2 size={14} />\n )}\n {tx('integrations.connectionDetail.actions.delete', 'Delete')}\n </button>\n )}\n </div>\n </div>\n )}\n </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ACtD;;SAEP;UACF;;MAEJ;OACF;;GACF"}
@@ -91,7 +91,7 @@ function j() {
91
91
  className: "space-y-6 p-6 max-w-7xl mx-auto",
92
92
  children: [
93
93
  /* @__PURE__ */ E("div", {
94
- className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
94
+ className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
95
95
  children: [/* @__PURE__ */ E("div", {
96
96
  className: "relative z-10 flex items-center gap-4",
97
97
  children: [
@@ -103,17 +103,17 @@ function j() {
103
103
  children: /* @__PURE__ */ T(f, { size: 20 })
104
104
  }),
105
105
  /* @__PURE__ */ T("div", {
106
- className: "p-2.5 rounded-lg bg-primary/10",
106
+ className: "p-2.5 rounded-lg bg-action-primary-bg/10",
107
107
  children: /* @__PURE__ */ T(_, {
108
108
  size: 24,
109
109
  className: "text-primary"
110
110
  })
111
111
  }),
112
112
  /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
113
- className: "text-2xl sm:text-3xl font-bold text-foreground",
113
+ className: "text-2xl sm:text-3xl font-bold text-text-primary",
114
114
  children: "Activity Logs"
115
115
  }), /* @__PURE__ */ T("p", {
116
- className: "text-sm text-muted-foreground mt-0.5",
116
+ className: "text-sm text-text-secondary mt-0.5",
117
117
  children: "Track integration activity and debug issues"
118
118
  })] })
119
119
  ]
@@ -128,21 +128,21 @@ function j() {
128
128
  className: "flex-1 relative group",
129
129
  children: [/* @__PURE__ */ T(ne, {
130
130
  size: 18,
131
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
131
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
132
132
  }), /* @__PURE__ */ T("input", {
133
133
  type: "text",
134
134
  "aria-label": "Search activity logs",
135
135
  placeholder: "Search logs...",
136
136
  value: F,
137
137
  onChange: (e) => I(e.target.value),
138
- className: "w-full pl-10 pr-4 py-2.5 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
138
+ className: "w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
139
139
  })]
140
140
  }),
141
141
  /* @__PURE__ */ E("button", {
142
142
  type: "button",
143
143
  onClick: () => H(!V),
144
144
  "aria-expanded": V,
145
- className: t("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", V || Q ? "bg-primary text-primary-foreground border-primary" : "bg-background text-foreground border-border hover:bg-accent"),
145
+ className: t("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", V || Q ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
146
146
  children: [/* @__PURE__ */ T(v, { size: 16 }), " Filter"]
147
147
  }),
148
148
  j && /* @__PURE__ */ E("button", {
@@ -151,22 +151,22 @@ function j() {
151
151
  A(X);
152
152
  },
153
153
  disabled: X.length === 0,
154
- className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border text-sm font-medium hover:bg-accent transition-colors disabled:opacity-50",
154
+ className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border-subtle text-sm font-medium hover:bg-accent transition-colors disabled:opacity-50",
155
155
  children: [/* @__PURE__ */ T(g, { size: 16 }), " Export CSV"]
156
156
  }),
157
157
  /* @__PURE__ */ E("button", {
158
158
  type: "button",
159
159
  onClick: () => Y(),
160
- className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border text-sm font-medium hover:bg-accent transition-colors",
160
+ className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border-subtle text-sm font-medium hover:bg-accent transition-colors",
161
161
  children: [/* @__PURE__ */ T(x, { size: 16 }), " Refresh"]
162
162
  })
163
163
  ]
164
164
  }), V && /* @__PURE__ */ E("div", {
165
- className: "rounded-xl border border-border/50 bg-card p-5 animate-in slide-in-from-top-2 duration-200",
165
+ className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200",
166
166
  children: [/* @__PURE__ */ E("div", {
167
167
  className: "flex items-center justify-between mb-4",
168
168
  children: [/* @__PURE__ */ E("h3", {
169
- className: "font-semibold text-foreground flex items-center gap-2",
169
+ className: "font-semibold text-text-primary flex items-center gap-2",
170
170
  children: [/* @__PURE__ */ T(v, {
171
171
  size: 16,
172
172
  className: "text-primary"
@@ -174,7 +174,7 @@ function j() {
174
174
  }), Q && /* @__PURE__ */ E("button", {
175
175
  type: "button",
176
176
  onClick: $,
177
- className: "text-sm text-muted-foreground hover:text-destructive flex items-center gap-1",
177
+ className: "text-sm text-text-secondary hover:text-status-error-text flex items-center gap-1",
178
178
  children: [/* @__PURE__ */ T(S, { size: 14 }), " Clear All"]
179
179
  })]
180
180
  }), /* @__PURE__ */ E("div", {
@@ -183,7 +183,7 @@ function j() {
183
183
  className: "space-y-2",
184
184
  children: [/* @__PURE__ */ T("label", {
185
185
  htmlFor: N,
186
- className: "block text-sm font-medium text-foreground",
186
+ className: "block text-sm font-medium text-text-primary",
187
187
  children: "Log Level"
188
188
  }), /* @__PURE__ */ E("select", {
189
189
  id: N,
@@ -191,7 +191,7 @@ function j() {
191
191
  onChange: (e) => {
192
192
  R(e.target.value), W(1);
193
193
  },
194
- className: "w-full px-3 py-2 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20",
194
+ className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20",
195
195
  children: [/* @__PURE__ */ T("option", {
196
196
  value: "all",
197
197
  children: "All Levels"
@@ -204,7 +204,7 @@ function j() {
204
204
  className: "space-y-2",
205
205
  children: [/* @__PURE__ */ T("label", {
206
206
  htmlFor: P,
207
- className: "block text-sm font-medium text-foreground",
207
+ className: "block text-sm font-medium text-text-primary",
208
208
  children: "Action"
209
209
  }), /* @__PURE__ */ E("select", {
210
210
  id: P,
@@ -212,7 +212,7 @@ function j() {
212
212
  onChange: (e) => {
213
213
  B(e.target.value), W(1);
214
214
  },
215
- className: "w-full px-3 py-2 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20",
215
+ className: "w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20",
216
216
  children: [/* @__PURE__ */ T("option", {
217
217
  value: "all",
218
218
  children: "All Actions"
@@ -254,11 +254,11 @@ function j() {
254
254
  className: "flex items-center justify-center py-12",
255
255
  children: /* @__PURE__ */ T(b, {
256
256
  size: 24,
257
- className: "animate-spin text-muted-foreground"
257
+ className: "animate-spin text-text-secondary"
258
258
  })
259
259
  }),
260
260
  !q && !J && /* @__PURE__ */ E(w, { children: [X.length > 0 ? /* @__PURE__ */ T("div", {
261
- className: "rounded-xl border border-border/50 bg-card overflow-hidden",
261
+ className: "rounded-xl border border-border-subtle/50 bg-bg-surface overflow-hidden",
262
262
  children: /* @__PURE__ */ T("div", {
263
263
  className: "divide-y divide-border/50",
264
264
  children: X.map((e) => /* @__PURE__ */ E("div", {
@@ -279,7 +279,7 @@ function j() {
279
279
  children: e.level.toUpperCase()
280
280
  }),
281
281
  /* @__PURE__ */ T("span", {
282
- className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground",
282
+ className: "text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary",
283
283
  children: e.action.replace(/_/g, " ")
284
284
  }),
285
285
  e.responseStatus && /* @__PURE__ */ T("span", {
@@ -289,11 +289,11 @@ function j() {
289
289
  ]
290
290
  }),
291
291
  /* @__PURE__ */ T("p", {
292
- className: "text-sm text-foreground mt-1",
292
+ className: "text-sm text-text-primary mt-1",
293
293
  children: e.message
294
294
  }),
295
295
  e.requestUrl && /* @__PURE__ */ E("p", {
296
- className: "text-xs text-muted-foreground font-mono mt-0.5 truncate",
296
+ className: "text-xs text-text-secondary font-mono mt-0.5 truncate",
297
297
  children: [e.requestMethod && /* @__PURE__ */ E("span", {
298
298
  className: "font-semibold",
299
299
  children: [e.requestMethod, " "]
@@ -302,7 +302,7 @@ function j() {
302
302
  ]
303
303
  }),
304
304
  /* @__PURE__ */ T("span", {
305
- className: "text-xs text-muted-foreground whitespace-nowrap flex-shrink-0",
305
+ className: "text-xs text-text-secondary whitespace-nowrap flex-shrink-0",
306
306
  children: r(e.createdAt)
307
307
  })
308
308
  ]
@@ -312,31 +312,31 @@ function j() {
312
312
  className: "flex flex-col items-center justify-center py-16 text-center",
313
313
  children: [
314
314
  /* @__PURE__ */ T("div", {
315
- className: "p-4 rounded-full bg-muted/50 mb-4",
315
+ className: "p-4 rounded-full bg-bg-sunken/50 mb-4",
316
316
  children: /* @__PURE__ */ T(_, {
317
317
  size: 32,
318
- className: "text-muted-foreground"
318
+ className: "text-text-secondary"
319
319
  })
320
320
  }),
321
321
  /* @__PURE__ */ T("h3", {
322
- className: "font-semibold text-foreground mb-1",
322
+ className: "font-semibold text-text-primary mb-1",
323
323
  children: Q ? "No matching logs" : "No activity logs yet"
324
324
  }),
325
325
  /* @__PURE__ */ T("p", {
326
- className: "text-sm text-muted-foreground max-w-sm",
326
+ className: "text-sm text-text-secondary max-w-sm",
327
327
  children: Q ? "Try adjusting your filters." : "Activity logs will appear here once you start using integrations."
328
328
  }),
329
329
  Q && /* @__PURE__ */ E("button", {
330
330
  type: "button",
331
331
  onClick: $,
332
- className: "mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors",
332
+ className: "mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors",
333
333
  children: [/* @__PURE__ */ T(S, { size: 14 }), " Clear Filters"]
334
334
  })
335
335
  ]
336
336
  }), Z > 1 && /* @__PURE__ */ E("div", {
337
337
  className: "flex items-center justify-between px-2",
338
338
  children: [/* @__PURE__ */ E("p", {
339
- className: "text-sm text-muted-foreground",
339
+ className: "text-sm text-text-secondary",
340
340
  children: [
341
341
  "Showing ",
342
342
  (U - 1) * 20 + 1,
@@ -353,11 +353,11 @@ function j() {
353
353
  onClick: () => W((e) => Math.max(1, e - 1)),
354
354
  disabled: U === 1,
355
355
  "aria-label": "Previous page",
356
- className: "p-2 rounded-lg border border-border hover:bg-accent disabled:opacity-50 transition-colors",
356
+ className: "p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors",
357
357
  children: /* @__PURE__ */ T(m, { size: 16 })
358
358
  }),
359
359
  /* @__PURE__ */ E("span", {
360
- className: "text-sm text-foreground px-3 py-1.5 rounded-lg bg-muted",
360
+ className: "text-sm text-text-primary px-3 py-1.5 rounded-lg bg-bg-sunken",
361
361
  children: [
362
362
  U,
363
363
  " / ",
@@ -369,7 +369,7 @@ function j() {
369
369
  onClick: () => W((e) => Math.min(Z, e + 1)),
370
370
  disabled: U === Z,
371
371
  "aria-label": "Next page",
372
- className: "p-2 rounded-lg border border-border hover:bg-accent disabled:opacity-50 transition-colors",
372
+ className: "p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors",
373
373
  children: /* @__PURE__ */ T(h, { size: 16 })
374
374
  })
375
375
  ]
@@ -381,20 +381,20 @@ function j() {
381
381
  children: [
382
382
  /* @__PURE__ */ T(u, {
383
383
  size: 48,
384
- className: "text-muted-foreground mb-4"
384
+ className: "text-text-secondary mb-4"
385
385
  }),
386
386
  /* @__PURE__ */ T("h2", {
387
- className: "text-xl font-bold text-foreground mb-2",
387
+ className: "text-xl font-bold text-text-primary mb-2",
388
388
  children: "Access Denied"
389
389
  }),
390
390
  /* @__PURE__ */ T("p", {
391
- className: "text-sm text-muted-foreground mb-6 max-w-sm",
391
+ className: "text-sm text-text-secondary mb-6 max-w-sm",
392
392
  children: "You don't have permission to view activity logs."
393
393
  }),
394
394
  /* @__PURE__ */ E("button", {
395
395
  type: "button",
396
396
  onClick: () => d?.(l),
397
- className: "inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors",
397
+ className: "inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors",
398
398
  children: [/* @__PURE__ */ T(f, { size: 16 }), " Back to Overview"]
399
399
  })
400
400
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionLogs.js","names":[],"sources":["../../../src/integrations/pages/ConnectionLogs.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n FileText,\n Search,\n Filter,\n X,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n Loader2,\n ChevronLeft,\n ChevronRight,\n Info,\n AlertTriangle,\n Bug,\n Activity,\n Download,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { formatDate } from '../utils/integrationsHelpers';\nimport { useIntegrationLogs } from '../hooks/useLogs';\nimport { LOG_LEVEL_OPTIONS, LOG_ACTION_OPTIONS, DEFAULT_PAGE_SIZE } from '../utils/constants';\nimport type { IntegrationLog, LogLevel, LogAction } from '../types';\n\nfunction getLogLevelIcon(level: LogLevel) {\n switch (level) {\n case 'error':\n return <AlertCircle size={14} className=\"text-status-error-text\" />;\n case 'warn':\n return <AlertTriangle size={14} className=\"text-status-warning-text\" />;\n case 'info':\n return <Info size={14} className=\"text-status-info-text\" />;\n case 'debug':\n return <Bug size={14} className=\"text-text-tertiary\" />;\n default:\n return <Activity size={14} className=\"text-text-tertiary\" />;\n }\n}\n\nfunction getLogLevelColor(level: LogLevel): string {\n switch (level) {\n case 'error':\n return 'text-status-error-text bg-status-error-bg-subtle border-border-default';\n case 'warn':\n return 'text-status-warning-text bg-status-warning-bg-subtle border-border-default';\n case 'info':\n return 'text-status-info-text bg-status-info-bg-subtle border-border-default';\n case 'debug':\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n default:\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n }\n}\n\nfunction toCsvCell(value: string | number | null): string {\n const text = String(value ?? '');\n return `\"${text.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction downloadLogsCsv(logs: IntegrationLog[]) {\n const header = [\n 'Created At',\n 'Level',\n 'Action',\n 'Message',\n 'Request Method',\n 'Request URL',\n 'Status',\n ];\n const rows = logs.map((log) => [\n log.createdAt,\n log.level,\n log.action,\n log.message,\n log.requestMethod,\n log.requestUrl,\n log.responseStatus,\n ]);\n const csv = [header, ...rows].map((row) => row.map(toCsvCell).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `integration-logs-${new Date().toISOString().slice(0, 10)}.csv`;\n link.click();\n URL.revokeObjectURL(url);\n}\n\n/**\n * Connection Logs — activity log view with filtering and pagination.\n */\nexport function ConnectionLogs() {\n const { basePath = '/', navigate } = useIntegrations();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canReadLogs = hasPermission(INTEGRATION_PERMISSIONS.LOG_READ);\n const canExportCsv = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.CSV_EXPORT, true);\n\n const idPrefix = useId();\n const levelFilterId = `${idPrefix}-level`;\n const actionFilterId = `${idPrefix}-action`;\n const [searchQuery, setSearchQuery] = useState('');\n const [levelFilter, setLevelFilter] = useState<LogLevel | 'all'>('all');\n const [actionFilter, setActionFilter] = useState<LogAction | 'all'>('all');\n const [showFilters, setShowFilters] = useState(false);\n const [currentPage, setCurrentPage] = useState(1);\n\n const { logs, total, loading, error, refetch } = useIntegrationLogs({\n level: levelFilter === 'all' ? undefined : levelFilter,\n action: actionFilter === 'all' ? undefined : actionFilter,\n page: currentPage,\n pageSize: DEFAULT_PAGE_SIZE,\n skip: permissionsLoading || !canReadLogs,\n });\n\n // Client-side search filter\n const filteredLogs = useMemo(() => {\n if (!searchQuery) return logs ?? [];\n const q = searchQuery.toLowerCase();\n return (logs ?? []).filter(\n (log: IntegrationLog) =>\n log.message.toLowerCase().includes(q) ||\n (log.requestUrl?.toLowerCase().includes(q) ?? false)\n );\n }, [logs, searchQuery]);\n\n const totalPages = Math.ceil((total ?? 0) / DEFAULT_PAGE_SIZE);\n\n const hasActiveFilters = searchQuery || levelFilter !== 'all' || actionFilter !== 'all';\n\n const handleClearFilters = () => {\n setSearchQuery('');\n setLevelFilter('all');\n setActionFilter('all');\n setCurrentPage(1);\n };\n\n const handleExport = () => {\n downloadLogsCsv(filteredLogs);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canReadLogs) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <AlertCircle size={48} className=\"text-muted-foreground mb-4\" />\n <h2 className=\"text-xl font-bold text-foreground mb-2\">Access Denied</h2>\n <p className=\"text-sm text-muted-foreground mb-6 max-w-sm\">\n You don&apos;t have permission to view activity logs.\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} /> Back to Overview\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label=\"Back\"\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"p-2.5 rounded-lg bg-primary/10\">\n <FileText size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-foreground\">Activity Logs</h1>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n Track integration activity and debug issues\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\"\n />\n <input\n type=\"text\"\n aria-label=\"Search activity logs\"\n placeholder=\"Search logs...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n aria-expanded={showFilters}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-primary text-primary-foreground border-primary'\n : 'bg-background text-foreground border-border hover:bg-accent'\n )}\n >\n <Filter size={16} /> Filter\n </button>\n {canExportCsv && (\n <button\n type=\"button\"\n onClick={handleExport}\n disabled={filteredLogs.length === 0}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border text-sm font-medium hover:bg-accent transition-colors disabled:opacity-50\"\n >\n <Download size={16} /> Export CSV\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border text-sm font-medium hover:bg-accent transition-colors\"\n >\n <RefreshCw size={16} /> Refresh\n </button>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border/50 bg-card p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-foreground flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" /> Filters\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-muted-foreground hover:text-destructive flex items-center gap-1\"\n >\n <X size={14} /> Clear All\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={levelFilterId}\n className=\"block text-sm font-medium text-foreground\"\n >\n Log Level\n </label>\n <select\n id={levelFilterId}\n value={levelFilter}\n onChange={(e) => {\n setLevelFilter(e.target.value as LogLevel | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20\"\n >\n <option value=\"all\">All Levels</option>\n {LOG_LEVEL_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={actionFilterId}\n className=\"block text-sm font-medium text-foreground\"\n >\n Action\n </label>\n <select\n id={actionFilterId}\n value={actionFilter}\n onChange={(e) => {\n setActionFilter(e.target.value as LogAction | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border rounded-lg bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20\"\n >\n <option value=\"all\">All Actions</option>\n {LOG_ACTION_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">Error loading logs</h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> Try Again\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-muted-foreground\" />\n </div>\n )}\n\n {/* Logs List */}\n {!loading && !error && (\n <>\n {filteredLogs.length > 0 ? (\n <div className=\"rounded-xl border border-border/50 bg-card overflow-hidden\">\n <div className=\"divide-y divide-border/50\">\n {filteredLogs.map((log: IntegrationLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-5 py-3.5 hover:bg-accent/30 transition-colors\"\n >\n <div className=\"mt-0.5\">{getLogLevelIcon(log.level)}</div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-medium',\n getLogLevelColor(log.level)\n )}\n >\n {log.level.toUpperCase()}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground\">\n {log.action.replace(/_/g, ' ')}\n </span>\n {log.responseStatus && (\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-mono',\n log.responseStatus >= 400\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n )}\n >\n {log.responseStatus}\n </span>\n )}\n </div>\n <p className=\"text-sm text-foreground mt-1\">{log.message}</p>\n {log.requestUrl && (\n <p className=\"text-xs text-muted-foreground font-mono mt-0.5 truncate\">\n {log.requestMethod && (\n <span className=\"font-semibold\">{log.requestMethod} </span>\n )}\n {log.requestUrl}\n </p>\n )}\n </div>\n <span className=\"text-xs text-muted-foreground whitespace-nowrap flex-shrink-0\">\n {formatDate(log.createdAt)}\n </span>\n </div>\n ))}\n </div>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-full bg-muted/50 mb-4\">\n <FileText size={32} className=\"text-muted-foreground\" />\n </div>\n <h3 className=\"font-semibold text-foreground mb-1\">\n {hasActiveFilters ? 'No matching logs' : 'No activity logs yet'}\n </h3>\n <p className=\"text-sm text-muted-foreground max-w-sm\">\n {hasActiveFilters\n ? 'Try adjusting your filters.'\n : 'Activity logs will appear here once you start using integrations.'}\n </p>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border hover:bg-accent transition-colors\"\n >\n <X size={14} /> Clear Filters\n </button>\n )}\n </div>\n )}\n\n {/* Pagination */}\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between px-2\">\n <p className=\"text-sm text-muted-foreground\">\n Showing {(currentPage - 1) * DEFAULT_PAGE_SIZE + 1}-\n {Math.min(currentPage * DEFAULT_PAGE_SIZE, total ?? 0)} of {total}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n aria-label=\"Previous page\"\n className=\"p-2 rounded-lg border border-border hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronLeft size={16} />\n </button>\n <span className=\"text-sm text-foreground px-3 py-1.5 rounded-lg bg-muted\">\n {currentPage} / {totalPages}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n aria-label=\"Next page\"\n className=\"p-2 rounded-lg border border-border hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronRight size={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AgB;OAC1B,cAAW;OACX,WAAU;iBAEV,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;OACnB,CAAA;MACL;OACF;MAEP,EAAA,CAAA;GAED;MA7SJ,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IAAa,MAAM;IAAI,WAAU;IAA+B,CAAA;GAChE,kBAAC,MAAD;IAAI,WAAU;cAAyC;IAAkB,CAAA;GACzE,kBAAC,KAAD;IAAG,WAAU;cAA8C;IAEvD,CAAA;GACJ,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,IAAW,EAAS;IACnC,WAAU;cAHZ,CAKE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EAAA,oBAChB;;GACL"}
1
+ {"version":3,"file":"ConnectionLogs.js","names":[],"sources":["../../../src/integrations/pages/ConnectionLogs.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n FileText,\n Search,\n Filter,\n X,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n Loader2,\n ChevronLeft,\n ChevronRight,\n Info,\n AlertTriangle,\n Bug,\n Activity,\n Download,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { formatDate } from '../utils/integrationsHelpers';\nimport { useIntegrationLogs } from '../hooks/useLogs';\nimport { LOG_LEVEL_OPTIONS, LOG_ACTION_OPTIONS, DEFAULT_PAGE_SIZE } from '../utils/constants';\nimport type { IntegrationLog, LogLevel, LogAction } from '../types';\n\nfunction getLogLevelIcon(level: LogLevel) {\n switch (level) {\n case 'error':\n return <AlertCircle size={14} className=\"text-status-error-text\" />;\n case 'warn':\n return <AlertTriangle size={14} className=\"text-status-warning-text\" />;\n case 'info':\n return <Info size={14} className=\"text-status-info-text\" />;\n case 'debug':\n return <Bug size={14} className=\"text-text-tertiary\" />;\n default:\n return <Activity size={14} className=\"text-text-tertiary\" />;\n }\n}\n\nfunction getLogLevelColor(level: LogLevel): string {\n switch (level) {\n case 'error':\n return 'text-status-error-text bg-status-error-bg-subtle border-border-default';\n case 'warn':\n return 'text-status-warning-text bg-status-warning-bg-subtle border-border-default';\n case 'info':\n return 'text-status-info-text bg-status-info-bg-subtle border-border-default';\n case 'debug':\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n default:\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n }\n}\n\nfunction toCsvCell(value: string | number | null): string {\n const text = String(value ?? '');\n return `\"${text.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction downloadLogsCsv(logs: IntegrationLog[]) {\n const header = [\n 'Created At',\n 'Level',\n 'Action',\n 'Message',\n 'Request Method',\n 'Request URL',\n 'Status',\n ];\n const rows = logs.map((log) => [\n log.createdAt,\n log.level,\n log.action,\n log.message,\n log.requestMethod,\n log.requestUrl,\n log.responseStatus,\n ]);\n const csv = [header, ...rows].map((row) => row.map(toCsvCell).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `integration-logs-${new Date().toISOString().slice(0, 10)}.csv`;\n link.click();\n URL.revokeObjectURL(url);\n}\n\n/**\n * Connection Logs — activity log view with filtering and pagination.\n */\nexport function ConnectionLogs() {\n const { basePath = '/', navigate } = useIntegrations();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canReadLogs = hasPermission(INTEGRATION_PERMISSIONS.LOG_READ);\n const canExportCsv = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.CSV_EXPORT, true);\n\n const idPrefix = useId();\n const levelFilterId = `${idPrefix}-level`;\n const actionFilterId = `${idPrefix}-action`;\n const [searchQuery, setSearchQuery] = useState('');\n const [levelFilter, setLevelFilter] = useState<LogLevel | 'all'>('all');\n const [actionFilter, setActionFilter] = useState<LogAction | 'all'>('all');\n const [showFilters, setShowFilters] = useState(false);\n const [currentPage, setCurrentPage] = useState(1);\n\n const { logs, total, loading, error, refetch } = useIntegrationLogs({\n level: levelFilter === 'all' ? undefined : levelFilter,\n action: actionFilter === 'all' ? undefined : actionFilter,\n page: currentPage,\n pageSize: DEFAULT_PAGE_SIZE,\n skip: permissionsLoading || !canReadLogs,\n });\n\n // Client-side search filter\n const filteredLogs = useMemo(() => {\n if (!searchQuery) return logs ?? [];\n const q = searchQuery.toLowerCase();\n return (logs ?? []).filter(\n (log: IntegrationLog) =>\n log.message.toLowerCase().includes(q) ||\n (log.requestUrl?.toLowerCase().includes(q) ?? false)\n );\n }, [logs, searchQuery]);\n\n const totalPages = Math.ceil((total ?? 0) / DEFAULT_PAGE_SIZE);\n\n const hasActiveFilters = searchQuery || levelFilter !== 'all' || actionFilter !== 'all';\n\n const handleClearFilters = () => {\n setSearchQuery('');\n setLevelFilter('all');\n setActionFilter('all');\n setCurrentPage(1);\n };\n\n const handleExport = () => {\n downloadLogsCsv(filteredLogs);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canReadLogs) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <AlertCircle size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">Access Denied</h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n You don&apos;t have permission to view activity logs.\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} /> Back to Overview\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label=\"Back\"\n >\n <ArrowLeft size={20} />\n </button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <FileText size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">Activity Logs</h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n Track integration activity and debug issues\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label=\"Search activity logs\"\n placeholder=\"Search logs...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-10 pr-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n aria-expanded={showFilters}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} /> Filter\n </button>\n {canExportCsv && (\n <button\n type=\"button\"\n onClick={handleExport}\n disabled={filteredLogs.length === 0}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border-subtle text-sm font-medium hover:bg-accent transition-colors disabled:opacity-50\"\n >\n <Download size={16} /> Export CSV\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border border-border-subtle text-sm font-medium hover:bg-accent transition-colors\"\n >\n <RefreshCw size={16} /> Refresh\n </button>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" /> Filters\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text flex items-center gap-1\"\n >\n <X size={14} /> Clear All\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={levelFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Log Level\n </label>\n <select\n id={levelFilterId}\n value={levelFilter}\n onChange={(e) => {\n setLevelFilter(e.target.value as LogLevel | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20\"\n >\n <option value=\"all\">All Levels</option>\n {LOG_LEVEL_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={actionFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n Action\n </label>\n <select\n id={actionFilterId}\n value={actionFilter}\n onChange={(e) => {\n setActionFilter(e.target.value as LogAction | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20\"\n >\n <option value=\"all\">All Actions</option>\n {LOG_ACTION_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">Error loading logs</h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} /> Try Again\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {/* Logs List */}\n {!loading && !error && (\n <>\n {filteredLogs.length > 0 ? (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface overflow-hidden\">\n <div className=\"divide-y divide-border/50\">\n {filteredLogs.map((log: IntegrationLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-5 py-3.5 hover:bg-accent/30 transition-colors\"\n >\n <div className=\"mt-0.5\">{getLogLevelIcon(log.level)}</div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-medium',\n getLogLevelColor(log.level)\n )}\n >\n {log.level.toUpperCase()}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {log.action.replace(/_/g, ' ')}\n </span>\n {log.responseStatus && (\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-mono',\n log.responseStatus >= 400\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n )}\n >\n {log.responseStatus}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-primary mt-1\">{log.message}</p>\n {log.requestUrl && (\n <p className=\"text-xs text-text-secondary font-mono mt-0.5 truncate\">\n {log.requestMethod && (\n <span className=\"font-semibold\">{log.requestMethod} </span>\n )}\n {log.requestUrl}\n </p>\n )}\n </div>\n <span className=\"text-xs text-text-secondary whitespace-nowrap flex-shrink-0\">\n {formatDate(log.createdAt)}\n </span>\n </div>\n ))}\n </div>\n </div>\n ) : (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <div className=\"p-4 rounded-full bg-bg-sunken/50 mb-4\">\n <FileText size={32} className=\"text-text-secondary\" />\n </div>\n <h3 className=\"font-semibold text-text-primary mb-1\">\n {hasActiveFilters ? 'No matching logs' : 'No activity logs yet'}\n </h3>\n <p className=\"text-sm text-text-secondary max-w-sm\">\n {hasActiveFilters\n ? 'Try adjusting your filters.'\n : 'Activity logs will appear here once you start using integrations.'}\n </p>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"mt-4 inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <X size={14} /> Clear Filters\n </button>\n )}\n </div>\n )}\n\n {/* Pagination */}\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between px-2\">\n <p className=\"text-sm text-text-secondary\">\n Showing {(currentPage - 1) * DEFAULT_PAGE_SIZE + 1}-\n {Math.min(currentPage * DEFAULT_PAGE_SIZE, total ?? 0)} of {total}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n aria-label=\"Previous page\"\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronLeft size={16} />\n </button>\n <span className=\"text-sm text-text-primary px-3 py-1.5 rounded-lg bg-bg-sunken\">\n {currentPage} / {totalPages}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n aria-label=\"Next page\"\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronRight size={16} />\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAAS,EAAgB,GAAiB;AACxC,SAAQ,GAAR;EACE,KAAK,QACH,QAAO,kBAAC,GAAD;GAAa,MAAM;GAAI,WAAU;GAA2B,CAAA;EACrE,KAAK,OACH,QAAO,kBAAC,GAAD;GAAe,MAAM;GAAI,WAAU;GAA6B,CAAA;EACzE,KAAK,OACH,QAAO,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAA0B,CAAA;EAC7D,KAAK,QACH,QAAO,kBAAC,GAAD;GAAK,MAAM;GAAI,WAAU;GAAuB,CAAA;EACzD,QACE,QAAO,kBAAC,GAAD;GAAU,MAAM;GAAI,WAAU;GAAuB,CAAA;;;AAIlE,SAAS,GAAiB,GAAyB;AACjD,SAAQ,GAAR;EACE,KAAK,QACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,QACE,QAAO;;;AAIb,SAAS,EAAU,GAAuC;AAExD,QAAO,IADM,OAAO,KAAS,GAAG,CAChB,WAAW,MAAK,OAAK,CAAC;;AAGxC,SAAS,EAAgB,GAAwB;CAmB/C,IAAM,IAAM,CAlBG;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EAUoB,GATR,EAAK,KAAK,MAAQ;EAC7B,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACL,CAAC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