import { $L } from "./helperMethods";

export const SUPPORT_COUNTRIES = { US: "en", DE: "de", UK: "uk", RU: "ru" };

// debug
export const DEBUG_KEY = "5286";
export const TESTPANEL_KEY = "5325";
export const SFT_TEST = "5555";
export const SFT_TEST2 = "6666";
export const DEFAULT_SERVERTYPE = "system"; //system, qt2, qt, prd
export const DEFAULT_RIC_CODE = "system"; //system, aic, eic, ruc
export const DEBUG_WINDOW_DEVICEID = "testdeviceid";
export const panel_names = {
  INTRO_PANEL: "intropanel",
  HOME_PANEL: "homepanel",
  MY_PAGE_PANEL: "mypagepanel",
  CATEGORY_PANEL: "categorypanel",
  SEARCH_PANEL: "searchpanel",
  ON_SALE_PANEL: "onsalepanel",
  TRENDING_NOW_PANEL: "trendingnowpanel",
  HOT_PICKS_PANEL: "hotpickpanel",
  CART_PANEL: "cartpanel",
  FEATURED_BRANDS_PANEL: "featuredbrandspanel",
  WELCOME_EVENT_PANEL: "welcomeeventpanel",
  CONFIRM_PANEL: "confirmpanel",
  DETAIL_PANEL: "detailpanel",
  PLAYER_PANEL: "playerpanel",
  PLAYER_PANEL_NEW: "playerpanel.new",
  CHECKOUT_PANEL: "checkoutpanel",
  THEME_CURATION_PANEL: "themeCurationPanel",
  IMAGE_PANEL: "imagepanel",
  SERVICE_UNAVAILABLE: "servicepanel",
  OPTIONAL_TERMS_PANEL: "optionaltermspanel", // 선택약관 Intro Panel
  // error
  ERROR_PANEL: "errorpanel",

  // debug
  DEBUG_PANEL: "debugpanel",
  VIDEO_TEST_PANEL: "videotestpanel",
};

//button
export const TBUTTON_PRESS_DELAY = 100;

//search data
export const SEARCH_DATA_MAX_RESULTS_LIMIT = 30;

// getSubCategory data
export const CATEGORY_DATA_MAX_RESULTS_LIMIT = 20;

// getMyinfoOrderSearch data
export const GET_MY_INFO_ORDER_SEARCH_LIMIT = 5;

// popup
export const ACTIVE_POPUP = {
  alarmOffPopup: "alarmOffPopup",
  alarmOnPopup: "alarmOnPopup",
  couponPopup: "couponPopup",
  exitPopup: "exitPopup",
  favoritePopup: "favoritePopup",
  loginPopup: "loginPopup",
  noShowPopup: "noShowPopup",
  optionPopup: "optionPopup",
  qrPopup: "qrPopup",
  qrPopup2: "qrPopup2",
  reminderPopup: "reminderPopup",
  termsPopup: "termsPopup",
  timeConflictPopup: "timeConflictPopup",
  descriptionPopup: "descriptionPopup",
  eventPopup: "eventPopup",
  smsPopup: "smsPopup",
  alertPopup: "alertPopup",
  setPinCodePopup: "setPinCodePopup",
  hotPicksSmsPopup: "hotPicksSmsPopup",
  watchPopup: "watchPopup",
  orderCancelPopup: "orderCancelPopup",
  cancelConfirmPopup: "cancelConfirmPopup",
  orderDetailPopup: "orderDetailPopup",
  orderDetailCancel: "orderDetailCancel",
  errorPopup: "errorPopup",
  returnExchangePopup: "returnExchangePopup",
  trackPackagePopup: "trackPackagePopup",
  unSupportedCountryPopup: "unSupportedCountryPopup",
  changeCountyPopup: "changeCounty",
  networkErrorPopup: "networkErrorPopup",
  endOfServicePopup: "endOfServicePopup",
  checkoutErrorPopup: "checkoutErrorPopup",
  optionalTermsConfirmPopup: "optionalTermsConfirmPopup",
  optionalTermsConfirm: "optionalTermsConfirm",
  optionalTermsConfirmBottom: "optionalTermsConfirmBottom",
  introTermsPopup: "introTermsPopup",
  toast: "toast",
  optionalConfirm: "optionalConfirm",
};
export const DEBUG_VIDEO_SUBTITLE_TEST = false;
export const AUTO_SCROLL_DELAY = 600;
export const AUTO_SCROLL_GAP = 20;
export const SINGLE = "SINGLE";
export const SERIES = "SERIES";
export const YOUTUBE_VIDEO = "youtube#video";
export const YOUTUBE_CHANNEL = "youtube#channel";
export const CP_CONTENT = "CP_CONTENT";
export const APP = "APP";
export const PLAN = "PLAN";
export const ADD_PLAN = "ADD_PLAN";
export const MORE = "MORE";

