import {
    G as M,
    r as v,
    z as H,
    R as G,
    $ as A,
    a_ as Q,
    C as q,
    E as X,
    aK as J,
    H as E,
    N as h,
    I as y,
    Q as d,
    O as i,
    ax as I,
    ay as $,
    J as r,
    P as p,
    av as W,
    aB as j,
    a$ as Y,
    u as c,
    F as D,
    aC as Z,
    aD as ee,
    ap as P,
    ao as B
} from "./common.modules-5cfe2cf4.js";
import {
    d as ne,
    P as N,
    V as le,
    v as R,
    E as ie,
    b as ue,
    c as K,
    e as de
} from "./page-login-index.vue_vue_type_script_setup_true_lang.ts-f69c0404.js";
import {
    a3 as V,
    G as F,
    A as x,
    bE as me,
    bF as se,
    bG as ae,
    cE as te,
    _ as oe,
    b$ as ce,
    bK as pe,
    N as ve
} from "./page-activity-ActivityDetail-a58ec568.js";
const we = w => (Z("data-v-e7fb7c52"), w = w(), ee(), w),
    ge = {
        class: "register__container"
    },
    _e = {
        class: "register__container-tip"
    },
    be = we(() => r("div", {
        class: "tipbg"
    }, null, -1)),
    fe = {
        class: "register__container-tips"
    },
    he = {
        class: "register__container-remember"
    },
    ye = {
        class: "register__container-button"
    },
    Se = M({
        __name: "ResetPassword",
        setup(w, {
            expose: T
        }) {
            const C = v("reset"),
                {
                    t: n
                } = H(),
                s = V(),
                l = G(),
                g = v(!1),
                S = F(),
                b = v(!1),
                m = v(!1),
                e = v({
                    numberType: s.userForm.numberType,
                    number: "",
                    password: "",
                    rePassword: "",
                    smsvcode: ""
                });
            sessionStorage.getItem("rpwd") && (e.value = JSON.parse(sessionStorage.getItem("rpwd") || ""), sessionStorage.setItem("rpwd", "")), A(() => s.rPwdForm.numberType, t => {
                !e.value.numberType && (e.value.numberType = t)
            }, {
                flush: "post"
            });
            const a = async () => {
                const t = (e.value.number.trim() + e.value.numberType).length;
                if (t < 10 || t > 14) return s.setCountDown(0), c({
                    message: n("wrongTel"),
                    wordBreak: "break-word"
                });
                await x(me({
                    phone: e.value.numberType + e.value.number,
                    codeType: se.resetPassword
                })) ? D(n("sendSuccess")) : setTimeout(() => {
                    s.setCountDown(0)
                }, 500)
            };
            async function _() {
                const t = (e.value.number.trim() + e.value.numberType).length;
                if (t < 10 || t > 14) return c({
                    message: n("wrongTel"),
                    wordBreak: "break-word"
                });
                if (!e.value.number.trim() || g.value) {
                    g.value = !0;
                    return
                }
                if (s.isOpenForgetPasswordSMSState)
                    if (e.value.smsvcode.trim()) {
                        if (e.value.smsvcode.trim().length != 6) return c({
                            message: n("verifyCode6Digits"),
                            wordBreak: "break-word"
                        })
                    } else return c({
                        message: n("registerTip1"),
                        wordBreak: "break-word"
                    });
                if (!e.value.password.trim()) return c({
                    message: n("registerTip2"),
                    wordBreak: "break-word"
                });
                if (!R.passReg3.test(e.value.password)) {
                    m.value = !0;
                    return
                }
                if (!e.value.rePassword.trim()) return c({
                    message: n("registerTip3"),
                    wordBreak: "break-word"
                });
                if (e.value.password !== e.value.rePassword) {
                    b.value = !0;
                    return
                } else b.value = !1;
                if (!s.userForm.termAndPolicy) return c({
                    message: n("registerDesc1"),
                    wordBreak: "break-word"
                });
                const {
                    numberType: o,
                    number: f,
                    password: u,
                    smsvcode: z
                } = e.value;
                let re = {
                    username: o + f.trim(),
                    password: u,
                    smsvcode: z,
                    type: "mobile"
                };
                await x(ae(re)) && (localStorage.getItem("token") && (await te({}), S.token = "", s.userForm.vCode = "", s.loginout(), localStorage.setItem("isToLogin", "1"), F().setToken("")), l.push("/login"), D(n("rpdsucceed")))
            }
            Q(window, "keydown", t => {
                t.key == "Enter" && _()
            });
            const k = () => {
                    l.push({
                        name: "About-AboutDetail"
                    })
                },
                O = t => {
                    e.value.numberType = t
                },
                L = t => {
                    e.value.number = t
                };
            q(() => {
                s.setCountDown(0)
            });
            let U = A(() => e.value.number, t => {
                s.setCountDown(0)
            }, {
                flush: "post"
            });
            return X(() => {
                U()
            }), J((t, o) => {
                t.name == "About-AboutDetail" ? sessionStorage.setItem("rpwd", JSON.stringify(e.value)) : sessionStorage.setItem("rpwd", "")
            }), T({
                showPhoneValidate: g
            }), (t, o) => {
                const f = E("van-checkbox");
                return h(), y("div", ge, [d(ne, {
                    "show-validate": g.value,
                    "onUpdate:showValidate": o[0] || (o[0] = u => g.value = u),
                    "number-type": e.value.numberType,
                    number: e.value.number,
                    type: C.value,
                    onChangeT: O,
                    onChangeN: L
                }, null, 8, ["show-validate", "number-type", "number", "type"]), d(N, {
                    value: e.value.password,
                    "onUpdate:value": o[1] || (o[1] = u => e.value.password = u),
                    label: i(n)("newPSWRest")
                }, null, 8, ["value", "label"]), I(r("div", _e, [be, r("span", null, p(i(n)("pswRule")), 1)], 512), [
                    [$, m.value]
                ]), d(N, {
                    value: e.value.rePassword,
                    "onUpdate:value": o[2] || (o[2] = u => e.value.rePassword = u),
                    label: i(n)("newPSWconfirm")
                }, null, 8, ["value", "label"]), I(r("div", fe, [r("span", null, p(i(n)("unmatchedInput")), 1)], 512), [
                    [$, b.value]
                ]), d(le, {
                    value: e.value.smsvcode,
                    "onUpdate:value": o[3] || (o[3] = u => e.value.smsvcode = u),
                    number: e.value.number,
                    sendFunc: a,
                    numberType: e.value.numberType,
                    loginType: "1"
                }, null, 8, ["value", "number", "numberType"]), r("div", he, [d(f, {
                    modelValue: i(s).userForm.termAndPolicy,
                    "onUpdate:modelValue": o[5] || (o[5] = u => i(s).userForm.termAndPolicy = u)
                }, {
                    default: W(() => [j(p(i(n)("readNagree")) + " ", 1), r("span", {
                        onClick: o[4] || (o[4] = Y(u => k(), ["stop"]))
                    }, p(i(n)("desPrivacy")), 1)]),
                    _: 1
                }, 8, ["modelValue"])]), r("div", ye, [r("button", {
                    onClick: _
                }, p(i(n)("reset")), 1)])])
            }
        }
    });
