-- MarketWatch Dictionaries.lua
-- Keyword lists per category. All lowercase, matched against the normalized message.
-- Order in MW.categoryOrder matters: first dictionary match wins (see Detection.lua)

MW = MW or {}

MW.categoryOrder = {
	"Herbs",
	-- Checked before MiningBS: a message can legitimately mention both SFS
	-- and Primordial Saronite/"primo" together (raid loot posts often sell
	-- several currencies at once) - SFS gets priority since it's the more
	-- specific, higher-demand good.
	"SFS",
	"MiningBS",
	"Enchanting",
	"Tailoring",
	"Jewelcrafting",
	"Inscription",
	"FlasksPotions",
	"BoE",
	"Mounts",
	-- Valuable oddball items that aren't a crafting mat, BoE gear, or a
	-- mount/pet - achievement/title/rep-farming goods and anything else
	-- that doesn't fit an existing tab lands here instead of Uncategorized.
	"Misc",
}

MW.categoryLabels = {
	Herbs = "Herbs",
	MiningBS = "Mining/Blacksmithing/Leather Mats",
	Enchanting = "Enchanting Mats",
	Tailoring = "Tailoring Mats",
	Jewelcrafting = "Jewelcrafting",
	Inscription = "Inscription/Glyphs",
	FlasksPotions = "Flasks/Potions",
	SFS = "Shadowfrost Shards",
	BoE = "BoE's",
	Mounts = "Mounts",
	Misc = "Misc",
	Uncategorized = "Uncategorized",
	CharacterTrade = "Char Trade",
	Transmog = "Transmog",
	Boost = "Boost",
}

