import{C as N,N as M,O as R,v as V,r as u,x as y,y as H,D as j,E as p,M as m,F as t,K as n,as as k,J as i,ay as v,al as l,aZ as O,a1 as U,n as D,I as _,G as F,H as q,aV as G,aW as J}from"./common.modules-7b90237f.js";import{y as S,L as I,A as W,ch as z,g as $,aM as K,_ as Z}from"./page-activity-ActivityDetail-27bd7cf0.js";import"./page-turntable-assets-d6267459.js";import"./native/index-ecf1462d.js";import"./en-91d2fc72.js";const Q={class:"promotionShare__container"},X={class:"promotionShare__container-tips"},Y=["id"],x={class:"sContent"},ee={class:"head1"},te=["innerHTML"],ne={class:"head3"},oe=["src"],ae=["src"],se=["innerHTML"],ie=["id"],re={class:"promotionShare__container-slogan"},le={class:"promotionShare__container-buttons"},de=N({__name:"index",setup(ce){const b=M();R();const{t:C}=V(),h=u(0),g=u(""),f=u(!1);let d=u("");const L=e=>{},P=e=>{h.value=e.activeIndex},E=()=>{b.back()};y(()=>S().getProjectLogo),y(()=>S().getProjectName);const T=()=>{I(d.value.toString())};async function B(){const e=await W(z());if(e){g.value=e.data.landingPageUrl,f.value=e.data.isLandingPageEnabled,e.data.url.startsWith("http")?d.value=e.data.url:d.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++)O.toCanvas(document.getElementById("qr-code"+o),d.value,s=>{s&&console.error(s)})}}const A=async e=>{var o=document.getElementById(e);const s=U({message:C("loading"),duration:0,forbidClick:!0}),a=await D(()=>import("./common.modules-7b90237f.js").then(r=>r.cp),["assets/js/common.modules-7b90237f.js","assets/css/common-e210f711.css"]),w=a.default||a;w&&w.toPng(o).then(r=>{const c=document.createElement("a");c.href=r,c.download="share.jpeg",document.body.appendChild(c),c.click(),s.close()}).catch(r=>{s.close(),console.error("Error generating image:",r)})};return H(()=>{B()}),(e,o)=>{const s=j("NavBar");return _(),p("div",Q,[m(s,{title:e.$t("titleInvite"),"left-arrow":"",onClickLeft:E},null,8,["title"]),t("div",X,[t("p",null,n(e.$t("tipSwipeToPickBrochure")),1)]),m(i(J),{class:"my-swipe",slidesPerView:"auto",centeredSlides:!0,"space-between":20,onSwiper:L,onSlideChange:P},{default:k(()=>[(_(),p(F,null,q(3,a=>m(i(G),{key:a},{default:k(()=>[t("div",{class:"promotionShare__container-swiper",id:"share"+(a-1)},[l(` <img v-lazy="getIcons('promotion/promotionShare', 'poster')" /> `),t("div",x,[l('						<img class="logo" data-html2canvas-ignore :src="projectIcon" alt="" />'),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),v(" "+n(e.$t("financialSecurity")),1)]),t("div",null,[t("img",{class:"logo",src:i($)("promotion","trucktick"),alt:""},null,8,ae),v(" "+n(e.$t("withdrawFast")),1)])]),t("div",{class:"head4",innerHTML:e.$t("highestRebate",[85])},null,8,se)]),t("canvas",{id:"qr-code"+a},null,8,ie)],8,Y)]),_:2},1024)),64))]),_:1}),t("div",re,[t("p",null,n(e.$t("inviteFriends")),1),t("p",null,[v(n(e.$t("divideBonus"))+" ",1),t("span",null,n(e.$t("tip10billion")),1),v(" "+n(e.$t("commission")),1)])]),t("div",le,[i(K)()?l("v-if",!0):(_(),p("div",{key:0,class:"share",onClick:o[0]||(o[0]=a=>A("share"+h.value))},n(e.$t("shareInvitationPoster")),1)),t("div",{class:"cpy",onClick:T},n(e.$t("copyInvitationLink")),1),f.value?(_(),p("div",{key:1,class:"cpy",onClick:o[1]||(o[1]=a=>i(I)(g.value))},n(e.$t("clanding")),1)):l("v-if",!0),l(" <div>{{ $t('copyInvitationLink') }}</div> ")])])}}});const he=Z(de,[["__scopeId","data-v-3b74cce6"],["__file","/usr/local/jenkins-prod/workspace/ar079-india-tashanwin/src/views/promotion/PromotionShare/index.vue"]]);export{he as default};
