-- Method talent loadouts expanded per hero path (expand-hero-paths.py).
-- Keys: Class|Spec|Hero and Class|Spec fallback.
-- Honesty: when hero keys share the same CUk as Class|Spec gold, GetResult
-- marks them as method-proxy (primary gold stand-in). When Method publishes
-- a distinct hero scrape, heroExact becomes true automatically.
-- Patch: Midnight 12.1  -  Gold base 2026-08-12
local M = {}
local LOADOUTS = {
  ["Death Knight|Blood|Deathbringer"] = "CoPAAAAAAAAAAAAAAAAAAAAAAwMzyMzwMmZmhZZmZmmZxYmxMGAAAAwMmZmZmZYGDAYmZmZGAAgxsNwAWC2GmADLAmxMAAMzAYYA",
  ["Death Knight|Blood|San'layn"] = "CoPAAAAAAAAAAAAAAAAAAAAAAwMzyMzMmxMzMMLzMz0MLGjxMGAAAAwMmZmZmZYGDAYmZmZGAAADMwMW0YZBklBsBYGzAAAmZghB",
  ["Death Knight|Blood"] = "CoPAAAAAAAAAAAAAAAAAAAAAAwMzyMzwMmZmhZZmZmmZxYmxMGAAAAwMmZmZmZYGDAYmZmZGAAgxsNwAWC2GmADLAmxMAAMzAYYA",
  ["Death Knight|Frost|Riders of the Apocalypse"] = "CsPAAAAAAAAAAAAAAAAAAAAAAMDYmhZMGDz2MzMzMLzMjmZMGDjxgZmZmZmZmZAAAAAAAAAYMbziZZGGLMsMz20QzYDzMmZGYAYYmBzMMYA",
  ["Death Knight|Frost|Deathbringer"] = "CsPAAAAAAAAAAAAAAAAAAAAAAMDYmhZMGDz2MzMzMLzMjmZMGDjxgZmZmZmZmZAAAAAAAAAYMbziZZGGLMsMz20QzYDzMmZGYAYYmBzMMYA",
  ["Death Knight|Frost"] = "CsPAAAAAAAAAAAAAAAAAAAAAAMDYmhZMGDz2MzMzMLzMjmZMGDjxgZmZmZmZmZAAAAAAAAAYMbziZZGGLMsMz20QzYDzMmZGYAYYmBzMMYA",
  ["Death Knight|Unholy|Riders of the Apocalypse"] = "CwPAAAAAAAAAAAAAAAAAAAAAAAwMjZMDDz2MzMTzmZmZMjBAAAAAAAgZGGDAWmxMz2MzYMDYzsZYIDMbM0YBDYGAGzMjZAmZmxYA",
  ["Death Knight|Unholy|San'layn"] = "CwPAAAAAAAAAAAAAAAAAAAAAAAwMjZMDDz2MzMTzmZmZMjBAAAAAAAgZGzYAwyMMzmZGjZMwAzYRjlFAbTsBgZAMzMzMmBzMYGjPA",
  ["Death Knight|Unholy"] = "CwPAAAAAAAAAAAAAAAAAAAAAAAwMjZMDDz2MzMTzmZmZMjBAAAAAAAgZGGDAWmxMz2MzYMDYzsZYIDMbM0YBDYGAGzMjZAmZmxYA",
  ["Demon Hunter|Devourer|Annihilator"] = "CgcBAAAAAAAAAAAAAAAAAAAAAAA2mxMzMzMzMGmBAAAAAAgxsNYGAAAAAAAAmxMMzMzMzMzMDzsYGjFtswMzMzWbzMzAYGDABMGMmB",
  ["Demon Hunter|Devourer|Void-Scarred"] = "CgcBAAAAAAAAAAAAAAAAAAAAAAA2mZmZmZmZMGmBAAAAAAgxsNYGAAAAAAAAmxMMPwMzMzMzMDzsNzYsJLAIgBYGzMz2Mz0sNzyMzYMDA",
  ["Demon Hunter|Devourer"] = "CgcBAAAAAAAAAAAAAAAAAAAAAAA2mxMzMzMzMGmBAAAAAAgxsNYGAAAAAAAAmxMMzMzMzMzMDzsYGjFtswMzMzWbzMzAYGDABMGMmB",
  ["Demon Hunter|Havoc|Aldrachi Reaver"] = "CEkAAAAAAAAAAAAAAAAAAAAAAYGMzMz2MmZmxMzkxMDAAAAAAY2MmtZYmZ2mZGLzMmhZGmZZmtZwwYbjJZMzYYBAAAAAAAMzAMAAAAM",
  ["Demon Hunter|Havoc|Fel-Scarred"] = "CEkAAAAAAAAAAAAAAAAAAAAAAYmZmZmZ2mxMzMmZmMmZAAAAAAAzmxsNDzMwMWmZegZYmxYWGYZ2MjhZTTjZmxwGAAAAAAAAzMYAAAAYA",
  ["Demon Hunter|Havoc"] = "CEkAAAAAAAAAAAAAAAAAAAAAAYGMzMz2MmZmxMzkxMDAAAAAAY2MmtZYmZ2mZGLzMmhZGmZZmtZwwYbjJZMzYYBAAAAAAAMzAMAAAAM",
  ["Demon Hunter|Vengeance|Annihilator"] = "CUkAAAAAAAAAAAAAAAAAAAAAAAAMjZmZMMzkZmB2MjZwMjZGzMzMzYwMzM2YmtxwAAAAAAAIgZmZ2AAAAwAzMzMzWbzMzAADAAAgB",
  ["Demon Hunter|Vengeance|Aldrachi Reaver"] = "CUkAAAAAAAAAAAAAAAAAAAAAAAAMjZmZMMzkZmB2MjZwMjZGzMzMzYwMzM2YmtxwAAAAwsNDGGLLMhhZmZWAAAAwADgAMzAMAAAAG",
  ["Demon Hunter|Vengeance"] = "CUkAAAAAAAAAAAAAAAAAAAAAAAAMjZmZMMzkZmB2MjZwMjZGzMzMzYwMzM2YmtxwAAAAAAAIgZmZ2AAAAwAzMzMzWbzMzAADAAAgB",
  ["Druid|Balance|Elune's Chosen"] = "CYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWoMbNMmZgxsMzMzMLMgxMLzsYMzswyMLjxMjNMAYstNzgxsNCMBAAAYhZmZGsZMjxAAwMDWGA",
  ["Druid|Balance|Keeper of the Grove"] = "CYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWoMbNjxMDMmlZmZmBYY2mZZsMjZsxyMGzMzYBDAGgltxGmmZWGBAAAYzMzMzgNjhxMAmZAgBA",
  ["Druid|Balance"] = "CYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWoMbNMmZgxsMzMzMLMgxMLzsYMzswyMLjxMjNMAYstNzgxsNCMBAAAYhZmZGsZMjxAAwMDWGA",
  ["Druid|Feral|Druid of the Claw"] = "CcGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjZ2YmZmxMzm5B2GbzYm5BmZAAAAYJY2gxMjaGziZmZmlxMMAAAAAAADAAAgmZZWmZmBEYBMzAsYmhBAAwMbYA",
  ["Druid|Feral|Wildstalker"] = "CcGAAAAAAAAAAAAAAAAAAAAAAAAAAAAgZMzGzMzMzY2MPw2YbGzMmZAAAAYJY2gxMjaGziZmZmlxMMAAAAAAADAAAgAgZbmlmlZ22AzMALmZYAAMzAgB",
  ["Druid|Feral"] = "CcGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjZ2YmZmxMzm5B2GbzYm5BmZAAAAYJY2gxMjaGziZmZmlxMMAAAAAAADAAAgmZZWmZmBEYBMzAsYmhBAAwMbYA",
  ["Druid|Guardian|Elune's Chosen"] = "CgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgZmxsYmZMziZxMmZZZgZzwoJamZWmZmZmlxMMAAAAAgZsZALbzMYMLDgpAAAAbYmHAYxMYALWAYmBwA",
  ["Druid|Guardian|Druid of the Claw"] = "CgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgZmxsYmZMziZxMmZZZgZzwoJamZWmZmZmlxMMAAAAAgZsZALbzMYMLDgpAAAAbYmHAYxMYALWAYmBwA",
  ["Druid|Guardian"] = "CgGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgZmxsYmZMziZxMmZZZgZzwoJamZWmZmZmlxMMAAAAAgZsZALbzMYMLDgpAAAAbYmHAYxMYALWAYmBwA",
  ["Druid|Restoration|Wildstalker"] = "CkGAAAAAAAAAAAAAAAAAAAAAAMMmZbMjZmxsN8AMzswsYbGAAAAAAAAAAsMoZzMmmZMjxsYmZGmhHYGAAAAAAAMAAEAAwsNzWzyML2YmZgZmFQzAAMzAwA",
  ["Druid|Restoration|Keeper of the Grove"] = "CkGAAAAAAAAAAAAAAAAAAAAAAMMmZZMjZmxsN8AMzsYsYbGAAAAAAAAAAsYoZbGmmBwsYmZmZxwDMAAAAAMAAzA22GLYamZZAAACYhZmZGmZ2ANDAmZAADA",
  ["Druid|Restoration"] = "CkGAAAAAAAAAAAAAAAAAAAAAAMMmZbMjZmxsN8AMzswsYbGAAAAAAAAAAsMoZzMmmZMjxsYmZGmhHYGAAAAAAAMAAEAAwsNzWzyML2YmZgZmFQzAAMzAwA",
  ["Evoker|Augmentation|Scalecommander"] = "CEcBAAAAAAAAAAAAAAAAAAAAAMMzMbjZmxyMYmtZMzMmBAAAAAAAAmhHYGYM1YmZGAAAAMzMjxMz2YmBmZzYwCsMGGbDgZQshxMYmBDG",
  ["Evoker|Augmentation|Chronowarden"] = "CEcBAAAAAAAAAAAAAAAAAAAAAMMzMbzMzgZYmZZGzMjZ2AAAAAAAAYmhZGYM1YmZGAAAAMjZMmZWGzMwMMwYGLsADMDDNwCGzMzAAD",
  ["Evoker|Augmentation"] = "CEcBAAAAAAAAAAAAAAAAAAAAAMMzMbjZmxyMYmtZMzMmBAAAAAAAAmhHYGYM1YmZGAAAAMzMjxMz2YmBmZzYwCsMGGbDgZQshxMYmBDG",
  ["Evoker|Devastation|Scalecommander"] = "CsbBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjZAMzwMwMYMTjZmpZmZ2mhZmZmZmZGwMzMGzMLzMDMwYwGsMGN2GAzAwGGYmBDD",
  ["Evoker|Devastation|Flameshaper"] = "CsbBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjZwMjZGzMgBjZamZmJzM2mxMzwYmZGwMmxYmZZmZwMwMmBWALgZYCsBWGGAzMDD",
  ["Evoker|Devastation"] = "CsbBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjZAMzwMwMYMTjZmpZmZ2mhZmZmZmZGwMzMGzMLzMDMwYwGsMGN2GAzAwGGYmBDD",
  ["Evoker|Preservation|Chronowarden"] = "CwbBAAAAAAAAAAAAAAAAAAAAAAAAAAAMzMz2yMYYmxsZGjx2wAAAzYGzYMMTMmBAAAMzMTzYmZmZZMDAAjZsxCMwMaohhFYmZGAGA",
  ["Evoker|Preservation|Flameshaper"] = "CwbBAAAAAAAAAAAAAAAAAAAAAAAAAAAmZmZ2WmZGDjxsMDw2wAAAzYGzYMMTMmBAAAMzMTzYmZmZZMDAMmBWAbgZYCZjxmhZAmZYA",
  ["Evoker|Preservation"] = "CwbBAAAAAAAAAAAAAAAAAAAAAAAAAAAMzMz2yMYYmxsZGjx2wAAAzYGzYMMTMmBAAAMzMTzYmZmZZMDAAjZsxCMwMaohhFYmZGAGA",
  ["Hunter|Beast Mastery|Pack Leader"] = "C0PAAAAAAAAAAAAAAAAAAAAAAAMmxwCsBzwQDbAAYGzMzsYGzMzMjZGMzYmhZGzMzYbmZYMDLDNDAAAAAAAAmHYMzAmZjAmFw2AwA",
  ["Hunter|Beast Mastery|Dark Ranger"] = "C0PAAAAAAAAAAAAAAAAAAAAAAYzsNwAGwMsBZsAAgZGzMziZYGmxMjZmZYGzMjZmZsNzMMmhlhmBAAAAMDAAAzDMmZYmBEwsA2GAA",
  ["Hunter|Beast Mastery"] = "C0PAAAAAAAAAAAAAAAAAAAAAAAMmxwCsBzwQDbAAYGzMzsYGzMzMjZGMzYmhZGzMzYbmZYMDLDNDAAAAAAAAmHYMzAmZjAmFw2AwA",
  ["Hunter|Marksmanship|Dark Ranger"] = "C4PAAAAAAAAAAAAAAAAAAAAAAYzsMwAmgZYLwsAAAAAAAAAmxMzMMjZmxMYMNjBzymZMzMzMzMLMzywMAAAzDMmxMzMgsBDwGzsNjB",
  ["Hunter|Marksmanship|Sentinel"] = "C4PAAAAAAAAAAAAAAAAAAAAAAwCMwMGzYZAMD2AAAAAAAAAzYGzwMmZGzgx0MGMbbmZmZmZmZmFmZZYGAAg5BmZGDgZajhBYjZ2mxA",
  ["Hunter|Marksmanship"] = "C4PAAAAAAAAAAAAAAAAAAAAAAYzsMwAmgZYLwsAAAAAAAAAmxMzMMjZmxMYMNjBzymZMzMzMzMLMzywMAAAzDMmxMzMgsBDwGzsNjB",
  ["Hunter|Survival|Pack Leader"] = "C8PAAAAAAAAAAAAAAAAAAAAAAMgxMGWILwMM0gFzMzMzMWGAAAAAAmxMzMLbzYMjZwYaGAAAgBAPwYZZm5BWYmZwYMgZ2AYGjZmNDA",
  ["Hunter|Survival|Sentinel"] = "C8PAAAAA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bZMzMzwsNMmhFAAAmZDYGGDYGMMA",
  ["Mage|Frost|Frostfire"] = "CAEAAAAAAAAAAAAAAAAAAAAAAMzwYZmZmFMzEzMGzMzMWMzMzMGzsMTzMLzCAAAaBAA2AAAALAstMmZm5BYMjxM2WAAAAzMYmMGwADD",
  ["Mage|Frost"] = "CAEAAAAAAAAAAAAAAAAAAAAAAMzwYZm5BmFMzEzMGzMzMziZmZMjZgAAAzMzssMz0GAAsBAAAWAYbZMzMzwsNMmhFAAAmZDYGGDYGMMA",
  ["Monk|Brewmaster|Shado-Pan"] = "CwQAQnG51S19isUJoJoTeJ/IKDAAAgZbzYGGzyMzGzMjBAAAAAAYZBzEzMwMM2MMmZmZY2YmxYZYZ7BW2mNMLAAwGCAAwsNLNzMzGDbAMzw0YAAAD",
  ["Monk|Brewmaster|Master of Harmony"] = "CwQAQnG51S19isUJoJoTeJ/IKDAAAgZbzYGGzyMzGzMjBAAAAAAYZBzEzMwMM2MMmZmZY2YmxYZYZ7BW2mNMLAAwysMtMbzsMAAz2s0MzMbMsBmZmZYaMAAgB",
  ["Monk|Brewmaster"] = "CwQAQnG51S19isUJoJoTeJ/IKDAAAgZbzYGGzyMzGzMjBAAAAAAYZBzEzMwMM2MMmZmZY2YmxYZYZ7BW2mNMLAAwGCAAwsNLNzMzGDbAMzw0YAAAD",
  ["Monk|Mistweaver|Conduit of the Celestials"] = "C4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMWmZZYxixMzsZsssND2Mz22yMjFmRzYGwgBjZZmZmhZbYGmlZCAAAAgAsYbmlZbmBAAAGgZADwiMmBA",
  ["Monk|Mistweaver|Master of Harmony"] = "C4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM2mZZYxixMzsZsssND2Mzy2yMjFmRzYGwgBjZZmZmhZbYGmlZCAAAAMbTLz2MLzGAAAAAzMDAMALyAA",
  ["Monk|Mistweaver"] = "C4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMWmZZYxixMzsZsssND2Mz22yMjFmRzYGwgBjZZmZmhZbYGmlZCAAAAgAsYbmlZbmBAAAGgZADwiMmBA",
  ["Monk|Windwalker|Shado-Pan"] = "C0QAQnG51S19isUJoJoTeJ/IKPzYAjxMbzM2mxAAAAAAAAAAAALDz0MmhhBMMMzMzwsNMDzyDMBAsYmtxMGmZgAYDANLzSzMzsAMMwMDAjlBwAG",
  ["Monk|Windwalker|Conduit of the Celestials"] = "C0QAQnG51S19isUJoJoTeJ/IKPzYMgxYbmx2MGAAAAAAAAAAAYZYmmxMMMghhZmZGmNmZYWegJAgFzsNmxwMDEALmZZ2GTz2s0MzMLAzYgZmZAGLDgZmZzA",
  ["Monk|Windwalker"] = "C0QAQnG51S19isUJoJoTeJ/IKPzYAjxMbzM2mxAAAAAAAAAAAALDz0MmhhBMMMzMzwsNMDzyDMBAsYmtxMGmZgAYDANLzSzMzsAMMwMDAjlBwAG",
  ["Paladin|Holy|Lightsmith"] = "CEEAAAAAAAAAAAAAAAAAAAAAAAAAALAwMAADWGzMzMjZmZBGDLjNzsY0EDjZmhxslBgBgNwGLzMzsMbzMzWDAAAwCLMzwmHAmxgZAAMzwMGjGA",
  ["Paladin|Holy|Herald of the Sun"] = "CEEAAAAAAAAAAAAAAAAAAAAAAAAAALAwMAADWGzMzMjZmZBGDLjNzsY0EDjZmhxslBgBgNwGLzMzsMbzMzWDAAAwCLMzwmHAmxgZAAMzwMGjGA",
  ["Paladin|Holy"] = "CEEAAAAAAAAAAAAAAAAAAAAAAAAAALAwMAADWGzMzMjZmZBGDLjNzsY0EDjZmhxslBgBgNwGLzMzsMbzMzWDAAAwCLMzwmHAmxgZAAMzwMGjGA",
  ["Paladin|Protection|Lightsmith"] = "CIEAAAAAAAAAAAAAAAAAAAAAAsZsNLjZMzMzMLLjxYWmlZMAADAAAAAAaamZZmxMDzMbtBgBGwAbAAAEgZmltlWmZsYbBDAYGGDAmZAwMDyYB",
  ["Paladin|Protection|Templar"] = "CIEAAAAAAAAAAAAAAAAAAAAAAsNDzyMzYmZmx2yYMLzithBAYAAAAAAQamZZmxMzYMbtBgBMwMYDAAMz02MzyMAAb22wAgxMMAAsMDwMDyYB",
  ["Paladin|Protection"] = "CIEAAAAAAAAAAAAAAAAAAAAAAsZsNLjZMzMzMLLjxYWmlZMAADAAAAAAaamZZmxMDzMbtBgBGwAbAAAEgZmltlWmZsYbBDAYGGDAmZAwMDyYB",
  ["Paladin|Retribution|Templar"] = "CYEAAAAAAAAAAAAAAAAAAAAAAAAAAAwoZbbmZWGzMzAAAAAAYmyYGmZsNmthZ2mxYMGmxGbAAAZmptZmtZAAbAGAMmhBmxMzGWmBDjZMYA",
  ["Paladin|Retribution|Herald of the Sun"] = "CYEAAAAAAAAAAAAAAAAAAAAAAAAAAAwoZbbmZWGzMzAAAAAAYmyYGmZsNmthZ2mxYMGmxCbAYWmtZmZrBBAAsAYAwYGGYGzMbAzMDjZMYA",
  ["Paladin|Retribution"] = "CYEAAAAAAAAAAAAAAAAAAAAAAAAAAAwoZbbmZWGzMzAAAAAAYmyYGmZsNmthZ2mxYMGmxGbAAAZmptZmtZAAbAGAMmhBmxMzGWmBDjZMYA",
  ["Priest|Discipline|Oracle"] = "CAQAAAAAAAAAAAAAAAAAAAAAAADsMDWmZMPwMwMbzYmZmZMzAAAAAAAAAAYGWmBzMzgxMD2MNTMAzsghwYWGgxgFAAYMzMjBzAMzMTwM",
  ["Priest|Discipline|Voidweaver"] = "CAQAAAAAAAAAAAAAAAAAAAAAAADsYegZ2YMmZmhZDzMzMzMAAAAAAAAAAYGWmBzMzgxMD2MNTMYmBABwsNbbgxmBAgxMzMGMDmZwMNDzA",
  ["Priest|Discipline"] = "CAQAAAAAAAAAAAAAAAAAAAAAAADsMDWmZMPwMwMbzYmZmZMzAAAAAAAAAAYGWmBzMzgxMD2MNTMAzsghwYWGgxgFAAYMzMjBzAMzMTwM",
  ["Priest|Holy|Oracle"] = "CEQAAAAAAAAAAAAAAAAAAAAAAwYAAAAAAAMzMmlxMMzYYGGLzMzMAAAAGmlZYmZmhZMzAYmaAMzCGCjZbAGDsYmZWA0MGjxgZAmZmB+A",
  ["Priest|Holy|Archon"] = "CEQAAAAAAAAAAAAAAAAAAAAAAwYAAAAAAgZzwYWGwMzMjZmZsMzMzAAAAYYWmhZmZGmxMD2wMFAYmNzkZzAAjBbGjFANjZGjBzstMADYA",
  ["Priest|Holy"] = "CEQAAAAAAAAAAAAAAAAAAAAAAwYAAAAAAAMzMmlxMMzYYGGLzMzMAAAAGmlZYmZmhZMzAYmaAMzCGCjZbAGDsYmZWA0MGjxgZAmZmB+A",
  ["Priest|Shadow|Voidweaver"] = "CIQAAAAAAAAAAAAAAAAAAAAAAMMDDAAAAAAAAAAAAmZxMmZbmxMzyMzYG2mZGzMzYDZGLmpBYmZGAIAz2stAmNGAYwYmZGzGzgZGMDGA",
  ["Priest|Shadow|Archon"] = "CIQAAAAAAAAAAAAAAAAAAAAAAMMDzAAAAAAAAAAAAwMLmxMbjxMzyMGzw2MzYmZGbIzYxMNAzAMzmZY2MAkxYBAzMgxMzMmNmZbZAmBDA",
  ["Priest|Shadow"] = "CIQAAAAAAAAAAAAAAAAAAAAAAMMDDAAAAAAAAAAAAmZxMmZbmxMzyMzYG2mZGzMzYDZGLmpBYmZGAIAz2stAmNGAYwYmZGzGzgZGMDGA",
  ["Rogue|Assassination|Fatebound"] = "CMQAAAAAAAAAAAAAAAAAAAAAAYmlZmFDGAAAAAYWGsNDAAAAAIbzMzMzMjxyMzMbzsMzMPgZMzYMMzYMAbmlBGwSwywEYYxgZGgxYA",
  ["Rogue|Assassination|Deathstalker"] = "CMQAAAAAAAAAAAAAAAAAAAAAAYmlZmFDGAAAAAYWGsNDAAAAAIbzMzMzMjxyMzMbzsMzMPgZMzYMMzYMAbmlBGwSwywEYYxgZGgxYA",
  ["Rogue|Assassination"] = "CMQAAAAAAAAAAAAAAAAAAAAAAYmlZmFDGAAAAAYWGsNDAAAAAIbzMzMzMjxyMzMbzsMzMPgZMzYMMzY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ZAwMjhhB",
  ["Shaman|Elemental"] = "CYQAAAAAAAAAAAAAAAAAAAAAAAAAAAzMbLzMGjZZZZMmhBAAAAsYmNYADY2YCZWAgZZmZGjtFTbMzsNWmxMjhlZZmZZGjZmFAgZAwMjhhB",
  ["Shaman|Enhancement|Totemic"] = "CcQAAAAAAAAAAAAAAAAAAAAAAMzMzgZmZmZmhZmZAAAAAAAAA2AsZGDbkFYGGawCAz2MmxYZZGbMzYsMzMzMGLjBAwMMmZYEYmBDGDA",
  ["Shaman|Enhancement|Stormbringer"] = "CcQAAAAAAAAAAAAAAAAAAAAAAMzMzgZmZmZmhZmZAAAAAAAAA2AsZGDbkFYGGawCAz2MmxYZZGbMzYsMzMzMGLjBAwMMmZYEYmBDGDA",
  ["Shaman|Enhancement"] = "CcQAAAAAAAAAAAAAAAAAAAAAAMzMzgZmZmZmhZmZAAAAAAAAA2AsZGDbkFYGGawCAz2MmxYZZGbMzYsMzMzMGLjBAwMMmZYEYmBDGDA",
  ["Shaman|Restoration|Totemic"] = "CgQAAAAAAAAAAAAAAAAAAAAAAAAAAgBAAAAzMzsstMmZGjZmZMjZsAbwMW0YbAZGYjZMDz2MjRz2yMzmZMbsYMzYYZWmBAgBwMDmZAAYG",
  ["Shaman|Restoration|Farseer"] = "CgQAAAAAAAAAAAAAAAAAAAAAAAAAAgBAAAAzMzsssNjZGjZGzMMWMzCMgJYWYCMWMDzwsNzY0stMzsZGzGLGzMGWmlBAAAmZGDgZGYwM",
  ["Shaman|Restoration"] = "CgQAAAAAAAAAAAAAAAAAAAAAAAAAAgBAAAAzMzsstMmZGjZmZMjZsAbwMW0YbAZGYjZMDz2MjRz2yMzmZMbsYMzYYZWmBAgBwMDmZAAYG",
  ["Warlock|Affliction|Soul Harvester"] = "CkQAAAAAAAAAAAAAAAAAAAAAAwMMzoZzM2mZmZWGAAwMzsMbzMzyYAgx2yADYCmhtADbDAAAGAAAzMjZMzsNGzgZmZGDzMzAAMDMA",
  ["Warlock|Affliction|Hellcaller"] = "CkQAAAAAAAAAAAAAAAAAAAAAAwMzMzoZjBzMmlBAAYmZZWmZmlxAAWgBmFjGzAysAWGAAAMAAwMDmZGzMMGmZmZmZGMzMzAAmBG",
  ["Warlock|Affliction"] = "CkQAAAAAAAAAAAAAAAAAAAAAAwMMzoZzM2mZmZWGAAwMzsMbzMzyYAgx2yADYCmhtADbDAAAGAAAzMjZMzsNGzgZmZGDzMzAAMDMA",
  ["Warlock|Demonology|Soul Harvester"] = "CoQAAAAAAAAAAAAAAAAAAAAAAwMzMzoZjxmZGzyAAAAAAAMWWGYADYGWCZsZYmZZ2mZmxMAwMMmZAmZGzYMbAAgZmZmZGzwyMGwA",
  ["Warlock|Demonology|Diabolist"] = "CoQAAAAAAAAAAAAAAAAAAAAAAwMzMzoZjxmZGzyAAAAAAAAGzYYBGYb0GNsYYmZZ2mZmxMAwMMmZmZAGzYMbAAgZmZmZGzwyMGwA",
  ["Warlock|Demonology"] = "CoQAAAAAAAAAAAAAAAAAAAAAAwMzMzoZjxmZGzyAAAAAAAMWWGYADYGWCZsZYmZZ2mZmxMAwMMmZAmZGzYMbAAgZmZmZGzwyMGwA",
  ["Warlock|Destruction|Hellcaller"] = "CsQAAAAAAAAAAAAAAAAAAAAAAwMmZmpZbMMzMmtZbmZmZxMzyyYAAwMGzMzmFYgZxoxMAmtYjBAAGzwAAgZGwMmZ2AAAMzMDAAMM",
  ["Warlock|Destruction|Diabolist"] = "CsQAAAAAAAAAAAAAAAAAAAAAAwMmZmpZbMMzMmtZbmZmZxMzyyYAAwMGzMzGYMjhFyAbDb0YhBAAGzwAAMzAwMmZ2AAAMzMDAAMM",
  ["Warlock|Destruction"] = "CsQAAAAAAAAAAAAAAAAAAAAAAwMmZmpZbMMzMmtZbmZmZxMzyyYAAwMGzMzmFYgZxoxMAmtYjBAAGzwAAgZGwMmZ2AAAMzMDAAMM",
  ["Warrior|Arms|Slayer"] = "CcEAAAAAAAAAAAAAAAAAAAAAAgZmZmFzMzYGAAAghphZYmZbZmZmZYGzMAAAAAGLmB2iZstMwCYAzwEyMYDYGMGMbmtBYmBgZmhB",
  ["Warrior|Arms|Colossus"] = "CcEAAAAAAAAAAAAAAAAAAAAAAgZmxsMzMzYGAAAghphZYmZbZmZmZYGzMAAAAAGbmB2iBsZGDLwAzoNaMYBYGMGMbmtBzMAgZmhB",
  ["Warrior|Arms"] = "CcEAAAAAAAAAAAAAAAAAAAAAAgZmZmFzMzYGAAAghphZYmZbZmZmZYGzMAAAAAGLmB2iZstMwCYAzwEyMYDYGMGMbmtBYmBgZmhB",
  ["Warrior|Fury|Slayer"] = "CgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGDDmZ2WmZmZmxMmZMjZMzyMzYMzsNmZGAAIGLLDsAmgZYCMDbAmZjxAAgZGDzMzMMYA",
  ["Warrior|Fury|Mountain Thane"] = "CgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGDDzMz2yMmZmxMmZMjZMzyMzYMzsMmZGAAIMwGssZ0YGQmFMjFAzgxAgZGADzMzMMYA",
  ["Warrior|Fury"] = "CgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGDDmZ2WmZmZmxMmZMjZMzyMzYMzsNmZGAAIGLLDsAmgZYCMDbAmZjxAAgZGDzMzMMYA",
  ["Warrior|Protection|Mountain Thane"] = "CkEAAAAAAAAAAAAAAAAAAAAAA0yAAAjZMmZmZGzmZmlZMGjGzYGLzMzMDDzMAAAAYZmBwYAGYDWWMaMDgZLmZDGzMDjNAYmBAADMG",
  ["Warrior|Protection|Colossus"] = "CkEAAAAAAAAAAAAAAAAAAAAAA0yAAAjZMmZmZGzmZmlZMGjGzYGLzMzMDDzMAAAAYZmBwYAGYDWWMaMDgZLmZDGzMDjNAYmBAADMG",
  ["Warrior|Protection"] = "CkEAAAAAAAAAAAAAAAAAAAAAA0yAAAjZMmZmZGzmZmlZMGjGzYGLzMzMDDzMAAAAYZmBwYAGYDWWMaMDgZLmZDGzMDjNAYmBAADMG",
}

