/**
 * Icon sets, brand glyph paths, and semantic icon-usage slots for the theme engine.
 *
 * @countermeasure-platform/web-components/services/theme-engine
 */

import type { IconSet, IconSetId, IconUsage } from './types'

export const ICON_SETS: Record<IconSetId, IconSet> = {
  lucide: {
    id: 'lucide',
    label: 'Lucide',
    description: 'Default — clean 2px stroke',
    strokeWidth: 2,
    linecap: 'round',
    linejoin: 'round',
    brand: false,
  },
  heroicons: {
    id: 'heroicons',
    label: 'Heroicons',
    description: 'Heavier 2.4px stroke',
    strokeWidth: 2.4,
    linecap: 'round',
    linejoin: 'round',
    brand: false,
  },
  phosphor: {
    id: 'phosphor',
    label: 'Phosphor',
    description: 'Lighter 1.5px stroke',
    strokeWidth: 1.5,
    linecap: 'round',
    linejoin: 'round',
    brand: false,
  },
  material: {
    id: 'material',
    label: 'Material',
    description: 'Square caps, geometric',
    strokeWidth: 2,
    linecap: 'square',
    linejoin: 'miter',
    brand: false,
  },
  countermeasure: {
    id: 'countermeasure',
    label: 'CounterMeasure',
    description: 'Brand set — bespoke marks for security',
    strokeWidth: 1.75,
    linecap: 'round',
    linejoin: 'round',
    brand: true,
  },
}

/** Brand glyph paths — used when `iconSet === 'countermeasure'`. */
export const CM_ICON_PATHS: Record<string, string> = {
  Shield: 'M12 2l9 4-3 11-6 5-6-5-3-11z M12 7v10 M7.5 10l9 4 M16.5 10l-9 4',
  ShieldCheck: 'M12 2l9 4-3 11-6 5-6-5-3-11z M8.5 12l3 3 4-5',
  Crosshair:
    'M12 12m-9 0a9 9 0 1 0 18 0 9 9 0 1 0-18 0 M12 12m-5 0a5 5 0 1 0 10 0 5 5 0 1 0-10 0 M22 12h-2 M4 12H2 M12 4V2 M12 22v-2 M12 12v.01',
  Bug: 'M12 3l4 5h-8z M12 8v13 M5 12l-2 2 2 2 M19 12l2 2-2 2 M8 21h8',
  Database: 'M4 4h16v5H4z M4 9.5h16v5H4z M4 15h16v5H4z M9 6.5h.01 M9 12h.01 M9 17.5h.01',
  Plug: 'M12 2l4 4-4 4-4-4z M12 10v4 M9 14h6v3a3 3 0 0 1-3 3 3 3 0 0 1-3-3z',
  Sparkles: 'M12 2l3 7 7 3-7 3-3 7-3-7-7-3 7-3z',
  Rocket: 'M12 2l5 8h-3v8h-4v-8H7z M9 22h6',
  Settings:
    'M12 2l1.5 2.6L16 4l.5 3 3 .5L19 10l2.6 1.5L20 14l1 3-3 1-1 3-3-1-1.5 2.6L11 20l-1 2-3-1L6 18l-3-1 1-3-2.6-1.5L4 11 2 9.5 5 8l-1-3 3-1z M12 12m-3 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0',
  Activity: 'M2 12h4l3 8 3-16 3 8 3-4h4',
  Skull: 'M12 3l8 7v6l-3 3v3h-2v-3h-2v3h-2v-3h-2v3H7v-3l-3-3v-6z M9 12h.01 M15 12h.01',
  Lightbulb: 'M12 3l5 6-5 8-5-8z M9 18h6 M10 21h4',
  Target:
    'M12 12m-10 0a10 10 0 1 0 20 0 10 10 0 1 0-20 0 M12 12m-5 0a5 5 0 1 0 10 0 5 5 0 1 0-10 0 M12 7l3 3 M12 17l3-3',
  Globe: 'M12 2l9 5v10l-9 5-9-5V7z M12 2v20 M3 7l9 5 9-5 M3 17l9-5 9 5',
}

/** Semantic icon-usage slots driving the per-icon override matrix. */
export const ICON_USAGES: IconUsage[] = [
  {
    id: 'nav.search',
    label: 'Search',
    defaultIcon: 'Search',
    alternates: ['Search', 'Crosshair', 'Target'],
  },
  {
    id: 'nav.notifications',
    label: 'Notifications',
    defaultIcon: 'Bell',
    alternates: ['Bell', 'AlertCircle', 'Activity'],
  },
  {
    id: 'nav.help',
    label: 'Help',
    defaultIcon: 'HelpCircle',
    alternates: ['HelpCircle', 'BookOpen', 'MessageSquare'],
  },
  {
    id: 'nav.feedback',
    label: 'Feedback',
    defaultIcon: 'MessageSquare',
    alternates: ['MessageSquare', 'Send', 'Mic'],
  },
  {
    id: 'product.detection',
    label: 'Detection',
    defaultIcon: 'Shield',
    alternates: ['Shield', 'ShieldCheck', 'Bug', 'AlertTriangle'],
  },
  {
    id: 'product.coverage',
    label: 'Coverage',
    defaultIcon: 'Crosshair',
    alternates: ['Crosshair', 'Target', 'Grid3X3'],
  },
  {
    id: 'product.intel',
    label: 'Threat intel',
    defaultIcon: 'Skull',
    alternates: ['Skull', 'Bug', 'AlertTriangle'],
  },
  {
    id: 'product.connectors',
    label: 'Connectors',
    defaultIcon: 'Plug',
    alternates: ['Plug', 'Network', 'Workflow'],
  },
  {
    id: 'product.detections',
    label: 'Detection library',
    defaultIcon: 'FileCode',
    alternates: ['FileCode', 'BookOpen', 'Files'],
  },
  {
    id: 'product.opps',
    label: 'Opportunities',
    defaultIcon: 'Lightbulb',
    alternates: ['Lightbulb', 'Sparkles', 'TrendingUp'],
  },
  {
    id: 'product.studio',
    label: 'Studio (IDE)',
    defaultIcon: 'Terminal',
    alternates: ['Terminal', 'Code2', 'Code'],
  },
  {
    id: 'system.settings',
    label: 'Settings',
    defaultIcon: 'Settings',
    alternates: ['Settings', 'SlidersHorizontal', 'Wrench'],
  },
  {
    id: 'system.user',
    label: 'User',
    defaultIcon: 'UserCheck',
    alternates: ['UserCheck', 'UserCog', 'Users'],
  },
  {
    id: 'system.logout',
    label: 'Sign out',
    defaultIcon: 'LogOut',
    alternates: ['LogOut', 'LogIn'],
  },
  {
    id: 'state.success',
    label: 'Success',
    defaultIcon: 'CheckCircle',
    alternates: ['CheckCircle', 'Check'],
  },
  {
    id: 'state.warning',
    label: 'Warning',
    defaultIcon: 'AlertTriangle',
    alternates: ['AlertTriangle', 'AlertCircle'],
  },
]
