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.9.1",
                date = "06/01/2026",
                sections = {
                    { label = "Changed", body = [[The text added in the last update is now translated into every supported language, so pet attack records, the record profiles, the info-bar hit and crit display, and the new-record threshold slider all show up in your language.]] },
                },
            },
            {
                version = "6.9.0",
                date = "06/01/2026",
                sections = {
                    { label = "Added", body = [[Each of your pets now keeps its own attack record. Hover a pet's Attack button to see that pet's best hit and crit. Records also now live in their own profile, separate from your settings, so you can use one settings profile on all your characters while each one keeps its own records. Pick a Record Profile in the options.]] },
                    { label = "Changed", body = [[The info-bar plugin and minimap tooltip now show your top hit next to your top crit, colored to match your alert colors, and the tooltip shows which spell set each record. There is a new Record Announce Threshold slider in the General options: leave it at 0 to hear about every new record, or raise it so only bigger jumps announce, handy for quieting tiny auto-attack records. New-record messages no longer show the "+1" amount.]] },
                },
            },
            {
                version = "6.8.1",
                date = "05/31/2026",
                sections = {
                    { label = "Changed", body = [[CritMatic's newest options and the minimap button tooltips are now translated into all supported languages.]] },
                },
            },
        },
    }
end

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