// cryptoJS Key
export const SECRET_KEY = "fy7BTKuM9eeTQqEC9sF3Iw5qG43Aaip";

export const MYPAGE_TABS = {
  MY_INFO: 30800,
  MY_ORDERS: 30900,
  RECENTLY_VIEWED: 30300,
  FAVORITES: 30200,
  REMINDERS: 30400,
  SUPPORT: 30500,
  TERMS_OF_SERVICE: 30600,
};

export const MYINFO_TABS = {
  PAYMENT: 0,
  BILLING_ADDRESS: 1,
  SHIPPING_ADDRESS: 2,
  COUPON: 3,
};

export const LOG_TP_NO = {
  // IF-LGSP-LOG-001 / Live 시청 이력
  LIVE: {
    HOME: "100",
    FEATURED_BRANDS: "101",
    FULL: "102",
    ITEM_DETAIL: "103",
  },

  // IF-LGSP-LOG-002 / VOD 시청 이력
  VOD: {
    FULL_VOD: "150",
    POPULAR_SHOWS_AND_HOT_PICKS: "151",
    FEATURED_BRANDS_VOD: "152",
    HOME_VOD: "153",
    ITEM_DETAIL_VOD: "154",
    FULL_MEDIA: "155",
    ITEM_DETAIL_MEDIA: "156",
  },

  // IF-LGSP-LOG-003 / Curation View 이력
  CURATION: {
    HOT_PICKS: "220",
    SHOWROOM: "221",
    ON_SALE: "260",
    HOME: "270",
    CATEGORY: "280",
  },

  // IF-LGSP-LOG-004 / Entry 이력
  SECOND_LAYER: "210",

  // IF-LGSP-LOG-005 / GNB 클릭 이력
  GNB: "300",

  // IF-LGSP-LOG-006 / Product Detail 이력
  PRODUCT: {
    PRODUCT_DETAIL: "400",
    GROUP_DETAIL: "408",
    BILLING_PRODUCT_DETAIL: "409",
    PRODUCT_DETAIL_IMAGE: "410",
  },

  // IF-LGSP-LOG-007 / Detail 이력
  DETAIL: {
    THEME_DETAIL: "402",
    TRAVEL_DETAIL: "406",
    DETAIL_BUTTON_CLICK: "407",
  },

  // IF-LGSP-LOG-008 / Shop By Mobile 이력
  SHOP_BY_MOBILE: {
    SHOP_BY_MOBILE: "450",
    AGREE_AND_SEND: "452",
    QR_CODE_REDIRECT_AND_CREATE_TRACKING_LOG: "453",
  },

  // IF-LGSP-LOG-009 / Patners 클릭 이력
  PARTNERS: "500",

  // IF-LGSP-LOG-010 / Reminders - Alert on / off
  MY_PAGE_ALERT_FLAG: "250",

  // IF-LGSP-LOG-011 / MyPage Delete 버튼 클릭 이력
  MY_PAGE_MY_DELETE: "251",

  // IF-LGSP-LOG-012 / MyPage Notice View
  MY_PAGE_NOTICE: "252",

  // IF-LGSP-LOG-013 / 검색 이력
  SEARCH: "261",

  // IF-LGSP-LOG-014 / 검색 결과 클릭 이력
  SEARCH_CLICK: "262",

  // IF-LGSP-LOG-015 / Upcoming - on / off
  UPCOMING_FLAG: "271",

  // IF-LGSP-LOG-017 / 알람 팝업
  ALARM_POP: "281",

  // IF-LGSP-LOG-018 / 알람 팝업 OK/NO 클릭
  ALARM_CLICK: {
    BROADCAST: "282",
    KEYWORD: "283",
  },

  // IF-LGSP-LOG-020 / 테마 상품 상세 이력
  THEME_PRODUCT: "411",

  // IF-LGSP-LOG-100 / TOP contents 노출 이력
  TOP_CONTENTS: {
    VIEW: "310",
    CLICK: "311",
  },

  // IF-LGSP-LOG-101 / 약관 동의/미동의 클릭 이력
  TERMS: {
    AGREE: "650",
    DO_NOT_AGREE: "651",
    TEARMS_CONDITIONS: "652",
    PRIVACY_POLICY: "653",
  },

  // IF-LGSP-LOG-102 / LG Account 로그인 이력
  LG_ACCOUNT_LOGIN: "700",

  // IF-LGSP-LOG-103 / Order 화면 버튼 클릭 이력
  ORDER_BTN_CLICK: "702",

  // IF-LGSP-LOG-104 / Order 취소 / 반품 / 교환 이력 (반품, 교환 = 삭제)
  ORDER_CHANGE: "703",

  // IF-LGSP-LOG-105 / 쿠폰 사용 이력
  COUPON_USE: "800",

  // IF-LGSP-LOG-108 / 결제 페이지 진입 이력
  PAYMENT_ENTRY: "900",

  // IF-LGSP-LOG-109 / 결제 완료 이력
  PAYMENT_COMPLETE: "901",

  // IF-LGSP-LOG-110 / Featured Brands View 이력
  BRANDS: "290",

  // IF-LGSP-LOG-111 / 카드, 주소 ADD/EDIT 이력
  MY_INFO_EDIT: "704",

  // IF-LGSP-LOG-112 / Check out 화면 버튼 클릭 이력
  CHECKOUT_BTN_CLICK: "902",
};

