import {
    G as b,
    R as z,
    r as h,
    W as S,
    H as M,
    I as v,
    J as _,
    aB as x,
    P as L,
    Q as g,
    ao as G,
    au as E,
    ap as k,
    N as f
} from "./common.modules-f9fa5dc7.js";
import {
    E as H
} from "./page-activity-Bonus-f5229d51.js";
import {
    M as V
} from "./MayrecordList-54929218.js";
import {
    A as q,
    eS as D,
    _ as K
} from "./page-activity-ActivityDetail-0d51a056.js";
const $ = {
        class: "MyGameRecord__C"
    },
    J = {
        key: 0,
        class: "MyGameRecord__C-head"
    },
    Q = {
        class: "MyGameRecord__C-body"
    },
    W = {
        key: 1,
        class: "MyGameRecord__C-body-empty"
    },
    F = {
        key: 1,
        class: "MyGameRecord__C-foot"
    },
    U = {
        class: "MyGameRecord__C-foot-page"
    },
    X = b({
        __name: "MyGameRecord",
        props: {
            typeid: {
                type: Number,
                required: !0
            },
            goPathName: {
                type: String,
                required: !0
            },
            hasHead: {
                type: Boolean,
                required: !0,
                default: !0
            }
        },
        setup(w, {
            expose: N
        }) {
            const R = w,
                A = z(),
                C = h(4),
                I = h(20),
                m = h(1),
                u = h([]),
                P = c => {
                    A.push({
                        name: c
                    })
                },
                B = () => {
                    m.value--, y()
                },
                j = () => {
                    m.value++, y()
                },
                y = async (c = !1) => {
                    if (R.typeid == null) return;
                    c && (m.value = 1);
                    const n = await q(D({
                            pageSize: I.value,
                            pageNo: m.value,
                            typeId: R.typeid
                        })),
                        s = (n == null ? void 0 : n.data.list) || [];
                    for (let o = 0; s.length > o; o++) {
                        let i = s[o].gameType.split(","),
                            e = s[o].selectType.split(",");
                        for (let l = 0; i.length > l; l++)
                            if (i[l] == "1" || i[l] == "2" || i[l] == "3") s[o].gameType = "1", s[o].oneList = e;
                            else if (i[l] == "5" || i[l] == "6") {
                            let p = [],
                                d = [],
                                r = [];
                            for (let t = 0; e.length > t; t++) {
                                if (e[t] == "|11|" || e[t] == "|22|" || e[t] == "|33|" || e[t] == "|44|" || e[t] == "|55|" || e[t] == "|66|") {
                                    let a = e[t].split("|");
                                    a.pop(), a.shift(), p.push(a.join())
                                }
                                if (e[t] == ":11:" || e[t] == ":22:" || e[t] == ":33:" || e[t] == ":44:" || e[t] == ":55:" || e[t] == ":66:") {
                                    let a = e[t].split(":");
                                    a.pop(), a.shift(), d.push(a.join())
                                }
                                if (e[t] == ":1:" || e[t] == ":2:" || e[t] == ":3:" || e[t] == ":4:" || e[t] == ":5:" || e[t] == ":6:") {
                                    let a = e[t].split(":");
                                    a.pop(), a.shift(), r.push(a.join())
                                }
                            }
                            s[o].gameType = "2", s[o].oneList = p, s[o].towList = T(d, r)
                        } else if (i[l] == "7" || i[l] == "8") {
                            let p = [],
                                d = !1;
                            for (let r = 0; e.length > r; r++) {
                                if (e[r] == "|111|" || e[r] == "|222|" || e[r] == "|333|" || e[r] == "|444|" || e[r] == "|555|" || e[r] == "|666|") {
                                    let t = e[r].split("|");
                                    t.pop(), t.shift(), p.push(t.join())
                                }
                                e[r] == "|AAA|" && (d = !0), s[o].oneList = p, s[o].towList = d, s[o].gameType = "3"
                            }
                        } else if (i[l] == "9" || i[l] == "10" || i[l] == "4") {
                            let p = [],
                                d = !1,
                                r = [];
                            for (let t = 0; e.length > t; t++) {
                                if (e[t] == "|1|" || e[t] == "|2|" || e[t] == "|3|" || e[t] == "|4|" || e[t] == "|5|" || e[t] == "|6|") {
                                    let a = e[t].split("|");
                                    a.pop(), a.shift(), p.push(a.join())
                                }
                                if (e[t] == "|ABC|" && (d = !0), e[t] == ".1." || e[t] == ".2." || e[t] == ".3." || e[t] == ".4." || e[t] == ".5." || e[t] == ".6.") {
                                    let a = e[t].split(".");
                                    a.pop(), a.shift(), r.push(a.join())
                                }
                            }
                            s[o].oneList = p, s[o].towList = d, s[o].threeList = r, s[o].gameType = "4"
                        }
                    }
                    u.value = s || [], C.value = (n == null ? void 0 : n.data.totalPage) || 0
                },
                T = (c, n) => {
                    let s = [];
                    for (var o = 0; c.length > o; o++) {
                        let e = c[o],
                            l = [];
                        for (var i = 0; n.length > i; i++) l.push(n[i]);
                        if (l.length > 0) {
                            let p = l.sort().join(",");
                            s.push(e + "|" + p)
                        }
                    }
                    return s.sort()
                };
            return N({
                getData: y
            }), S(() => {
                y()
            }), (c, n) => {
                const s = M("svg-icon"),
                    o = M("van-icon");
                return f(), v("div", $, [c.hasHead ? (f(), v("div", J, [_("div", {
                    class: "MyGameRecord__C-head-moreB", style: "display: none;",
                    onClick: n[0] || (n[0] = i => P(c.goPathName))
                }, [x(L(c.$t("more")) + " ", 1), g(s, {
                    name: "rightCircle"
                })])])) : G("v-if", !0), _("div", Q, [u.value.length ? (f(), E(V, {
                    key: 0,
                    mayrecord: u.value
                }, null, 8, ["mayrecord"])) : (f(), v("div", W, [g(H)]))]), u.value.length ? (f(), v("div", F, [_("div", {
                    class: k(["MyGameRecord__C-foot-previous", {
                        disabled: m.value <= 1
                    }]),
                    onClick: B
                }, [g(o, {
                    name: "arrow-left",
                    class: "MyGameRecord__C-icon",
                    size: "20"
                })], 2), _("div", U, L(m.value) + "/" + L(C.value), 1), _("div", {
                    class: k(["MyGameRecord__C-foot-next", {
                        disabled: m.value >= C.value
                    }]),
                    onClick: j
                }, [g(o, {
                    name: "arrow",
                    class: "MyGameRecord__C-icon",
                    size: "20"
                })], 2)])) : G("v-if", !0)])
            }
        }
    });
const te = K(X, [
    ["__scopeId", "data-v-cffd8c9f"],
    ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/Home/AllLotteryGames/K3/MyGameRecord.vue"]
]);
export {
    te as M
};