{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-act-trust-card",
  "type": "registry:component",
  "title": "EU AI Act Art. 50 & 2 Dec 2026 C2PA SaaS Trust-Center Card",
  "description": "Interactive Shadow DOM EU AI Act Art. 50 & 2 December 2026 C2PA Readiness Card for SaaS /trust and /security pages across 10 EU languages. Loads https://spurvik.com/trust-widget.js (MIT, zero cookies, zero storage). attribution={false} = Pro white-label (€19/mo).",
  "author": "Spurvik (EyeTea Solutions ApS) <hello@spurvik.com>",
  "dependencies": [],
  "docs": "Render <AIActTrustCard domain=\"yourdomain.com\" /> on your /trust, /security, or footer page. On Free (€0), displays a subtle \"Art. 50 · Spurvik\" link plus live DPO Brief & C2PA Check links; set attribution={false} on Pro (€19/mo or €190/yr) or Done-For-You (€199 once) for white-label. If you send a Content-Security-Policy, allow script-src https://spurvik.com and connect-src https://console.spurvik.com.",
  "categories": [
    "eu-ai-act",
    "ai",
    "trust-center"
  ],
  "files": [
    {
      "path": "components/ai-act-trust-card.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\n/**\n * Spurvik SaaS Trust-Center Readiness Card (EU AI Act Art. 50 & 2 Dec 2026 C2PA).\n *\n * Loads https://spurvik.com/trust-widget.js (MIT, zero cookies, zero storage, Shadow DOM)\n * once per page and renders the live 4-signal card inside its own Shadow Root.\n *\n *   <AIActTrustCard domain=\"folk.app\" />\n *   <AIActTrustCard domain=\"personio.de\" locale=\"de\" theme=\"dark\" />\n *   <AIActTrustCard domain=\"folk.app\" attribution={false} /> // Pro white-label (€19/mo)\n */\n\nexport type TrustCardLocale =\n  | \"auto\" | \"en\" | \"de\" | \"fr\" | \"nl\" | \"da\" | \"sv\" | \"fi\" | \"es\" | \"it\" | \"pl\";\n\nexport type TrustCardTheme = \"dark\" | \"light\" | \"auto\";\n\nexport interface AIActTrustCardProps {\n  /** Public SaaS or store hostname, e.g. \"folk.app\" or \"yourdomain.com\". */\n  domain: string;\n  /** Card language (10 EU languages or \"auto\" to follow <html lang> / ccTLD). */\n  locale?: TrustCardLocale;\n  /** Visual theme. Default \"dark\". */\n  theme?: TrustCardTheme;\n  /** Hydrate live HTTPS / Art. 50 / C2PA signals from console.spurvik.com. Default true. */\n  live?: boolean;\n  /** Show subtle \"Art. 50 · Spurvik\" referral link. Default true; false = Pro white-label (€19/mo). */\n  attribution?: boolean;\n  className?: string;\n}\n\nconst WIDGET_SRC = \"https://spurvik.com/trust-widget.js\";\n\ninterface SpurvikTrustWidgetApi {\n  version: string;\n  create: (options: {\n    target: HTMLElement;\n    domain: string;\n    locale?: string;\n    theme?: string;\n    live?: string;\n    attribution?: string;\n  }) => HTMLElement | null;\n}\n\nfunction widgetApi(): SpurvikTrustWidgetApi | undefined {\n  return (window as unknown as { SpurvikTrustWidget?: SpurvikTrustWidgetApi }).SpurvikTrustWidget;\n}\n\nlet loading: Promise<SpurvikTrustWidgetApi> | null = null;\n\nfunction loadTrustWidget(): Promise<SpurvikTrustWidgetApi> {\n  const ready = widgetApi();\n  if (ready) return Promise.resolve(ready);\n  if (loading) return loading;\n  loading = new Promise<SpurvikTrustWidgetApi>((resolve, reject) => {\n    const existing = document.querySelector<HTMLScriptElement>(`script[src=\"${WIDGET_SRC}\"]`);\n    const script = existing ?? document.createElement(\"script\");\n    script.addEventListener(\n      \"load\",\n      () => {\n        const api = widgetApi();\n        if (api) resolve(api);\n        else reject(new Error(\"trust-widget.js loaded but window.SpurvikTrustWidget is missing\"));\n      },\n      { once: true },\n    );\n    script.addEventListener(\n      \"error\",\n      () => {\n        loading = null;\n        reject(new Error(`Could not load ${WIDGET_SRC}`));\n      },\n      { once: true },\n    );\n    if (!existing) {\n      script.src = WIDGET_SRC;\n      script.async = true;\n      script.dataset.spurvikMounted = \"react\";\n      script.dataset.cookieconsent = \"ignore\";\n      script.dataset.ucAllowed = \"true\";\n      document.head.appendChild(script);\n    }\n  });\n  return loading;\n}\n\nexport function AIActTrustCard({\n  domain,\n  locale = \"auto\",\n  theme = \"dark\",\n  live = true,\n  attribution = true,\n  className,\n}: AIActTrustCardProps) {\n  const slot = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    const el = slot.current;\n    if (!el || !domain) return;\n    let cancelled = false;\n    el.replaceChildren();\n    el.removeAttribute(\"data-spurvik-trust-widget\");\n    const hostNode = document.createElement(\"div\");\n    el.appendChild(hostNode);\n    loadTrustWidget()\n      .then((api) => {\n        if (cancelled) return;\n        api.create({\n          target: hostNode,\n          domain,\n          locale,\n          theme,\n          live: live ? \"true\" : \"false\",\n          attribution: attribution ? \"true\" : \"false\",\n        });\n      })\n      .catch((error: unknown) => {\n        console.error(\"[ai-act-trust-card]\", error);\n      });\n    return () => {\n      cancelled = true;\n      hostNode.remove();\n    };\n  }, [domain, locale, theme, live, attribution]);\n\n  return <div ref={slot} className={className} data-spurvik-trust-react=\"\" />;\n}\n\nexport default AIActTrustCard;\n"
    }
  ]
}
