1import{_ as rt}from"./DnUT4gl2.js";import{_ as ut}from"./BU39HjjK.js";import{d as fe,b as xe,c as Ae,a as ce,u as ie,e as S,q as P,f as A,o as c,l as t,k as x,g as M,h as e,K as q,t as r,N as Le,w as R,F as Pe,r as Re,m as z,aP as mt,s as Ee,D as me,i as Z,U as Ue,O as Xe,aO as ct,V as pt,ab as Ke,M as we,v as Ne,z as Be,B as et,x as _e,_ as Ve,aM as dt,aJ as tt,R as Ge,aY as ft,Q as vt,a7 as yt,a_ as gt}from"./Y4ICXCuc.js";import{E as bt}from"./yhRu0ssi.js";import{_ as ot,a as ht,b as Ct}from"./CG73lJpV.js";import{_ as wt}from"./bX4OmDCk.js";import{v as qe}from"./BPzcK7w0.js";import{E as Tt}from"./BDO9QEQJ.js";import"./DVzYJwT5.js";import{V as St}from"./DkH_gNP6.js";import{o as Ye}from"./D2-BrpQ8.js";import{u as Fe}from"./Ds-VHX1L.js";import{b as ze,e as nt,h as _t}from"./JffoND0l.js";import{E as It}from"./q9yNHxoh.js";import{E as lt}from"./BRWwJqKy.js";import{E as at,a as st}from"./BqK22eZm.js";import"./BrkzQORG.js";import{d as Oe}from"./C6Bxth9v.js";import{E as At,a as Lt}from"./QSOktryP.js";import{E as $t}from"./CIf3jNmk.js";import"./CUrE0vbu.js";import"./DP0-JWAl.js";import{u as kt}from"./DK5zXFld.js";import{d as We}from"./BQ977c7p.js";import"./aMyN3jB5.js";import"./BE20p1dL.js";import"./BH9nULxh.js";import"./DTC6CVyF.js";import"./DbDwZyaJ.js";import"./CGgbl_zB.js";import"./DbdTMwVV.js";import"./vMIVouA4.js";import"./anKvzuH2.js";import"./Ca1OSTWz.js";import"./NVAjB_Yf.js";import"./CailpaEi.js";const xt=""+new URL("lw1.BPI0-S81.png",import.meta.url).href,Bt=""+new URL("lw2.DHBNiE3A.png",import.meta.url).href,Mt=""+new URL("lw3.DIEYbDDV.png",import.meta.url).href,Dt=""+new URL("lw4.BXsPUmfr.png",import.meta.url).href,Ut=""+new URL("leftimg.D7UZSbOb.png",import.meta.url).href,Nt={class:"mtown-top-deposit-box"},Ft={class:"tdb-content"},Pt={key:0,class:"tdp-left-img"},Rt=["src"],Et={class:"tdp-left"},Wt={class:"title"},Vt={class:"tlt"},Gt={key:0},qt={key:0,class:"tlb"},zt={class:"toprightbtn"},Ot={key:0,class:"tlb tlb-mobile"},jt={class:"tdp-right"},Ht={class:"b-box"},Qt=["src"],Yt={class:"text-box"},Jt={class:"tl2"},Zt=fe({__name:"PromoBannerDeposit",setup(n){const D=xe(),T=Ae(),a=ce(),{t:u,locale:d}=ie(),p=S(()=>a.isMobile),s=S(()=>a.isLogin),B=P([{bg:xt,des:"300%",btn:u("promotion.allSlotsBonus")},{bg:Bt,des:"200%",btn:u("promotion.setSlotsBonus")},{bg:Mt,des:"100%",btn:u("promotion.sportsBonus")},{bg:Dt,des:"80%",btn:u("promotion.liveCasinoBonus")}]),h=()=>{s.value?D.push(T({path:"/account/deposit"})):a.setLoginVisible(!0)};return(C,g)=>{const i=Le,o=bt;return c(),A("div",Nt,[t("div",Ft,[e(p)?x("",!0):(c(),A("div",Pt,[t("img",{src:e(Ut)},null,8,Rt)])),t("div",Et,[t("span",Wt,[t("span",Vt,[q(r(e(u)("promotion.upTo")),1),g[0]||(g[0]=t("span",{class:"numbers"}," 680% ",-1)),e(p)?x("",!0):(c(),A("br",Gt)),q(r(e(u)("common.welcomeBonus")),1)]),e(p)?x("",!0):(c(),A("span",qt,r(e(u)("promotion.depositBonusToday")),1))]),t("div",zt,[e(p)?(c(),A("p",Ot,r(e(u)("promotion.depositBonusToday")),1)):x("",!0),M(i,{onClick:h},{default:R(()=>[q(r(e(u)("common.depositNow")),1)]),_:1})])]),M(o,{always:!0},{default:R(()=>[t("div",jt,[(c(!0),A(Pe,null,Re(e(B),(w,I)=>(c(),A("div",Ht,[t("img",{src:w.bg},null,8,Qt),t("div",Yt,[t("p",{class:z(["tl1",`tl1-${I}`])},r(w.des),3),t("p",Jt,r(w.btn),1)])]))),256))])]),_:1})])])}}}),Xt=["src"],Kt={key:1},eo={class:"flex items-center justify-center w-100%"},to={__name:"PromoFormBody",props:{visible:Boolean,formField:"",contentId:0,themeStyle:String},emits:["update:visible","updataList"],setup(n,{emit:D}){const T=n,a=D,d=mt().app.boapi,{t:p}=ie(),s=ce(),B=Ee(),h=S(()=>B.currentRegionLang.areaCode),C=P({}),g=S(()=>{if(!T.formField)return[];let l=T.formField.split(",");return l.indexOf("uploadImage")>-1&&(l.splice(l.indexOf("uploadImage"),1),l=l.concat(["IDCardFront","IDCardBack"])),l}),i=l=>{const k={};return l.forEach(X=>{k[X]=""}),k};me(g,l=>{C.value=i(l)},{deep:!0}),me(()=>T.visible,l=>{l&&(C.value=i(g.value))},{immediate:!0});const o=S(()=>g.value.map(l=>{let k={label:l=="IDCardFront"||l=="IDCardBack"?"Upload Image":w(l),key:l};return l=="address"||l=="remark"||l=="shippingAddress"?k.type="textarea":l=="IDCardFront"||l=="IDCardBack"?k.type="uploadImage":k.type="text",k}));function w(l){return l=l.split("").map(k=>{let X=k;return k.toUpperCase()==k&&(X=" "+k),X}).join(""),l.slice(0,1).toUpperCase()+l.slice(1)}const I=P(!1),U=Oe(async()=>{I.value=!0;let l={...C.value};l.uploadImage=l.IDCardFront,l.uploadImage2=l.IDCardBack,l.appliedPhone&&(l.appliedPhone=h.value+l.appliedPhone);try{await Ke("/player/setting/addPromotionContentMember",{loginId:s.userInfo.loginId,contentId:T.contentId,merchantLanguageId:B.currentRegionLang.languageId,...l}),we.success("Submit successful!"),a("update:visible",!1),a("updataList")}finally{I.value=!1}},500),E=P(),m=P(!1),L=P(!1),W=l=>{const{data:k}=l;C.value.IDCardFront=k,m.value=!1},f=l=>{const{data:k}=l;C.value.IDCardBack=k,L.value=!1},V=l=>{E.value[0].clearFiles(),Ne(()=>{E.value[0].handleStart(l[0])})},ne=()=>`xxxxxxxx-xxxx-${new Date().getTime()}-yxxx`.replace(/[xy]/g,function(X){var O=Math.random()*12|0,ue=X=="x"?O:O&3|8;return ue.toString(12)}),re=l=>{if((l==null?void 0:l.status)==="ready"){const k=l.name.substring(l.name.lastIndexOf(".")+1);let X=ne()+"."+k,O=new File([l.raw],X,{type:l.raw.type});O.uid=l.uid,l.raw=O,E.value[0].submit()}},N=l=>{if((l==null?void 0:l.status)==="ready"){const k=l.name.substring(l.name.lastIndexOf(".")+1);let X=ne()+"."+k,O=new File([l.raw],X,{type:l.raw.type});O.uid=l.uid,l.raw=O,E.value[1].submit()}},J=S(()=>Object.values(C.value).every(l=>l!=null&&l!==""));return(l,k)=>{const X=Xe,O=It,ue=lt,ae=at,K=Le,se=st,Te=qe;return e(C)?(c(),A("div",{key:0,class:z(["modal-content promoForm",n.themeStyle+"-promotion-transfer"])},[n.formField?(c(),Z(se,{key:0,model:e(C),"label-width":"auto"},{default:R(()=>[(c(!0),A(Pe,null,Re(o.value,j=>(c(),Z(ae,{label:j.label},{default:R(()=>[j.type=="uploadImage"?(c(),Z(O,{key:0,"show-file-list":!1,action:`${e(d)}/player/transaction/importReport`,class:"receipt-uploader border-#c0c4cc border-1px border-r","on-success":j.key=="IDCardFront"?W:f,accept:".png,.jpg,.jpeg","on-exceed":V,"auto-upload":!1,"on-change":j.key=="IDCardFront"?re:N,limit:1,ref_for:!0,ref_key:"uploadRef",ref:E,"on-progress":()=>j.key=="IDCardFront"?m.value=!0:L.value=!0,"on-error":()=>j.key=="IDCardFront"?m.value=!1:L.value=!1},{default:R(()=>[Ue((c(),A("div",{class:z(["w-[120px] h-[120px] flex items-center justify-center",{"has-img":e(C)[j.key]}])},[e(C)[j.key]?(c(),A("img",{key:0,src:e(C)[j.key],class:"receiptImgUrl"},null,8,Xt)):(c(),A("span",Kt,[M(X,{class:"uploader-icon mr-5px"},{default:R(()=>[M(e(ct))]),_:1}),q(" Upload ID "+r(j.key=="IDCardFront"?"Front":"Back"),1)]))],2)),[[Te,j.key=="IDCardFront"?e(m):e(L)]])]),_:2},1032,["action","on-success","on-change","on-progress","on-error"])):(c(),Z(ue,{key:1,modelValue:e(C)[j.key],"onUpdate:modelValue":Se=>e(C)[j.key]=Se,type:j.type,class:z(j.key=="appliedPhone"?"applyphone":"")},pt({_:2},[j.key=="appliedPhone"?{name:"prepend",fn:R(()=>[q(r(h.value),1)]),key:"0"}:void 0]),1032,["modelValue","onUpdate:modelValue","type","class"]))]),_:2},1032,["label"]))),256)),M(ae,null,{default:R(()=>[t("div",eo,[M(K,{onClick:e(U),size:"large",class:"w-100% submit-btn",loading:e(I),disabled:!J.value},{default:R(()=>[q(r(e(p)("common.submit")),1)]),_:1},8,["onClick","loading","disabled"])])]),_:1})]),_:1},8,["model"])):x("",!0)],2)):x("",!0)}}},oo=fe({__name:"index",props:{visible:Boolean,formField:"",contentId:0,themeStyle:String},emits:["update:visible","updataList"],setup(n,{emit:D}){const{t:T}=ie(),a=ce(),u=Fe(),d=n,p=D,s=S({get:()=>d.visible,set:i=>p("update:visible",i)}),B=S(()=>a.isMobile),h=S(()=>ze(d.themeStyle)),C=S(()=>{var i;return((i=h.value)==null?void 0:i.promoFormModalTemplate)==="drawer"&&B.value}),g=()=>{u.open("promoForm",{formField:d.formField,contentId:d.contentId,themeStyle:d.themeStyle,onUpdataList:()=>p("updataList"),onClose:()=>{d.visible&&p("update:visible",!1)}})};return me(()=>d.visible,i=>{i&&C.value&&g()}),me(C,()=>{d.visible&&(u.closeLayer("promoForm"),p("update:visible",!1))}),(i,o)=>{const w=ot;
1return C.value?x("",!0):(c(),Z(w,{key:0,type:"form",modelValue:s.value,"onUpdate:modelValue":[o[2]||(o[2]=I=>s.value=I),o[3]||(o[3]=I=>i.$emit("update:visible",I))],title:e(T)("promotion.fillinform"),width:"390",themeStyle:n.themeStyle},{default:R(()=>[M(to,{visible:n.visible,"form-field":n.formField,"content-id":n.contentId,"theme-style":n.themeStyle,"onUpdate:visible":o[0]||(o[0]=I=>s.value=I),onUpdataList:o[1]||(o[1]=I=>p("updataList"))},null,8,["visible","form-field","content-id","theme-style"])]),_:1},8,["modelValue","title","themeStyle"]))}}}),no={class:"pt-0"},lo={key:0,class:"groupTypeText"},ao={key:0},so={key:1},io={key:2},ro={class:"mainWalletBox pos-relative flex items-center"},uo={class:"flex items-center flex-1 pr-10px pl-15px pt-5px"},mo={class:"flex-1"},co=["src"],po={class:"transfer-select"},fo={key:0},vo={class:"detailPromotion"},yo={class:"borderBottom"},go={key:0},bo={class:"mb-0!"},ho={class:"font-size-13px borderBottom"},Co={key:2},wo=fe({__name:"PromoTransferForm",props:{promoCentent:Object,themeStyle:String},emits:["update:visible","updataList"],setup(n,{emit:D}){const T=Ee(),{t:a}=ie(),u=xe(),d=Ae(),p=ce(),s=n,B=D,h=S(()=>nt(s.themeStyle)),{restoreLoading:C,restoreHandler:g}=kt({onRestored:async()=>{await U(),J()}}),i=P({walletBalance:0}),o=async()=>{C.value=!0;try{await U(),C.value=!1}catch{C.value=!1}},w=S(()=>{var v;return(v=N.value)!=null&&v.providerWalletList?N.value.providerWalletList.filter(y=>y.list&&y.list.length).map((y,le)=>({id:`group-${le}`,value:`group~${y.typeCode}`,label:y.typeName,typeCode:y.typeCode,amount:y.totalBalance,showCurrency:!0,currency:"",translation:!0,disabled:!1,children:y.list.map(H=>({...H,value:H.type+"~"+H.providerId+"~"+(H.code||H.currency||""),label:`${H.providerName} (${H.currency} ${se(H.walletBalance)})`,typeCode:H.type,amount:H.walletBalance,showCurrency:!1,currency:H.currency,disabled:H.providerId==f.value.fromAccount}))})):[]}),I=S(()=>{var v,y;return((y=(v=N.value)==null?void 0:v.providerWalletList)==null?void 0:y.length)===1?[`group~${N.value.providerWalletList[0].typeCode}`]:[]}),Y=(v,y)=>v?y.label.toLowerCase().includes(v.toLowerCase()):!0,U=async()=>{const{loginId:v}=p.userInfo;if(!v)return;const y=await _e("/player/provider/selectAllWallet?loginId="+v);p.setUserAllWallet(y),i.value=y==null?void 0:y.mainWallet,f.value.fromAccount=i.value.providerId,f.value.fromAccountType=i.value.type,f.value.amount=i.value.walletBalance,C.value=!1},E=S(()=>Object.values(f.value).every(v=>v!=null&&v!=="")),m=P(null);P(1);const L=S(()=>
1{if(s.promoCentent){let v=[];return s.promoCentent.promotion?v=[s.promoCentent.promotion]:s.promoCentent.promotionGroup&&(v=s.promoCentent.promotionList),v.some((y,le)=>{if(y.isCilaimed)return m.value=le,!0}),v}else return[]}),W=S(()=>{if(m.value===null)return;const v=L.value[m.value];if(!v)return;let y="";return v.targetType=="turn"?y=a("promotion.targetTurnover"):v.targetType=="win"?y=a("promotion.targetWinover"):v.targetType=="winLoss"&&(y=a("promotion.targetWinLoss")),{...v,targetTypeLabel:y}}),f=P({fromAccount:"",fromAccountType:"",toAccount:"",toAccountType:"",amount:0,promotionId:0}),V=P(),ne=async()=>{if(m.value===null)return;const v={amount:f.value.amount,providerId:f.value.toAccount,id:L.value[m.value].id};if(V.value={wallet:0,bonusAmount:0,targetAmount:0,completedAmount:0},!(v.amount===""||v.amount===null||v.amount===void 0||v.providerId==""||v.id==""))try{V.value=await _e("/player/transaction/calculatePromotion",v)}catch(le){console.error("calculatePromotion 请æ±å¤±è´¥:",le)}},re=Oe(ne,1e3);me(()=>f.value.amount,(v,y)=>{v!=y&&re()},{deep:!0});const N=P(),J=async()=>{if(f.value.toAccount="",f.value.toAccountType="",f.value.toAccountWalletBalance="",f.value.toAccountLabel="",L.value.length&&m.value!==null){const{loginId:v}=p.userInfo;try{const y=await _e("/player/provider/selectPromotionProviderWallet",{loginId:v,providers:L.value[m.value].eligibleGameProviders,type:"promotion",eligibleGameTypes:L.value[m.value].eligibleGameTypes});N.value=y}catch(y){console.error("请æ±å¤±è´¥:",y)}}},l=async()=>{try{const{loginId:v}=p.userInfo,y=await _e("/player/provider/selectPromotionProviderWallet",{loginId:v,type:"promotion"});i.value=y?y.mainWallet:{walletBalance:0},f.value.fromAccount=i.value.providerId,f.value.fromAccountType=i.value.type,f.value.amount=i.value.walletBalance}catch(v){console.error("请æ±å¤±è´¥:",v)}},k=S(()=>L.value.length);me(()=>[m,k],()=>{J()},{deep:!0}),Be(()=>{l(),J()});const X=v=>{var H,ee;if(!v){f.value.toAccount="",f.value.toAccountType="",f.value.toAccountWalletBalance=0;return}const y=v.split("~"),le=Number(y[1]);if(y.length<3||isNaN(le)){f.value.toAccount="",f.value.toAccountType="",f.value.toAccountWalletBalance=0,f.value.toAccountLabel="";return}f.value.toAccount=le,f.value.toAccountType=y[0];for(const ye of((H=N.value)==null?void 0:H.providerWalletList)||[]){const ge=(ee=ye.list)==null?void 0:ee.find(ve=>ve.providerId==Number(y[1]));if(ge){f.value.toAccountWalletBalance=ge.walletBalance;break}}ne()};let O=P(!1);const ue=()=>{var v;if(m.value!==null)if(!f.value.amount&&((v=W.value)==null?void 0:v.calculationType)=="PERCENT"){we.error(a("promotion.transferTip2"));return}else if(f.value.amount<L.value[m.value].minDeposit){we.error(a("promotion.transferTip1"));return}else O.value=!0,ce().setPromotionWarning({visible:!0,type:"promotion",status:1,apiParams:{providerId:f.value.toAccount},onConfirm:ae,onClose:()=>{O.value=!1}})},ae=async()=>{var v;if(m.value!==null){f.value.fromAccount=i.value.providerId,f.value.fromAccountType=i.value.type,O.value=!0;try{await Ke("/player/provider/transferAccounts",{...f.value,promotionId:(v=L.value[m.value])==null?void 0:v.id}),we.success(a("common.successful")),O.value=!1,B("update:visible",!1),u.push(d("/account/history?type=promotionApply"))}catch{O.value=!1}finally{O.value=!1}}};me(()=>p.transferInfo.confirm,v=>{v&&p.transferInfo.type==="promotion"&&ae()});const K=S(()=>p.isMobile),se=v=>{const y=Number(v);return isNaN(y)?"":y.toFixed(2)};let Te=S(()=>T.gameTypeLanguages);const j=S(()=>T.currentRegionLang.languageCode),Se=S(()=>{var le,H;let v=(le=W.value)!=null&&le.eligibleGameTypes?(H=W.value)==null?void 0:H.eligibleGameTypes.split(","):[],y="";return v.map(ee=>{var ge,ve;let ye=((ve=(ge=Te.value)==null?void 0:ge[j.value])==null?void 0:ve[ee])||"";ye&&(y+=(y?", ":"")+ye)}),y});return(v,y)=>{var F,G,Q,b;const le=Lt,H=At,ee=at,ye=Le,ge=$t,ve=lt,_=st,$=qe;return c(),A("div",{class:z(["pt-0 promotion-transfer",n.themeStyle+"-promotion-transfer"])},[t("div",no,[(F=n.promoCentent)!=null&&F.promotionGroup?(c(),A("div",lo,[((G=n.promoCentent)==null?void 0:G.promotionGroup.groupType)==3?(c(),A("p",ao," *Sequence: "+r(e(a)("promotion.sequence")),1)):x("",!0),((Q=n.promoCentent)==null?void 0:Q.promotionGroup.groupType)==1?(c(),A("p",so," *One At A Time: "+r(e(a)("promotion.oneAtATime")),1)):x("",!0),((b=n.promoCentent)==null?void 0:b.promotionGroup.groupType)==2?(c(),A("p",io," *Single Choice: "+r(e(a)("promotion.singleChoice")),1)):x("",!0)])):x("",!0),L.value&&L.value.length?(c(),Z(_,{key:1,model:e(f),ref:"transferFormRef","label-position":"top",class:"transfer-form",size:"large"},{default:R(()=>{var te,be,pe,he,Ce,de,Me,$e,ke,Ie;return[M(ee,{label:e(a)("promotion.promotionTitle"),class:"transfer-input mr-0 flex-1 pos-relative"},{default:R(()=>[M(H,{modelValue:e(m),"onUpdate:modelValue":y[0]||(y[0]=oe=>et(m)?m.value=oe:null),class:z({"mb-10px":!K.value}),"popper-class":"promotf-select-popper"},{default:R(()=>[(c(!0),A(Pe,null,Re(L.value,(oe,De)=>(c(),Z(le,{key:oe.id,label:oe.title,value:De,disabled:!oe.isCilaimed},null,8,["label","value","disabled"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["label"]),t("div",{class:z(["flex w-100%",K.value?"mt-10px flex-col mobile-form-item":"my-10px flex-row pc-form-item"])},[M(ee,{label:e(a)("promotion.fromMainWallet"),class:z(["transfer-input flex-1 pos-relative",{"mr-2":!K.value}])},{default:R(()=>[Ue((c(),A("div",ro,[t("span",uo,[t("span",mo,r(e(i).walletBalance?se(e(i).walletBalance):"0.00"),1),t("img",{onClick:o,src:h.value.refreshIcon},null,8,co)]),M(ye,{size:"default",class:"restore-btn mr-3px",onClick:e(g)},{default:R(()=>[q(r(e(a)("header.restore")),1)]),_:1},8,["onClick"])])),[[$,e(C)]])]),_:1},8,["label","class"]),M(ee,{label:e(a)("promotion.to"),class:"transfer-input flex-1 z-9999"},{default:R(()=>[M(ge,{modelValue:e(f).toAccountLabel,"onUpdate:modelValue":y[1]||(y[1]=oe=>e(f).toAccountLabel=oe),data:w.value,"render-after-expand":!1,"node-key":"value","default-expanded-keys":I.value,onChange:X,placeholder:e(a)("common.select"),"popper-class":`transfer-tree-select-${n.themeStyle=="eightwin"?"8win":n.themeStyle}`,"filter-node-method":Y,filterable:"",clearable:""},{default:R(({data:oe})=>{var De,Qe;return[t("div",po,[t("span",null,r(((Qe=(De=e(Te))==null?void 0:De[j.value])==null?void 0:Qe[oe.typeCode])||oe.providerName||oe.label),1),oe.amount!==-1?(c(),A("span",fo,r(oe.showCurrency?oe.currency+" ":"")+r(se(oe.amount)),1)):x("",!0)])]}),_:1},8,["modelValue","data","default-expanded-keys","placeholder","popper-class"])]),_:1},8,["label"])],2),M(ee,{label:e(a)("promotion.transferAmount"),style:{"margin-bottom":"0 !important"}},{default:R(()=>[M(ve,{modelValue:e(f).amount,"onUpdate:modelValue":y[2]||(y[2]=oe=>e(f).amount=oe),modelModifiers:{number:!0},type:"number"},null,8,["modelValue"]),y[3]||(y[3]=t("div",{class:"py-10px amountproremark"},null,-1))]),_:1},8,["label"]),t("div",vo,[t("p",null,[q(r(e(a)("promotion.providerCurrentBalance"))+": ",1),t("span",null,r(se(((te=e(f))==null?void 0:te.toAccountWalletBalance)||0)),1)]),t("p",null,[q(r(e(a)("promotion.minDeposit"))+": ",1),t("span",null,r(se(((be=W.value)==null?void 0:be.minDeposit)||0)),1)]),t("p",yo,[q(r(e(a)("promotion.transferAmount"))+": ",1),t("span",null,r(se(e(f).amount+((pe=e(f))==null?void 0:pe.toAccountWalletBalance)||0)),1)]),((he=W.value)==null?void 0:he.calculationType)=="PERCENT"?(c(),A("p",go,[q(r(e(a)("promotion.bonusPercentage"))+": ",1),t("span",null,r(`${W.value.targetBonus}%`),1)])):x("",!0),t("p",null,[q(r(e(a)("promotion.bonusAmount"))+": ",1),t("span",null,r(se(((Ce=e(V))==null?void 0:Ce.bonusAmount)||0)),1)]),t("p",null,[q(r(e(a)("promotion.maxBonus"))+":",1),t("span",null,r(se(((de=W.value)==null?void 0:de.max
1Bonus)||0)),1)]),t("p",null,[q(r(e(a)("promotion.totalTransferAmount"))+": ",1),t("span",null,r(se(((Me=e(V))==null?void 0:Me.totalTransferAmount)||0)),1)]),t("p",bo,r(e(a)("promotion.eligibleGameTypes"))+" :",1),t("p",ho,r(Se.value||"-"),1),t("p",null,[q(r(e(a)("promotion.targetType"))+":",1),t("span",null,r(($e=W.value)==null?void 0:$e.targetTypeLabel),1)]),t("p",null,[q(r(e(a)("promotion.targetMultiplier"))+":",1),t("span",null,r(((ke=W.value)==null?void 0:ke.targetMultiplier)||0),1)]),t("p",null,[q(r(e(a)("promotion.targetAmount"))+": ",1),t("span",null,r(se(((Ie=e(V))==null?void 0:Ie.completedAmount)||0)),1)])]),M(ee,null,{default:R(()=>[M(ye,{size:"large",class:"submit-btn w-100%",onClick:ue,loading:e(O),disabled:!E.value},{default:R(()=>[q(r(e(a)("common.claimNow")),1)]),_:1},8,["loading","disabled"])]),_:1})]}),_:1},8,["model"])):(c(),A("div",Co,r(e(a)("common.noPromotion")),1))])],2)}}}),To=fe({__name:"index",props:{visible:Boolean,promoCentent:Object,themeStyle:String},emits:["update:visible","updataList"],setup(n,{emit:D}){const{t:T}=ie(),a=ce(),u=Fe(),d=n,p=D,s=S({get:()=>d.visible,set:w=>p("update:visible",w)}),B=S(()=>a.isMobile),h=S(()=>ze(d.themeStyle)),C=S(()=>{var w;return((w=h.value)==null?void 0:w.promoTransferModalTemplate)==="drawer"&&B.value}),g=S(()=>{var w;return((w=h.value)==null?void 0:w.promoTransferModalTemplate)==="drawer"}),i=S(()=>{var w,I,Y,U;if((w=d.promoCentent)!=null&&w.promotionGroup){if(((I=d.promoCentent)==null?void 0:I.promotionGroup.groupType)==1)return"One At A time";if(((Y=d.promoCentent)==null?void 0:Y.promotionGroup.groupType)==2)return"Single Choice";if(((U=d.promoCentent)==null?void 0:U.promotionGroup.groupType)==3)return"Sequence"}else return"Single Promotion"}),o=()=>{u.open("promoTransfer",{promoCentent:d.promoCentent,promotionModalTitle:i.value,onUpdataList:()=>p("updataList"),onClose:()=>{d.visible&&p("update:visible",!1)}})};return Be(()=>{C.value&&d.visible&&o()}),me(C,()=>{d.visible&&(u.closeLayer("promoTransfer"),p("update:visible",!1))}),(w,I)=>{const Y=ot;return C.value?x("",!0):(c(),Z(Y,{key:0,type:"form",modelValue:s.value,"onUpdate:modelValue":[I[2]||(I[2]=U=>s.value=U),I[3]||(I[3]=U=>w.$emit("update:visible",U))],title:e(T)("common.claimNowInfo")+" ("+i.value+")",width:g.value?"390px":"550px",themeStyle:n.themeStyle},{default:R(()=>[M(wo,{promoCentent:n.promoCentent,themeStyle:n.themeStyle,"onUpdate:visible":I[0]||(I[0]=U=>s.value=U),onUpdataList:I[1]||(I[1]=U=>p("updataList"))},null,8,["promoCentent","themeStyle"])]),_:1},8,["modelValue","title","width","themeStyle"]))}}}),je=fe({__name:"apply",props:["promoCentent","themeStyle"],emits:["updataList"],setup(n,{emit:D}){const T=xe(),{t:a}=ie();Ee();const u=ce(),d=Ae(),p=D,s=n,B=S(()=>u.userInfo.loginId),h=S(()=>u.isMobile),C=S(()=>{var E,m,L;return((L=(m=(E=s.promoCentent)==null?void 0:E.list)==null?void 0:m[0])==null?void 0:L.customField)||a("promotion.contactCS")}),g=P(!1),i=P(!1),o=P(""),w=S(()=>ze(s.themeStyle)),I=S(()=>{var E;return((E=w.value)==null?void 0:E.promoTransferModalTemplate)==="drawer"&&h.value}),Y=()=>{var E,m,L,W;if(s.promoCentent.allowAction==0){const f=s.promoCentent.list[0].linkUrl;if(!f){typeof((E=window.LiveChat)==null?void 0:E.open)=="function"?window.LiveChat.open():h.value&&((m=window.LC_API)!=null&&m.open_chat_window)?window.LC_API.open_chat_window():window.LiveChatWidget?(W=(L=window.LiveChatWidget)==null?void 0:L.call)==null||W.call(L,"maximize"):I.value?Fe().open("comingSoon"):u.setComingSoonVisible(!0);return}s.promoCentent.list[0].urlPage?Ye(f):window.location.href=f}else s.promoCentent.allowAction==1?i.value=!0:s.promoCentent.allowAction==2?(o.value=s.promoCentent.formField,g.value=!0):s.promoCentent.allowAction==3?T.push(d({path:"/account/transfer"})):s.promoCentent.allowAction==4&&Ye(s.promoCentent.list[0].formUrl)},U=()=>{I.value?Fe().open("goLogin"):u.setLoginVisible(!0)};return(E,m)=>{var W,f;const L=Le;return n.promoCentent&&!n.promoCentent.displayOnly?(c(),A("div",{key:0,class:z(["flex promotion-apply-btn",{mobilePromotionApply:e(h)}])},[e(B)&&e(u).userInfo.timeZone?(c(),Z(L,{key:0,onClick:Y,class:"submit-green w-100%",size:"large",disabled:(W=n.promoCentent)==null?void 0:W.disabledApply},{default:R(()=>[q(r(n.promoCentent.allowAction==0?e(C):n.promoCentent.allowAction==1?e(a)("common.claimNow"):n.promoCentent.allowAction==2?e(a)("common.applyNow"):e(a)("common.applyNow")),1)]),_:1},8,["disabled"])):x("",!0),e(B)?x("",!0):(c(),Z(L,{key:1,class:"submit-green w-100%",onClick:U,size:"large"},{default:R(()=>[q(r(e(a)("common.joinNow")),1)]),_:1})),M(oo,{onUpdataList:m[0]||(m[0]=V=>p("updataList")),"onUpdate:visible":[m[1]||(m[1]=V=>g.value=V),m[2]||(m[2]=V=>g.value=V)],contentId:(f=n.promoCentent)==null?void 0:f.id,visible:g.value,formField:o.value,themeStyle:n.themeStyle},null,8,["contentId","visible","formField","themeStyle"]),i.value?(c(),Z(To,{key:2,onUpdataList:m[3]||(m[3]=V=>p("updataList")),"onUpdate:visible":[m[4]||(m[4]=V=>i.value=V),m[5]||(m[5]=V=>i.value=V)],visible:i.value,promoCentent:n.promoCentent,themeStyle:n.themeStyle},null,8,["visible","promoCentent","themeStyle"])):x("",!0)],2)):x("",!0)}}}),So={key:0,class:"countdown-container"},_o={class:"remaining-time"},Io={class:"time-container"},Ao={class:"day-box"},Lo={class:"day-number"},$o={class:"time-box-container"},ko={class:"time-box"},xo={class:"time-hour"},Bo={class:"time-box"},Mo={class:"time-min"},Do={class:"time-box"},Uo={class:"time-sec"},No={key:1,class:"countdown-day-time"},Fo={class:"title"},Po={class:"time"},Ro={class:"day num"},Eo={class:"hour num"},Wo={class:"min num"},Vo={class:"sec num"},Go={__name:"countdownTimer",props:{endTime:{type:Number,required:!0},title:{type:String,required:!0},countdownTyle:{type:String,default:""}},setup(n){const{nowTimeStamp:D}=We(),T=n,a=P(T.endTime-D()),u=S(()=>{const p=Math.max(0,Math.floor(a.value/1e3));return{days:Math.floor(p/86400),hours:Math.floor(p%86400/3600),minutes:Math.floor(p%3600/60),seconds:p%60}
1});let d;return Be(async()=>{await Ne(),d=dt(()=>{a.value=T.endTime-D()},1e3)}),tt(()=>{clearInterval(d)}),(p,s)=>n.countdownTyle!=="dayTime"?(c(),A("div",So,[t("p",_o,r(n.title)+" :",1),t("div",Io,[t("div",Ao,[t("p",Lo,r(u.value.days),1),s[0]||(s[0]=t("p",{class:"day-text"},"Day",-1))]),t("div",$o,[t("div",ko,[t("p",xo,r(u.value.hours),1),s[1]||(s[1]=t("p",{class:"time-text"},"Hour",-1))]),s[4]||(s[4]=t("div",{class:"time-colon"},[t("span",null,":")],-1)),t("div",Bo,[t("p",Mo,r(u.value.minutes),1),s[2]||(s[2]=t("p",{class:"time-text"},"Min",-1))]),s[5]||(s[5]=t("div",{class:"time-colon"},[t("span",null,":")],-1)),t("div",Do,[t("p",Uo,r(u.value.seconds),1),s[3]||(s[3]=t("p",{class:"time-text"},"Sec",-1))])])])])):(c(),A("div",No,[t("p",Fo,r(n.title),1),t("p",Po,[t("span",Ro,r(u.value.days),1),s[6]||(s[6]=t("span",{class:"daytest"},"Day",-1)),t("span",Eo,r(u.value.hours),1),t("span",Wo,r(u.value.minutes),1),t("span",Vo,r(u.value.seconds),1)])]))}},qo=Ve(Go,[["__scopeId","data-v-76230f68"]]),{parseTimeDate:zo,nowTimeStamp:Oo}=We(),He=()=>{const n=Ge(),D=ce(),{t:T}=ie(),a=S(()=>D.isLogin),u=S(()=>D.isMobile),d=g=>zo(g)-Oo()>0,p=g=>{var o;const i=(o=g==null?void 0:g.list)==null?void 0:o[0];return i?!!(g.showRemainingTime&&i.endTime&&d(i.endTime)&&!d(i.startTime)):!1},s=g=>{var o;const i=(o=g==null?void 0:g.list)==null?void 0:o[0];return i?!!(g.showComingSoonTime&&i.startTime&&d(i.startTime)):!1},B=async g=>{if(g)try{await navigator.clipboard.writeText(g),we.success(T("common.copySuccess"))}catch(i){console.warn("å¤å¶å¤±è´¥",i),we.error(T("common.copyFailed"))}},h=g=>{let i=`promotionbox_${g}`,o=document.getElementById(i);if(!o)return;let w=document.getElementsByClassName("promotion-page-wrap")[0];if(!w)return;const I=w.getBoundingClientRect(),U=o.getBoundingClientRect().top-I.top;w.style.minHeight="250vh",document.getElementsByTagName("body")[0].scrollTo({top:U,behavior:"smooth"})};return{isLogin:a,isMobile:u,isTimeShow:d,remainingTimeShow:p,comingSoonTimeShow:s,copy:B,imgLoad:g=>{n.query.id&&g.id==n.query.id&&h(n.query.id)},Apply:je,CountdownTimer:qo}},jo=["src"],Ho={key:1,src:_t,class:"w-12px mr-7px"},it=fe({__name:"share",props:{promoCentent:Object,themeStyle:String},setup(n){const D=Ae(),T=Ge(),{t:a}=ie(),u=n,d=S(()=>nt(u.themeStyle)),p=S(()=>{var h;return(h=d.value)==null?void 0:h.promoShareIcon}),{copy:s}=He(),B=()=>{var g;if(!((g=u.promoCentent)!=null&&g.id))return;const h={};typeof T.query.type=="string"&&T.query.type!==""&&T.query.type!=="available"&&(h.type=T.query.type),h.id=u.promoCentent.id;const C=new URL(D({path:"/promotion",query:h}),window.location.origin);s(C.href)};return(h,C)=>{var i;const g=Le;return(i=n.promoCentent)!=null&&i.allowShare?(c(),Z(g,{key:0,onClick:B,class:"promo-share mr-5px",size:"large"},{default:R(()=>[e(p)?(c(),A("img",{key:0,src:e(p),class:"w-12px mr-7px"},null,8,jo)):(c(),A("img",Ho)),q(" "+r(e(a)("common.share")),1)]),_:1})):x("",!0)}}}),Qo={class:"flex items-center justify-between promo-modal-header"},Yo={class:"text-center modal-titlep"},Jo={class:"modal-title"},Zo=["src"],Xo={class:"flex items-center"},Ko={class:"promo-title"},en={class:"flex-1"},tn={key:0,class:"flex justify-end mr-5px pro-des-codebox"},on={class:"codebox"},nn={class:"tl"},ln={class:"num"},an=["src"],sn={class:"editContentStyle"},rn=["innerHTML"],Je=768,un=fe({__name:"promoModal",props:{visible:Boolean,promoCentent:Object,themeStyle:String,copyIcon:String,pageClass:String},emits:["update:visible","updataList","close"],setup(n,{emit:D}){const{t:T}=ie(),a=P(null),u=n,d=D,p=()=>{u.visible&&(d("close"),d("update:visible",!1))},s=S({get:()=>u.visible,set:g=>d("update:visible",g)}),B=async g=>{if(g)try{await navigator.clipboard.writeText(g),we.success(T("common.copySuccess"))}catch(i){console.warn("å¤å¶å¤±è´¥",i),we.error(T("common.copyFailed"))}},h=P(!1),C=()=>{const g=h.value;h.value=window.innerWidth<=Je,!g&&h.value&&u.visible&&p()};return Be(()=>{window.addEventListener("resize",C),h.value=window.innerWidth<=Je,h.value&&u.visible&&p()}),ft(()=>{window.removeEventListener("resize",C)}),(g,i)=>{const o=Xe,w=Tt;
1return c(),Z(w,{"align-center":"","append-to-body":"","modal-class":`${n.themeStyle}-detail-modal promo-modal-mask`,modelValue:s.value,"onUpdate:modelValue":i[2]||(i[2]=I=>s.value=I),width:"60%","show-close":!1,onClose:p,class:"editBgColorModalPC"},{header:R(()=>[t("div",Qo,[t("p",Yo,[t("span",Jo,[t("span",null,r(e(T)("promotion.promotionDetails")),1)]),t("span",{class:"close-icon-pos",onClick:p,style:{display:"none"}},"X")]),M(o,{onClick:p,class:"close-icon cursor-pointer"},{default:R(()=>[M(e(vt))]),_:1})])]),default:R(()=>{var I,Y,U,E,m,L;return[t("div",{class:z([n.themeStyle+"-promotion-content","promo-scroll-wrap"])},[t("div",{ref_key:"scrollbarRef",ref:a,class:z(["modal-content",[n.themeStyle]])},[(I=n.promoCentent)!=null&&I.list[0].affiliateImageUrl?(c(),A("img",{key:0,src:(Y=n.promoCentent)==null?void 0:Y.list[0].affiliateImageUrl,alt:"Promotion",class:"modal-image"},null,8,Zo)):x("",!0),t("div",Xo,[t("h2",Ko,r((U=n.promoCentent)==null?void 0:U.list[0].title),1),t("div",en,[(E=n.promoCentent)!=null&&E.promotionCode?(c(),A("div",tn,[t("div",on,[t("span",nn,r(e(T)("promotion.coupon")),1),t("span",ln,[q(r((m=n.promoCentent)==null?void 0:m.promotionCode)+" ",1),t("img",{onClick:i[0]||(i[0]=W=>{var f;return B((f=n.promoCentent)==null?void 0:f.promotionCode)}),src:n.copyIcon},null,8,an)])])])):x("",!0)]),M(it,{class:"min-w-120px",themeStyle:n.themeStyle,promoCentent:n.promoCentent},null,8,["themeStyle","promoCentent"]),M(je,{themeStyle:n.themeStyle,class:"min-w-120px",promoCentent:n.promoCentent,onUpdataList:i[1]||(i[1]=W=>d("updataList"))},null,8,["themeStyle","promoCentent"])]),t("div",sn,[t("div",{innerHTML:(L=n.promoCentent)==null?void 0:L.list[0].affiliateContent},null,8,rn)])],2),M(St,{"scrollbar-ref":a.value},null,8,["scrollbar-ref"])],2)]}),_:1},8,["modal-class","modelValue"])}}}),mn={class:"modal-content"},cn={key:0},pn={class:"topImg"},dn=["src"],fn={class:"flex ma-10px items-center"},vn={class:"flex-1"},yn={class:"promo-title-applay-flex pr-10px font-size-15px font-700"},gn={class:"promo-title px-10px font-size-15px font-700"},bn={class:"editContentStyle"},hn=["innerHTML"],Cn=fe({__name:"mobileMoreInfo",props:{visible:Boolean,promoCentent:Object,detailContentLayout:Object,themeStyle:String},emits:["update:isShowMobileMoreInfo","updataList"],setup(n,{emit:D}){const T=ce(),{t:a}=ie(),u=D;me(()=>T.isMobile,()=>{T.isMobile||u("update:isShowMobileMoreInfo",!1)});let d=P(0);const p=()=>{var s;d.value=(((s=document.getElementById("modal-image"))==null?void 0:s.clientHeight)||0)+10};return(s,B)=>(c(),Z(yt(n.detailContentLayout),{title:e(a)("promotion.promotionDetails"),onGoBack:B[1]||(B[1]=h=>u("update:isShowMobileMoreInfo",!1))},{default:R(()=>{var h,C,g,i,o;return[t("div",mn,[(h=n.promoCentent)!=null&&h.list[0].affiliateImageUrl?(c(),A("div",cn,[t("div",pn,[t("img",{src:(C=n.promoCentent)==null?void 0:C.list[0].affiliateImageUrl,alt:"Promotion",class:"modal-image",id:"modal-image",onLoad:p},null,40,dn)])])):x("",!0),t("div",fn,[t("div",vn,[t("p",yn,r((g=n.promoCentent)==null?void 0:g.list[0].title),1)]),M(it,{themeStyle:n.themeStyle,promoCentent:n.promoCentent,class:"min-w-95px"},null,8,["themeStyle","promoCentent"]),M(je,{class:"min-w-95px",promoCentent:n.promoCentent,onUpdataList:B[0]||(B[0]=w=>u("updataList")),themeStyle:n.themeStyle},null,8,["promoCentent","themeStyle"])]),t("p",gn,r((i=n.promoCentent)==null?void 0:i.list[0].title),1),t("div",bn,[t("div",{innerHTML:(o=n.promoCentent)==null?void 0:o.list[0].affiliateContent},null,8,hn)])])]}),_:1},40,["title"]))}}),wn=Ve(Cn,[["__scopeId","data-v-5372dc9f"]]),{handleTimeDate:Ze,parseTimeDate:Tn}=We(),Sn=n=>{const D=xe(),T=Ge(),a=Ee(),u=ce(),d=Ae(),p=P(!1),{t:s}=ie(),{isLogin:B,isMobile:h,copy:C,isTimeShow:g,remainingTimeShow:i,comingSoonTimeShow:o,imgLoad:w,Apply:I,CountdownTimer:Y}=He(),U=P({}),E=S(()=>K.value.filter(_=>_.list&&_.list[0]).length),m=P([]),L=P(null),W={available:[{title:s("common.available"),value:"available"},{title:s("common.all"),value:""}],all:[{title:s("common.all"),value:""},{title:s("common.available"),value:"available"}]},f=S(()=>{let _=[];return B.value?_=W[n.tabBase]||W.available:_=[{title:s("common.all"),value:""}],n.toUpperCase&&(_=_.map($=>({...$,title:$.title.toUpperCase()}))),_}),V=P(!0),ne=P(!1),re=S(()=>V.value||ne.value),N=_=>{L.value=_,D.replace(d({path:"/promotion",query:{type:m.value[L.value].value}}))},J=S(()=>u.userInfo.loginId),l=S(()=>a.currentRegionLang.regionId),k=S(()=>a.currentRegionLang.languageCode),X=S(()=>a.currentRegionLang.languageShow),O=P(),ue=P(),ae=_=>{ue.value=null,(_||[]).map($=>{$.id==n.toApplayId&&n.toApplayId!==null&&(ue.value=$)})},K=P([]),se=S(()=>{let _=[];return _=K.value.map($=>({showTitle:$.showTitle,showRemainingTime:$.showRemainingTime,showComingSoonTime:$.showComingSoonTime,promotionCode:$.promotionCode,...$.list[0]})),_}),Te=(_,$)=>
1$===""||$===void 0||$===null?_||[]:(_||[]).filter(F=>F.promotionType?F.promotionType.split(",").map(G=>G.trim()).includes(String($)):!1),j=async _=>{if(_==="available"){if(!J.value)return ne.value=!1,null;ne.value=!0;try{return await _e("/player/setting/getAvailablPromotionContents",{languageCode:k.value})}finally{ne.value=!1}}V.value=!0;try{const $=await _e("/player/setting/getPromotionContents",{loginId:J.value||"",languageCode:k.value,type:""});return Te($,_)}finally{V.value=!1}},Se=async(_=!1)=>{if(!k.value||!m.value.length)return;let $=T.query.type;const F=m.value.findIndex(G=>G.value==$);if(L.value=F>=0?F:null,F<0&&n.source!="home"){if(!_)return;const G=m.value.findIndex(Q=>Q.value==="");if(G<0)return;L.value=G,T.query.type!==void 0&&D.replace(d({path:"/promotion",query:{type:""}}))}try{K.value=[],_?await v():await H()}catch(G){console.error("Promotion init 请æ±å¤±è´¥",G),K.value=[]}},v=async()=>{var _;if(k.value){const $=L.value,F=String(((_=m.value[$])==null?void 0:_.value)??"");let G=U.value[$];if(!G){try{G=await j(F)}catch(Q){console.error("Promotion initAll é级请æ±å¤±è´¥",Q),K.value=[];return}$!==null&&(U.value[$]=G||[])}if(String(T.query.type??"")!==F)return;y(G?JSON.parse(JSON.stringify(G)):null)}},y=_=>{var Q;let $=864e5,F=((Q=u.userInfo)==null?void 0:Q.dateOfBirth)||"",G=new Date().getFullYear();K.value=_?_.filter(b=>b.list&&b.list[0]).map(b=>{var te,be,pe,he,Ce;if(b.list[0].startTime&&(b.list[0].startTime=Ze(b.list[0].startTime)),b.list[0].endTime&&(b.list[0].endTime=Ze(b.list[0].endTime)),b.promotionContentType==0&&((te=b.promotion)!=null&&te.id)&&b.promotion.promotionType=="Birthday"||b.promotionContentType==1&&((be=b.promotionGroup)!=null&&be.id)&&((pe=b.promotionList[0])==null?void 0:pe.promotionType)=="Birthday"){const de=b.promotionContentType==0?b.promotion:(he=b.promotionList)==null?void 0:he[0];if(F){const[Me,$e,ke]=String(F).split("-").map(Number);if(!Me||!$e||!ke)b.list[0].startTime="",b.list[0].endTime="";else{const Ie=Tn(`${G}-${String($e).padStart(2,"0")}-${String(ke).padStart(2,"0")}`);console.log(Ie),b.list[0].startTime=Ie-((de==null?void 0:de.beforeBirthdayDays)||0)*$,b.list[0].endTime=Ie+(((de==null?void 0:de.afterBirthdayDays)||0)+1)*$}}else b.list[0].startTime="",b.list[0].endTime=""}return(b.allowAction==1||b.allowAction==3)&&(b.disabledApply=!0),b.promotion&&b.promotion.isCilaimed?b.disabledApply=!1:b.promotionGroup&&((Ce=b.promotionList)==null?void 0:Ce.length)>0&&b.promotionList.some(de=>{if(de.isCilaimed)return b.disabledApply=!1,!0}),!b.promotion&&!b.promotionGroup&&(b.disabledApply=!1),b}):[],T.query.id&&ge(T.query.id)},le=async(_=!1)=>{var $;if(L.value=null,m.value=[...f.value],!_&&!(!(($=a==null?void 0:a.currentRegionLang)!=null&&$.merchantId)||!l.value)){try{let F=await _e("/player/setting/getPromotionType",{merchantId:a.currentRegionLang.merchantId,regionId:l.value}),G=F==null?void 0:F.map(Q=>{Q.isDefault&&u.setSpecialForYouId(Q.id);let b=Q.name;return Q.languages.map(te=>{X.value===te.name&&(b=te.value)}),{title:b||Q.name||Q.title,value:Number(Q.id),isDefault:Q.isDefault}});m.value=[...f.value,...G]}catch(F){console.error("PromotionType 请æ±å¤±è´¥",F)}await H()}},H=async()=>{if(!k.value)return;const _=j(""),$=J.value?j("available"):Promise.resolve(null);let F=null,G=null;try{F=await _}catch(b){console.error("Promotion å
¨é请æ±å¤±è´¥",b)}if(J.value)try{G=await $}catch(b){console.error("Promotion available 请æ±å¤±è´¥",b)}if(!F&&!G){K.value=[];return}const Q=m.value.findIndex(b=>b.value==="available");Q>=0&&(U.value[Q]=G||[],m.value[Q]={...m.value[Q],tipNumber:(G||[]).filter(b=>b.list&&b.list[0]).length||0}),F?(ae(F),m.value.forEach((b,te)=>{const be=b.value;if(be!=="available")if(be==="")U.value[te]=F,m.value[te]={...m.value[te],tipNumber:F.filter(pe=>pe.list&&pe.list[0]).length||0};else{const pe=Te(F,be);U.value[te]=pe;const he=pe.filter(Ce=>Ce.list&&Ce.list[0]).length||0;m.value[te]={...m.value[te],tipNumber:he},b.isDefault&&u.setSpecialForYouCount(he)}})):m.value.forEach((b,te)=>{b.value!=="available"&&delete U.value[te]}),await Se(!0)};me(()=>T.query.type,async(_,$)=>{_!=$&&await Se(!0)});const ee=P(!1),ye=_=>{h.value?(p.value=!1,ee.value=!0):(p.value=!0,ee.value=!1),O.value=_},ge=_=>{const $=K.value.find(F=>F.id==_);$&&(O.value=$,h.value?ee.value=!0:p.value=!0)},ve=()=>{if(n.source!="home"){const _=document.getElementsByClassName("promotion-page-wrap")[0];_&&(_.style.minHeight="100vh"),D.replace(d({path:"/promotion",query:{type:T.query.type}}))}};return me(()=>u.isMobile,()=>{u.isMobile?(p.value&&ve(),p.value=!1):(ee.value&&ve(),ee.value=!1)}),{isLogin:B,isMobile:h,activeName:L,allLoading:V,availableLoading:ne,pageLoading:re,promoTyleTab:m,promoListWater:se,promoList:K,promoTopApply:ue,isTimeShow:g,copy:C,moreInfoHandle:ye,promoCentent:O,showModal:p,removeRouterId:ve,isShowMobileMoreInfo:ee,remainingTimeShow:i,comingSoonTimeShow:o,handleClick:N,init:Se,typeFun:le,imgLoad:w,Apply:I,PromoModal:un,CountdownTimer:Y,MobileMoreInfo:wn,showActiveNumber:E,pageClass:n.pageClass,themeStyle:n.themeStyle,countdownTyle:n.countdownTyle,copyIcon:n.copyIcon,languageCode:k}},_n=["id"],In={class:"boxmain"},An=["src"],Ln={key:2,class:"codebox"},$n={class:"tl"},kn={class:"num"},xn=["src"],Bn={class:"shade-box flex items-center"},Mn={class:"title"},Dn={class:"des"},Un={class:"show-time flex-1"},Nn={key:0,class:"codebox"},Fn={class:"tl"},Pn={class:"num"},Rn=["src"],En={class:"btndiv"},Wn={class:"flex"},Vn={class:"right-btn"},Gn={class:"btndiv"},qn={class:"flex"},zn={class:"right-btn"},On=fe({__name:"itemPromo",props:{item:{default:null},themeStyle:{default:"default"},copyIcon:{default:null},toUpperCase:{type:Boolean,default:!1},pageClass:{default:""},imgCDTimeShow:{type:Boolean,default:!1},bannerLink:{default:null},countdownTyle:{default:""}
1,codeTopShow:{type:Boolean,default:!1},detailBtnText:{default:""}},emits:["moreInfoHandle","init"],setup(n,{emit:D}){const{parseTimeDate:T}=We(),{t:a}=ie(),u=D,{isLogin:d,isMobile:p,copy:s,Apply:B,remainingTimeShow:h,comingSoonTimeShow:C,imgLoad:g,CountdownTimer:i}=He();return(o,w)=>{var Y,U,E,m,L,W,f,V,ne,re,N,J;const I=Le;return o.item&&o.item.list[0]?(c(),A("div",{key:0,class:"w-100% promotionbox",id:`promotionbox_${o.item.id}`},[t("div",In,[t("div",{class:z(["img-box-promo",(Y=o.item)!=null&&Y.promotionCode||(e(h)(o.item)||e(C)(o.item))&&e(d)&&o.imgCDTimeShow?"hascode":""])},[o.item.list[0].affiliateImageUrl?(c(),A("img",{key:0,class:"w-100% masonry-item-img banner cursor-pointer",src:e(p)&&o.item.list[0].mobileImage||o.item.list[0].affiliateImageUrl,alt:"Promotion",onLoad:w[0]||(w[0]=l=>e(g)(o.item)),onClick:w[1]||(w[1]=l=>u("moreInfoHandle",o.item))},null,40,An)):x("",!0),(e(h)(o.item)||e(C)(o.item))&&e(d)&&o.imgCDTimeShow?(c(),Z(e(i),{key:1,title:e(h)(o.item)?e(a)("promotion.remainingTime"):e(a)("promotion.comingSoonTime"),endTime:e(h)(o.item)?e(T)(o.item.list[0].endTime):e(T)(o.item.list[0].startTime),countdownTyle:o.countdownTyle},null,8,["title","endTime","countdownTyle"])):x("",!0),(U=o.item)!=null&&U.promotionCode&&o.codeTopShow?(c(),A("div",Ln,[t("span",$n,r(e(a)("promotion.coupon")),1),t("span",kn,[q(r((E=o.item)==null?void 0:E.promotionCode)+" ",1),t("img",{onClick:w[2]||(w[2]=l=>{var k;return e(s)((k=o.item)==null?void 0:k.promotionCode)}),src:o.copyIcon},null,8,xn)])])):x("",!0)],2),t("div",Bn,[t("div",{class:z(["boxcontent",{"tcb-hasCode":(m=o.item)==null?void 0:m.promotionCode,"tcb-hastime":e(h)(o.item)||e(C)(o.item)}])},[o.item.showTitle?(c(),A("div",{key:0,class:z(["text",(L=o.item)!=null&&L.promotionCode?"hasCode":""])},[t("p",Mn,r((W=o.item.list[0])==null?void 0:W.title),1),t("p",Dn,r((f=o.item.list[0])==null?void 0:f.description),1)],2)):x("",!0),t("div",{class:z(["time-code-button",{hasCodeb:(V=o.item)==null?void 0:V.promotionCode,hasTimeb:(e(h)(o.item)||e(C)(o.item))&&e(d)}])},[(ne=o.item)!=null&&ne.promotionCode||e(h)(o.item)||e(C)(o.item)?(c(),A("div",{key:0,class:z(["flex time-code-box",{hasCode:(re=o.item)==null?void 0:re.promotionCode,hasTime:(e(h)(o.item)||e(C)(o.item))&&e(d)}])},[t("div",Un,[(e(h)(o.item)||e(C)(o.item))&&e(d)?(c(),Z(e(i),{key:0,title:e(h)(o.item)?e(a)("promotion.remainingTime"):e(a)("promotion.comingSoonTime"),endTime:e(h)(o.item)?e(T)(o.item.list[0].endTime):e(T)(o.item.list[0].startTime),countdownTyle:o.countdownTyle},null,8,["title","endTime","countdownTyle"])):x("",!0)]),(N=o.item)!=null&&N.promotionCode&&!o.codeTopShow?(c(),A("div",Nn,[t("span",Fn,r(e(a)("promotion.coupon")),1),t("span",Pn,[q(r((J=o.item)==null?void 0:J.promotionCode)+" ",1),t("img",{onClick:w[3]||(w[3]=l=>{var k;return e(s)((k=o.item)==null?void 0:k.promotionCode)}),src:o.copyIcon},null,8,Rn)])])):x("",!0)],2)):x("",!0),t("div",{class:z(["flex items-center bottom-btn-all",e(p)?"mt-10px":"mt-15px"])},[t("div",En,[t("div",Wn,[M(I,{size:"large",class:"memberinfo-btn w-100%",onClick:w[4]||(w[4]=l=>u("moreInfoHandle",o.item))},{default:R(()=>[q(r(o.detailBtnText||e(a)("common.moreInfo")),1)]),_:1})]),t("div",Vn,[M(e(B),{themeStyle:o.themeStyle,promoCentent:o.item,onUpdataList:w[5]||(w[5]=l=>u("init"))},null,8,["themeStyle","promoCentent"])])])],2)],2),t("div",{class:z(["flex items-center bottom-btn-all",e(p)?"mt-10px":"mt-15px"]),style:{display:"none"}},[t("div",Gn,[t("div",qn,[M(I,{size:"large",class:"memberinfo-btn w-100%",onClick:w[6]||(w[6]=l=>u("moreInfoHandle",o.item))},{default:R(()=>[q(r(o.detailBtnText||e(a)("common.moreInfo")),1)]),_:1})]),t("div",zn,[M(e(B),{themeStyle:o.themeStyle,promoCentent:o.item,onUpdataList:w[7]||(w[7]=l=>u("init"))}
1,null,8,["themeStyle","promoCentent"])])])],2)],2)])])],8,_n)):x("",!0)}}}),jn={key:1,class:"waterOut"},Hn=["list"],Qn=fe({__name:"index",props:{pageClass:{default:""},themeStyle:{default:"default"},copyIcon:{default:null},tabBase:{default:"available"},toApplayId:{default:null},detailContentLayout:{default:null},toUpperCase:{type:Boolean,default:!1},imgCDTimeShow:{type:Boolean,default:!1},bannerLink:{default:null},showTipNumber:{type:Boolean,default:!0},countdownTyle:{default:""},codeTopShow:{type:Boolean,default:!1},detailBtnText:{default:""},tabMode:{default:"scroll"}},setup(n,{expose:D}){const{t:T,locale:a}=ie();ce();const u=n,{isMobile:d,activeName:p,pageLoading:s,promoTyleTab:B,promoListWater:h,promoList:C,moreInfoHandle:g,promoCentent:i,showModal:o,removeRouterId:w,isShowMobileMoreInfo:I,init:Y,handleClick:U,typeFun:E,promoTopApply:m,PromoModal:L,MobileMoreInfo:W,showActiveNumber:f,languageCode:V,countdownTyle:ne}=Sn(u),re=Oe(E,500);return Be(async()=>{document.getElementsByTagName("body")[0].scrollTop=0,await Ne(),re()}),me(()=>V.value,async(N,J)=>{N&&N!=J&&(await Ne(),re())},{deep:!0}),tt(()=>{re.cancel()}),D({promoTopApply:m}),(N,J)=>{var ue;const l=ht,k=wt,X=qe,O=gt("masonry-tile");return c(),A("div",{class:z([[N.pageClass],"promotion-page-wrap"])},[t("div",{class:z({"px-10px pt-5px":e(d)})},[e(B)&&e(B).length?(c(),Z(l,{key:0,initActiveIndex:e(p),tabsData:e(B),onTabClick:e(U),class:z(`${N.themeStyle}-tab-change-page`),showActiveNumber:e(f),showTipNumber:N.showTipNumber,mode:N.tabMode},null,8,["initActiveIndex","tabsData","onTabClick","class","showActiveNumber","showTipNumber","mode"])):x("",!0)],2),t("div",{class:z(["position-relative promotion-page-cm",e(d)?"mt-10px min-h-200px mb-20px":"mt-20px min-h-500px mb-80px"])},[e(s)?Ue((c(),A("div",{key:0,background:"rgba(0,0,0,0.7)",class:z(["position-absolute left-50%",e(d)?"top-110px":"top-210px"]),style:{transform:"translate(-21px)"}},null,2)),[[X,e(s),void 0,{lock:!0}]]):x("",!0),e(s)?x("",!0):(c(),A("div",jn,[e(h).length?(c(),A("div",{key:0,"transition-duration":"0.3s",gutter:0,ref:"masonryRef",list:e(h)},[(c(!0),A(Pe,null,Re(e(C),(ae,K)=>Ue((c(),A("div",{class:"masonry-item mobile-col",key:K},[M(On,{item:ae,themeStyle:N.themeStyle,copyIcon:N.copyIcon,pageClass:N.pageClass,bannerLink:u.bannerLink,imgCDTimeShow:N.imgCDTimeShow,countdownTyle:e(ne),codeTopShow:N.codeTopShow,detailBtnText:N.detailBtnText,onMoreInfoHandle:e(g),onInit:e(Y)},null,8,["item","themeStyle","copyIcon","pageClass","bannerLink","imgCDTimeShow","countdownTyle","codeTopShow","detailBtnText","onMoreInfoHandle","onInit"])])),[[O]])),128))],8,Hn)):x("",!0)])),(!e(C)||!((ue=e(C))!=null&&ue.length))&&!e(s)&&e(B).length?(c(),A("div",{key:2,class:z(["color-#fff text-center noPromotion font-size-14px",e(d)?"pt-50px":"pt-180px"])},[M(k)],2)):x("",!0)],2),e(o)?(c(),Z(e(L),{key:0,visible:e(o),"onUpdate:visible":[J[0]||(J[0]=ae=>et(o)?o.value=ae:null),J[1]||(J[1]=ae=>{o.value=ae,e(w)()})],promoCentent:e(i),onUpdataList:e(Y),pageClass:N.pageClass,copyIcon:N.copyIcon,themeStyle:N.themeStyle},null,8,["visible","promoCentent","onUpdataList","pageClass","copyIcon","themeStyle"])):x("",!0),e(I)?(c(),Z(e(W),{key:1,class:z(`${N.pageClass}-mobile`),promoCentent:e(i),onUpdataList:e(Y),"onUpdate:isShowMobileMoreInfo":J[2]||(J[2]=ae=>{I.value=ae,e(w)()}),detailContentLayout:N.detailContentLayout,themeStyle:N.themeStyle},null,8,["class","promoCentent","onUpdataList","detailContentLayout","themeStyle"])):x("",!0)],2)}}}),Yn=Ve(Qn,[["__scopeId","data-v-39b37c8e"]]),Jn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAcCAYAAAB/E6/TAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAISSURBVHgB7ZZNdtMwEMdnFNtxFrTiBDXvNYZlcoLCjh1wAsoJCCdoOUG5QZsTwA3SnoB0xyt9r2LHBjDQDyetNdWoyXt+jpvIL25X/a9G1sg/WzOaEcICSRnJC+1vEeImmmFhWqGG7fT/UX/6IJRRlCZKFd+D8yChfBYR6YExo3l+gPrDKDn+xGZzNT5p4bibJCrJu4h5650g1g+3csPogvwB74QTKJDxaxcICwELW4qdc+3vOIFQ0wZUUBg+WZuYQ7vexNRfae8sBNHMV86XDvzNG4B4M4UJxF5TrvfY9qAuIfVMxvXT5Jsyo25xWkBN4jgRBYPwUfy2bL420EQRCdgzKU7BavwnWGnv8rmyoFDG2zyRD1wd4sPNCUHkf7YgTfDeGiZwdcMmyI4n15+LfFlhWPGg1YLKxNpMjM6y4BXcgepOhgfQPYAQ3Sp2FZl2o0r+iCILBBxCTfK8qx+zIATuQ9ASoz4BJLCkiGiPW/vs1pniyCeZWzGi/gjLSQlxad9RmgwNErtcIew9wNwHeAFUFu0jjl9MLyrIBb
1XUzfzy+N/3d2wz9DxrbhCQU3ni4F+dHh/knxnQ05NpApRI5b9qGWGTK7Yppgvc9oH00LT3m+QQcDhOjr5AFZAv2x1B+BWqS5Xd325TQ6e/f3qtx38N8yVUk7ykRpqNfh24ONus4+zykLqcKeAoe8ZEdujqfw3d3r7uF6gv9gAAAABJRU5ErkJggg==",Dl=fe({__name:"index",setup(n){xe(),Ae();const D=ce(),{t:T,locale:a}=ie(),u=S(()=>D.isMobile);return S(()=>D.isLogin),(d,p)=>{const s=rt,B=ut,h=Zt,C=Yn;return c(),A("div",{class:z(["page-container mtown-promotion",{"mobile-promotion pos-relative":e(u)}])},[e(u)?x("",!0):(c(),Z(s,{key:0,themeStyle:"mtown"})),M(B,{theme:"mtown",pageTitle:e(T)("promotion.promotion"),type:"link",fontSize:"16px"},null,8,["pageTitle"]),M(h),M(C,{pageClass:"mtown-promotion-content",themeStyle:"mtown",copyIcon:e(Jn),detailContentLayout:Ct,imgCDTimeShow:!0},null,8,["copyIcon"])],2)}}});export{Dl as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.