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.16.0",
                date = "06/08/2026",
                sections = {
                    { label = "Added", body = [[Picking a sound in settings now plays it right away, so you can hear each one before you choose.]] },
                    { label = "Changed", body = [[The sound list is cleaner with no duplicate entries, a couple of sounds were renamed, and the alert sounds are louder. Resetting a profile now asks you to confirm first, on both the Profiles tab and the Crit Records tab.]] },
                },
            },
            {
                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.]] },
                },
            },
        },
    }
end

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