#include "AppStatsEvents.h"

// MEGA Desktop App ranges:
//   [99500, 99599]
//   [600000, 699999]
QMap<AppStatsEvents::EventType, int> AppStatsEvents::mTypeMap = {
    {AppStatsEvents::EventType::NONE, 0},
    {AppStatsEvents::EventType::FIRST_START, 99500},
    {AppStatsEvents::EventType::FIRST_SYNC, 99501},
    {AppStatsEvents::EventType::FIRST_SYNCED_FILE, 99502},
    {AppStatsEvents::EventType::FIRST_WEBCLIENT_DL, 99503},
    {AppStatsEvents::EventType::UNINSTALL, 99504},
    {AppStatsEvents::EventType::ACC_CREATION_START, 99505},
    //{ (Deprecated)                                                       , 99506 },
    //{ (Deprecated)                                                       , 99507 },
    {AppStatsEvents::EventType::PRO_REDIRECT, 99508},
    {AppStatsEvents::EventType::MEM_USAGE, 99509},
    {AppStatsEvents::EventType::UPDATE, 99510},
    {AppStatsEvents::EventType::UPDATE_OK, 99511},
    //{ (Deprecated)                                                       , 99513 },
    //{ (Deprecated)                                                       , 99514 },
    //{ (Deprecated)                                                       , 99515 },
    //{ (Deprecated)                                                       , 99516 },
    //{ (Deprecated)                                                       , 99517 },
    {AppStatsEvents::EventType::OVER_STORAGE_DIAL, 99518},
    {AppStatsEvents::EventType::OVER_STORAGE_NOTIF, 99519},
    {AppStatsEvents::EventType::OVER_STORAGE_MSG, 99520},
    {AppStatsEvents::EventType::ALMOST_OVER_STORAGE_MSG, 99521},
    {AppStatsEvents::EventType::ALMOST_OVER_STORAGE_NOTIF, 99522},
    {AppStatsEvents::EventType::MAIN_DIAL_WHILE_OVER_QUOTA, 99523},
    {AppStatsEvents::EventType::MAIN_DIAL_WHILE_ALMOST_OVER_QUOTA, 99524},
    {AppStatsEvents::EventType::RED_LIGHT_USED_STORAGE_MISMATCH, 99525},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_DIAL, 99526},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_NOTIF, 99527},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_MSG, 99528},
    {AppStatsEvents::EventType::TRSF_ALMOST_OVER_QUOTA_MSG, 99529},
    {AppStatsEvents::EventType::PAYWALL_NOTIF, 99530},
    {AppStatsEvents::EventType::SYNC_ADD_FAIL_API_EACCESS, 99531},
    {AppStatsEvents::EventType::TRSF_ALMOST_OVERQUOTA_NOTIF, 99532},
    {AppStatsEvents::EventType::FIRST_BACKUP, 99533},
    {AppStatsEvents::EventType::FIRST_BACKED_UP_FILE, 99534},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_MANUALLY, 99535},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_AUTOMATICALLY, 99536},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_SEMI_AUTOMATICALLY, 99537},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_MANUALLY, 99538},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_AUTOMATICALLY, 99539},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_SEMI_AUTOMATICALLY, 99540},
    {AppStatsEvents::EventType::SI_IGNORE_SOLVED_MANUALLY, 99541},
    {AppStatsEvents::EventType::SI_STALLED_ISSUE_RECEIVED, 99542},
    {AppStatsEvents::EventType::SI_IGNORE_ALL_SYMLINK, 99543},
    {AppStatsEvents::EventType::SI_SMART_MODE_FIRST_SELECTED, 99544},
    {AppStatsEvents::EventType::SI_ADVANCED_MODE_FIRST_SELECTED, 99545},
    {AppStatsEvents::EventType::SI_CHANGE_TO_SMART_MODE, 99546},
    {AppStatsEvents::EventType::SI_CHANGE_TO_ADVANCED_MODE, 99547},
    {AppStatsEvents::EventType::SI_FINGERPRINT_MISSING_SOLVED_MANUALLY, 99548},
    {AppStatsEvents::EventType::SI_MOVERENAME_CANNOT_OCCUR_SOLVED_MANUALLY, 99549},
    {AppStatsEvents::EventType::SI_UNKNOWN_DOWNLOAD_ISSUE_SOLVED_BY_FEEDBACK, 99550},
    //{ (Stalled issues reserved)                                          , 99552 },
    //{ (Stalled issues reserved)                                          , 99553 },
    //{ (Stalled issues reserved)                                          , 99554 },
    //{ (Stalled issues reserved)                                          , 99555 },
    //{ (Stalled issues reserved)                                          , 99556 },
    //{ (Stalled issues reserved)                                          , 99557 },
    //{ (Stalled issues reserved)                                          , 99558 },
    //{ (Stalled issues reserved)                                          , 99559 },
    //{ (Stalled issues reserved)                                          , 99560 },
    //{ (Stalled issues reserved)                                          , 99561 },
    //{ (Stalled issues reserved)                                          , 99562 },
    //{ (Stalled issues reserved)                                          , 99563 },
    //{ (Stalled issues reserved)                                          , 99564 },
    //{ (Stalled issues reserved)                                          , 99565 },
    {AppStatsEvents::EventType::DAILY_ACTIVE_USER, 99566},
    {AppStatsEvents::EventType::MONTHLY_ACTIVE_USER, 99567},
    {AppStatsEvents::EventType::LOGIN_CLICKED, 99568},
    {AppStatsEvents::EventType::LOGOUT_CLICKED, 99569},
    {AppStatsEvents::EventType::TRANSFER_TAB_CLICKED, 99570},
    {AppStatsEvents::EventType::NOTIFICATION_TAB_CLICKED, 99571},
    {AppStatsEvents::EventType::NOTIFICATION_SETTINGS_CLICKED, 99572},
    {AppStatsEvents::EventType::UPGRADE_ACCOUNT_CLICKED, 99573},
    {AppStatsEvents::EventType::OPEN_TRANSFER_MANAGER_CLICKED, 99574},
    //{ (Deprecated)                                                       , 99575},
    {AppStatsEvents::EventType::ADD_BACKUP_CLICKED, 99576},
    {AppStatsEvents::EventType::UPLOAD_CLICKED, 99577},
    {AppStatsEvents::EventType::AVATAR_CLICKED, 99578},
    {AppStatsEvents::EventType::MENU_CLICKED, 99579},
    {AppStatsEvents::EventType::MENU_ABOUT_CLICKED, 99580},
    {AppStatsEvents::EventType::MENU_CLOUD_DRIVE_CLICKED, 99581},
    {AppStatsEvents::EventType::MENU_ADD_SYNC_CLICKED, 99582},
    {AppStatsEvents::EventType::MENU_ADD_BACKUP_CLICKED, 99583},
    {AppStatsEvents::EventType::MENU_OPEN_LINKS_CLICKED, 99584},
    {AppStatsEvents::EventType::MENU_UPLOAD_CLICKED, 99585},
    {AppStatsEvents::EventType::MENU_DOWNLOAD_CLICKED, 99586},
    {AppStatsEvents::EventType::MENU_STREAM_CLICKED, 99587},
    {AppStatsEvents::EventType::MENU_SETTINGS_CLICKED, 99588},
    {AppStatsEvents::EventType::MENU_EXIT_CLICKED, 99589},
    {AppStatsEvents::EventType::SETTINGS_GENERAL_TAB_CLICKED, 99590},
    {AppStatsEvents::EventType::SETTINGS_ACCOUNT_TAB_CLICKED, 99591},
    {AppStatsEvents::EventType::SETTINGS_SYNC_TAB_CLICKED, 99592},
    {AppStatsEvents::EventType::SETTINGS_BACKUP_TAB_CLICKED, 99593},
    {AppStatsEvents::EventType::SETTINGS_SECURITY_TAB_CLICKED, 99594},
    {AppStatsEvents::EventType::SETTINGS_FOLDERS_TAB_CLICKED, 99595},
    {AppStatsEvents::EventType::SETTINGS_NETWORK_TAB_CLICKED, 99596},
    {AppStatsEvents::EventType::SETTINGS_NOTIFICATIONS_TAB_CLICKED, 99597},
    {AppStatsEvents::EventType::SETTINGS_EXPORT_KEY_CLICKED, 99598},
    {AppStatsEvents::EventType::SETTINGS_CHANGE_PASSWORD_CLICKED, 99599},
    {AppStatsEvents::EventType::SETTINGS_REPORT_ISSUE_CLICKED, 600000},
    {AppStatsEvents::EventType::NOTIFICATION_DISPLAYED, 600001},
    {AppStatsEvents::EventType::NOTIFICATION_CTA_CLICKED, 600002},
    {AppStatsEvents::EventType::ONBOARDING_CLOSED_WITHOUT_SETTING_SYNCS, 600003},
    {AppStatsEvents::EventType::FIRST_SYNC_FROM_ONBOARDING, 600004},
    {AppStatsEvents::EventType::FIRST_BACKUP_FROM_ONBOARDING, 600005},
    {AppStatsEvents::EventType::DEVICE_CENTRE_RENAME_ICON_CLICKED, 600006},
    {AppStatsEvents::EventType::RENAME_DIALOG_RENAME_BUTTON_CLICKED, 600007},
    {AppStatsEvents::EventType::RENAME_DIALOG_CANCEL_BUTTON_CLICKED, 600008},
    {AppStatsEvents::EventType::DEVICE_CENTRE_ADD_BACKUP_BUTTON_CLICKED, 600009},
    {AppStatsEvents::EventType::DEVICE_CENTRE_ADD_SYNC_BUTTON_CLICKED, 600010},
    {AppStatsEvents::EventType::DEVICE_CENTRE_CONTEXT_MENU_TRIGGERED, 600011},
    {AppStatsEvents::EventType::DEVICE_CENTRE_PAUSE_ACTION_TIGGERED, 600012},
    {AppStatsEvents::EventType::DEVICE_CENTRE_RESUME_ACTION_TRIGGERED, 600013},
    {AppStatsEvents::EventType::DEVICE_CENTRE_STOP_BACKUP_ACTION_TRIGGERED, 600014},
    {AppStatsEvents::EventType::MENU_DEVICE_CENTRE_CLICKED, 600015},
    {AppStatsEvents::EventType::TRAY_ICON_TRIGGERED, 600016},
    {AppStatsEvents::EventType::DELETE_REMOVED_BAKCUP_CLICKED, 600017},
    {AppStatsEvents::EventType::MOVE_REMOVED_BACKUP_FOLDER, 600018},
    {AppStatsEvents::EventType::CONFIRM_REMOVE_BACKUP, 600019},
    {AppStatsEvents::EventType::DEVICE_CENTRE_SYNC_ROW_DOUBLE_CLICKED, 600020},
    {AppStatsEvents::EventType::UPSELL_DIALOG_STORAGE_FULL_SHOWN, 600021},
    {AppStatsEvents::EventType::UPSELL_DIALOG_STORAGE_ALMOST_FULL_SHOWN, 600022},
    {AppStatsEvents::EventType::UPSELL_DIALOG_TX_QUOTA_EXCEEDED_SHOWN, 600023},
    {AppStatsEvents::EventType::UPSELL_DIALOG_LEARN_MORE_TX_QUOTA_CLICKED, 600024},
    //{ (Deprecated) UPSELL_DIALOG_EMPTY_RUBBISH_BIN_CLICKED, 600025 },
    {AppStatsEvents::EventType::UPSELL_DIALOG_TRY_PRO_FLEXI_CLICKED, 600026},
    {AppStatsEvents::EventType::UPSELL_DIALOG_BILLED_MONTHLY_CLICKED, 600027},
    {AppStatsEvents::EventType::UPSELL_DIALOG_BILLED_YEARLY_CLICKED, 600028},
    {AppStatsEvents::EventType::UPSELL_DIALOG_PLAN_BUTTON_CLICKED, 600029},
    {AppStatsEvents::EventType::INFO_DIALOG_ADD_SYNC_CLICKED, 600030},
    {AppStatsEvents::EventType::SYNC_ADDED_ADD_SYNC_BUTTON, 600031},
    {AppStatsEvents::EventType::FIRST_SYNC_NOTIFICATION_SHOWN, 600032},
    {AppStatsEvents::EventType::SECOND_SYNC_NOTIFICATION_SHOWN, 600033},
    {AppStatsEvents::EventType::MONTHLY_SYNC_NOTIFICATION_SHOWN, 600034},
    {AppStatsEvents::EventType::BIMONTHLY_SYNC_NOTIFICATION_SHOWN, 600035},
    {AppStatsEvents::EventType::SYNC_CREATED_AFTER_CLICKING_NOTIFICATION, 600036},
    {AppStatsEvents::EventType::SYNC_CREATED_AFTER_NOTIFICATION, 600037},
    {AppStatsEvents::EventType::SYNC_ADDED_CLOUD_DRIVE_BUTTON, 600038},
    {AppStatsEvents::EventType::CLOUD_DRIVE_OPENED, 600039},
    {AppStatsEvents::EventType::UPSELL_DIALOG_AFTER_ANY_PLAN_CLOSE_BUTTON_CLICKED, 600040},
    {AppStatsEvents::EventType::UPSELL_DIALOG_WITHOUT_ANY_PLAN_CLOSE_BUTTON_CLICKED, 600041},
    {AppStatsEvents::EventType::SYNC_ADDED_SETTINGS, 600042},
    {AppStatsEvents::EventType::SYNC_ADDED_WEBCLIENT, 600043},
    {AppStatsEvents::EventType::SYNC_ADDED_CONTEXT_MENU, 600044},
    {AppStatsEvents::EventType::SYNC_ADDED_ONBOARDING, 600045},
    {AppStatsEvents::EventType::SYNC_ADDED_OS_NOTIFICATION, 600046},
    {AppStatsEvents::EventType::SYNC_ADDED_MAIN_APP, 600047},
    {AppStatsEvents::EventType::CLOUD_DRIVE_HOURLY_ACTIVE_USERS, 600048},
    {AppStatsEvents::EventType::USER_ABORTS_ONBOARDING_SYNC_CREATION, 600049},
    {AppStatsEvents::EventType::MULTIPLE_SYNCS_CREATED_ON_ONBOARDING, 600050},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_DOWNLOAD_CLICKED, 600051},
    {AppStatsEvents::EventType::LINK_STREAM_STARTED, 600052},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_INFO_DIALOG, 600053},
    {AppStatsEvents::EventType::STORAGE_USAGE_CLICKED_INFO_DIALOG, 600054},
    {AppStatsEvents::EventType::NOTIFICATION_FILTERS_OPENED, 600055},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_ALL, 600056},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_CONTACTS, 600057},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_INCOMING_SHARES, 600058},
    {AppStatsEvents::EventType::BACKUP_ADDED_SHELL_EXTENSION, 600059},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_PAYMENTS, 600060},
    {AppStatsEvents::EventType::NOTIFICATION_ITEM_CLICKED, 600061},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_SETTINGS, 600062},
    {AppStatsEvents::EventType::SETTINGS_MY_ACCOUNT_CLICKED, 600063},
    {AppStatsEvents::EventType::SETTINGS_DETAILS_CLICKED, 600064},
    {AppStatsEvents::EventType::BACKUP_CHECKBOX_TOGGLED, 600065},
    {AppStatsEvents::EventType::SYNC_CHECKBOX_TOGGLED, 600066},
    {AppStatsEvents::EventType::SETTINGS_PERMISSIONS_CLICKED, 600067},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_INFO_DIALOG_OVER_QUOTA_WARNING, 600068},
    {AppStatsEvents::EventType::BACKUP_ADDED_SETTINGS, 600069},
    {AppStatsEvents::EventType::BACKUP_ADDED_CONTEXT_MENU, 600070},
    {AppStatsEvents::EventType::BACKUP_ADDED_ONBOARDING, 600071},
    {AppStatsEvents::EventType::BACKUP_ADDED_MAIN_APP, 600072},
    {AppStatsEvents::EventType::BACKUP_ADDED_WEBCLIENT, 600073},
    {AppStatsEvents::EventType::SETTINGS_ISSUE_RESOLUTION_SMART, 600074},
    {AppStatsEvents::EventType::SETTINGS_ISSUE_RESOLUTION_ADVANCED, 600075},
    {AppStatsEvents::EventType::SETTINGS_VIEW_BACKUP_CLICKED, 600076},
    {AppStatsEvents::EventType::SETTINGS_DEVICE_CENTER_CLICKED, 600077},
    {AppStatsEvents::EventType::SETTINGS_SESSION_HISTORY_CLICKED, 600078},
    {AppStatsEvents::EventType::CLOUD_DRIVE_UPLOAD_CLICKED, 600079},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_OPEN_LINKS_CLICKED, 600080},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_UPLOAD_CLICKED, 600081},
    {AppStatsEvents::EventType::INFO_DIALOG_UPLOAD_CLICKED, 600082},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_PAUSE_RESUME_CLICKED, 600083},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_SETTINGS_CLICKED, 600084},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_CAMPAIGN_STARTED, 600085},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_CAMPAIGN_STOPPED, 600086},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_SHOWN, 600087},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_DISMISSED, 600088},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_DEAL_GRABBED, 600089},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_INFODIALOG_BUTTON_CLICKED, 600090},
    {AppStatsEvents::EventType::MACOS_ARM64_UPDATE_URL_ADJUSTED_FOR_INTEL_BINARY, 600091}};

