import Greetings from "@/constants/greetings.json";

export class GameConstants {
  static BEATSTREAM = "bst";
  static BISHI_BASHI = "bishi";
  static BISHI_BASHI_NEW = "newbishi";
  static DANCE_EVOLUTION = "danevo";
  static DANCE_RUSH = "dancerush";
  static DDR = "ddr";
  static DDRCLASS = "ddrclass";
  static DDROMNI = "ddromni";
  static DRUMMANIA = "dm";
  static EEMALL = "eemall";
  static FUTURETOMTOM = "ftt";
  static GITADORA_DM = "gitadora_dm";
  static GITADORA_GF = "gitadora_gf";
  static GUITARFREAKS = "gf";
  static IIDX = "iidx";
  static IIDXCLASS = "iidxclass";
  static JUBEAT = "jubeat";
  static LOVEPLUS = "loveplus";
  static MGA = "metalgear";
  static MUSECA = "museca";
  static NOSTALGIA = "nost";
  static OTOMEDIUS = "oto";
  static OTOCA = "otoca";
  static POPN_HELLO = "hpm";
  static POPN_MUSIC = "pnm";
  static QMA = "qma";
  static REFLEC_BEAT = "reflec";
  static ROAD_FIGHTERS = "roadfighters";
  static SDVX = "sdvx";
  static SILENT_HILL = "sha";
  static SILENT_SCOPE = "scope";
  static TSUMTSUM = "tsum";
  static WINNING_ELEVEN = "weac";
}

export class VersionConstants {
  static BEATSTREAM = 1;
  static BEATSTREAM_2 = 2;

  static THE_STAR_BISHI_BASHI = 1;
  static BISHI_BASHI_CHANNEL = 1;

  static DANCE_EVOLUTION = 1;

  static DANCE_RUSH_STARDOM = 1;

  static DDR_CS_SOLO = 200;
  static DDR_1ST_MIX = 1;
  static DDR_2ND_MIX = 2;
  static DDR_3RD_MIX = 3;
  static DDR_4TH_MIX = 4;
  static DDR_5TH_MIX = 5;
  static DDR_MAX = 6;
  static DDR_MAX2 = 7;
  static DDR_EXTREME = 8;
  static DDR_SUPERNOVA = 9;
  static DDR_SUPERNOVA_2 = 10;
  static DDR_X = 11;
  static DDR_X2 = 12;
  static DDR_X3_VS_2ND_MIX = 13;
  static DDR_2013 = 14;
  static DDR_2014 = 15;
  static DDR_ACE = 16;
  static DDR_A20 = 17;
  static DDR_A20_PLUS = 18;
  static DDR_A3 = 19;

  static DRUMMANIA_1ST = 1;
  static DRUMMANIA_2ND = 2;
  static DRUMMANIA_3RD = 3;
  static DRUMMANIA_4TH = 4;
  static DRUMMANIA_5TH = 5;
  static DRUMMANIA_6TH = 6;
  static DRUMMANIA_7TH = 7;
  static DRUMMANIA_8TH = 8;
  static DRUMMANIA_9TH = 9;
  static DRUMMANIA_10TH = 10;
  static DRUMMANIA_V = 11;
  static DRUMMANIA_V2 = 12;
  static DRUMMANIA_V3 = 13;
  static DRUMMANIA_V4 = 14;
  static DRUMMANIA_V5 = 15;
  static DRUMMANIA_V6 = 16;
  static DRUMMANIA_V7 = 17;
  static DRUMMANIA_V8 = 18;

  static EEMALL = 1;
  static EEMALL_2ND = 2;

  static FUTURETOMTOM = 1;
  static FUTURETOMTOM_VER2 = 2;

  static GITADORA = 1;
  static GITADORA_OVERDRIVE = 2;
  static GITADORA_TRIBOOST = 3;
  static GITADORA_TRIBOOST_RE_EVOLVE = 4;
  static GITADORA_MATIXX = 5;
  static GITADORA_EXCHAIN = 6;
  static GITADORA_NEXTAGE = 7;
  static GITADORA_HIGH_VOLTAGE = 8;
  static GITADORA_FUZZUP = 9;

  static GUITARFREAKS_1ST = 0;
  static GUITARFREAKS_2ND = 1;
  static GUITARFREAKS_3RD = 2;
  static GUITARFREAKS_4TH = 3;
  static GUITARFREAKS_5TH = 4;
  static GUITARFREAKS_6TH = 5;
  static GUITARFREAKS_7TH = 6;
  static GUITARFREAKS_8TH = 7;
  static GUITARFREAKS_9TH = 8;
  static GUITARFREAKS_10TH = 9;
  static GUITARFREAKS_11TH = 10;
  static GUITARFREAKS_V = 11;
  static GUITARFREAKS_V2 = 12;
  static GUITARFREAKS_V3 = 13;
  static GUITARFREAKS_V4 = 14;
  static GUITARFREAKS_V5 = 15;
  static GUITARFREAKS_V6 = 16;
  static GUITARFREAKS_V7 = 17;
  static GUITARFREAKS_V8 = 18;

