// Line-icon set — lucide-inspired, original strokes
// All icons are 24x24 viewBox, currentColor stroke

const Icon = ({ d, size = 16, fill = "none", stroke = "currentColor", sw = 1.6, children, viewBox = "0 0 24 24", ...rest }) => (
  <svg width={size} height={size} viewBox={viewBox} fill={fill} stroke={stroke}
       strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {d ? <path d={d} /> : children}
  </svg>
);

// Sidebar nav icons
const IconHome = (p) => <Icon {...p}><path d="M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-7h-6v7H4a1 1 0 0 1-1-1z"/></Icon>;
const IconSearch = (p) => <Icon {...p}><circle cx="11" cy="11" r="6.5"/><path d="m16 16 4.5 4.5"/></Icon>;
const IconBars = (p) => <Icon {...p}><path d="M4 20V10M10 20V4M16 20V13M22 20H2"/></Icon>;
const IconNetwork = (p) => <Icon {...p}><circle cx="12" cy="5" r="2.5"/><circle cx="5" cy="19" r="2.5"/><circle cx="19" cy="19" r="2.5"/><path d="M12 7.5v3.5M7 17l3.5-4M17 17l-3.5-4"/></Icon>;
const IconMonitor = (p) => <Icon {...p}><rect x="3" y="4" width="18" height="13" rx="1.5"/><path d="M8 21h8M12 17v4"/></Icon>;
const IconBranch = (p) => <Icon {...p}><circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="9" r="2"/><path d="M6 7v10M6 12c0-2 2-3 4-3h6"/></Icon>;
const IconGrid = (p) => <Icon {...p}><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"/></Icon>;
const IconStream = (p) => <Icon {...p}><ellipse cx="12" cy="5" rx="8" ry="2.5"/><path d="M4 5v6c0 1.4 3.6 2.5 8 2.5s8-1.1 8-2.5V5M4 11v6c0 1.4 3.6 2.5 8 2.5s8-1.1 8-2.5v-6"/></Icon>;
const IconReport = (p) => <Icon {...p}><path d="M6 3h9l4 4v14H6z"/><path d="M14 3v5h5M9 13h7M9 17h5"/></Icon>;
const IconAlert = (p) => <Icon {...p}><path d="M6 17h12l-1.5-3V10a4.5 4.5 0 0 0-9 0v4z"/><path d="M10 20a2 2 0 0 0 4 0"/></Icon>;
const IconBolt = (p) => <Icon {...p}><path d="M13 3 4 14h7l-1 7 9-11h-7z"/></Icon>;
const IconFilter = (p) => <Icon {...p}><path d="M4 5h16l-6 8v7l-4-2v-5z"/></Icon>;
const IconUsers = (p) => <Icon {...p}><circle cx="9" cy="8" r="3.5"/><path d="M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6"/><circle cx="17" cy="9" r="2.5"/><path d="M15 14h1c2.8 0 5 2.2 5 5"/></Icon>;

