package com.adealink.weparty.url

import android.net.Uri
import com.adealink.frame.base.AppBase
import com.adealink.weparty.debug.DebugPrefs
import com.adealink.weparty.network.RELEASE_HOSTS

/**
 * UrlConfig配置url
 */
object UrlConfig {

    private val isProdEnv =
        AppBase.isRelease || RELEASE_HOSTS.contains(Uri.parse(DebugPrefs.httpUrl).host)

    val thirdPayUrl = when {
        isProdEnv -> "https://web.wenext.chat/web/yoki-wallet"
        else -> "http://web-test.wenext.chat/web/yoki-wallet"
    }

    val serviceTerms = when {
        isProdEnv -> "https://web.yoki.chat/service_terms/0?projectname=yoki-terms"
        else -> "http://web-test.yoki.chat/service_terms/0?projectname=yoki-terms"
    }

    val privacyPolicy = when {
        isProdEnv -> "https://web.yoki.chat/privacy_policy/0?projectname=yoki-terms"
        else -> "http://web-test.yoki.chat/privacy_policy/0?projectname=yoki-terms"
    }

    val policies = when {
        isProdEnv -> "https://web.yoki.chat/policies/0?projectname=yoki-terms"
        else -> "http://web-test.yoki.chat/policies/0?projectname=yoki-terms"
    }

    val thirdPartyRecharge =
        when {
            isProdEnv -> "https://web.yoki.chat/third-party-recharge?projectname=yoki-payment&hideAppBar=true&vpResizable=true"
            else -> "http://web-test.yoki.chat/third-party-recharge?projectname=yoki-payment&hideAppBar=true&vpResizable=true"
        }

    val diamondWithdrawal =
        when {
            isProdEnv -> "https://web.yoki.chat/diamond-deal?projectname=yoki-payment&hideAppBar=true&vpResizable=true"
            else -> "http://web-test.yoki.chat/diamond-deal?projectname=yoki-payment&hideAppBar=true&vpResizable=true"
        }

    val childSafetyPolicy =
        when {
            AppBase.isProdEnv -> "https://web.yoki.chat/child_policy/0?projectname=yoki-terms"
            else -> "https://web-test.yoki.chat/child_policy/0?projectname=yoki-terms"
        }

}