  static IIDX = 1;
  static IIDX_2ND_STYLE = 2;
  static IIDX_3RD_STYLE = 3;
  static IIDX_4TH_STYLE = 4;
  static IIDX_5TH_STYLE = 5;
  static IIDX_6TH_STYLE = 6;
  static IIDX_7TH_STYLE = 7;
  static IIDX_8TH_STYLE = 8;
  static IIDX_9TH_STYLE = 9;
  static IIDX_10TH_STYLE = 10;
  static IIDX_RED = 11;
  static IIDX_HAPPY_SKY = 12;
  static IIDX_DISTORTED = 13;
  static IIDX_GOLD = 14;
  static IIDX_DJ_TROOPERS = 15;
  static IIDX_EMPRESS = 16;
  static IIDX_SIRIUS = 17;
  static IIDX_RESORT_ANTHEM = 18;
  static IIDX_LINCLE = 19;
  static IIDX_TRICORO = 20;
  static IIDX_SPADA = 21;
  static IIDX_PENDUAL = 22;
  static IIDX_COPULA = 23;
  static IIDX_SINOBUZ = 24;
  static IIDX_CANNON_BALLERS = 25;
  static IIDX_ROOTAGE = 26;
  static IIDX_HEROIC_VERSE = 27;
  static IIDX_BISTROVER = 28;
  static IIDX_CASTHOUR = 29;
  static IIDX_RESIDENT = 30;

  static JUBEAT = 1;
  static JUBEAT_RIPPLES = 2;
  static JUBEAT_RIPPLES_APPEND = 3;
  static JUBEAT_KNIT = 4;
  static JUBEAT_KNIT_APPEND = 5;
  static JUBEAT_COPIOUS = 6;
  static JUBEAT_COPIOUS_APPEND = 7;
  static JUBEAT_SAUCER = 8;
  static JUBEAT_SAUCER_FULFILL = 9;
  static JUBEAT_PROP = 10;
  static JUBEAT_QUBELL = 11;
  static JUBEAT_CLAN = 12;
  static JUBEAT_FESTO = 13;
  static JUBEAT_AVE = 14;

  static LOVEPLUS_ARCADE = 1;
  static LOVEPLUS_CC = 2;

  static METALGEAR_ARCADE = 1;

  static MUSECA = 1;
  static MUSECA_1_PLUS = 2;

  static NOSTALGIA = 1;
  static NOSTALGIA_FORTE = 2;
  static NOSTALGIA_OP_2 = 3;
  static NOSTALGIA_OP_3 = 4;

  static OTOMEDIUS = 1;

  static OTOCA_DOLL = 1;

  static HELLO_POPN_MUSIC = 1;

  static POPN_MUSIC = 1;
  static POPN_MUSIC_2 = 2;
  static POPN_MUSIC_3 = 3;
  static POPN_MUSIC_4 = 4;
  static POPN_MUSIC_5 = 5;
  static POPN_MUSIC_6 = 6;
  static POPN_MUSIC_7 = 7;
  static POPN_MUSIC_8 = 8;
  static POPN_MUSIC_9 = 9;
  static POPN_MUSIC_10 = 10;
  static POPN_MUSIC_11 = 11;
  static POPN_MUSIC_IROHA = 12;
  static POPN_MUSIC_CARNIVAL = 13;
  static POPN_MUSIC_FEVER = 14;
  static POPN_MUSIC_ADVENTURE = 15;
  static POPN_MUSIC_PARTY = 16;
  static POPN_MUSIC_THE_MOVIE = 17;
  static POPN_MUSIC_SENGOKU_RETSUDEN = 18;
  static POPN_MUSIC_TUNE_STREET = 19;
  static POPN_MUSIC_FANTASIA = 20;
  static POPN_MUSIC_SUNNY_PARK = 21;
  static POPN_MUSIC_LAPISTORIA = 22;
  static POPN_MUSIC_ECLALE = 23;
  static POPN_MUSIC_USANEKO = 24;
  static POPN_MUSIC_PEACE = 25;
  static POPN_MUSIC_KAIMEI_RIDDLES = 26;
  static POPN_MUSIC_UNILAB = 27;

  static QMA = 1;
  static QMA_II = 2;
  static QMA_III = 3;
  static QMA_IV = 4;
  static QMA_V = 5;
  static QMA_VI = 6;
  static QMA_VII = 7;
  static QMA_VIII = 8;
  static QMA_GATE = 9;
  static QMA_CAMPUS = 10;
  static QMA_DAWN = 11;
  static QMA_TOKYO = 12;
  static QMA_EVOLVE = 13;
  static QMA_MAXIVCORD = 14;
  static QMA_XROSS_VOYAGE = 15;
  static QMA_KIBOU = 16;
  static QMA_MUGEN = 17;

  static REFLEC_BEAT = 1;
  static REFLEC_BEAT_LIMELIGHT = 2;
  static REFLEC_BEAT_COLETTE = 3;
  static REFLEC_BEAT_GROOVIN = 4;
  static REFLEC_BEAT_VOLZZA = 5;
  static REFLEC_BEAT_VOLZZA_2 = 6;
  static REFLEC_BEAT_REFLESIA = 7;

