--[[
============================================================
Decor Vendor Addon
© 2026 MidniteDestiny. All Rights Reserved.
============================================================

This file is part of the Decor Vendor addon.

All code, structure, and design are the intellectual
property of MidniteDestiny unless otherwise stated.

You may NOT:
• Copy, reproduce, or redistribute this code
• Modify and redistribute this code
• Use this code in other addons or projects

without explicit permission from the author.

This addon is distributed for personal use only.

============================================================
]]

local addonName, dv = ...

dv.CONSTANTS = dv.CONSTANTS or {}
local C = dv.CONSTANTS

C.VERSION_TEXT = "Current Working Version %s"
C.VERSION = "1.94"

dv.filters = dv.filters or {}

dv.filters.vendors = dv.filters.vendors or {
    expansions = {},
    factions = {},
    recipes = {}, 
	categories = {},
}

dv.filters.quests = dv.filters.quests or {
    expansions = {},
	categories = {},
    factions = {},
}

dv.filters.bossdrops = dv.filters.bossdrops or {
    expansions = {},
	categories = {},
}

dv.filters.professions = dv.filters.professions or {
    professions = {},
	expansions = {},
}

dv.filters.achievements = dv.filters.achievements or {
    groups = {},
    factions = {},
}

dv.EXPANSION_ORDER = {
    "Classic",
    "The Burning Crusade",
    "Wrath of the Lich King",
    "Cataclysm",
    "Mists of Pandaria",
    "Warlords of Draenor",
    "Legion",
    "Battle for Azeroth",
    "Shadowlands",
    "Dragonflight",
    "The War Within",
	"Midnight",
	"Midnight Delves",
	"Recipe Only Vendors",
}

dv.rareEvents = {

    ["Daily Darkshore Rares"] = {
        { name = "Granokk", x = 48.2, y = 55.6 },
        { name = "Stonebinder Ssra'vess", x = 45.4, y = 58.8 },
        { name = "Shattershard", x = 43.4, y = 29.2 },
        { name = "Scalefiend", x = 47.4, y = 44.6 },
        { name = "Aman", x = 37.4, y = 84.2 },
        { name = "Mrggr'marr", x = 35.4, y = 81.4 },
        { name = "Glimmerspine", x = 43.4, y = 19.8 },
        { name = "Madfeather", x = 44.0, y = 48.4 },
    },
    ["Isle of Quel’Danas Delves"] = {
        { name = "Parhelion Plaza", x = 46.8, y = 40.9 },
    },

    ["Eversong Woods Delves"] = {
        { name = "The Shadow Enclave", x = 45.5, y = 86.0 },
        { name = "Atal'Aman", x = 63.7, y = 80.1 },
    },

    ["Silvermoon City Delves"] = {
        { name = "Collegiate Calamity", x = 40.6, y = 53.7 },
        { name = "The Darkway", x = 39.3, y = 31.7 },
    },

    ["Zul'aman Delves"] = {
        { name = "Twilight Crypts", x = 25.4, y = 84.4 },
    },

    ["Harandar Delves"] = {
        { name = "The Gulf of Memory", x = 36.7, y = 49.6 },
        { name = "The Grudge Pit", x = 70.4, y = 64.8 },
    },

    ["Voidstorm Delves"] = {
        { name = "Shadowguard Point", x = 37.1, y = 49.1 },
        { name = "Sunkiller Sanctum", x = 54.8, y = 47.1 },
    },
	
	["Withered Army Training"] = {
	{name = "Glimmering Treasure Chest", x = 22.8, y = 36.2},
	},

	["Cooking Daily"] = {
	{name = "Katherine Lee", x = 40,3, y = 66.1},
	{name = "Awilo Lon'gomba", x = 70.0, y = 38.9},	
	},	
	
	["Frederick the Fabulous"] = {
	{name = "Frederick the Fabulous", x = 55.7, y = 15.7},
	},
}

dv.Profession_Order = {
    "Alchemy", 
    "Blacksmithing",
    "Cooking", 
    "Enchanting",
    "Engineering", 
    "Inscriptions", 
    "Jewelcrafting", 
    "Junkyard Tinkering",
    "Leatherworking", 
    "Tailoring", 
}

--------------------------------------------------
-- Colors
--------------------------------------------------
C.COLORS = {}

