import { PlayType } from '@/types';

export const logType = {
    'denet': '150',//denet-event-log
}

export const redPacketType = {
    nftSale: 2,
    nftGroupSale: 3,
    treasure: 4,
    postEditor: 5,
    giveaway: 0,
    lottery: 1
}

export const businessType = {
    buttonView: "buttonView",
    buttonClick: "buttonClick",
    // 页面曝光
    pageView: "pageView",
}

export const objectType = {
    buttonMain: "button-main",
    buttonSecond: "button-second",
    confirmButton: "confirm-button",
    tweetPostBinded: "TweetPostBinded",
    loginButton: "login-button",
    withdrawButton: "withdraw-button",
    topupButton: "topup-button",
    previewNextButton: 'preview-next-button',
    setPublishContent: 'set-publish-content',


    getMoreGiveaway: "get-more-giveaway",
    nextButton: "next-button",
    openChestButton: "open-chest-button",
    copyButton: "copy-button",
    repostSuccess: "repostSuccess",
    channelButton: 'channel-button',

    //discord
    getDiscordGuildNoData: 'get-discord-guild-no-data',
    getDiscordGuildCatch: 'get-discord-guild-catch',
    getDiscordGuildOpenApiNoData: 'get-discord-guild-openapi-no-data',
    getDiscordGuildOpenApiCatch: 'get-discord-guild-openapi-catch',
    saveDiscordGuildData: 'save-discord-guild-data',

    // 按钮点击
    open_button: 'open-button',
    // 关注全部
    follow_button: 'follow-button',
    follow: 'follow',
    retweet: 'retweet',
    like: 'like',
    comment_and_tag: 'comment-and-tag',
    join_discord: 'discord',
    share_facebook: 'share-facebook',

    // 查看已领取红包列表
    received_list: 'received-list',
    // 点击检测任务
    get_giveaway: 'get-giveaway',
    // 成功领取到钱包
    wallet_button: 'wallet-button',
    // 卡片解析
    parse_card_error: 'parse-card-error',
    // 安装成功
    chrome_extension_installed: 'chrome-extension-installed',
    // 发送事件异常
    chrome_extension_sendmessage_error: 'chrome-extension-sendmessage-error',
    // background文件安装catch异常
    background_function_catch: 'background-function-catch',
    // background 文件chrome 函数 try
    background_function_try: 'background-function-try',
    // create Nft
    create_nfts_button: 'create-nfts-button',
    confirm_transfer_button: 'confirm-transfer-button',
    redeem_button: 'redeem-button',
    buy_button: 'buy-button',
    buy_nft_button: 'buy-nft-button',
    custom_link_button: 'custom-link-button',
    history_button: 'history-button',
    app_button: 'app-button',
    enter_url_button: 'enter-url-button',
    top_right_button: 'top-right-button',
    fullscreen_button: 'fullscreen-button',
    encrypte_nft_button: 'encrypte-nft-button',
    preRepost: 'preRepost',
}

export const pageSource = {
    mainPage: "main-page",
    publisherDialog: "publisher-dialog",
    currencySelectorPage: "currency-selector-page",
    rechargePage: "recharge-page",
    previewPage: "preview-page",
    denetLogin: "denet-login",
    denetHomePage: "denet-home-page",
    denetWithdrawSelector: "denet-withdraw-selector",
    denetWithdrawForm: "denet-withdraw-form",
    denetWithdrawConfirm: "denet-withdraw-confirm",
    denetTopupSelector: "denet-topup-selector",
    denetMorePage: "denet-more-page",
    denetSelector: "denet-selector",
    nftShopPage: "nft-shop-page",
    nftPreviewPage: "nft-preview-page",
    denetNftTransferPage: "denet-nft-transfer-page",


    newFansRewardPage: "new-fans-reward-page",
    inviteFriendsPage: "invite-friends-page",
    openTreasurePage: "open-treasure-page",
    beenInvitedPage: "been-invited-page",
    waitingLotteryPage: "waiting-lottery-page",
    missingLotteryPage: "missing-lottery-page",
    expiredPage: "expired-page",

    // 待开红包页
    pending_page: 'pending-page',
    // 已领取任务页
    task_page: 'task-page',
    // 领取列表页
    received_list_page: 'received-list-page',
    // 红包过期
    expired_page: 'expired-page',
    // 红包被领完
    been_claimed_page: 'been-claimed-page',
    // 机器人检测未通过
    robot_detection_failed_page: 'robot-detection-failed-page',
    // 成功领取到钱包
    received_success_page: 'received-success-page',
    received_empty_rewards_page: 'received-empty-rewards-page',
    pe_loading_page: 'pe-loading-page',
    pe_display_page: 'pe-display-page',
    nft_sales_window: 'nft-sales-window',
    nft_post_page: 'nft-post-page',
    main_page_dashboard: 'main-page-dashboard',
    post_editor_guide_page_left: 'post-editor-guide-page-left',
    post_editor_guide_page_right: 'post-editor-guide-page-right',
    buy_posteditor_nft_dialog: 'buy-posteditor-nft-dialog',

}

export const extParams = {
    success: 'success',
    failure: 'failure'
}

export const bizType = {
    Treasure: 0,
    Lottery: 1,
    RedPacket: 2,
    ToolBox: 3,
}

export const getCurrentBizType = (type) => {
    let obj = {};
    obj[PlayType.common] = bizType.RedPacket;
    obj[PlayType.lottery] = bizType.Lottery;
    obj[PlayType.treasure] = bizType.Treasure;
    obj[PlayType.postEditor] = bizType.ToolBox;

    return obj[type];
}
