local lib = LibStub("LibMatic-ChangeLog-1.0", true)

local function buildSpec()
    return {
        title = "CritMatic - Change Log",
        statusText = "For the full changelog, visit CurseForge.",
        version = tostring(Critmatic.newVersion or ""),
        style = (Critmatic.db and Critmatic.db.profile and Critmatic.db.profile.changeLogPopUp) or nil,
        entries = {
            {
                version = "6.13.0",
                date = "06/04/2026",
                sections = {
                    { label = "Fixed", body = [[Opening CritMatic's options is now more reliable on Mists of Pandaria Classic.]] },
                },
            },
            {
                version = "6.12.0",
                date = "06/03/2026",
                sections = {
                    { label = "Added", body = [[When a record alert shows your previous best, that previous number now counts up too, right alongside your new record.]] },
                    { label = "Fixed", body = [[Record alert numbers no longer wobble side to side while they count up, including when a previous best is shown. The Settings option in the Crit Log right-click menu now opens CritMatic's options page.]] },
                },
            },
            {
                version = "6.11.0",
                date = "06/02/2026",
                sections = {
                    { label = "Added", body = [[Your on-screen record alerts now count up. When you set a new record, the number rolls from zero up to your new best over a few seconds, then holds before fading. Prefer the old instant number? Turn off "Animate Alert Numbers" in the General options.]] },
                    { label = "Changed", body = [[Added a Discord icon to the General options so the support link is easier to spot, and updated CritMatic for Mists of Pandaria 5.5.4.]] },
                },
            },
        },
    }
end

Critmatic.showChangeLog = function()
    if not lib then return end
    lib:Show(buildSpec())
end