C.COLORS.ALLIANCE = {0.3, 0.6, 1}
C.COLORS.HORDE = {1, 0.2, 0.2}
C.COLORS.NEUTRAL = {0.2, 0.8, 0.3}
C.COLORS.GOLD = {1, 0.82, 0}	
C.COLORS.GOLD_DIM = { 0.8, 0.66, 0, 1 }
C.COLORS.TITLE = { 0.9, 0.85, 0.5, 1 }
C.COLORS.SIDEBAR_BG = { 0.05, 0.05, 0.08, 0.9 }
C.COLORS.CONTENT_BG = { 0, 0, 0, 0.8 }
C.COLORS.TAB_NORMAL = { 0.1, 0.1, 0.12, 0.8 }
C.COLORS.TAB_HOVER = { 0.15, 0.15, 0.17, 0.9 }
C.COLORS.TAB_SELECTED = { 0.12, 0.12, 0.14, 1 }
C.COLORS.TAB_TEXT_INACTIVE = { 0.56, 0.56, 0.56, 1 }
C.COLORS.TAB_ICON_ALPHA_INACTIVE = 0.75
C.COLORS.TEXT_PRIMARY = { 1, 1, 1, 1 }
C.COLORS.TEXT_SECONDARY = { 0.9, 0.9, 0.9, 1 }
C.COLORS.TEXT_TERTIARY = { 0.7, 0.7, 0.7, 1 }
C.COLORS.TEXT_DISABLED = { 0.5, 0.5, 0.5, 1 }
C.COLORS.BORDER = { 0.3, 0.3, 0.3, 1 }
C.COLORS.PROGRESS_COMPLETE = { 0.2, 1, 0.2, 1 }   
C.COLORS.PROGRESS_NEAR_COMPLETE = { 0.6, 0.9, 0.1, 1 }
C.COLORS.PROGRESS_MID = { 0.75, 0.65, 0.35, 1 }   
C.COLORS.PROGRESS_LOW_DIM = { 0.6, 0.6, 0.6, 1 } 
C.COLORS.PANEL_NORMAL = { 0.14, 0.14, 0.16, 0.9 }
C.COLORS.PANEL_HOVER = { 0.19, 0.19, 0.21, 1 }
C.COLORS.PANEL_NORMAL_ALT = { 0.12, 0.12, 0.14, 0.95 }  
C.COLORS.PANEL_HOVER_ALT = { 0.16, 0.16, 0.18, 1 }
C.COLORS.ROW_BG = { 0.08, 0.08, 0.10, 0.9 }
C.COLORS.ROW_BG_SOLID = { 0.08, 0.08, 0.10, 1 }
C.COLORS.SOURCE_NAME_GOLD = { 0.92, 0.76, 0, 1 }
C.COLORS.ROW_SELECTED = { 0.20, 0.20, 0.22, 1 }
--C.COLORS.HEADER_GRADIENT_TOP = CreateColor(0.15, 0.10, 0.25, 0.85)
--C.COLORS.HEADER_GRADIENT_BOTTOM = CreateColor(0.05, 0.05, 0.15, 0.85)
--------------------------------------------------
-- Spacing
--------------------------------------------------
C.SPACING_SMALL = 4
C.SPACING_NORMAL = 8
C.SPACING_LARGE = 16
--------------------------------------------------
-- Camera
--------------------------------------------------
C.CAMERA = {
TRANSITION_IMMEDIATE = CAMERA_TRANSITION_TYPE_IMMEDIATE or 1,
MODIFICATION_DISCARD = CAMERA_MODIFICATION_TYPE_DISCARD or 1,
MODIFICATION_MAINTAIN = CAMERA_MODIFICATION_TYPE_MAINTAIN or 1,
ORBIT_MOUSE_NOTHING = ORBIT_CAMERA_MOUSE_MODE_NOTHING or 0,
ORBIT_MOUSE_YAW = ORBIT_CAMERA_MOUSE_MODE_YAW_ROTATION or 1,
ORBIT_MOUSE_PITCH = ORBIT_CAMERA_MOUSE_MODE_PITCH_ROTATION or 2,
ORBIT_MOUSE_ZOOM = ORBIT_CAMERA_MOUSE_MODE_ZOOM or 6,
ORBIT_MOUSE_PAN_HORIZONTAL = ORBIT_CAMERA_MOUSE_PAN_HORIZONTAL or 7,
ORBIT_MOUSE_PAN_VERTICAL = ORBIT_CAMERA_MOUSE_PAN_VERTICAL or 8,
PREVIEW_MIN_ZOOM_SCALE = 0.5, 
ROTATION_SPEED = 0.5, 
ZOOM_STEP = 0.02, 
}  

    -- Housing sizes (Enum.HousingCatalogEntrySize values → localization keys)
    -- Use these instead of magic numbers for patch-proof code
