export interface EnxBotConfig { botId: string; host: string; rootPath?: string; callingEnabled?: boolean; } export enum EnxMessageSender { User = 'user', Bot = 'bot', } export enum EnxMessageType { Text = 'text', Action = 'action', Suggestion = 'suggestion', Image = 'image', File = 'file', Video = 'video', Typing = 'typing', Calendar = 'calendar', } export enum EnxSuggestionType { Single = 'single', Multiple = 'multiple', } export interface EnxChoice { title: string; value: string; isSelected?: boolean; } export interface EnxAction { title: string; url?: string; action?: string; } export interface EnxMedia { url?: string; fileName: string; mimeType: string; localUri?: string; size?: number; } /** Rich link / company card (hero image + title + body + CTA), aligned with mobile web chat. */ export interface EnxLinkCard { url: string; imageUrl?: string; title?: string; description?: string; buttonTitle?: string; } /** WhatsApp-style centered notice (handover, agent assignment, dropped, etc.). */ export type EnxMessageDisplayStyle = 'default' | 'systemCentered'; export interface EnxMessage { id?: string; sender: EnxMessageSender; type: EnxMessageType; timestamp: Date; text?: string; subtitle?: string; /** When `systemCentered`, render as a full-width centered notice chip instead of a side bubble. */ displayStyle?: EnxMessageDisplayStyle; /** Raw handover state from the bot payload (e.g. initiated, assigned). */ handoverStatus?: string; media?: EnxMedia; /** When set, UI renders a link preview card instead of raw URL + file row. */ linkCard?: EnxLinkCard; choices?: EnxChoice[]; actions?: EnxAction[]; suggestionType?: EnxSuggestionType; } export enum EnxConnectionStatus { Idle = 'idle', Loading = 'loading', Connected = 'connected', Disconnected = 'disconnected', Reconnecting = 'reconnecting', Error = 'error', } export interface EnxChatTheme { primaryColor: string; userBubbleColor: string; botBubbleColor: string; backgroundColor: string; userAvatarColor: string; botAvatarColor: string; useMobileClassicLayout: boolean; } export const defaultTheme: EnxChatTheme = { primaryColor: '#075E54', userBubbleColor: '#DCF8C6', botBubbleColor: '#FFFFFF', backgroundColor: '#ECE5DD', userAvatarColor: '#2196F3', botAvatarColor: '#4CAF50', useMobileClassicLayout: false, }; export const mobileClassicTheme: EnxChatTheme = { primaryColor: '#22C55E', userBubbleColor: '#DDF7C7', botBubbleColor: '#FFFFFF', backgroundColor: '#F2EEEA', userAvatarColor: '#2EA3F2', botAvatarColor: '#4CAF50', useMobileClassicLayout: true, };