local _, ns = ...

local function getSpellNameByID(spellID)
    if C_Spell and C_Spell.GetSpellName then
        return C_Spell.GetSpellName(spellID)
    end
    if GetSpellInfo then
        return GetSpellInfo(spellID)
    end
end

ns.constants = {
    APP_COLOR = "|cff3cc8ff",
    GOLD_COLOR = "|cffefc96a",
    GREEN_COLOR = "|cff3be38d",
    RED_COLOR = "|cffef6a6a",
    FISHING_IDS = {
        [131474] = true,
        [131490] = true,
        [131476] = true,
        [7620] = true,
        [7731] = true,
        [7732] = true,
        [18248] = true,
        [33095] = true,
        [51294] = true,
        [88868] = true,
        [110410] = true,
        [158743] = true,
        [377895] = true,
    },
}

ns.constants.FISHING_SPELL_NAME = getSpellNameByID(7620) or getSpellNameByID(131474) or "Fishing"
ns.constants.FISHING_PRIMARY_ID = 131474

ns.defaults = {
    profile = {
        minimap = {
            hide = false,
            angle = 225,
            radius = 90,
            dragUnlocked = false,
            showStatsTooltip = true,
            pulseWhileSessionActive = true,
            wheelRotate = true,
            iconTexture = "Interface\\AddOns\\ForgeFishing\\Media\\ForgeFishingLogo.tga",
        },
        atlas = {
            rememberLastKnownZone = true,
            lastKnownZoneID = "",
        },
        nearby = {
            enabled = true,
            showOnMinimap = true,
            autoPing = true,
            pingInterval = 12,
            peerTimeout = 45,
            maxMarkers = 8,
            mapRangeNormalized = 0.04,
        },
        ui = {
            scale = 1,
            locked = false,
            compactMode = false,
            showMainOnLogin = true,
            showMinimapButton = true,
            point = { "CENTER", "UIParent", "CENTER", 0, 0 },
            compactPoint = { "CENTER", "UIParent", "CENTER", 430, 140 },
        },
        alerts = {
            soundOnBite = true,
            highlightBobber = true,
            flashOnRare = true,
            enhanceSounds = true,
            enhanceSoundsScale = 1,
            lureReminder = true,
            lureReminderOnZoneChange = true,
            autoAttachLure = false,
            autoReapplyBobber = false,
            patientChestAlert = false,
            milestoneAlerts = true,
            preferredLureItemID = 6530,
        },
        debug = {
            captureLuaErrors = true,
            maxEntries = 120,
        },
        gear = {
            preferredSet = "",
            returnSet = "",
            autoRestoreOnStop = false,
        },
        interaction = {
            doubleClickEnabled = true,
            doubleClickSpeed = 0.40,
            recastOnDoubleClick = true,
            recastKeyEnabled = false,
            dismountWithKey = false,
            raftEnabled = false,
                raftToyName = "Anglers Fishing Raft",
            sleepWhenNoTool = false,
            overrideLunker = false,
            objectIconDisabled = false,
            sleepingMode = false,
        },
        tracking = {
            autoStartSession = true,
            trackOpenWater = true,
            trackPools = true,
            trackSkill = true,
        },
    },
    currentSession = {
        active = false,
        startTime = 0,
        zone = "",
        casts = 0,
        catches = 0,
        lastCatch = "None",
        fishingSkill = 0,
        items = {},
        recentCatches = {},
        recentRares = {},
        rareCatches = 0,
        poolCatches = 0,
        openWaterCatches = 0,
    },
    stats = {
        totalCasts = 0,
        totalCatches = 0,
        sessionsCompleted = 0,
        totalFishLoots = 0,
    },
    history = {
        sessions = {},
    },
    debug = {
        logs = {},
        lastError = "",
    },
    v2 = {
        zoneStats = {},
        itemStats = {},
        rareItems = {},
        recentRares = {},
    },
}