C.SCENE_PRESETS = {
        [0]  = Enum.HousingCatalogEntryModelScenePresets.DecorDefault,
        [65] = Enum.HousingCatalogEntryModelScenePresets.DecorTiny,
        [66] = Enum.HousingCatalogEntryModelScenePresets.DecorSmall,
        [67] = Enum.HousingCatalogEntryModelScenePresets.DecorMedium,
        [68] = Enum.HousingCatalogEntryModelScenePresets.DecorLarge,
        [69] = Enum.HousingCatalogEntryModelScenePresets.DecorHuge,
}
C.DEFAULT_SCENE_ID = Enum.HousingCatalogEntryModelScenePresets.DecorDefault
C.MODEL_SCENE_ID = 1317  
--------------------------------------------------
-- Random
--------------------------------------------------
C.MODELCONTAINER_HEIGHT = 300
C.DIVIDER_HEIGHT = 2
C.TITLESEPERATOR_HEIGHT = 2
C.MODEL_ROTATION_SENSITIVITY = 0.01
C.MODEL_ZOOM_SCALE = 1.2
C.MODEL_ZOOM_MIN = 0.5
C.MODEL_ZOOM_MAX = 3.0
C.MODEL_ZOOM_STEP = 0.1
C.MODEL_VERTICAL_OFFSET = -0.1
C.RECIPEFRAME_WIDTH = 300
C.RECIPEFRAME_HEIGHT = 40
C.RECIPEICON_WIDTH = 40
C.RECIPEICON_HEIGHT = 40
C.RECIPETEXT_WIDTH = 200
C.CHECKTOGGLE_WIDTH = 28
C.CHECKTOGGLE_HEIGHT = 28
C.PREVBTN_WIDTH = 32
C.PREVBTN_HEIGHT = 32
C.NEXTBTN_WIDTH = 32
C.NEXTBTN_HEIGHT = 32
C.SIDEBAR_WIDTH = 220
C.PREVIEW_WIDTH = 420
C.SEARCHBOX_WIDTH = 200
C.SEARCHBOX_HEIGHT = 24
C.RESETCACHE_WIDTH = 170
C.RESETCACHE_HEIGHT = 22
C.RESETBTN_WIDTH = 120
C.RESETBTN_HEIGHT = 22
C.INFOSIZE_WIDTH = 24
C.INFOSIZE_HEIGHT = 24
C.CLOSE_WIDTH = 28
C.CLOSE_HEIGHT = 28
C.SCROLLCHILD_WIDTH = 400
C.MODELCONTAINER_HEIGHT = 380
C.DIVIDER_HEIGHT = 2
C.TITLESEPERATOR_HEIGHT = 2
C.DEFAULT_FRAME_WIDTH = 1200
C.DEFAULT_FRAME_HEIGHT = 800
C.MIN_FRAME_WIDTH = 400
C.MIN_FRAME_HEIGHT = 400
C.PREVIEW_DEFAULT_WIDTH = 500
C.HEADER_HEIGHT = 32
C.TITLEBG_HEIGHT = 50
C.VENDOR_HEADER_HEIGHT = 24
C.LINE_HEIGHT = 20
--C.SEARCHBOX_HEIGHT = 24
--C.RESETCACHE_WIDTH = 170
--C.RESETCACHE_HEIGHT = 22
--C.RESETBTN_WIDTH = 120
--C.RESETBTN_HEIGHT = 22
--C.INFOSIZE_WIDTH = 24
--C.INFOSIZE_HEIGHT = 24
--C.CLOSE_WIDTH = 28
--C.CLOSE_HEIGHT = 28
--C.SIDEBAR_WIDTH = 180
--C.PREVIEW_WIDTH = 420
--C.SCROLLCHILD_WIDTH = 520
--C.FRAME_WIDTH = 1200
--C.FRAME_HEIGHT = 800
--C.SIDEBAR_WIDTH = 167