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.24.0",
                date = "06/15/2026",
                sections = {
                    { label = "Added", body = [[The Crit Log has a new Group Order option. When you group your records into Damage and Healing sections, you can now choose which section appears on top.]] },
                    { label = "Fixed", body = [[The Level Up font now shows up and displays correctly in the font lists.]] },
                },
            },
            {
                version = "6.23.1",
                date = "06/15/2026",
                sections = {
                    { label = "Changed", body = [[The Olie and Fo Shizzle alert sounds have been updated. If you use one of them, you will hear the refreshed version.]] },
                },
            },
            {
                version = "6.23.0",
                date = "06/15/2026",
                sections = {
                    { label = "Changed", body = [[The Tooltip tab has been removed from the options for now while it gets reworked. Your Crit Log and Broker appearance options are unchanged, and any settings you already saved are kept.]] },
                },
            },
        },
    }
end

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