import {
  appSetting as appSettingDefine, userSetting as userSettingDefine, indentifySetting as indentifySettingDefine, shopeeSetting as shopeeSettingDefine, affiliateSetting as affiliateSettingDefine, platformSetting as platformSettingDefine, tiktokSetting as tiktokSettingDefine, lazadaSetting as lazadaSettingDefine,
} from './setting';
import { apiLocalSetting, clearAllSetting } from './api';

export const platformSetting = {
  saveHistoryPrint: apiLocalSetting(platformSettingDefine.saveHistoryPrint),
};

export const appSetting = {
  usePopup: apiLocalSetting(appSettingDefine.usePopup),
  useShopManager: apiLocalSetting(appSettingDefine.useShopManager),
  readNotifyId: apiLocalSetting(appSettingDefine.readNotifyId),
  extensionInfo: apiLocalSetting(appSettingDefine.extensionInfo),
  platformShopConfig: apiLocalSetting(appSettingDefine.platformShopConfig),
  betaMode: apiLocalSetting(appSettingDefine.betaMode),
  workerFetchService: apiLocalSetting(appSettingDefine.workerFetchService),
  toggleMenu: apiLocalSetting(appSettingDefine.toggleMenu),
  badWord: apiLocalSetting(appSettingDefine.badWord),
};

export const userSetting = {
  userId: apiLocalSetting(userSettingDefine.userId),
  userToken: apiLocalSetting(userSettingDefine.userToken),
  userExtensionPlan: apiLocalSetting(userSettingDefine.userExtensionPlan),
  userName: apiLocalSetting(userSettingDefine.userName),
  userPassword: apiLocalSetting(userSettingDefine.userPassword),
  userData: apiLocalSetting(userSettingDefine.userData),
};

export const indentifySetting = {
  databaseId: apiLocalSetting(indentifySettingDefine.databaseId),
  appUuid: apiLocalSetting(indentifySettingDefine.appUuid),
  profileId: apiLocalSetting(indentifySettingDefine.profileId),
  fingerprintId: apiLocalSetting(indentifySettingDefine.fingerprintId),
  browserIp: apiLocalSetting(indentifySettingDefine.browserIp),
  browserAgent: apiLocalSetting(indentifySettingDefine.browserAgent),
  browserName: apiLocalSetting(indentifySettingDefine.browserName),
  browserPlatform: apiLocalSetting(indentifySettingDefine.browserPlatform),
};

export const shopeeSetting = {
  // Affiliate
  shopeeAffId: apiLocalSetting(shopeeSettingDefine.shopeeAffId),
  shopeeAffToken: apiLocalSetting(shopeeSettingDefine.shopeeAffToken),
  shopeeAffSubId: apiLocalSetting(shopeeSettingDefine.shopeeAffSubId),
  shopeeAffContent: apiLocalSetting(shopeeSettingDefine.shopeeAffContent),
  //  Shop
  shopeeShopWarehouse: apiLocalSetting(shopeeSettingDefine.shopeeShopWarehouse),
  shopeeShopId: apiLocalSetting(shopeeSettingDefine.shopeeShopId),
  shopeeShopName: apiLocalSetting(shopeeSettingDefine.shopeeShopName),
  shopeeShopImage: apiLocalSetting(shopeeSettingDefine.shopeeShopImage),
  shopeeShopRef: apiLocalSetting(shopeeSettingDefine.shopeeShopRef),
  shopeeShopSpcCds: apiLocalSetting(shopeeSettingDefine.shopeeShopSpcCds),
  shopeeShopSpcf: apiLocalSetting(shopeeSettingDefine.shopeeShopSpcf),
  //  Product
  shopeeConfigProduct: apiLocalSetting(shopeeSettingDefine.shopeeConfigProduct),
  cloneProductEditData: apiLocalSetting(shopeeSettingDefine.cloneProductEditData),
  // Flashsale
  shopeeFlashsaleCampaignAuto: apiLocalSetting(shopeeSettingDefine.shopeeFlashsaleCampaignAuto),
  shopeeFlashsaleSchedulerAuto: apiLocalSetting(shopeeSettingDefine.shopeeFlashsaleSchedulerAuto),
};

export const tiktokSetting = {
  tiktokShopId: apiLocalSetting(tiktokSettingDefine.tiktokShopId),
  tiktokShopName: apiLocalSetting(tiktokSettingDefine.tiktokShopName),
};

export const lazadaSetting = {
  lazadaShopId: apiLocalSetting(lazadaSettingDefine.lazadaShopId),
  lazadaShopName: apiLocalSetting(lazadaSettingDefine.lazadaShopName),
};

export const tracerAfSetting = {
  affTrackingShopeeTime: apiLocalSetting(affiliateSettingDefine.affTrackingShopeeTime),
  affTrackingLazadaTime: apiLocalSetting(affiliateSettingDefine.affTrackingLazadaTime),
  affTrackingTikiTime: apiLocalSetting(affiliateSettingDefine.affTrackingTikiTime),
};

export const allSetting = {
  ...appSetting,
  ...userSetting,
  ...shopeeSetting,
  ...tracerAfSetting,
};

export { clearAllSetting };
