// In an app: import { setupStatsCard } from '@aparte/plugin-cards/stats';
const { setupStatsCard } = window.apartePlugins.cards.stats;
setupStatsCard({ tool: 'get_sales_summary', variant: 'list' });
document.querySelector('aparte-chat-bubble').setSegments([{
id: 's1', type: 'tool_call', status: 'resolved',
toolCall: { id: 'c-s1', name: 'get_sales_summary', input: { period: 'this week' } },
structuredResult: {
title: 'Sales this week', subtitle: 'Online store, every channel',
items: [
{ label: 'Revenue', value: 48250, currency: 'EUR', change: 0.124, good: 'up', changeLabel: 'vs last week', icon: 'money',
trend: [5200, 6100, 5800, 7400, 6900, 8300, 8550] },
{ label: 'Orders', value: 612, change: 0.08, good: 'up', icon: 'cart', trend: [71, 80, 76, 92, 88, 101, 104] },
{ label: 'Conversion rate', value: 0.031, format: 'percent', change: -0.06, good: 'up', icon: 'chart',
trend: [0.034, 0.033, 0.033, 0.032, 0.031, 0.030, 0.031] },
{ label: 'Returns', value: 23, change: '+3%', good: 'down', hint: '3.8% of orders' },
],
footnote: 'Taxes included; a refund counts on the day it is issued.',
updatedAt: Date.now() - 5 * 60000,
},
}]);