// TV log update
export const LOG_MENU = {
  APP: "App",
  UNKNOWN: "Unknown",

  EVENT_POPUP: "Event Popup",
  WELCOME_EVENT: "Welcome Event",
  TERMS_CONDITIONS: "Terms & Conditions",

  HOME_TOP: "Home/Top",
  HOME_CATEGORY: "Home/Category",
  HOME_ON_SALE: "Home/On Sale",
  HOME_POPULAR_SHOWS: "Home/Popular Shows",
  HOME_BEST_SELLER: "Home/Best Sellers",

  TRENDING_NOW_POPULAR_SHOWS: "Trending Now/Popular Shows",
  TRENDING_NOW_BEST_SELLER: "Trending Now/Best Sellers",

  HOT_PICKS: "Hot Picks",

  ON_SALE: "On Sale",

  SEARCH_SEARCH: "Search/Search",
  SEARCH_RESULT: "Search/Search Result",
  SEARCH_BEST_SELLER: "Search/Best Sellers",

  CATEGORY_SHOWS: "Category/Category_show",
  CATEGORY_ITEM: "Category/Category_item",
  CATEGORY_POPULAR_SHOWS: "Category/Popular Shows",
  CATEGORY_BEST_SELLER: "Category/Best Sellers",

  FEATURED_BRANDS: "Featured Brands",
  FEATURED_BRANDS_QUICK_MENU: "Quick Menu",
  FEATURED_BRANDS_LIVE_CHANNELS: "Live Channels",
  FEATURED_BRANDS_UPCOMING: "Upcoming",
  FEATURED_BRANDS_TODAYS_DEALS: "Today's Deals",
  FEATURED_BRANDS_BEST_SELLER: "Best Sellers",
  FEATURED_BRANDS_RECOMMENDED_SHOWS: "Recommended Shows",
  FEATURED_BRANDS_FEATURED_CREATORS: "Featured Creators",
  FEATURED_BRANDS_SERIES: "Series",
  FEATURED_BRANDS_CATEGORY: "Category",
  FEATURED_BRANDS_SHOWROOM: "Showroom",

  // FEATURED_BRANDS_QUICK_MENU: "Featured Brands/Quick Menu",
  // FEATURED_BRANDS_LIVE_CHANNELS: "Featured Brands/Live Channels",
  // FEATURED_BRANDS_UPCOMING: "Featured Brands/Upcoming",
  // FEATURED_BRANDS_TODAYS_DEALS: 'Featured Brands/Today"s Deals',
  // FEATURED_BRANDS_BEST_SELLER: "Featured Brands/Best Sellers",
  // FEATURED_BRANDS_RECOMMENDED_SHOWS: "Featured Brands/Recommended Shows",
  // FEATURED_BRANDS_FEATURED_CREATORS: "Featured Brands/Featured Creators",
  // FEATURED_BRANDS_SERIES: "Featured Brands/Series",
  // FEATURED_BRANDS_CATEGORY: "Featured Brands/Category",
  // FEATURED_BRANDS_SHOWROOM: "Featured Brands/Showroom",

  MY_PAGE: "My Page",
  // MY_PAGE_MY_INFO: "My Page/My Info",
  // MY_PAGE_MY_ORDERS: "My Page/My Orders",
  // MY_PAGE_FAVORITES: "My Page/Favorites",
  // MY_PAGE_RECENTLY_VIEWED: "My Page/Recently Viewed",
  // MY_PAGE_REMINDERS: "My Page/Reminders",
  // MY_PAGE_SUPPORT: "My Page/Support",
  // MY_PAGE_TERMS_OF_SERVICE: "My Page/Terms Of Service",
  // MY_PAGE_SETTINGS: "My Page/Settings",

  THEME_PAGE: "Theme Page",

  DETAIL_PAGE_BILLING_PRODUCT_DETAIL: "Billing Product Detail",
  DETAIL_PAGE_PRODUCT_DETAIL: "Product Detail",
  DETAIL_PAGE_GROUP_DETAIL: "Group Detail",
  DETAIL_PAGE_THEME_DETAIL: "Theme Detail",
  DETAIL_PAGE_TRAVEL_THEME_DETAIL: "Travel Theme Detail",
  DETAIL_PAGE_YOU_MAY_LIKE: "You May Also Like",

  FULL: "Full Player/Full Player",
  FULL_SHOP_NOW: "Full Player/Shop Now",
  FULL_YOU_MAY_LIKE: "Full Player/You May Also Like",
  FULL_LIVE_CHANNELS: "Full Player/Live Channels",
  FULL_FEATURED_SHOWS: "Full Player/Featured Shows",

  SHOW_ROOM_SHOP_NOW: "Showroom/Shop Now",
  SHOW_ROOM_ROOM_THEME: "Showroom/Room Theme",

  CHECKOUT: "Checkout/Checkout",
  CHECKOUT_PIN_CODE: "Checkout/PIN Code",
  CHECKOUT_ORDER_COMPLETE: "Checkout/Order Complete",
};

