import type { TAndroidtvKeyCommand } from './androidtv.types.js';

export const androidtvDefaultPort = 5555;
export const androidtvDefaultAdbServerPort = 5037;

export const androidtvKeyCodes: Record<TAndroidtvKeyCommand, number> = {
  BACK: 4,
  BLUE: 186,
  CENTER: 23,
  COMPONENT1: 249,
  COMPONENT2: 250,
  COMPOSITE1: 247,
  COMPOSITE2: 248,
  DOWN: 20,
  END: 123,
  ENTER: 66,
  ESCAPE: 111,
  FAST_FORWARD: 90,
  GREEN: 184,
  HDMI1: 243,
  HDMI2: 244,
  HDMI3: 245,
  HDMI4: 246,
  HOME: 3,
  INPUT: 178,
  LEFT: 21,
  MENU: 82,
  MOVE_HOME: 122,
  MUTE: 164,
  PAIRING: 225,
  POWER: 26,
  RED: 183,
  RESUME: 224,
  REWIND: 89,
  RIGHT: 22,
  SAT: 237,
  SEARCH: 84,
  SETTINGS: 176,
  SLEEP: 223,
  SUSPEND: 276,
  SYSDOWN: 281,
  SYSLEFT: 282,
  SYSRIGHT: 283,
  SYSUP: 280,
  TEXT: 233,
  TOP: 122,
  UP: 19,
  VGA: 251,
  VOLUME_DOWN: 25,
  VOLUME_UP: 24,
  WAKEUP: 224,
  YELLOW: 185,
};

export const androidtvKnownApps: Record<string, string> = {
  'com.amazon.avod': 'Amazon Video',
  'com.amazon.avod.thirdpartyclient': 'Amazon Prime Video',
  'com.amazon.firetv.youtube': 'YouTube (FireTV)',
  'com.amazon.tv.launcher': 'Fire TV Launcher',
  'com.android.tv.settings': 'Settings',
  'com.disney.disneyplus': 'Disney+',
  'com.google.android.apps.tv.launcherx': 'Google TV Launcher',
  'com.google.android.tvlauncher': 'Android TV Launcher',
  'com.google.android.youtube.tv': 'YouTube',
  'com.google.android.youtube.tvkids': 'YouTube Kids',
  'com.google.android.youtube.tvmusic': 'YouTube Music',
  'com.hbo.hbonow': 'HBO Max',
  'com.hulu.plus': 'Hulu',
  'com.netflix.ninja': 'Netflix',
  'com.plexapp.android': 'Plex',
  'com.spotify.tv.android': 'Spotify',
  'org.jellyfin.androidtv': 'Jellyfin',
  'org.videolan.vlc': 'VLC',
  'org.xbmc.kodi': 'Kodi',
  'tv.twitch.android.app': 'Twitch',
};
