declare global { interface Window { AgentsChatWidget?: { init: (config: { serverUrl: string agentSlug: string appId: string externalUserId?: string position?: 'bottom-right' | 'bottom-left' theme?: 'dark' | 'light' primaryColor?: string }) => void } } } export default defineNuxtPlugin(() => { const initWidget = () => { if (window.AgentsChatWidget) { window.AgentsChatWidget.init({ serverUrl: 'https://gamdias.nucleoriofrio.com', agentSlug: 'whatsapp-agent', appId: 'whatsapp-app', externalUserId: 'whatsapp-user', position: 'bottom-right', theme: 'dark', primaryColor: '#25D366' }) } } if (document.readyState === 'complete') { setTimeout(initWidget, 100) } else { window.addEventListener('load', () => setTimeout(initWidget, 100)) } })