import {
    G as F,
    z as J,
    R as Q,
    B as Z,
    r as y,
    C as $,
    H as C,
    I as r,
    J as e,
    Q as g,
    O as t,
    P as s,
    ao as j,
    Z as G,
    K as N,
    M as P,
    N as c,
    ap as X
} from "./common.modules-f9fa5dc7.js";
import {
    i as Y,
    G as ee,
    n as te,
    a4 as ae,
    cB as se,
    y as le,
    A as ne,
    cq as oe,
    cD as re,
    c as m,
    g as ce,
    aI as ie
} from "./page-activity-ActivityDetail-0d51a056.js";
const ue = {
        class: "wallet-container"
    },
    de = {
        class: "wallet-container-header"
    },
    ve = {
        class: "wallet-container-header-belly"
    },
    he = {
        key: 0
    },
    _e = {
        class: "total"
    },
    we = {
        class: "total"
    },
    ye = {
        class: "wallet-container-content"
    },
    ge = {
        class: "container"
    },
    pe = {
        class: "progressBars"
    },
    me = {
        class: "progressBarsL"
    },
    fe = {
        class: "progressBarsR"
    },
    Be = {
        class: "recycleBtnD"
    },
    Re = {
        key: 1,
        class: "recycleBtn disable"
    },
    ke = {
        class: "userDetail"
    },
    Ce = ["onClick"],
    be = {
        class: "imgD"
    },
    De = ["src"],
    Le = {
        key: 0,
        class: "gameList"
    },
    Se = {
        class: "money"
    },
    We = {
        key: 1,
        class: "gameList"
    },
    Me = F({
        __name: "index",
        setup(xe) {
            Y();
            const b = ee(),
                {
                    downAppTip: K
                } = te(),
                U = re(),
                {
                    t: n
                } = J(),
                D = Q(),
                {
                    setLoading: p
                } = ae(),
                L = se();
            le();
            const V = {
                    recharge: {
                        title: n("recharge"),
                        icon: "rechargeIcon",
                        link: "Recharge"
                    },
                    withdraw: {
                        title: n("withdraw"),
                        icon: "widthdrawBlue",
                        link: "Withdraw"
                    },
                    rechargeHistory: {
                        title: n("rechargeRecords"),
                        icon: "rechargeHistory",
                        link: "RechargeHistory"
                    },
                    withdrawHistory: {
                        title: n("withdrawRecords"),
                        icon: "withdrawHistory",
                        link: "WithdrawHistory"
                    }
                },
                S = Z(() => b.userInfo),
                z = async a => {
                    a == "Recharge" || a == "Withdraw" ? await K(a) : (a === "RechargeHistory" && U.emit("changeKeepAliveKey"), D.push({
                        name: a
                    }))
                };
            let f = 0,
                B = y([]),
                v = 0,
                h = 0,
                i = 0,
                W = "0%",
                _ = 0,
                u = 0,
                x = "0%";
            new Date().getTime() / 1e3;
            const A = y(0),
                I = y(0),
                d = y(0),
                R = y(!1);
            async function H(a = !0) {
                p(!0), await L.getAllwalletsBalance(void 0, !0), q(L.getAllwallets), p(!1), a && b.notifyARGame()
            }
            async function E() {
                if (d.value || R.value) return;
                R.value = !0;
                const a = await ne(oe(!0));
                R.value = !1, a ? (d.value = 5, v = a.data.amount, O()) : d.value = 0
            }
            const O = async () => {
                clearInterval(f), f = setInterval(async () => {
                    d.value -= 1, d.value == 0 && (clearInterval(f), p(!0), await H(!1), p(!1))
                }, 1e3)
            };

            function q(a) {
                if (!a) return;
                S.value.isShowWalletTotalCT == "1" && (A.value = a.totalWithdraw || 0, I.value = a.totalRecharge || 0), B.value = a.thidGameBalanceList || [];
                let o = a.thidGameBalanceList || [];
                if (h = 0, _ = 0, o)
                    for (var w of o) w.vendorCode === "Lottery" ? h += w.balance : _ += w.balance;
                v = h + _, v > 0 ? (i = Math.round(h / v * 1e4) / 100, u = Math.round(_ / v * 1e4) / 100, W = i + "%", x = u + "%") : (i = 0, u = 0)
            }
            return $(async () => {
                await H()
            }), (a, o) => {
                const w = C("NavBar"),
                    M = C("svg-icon"),
                    T = C("van-circle");
                return c(), r("div", ue, [e("div", de, [g(w, {
                    title: t(n)("wallet"),
                    class: "main",
                    "left-arrow": "",
                    onClickLeft: o[0] || (o[0] = l => t(D).go(-1))
                }, null, 8, ["title"]), e("div", ve, [g(M, {
                    name: "wallet1"
                }), e("div", null, s(t(m)(t(v))), 1), e("span", null, s(t(n)("totalBalance")), 1), S.value.isShowWalletTotalCT == "1" ? (c(), r("div", he, [e("div", null, [e("p", _e, s(A.value), 1), e("p", null, s(t(n)("totalWithdraw")), 1)]), e("div", null, [e("p", we, s(I.value), 1), e("p", null, s(t(n)("totalRechargeAmount")), 1)])])) : j("v-if", !0)])]), e("div", ye, [e("div", ge, [e("div", pe, [e("div", me, [g(T, {
                    "current-rate": t(i),
                    "onUpdate:currentRate": o[1] || (o[1] = l => G(i) ? i.value = l : i = l),
                    speed: 100,
                    text: t(W),
                    "stroke-width": "100",
                    "stroke-linecap": "butt"
                }, null, 8, ["current-rate", "text"]), e("h3", null, s(t(m)(t(h))), 1), e("span", null, s(t(n)("mainWallet")), 1)]), e("div", fe, [g(T, {
                    "current-rate": t(u),
                    "onUpdate:currentRate": o[2] || (o[2] = l => G(u) ? u.value = l : u = l),
                    speed: 100,
                    text: t(x),
                    "stroke-width": "100",
                    "stroke-linecap": "butt"
                }, null, 8, ["current-rate", "text"]), e("h3", null, s(t(m)(t(_))), 1), e("span", null, s(t(n)("thirdPartyWallet")), 1)])]), e("div", Be, [d.value == 0 ? (c(), r("button", {
                    key: 0,
                    class: "recycleBtn",
                    onClick: E
                }, s(t(n)("oneClickRecovery")), 1)) : (c(), r("button", Re, s(t(n)("recycling")) + " " + s(d.value), 1))]), e("div", ke, [(c(), r(N, null, P(V, (l, k) => e("div", {
                    key: k,
                    onClick: Ae => z(l.link)
                }, [e("div", be, [e("img", {
                    src: t(ce)("wallet", l.icon)
                }, null, 8, De)]), e("span", null, s(l.title), 1)], 8, Ce)), 64))])]), t(B) ? (c(), r("div", Le, [(c(!0), r(N, null, P(t(B), (l, k) => (c(), r("div", {
                    class: X(["box", l.balance > 0 ? "select" : ""]),
                    key: k
                }, [g(M, {
                    name: l.vendorCode
                }, null, 8, ["name"]), e("h3", Se, s(t(m)(l.balance, " ")), 1), e("span", null, s(t(ie)(l.vendorCode)), 1)], 2))), 128))])) : (c(), r("div", We, [e("div", null, s(t(n)("noData")), 1)]))])])
            }
        }
    });
export {
    Me as _
};