// ERROR MESSAGE
export const ERROR_MESSAGES_GROUPS = [
  {
    codes: [502, 503, 504],
    message: $L(
      "We're sorry, but this request cannot be supported by the service."
    ),
  },
  {
    codes: [505, 506, 508],
    message: $L("Please confirm your agreement to the terms and conditions."),
  },
  {
    codes: [508, 509, 600, 601, 900, 901, 903, 904, 905, 906, 907],
    message: $L(
      "We're sorry, but an error occurred on the server. Please try again later."
    ),
  },
  {
    codes: [602, 603, 604, 605, 606],
    message: $L(
      "Unsupported request. Please check the system configuration settings"
    ),
  },
  {
    codes: [921, 922, 923, 924, 925, 926],
    message: $L(
      "Required information for the order is missing. Please check and try again."
    ),
  },
  {
    codes: [927, 928, 929, 930, 931, 932, 933, 934, 941],
    message: $L(
      "Customer information is missing. Please check your details and try again."
    ),
  },
  {
    codes: [935, 936, 937, 938, 939, 940],
    message: $L(
      "We're sorry, but there seems to be an issue with your order request. Please check and try again."
    ),
  },
  {
    codes: [1006, 1007],
    message: $L(
      "Customer information is missing. Please check your details and try again."
    ),
  },
  {
    codes: [1008],
    message: $L(
      "We're sorry, but there seems to be an issue with your order request. Please check and try again."
    ),
  },
  {
    codes: [1009],
    message: $L(
      "Payment cannot be processed. Please check your details and try again."
    ),
  },
  {
    codes: [1010],
    message: $L("This coupon has already been used."),
  },
  {
    codes: [1011],
    message: $L("There is an error with the membership system."),
  },
  {
    codes: [1012],
    message: $L("There is an error with the payment system."),
  },
  {
    codes: [1013],
    message: $L("You have already received this coupon."),
  },
  {
    codes: [1014],
    message: $L("This item is out of stock."),
  },
  {
    codes: [1015],
    message: $L("Card information is missing."),
  },
  {
    codes: [1016, 1017],
    message: $L("Invalid product information."),
  },
  {
    codes: [1018, 1019],
    message: $L("Coupon information is missing."),
  },
  {
    codes: [1020],
    message: $L("Order system error."),
  },
  {
    codes: [1021],
    message: $L("Invalid PIN."),
  },
  {
    codes: [1024],
    message: $L("Payment request failed."),
  },
  {
    codes: [1025],
    message: $L("An error has occurred in the tax lookup system."),
  },
  {
    codes: [1026],
    message: $L("Invalid product information."),
  },
  {
    codes: [1027],
    message: $L(
      "This item cannot be purchased on the TV. Please scan the QR code or send an SMS."
    ),
  },
  {
    codes: [1028],
    message: $L("Invalid email format."),
  },
  {
    codes: [1029],
    message: $L("Please select a payment method."),
  },
  {
    codes: [1030],
    message: $L("Payment cancellation request failed."),
  },
  {
    codes: [1033],
    message: $L(
      "Customer information is missing. Please check your details and try again."
    ),
  },
  {
    codes: [1037],
    message: $L("Invalid data format."),
  },
  {
    codes: [1038],
    message: $L(
      "Required information for the order is missing. Please check and try again."
    ),
  },
  {
    codes: [1039, 1040],
    message: $L("Payment cancellation request failed."),
  },
  {
    codes: [1041],
    message: $L("You have exceeded the coupon issuance limit."),
  },
  {
    codes: [1104],
    message: $L("Only one coupon can be used."),
  },
  {
    codes: [1106],
    message: $L("Invalid card information."),
  },
  {
    codes: [1107],
    message: $L("Invalid price information."),
  },
  {
    codes: [1108],
    message: $L("Due to a system error, we were unable to process your order."),
  },
  {
    codes: [1109],
    message: $L("This coupon cannot be used for the current amount."),
  },
  {
    codes: [1111],
    message: $L(
      "This order cannot be partially canceled; only full cancellation is possible."
    ),
  },
  {
    codes: [1114],
    message: $L(
      "The request for the product information in the order is incorrect."
    ),
  },
  {
    codes: [1116],
    message: $L("Order cancellation is not possible during shipping."),
  },
  {
    codes: [1120],
    message: $L("The selected item is out of stock and cannot be ordered."),
  },
  {
    codes: [1121],
    message: $L(
      "The selected shipping address is in a region where delivery is not possible."
    ),
  },
  {
    codes: [1122],
    message: $L("Invalid card information."),
  },
  {
    codes: [1123, 1124],
    message: $L(
      "Customer information is missing. Please check your details and try again."
    ),
  },
  {
    codes: [1125],
    message: $L("Card information is missing."),
  },
  {
    codes: [1126, 1127],
    message: $L("There are terms and conditions that have not been agreed to."),
  },
  {
    codes: [1129],
    message: $L("Only one coupon can be used."),
  },
  {
    codes: [1130],
    message: $L("This coupon cannot be used for the current amount."),
  },
  {
    codes: [1134],
    message: $L("This order has already been canceled."),
  },
  {
    codes: [1136],
    message: $L("The system is currently not responding properly."),
  },
  {
    codes: [1139],
    message: $L(
      "This order has already been shipped and cannot be canceled. Please contact ShopLC Customer Service. Contact Information -ShopLC: 877-899-0078 (Customer Service)"
    ),
  },
  {
    codes: [1044],
    message: $L("The order request has failed."),
  },
];