local function trim(s)
  return (tostring(s or ""):gsub("^%s+", ""):gsub("%s+$", ""))
end

--- Lookup with honesty metadata.
--- heroExact = true only when Class|Spec|Hero CUk differs from Class|Spec base
---   (true separate Method scrape for that hero).
--- proxy = true when a hero was requested but we serve shared/primary gold.
--- source = "method" | "method-proxy" | "" (empty loadout)
function M.GetResult(className, spec, hero)
  className = trim(className)
  spec = trim(spec)
  hero = trim(hero)
  local baseKey = className .. "|" .. spec
  local base = LOADOUTS[baseKey] or ""
  local out = {
  loadout = "",
  matchedKey = "",
  hero = hero,
  className = className,
  spec = spec,
  heroExact = false,
  proxy = false,
  source = "",
  primaryHero = nil,
  }

  -- First listed hero key for this spec (registry order is not sorted; pick any)
  local prefix = baseKey .. "|"
  local heroes = {}
  for k in pairs(LOADOUTS) do
  if k:sub(1, #prefix) == prefix then
  local h = k:sub(#prefix + 1)
  if h ~= "" then
  heroes[#heroes + 1] = h
  end
  end
  end
  table.sort(heroes)
  if heroes[1] then
  out.primaryHero = heroes[1]
  end

  if hero ~= "" then
  local heroKey = baseKey .. "|" .. hero
  local heroLo = LOADOUTS[heroKey]
  if heroLo and heroLo ~= "" then
  out.loadout = heroLo
  out.matchedKey = heroKey
  -- Distinct scrape vs class|spec gold = hero-exact Method package
  if base ~= "" and heroLo ~= base then
  out.heroExact = true
  out.proxy = false
  out.source = "method"
  else
  -- Same string as base (or no base): labeled hero key but shared gold
  out.heroExact = false
  out.proxy = true
  out.source = "method-proxy"
  end
  return out
  end
  -- Hero requested but no key: fall through to base as proxy
  if base ~= "" then
  out.loadout = base
  out.matchedKey = baseKey
  out.proxy = true
  out.source = "method-proxy"
  return out
  end
  return out
  end

  -- No hero: class|spec gold is the Method package (honest for "no hero chip")
  if base ~= "" then
  out.loadout = base
  out.matchedKey = baseKey
  out.heroExact = false
  out.proxy = false
  out.source = "method"
  end
  return out
end

function M.Get(className, spec, hero)
  local r = M.GetResult(className, spec, hero)
  return (r and r.loadout) or ""
end

function M.IsHeroExact(className, spec, hero)
  local r = M.GetResult(className, spec, hero)
  return r and r.heroExact == true
end

--- Classify an existing CUk against the registry (proxy vs hero-exact vs class|spec gold).
--- Use this whenever a pack already has a string and needs honest metadata re-stamped.
--- Does not invent a new string; loadout field echoes the input when non-empty.
function M.ClassifyLoadout(className, spec, hero, loadoutStr)
  className = trim(className)
  spec = trim(spec)
  hero = trim(hero)
  loadoutStr = trim(loadoutStr)
  local r = M.GetResult(className, spec, hero)
  local out = {
    loadout = loadoutStr,
    matchedKey = (r and r.matchedKey) or "",
    hero = hero,
    className = className,
    spec = spec,
    heroExact = false,
    proxy = false,
    source = "",
    primaryHero = r and r.primaryHero or nil,
    matchesRegistry = false,
  }
  if #loadoutStr < 40 then
    return out
  end
  local baseKey = className .. "|" .. spec
  local base = LOADOUTS[baseKey] or ""
  -- Exact registry match for this hero request
  if r and r.loadout and r.loadout == loadoutStr then
    out.matchedKey = r.matchedKey
    out.heroExact = r.heroExact and true or false
    out.proxy = r.proxy and true or false
    out.source = r.source or "method"
    out.matchesRegistry = true
    return out
  end
  -- Same string as Class|Spec gold while a hero chip is set > shared gold proxy
  if hero ~= "" and base ~= "" and loadoutStr == base then
    out.matchedKey = baseKey
    out.heroExact = false
    out.proxy = true
    out.source = "method-proxy"
    out.matchesRegistry = true
    return out
  end
  -- Matches some other hero key under this spec?
  local prefix = baseKey .. "|"
  for k, v in pairs(LOADOUTS) do
    if k:sub(1, #prefix) == prefix and v == loadoutStr then
      local h = k:sub(#prefix + 1)
      out.matchedKey = k
      out.matchesRegistry = true
      if base ~= "" and v ~= base then
        out.heroExact = true
        out.proxy = (hero ~= "" and h ~= hero) -- different hero's exact scrape
        out.source = out.proxy and "method-proxy" or "method"
      else
        out.heroExact = false
        out.proxy = hero ~= ""
        out.source = out.proxy and "method-proxy" or "method"
      end
      return out
    end
  end
  -- Unknown custom/live string - not Method registry
  out.source = "custom"
  out.proxy = false
  out.heroExact = false
  return out
end

--- Stamp honesty fields onto a pack sequence from registry + optional existing CUk.
function M.StampSeqHonesty(seq, hero)
  if type(seq) ~= "table" then
    return false
  end
  hero = trim(hero or seq.heroTalent or "")
  local lo = trim(seq.talentLoadout or seq.talents or "")
  local r
  if #lo >= 40 then
    r = M.ClassifyLoadout(seq.className, seq.spec, hero, lo)
  else
    r = M.GetResult(seq.className, seq.spec, hero)
    lo = trim(r and r.loadout or "")
    if #lo >= 40 then
      seq.talentLoadout = lo
      seq.talents = lo
    end
  end
  if not r or #trim(seq.talentLoadout or seq.talents or "") < 40 then
    return false
  end
  -- Never overwrite live/custom source with Method labels
  local srcNow = string.lower(trim(seq.talentLoadoutSource or ""))
  if srcNow == "live" or srcNow == "custom" then
    seq.talentLoadoutProxy = false
    seq.talentLoadoutHeroExact = false
    return true
  end
  seq.talentLoadoutSource = r.source or "method"
  seq.talentLoadoutProxy = r.proxy and true or false
  seq.talentLoadoutHeroExact = r.heroExact and true or false
  seq.talentLoadoutMatchedKey = r.matchedKey or ""
  return true
end

function M.ListHeroes(className, spec)
  local prefix = trim(className) .. "|" .. trim(spec) .. "|"
  local t, seen = {}, {}
  for k in pairs(LOADOUTS) do
  if k:sub(1, #prefix) == prefix then
  local h = k:sub(#prefix + 1)
  if h ~= "" and not seen[h] then seen[h] = true; t[#t + 1] = h end
  end
  end
  table.sort(t)
  return t
end

M.LOADOUTS = LOADOUTS
M.patch = "Midnight 12.1"
M.scrapedAt = "2026-08-12"
M.heroExpanded = true
--- True only when every hero key still shares Class|Spec gold (none distinct).
M.heroCukShared = false
SpellSmasherMethodLoadouts = M
return M