// Top bar icons
const IconSun = (p) => <Icon {...p}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></Icon>;
const IconMoon = (p) => <Icon {...p}><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></Icon>;
const IconHash = (p) => <Icon {...p}><path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18"/></Icon>;
const IconHelp = (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 1-1 1.7v.5"/><circle cx="12" cy="16.5" r=".5" fill="currentColor"/></Icon>;
const IconGear = (p) => <Icon {...p}><circle cx="12" cy="12" r="3"/><path d="M12 2v2M12 20v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M2 12h2M20 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/></Icon>;
const IconUser = (p) => <Icon {...p}><circle cx="12" cy="8" r="3.5"/><path d="M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8"/></Icon>;
const IconChevDown = (p) => <Icon {...p}><path d="m6 9 6 6 6-6"/></Icon>;
const IconChevRight = (p) => <Icon {...p}><path d="m9 6 6 6-6 6"/></Icon>;
const IconChevLeft = (p) => <Icon {...p}><path d="m15 6-6 6 6 6"/></Icon>;
const IconChevsLeft = (p) => <Icon {...p}><path d="m11 6-6 6 6 6M19 6l-6 6 6 6"/></Icon>;
const IconChevsRight = (p) => <Icon {...p}><path d="m13 6 6 6-6 6M5 6l6 6-6 6"/></Icon>;
const IconRefresh = (p) => <Icon {...p}><path d="M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5"/></Icon>;
const IconClock = (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></Icon>;
const IconSave = (p) => <Icon {...p}><path d="M5 3h11l4 4v14H5z"/><path d="M8 3v5h8V3M8 21v-7h8v7"/></Icon>;
const IconShare = (p) => <Icon {...p}><circle cx="6" cy="12" r="2.5"/><circle cx="18" cy="6" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path d="m8 11 8-4M8 13l8 4"/></Icon>;
const IconMenu = (p) => <Icon {...p}><path d="M4 6h16M4 12h16M4 18h16"/></Icon>;
const IconPlus = (p) => <Icon {...p}><path d="M12 4v16M4 12h16"/></Icon>;
const IconExpand = (p) => <Icon {...p}><path d="M4 4h6M4 4v6M20 4h-6M20 4v6M4 20h6M4 20v-6M20 20h-6M20 20v-6"/></Icon>;
const IconCaretRight = (p) => <Icon {...p}><path d="m9 6 6 6-6 6" sw="2"/></Icon>;
const IconCopy = (p) => <Icon {...p}><rect x="8" y="8" width="12" height="12" rx="1.5"/><path d="M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3"/></Icon>;
const IconHistogram = (p) => <Icon {...p}><path d="M4 20V13M9 20V8M14 20V11M19 20V5" sw={1.8}/></Icon>;
const IconChart = (p) => <Icon {...p}><path d="M4 20V14M9 20V10M14 20V6M19 20V12" sw={1.8}/></Icon>;
const IconSql = (p) => <Icon {...p}><ellipse cx="12" cy="5" rx="8" ry="2.5"/><path d="M4 5v14c0 1.4 3.6 2.5 8 2.5s8-1.1 8-2.5V5"/><path d="M8 12h2M8 16h2" sw="1.4" stroke="currentColor"/></Icon>;
const IconFx = (p) => <Icon {...p}><path d="M5 18c0-8 2-13 5-13M10 12H6M19 7l-7 11M12 7l7 11" sw={1.4}/></Icon>;
const IconCircle = (p) => <Icon {...p}><circle cx="12" cy="12" r="4" fill="currentColor" stroke="none"/></Icon>;
const IconDot = (p) => <Icon {...p}><circle cx="12" cy="12" r="2" fill="currentColor" stroke="none"/></Icon>;
const IconGripV = (p) => <Icon {...p}><circle cx="9" cy="6" r="1" fill="currentColor"/><circle cx="9" cy="12" r="1" fill="currentColor"/><circle cx="9" cy="18" r="1" fill="currentColor"/><circle cx="15" cy="6" r="1" fill="currentColor"/><circle cx="15" cy="12" r="1" fill="currentColor"/><circle cx="15" cy="18" r="1" fill="currentColor"/></Icon>;
const IconInfo = (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 11v6M12 8v.1"/></Icon>;
const IconArrowUp = (p) => <Icon {...p}><path d="M12 19V5M5 12l7-7 7 7"/></Icon>;
const IconArrowDown = (p) => <Icon {...p}><path d="M12 5v14M19 12l-7 7-7-7"/></Icon>;
const IconSlack = (p) => <Icon {...p}><rect x="3" y="10" width="6" height="4" rx="2"/><rect x="10" y="15" width="4" height="6" rx="2"/><rect x="15" y="10" width="6" height="4" rx="2"/><rect x="10" y="3" width="4" height="6" rx="2"/></Icon>;
const IconPattern = (p) => <Icon {...p}><path d="M4 6h7M4 10h12M4 14h9M4 18h14" sw={1.7}/><circle cx="18" cy="6" r="1.4" fill="currentColor" stroke="none"/><circle cx="16" cy="14" r="1.4" fill="currentColor" stroke="none"/></Icon>;
const IconHourglass = (p) => <Icon {...p}><path d="M6 3h12M6 21h12M7 3v4l5 5 5-5V3M7 21v-4l5-5 5 5v4" sw={1.5}/></Icon>;
const IconWarnTri = (p) => <Icon {...p}><path d="M12 3 2 21h20z" sw={1.6}/><path d="M12 10v5M12 18.5v.1" sw={1.8}/></Icon>;
const IconEq = (p) => <Icon {...p}><path d="M4 9h16M4 15h16" sw={1.8}/></Icon>;
const IconNeq = (p) => <Icon {...p}><path d="M4 9h16M4 15h16M16 5 8 19" sw={1.8}/></Icon>;
const IconFire = (p) => <Icon {...p}><path d="M12 3c1 4-3 5-3 9a3 3 0 0 0 6 0c0-2-1-3-1-5 1 1 2 3 2 5a5 5 0 0 1-10 0c0-5 5-5 6-9z"/></Icon>;
const IconGitGraph = (p) => <Icon {...p}><circle cx="6" cy="6" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="12" r="2"/><path d="M6 8v8M8 6h2c3 0 6 2 6 4M8 18h2c3 0 6-2 6-4"/></Icon>;
const IconWaterfall = (p) => <Icon {...p}><path d="M3 5h6M6 9h7M9 13h7M12 17h9" sw={1.8}/></Icon>;
const IconJSON = (p) => <Icon {...p}><path d="M8 4c-2 0-3 1-3 3v3c0 1-1 2-2 2 1 0 2 1 2 2v3c0 2 1 3 3 3M16 4c2 0 3 1 3 3v3c0 1 1 2 2 2-1 0-2 1-2 2v3c0 2-1 3-3 3"/></Icon>;
const IconTable = (p) => <Icon {...p}><rect x="3" y="4" width="18" height="16" rx="1"/><path d="M3 10h18M3 15h18M11 4v16"/></Icon>;
const IconArrowLeft = (p) => <Icon {...p}><path d="M19 12H5M12 19l-7-7 7-7"/></Icon>;
const IconX = (p) => <Icon {...p}><path d="M6 6l12 12M18 6 6 18"/></Icon>;

// Logs toolbar additions
const IconPatterns  = (p) => <Icon {...p}><path d="M4 20V14M9 20V8M14 20V11M19 20V5" sw={2}/></Icon>;
const IconInsights  = (p) => <Icon {...p}><path d="M3 17c3-1 5-9 9-9s5 6 9 5"/></Icon>;
const IconTool      = (p) => <Icon {...p}><path d="m14.7 6.3 3 3-9.5 9.5a1.4 1.4 0 0 1-2-2zM14.7 6.3l-2.4-2.4 2-2 4.4 4.4-2 2zM5 17l-2 4 4-2"/></Icon>;
const IconSearchZoom = (p) => <Icon {...p}><circle cx="11" cy="11" r="6.5"/><path d="m16 16 4.5 4.5M8.5 11h5M11 8.5v5"/></Icon>;
const IconAnomaly    = (p) => <Icon {...p}><path d="M12 3 22 20H2z"/><path d="M12 10v5M12 17.5v.1"/></Icon>;
const IconQuickMode  = (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M9 9h6v6H9z" fill="currentColor" stroke="none"/></Icon>;

// Chart-type rail glyphs (for dashboard editor)
const IconCT = {
  bar:     (p) => <Icon {...p}><path d="M4 20V10M10 20V6M16 20V13M22 20H2" sw={1.6}/></Icon>,
  area:    (p) => <Icon {...p}><path d="M3 17 9 9l5 4 6-9v15H3z" fill="currentColor" stroke="none" opacity=".15"/><path d="M3 17 9 9l5 4 6-9"/></Icon>,
  line:    (p) => <Icon {...p}><path d="M3 17 9 9l5 4 6-9"/></Icon>,
  stack:   (p) => <Icon {...p}><rect x="3" y="14" width="4" height="6"/><rect x="10" y="10" width="4" height="10"/><rect x="17" y="6" width="4" height="14"/></Icon>,
  scatter: (p) => <Icon {...p}><circle cx="5" cy="17" r="1.5"/><circle cx="10" cy="10" r="1.5"/><circle cx="14" cy="14" r="1.5"/><circle cx="18" cy="6" r="1.5"/><circle cx="19" cy="18" r="1.5"/></Icon>,
  pie:     (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 3v9l8 4"/></Icon>,
  donut:   (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="4"/></Icon>,
  gauge:   (p) => <Icon {...p}><path d="M4 14a8 8 0 0 1 16 0"/><path d="m12 14 4-3"/></Icon>,
  table:   (p) => <Icon {...p}><rect x="3" y="4" width="18" height="16" rx="1"/><path d="M3 10h18M3 15h18M11 4v16"/></Icon>,
  map:     (p) => <Icon {...p}><circle cx="12" cy="10" r="3"/><path d="M12 21c-4-5-7-8-7-12a7 7 0 0 1 14 0c0 4-3 7-7 12z"/></Icon>,
  heatmap: (p) => <Icon {...p}><rect x="3" y="3" width="5" height="5" fill="currentColor" opacity=".2" stroke="none"/><rect x="10" y="3" width="5" height="5" fill="currentColor" opacity=".5" stroke="none"/><rect x="17" y="3" width="4" height="5" fill="currentColor" opacity=".8" stroke="none"/><rect x="3" y="10" width="5" height="5" fill="currentColor" opacity=".7" stroke="none"/><rect x="10" y="10" width="5" height="5" fill="currentColor" opacity=".3" stroke="none"/><rect x="17" y="10" width="4" height="5" fill="currentColor" opacity=".5" stroke="none"/><rect x="3" y="17" width="5" height="4" fill="currentColor" opacity=".4" stroke="none"/><rect x="10" y="17" width="5" height="4" fill="currentColor" opacity=".9" stroke="none"/><rect x="17" y="17" width="4" height="4" fill="currentColor" opacity=".2" stroke="none"/></Icon>,
  num:     (p) => <Icon {...p}><path d="M5 6v12M5 12h6M11 6v12M16 9c2 0 3-1 3-3M16 18c2 0 3-1 3-3" sw={1.4}/></Icon>,
  funnel:  (p) => <Icon {...p}><path d="M3 4h18l-6 7v9l-6-2v-7z"/></Icon>,
  md:      (p) => <Icon {...p}><rect x="3" y="6" width="18" height="12" rx="1.5"/><path d="M6 9v6M6 9l2 2 2-2v6M14 9v6M14 15l3-3"/></Icon>,
  text:    (p) => <Icon {...p}><path d="M5 6h14M12 6v14M8 20h8"/></Icon>,
  sankey:  (p) => <Icon {...p}><rect x="3" y="4" width="3" height="6"/><rect x="3" y="14" width="3" height="6"/><rect x="18" y="7" width="3" height="10"/><path d="M6 7C12 7 14 10 18 10M6 17C12 17 14 14 18 14" sw={2.5} opacity=".4"/></Icon>,
};

window.Icons = {
  IconHome, IconSearch, IconBars, IconNetwork, IconMonitor, IconBranch, IconGrid,
  IconStream, IconReport, IconAlert, IconBolt, IconFilter, IconUsers,
  IconSun, IconMoon, IconHash, IconHelp, IconGear, IconUser, IconChevDown,
  IconChevRight, IconChevLeft, IconChevsLeft, IconChevsRight, IconRefresh, IconClock,
  IconSave, IconShare, IconMenu, IconPlus, IconExpand, IconCaretRight, IconCopy,
  IconHistogram, IconChart, IconSql, IconFx, IconCircle, IconDot, IconGripV, IconInfo,
  IconArrowUp, IconArrowDown, IconSlack, IconCT,
  IconPattern, IconHourglass, IconWarnTri, IconEq, IconNeq, IconFire, IconGitGraph,
  IconWaterfall, IconJSON, IconTable, IconArrowLeft, IconX,
  IconPatterns, IconInsights, IconTool, IconSearchZoom, IconAnomaly, IconQuickMode,
};
