/* icons.jsx — line-icon library (UI chrome + industrial / data-viz asset icons) */
const ICON_PATHS = {
  /* ---- UI chrome ---- */
  search:      <><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></>,
  plus:        <><path d="M12 5v14M5 12h14"/></>,
  close:       <><path d="M18 6 6 18M6 6l12 12"/></>,
  chevronR:    <><path d="m9 6 6 6-6 6"/></>,
  chevronD:    <><path d="m6 9 6 6 6-6"/></>,
  check:       <><path d="M20 6 9 17l-5-5"/></>,
  filter:      <><path d="M3 5h18M6 12h12M10 19h4"/></>,
  sliders:     <><path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"/></>,
  sun:         <><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></>,
  moon:        <><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></>,
  link:        <><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></>,
  branch:      <><circle cx="6" cy="6" r="2.4"/><circle cx="6" cy="18" r="2.4"/><circle cx="18" cy="7" r="2.4"/><path d="M6 8.4v7.2M18 9.4c0 4-4 4.6-9.6 6"/></>,
  diff:        <><path d="M12 3v6M9 6h6M5 9 3 11l2 2M19 9l2 2-2 2"/><path d="M9 18h6"/></>,
  layers:      <><path d="m12 3 9 5-9 5-9-5 9-5z"/><path d="m3 13 9 5 9-5"/></>,
  grid:        <><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></>,
  image:       <><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.6"/><path d="m21 15-5-5L5 21"/></>,
  upload:      <><path d="M12 16V4M7 9l5-5 5 5"/><path d="M5 16v3a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3"/></>,
  download:    <><path d="M12 4v12M7 11l5 5 5-5"/><path d="M5 20h14"/></>,
  trash:       <><path d="M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2M6 7l1 13h10l1-13"/></>,
  edit:        <><path d="M4 20h4L18.5 9.5a2 2 0 0 0-3-3L5 17z"/></>,
  copy:        <><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h8"/></>,
  eye:         <><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="2.5"/></>,
  info:        <><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></>,
  warningTri:  <><path d="M10.3 4 2.4 18a1.8 1.8 0 0 0 1.6 2.7h16a1.8 1.8 0 0 0 1.6-2.7L13.7 4a1.9 1.9 0 0 0-3.4 0z"/><path d="M12 9v4M12 17h.01"/></>,
  arrowR:      <><path d="M5 12h14M13 6l6 6-6 6"/></>,
  more:        <><circle cx="5" cy="12" r="1.4"/><circle cx="12" cy="12" r="1.4"/><circle cx="19" cy="12" r="1.4"/></>,
  refresh:     <><path d="M21 12a9 9 0 1 1-2.6-6.4M21 4v4h-4"/></>,
  external:    <><path d="M14 4h6v6M20 4 10 14M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5"/></>,
  user:        <><circle cx="12" cy="8" r="3.4"/><path d="M5 20a7 7 0 0 1 14 0"/></>,
  hash:        <><path d="M4 9h16M4 15h16M10 4 8 20M16 4l-2 16"/></>,
  tag:         <><path d="M3 11.5V5a2 2 0 0 1 2-2h6.5a2 2 0 0 1 1.4.6l7.5 7.5a2 2 0 0 1 0 2.8l-6.5 6.5a2 2 0 0 1-2.8 0L3.6 12.9A2 2 0 0 1 3 11.5z"/><circle cx="7.5" cy="7.5" r="1.2"/></>,
  chat:        <><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8z"/></>,
  send:        <><path d="M22 2 11 13M22 2l-7 20-4-9-9-4z"/></>,
  clock:       <><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></>,
  /* ---- industrial / data-viz asset icons ---- */
  gauge:       <><path d="M12 21a9 9 0 1 1 9-9"/><path d="m12 12 4-4"/><circle cx="12" cy="12" r="1.4"/></>,
  chartLine:   <><path d="M4 4v16h16"/><path d="m7 14 3-4 3 3 5-7"/></>,
  chartBar:    <><path d="M4 4v16h16"/><path d="M8 17v-5M12 17V8M16 17v-8"/></>,
  thermometer: <><path d="M14 14.8V5a2 2 0 1 0-4 0v9.8a4 4 0 1 0 4 0z"/><path d="M12 9v6"/></>,
  vibration:   <><path d="M2 12h3l2-6 4 13 3-9 2 4h6"/></>,
  chip:        <><rect x="7" y="7" width="10" height="10" rx="1.5"/><path d="M10 7V4M14 7V4M10 20v-3M14 20v-3M7 10H4M7 14H4M20 10h-3M20 14h-3"/></>,
  database:    <><ellipse cx="12" cy="5.5" rx="7" ry="2.8"/><path d="M5 5.5v6c0 1.5 3.1 2.8 7 2.8s7-1.3 7-2.8v-6"/><path d="M5 11.5v6c0 1.5 3.1 2.8 7 2.8s7-1.3 7-2.8v-6"/></>,
  bell:        <><path d="M18 8a6 6 0 1 0-12 0c0 7-3 9-3 9h18s-3-2-3-9z"/><path d="M10.5 21a2 2 0 0 0 3 0"/></>,
  signal:      <><path d="M4 20v-4M9 20v-8M14 20v-12M19 20V5"/></>,
  power:       <><path d="M12 4v8"/><path d="M7.5 7a7 7 0 1 0 9 0"/></>,
  alertCircle: <><circle cx="12" cy="12" r="9"/><path d="M12 8v5M12 16h.01"/></>,
  activity:    <><path d="M3 12h4l3 8 4-16 3 8h4"/></>,
  cpuWave:     <><path d="M3 12h3l2-5 3 10 3-7 2 2h5"/></>,
  cube:        <><path d="m12 3 8 4.5v9L12 21l-8-4.5v-9L12 3z"/><path d="m4 7.5 8 4.5 8-4.5M12 12v9"/></>,
  network:     <><circle cx="5" cy="6" r="2.2"/><circle cx="5" cy="18" r="2.2"/><circle cx="19" cy="12" r="2.2"/><path d="M7.2 6.6 16.8 11M7.2 17.4 16.8 13"/></>,
  table:       <><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 9h18M3 14.5h18M9 9v11"/></>,
  route:       <><circle cx="6" cy="19" r="2.2"/><circle cx="18" cy="5" r="2.2"/><path d="M8 19h6a4 4 0 0 0 0-8H10a4 4 0 0 1 0-8h6"/></>,
  zoomIn:      <><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3M11 8v6M8 11h6"/></>,
  zoomOut:     <><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3M8 11h6"/></>,
  fit:         <><path d="M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"/></>,
  move:        <><path d="M12 3v18M3 12h18M12 3 9 6m3-3 3 3M12 21l-3-3m3 3 3-3M3 12l3-3m-3 3 3 3M21 12l-3-3m3 3-3 3"/></>,
  component:   <><path d="M12 2 9 5l3 3 3-3-3-3zM5 9l-3 3 3 3 3-3-3-3zm14 0-3 3 3 3 3-3-3-3zm-7 7-3 3 3 3 3-3-3-3z"/></>,
  crosshair:   <><circle cx="12" cy="12" r="8"/><path d="M12 2v4M12 18v4M2 12h4M18 12h4"/></>,
};

function Icon({ name, size = 16, stroke = 1.6, className = '', style }) {
  const p = ICON_PATHS[name];
  if (!p) return null;
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
      stroke="currentColor" strokeWidth={stroke} strokeLinecap="round" strokeLinejoin="round"
      className={className} style={style} aria-hidden="true">{p}</svg>
  );
}

Object.assign(window, { Icon, ICON_PATHS });