export const LOG_CONTEXT_NAME = {
  SHOPTIME: "shoptime",
  HOME: "shoptime.home",
  CHECKOUT: "shoptime.checkout",
  PINCODE: "shoptime.pincode",
  YOUMAYLIKE: "shoptime.youmayalsolike",
  SHOW: "shoptime.show",
  SHOPBYMOBILE: "shoptime.shopbymobile",
  GNB: "shoptime.gnb",
  REMINDERS: "shoptime.reminders",
  MYPAGE: "shoptime.mypage",
  FEATURED_BRANDS: "shoptime.featuredpartner",
  MYINFO: "shoptime.myinfo",
  ON_SALE: "shoptime.onsale",
  TRENDING_NOW: "shoptime.trendingnow",
  HOT_PICKS: "shoptime.hotpicks",
  SEARCH: "shoptime.search",
  THEME_CURATION: "shoptime.themecuration",
  CATEGORY: "shoptime.category",
  ENTRY: "shoptime.entry",
  MYORDER: "shoptime.myorder",
  DETAILPAGE: "shoptime.detailpage",
};

export const LOG_MESSAGE_ID = {
  VIEW_CHANGE: "AL_VIEW_CHANGE",
  HOME: "AL_HOME_SHOWN",
  BANNER: "AL_BANNER_SHOWN",
  BANNER_CLICK: "AL_BANNER_CLICK",
  PINCODE: "AL_PINCODE_BUTTON",
  CONTENTCLICK: "AL_PAGE_CONTENT_CLICK",
  SHOWVIEW: "AL_SHOW_VIEW_CHANGE",
  SHELF: "AL_SHELF_LIST_SHOWN",
  SHELF_CLICK: "AL_SHELF_CONTENT_CLICK",
  SMB: "AL_SBM",
  GNB: "AL_GNB_CLICK",
  BUTTONCLICK: "AL_BUTTON_CLICK",
  BUTTON_CANCEL: "AL_BUTTON_CANCEL",
  TOGGLE_CLICK: "AL_TOGGLE_CLICK",
  MYPAGE_DELETE: "AL_MYPAGE_DELETE",
  MYPAGE_CLICK: "AL_MYPAGE_CLICK",
  HOTPICKS_SHOWN: "AL_HOTPICKS_SHOWN",
  HOTPICKS_CLICK: "AL_HOTPICKS_CLICK",
  SEARCH_RESULT_CLICK: "AL_SEARCH_RESULT_CLICK",
  SEARCH_ITEM: "AL_SEARCH_ITEM",
  ENTRY_INFO: "AL_APP_ENTRY_INFO",
  CHECKOUT_CLICK: "AL_CHECKOUT_CLICK",
  BUY_NOW: "AL_BUY_NOW",
};