MW.dictionaries = {

	Herbs = {
		-- herbs
		"frost lotus", "lichbloom", "icethorn", "talandra's rose", "talandras rose",
		"adder's tongue", "adders tongue", "tiger lily", "goldclover", "fire leaf", "deadnettle",
		-- raw food mats + prepared raid food (folded in here rather than a dedicated category)
		"glacial salmon", "nettlefish", "dragonfin angelfish", "fish oil", "worm meat",
		"fish feast", "dragonfin filet", "hearty rhino", "blackened dragonfin",
		"firecracker salmon", "imperial manta steak", "tender shoveltusk steak", "spiced worm burger",
	},

	MiningBS = {
		"saronite ore", "saronite bar", "titanium ore", "titanium bar", "titansteel bar",
		"frozen orb", "frozen orbs", "runed orb", "runed orbs",
		"eternal fire", "eternal earth", "eternal shadow", "eternal life", "eternal air", "eternal water",
		"crystallized fire", "crystallized air", "crystallized water", "crystallized earth",
		"crystallized shadow", "crystallized life",
		"crusader orb", "primordial saronite",
		-- "primo"/"primos" - Warmane trade-chat shorthand for Primordial Saronite
		"primo", "primos",
		"cobalt ore", "cobalt bar",
		-- Leatherworking mats (no dedicated category for one profession's worth
		-- of keywords, folded in here alongside the other raw gathering mats)
		"arctic fur", "icy dragonscale", "borean leather", "heavy borean leather",
		"nerubian chitin", "jormungar scale",
		-- BC-era Elemental Plane mats - still occasionally traded/crafted with
		-- (e.g. Primal Life for the Primal Mooncloth tailoring recipe)
		"primal life", "primal fire", "primal water", "primal earth", "primal air",
		"primal shadow", "primal mana", "primal nether", "primal might", "primal divinity",
		"mote of life", "mote of fire", "mote of water", "mote of earth", "mote of air",
		"mote of shadow", "mote of mana",
		-- profession name itself (e.g. "WTS [Blacksmithing]" meaning "ask me for anything")
		"blacksmithing",
	},

	Enchanting = {
		"infinite dust", "dream dust", "greater cosmic essence", "lesser cosmic essence",
		"abyss crystal", "dream shard", "cosmic shard",
		"enchant weapon", "enchant chest", "enchant cloak", "enchant boots",
		"enchant gloves", "enchant bracer", "enchant shield", "vellum",
		-- profession name itself
		"enchanting",
		-- bulk-buying green/blue gear is almost always for disenchanting into mats.
		-- "green/blue" never matched anything - NormalizeMsg turns "/" into a
		-- space, so the raw text can never contain a literal "/" to match against.
		-- "greens"/"blues" (bare plural, no "items") cover the equally common
		-- "WTB Greens & Blues lvl 74+" phrasing - normalizes to "greens blues"
		-- once "&" is stripped, matching neither "green items" nor "green/blue".
		"green items", "blue items", "green/blue", "green blue", "greens", "blues",
	},

	Tailoring = {
		"frostweave cloth", "frostweave bolt", "bolt of frostweave",
		"spellweave", "moonshroud", "ebonweave", "imbued frostweave",
		-- crafted bags (very commonly traded, distinct from raw cloth mats)
		"frostweave bag", "imbued frostweave bag", "spellweave bag",
		-- profession name itself
		"tailoring",
	},

	Jewelcrafting = {
		"cardinal ruby", "ametrine", "eye of zul",
		"dreadstone", "chalcedony", "bloodstone", "huge citrine", "monarch topaz",
		"autumn's glow", "autumns glow", "king's amber", "kings amber",
		"majestic zircon", "sky sapphire", "forest emerald", "shadow crystal",
		-- raw green-quality gems from prospecting Cobalt/Saronite/Titanium ore
		-- (confirmed via Wowhead - the epic/rare-quality gems above were
		-- already covered, these two weren't)
		"sun crystal", "dark jade",
		"scarlet ruby",
		"dragon's eye", "dragons eye", "uncut",
		-- profession name itself
		"jewelcrafting",
	},

	Inscription = {
		"glyph", "glyphs", "minor glyph", "major glyph", "prime glyph",
		-- Darkmoon Card decks - the 4 scribe-crafted card sets that combine
		-- into WotLK's 4 Darkmoon trinkets (Death/Greatness/Illusion/
		-- Berserker!). Genuinely valuable (~1500-1900g each on this server's
		-- own AH data) and a real, distinct traded good, not just filler.
		"chaos deck", "storms deck", "furies deck", "blessings deck",
		-- profession name itself
		"inscription", "milling",
	},

	-- Shadowfrost Shards - ICC25 quest currency for the Shadowmourne legendary
	-- chain, actively traded on Warmane since a lot of players are working
	-- toward it. Own category rather than folded into MiningBS since it's a
	-- specific, high-demand, high-value good in its own right.
	SFS = {
		"shadowfrost shard", "shadowfrost shards", "sfs",
	},

	FlasksPotions = {
		"flask of the frost wyrm", "flask of endless rage", "flask of pure mojo",
		"flask of stoneblood", "flask of blinding light", "flask of relentless assault",
		"flask of the north",
		"indestructible potion", "potion of speed", "potion of wild magic", "wild magic potion",
		"potion of accuracy", "potion of pure energy", "potion of nightmares",
		"runic healing potion", "runic mana potion", "flask of",
	},

	BoE = {
		-- ICC trash zone-drop
		"stiffened corpse shoulderpads", "wodin's lucky necklace", "wodins lucky necklace",
		"harbinger's bone band", "harbingers bone band", "ring of rotting sinew",
		"rowan's rifle of silver bullets", "rowans rifle of silver bullets",
		"leggings of dubious charms", "belt of the lonely noble",
		-- ICC per-boss BoE (normal difficulty)
		"marrowgar's frigid eye", "marrowgars frigid eye",
		"the lady's brittle bracers", "lady's brittle bracers", "ladys brittle bracers",
		"skeleton lord's circle", "skeleton lords circle",
		"might of blight",
		"rotface's rupturing ring", "rotfaces rupturing ring",
		"professor's bloodied smock", "professors bloodied smock",
		"crypt keeper's bracers", "crypt keepers bracers",
		"seal of the twilight queen",
		"blood queen's crimson choker", "blood queens crimson choker",
		"lich wrappings", "nightmare ender", "deathfrost boots",
		"leggings of woven death", "lightweave leggings", "sandals of consecration",
		-- Trial of the Crusader
		"cloak of displacement", "shroud of displacement",
		-- Ulduar
		"leggings of the stoneweaver",
		"phaelia's vestments of the sprouting seed", "phaelias vestments of the sprouting seed",
		"belt of the titans", "indestructible plate girdle", "plate girdle of righteousness",
		"battlelord's plate boots", "spiked deathdealers", "treads of destiny",
		"bladebearer's signet", "signet of the earthshaker", "the leviathan's coil",
		-- NormalizeMsg turns every "-" into a space, so the space-variant twin
		-- is required or this can never match real (normalized) chat text
		"star-beaded clutch", "star beaded clutch",
		-- Naxxramas / older raid BoEs
		"the turning tide", "hailstorm", "torch of holy fire", "betrayer's choker",
		"wand of the nerubian", "signet of edward the odd", "cloak of the shadowed sun",
		-- Crafted BoE - Tailoring
		"deathchill cloak", "sundial of the exiled", "merlin's robe", "merlins robe",
		"royal moonshroud robe", "bejeweled wizard's bracers", "bejeweled wizards bracers",
		-- Crafted BoE - Leatherworking
		"earthsoul boots", "rock-steady treads", "rock steady treads",
		"lightning-infused leggings", "lightning infused leggings",
		"ensorcelled nerubian breastplate", "black chitin bracers",
		"crusader's dragonscale breastplate", "crusaders dragonscale breastplate",
		-- Crafted BoE - Blacksmithing
		"pillars of might", "boots of kingly upheaval", "hellfrozen bonegrinders",
		"draconic bonesplinter legguards", "titanium spikeguards", "titanium razorplate",
		"saronite swordbreakers", "breastplate of the white knight",
		"sunforged breastplate", "sunforged bracers",
		-- Rare world-drop BoEs
		"blade of wizardry", "teebu's blazing longsword", "teebus blazing longsword",
		"edgemaster's handguards", "edgemasters handguards",
		"hand of edward the odd", "alcor's sunrazor", "alcors sunrazor",
		"cloudkeeper legplates", "krol blade", "flurry axe", "staff of jordan",
		"freezing band", "blade of hanna", "shadowfang", "pendulum of doom",
		"skullflame shield", "assassin's blade", "assassins blade", "assassination blade",
		"nightblade", "doom's edge", "dooms edge", "destiny", "dazzling longsword",
		"fiery war axe", "witching stave", "the green tower", "glowing brightwood staff",
		"ardent custodian", "axe of the deep woods", "gloom reaper", "wraith scythe",
		"treant's bane", "treants bane", "taran icebreaker", "jadefire",
		"stockade pauldrons", "underworld band", "gloves of holy might",
		"mass of mcgowan", "the lobotomizer", "skullance",
		-- TBC world-drop BoEs
		"staff of disintegration", "sunflare", "ethereum nexus-reaver", "ethereum nexus reaver",
		"vim's scalecrusher", "vims scalecrusher", "crystalblade of the draenei",
		"arcanite steam-pistol", "arcanite steam pistol", "world's end bracers", "worlds end bracers",
		"boots of the long road", "girdle of the deathdealer", "belt of the guardian",
		-- other high-value tradeable collectibles (non-mount)
		"jaina's locket", "jainas locket", "muradin's favor", "muradins favor",
		"sylvanas' music box", "sylvanas music box", "tabard of the lightbringer",
		-- Frozen Halls heroic trash drop (Quel'Delar questline starter) - confirmed BoE
		"battered hilt",
	},

	Mounts = {
		"crimson deathcharger", "reins of the crimson deathcharger", "deathcharger's reins", "deathchargers reins",
		"amani war bear",
		-- NormalizeMsg turns every "-" into a space, so these need the fully
		-- space-separated form too ("x-51" -> "x 51", "x-treme" -> "x treme") -
		-- the hyphenated originals below can never match normalized chat text
		"x-51 nether-rocket x-treme", "x51 nether-rocket x-treme", "x 51 nether rocket x treme",
		"x-51 nether-rocket", "x51 nether-rocket", "x 51 nether rocket",
		"magic rooster", "magic rooster egg",
		"big battle bear", "swift spectral tiger", "spectral tiger", "riding turtle",
		"mekgineer's chopper", "mekgineers chopper", "mechano-hog", "mechano hog",
		-- famous rare-drop mounts, genuinely missing before despite being
		-- some of the most bragged-about/traded mounts on private servers
		"raven lord", "reins of the raven lord",
		"ashes of alar",
		"zulian tiger", "swift zulian tiger",
		-- rare BoE pets (no dedicated pets tab, filed here alongside mounts)
		"dark whelpling", "azure whelpling", "crimson whelpling", "emerald whelpling",
		"hyacinth macaw", "darkmoon cub", "darkmoon monkey", "darkmoon turtle", "darkmoon rabbit",
		"lil' smoky", "lil smoky", "pet bombling", "mechanical chicken", "lifelike mechanical toad",
		"elwynn lamb",
	},

	-- Valuable non-gear, non-mount items - achievement/title/rep-farming
	-- goods and similar oddball collectibles that don't fit any tab above.
	Misc = {
		-- farmed for Bloodsail Buccaneers rep toward Insane in the Membrane /
		-- the Insane title - genuinely valuable, actively traded
		"heavy junkbox", "heavy junkboxes",
	},
}

-- Transmog: trigger words rather than item names (any item can be sold "for mog")
MW.transmogTriggers = {
	-- NOTE: NormalizeMsg converts hyphens to spaces, so "x-mog"/"t-mog" would
	-- NEVER match anything (the normalized text only ever contains "x mog"/
	-- "t mog") - these are the corrected space-form equivalents.
	"xmog", "x mog", "tmog", "t mog", "transmog", "mog set", "for mog", "mog look", "mogging",
}

-- Boost / carry service ads (very high volume on Icecrown trade chat)
-- NOTE: bare "run"/"runs" deliberately excluded - too generic, collides
-- with ordinary raid-recruitment phrasing ("fresh run" meaning a newly-
-- reset lockout, not a purchasable carry). The compound phrases below
-- ("full run", "full clear", "pilot run", "loot run", "farm run") stay,
-- since those are unambiguous - nobody says "full run" to mean "we just
-- reset the raid."
MW.boostTriggers = {
	"boost", "boosts", "boosting", "boosted", "carry", "carries", "carrying",
	"full run", "full clear", "piloted", "pilot", "piloting", "pilot run",
	-- title/achievement carries advertised by the title name itself, not a "boost" keyword
	"herald of the titans", "argent defender",
	-- common Warmane raid-carry lingo not covered above
	"glory", "hardmode", "hard mode", "spot", "spots",
	"achievement carry", "achiev carry", "mount carry", "loot run", "farm run",
	"algalon", "yogg", "immortal", "tribute to immortality",
	"glory of the ulduar raider", "glory of the icecrown raider",
}

-- Character/Account trading: phrase + heuristics
MW.charTradeTriggers = {
	"warmane trade", "warmane website", "character trade", "char trade", "account trade",
	-- unambiguous full-sentence phrases: these alone (no class/context word needed)
	-- are specific enough to indicate a character/account sale, not an item post
	"account for sale", "selling my account", "selling account",
	"toon for sale", "character for sale", "char for sale", "selling toon", "selling char",
	"selling character",
	-- WTB/WTT side of the same phrasing - previously only the "selling X" forms
	-- were covered, so buying/trading an account had to fall back on the
	-- class-word + context-word heuristic below even when the phrasing was
	-- already unambiguous on its own
	"buying account", "buying character", "buying toon", "buying char",
	"trading account", "trading character", "trading toon", "trading char",
}

-- Standalone strong indicators: unlike the class-word heuristic below, these
-- alone (with wts/wtb/wtt already confirmed by Tier 1) are specific enough
-- to flag a character/account sale even when no class is mentioned at all
-- (e.g. "WTB account 500gs" or "WTS my toon, fully geared").
MW.charTradeStrongWords = {
	"account", "toon", "toons", "character", "char",
}

-- class names/abbreviations commonly used when advertising a character
MW.charTradeClassWords = {
	"warrior", "warr", "war", "paladin", "pala", "pally", "hunter", "hunt", "rogue",
	"priest", "druid", "shaman", "sham", "mage", "warlock", "lock",
	"death knight", "deathknight", "dk",
	-- gender-prefixed shorthand (very common in these posts, e.g. "fwarr", "mpala")
	-- these need to be listed as their own whole words: a bare "warr" substring
	-- inside "fwarr" is deliberately NOT matched by the frontier-bounded check
	-- below, since that's what stops "warr" from false-matching mid-word elsewhere
	"fwarr", "mwarr", "fwar", "mwar", "fpala", "mpala", "fhunt", "mhunt", "frogue", "mrogue",
	"fpriest", "mpriest", "fdruid", "mdruid", "fsham", "msham", "fmage", "mmage",
	"flock", "mlock", "fdk", "mdk",
	-- faction-prefixed shorthand (h=Horde, a=Alliance) - same reasoning as above
	"hwarr", "awarr", "hwar", "awar", "hpala", "apala", "hhunt", "ahunt", "hrogue", "arogue",
	"hpriest", "apriest", "hdruid", "adruid", "hsham", "asham", "hmage", "amage",
	"hlock", "alock", "hdk", "adk",
	-- other common informal class names
	"shamy",
}

-- race names/abbreviations commonly used alongside a class word when advertising a
-- character (e.g. "WTS 80 Human DK ..."). A race word + a class word together is
-- distinctive enough on its own to flag a character sale - see the heuristic below -
-- since item-sale posts essentially never describe the poster's own race+class combo.
MW.charTradeRaceWords = {
	"human", "dwarf", "gnome", "night elf", "nightelf", "orc", "troll", "tauren",
	"undead", "blood elf", "belf", "draenei", "worgen", "goblin",
}

-- context words that, combined with a class word + wts/wtb/wtt, indicate a character/account sale
-- rather than an item post. NOTE: "boost" intentionally excluded here now that Boost is its
-- own category - a class word + "boost" (e.g. "WTS Rogue boost 20g") should route to Boost,
-- not be misread as a character sale.
MW.charTradeContextWords = {
	"account", "toon", "toons", "character", "char", "chars", "twink", "geared", "transfer", "xfer",
	"coins", "eof", "eofs", "toc marks", "bis", "achivs", "achievs", "achievements", "gs",
	"mark", "marks", "alt", "alts", "rating", "glad", "gladiator", "arena", "rbg",
	-- common real-world typo/shorthand variants seen in actual trade chat
	"archiev", "archievs", "ahiev", "ahievs", "title", "tittle",
	-- NOTE: "boe"/"boes" deliberately excluded - too generic, collides with
	-- ordinary "selling BOE loot from a raid" posts that have nothing to do
	-- with a character sale (e.g. an LFM post mentioning a class + BOEs for
	-- sale). The stronger signals above (bis/achievements/gs/etc) already
	-- cover genuine char-trade bragging without this false-positive risk.
}
