import {
    G as R,
    R as N,
    T as H,
    z as M,
    r as c,
    B as k,
    C as V,
    H as O,
    I as u,
    Q as _,
    J as t,
    P as n,
    av as y,
    O as i,
    aB as p,
    ao as m,
    b4 as U,
    q as j,
    n as q,
    N as v,
    K as D,
    M as F,
    b0 as J,
    b1 as G
} from "./common.modules-5cfe2cf4.js";
import {
    y as b,
    L as S,
    A as z,
    cJ as K,
    g as $,
    au as Q,
    _ as W
} from "./page-activity-ActivityDetail-a58ec568.js";
import "./page-turntable-assets-d6267459.js";
import "./native/index-2ac88fb8.js";
import "./en-cfd26acf.js";
const X = {
        class: "promotionShare__container"
    },
    Y = {
        class: "promotionShare__container-tips"
    },
    Z = ["id"],
    x = {
        class: "sContent"
    },
    ee = {
        class: "head1"
    },
    te = ["innerHTML"],
    ne = {
        class: "head3"
    },
    oe = ["src"],
    se = ["src"],
    ae = ["innerHTML"],
    ie = ["id"],
    re = {
        class: "promotionShare__container-slogan"
    },
    le = {
        class: "promotionShare__container-buttons"
    },
    de = R({
        __name: "index",
        setup(ce) {
            const I = N();
            H();
            const {
                t: C
            } = M(), h = c(0), g = c(""), f = c(!1);
            let l = c("");
            const L = e => {},
                P = e => {
                    h.value = e.activeIndex, console.log(e.activeIndex)
                },
                B = () => {
                    I.back()
                };
            k(() => b().getProjectLogo), k(() => b().getProjectName);
            const T = () => {
                S(l.value.toString())
            };
            async function A() {
                const e = await z(K());
                if (console.log("res: ", e.data.url, window.location.origin), e) {
                    g.value = e.data.landingPageUrl, f.value = e.data.isLandingPageEnabled, e.data.url.startsWith("http") ? l.value = e.data.url : l.value = window.location.href.substring(0, window.location.href.lastIndexOf("/#/") + 2) + "/" + e.data.url.substring(e.data.url.lastIndexOf("re"), e.data.url.length);
                    for (let o = 1; o <= 3; o++) U.toCanvas(document.getElementById("qr-code" + o), l.value, a => {
                        a && console.error(a)
                    })
                }
            }
            const E = async e => {
                var o = document.getElementById(e);
                const a = j({
                        message: C("loading"),
                        duration: 0,
                        forbidClick: !0
                    }),
                    s = await q(() =>
                        import ("./common.modules-5cfe2cf4.js").then(r => r.cu), ["assets/js/common.modules-5cfe2cf4.js", "assets/css/common-05d2aa17.css"]),
                    w = s.default || s;
                w && w.toPng(o).then(r => {
                    const d = document.createElement("a");
                    d.href = r, d.download = "share.jpeg", document.body.appendChild(d), d.click(), a.close()
                }).catch(r => {
                    a.close(), console.error("Error generating image:", r)
                })
            };
            return V(() => {
                A()
            }), (e, o) => {
                const a = O("NavBar");
                return v(), u("div", X, [_(a, {
                    title: e.$t("titleInvite"),
                    "left-arrow": "",
                    onClickLeft: B
                }, null, 8, ["title"]), t("div", Y, [t("p", null, n(e.$t("tipSwipeToPickBrochure")), 1)]), _(i(G), {
                    class: "my-swipe",
                    slidesPerView: "auto",
                    centeredSlides: !0,
                    "space-between": 20,
                    onSwiper: L,
                    onSlideChange: P
                }, {
                    default: y(() => [(v(), u(D, null, F(3, s => _(i(J), {
                        key: s
                    }, {
                        default: y(() => [t("div", {
                            class: "promotionShare__container-swiper",
                            id: "share" + (s - 1)
                        }, [t("div", x, [t("div", ee, [t("div", null, n(e.$t("fairAndJust")), 1), t("div", null, n(e.$t("openAndTransparent")), 1)]), t("div", {
                            class: "head2",
                            innerHTML: e.$t("fullOddsReturnRate")
                        }, null, 8, te), t("div", ne, [t("div", null, [t("img", {
                            class: "logo",
                            src: i($)("promotion", "bank"),
                            alt: ""
                        }, null, 8, oe), p(" " + n(e.$t("financialSecurity")), 1)]), t("div", null, [t("img", {
                            class: "logo",
                            src: i($)("promotion", "trucktick"),
                            alt: ""
                        }, null, 8, se), p(" " + n(e.$t("withdrawFast")), 1)])]), t("div", {
                            class: "head4",
                            innerHTML: e.$t("highestRebate", [85])
                        }, null, 8, ae)]), t("canvas", {
                            id: "qr-code" + s
                        }, null, 8, ie)], 8, Z)]),
                        _: 2
                    }, 1024)), 64))]),
                    _: 1
                }), t("div", re, [t("p", null, n(e.$t("inviteFriends")), 1), t("p", null, [p(n(e.$t("divideBonus")) + " ", 1), t("span", null, n(e.$t("tip10billion")), 1), p(" " + n(e.$t("commission")), 1)])]), t("div", le, [i(Q)() ? m("v-if", !0) : (v(), u("div", {
                    key: 0,
                    class: "share",
                    onClick: o[0] || (o[0] = s => E("share" + h.value))
                }, n(e.$t("shareInvitationPoster")), 1)), t("div", {
                    class: "cpy",
                    onClick: T
                }, n(e.$t("copyInvitationLink")), 1), f.value ? (v(), u("div", {
                    key: 1,
                    class: "cpy",
                    onClick: o[1] || (o[1] = s => i(S)(g.value))
                }, n(e.$t("clanding")), 1)) : m("v-if", !0), m(" <div>{{ $t('copyInvitationLink') }}</div> ")])])
            }
        }
    });
const he = W(de, [
    ["__scopeId", "data-v-3b74cce6"],
    ["__file", "/usr/local/jenkins-prod/workspace/AR048-Pages-india-91club/src/views/promotion/PromotionShare/index.vue"]
]);
export {
    he as
    default
};