// Deprecated are not displayed
QMap<AppStatsEvents::EventType, const char*> AppStatsEvents::mMessageMap = {
    {AppStatsEvents::EventType::FIRST_START, "MEGAsync first start"},
    {AppStatsEvents::EventType::FIRST_SYNC, "MEGAsync first sync"},
    {AppStatsEvents::EventType::FIRST_SYNCED_FILE, "MEGAsync first synced file"},
    {AppStatsEvents::EventType::FIRST_WEBCLIENT_DL, "MEGAsync first webclient download"},
    {AppStatsEvents::EventType::UNINSTALL, "{\"it\":%1,\"act\":%2,\"lt\":%3}"},
    {AppStatsEvents::EventType::ACC_CREATION_START, "MEGAsync account creation start"},
    {AppStatsEvents::EventType::PRO_REDIRECT, "Redirection to PRO"},
    {AppStatsEvents::EventType::MEM_USAGE, "%1 %2 %3"},
    {AppStatsEvents::EventType::UPDATE, "MEGAsync update"},
    {AppStatsEvents::EventType::UPDATE_OK, "MEGAsync updated OK"},
    {AppStatsEvents::EventType::OVER_STORAGE_DIAL, "Overstorage dialog shown"},
    {AppStatsEvents::EventType::OVER_STORAGE_NOTIF, "Overstorage notification shown"},
    {AppStatsEvents::EventType::OVER_STORAGE_MSG, "Overstorage warning shown"},
    {AppStatsEvents::EventType::ALMOST_OVER_STORAGE_MSG, "Almost overstorage warning shown"},
    {AppStatsEvents::EventType::ALMOST_OVER_STORAGE_NOTIF, "Almost overstorage notification shown"},
    {AppStatsEvents::EventType::MAIN_DIAL_WHILE_OVER_QUOTA, "Main dialog shown while overquota"},
    {AppStatsEvents::EventType::MAIN_DIAL_WHILE_ALMOST_OVER_QUOTA,
     "Main dialog shown while almost overquota"},
    {AppStatsEvents::EventType::RED_LIGHT_USED_STORAGE_MISMATCH,
     "Red light does not match used storage"},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_DIAL, "Transfer over quota dialog shown"},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_NOTIF, "Transfer over quota os notification shown"},
    {AppStatsEvents::EventType::TRSF_OVER_QUOTA_MSG, "Transfer over quota ui message shown"},
    {AppStatsEvents::EventType::TRSF_ALMOST_OVER_QUOTA_MSG,
     "Transfer almost over quota ui message shown"},
    {AppStatsEvents::EventType::PAYWALL_NOTIF, "Paywall notification shown"},
    {AppStatsEvents::EventType::SYNC_ADD_FAIL_API_EACCESS, "Sync addition fails with API_EACCESS"},
    {AppStatsEvents::EventType::TRSF_ALMOST_OVERQUOTA_NOTIF,
     "Transfer almost over quota os notification shown"},
    {AppStatsEvents::EventType::FIRST_BACKUP, "MEGAsync first backup"},
    {AppStatsEvents::EventType::FIRST_BACKED_UP_FILE, "MEGAsync first backed-up file"},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_MANUALLY,
     "Name conflict issue solved manually"},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_AUTOMATICALLY,
     "Name conflict issue solved automatically"},
    {AppStatsEvents::EventType::SI_NAMECONFLICT_SOLVED_SEMI_AUTOMATICALLY,
     "Name conflict issue solved semi-automatically"},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_MANUALLY,
     "Local/Remote issue solved manually"},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_AUTOMATICALLY,
     "Local/Remote issue solved automatically"},
    {AppStatsEvents::EventType::SI_LOCALREMOTE_SOLVED_SEMI_AUTOMATICALLY,
     "Local/Remote issue solved semi-automatically"},
    {AppStatsEvents::EventType::SI_IGNORE_SOLVED_MANUALLY, "Issue ignored manually"},
    {AppStatsEvents::EventType::SI_STALLED_ISSUE_RECEIVED, "Stalled issue received: Type %1"},
    {AppStatsEvents::EventType::SI_IGNORE_ALL_SYMLINK, "All symlink ignored"},
    {AppStatsEvents::EventType::SI_SMART_MODE_FIRST_SELECTED, "Smart mode selected by default"},
    {AppStatsEvents::EventType::SI_ADVANCED_MODE_FIRST_SELECTED,
     "Advanced mode selected by default"},
    {AppStatsEvents::EventType::SI_CHANGE_TO_SMART_MODE, "Smart mode selected"},
    {AppStatsEvents::EventType::SI_CHANGE_TO_ADVANCED_MODE, "Advanced mode selected"},
    {AppStatsEvents::EventType::SI_FINGERPRINT_MISSING_SOLVED_MANUALLY,
     "Cloud fingerprint missing solved manually"},
    {AppStatsEvents::EventType::SI_MOVERENAME_CANNOT_OCCUR_SOLVED_MANUALLY,
     "Move or Rename Cannot Occur solved manually"},
    {AppStatsEvents::EventType::SI_UNKNOWN_DOWNLOAD_ISSUE_SOLVED_BY_FEEDBACK,
     "Unknown download issue solved manually by sending feedback"},
    {AppStatsEvents::EventType::DAILY_ACTIVE_USER, "Daily Active Users (DAU) - acctype: %1"},
    {AppStatsEvents::EventType::MONTHLY_ACTIVE_USER, "Monthly Active Users (MAU) - acctype: %1"},
    {AppStatsEvents::EventType::LOGIN_CLICKED, "Log in clicked"},
    {AppStatsEvents::EventType::LOGOUT_CLICKED, "Log out clicked"},
    {AppStatsEvents::EventType::TRANSFER_TAB_CLICKED, "Transfer tab clicked"},
    {AppStatsEvents::EventType::NOTIFICATION_TAB_CLICKED, "Notification tab clicked"},
    {AppStatsEvents::EventType::NOTIFICATION_SETTINGS_CLICKED,
     "Show notification settings clicked"},
    {AppStatsEvents::EventType::UPGRADE_ACCOUNT_CLICKED, "Upgrade account clicked"},
    {AppStatsEvents::EventType::OPEN_TRANSFER_MANAGER_CLICKED, "Open transfer manager clicked"},
    {AppStatsEvents::EventType::ADD_BACKUP_CLICKED, "Add backup clicked"},
    {AppStatsEvents::EventType::UPLOAD_CLICKED, "Upload clicked"},
    {AppStatsEvents::EventType::AVATAR_CLICKED, "Settings clicked (avatar)"},
    {AppStatsEvents::EventType::MENU_CLICKED, "Show options clicked"},
    {AppStatsEvents::EventType::MENU_ABOUT_CLICKED, "About clicked (menu)"},
    {AppStatsEvents::EventType::MENU_CLOUD_DRIVE_CLICKED, "Cloud drive clicked (menu)"},
    {AppStatsEvents::EventType::MENU_ADD_SYNC_CLICKED, "Add sync clicked (menu)"},
    {AppStatsEvents::EventType::MENU_ADD_BACKUP_CLICKED, "Add backup clicked (menu)"},
    {AppStatsEvents::EventType::MENU_OPEN_LINKS_CLICKED, "Open links clicked (menu)"},
    {AppStatsEvents::EventType::MENU_UPLOAD_CLICKED, "Upload clicked (menu)"},
    {AppStatsEvents::EventType::MENU_DOWNLOAD_CLICKED, "Download clicked (menu)"},
    {AppStatsEvents::EventType::MENU_STREAM_CLICKED, "Stream clicked (menu)"},
    {AppStatsEvents::EventType::MENU_SETTINGS_CLICKED, "Settings clicked (menu)"},
    {AppStatsEvents::EventType::MENU_EXIT_CLICKED, "Exit clicked (menu)"},
    {AppStatsEvents::EventType::SETTINGS_GENERAL_TAB_CLICKED, "Settings general tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_ACCOUNT_TAB_CLICKED, "Settings account tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_SYNC_TAB_CLICKED, "Settings sync tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_BACKUP_TAB_CLICKED, "Settings backup tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_SECURITY_TAB_CLICKED, "Settings security tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_FOLDERS_TAB_CLICKED, "Settings folders tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_NETWORK_TAB_CLICKED, "Settings network tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_NOTIFICATIONS_TAB_CLICKED,
     "Settings notifications tab clicked"},
    {AppStatsEvents::EventType::SETTINGS_EXPORT_KEY_CLICKED, "Settings export key clicked"},
    {AppStatsEvents::EventType::SETTINGS_CHANGE_PASSWORD_CLICKED,
     "Settings change password clicked"},
    {AppStatsEvents::EventType::SETTINGS_REPORT_ISSUE_CLICKED, "Settings report issue clicked"},
    {AppStatsEvents::EventType::NOTIFICATION_DISPLAYED, "Notification displayed - id: %1"},
    {AppStatsEvents::EventType::NOTIFICATION_CTA_CLICKED,
     "Notification CTA button clicked - id: %1"},
    {AppStatsEvents::EventType::ONBOARDING_CLOSED_WITHOUT_SETTING_SYNCS,
     "Onboarding closed without sync/backup"},
    {AppStatsEvents::EventType::FIRST_SYNC_FROM_ONBOARDING,
     "First sync created (from onboarding wizard)"},
    {AppStatsEvents::EventType::FIRST_BACKUP_FROM_ONBOARDING,
     "First backup created (from onboarding wizard)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_RENAME_ICON_CLICKED,
     "Rename device icon clicked (from Device centre wizard)"},
    {AppStatsEvents::EventType::RENAME_DIALOG_RENAME_BUTTON_CLICKED,
     "Rename device button clicked (from Rename device dialog wizard)"},
    {AppStatsEvents::EventType::RENAME_DIALOG_CANCEL_BUTTON_CLICKED,
     "Cancel rename device button clicked (from Rename device dialog wizard)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_ADD_BACKUP_BUTTON_CLICKED,
     "Add backup button clicked (from device centre dialog wizard)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_ADD_SYNC_BUTTON_CLICKED,
     "Add sync button clicked (from device centre dialog wizard)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_CONTEXT_MENU_TRIGGERED,
     "Sync context men triggered (from Device centre wizard)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_PAUSE_ACTION_TIGGERED,
     "Pause sync action triggered (from Device centre wizar)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_RESUME_ACTION_TRIGGERED,
     "Resume sync action triggered (from Device centre wizar)"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_STOP_BACKUP_ACTION_TRIGGERED,
     "Stop sync action triggered (from Device centre wizar)"},
    {AppStatsEvents::EventType::MENU_DEVICE_CENTRE_CLICKED, "Device centre button clicked(menu)"},
    {AppStatsEvents::EventType::TRAY_ICON_TRIGGERED, "Tray icon triggered"},
    {AppStatsEvents::EventType::DELETE_REMOVED_BAKCUP_CLICKED, "Delete removed backup folder"},
    {AppStatsEvents::EventType::MOVE_REMOVED_BACKUP_FOLDER, "Move removed backup folder"},
    {AppStatsEvents::EventType::CONFIRM_REMOVE_BACKUP, "Confirm remove backup"},
    {AppStatsEvents::EventType::DEVICE_CENTRE_SYNC_ROW_DOUBLE_CLICKED,
     "Sync table row double clicked (from Device centre wizar)"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_STORAGE_FULL_SHOWN, "Storage full dialog shown"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_STORAGE_ALMOST_FULL_SHOWN,
     "Storage almost full dialog shown"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_TX_QUOTA_EXCEEDED_SHOWN,
     "Transfer quota exceeded dialog shown"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_LEARN_MORE_TX_QUOTA_CLICKED,
     "Link learn more about transfer quota clicked"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_TRY_PRO_FLEXI_CLICKED,
     "Link try pro flexi clicked - view mode: %1"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_BILLED_MONTHLY_CLICKED,
     "Radio button billed monthly clicked - view mode: %1"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_BILLED_YEARLY_CLICKED,
     "Radio button billed yearly clicked - view mode: %1"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_PLAN_BUTTON_CLICKED,
     "Button buy plan clicked  - view mode: %1 - plan id: %2 - plan name: %3"},
    {AppStatsEvents::EventType::INFO_DIALOG_ADD_SYNC_CLICKED,
     "Create Sync button clicked (InfoDialog)"},
    {AppStatsEvents::EventType::SYNC_ADDED_ADD_SYNC_BUTTON, "Sync added from create sync button"},
    {AppStatsEvents::EventType::FIRST_SYNC_NOTIFICATION_SHOWN,
     "Sync reminder notification shown (2 hrs)"},
    {AppStatsEvents::EventType::SECOND_SYNC_NOTIFICATION_SHOWN,
     "Sync reminder notification shown (10 days)"},
    {AppStatsEvents::EventType::MONTHLY_SYNC_NOTIFICATION_SHOWN,
     "Sync reminder notification shown (1 month)"},
    {AppStatsEvents::EventType::BIMONTHLY_SYNC_NOTIFICATION_SHOWN,
     "Sync reminder notification shown (2 months)"},
    {AppStatsEvents::EventType::SYNC_CREATED_AFTER_CLICKING_NOTIFICATION,
     "Sync created after clicking the notification - notif clicked: %1"},
    {AppStatsEvents::EventType::SYNC_CREATED_AFTER_NOTIFICATION,
     "Sync created after 15 min - last notif shown: %1"},
    {AppStatsEvents::EventType::SYNC_ADDED_CLOUD_DRIVE_BUTTON,
     "Sync added from Cloud drive dialog"},
    {AppStatsEvents::EventType::CLOUD_DRIVE_OPENED, "Cloud drive dialog opened"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_AFTER_ANY_PLAN_CLOSE_BUTTON_CLICKED,
     "Upsell dialog closed after clicking any plan button"},
    {AppStatsEvents::EventType::UPSELL_DIALOG_WITHOUT_ANY_PLAN_CLOSE_BUTTON_CLICKED,
     "Upsell dialog closed without clicking any plan button"},
    {AppStatsEvents::EventType::SYNC_ADDED_SETTINGS, "Sync added from Settings "},
    {AppStatsEvents::EventType::SYNC_ADDED_WEBCLIENT, "Sync added from the Webclient"},
    {AppStatsEvents::EventType::SYNC_ADDED_CONTEXT_MENU, "Sync added from the context menu"},
    {AppStatsEvents::EventType::SYNC_ADDED_ONBOARDING, "Sync added from the Onboarding"},
    {AppStatsEvents::EventType::SYNC_ADDED_OS_NOTIFICATION, "Sync added from an OS notification"},
    {AppStatsEvents::EventType::SYNC_ADDED_MAIN_APP, "Sync added from main app"},
    {AppStatsEvents::EventType::CLOUD_DRIVE_HOURLY_ACTIVE_USERS,
     "Cloud Drive dialog hourly active users"},
    {AppStatsEvents::EventType::USER_ABORTS_ONBOARDING_SYNC_CREATION,
     "In the onboarding the user entered in the sync creation pages but it exited the process "
     "without any sync "
     "created."},
    {AppStatsEvents::EventType::MULTIPLE_SYNCS_CREATED_ON_ONBOARDING,
     "More than one sync has been created during onboarding."},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_DOWNLOAD_CLICKED,
     "Download clicked (transfer manager)."},
    {AppStatsEvents::EventType::LINK_STREAM_STARTED, "Streaming link started."},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_INFO_DIALOG, "Upgrade clicked (Info dialg)"},
    {AppStatsEvents::EventType::STORAGE_USAGE_CLICKED_INFO_DIALOG,
     "Storage usage clicked(Info Dialog)"},
    {AppStatsEvents::EventType::NOTIFICATION_FILTERS_OPENED,
     "Notification filter menu opened(Info Dialog)"},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_ALL,
     "Notification filter ALL selected(Info Dialog)"},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_CONTACTS,
     "Notification filter Contacts selected(Info Dialog)"},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_INCOMING_SHARES,
     "Notification filter Incoming shares selected(Info Dialog)"},
    {AppStatsEvents::EventType::BACKUP_ADDED_SHELL_EXTENSION, "Backup added from shell extension"},
    {AppStatsEvents::EventType::NOTIFICATION_FILTER_SELECTED_PAYMENTS,
     "Notification filter Payments selected(Info Dialog)"},
    {AppStatsEvents::EventType::NOTIFICATION_ITEM_CLICKED,
     "Notification item clicked (Info Dialog)"},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_SETTINGS, "Upgrade clicked (Settings)"},
    {AppStatsEvents::EventType::SETTINGS_MY_ACCOUNT_CLICKED, "My account clicked (Settings)"},
    {AppStatsEvents::EventType::SETTINGS_DETAILS_CLICKED, "Usage details clicked (Settings)"},
    {AppStatsEvents::EventType::BACKUP_CHECKBOX_TOGGLED, "Backup checkbox toggled (Settings)"},
    {AppStatsEvents::EventType::SYNC_CHECKBOX_TOGGLED, "Sync checkbox toggled (Settings)"},
    {AppStatsEvents::EventType::SETTINGS_PERMISSIONS_CLICKED,
     "Permissions button clicked (Settings)"},
    {AppStatsEvents::EventType::UPGRADE_CLICKED_INFO_DIALOG_OVER_QUOTA_WARNING,
     "Upgrade clicked (Info dialg, overquoa warning)"},
    {AppStatsEvents::EventType::BACKUP_ADDED_SETTINGS, "Backup added from settings"},
    {AppStatsEvents::EventType::BACKUP_ADDED_CONTEXT_MENU, "Backup added from context menu"},
    {AppStatsEvents::EventType::BACKUP_ADDED_ONBOARDING, "Backup added from onboarding"},
    {AppStatsEvents::EventType::BACKUP_ADDED_MAIN_APP, "Backup added from main app"},
    {AppStatsEvents::EventType::BACKUP_ADDED_WEBCLIENT, "Backup added from webclient"},
    {AppStatsEvents::EventType::SETTINGS_ISSUE_RESOLUTION_SMART,
     "Sync issue resolution mode changed to smart"},
    {AppStatsEvents::EventType::SETTINGS_ISSUE_RESOLUTION_ADVANCED,
     "Sync issue resolution mode set to advanced"},
    {AppStatsEvents::EventType::SETTINGS_VIEW_BACKUP_CLICKED, "View backup clicked (Settings)"},
    {AppStatsEvents::EventType::SETTINGS_DEVICE_CENTER_CLICKED, "Device centre clicked (Settings)"},
    {AppStatsEvents::EventType::SETTINGS_SESSION_HISTORY_CLICKED,
     "Session history clicked (Settings)"},
    {AppStatsEvents::EventType::CLOUD_DRIVE_UPLOAD_CLICKED, "Upload clicked (Cloud drive)"},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_OPEN_LINKS_CLICKED,
     "Open links clicked (Transfer manager)"},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_UPLOAD_CLICKED,
     "Upload clicked (Transfer manager)"},
    {AppStatsEvents::EventType::INFO_DIALOG_UPLOAD_CLICKED, "Upload clicked (Info dialog)"},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_PAUSE_RESUME_CLICKED,
     "Pause-Resume transfers clicked (Transfer manager)"},
    {AppStatsEvents::EventType::TRANSFER_MANAGER_SETTINGS_CLICKED,
     "Open settings clicked (Transfer manager)"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_CAMPAIGN_STARTED,
     "Targeted discount campaign started"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_CAMPAIGN_STOPPED,
     "Targeted discount campaign stopped"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_SHOWN, "Targeted discount dialog shown"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_DISMISSED,
     "Targeted discount dialog dismissed"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_DIALOG_DEAL_GRABBED,
     "Targeted discount deal grabbed"},
    {AppStatsEvents::EventType::TARGETED_DISCOUNT_INFODIALOG_BUTTON_CLICKED,
     "Targeted discount infodialog button clicked"},
    {AppStatsEvents::EventType::MACOS_ARM64_UPDATE_URL_ADJUSTED_FOR_INTEL_BINARY,
     "macOS arm64 update URL adjusted for Intel binary on Apple Silicon"}};

QString AppStatsEvents::getEventMessage(EventType event,
                                         const QStringList& args)
{
    if (!mMessageMap.contains(event))
    {
        return QString();
    }

    QString message(QString::fromUtf8(mMessageMap[event]));
    for (const QString& arg : args)
    {
        message = message.arg(arg);
    }
    return message;
}

int AppStatsEvents::getEventType(EventType event)
{
    if (!mTypeMap.contains(event))
    {
        return -1;
    }

    return mTypeMap[event];
}

AppStatsEvents::EventType AppStatsEvents::getEventType(int event)
{
    return mTypeMap.key(event, AppStatsEvents::EventType::NONE);
}
