(function() { const ENTRIES = {{ entries | tojson }}; const PROJECT = {{ project | tojson }}; const BASE_URL = {{ base_url | tojson }}; const ENTRY_COUNT = {{ entry_count }}; const CATEGORY_ICONS = { 'feature': '\u2728', 'fix': '\uD83D\uDC1B', 'improvement': '\uD83D\uDE80', 'breaking': '\u26A0\uFE0F', 'docs': '\uD83D\uDCD6', 'chore': '\uD83D\uDD27' }; const containerId = 'changelog-hq-widget-' + PROJECT.id; if (document.getElementById(containerId)) return; const style = document.createElement('style'); style.textContent = ` #${containerId} { position: fixed; bottom: 20px; right: 20px; z-index: 99999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; } #${containerId} .chq-trigger { width: 48px; height: 48px; border-radius: 50%; background: #6366f1; color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(99,102,241,0.4); transition: transform 0.2s, box-shadow 0.2s; position: relative; } #${containerId} .chq-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(99,102,241,0.5); } #${containerId} .chq-trigger svg { width: 22px; height: 22px; } #${containerId} .chq-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: white; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; line-height: 1; } #${containerId} .chq-panel { position: absolute; bottom: 60px; right: 0; width: 360px; max-height: 480px; background: #ffffff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05); overflow: hidden; display: none; flex-direction: column; animation: chqSlideUp 0.2s ease-out; } #${containerId} .chq-panel.open { display: flex; } @keyframes chqSlideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } #${containerId} .chq-panel-header { padding: 16px 20px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; } #${containerId} .chq-panel-header h3 { font-size: 15px; font-weight: 600; color: #111827; margin: 0; } #${containerId} .chq-panel-header a { font-size: 12px; color: #6366f1; text-decoration: none; } #${containerId} .chq-panel-header a:hover { text-decoration: underline; } #${containerId} .chq-entries { overflow-y: auto; padding: 8px 0; flex: 1; } #${containerId} .chq-entry { padding: 12px 20px; border-bottom: 1px solid #f3f4f6; transition: background 0.1s; } #${containerId} .chq-entry:hover { background: #f9fafb; } #${containerId} .chq-entry:last-child { border-bottom: none; } #${containerId} .chq-entry-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin-bottom: 4px; } #${containerId} .chq-entry-title { font-size: 14px; font-weight: 500; color: #111827; line-height: 1.4; } #${containerId} .chq-entry-body { font-size: 13px; color: #6b7280; margin-top: 4px; line-height: 1.4; } #${containerId} .chq-entry-date { font-size: 11px; color: #9ca3af; margin-top: 6px; } #${containerId} .chq-empty { padding: 32px 20px; text-align: center; color: #9ca3af; font-size: 14px; } @media (prefers-color-scheme: dark) { #${containerId} .chq-panel { background: #1f2937; box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05); } #${containerId} .chq-panel-header { border-color: #374151; } #${containerId} .chq-panel-header h3 { color: #f3f4f6; } #${containerId} .chq-entry { border-color: #374151; } #${containerId} .chq-entry:hover { background: #111827; } #${containerId} .chq-entry-title { color: #f3f4f6; } #${containerId} .chq-entry-body { color: #9ca3af; } } `; document.head.appendChild(style); const container = document.createElement('div'); container.id = containerId; const changelogUrl = BASE_URL + '/projects/' + PROJECT.id + '/changelog?format=html'; let entriesHtml = ''; if (ENTRIES.length === 0) { entriesHtml = '