  static ROAD_FIGHTERS = 1;

  static SDVX_BOOTH = 1;
  static SDVX_INFINITE_INFECTION = 2;
  static SDVX_GRAVITY_WARS = 3;
  static SDVX_HEAVENLY_HAVEN = 4;
  static SDVX_VIVID_WAVE = 5;
  static SDVX_EXCEED_GEAR = 6;

  static SILENT_HILL_ARCADE = 1;

  static SILENT_SCOPE_BONE_EATER = 1;

  static DISNEY_TSUM_TSUM = 1;

  static WINNING_ELEVEN_2008 = 1;
  static WINNING_ELEVEN_2010 = 2;
  static WINNING_ELEVEN_2012 = 3;
  static WINNING_ELEVEN_2014 = 4;
}

export function GetRandomMessage() {
  const greetings = Greetings; // Assuming Greetings is a promise

  const key = Math.floor(Math.random() * greetings.length);
  const selected = greetings[key];

  if (typeof selected.header !== "string") {
    selected.comment = "Show me your moves.";
    selected.author = "PhaseII server";
  }

  selected.header =
    typeof selected.header === "string"
      ? selected.header.split("<username>")
      : ["Heyo, ", "!"];

  return selected;
}

const GITADORA_VERSION_DATA = [
  {
    id: VersionConstants.GITADORA,
    label: "Original",
  },
  {
    id: VersionConstants.GITADORA_OVERDRIVE,
    label: "OverDrive",
  },
  {
    id: VersionConstants.GITADORA_TRIBOOST,
    label: "Tri-Boost",
  },
  {
    id: VersionConstants.GITADORA_TRIBOOST_RE_EVOLVE,
    label: "Tri-Boost RE:Evolve",
  },
  {
    id: VersionConstants.GITADORA_MATIXX,
    label: "Matixx",
  },
  {
    id: VersionConstants.GITADORA_EXCHAIN,
    label: "EXCHAIN",
  },
  {
    id: VersionConstants.GITADORA_NEXTAGE,
    label: "Nex+Age",
  },
  {
    id: VersionConstants.GITADORA_HIGH_VOLTAGE,
    label: "HIGH-VOLTAGE",
  },
  {
    id: VersionConstants.GITADORA_FUZZUP,
    label: "FUZZUP",
  },
];

