local M = {}

function M.highlight(palette, opts)
  return {
    ["@annotation"] = { fg = palette.fg },
    ["@attribute"] = { fg = palette.fg },
    ["@boolean"] = { fg = palette.red },
    ["@character"] = { fg = palette.green },
    ["@comment"] = { link = "Comment" },
    ["@comment.documentation"] = { fg = palette.medium_gray },
    ["@comment.error"] = { fg = palette.error },
    ["@comment.note"] = { fg = palette.light_gray },
    ["@comment.todo"] = { fg = palette.todo },
    ["@comment.warning"] = { fg = palette.warning },
    ["@const.builtin"] = { fg = palette.red },
    ["@const.macro"] = { fg = palette.cyan },
    ["@constant"] = { fg = palette.fg },
    ["@constructor"] = { fg = palette.cyan },
    ["@diff.delta"] = {
      fg = palette.gray_blue,
      bg = palette.accent_blue,
      bold = true,
    },
    ["@error"] = { fg = palette.error },
    ["@function"] = vim.tbl_extend(
      "force",
      { fg = palette.cyan },
      opts.styles.functions
    ),
    ["@function.builtin"] = { fg = palette.cyan },
    ["@function.macro"] = { fg = palette.cyan },
    ["@function.method"] = { fg = palette.cyan },
    ["@function.method.call"] = { fg = palette.cyan },
    ["@keyword"] = vim.tbl_extend(
      "force",
      { fg = palette.gray_blue },
      opts.styles.keywords
    ),
    ["@keyword.conditional"] = { fg = palette.gray_blue },
    ["@keyword.coroutine"] = { fg = palette.gray_blue },
    ["@keyword.exception"] = { fg = palette.red },
    ["@keyword.function"] = vim.tbl_extend(
      "force",
      { fg = palette.gray_blue },
      opts.styles.keywords
    ),
    ["@keyword.import"] = { fg = palette.red },
    ["@keyword.operator"] = { fg = palette.gray_blue },
    ["@keyword.repeat"] = { fg = palette.gray_blue },
    ["@label"] = { fg = palette.fg },
    ["@lsp.type.comment"] = {},
    ["@markup"] = { fg = palette.fg },
    ["@markup.italic"] = { italic = true },
    ["@markup.link"] = { fg = palette.medium_gray_blue },
    ["@markup.list"] = { fg = palette.fg },
    ["@markup.list.unchecked"] = { fg = palette.fg },
    ["@markup.literal"] = { fg = palette.medium_gray },
    ["@markup.strong"] = { fg = palette.medium_gray },
    ["@markup.title"] = { fg = palette.medium_gray },
    ["@markup.underline"] = { underline = true },
    ["@module"] = { fg = palette.fg },
    ["@number"] = { fg = palette.red },
    ["@number.float"] = { fg = palette.red },
    ["@operator"] = { fg = palette.fg },
    ["@property"] = { fg = palette.fg },
    ["@punctuation.bracket"] = { fg = palette.fg },
    ["@punctuation.delimiter"] = { fg = palette.fg },
    ["@string"] = { fg = palette.medium_gray_blue },
    ["@string.escape"] = { fg = palette.medium_gray_blue },
    ["@string.regexp"] = { fg = palette.medium_gray_blue },
    ["@string.special.path"] = { fg = palette.light_gray },
    ["@string.special.symbol"] = { fg = palette.medium_gray },
    ["@tag"] = { fg = palette.blue },
    ["@tag.attribute"] = { fg = palette.fg },
    ["@tag.delimiter"] = { fg = palette.fg },
    ["@text.uri"] = { fg = palette.light_gray },
    ["@type"] = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.type),
    ["@type.builtin"] = { fg = palette.fg },
    ["@variable"] = vim.tbl_extend("force", { fg = palette.fg }, opts.styles.variables),
    ["@variable.builtin"] = { fg = palette.fg },
    ["@variable.field"] = { fg = palette.fg },
    ["@variable.parameter"] = { fg = palette.fg },
    ["@variable.parameter.reference"] = { fg = palette.fg },
  }
end

return M
