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.15.1",
                date = "06/08/2026",
                sections = {
                    { label = "Added", body = [[Each Infinite Loop Alchemist addon now shows a short description in the More Infinite Loop Alchemist Addons section of the settings, so you can see what each one does at a glance.]] },
                },
            },
            {
                version = "6.15.0",
                date = "06/07/2026",
                sections = {
                    { label = "Added", body = [[New Shadow Strength slider on the Alert Font settings makes crit alerts easier to read. Turn it down for a lighter shadow or to 0 for none.]] },
                    { label = "Fixed", body = [[Crit alerts no longer get hidden behind the game's level-up and cinematic screens. They now show right after the screen clears.]] },
                },
            },
            {
                version = "6.14.0",
                date = "06/06/2026",
                sections = {
                    { label = "Added", body = [[15 new alert sounds to choose from, plus new settings for the record number roll-up: Animation Length, Stay After Animation, and Start Delay.]] },
                    { label = "Changed", body = [[When an alert shows your previous best, it now appears on its own line below your new record.]] },
                },
            },
        },
    }
end

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