export const gameData = [
  {
    id: GameConstants.BEATSTREAM,
    name: "BeatStream",
    icon: null,
    cardBG: null,
    noRivals: true,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.BEATSTREAM,
        label: "Original",
      },
      {
        id: VersionConstants.BEATSTREAM_2,
        label: "アニムトライヴ",
      },
    ],
  },
  {
    id: GameConstants.BISHI_BASHI,
    name: "The ⭐ Bishi Bashi",
    icon: null,
    cardBG: null,
    noRivals: true,
    noScores: true,
    noRecords: true,
    skip: true,
    playerHeaders: [
      { text: "Region", value: "region", sortable: true, width: 100 },
      { text: "Home Arcade", value: "homeArcade", sortable: true, width: 150 },
    ],
  },
  {
    id: GameConstants.BISHI_BASHI_NEW,
    name: "BishiBashi Channel",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.DANCE_EVOLUTION,
    name: "DanceEvolution",
    icon: null,
    cardBG: null,
    noRivals: true,
    noScores: true,
    noRecords: true,
    skip: true,
  },
  {
    id: GameConstants.DANCE_RUSH,
    name: "DanceRush",
    icon: null,
    cardBG: null,
    noRivals: true,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.DANCE_RUSH_STARDOM,
        label: "STARDOM",
      },
    ],
  },
  {
    id: GameConstants.DDR,
    name: "DanceDanceRevolution",
    shortName: "DDR",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "EX Score", value: "exscore" },
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.DDR_1ST_MIX,
        label: "1ST MIX",
      },
      {
        id: VersionConstants.DDR_2ND_MIX,
        label: "2ND MIX",
      },
      {
        id: VersionConstants.DDR_3RD_MIX,
        label: "3RD MIX",
      },
      {
        id: VersionConstants.DDR_4TH_MIX,
        label: "4TH MIX",
      },
      {
        id: VersionConstants.DDR_5TH_MIX,
        label: "5TH MIX",
      },
      {
        id: VersionConstants.DDR_MAX,
        label: "MAX",
      },
      {
        id: VersionConstants.DDR_MAX2,
        label: "MAX 2",
      },
      {
        id: VersionConstants.DDR_EXTREME,
        label: "EXTREME",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA,
        label: "SuperNOVA",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA_2,
        label: "SuperNOVA 2",
      },
      {
        id: VersionConstants.DDR_X,
        label: "X",
      },
      {
        id: VersionConstants.DDR_X2,
        label: "X2",
      },
      {
        id: VersionConstants.DDR_X3_VS_2ND_MIX,
        label: "X3 vs. 2ND MIX",
      },
      {
        id: VersionConstants.DDR_2013,
        label: "(2013)",
      },
      {
        id: VersionConstants.DDR_2014,
        label: "(2014)",
      },
      {
        id: VersionConstants.DDR_ACE,
        label: "Ace",
      },
      {
        id: VersionConstants.DDR_A20,
        label: "A20",
      },
      {
        id: VersionConstants.DDR_A20_PLUS,
        label: "A20 PLUS",
      },
      {
        id: VersionConstants.DDR_A3,
        label: "A3",
      },
    ],
  },
  {
    id: GameConstants.DDRCLASS,
    name: "Classic DDR",
    icon: "/assets/icon/ddr.png",
    cardBG: "/assets/card/ddr.png",
    noRivals: true,
    noScores: true,
    noRecords: true,
    versions: [
      {
        id: VersionConstants.DDR_1ST_MIX,
        label: "1ST MIX",
      },
      {
        id: VersionConstants.DDR_2ND_MIX,
        label: "2ND MIX",
      },
      {
        id: VersionConstants.DDR_3RD_MIX,
        label: "3RD MIX",
      },
      {
        id: VersionConstants.DDR_4TH_MIX,
        label: "4TH MIX",
      },
      {
        id: VersionConstants.DDR_5TH_MIX,
        label: "5TH MIX",
      },
      {
        id: VersionConstants.DDR_MAX,
        label: "MAX",
      },
      {
        id: VersionConstants.DDR_MAX2,
        label: "MAX 2",
      },
      {
        id: VersionConstants.DDR_EXTREME,
        label: "EXTREME",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA,
        label: "SuperNOVA",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA_2,
        label: "SuperNOVA 2",
      },
    ],
  },
  {
    id: GameConstants.DDROMNI,
    name: "DDR OmniMIX",
    icon: "/assets/icon/ddr.png",
    cardBG: "/assets/card/ddr.png",
    scoreHeaders: [
      { text: "EX Score", value: "exscore" },
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.DDR_1ST_MIX,
        label: "1ST MIX",
      },
      {
        id: VersionConstants.DDR_2ND_MIX,
        label: "2ND MIX",
      },
      {
        id: VersionConstants.DDR_3RD_MIX,
        label: "3RD MIX",
      },
      {
        id: VersionConstants.DDR_4TH_MIX,
        label: "4TH MIX",
      },
      {
        id: VersionConstants.DDR_5TH_MIX,
        label: "5TH MIX",
      },
      {
        id: VersionConstants.DDR_MAX,
        label: "MAX",
      },
      {
        id: VersionConstants.DDR_MAX2,
        label: "MAX 2",
      },
      {
        id: VersionConstants.DDR_EXTREME,
        label: "EXTREME",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA,
        label: "SuperNOVA",
      },
      {
        id: VersionConstants.DDR_SUPERNOVA_2,
        label: "SuperNOVA 2",
      },
      {
        id: VersionConstants.DDR_X,
        label: "X",
      },
      {
        id: VersionConstants.DDR_X2,
        label: "X2",
      },
      {
        id: VersionConstants.DDR_X3_VS_2ND_MIX,
        label: "X3 vs. 2ND MIX",
      },
      {
        id: VersionConstants.DDR_2013,
        label: "(2013)",
      },
      {
        id: VersionConstants.DDR_2014,
        label: "(2014)",
      },
      {
        id: VersionConstants.DDR_ACE,
        label: "A",
      },
      {
        id: VersionConstants.DDR_A20,
        label: "A20",
      },
      {
        id: VersionConstants.DDR_A20_PLUS,
        label: "OmniMIX (A20 PLUS)",
      },
    ],
  },
  {
    id: GameConstants.DRUMMANIA,
    name: "DRUMMANIA",
    icon: null,
    cardBG: null,
    playerHeaders: [
      { text: "SKILL LEVEL", value: "skill.level", sortable: true, width: 120 },
      {
        text: "SKILL POINT",
        value: "skill.point",
        sortable: true,
        width: 150,
      },
    ],
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
      { text: "Skill %", value: "skill.perc" },
      { text: "Skill Point", value: "skill.point" },
    ],
    versions: [
      {
        id: VersionConstants.DRUMMANIA_1ST,
        label: "1ST MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_2ND,
        label: "2ND MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_3RD,
        label: "3RD MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_4TH,
        label: "4TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_5TH,
        label: "5TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_6TH,
        label: "6TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_7TH,
        label: "7TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_8TH,
        label: "8TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_9TH,
        label: "9TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_10TH,
        label: "10TH MIX",
      },
      {
        id: VersionConstants.DRUMMANIA_V,
        label: "V",
      },
      {
        id: VersionConstants.DRUMMANIA_V2,
        label: "V2",
      },
      {
        id: VersionConstants.DRUMMANIA_V3,
        label: "V3",
      },
      {
        id: VersionConstants.DRUMMANIA_V4,
        label: "V4: ROCKxROCK",
      },
      {
        id: VersionConstants.DRUMMANIA_V5,
        label: "V5: ROCK TO INFINITY!",
      },
      {
        id: VersionConstants.DRUMMANIA_V6,
        label: "V6: BLAZING!!!!",
      },
      {
        id: VersionConstants.DRUMMANIA_V7,
        label: "V7",
      },
      {
        id: VersionConstants.DRUMMANIA_V8,
        label: "V8",
      },
    ],
  },
  {
    id: GameConstants.EEMALL,
    name: "eeMall",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
    versions: [
      {
        id: VersionConstants.EEMALL,
        label: "1st Avenue",
      },
      {
        id: VersionConstants.EEMALL_2ND,
        label: "2nd Avenue",
      },
    ],
  },
  {
    id: GameConstants.FUTURETOMTOM,
    name: "Future Tom Tom",
    icon: null,
    cardBG: null,
    noRivals: true,
    noScores: true,
    noRecords: true,
    versions: [
      {
        id: VersionConstants.FUTURETOMTOM,
        label: "Ver 1",
      },
      {
        id: VersionConstants.FUTURETOMTOM_VER2,
        label: "Ver 2",
      },
    ],
  },
  {
    id: GameConstants.GITADORA_DM,
    name: "GITADORA (Drums)",
    icon: null,
    cardBG: null,
    noRivals: true,
    playerHeaders: [
      {
        text: "SKILL POINT",
        value: "skill.point",
        sortable: true,
        width: 150,
      },
    ],
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
      { text: "Skill %", value: "skill.perc" },
      { text: "Skill Point", value: "skill.point" },
    ],
    versions: GITADORA_VERSION_DATA,
  },
  {
    id: GameConstants.GITADORA_GF,
    name: "GITADORA (Guitar)",
    icon: null,
    cardBG: null,
    noRivals: true,
    playerHeaders: [
      {
        text: "SKILL POINT",
        value: "skill.point",
        sortable: true,
        width: 150,
      },
    ],
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
      { text: "Skill %", value: "skill.perc" },
      { text: "Skill Point", value: "skill.point" },
    ],
    versions: GITADORA_VERSION_DATA,
  },
  {
    id: GameConstants.GUITARFREAKS,
    name: "GUITAR FREAKS",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
      { text: "Skill %", value: "skill.perc" },
      { text: "Skill Point", value: "skill.point" },
    ],
    playerHeaders: [
      { text: "SKILL LEVEL", value: "skill.level", sortable: true, width: 120 },
      {
        text: "SKILL POINT",
        value: "skill.point",
        sortable: true,
        width: 150,
      },
    ],
    versions: [
      {
        id: VersionConstants.GUITARFREAKS_1ST,
        label: "1ST MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_2ND,
        label: "2ND MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_3RD,
        label: "3RD MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_4TH,
        label: "4TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_5TH,
        label: "5TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_6TH,
        label: "6TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_7TH,
        label: "7TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_8TH,
        label: "8TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_9TH,
        label: "9TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_10TH,
        label: "10TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_11TH,
        label: "11TH MIX",
      },
      {
        id: VersionConstants.GUITARFREAKS_V,
        label: "V",
      },
      {
        id: VersionConstants.GUITARFREAKS_V2,
        label: "V2",
      },
      {
        id: VersionConstants.GUITARFREAKS_V3,
        label: "V3",
      },
      {
        id: VersionConstants.GUITARFREAKS_V4,
        label: "V4: ROCKxROCK",
      },
      {
        id: VersionConstants.GUITARFREAKS_V5,
        label: "V5: ROCK TO INFINITY!",
      },
      {
        id: VersionConstants.GUITARFREAKS_V6,
        label: "V6: BLAZING!!!!",
      },
      {
        id: VersionConstants.GUITARFREAKS_V7,
        label: "V7",
      },
      {
        id: VersionConstants.GUITARFREAKS_V8,
        label: "V8",
      },
    ],
  },
  {
    id: GameConstants.IIDX,
    name: "beatmaniaIIDX",
    shortName: "IIDX",
    icon: "/assets/icon/iidx.png",
    cardBG: "/assets/card/iidx.png",
    scoreHeaders: [
      { text: "EX Score", value: "exscore" },
      { text: "Combos", value: "combo" },
      { text: "Misses", value: "misses" },
      { text: "Halo", value: "halo" },
      { text: "Gauge %", value: "gauge" },
    ],
    playerHeaders: [
      { text: "SP DAN", value: "sgrade", width: 100 },
      { text: "DP DAN", value: "dgrade", width: 100 },
      {
        text: "SP DJPOINT",
        value: "stats.single_dj_points",
        sortable: true,
        width: 150,
      },
      {
        text: "DP DJPOINT",
        value: "stats.double_dj_points",
        sortable: true,
        width: 150,
      },
    ],
    versions: [
      {
        id: VersionConstants.IIDX,
        label: "1st Style",
      },
      {
        id: VersionConstants.IIDX_2ND_STYLE,
        label: "2nd Style",
      },
      {
        id: VersionConstants.IIDX_3RD_STYLE,
        label: "3rd Style",
      },
      {
        id: VersionConstants.IIDX_4TH_STYLE,
        label: "4th Style",
      },
      {
        id: VersionConstants.IIDX_5TH_STYLE,
        label: "5th Style",
      },
      {
        id: VersionConstants.IIDX_6TH_STYLE,
        label: "6th Style",
      },
      {
        id: VersionConstants.IIDX_7TH_STYLE,
        label: "7th Style",
      },
      {
        id: VersionConstants.IIDX_8TH_STYLE,
        label: "8th Style",
      },
      {
        id: VersionConstants.IIDX_9TH_STYLE,
        label: "9th Style",
      },
      {
        id: VersionConstants.IIDX_10TH_STYLE,
        label: "10th Style",
      },
      {
        id: VersionConstants.IIDX_RED,
        label: "RED",
      },
      {
        id: VersionConstants.IIDX_HAPPY_SKY,
        label: "HAPPY SKY",
      },
      {
        id: VersionConstants.IIDX_DISTORTED,
        label: "DistorteD",
      },
      {
        id: VersionConstants.IIDX_GOLD,
        label: "GOLD",
      },
      {
        id: VersionConstants.IIDX_DJ_TROOPERS,
        label: "DJ TROOPERS",
      },
      {
        id: VersionConstants.IIDX_EMPRESS,
        label: "EMPRESS",
      },
      {
        id: VersionConstants.IIDX_SIRIUS,
        label: "SIRIUS",
      },
      {
        id: VersionConstants.IIDX_RESORT_ANTHEM,
        label: "Resort Anthem",
      },
      {
        id: VersionConstants.IIDX_LINCLE,
        label: "Lincle",
      },
      {
        id: VersionConstants.IIDX_TRICORO,
        label: "tricoro",
      },
      {
        id: VersionConstants.IIDX_SPADA,
        label: "SPADA",
      },
      {
        id: VersionConstants.IIDX_PENDUAL,
        label: "PENDUAL",
      },
      {
        id: VersionConstants.IIDX_COPULA,
        label: "COPULA",
      },
      {
        id: VersionConstants.IIDX_SINOBUZ,
        label: "SINOBUZ",
      },
      {
        id: VersionConstants.IIDX_CANNON_BALLERS,
        label: "CANNON BALLERS",
      },
      {
        id: VersionConstants.IIDX_ROOTAGE,
        label: "ROOTAGE",
      },
      {
        id: VersionConstants.IIDX_HEROIC_VERSE,
        label: "HEROIC VERSE",
      },
      {
        id: VersionConstants.IIDX_BISTROVER,
        label: "BISTROVER",
      },
      {
        id: VersionConstants.IIDX_CASTHOUR,
        label: "CastHour",
      },
      {
        id: VersionConstants.IIDX_RESIDENT,
        label: "RESIDENT",
      },
    ],
  },
  {
    id: GameConstants.IIDXCLASS,
    name: "Classic IIDX",
    icon: "/assets/icon/iidx.png",
    cardBG: "/assets/card/iidx.png",
    noRivals: true,
    noScores: true,
    noRecords: true,
    playerHeaders: [
      { text: "SP DAN", value: "sgrade", width: 100 },
      { text: "DP DAN", value: "dgrade", width: 100 },
      {
        text: "SP DJPOINT",
        value: "stats.single_dj_points",
        sortable: true,
        width: 150,
      },
      {
        text: "DP DJPOINT",
        value: "stats.double_dj_points",
        sortable: true,
        width: 150,
      },
    ],
    versions: [
      {
        id: VersionConstants.IIDX,
        label: "1st Style",
      },
      {
        id: VersionConstants.IIDX_2ND_STYLE,
        label: "2nd Style",
      },
      {
        id: VersionConstants.IIDX_3RD_STYLE,
        label: "3rd Style",
      },
      {
        id: VersionConstants.IIDX_4TH_STYLE,
        label: "4th Style",
      },
      {
        id: VersionConstants.IIDX_5TH_STYLE,
        label: "5th Style",
      },
      {
        id: VersionConstants.IIDX_6TH_STYLE,
        label: "6th Style",
      },
      {
        id: VersionConstants.IIDX_7TH_STYLE,
        label: "7th Style",
      },
      {
        id: VersionConstants.IIDX_8TH_STYLE,
        label: "8th Style",
      },
      {
        id: VersionConstants.IIDX_9TH_STYLE,
        label: "9th Style",
      },
      {
        id: VersionConstants.IIDX_10TH_STYLE,
        label: "10th Style",
      },
      {
        id: VersionConstants.IIDX_RED,
        label: "RED",
      },
      {
        id: VersionConstants.IIDX_HAPPY_SKY,
        label: "HAPPY SKY",
      },
      {
        id: VersionConstants.IIDX_DISTORTED,
        label: "DistorteD",
      },
      {
        id: VersionConstants.IIDX_GOLD,
        label: "GOLD",
      },
      {
        id: VersionConstants.IIDX_DJ_TROOPERS,
        label: "DJ TROOPERS",
      },
      {
        id: VersionConstants.IIDX_EMPRESS,
        label: "EMPRESS",
      },
      {
        id: VersionConstants.IIDX_SIRIUS,
        label: "SIRIUS",
      },
      {
        id: VersionConstants.IIDX_RESORT_ANTHEM,
        label: "Resort Anthem",
      },
      {
        id: VersionConstants.IIDX_LINCLE,
        label: "Lincle",
      },
    ],
  },
  {
    id: GameConstants.JUBEAT,
    name: "jubeat",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
      { text: "Music Rate", value: "rate" },
    ],
    playerHeaders: [
      { text: "Jubility", value: "jubility", sortable: true, width: 120 },
    ],
    versions: [
      {
        id: VersionConstants.JUBEAT,
        label: "Original",
      },
      {
        id: VersionConstants.JUBEAT_RIPPLES,
        label: "Ripples",
      },
      {
        id: VersionConstants.JUBEAT_RIPPLES_APPEND,
        label: "Ripples (Append)",
      },
      {
        id: VersionConstants.JUBEAT_KNIT,
        label: "Knit",
      },
      {
        id: VersionConstants.JUBEAT_KNIT_APPEND,
        label: "Knit (Append)",
      },
      {
        id: VersionConstants.JUBEAT_COPIOUS,
        label: "Copious",
      },
      {
        id: VersionConstants.JUBEAT_COPIOUS_APPEND,
        label: "Copious (Append)",
      },
      {
        id: VersionConstants.JUBEAT_SAUCER,
        label: "Saucer",
      },
      {
        id: VersionConstants.JUBEAT_SAUCER_FULFILL,
        label: "Saucer Fulfill",
      },
      {
        id: VersionConstants.JUBEAT_PROP,
        label: "Prop",
      },
      {
        id: VersionConstants.JUBEAT_QUBELL,
        label: "Qubell",
      },
      {
        id: VersionConstants.JUBEAT_CLAN,
        label: "Clan",
      },
      {
        id: VersionConstants.JUBEAT_FESTO,
        label: "Festo",
      },
      {
        id: VersionConstants.JUBEAT_AVE,
        label: "Avenue",
      },
    ],
  },
  {
    id: GameConstants.LOVEPLUS,
    name: "LovePlus",
    icon: null,
    cardBG: null,
    noRivals: true,
    noScores: true,
    noRecords: true,
    skip: true,
    playerHeaders: [
      { text: "Girlfriend", value: "gf", sortable: true, width: 100 },
    ],
    versions: [
      {
        id: VersionConstants.LOVEPLUS_ARCADE,
        label: "Medal",
      },
      {
        id: VersionConstants.LOVEPLUS_CC,
        label: "Colorful Clip",
      },
    ],
  },
  {
    id: GameConstants.MGA,
    name: "Metal Gear Arcade",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.MUSECA,
    name: "Museca",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.MUSECA,
        label: "Original",
      },
      {
        id: VersionConstants.MUSECA_1_PLUS,
        label: "1 + 1/2",
      },
    ],
  },
  {
    id: GameConstants.NOSTALGIA,
    name: "Nostalgia",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.NOSTALGIA,
        label: "Original",
      },
      {
        id: VersionConstants.NOSTALGIA_FORTE,
        label: "Forte",
      },
      {
        id: VersionConstants.NOSTALGIA_OP_2,
        label: "OP.2",
      },
      {
        id: VersionConstants.NOSTALGIA_OP_3,
        label: "OP.3",
      },
    ],
  },
  {
    id: GameConstants.OTOMEDIUS,
    name: "Otomedius",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.OTOCA,
    name: "Otoca d' Or",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.POPN_HELLO,
    name: "Hello! Pop'n Music",
    icon: "/assets/icon/popn.png",
    cardBG: "/assets/card/popn.png",
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.POPN_MUSIC,
    name: "pop'n music",
    shortName: "pop'n",
    icon: "/assets/icon/popn.png",
    cardBG: "/assets/card/popn.png",
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.POPN_MUSIC,
        label: "Original",
      },
      {
        id: VersionConstants.POPN_MUSIC_2,
        label: "2",
      },
      {
        id: VersionConstants.POPN_MUSIC_3,
        label: "3",
      },
      {
        id: VersionConstants.POPN_MUSIC_4,
        label: "4",
      },
      {
        id: VersionConstants.POPN_MUSIC_5,
        label: "5",
      },
      {
        id: VersionConstants.POPN_MUSIC_6,
        label: "6",
      },
      {
        id: VersionConstants.POPN_MUSIC_7,
        label: "7",
      },
      {
        id: VersionConstants.POPN_MUSIC_8,
        label: "8",
      },
      {
        id: VersionConstants.POPN_MUSIC_9,
        label: "9",
      },
      {
        id: VersionConstants.POPN_MUSIC_10,
        label: "10",
      },
      {
        id: VersionConstants.POPN_MUSIC_11,
        label: "11",
      },
      {
        id: VersionConstants.POPN_MUSIC_IROHA,
        label: "いろは (Iroha)",
      },
      {
        id: VersionConstants.POPN_MUSIC_CARNIVAL,
        label: "カーニバル (Carnival)",
      },
      {
        id: VersionConstants.POPN_MUSIC_FEVER,
        label: "FEVER!",
      },
      {
        id: VersionConstants.POPN_MUSIC_ADVENTURE,
        label: "ADVENTURE",
      },
      {
        id: VersionConstants.POPN_MUSIC_PARTY,
        label: "PARTY♪",
      },
      {
        id: VersionConstants.POPN_MUSIC_THE_MOVIE,
        label: "THE MOVIE",
      },
      {
        id: VersionConstants.POPN_MUSIC_SENGOKU_RETSUDEN,
        label: "せんごく列伝 (Sengoku Retsuden)",
      },
      {
        id: VersionConstants.POPN_MUSIC_TUNE_STREET,
        label: "TUNE STREET",
      },
      {
        id: VersionConstants.POPN_MUSIC_FANTASIA,
        label: "fantasia",
      },
      {
        id: VersionConstants.POPN_MUSIC_SUNNY_PARK,
        label: "Sunny Park",
      },
      {
        id: VersionConstants.POPN_MUSIC_LAPISTORIA,
        label: "ラピストリア (Lapistoria)",
      },
      {
        id: VersionConstants.POPN_MUSIC_ECLALE,
        label: "éclale",
      },
      {
        id: VersionConstants.POPN_MUSIC_USANEKO,
        label: "うさぎと猫と少年の夢 (Usaneko)",
      },
      {
        id: VersionConstants.POPN_MUSIC_PEACE,
        label: "peace",
      },
      {
        id: VersionConstants.POPN_MUSIC_KAIMEI_RIDDLES,
        label: "解明リドルズ (Kaimei riddles)",
      },
      {
        id: VersionConstants.POPN_MUSIC_UNILAB,
        label: "UniLab",
      },
    ],
  },
  {
    id: GameConstants.QMA,
    name: "Quiz Magic Academy",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.REFLEC_BEAT,
    name: "ReflecBeat",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Misses", value: "misses" },
      { text: "Halo", value: "halo" },
    ],
    versions: [
      {
        id: VersionConstants.REFLEC_BEAT,
        label: "Original",
      },
      {
        id: VersionConstants.REFLEC_BEAT_LIMELIGHT,
        label: "Limelight",
      },
      {
        id: VersionConstants.REFLEC_BEAT_COLETTE,
        label: "Colette",
      },
      {
        id: VersionConstants.REFLEC_BEAT_GROOVIN,
        label: "groovin'!!",
      },
      {
        id: VersionConstants.REFLEC_BEAT_VOLZZA,
        label: "VOLZZA",
      },
      {
        id: VersionConstants.REFLEC_BEAT_VOLZZA_2,
        label: "VOLZZA 2",
      },
    ],
  },
  {
    id: GameConstants.ROAD_FIGHTERS,
    name: "Road Fighters",
    icon: null,
    cardBG: null,
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
  {
    id: GameConstants.SDVX,
    name: "SOUND VOLTEX",
    shortName: "SDVX",
    icon: null,
    cardBG: null,
    scoreHeaders: [
      { text: "Combos", value: "combo" },
      { text: "Halo", value: "halo" },
    ],
    playerHeaders: [
      { text: "Skill Level", value: "skillLevel", sortable: true, width: 100 },
      { text: "VOLFORCE", value: "vf", sortable: true, width: 100 },
    ],
    versions: [
      {
        id: VersionConstants.SDVX_BOOTH,
        label: "BOOTH",
      },
      {
        id: VersionConstants.SDVX_INFINITE_INFECTION,
        label: "-II- Infinite Infection",
      },
      {
        id: VersionConstants.SDVX_GRAVITY_WARS,
        label: "GRAVITY WARS",
      },
      {
        id: VersionConstants.SDVX_HEAVENLY_HAVEN,
        label: "HEAVENLY HAVEN",
      },
      {
        id: VersionConstants.SDVX_VIVID_WAVE,
        label: "VIVID WAVE",
      },
      {
        id: VersionConstants.SDVX_EXCEED_GEAR,
        label: "EXCEED GEAR",
      },
    ],
  },
  {
    id: GameConstants.TSUMTSUM,
    name: "Tsum Tsum",
    icon: "/assets/icon/tsum.png",
    cardBG: "/assets/card/tsum.png",
    skip: false,
    noRivals: true,
    noScores: false,
    noRecords: true,
  },
  {
    id: GameConstants.ROAD_FIGHTERS,
    name: "Road Fighters 3D",
    icon: "/assets/icon/rf.png",
    cardBG: "/assets/card/rf.png",
    skip: true,
    noRivals: true,
    noScores: true,
    noRecords: true,
  },
];

export function getGameInfo(game) {
  var requestedData = gameData.find((item) => item.id === game);

  // try finding by game's name.
  if (!requestedData) {
    requestedData = gameData.find((item) => item.name === game);
  }

  if (!requestedData) {
    return null;
  }

  if (!requestedData.icon) {
    requestedData.icon = `/assets/icon/${game}.png`;
  }
  if (!requestedData.cardBG) {
    requestedData.cardBG = `/assets/card/${game}.png`;
  }
  return requestedData;
}

export function getGameTitle(game, version) {
  const gameObject = gameData.find((x) => x.id == game);
  var output = gameObject.name;

  const versions = gameObject.versions;
  if (versions !== null) {
    const thisVersion = versions.find((x) => x.id == version);
    if (thisVersion !== undefined) {
      output += ` ${thisVersion.name}`;
    }
  }

  return output;
}
