{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkout-invoice-history",
  "type": "registry:component",
  "title": "Checkout Invoice History",
  "description": "Invoice history with counting totals, an upcoming invoice card, status filters, search and a year select over a table with status pills and download buttons. The table turns into stacked rows in narrow containers and exports to CSV locally.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "checkout",
    "billing",
    "invoices",
    "table",
    "filters",
    "csv export",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/checkout-invoice-history",
  "files": [
    {
      "path": "registry/hyperblur/checkout-invoice-history.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/checkout-invoice-history.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type InvoiceStatus = \"paid\" | \"open\" | \"failed\" | \"refunded\";\n\nexport interface InvoiceRow {\n  id: string;\n  date: string;\n  year: number;\n  description: string;\n  amount: number;\n  status: InvoiceStatus;\n}\n\nexport interface UpcomingInvoice {\n  date: string;\n  lines: { label: string; amount: number }[];\n}\n\nexport interface CheckoutInvoiceHistoryProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  invoices?: InvoiceRow[];\n  upcoming?: UpcomingInvoice;\n  currency?: string;\n  onDownload?: (invoiceId: string) => void;\n  onFilterChange?: (filter: { status: InvoiceStatus | \"all\"; query: string; year: number | \"all\" }) => void;\n  accent?: string;\n}\n\nconst defaultInvoices: InvoiceRow[] = [\n  { id: \"INV-2026-0112\", date: \"Nov 1, 2026\", year: 2026, description: \"Team plan, 10 seats\", amount: 240, status: \"open\" },\n  { id: \"INV-2026-0098\", date: \"Oct 1, 2026\", year: 2026, description: \"Team plan, 10 seats\", amount: 240, status: \"paid\" },\n  { id: \"INV-2026-0091\", date: \"Sep 14, 2026\", year: 2026, description: \"Extra build minutes, 2,000\", amount: 36, status: \"paid\" },\n  { id: \"INV-2026-0085\", date: \"Sep 1, 2026\", year: 2026, description: \"Team plan, 10 seats\", amount: 240, status: \"failed\" },\n  { id: \"INV-2026-0071\", date: \"Aug 1, 2026\", year: 2026, description: \"Team plan, 8 seats\", amount: 192, status: \"paid\" },\n  { id: \"INV-2026-0064\", date: \"Jul 19, 2026\", year: 2026, description: \"Seat added mid-cycle, prorated\", amount: 14.2, status: \"refunded\" },\n  { id: \"INV-2026-0058\", date: \"Jul 1, 2026\", year: 2026, description: \"Team plan, 8 seats\", amount: 192, status: \"paid\" },\n  { id: \"INV-2026-0042\", date: \"Jun 1, 2026\", year: 2026, description: \"Team plan, 8 seats\", amount: 192, status: \"paid\" },\n  { id: \"INV-2025-0311\", date: \"Dec 1, 2025\", year: 2025, description: \"Starter plan, 6 seats\", amount: 60, status: \"paid\" },\n  { id: \"INV-2025-0287\", date: \"Nov 1, 2025\", year: 2025, description: \"Starter plan, 6 seats\", amount: 60, status: \"paid\" },\n];\n\nconst defaultUpcoming: UpcomingInvoice = {\n  date: \"Dec 1, 2026\",\n  lines: [\n    { label: \"Team plan, 10 seats\", amount: 240 },\n    { label: \"Extra bandwidth, 120 GB\", amount: 18 },\n    { label: \"Credit from downgrade\", amount: -12 },\n  ],\n};\n\nconst statusLabel: Record<InvoiceStatus, string> = { paid: \"Paid\", open: \"Open\", failed: \"Failed\", refunded: \"Refunded\" };\nconst filters: (InvoiceStatus | \"all\")[] = [\"all\", \"paid\", \"open\", \"failed\", \"refunded\"];\n\nfunction useCount(target: number) {\n  const [value, setValue] = React.useState(0);\n  React.useEffect(() => {\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    let raf = 0;\n    let t0 = 0;\n    const step = (t: number) => {\n      if (!t0) t0 = t;\n      const p = reduce ? 1 : Math.min(1, (t - t0) / 1100);\n      setValue(target * (1 - Math.pow(1 - p, 4)));\n      if (p < 1) raf = requestAnimationFrame(step);\n    };\n    raf = requestAnimationFrame(step);\n    return () => cancelAnimationFrame(raf);\n  }, [target]);\n  return value;\n}\n\nconst css = `\n.hb-qg9 {\n  --hb-qg9-accent: #f59e0b;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-qg9 *, .hb-qg9 *::before, .hb-qg9 *::after { box-sizing: border-box; }\n.hb-qg9-inner { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 6cqw, 88px) clamp(16px, 4cqw, 32px); }\n.hb-qg9-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }\n.hb-qg9-title { margin: 0; font-size: clamp(26px, 3.6cqw, 36px); letter-spacing: -0.03em; font-weight: 600; }\n.hb-qg9-sub { margin: 6px 0 0; font-size: 14px; color: #8f8f8f; }\n.hb-qg9-btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); background: #141414; color: #ededed; font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: background .2s, border-color .2s; }\n.hb-qg9-btn:hover { background: #1c1c1c; border-color: rgba(255,255,255,.18); }\n.hb-qg9-btn svg { width: 14px; height: 14px; }\n.hb-qg9-btn:focus-visible, .hb-qg9-seg button:focus-visible, .hb-qg9-dl:focus-visible { outline: 2px solid var(--hb-qg9-accent); outline-offset: 2px; }\n.hb-qg9-top { display: grid; gap: 12px; margin-top: 28px; }\n@container (min-width: 760px) { .hb-qg9-top { grid-template-columns: 1fr 1fr 1.5fr; } }\n.hb-qg9-stat { border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: #111; padding: 18px; display: grid; align-content: space-between; gap: 18px; position: relative; overflow: hidden; }\n.hb-qg9-stat small { font-size: 12px; color: #8f8f8f; display: flex; align-items: center; gap: 6px; }\n.hb-qg9-stat b { font-size: clamp(26px, 3.4cqw, 34px); letter-spacing: -0.04em; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-qg9-stat span { font-size: 12px; color: #6b6b6b; }\n.hb-qg9-spark { position: absolute; right: 0; bottom: 0; width: 55%; height: 60%; opacity: .9; }\n.hb-qg9-spark path:first-child { fill: color-mix(in srgb, var(--hb-qg9-accent) 14%, transparent); }\n.hb-qg9-spark path:last-child { stroke: var(--hb-qg9-accent); stroke-dasharray: 300; stroke-dashoffset: 300; animation: hb-qg9-draw 1.6s .2s ease forwards; }\n@keyframes hb-qg9-draw { to { stroke-dashoffset: 0; } }\n.hb-qg9-up { border: 1px solid color-mix(in srgb, var(--hb-qg9-accent) 30%, rgba(255,255,255,.08)); border-radius: 16px; padding: 18px; background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hb-qg9-accent) 14%, #111), #111 60%); }\n.hb-qg9-uph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }\n.hb-qg9-uph small { font-size: 12px; color: #a1a1a1; }\n.hb-qg9-uph span { font-size: 11px; font-weight: 600; color: var(--hb-qg9-accent); background: color-mix(in srgb, var(--hb-qg9-accent) 14%, transparent); padding: 3px 8px; border-radius: 999px; }\n.hb-qg9-upt { margin: 6px 0 10px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }\n.hb-qg9-upl { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px dashed rgba(255,255,255,.1); display: grid; gap: 6px; font-size: 12px; color: #a1a1a1; }\n.hb-qg9-upl li { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }\n.hb-qg9-upl li[data-neg=\"true\"] span:last-child { color: #6ee7b7; }\n.hb-qg9-panel { margin-top: 16px; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; background: #0f0f0f; overflow: hidden; container-type: inline-size; }\n.hb-qg9-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06); }\n.hb-qg9-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #161616; border: 1px solid rgba(255,255,255,.06); overflow-x: auto; max-width: 100%; }\n.hb-qg9-seg button { border: 0; background: none; color: #8f8f8f; font: inherit; font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }\n.hb-qg9-seg button:hover { color: #ededed; }\n.hb-qg9-seg button[aria-checked=\"true\"] { background: #262626; color: #ededed; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }\n.hb-qg9-seg em { font-style: normal; font-size: 10px; color: #6b6b6b; font-variant-numeric: tabular-nums; }\n.hb-qg9-search { flex: 1; min-width: 160px; position: relative; }\n.hb-qg9-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: #6b6b6b; }\n.hb-qg9-search input { width: 100%; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: #0a0a0a; color: #ededed; font: inherit; font-size: 13px; padding: 0 10px 0 30px; outline: none; }\n.hb-qg9-search input:focus, .hb-qg9-year:focus { border-color: var(--hb-qg9-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-qg9-accent) 20%, transparent); }\n.hb-qg9-year { height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.08); background: #0a0a0a; color: #ededed; font: inherit; font-size: 13px; padding: 0 8px; outline: none; }\n.hb-qg9-table { width: 100%; border-collapse: collapse; font-size: 13px; }\n.hb-qg9-table th { text-align: left; font-weight: 500; font-size: 11px; color: #6b6b6b; text-transform: uppercase; letter-spacing: .06em; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.06); background: #0c0c0c; }\n.hb-qg9-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }\n.hb-qg9-table tbody tr { animation: hb-qg9-row .45s cubic-bezier(.2,.8,.2,1) both; transition: background .15s; }\n.hb-qg9-table tbody tr:hover { background: rgba(255,255,255,.02); }\n@keyframes hb-qg9-row { from { opacity: 0; transform: translateY(6px); } }\n.hb-qg9-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #d4d4d4; }\n.hb-qg9-muted { color: #8f8f8f; }\n.hb-qg9-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }\n.hb-qg9-table th.hb-qg9-num { text-align: right; }\n.hb-qg9-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px 3px 8px; border-radius: 999px; border: 1px solid; }\n.hb-qg9-pill::before { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }\n.hb-qg9-pill[data-s=\"paid\"] { color: #6ee7b7; border-color: rgba(110,231,183,.25); background: rgba(110,231,183,.08); }\n.hb-qg9-pill[data-s=\"open\"] { color: var(--hb-qg9-accent); border-color: color-mix(in srgb, var(--hb-qg9-accent) 35%, transparent); background: color-mix(in srgb, var(--hb-qg9-accent) 10%, transparent); }\n.hb-qg9-pill[data-s=\"open\"]::before { animation: hb-qg9-blink 1.6s ease-in-out infinite; }\n@keyframes hb-qg9-blink { 50% { opacity: .3; } }\n.hb-qg9-pill[data-s=\"failed\"] { color: #fda4af; border-color: rgba(253,164,175,.25); background: rgba(253,164,175,.08); }\n.hb-qg9-pill[data-s=\"refunded\"] { color: #a1a1a1; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.04); }\n.hb-qg9-dl { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); background: transparent; color: #a1a1a1; cursor: pointer; display: inline-grid; place-items: center; transition: background .2s, color .2s; }\n.hb-qg9-dl:hover { background: #1a1a1a; color: #ededed; }\n.hb-qg9-dl svg { width: 14px; height: 14px; }\n.hb-qg9-empty { padding: 40px 16px; text-align: center; color: #6b6b6b; font-size: 13px; }\n.hb-qg9-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; font-size: 12px; color: #8f8f8f; font-variant-numeric: tabular-nums; }\n.hb-qg9-foot b { color: #ededed; font-weight: 500; }\n@container (max-width: 640px) {\n  .hb-qg9-table thead { display: none; }\n  .hb-qg9-table, .hb-qg9-table tbody, .hb-qg9-table tr, .hb-qg9-table td { display: block; width: 100%; }\n  .hb-qg9-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05); }\n  .hb-qg9-table td { padding: 0; border: 0; }\n  .hb-qg9-table td:nth-child(1) { grid-column: 1; }\n  .hb-qg9-table td:nth-child(2) { grid-column: 1; grid-row: 3; font-size: 12px; }\n  .hb-qg9-table td:nth-child(3) { grid-column: 1; grid-row: 2; }\n  .hb-qg9-table td:nth-child(4) { grid-column: 2; grid-row: 1; }\n  .hb-qg9-table td:nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; }\n  .hb-qg9-table td:nth-child(6) { grid-column: 2; grid-row: 3; text-align: right; }\n  .hb-qg9-table td.hb-qg9-num { width: auto; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qg9 *, .hb-qg9 *::before, .hb-qg9 *::after { animation: none !important; transition: none !important; }\n  .hb-qg9-spark path:last-child { stroke-dashoffset: 0; }\n}\n`;\n\nexport function CheckoutInvoiceHistory({\n  title = \"Invoices\",\n  subtitle = \"Every charge for the Halcyon Labs workspace, with PDF-ready receipts.\",\n  invoices = defaultInvoices,\n  upcoming = defaultUpcoming,\n  currency = \"USD\",\n  onDownload,\n  onFilterChange,\n  accent = \"#f59e0b\",\n  className = \"\",\n  style,\n  ...rest\n}: CheckoutInvoiceHistoryProps) {\n  const uid = React.useId();\n  const money = React.useMemo(() => new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency }), [currency]);\n  const [status, setStatus] = React.useState<InvoiceStatus | \"all\">(\"all\");\n  const [query, setQuery] = React.useState(\"\");\n  const years = React.useMemo(() => Array.from(new Set(invoices.map((i) => i.year))).sort((a, b) => b - a), [invoices]);\n  const [year, setYear] = React.useState<number | \"all\">(years[0] ?? \"all\");\n  const segRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n\n  const update = (next: { status?: InvoiceStatus | \"all\"; query?: string; year?: number | \"all\" }) => {\n    const s = next.status ?? status;\n    const q = next.query ?? query;\n    const y = next.year ?? year;\n    if (next.status !== undefined) setStatus(s);\n    if (next.query !== undefined) setQuery(q);\n    if (next.year !== undefined) setYear(y);\n    onFilterChange?.({ status: s, query: q, year: y });\n  };\n\n  const inYear = invoices.filter((i) => year === \"all\" || i.year === year);\n  const q = query.trim().toLowerCase();\n  const shown = inYear.filter((i) => (status === \"all\" || i.status === status) && (!q || i.id.toLowerCase().includes(q) || i.description.toLowerCase().includes(q)));\n  const paidTotal = inYear.filter((i) => i.status === \"paid\").reduce((s, i) => s + i.amount, 0);\n  const openTotal = inYear.filter((i) => i.status === \"open\" || i.status === \"failed\").reduce((s, i) => s + i.amount, 0);\n  const shownTotal = shown.reduce((s, i) => s + (i.status === \"refunded\" ? 0 : i.amount), 0);\n  const upTotal = upcoming.lines.reduce((s, l) => s + l.amount, 0);\n  const paidCount = useCount(paidTotal);\n  const openCount = useCount(openTotal);\n\n  const download = (inv: InvoiceRow) => {\n    if (onDownload) {\n      onDownload(inv.id);\n      return;\n    }\n    const text = [`Invoice ${inv.id}`, `Date ${inv.date}`, inv.description, `Amount ${money.format(inv.amount)}`, `Status ${statusLabel[inv.status]}`].join(\"\\n\");\n    const url = URL.createObjectURL(new Blob([text], { type: \"text/plain\" }));\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `${inv.id}.txt`;\n    a.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  };\n\n  const exportCsv = () => {\n    const rows = [[\"Invoice\", \"Date\", \"Description\", \"Amount\", \"Status\"], ...shown.map((i) => [i.id, i.date, i.description, i.amount.toFixed(2), statusLabel[i.status]])];\n    const csv = rows.map((r) => r.map((c) => `\"${c.replace(/\"/g, '\"\"')}\"`).join(\",\")).join(\"\\n\");\n    const url = URL.createObjectURL(new Blob([csv], { type: \"text/csv\" }));\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `invoices-${year}.csv`;\n    a.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  };\n\n  const onSegKey = (e: React.KeyboardEvent, i: number) => {\n    let n = -1;\n    if (e.key === \"ArrowRight\") n = (i + 1) % filters.length;\n    if (e.key === \"ArrowLeft\") n = (i - 1 + filters.length) % filters.length;\n    if (n < 0) return;\n    e.preventDefault();\n    update({ status: filters[n] });\n    segRefs.current[n]?.focus();\n  };\n\n  const vars = { \"--hb-qg9-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-qg9 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-checkout-invoice-history\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qg9-inner\">\n        <div className=\"hb-qg9-head\">\n          <div>\n            <h2 className=\"hb-qg9-title\">{title}</h2>\n            {subtitle ? <p className=\"hb-qg9-sub\">{subtitle}</p> : null}\n          </div>\n          <button type=\"button\" className=\"hb-qg9-btn\" onClick={exportCsv}>\n            <svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><path d=\"M7 1.5v7M4 5.8L7 8.8l3-3M2 12.5h10\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n            Export CSV\n          </button>\n        </div>\n        <div className=\"hb-qg9-top\">\n          <div className=\"hb-qg9-stat\">\n            <small>Paid in {year === \"all\" ? \"total\" : year}</small>\n            <b>{money.format(paidCount)}</b>\n            <span>{inYear.filter((i) => i.status === \"paid\").length} invoices settled</span>\n            <svg className=\"hb-qg9-spark\" viewBox=\"0 0 120 60\" preserveAspectRatio=\"none\" aria-hidden=\"true\">\n              <path d=\"M0 50 L15 46 L30 48 L45 38 L60 40 L75 28 L90 30 L105 18 L120 14 L120 60 L0 60Z\" />\n              <path d=\"M0 50 L15 46 L30 48 L45 38 L60 40 L75 28 L90 30 L105 18 L120 14\" fill=\"none\" strokeWidth=\"1.6\" />\n            </svg>\n          </div>\n          <div className=\"hb-qg9-stat\">\n            <small>Outstanding</small>\n            <b>{money.format(openCount)}</b>\n            <span>{inYear.filter((i) => i.status === \"open\" || i.status === \"failed\").length} open or failed</span>\n          </div>\n          <div className=\"hb-qg9-up\">\n            <div className=\"hb-qg9-uph\"><small>Upcoming invoice</small><span>{upcoming.date}</span></div>\n            <div className=\"hb-qg9-upt\">{money.format(upTotal)}</div>\n            <ul className=\"hb-qg9-upl\">\n              {upcoming.lines.map((l) => (\n                <li key={l.label} data-neg={l.amount < 0 ? \"true\" : undefined}><span>{l.label}</span><span>{l.amount < 0 ? `-${money.format(-l.amount)}` : money.format(l.amount)}</span></li>\n              ))}\n            </ul>\n          </div>\n        </div>\n        <div className=\"hb-qg9-panel\">\n          <div className=\"hb-qg9-bar\">\n            <div className=\"hb-qg9-seg\" role=\"radiogroup\" aria-label=\"Status\">\n              {filters.map((f, i) => (\n                <button\n                  key={f}\n                  ref={(el) => { segRefs.current[i] = el; }}\n                  type=\"button\"\n                  role=\"radio\"\n                  aria-checked={status === f}\n                  tabIndex={status === f ? 0 : -1}\n                  onClick={() => update({ status: f })}\n                  onKeyDown={(e) => onSegKey(e, i)}\n                >\n                  {f === \"all\" ? \"All\" : statusLabel[f]}\n                  <em>{f === \"all\" ? inYear.length : inYear.filter((x) => x.status === f).length}</em>\n                </button>\n              ))}\n            </div>\n            <div className=\"hb-qg9-search\">\n              <svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><circle cx=\"6\" cy=\"6\" r=\"4.2\" stroke=\"currentColor\" strokeWidth=\"1.4\" /><path d=\"M9.2 9.2l3 3\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" /></svg>\n              <input aria-label=\"Search invoices\" placeholder=\"Search number or description\" value={query} onChange={(e) => update({ query: e.target.value })} />\n            </div>\n            <select className=\"hb-qg9-year\" aria-label=\"Year\" value={String(year)} onChange={(e) => update({ year: e.target.value === \"all\" ? \"all\" : Number(e.target.value) })}>\n              {years.map((y) => <option key={y} value={y}>{y}</option>)}\n              <option value=\"all\">All years</option>\n            </select>\n          </div>\n          {shown.length ? (\n            <table className=\"hb-qg9-table\" aria-describedby={`${uid}-foot`}>\n              <thead>\n                <tr>\n                  <th scope=\"col\">Invoice</th>\n                  <th scope=\"col\">Date</th>\n                  <th scope=\"col\">Description</th>\n                  <th scope=\"col\" className=\"hb-qg9-num\">Amount</th>\n                  <th scope=\"col\">Status</th>\n                  <th scope=\"col\"><span style={{ position: \"absolute\", width: 1, height: 1, overflow: \"hidden\", clip: \"rect(0 0 0 0)\" }}>Download</span></th>\n                </tr>\n              </thead>\n              <tbody>\n                {shown.map((inv, i) => (\n                  <tr key={inv.id} style={{ animationDelay: `${(i * 0.05).toFixed(2)}s` }}>\n                    <td className=\"hb-qg9-id\">{inv.id}</td>\n                    <td className=\"hb-qg9-muted\">{inv.date}</td>\n                    <td>{inv.description}</td>\n                    <td className=\"hb-qg9-num\">{money.format(inv.amount)}</td>\n                    <td><span className=\"hb-qg9-pill\" data-s={inv.status}>{statusLabel[inv.status]}</span></td>\n                    <td style={{ textAlign: \"right\" }}>\n                      <button type=\"button\" className=\"hb-qg9-dl\" aria-label={`Download ${inv.id}`} onClick={() => download(inv)}>\n                        <svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><path d=\"M7 1.5v7M4 5.8L7 8.8l3-3M2 12.5h10\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n                      </button>\n                    </td>\n                  </tr>\n                ))}\n              </tbody>\n            </table>\n          ) : (\n            <p className=\"hb-qg9-empty\">No invoices match these filters.</p>\n          )}\n          <div className=\"hb-qg9-foot\" id={`${uid}-foot`}>\n            <span>Showing <b>{shown.length}</b> of {inYear.length} invoices</span>\n            <span>Billed <b>{money.format(shownTotal)}</b> excluding refunds</span>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}