const ke = oe(Se, [
        ["__scopeId", "data-v-e7fb7c52"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR048-Pages-india-91club/src/components/Login/ResetPassword.vue"]
    ]),
    Pe = w => (Z("data-v-470fd154"), w = w(), ee(), w),
    Te = {
        class: "register__container"
    },
    Ce = {
        class: "register__container-tip"
    },
    Ie = Pe(() => r("div", {
        class: "tipbg"
    }, null, -1)),
    $e = {
        class: "register__container-tips"
    },
    Fe = {
        class: "register__container-remember"
    },
    Be = {
        class: "register__container-button"
    },
    Re = M({
        __name: "ResetEmailPassword",
        setup(w, {
            expose: T
        }) {
            const {
                registerState: C
            } = ce();
            C();
            const n = v("reset"),
                {
                    t: s
                } = H(),
                l = V(),
                g = F(),
                S = G(),
                b = v(!1),
                m = v(!1),
                e = v(!1),
                a = v({
                    numberType: l.userForm.numberType,
                    number: "",
                    email: "",
                    password: "",
                    rePassword: "",
                    smsvcode: ""
                });
            sessionStorage.getItem("rpwd") && (a.value = JSON.parse(sessionStorage.getItem("rpwd") || ""), sessionStorage.setItem("rpwd", "")), A(() => l.rPwdForm.numberType, t => {
                !a.value.numberType && (a.value.numberType = t)
            }, {
                flush: "post"
            });
            const _ = async () => {
                if (!R.email1.test(a.value.email)) return l.setCountEmailDown(0), c({
                    message: s(K.email),
                    wordBreak: "break-word"
                });
                await x(pe({
                    email: a.value.email,
                    emailType: se.resetPassword
                })) ? D(s("sendSuccess")) : setTimeout(() => {
                    l.setCountEmailDown(0)
                }, 500)
            };
            async function k() {
                if (!R.email1.test(a.value.email)) return c({
                    message: s(K.email),
                    wordBreak: "break-word"
                });
                if (l.isOpenForgetPasswordEmailState)
                    if (a.value.smsvcode.trim()) {
                        if (a.value.smsvcode.trim().length != 6) return c({
                            message: s("verifyCode6Digits"),
                            wordBreak: "break-word"
                        })
                    } else return c({
                        message: s("registerTip6"),
                        wordBreak: "break-word"
                    });
                if (!a.value.password.trim()) return c({
                    message: s("registerTip2"),
                    wordBreak: "break-word"
                });
                if (!R.passReg3.test(a.value.password)) {
                    e.value = !0;
                    return
                }
                if (!a.value.rePassword.trim()) return c({
                    message: s("registerTip3"),
                    wordBreak: "break-word"
                });
                if (a.value.password !== a.value.rePassword) {
                    m.value = !0;
                    return
                } else m.value = !1;
                if (!l.userForm.termAndPolicy) return c({
                    message: s("registerDesc1"),
                    wordBreak: "break-word"
                });
                const {
                    email: t,
                    password: o,
                    smsvcode: f
                } = a.value;
                let u = {
                    username: t.trim(),
                    password: o,
                    type: "email",
                    smsvcode: f
                };
                await x(ae(u)) && (localStorage.getItem("token") && (await te({}), g.token = "", l.userForm.vCode = "", l.loginout(), localStorage.setItem("isToLogin", "1"), F().setToken("")), S.push("/login"), D(s("rpdsucceed")))
            }
            Q(window, "keydown", t => {
                t.key == "Enter" && k()
            });
            const O = () => {
                    S.push({
                        name: "About-AboutDetail"
                    })
                },
                L = t => {
                    a.value.email = t
                };
            q(() => {
                l.setCountEmailDown(0)
            });
            let U = A(() => a.value.email, t => {
                l.setCountEmailDown(0)
            }, {
                flush: "post"
            });
            return X(() => {
                U()
            }), J((t, o) => {
                t.name == "About-AboutDetail" ? sessionStorage.setItem("rpwd", JSON.stringify(a.value)) : sessionStorage.setItem("rpwd", "")
            }), T({
                showPhoneValidate: b
            }), (t, o) => {
                const f = E("van-checkbox");
                return h(), y("div", Te, [d(ie, {
                    ref: "email",
                    type: n.value,
                    email: a.value.email,
                    onChangeN: L
                }, null, 8, ["type", "email"]), d(N, {
                    value: a.value.password,
                    "onUpdate:value": o[0] || (o[0] = u => a.value.password = u),
                    label: i(s)("newPSWRest")
                }, null, 8, ["value", "label"]), I(r("div", Ce, [Ie, r("span", null, p(i(s)("pswRule")), 1)], 512), [
                    [$, e.value]
                ]), d(N, {
                    value: a.value.rePassword,
                    "onUpdate:value": o[1] || (o[1] = u => a.value.rePassword = u),
                    label: i(s)("newPSWconfirm")
                }, null, 8, ["value", "label"]), I(r("div", $e, [r("span", null, p(i(s)("unmatchedInput")), 1)], 512), [
                    [$, m.value]
                ]), d(ue, {
                    value: a.value.smsvcode,
                    "onUpdate:value": o[2] || (o[2] = u => a.value.smsvcode = u),
                    sendFunc: _,
                    email: a.value.email
                }, null, 8, ["value", "email"]), r("div", Fe, [d(f, {
                    modelValue: i(l).userForm.termAndPolicy,
                    "onUpdate:modelValue": o[4] || (o[4] = u => i(l).userForm.termAndPolicy = u)
                }, {
                    default: W(() => [j(p(i(s)("readNagree")) + " ", 1), r("span", {
                        onClick: o[3] || (o[3] = Y(u => O(), ["stop"]))
                    }, p(i(s)("desPrivacy")), 1)]),
                    _: 1
                }, 8, ["modelValue"])]), r("div", Be, [r("button", {
                    onClick: k
                }, p(i(s)("reset")), 1)])])
            }
        }
    });
const Ae = oe(Re, [
        ["__scopeId", "data-v-470fd154"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR048-Pages-india-91club/src/components/Login/ResetEmailPassword.vue"]
    ]),
    Ee = {
        class: "rpwd__C"
    },
    De = {
        class: "rpwd__C-heading"
    },
    Ne = {
        class: "rpwd__C-heading__title"
    },
    Ve = {
        class: "rpwd__C-heading__subTitle"
    },
    xe = {
        class: "login_container-tab"
    },
    Oe = {
        class: "rpwd__C-form"
    },
    Je = M({
        __name: "index",
        setup(w) {
            const {
                t: T
            } = ve.global, C = F(), n = V();
            n.getRegisterState();
            const s = G(),
                l = v("phone");
            n.isOpenForgetPasswordSMSState || (l.value = "email");
            const g = v(!0);

            function S() {
                s.go(-1)
            }
            const b = m => {
                l.value = m
            };
            return C.token && (g.value = !1), J((m, e, a) => {
                m.name !== "About-AboutDetail" && V().clearRpwdData(), a()
            }), (m, e) => {
                const a = E("NavBar"),
                    _ = E("svg-icon");
                return h(), y("div", Ee, [d(a, {
                    onClickLeft: S,
                    leftArrow: !0,
                    headLogo: !0,
                    class: "main"
                }, {
                    right: W(() => [d(de)]),
                    _: 1
                }), r("div", De, [r("h1", Ne, p(i(T)("forgetPSW")), 1), r("div", Ve, [r("div", null, p(m.$t("changepasswordphoneoremail")), 1)])]), r("div", xe, [i(n).isOpenForgetPasswordSMSState ? (h(), y("div", {
                    key: 0,
                    class: P(["tab", [l.value == "phone" ? "active" : ""]]),
                    onClick: e[0] || (e[0] = k => b("phone"))
                }, [d(_, {
                    name: "phone"
                }), r("div", {
                    class: P([l.value == "phone" ? "phonefont30active" : ""])
                }, p(m.$t("changepasswordphone")), 3)], 2)) : B("v-if", !0), i(n).isOpenForgetPasswordEmailState ? (h(), y("div", {
                    key: 1,
                    class: P(["tab", [l.value == "email" ? "active" : ""]]),
                    onClick: e[1] || (e[1] = k => b("email"))
                }, [r("div", null, [d(_, {
                    name: "email"
                }), j(), I(d(_, {
                    name: "user"
                }, null, 512), [
                    [$, i(n).isOpenExternalAccount]
                ])]), r("div", {
                    class: P([l.value == "email" ? "emailfont30active" : ""])
                }, p(m.$t("changepasswordemail")), 3)], 2)) : B("v-if", !0)]), r("div", Oe, [i(n).isOpenForgetPasswordSMSState ? (h(), y("div", {
                    key: 0,
                    class: P(["tab-content", [l.value == "phone" ? "activecontent" : ""]])
                }, [d(ke)], 2)) : B("v-if", !0), i(n).isOpenForgetPasswordEmailState ? (h(), y("div", {
                    key: 1,
                    class: P(["tab-content", [l.value == "email" ? "activecontent" : ""]])
                }, [d(Ae)], 2)) : B("v-if", !0)])])
            }
        }
    });
export {
    Je as _
};