PageSourceSearch

https://xyes.ai/_next/static/chunks/features.e801676131821966.js

js xyes.ai collected 2026-10-05 14:49:45 UTC 299,777 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4463],{31676:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var r=n(57437),a=n(60033),i=n(2265),o=n(20418),l=n(17947),s=n(36067),c=n(19643),d=n(71096),u=n.n(d),m=n(31691),x=n(82156),h=n(70203),p=n(22577),g=n(33833),f=n(50290),v=n(1899),b=n(76245);function y(e){let{setFilters:t,setCurrentPage:n}=e,{t:d}=(0,a.i)(),{authenticated:y}=(0,o.E)(),{showMessage:j}=(0,s.useSnackbar)(),w=(0,m.Z)(),Z=(0,x.Z)(w.breakpoints.down("md")),{data:C,isError:S,error:k}=(0,l._y)({authenticated:y});S&&j(k.message||d("errors.anErrorOccurred"),"error");let[I,M]=(0,i.useState)(""),[A,F]=(0,i.useState)([u()().subtract(7,"day"),u()()]);return(0,i.useEffect)(()=>{var e,r;let a={category:I,fromDate:(null===(e=A[0])||void 0===e?void 0:e.toISOString())||"",toDate:(null===(r=A[1])||void 0===r?void 0:r.toISOString())||""};n(0),t({search:"",filters:JSON.stringify(a)})},[I,A,n,t]),(0,r.jsxs)(c.Z,{direction:"row",spacing:2,alignItems:"center",justifyContent:"start",children:[(0,r.jsxs)(h.Z,{sx:{width:Z?150:200},children:[(0,r.jsx)(p.Z,{id:"categorySelect",children:d("transaction.filter.selectAType")}),(0,r.jsx)(g.Z,{labelId:"categorySelect",id:"category-select",value:I,label:d("transaction.filter.selectAType"),onChange:e=>M(e.target.value),children:(null==C?void 0:C.data)&&C.data.length>0&&C.data.map(e=>(0,r.jsx)(f.Z,{value:e._id,children:e.name},e._id))})]}),(0,r.jsx)(v.Z,{sx:{width:Z?"auto":300,flexGrow:Z?1:0},children:(0,r.jsx)(b.Z,{value:A,onChange:e=>{F([e.fromDate?u()(e.fromDate):null,e.toDate?u()(e.toDate):null])},label:d("transaction.filter.dateRange")})})]})}var j=n(68651),w=n(68575),Z=n(38954),C=n(61043),S=n(82877),k=n(48116),I=n(22095),M=n(19902),A=n(70208),F=n(32281),D=n(28314),_=n(52988),T=n(46387),R=n(59469),N=n(73053),P=n(27970);let W=(e,t,n)=>t[n]<e[n]?-1:t[n]>e[n]?1:0,B=(e,t)=>"desc"===e?(e,n)=>W(e,n,t):(e,n)=>-W(e,n,t),L=(e,t)=>e&&Array.isArray(e)?e.map((e,t)=>[e,t]).sort((e,n)=>{let r=t(e[0],n[0]);return 0!==r?r:e[1]-n[1]}).map(e=>e[0]):[],E=e=>{let{gameRecordInfo:t,isLoading:n,page:o,rowsPerPage:l,onChangePage:s,onChangeRowsPerPage:c}=e,d=(0,m.Z)(),{t:u}=(0,a.i)(),[h]=(0,i.useState)("desc"),[p]=(0,i.useState)("createdAt"),g=(0,w.v9)(e=>e.user.data),{data:f}=(0,S.SG)({all:!0}),{data:b}=(0,S.Xn)({currencyCode:null==g?void 0:g.settings.view_in_fiat_object.currency}),y=(0,x.Z)(d.breakpoints.down("sm")),j={borderBottomColor:"#1976d2",backgroundColor:d.palette.grey[700]},Z={backgroundColor:"".concat(d.palette.blue[800]," !important")},W=(0,i.useMemo)(()=>t&&t.data?L(t.data,B(h,p)):[],[t,h,p]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(I.Z,{component:M.Z,sx:{maxHeight:1===W.length?"500px":void 0},children:(0,r.jsxs)(A.Z,{sx:{tableLayout:"auto"},children:[(0,r.jsx)(F.Z,{children:(0,r.jsx)(D.Z,{children:(y?[{id:"gameName",label:"gameRecord.table.gameName",width:100,align:"center",numeric:!1},{id:"betAmount",label:"gameRecord.table.betAmount",width:100,align:"center",numeric:!0},{id:"winLoss",label:"gameRecord.table.winLoss",width:100,align:"center",numeric:!0},{id:"createdAt",label:"gameRecord.table.time",width:120,align:"center",numeric:!1}]:[{id:"systemNo",label:"gameRecord.table.systemNo",width:100,align:"center",numeric:!1},{id:"gameName",label:"gameRecord.table.gameName",width:100,align:"center",numeric:!1},{id:"betAmount",label:"gameRecord.table.betAmount",width:100,align:"center",numeric:!0},{id:"winLoss",label:"gameRecord.table.winLoss",width:100,align:"center",numeric:!0},{id:"createdAt",label:"gameRecord.table.time",width:120,align:"center",numeric:!1}]).map(e=>(0,r.jsx)(_.Z,{sx:{...j,width:e.width,textAlign:e.align},sortDirection:p===e.id&&h,children:(0,r.jsx)(T.Z,{variant:"h4",children:u(e.label)})},e.id))})}),(0,r.jsx)(R.Z,{sx:Z,children:n?(0,r.jsx)(D.Z,{children:(0,r.jsx)(_.Z,{colSpan:8,align:"center",children:(0,r.jsx)(v.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(N.Z,{color:"secondary"})})})}):0!==W.length||n?W.map(e=>(0,r.jsxs)(D.Z,{hover:!0,children:[y?(0,r.jsx)(_.Z,{align:"center",children:e.gameName}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_.Z,{align:"center",children:e.systemNo}),(0,r.jsx)(_.Z,{align:"center",children:e.gameName})]}),(0,r.jsx)(_.Z,{align:"center",children:(0,r.jsx)(O,{betCurrencyExchange:e.betCurrencyExchange,userSettings:g,exchangeRates:b,currenciesData:f,currencyLogo:(0,k.ft)(e.currency||e.betCurrencyExchange.currency||"",null==f?void 0:f.data).logoUrl})}),(0,r.jsx)(_.Z,{align:"center",children:(0,r.jsx)(q,{betCurrencyExchange:e.betCurrencyExchange,userSettings:g,exchangeRates:b,currenciesData:f,currencyLogo:(0,k.ft)(e.currency||e.betCurrencyExchange.currency||"",null==f?void 0:f.data).logoUrl,gameResult:e.gameResult})}),(0,r.jsx)(_.Z,{align:"center",children:(0,r.jsx)(C.Z,{row:e})})]},e._id)):(0,r.jsx)(D.Z,{children:(0,r.jsx)(_.Z,{colSpan:8,align:"center",children:u("wallet.table.noRecords")})})})]})}),(0,r.jsx)(P.Z,{sx:Z,rowsPerPageOptions:[5,10],component:"div",count:t?t.totalDocuments:0,rowsPerPage:l,page:o,onPageChange:s,onRowsPerPageChange:c})]})},O=e=>{let{betCurrencyExchange:t,userSettings:n,exchangeRates:a,currenciesData:i,currencyLogo:o}=e,{to_show:l,currency:s}=(null==n?void 0:n.settings.view_in_fiat_object)||{},c=(0,k.TQ)(t.currency,null==i?void 0:i.data),d=(0,k.dN)(t.betAmount,c),u=null;return l&&a&&a[t.currency]&&(u=(0,k.x3)((0,j.Z)(t.betAmount).div((0,j.Z)(a[t.currency])).toString(),"f
1iat")),(0,r.jsxs)(v.Z,{display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:[(0,r.jsxs)(v.Z,{display:"flex",alignItems:"center",gap:1,children:[(0,r.jsx)(Z.Z,{width:c.includes("fiat")?25:20,height:20,alt:"currency",src:o}),(0,r.jsx)(T.Z,{fontWeight:"bold",children:d})]}),l&&(0,r.jsxs)(v.Z,{display:"flex",alignItems:"end",justifyContent:"end",gap:1.5,children:[(0,r.jsx)(T.Z,{children:s}),(0,r.jsx)(T.Z,{children:u})]})]})},q=e=>{let{betCurrencyExchange:t,userSettings:n,exchangeRates:i,currenciesData:o,currencyLogo:l,gameResult:s}=e,{to_show:c,currency:d}=(null==n?void 0:n.settings.view_in_fiat_object)||{},u=(0,k.TQ)(t.currency,null==o?void 0:o.data),m=(0,k.dN)(Number(t.winLoss),u),{t:x}=(0,a.i)(),h=null;return(c&&i&&i[t.currency]&&(h=(0,k.x3)((0,j.Z)(t.winLoss).div((0,j.Z)(i[t.currency])).toString(),"fiat")),"Pending"!==s&&s)?(0,r.jsxs)(v.Z,{display:"flex",flexDirection:"column",alignItems:"center",gap:1,children:[(0,r.jsxs)(v.Z,{display:"flex",alignItems:"center",gap:1,children:[(0,r.jsx)(Z.Z,{src:l,alt:"currency",width:u.includes("fiat")?25:20,height:20}),(0,r.jsx)(T.Z,{fontWeight:"bold",color:t.winLoss>0?"#1d8200":t.winLoss<0?"#ff0000":"#facc15",children:m})]}),c&&(0,r.jsxs)(v.Z,{display:"flex",alignItems:"end",justifyContent:"end",gap:1.5,children:[(0,r.jsx)(T.Z,{children:d}),(0,r.jsx)(T.Z,{color:t.winLoss>0?"#1d8200":t.winLoss<0?"#ff0000":"#facc15",children:h})]})]}):(0,r.jsx)(v.Z,{display:"flex",alignItems:"center",justifyContent:"center",children:(0,r.jsx)(T.Z,{color:"#facc15",children:x("gameRecord.table.pending")})})};function z(){let{t:e}=(0,a.i)(),{authenticated:t}=(0,o.E)(),{showMessage:n}
1=(0,s.useSnackbar)(),[d,u]=(0,i.useState)({search:"",filters:""}),[m,x]=(0,i.useState)(0),[h,p]=(0,i.useState)(5),{data:g,isLoading:f,isError:v,error:b,refetch:j}=(0,l.W0)({page:m,limit:h,filters:d,authenticated:t});return(0,i.useEffect)(()=>{j()},[m,h,d,j]),v&&n(b.message||e("errors.anErrorOccurred"),"error"),(0,r.jsxs)(c.Z,{direction:"column",spacing:2,sx:{mt:1},children:[(0,r.jsx)(y,{setFilters:u,setCurrentPage:x}),(0,r.jsx)(E,{gameRecordInfo:g,isLoading:f,page:m,rowsPerPage:h,onChangePage:(e,t)=>{x(t)},onChangeRowsPerPage:e=>{p(parseInt(e.target.value,10)),x(0)}})]})}},98145:function(e,t,n){n.r(t),n.d(t,{default:function(){return U}});var r=n(57437),a=n(33145),i=n(2265),o=n(60033),l=n(68575),s=n(17034),c=n(1899),d=n(46387),u=n(44811),m=()=>{var e;let{t}=(0,o.i)(),[,n]=(0,i.useState)(""),[,m]=(0,i.useState)(!0),x=(0,l.v9)(e=>e.user),{linkedAccountWithTelegram:h}=(0,s.Su)({setErrorMessage:n,setOpenMessage:m}),p=null===(e=x.data)||void 0===e?void 0:e.telegramId;return(0,r.jsxs)(c.Z,{sx:{width:{xs:"100%",md:"90%"},background:"radial-gradient(72.78% 432.22% at 100% 0%, #0DA0F2 24.15%, #111928 100%)",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",color:"white",position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(to right, rgba(17, 25, 40, 0.3), rgba(13, 160, 242, 0.3))",zIndex:1}},children:[(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",zIndex:2},children:[(0,r.jsx)(d.Z,{variant:"h3",fontWeight:400,children:t("userProfile.telegramBanner")}),(0,r.jsx)(d.Z,{variant:"h2",sx:{mb:1},children:t("userProfile.telegramBanner2")}),(0,r.jsxs)(d.Z,{variant:"h2",fontWeight:400,children:[t("userProfile.telegramBanner3")," ",(0,r.jsx)(c.Z,{component:"span",sx:{color:"primary.main"},children:t("userProfile.telegramBanner4")})]}),(0,r.jsx)(u.Z,{size:"large",variant:"contained",disabled:void 0!==p,onClick:h,sx:{mt:1,color:"white",px:2,borderRadius:"4px",maxHeight:"32px"},color:"primary",children:t(void 0===p?"actions.connect":"actions.connected")})]}),(0,r.jsx)(c.Z,{sx:{position:"absolute",top:2,right:1,backgroundColor:"primary.main",color:"white",padding:"4px 12px",zIndex:3,borderRadius:1},children:(0,r.jsx)(d.Z,{variant:"body2",sx:{fontWeight:"bold"},children:"NEW"})}),(0,r.jsx)(c.Z,{sx:{position:"absolute",bottom:-30,right:-30,width:100,height:100,borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.1)"}}),(0,r.jsx)(c.Z,{sx:{position:"absolute",top:0,right:"-12%",bottom:0,width:"60%",overflow:"visible"},children:(0,r.jsx)(a.default,{alt:"telegram-banner",src:"".concat("https://img.xyes.com/","assets/images/account-management/my-account/telegram-right-banner.png"),layout:"fill",objectFit:"contain",objectPosition:"left center",style:{zIndex:2}})})]})},x=n(55447),h=n(66274),p=n(43161),g=n(63400),f=n(31691),v=n(19643);let b=()=>{let{t:e}=(0,o.i)(),t=(0,f.Z)(),n=(0,h.tv)(),{getLink:a}=(0,p.m)(),l=(0,i.useCallback)(()=>{let t={limit:10,page:1,endpoint:"".concat("https://api.xyes.com/api/v1"+x.Hv.games.me),filter:"last_played"};return(0,r.jsx)(g.default,{options:t,category:{slug:"last-played",icon:"solar:cup-outline",name:"Last Played",categoryId:t},handleTabType:()=>{n.push(a("casino"))},setCurrentPage:()=>{},currentPage:1,setGames:()=>{},routeType:"casino",title:e("userProfile.lastPlayedGames"),games:void 0},1)},[n,e,a]);return(0,r.jsx)(v.Z,{direction:"column",spacing:2,alignItems:"start",sx:{backgroundColor:"grey.800",p:2,borderRadius:1,flexGrow:1,flexBasis:"50%",[t.breakpoints.down("md")]:{flexBasis:"100%",maxWidth:"100%"}},children:(0,r.jsx)(c.Z,{sx:{width:"100%"},children:l()})})};var y=n(36067),j=n(86404),w=n(82877),Z=n(62511),C=n(73053);let S=e=>{let{title:t,icon:n,items:a,withDetails:i,onDetailsClick:s,isLoadingItems:u=!1,abbreviateAmounts:m=!0}=e,{t:x}=(0,o.i)(),h=(0,f.Z)(),p=(0,l.v9)(e=>e.user.data),{data:g}=(0,w.Xn)({currencyCode:"USD"});return(0,r.jsxs)(c.Z,{sx:{backgroundColor:"grey.800",p:2,borderRadius:2,position:"relative",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",width:"100%"},children:[i?(0,r.jsx)(c.Z,{onClick:s,sx:{position:"absolute",right:16,top:16,cursor:"pointer",color:h.palette.secondary.main},children:(0,r.jsxs)(d.Z,{variant:"label",children:[x("actions.details")," >"]})}):null,(0,r.jsxs)(v.Z,{spacing:2,width:"100%",children:[(0,r.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:1,children:[n,(0,r.jsx)(d.Z,{variant:"h3",children:t})]}),(()=>{if(u)return(0,r.jsx)(C.Z,{});let e=Object.entries(null!=a?a:{}),t=["betAmount","betAmountWon","bonusClaimedAmount","totalCommissionAmount","totalReferralBetsAmount"];return(0,r.jsx)(v.Z,{spacing:2,width:"100%",children:e.map((e,n)=>{let[a,i]=e;return(0,r.jsxs)(c.Z,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,r.jsx)(d.Z,{variant:"h4",color:"text.secondary",sx:{fontWeight:400},children:x("userProfile.".concat(a))}),(0,r.jsx)(v.Z,{direction:"row",alignItems:"center",spacing:.5,children:(0,r.jsx)(d.Z,{variant:"paragraph",component:"p",fontWeight:"bold",sx:{margin:"0 auto"},children:t.includes(a)?(m?Z._S:Z.lj)({amount:Number(i),currency:"USD",fiatCurrency:(null==p?void 0:p.settings.view_in_fiat_object.currency)||"",exchangeRates:g||{}
1,shouldShow:(null==p?void 0:p.settings.view_in_fiat_object.to_show)||!1}):(0,r.jsx)("span",{children:i})})})]},n)})})})()]})]})};var k=()=>{let{t:e}=(0,o.i)(),{showMessage:t}=(0,y.useSnackbar)(),n=(0,l.v9)(e=>e.user.data),s=(0,i.useMemo)(()=>(null==n?void 0:n.memberId.toString())||"",[null==n?void 0:n.memberId]),{data:c,isLoading:d,isError:u,error:m}=(0,j.u)(s);return(0,i.useEffect)(()=>{let n=(null==m?void 0:m.message)||e("errors.anErrorOccurred");u&&t(n,"error")},[u,m,t,e]),(0,r.jsx)(v.Z,{direction:{xs:"column",md:"row"},spacing:2,children:c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S,{title:e("userProfile.bettingInformation"),icon:(0,r.jsx)(a.default,{alt:"chart",height:30,width:30,src:"".concat("https://img.xyes.com/","assets/icons/my-profile/chart.svg")}),isLoadingItems:d,items:c.bettingInformation}),(0,r.jsx)(S,{title:e("userProfile.bonusInformation"),icon:(0,r.jsx)(a.default,{alt:"chart",height:30,width:30,src:"".concat("https://img.xyes.com/","assets/icons/my-profile/rocket.svg")}),items:c.bonusInformation,isLoadingItems:d}),(0,r.jsx)(S,{title:e("userProfile.referralInformation"),icon:(0,r.jsx)(a.default,{alt:"rocket",height:30,width:30,src:"".concat("https://img.xyes.com/","assets/icons/my-profile/rocket.svg")}),items:c.referralInformation,abbreviateAmounts:!1})]})})},I=n(68651),M=n(68720),A=n(76975),F=n(29233),D=n.n(F),_=n(77533),T=n(67972),R=n(30166),N=n(67116),P=n(82156),W=n(12713),B=n(95576),L=n(89051),E=n(89902),O=n(5186);let q=Array.from({length:12},(e,t)=>"".concat("https://img.xyes.com/","assets/avatars/").concat(t+1,".png")),z=()=>{var e,t;let n=(0,l.I0)(),a=(0,f.Z)(),s=(0,P.Z)(a.breakpoints.down("sm")),{t:m,getLang:h}=(0,o.i)(),p=h(),g=(0,l.v9)(e=>e.user.data),b=(0,l.v9)(e=>e.user.permissions),{showMessage:j}=(0,y.useSnackbar)(),{data:w,isLoading:Z}=(0,R.Q)({populate:[{key:"populate",value:"*"}],locale:{key:"locale",value:p}}),[C,S]=(0,i.useState)(!1),[k,F]=(0,i.useState)(!1),[z,U]=(0,i.useState)((null==g?void 0:g.memberUsername)||""),[V,H]=(0,i.useState)((null==g?void 0:g.avatar)||""),[G,K]=(0,i.useState)(!1),X=null==w?void 0:null===(e=w.data)||void 0===e?void 0:e.find(e=>"profile"===e.attributes.slug),[$,J]=(0,i.useState)(!1);(0,i.useEffect)(()=>{g&&!C&&(U(g.memberUsername||""),H(g.avatar||""))},[C,g]);let Y=()=>{U((null==g?void 0:g.memberUsername)||""),H((null==g?void 0:g.avatar)||"")},Q=async()=>{if(g)try{var e;F(!0);let t={memberUsername:z};q.includes(V)&&(t.avatar=V);let r=await x.ZP.put(x.Hv.accountManagement.updateProfile,t),a=null===(e=r.data)||void 0===e?void 0:e.data;n((0,_.eN)({data:{...g,avatar:(null==a?void 0:a.avatar)||t.avatar||g.avatar,lastname:(null==a?void 0:a.lastname)||g.lastname,memberUsername:(null==a?void 0:a.memberUsername)||z||g.memberUsername,name:(null==a?void 0:a.name)||g.name},permissions:b})),S(!1),j(m("actions.updateSuccess"),"success")}catch(e){j(e.message||m("errors.anErrorOccurred"),"error")}finally{F(!1)}},ee=e=>{H(e)},et=(null==g?void 0:null===(t=g.memberId)||void 0===t?void 0:t.toString())||"",en=C&&V||(null==g?void 0:g.avatar),er=(0,I.Z)((null==g?void 0:g.xpPoints)||0).minus((0,I.Z)((null==g?void 0:g.levelInfo.baseCurrentLevelXP)||0)).toFixed(0,1),ea=(0,I.Z)((null==g?void 0:g.levelInfo.nextLevelXP)||0).minus((0,I.Z)((null==g?void 0:g.levelInfo.baseCurrentLevelXP)||0)).toString();return(0,r.jsxs)(v.Z,{direction:s?"column":"row",width:"100%",alignItems:s?"center":"flex-start",spacing:2,sx:{backgroundColor:"grey.800",p:2,borderRadius:1},children:[!s&&(0,r.jsx)(N.Z,{alt:"avatar",src:en,sx:{width:128,height:128}}),(0,r.jsxs)(v.Z,{spacing:2,flexGrow:1,width:s?"100%":"auto",children:[(0,r.jsxs)(v.Z,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[C?(0,r.jsxs)(v.Z,{spacing:1.5,flexGrow:1,sx:{mr:1},children:[(0,r.jsx)(W.Z,{id:"edit-username",label:"Username",variant:"outlined",sx:{background:"grey.800",borderRadius:1},inputProps:{min:0,max:32,style:{textAlign:"left"}},value:z,onChange:e=>{U(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&Q().catch(()=>void 0)}}),(0,r.jsxs)(v.Z,{spacing:1,children:[(0,r.jsx)(d.Z,{variant:"body2",color:"grey.400",children:"Choose avatar"}),(0,r.jsx)(v.Z,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,children:q.map(e=>{let t=e===V;return(0,r.jsx)(B.Z,{onClick:()=>
1ee(e),sx:{p:.35,border:"2px solid",borderColor:t?"primary.main":"transparent",borderRadius:"50%"},children:(0,r.jsx)(N.Z,{alt:"avatar option",src:e,sx:{width:40,height:40}})},e)})})]})]}):(0,r.jsxs)(c.Z,{display:"flex",alignItems:"center",flexGrow:1,children:[s&&(0,r.jsx)(N.Z,{alt:"avatar",src:en,sx:{width:32,height:32,mr:1}}),(0,r.jsxs)(c.Z,{flexGrow:1,children:[(0,r.jsx)(L.Z,{title:z,arrow:!0,placement:"top",children:(0,r.jsx)(d.Z,{variant:"h2",noWrap:!0,sx:{width:"95%"},children:z})}),(0,r.jsxs)(v.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsxs)(d.Z,{variant:"label",sx:{opacity:.7},children:[m("userProfile.userId"),": ",null==g?void 0:g.memberId]}),(0,r.jsx)(D(),{text:et,onCopy:()=>{K(!0),setTimeout(()=>K(!1),2e3)},children:(0,r.jsx)(L.Z,{title:G?"Copied!":"Copy to clipboard",children:(0,r.jsx)(B.Z,{size:"small",sx:{color:"grey.500"},children:(0,r.jsx)(M.JO,{icon:"mdi:content-copy",width:16,height:16,style:{color:G?"green":""}})})})})]})]})]}),(0,r.jsxs)(v.Z,{direction:"row",spacing:1,children:[C?(0,r.jsx)(u.Z,{variant:"outlined",sx:{minWidth:"auto",p:1,borderColor:"grey.500",color:"grey.100"},onClick:()=>{Y(),S(!1)},disabled:k,children:(0,r.jsx)(M.JO,{icon:"mdi:close",width:20,height:20,color:"white"})}):null,(0,r.jsx)(u.Z,{variant:"contained",sx:{minWidth:"auto",p:1,backgroundColor:"grey.600","&:hover":{backgroundColor:"grey.500"}},onClick:C?Q:()=>{S(e=>!e)},disabled:k,children:C?(0,r.jsx)(M.JO,{icon:"mdi:content-save",width:20,height:20,color:"white"}):(0,r.jsx)(M.JO,{icon:"mynaui:edit-one",width:20,height:20,color:"white"})})]})]}),(0,r.jsxs)(v.Z,{direction:"row",justifyContent:"space-between",spacing:1,flexWrap:"wrap",children:[(0,r.jsx)(E.Z,{label:null==g?void 0:g.levelInfo.currentLevel,size:"small",sx:{bgcolor:"secondary.main",color:"white","&:hover":{bgcolor:"secondary.main",cursor:"default"}},avatar:s?void 0:(0,r.jsx)(N.Z,{alt:"rank",src:null==g?void 0:g.levelInfo.icon})}),(0,r.jsxs)(d.Z,{variant:"button",color:"white",sx:{fontSize:s?"0.75rem":"0.875rem"},children:["".concat(null!=er?er:"-"," / ").concat(null!=ea?ea:"-"," XP"),(0,r.jsx)(u.Z,{variant:"text",size:"small",sx:{minWidth:"auto",padding:"2px",color:"white","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},onClick:()=>J(!0),children:(0,r.jsx)(A.Z,{color:"primary.main",icon:"jam:alert",width:20,height:20})})]}),(0,r.jsx)(E.Z,{label:null==g?void 0:g.levelInfo.nextLevel,size:"small",sx:{bgcolor:"secondary.main",color:"white","&:hover":{bgcolor:"secondary.main",cursor:"default"}},avatar:s?void 0:(0,r.jsx)(N.Z,{alt:"rank",src:null==g?void 0:g.levelInfo.nextLevelIcon})})]}),(0,r.jsx)(c.Z,{sx:{bgcolor:"grey.600",borderRadius:2,p:.5},children:(0,r.jsx)(O.Z,{variant:"determinate",value:Math.round((null==g?void 0:g.levelInfo.percentageToNextLevel)||0),sx:{width:"100%",height:s?10:15,"&.MuiLinearProgress-root":{backgroundColor:"grey.600"},borderRadius:2}})})]}),(0,r.jsx)(T.A,{title:(null==X?void 0:X.attributes.heading)||"Profile",showModal:$,type:"htmlContent",stickyHeader:!0,handleModal:()=>J(!1),modalProps:{content:null==X?void 0:X.attributes.content},size:"550px"})]})};function U(){return(0,r.jsxs)(v.Z,{direction:"column",spacing:2,sx:{mt:1},alignContent:"center",children:[(0,r.jsxs)(v.Z,{direction:{xs:"column",md:"row"},children:[(0,r.jsx)(z,{}),(0,r.jsx)(m,{})]}),(0,r.jsx)(b,{}),(0,r.jsx)(k,{})]})}},97512:function(e,t,n){n.r(t);var r=n(57437),a=n(34422),i=n(43577),o=n(60033),l=n(2265),s=n(21770),c=n(73842),d=n(55447),u=n(66798),m=n(33900),x=n(29501),h=n(36067),p=n(6809),g=n(1899),f=n(20184),v=n(85299),b=n(33460),y=n(19643),j=n(19978),w=n(73053),Z=n(46387),C=n(12713),S=n(50290),k=n(69459),I=n(19902),M=n(44811);let A=e=>{switch(e){case"number":return"number";case"file":default:return"text";case"date":return"date";case"dropdown":return"dropdown"}};t.default=e=>{let{cardSelected:t,refetch:n,isNew:F,setOpenModal:D,setShowKycModal:_,fiatData:T}=e,{t:R}=(0,o.i)(),{showMessage:N}=(0,h.useSnackbar)(),[P,W]=(0,l.useState)(0),[B,L]=(0,l.useState)((T||[]).find(e=>e.symbol===(null==t?void 0:t.currency))),[E,O]=(0,l.useState)([]),[q,z]=(0,l.useState)([]),[,U]=(0,l.useState)({}),[V,H]=(0,l.useState)(null),[G]=(0,l.useState)([]),{data:K,isLoading:X}=(0,m.K)({currency:(null==B?void 0:B.symbol)||"",code:(null==B?void 0:B.regionCode)||""},!!B),[$,J]=(0,l.useState)(),Y=[{label:R("steps.selectAccountType")},{label:R("steps.details")},{label:R("steps.confirm")}
1],Q=a.Ry().shape({currency:a.Ry({symbol:a.Z_().required(R("validators.currencySymbolRequired")),fiatId:a.Z_().required(R("validators.currencyFiatIdRequired"))}).required(R("validators.currencyIsRequired")),accountType:a.Ry({type:a.Z_().required(R("validators.currencySymbolRequired")),accountName:a.Z_().required(R("validators.currencySymbolRequired"))}).required(R("validators.accountTypeRequired")),remark:a.Z_(),other:a.Ry().shape(E.reduce((e,t)=>("bankName"===t.label?e[t.label]=a.Ry().shape({_id:a.Z_().required(),bank_name:a.Z_().required()}).required("".concat(t.customName," is required")):e[t.label]=a.Z_().required("".concat(t.customName," is required")),e),{}))}),ee=e=>{let t={};return e.forEach(e=>{t[e.type]||(t[e.type]=[]),t[e.type].push(e)}),t},et={currency:B||"",accountType:"",remark:(null==t?void 0:t.control.remark)||"",other:{...(null==t?void 0:t.other)||{},bankName:$}},en=(0,x.cI)({resolver:(0,c.X)(Q),defaultValues:et,mode:"onChange"}),{control:er,handleSubmit:ea,setValue:ei,getValues:eo,watch:el,formState:{errors:es,isSubmitting:ec}}=en,ed=e=>{if(e){if(en.clearErrors(),O([]),H({type:e.type,customName:e.customName}),ei("accountType",{type:e.type,customName:e.customName},{shouldValidate:!0}),null==e?void 0:e.other){var n;let r=[...null!==(n=e.other)&&void 0!==n?n:[]].sort((e,t)=>(null==e?void 0:e.label)==="bankName"?-1:(null==t?void 0:t.label)==="bankName"?1:0).map(e=>({...e,required:void 0===e.required||e.required}));ei("other",r.reduce((e,n)=>{var r;return e[n.label]=(null==t?void 0:null===(r=t.other)||void 0===r?void 0:r[n.label])||"",e},{}),{shouldValidate:!1,shouldDirty:!1}),O(r)}else ei("other",{},{shouldValidate:!1,shouldDirty:!1}),O([])}};(0,l.useEffect)(()=>{if((null==K?void 0:K.data)&&(null==t?void 0:t.bankName)){let e=(K.data||[]).find(e=>e.english_name===t.bankName);J(e),e&&ei("other.bankName",e,{shouldValidate:!0})}},[null==K?void 0:K.data,null==t?void 0:t.bankName,ei]),(0,l.useEffect)(()=>{if(B){let r=(null==B?void 0:B.supportedAccount)||[];U(ee(r)),z(r);let a=((null==B?void 0:B.supportedAccount)||[]).find(e=>e.customName===(null==t?void 0:t.accountName));if(ei("accountType",a,{shouldValidate:!1}),(null==a?void 0:a.other)&&Array.isArray(a.other)){var e,n;let r=[...null!==(n=a.other)&&void 0!==n?n:[]].sort((e,t)=>(null==e?void 0:e.label)==="bankName"?-1:(null==t?void 0:t.label)==="bankName"?1:0),i=r.map(e=>({...e,required:void 0===e.required||e.required})),o=r.reduce((e,n)=>{var r;return e[n.label]=(null==t?void 0:null===(r=t.other)||void 0===r?void 0:r[n.label])||"",e},{});(null==t?void 0:null===(e=t.other)||void 0===e?void 0:e.bankName)&&(o.bankName=$),ei("other",o,{shouldValidate:!0}),O(i)}else ei("other",{},{shouldValidate:!0}),O([])}},[$,null==t?void 0:t.accountName,null==t?void 0:t.other,B,ei]);let eu=async e=>{let t=F?"https://api.xyes.com/api/v1"+d.Hv.wallet.createBankCard:"https://api.xyes.com/api/v1"+d.Hv.wallet.updateBankCardById;return(await (0,d.ZP)({method:F?"post":"patch",url:t,data:e})).data},em=(0,s.D)({mutationFn:eu,onSuccess:e=>{N(R("actions.updateSuccess"),"success"),n(),D(!1)},onError:e=>{var t,n,r;e instanceof i.d7?N((null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message,"error"):(null===(t=e.message)||void 0===t?void 0:t.toLowerCase().includes("required level of verification"))?_(!0):N(e.message||R("errors.anErrorOccurred"),"error")}}),ex=async e=>{var n,r,a,i;let o=Object.entries(e.other).reduce((e,t)=>{let[n,r]=t;return"string"==typeof r?e[n]=r.trim():e[n]=r,e},{}),l={currency:e.currency.symbol,_id:F?void 0:null==t?void 0:t._id,regionCode:e.currency.regionCode||"",currencyId:e.currency.fiatId||"",remark:e.remark?e.remark.trim():"",type:e.accountType.type,accountName:e.accountType.customName,other:"bank_transfer"===e.accountType.type||"ewallet"===e.accountType.type?{...o,bankName:null==e?void 0:null===(r=e.other)||void 0===r?void 0:null===(n=r.bankName)||void 0===n?void 0:n.english_name}:o,..."bank_transfer"===e.accountType.type||"ewallet"===e.accountType.type?{bankNo:null==e?void 0:null===(i=e.other)||void 0===i?void 0:null===(a=i.bankName)||void 0===a?void 0:a.code}:{}};em.mutate(l)};return(0,r.jsx)(g.Z,{sx:{gap:2},children:(0,r.jsx)(x.RV,{...en,children:(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),e.stopPropagation(),ea(ex)(e)},children:[(0,r.jsx)(f.Z,{activeStep:P,alternativeLabel:!0,sx:{mb:{sx:0,sm:0,md:4}},children:Y.map(e=>(0,r.jsx)(v.Z,{sx:{"& .MuiStepIcon-root":{color:"grey.300",fontSize:"22px"},"& .Mui-completed":{color:"success.main"},"& .Mui-active":{color:"primary.main"}},children:(0,r.jsx)(b.Z,{sx:{"& .MuiStepLabel-label":{fontSize:"12px",color:"text.primary","&.Mu
1i-active":{color:"primary.main",fontWeight:"bold"},"&.Mui-completed":{color:"success.main"},display:{xs:"none",sm:"none",md:"block"}}},children:e.label})},e.label))}),(0,r.jsx)(y.Z,{direction:"column",sx:{mt:2},spacing:2,children:X?(0,r.jsx)(j.Z,{children:(0,r.jsx)(g.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(w.Z,{color:"secondary"})})}):(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(Z.Z,{variant:"h2",sx:{mb:4,py:1,display:{xs:"block",sm:"block",md:"none"}},children:Y[P].label}),0===P&&(0,r.jsxs)(g.Z,{children:[(0,r.jsx)(u.u,{name:"currency",control:er,options:T,label:R("bankCard.table.currency"),error:!!es.currency,getOptionLabel:e=>"".concat(e.symbol," - ").concat(e.fiatCountryOrRegion),isOptionEqualToValue:(e,t)=>!!t&&("string"==typeof t?e.symbol===t:e.symbol===t.symbol),onChange:e=>{ei("currency",(null==e?void 0:e.symbol)||""),z((null==e?void 0:e.supportedAccount)||[]),L(e),ei("remark","",{shouldValidate:!1,shouldDirty:!1}),ei("accountType",null,{shouldValidate:!1,shouldDirty:!1})},showAvatar:!0,value:eo("currency"),t:R}),(0,r.jsx)(g.Z,{sx:{mt:3}}),(0,r.jsx)(u.u,{name:"accountType",control:er,options:q.map(e=>({type:e.type,customName:e.customName,originalAccount:e})),label:R("steps.selectAccountType"),error:!!es.accountType,getOptionLabel:e=>e.customName,isOptionEqualToValue:(e,t)=>!!t&&!!e&&e.type===("string"==typeof t?t:null==t?void 0:t.type)&&e.customName===("string"==typeof t?"":null==t?void 0:t.customName),onChange:e=>{if(e){if(ed((null==e?void 0:e.originalAccount)||e),(null==K?void 0:K.data)&&(null==t?void 0:t.bankName)){let e=(K.data||[]).find(e=>e.english_name===t.bankName);J(e),e&&ei("other.bankName",e,{shouldValidate:!0})}}else H(null),ei("accountType",null,{shouldValidate:!0}),O([]),ei("other",{},{shouldValidate:!0})},value:V&&(q||[]).find(e=>e.type===V.type&&e.customName===V.customName)||null,showAvatar:!1,t:R})]}),1===P&&(0,r.jsxs)(g.Z,{children:[1===P&&G.length>0&&"ewallet"===V&&(0,r.jsx)(g.Z,{mb:2,children:(0,r.jsx)(u.u,{name:"subAccount",control:er,options:G,label:R("steps.selectSubAccount"),error:!1,getOptionLabel:e=>e.customName,isOptionEqualToValue:(e,t)=>!!t&&!!e&&e.customName===("string"==typeof t?t:null==t?void 0:t.customName),onChange:e=>{if(ei("accountType",e,{shouldValidate:!0}),(null==e?void 0:e.other)&&Array.isArray(e.other)){var n,r;let a=[...null!==(r=e.other)&&void 0!==r?r:[]].sort((e,t)=>(null==e?void 0:e.label)==="bankName"?-1:(null==t?void 0:t.label)==="bankName"?1:0),i=a.map(e=>({...e,required:void 0===e.required||e.required})),o=a.reduce((e,n)=>{var r;return e[n.label]=(null==t?void 0:null===(r=t.other)||void 0===r?void 0:r[n.label])||"",e},{});(null==t?void 0:null===(n=t.other)||void 0===n?void 0:n.bankName)&&(o.bankName=$),ei("other",o,{shouldValidate:!0}),O(i)}else ei("other",{},{shouldValidate:!0}),O([])},value:eo("accountType"),showAvatar:!1,t:R})}),E.map((e,t)=>{var n,a,i,o,l,s,c,d,m,x,h;return e.values&&Array.isArray(e.values)&&e.values.length>0?(0,r.jsx)(g.Z,{sx:{my:4},children:(0,r.jsx)(C.Z,{select:!0,fullWidth:!0,name:"other.".concat(e.label),label:e.customName,value:en.getValues("other.".concat(e.label))||"",onChange:t=>{let n={...en.getValues("other")||{},[e.label]:t.target.value};en.clearErrors("other.".concat(e.label)),ei("other",n,{shouldValidate:!1,shouldDirty:!1})},error:!!(null===(l=es.other)||void 0===l?void 0:l[e.label]),helperText:(null===(c=es.other)||void 0===c?void 0:null===(s=c[e.label])||void 0===s?void 0:s.message)||e.warningMessage,InputLabelProps:{shrink:!0,sx:{color:"#fff !important"}},FormHelperTextProps:{sx:{color:(null===(d=es.other)||void 0===d?void 0:d[e.label])?"error.main":"text.secondary",marginLeft:0,fontSize:"14px"}},placeholder:e.warningMessage,children:(e.values||[]).map(e=>(0,r.jsx)(S.Z,{value:null==e?void 0:e.value,children:null==e?void 0:e.key},null==e?void 0:e.value))})},t):"bankName"===e.label?(0,r.jsxs)(g.Z,{mb:4,children:[(0,r.jsx)(u.u,{name:"other.".concat(e.label),control:er,options:(null==K?void 0:K.data)||[],label:e.customName,error:!!(null===(m=es.other)||void 0===m?void 0:m[e.label]),placeholder:e.warningMessage,getOptionLabel:e=>null==e?void 0:e.bank_name,isOptionEqualToValue:(e,t)=>
1(null==e?void 0:e.bank_name)===("string"==typeof t?t:null==t?void 0:t.bank_name),onChange:t=>{let n=(null==t?void 0:t.bank_name)||"";ei("other",{...en.getValues("other")||{},[e.label]:n},{shouldValidate:!1,shouldDirty:!1})},value:en.getValues("other.".concat(e.label))||"",showAvatar:!1,t:R}),!(null===(x=es.other)||void 0===x?void 0:x[e.label])&&(0,r.jsx)(k.Z,{sx:{color:(null===(h=es.other)||void 0===h?void 0:h[e.label])?"error.main":"text.secondary",marginLeft:0,marginTop:"2px !important",marginBottom:2,fontSize:"10px"},children:e.warningMessage})]},t):(0,r.jsx)(g.Z,{sx:{my:4},children:(0,r.jsx)(C.Z,{fullWidth:!0,name:"other.".concat(e.label),label:e.customName,type:A(e.type),value:en.getValues("other.".concat(e.label))||"",InputProps:{inputProps:{min:e.min,max:e.max}},InputLabelProps:{shrink:!0,sx:{color:"#fff !important"}},error:!!(null===(n=es.other)||void 0===n?void 0:n[e.label]),helperText:null===(i=es.other)||void 0===i?void 0:null===(a=i[e.label])||void 0===a?void 0:a.message,placeholder:e.warningMessage,onChange:t=>{let n={...en.getValues("other")||{},[e.label]:t.target.value};en.clearErrors("other.".concat(e.label)),ei("other",n,{shouldValidate:!1,shouldDirty:!1})},FormHelperTextProps:{sx:{color:(null===(o=es.other)||void 0===o?void 0:o[e.label])?"error.main":"text.secondary",marginLeft:0,fontSize:"14px"}}})},t)}),(0,r.jsx)(g.Z,{mt:2,children:(0,r.jsx)(x.Qr,{name:"remark",control:er,render:e=>{var t;let{field:n}=e;return(0,r.jsx)(C.Z,{...n,fullWidth:!0,label:R("bankCard.table.remark"),error:!!es.remark,helperText:(null===(t=es.remark)||void 0===t?void 0:t.message)||"",inputProps:{maxLength:250},InputLabelProps:{shrink:!0,sx:{color:"#fff !important"}},onChange:e=>{n.onChange(e),ei("remark",e.target.value,{shouldValidate:!0,shouldDirty:!0})}})}})})]}),2===P&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I.Z,{sx:{bgcolor:"rgb(26, 31, 46)",px:3,pt:2,borderRadius:2,color:"white"},children:[(0,r.jsx)(Z.Z,{variant:"h4",gutterBottom:!0,children:R("steps.reviewInformation")}),(0,r.jsx)(g.Z,{component:"table",sx:{width:"100%",borderCollapse:"collapse",mb:3},children:(0,r.jsxs)(g.Z,{component:"tbody",children:[(0,r.jsxs)(g.Z,{component:"tr",children:[(0,r.jsxs)(g.Z,{component:"td",sx:{py:1.5,pr:2,fontWeight:"medium",color:"text.secondary",textTransform:"capitalize"},children:[R("validations.currency"),":"]}),(0,r.jsxs)(g.Z,{component:"td",sx:{py:1.5,textAlign:"end"},children:[en.getValues("currency.symbol")," (",en.getValues("currency.fiatCountryOrRegion"),")"]})]}),(0,r.jsxs)(g.Z,{component:"tr",children:[(0,r.jsxs)(g.Z,{component:"td",sx:{py:1.5,pr:2,fontWeight:"medium",color:"text.secondary",textTransform:"capitalize"},children:[R("steps.accountType"),":"]}),(0,r.jsx)(g.Z,{component:"td",sx:{py:1.5,textAlign:"end"},children:en.getValues("accountType.customName")})]}),E.map((e,t)=>{var n;let a=en.getValues("other.".concat(e.label));return(0,r.jsxs)(g.Z,{component:"tr",children:[(0,r.jsxs)(g.Z,{component:"td",sx:{py:1.5,pr:2,fontWeight:"medium",color:"text.secondary",textTransform:"capitalize"},children:[e.customName,":"]}),(0,r.jsx)(g.Z,{component:"td",sx:{py:1.5,textAlign:"end"},children:"bankName"===e.label?(null==a?void 0:a.bank_name)||"-":e.values?null===(n=(e.values||[]).find(e=>(null==e?void 0:e.value)===a))||void 0===n?void 0:n.key:a||"-"})]},t)}),(0,r.jsxs)(g.Z,{component:"tr",children:[(0,r.jsxs)(g.Z,{component:"td",sx:{py:1.5,pr:2,fontWeight:"medium",color:"text.secondary",textTransform:"capitalize"},children:[R("bankCard.table.remark"),":"]}),(0,r.jsx)(g.Z,{component:"td",sx:{py:1.5,textAlign:"end"},children:en.getValues("remark")})]})]})})]}),(0,r.jsx)(g.Z,{children:(0,r.jsx)(Z.Z,{variant:"body2",sx:{mt:2,color:"text.secondary"},children:R("steps.reviewInformationDescription")})})]}),(0,r.jsxs)(y.Z,{direction:"row",justifyContent:"space-between",mt:4,children:[(0,r.jsx)(M.Z,{color:"inherit",disabled:0===P,onClick:()=>{en.clearErrors(),W(e=>e-1)},sx:{mr:1},children:R("actions.back")}),P===Y.length-1?(0,r.jsx)(p.Z,{size:"small",type:"submit",variant:"header",loading:ec,disabled:ec,onClick:()=>ex(el()),children:R("actions.submit")}):(0,r.jsx)(M.Z,{variant:"header",onClick:()=>{let e=el("other");if(0===P){if(!eo("currency")||!eo("accountType")){en.setError("currency",{type:"manual",message:R("validations.requiredField")}),en.setError("accountType",{type:"manual",message:R("validations.requiredField")});return}}else if(1===P){let t=!1;if(E.forEach(n=>{let r=null==e?void 0:e[n.label];if(n.required&&(null==r||"string"==typeof r&&""===r.trim()||"object"==typeof r&&0===Object.keys(r).length)){en.setError("other.".concat(n.label),{type:"manual",message:R(n.warningMessage)}),t=!0;return}if(n.regexValue&&"/^.*$/"!==n.regexValue&&"string"==typeof r&&""!==r.trim()){let e=n.regexValue;e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),new RegExp("^".concat(e,"$")).test(r)?en.clearErrors("other.".concat(n.label)):(en.setError("other.".concat(n.label),{type:"manual",message:R(n.warningMessage)}),t=!0)}}),t)return}W(e=>e+1)},children:R("actions.next")})]})]})})]})})})}},48317:function(e,t,n){n.r(t),n.d(t,{default:function(){return ei}});var r=n(57437),a=n(20418),i=n(55343),o=n(2265),l=n(43577),s=n(60033),c=n(76975),d=n(66274),u=n(43161),m=n(55447),x=n(36067),h=n(67972),p=n(17947),g=n(67352),f=n(6809),v=n(31691),b=n(82156),y=n(1899),j=n(95576),w=n(19643),Z=n(46387),C=n(89414),S=n(35791),k=n(79507),I=n(77468),M=n(12258),A=n(9026),F=n(44811),D=n(27648),_=n(68575),T=n(38954),R=n(57099);function N(e){let{titleName:t,cardType:n,cardNumberType:a,currencyType:i,rowSelected:l,handleDeleteRow:d,isValid:u,handleEditRow:m}=e,x=(0,v.Z)(),{t:h}=(0,s.i)(),p=(0,b.Z)(x.breakpoints.down("sm")),[g,f]=(0,o.useState)(!1),[C,S]=(0,o.useState)(!1),k=(0,o.useRef)(null),I=(0,_.v9)(e=>e.userBalance.fiat),M=(0,_.v9)(e=>e.userBalance.crypto),A=(0,o.useMemo)(()=>(I||[]).find(e=>e.symbol===i),[I,i]),N=(0,o.useMemo)(()=>(M||[]).find(e=>e.symbol===i),[M,i]),W=e=>{k.current&&!k.current.contains(e.target)&&f(!1)};return(0,o.useEffect)(()=>(g?document.addEventListener("mousedown",W):document.removeEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}),[g]),(0,r.jsx)(y.Z,{mb:2,display:"flex",justifyContent:"center",children:(0,r.jsxs)(y.Z,{sx:{width:p?"100%":"320px",height:p?"100%":"180px",backgroundImage:"url(".concat("https://img.xyes.com/","assets/images/account-management/payment-address/").concat(n,"-bg.png)"),backgroundSize:"cover",backgroundRepeat:"no-repeat",borderRadius:p?"8px":"15px",padding:p?"2px":"10px",color:"#fff",position:"relative",overflow:"hidden",backgroundColor:u?"transparent":"#333",filter:u?"none":"brightness(0.6)",border:"2px s
1olid #0072FF"},ref:k,children:[g&&(0,r.jsxs)(w.Z,{direction:"row",alignItems:"center",justifyContent:"center",sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2},spacing:2,children:[!u&&(0,r.jsx)(j.Z,{sx:{p:0,color:"success.neon"},onClick:()=>m(l,!1),children:(0,r.jsx)(c.Z,{sx:{height:30,width:30},icon:"nimbus:edit"})}),(0,r.jsx)(j.Z,{sx:{p:0,fontSize:"40px",color:"warning.neon"},onClick:()=>d(l),children:(0,r.jsx)(c.Z,{sx:{height:40,width:40},icon:"solar:trash-bin-minimalistic-linear"})})]}),(0,r.jsxs)(y.Z,{sx:{px:p?1:0,filter:g?"blur(2px)":"none",opacity:g?.6:1,transition:"filter 0.3s ease, opacity 1s ease"},children:[(0,r.jsxs)(w.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{zIndex:2},children:[(0,r.jsx)(Z.Z,{noWrap:!0,variant:"h5",sx:{textTransform:"capitalize",width:"14rem"},children:t||"Bank Name"}),(0,r.jsx)(j.Z,{sx:{p:0,opacity:g?.7:1},onClick:()=>{f(e=>!e)},children:(0,r.jsx)(c.Z,{sx:{height:30,width:30},icon:"mdi:dots-horizontal"})})]}),(0,r.jsx)(y.Z,{sx:{mt:.5,ml:.5},children:(0,r.jsx)(T.Z,{alt:n||"card",src:"".concat("https://img.xyes.com/","assets/images/account-management/payment-address/").concat(n,"-chip.svg"),width:35,height:25})}),(0,r.jsxs)(w.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",mt:1,children:[(0,r.jsx)(Z.Z,{noWrap:"fiat"!==i,variant:"body2",sx:{letterSpacing:"fiat"===i?"2px":"normal",fontFamily:x.typography.fontSecondaryFamily,whiteSpace:"fiat"===i?"nowrap":"normal",wordBreak:"break-all",fontWeight:400},children:a?C?"fiat"===n?a.replace(/(\d{4})(?=\d)/g,"$1 "):a:"fiat"===n?(0,R.FE)(a):a.replace(/^(\w{4})\w+(\w{4})$/,"$1..............$2"):"1234 •••• •••• 6789"}),(0,r.jsx)(j.Z,{onClick:()=>{S(e=>!e)},children:(0,r.jsx)(c.Z,{icon:C?"solar:eye-bold":"solar:eye-closed-bold"})})]}),(0,r.jsxs)(y.Z,{sx:{display:"flex",justifyContent:"fiat"===n?"space-between":"flex-start",alignItems:"center",my:1},children:[(0,r.jsxs)(w.Z,{direction:"row",spacing:1,alignItems:"center",children:["fiat"===n&&A&&(0,r.jsx)(P,{image:A.logoUrl,symbol:A.symbol,currencyType:n}),"crypto"===n&&N&&(0,r.jsx)(P,{image:N.cryptoIcon,symbol:N.symbol,currencyType:n})]}),"crypto"===n&&(0,r.jsxs)(Z.Z,{variant:"h3",sx:{ml:1},children:["@",l.network]}),"fiat"===n&&(0,r.jsx)(F.Z,{LinkComponent:D.default,href:"?modal=wallet&tab=withdraw&type=fiat&currency=".concat(l.currency,"&id=").concat(l.systemNo),"data-test":"open-wallet-modal-button",size:"small",variant:"headerSecondary",sx:{border:"0.5px solid #FF7901CC"},children:(0,r.jsx)(Z.Z,{fontSize:10,children:h("wallet.withdraw")})})]})]})]})})}let P=e=>{let{image:t,symbol:n,currencyType:a}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.Z,{alt:n||"card",src:t,width:"fiat"===a?25:20,height:20}),(0,r.jsx)(y.Z,{sx:{border:"2px solid #fff",borderRadius:"5px",padding:"2px 5px"},children:(0,r.jsx)(Z.Z,{variant:"h6",sx:{color:"#fff",fontWeight:"bold",letterSpacing:"1px"},children:n})})]})};function W(){let e=(0,v.Z)(),{t}=(0,s.i)(),{authenticated:n}=(0,a.E)(),i=(0,b.Z)(e.breakpoints.down("sm")),[D,_]=(0,o.useState)(!1),[T,R]=(0,o.useState)(!1),[P,W]=(0,o.useState)(),{showMessage:B}=(0,x.useSnackbar)(),[L,E]=(0,o.useState)(!1),[O,q]=(0,o.useState)(!1),[z,U]=(0,o.useState)(!1),V="".concat("https://api.xyes.com/api/v1"+m.Hv.wallet.getBankDetailUser,"?page=",1,"&limit=",10),{data:H,refetch:G}=(0,p.DU)({fetchURL:V},n),K=(null==H?void 0:H.data)?H.data.filter(e=>0!==e.status):[],{data:X}=(0,g.J)("fiat","withdraw"),$=(null==X?void 0:X.data)?X.data:[],{getLink:J}=(0,u.m)(),Y=(0,d.tv)(),Q=e=>{W(e),_(!0)},ee=(e,t)=>{W(e),R(!0),q(t)},et=()=>{_(!1)},en=async()=>{E(!0);try{if((null==P?void 0:P.status)===1){let e={data:{_id:P._id}};await m.ZP.delete(m.Hv.wallet.deleteBankCardById,e)}else{let e={_id:null==P?void 0:P._id,status:1};await m.ZP.patch(m.Hv.wallet.updateBankCardById,e)}B(t("actions.updateSuccess")),G(),_(!1),E(!1)}catch(r){if(_(!0),r instanceof l.d7){var e,n;B((null===(n=r.response)||void 0===n?void 0:null===(e=n.data)||void 0===e?void 0:e.message)||r.message,"error")}else B(r.message||t("errors.anErrorOccurred"),"error")}finally{E(!1)}},er=(0,r.jsx)(y.Z,{mb:2,display:"flex",justifyContent:"center",children:(0,r.jsx)(y.Z,{sx:{width:i?"100%":"320px",height:i?"175px":"180px",border:"2px s
1olid #2b2f35",borderRadius:"15px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"#2b2f35",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"#24272c"}},onClick:()=>ee(void 0,!0),children:(0,r.jsx)(j.Z,{color:"success",children:(0,r.jsx)(c.Z,{width:36,height:40,icon:"solar:add-circle-linear"})})})});return(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(w.Z,{direction:"row",spacing:1,justifyContent:"space-between",sx:{mb:1},children:(0,r.jsxs)(y.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(c.Z,{width:32,icon:"solar:card-outline"}),(0,r.jsx)(Z.Z,{variant:"h2",sx:{fontWeight:"bold"},children:t("paymentAddress.bankCard")}),(0,r.jsxs)(Z.Z,{variant:"h2",children:["(",K.filter(e=>0!==e.status).length," / ",8,")"]})]})}),(0,r.jsxs)(C.ZP,{container:!0,spacing:i?1:2,children:[K.map((e,t)=>(0,r.jsx)(C.ZP,{item:!0,xs:6,sm:6,md:4,lg:3,children:(0,r.jsx)(N,{titleName:e.bankName,cardNumberType:e.acc,cardType:"fiat",currencyType:e.currency,rowSelected:e,handleDeleteRow:()=>Q(e),isValid:e.isValid,handleEditRow:()=>ee(e,!1)})},t)),K.filter(e=>0!==e.status).length<8&&(0,r.jsx)(C.ZP,{item:!0,xs:6,sm:6,md:4,lg:3,children:er})]}),(0,r.jsx)(h.A,{showModal:T,type:"registerCreditCardStepper",title:t(O?"paymentAddress.registerCreditCard":"paymentAddress.editCreditCard"),modalProps:{cardSelected:P,refetch:G,isNew:O,setOpenModal:R,fiatData:$,setShowKycModal:U},handleModal:R,fullScreenOnMobile:!0,hasIcon:!0,size:i?"300px":"500px"}),(0,r.jsx)(h.A,{showModal:z,type:"kycLevelNotMet",title:t("accountManagement.verification.verificationLevelNotMetTitle"),modalProps:{action:()=>{Y.push(J("account-management/verification/"))},halfHeight:!0},fullScreenOnMobile:!0,hasIcon:!0,showCloseButton:!1}),(0,r.jsxs)(S.Z,{open:D,fullWidth:!0,maxWidth:"xs",onClose:et,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.Z,{"aria-label":"close",sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},onClick:et,children:(0,r.jsx)(c.Z,{icon:"solar:close-circle-linear",sx:{height:30,width:30}})}),(0,r.jsx)(k.Z,{id:"alert-dialog-title",children:t((null==P?void 0:P.status)===1?"wallet.options.removeBankCard":"wallet.options.revertChanges")}
1)]}),(0,r.jsx)(I.Z,{children:(0,r.jsx)(M.Z,{id:"alert-dialog-description",children:t((null==P?void 0:P.status)===1?"wallet.options.areYouSureRemoveBankCard":"wallet.options.areYouSureRevertBankCardChages")})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsxs)(F.Z,{onClick:et,children:[" ",t("actions.cancel")]}),(0,r.jsx)(f.Z,{loading:L,autoFocus:!0,size:"large",sx:{alignSelf:"center",width:"fit-content"},onClick:en,variant:"header",children:t((null==P?void 0:P.status)===1?"actions.delete":"wallet.options.revert")})]})]})]})}var B=n(34422),L=n(73842),E=n(29501),O=n(4074),q=n(70203),z=n(22577),U=n(33833),V=n(67116),H=n(2323),G=n(12713),K=n(23996),X=n(50290),$=n(69459);let J={PaperProps:{sx:{maxHeight:{xs:263,sm:326},width:250}},autoFocus:!1},Y=(e,t)=>e.symbol.toLowerCase().includes(t.toLowerCase());function Q(e){let{dataSelected:t,isNewCrypto:n,handleClose:a,refetch:i}=e,[d,u]=(0,o.useState)(),[h,p]=(0,o.useState)([]),[g,v]=(0,o.useState)(null),b=(0,_.v9)(e=>e.user.data),j=(0,_.v9)(e=>e.userBalance.crypto),[Z,C]=(0,o.useState)(""),[S,k]=(0,o.useState)(null),M=(0,o.useMemo)(()=>null==j?void 0:j.filter(e=>Y(e,Z)),[j,Z]),{t:A}=(0,s.i)(),{showMessage:F}=(0,x.useSnackbar)(),D=B.Ry().shape({currency:B.Z_().required(A("validators.currencyIsRequired")),network:B.Z_().required(A("validators.networkIsRequired")),address:B.Z_().required(A("validators.addressIsRequired")).test("is-valid-address",A("validators.invalidCryptoAddress"),function(e){let{currency:t,network:n}=this.parent,r=(0,R.GB)(n);try{return(0,O.validate)(e,t,{chainType:r})}catch(e){return this.createError({message:A("validators.invalidCryptoAddress")})}}),cardRemark:B.Z_()}),{control:T,handleSubmit:N,setValue:P,trigger:W,formState:{errors:Q,isSubmitting:ee}}=(0,E.cI)({resolver:(0,L.X)(D),defaultValues:{currency:(null==t?void 0:t.currency)||"",network:(null==t?void 0:t.network)||"",address:(null==t?void 0:t.address)||"",cardRemark:(null==t?void 0:t.control.remark)||""}}),et=(0,o.useCallback)(async(e,n)=>{try{let n=null==e?void 0:e.coinId,r=await m.ZP.get("".concat(m.Hv.wallet.getNetworksByCurrency+n));p(r.data.data);let a=(r.data.data||[]).find(e=>e.chain===(null==t?void 0:t.network));v(void 0!==a?a:r.data.data[0]),P("network",(null==a?void 0:a.chain)||"")}catch(e){if(e instanceof l.d7){var r,a;F((null===(a=e.response)||void 0===a?void 0:null===(r=a.data)||void 0===r?void 0:r.message)||e.message,"error")}else F(e.message||A("errors.anErrorOccurred"),"error")}},[null==t?void 0:t.network,P,F,A]);(0,o.useEffect)(()=>{if(!n){var e;let n=null===(e=j||[])||void 0===e?void 0:e.find(e=>e.symbol===(null==t?void 0:t.currency));u(n),et(n,null),P("currency",(null==n?void 0:n.symbol)||"")}},[n,j,null==t?void 0:t.currency]);let en=N(async e=>{try{let r={user:n?null==b?void 0:b._id:void 0,currency:e.currency,network:e.network,address:e.address,remark:e.cardRemark,_id:null==t?void 0:t._id},o=n?"https://api.xyes.com/api/v1"+m.Hv.wallet.createCryptoWallet:"https://api.xyes.com/api/v1"+m.Hv.wallet.updateCryptoWalletById,l=await (0,m.ZP)({method:n?"post":"patch",url:o,data:r});200===l.status&&(F(A("actions.updateSuccess"),"success"),i(),k(null),a())}catch(e){if(e instanceof l.d7){var r,o;F((null===(o=e.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:r.message)||e.message,"error")}else"Invalid crypto address"===e.message?k(A("validators.invalidCryptoAddress")):F(e.message||A("errors.anErrorOccurred"),"error")}});return(0,r.jsx)(w.Z,{direction:"column",spacing:2,children:(0,r.jsxs)("form",{onSubmit:en,children:[(0,r.jsxs)(I.Z,{sx:{px:0},children:[(0,r.jsxs)(q.Z,{sx:{my:2},fullWidth:!0,children:[(0,r.jsx)(z.Z,{id:"currency-label",sx:{color:Q.currency&&"#ba3619"},children:A("wallet.table.currency")}),(0,r.jsx)(E.Qr,{name:"currency",control:T,render:e=>{let{field:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(U.Z,{...t,MenuProps:J,labelId:"currency-label",label:A("wallet.table.currency"),id:"currency-select",value:t.value,error:!!Q.currency,onChange:e=>{var n;let r=e.target.value,a=null===(n=j||[])||void 0===n?void 0:n.find(e=>e.symbol===r);t.onChange(null==a?void 0:a.symbol),u(a),et(a,null)},renderValue:e=>(0,r.jsxs)(w.Z,{direction:"row",spacing:0,children:[(0,r.jsx)(V.Z,{src:null==d?void 0:d.cryptoIcon,sx:{mr:2,height:25,width:25}}),null==d?void 0:d.symbol]}),children:[(0,r.jsx)(H.Z,{children:(0,r.jsx)(G.Z,{size:"small",autoFocus:!0,placeholder:A("wallet.typeToSearch"),fullWidth:!0,InputProps:{startAdornment:(0,r.jsx)(K.Z,{position:"start",children:(0,r.jsx)(c.Z,{icon:"eva:search-fill",width:24,sx:{color:"text.disabled"}})})},style:{padding:10},onChange:e=>C(e.target.value),onKeyDown:e=>{"Escape"!==e.key&&e.stopPropagation()}})}),null==M?void 0:M.map(e=>(0,r.jsxs)(X.Z,{value:e.symbol,children:[(0,r.jsx)(V.Z,{src:e.cryptoIcon,sx:{mr:2,height:25,width:25}}),e.symbol]},e._id))]}),(0,r.jsx)($.Z,{sx:{color:"#ba3619"},children:Q.currency?A("validators.currencyIsRequired"):""})]})}})]}),(0,r.jsxs)(q.Z,{sx:{mb:2},fullWidth:!0,children:[(0,r.jsx)(z.Z,{id:"network-label",sx:{color:Q.network&&"#ba3619"},children:A("wallet.table.chooseNetwork")}),(0,r.jsx)(E.Qr,{name:"network",control:T,render:e=>{let{field:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U.Z,{...t,MenuProps:J,labelId:"network-label",label:A("wallet.table.chooseNetwork"),id:"network-select",value:t.value,error:!!Q.network,onChange:e=>{var n;let r=null===(n=h||[])||void 0===n?void 0:n.find(t=>t.chain===e.target.value);
1t.onChange(null==r?void 0:r.chain),v(r)},renderValue:e=>(0,r.jsx)(w.Z,{direction:"row",spacing:0,children:null==g?void 0:g.chain}),children:null==h?void 0:h.map(e=>(0,r.jsx)(X.Z,{value:e.chain,children:e.chain},e._id))}),(0,r.jsx)($.Z,{sx:{color:"#ba3619"},children:Q.network?A("validators.networkIsRequired"):""})]})}})]}),(0,r.jsx)(y.Z,{sx:{mb:2},children:(0,r.jsx)(E.Qr,{name:"address",control:T,render:e=>{var t;let{field:n}=e;return(0,r.jsx)(G.Z,{...n,label:A("wallet.table.address"),fullWidth:!0,error:!!Q.address||!!S,helperText:(null===(t=Q.address)||void 0===t?void 0:t.message)||S,sx:{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:S?"#ba3619":void 0}}},onChange:e=>{n.onChange(e.target.value),k(null),W("address")}})}})}),(0,r.jsx)(y.Z,{sx:{mb:2},children:(0,r.jsx)(E.Qr,{name:"cardRemark",control:T,render:e=>{var t;let{field:n}=e;return(0,r.jsx)(G.Z,{...n,label:A("wallet.table.cardRemark"),fullWidth:!0,error:!!Q.cardRemark,helperText:null===(t=Q.cardRemark)||void 0===t?void 0:t.message})}})})]}),(0,r.jsx)(w.Z,{direction:"row",justifyContent:"center",alignContent:"center",spacing:2,my:4,children:(0,r.jsx)(f.Z,{color:"inherit",size:"large",type:"submit",variant:"header",sx:{width:"300px"},loading:ee,children:A("actions.save")})})]})})}function ee(){let{t:e}=(0,s.i)(),{authenticated:t}=(0,a.E)(),[n,i]=(0,o.useState)(),[d,u]=(0,o.useState)(!1),[h,g]=(0,o.useState)(!1),[D,_]=(0,o.useState)(!1),{showMessage:T}=(0,x.useSnackbar)(),[R,P]=(0,o.useState)(!1),W=(0,v.Z)(),B=(0,b.Z)(W.breakpoints.down("sm")),L="".concat("https://api.xyes.com/api/v1"+m.Hv.wallet.getCryptoWalletUser,"?page=",1,"&limit=",10),{data:E,refetch:O}=(0,p.BQ)({fetchURL:L},t),q=E?null==E?void 0:E.data.filter(e=>0!==e.status):[],z=e=>{g(!0),i(e)},U=(e,t)=>{P(t),i(e),_(!0)},V=async()=>{u(!0);try{if((null==n?void 0:n.status)===1){let e={data:{_id:n._id}};await m.ZP.delete(m.Hv.wallet.deleteCryptoWalletById,e)}else{let e={_id:null==n?void 0:n._id,status:1};await m.ZP.patch(m.Hv.wallet.updateCryptoWalletById,e)}T(e("actions.updateSuccess")),O(),g(!1),u(!1)}catch(n){if(g(!0),n instanceof l.d7){var t,r;T((null===(r=n.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||n.message,"error")}else T(n.message||e("errors.anErrorOccurred"),"error")}finally{u(!1)}},H=()=>{g(!1),_(!1)},G=(0,r.jsx)(y.Z,{mb:2,display:"flex",justifyContent:"center",children:(0,r.jsx)(y.Z,{sx:{width:B?"100%":"320px",height:B?"175px":"180px",border:"2px solid #2b2f35",borderRadius:"15px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:"#2b2f35",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"#24272c"}},onClick:()=>U(void 0,!0),children:(0,r.jsx)(j.Z,{color:"success",children:(0,r.jsx)(c.Z,{width:36,height:40,icon:"solar:add-circle-linear"})})})});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(w.Z,{direction:"row",spacing:2,justifyContent:"space-between",sx:{mb:2},children:(0,r.jsxs)(y.Z,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,r.jsx)(c.Z,{width:32,icon:"solar:safe-2-linear"}),(0,r.jsxs)(Z.Z,{variant:"h2",children:[e("wallet.table.cryptoAddress")," (",q.length," / ",8,")"]})]})}),(0,r.jsxs)(C.ZP,{container:!0,spacing:2,children:[q.map((e,t)=>{var n;return(0,r.jsx)(o.Fragment,{children:(0,r.jsx)(C.ZP,{item:!0,xs:6,sm:6,md:4,lg:3,children:(0,r.jsx)(N,{titleName:null===(n=e.control)||void 0===n?void 0:n.remark,cardNumberType:e.address,cardType:"crypto",currencyType:e.currency,rowSelected:e,handleDeleteRow:()=>z(e),isValid:e.isValid,handleEditRow:()=>U(e,!1)})})},t)}),q.length<8&&(0,r.jsx)(C.ZP,{item:!0,xs:6,sm:6,md:4,lg:3,children:G})]})]}),(0,r.jsxs)(S.Z,{open:h,fullWidth:!0,maxWidth:"xs",onClose:H,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,r.jsx)(j.Z,{"aria-label":"close",sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},onClick:H,children:(0,r.jsx)(c.Z,{icon:"solar:close-circle-linear",sx:{height:30,width:30}})}),(0,r.jsx)(k.Z,{id:"alert-dialog-title",children:e((null==n?void 0:n.status)===1?"wallet.options.removeAddress":"wallet.options.revertChanges")}
1),(0,r.jsx)(I.Z,{children:(0,r.jsx)(M.Z,{id:"alert-dialog-description",children:e((null==n?void 0:n.status)===1?"wallet.options.areYouSureRemoveAddress":"wallet.options.areYouSureRevertChages")})}),(0,r.jsxs)(A.Z,{children:[(0,r.jsxs)(F.Z,{onClick:H,children:[" ",e("actions.cancel")]}),(0,r.jsx)(f.Z,{loading:d,autoFocus:!0,size:"large",sx:{alignSelf:"center",width:"fit-content"},onClick:V,variant:"header",children:e((null==n?void 0:n.status)===1?"actions.disable":"wallet.options.revert")})]})]}),(0,r.jsxs)(S.Z,{open:D,onClose:H,fullWidth:!0,maxWidth:"xs",children:[(0,r.jsx)(j.Z,{"aria-label":"close",sx:{position:"absolute",right:8,top:8,color:e=>e.palette.grey[500]},onClick:H,children:(0,r.jsx)(c.Z,{icon:"solar:close-circle-linear",sx:{height:30,width:30}})}),(0,r.jsx)(k.Z,{id:"alert-dialog-title",children:e(R?"wallet.options.addNewAddress":"wallet.options.editAddress")}),(0,r.jsx)(I.Z,{children:(0,r.jsx)(Q,{dataSelected:n,handleClose:H,isNewCrypto:R,refetch:O})})]})]})}var et=n(19978),en=n(73053);let er=()=>(0,r.jsx)(y.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(en.Z,{color:"secondary"})}),ea=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W,{}),(0,r.jsx)(ee,{})]});function ei(){let{authenticated:e,loading:t}=(0,a.E)();return t?(0,r.jsx)(et.Z,{children:(0,r.jsx)(er,{})}):(0,r.jsx)(y.Z,{sx:{mt:1,width:"100%"},children:(0,r.jsx)(w.Z,{spacing:4,children:e?(0,r.jsx)(ea,{}):(0,r.jsx)(i.Kl,{})})})}},31589:function(e,t,n){n.r(t),n.d(t,{DesktopCampaing:function(){return U}});var r=n(57437),a=n(2265),i=n(60033),o=n(76975),l=n(20418),s=n(57099),c=n(67049),d=n(33148),u=n(36067),m=n(67972),x=n(68575),h=n(29233),p=n.n(h),g=n(82877),f=n(37631),v=n(62511),b=n(55447),y=n(19643),j=n(12713),w=n(44811),Z=n(46387);let C=e=>{let{campaignName:t,campaignId:n}=e,{t:l}=(0,i.i)(),[s,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(t),{showMessage:x}=(0,u.useSnackbar)(),h=async()=>{try{let{data:e}=await b.ZP.patch(b.Hv.auth.updateCampaign+n,{name:d});c(!1),200===e.status&&x("accountManagement.referral.campaings.campaignNameUpdated","success")}catch(e){x(e.message||l("errors.anErrorOccurred"),"error")}};return(0,r.jsx)(y.Z,{direction:"row",alignItems:"center",children:s?(0,r.jsxs)(y.Z,{direction:"row",spacing:1,justifyContent:"space-between",children:[(0,r.jsx)(j.Z,{id:"edit-campaign-name",variant:"outlined",sx:{background:"grey.800",borderRadius:1,width:"180px"},inputProps:{min:0,max:16,style:{textAlign:"left",height:"5px",fontSize:"11px"}},value:d,onChange:e=>{m(String(e.target.value).substring(0,255))},onKeyDown:e=>{"Enter"===e.key&&h()}}),(0,r.jsx)(w.Z,{variant:"contained",sx:{fontSize:"0.7rem",borderRadius:"4px",color:"white",backgroundColor:"grey.600",px:1,py:.2,minWidth:0},onClick:e=>{e.stopPropagation(),h()},children:(0,r.jsx)(o.Z,{icon:"mdi:content-save",width:20,height:20,color:"white"})})]}):(0,r.jsxs)(y.Z,{direction:"row",alignItems:"center",children:[(0,r.jsx)(Z.Z,{component:"span",sx:{fontWeight:700,color:"#FFFFFF",marginRight:"12px",wordBreak:"break-all"},children:d}),(0,r.jsx)(o.Z,{icon:"fa-regular:edit",sx:{cursor:"pointer",width:"20px",height:"20px"},onClick:e=>{e.preventDefault(),e.stopPropagation(),m(d),c(!s)}})]})})};var S=n(16210),k=n(52077),I=n(44164),M=n(1899),A=n(73053),F=n(36402),D=n(89902);let _=(0,S.ZP)(k.Z)({backgroundColor:"#374151",borderTopRightRadius:"8px",borderTopLeftRadius:"8px"}),T=(0,S.ZP)(I.Z)({backgroundColor:"#111928",border:"2px solid #374151"}),R={fontWeight:700,lineHeight:"150%"},N={cursor:"pointer",color:"#FFFFFF",width:"16px",height:"16px"},P={cursor:"pointer",color:"#9CA3AF",width:"24px",height:"24px"},W=e=>{let{data:t,isLoading:n,setShowShareViaSocialModal:l}=e,{t:s}=(0,i.i)(),[c,d]=(0,a.useState)(null),[m,h]=(0,a.useState)({value:"",copied:!1}),b=(0,x.v9)(e=>e.user.data),{data:j}=(0,g.Xn)({currencyCode:"USD"}),S=e=>{h({copied:!0,value:e}),setTimeout(()=>{h({copied:!1,value:""})},2500)},{showMessage:k}=(0,u.useSnackbar)(),I=e=>e===c?d(null):d(e),W={currency:"USD",fiatCurrency:(null==b?void 0:b.settings.view_in_fiat_object.currency)||"",exchangeRates:j||{}
1,shouldShow:(null==b?void 0:b.settings.view_in_fiat_object.to_show)||!1},B=e=>(0,v.lj)({amount:Number(e.totalCommissionAmount||0),...W});return(0,a.useEffect)(()=>{m.copied&&k(s("general.textCopied"),"success")},[k,s,m.copied]),(0,r.jsxs)(M.Z,{sx:{display:"grid",gridTemplateColumns:{lg:"repeat(2, 1fr)",md:"1fr"},gap:"1rem",mt:{lg:5,sm:3}},children:[n&&(0,r.jsx)(M.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(A.Z,{color:"secondary"})}),(null==t?void 0:t.data)&&t.data.length>0&&t.data.sort((e,t)=>(t.default?1:0)-(e.default?1:0)).map((e,t,n)=>{var a,i;let d=t===n.length-1,u=n.length%2!=0;return(0,r.jsx)(M.Z,{sx:{gridColumn:u&&d?"1 / -1":void 0},children:(0,r.jsxs)(F.Z,{sx:{"&:before":{display:"none"}},expanded:e._id===c,onChange:()=>I(e._id),disableGutters:!0,children:[(0,r.jsxs)(_,{"aria-controls":"campaigns-content",id:"campaigns-summary-header",sx:{backgroundColor:"rgba(42, 51, 74, 1)"},children:[e.default&&(0,r.jsx)(y.Z,{direction:"row",children:(0,r.jsx)(D.Z,{label:"".concat(s("general.default")),color:"primary",sx:{maxWidth:"150px",p:"12px 0",height:"16px",borderRadius:"6px 6px 6px 0",fontStyle:"normal",fontWeight:"bold",fontSize:"10px",lineHeight:"150%",color:"#FFFFFF",left:0,position:"absolute",top:-32}})}),(0,r.jsxs)(M.Z,{sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:2},children:[(0,r.jsxs)(y.Z,{justifyContent:"center",children:[(0,r.jsx)(C,{campaignName:e.name,campaignId:e._id}),(0,r.jsx)(Z.Z,{children:"".concat(s("general.createdAt"))}),(0,r.jsx)(f.U,{date:e.createdAt,formatStyle:"short",timeFormat:"24h",showTime:!0})]}),(0,r.jsxs)(y.Z,{border:"2px dashed gray",direction:"row",sx:{paddingX:1.5,paddingY:.5,borderRadius:1,ml:"auto",mr:2,"@media (max-width: 510px)":{display:"none"}},alignItems:"center",justifyContent:"center",spacing:1,children:[(0,r.jsx)(Z.Z,{sx:{px:2,textTransform:"uppercase"},children:e.referenceCode}),(0,r.jsx)(p(),{text:e.referenceCode,onCopy:()=>S(e.referenceCode),children:(0,r.jsx)(w.Z,{onClick:e=>e.stopPropagation(),variant:"headerSecondary",size:"small",sx:{padding:"2px 4px"},children:(0,r.jsx)(o.Z,{icon:"eva:copy-fill"})})})]}),(0,r.jsxs)(y.Z,{direction:"row",spacing:1,children:[(0,r.jsx)(M.Z,{sx:{display:"grid",placeItems:"center",height:"36px",minWidth:"40px",background:"#1F272D",borderRadius:"5px"},onClick:t=>{t.stopPropagation(),l({isVisible:!0,referralCode:e.referenceCode,referralLink:e.referalLink,campaignName:e.name})},children:(0,r.jsx)(o.Z,{icon:"eva:share-outline"})}),(0,r.jsx)(M.Z,{sx:{display:"grid",placeItems:"center",height:"36px",minWidth:"40px",background:"#1F272D",borderRadius:"5px",mr:.5},children:(0,r.jsx)(o.Z,{icon:"iconamoon:arrow-up-2-duotone",sx:{...N,transition:"rotate 0.2s ease",rotate:c===e._id?"180deg":0}})})]})]},e._id)]}),(0,r.jsxs)(T,{children:[(0,r.jsxs)(y.Z,{direction:"row",justifyContent:"space-between",width:"100%",sx:{mt:"10px"},children:[(0,r.jsx)(Z.Z,{variant:"label",sx:{...R,color:"#D1D5DB"},children:s("accountManagement.referral.campaings.table.myProfit")}),(0,r.jsx)(Z.Z,{variant:"label",sx:R,children:B(e)})]}),(0,r.jsxs)(y.Z,{direction:"row",justifyContent:"space-between",width:"100%",sx:{marginTop:"10px"},children:[(0,r.jsx)(Z.Z,{variant:"label",sx:{...R,color:"#D1D5DB"},children:s("accountManagement.referral.campaings.table.referrals")}),(0,r.jsx)(Z.Z,{variant:"label",sx:{...R,color:"#D1D5DB"},children:null!==(i=null!==(a=e.totalReferrals)&&void 0!==a?a:e.totalReferred)&&void 0!==i?i:0})]}),(0,r.jsxs)(y.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",sx:{marginTop:"10px"},children:[(0,r.jsx)(Z.Z,{variant:"label",sx:{...R,color:"#D1D5DB"},children:s("accountManagement.referral.campaings.table.referralLink")}),(0,r.jsxs)(M.Z,{sx:{...R,display:"flex",alignItems:"center"},children:[(0,r.jsx)(Z.Z,{variant:"label",children:String(e.referalLink).length>27?"".concat(String(e.referalLink).substring(0,28),"..."):e.referalLink}),(0,r.jsx)(p(),{text:String(e.referalLink),onCopy:()=>S(String(e.referalLink)),children:(0,r.jsx)(o.Z,{icon:"solar:copy-outline",flexGrow:1,sx:P})})]})]}),(0,r.jsxs)(y.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",sx:{marginTop:"10px"},children:[(0,r.jsx)(Z.Z,{variant:"label",sx:{...R,color:"#D1D5DB"},children:s("accountManagement.referral.campaings.table.referralCode")}),(0,r.jsxs)(M.Z,{sx:{...R,display:"flex",alignItems:"center"},children:[(0,r.jsx)(Z.Z,{variant:"label",children:e.referenceCode}),(0,r.jsx)(p(),{text:String(e.referenceCode),onCopy:()=>S(String(e.referenceCode)),children:(0,r.jsx)(o.Z,{icon:"solar:copy-outline",flexGrow:1,sx:P})})]})]})]})]})},e._id)})]})};var B=n(27970),L=n(31691),E=n(82156),O=n(11584);let q=e=>{let{totalPages:t,totalDocuments:n,isLoading:a,setShowCreateCampaignModal:o}=e,{t:l}=(0,i.i)(),s=(0,L.Z)(),c=(0,E.Z)(s.breakpoints.down("md"));return(0,r.jsxs)(y.Z,{direction:c?"column":"row",justifyContent:"space-between",alignItems:"center",display:c?"block":"flex",sx:{width:"100%",alignItems:"center"},children:[(0,r.jsx)(M.Z,{children:(0,r.jsxs)(Z.Z,{variant:"h2",sx:{marginRight:"2px",marginTop:"10px",lineHeight:"36px",minWidth:"200px"},children:[l("accountManagement.referral.campaings.myCampaigns"),a?(0,r.jsx)("span",{style:{marginLeft:"10px"},children:(0,r.jsx)(A.Z,{size:20})}):(0,r.jsx)(D.Z,{label:"".concat(t,"/").concat(n),color:"secondary",sx:{maxWidth:"65px",m:"15px 15px",backgroundColor:s.palette.grey[700]}})]})}),(0,r.jsx)(M.Z,{children:t===n?(0,r.jsx)(O.Z,{}):(0,r.jsx)(w.Z,{size:"small",color:"primary",variant:"contained",sx:{mt:"15px",minWidth:"210px",m:"15px 5px",cursor:"pointer"},onClick:()=>o(!0),children:(0,r.jsx)(Z.Z,{color:"white",fontWeight:"bold",variant:"buttonTxt",children:l("accountManagement.referral.campaings.createCampaing")})})})]})};var z=n(39858);let U=()=>{var e,t;let[n,x]=(0,a.useState)({search:"",filters:{fromDate:null,toDate:null},currentPage:0,currentRowsPerPage:5}),{showMessage:h}=(0,u.useSnackbar)(),{t:p}=(0,i.i)(),{authenticated:g}=(0,l.E)(),{data:f,isLoading:v,isError:b,error:j,refetch:w}=(0,c._)({page:n.currentPage,limit:n.currentRowsPerPage,filters:{fromDate:(null===(e=n.filters)||void 0===e?void 0:e.fromDate)||null,toDate:(null===(t=n.filters)||void 0===t?void 0:t.toDate)||null,search:n.search||""},authenticated:g}),[C,S]=(0,a.useState)(!1);b&&h(j.message||p("errors.anErrorOccurred"),"error");let[k,I]=(0,a.useState)({isVisible:!1,referralCode:"",referralLink:"",campaignName:""}),{isVisible:M,referralCode:A,referralLink:F,campaignName:D}=k;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y.Z,{direction:"row",spacing:2,alignItems:"center",marginTop:6,marginBottom:2,children:[(0,r.jsx)(o.Z,{icon:"mage:magnet-right",color:"#FF7901",width:24,height:24}),(0,r.jsx)(Z.Z,{variant:"h2",component:"h2",children:p("accountManagement.referral.campaings.title")})]}),(0,r.jsx)(z.M,{sx:{paddingX:4,paddingY:0},children:(0,r.jsxs)(d.n,{children:[(0,r.jsx)(q,{totalPages:null==f?void 0:f.totalDocuments,totalDocuments:s.sH,isLoading:v,setShowCreateCampaignModal:S}),(0,r.jsx)(W,{data:f,isLoading:v,setShowShareViaSocialModal:I}),(0,r.jsx)(B.Z,{sx:{width:"100%"},rowsPerPageOptions:[5,10],component:"div",count:(null==f?void 0:f.data.length)?f.totalDocuments:0,rowsPerPage:n.currentRowsPerPage,page:n.currentPage,onPageChange:(e,t)=>
1{x(e=>({...e,currentPage:t}))},onRowsPerPageChange:e=>{x(t=>({...t,currentPage:0,currentRowsPerPage:parseInt(e.target.value,10)}))}})]})}),(0,r.jsx)(m.A,{title:p("accountManagement.referral.campaings.modalTitle"),type:"createCampaign",size:"500px",showModal:C,handleModal:S,modalProps:{isOpenModal:C,refetch:w}}),(0,r.jsx)(m.A,{type:"sharedViaSocial",size:"600px",title:p("accountManagement.referral.shareViaSocial.modalTitle"),showModal:M,modalProps:{campaignName:D,referralCode:A,referralLink:F},handleModal:()=>I(e=>({...e,isVisible:!e.isVisible}))})]})}},11584:function(e,t,n){var r=n(57437),a=n(2265),i=n(60033),o=n(76975),l=n(67972),s=n(31691),c=n(24021),d=n(89051),u=n(19643),m=n(95576),x=n(46387),h=n(44811);t.Z=()=>{let e=(0,s.Z)(),{t}=(0,i.i)(),[n,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)(!1),v=()=>{p(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.d,{onClickAway:v,children:(0,r.jsx)("div",{children:(0,r.jsx)(d.Z,{PopperProps:{disablePortal:!0},onClose:v,open:n,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,placement:"top-start",title:(0,r.jsxs)(u.Z,{direction:"column",spacing:1,position:"relative",children:[(0,r.jsx)(m.Z,{"aria-label":"close",onClick:v,sx:{position:"absolute",right:-10,top:-6,
1color:e.palette.grey[100],zIndex:1},children:(0,r.jsx)(o.Z,{icon:"solar:close-circle-linear",sx:{height:24,width:24}})}),(0,r.jsxs)(u.Z,{direction:"column",spacing:1,sx:{padding:"24px 16px 16px"},children:[(0,r.jsx)(x.Z,{variant:"body2",color:"white",children:t("accountManagement.referral.dashboard.referral.youCannotCreateNewCampaings")}),(0,r.jsx)(h.Z,{variant:"contained",color:"secondary",size:"small",onClick:()=>{f(!0),v()},children:t("accountManagement.referral.dashboard.referral.goToCustomerService")})]})]}),children:(0,r.jsx)(h.Z,{variant:"contained",sx:{color:"text.disabled",backgroundColor:"rgba(107, 114, 128, 0.24)","&:hover":{background:"rgba(107, 114, 128, 0.336)"}},onClick:()=>{p(!0)},children:t("accountManagement.referral.dashboard.referral.buttons.createCampaign")})})})}),(0,r.jsx)(l.A,{type:"verifyContact",title:t("verifyContact.modal.title"),showModal:g,handleModal:f})]})}},98336:function(e,t,n){n.r(t),n.d(t,{Dashboard:function(){return F}});var r=n(57437),a=n(60033),i=n(2265),o=n(76975),l=n(20418),s=n(57952),c=n(67049),d=n(67972),u=n(14510),m=n(31691),x=n(82156),h=n(19643),p=n(46387),g=n(8350),f=n(44811),v=n(68575),b=n(38954),y=n(82877),j=n(62511);let w=e=>{switch(e){case"center":return"center";case"right":return"flex-end";default:return"flex-start"}},Z=e=>{let{imageUrl:t,title:n,value:a,imageWidth:i=58,imageHeight:o=58,imageSx:l,textAlign:s="left",showDollarSymbol:c=!0}=e,d=(0,m.Z)(),u=(0,v.v9)(e=>e.user.data),{data:x}=(0,y.Xn)({currencyCode:"USD"}),g=(0,j.lj)({amount:Number(a),currency:"USD",fiatCurrency:(null==u?void 0:u.settings.view_in_fiat_object.currency)||"",exchangeRates:x||{},shouldShow:(null==u?void 0:u.settings.view_in_fiat_object.to_show)||!1});return(0,r.jsxs)(h.Z,{direction:"row",spacing:2,children:[(0,r.jsx)(b.Z,{src:t,width:i,height:o,sx:l}),(0,r.jsxs)(h.Z,{direction:"column",spacing:1,sx:{textAlign:s,alignItems:w(s)},children:[(0,r.jsx)(p.Z,{align:s,color:d.palette.grey[400],variant:"h4",fontWeight:600,children:n}),(0,r.jsx)(p.Z,{align:s,variant:"h3",children:c?"".concat(g):a})]})]})};var C=n(39858);let S=e=>{let{totalProfit:t,totalReferrals:n,comissionRewards:i,setShowClaimEarningsModal:o}=e,l=(0,m.Z)(),s=(0,x.Z)(l.breakpoints.down("md")),{t:c}=(0,a.i)();return(0,r.jsx)(C.M,{sx:{flex:1},children:(0,r.jsxs)(h.Z,{direction:"column",spacing:2,children:[(0,r.jsxs)(h.Z,{direction:"row",spacing:2,sx:{border:"2px solid #6B728099",p:4,borderRadius:"9px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)(Z,{imageUrl:"".concat("https://img.xyes.com/","assets/images/account-management/referral/my-total-profit.png"),title:c("accountManagement.referral.dashboard.referral.myTotalProfitTitle"),value:t,imageWidth:s?29:60,imageHeight:s?31:48}),(0,r.jsx)(g.Z,{orientation:"vertical",flexItem:!0}),(0,r.jsx)(Z,{imageUrl:"".concat("https://img.xyes.com/","assets/images/account-management/referral/total-referrals.png"),title:c("accountManagement.referral.dashboard.referral.totalReferralsTitle"),value:n,imageWidth:s?34:60,imageHeight:s?27:48,showDollarSymbol:!1})]}),(0,r.jsxs)(h.Z,{direction:"row",spacing:2,sx:{border:"2px solid #6B728099",p:4,borderRadius:"9px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)(Z,{imageUrl:"".concat("https://img.xyes.com/","assets/images/account-management/referral/commission-rewards.png"),title:c("accountManagement.referral.dashboard.referral.commission_rewards"),value:i,imageWidth:s?78:146,imageHeight:s?41:76,textAlign:"center"}),(0,r.jsx)(f.Z,{variant:"contained",onClick:()=>o(!0),color:"primary",disabled:i<5,children:(0,r.jsx)(p.Z,{color:"white",fontWeight:"bold",variant:"buttonTxt",children:c("actions.claim")})})]})]})})};var k=n(89902),I=n(11584),M=n(93352);let A=e=>{let{referralLink:t,code:n,disabledButton:o,setShowShareViaSocialModal:l,refetch:s}=e,c=(0,m.Z)(),u=(0,x.Z)(c.breakpoints.down("sm")),[g,v]=(0,i.useState)(!1),[b,y]=(0,i.useState)(!1),{t:j}=(0,a.i)(),[w,Z]=(0,i.useState)(!1);return(0,r.jsxs)(C.M,{sx:{flex:1},children:[(0,r.jsx)(d.A,{title:j("accountManagement.referral.campaings.modalTitle"),type:"createCampaign",size:"500px",showModal:w,handleModal:Z,modalProps:{isOpenModal:w,refetch:s}}),(0,r.jsxs)(h.Z,{direction:"column",spacing:2,children:[(0,r.jsxs)(h.Z,{direction:"row",spacing:2,children:[(0,r.jsx)(p.Z,{variant:"h2",children:j("accountManagement.referral.dashboard.referral.myReferralCampaign")}),(0,r.jsx)(k.Z,{label:j("status.default"),color:"primary",sx:{color:c.palette.common.white,fontWeight:700,"& .MuiChip-label":{color:c.palette.common.white}}})]}),(0,r.jsx)(M.Z,{text:t,copied:g,onCopy:v}),(0,r.jsx)(M.Z,{text:n,copied:b,onCopy:y}),(0,r.jsxs)(h.Z,{direction:"row",justifyContent:u?"center":"flex-end",alignItems:"center",spacing:2,children:[(0,r.jsx)(f.Z,{variant:"contained",onClick:()=>{l({isVisible:!0,referralCode:n,referralLink:t})},sx:{background:c.palette.grey[700]},children:(0,r.jsx)(p.Z,{color:c.palette.grey[300],fontWeight:"bold",variant:"buttonTxt",children:j("accountManagement.referral.dashboard.referral.buttons.shareViaSocials")})}),o?(0,r.jsx)(I.Z,{}):(0,r.jsx)(f.Z,{variant:"contained",onClick:()=>Z(!0),color:"primary",disabled:o,children:(0,r.jsx)(p.Z,{color:"white",fontWeight:"bold",variant:"buttonTxt",children:j("accountManagement.referral.dashboard.referral.buttons.createCampaign")})})]})]})]})},F=()=>{var e,t,n;let g=(0,m.Z)(),f=(0,x.Z)(g.breakpoints.down("md")),{authenticated:v}=(0,l.E)(),{data:b,refetch:y}=(0,s.s)({authenticated:v}),{data:j}=(0,u.k)(v),{t:w}=(0,a.i)(),{data:Z,refetch:C}=(0,c._)({page:0,limit:20,filters:{fromDate:null,toDate:null,search:""},authenticated:v}),k=(0,i.useMemo)(()=>null==Z?void 0:Z.data.find(e=>!0===e.default),[null==Z?void 0:Z.data]),[I,M]=(0,i.useState)(!1),[F,D]=(0,i.useState)({isVisible:!1,referralCode:"",referralLink:""}),{isVisible:_,referralCode:T,referralLink:R}=F;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(h.Z,{direction:"row",spacing:2,alignItems:"center",marginTop:4,marginBottom:4,children:[(0,r.jsx)(o.Z,{icon:"mage:users",color:"#FF7901",width:24,height:24}),(0,r.jsx)(p.Z,{variant:"h2",component:"h2",children:w("accountManagement.referral.dashboard.referral.title")})]}),(0,r.jsxs)(h.Z,{direction:"column",spacing:3,children:[(0,r.jsxs)(h.Z,{direction:f?"column":"row",spacing:2,sx:{width:"100%"},children:[(0,r.jsx)(S,{totalProfit:null!==(e=null==b?void 0:b.data.totalCommissionAmount)&&void 0!==e?e:0,totalReferrals:null!==(t=null==j?void 0:j.total)&&void 0!==t?t:0,comissionRew
1ards:null!==(n=null==b?void 0:b.data.ComissionReward)&&void 0!==n?n:0,setShowClaimEarningsModal:M}),(0,r.jsx)(A,{referralLink:null==k?void 0:k.referalLink,code:null==k?void 0:k.referenceCode,disabledButton:(null==Z?void 0:Z.totalDocuments)===20,setShowShareViaSocialModal:D,refetch:C})]}),I&&(0,r.jsx)(d.A,{title:w("referralCampaign.claimModal.tittle"),type:"claimEarnings",size:"600px",showModal:I,handleModal:()=>{M(!1),y()},modalProps:{isOpenModal:I}})]}),(0,r.jsx)(d.A,{type:"sharedViaSocial",size:"500px",title:w("accountManagement.referral.shareViaSocial.modalTitle"),showModal:_,modalProps:{referralCode:T,referralLink:R},handleModal:()=>D(e=>({...e,isVisible:!e.isVisible}))})]})}},39858:function(e,t,n){n.d(t,{M:function(){return l}});var r=n(57437);n(2265);var a=n(31691),i=n(82156),o=n(19902);let l=e=>{let{children:t,sx:n}=e,l=(0,a.Z)(),s=(0,i.Z)(l.breakpoints.down("md"));return(0,r.jsx)(o.Z,{sx:{backgroundColor:l.palette.grey[800],boxShadow:"0px 2px 6px 0px #00000073",padding:s?l.spacing(2):l.spacing(3),...n},children:t})}},20546:function(e,t,n){n.r(t),n.d(t,{default:function(){return P}});var r=n(57437),a=n(60033),i=n(2265),o=n(66386),l=n(16658),s=n(1899),c=n(73053),d=n(19978),u=n(99074),m=n(46387),x=n(97312),h=n(31691),p=n(88
1064),g=n(91055);let f="https://blog.xyes.com".replace(/\/$/,"");function v(e){let t=e.toLowerCase().startsWith("zh")||(0,g.rt)(e).toLowerCase().startsWith("zh")?"zh-HK":"en",n="zh-HK"===t?"referral-program-hk":"referral-program";return{calculator:"".concat(f,"/tool/").concat(t,"/vip/referral-reward-calculator"),examples:"".concat(f,"/blog/").concat(t,"/promotions/referral-reward-examples-hk"),terms:"".concat(f,"/blog/").concat(t,"/promotions/").concat(n)}}function b(e){let{faqs:t}=e,{t:n,getLang:i}=(0,a.i)(),o=(0,h.Z)(),l=o.palette.orange[900],c=v(i());return(0,r.jsx)(s.Z,{component:"section",id:"faq",sx:{mt:{xs:5,md:7}},children:(0,r.jsxs)(s.Z,{sx:{display:"grid",gap:{xs:3,sm:5},gridTemplateColumns:{xs:"1fr",sm:t.length?"0.68fr 1.32fr":"1fr"},alignItems:"start"},children:[(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{variant:"overline",sx:{color:l,letterSpacing:1.2,fontWeight:700},children:n("accountManagement.referral.guestLanding.faqKicker")}),(0,r.jsx)(m.Z,{component:"h2",sx:{mt:1,mb:1,fontWeight:800,fontSize:{xs:"1.4rem",md:"1.85rem"},color:o.palette.common.white,maxWidth:640},children:n("accountManagement.referral.guestLanding.faqTitle")}),(0,r.jsx)(m.Z,{sx:{mb:2,color:(0,p.Fq)(o.palette.common.white,.65),maxWidth:560},children:n("accountManagement.referral.guestLanding.faqIntro")}),(0,r.jsxs)(x.Z,{href:c.terms,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{display:"inline-flex",alignItems:"center",gap:.5,color:l,fontWeight:700,fontSize:"0.9rem",mb:2},children:[n("accountManagement.referral.guestLanding.faqTermsCta")," ↗"]}),(0,r.jsx)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(o.palette.common.white,.55),maxWidth:520,mb:1},children:n("accountManagement.referral.guestLanding.faqSource")}),(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(o.palette.common.white,.45),display:"block"},children:n("accountManagement.referral.guestLanding.faqMeta")})]}),t.length>0&&(0,r.jsx)(s.Z,{sx:{"& > .MuiBox-root":{bgcolor:"transparent !important",mt:0},"& > .MuiBox-root > .MuiBox-root:first-of-type":{display:"none"},"& .MuiGrid-item":{maxWidth:"100% !important",flexBasis:"100% !important"}},children:(0,r.jsx)(u.Z,{faqs:t})})]})})}var y=n(33145),j=n(19643),w=n(99376),Z=n(44811);function C(e){let{secondaryAction:t="calculator"}=e,{t:n,getLang:i}=(0,a.i)(),o=(0,h.Z)(),l=(0,w.useRouter)(),s=(0,w.usePathname)(),c=o.palette.orange[900],{primary:d,secondary:u}=function(e,t){let n={minHeight:{xs:44,sm:52},px:{xs:1.5,sm:2.5},py:1.5,borderRadius:"12px",textTransform:"none",fontWeight:700,fontSize:{xs:"0.8125rem",sm:"0.9375rem"},lineHeight:1.35,letterSpacing:0,whiteSpace:"normal",textAlign:"center",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease"};return{primary:{...n,flex:{xs:"1 1 auto",sm:"1 1 0"},width:{xs:"100%",sm:"auto"},minWidth:0,color:e.palette.common.black,bgcolor:t,border:"none",boxShadow:"0 4px 18px ".concat((0,p.Fq)(t,.4)),"&:hover":{bgcolor:"#ff8a1a",boxShadow:"0 6px 24px ".concat((0,p.Fq)(t,.55)),transform:"translateY(-1px)"},"&:active":{transform:"translateY(0)",boxShadow:"0 2px 12px ".concat((0,p.Fq)(t,.35))}},secondary:{...n,flex:{xs:"1 1 auto",sm:"1 1 0"},width:{xs:"100%",sm:"auto"},minWidth:{xs:0,sm:0},color:e.palette.common.white,bgcolor:(0,p.Fq)(e.palette.common.white,.04),border:"1.5px solid ".concat((0,p.Fq)(e.palette.common.white,.75)),boxShadow:"none","&:hover":{bgcolor:(0,p.Fq)(e.palette.common.white,.1),borderColor:e.palette.common.white,transform:"translateY(-1px)"},"&:active":{transform:"translateY(0)"}}}}(o,c),m=v(i()),g=e=>{l.push("".concat(s,"?modal=auth&tab=").concat(e))};return(0,r.jsxs)(j.Z,{direction:{xs:"column",sm:"row"},spacing:{xs:1,sm:1.5},alignItems:"stretch",sx:{width:"100%",maxWidth:560},children:[(0,r.jsx)(Z.Z,{disableElevation:!0,onClick:()=>g("2"),sx:d,children:n("accountManagement.referral.guestLanding.registerCta")}),"calculator"===t?(0,r.jsxs)(Z.Z,{disableElevation:!0,component:x.Z,href:m.calculator,target:"_blank",rel:"noopener noreferrer",underline:"none",sx:u,children:[n("accountManagement.referral.guestLanding.trialCalculationCta")," ↗"]}):(0,r.jsx)(Z.Z,{disableElevation:!0,onClick:()=>g("1"),sx:u,children:n("accountManagement.referral.guestLanding.loginCta")})]})}let S=["L1","L2","L3","L4","L5"];function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e%1==0?0:2;
1return"US$".concat(e.toLocaleString("en-US",{minimumFractionDigits:t,maximumFractionDigits:t}))}function I(e){var t;let n=e%1==0?0:(null===(t=e.toString().split(".")[1])||void 0===t?void 0:t.length)||1;return"".concat(e.toFixed(Math.min(n,4)),"%")}function M(e){let{config:t}=e,{t:n}=(0,a.i)(),i=(0,h.Z)(),o=i.palette.orange[900];return(0,r.jsx)(s.Z,{component:"section",sx:{position:"relative",overflow:"hidden",borderRadius:2,px:{xs:2,sm:2.5,md:4},py:{xs:3,sm:4,md:6},bgcolor:"transparent"},children:(0,r.jsxs)(s.Z,{sx:{display:"grid",rowGap:{xs:2,sm:1.5,md:2},columnGap:{xs:1.5,sm:4,md:6},alignItems:"center",gridTemplateColumns:{xs:"minmax(0, 1.25fr) minmax(0, 0.75fr)",sm:"1.08fr 0.92fr"},gridTemplateAreas:{xs:'\n              "title title"\n              "offer tiger"\n            ',sm:'\n              "title tiger"\n              "offer tiger"\n            '}},children:[(0,r.jsxs)(s.Z,{sx:{gridArea:"title"},children:[(0,r.jsx)(m.Z,{variant:"overline",sx:{color:o,letterSpacing:1.2,fontWeight:700},children:n("accountManagement.referral.guestLanding.eyebrow")}),(0,r.jsx)(m.Z,{component:"h1",sx:{mt:1.5,mb:2,fontWeight:800,fontSize:{xs:"1.85rem",sm:"2.25rem",md:"2.75rem"},lineHeight:{xs:1.1,md:1.08},letterSpacing:"-0.02em",color:i.palette.common.white,maxWidth:680},children:n("accountManagement.referral.guestLanding.heroTitle")}),(0,r.jsx)(m.Z,{sx:{mb:0,maxWidth:610,color:(0,p.Fq)(i.palette.common.white,.72),fontSize:{xs:"0.875rem",md:"1rem"},lineHeight:1.65},children:n("accountManagement.referral.guestLanding.heroDescription",{depositThreshold:null!=t.minDepositAmount?k(t.minDepositAmount):"—",rewardAmount:k(t.bonusBaseAmount)})})]}),(0,r.jsxs)(s.Z,{sx:{gridArea:"offer",minWidth:0,alignSelf:{xs:"center",sm:"start"}},children:[(0,r.jsxs)(s.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",maxWidth:{sm:590},mt:{xs:0,sm:1},mb:{xs:1.5,sm:3},py:{xs:1.25,md:2},borderTop:"1px solid ".concat((0,p.Fq)(i.palette.common.white,.12)),borderBottom:"1px solid ".concat((0,p.Fq)(i.palette.common.white,.12))},children:[(0,r.jsxs)(s.Z,{sx:{pr:{xs:1,md:3}},children:[(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2.125rem"},lineHeight:1,letterSpacing:"-0.04em",color:o},children:k(t.bonusBaseAmount)}),(0,r.jsx)(m.Z,{variant:"caption",sx:{display:"block",color:(0,p.Fq)(i.palette.common.white,.65),mt:.5,fontWeight:700,fontSize:{xs:"0.65rem",sm:"0.75rem"}},children:n("accountManagement.referral.guestLanding.validMemberReward")})]}),(0,r.jsxs)(s.Z,{sx:{pl:{xs:1,md:3},borderLeft:"1px solid ".concat((0,p.Fq)(i.palette.common.white,.12))},children:[(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2.125rem"},lineHeight:1,letterSpacing:"-0.04em",color:i.palette.info.light},children:I(t.baseRatePercent)}),(0,r.jsx)(m.Z,{variant:"caption",sx:{display:"block",color:(0,p.Fq)(i.palette.common.white,.65),mt:.5,fontWeight:700,fontSize:{xs:"0.65rem",sm:"0.75rem"}},children:n("accountManagement.referral.guestLanding.turnoverCommission")})]})]}),(0,r.jsx)(C,{}),(0,r.jsxs)(j.Z,{spacing:.75,sx:{mt:{xs:1.5,sm:3}},children:[(0,r.jsxs)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(i.palette.common.white,.65),fontSize:{xs:"0.7rem",sm:"0.875rem"}},children:["✓"," ",n("accountManagement.referral.guestLanding.metaBaseline",{baseRate:I(t.baseRatePercent)})]}),(0,r.jsxs)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(i.palette.common.white,.65),fontSize:{xs:"0.7rem",sm:"0.875rem"}},children:["✓ ",n("accountManagement.referral.guestLanding.metaWallet")]})]})]}),(0,r.jsxs)(s.Z,{sx:{gridArea:"tiger",position:"relative",justifySelf:"center",alignSelf:"center",width:"100%",maxWidth:{xs:160,sm:420,md:460},mx:"auto",display:"flex",flexDirection:"column",alignItems:"center","&::before":{content:'""',position:"absolute",inset:"8% 5%",borderRadius:"50%",background:"radial-gradient(circle, ".concat((0,p.Fq)(o,.22)," 0%, transparent 70%)"),pointerEvents:"none",zIndex:0}},children:[(0,r.jsxs)(s.Z,{sx:{mb:{xs:.75,sm:1.5},width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:.5,position:"relative",zIndex:1},children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(i.palette.common.white,.55),fontSize:{xs:"0.6rem",sm:"0.75rem"}},children:n("accountManagement.referral.guestLanding.officialEvent")}),(0,r.jsx)(m.Z,{variant:"caption",sx:{color:o,fontWeight:700,fontSize:{xs:"0.6rem",sm:"0.75rem"}},children:n("accountManagement.referral.guestLanding.levelsBadge")})]}),(0,r.jsx)(s.Z,{sx:{position:"relative",zIndex:1,width:"100%",maxWidth:{xs:150,sm:380,md:440},mx:"auto",aspectRatio:"1 / 1",animation:"referralMascotFloat 4.5s ease-in-out infinite","@keyframes referralMascotFloat":{"0%, 100%":{transform:"translateY(0)"},"50%":{transform:"translateY(-10px)"}}},children:(0,r.jsx)(y.default,{src:"/assets/images/referral/xyes-tiger.png",alt:n("accountManagement.referral.guestLanding.mascotAlt"),fill:!0,priority:!0,sizes:"(max-width: 768px) 150px, 460px",style:{objectFit:"contain"}})})]})]})})}function A(){let{t:e}=(0,a.i)(),t=(0,h.Z)(),n=t.palette.orange[900],i=[{title:e("accountManagement.referral.guestLanding.step1Title"),description:e("accountManagement.referral.guestLanding.step1Desc")},{title:e("accountManagement.referral.guestLanding.step2Title"),description:e("accountManagement.referral.guestLanding.step2Desc")},{title:e("accountManagement.referral.guestLanding.step3Title"),description:e("accountManagement.referral.guestLanding.step3Desc")},{title:e("accountManagement.referral.guestLanding.step4Title"),description:e("accountManagement.referral.guestLanding.step4Desc")}];return(0,r.jsxs)(s.Z,{component:"section",sx:{mt:{xs:5,md:7}},children:[(0,r.jsx)(m.Z,{variant:"overline",sx:{color:n,letterSpacing:1.2,fontWeight:700},children:e("accountManagement.referral.guestLanding.processKicker")}),(0,r.jsx)(m.Z,{component:"h2",sx:{mt:1,mb:3,fontWeight:800,fontSize:{xs:"1.4rem",md:"1.85rem"},color:t.palette.common.white,maxWidth:720},children:e("accountManagement.referral.guestLanding.processTitle")}),(0,r.jsx)(s.Z,{component:"ol",sx:{m:0,p:0,listStyle:"none",display:"grid",gap:0,gridTemplateColumns:{xs:"1fr 1fr",md:"repeat(4, 1fr)"},borderTop:"1px solid ".concat((0,p.Fq)(t.palette.common.white,.1)),borderBottom:"1px solid ".concat((0,p.Fq)(t.palette.common.white,.1))},children:i.map((e,a)=>
1(0,r.jsxs)(s.Z,{component:"li",sx:{display:"grid",gridTemplateColumns:{xs:"32px minmax(0, 1fr)",sm:"36px minmax(0, 1fr)"},gap:{xs:1,sm:1.5},alignContent:"center",minHeight:{xs:100,md:134},p:{xs:"14px 10px",md:2.5},borderLeft:{xs:a%2==1?"1px solid ".concat((0,p.Fq)(t.palette.common.white,.1)):"none",md:a>0?"1px solid ".concat((0,p.Fq)(t.palette.common.white,.1)):"none"},borderTop:{xs:a>=2?"1px solid ".concat((0,p.Fq)(t.palette.common.white,.1)):"none",md:"none"},bgcolor:"transparent",transition:"background-color 0.2s ease","&:hover":{bgcolor:(0,p.Fq)(t.palette.common.white,.03)}},children:[(0,r.jsx)(s.Z,{sx:{width:{xs:30,sm:34},height:{xs:30,sm:34},borderRadius:1,border:"1px solid ".concat((0,p.Fq)(n,.48)),color:n,display:"grid",placeItems:"center",fontSize:10,fontWeight:900},children:String(a+1).padStart(2,"0")}),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{sx:{fontWeight:700,color:t.palette.common.white,mb:.5,fontSize:{xs:"0.875rem",md:"0.9375rem"},lineHeight:1.3},children:e.title}),(0,r.jsx)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(t.palette.common.white,.65),fontSize:"0.75rem",lineHeight:1.5},children:e.description})]})]},e.title))})]})}var F=n(70208),D=n(59469),_=n(28314),T=n(52988);function R(e){var t,n;let{config:i}=e,{t:o,getLang:l}=(0,a.i)(),c=(0,h.Z)(),d=c.palette.orange[900],u=v(l()),g=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4,r=null!==(t=e.levelRatioPercents[0])&&void 0!==t?t:100;return e.baseRatePercent/100*n*(r/100)}(i),f=i.bonusBaseAmount*((null!==(t=i.levelRatioPercents[0])&&void 0!==t?t:100)/100),b=[o("accountManagement.referral.guestLanding.levelL1Desc"),o("accountManagement.referral.guestLanding.levelL2Desc"),o("accountManagement.referral.guestLanding.levelL3Desc"),o("accountManagement.referral.guestLanding.levelL4Desc"),o("accountManagement.referral.guestLanding.levelL5Desc")];return(0,r.jsxs)(s.Z,{component:"section",sx:{mt:{xs:4,sm:5,md:7}},children:[(0,r.jsx)(m.Z,{variant:"overline",sx:{color:d,letterSpacing:1.2,fontWeight:700},children:o("accountManagement.referral.guestLanding.earningsKicker")}),(0,r.jsx)(m.Z,{component:"h2",sx:{mt:1,mb:3,fontWeight:800,fontSize:{xs:"1.4rem",md:"1.85rem"},color:c.palette.common.white},children:o("accountManagement.referral.guestLanding.earningsTitle")}),(0,r.jsxs)(s.Z,{sx:{display:"grid",gap:0,gridTemplateColumns:{xs:"1fr",sm:"1.05fr 0.95fr"},borderRadius:2,overflow:"hidden",bgcolor:(0,p.Fq)(c.palette.common.white,.03),border:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.08)),borderTopColor:(0,p.Fq)(d,.55)},children:[(0,r.jsxs)(s.Z,{sx:{p:{xs:2.5,md:3},borderBottom:{xs:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.08)),sm:"none"},borderRight:{xs:"none",sm:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.08))}},children:[(0,r.jsxs)(s.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:{xs:1.5,sm:2},mb:3},children:[(0,r.jsxs)(s.Z,{sx:{pr:{xs:1.5,sm:2},borderRight:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.12))},children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(c.palette.common.white,.55)},children:o("accountManagement.referral.guestLanding.l1Qualification")}),(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.75rem",sm:"2rem",md:"2.5rem"},lineHeight:1.1,letterSpacing:"-0.02em",color:d,my:.75},children:k(i.bonusBaseAmount)}),(0,r.jsx)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(c.palette.common.white,.65),fontSize:{xs:"0.75rem",sm:"0.875rem"}},children:o("accountManagement.referral.guestLanding.l1QualificationDesc",{depositThreshold:null!=i.minDepositAmount?k(i.minDepositAmount):"—"})})]}),(0,r.jsxs)(s.Z,{sx:{pl:{xs:.5,sm:1}},children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(c.palette.common.white,.55)},children:o("accountManagement.referral.guestLanding.qualifiedBetting")}),(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.75rem",sm:"2rem",md:"2.5rem"},lineHeight:1.1,letterSpacing:"-0.02em",color:c.palette.info.light,my:.75},children:I(i.baseRatePercent)}),(0,r.jsx)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(c.palette.common.white,.65),fontSize:{xs:"0.75rem",sm:"0.875rem"}},children:o("accountManagement.referral.guestLanding.qualifiedBettingDesc",{baseRate:I(i.baseRatePercent)})})]})]}),(0,r.jsxs)(s.Z,{sx:{p:{xs:1.75,sm:2},borderRadius:1.5,bgcolor:(0,p.Fq)(d,.08),border:"1px solid ".concat((0,p.Fq)(d,.3))},children:[(0,r.jsxs)(j.Z,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,sx:{mb:2},children:[(0,r.jsxs)(s.Z,{sx:{minWidth:0},children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:d,fontWeight:700},children:"L1"}),(0,r.jsx)(m.Z,{sx:{fontWeight:700,color:c.palette.common.white,fontSize:{xs:"0.875rem",sm:"1rem"}},children:o("accountManagement.referral.guestLanding.l1ExampleTitle")})]}),(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"0.95rem",sm:"1.15rem",md:"1.35rem"},color:d,textAlign:"right",flexShrink:0},children:o("accountManagement.referral.guestLanding.l1ExampleTotal",{total:k(f+g)})})]}),(0,r.jsxs)(s.Z,{sx:{display:"grid",gridTemplateColumns:"1fr auto 1fr",alignItems:"end",gap:{xs:1,sm:1.5},mb:1},children:[(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(c.palette.common.white,.5)},children:o("accountManagement.referral.guestLanding.validMemberReward")}),(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.35rem",sm:"1.75rem",md:"2rem"},lineHeight:1.15,color:c.palette.common.white},children:k(f)})]}),(0,r.jsx)(m.Z,{sx:{color:d,fontWeight:800,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},lineHeight:1.15,pb:.25},children:"+"}),(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(c.palette.common.white,.5)},children:o("accountManagement.referral.guestLanding.turnoverCommission")}),(0,r.jsx)(m.Z,{sx:{fontWeight:800,fontSize:{xs:"1.35rem",sm:"1.75rem",md:"2rem"},lineHeight:1.15,color:c.palette.common.white},children:k(g)})]})]}),(0,r.jsxs)(m.Z,{variant:"caption",sx:{color:(0,p.Fq)(c.palette.common.white,.5)},children:[k(1e4)," \xd7 ",I(i.baseRatePercent)," \xd7"," ",I(null!==(n=i.levelRatioPercents[0])&&void 0!==n?n:100)]}),(0,r.jsxs)(j.Z,{direction:"row",flexWrap:"wrap",spacing:2,useFlexGap:!0,sx:{mt:2.5,pt:2,borderTop:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.12))},children:[(0,r.jsxs)(x.Z,{href:u.calculator,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:d,fontWeight:700,fontSize:"0.875rem"},children:[o("accountManagement.referral.guestLanding.trialCalculationCta")," ↗"]}),(0,r.jsx)(x.Z,{href:u.examples,target:"_blank",rel:"noopener noreferrer",underline:"hover",sx:{color:(0,p.Fq)(c.palette.common.white,.85),fontWeight:600,fontSize:"0.875rem"},children:o("accountManagement.referral.guestLanding.calculationExamplesCta")})]})]}),(0,r.jsx)(m.Z,{variant:"body2",sx:{mt:2.5,color:(0,p.Fq)(c.palette.common.white,.6)},children:o("accountManagement.referral.guestLanding.walletNote",{transferMin:k(i.walletTransferMin)})})]}),(0,r.jsxs)(s.Z,{sx:{p:{xs:2.5,md:3}},children:[(0,r.jsxs)(j.Z,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,sx:{mb:2},children:[(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{sx:{fontWeight:700,color:c.palette.common.white},children:o("accountManagement.referral.guestLanding.levelsTitle")}),(0,r.jsx)(m.Z,{variant:"body2",sx:{color:(0,p.Fq)(c.palette.common.white,.6)},children:o("accountManagement.referral.guestLanding.levelsSubtitle")})]}),(0,r.jsx)(m.Z,{variant:"caption",sx:{color:d,fontWeight:700,whiteSpace:"nowrap"},children:o("accountManagement.referral.guestLanding.levelsFormula",{baseRate:I(i.baseRatePercent)})})]}),(0,r.jsx)(F.Z,{size:"small","aria-label":o("accountManagement.referral.guestLanding.levelsTableCaption"),children:(0,r.jsx)(D.Z,{children:S.map((e,t)=>{var n;return(0,r.jsxs)(_.Z,{sx:{bgcolor:0===t?(0,p.Fq)(d,.1):"transparent","& td, & th":{borderBottom:"1px solid ".concat((0,p.Fq)(c.palette.common.white,.08)),borderTop:"none",py:1.25},"&:last-of-type td, &:last-of-type th":{borderBottom:"none"}},children:[(0,r.jsx)(T.Z,{component:"th",scope:"row",sx:{fontWeight:700,color:d},children:e}),(0,r.jsx)(T.Z,{sx:{color:(0,p.Fq)(c.palette.common.white,.7)},children:b[t]}),(0,r.jsx)(T.Z,{align:"right",sx:{fontWeight:800,color:c.palette.common.white},children:I(null!==(n=i.levelRatioPercents[t])&&void 0!==n?n:0)})]},e)})})}
1),(0,r.jsx)(m.Z,{variant:"caption",sx:{display:"block",mt:2,color:(0,p.Fq)(c.palette.common.white,.5)},children:o("accountManagement.referral.guestLanding.levelsNote")})]})]})]})}function N(){let{t:e}=(0,a.i)(),t=(0,h.Z)(),n=t.palette.orange[900];return(0,r.jsx)(s.Z,{component:"section",sx:{mt:{xs:5,md:7},mb:2},children:(0,r.jsxs)(s.Z,{sx:{p:{xs:2.5,sm:3,md:4},borderRadius:2,display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{sm:"center"},justifyContent:"space-between",gap:{xs:2,sm:3,md:5},bgcolor:"transparent",border:"1px solid ".concat((0,p.Fq)(n,.55))},children:[(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(m.Z,{variant:"overline",sx:{color:n,letterSpacing:1.2,fontWeight:700},children:e("accountManagement.referral.guestLanding.finalKicker")}),(0,r.jsx)(m.Z,{component:"h2",sx:{mt:1,mb:1,fontWeight:800,fontSize:{xs:"1.35rem",md:"1.7rem"},color:t.palette.common.white},children:e("accountManagement.referral.guestLanding.finalTitle")}),(0,r.jsx)(m.Z,{sx:{color:(0,p.Fq)(t.palette.common.white,.7),maxWidth:520},children:e("accountManagement.referral.guestLanding.finalDescription")})]}),(0,r.jsx)(C,{secondaryAction:"login"})]})})}function P(){let{getLang:e}=(0,a.i)(),t=e(),{data:n,isLoading:u}=(0,l.u)(),m=(0,i.useMemo)(()=>(function(e){let t=Array.isArray(null==e?void 0:e.levelRatioPercents)&&5===e.levelRatioPercents.length?e.levelRatioPercents:[100,10,1,.1,.01],n=Number(null==e?void 0:e.minTotalDepositAmount),r=Number.isFinite(n)?n:null;return{bonusBaseAmount:Number.isFinite(null==e?void 0:e.bonusBaseAmount)?Number(null==e?void 0:e.bonusBaseAmount):0,baseRatePercent:Number.isFinite(null==e?void 0:e.baseRatePercent)?Number(null==e?void 0:e.baseRatePercent):.1,levelRatioPercents:t,minDepositAmount:r,minDepositAmountCondition:"string"==typeof(null==e?void 0:e.minTotalDepositAmountCondition)?e.minTotalDepositAmountCondition:null,walletTransferMin:5}})(n),[n]),[x,h]=(0,i.useState)([]),p={filter:{key:"filters[slug][$eq]",value:"referral"},populate:{key:"populate",value:"*"}},{data:g}=(0,o.W)({...p,locale:{key:"locale",value:t}}),{data:f}=(0,o.W)({...p,locale:{key:"locale",value:"en"}}),v=(0,i.useMemo)(()=>(null==g?void 0:g.data[0])?g.data[0]:null==f?void 0:f.data[0],[g,f]);return((0,i.useEffect)(()=>{if(!v){h([]);return}try{let e=v.attributes.questions.map(e=>({question:e.question,answer:e.answer,id:e.id}));h(e)}catch(e){h([])}},[v]),u&&!n)?(0,r.jsx)(s.Z,{sx:{width:"100%",textAlign:"center",py:10},children:(0,r.jsx)(c.Z,{color:"secondary"})}):(0,r.jsx)(s.Z,{id:"main-content",sx:{width:"100%",pb:{xs:12,md:6}},children:(0,r.jsxs)(d.Z,{maxWidth:"lg",disableGutters:!0,sx:{width:"100%"},children:[(0,r.jsx)(M,{config:m}),(0,r.jsx)(R,{config:m}),(0,r.jsx)(A,{}),(0,r.jsx)(b,{faqs:x}),(0,r.jsx)(N,{})]})})}},76218:function(e,t,n){n.r(t),n.d(t,{ReferralsWrapper:function(){return J}});var r=n(57437),a=n(60033),i=n(2265),o=n(76975),l=n(20418),s=n(12654),c=n(56203),d=n(3366),u=n(36067),m=n(14510),x=n(1899),h=n(73053),p=n(22095),g=n(70208),f=n(19643),v=n(46387),b=n(19902),y=n(27970),j=n(39858),w=n(31691),Z=n(82156),C=n(59469),S=n(28314),k=n(52988),I=n(33145);let M=(e,t)=>({tableBody:{backgroundColor:"".concat(e.palette.blue[800]," !important")},tableCell:{border:"1px solid ".concat(e.palette.grey[700]," !important"),padding:t?"8px":"7px",height:"10px"},commissionPercent:{fontWeight:700,fontSize:"14px",lineHeight:"21px",color:"#FFFFFF"},commonText:{lineHeight:"18px",color:"#9CA3AF"},commissionStyles:{fontWeight:500,fontSize:"10px",lineHeight:"15px",color:"#9CA3AF"},arrowIcon:{color:"#FFFFFF",width:"24px",height:"24px",marginTop:"5px"}});var A=e=>{let{row:t,isMobile:n}=e,{t:i}=(0,a.i)(),o=M((0,w.Z)(),n);return(0,r.jsxs)(f.Z,{direction:n?"column":"row",alignItems:"center",spacing:1,children:[(0,r.jsx)(x.Z,{children:(0,r.jsx)(I.default,{src:t.avatar,alt:"",width:32,height:32,style:{objectFit:"contain"}})}),(0,r.jsxs)(x.Z,{sx:{textAlign:n?"center":"left",width:"100%"},children:[(0,r.jsx)(x.Z,{children:(0,r.jsx)(v.Z,{variant:"paragraph",fontWeight:700,children:t.memberUsername})}),(0,r.jsx)(x.Z,{children:(0,r.jsxs)(v.Z,{variant:"label",sx:{...o.commonText},children:[i("accountManagement.referral.referrals.registered"),":"," ",new Date(t.createdAt).toLocaleDateString()]})})]})]})},F=n(68575),D=n(82877),_=n(62511),T=e=>{let{row:t,isMobile:n,styles:i}=e,{t:o}=(0,a.i)(),l=(0,F.v9)(e=>e.user.data),{data:s}=(0,D.Xn)({currencyCode:"USD"}),c={currency:"USD",fiatCurrency:(null==l?void 0:l.settings.view_in_fiat_object.currency)||"",exchangeRates:s||{}
1,shouldShow:(null==l?void 0:l.settings.view_in_fiat_object.to_show)||!1},d=(0,_.lj)({amount:Number(t.totalDepositAmount||0),...c}),u=(0,_.lj)({amount:Number(t.totalWithdrawAmount||0),...c}),m=(0,_.lj)({amount:Number(t.totalBetAmount||0),...c}),h=(0,_.lj)({amount:Number(t.totalWager||0),...c}),p=[{label:o("accountManagement.referral.referrals.deposit"),value:d},{label:o("accountManagement.referral.referrals.withdraw"),value:u},{label:o("accountManagement.referral.referrals.bets"),value:m},{label:o("accountManagement.referral.referrals.wager"),value:h}];return(0,r.jsx)(f.Z,{spacing:n?1:2,direction:n?"column":"row",alignItems:"flex-start",children:p.map((e,t)=>(0,r.jsxs)(x.Z,{sx:{textAlign:n?"center":"left",width:n?"100%":"auto",flex:n?"none":1,minWidth:0},children:[(0,r.jsx)(x.Z,{children:(0,r.jsx)(v.Z,{sx:i.commissionStyles,variant:"label",children:e.label})}),(0,r.jsx)(x.Z,{children:(0,r.jsx)(v.Z,{sx:i.commissionPercent,variant:"paragraph",children:e.value})})]},t))})},R=e=>{let{rebate:t,validBonus:n,showValidBonus:i=!0,isMobile:l}=e,{t:s}=(0,a.i)(),c=(0,F.v9)(e=>e.user.data),{data:d}=(0,D.Xn)({currencyCode:"USD"}),u={currency:"USD",fiatCurrency:(null==c?void 0:c.settings.view_in_fiat_object.currency)||"",exchangeRates:d||{},shouldShow:(null==c?void 0:c.settings.view_in_fiat_object.to_show)||!1},m=(0,_.lj)({amount:Number(t),...u}),h=(0,_.lj)({amount:Number(n),...u}),p={fontWeight:500,fontSize:"10px",lineHeight:"15px",color:"#9CA3AF",textTransform:"uppercase"},g={fontWeight:700,fontSize:l?"14px":"16px",lineHeight:"21px",color:"#FFFFFF"};return(0,r.jsxs)(f.Z,{direction:"row",alignItems:"center",justifyContent:l?"center":"flex-start",spacing:1,children:[(0,r.jsxs)(f.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsxs)(x.Z,{sx:{textAlign:l?"center":"left"},children:[(0,r.jsx)(v.Z,{sx:p,variant:"label",children:s("accountManagement.referral.referrals.bets")}),(0,r.jsx)(v.Z,{sx:g,children:m})]}),i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{sx:{color:"#9CA3AF",fontWeight:500},children:"/"}),(0,r.jsxs)(x.Z,{sx:{textAlign:l?"center":"left"},children:[(0,r.jsx)(v.Z,{sx:p,variant:"label",children:s("accountManagement.referral.referrals.validReferralBonus")}),(0,r.jsx)(v.Z,{sx:g,children:h})]})]})]}),(0,r.jsx)(o.Z,{icon:"eva:info-outline",sx:{width:l?"20px":"30px",height:l?"20px":"30px",flexShrink:0}})]})};let N=e=>{let{data:t}=e,n=(0,w.Z)(),i=(0,Z.Z)(n.breakpoints.down("md")),o=M(n,i),{t:l}=(0,a.i)();return(0,r.jsxs)(C.Z,{sx:o.tableBody,children:[t.map(e=>(0,r.jsxs)(S.Z,{hover:!0,sx:{"&:hover":{backgroundColor:"".concat(n.palette.blue[700]," !important")}},children:[(0,r.jsx)(k.Z,{size:"small",sx:o.tableCell,children:(0,r.jsx)(A,{row:e,isMobile:i})}),(0,r.jsx)(k.Z,{size:"small",sx:{...o.tableCell,textAlign:"center"},children:(0,r.jsxs)(v.Z,{variant:"body2",component:"span",sx:{fontWeight:600},children:["L",e.networkDepth]})}),(0,r.jsx)(k.Z,{size:"small",sx:o.tableCell,children:(0,r.jsx)(R,{rebate:e.generatedIncomeRebate,validBonus:e.generatedIncomeValidBonus,showValidBonus:1===e.networkDepth,isMobile:i})}),(0,r.jsx)(k.Z,{size:"small",sx:o.tableCell,children:(0,r.jsx)(T,{row:e,isMobile:i,styles:o})})]},e.id)),0===t.length&&(0,r.jsx)(S.Z,{children:(0,r.jsx)(k.Z,{colSpan:4,align:"center",sx:{height:"300px"},children:l("wallet.noResultsFunds")})})]})};var P=n(32281);let W=[{id:"userName",label:"accountManagement.referral.referrals.username",width:350,align:"left"},{id:"level",label:"accountManagement.referral.referrals.level",width:100,align:"center"},{id:"myCommision",label:"accountManagement.referral.campaings.myCommision",width:250,align:"left"},{id:"AdditionalData",label:"accountManagement.referral.referrals.additionalData",width:500,align:"left"}],B={fontWeight:700,lineHeight:"24px",color:"#D1D5DB"},L=e=>{let{isLoading:t}=e,{t:n}=(0,a.i)(),i=(0,w.Z)();return t?null:(0,r.jsx)(P.Z,{children:(0,r.jsx)(S.Z,{children:W.map(e=>{let{id:t,label:a,width:o,align:l}=e;return(0,r.jsx)(k.Z,{sx:{backgroundColor:i.palette.grey[700],width:o,textAlign:l,backgroundImage:"none"},children:(0,r.jsx)(v.Z,{sx:B,variant:"h4",children:n(a)})},t)})})})};var E=n(67049),O=n(68834),q=n(67972),z=n(30166);let U="referral-commission-bonus";var V=n(90077),H=n(95576),G=n(70203),K=n(33833),X=n(50290);function $(e){var t;let{totalReferrals:n,downlineCounts:s,directValidCount:c,setSelectedCampaign:d,selectedCampaign:u}=e,{authenticated:m}=(0,l.E)(),{t:h,getLang:p}=(0,a.i)(),g=(0,w.Z)(),b=(0,Z.Z)(g.breakpoints.down("md")),y=(0,O.Sv)(),[j,C]=(0,i.useState)(!1),S=p(),{data:k}=(0,E._)({page:0,limit:20,filters:{fromDate:null,toDate:null,search:""},authenticated:m}),I=(0,i.useMemo)(()=>[{key:"slug",value:U}],[]),{data:M}=(0,z.Q)({locale:{key:"locale",value:S},filters:I}),{data:A}=(0,z.Q)({locale:{key:"locale",value:"en"},filters:I}),F=(0,i.useMemo)(()=>{let e=null==M?void 0:M.data.find(e=>e.attributes.slug===U),t=null==A?void 0:A.data.find(e=>e.attributes.slug===U);return null!=e?e:t},[M,A]),D="#FF7901",_=!!(s&&s.length>0),T=(0,r.jsxs)(V.Z,{onClick:_?y.onOpen:void 0,disabled:!_,sx:{dis
1play:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:2,bgcolor:"rgba(255, 121, 1, 0.18)",border:"1px solid rgba(255, 121, 1, 0.45)",cursor:_?"pointer":"default",transition:"background-color 0.2s ease","&:hover":_?{bgcolor:"rgba(255, 121, 1, 0.28)"}:void 0,"&.Mui-disabled":{opacity:1}},children:[(0,r.jsx)(o.Z,{icon:"material-symbols:account-tree-outline-rounded",width:18,sx:{color:D,flexShrink:0}}),(0,r.jsx)(v.Z,{component:"span",sx:{color:D,fontWeight:800,fontSize:"0.95rem",lineHeight:1,minWidth:"1ch"},children:n}),_&&(0,r.jsx)(o.Z,{icon:"eva:arrow-ios-downward-fill",width:14,sx:{color:D,flexShrink:0,opacity:.85}})]}),R=(0,r.jsx)(H.Z,{onClick:()=>C(!0),size:"small","aria-label":h("accountManagement.referral.referrals.information"),sx:{color:"primary.main",p:0,flexShrink:0},children:(0,r.jsx)(o.Z,{color:"primary.main",icon:"jam:alert",width:b?20:22,height:"auto"})});return(0,r.jsxs)(f.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{width:"100%",mb:1},children:[(0,r.jsxs)(f.Z,{direction:"row",alignItems:"center",children:[(0,r.jsx)(v.Z,{variant:"h2",sx:{pt:.5,fontWeight:800,minWidth:"100px"},children:h("accountManagement.referral.referrals.myReferrals")}),(0,r.jsxs)(f.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{ml:2},children:[T,R]}),_&&(0,r.jsxs)(O.ZP,{open:y.open,onClose:y.onClose,arrow:"top-left",sx:{p:0,minWidth:260,overflow:"hidden"},children:[null!=c&&(0,r.jsxs)(x.Z,{sx:{px:2,py:2,textAlign:"center",background:"linear-gradient(135deg, rgba(255, 121, 1, 0.22) 0%, rgba(255, 121, 1, 0.08) 100%)",borderBottom:"1px solid",borderColor:"rgba(255, 121, 1, 0.35)"},children:[(0,r.jsxs)(f.Z,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.75,sx:{mb:.75},children:[(0,r.jsx)(o.Z,{icon:"solar:star-bold",width:16,sx:{color:D}}),(0,r.jsx)(v.Z,{variant:"caption",sx:{color:D,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:h("accountManagement.referral.referrals.directValidReferrals")})]}),(0,r.jsx)(v.Z,{component:"p",sx:{m:0,fontSize:"2.75rem",fontWeight:900,lineHeight:1,color:D,textShadow:"0 2px 12px rgba(255, 121, 1, 0.35)"},children:c})]}),(0,r.jsxs)(x.Z,{sx:{px:2,py:1.75},children:[(0,r.jsx)(v.Z,{variant:"caption",color:"text.secondary",sx:{fontWeight:600,mb:1,display:"block"},children:h("accountManagement.referral.referrals.downlineByLevel")}),(0,r.jsx)(f.Z,{spacing:.5,children:s.map((e,t)=>(0,r.jsxs)(f.Z,{direction:"row",justifyContent:"space-between",spacing:2,children:[(0,r.jsx)(v.Z,{variant:"body2",color:"text.secondary",children:"L".concat(t+1)}),(0,r.jsx)(v.Z,{variant:"body2",fontWeight:0===t?700:500,children:e})]},"downline-l".concat(t+1)))})]})]})]}),(0,r.jsx)(G.Z,{sx:{width:b?150:200},children:(0,r.jsxs)(K.Z,{value:u,onChange:e=>{d(e.target.value)},displayEmpty:!0,sx:{borderColor:g.palette.grey[500],textTransform:"capitalize",color:g.palette.text.primary,backgroundColor:g.palette.grey[900]},children:[(0,r.jsx)(X.Z,{value:"all",children:(0,r.jsx)(v.Z,{variant:"h4",component:"span",children:h("accountManagement.referral.dashboard.graph.allCampaings")})}),k&&k.data.map(e=>(0,r.jsx)(X.Z,{value:e._id,sx:{backgroundColor:g.palette.background.paper,"&.Mui-selected":{backgroundColor:g.palette.text.primary,color:g.palette.getContrastText(g.palette.text.primary)},"&.Mui-selected:hover":{backgroundColor:g.palette.text.primary}},children:(0,r.jsx)(v.Z,{variant:"h4",component:"span",children:e.name})},e._id))]})}),(0,r.jsx)(q.A,{title:(null==F?void 0:F.attributes.heading)||h("accountManagement.referral.referrals.information"),showModal:j,type:"htmlContent",stickyHeader:!0,size:"550px",handleModal:C,modalProps:{content:null!==(t=null==F?void 0:F.attributes.content)&&void 0!==t?t:""}})]})}let J=()=>{var e;let{t}=(0,a.i)(),{authenticated:n}=(0,l.E)(),{showMessage:w}=(0,u.useSnackbar)(),[Z,C]=(0,i.useState)("all"),{page:S,rowsPerPage:k,handleChangePage:I,handleChangeRowsPerPage:M}=(0,s.h)(),[A,F]=(0,i.useState)([]),{data:D,isSuccess:_}=(0,m.k)(n),{data:T,isLoading:R,isError:P,error:W}=(0,d.N)({page:S,limit:k,_id:Z,authenticated:n});(0,i.useEffect)(()=>{T&&F((0,c.X)(T.data))},[T]),(0,i.useEffect)(()=>{P&&w(W.message||"Something went wrong","error")},[P,W,w]);let B={totalReferrals:null!==(e=null==D?void 0:D.total)&&void 0!==e?e:0,downlineCounts:_?D.counts:void 0,directValidCount:_?D.directValidCount:void 0,setSelectedCampaign:C,selectedCampaign:Z};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(f.Z,{direction:"row",spacing:2,alignItems:"center",marginTop:6,marginBottom:2,children:[(0,r.jsx)(o.Z,{icon:"mage:users",color:"#FF7901",width:24,height:24}),(0,r.jsx)(v.Z,{variant:"h2",component:"h2",children:t("accountManagement.referral.referrals.myReferrals")})]}),(0,r.jsxs)(j.M,{sx:{paddingX:4,paddingY:1},children:[(0,r.jsx)($,{...B}),(0,r.jsx)(p.Z,{component:b.Z,children:R?(0,r.jsx)(x.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"400px"},children:(0,r.jsx)(h.Z,{})}):(0,r.jsx)(p.Z,{sx:{overflowX:"auto","@media (max-width: 500px)":{"& .MuiTable-root":{minWidth:"600px"}}},children:(0,r.jsxs)(g.Z,{sx:{tableLayout:"auto"},children:[(0,r.jsx)(L,{isLoading:!1}),(0,r.jsx)(N,{data:A})]})})}),(0,r.jsx)(y.Z,{sx:{borderRadius:"8px"},rowsPerPageOptions:[5,10,20],component:"div",count:(null==T?void 0:T.totalDocuments)||0,page:S,rowsPerPage:k,onPageChange:I,onRowsPerPageChange:M})]})]})}},45095:function(e,t,n){n.r(t),n.d(t,{AccountReferralView:function(){return m}});var r=n(57437),a=n(60033),i=n(2265),o=n(66386),l=n(99074),s=n(78599),c=n(16931),d=n(1899),u=n(98336);let m=()=>{let{getLang:e}=(0,a.i)(),t=e(),[n,m]=(0,i.useState)([]),[x,h]=(0,i.useState)(!0),p={filter:{key:"filters[slug][$eq]",value:"referral"},populate:{key:"populate",value:"*"}},{data:g}=(0,o.W)({...p,locale:{key:"locale",value:t}}),{data:f}=(0,o.W)({...p,locale:{key:"locale",value:"en"}}),v=(0,i.useMemo)(()=>(null==g?void 0:g.data[0])?g.data[0]:null==f?void 0:f.data[0],[g,f]);return(0,i.useEffect)(()=>
1{if(!v){m([]),h(!1);return}try{let e=v.attributes.questions.map(e=>({question:e.question,answer:e.answer,id:e.id}));m(e)}catch(e){m([])}finally{h(!1)}},[v]),(0,r.jsxs)(d.Z,{sx:{pb:2},children:[(0,r.jsx)(u.Dashboard,{}),(0,r.jsx)(c.t,{}),(0,r.jsx)(s.G,{}),v&&(0,r.jsx)(l.Z,{faqs:n})]})}},1327:function(e,t,n){n.r(t),n.d(t,{default:function(){return I}});var r=n(57437),a=n(34422),i=n(33145),o=n(60033),l=n(68575),s=n(2265),c=n(76975),d=n(20418),u=n(29501),m=n(73842),x=n(56574),h=n(78292),p=n(11417),g=n(66274),f=n(28761),v=n(25805),b=n(55447),y=n(47302),j=n(51786),w=n(36067),Z=n(6809),C=n(1899),S=n(19643),k=n(46387);function I(e){let{onAbortEmailVerification:t,setShowVerifyContactModal:n}=e,{t:I}=(0,o.i)(),M=(0,l.v9)(e=>e.user.data),A=null==M?void 0:M.email,[F,D]=(0,s.useState)(!1),[_,T]=(0,s.useState)(""),[R,N]=(0,s.useState)("info"),[P,W]=(0,s.useState)(!0),[B,L]=(0,s.useState)(""),[E,O]=(0,s.useState)(!1),[q,z]=(0,s.useState)(!1),[U,V]=(0,s.useState)(0),[H,G]=(0,s.useState)(600),{initialize:K}=(0,d.E)(),X=(0,g.jD)(),$=(0,g.tv)(),{showMessage:J}=(0,w.useSnackbar)(),[Y,Q]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(!1),[en,er]=(0,s.useState)(""),ea=a.Ry().shape({emailCode:a.Z_().nullable().required(I("validators.thisFieldIsRequired")).test("emailCode",I("auth.validation.invalidEmailOrPhone"),e=>!!e&&a.Z_().email().isValidSync(e))}),ei=(0,u.cI)({resolver:(0,m.X)(ea),defaultValues:{emailCode:P?A:""},shouldUnregister:!0}),{handleSubmit:eo,reset:el,formState:{isSubmitting:es}}=ei,ec=eo(async e=>{let{emailCode:t}=e;try{if(!Y){et(!0);return}if(!P&&t===A){T(I("accountManagement.security.theNewEmailProvideMatchesTheOldOne")),N("error"),D(!0);return}let e=await b.ZP.post("https://api.xyes.com/api/v1"+b.Hv.auth.sendEmailCode,{contactType:"email",email:t,reason:P?"change_current_data":"add_new_data",captcha:en});T(I(e.data.message)),N("success"),D(!0),L(t),O(!0),V(60),G(600),z(!1)}catch(e){var n,r;T("An error occurred: ".concat((null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message)),N("error"),D(!0),V(0),z(!0)}}),ed=a.Ry().shape({verifyCode:a.Z_().required(I("validators.thisFieldIsRequired"))}),{setValue:eu,reset:em}=(0,u.cI)({resolver:(0,m.X)(ed),defaultValues:{verifyCode:""},shouldUnregister:!0}),ex=async e=>{let t={email:P?A:B,code:e.join("")},n=P?b.Hv.auth.verifyCurrentEmail:b.Hv.auth.verifyNewEmail;try{let e=await b.ZP.post("https://api.xyes.com/api/v1"+n,t);200===e.status&&(P?W(!1):(eu("verifyCode",B),W(!0),J(I("actions.updateSuccess")),K(),$.replace(X)),V(0),T(I("actions.updateSuccess")),em(),el(),N("success"),D(!0))}catch(e){var r,a;T("".concat((null===(a=e.response)||void 0===a?void 0:null===(r=a.data)||void 0===r?void 0:r.message)||e.message)),N("error"),D(!0)}};(0,s.useEffect)(()=>{let e;return E&&U>0?e=setInterval(()=>{V(e=>e-1)},1e3):0===U&&(O(!1),D(!1)),()=>clearInterval(e)},[E,U]),(0,s.useEffect)(()=>{let e;return H>0?e=setInterval(()=>{G(e=>e-1)},1e3):0===H&&t(),()=>clearInterval(e)},[E,H,t]);let eh=()=>{n(!0),$.replace("?modal=ContactUs")};return(0,r.jsxs)(C.Z,{children:[(0,r.jsx)(j.Z,{message:_,open:F,setOpen:D,severity:R}),(0,r.jsxs)(C.Z,{children:[(0,r.jsxs)(S.Z,{direction:"row",spacing:1,sx:{mb:3},children:[(0,r.jsx)(i.default,{alt:"Security-Icon",height:50,width:50,src:"".concat("https://img.xyes.com/","assets/images/security/email-icon.svg")}),(0,r.jsx)(k.Z,{children:P?I("accountManagement.security.forYourSecurityPleaseVerifyYourCurrentEmail"):I(q?"accountManagement.security.forYourSecurityPleaseVerifyYourCurrentEmail":"accountManagement.security.nowEnterAndConfirmYourNewEmailAddress",{time:(0,h.vA)(H)})})]}),(0,r.jsx)(y.default,{methods:ei,onSubmit:ec,children:(0,r.jsxs)(S.Z,{direction:"column",gap:2,children:[(0,r.jsx)(u.Qr,{name:"emailCode",control:ei.control,render:e=>{let{field:t,fieldState:n}=e;return(0,r.jsx)(p.a,{...t,label:(0,r.jsxs)(S.Z,{direction:"row",justifyContent:"center",children:[(0,r.jsx)(c.Z,{icon:"system-uicons:mail",color:e=>e.palette.primary.light}),"\xa0",(0,r.jsxs)("span",{children:[" ",I(P?"accountManagement.security.currentEmail":"accountManagement.security.newEmail")," "]})]}
1),helperText:n.invalid?"Email is invalid":"",error:n.invalid,disabled:P||E,onChange:e=>{let{value:n}=e.target;t.onChange(n)}})}}),(0,r.jsx)(Z.Z,{loading:es,size:"small",sx:{alignSelf:"center",width:"fit-content"},type:"submit",variant:E?"outlinedSecondary":"headerSecondary",disabled:E,endIcon:E?(0,r.jsx)(x.Z,{countdown:U}):null,children:E?"".concat(I("buttons.resendIn")," ").concat(U," s"):I("accountManagement.security.sendCode")})]})}),ee&&(0,r.jsx)(v.Z,{onVerify:e=>{Q(!0),et(!1),er(e)},onError:e=>{T(e),N("error"),D(!0)},title:I("register.verifyHuman"),buttonText:I("register.verify")})]}),(0,r.jsxs)(C.Z,{sx:{my:3},children:[(0,r.jsx)(k.Z,{variant:"body1",sx:{textAlign:"left",backgroundColor:"transparent",display:"block",mb:2},children:I("wallet.enableTFA.placeholder")}),(0,r.jsx)(f.Z,{handleSubmit:ex,defaultButtonText:I("actions.submit")})]}),(0,r.jsx)(k.Z,{variant:"body1",sx:{color:"#00C6FF",textAlign:"center",marginTop:"15px",cursor:"pointer"},onClick:()=>eh(),children:I("accountManagement.security.noLongerWorks",{type:I("register.email")})})]})}},27140:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var r=n(57437),a=n(33145),i=n(60033),o=n(66274),l=n(99376),s=n(43161),c=n(78292),d=n(2265),u=n(51786),m=n(1899),x=n(19643),h=n(46387);let p=e=>{let{showVerifyContactModal:t,setShowVerifyContactModal:n}=e,{t:a}=(0,i.i)(),l=(0,o.tv)(),s=()=>{n(!t),l.replace("?modal=ContactUs")};return(0,r.jsx)(h.Z,{variant:"body1",sx:{color:"#00C6FF",textAlign:"center",marginTop:"15px",cursor:"pointer"},onClick:()=>s(),children:a("accountManagement.security.noLongerWorks",{type:a("register.phoneNumber")})})};var g=n(34422),f=n(43577),v=n(68575),b=n(29501),y=n(20418),j=n(73842),w=n(11417),Z=n(56574),C=n(28761),S=n(25805),k=n(55447),I=n(20360),M=n(36067),A=n(68153),F=n(69430),D=n(13719),_=n(6809);let T=e=>{var t,n,a;let{step:l,setAlertSettings:c,setChangePhoneState:u}=e,{t:m}=(0,i.i)(),p=(0,v.v9)(e=>e.user.data),T=(0,o.tv)(),{showMessage:R}=(0,M.useSnackbar)(),{initialize:N}=(0,y.E)(),{getLink:P}=(0,s.m)(),[W,B]=(0,d.useState)({isDisabled:!1,timer:0}),[L,E]=(0,d.useState)({verificationCode:"",countryPhoneCode:null===(t=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===t?void 0:t.country,phone:null===(n=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===n?void 0:n.nationalNumber,fullNumber:null===(a=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===a?void 0:a.number}),[O,q]=(0,d.useState)(!1),[z,U]=(0,d.useState)(!1),[V,H]=(0,d.useState)(""),G=g.Ry().shape({phoneNumber:g.Z_().required(m("validators.phoneIsRequired")).test("is-valid-phone",m("validators.phoneIsInvalid"),e=>!!e&&(0,I.y)(e,L.countryPhoneCode?L.countryPhoneCode:void 0))}),K=g.Ry().shape({verificationCode:g.Z_().required(m("validators.verificationCodeisRequired"))}),X=(0,b.cI)({resolver:(0,j.X)(G),defaultValues:D.P}),{setValue:$,clearErrors:J,reset:Y}=(0,b.cI)({resolver:(0,j.X)(K),defaultValues:{verificationCode:""},shouldUnregister:!0}),{handleSubmit:Q,setValue:ee,formState:{isSubmitting:et}}=X,en=(0,I.y)(String(L.fullNumber),L.countryPhoneCode),er=async e=>{let t="1"===l?"https://api.xyes.com/api/v1"+k.Hv.security.verifyCurrentCode:"https://api.xyes.com/api/v1"+k.Hv.security.verifyNewPhone;if(L.fullNumber){let n={phone:String(L.fullNumber).replace(/[+ ]/g,""),code:e.join("")};try{if(en&&L.countryPhoneCode){let e=await k.ZP.post(t,n);200===e.status&&(c(e=>({...e,severity:"success",open:!0,message:m("accountManagement.security.changePhoneNumber.step".concat(l,"Success"))})),B(e=>({...e,isDisabled:!1,timer:0})),setTimeout(()=>{$("verificationCode",""),ee("phoneNumber",""),E(e=>{var t,n,r;return{...e,phone:"",fullNumber:"",verificationCode:"",countryPhoneCode:(null==p?void 0:null===(t=p.lastLoginLog)||void 0===t?void 0:t.countryCode)?null===(n=p.lastLoginLog)||void 0===n?void 0:n.countryCode:null===(r=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===r?void 0:r.country}}),J(),Y(),"1"===l?(u({step1Completed:!0}),T.replace("?modal=security-verification&type=ChangePhoneNumber&step=2")):"2"===l&&(u({step1Completed:!1}),N(),T.push(P("account-management/security/")),R(m("accountManagement.security.changePhoneNumber.step".concat(l,"Success")),"success"))},1500))}}catch(e){e instanceof f.d7?c(t=>{var n,r;return{...t,severity:"error",open:!0,message:(null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message}}):c(t=>({...t,severity:"error",open:!0,message:e.message||m("errors.anErrorOccurred")}))}}},ea=async e=>{try{if(!O){U(!0);return}let t={phone:"1"===l?String(L.fullNumber).replace("+",""):e.phoneNumber,reason:"1"===l?"change_current_data":"add_new_data",contactType:"phone",captcha:V};B(e=>({...e,timer:60,isDisabled:!0}));let n=await k.ZP.post("https://api.xyes.com/api/v1"+k.Hv.security.sendCode,t);200===n.status&&c(e=>({...e,severity:"success",open:!0,message:m("accountManagement.security.changePhoneNumber.phoneCodeWasSent")}))}catch(e){e instanceof f.d7?c(t=>{var n,r;return{...t,severity:"error",open:!0,message:(null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message}}):(c(t=>({...t,severity:"error",open:!0,message:e.message||m("errors.anErrorOccurred")})),B(e=>({...e,isDisabled:!1})))}};return(0,d.useEffect)(()=>{var e;E(e=>{var t;return{...e,verificationCode:"",phone:"1"===l?null===(t=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===t?void 0:t.nationalNumber:""}});let t=null===(e=(0,F.RE)("+".concat(null==p?void 0:p.phone)))||void 0===e?void 0:e.number;ee("phoneNumber","1"===l&&"string"==typeof t?t:""),"2"===l&&$("verificationCode","")},[$,ee,l,null==p?void 0:p.phone]),(0,d.useEffect)(()=>{let e;return!0===W.isDisabled&&W.timer>0?e=setInterval(()=>{B(e=>({...e,timer:e.timer-1}))},1e3):0===W.timer&&(B(e=>({...e,isDisabled:!1})),c(e=>({...e,open:!1}))),()=>clearInterval(e)},[W.isDisabled,W.timer,c]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(w.Z,{methods:X,onSubmit:Q(ea),children:[(0,r.jsx)(A.P,{handleCountrySelect:e=>{E(t=>({...t,countryPhoneCode:String(e.target.value)}));let t=(0,F.un)(String(L.fullNumber),String(e.target.value));"object"==typeof t&&ee("phoneNumber",t.internationalNumber)},selectedCountry:String(L.countryPhoneCode),handlePhoneChange:e=>{let t=e.target.value.replace(/\D/g,"");E(e=>({...e,phone:t}));let n=(0,F.un)(t,L.countryPhoneCode);E(e=>({...e,fullNumber:n.internationalNumber})),"object"==typeof n&&ee("phoneNumber",n.internationalNumber)},phoneNumberSelected:L.phone?L.phone:"",isDisabled:"1"===l||W.isDisabled&&"2"
1===l}),(0,r.jsx)(x.Z,{direction:"row",justifyContent:"center",alignItems:"center",sx:{mt:3},children:(0,r.jsx)(_.Z,{loading:et,size:"small",sx:{alignSelf:"center",width:"fit-content"},type:"submit",variant:W.isDisabled?"outlinedSecondary":"headerSecondary",disabled:W.isDisabled,endIcon:W.isDisabled?(0,r.jsx)(Z.Z,{countdown:W.timer}):null,children:W.isDisabled?"".concat(m("buttons.resendIn")," ").concat(W.timer," s"):m("buttons.sendCode")})})]}),z&&(0,r.jsx)(S.Z,{onVerify:e=>{q(!0),U(!1),H(e)},onError:e=>{c(t=>({...t,severity:"error",open:!0,message:e}))},title:m("register.verifyHuman"),buttonText:m("register.verify")}),(0,r.jsx)(h.Z,{variant:"body1",sx:{textAlign:"left",backgroundColor:"transparent",display:"block",mb:2},children:m("wallet.enableTFA.placeholder")}),(0,r.jsx)(C.Z,{handleSubmit:er,defaultButtonText:m("actions.submit")})]})};var R=e=>{let{showVerifyContactModal:t,setShowVerifyContactModal:n,onAbortEmailVerification:g,setChangePhoneState:f,changePhoneState:v}=e,{t:b}=(0,i.i)(),y=(0,l.useSearchParams)().get("step"),j=(0,o.tv)(),{getLink:w}=(0,s.m)(),[Z,C]=(0,d.useState)({open:!1,message:b("accountManagement.verification.informationSavedSuccessfully"),severity:"success",setOpen:()=>{}}),[S,k]=(0,d.useState)(600);return(0,d.useEffect)(()=>{y&&!["1","2"].includes(y)&&j.replace(w("account-management/security/"))},[w,j,y]),(0,d.useEffect)(()=>{let e;return S>0?e=setInterval(()=>{k(e=>e-1)},1e3):0===S&&!0===v.step1Completed&&g(),()=>clearInterval(e)},[v.step1Completed,S,g]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{message:Z.message,open:Z.open,setOpen:()=>{C(e=>({...e,open:!e.open}))},severity:Z.severity}),(0,r.jsxs)(m.Z,{sx:{marginTop:Z.open?"50px":"0"},children:[(0,r.jsxs)(x.Z,{direction:"row",sx:{position:"relative",top:"-20px"},children:[(0,r.jsx)(a.default,{alt:"telegramIcon",height:50,src:"".concat("https://img.xyes.com/","assets/icons/my-account/ic_change_phone_number.svg"),width:50,style:{marginRight:"25px",width:"50px"}}),(0,r.jsx)(h.Z,{variant:"body1",sx:{width:"364px",height:"35px",fontWeight:500,fontSize:"16px",color:"#D1D5DB",marginBottom:5},children:b("accountManagement.security.changePhoneNumber.step".concat(y,"Description"),"2"===y?{time:(0,c.vA)(S)}:{})})]}),(0,r.jsx)(T,{step:y||"1",setAlertSettings:C,setChangePhoneState:f}),"1"===y&&(0,r.jsx)(p,{showVerifyContactModal:t,setShowVerifyContactModal:n})]})]})}},95111:function(e,t,n){n.r(t),n.d(t,{default:function(){return R}});var r=n(57437),a=n(34422),i=n(27648),o=n(33145),l=n(43577),s=n(60033),c=n(35398),d=n(29501),u=n(68575),m=n(76975),x=n(66274),h=n(20418),p=n(2265),g=n(73842),f=n(29233),v=n.n(f),b=n(43161),y=n(28761),j=n(68310),w=n(51786),Z=n(36067),C=n(10764),S=n(31691),k=n(82156),I=n(19643),M=n(1899),A=n(46387),F=n(19902),D=n(89414),_=n(44811),T=n(55447);function R(){let{t:e}=(0,s.i)(),t=(0,S.Z)(),{initialize:n}=(0,h.E)(),[f,R]=(0,p.useState)({value:"",copied:!1}),[N,P]=(0,p.useState)(null),[W,B]=(0,p.useState)(!0),[L,E]=(0,p.useState)(null),[O,q]=(0,p.useState)(!1),[z,U]=(0,p.useState)(""),[V,H]=(0,p.useState)("error"),[G,K]=(0,p.useState)(""),X=(0,u.v9)(e=>e.user.data),[,$]=(0,p.useState)(!1),[,J]=(0,p.useState)(!1),{getLink:Y}=(0,b.m)(),Q=a.Ry().shape({code:a.Z_().required(e("wallet.enableTFA.codeIsRequired"))}),ee={code:""},{getValues:et,watch:en,reset:er}=(0,d.cI)({resolver:(0,g.X)(Q),defaultValues:ee,mode:"onTouched"}),ea=(0,k.Z)(t.breakpoints.down("md")),ei=en(),{showMessage:eo}=(0,Z.useSnackbar)(),el=null==X?void 0:X.two_factor_enabled,es=e=>{R({copied:!0,value:e})},ec=(0,x.tv)(),ed=()=>ec.replace("?modal=security-verification&type=contact-us"),eu=async t=>{try{$(!0);let r=await T.ZP.put(T.Hv.wallet.twoFactorAuthentication,{enable:!el,two_factor_token:t,refresh:!1});return U(el?e("wallet.disableTFA.success"):e("wallet.enableTFA.success")),n(),$(!1),er(ee),ec.replace(Y("account-management/security")),eo(el?e("wallet.disableTFA.success"):e("wallet.enableTFA.success"),"success"),r.data}catch(t){if(t instanceof l.d7){var r,a;U(t.message||(null===(a=t.response)||void 0===a?void 0:null===(r=a.data)||void 0===r?void 0:r.message)||e("wallet.twoFactorAuthFailed"))}else U(t.message||e("wallet.twoFactorAuth.unexpectedError"));return H("error"),q(!0),$(!1),er(ee),null}};(0,p.useEffect)(()=>{(async()=>
1{if(el||N){B(!1);return}try{let e=await T.ZP.put(T.Hv.wallet.twoFactorAuthentication,{enable:!0,two_factor_token:"",refresh:!1});P(e.data),K(e.data.otpauthUrl)}catch(r){if(r instanceof l.d7){var t,n;E((null===(n=r.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||r.message)}else E(e("errors.anErrorOccurredWhileFetchingNewtwork"))}finally{B(!1)}})()},[e,el,N]);let em=(null==N?void 0:N.secret)||"";(0,p.useEffect)(()=>{J(Object.values(et()).every(e=>""!==e))},[ei,et]);let ex=async e=>{let t=e.join("");await eu(t)},eh=(0,p.useRef)(null);(0,p.useEffect)(()=>{!eh.current||W||L||setTimeout(()=>{if(ea)window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"});else{var e;null===(e=eh.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"})}},300)},[W,L,ea]);let ep=(0,r.jsxs)(I.Z,{sx:{px:2},direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[(0,r.jsx)(M.Z,{children:(0,r.jsx)(i.default,{href:"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2",passHref:!0,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)(o.default,{alt:"Google Play Store - Google Authenticator",height:60,width:155,src:"".concat("https://img.xyes.com/","assets/images/security/google-play.svg")})})}),(0,r.jsx)(M.Z,{children:(0,r.jsx)(i.default,{href:"https://apps.apple.com/us/app/google-authenticator/id388497605",passHref:!0,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsx)(o.default,{alt:"App Store - Google Authenticator",height:40,width:119,src:"".concat("https://img.xyes.com/","assets/images/security/app-store-dark.svg")})})})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.Z,{sx:{px:3},children:(0,r.jsx)(A.Z,{variant:"h2",sx:{fontSize:{xs:"1.25rem",sm:"1.5rem"}},children:el?e("wallet.disableTFA.title").toUpperCase():e("wallet.enableTFA.title").toUpperCase()})}),(0,r.jsx)(w.Z,{message:z,open:O,setOpen:q,severity:V}),(0,r.jsx)(M.Z,{ref:eh,sx:{px:{xs:1,sm:2},pb:{xs:2,sm:3,md:0},overflowX:"hidden"},id:"2fa-container",children:W?(0,r.jsx)(A.Z,{children:e("general.loading")}):L?(0,r.jsx)(A.Z,{children:L}):(0,r.jsxs)(I.Z,{sx:{px:2},spacing:2,children:[(0,r.jsx)(M.Z,{alignSelf:"center",children:(0,r.jsx)(o.default,{alt:"2fa_disable.svg icon",height:74,width:84,src:"".concat("https://img.xyes.com/","assets/images/security/").concat(el?"2fa_disable.svg":"2fa-icon.svg")})}),(0,r.jsx)(M.Z,{}),el?(0,r.jsx)(I.Z,{spacing:2,children:(0,r.jsx)(j.Z,{message:e("wallet.enableTFA.disableTFA"),type:"warning",withBackground:!0})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(I.Z,{id:"2fa-instructions",spacing:1.5,sx:{px:{xs:1,sm:2}},children:(0,r.jsxs)(M.Z,{children:[(0,r.jsx)(A.Z,{variant:"body1",sx:{mb:2,fontSize:{xs:"0.875rem",sm:"1rem"}},children:e("wallet.enableTFA.2faInstructions.first")}),(0,r.jsx)(M.Z,{display:"flex",justifyContent:"center",alignItems:"center",sx:{mb:{xs:2,sm:3},"& svg":{maxWidth:"100%",height:"auto"}},children:(0,r.jsx)(c.tv,{value:G,size:ea?180:208,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!0,style:{borderRadius:8}})})]})}),(0,r.jsx)(M.Z,{sx:{mt:2,mb:2},children:(0,r.jsx)(I.Z,{direction:{xs:"column",sm:"row"},gap:"2rem",children:(0,r.jsxs)(I.Z,{spacing:2,width:"100%",children:[(0,r.jsx)(A.Z,{fontWeight:"regular",color:C.Z[300],children:e("wallet.enableTFA.2faQrInfo.first")}),ep,(0,r.jsx)(A.Z,{fontWeight:"regular",color:C.Z[300],children:e("wallet.enableTFA.2faQrInfo.second")}),(0,r.jsx)(I.Z,{spacing:1,mt:"4",children:(0,r.jsx)(F.Z,{sx:{width:"100%",px:2,py:1,background:"#1f2a37",border:"2px solid #1a4151",mt:1,mb:1},children:(0,r.jsxs)(D.ZP,{container:!0,component:"main",spacing:1,alignItems:"center",sx:{},children:[(0,r.jsx)(D.ZP,{item:!0,xs:12,sm:12,md:8,children:(0,r.jsx)(A.Z,{sx:{wordBreak:"break-word",color:t.palette.grey[400]},children:em})}),(0,r.jsx)(D.ZP,{item:!0,xs:12,sm:12,md:4,textAlign:"end",children:(0,r.jsx)(v(),{text:em,onCopy:()=>es(em),children:(0,r.jsx)(_.Z,{fullWidth:ea,variant:"headerSecondary",sx:{border:"1px solid #FF7901CC"},children:(0,r.jsx)(m.Z,{icon:f.copied?"solar:check-circle-line-duotone":"solar:copy-linear"})})})})]})})})]})})})]}),(0,r.jsx)(A.Z,{variant:"body1",sx:{textAlign:"left",backgroundColor:"transparent",display:"block"},children:e("wallet.enableTFA.placeholder")}),(0,r.jsx)(y.Z,{handleSubmit:ex,defaultButtonText:el?e("wallet.enableTFA.disable"):e("wallet.disableTFA.enable"),buttonColor:el?"secondary":void 0}),el?(0,r.jsx)(A.Z,{variant:"body1",sx:{color:"#00C6FF",textAlign:"center",marginTop:"10px",cursor:"pointer"},onClick:()=>ed(),children:e("accountManagement.security.noLongerWorks",{type:e("accountManagement.security.2FA")})}):null]})})]})}},9194:function(e,t,n){n.r(t),n.d(t,{default:function(){return S}});var r=n(57437),a=n(34422),i=n(33145),o=n(60033),l=n(68575),s=n(2265),c=n(76975),d=n(20418),u=n(29501),m=n(73842),x=n(56574),h=n(11417),p=n(66274),g=n(28761),f=n(55447),v=n(47302),b=n(51786),y=n(36067),j=n(6809),w=n(1899),Z=n(19643),C=n(46387);function S(){let{t:e}=(0,o.i)(),t=(0,l.v9)(e=>e.user.data),n=(null==t?void 0:t.email)?t.email:"",[S,k]=(0,s.use
1State)(!1),[I,M]=(0,s.useState)(""),[A,F]=(0,s.useState)("info"),{initialize:D}=(0,d.E)(),[_,T]=(0,s.useState)(!1),[R,N]=(0,s.useState)(0),P=(0,p.jD)(),W=(0,p.tv)(),{showMessage:B}=(0,y.useSnackbar)(),L=a.Ry().shape({emailCode:a.Z_().nullable().required(e("validators.thisFieldIsRequired")).test("emailCode",e("validators.emailMustBeaValidEmailAddress"),e=>!!e&&a.Z_().email().isValidSync(e))}),E=(0,u.cI)({resolver:(0,m.X)(L),defaultValues:{emailCode:n},shouldUnregister:!0}),{handleSubmit:O,formState:{isSubmitting:q}}=E,z=O(async t=>{let{emailCode:r}=t,a=n.length>0?{contactType:"email"}:{contactType:"email",email:r};try{await f.ZP.post("".concat("https://api.xyes.com/api/v1").concat(f.Hv.auth.verifyEmailOrPhone),a),M(e("accountManagement.security.codeHasBeenSent")),F("success"),k(!0),T(!0),N(60)}catch(e){var i,o;M("An error occurred: ".concat((null===(o=e.response)||void 0===o?void 0:null===(i=o.data)||void 0===i?void 0:i.message)||e.message)),F("error"),k(!0)}}),U=a.Ry().shape({verifyCode:a.Z_().required(e("validators.thisFieldIsRequired"))}),{reset:V}=(0,u.cI)({resolver:(0,m.X)(U),defaultValues:{verifyCode:""},shouldUnregister:!0}),H=async t=>{try{let n={contactType:"email",loginCode:t.join("")},r=await f.ZP.post("https://api.xyes.com/api/v1"+f.Hv.auth.verifyContact,n);200===r.status&&(D(),V(),B(e("accountManagement.security.emailVerified")),k(!1),W.replace(P))}catch(e){var n,r;M("".concat((null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message)),F("error"),k(!0)}};return(0,s.useEffect)(()=>{let e;return _&&R>0?e=setInterval(()=>{N(e=>e-1)},1e3):0===R&&(T(!1),k(!1)),()=>clearInterval(e)},[_,R]),(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(b.Z,{message:I,open:S,setOpen:k,severity:A}),(0,r.jsxs)(w.Z,{children:[(0,r.jsxs)(Z.Z,{direction:"row",spacing:1,sx:{mb:3},children:[(0,r.jsx)(i.default,{alt:"Security-Icon",height:50,width:50,src:"".concat("https://img.xyes.com/","assets/images/security/email-icon.svg")}),(0,r.jsx)(C.Z,{children:e("accountManagement.security.pleaseProvideAndVerifyYourEmailAddressToSecureYourAccount")})]}),(0,r.jsx)(v.default,{methods:E,onSubmit:z,children:(0,r.jsxs)(Z.Z,{direction:"column",gap:2,children:[(0,r.jsx)(u.Qr,{name:"emailCode",control:E.control,render:t=>{let{field:a,fieldState:i}=t;return(0,r.jsx)(h.a,{...a,label:(0,r.jsxs)(Z.Z,{direction:"row",justifyContent:"center",children:[(0,r.jsx)(c.Z,{icon:"system-uicons:mail",color:e=>e.palette.primary.light}),"\xa0",(0,r.jsxs)("span",{children:[" ",e("accountManagement.security.currentEmail")," "]})]}),helperText:i.invalid?"Email is invalid":"",error:i.invalid,disabled:n.length>0||_,onChange:e=>{let{value:t}=e.target;a.onChange(t)}})}}),(0,r.jsx)(j.Z,{loading:q,size:"small",sx:{alignSelf:"center",width:"fit-content"},type:"submit",variant:_?"outlinedSecondary":"headerSecondary",disabled:_,endIcon:_?(0,r.jsx)(x.Z,{countdown:R}):null,children:_?"".concat(e("buttons.resendIn")," ").concat(R," s"):e("accountManagement.security.sendCode")})]})})]}),(0,r.jsx)(w.Z,{sx:{my:3},children:(0,r.jsx)(g.Z,{handleSubmit:H,defaultButtonText:e("actions.submit")})})]})}},8678:function(e,t,n){n.r(t),n.d(t,{default:function(){return F}});var r=n(57437),a=n(33145),i=n(60033),o=n(66274),l=n(99376),s=n(43161),c=n(2265),d=n(51786),u=n(1899),m=n(19643),x=n(46387),h=n(34422),p=n(43577),g=n(68575),f=n(29501),v=n(20418),b=n(73842),y=n(11417),j=n(56574),w=n(28761),Z=n(55447),C=n(20360),S=n(36067),k=n(68153),I=n(69430),M=n(6809);let A=e=>{var t,n,a,l;let{step:s,setAlertSettings:d,setChangePhoneState:u}=e,{t:A}=(0,i.i)(),F=(0,g.v9)(e=>e.user.data),D=(null==F?void 0:F.phone)?F.phone:"",_=(0,o.jD)(),T=(0,o.tv)(),{showMessage:R}=(0,S.useSnackbar)(),{initialize:N}=(0,v.E)(),[P,W]=(0,c.useState)({isDisabled:!1,timer:0}),[B,L]=(0,c.useState)({verificationCode:"",countryPhoneCode:(null==F?void 0:null===(t=F.lastLoginLog)||void 0===t?void 0:t.countryCode)?null===(n=F.lastLoginLog)||void 0===n?void 0:n.countryCode:"US",phone:(null==F?void 0:F.phone)?null===(a=(0,I.RE)("+".concat(F.phone)))||void 0===a?void 0:a.nationalNumber:"",fullNumber:null===(l=(0,I.RE)("+".concat(null==F?void 0:F.phone)))||void 0===l?void 0:l.number}),E=h.Ry().shape({phoneNumber:h.Z_().required(A("validators.phoneIsRequired")).test("is-valid-phone",A("validators.phoneIsInvalid"),e=>!!e&&(0,C.y)(e,B.countryPhoneCode?B.countryPhoneCode:void 0))}),O=(0,f.cI)({resolver:(0,b.X)(E),defaultValues:{phoneNumber:D}}),{handleSubmit:q,setValue:z,formState:{isSubmitting:U}}=O,V=(0,C.y)(String(B.fullNumber),B.countryPhoneCode),H=async e=>{try{let t=(null==D?void 0:D.length)>0?{contactType:"phone"}:{contactType:"phone",phone:e.phoneNumber};W(e=>({...e,timer:60,isDisabled:!0}));let n=await Z.ZP.post("".concat("https://api.xyes.com/api/v1").concat(Z.Hv.auth.verifyEmailOrPhone),t);200===n.status&&d(e=>({...e,severity:"success",open:!0,message:A("accountManagement.security.changePhoneNumber.phoneCodeWasSent")}))}catch(e){e instanceof p.d7?d(t=>{var n,r;return{...t,severity:"error",open:!0,message:(null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message}}):d(t=>({...t,severity:"error",open:!0,message:e.message||A("errors.anErrorOccurred")}))}},G=async e=>{if(B.fullNumber)try{if(V&&B.countryPhoneCode){let t={contactType:"phone",loginCode:e.join("")},n=await Z.ZP.post("https://api.xyes.com/api/v1"+Z.Hv.auth.verifyContact,t);200===n.status&&(N(),R(A("accountManagement.security.phoneVerified")),T.replace(_))}}catch(e){e instanceof p.d7?d(t=>{var n,r;return{...t,severity:"error",open:!0,message:(null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.message)||e.message}}):d(t=>({...t,severity:"error",open:!0,message:e.message||A("errors.anErrorOccurred")}))}};return(0,c.useEffect)(()=>{let e;return!0===P.isDisabled&&P.timer>0?e=setInterval(()=>{W(e=>({...e,timer:e.timer-1}))},1e3):0===P.timer&&(W(e=>({...e,isDisabled:!1})),d(e=>({...e,open:!1}))),()=>clearInterval(e)},[P.isDisabled,P.timer,d]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y.Z,{methods:O,onSubmit:q(H),children:[(0,r.jsx)(k.P,{handleCountrySelect:e=>{L(t=>({...t,countryPhoneCode:String(e.target.value)}));let t=(0,I.un)(String(B.fullNumber),String(e.target.value));"object"==typeof t&&z("phoneNumber",t.internationalNumber)},selectedCountry:String(B.countryPhoneCode),handlePhoneChange:e=>{let t=e.target.value.replace(/\D/g,"");
1L(e=>({...e,phone:t}));let n=(0,I.un)(t,B.countryPhoneCode);L(e=>({...e,fullNumber:n.internationalNumber})),"object"==typeof n&&z("phoneNumber",n.internationalNumber)},phoneNumberSelected:B.phone?B.phone:"",isDisabled:(null==D?void 0:D.length)>0||P.isDisabled}),(0,r.jsx)(m.Z,{direction:"row",justifyContent:"center",alignItems:"center",sx:{mt:3},children:(0,r.jsx)(M.Z,{loading:U,size:"small",sx:{alignSelf:"center",width:"fit-content"},type:"submit",variant:P.isDisabled?"outlinedSecondary":"headerSecondary",disabled:P.isDisabled,endIcon:P.isDisabled?(0,r.jsx)(j.Z,{countdown:P.timer}):null,children:P.isDisabled?"".concat(A("buttons.resendIn")," ").concat(P.timer," s"):A("buttons.sendCode")})})]}),(0,r.jsx)(x.Z,{variant:"body1",sx:{textAlign:"left",backgroundColor:"transparent",display:"block",mb:2,mt:2},children:A("wallet.enableTFA.placeholder")}),(0,r.jsx)(w.Z,{handleSubmit:G,defaultButtonText:A("login.verify"),loadingButtonText:A("auth.verifying")})]})};var F=e=>{let{showVerifyContactModal:t,setShowVerifyContactModal:n,onAbortEmailVerification:h,setChangePhoneState:p,changePhoneState:g}=e,{t:f}=(0,i.i)(),v=(0,l.useSearchParams)().get("step"),b=(0,o.tv)(),{getLink:y}=(0,s.m)(),[j,w]=(0,c.useState)({open:!1,message:f("accountManagement.verification.informationSavedSuccessfully"),severity:"success",setOpen:()=>{}});return(0,c.useEffect)(()=>{v&&!["1","2"].includes(v)&&b.replace(y("account-management/security/"))},[y,b,v]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Z,{message:j.message,open:j.open,setOpen:()=>{w(e=>({...e,open:!e.open}))},severity:j.severity}),(0,r.jsxs)(u.Z,{sx:{marginTop:j.open?"50px":"0"},children:[(0,r.jsxs)(m.Z,{direction:"row",sx:{mb:3},children:[(0,r.jsx)(a.default,{alt:"Verify-phone-Number",height:50,src:"".concat("https://img.xyes.com/","assets/icons/my-account/ic_change_phone_number.svg"),width:50,style:{marginRight:"25px",width:"50px"}}),(0,r.jsx)(x.Z,{variant:"body1",sx:{fontWeight:500,fontSize:"16px",color:"#D1D5DB"},children:f("accountManagement.security.phoneNumberVerification.looksLikeYouHaventSetAphoneNumberYet")})]}),(0,r.jsx)(A,{step:"2",setAlertSettings:w,setChangePhoneState:p})]})]})}},67498:function(e,t,n){n.r(t),n.d(t,{default:function(){return X}});var r=n(57437),a=n(20418),i=n(55343),o=n(1899),l=n(73053),s=n(19643),c=n(2265),d=n(60033),u=n(68575),m=n(66274),x=n(51283),h=n(67972),p=n(89414),g=n(55447),f=n(31691),v=n(82156);let b=()=>{let e=(0,m.jD)(),t=(0,m.tv)(),n=(0,m.lr)(),i=n.get("modal"),o=n.get("type"),l=n.get("step"),[s,u]=(0,c.useState)({step1Completed:!1}),{authenticated:x}=(0,a.E)(),{t:p}=(0,d.i)(),[b,y]=(0,c.useState)("ContactUs"===i),j=(0,f.Z)(),w=(0,v.Z)(j.breakpoints.down("md"));(0,c.useEffect)(()=>{x&&t.replace(e)},[x,e,t]);let Z=async()=>{if("change-email"===o||"ChangePhoneNumber"===o)try{await g.ZP.post("https://api.xyes.com/api/v1"+g.Hv.auth.abortChangeEmail),t.replace(e)}catch(e){}};return(0,r.jsxs)(r.Fragment,{children:["2"===l&&!0!==s.step1Completed?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.A,{type:"enableTFA",size:"500px",title:"",showTitle:!1,showModal:"EnableTFA"===o,fullScreenOnMobile:!1,disablePadding:w}),(0,r.jsx)(h.A,{type:"verifyPhoneNumberDialog",title:p("accountManagement.security.verifyPhoneNumber"),showModal:"verifyphone"===o,size:"500px",fullScreenOnMobile:!1,handleModal:()=>{t.replace(e)},showCloseButton:!0,modalProps:{showVerifyContactModal:b,setShowVerifyContactModal:y,onAbortEmailVerification:Z,setChangePhoneState:u,changePhoneState:s}}),(0,r.jsx)(h.A,{type:"changePhoneNumberDialog",title:p("accountManagement.security.changePhone"),showModal:"ChangePhoneNumber"===o,size:"500px",fullScreenOnMobile:!1,handleModal:Z,modalProps:{showVerifyContactModal:b,setShowVerifyContactModal:y,onAbortEmailVerification:Z,setChangePhoneState:u,changePhoneState:s}}),(0,r.jsx)(h.A,{type:"changeEmail",size:"500px",fullScreenOnMobile:!1,title:p("accountManagement.security.changeEmail"),showModal:"change-email"===o,handleModal:Z,modalProps:{onAbortEmailVerification:Z,setShowVerifyContactModal:y}}),(0,r.jsx)(h.A,{type:"verifyEmail",size:"500px",title:p("accountManagement.security.verifyEmail"),showModal:"email"===o,fullScreenOnMobile:!1}
1),(0,r.jsx)(h.A,{type:"contactUs",size:"500px",title:"",showTitle:!1,showModal:"contact-us"===o,fullScreenOnMobile:!0,disablePadding:!0})]}),"ContactUs"===i&&(0,r.jsx)(h.A,{type:"verifyContact",title:p("verifyContact.modal.title"),showModal:b,handleModal:y})]})};var y=n(68720),j=n(67208),w=n(44811),Z=n(46387),C=n(36137);function S(e){let{title:t,description:n,onEdit:a,verified:i,buttonText:l,id:s}=e;return(0,r.jsx)(j.Z,{sx:{bgcolor:"rgb(15, 23, 42)",border:"1px solid rgba(51, 65, 85, 0.5)",borderRadius:"8px","&:hover":{borderColor:"rgb(59, 130, 246)",boxShadow:"0 0 0 1px rgb(59, 130, 246)"},height:"fit-content"},children:(0,r.jsxs)(C.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:{xs:2,sm:3},"&:last-child":{pb:{xs:2,sm:3}}},children:[(0,r.jsxs)(o.Z,{sx:{width:{xs:"200px",sm:"auto"},display:"flex",alignItems:"center",gap:{xs:1,sm:2},flexGrow:1,minWidth:0},children:[(e=>{let t={fontSize:{xs:"24px",sm:"24px"},color:"#3b82f6"};switch(e){case"1":return(0,r.jsx)(o.Z,{width:24,component:y.JO,icon:"mdi:lock",sx:t});case"2":return(0,r.jsx)(o.Z,{width:24,component:y.JO,icon:"mdi:security",sx:t});case"3":return(0,r.jsx)(o.Z,{width:24,component:y.JO,icon:"mdi:email",sx:t});case"4":return(0,r.jsx)(o.Z,{width:24,component:y.JO,icon:"mdi:phone",sx:t});default:return null}})(s),(0,r.jsxs)(o.Z,{sx:{minWidth:0,flexShrink:1},children:[(0,r.jsx)(Z.Z,{variant:"subtitle1",sx:{color:"white",fontWeight:600,mb:.5,fontSize:{xs:"0.875rem",sm:"1rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),n&&(0,r.jsx)(Z.Z,{variant:"body2",sx:{color:((e,t)=>{let n={verified:"#22c55e",unverified:"#ef4444"};return t?n.verified:n.unverified})(0,i),fontWeight:500,fontSize:{xs:"0.75rem",sm:"0.875rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n})]})]}),(0,r.jsx)(w.Z,{onClick:a,sx:{bgcolor:"rgb(249, 115, 22)",color:"white",textTransform:"none",px:{xs:2,sm:2},py:{xs:.5,sm:1},fontSize:{xs:"0.75rem",sm:"0.875rem"},minWidth:{xs:"100px",sm:"120px"},"&:hover":{bgcolor:"rgb(234, 88, 12)"},flexShrink:0},children:l})]})})}function k(){let{t:e}=(0,d.i)(),t=(0,u.v9)(e=>e.user.data),n=(0,m.tv)(),[a,i]=(0,c.useState)(!1),l=[{label:e("accountManagement.security.emailVerification"),linkTo:"?modal=security-verification&type=".concat((null==t?void 0:t.verification.email)?"change-email":"email"),buttonText:e((null==t?void 0:t.verification.email)?"accountManagement.security.change":"accountManagement.security.verify"),isComplete:null==t?void 0:t.verification.email,labelInfo:(null==t?void 0:t.email)?t.email:e("accountManagement.security.emailNotVerified"),id:"3"},{label:e((null==t?void 0:t.verification.phone)?"accountManagement.security.phone":"accountManagement.security.phoneVerification"),linkTo:(null==t?void 0:t.verification.phone)?"?modal=security-verification&type=ChangePhoneNumber&step=1":"?modal=security-verification&type=verifyphone",buttonText:e((null==t?void 0:t.verification.phone)?"accountManagement.security.change":"accountManagement.security.verify"),isComplete:null==t?void 0:t.verification.phone,labelInfo:(null==t?void 0:t.phone)?"+".concat(t.phone):e("accountManagement.security.numberNotVerified"),id:"4"},{label:e("accountManagement.security.password"),linkTo:"",buttonText:e((null==t?void 0:t.has_password)||(null==t?void 0:t.loginType)!==x.H.GOOGLE?"accountManagement.security.change":"auth.setPassword"),isComplete:null==t?void 0:t.has_password,labelInfo:e((null==t?void 0:t.has_password)?"accountManagement.security.passwordVerified":"accountManagement.security.passwordNotVerified"),id:"1"},{label:e("accountManagement.security.twoFactorAuthentication"),linkTo:"?modal=security-verification&type=EnableTFA",buttonText:e((null==t?void 0:t.two_factor_enabled)?"wallet.disableTFA.disableTFA":"wallet.enableTFA.enableTFA"),isComplete:null==t?void 0:t.two_factor_enabled,labelInfo:e((null==t?void 0:t.two_factor_enabled)?"accountManagement.security.twoFactorEnabled":"accountManagement.security.twoFactorDisabled"),id:"2"}],s=async e=>{if("1"===e.id){i(!0);return}("3"===e.id||"4"===e.id||"2"===e.id)&&n.replace(e.linkTo)};return(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(o.Z,{children:(0,r.jsx)(p.ZP,{container:!0,spacing:1,children:l.map(e=>(0,r.jsx)(p.ZP,{item:!0,xs:12,sm:6,md:6,lg:6,children:(0,r.jsx)(S,{id:e.id,title:e.label,description:e.labelInfo,onEdit:()=>s(e),verified:e.isComplete,buttonText:e.buttonText})},e.id))})}),(0,r.jsx)(b,{}),(0,r.jsx)(h.A,{title:e((null==t?void 0:t.has_password)||(null==t?void 0:t.loginType)!==x.H.GOOGLE?"accountManagement.security.modalTitle":"accountManagement.security.setupPassword"),type:"changePassword",fullScreenOnMobile:!1,showModal:a,handleModal:i})]})}var I=n(33145),M=n(43577),A=n(76975),F=n(14086),D=n(69430),_=n(36067),T=n(13335),R=n(37631),N=n(22095),P=n(19902),W=n(70208),B=n(32281),L=n(28314),E=n(52988),O=n(59469),q=n(27970);let z=[{id:"cardNumber",label:"security.table.device",width:100,align:"center"},{id:"bankName",label:"security.table.location",width:100,align:"center"},{id:"currency",label:"security.table.lastUsed",width:100,align:"center"}
1,{id:"other",label:"security.table.operation",width:100,align:"center"}];function U(e,t){return!!t&&!!e.sessionId&&e.sessionId===t}function V(){var e;let t=(0,f.Z)(),{t:n}=(0,d.i)(),{authenticated:i}=(0,a.E)(),[u,m]=(0,c.useState)(0),[x,h]=(0,c.useState)(5),[p,v]=(0,c.useState)([]),[b,y]=(0,c.useState)(null),{showMessage:j}=(0,_.useSnackbar)(),C=i?(0,F.C$)():null,S="".concat("https://api.xyes.com/api/v1"+g.Hv.security.getSessionsByUser,"?page=").concat(u+1,"&limit=").concat(x),{data:k,isLoading:V,refetch:H}=(0,T.e)({fetchURL:S},i);(0,c.useEffect)(()=>{k&&v(k.data)},[k]);let G=async e=>{if(!U(e,C))try{y(e._id);let t={deviceInfo:e.deviceInfo,_id:e._id};await g.ZP.patch(g.Hv.security.setKickOff,t),j(n("actions.updateSuccess")),H()}catch(e){if(e instanceof M.d7){var t,r;j((null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||e.message,"error")}else j(e.message||n("errors.anErrorOccurred"),"error")}finally{y(null)}},K={borderBottomColor:"#1976d2",backgroundColor:t.palette.grey[700]},X={backgroundColor:"".concat(t.palette.blue[800]," !important")},$=null!==(e=null==k?void 0:k.totalDocuments)&&void 0!==e?e:0,{countryCodes:J}=(0,D.$J)("en");return(0,r.jsx)(s.Z,{direction:"column",spacing:2,sx:{mt:8},children:(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(N.Z,{component:P.Z,children:(0,r.jsxs)(W.Z,{sx:{tableLayout:"auto"},children:[(0,r.jsx)(B.Z,{children:(0,r.jsx)(L.Z,{children:z.map(e=>(0,r.jsx)(E.Z,{sx:{...K,width:e.width,textAlign:e.align||"left"},children:(0,r.jsx)(Z.Z,{variant:"thead",children:n(e.label)})},e.id))})}),(0,r.jsxs)(O.Z,{sx:X,children:[V&&(0,r.jsx)(L.Z,{children:(0,r.jsx)(E.Z,{colSpan:8,align:"center",children:(0,r.jsx)(o.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(l.Z,{color:"secondary"})})})}),0===p.length&&!V&&(0,r.jsx)(L.Z,{children:(0,r.jsx)(E.Z,{colSpan:8,align:"center",children:n("wallet.table.noRecords")})}),p.map(e=>{var a;let i=U(e,C),o=b===e._id;return(0,r.jsxs)(L.Z,{sx:{"&:hover":{backgroundColor:"".concat(t.palette.blue[700]," !important")}},children:[(0,r.jsxs)(E.Z,{align:"center",children:[(0,r.jsx)(Z.Z,{variant:"body2",sx:{fontWeight:"bold"},children:"object"==typeof e.deviceInfo&&null!==e.deviceInfo?e.deviceInfo.browser.name||"N/A":e.deviceInfo||"N/A"}),(0,r.jsx)(Z.Z,{variant:"body2",children:"object"==typeof e.deviceInfo&&null!==e.deviceInfo?"(".concat("".concat(e.deviceInfo.os.name,"  ").concat(e.deviceInfo.os.version),")")||0:e.deviceInfo||"N/A"})]}),(0,r.jsxs)(E.Z,{align:"center",children:[(0,r.jsx)(I.default,{alt:"country",width:25,height:20,src:(null===(a=J.find(t=>t.code===e.countryCode))||void 0===a?void 0:a.image)||""}),(0,r.jsx)("span",{style:{marginLeft:"8px"},children:e.country&&"N/A"!==e.country?e.country:"N/A"}),(0,r.jsx)(Z.Z,{style:{marginLeft:"8px"},children:e.ip&&"N/A"!=="(".concat(e.ip,")")?"(".concat(e.ip,")"):"N/A"})]}),(0,r.jsx)(E.Z,{align:"center",children:(0,r.jsx)(R.U,{date:e.createdAt,formatStyle:"short",timeFormat:"24h",showTime:!0})}),(0,r.jsx)(E.Z,{align:"center",children:(0,r.jsx)(s.Z,{direction:"row",alignItems:"center",justifyContent:"center",spacing:2,children:(0,r.jsxs)(w.Z,{color:i?"success":"error",variant:"outlined",onClick:()=>G(e),disabled:i||o,size:"small",sx:{textTransform:"capitalize",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o?(0,r.jsx)(l.Z,{size:16,color:"inherit"}):(0,r.jsx)(A.Z,{icon:i?"solar:check-circle-linear":"solar:logout-2-outline"}),(0,r.jsx)(Z.Z,{mx:1,children:n(i?"security.table.inUse":"security.table.removeDevice")})]})})})]},e._id)})]})]})}),(0,r.jsx)(q.Z,{sx:X,rowsPerPageOptions:[5,10],component:"div",count:$,rowsPerPage:x,page:u,onPageChange:(e,t)=>
1{m(t)},onRowsPerPageChange:e=>{h(+e.target.value),m(0)}})]})})}function H(){return(0,r.jsx)(o.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(l.Z,{color:"secondary"})})}function G(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{}),(0,r.jsx)(V,{})]})}function K(e){let{authenticated:t,loading:n}=e;return n?(0,r.jsx)(H,{}):t?(0,r.jsx)(G,{}):(0,r.jsx)(i.Kl,{})}function X(){let{authenticated:e,loading:t}=(0,a.E)();return(0,r.jsx)(o.Z,{sx:{mt:1,width:1},children:(0,r.jsx)(s.Z,{spacing:1,children:(0,r.jsx)(K,{authenticated:e,loading:t})})})}},43706:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var r=n(57437),a=n(60033),i=n(42180),o=n(38954),l=n(20418),s=n(68575),c=n(55447),d=n(59062),u=n(43426),m=n(2265),x=n(82877),h=n(36067),p=n(45091),g=n(67972),f=n(1899),v=n(31691),b=n(82156),y=n(46387),j=n(44811),w=n(85860),Z=n(85147);let C="".concat("https://api.xyes.com/api/v1"+c.Hv.configs.languages);function S(e){let{sx:t,...n}=e;return(0,r.jsx)(f.Z,{sx:[e=>({p:1,m:1}),...Array.isArray(t)?t:[t]],...n})}function k(){var e,t,n;let{t:i}=(0,a.i)(),k=(0,s.I0)(),{initialize:I}=(0,l.E)(),M=(0,s.v9)(e=>e.user.data),{showMessage:A}=(0,h.useSnackbar)(),[F,D]=(0,m.useState)(!1),[_,T]=(0,m.useState)(0),R=()=>D(!1),N=(0,v.Z)(),P=(0,b.Z)(N.breakpoints.up("lg")),W=(0,b.Z)(N.breakpoints.between("sm","lg")),[B,L]=(0,m.useState)(""),{data:E,isLoading:O,error:q}=(0,u.d)({fetchURL:C},!0),z=(0,d.K$)(),U=(0,s.v9)(e=>e.user.data),V=(0,b.Z)("(min-width:640px)"),H="mini"===z.themeLayout,{getLang:G}=(0,a.i)(),K=G()||(null==U?void 0:U.settings.language),X=null==E?void 0:null===(e=E.find(e=>e.abbreviatedCode===K))||void 0===e?void 0:e.flag,$=(0,s.v9)(e=>e.user.data),[J,Y]=(0,m.useState)((null==$?void 0:$.settings.view_in_fiat_object.to_show)||!1),[Q,ee]=(0,m.useState)({view_in_fiat:(null==M?void 0:M.settings.view_in_fiat_object.currency)||"USD",language:(null==M?void 0:M.settings.language)||"EN",hide_blocked_games:(null==M?void 0:M.settings.hide_blocked_games)||!1,dark_mode:(null==M?void 0:M.settings.dark_mode)||!1,receive_marketing_promotions:(null==M?void 0:M.settings.receive_marketing_promotions)||!1});(0,m.useEffect)(()=>{(null==M?void 0:M.settings)&&ee(e=>({...e,view_in_fiat:M.settings.view_in_fiat_object.currency||"USD",language:M.settings.language||"EN",hide_blocked_games:M.settings.hide_blocked_games||!1,dark_mode:M.settings.dark_mode||!1,receive_marketing_promotions:M.settings.receive_marketing_promotions||!1}))},[M]);let{isLoading:et,error:en}=(0,x.SG)(),er=e=>{let{name:t,checked:n}=e.target;ee(e=>({...e,[t]:n})),ei({[t]:n})};(0,m.useEffect)(()=>{Y((null==$?void 0:$.settings.view_in_fiat_object.to_show)||!1)},[$]);let ea=async e=>{Y(e.target.checked);let t=new URL("".concat("https://api.xyes.com/api/v1"+c.Hv.configs.updateProfileSettings)),n={settings:{to_show_in_fiat:e.target.checked}};try{await c.ZP.put(t.href,n)}catch(e){A(e.message||i("errors.anErrorOccurred"),"error")}finally{I()}},ei=async e=>{try{await c.ZP.put(c.Hv.accountManagement.settings,{settings:e}),I(),k({type:"UPDATE_USER_SETTINGS",payload:e})}catch(e){}};return((0,m.useEffect)(()=>{U&&L(U.settings.language)},[U]),et||O)?(0,r.jsx)("div",{children:i("general.loading")}):en||q?(0,r.jsx)("div",{children:i("error.somethingWentWrong")}):(0,r.jsxs)(f.Z,{sx:{width:"100%",display:"flex",flexWrap:"wrap",justifyContent:"center",p:1,m:1,borderRadius:1},children:[(0,r.jsxs)(S,{sx:{width:"360px"},children:[(0,r.jsx)(y.Z,{variant:"subtitle1",sx:{fontWeight:"medium"},children:i("accountManagement.settings.displayInFiat")}),(0,r.jsxs)(j.Z,{onClick:()=>{D(!0),T(1)},sx:{display:"flex",alignItems:"center",gap:1,height:50,width:"100%",md:{pd:0}},variant:"outlined",children:[(null==U?void 0:U.settings.view_in_fiat_object.icon)&&!W&&(0,r.jsx)(o.Z,{alt:"currency",width:25,src:U.settings.view_in_fiat_object.icon}),(null==U?void 0:U.settings.view_in_fiat_object.to_show)?U.settings.view_in_fiat_object.currency:i("navigation.header.settings.none")]})]}),(0,r.jsxs)(S,{sx:{width:"360px"},children:[(0,r.jsx)(y.Z,{variant:"subtitle1",sx:{fontWeight:"medium"},children:i("accountManagement.settings.language")}),(0,r.jsxs)(j.Z,{onClick:()=>{D(!0),T(0)},sx:{display:"flex",alignItems:"center",gap:1,height:50,width:"100%",md:{pd:0}},variant:"outlined",children:[B&&(0,r.jsx)(o.Z,{alt:"language",width:25,src:X||(null==E?void 0:null===(t=E[0])||void 0===t?void 0:t.flag)}),"80px"!=(P?H?"80px":"280px":V?"80px":"0px")&&(0,r.jsx)(r.Fragment,{children:B&&(null==E?void 0:null===(n=E.find(e=>e.abbreviatedCode===K))||void 0===n?void 0:n.nameOfTheLanguage)||"Select Language"})]})]}),(0,r.jsxs)(S,{sx:{width:"360px"},children:[(0,r.jsx)(y.Z,{variant:"subtitle1",sx:{fontWeight:"medium"},children:i("accountManagement.settings.theme")}),(0,r.jsx)(p.Z,{isDark:Q.dark_mode,onToggle:e=>{ee(t=>({...t,dark_mode:e})),ei({dark_mode:e})}})]}),(0,r.jsx)(S,{sx:{width:"360px",display:"flex",alignItems:"center",justifyContent:"start"},children:(0,r.jsx)(w.Z,{control:(0,r.jsx)(Z.Z,{name:"display_in_fiat",checked:J,onChange:e=>ea(e)}),label:"Display in Fiat"})}),(0,r.jsx)(S,{sx:{width:"360px",display:"flex",alignItems:"center",justifyContent:"start"},children:(0,r.jsx)(w.Z,{control:(0,r.jsx)(Z.Z,{checked:Q.receive_marketing_promotions,onChange:er,name:"receive_marketing_promotions"}),label:"Receive marketing promotions by Email"})}),(0,r.jsx)(S,{sx:{width:"360px",display:"flex",alignItems:"center",justifyContent:"start"},children:(0,r.jsx)(w.Z,{control:(0,r.jsx)(Z.Z,{checked:Q.hide_blocked_games,onChange:er,name:"hide_blocked_games"}),label:"Hide blocked games"})}),(0,r.jsx)(g.A,{title:"",showModal:F,handleModal:R,type:"updateLanguage",modalProps:{setLanguage:L,handleClose:R,defaultTab:_},hasIcon:!0})]})}var I=n(19643);function M(){let{t:e}=(0,a.i)();return(0,r.jsx)(I.Z,{direction:"column",spacing:4,sx:{mt:1},children:(0,r.jsx)(I.Z,{direction:{xs:"column",md:"row"},spacing:2,children:(0,r.jsx)(i.Z,{label:e("accountManagement.accountPreferences"),children:(0,r.jsx)(k,{})})})})}},42549:function(e,t,n){n.r(t),n.d(t,{default:function(){return H}});var r=n(57437),a=n(2265),i=n(60033),o=n(20418),l=n(12654),s=n(36067),c=n(17947),d=n(19643),u=n(68575),m=n(76975),x=n(38954),h=n(48116),p=n(
150857),g=n(82877),f=n(67972),v=n(61043),b=n(62511),y=n(31691),j=n(82156),w=n(22095),Z=n(19902),C=n(70208),S=n(32281),k=n(28314),I=n(52988),M=n(46387),A=n(59469),F=n(1899),D=n(73053),_=n(95576),T=n(27970);let R=e=>{let{transactionRecordInfo:t,isLoading:n,page:o,rowsPerPage:l,onChangePage:s,onChangeRowsPerPage:c,refetch:d}=e,R=(0,y.Z)(),{t:N}=(0,i.i)(),P=(0,j.Z)(R.breakpoints.down("sm")),[W]=(0,a.useState)("desc"),[B]=(0,a.useState)("createdAt"),L=P?[{id:"type",label:"transaction.table.type",width:100,align:"center"},{id:"amount",label:"transaction.table.amount",width:100,align:"center"},{id:"createdAt",label:"transaction.table.time",width:100,align:"center"},{id:"status",label:"transaction.table.status",width:100,align:"center"}]:[{id:"bill",label:"transaction.table.billNo",width:100,align:"center"},{id:"type",label:"transaction.table.type",width:100,align:"center"},{id:"amount",label:"transaction.table.amount",width:100,align:"center"},{id:"createdAt",label:"transaction.table.time",width:100,align:"center"},{id:"status",label:"transaction.table.status",width:100,align:"center"}],E=(0,u.v9)(e=>e.user.data),{data:O}=(0,g.Xn)({currencyCode:"USD"}),q=a.useMemo(()=>t?[...t.data].sort((e,t)=>{let n=e[B],r=t[B];return n<r?"asc"===W?-1:1:n>r?"asc"===W?1:-1:0}):[],[t,W,B]),z={borderBottomColor:"#1976d2",backgroundColor:R.palette.grey[700]},U={backgroundColor:"".concat(R.palette.blue[800]," !important")},[V,H]=(0,a.useState)(!1),[G,K]=(0,a.useState)(null),X=e=>{K(e),H(!0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{component:Z.Z,sx:{maxHeight:1===q.length?"500px":void 0},children:(0,r.jsxs)(C.Z,{sx:{tableLayout:"auto"},children:[(0,r.jsx)(S.Z,{children:(0,r.jsx)(k.Z,{children:L.map(e=>(0,r.jsx)(I.Z,{sx:{...z,width:e.width,textAlign:e.align||"left"},children:(0,r.jsx)(M.Z,{variant:"h4",children:N(e.label)})},e.id))})}),(0,r.jsxs)(A.Z,{sx:U,children:[n&&(0,r.jsx)(k.Z,{children:(0,r.jsx)(I.Z,{colSpan:8,align:"center",children:(0,r.jsx)(F.Z,{sx:{width:"100%",mx:"auto",textAlign:"center",p:10},children:(0,r.jsx)(D.Z,{color:"secondary"})})})}),0===q.length&&!n&&(0,r.jsx)(k.Z,{children:(0,r.jsx)(I.Z,{colSpan:8,align:"center",children:N("wallet.table.noRecords")})}),q.map(e=>(0,r.jsxs)(k.Z,{hover:!0,sx:{"&:hover":{backgroundColor:"".concat(R.palette.blue[700]," !important")}},children:[!P&&(0,r.jsx)(I.Z,{align:"center",children:e.billNo&&e.billNo.charAt(0).toUpperCase()+e.billNo.slice(1)}),(0,r.jsx)(I.Z,{align:"center",sx:{textTransform:"capitalize"},children:(()=>{switch("refund"===e.activityName?e.activityName:e.type){case"deposit":return N("wallet.deposit");case"withdraw":case"withdrawal":return N("wallet.withdraw");case"swap":return N("wallet.swap");case"refund":return N("refund");case"bonus":return N("wallet.bonus");default:return N("unknown")}})()}),(0,r.jsx)(I.Z,{align:"center",children:(0,r.jsxs)(F.Z,{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:1,children:[(0,r.jsxs)(F.Z,{display:"flex",alignItems:"center",gap:1,children:[e.logoUrl&&(0,r.jsx)(x.Z,{width:e.currency.includes("fiat")?25:20,alt:"currency",src:e.logoUrl,height:20}),(0,r.jsxs)(M.Z,{fontWeight:"bold",color:(0,p.v)(e),children:[("withdraw"===e.type||"withdrawal"===e.type)&&"-",(0,h.dN)(Number("deposit"===e.type?e.realityamount:e.amount),e.currency)]})]}),(0,r.jsx)(M.Z,{children:(0,b.ok)(e,(null==E?void 0:E.settings.view_in_fiat_object.currency)||"",O||{},(null==E?void 0:E.settings.view_in_fiat_object.to_show)||!1)})]})}),(0,r.jsx)(I.Z,{align:"center",children:(0,r.jsx)(v.Z,{row:e})}),(0,r.jsx)(I.Z,{align:"center",children:(0,r.jsx)(_.Z,{color:"success"===e.status?"success":"fail"===e.status||"Canceled by user"===e.memberFeedback?"error":"pending"===e.status||"processing"===e.status||"-"===e.memberFeedback?"warning":"error",onClick:()=>X(e),children:(0,r.jsx)(m.Z,{icon:"success"===e.status?"solar:check-circle-linear":"fail"===e.status||"Canceled by user"===e.memberFeedback?"carbon:close-outline":"pending"===e.status||"processing"===e.status||"-"===e.memberFeedback?"mdi-light:clock":"carbon:close-outline"})})})]},e._id))]})]})}),(0,r.jsx)(T.Z,{sx:{backgroundColor:"".concat(R.palette.blue[800]," !important")},rowsPerPageOptions:[5,10],component:"div",count:t?t.totalDocuments:0,rowsPerPage:l,page:o,onPageChange:s,onRowsPerPageChange:c}),V&&G&&(0,r.jsx)(f.A,{type:"withdrawStatus",title:"actions.transactionDetail
1s",showModal:V,handleModal:()=>{H(!1),K(null)},fullScreenOnMobile:!1,disablePadding:P,modalProps:{orderId:G.billNo,expiryTime:600,depositAmount:"".concat(G.realityamount),createdAt:G.createdAt,currency:G.currency,method:G.type,refetch:d,memberFeedback:G.memberFeedback,fee:G.fee,row:G,type:G.type},size:"md"})]})};var N=n(71096),P=n.n(N),W=n(76245),B=n(70203),L=n(22577),E=n(33833),O=n(50290);function q(e,t,n){let r={};return(t||n)&&(r.timeframe="requestTime",r.date={...t?{from:t}:{},...n?{to:n}:{}}),"deposit"===e?r.activity=2:"withdraw"===e?r.activity=1:"tips"===e?r.platform=7:"swap"===e&&(r.platform=6),r}let z=[{value:"transfer",label:"transaction.filter.transfer"},{value:"bonus",label:"transaction.filter.bonus"}],U={transfer:[{value:"all",label:"transaction.filter.all"},{value:"deposit",label:"transaction.filter.deposit"},{value:"withdraw",label:"transaction.filter.withdraw"},{value:"tips",label:"transaction.filter.sendTips"},{value:"swap",label:"transaction.filter.cryptoSwap"}],bonus:[{value:"all",label:"transaction.filter.all"},{value:"deposit",label:"transaction.filter.deposit"},{value:"withdraw",label:"transaction.filter.withdraw"}]};function V(e){let{category:t,setCategory:n,setFilters:o,handleChangePage:l}=e,{t:s}=(0,i.i)(),c=(0,y.Z)(),u=(0,j.Z)(c.breakpoints.down("md")),[m,x]=(0,a.useState)("all"),[h,p]=(0,a.useState)([P()().subtract(7,"day"),P()()]),g=(0,a.useRef)(!0),f=(0,a.useRef)(h),v=(0,a.useCallback)((e,t)=>{var n,r;l(null,0),o({search:"",filters:JSON.stringify(q(e,(null===(n=t[0])||void 0===n?void 0:n.toISOString())||"",(null===(r=t[1])||void 0===r?void 0:r.toISOString())||""))})},[l,o]);(0,a.useEffect)(()=>{g.current&&(v(m,h),g.current=!1)},[m,h,v]),(0,a.useEffect)(()=>{g.current||P()(h[0]).isSame(f.current[0],"day")&&P()(h[1]).isSame(f.current[1],"day")||(v(m,h),f.current=h)},[h,m]);let b=U[t];return(0,r.jsxs)(d.Z,{direction:"row",spacing:2,alignItems:"center",justifyContent:"start",children:[(0,r.jsxs)(d.Z,{direction:"row",spacing:2,children:[(0,r.jsxs)(B.Z,{fullWidth:!0,sx:{width:u?150:200},children:[(0,r.jsx)(L.Z,{id:"categorySelect",children:s("transaction.filter.selectCategory")}),(0,r.jsx)(E.Z,{labelId:"categorySelect",id:"category-select",value:t,label:s("transaction.filter.selectCategory"),onChange:e=>{var t,r;n(e.target.value),x("all"),l(null,0),o({search:"",filters:JSON.stringify(q("all",(null===(t=h[0])||void 0===t?void 0:t.toISOString())||"",(null===(r=h[1])||void 0===r?void 0:r.toISOString())||""))})},children:z.map(e=>(0,r.jsx)(O.Z,{value:e.value,children:s(e.label)},e.value))})]}),(0,r.jsxs)(B.Z,{fullWidth:!0,sx:{width:u?150:200},children:[(0,r.jsx)(L.Z,{id:"activitySelect",children:s("transaction.filter.selectActivity")}),(0,r.jsx)(E.Z,{labelId:"activitySelect",id:"activity-select",value:m,label:s("transaction.filter.selectActivity"),onChange:e=>{let t=e.target.value;x(t),v(t,h)},children:b.map(e=>(0,r.jsx)(O.Z,{value:e.value,children:s(e.label)},e.value))})]})]}),(0,r.jsx)(F.Z,{sx:{width:u?365:300},children:(0,r.jsx)(W.Z,{value:h,onChange:e=>{p([e.fromDate?P()(e.fromDate):null,e.toDate?P()(e.toDate):null])}})})]})}function H(){let{t:e}=(0,i.i)(),{authenticated:t}=(0,o.E)(),{showMessage:n}
1=(0,s.useSnackbar)(),[u,m]=(0,a.useState)("transfer"),[x,h]=(0,a.useState)({search:"",filters:""}),{page:p,rowsPerPage:g,handleChangePage:f,handleChangeRowsPerPage:v}=(0,l.h)(),b=(0,c.OS)({page:p,limit:g,filters:x,authenticated:t,enabled:"transfer"===u}),y=(0,c.lb)({page:p,limit:g,filters:x,authenticated:t,enabled:"bonus"===u}),{data:j,isLoading:w,isError:Z,error:C,refetch:S}="transfer"===u?b:y;Z&&n(C.message||e("errors.anErrorOccurred"),"error");let k=(null==j?void 0:j.data)?g:0,I=(null==j?void 0:j.data)?p:0;return(0,r.jsxs)(d.Z,{direction:"column",spacing:2,sx:{mt:1},children:[(0,r.jsx)(V,{category:u,setCategory:m,setFilters:h,handleChangePage:f}),(0,r.jsx)(R,{transactionRecordInfo:j,isLoading:w,page:I,rowsPerPage:k,onChangePage:f,onChangeRowsPerPage:v,refetch:S})]})}},39466:function(e,t,n){n.r(t),n.d(t,{default:function(){return $}});var r=n(57437),a=n(33145),i=n(60033),o=n(31691),l=n(19643),s=n(46387),c=n(1899);let d=()=>{let e=(0,o.Z)(),{t}=(0,i.i)();return(0,r.jsx)(l.Z,{direction:{xs:"column",md:"row"},spacing:2,alignItems:"flex-start",position:"relative",sx:{backgroundColor:"grey.800",p:4,borderRadius:1,flexGrow:1,flexBasis:"50%",maxWidth:"40%",[e.breakpoints.down("md")]:{flexBasis:"100%",maxWidth:"100%"}},children:(0,r.jsxs)(l.Z,{spacing:4,width:"100%",children:[(0,r.jsx)(s.Z,{variant:"h2",color:"common.white",children:t("accountManagement.verification.informationTitle")}),(0,r.jsxs)(l.Z,{spacing:2,children:[(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:t("accountManagement.verification.informationFirstParagraph")}),(0,r.jsx)(s.Z,{variant:"body1",color:"text.secondary",children:t("accountManagement.verification.informationSecondParagraph")})]}),(0,r.jsx)(c.Z,{sx:{position:"relative",width:"100%",paddingTop:"56.25%",overflow:"hidden"},children:(0,r.jsx)(a.default,{src:"".concat("https://img.xyes.com/","assets/images/account-management/verification/verification-info-01.png"),alt:"Verification Information",fill:!0,priority:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",style:{objectFit:"contain",transition:"filter 0.3s ease"},onError:e=>{}})})]})})};var u=n(76975),m=n(2265),x=n(68818);
1n(70939),n(76416);var h=n(34422);n(44508),n(31732);var p=n(16206),g=n.n(p),f=n(71096),v=n.n(f),b=n(29501),y=n(73842),j=n(55447),w=n(63177),Z=n(70361),C=n(51786),S=n(51423),k=n(95401),I=n(57099),M=n(92772),A=n(61461),F=n(6809),D=n(19902),_=n(73053),T=n(11417);v().extend(g());var R=n(68310),N=n(71102),P=n(63511),W=n(89414);let B="".concat("https://img.xyes.com/","assets/images/security/icon-documents.svg");var L=n(16210),E=n(10207),O=n(73904),q=n(12713);let z="".concat("https://img.xyes.com/","assets/images/security/icon-documents.svg"),U="".concat("https://img.xyes.com/","assets/images/security/icon-documents.svg"),V=(0,L.ZP)(E.Z)(e=>{let{theme:t}=e;return{textTransform:"none",fontWeight:"bold",fontSize:"16px",borderRadius:"var(--rounded-lg, 8px)",color:t.palette.common.white,padding:"8px 12px",minHeight:"unset",marginRight:0,marginLeft:0,"&.Mui-selected":{backgroundColor:"#1f272d",border:"1px solid #fe7801",color:"#fe7801"},"&:not(.Mui-selected)":{backgroundColor:"rgba(255, 255, 255, 0.08)",border:"1px solid rgba(255, 255, 255, 0.12)"},"&.MuiButtonBase-root.MuiTab-root:not(:last-of-type)":{marginRight:15}}}),H=(0,L.ZP)(O.Z)({"& .MuiTabs-indicator":{display:"none"},minHeight:"unset","& .MuiTabs-flexContainer":{gap:0},"& .MuiTabs-scrollButtons":{color:"white"},"& .MuiTabs-scrollButtons.Mui-disabled":{opacity:.3}}),G=e=>{let{children:t,value:n,index:a,...i}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:n!==a,id:"tabpanel-".concat(a),"aria-labelledby":"tab-".concat(a),...i,children:n===a&&(0,r.jsx)(c.Z,{sx:{p:0,width:"100%"},children:(0,r.jsx)(s.Z,{children:t})})})},K=[{labelKey:"accountManagement.level1",component:e=>{var t,n,a,o,d,u,x,p,g;let{userVerificationData:f,isLoadingUserVerification:R,refetch:N}=e,{t:P}=(0,i.i)(),[W,B]=(0,m.useState)(!1),[L,E]=(0,m.useState)(!1),[O,q]=(0,m.useState)(""),[z,U]=(0,m.useState)("info"),V=(0,Z.K)(),H=I.pw[V.language],G=Number(null==f?void 0:f.level_1.status),K=(0,w.O)(null==f?void 0:f.level_1.status),[X,$]=(0,m.useState)({date:!R&&(null==f?void 0:f.level_1.dateOfBirth)?v()(f.level_1.dateOfBirth).startOf("day"):null,errorDate:null}),[J,Y]=(0,m.useState)(""),[Q,ee]=(0,m.useState)(""),[et,en]=(0,m.useState)(!1),er=h.Ry().shape({firstName:h.Z_().max(100,e=>P("accountManagement.verification.firstNameLengthValidation",{max:e.max})).required(P("accountManagement.verification.firstNameValidation")),lastName:h.Z_().max(100,e=>P("accountManagement.verification.lastNameLengthValidation",{max:e.max})).required(P("accountManagement.verification.lastNameValidation")),country:h.Z_().required(P("accountManagement.verification.countryRequired")),placeOfBirth:h.Z_().required(P("accountManagement.verification.livingAddressValidation")),city:h.Z_().max(255,e=>P("accountManagement.verification.cityLengthValidation",{max:e.max})).required(P("accountManagement.verification.cityValidation")),postalCode:h.Z_().max(255,e=>P("accountManagement.verification.postalCodeLengthValidation",{max:e.max})).required(P("accountManagement.verification.postalCodeValidation")),residentialAddress:h.Z_().max(255,e=>P("accountManagement.verification.livingAddressLengthValidation",{max:e.max})).required(P("accountManagement.verification.livingAddressValidation")),occupationIndustry:h.Z_().max(255,e=>P("accountManagement.verification.occupationIndustryLengthValidation",{max:e.max})).required(P("accountManagement.verification.occupationIndustryRequired")),occupation:h.Z_().max(255,e=>P("accountManagement.verification.occupationLengthValidation",{max:e.max})).required(P("accountManagement.verification.occupationRequired")),occupationExperience:h.Z_().max(255,e=>P("accountManagement.verification.occupationExperienceLengthValidation",{max:e.max})).required(P("accountManagement.verification.occupationExperienceRequired"))}),ea=(0,b.cI)({resolver:(0,y.X)(er),defaultValues:{firstName:"",lastName:"",residentialAddress:"",country:"",placeOfBirth:"",city:"",postalCode:"",occupationIndustry:"",occupation:"",occupationExperience:""},mode:"onTouched"}),{handleSubmit:ei,setValue:eo,formState:el,getValues:es,watch:ec,trigger:ed}=ea,eu=ec();(0,m.useEffect)(()=>{(()=>{let e=Object.values(es()).every(e=>""!==e),t=null!==X.date&&!X.errorDate;en(e&&t)})()},[eu,X,es]);let em=ei(async e=>{if(Object.keys(el.errors).length>0&&el.isValid){q(P("accountManagement.verification.pleaseFillAllFields")),U("error"),E(!0);return}B(!0);try{let t=X.date?X.date.format("YYYY-MM-DD"):null;0===G||Number.isNaN(G)?(await j.ZP.post(j.Hv.accountManagement.verification,{...e,dateOfBirth:t})).data&&(q(P("accountManagement.verification.informationSavedSuccessfully")),U("success")):(await j.ZP.put(j.Hv.accountManagement.verifyFirstLevel,{...e,dateOfBirth:t})).data&&(q(P("accountManagement.verification.informationSavedSuccessfully")),U("success")),N()}catch(e){var t,n;q("An error occurred: ".concat((null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||e.message)),U("error")}finally{B(!1),E(!0)}}),ex=e=>
1{e&&e.isValid()?$({date:e.startOf("day"),errorDate:null}):$({date:null,errorDate:P("accountManagement.verification.dateOfBirthRequired")})},eh=async e=>{eo(e.target.name,String(e.target.value))},ep=P("countries",{returnObjects:!0}),eg=(e,t)=>!!Object.values(e).some(e=>String(e).toLowerCase().includes(String(t).toLowerCase())),ef=(0,m.useMemo)(()=>Object.entries(ep).filter(e=>{let[t,n]=e;return eg({[t]:n},Q)}),[ep,Q]),{country:ev,placeOfBirth:eb,firstName:ey,lastName:ej,city:ew,postalCode:eZ,residentialAddress:eC,occupation:eS,occupationExperience:ek,occupationIndustry:eI}=es(),eM=(e,t)=>{let{name:n,value:r}=e.target;eo(n,r.replace(/[!@#$%^&()\-_=+{}[\]|\\:;"<>,.?/~`*]/g,"").substring(0,t))};return(0,m.useEffect)(()=>{!R&&(null==f?void 0:f.level_1)&&Object.entries(f.level_1).forEach(e=>{let[t,n]=e;n&&("dateOfBirth"===t&&""!==n&&$({date:v()(n).utc().startOf("day"),errorDate:null}),""!==n&&eo(t,String(n)))})},[eo,null==f?void 0:f.level_1,R]),(0,r.jsx)(T.Z,{methods:ea,onSubmit:em,children:(0,r.jsxs)(D.Z,{sx:{padding:"15px",minHeight:"800px",borderRadius:{xs:0,sm:1}},children:[(0,r.jsx)(C.Z,{message:O,open:L,setOpen:E,severity:z}),R?(0,r.jsx)(l.Z,{alignItems:"center",justifyContent:"center",sx:{height:"100%"},children:(0,r.jsx)(_.Z,{sx:{width:110,height:110,mt:15}})}):(0,r.jsxs)(l.Z,{spacing:2.5,children:[(0,r.jsx)(l.Z,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:2,children:(0,r.jsx)(s.Z,{sx:{color:(0,I.JU)(null==f?void 0:f.level_1.status).value,mt:1.5},children:((null==f?void 0:f.level_1.status)===1||(null==f?void 0:f.level_1.status)===2)&&P((0,I.JU)(f.level_1.status).label)})}),(0,r.jsxs)(l.Z,{direction:{xs:"column",lg:"row"},spacing:2,children:[(0,r.jsx)(A.Z,{name:"firstName",label:P("accountManagement.verification.realName"),icon:"solar:user-linear",required:!0,disabled:K,maxLength:100,onChange:e=>eM(e,100),error:!ey&&!!el.errors.firstName,helperText:null===(t=el.errors.firstName)||void 0===t?void 0:t.message}),(0,r.jsx)(A.Z,{name:"lastName",label:P("accountManagement.lastName"),icon:"solar:user-linear",required:!0,disabled:K,maxLength:100,onChange:e=>eM(e,100),error:!ej&&!!el.errors.lastName,helperText:null===(n=el.errors.lastName)||void 0===n?void 0:n.message})]}),(0,r.jsx)(k.Z,{name:"country",staticSelect:!0,required:!0,label:P("accountManagement.verification.countryOrRegion"),disabled:K,error:el.errors.country,helperText:null===(a=el.errors.country)||void 0===a?void 0:a.message,searchText:J,setSearchText:Y,handleSelect:eh,country:ev,icon:"mynaui:location"}),(0,r.jsx)(M.Z,{name:"placeOfBirth",static:!0,required:!0,icon:"mynaui:location",label:P("accountManagement.verification.placeOfBirth"),options:ef,disabled:K,error:el.errors.placeOfBirth,helperText:!eb&&el.errors.placeOfBirth?P("accountManagement.verification.placeOfBirthRequired"):"",searchText:Q,setSearchText:ee,handleSelect:eh}),(0,r.jsx)(S.Z,{id:"dateOfBirth",name:"dateOfBirth",label:P("accountManagement.verification.dateOfBirth"),value:X.date,onChange:e=>ex(e),error:X.errorDate||void 0,disabled:K,disableFuture:!0,language:H,required:!0,iconColor:"#FF7901E5",minAge:18}),(0,r.jsx)(A.Z,{name:"residentialAddress",label:P("accountManagement.verification.residentialAddress"),icon:"mynaui:location",required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!eC&&!!el.errors.residentialAddress,helperText:null===(o=el.errors.residentialAddress)||void 0===o?void 0:o.message}),(0,r.jsxs)(l.Z,{direction:{xs:"column",md:"row"},spacing:2,children:[(0,r.jsx)(A.Z,{name:"city",label:P("accountManagement.verification.city"),icon:"mynaui:location",required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!ew&&!!el.errors.city,helperText:null===(d=el.errors.city)||void 0===d?void 0:d.message}),(0,r.jsx)(A.Z,{name:"postalCode",label:P("accountManagement.verification.postalCode"),icon:"solar:code-file-broken",required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!eZ&&!!el.errors.postalCode,helperText:null===(u=el.errors.postalCode)||void 0===u?void 0:u.message})]}),(0,r.jsx)(A.Z,{name:"occupationIndustry",label:P("accountManagement.verification.occupationIndustry"),icon:"ic:outline-business",required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!eI&&!!el.errors.occupationIndustry,helperText:null===(x=el.errors.occupationIndustry)||void 0===x?void 0:x.message}),(0,r.jsx)(A.Z,{name:"occupation",label:P("accountManagement.verification.occupation"),iconType:"img",icon:"".concat("https://img.xyes.com/","assets/icons/setting/ic_occupation.svg"),required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!eS&&!!el.errors.occupation,helperText:null===(p=el.errors.occupation)||void 0===p?void 0:p.message}),(0,r.jsx)(A.Z,{name:"occupationExperience",label:P("accountManagement.verification.occupationExperience"),icon:"".concat("https://img.xyes.com/","assets/icons/setting/ic_experience.svg"),iconType:"img",required:!0,disabled:K,maxLength:255,onChange:e=>eM(e,255),error:!ek&&!!el.errors.occupationExperience,helperText:null===(g=el.errors.occupationExperience)||void 0===g?void 0:g.message}),(0,r.jsx)(c.Z,{sx:{display:"flex",justifyContent:"center",mt:3,mb:3},children:(0,r.jsx)(F.Z,{sx:{width:{xs:"100%",sm:"60%"}},color:"inherit",size:"large",type:"submit",variant:"header",loading:W,disabled:K||!et||W,onClick:async()=>{v()(X.date).isValid()&&X.date||$(e=>({...e,errorDate:P("accountManagement.verification.dateOfBirthRequired")})),await ed()},children:et?P("accountManagement.verification.saveButton"):P("accountManagement.verification.allFieldsRequired")})})]})]})})},statusKey:"level_1"},{labelKey:"accountManagement.level2",component:e=>{let{userVerificationData:t,isLoadingUserVerification:n,refetch:a}=e,{t:o}=(0,i.i)(),[d,x]=(0,m.useState)({open:!1,message:"",severity:"info"}),[h,p]=(0,m.useState)((null==t?void 0:t.level_2.documentType)||""),[g,f]=(0,m.useState)((null==t?void 0:t.level_2.documentValue)||""),[v,b]=(0,m.useState)({frontSideImage:{file:void 0,preview:z,isPDF:!1},backSideImage:{file:void 0,preview:z,isPDF:!1}}),y=(0,m.useMemo)(()=>(null==t?void 0:t.level_1.status)===2,[null==t?void 0:t.level_1.status]),w=(0,m.useMemo)(()=>{let e=Number(null==t?void 0:t.level_2.status);return(0===e||3===e)&&y},[null==t?void 0:t.level_2.status,y]),Z=(0,m.useMemo)(()=>""!==h&&""!==g&&void 0!==v.frontSideImage.file&&void 0!==v.backSideImage.file,[h,g,v.frontSideImage.file,v.backSideImage.file]),S=(0,m.useMemo)(()=>!w||!Z||n,[w,Z,n]),k=(0,m.useMemo)(()=>[{label:o("accountManagement.verification.driverLicense"),key:"driverLicense"},{label:o("accountManagement.verification.passport"),key:"passport"},{label:o("accountManagement.verification.id"),key:"id"},{label:o("accountManagement.verification.socialSecurityNumber"),key:"socialSecurityNumber"},{label:o("accountManagement.verification.other"),key:"other"}],[o]),A=(0,m.useCallback)(e=>t=>{if(t.length>0&&y){let n=t[0];b(t=>({...t,[e]:{file:new File([],n.original_filename),preview:n.file_url,isPDF:"application/pdf"===n.mime_type}}))}},[y]),_=async()=>
1{if(y&&h&&g&&v.frontSideImage.file&&v.backSideImage.file){let n={documentType:h,documentValue:g,frontSideImage:v.frontSideImage.preview,backSideImage:v.backSideImage.preview};try{await j.ZP.put("".concat("https://api.xyes.com/api/v1"+j.Hv.accountManagement.verifySecondLevel),n),x({open:!0,message:o("accountManagement.verification.informationSavedSuccessfully"),severity:"success"}),b({frontSideImage:{file:void 0,preview:z,isPDF:!1},backSideImage:{file:void 0,preview:z,isPDF:!1}}),p(""),f(""),a()}catch(n){var e,t;x({open:!0,message:"An error occurred: ".concat((null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||n.message),severity:"error"})}}};return(0,m.useEffect)(()=>{if(!n&&(null==t?void 0:t.level_2)){var e,r;b({frontSideImage:{file:void 0,preview:null!==(e=t.level_2.frontSideImage)&&void 0!==e?e:z,isPDF:String(t.level_2.frontSideImage).endsWith(".pdf")},backSideImage:{file:void 0,preview:null!==(r=t.level_2.backSideImage)&&void 0!==r?r:z,isPDF:String(t.level_2.backSideImage).endsWith(".pdf")}}),p(String(t.level_2.documentType||"")),f(String(t.level_2.documentValue||""))}},[n,t]),(0,r.jsxs)(D.Z,{elevation:2,sx:{padding:2,textAlign:"left",borderRadius:{xs:0,sm:1}},children:[(0,r.jsx)(C.Z,{message:d.message,open:d.open,setOpen:e=>x(t=>({...t,open:e})),severity:d.severity}),(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(l.Z,{direction:"column",spacing:2,children:[(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,children:[(0,r.jsx)(s.Z,{component:"div",variant:"h2",gutterBottom:!0,children:o("account.verification")}),(0,r.jsx)(l.Z,{direction:"row",children:(0,r.jsx)(s.Z,{component:"div",sx:{color:(0,I.JU)(null==t?void 0:t.level_2.status).value},children:((null==t?void 0:t.level_2.status)===1||(null==t?void 0:t.level_2.status)===2)&&o((0,I.JU)(t.level_2.status).label)})})]}),(0,r.jsx)(s.Z,{component:"div",mb:2,color:"grey.400",variant:"body2",fontSize:"0.975rem",children:o("accountManagement.verification.pleaseUploadYourID")}),!y&&(0,r.jsx)(R.Z,{message:o("accountManagement.verification.completeFirstLevel"),type:"warning"})]}),(0,r.jsx)(c.Z,{sx:{mt:2},children:(0,r.jsx)(M.Z,{name:"documentType",required:!0,labelText:o("accountManagement.verification.selectDocumentType"),placeholder:o("accountManagement.verification.documentType"),options:k,disabled:!y||!w,onChange:e=>{y&&p(e.target.value)},value:h})}),(0,r.jsx)(c.Z,{sx:{mt:2},children:(0,r.jsx)(q.Z,{fullWidth:!0,name:"documentValue",label:o("accountManagement.verification.idValue")||"Document Value",InputProps:{startAdornment:(0,r.jsx)(c.Z,{sx:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center"},children:(0,r.jsx)(u.Z,{icon:"solar:user-id-linear",sx:{color:"primary.light",width:24,height:24}})})},sx:{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"transparent"},"&:hover fieldset":{borderColor:"transparent"},"&.Mui-focused fieldset":{borderColor:"inherit"},paddingLeft:"40px"},"& .MuiInputLabel-root":{color:"#9CA3AF","&.Mui-focused":{color:"#9CA3AF"},transform:"translate(14px, -9px) scale(0.75)","&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}},"& .MuiInputLabel-asterisk":{color:"red"},mb:2},required:!0,inputProps:{maxLength:100},onChange:e=>{y&&w&&f(e.target.value)},value:g||"",disabled:!y||!w})}),(0,r.jsxs)(c.Z,{sx:{mt:4,mb:2,filter:y?"none":"blur(4px)",pointerEvents:y?"auto":"none",display:"flex",gap:2,flexDirection:"column"},children:[(0,r.jsx)(c.Z,{children:y&&w?(0,r.jsx)(P.b,{saveFilesURL:A("frontSideImage"),numfilesUploaded:v.frontSideImage.file?1:0,module:"KYC",fileName:"level2_frontSideImage",status:Number(null==t?void 0:t.level_2.status),id:"frontSideImage",preview:v.frontSideImage.preview,isPDF:v.frontSideImage.isPDF}):(0,r.jsx)(N.Z,{isPDF:v.frontSideImage.isPDF,preview:v.frontSideImage.preview,status:Number(null==t?void 0:t.level_2.status),side:"frontSideImage"})}),(0,r.jsx)(c.Z,{children:y&&w?(0,r.jsx)(P.b,{saveFilesURL:A("backSideImage"),numfilesUploaded:v.backSideImage.file?1:0,module:"KYC",fileName:"level2_backSideImage",status:Number(null==t?void 0:t.level_2.status),id:"backSideImage",preview:v.backSideImage.preview,isPDF:v.backSideImage.isPDF}):(0,r.jsx)(N.Z,{isPDF:v.backSideImage.isPDF,preview:v.backSideImage.preview,status:Number(null==t?void 0:t.level_2.status),side:"frontSideImage"})})]}),(0,r.jsx)(W.ZP,{container:!0,component:"div",alignItems:"center",justifyContent:"center",children:(0,r.jsx)(W.ZP,{item:!0,sx:{p:1,background:"#1f2a37",border:"2px s
1olid #1a4151",borderRadius:1,mt:2},children:(0,r.jsxs)(s.Z,{sx:{wordBreak:"break-word",color:"grey.400"},children:[o("account.followingTypesAreAccepted")," ",I.FN]})})}),(0,r.jsx)(l.Z,{justifyContent:"center",alignItems:"center",children:(0,r.jsx)(F.Z,{sx:{width:{xs:"100%",sm:"60%"},mt:3,mb:3},color:"inherit",size:"large",type:"button",variant:"header",onClick:_,loading:n,disabled:!y||S,children:o("accountManagement.verification.saveButton")})})]})]})},statusKey:"level_2"},{labelKey:"accountManagement.level3",component:e=>{let{userVerificationData:t,isLoadingUserVerification:n,refetch:a}=e,{t:o}=(0,i.i)(),[d,u]=(0,m.useState)({open:!1,message:"",severity:"info"}),[x,h]=(0,m.useState)((null==t?void 0:t.level_3.proofOfAddressType)||""),[p,g]=(0,m.useState)({proofOfAddressImage:{file:void 0,preview:B,isPDF:!1}}),f=(0,m.useMemo)(()=>(null==t?void 0:t.level_1.status)===2&&2===t.level_2.status,[null==t?void 0:t.level_1.status,null==t?void 0:t.level_2.status]),v=(0,m.useMemo)(()=>{let e=Number(null==t?void 0:t.level_3.status);return(0===e||3===e)&&f},[null==t?void 0:t.level_3.status,f]),b=(0,m.useMemo)(()=>""!==x&&p.proofOfAddressImage.preview!==B,[x,p.proofOfAddressImage.preview]),y=(0,m.useMemo)(()=>!v||!b||n,[v,b,n]),w=(0,m.useMemo)(()=>[{label:o("account.propertyCertificate"),key:"Property Certificate"},{label:o("account.waterBill"),key:"Water bill"},{label:o("account.electricityBill"),key:"Electricity bill"},{label:o("account.taxBill"),key:"Tax bill"},{label:o("account.other"),key:"Other"}],[o]),Z=(0,m.useCallback)(e=>t=>{if(t.length>0&&f){let n=t[0];g(t=>({...t,[e]:{file:void 0,preview:n.file_url,isPDF:"application/pdf"===n.mime_type}}))}},[f]),S=async()=>{if(f&&x&&p.proofOfAddressImage.preview){let n={proofOfAddressType:x,proofOfAddressImage:p.proofOfAddressImage.preview};try{await j.ZP.put("".concat("https://api.xyes.com/api/v1"+j.Hv.accountManagement.verifyThirdLevel),n),u({open:!0,message:o("accountManagement.verification.informationSavedSuccessfully"),severity:"success"}),g({proofOfAddressImage:{file:void 0,preview:B,isPDF:!1}}),h(""),a()}catch(n){var e,t;u({open:!0,message:"An error occurred: ".concat((null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||n.message),severity:"error"})}}};return(0,m.useEffect)(()=>{if(!n&&(null==t?void 0:t.level_3)){var e;g({proofOfAddressImage:{file:void 0,preview:null!==(e=t.level_3.proofOfAddressImage)&&void 0!==e?e:B,isPDF:String(t.level_3.proofOfAddressImage).endsWith(".pdf")}}),h(String(t.level_3.proofOfAddressType||""))}},[n,t]),(0,r.jsxs)(D.Z,{elevation:2,sx:{padding:2,textAlign:"left",borderRadius:{xs:0,sm:1}},children:[(0,r.jsx)(C.Z,{message:d.message,open:d.open,setOpen:e=>u(t=>({...t,open:e})),severity:d.severity}),(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(l.Z,{direction:"column",spacing:2,children:[(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,children:[(0,r.jsx)(s.Z,{component:"div",variant:"h2",gutterBottom:!0,children:o("account.verification")}),(0,r.jsx)(l.Z,{direction:"row",children:(0,r.jsx)(s.Z,{component:"div",sx:{color:(0,I.JU)(null==t?void 0:t.level_3.status).value},children:((null==t?void 0:t.level_3.status)===1||(null==t?void 0:t.level_3.status)===2)&&o((0,I.JU)(t.level_3.status).label)})})]}),(0,r.jsx)(s.Z,{component:"div",mb:2,color:"grey.400",variant:"body2",fontSize:"0.975rem",children:o("account.pleaseUploadYourProofAddress")})]}),!f&&(0,r.jsx)(R.Z,{message:o("accountManagement.verification.completeSecondLevel"),type:"warning"}),(0,r.jsx)(c.Z,{sx:{my:2},children:(0,r.jsx)(M.Z,{name:"proofOfAddressType",required:!0,labelText:o("account.proofOfAddressType"),placeholder:o("account.proofOfAddress"),options:w,disabled:!v,onChange:e=>{h(e.target.value)},value:x})}),(0,r.jsx)(c.Z,{sx:{filter:f?"none":"blur(4px)",pointerEvents:f?"auto":"none",transition:"filter 0.3s ease-in-out"},children:(0,r.jsx)(c.Z,{children:f&&v?(0,r.jsx)(P.b,{saveFilesURL:Z("proofOfAddressImage"),numfilesUploaded:p.proofOfAddressImage.file?1:0,module:"KYC",fileName:"level3_proofOfAddressImage",status:Number(null==t?void 0:t.level_3.status),id:"proofOfAddressImage",preview:p.proofOfAddressImage.preview,isPDF:p.proofOfAddressImage.isPDF}):(0,r.jsx)(N.Z,{isPDF:p.proofOfAddressImage.isPDF,preview:p.proofOfAddressImage.preview,status:Number(null==t?void 0:t.level_3.status),side:"proofOfAddressImage"})})}),(0,r.jsx)(W.ZP,{container:!0,component:"div",alignItems:"center",justifyContent:"center",children:(0,r.jsx)(W.ZP,{item:!0,sx:{p:1,background:"#1f2a37",border:"2px s
1olid #1a4151",borderRadius:1,mt:2},children:(0,r.jsxs)(s.Z,{sx:{wordBreak:"break-word",color:"grey.400"},children:[o("account.followingTypesAreAccepted")," ",I.FN]})})}),(0,r.jsx)(l.Z,{justifyContent:"center",alignItems:"center",children:(0,r.jsx)(F.Z,{sx:{width:{xs:"100%",sm:"60%"},mt:3,mb:3},color:"inherit",size:"large",type:"button",variant:"header",onClick:S,loading:n,disabled:y,children:o("accountManagement.verification.saveButton")})})]})]})},statusKey:"level_3"},{labelKey:"accountManagement.level4",component:e=>{let{userVerificationData:t,isLoadingUserVerification:n,refetch:a}=e,{t:o}=(0,i.i)(),[d,u]=(0,m.useState)({open:!1,message:"",severity:"info"}),[x,h]=(0,m.useState)((null==t?void 0:t.level_4.sourceOfFoundsType)||""),[p,g]=(0,m.useState)({sourceOfFoundsImage:{file:void 0,preview:U,isPDF:!1}}),f=(0,m.useMemo)(()=>(null==t?void 0:t.level_1.status)===2&&2===t.level_2.status&&2===t.level_3.status,[null==t?void 0:t.level_1.status,null==t?void 0:t.level_2.status,null==t?void 0:t.level_3.status]),v=(0,m.useMemo)(()=>{let e=Number(null==t?void 0:t.level_4.status);return(0===e||3===e)&&f},[null==t?void 0:t.level_4.status,f]),b=(0,m.useMemo)(()=>""!==x&&p.sourceOfFoundsImage.preview!==U,[x,p.sourceOfFoundsImage.preview]),y=(0,m.useMemo)(()=>!v||!b||n,[v,b,n]),w=(0,m.useMemo)(()=>[{label:o("account.payRoll"),key:"Pay Roll"},{label:o("account.taxBill"),key:"Tax bill"},{label:o("account.bankStatement"),key:"Bank statement"},{label:o("account.employerLetter"),key:"Employer letter"},{label:o("account.selfEmploymentIncomeCertificate"),key:"Self-employment income certificate"},{label:o("account.retirementPension"),key:"Retirement pension"},{label:o("account.other"),key:"Other"}],[o]),Z=(0,m.useCallback)(e=>t=>{if(t.length>0&&f){let n=t[0];g(t=>({...t,[e]:{file:void 0,preview:n.file_url,isPDF:"application/pdf"===n.mime_type}}))}},[f]),S=async()=>{if(f&&x&&p.sourceOfFoundsImage.preview){let n={sourceOfFoundsType:x,sourceOfFoundsImage:p.sourceOfFoundsImage.preview};try{await j.ZP.put("".concat("https://api.xyes.com/api/v1"+j.Hv.accountManagement.verifyFourthLevel),n),u({open:!0,message:o("accountManagement.verification.informationSavedSuccessfully"),severity:"success"}),g({sourceOfFoundsImage:{file:void 0,preview:U,isPDF:!1}}),h(""),a()}catch(n){var e,t;u({open:!0,message:"An error occurred: ".concat((null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||n.message),severity:"error"})}}};return(0,m.useEffect)(()=>{if(!n&&(null==t?void 0:t.level_4)){var e;g({sourceOfFoundsImage:{file:void 0,preview:null!==(e=t.level_4.sourceOfFoundsImage)&&void 0!==e?e:U,isPDF:String(t.level_4.sourceOfFoundsImage).endsWith(".pdf")}}),h(String(t.level_4.sourceOfFoundsType||""))}},[n,t]),(0,r.jsxs)(D.Z,{elevation:2,sx:{padding:2,textAlign:"left",borderRadius:{xs:0,sm:1}},children:[(0,r.jsx)(C.Z,{message:d.message,open:d.open,setOpen:e=>u(t=>({...t,open:e})),severity:d.severity}),(0,r.jsxs)(c.Z,{children:[(0,r.jsxs)(l.Z,{direction:"column",spacing:2,children:[(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,children:[(0,r.jsx)(s.Z,{component:"div",variant:"h2",gutterBottom:!0,children:o("account.verification")}),(0,r.jsx)(l.Z,{direction:"row",children:(0,r.jsx)(s.Z,{component:"div",sx:{color:(0,I.JU)(null==t?void 0:t.level_4.status).value},children:((null==t?void 0:t.level_4.status)===1||(null==t?void 0:t.level_4.status)===2)&&o((0,I.JU)(t.level_4.status).label)})})]}),(0,r.jsx)(s.Z,{component:"div",mb:2,color:"grey.400",variant:"body2",fontSize:"0.975rem",children:o("account.pleaseUploadSupportingDocumentation")})]}),!f&&(0,r.jsx)(R.Z,{message:o("accountManagement.verification.completeThirdLevel"),type:"warning"}),(0,r.jsx)(c.Z,{sx:{my:2},children:(0,r.jsx)(M.Z,{name:"sourceOfFoundsType",required:!0,labelText:o("account.sourceOfFundsType"),placeholder:o("account.sourceOfFunds"),options:w,disabled:!v,onChange:e=>{h(e.target.value)},value:x})}),(0,r.jsx)(c.Z,{sx:{filter:f?"none":"blur(4px)",pointerEvents:f?"auto":"none",transition:"filter 0.3s ease-in-out"},children:(0,r.jsx)(c.Z,{children:f&&v?(0,r.jsx)(P.b,{saveFilesURL:Z("sourceOfFoundsImage"),numfilesUploaded:p.sourceOfFoundsImage.file?1:0,module:"KYC",fileName:"level4_sourceOfFoundsImage",status:Number(null==t?void 0:t.level_4.status),id:"sourceOfFoundsImage",preview:p.sourceOfFoundsImage.preview,isPDF:p.sourceOfFoundsImage.isPDF}):(0,r.jsx)(N.Z,{isPDF:p.sourceOfFoundsImage.isPDF,preview:p.sourceOfFoundsImage.preview,status:Number(null==t?void 0:t.level_4.status),side:"sourceOfFoundsImage"})})}),(0,r.jsx)(W.ZP,{container:!0,component:"div",alignItems:"center",justifyContent:"center",children:(0,r.jsx)(W.ZP,{item:!0,sx:{p:1,background:"#1f2a37",border:"2px s
1olid #1a4151",borderRadius:1,mt:2},children:(0,r.jsxs)(s.Z,{sx:{wordBreak:"break-word",color:"grey.400"},children:[o("account.followingTypesAreAccepted")," ",I.FN]})})}),(0,r.jsx)(l.Z,{justifyContent:"center",alignItems:"center",children:(0,r.jsx)(F.Z,{sx:{width:{xs:"100%",sm:"60%"},mt:3,mb:3},color:"inherit",size:"large",type:"button",variant:"header",onClick:S,loading:n,disabled:y,children:o("accountManagement.verification.saveButton")})})]})]})},statusKey:"level_4"}];var X=()=>{let[e,t]=(0,m.useState)(0),n=(0,o.Z)(),{t:a}=(0,i.i)(),{data:s,isLoading:d,refetch:h}=(0,x.c)(),p=e=>{let t={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:16,height:16},n={position:"absolute",width:"80%",height:"80%",backgroundColor:"white",borderRadius:"50%"};return 2===e?(0,r.jsxs)(c.Z,{sx:t,children:[(0,r.jsx)(c.Z,{sx:n}),(0,r.jsx)(u.Z,{icon:"icon-park-solid:check-one",width:16,height:16,sx:{position:"relative",color:"#4CAF50"}})]}):3===e?(0,r.jsxs)(c.Z,{sx:t,children:[(0,r.jsx)(c.Z,{sx:n}),(0,r.jsx)(u.Z,{icon:"emojione-monotone:letter-x",width:16,height:16,sx:{position:"relative",color:"#F44336"}})]}):null};return(0,r.jsx)(l.Z,{direction:{xs:"column",md:"row"},spacing:1,alignItems:"flex-start",position:"relative",sx:{backgroundColor:"grey.800",p:0,borderRadius:1,flexGrow:1,flexBasis:"50%",maxWidth:"60%",[n.breakpoints.down("md")]:{flexBasis:"100%",maxWidth:"100%"}},children:(0,r.jsxs)(c.Z,{sx:{width:"100%"},children:[(0,r.jsx)(H,{value:e,onChange:(e,n)=>{t(n)},"aria-label":"information tabs",sx:{mb:5,mt:3,pl:2,pt:2},variant:"scrollable",scrollButtons:"auto",children:K.map((e,t)=>{var n,i;return(0,r.jsx)(V,{label:(0,r.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,r.jsx)("span",{children:a(e.labelKey)}),p(null!==(i=null==s?void 0:null===(n=s[e.statusKey])||void 0===n?void 0:n.status)&&void 0!==i?i:null)]})},t)})}),(0,r.jsx)(c.Z,{sx:{pl:{sm:2,md:2},pr:{sm:2,md:2},pb:2},children:K.map((t,n)=>(0,r.jsx)(G,{value:e,index:n,children:(0,r.jsx)(t.component,{userVerificationData:s,isLoadingUserVerification:d,refetch:h})},n))})]})})};function $(){return(0,r.jsx)(l.Z,{direction:"column",spacing:4,sx:{mt:1},children:(0,r.jsxs)(l.Z,{direction:{xs:"column-reverse",md:"row"},spacing:2,children:[(0,r.jsx)(d,{}),(0,r.jsx)(X,{})]})})}},42453:function(e,t,n){n.d(t,{Z:function(){return ed}});var r=n(57437),a=n(33145),i=n(66274),o=n(20418),l=n(43161),s=n(68834),c=n(2265),d=n(1899),u=n(46387),m=()=>(0,r.jsx)(d.Z,{sx:{py:3,textAlign:"center"},children:(0,r.jsx)(u.Z,{color:"text.secondary",sx:{fontSize:"0.8rem"},children:"Free bonuses will appear here"})}),x=n(43949),h=n(89011),p=n(67383),g=n(41680),f=n(14697),v=n(28389),b=n(96704),y=n(17925),j=n(30276);let w=()=>{var e,t,n,r,a,i,o,l,s;let c;let{authenticated:d}=(0,h.E)(),u=(0,f.t)({authenticated:d}),m=(0,v.y)({authenticated:d}),x=(0,j.Sn)({authenticated:d}),w=(0,j.C6)({authenticated:d}),Z=(0,j.tK)({authenticated:d}),C=(0,j.Ao)({authenticated:d}),S=(0,y._)({authenticated:d}),k=(0,b.W)({authenticated:d}),I=(0,j.Tr)({authenticated:d}),M=(0,g.J)({authenticated:d}),A=(0,p.y)({authenticated:d}),F=u.isLoading||m.isLoading||x.isLoading||w.isLoading||Z.isLoading||C.isLoading||S.isLoading||k.isLoading||I.isLoading||M.isLoading||A.isLoading,D=u.isError||m.isError||x.isError||w.isError||Z.isError||C.isError||S.isError||k.isError||I.isError||M.isError||A.isError;return{isActive:u.isActive,hasClaimableBonus:F?0:(c=0,(null===(t=m.data)||void 0===t?void 0:null===(e=t.data[0])||void 0===e?void 0:e.isClaimable)&&(c+=1),(null===(n=A.data)||void 0===n?void 0:n.data.isClaimable)&&(c+=1),(null===(r=w.data)||void 0===r?void 0:r.isClaimable)&&(c+=1),(null===(a=Z.data)||void 0===a?void 0:a.isClaimable)&&Z.data.isConditionMet&&(c+=1),(null===(i=x.data)||void 0===i?void 0:i.isClaimable)&&(c+=1),(null===(o=S.data)||void 0===o?void 0:o.isClaimable)&&(c+=1),(null===(l=k.data)||void 0===l?void 0:l.isClaimable)&&!k.data.claimed&&(c+=1),(null===(s=I.data)||void 0===s?void 0:s.isClaimable)&&(c+=1),c),memberRebate:m.data,weeklyRebate:x.data,monthlyBonus:w.data,birthdayBonus:Z.data,weeklyTournaments:C.data,weeklySports:S.data,weeklySportsFreebet:k.data,monthlyTournaments:I.data,welcomeBonus:M.data,vipLevelUp:A.data,isLoading:F,hasErrors:D,refetch:{memberRebate:m.refetch,weeklyRebate:x.refetch,monthlyBonus:w.refetch,birthdayBonus:Z.refetch,weeklyTournaments:C.refetch,weeklySports:S.refetch,weeklySportsFreebet:k.refetch,monthlyTournaments:I.refetch,welcomeBonus:M.refetch,vipLevelUp:A.refetch}}};var Z=n(68720),C=n(1798),S=n(60626),k=e=>{let{children:t}=e;return(0,r.jsx)(d.Z,{sx:{display:"flex",alignItems:"center",bgcolor:"grey.900",borderRadius:1,p:.75,minHeight:48},children:t})},I=n(31691),M=n(82156),A=e=>{let{isActive:t,data:n,refetch:a}=e,{t:i}=(0,x.$G)(),o=(0,I.Z)(),l=(0,M.Z)(o.breakpoints.down("sm")),s={labelsFontSize:"clamp(0.4rem, ".concat(l?"3vw":"1vw",", 0.7rem) !important")},c=(null==n?void 0:n.currentDepositAmount)||0,m=(null==n?void 0:n.bonusAmount)||0,h=(null==n?void 0:n.bonusSettingNo)||"",p=(null==n?void 0:n.isClaimable)||!1,g=(null==n?void 0:n.timer)||"",f=(null==n?void 0:n.amountOfDeposit)||0,v=(null==n?void 0:n.isSettlementPending)||!1;return(null==n?void 0:n.isBonusActive)===!1?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"mingcute:calendar-fill",width:24,height:24})}),(0,r.jsxs)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between",mr:2},children:[(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(i("bonus.monthlyBonus"))}),(0,r.jsx)(S.Z,{label:i("bonus.depositAmount"),currentValue:c,requiredValue:f,fontSize:s.labelsFontSize})]}),(0,r.jsx)(C.Z,{isSmall:!0,endDate:g,labelsFontSize:s.labelsFontSize,isClaimable:p,bonusAmount:m,bonusSettingNo:h,bonusValue:m,bonusData:n,refetch:a,isActive:t,isSettlementPending:v})]})},F=n(60033),D=n(68575),_=n(29827),T=n(55447),R=n(37373),N=n(19643),P=n(12713),W=n(44811),B=n(73053),L=e=>{let{isActive:t}=e,{t:n}=(0,F.i)(),a=(0,D.v9)(e=>e.user.data),[i,o]=(0,c.useState)(!1),l=(0,_.NL)(),[s,d]=(0,c.useState)(""),[u,m]=(0,c.useState)(!1),[x,h]=(0,c.useState)(""),[p,g]=(0,c.useState)({promotion_name:"",bonus_amount:"",currency:"",transfer_type:"",bonusSettingNo:"",_id:"",bonusTitle:"",isClaimable:!1}),[f,v]=(0,c.useState)(""),b=async()=>
1{if(o(!0),!s)return;let e=s.replace(/\s+/g,"");try{let t=await T.ZP.post(T.Hv.promotions.redeemBonusCode,{manual_promotion_code:e,locale:null==a?void 0:a.settings.language.toUpperCase()});g(t.data),v(""),h("success"),await l.invalidateQueries({queryKey:["getBonusCalendar"]})}catch(e){h("error"),v(e.error)}finally{m(!0),d(""),o(!1)}};return(0,r.jsxs)(N.Z,{direction:"row",alignItems:"center",spacing:1,sx:{border:"2px solid",borderRadius:1,borderColor:"#959DAB80",backgroundColor:"#0B1018",width:"100%",mx:"auto",overflow:"hidden"},children:[(0,r.jsx)(P.Z,{value:s,onChange:e=>{let t=e.target.value.replace(/\s+/g,"");/^[a-zA-Z0-9]*$/.test(t)&&t.length<=5&&d(t)},fullWidth:!0,placeholder:n("bonus.redeemBonusCodeHere"),sx:{"& .MuiOutlinedInput-root":{height:"40px",color:"grey.400",fontSize:"0.875rem",backgroundColor:"transparent","& fieldset":{border:"none"},"& input::placeholder":{fontWeight:"bold"}}},InputProps:{endAdornment:(0,r.jsx)(W.Z,{variant:"contained",color:"secondary",sx:{fontWeight:"600",fontSize:"0.675rem !important",color:"primary.main",borderRadius:"5px",backgroundColor:"#0072ff",lineHeight:1,"&.MuiButtonBase-root:hover":{boxShadow:"none"},"&.MuiButton-contained":{backgroundColor:"#2A334A",borderColor:"primary.main"},"&.Mui-disabled":{borderColor:"grey.600"}},onClick:b,disabled:5!==s.length||i,children:i?(0,r.jsx)(B.Z,{size:12}):n("bonus.redeem")})}}),(0,r.jsx)(R.J,{open:u,handleClose:()=>m(!1),isClaimable:p.isClaimable,type:x,promotion_name:p.promotion_name,bonus_amount:p.bonus_amount,currency:p.currency,transfer_type:p.transfer_type,error:f,bonus_id:p._id,bonus_setting_no:p.bonusSettingNo,bonusTitle:p.bonusTitle,isActive:t})]})},E=e=>{let{isActive:t,data:n,refetch:a}=e,{t:i}=(0,x.$G)(),o=(0,I.Z)(),l=(0,M.Z)(o.breakpoints.down("sm")),s=(null==n?void 0:n.timer)||"",c=null==n?void 0:n.isClaimable,m=(null==n?void 0:n.bonusSettingNo)||"",h=(null==n?void 0:n.bonusAmount)||0,p=(null==n?void 0:n.isSettlementPending)||!1;return(null==n?void 0:n.isBonusActive)===!1?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"mingcute:calendar-fill",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between"},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(i("bonus.weeklyBonus"))})}),(0,r.jsx)(C.Z,{isSmall:!0,endDate:s,labelsFontSize:"clamp(0.6rem, ".concat(l?"3vw":"1vw",", 0.9rem) !important"),isClaimable:c,bonusAmount:h,bonusSettingNo:m,bonusValue:h,bonusData:n,refetch:a,isActive:t,isSettlementPending:p})]})},O=n(82877),q=n(62511),z=n(5186),U=e=>{var t,n,a,i,o,l,s,m,h,p,g,f;let{data:v,refetch:b}=e,{t:y}=(0,x.$G)(),j=(0,I.Z)(),w=(0,D.v9)(e=>e.user.data),[,S]=(0,c.useState)(!1),M=null!==(s=null==v?void 0:v.isBonusActive)&&void 0!==s?s:null==v?void 0:null===(t=v.data)||void 0===t?void 0:t.isBonusActive,A=null!==(m=null==v?void 0:v.isClaimable)&&void 0!==m?m:null==v?void 0:null===(n=v.data)||void 0===n?void 0:n.isClaimable,F=null!==(h=null==v?void 0:v.bonusAmount)&&void 0!==h?h:null==v?void 0:null===(a=v.data)||void 0===a?void 0:a.bonusAmount,_=null!==(p=null==v?void 0:v.amount)&&void 0!==p?p:null==v?void 0:null===(i=v.data)||void 0===i?void 0:i.amount,T=null==w?void 0:w.levelInfo.percentageToNextLevel,{data:R}=(0,O.Xn)({currencyCode:"USD"});if(!v)return null;let N=(0,q.lj)({amount:_,currency:"USD",fiatCurrency:(null==w?void 0:w.settings.view_in_fiat_object.currency)||"",exchangeRates:R||{},shouldShow:(null==w?void 0:w.settings.view_in_fiat_object.to_show)||!1});return!1===M?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:j.palette.primary.main,icon:"mingcute:star-fill",width:24,height:24})}),(0,r.jsxs)(d.Z,{sx:{flexGrow:1,mr:2},children:[(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(y("bonus.lvlUpBonus"))}),(0,r.jsxs)(u.Z,{variant:"caption",sx:{fontSize:"0.6rem",color:"grey.400",mb:1,display:"block"},children:[y("bonus.yourNextLevelUpBonusIs"),": ",N]}),(0,r.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(z.Z,{variant:"determinate",value:T||0,sx:{flexGrow:1,height:4,borderRadius:2,backgroundColor:"grey.800","& .MuiLinearProgress-bar":{backgroundColor:"primary.main"}}}),(0,r.jsx)(u.Z,{variant:"caption",sx:{fontSize:"0.6rem",color:"grey.400"},children:"".concat(T||0,"%")}
1)]})]}),(0,r.jsx)(C.Z,{isSmall:!0,isClaimable:A,onButtonClick:()=>S(!0),bonusSettingNo:null!==(g=null==v?void 0:v.bonusSettingNo)&&void 0!==g?g:null==v?void 0:null===(o=v.data)||void 0===o?void 0:o.bonusSettingNo,bonusValue:Number(null!==(f=null==v?void 0:v.bonusValue)&&void 0!==f?f:null==v?void 0:null===(l=v.data)||void 0===l?void 0:l.bonusValue),bonusData:v,refetch:b,bonusAmount:F})]})},V=n(89051),H=e=>{var t;let{data:n}=e,{t:a}=(0,x.$G)(),o=(0,I.Z)(),[s,m]=(0,c.useState)(null),h=(0,i.tv)(),{getLink:p}=(0,l.m)();return((0,c.useEffect)(()=>{if(null==n?void 0:n.data.length){let e=[...n.data].sort((e,t)=>{let n=["first-deposit","second-deposit","third-deposit","fourth-deposit"];return n.indexOf(e.condition)-n.indexOf(t.condition)}).find(e=>!e.claimed);if(e){let t=e.condition.split("-").map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1)).join("");m(a("bonus.".concat(t)))}}},[n,a]),!1!==(null==n?void 0:null===(t=n.data[0])||void 0===t?void 0:t.isBonusActive)&&s)?(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"solar:gift-bold",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:s?"".concat(s," ").concat(a("bonus.bonus")):a("bonus.bonus")})}),(0,r.jsx)(W.Z,{size:"small",sx:{width:"100px !important",height:24,fontSize:"0.75rem !important",color:"white",px:1.5,py:.5,textTransform:"none","&:hover":{bgcolor:"primary.dark"}},onClick:()=>{h.push(p("?modal=wallet&tab=deposit"))},variant:"contained",color:"primary",children:(0,r.jsx)(V.Z,{title:s,placement:"top",arrow:!0,children:(0,r.jsx)(u.Z,{sx:{fontSize:"0.75rem !important",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:s})})})]}):null},G=n(45225),K=n(71764),X=e=>{var t,n;let{isActive:a,popover:i,data:o,refetch:l}=e,{t:s}=(0,x.$G)(),c=(0,I.Z)(),m=(0,M.Z)(c.breakpoints.down("sm")),h={labelsFontSize:"clamp(0.4rem, ".concat(m?"3vw":"1vw",", 0.7rem) !important")},p=(null==o?void 0:o.currentKycLevel)||0,g=(null==o?void 0:o.kycLevelRequired)||0,f=(null==o?void 0:o.timer)||"",v=(null==o?void 0:o.bonusSettingNo)||"",b=null===(t=null==o?void 0:o.isConditionMet)||void 0===t||t,y=null!==(n=null==o?void 0:o.isClaimable)&&void 0!==n&&n,j=(null==o?void 0:o.bonusAmount)||0,w=null==o?void 0:o.isBonusActive,C=!!(p&&g&&p>=g),S=!!g&&p>=g;return!1===w?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:c.palette.primary.main,icon:"mingcute:birthday-2-line",width:24,height:24})}),(0,r.jsxs)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between"},children:[(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(s("bonus.bonusBirthday"))}),(0,r.jsxs)(N.Z,{direction:"row",alignItems:"center",spacing:.5,children:[(0,r.jsx)(u.Z,{variant:"body1",color:"white",sx:{fontSize:h.labelsFontSize,flexShrink:0},children:"KYC (".concat(p," / ").concat(g,")")}),(0,r.jsx)(G.Z,{icon:S?"material-symbols:check-circle":"material-symbols:cancel",width:"clamp(14px, ".concat(m?"calc(2vw + 0.2rem)":"1.2vw",", 18px) !important"),height:"clamp(14px, ".concat(m?"calc(2vw + 0.2rem)":"1.2vw",", 18px) !important"),sx:{color:S?"#4CAF50":"#F44336",fontSize:"clamp(14px, ".concat(m?"4vw":"1.2vw",", 18px)")}})]})]}),(0,r.jsx)(K.R,{isSmall:!0,isActive:null!=a&&a,hasValidKYC:C,canClaim:!!(b&&y),isClaimable:!!y,timer:f,labelsFontSize:h.labelsFontSize,bonusSettingNo:v,birthdayBonusData:o,refetch:l||(()=>{}),bonusValue:j,popover:i,handleClose:()=>{i&&i.onClose()}})]})},$=e=>{var t,n,a,i,o;let{isActive:l,data:s,refetch:c}=e,{t:m}=(0,x.$G)(),h=(0,I.Z)(),p=(null==s?void 0:s.data)||[];return!1===(null===(t=p[0])||void 0===t?void 0:t.isBonusActive)?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:h.palette.primary.main,icon:"hugeicons:cashback",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(m("bonus.instantRebate"))})}),(0,r.jsx)(C.Z,{isSmall:!0,bonusType:"memberRebate",isClaimable:null===(n=p[0])||void 0===n?void 0:n.isClaimable,onButtonClick:()=>{},isActive:l,bonusSettingNo:null===(a=p[0])||void 0===a?void 0:a.bonusSettingNo,bonusValue:Number(null===(i=p[0])||void 0===i?void 0:i.bonusValue),bonusData:p,refetch:c,bonusAmount:Number(null===(o=p[0])||void 0===o?void 0:o.bonusValue)})]})},J=e=>{let{isActive:t,data:n,refetch:a}=e,{t:i}=(0,x.$G)(),o=(0,I.Z)(),l=(0,M.Z)(o.breakpoints.down("sm")),s=(null==n?void 0:n.timer)||"",c=(null==n?void 0:n.bonusSettingNo)||"",m=null==n?void 0:n.isClaimable,h=(null==n?void 0:n.isSettlementPending)||!1;return(null==n?void 0:n.isBonusActive)===!1?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"mingcute:trophy-fill",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between"},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(i("bonus.weeklyTournaments"))})}),(0,r.jsx)(C.Z,{isSmall:!0,endDate:s,labelsFontSize:"clamp(0.6rem, ".concat(l?"3vw":"1vw",", 0.9rem) !important"),isClaimable:m,bonusSettingNo:c,bonusData:n,refetch:a,isActive:t,isSettlementPending:h})]})},Y=e=>{let{isActive:t,data:n,refetch:a}=e,{t:i}=(0,x.$G)(),o=(0,I.Z)(),l=(0,M.Z)(o.breakpoints.down("sm")),s=(null==n?void 0:n.timer)||"",c=(null==n?void 0:n.bonusSettingNo)||"",m=null==n?void 0:n.isClaimable,h=(null==n?void 0:n.isSettlementPending)||!1;return(null==n?void 0:n.isBonusActive)===!1?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"mingcute:trophy-fill",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between"},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(i("bonus.monthlyTournaments"))})}),(0,r.jsx)(C.Z,{isSmall:!0,endDate:s,labelsFontSize:"clamp(0.6rem, ".concat(l?"3vw":"1vw",", 0.9rem) !important"),isClaimable:m,bonusSettingNo:c,bonusData:n,refetch:a,isActive:t,isSettlementPending:h})]})},Q=e=>{let{isActive:t,data:n,refetch:a}=e,{t:i}=(0,x.$G)(),o=(0,I.Z)(),l=(0,M.Z)(o.breakpoints.down("sm")),s=(null==n?void 0:n.timer)||"",c=(null==n?void 0:n.bonusSettingNo)||"",m=null==n?void 0:n.isClaimable,h=(null==n?void 0:n.isSettlementPending)||!1;return(null==n?void 0:n.isBonusActive)===!1?null:(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:o.palette.primary.main,icon:"mingcute:football-fill",width:24,height:24})}),(0,r.jsx)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between"},children:(0,r.jsx)(u.Z,{variant:"body2",sx:{fontSize:"0.75rem",mb:.1},children:"".concat(i("bonus.weeklySportsBonus"))})}),(0,r.jsx)(C.Z,{isSmall:!0,endDate:s,labelsFontSize:"clamp(0.6rem, ".concat(l?"3vw":"1vw",", 0.9rem) !important"),isClaimable:m,bonusSettingNo:c,bonusData:n,refetch:a,isActive:t,isSettlementPending:h})]})},ee=n(82700),et=n(61709),en=e=>{var t,n,a,o,s;let{isActive:c,data:m,refetch:h}=e,{t:p}=(0,x.$G)(),g=(0,i.tv)(),{getLink:f}=(0,l.m)(),v=(0,I.Z)(),y=(0,M.Z)(v.breakpoints.down("sm")),j="clamp(0.4rem, ".concat(y?"3vw":"1vw",", 0.7rem) !important");if((null==m?void 0:m.isBonusActive)===!1)return null;let w=null!==(t=null==m?void 0:m.currentDepositAmount)&&void 0!==t?t:"0",A=null!==(n=null==m?void 0:m.amountOfDeposit)&&void 0!==n?n:"0",F=Number(null!==(a=null==m?void 0:m.bonusAmount)&&void 0!==a?a:0),D=!!((null==m?void 0:m.isClaimable)&&!m.claimed),_=!!(m&&!m.isClaimable&&!m.claimed),T=!!(null==m?void 0:m.claimed),R=null!==(s=null!==(o=null==m?void 0:m.timer)&&void 0!==o?o:null==m?void 0:m.expiredTime)&&void 0!==s?s:void 0,N=(null==m?void 0:m.expiredBonus)||void 0,P=!!((null==m?void 0:m.claimed)&&("unused"===m.bonusStatus||!m.bonusStatus)&&N),B={width:"100px !important",height:24,fontSize:"0.75rem !important",color:"white",px:1.5,py:.5,textTransform:"none","&:hover":{bgcolor:"primary.dark"}},L=()=>{g.push(f(b.v))};return(0,r.jsxs)(k,{children:[(0,r.jsx)(d.Z,{sx:{mr:.75,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(Z.JO,{color:v.palette.primary.main,icon:"material-symbols:sports-score",width:24,height:24})}),(0,r.jsxs)(d.Z,{sx:{flexGrow:1,justifyContent:"space-between",mr:2,minWidth:0},children:[(0,r.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5,mb:.1,minWidth:0},children:[(0,r.jsx)(u.Z,{variant:"body2",noWrap:!0,sx:{fontSize:"0.75rem",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:p("bonus.sportsFreeBet")}),(0,r.jsx)(d.Z,{sx:{flexShrink:0,width:"auto"},children:(0,r.jsx)(ee.Z,{endDate:R,fontSize:j})})]}),(0,r.jsx)(S.Z,{label:p("bonus.depositAmount"),currentValue:w,requiredValue:A,fontSize:j}),(0,r.jsx)(et.Z,{data:m,fontSize:j,expiredBonusDate:P?N:void 0})]}),(()=>{if(T)return(0,r.jsx)(W.Z,{size:"small",variant:"contained",color:"primary",onClick:L,sx:B,children:(0,r.jsx)(V.Z,{title:p("actions.play"),placement:"top",arrow:!0,children:(0,r.jsx)(u.Z,{sx:{fontSize:"0.75rem !important",textOverflow:"ellipsis",overflow:"hidden",
1whiteSpace:"nowrap"},children:p("actions.play")})})});if(D){var e;return(0,r.jsx)(C.Z,{isSmall:!0,endDate:R,labelsFontSize:j,isActive:c,isClaimable:!0,bonusAmount:F,bonusSettingNo:null!==(e=null==m?void 0:m.bonusSettingNo)&&void 0!==e?e:void 0,bonusValue:F,bonusData:m,refetch:h,bonusType:"generalBonus",useClaimLabel:!0,redirectAfterClaim:b.v})}return _?(0,r.jsx)(W.Z,{size:"small",variant:"contained",color:"primary",onClick:()=>g.push(f("?modal=wallet&tab=deposit")),sx:B,children:(0,r.jsx)(V.Z,{title:p("bonus.deposit"),placement:"top",arrow:!0,children:(0,r.jsx)(u.Z,{sx:{fontSize:"0.75rem !important",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:p("bonus.deposit")})})}):(0,r.jsx)(C.Z,{isSmall:!0,endDate:R,labelsFontSize:j,isClaimable:!1,bonusAmount:F})})()]})},er=e=>{let{popover:t}=e,{t:n}=(0,x.$G)(),{getLink:a}=(0,l.m)(),o=(0,i.tv)(),{isActive:s,isLoading:c,memberRebate:d,weeklyRebate:u,monthlyBonus:m,birthdayBonus:h,weeklyTournaments:p,weeklySports:g,weeklySportsFreebet:f,monthlyTournaments:v,welcomeBonus:b,vipLevelUp:y,refetch:j}=w();return c?(0,r.jsxs)(N.Z,{spacing:.75,alignItems:"center",sx:{py:3},children:[(0,r.jsx)(B.Z,{size:24,color:"primary"}),(0,r.jsx)(W.Z,{variant:"contained",fullWidth:!0,onClick:()=>{t.onClose(),o.push(a("bonus"))},sx:{bgcolor:"primary.main","&:hover":{bgcolor:"primary.dark"},py:1,mt:1,fontSize:"0.8rem",fontWeight:600,color:"white"},children:n("bonus.bonusDashboard")})]}):(0,r.jsxs)(N.Z,{spacing:.75,children:[(0,r.jsx)(L,{isActive:s}),(0,r.jsx)($,{isActive:s,data:d,refetch:j.memberRebate}),(0,r.jsx)(H,{data:b}),(0,r.jsx)(U,{data:y,refetch:j.vipLevelUp}),(0,r.jsx)(A,{isActive:s,data:m,refetch:j.monthlyBonus}),(0,r.jsx)(X,{isActive:s,popover:t,data:h,refetch:j.birthdayBonus}),(0,r.jsx)(E,{isActive:s,data:u,refetch:j.weeklyRebate}),(0,r.jsx)(J,{isActive:s,data:p,refetch:j.weeklyTournaments}),(0,r.jsx)(Q,{isActive:s,data:g,refetch:j.weeklySports}),(0,r.jsx)(en,{isActive:s,data:f,refetch:j.weeklySportsFreebet}),(0,r.jsx)(Y,{isActive:s,data:v,refetch:j.monthlyTournaments}),(0,r.jsx)(W.Z,{variant:"contained",fullWidth:!0,onClick:()=>{t.onClose(),o.push(a("bonus"))},sx:{bgcolor:"primary.main","&:hover":{bgcolor:"primary.dark"},py:1,mt:1,fontSize:"0.8rem",fontWeight:600,color:"white"},children:n("bonus.bonusDashboard")})]})},ea=n(73904),ei=n(10207),eo=e=>{let{popover:t}=e,[n,a]=c.useState(0);return(0,r.jsxs)(d.Z,{children:[(0,r.jsxs)(ea.Z,{value:n,onChange:(e,t)=>
1{a(t)},allowScrollButtonsMobile:!1,scrollButtons:!1,sx:{mb:1,"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{border:"1px solid",borderColor:"grey.800",borderRadius:1,mx:.25,minHeight:28,fontSize:"0.7rem",fontWeight:500,py:.5,color:"grey.400","&.Mui-selected":{borderColor:"primary.main",color:"primary.main"}}},children:[(0,r.jsx)(ei.Z,{label:"Common",sx:{width:"50%"}}),(0,r.jsx)(ei.Z,{label:"Free",sx:{width:"50%"}})]}),0===n&&(0,r.jsx)(er,{popover:t}),1===n&&(0,r.jsx)(m,{})]})},el=n(16210),es=n(59708),ec=n(97312);function ed(){let e=(0,s.Sv)(),{authenticated:t}=(0,o.E)(),n=(0,i.tv)(),{getLink:c}=(0,l.m)(),d=(0,I.Z)(),u=(0,M.Z)(d.breakpoints.down("md")),{hasClaimableBonus:m}=w(),x=(0,el.ZP)(es.Z)(()=>({"& .MuiBadge-badge":{right:6,top:8,padding:"0 4px",minWidth:"15px",height:"15px"}}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W.Z,{size:"small","aria-label":"Check your bonus",variant:"headerTerciary",component:ec.Z,onClick:r=>{t?e.onOpen(r):n.push(c("?modal=auth&tab=1"))},sx:{minWidth:"40px !important",width:"40px !important",padding:"0px !important",background:"transparent !important","&:hover":{background:"transparent !important"},boxShadow:"none !important"},children:(0,r.jsx)(x,{badgeContent:0===m?"":m,invisible:!t,sx:{"& .MuiBadge-badge":{backgroundColor:"#f00"}},children:(0,r.jsx)(a.default,{alt:"Chest bonus",height:u?36:40,width:u?36:40,src:"".concat("https://img.xyes.com/","assets/icons/header/bonus_chest.gif")})})}),(0,r.jsx)(s.ZP,{blur:!0,open:e.open,onClose:e.onClose,sx:{width:400,p:2,left:{xs:"2% !important",md:"25% !important"}},children:(0,r.jsx)(eo,{popover:e})})]})}},6317:function(e,t,n){n.d(t,{Z:function(){return v}});var r=n(57437),a=n(27648),i=n(68651),o=n(60033),l=n(76975),s=n(20418),c=n(48116),d=n(57099),u=n(41680),m=n(31691),x=n(82156),h=n(1899),p=n(44811),g=n(19643),f=n(46387);function v(e){var t,n;let{depositAmount:v,currency:b}=e,{authenticated:y}=(0,s.E)(),{data:j}=(0,u.J)({authenticated:y}),w=(0,m.Z)(),{t:Z}=(0,o.i)(),C=(0,x.Z)(w.breakpoints.down("sm")),S=["first-deposit","second-deposit","third-deposit","fourth-deposit"],k=null==j?void 0:null===(n=j.data)||void 0===n?void 0:null===(t=n.sort((e,t)=>S.indexOf(e.condition)-S.indexOf(t.condition)))||void 0===t?void 0:t.find(e=>
1!e.claimed),I=v&&new i.Z(v).gt(0),M=I&&k?((e,t,n)=>{let r=new i.Z(e||0),a=new i.Z(t||0);return r.lte(0)||a.lte(0)?new i.Z(0):"percentage"===n?r.multipliedBy(a).dividedBy(100):a})(v,k.bonusValue,k.valueType):new i.Z(0),A=I&&M.gt(0);return(0,r.jsx)(h.Z,{children:k&&(0,r.jsxs)(p.Z,{LinkComponent:a.default,"data-test":"open-wallet-modal-button",variant:"header",size:"small",fullWidth:!0,sx:[{backgroundColor:"#212734","&:hover":{backgroundColor:"#212734 !important"}},{mb:1,borderWidth:0,boxShadow:0,"&:hover":{boxShadow:0}},{height:0!==A&&v?"50px":"auto"}],children:[(0,r.jsx)(l.Z,{icon:"solar:gift-outline",sx:{color:w.palette.primary.main,height:20,width:20}}),(0,r.jsxs)(g.Z,{direction:C?"column":"row",alignItems:"center",gap:C?0:2,p:1,children:[(0,r.jsx)(f.Z,{variant:"h6",noWrap:!0,sx:{fontWeight:"light",color:w.palette.primary.main},children:"".concat(Z("wallet.enjoyUpTo")," ").concat(k.bonusValue).concat("percentage"===k.valueType?"%":""," ").concat(Z("wallet.bonusDeposit"))}),0!==A&&v&&(0,r.jsx)(f.Z,{variant:"h6",sx:{color:w.palette.primary.main},children:Z("wallet.bonusCalculation",{deposit:v,bonus:(0,c.dN)(Number(M),b||"USD"),currency:(0,d.jK)(b)||"USD"})})]})]})})}},89002:function(e,t,n){var r=n(57437),a=n(68651),i=n(60033),o=n(76975),l=n(2265),s=n(48116),c=n(29827),d=n(55447),u=n(92205),m=n(89011),x=n(36067),h=n(1899),p=n(46387),g=n(44811),f=n(61622);t.Z=e=>{var t;let n;let{day:v,dayName:b,isToday:y,bonusData:j,isCalendar:w,styles:Z}=e,{t:C}=(0,i.i)(),S=(0,c.NL)(),{fetchBalance:k}=(0,m.E)(),{showMessage:I}=(0,x.useSnackbar)(),[M,A]=(0,l.useState)(!1),[F,D]=(0,l.useState)(),_=new Date,T=null==j?void 0:j.claimAttempts.find(e=>_<new Date(e.availableTime)),{timeRemaining:R,timerRunOut:N}=(0,u.U)(new Date(null==T?void 0:T.availableTime)),P=new Date(Date.UTC(null==j?void 0:j.bonusDay.year,(null!==(t=null==j?void 0:j.bonusDay.month)&&void 0!==t?t:1)-1,null==j?void 0:j.bonusDay.day)),W=16>_.getUTCHours()?_.getTime()<P.getTime():_.getTime()<P.getTime()-864e5,[B,L]=(0,l.useState)(!1),[E,O]=(0,l.useState)(!1),[q,z]=(0,l.useState)(!1);(0,l.useEffect)(()=>{L(null==j?void 0:j.claimAttempts.reduce((e,t)=>t.expired,!1)),O(null==j?void 0:j.claimAttempts.reduce((e,t)=>t.claimed,!1)),z(null==j?void 0:j.claimAttempts.reduce((e,t)=>!1===e?t.claimable:e,!1))},[j]);let U=()=>A(!1),V=async()=>{if(!F)return;let e={calendarBonusId:j._id,currency:F.symbol,day:j.day,coinId:"coinId"in F?F.coinId.toString():F.fiatId.toString(),currencyType:"type"in F?F.type:void 0};try{await d.ZP.post(d.Hv.promotions.claimPerDay,e),await S.invalidateQueries({queryKey:["getBonusCalendar"]}),k(),I("Bonus claimed successfully","success")}catch(e){I("Error claiming bonus","error")}finally{U()}};return(0,r.jsxs)(h.Z,{sx:{border:"1px solid ".concat(y?"#0072FF":"#4b5262"),mb:w?1:0,borderRadius:1,bgcolor:y?"linear-gradient(180deg, #1F2A3733 20%, #0072FF33 20%)":"#111928",width:w?"100%":"135px",height:"auto",...Z},children:[(0,r.jsxs)(h.Z,{sx:{textAlign:"center",display:"flex",flexDirection:"row",justifyContent:"space-between",bgcolor:y?"#0072FF":"#374151",width:"100%",height:"auto",aspectRatio:"10/2",paddingY:"1px",paddingX:"4px",borderRadius:"7px 7px 0px 0px"},children:[(0,r.jsx)(p.Z,{fontWeight:"bold",color:"white",sx:{fontSize:w?"clamp(12px, 0.5vw, 14px) !important":"14px  !important"},children:v}),(0,r.jsx)(p.Z,{fontWeight:"bold",color:"white",sx:{fontSize:w?"clamp(12px, 0.5vw, 14px) !important":"14px  !important"},children:y?"Today":b})]}),(0,r.jsx)(h.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",height:"auto",aspectRatio:"10/8"},children:j?(null==j?void 0:j.claimAttempts)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",aspectRatio:"10/2",width:"100%"},children:(0,r.jsxs)(p.Z,{sx:{textAlign:"center",fontSize:w?"12px !important":"13px !important"},children:[(0,r.jsx)("strong",{style:{color:"green"},children:(0,s.dN)(Number(new a.Z(j.totalClaimed).toString()),"fiat/")})," ","/ $",(0,s.dN)(Number(new a.Z(j.totalAmount).toString()),"fiat/")]})}),(0,r.jsx)(h.Z,{sx:{bgcolor:"#374151",px:"4px !important",borderRadius:1,boxShadow:" 0px 2px 1px 1px rgba(0,0,0,0.6)",mb:"2px",alignItems:"center",justifyContent:"center",display:"flex",aspectRatio:"10/3"},children:j.claimAttempts.map((e,t)=>{let n="ic:outline-watch-later",a="white";return e.claimed||!e.claimable||e.expired?e.claimed?(n="humbleicons:check-circle",a="#22c55e"):e.expired&&(n="humbleicons:times-circle",a="#ff0000"):(n="humbleicons:currency-dollar-circle",a="#ff7901"),(0,r.jsx)(o.Z,{width:w?"24px !important":"26px !important",height:"auto",icon:n,color:a},t)})}),(0,r.jsx)(h.Z,{sx:{justifyContent:"center",alignItems:"center",display:"flex",mt:"2px",aspectRatio:"10/3"},children:(0,r.jsx)(g.Z,{variant:"contained",disabled:!q||j.totalClaimed>=j.totalAmount,onClick:()=>
1A(!0),sx:{display:W||E||B?"none":"block",bgcolor:"#ff7901",width:"100% !important",minWidth:"100px !important",py:w?"2px !important":"4px",px:w?"2px !important":"4px",size:"small",color:"white",fontSize:w?"12px !important":"14px !important",justifyContent:"center",alignItems:"center",textAlign:"center",textJustify:"center","&:hover":{bgcolor:"#ff8a1f"},"&.Mui-disabled":{bgcolor:q||E||N?"#ff790180":"#6b728080",color:q||E||N?"rgba(255, 255, 255, 0.5)":"white"}},children:(n=R,(q||N)&&(n=C("bonus.claim")),n)})})]}):null:(0,r.jsx)(p.Z,{color:"white",sx:{fontSize:w?"clamp(12px, 0.5vw, 14px) !important":"14px  !important"},children:"No Bonuses"})}),(0,r.jsx)(f.Z,{open:M,onClose:U,handleClaim:V,setSelectedCurrency:D,selectedCurrency:F,bonusData:j})]})}},61622:function(e,t,n){n.d(t,{Z:function(){return M}});var r=n(57437),a=n(33145),i=n(68651),o=n(68720),l=n(68575),s=n(2265),c=n(78948),d=n(76975),u=n(38954),m=n(43949),x=n(48116),h=n(89011),p=n(3801),g=n(47101),f=n(66393),v=n(82877),b=n(58004),y=n(1899),j=n(46387),w=n(33833),Z=n(50290),C=n(44811),S=n(73053),k=n(1869);let I=e=>e&&Array.isArray(e)?e.reduce((e,t)=>!t.claimable||t.claimed||t.expired?e:e+(t.claimableAmount||0),0):0;function M(e){let{open:t,onClose:n,handleClaim:M,setSelectedCurrency:A,selectedCurrency:F,bonusData:D,totalUnclaimedAmount:_,title:T,currency:R="USD",redeemingCode:N=!1}=e,[P,W]=(0,s.useState)(""),{data:B}=(0,f.s)(""),{authenticated:L}=(0,h.E)(),E=(0,l.v9)(e=>e.user.data),O=(0,l.v9)(e=>e.userBalance),{data:q}=(0,p.r)({authenticated:L}),[z,U]=(0,s.useState)(""),{data:V}=(0,g.i)({authenticated:L,userId:(null==E?void 0:E._id)||""}),{t:H}=(0,m.$G)(),[G,K]=(0,s.useState)(0),[X,$]=(0,s.useState)([]),{data:J}=(0,v.SG)({all:!0}),[Y,Q]=(0,s.useState)(""),{data:ee}=(0,v.Xn)({currencyCode:"USD"}),[et,en]=(0,s.useState)(""),[er,ea]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{K(I(null==D?void 0:D.claimAttempts))},[D]),(0,s.useEffect)(()=>{if(J){var e,t;let n=(null===(e=J.data.fiats.find(e=>e.symbol===R))||void 0===e?void 0:e.logoUrl)||(null===(t=J.data.cryptos.find(e=>e.symbol===R))||void 0===t?void 0:t.logoUrl);Q(null!=n?n:"https://img.xyes.com/uploads/Logotipo_Mobile_5c87dbd4a9.svg")}},[J,R]),(0,s.useEffect)(()=>{if(!(null==q?void 0:q.data)||!(null==B?void 0:B.data)||!(null==V?void 0:V.data))return;let e=q.data.cryptos.map(e=>e),t=q.data.fiats.map(e=>e);$((0,k.re)(B,{message:"success",data:{cryptos:e,fiats:t}}).map(e=>{var t,n;let r=null===(t=O.crypto)||void 0===t?void 0:t.find(t=>t.symbol===e.symbol),a=null===(n=O.fiat)||void 0===n?void 0:n.find(t=>t.symbol===e.symbol),i=r||a;return{...e,amount:(null==i?void 0:i.amount)||"0",type:r?"crypto":"fiat"}}))},[q,B,O.crypto,O.fiat,V]),(0,s.useEffect)(()=>{if(X.length>0){if(E){let e=X.find(e=>e.symbol===E.lastBonusCurrency);e?A(e):A(X[0])}else A(X[0])}},[X,A,E]),(0,s.useEffect)(()=>{var e;W(null!==(e=null==E?void 0:E.levelInfo.icon)&&void 0!==e?e:"")},[E]),(0,s.useEffect)(()=>{F&&ee&&(U(ee[F.symbol]||"0"),en(ee[F.symbol&&"XCD"!==F.symbol?F.symbol:"XCD"]||"0"))},[ee,F]),!F)return null;let ei=0;D?ei=D.totalAmount:_&&(ei=_);let eo=e=>{let t=X.find(t=>t.symbol===e);t&&A(t)},el=async()=>{ea(!0);try{await M()}catch(e){}finally{ea(!1)}};return(0,r.jsx)(b.Z,{open:t,onClose:n,"aria-labelledby":"claim-calendar-modal","aria-describedby":"claim-calendar-bonus-modal",children:(0,r.jsxs)(y.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"#111928",borderRadius:2,p:3,boxShadow:c.y0.boxShadow,width:"98%",maxWidth:"580px"},children:[(0,r.jsx)(y.Z,{component:"span",onClick:n,sx:{cursor:"pointer",lineHeight:1,position:"absolute",top:8,right:8},children:(0,r.jsx)(d.Z,{icon:"lucide:circle-x",color:"text.secondary"})}),(0,r.jsxs)(j.Z,{variant:"h2",component:"h2",mb:3,children:[(0,r.jsx)(a.default,{alt:"svip",src:"".concat("https://img.xyes.com/","assets/icons/logos/xyes-favicon-dark-mode.svg"),width:24,height:24,style:{marginRight:"8px"}}),H(N?"bonus.bonus":"bonus.calendarBonus")]}),T&&(0,r.jsx)(j.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,mb:2,children:T}),!N&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y.Z,{display:"flex",alignItems:"center",gap:2,mb:3,children:[(0,r.jsx)(a.default,{src:P,alt:"VIP Level Icon",width:48,height:48}),(0,r.jsx)(j.Z,{color:"grey.500",fontWeight:"bold",children:H("bonus.vipLevel")}),(0,r.jsx)(j.Z,{color:"secondary.main",fontWeight:"bold",children:null==E?void 0:E.levelInfo.currentLevel})]}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.Z,{variant:"body2",color:"grey.500",mb:1,children:H("bonus.instructions.chooseCurrency",{currency:"USD"})}),(0,r.jsx)(j.Z,{variant:"body2",color:"grey.500",mb:1,children:H("bonus.instructions.clickClaim")})]})]}),(0,r.jsxs)(y.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,r.jsxs)(y.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pb:{xs:"30px"}},children:[(0,r.jsx)(y.Z,{sx:{display:"flex",alignItems:"center",height:"34px",width:"110px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)"},children:(0,r.jsxs)(j.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)(u.Z,{alt:"currency",width:20,src:Y,style:{marginRight:"8px"}})," ",R]})}),(0,r.jsxs)(j.Z,{variant:"h4",children:[_?(0,x.dN)(Number(new i.Z(_).toString()),"fiat/"):(0,x.dN)(Number(new i.Z(G).toString()),"fiat/")," ".concat(R)]})]}),(0,r.jsx)(y.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center",my:.5},children:(0,r.jsxs)(y.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-25px",border:"6px solid #111928"},children:[(0,r.jsx)(o.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20}),(0,r.jsx)(o.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20})]})}),(0,r.jsxs)(y.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pt:{xs:"30px"}},children:[(0,r.jsx)(w.Z,{value:F.symbol,onChange:e=>
1eo(e.target.value),variant:"standard",sx:{display:"flex",alignItems:"center",height:"34px",width:"200px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)","& .MuiSelect-select:focus":{bgcolor:"transparent"},"&:before":{display:"none"},"&:after":{display:"none"}},children:X.map(e=>(0,r.jsx)(Z.Z,{value:e.symbol,sx:{display:"flex",alignItems:"center"},children:(0,r.jsxs)(j.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(u.Z,{alt:"currency",width:"crypto"===e.type?20:25,src:e.logoUrl,borderRadius:.1}),e.symbol," - ",Number(e.amount).toFixed(2)]})},e.symbol))}),(0,r.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,r.jsx)(j.Z,{color:"grey.400",variant:"caption",children:H("bonus.currency")}),(0,r.jsx)(j.Z,{variant:"h4",align:"right",children:"".concat((0,x.dN)(((e,t,n)=>{let r=new i.Z(t).dividedBy(new i.Z(n)).multipliedBy(new i.Z(et)),a=new i.Z(e.replace("%",""));return r.multipliedBy(a).dividedBy(100).toNumber()})("100",Number(N?ei:G),ee?ee[R]:"1"),"crypto"===F.type?"crypto/":"fiat/")," ").concat(F.symbol)})]})]})]}),(0,r.jsxs)(j.Z,{variant:"caption",color:"grey.500",align:"right",display:"block",sx:{mt:1,mb:2},children:["1 USD ≈ ",(0,x.dN)(Number(z),"crypto/")," ",F.symbol]}),(0,r.jsx)(C.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:el,disabled:er,children:er?(0,r.jsx)(S.Z,{size:20}):H("bonus.claimNow")})]})})}},71764:function(e,t,n){n.d(t,{R:function(){return m}});var r=n(57437),a=n(66274),i=n(43949),o=n(43161),l=n(1798),s=n(89051),c=n(44811),d=n(46387);let u=e=>{let{buttonText:t,labelsFontSize:n,disabled:a,href:o,onClick:l,isSmall:u,popover:m,handleClose:x}=e,{t:h}=(0,i.$G)();return u?(0,r.jsx)(s.Z,{title:h("bonus.kycRequired"),placement:"top",children:(0,r.jsx)(c.Z,{variant:"contained",color:"primary",disabled:a,href:o,size:"small",onClick:()=>{m&&m.onClose(),x&&x(),l&&l()},sx:{height:24,width:"100px !important",fontSize:"0.75rem !important",color:"white",px:1.5,py:.5,textTransform:"none",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","&:hover":{bgcolor:"primary.dark"}},children:(0,r.jsx)(d.Z,{sx:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:t})})}):(0,r.jsx)(c.Z,{variant:"contained",color:"primary",disabled:a,href:o,onClick:l,sx:{fontWeight:"bold",color:"white",borderRadius:"5px",width:"100%",maxWidth:"150px",mt:1,fontSize:n},children:t})},m=e=>{let{hasValidKYC:t,canClaim:n,isClaimable:s,timer:c,labelsFontSize:d,bonusSettingNo:m,birthdayBonusData:x,refetch:h,isActive:p,bonusValue:g,isSmall:f,popover:v,handleClose:b}=e,{t:y}=(0,i.$G)(),j=(0,a.tv)(),{getLink:w}=(0,o.m)();return t?s?n?(0,r.jsx)(l.Z,{isSmall:f,endDate:c,labelsFontSize:d,isClaimable:s,bonusAmount:g,bonusSettingNo:m,bonusValue:g,bonusData:x,refetch:h,isActive:p}):(0,r.jsx)(l.Z,{isSmall:f,endDate:c,labelsFontSize:d,isClaimable:s,bonusAmount:g,bonusSettingNo:x.bonusSettingNo,bonusValue:g,bonusData:x,refetch:h,isActive:p}):(0,r.jsx)(l.Z,{isSmall:f,endDate:c,labelsFontSize:d,isClaimable:s,bonusSettingNo:m,isActive:p,disabled:!0}):(0,r.jsx)(u,{isSmall:f,buttonText:y("bonus.kycRequired"),labelsFontSize:d,disabled:!1,popover:v,handleClose:b,onClick:()=>{setTimeout(()=>{j.push(w("/account-management/verification/"))},100)}})}},1798:function(e,t,n){var r=n(57437),a=n(68575),i=n(2265),o=n(43949),l=n(82877),s=n(67972),c=n(62511),d=n(44811),u=n(89051),m=n(46387);t.Z=e=>{let{endDate:t,onTimerEnd:n,labelsFontSize:x="0.8rem",onButtonClick:h,isClaimable:p=!1,isActive:g,bonusSettingNo:f,bonusValue:v,bonusData:b,refetch:y,disabled:j,bonusAmount:w,isSettlementPending:Z,isSmall:C,bonusType:S,useClaimLabel:k,redirectAfterClaim:I}=e,{t:M}=(0,o.$G)(),[A,F]=(0,i.useState)("00:00:00"),[D,_]=(0,i.useState)(!1),[T,R]=(0,i.useState)(!0),N=(0,a.v9)(e=>e.user.data),{data:P}=(0,l.Xn)({currencyCode:"USD"}),W=(0,c.lj)({amount:Number(w||0),currency:"USD",fiatCurrency:(null==N?void 0:N.settings.view_in_fiat_object.currency)||"",exchangeRates:P||{}
1,shouldShow:(null==N?void 0:N.settings.view_in_fiat_object.to_show)||!1}),B=null!=t&&""!==t;(0,i.useEffect)(()=>{if(!B)return;let e=e=>!Number.isNaN(new Date(e).getTime()),r=()=>{if(t&&e(t))return new Date(t);R(!1);let n=new Date;return n.setHours(n.getHours()+24),n},a=()=>{try{let e=r(),t=new Date,a=e.getTime()-t.getTime();if(a<=0){F("00:00:00"),n&&n();return}let i=Math.floor(a/864e5),o=Math.floor(a%864e5/36e5),l=Math.floor(a%36e5/6e4),s=Math.floor(a%6e4/1e3),c="";c=i>0?"".concat(i,"d ").concat(o.toString().padStart(2,"0"),":").concat(l.toString().padStart(2,"0"),":").concat(s.toString().padStart(2,"0")):"".concat(o.toString().padStart(2,"0"),":").concat(l.toString().padStart(2,"0"),":").concat(s.toString().padStart(2,"0")),F(c)}catch(e){F("00:00:00")}};a();let i=setInterval(a,1e3);return()=>clearInterval(i)},[t,n,B]);let L=()=>{p&&(f?_(!0):h&&h())},E=()=>{_(!1)},O=()=>B?T?A:M("bonus.notEligibleForBonus"):W,q="".concat(M("bonus.processing"),"..."),z=()=>Z?q:p&&k?M("bonus.claim"):p?W:O();return(0,r.jsxs)(r.Fragment,{children:[C?(0,r.jsx)(d.Z,{size:"small",sx:{width:"100px !important",height:24,fontSize:"0.75rem !important",color:"white",px:1.5,py:.5,textTransform:"none","&:hover":{bgcolor:"primary.dark"}},onClick:L,disabled:!p||j||Z,variant:"contained",color:"primary",children:(0,r.jsx)(u.Z,{title:z(),placement:"top",arrow:!0,children:(0,r.jsx)(m.Z,{sx:{fontSize:"0.75rem !important",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},children:z()})})}):(0,r.jsx)(d.Z,{variant:"contained",color:"primary",sx:{fontWeight:"bold",color:"white",borderRadius:"5px",width:"100%",maxWidth:"150px",mt:1,fontSize:x},onClick:L,disabled:!p||j||Z,children:z()}),f&&(0,r.jsx)(s.A,{title:M("bonus.claimYourEarnings"),showModal:D,type:"modalBonusClaim",handleModal:E,hasIcon:!0,modalProps:{refetch:y,bonusData:b,bonusSettingNo:f,setIsModalOpen:E,claimAmount:v||0,isClaimable:p,isActive:g,bonusType:S,redirectAfterClaim:I}})]})}},60626:function(e,t,n){var r=n(57437),a=n(68575),i=n(76975),o=n(82877),l=n(62511),s=n(31691),c=n(82156),d=n(1899),u=n(46387),m=n(19643);t.Z=e=>{let{label:t,currentValue:n,requiredValue:x,fontSize:h,valueColor:p="white",valueFontWeight:g="normal",showStatus:f=!0}=e,v=Number(n)>=Number(x),b=(0,s.Z)(),y=(0,c.Z)(b.breakpoints.down("sm")),j=(0,a.v9)(e=>e.user.data),{data:w}=(0,o.Xn)({currencyCode:"USD"}),Z={currency:"USD",fiatCurrency:(null==j?void 0:j.settings.view_in_fiat_object.currency)||"",exchangeRates:w||{},shouldShow:(null==j?void 0:j.settings.view_in_fiat_object.to_show)||!1},C=(0,l.lj)({amount:Number(n),...Z}),S=(0,l.lj)({amount:Number(x),...Z});return(0,r.jsxs)(d.Z,{justifyContent:"space-between",sx:{display:"flex",flexDirection:"row",gap:1,mt:.25,alignItems:"center"},children:[t&&(0,r.jsx)(u.Z,{variant:"body2",color:"text.secondary",noWrap:!0,sx:{color:"grey.400",fontSize:h,lineHeight:1.4,flexShrink:1},children:t}),(0,r.jsxs)(m.Z,{direction:"row",alignItems:"center",spacing:.5,children:[(0,r.jsx)(u.Z,{variant:"body1",color:p,fontWeight:g,sx:{fontSize:h,flexShrink:0},children:f?"".concat(C," / ").concat(S):C}),f&&(0,r.jsx)(i.Z,{icon:v?"material-symbols:check-circle":"material-symbols:cancel",width:"clamp(14px, ".concat(y?"calc(2vw + 0.2rem)":"1.2vw",", 18px) !important"),height:"clamp(14px, ".concat(y?"calc(2vw + 0.2rem)":"1.2vw",", 18px) !important"),sx:{color:v?b.palette.success.light:b.palette.error.dark,fontSize:"clamp(14px, 4vw, 18px)"}})]})]})}},82700:function(e,t,n){var r=n(57437),a=n(2265),i=n(45225),o=n(19643),l=n(46387);let s=e=>{let t=new Date(e);if(Number.isNaN(t.getTime()))return"00:00:00";let n=t.getTime()-Date.now();if(n<=0)return"00:00:00";let r=Math.floor(n/864e5),a="".concat(Math.floor(n%864e5/36e5).toString().padStart(2,"0"),":").concat(Math.floor(n%36e5/6e4).toString().padStart(2,"0"),":").concat(Math.floor(n%6e4/1e3).toString().padStart(2,"0"));return r>0?"".concat(r,"d ").concat(a):a};t.Z=e=>{let{endDate:t,fontSize:n="0.7rem",label:c}=e,[d,u]=(0,a.useState)("00:00:00");return((0,a.useEffect)(()=>{if(!t)return;let e=()=>{u(s(t))};e();let n=setInterval(e,1e3);return()=>clearInterval(n)},[t]),t)?(0,r.jsxs)(o.Z,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.35,sx:{flexShrink:0,width:"100%",mb:.25},title:c?"".concat(c," ").concat(d):d,children:[(0,r.jsx)(i.Z,{icon:"mdi:clock-outline",width:12,height:12,sx:{color:"grey.400"}}),c&&(0,r.jsx)(l.Z,{variant:"body2",noWrap:!0,sx:{color:"grey.500",fontSize:n,lineHeight:1.2,display:{xs:"none",sm:"block"}},children:c}),(0,r.jsx)(l.Z,{variant:"body2",noWrap:!0,sx:{color:"grey.300",fontSize:n,fontWeight:600,lineHeight:1.2,fontVariantNumeric:"tabular-nums"},children:d})]}):null}}
1,61709:function(e,t,n){var r=n(57437),a=n(2265),i=n(43949),o=n(45225),l=n(1899),s=n(19643),c=n(46387);let d=e=>{let t=new Date(e);if(Number.isNaN(t.getTime()))return"00:00:00";let n=t.getTime()-Date.now();if(n<=0)return"00:00:00";let r=Math.floor(n/864e5),a="".concat(Math.floor(n%864e5/36e5).toString().padStart(2,"0"),":").concat(Math.floor(n%36e5/6e4).toString().padStart(2,"0"),":").concat(Math.floor(n%6e4/1e3).toString().padStart(2,"0"));return r>0?"".concat(r,"d ").concat(a):a},u=e=>e&&"unused"!==e?"used"===e?"bonus.statusUsed":"expired"===e||"revoked"===e?"bonus.statusUnclaimed":null:"bonus.statusClaimed";t.Z=e=>{var t,n;let{data:m,fontSize:x,expiredBonusDate:h}=e,{t:p}=(0,i.$G)(),[g,f]=(0,a.useState)("00:00:00"),v=(null==m?void 0:null===(t=m.amountClaimed)||void 0===t?void 0:t.trim())||"",b=(null==m?void 0:null===(n=m.currencyClaimed)||void 0===n?void 0:n.trim())||"",y=null==m?void 0:m.bonusStatus,j=!!(null==m?void 0:m.claimed),w=!!(j&&v),Z=!y||"unused"===y,C=!!(j&&u(y)),S=!!(j&&Z&&h),k=u(y);return((0,a.useEffect)(()=>{if(!S||!h)return;let e=()=>{f(d(h))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[h,S]),w||C)?(0,r.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",gap:.5,minWidth:0},children:[w&&(0,r.jsxs)(s.Z,{direction:"row",justifyContent:"space-between",alignItems:"baseline",spacing:1,children:[(0,r.jsx)(c.Z,{variant:"body2",noWrap:!0,sx:{color:"grey.400",fontSize:x,lineHeight:1.3},children:p("wallet.amount")}),(0,r.jsxs)(c.Z,{variant:"body1",noWrap:!0,sx:{color:"white",fontWeight:700,fontSize:x,lineHeight:1.3},children:[v,b?" ".concat(b):""]})]}),C&&k&&(0,r.jsxs)(s.Z,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,r.jsx)(c.Z,{variant:"body2",noWrap:!0,sx:{color:"grey.400",fontSize:x,lineHeight:1.3},children:p("bonus.bonusStatus")}),(0,r.jsxs)(s.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{flexShrink:0},children:[(0,r.jsx)(c.Z,{variant:"body2",noWrap:!0,sx:{color:"white",fontWeight:600,fontSize:x,lineHeight:1.3},children:p(k)}),S&&(0,r.jsxs)(s.Z,{direction:"row",alignItems:"center",spacing:.35,children:[(0,r.jsx)(o.Z,{icon:"mdi:clock-outline",width:14,height:14,sx:{color:"orange.900"}}),(0,r.jsx)(c.Z,{variant:"body2",noWrap:!0,sx:{color:"orange.900",fontSize:x,fontWeight:600,lineHeight:1.3,fontVariantNumeric:"tabular-nums"},children:g})]})]})]})]}):null}},37373:function(e,t,n){n.d(t,{J:function(){return W}});var r=n(57437),a=n(2265),i=n(68575),o=n(78948),l=n(76975),s=n(43949),c=n(55447),d=n(36067),u=n(67972),m=n(58004),x=n(1899),h=n(46387),p=n(44811),g=n(33145),f=n(68651),v=n(38954),b=n(48116),y=n(89011),j=n(82877),w=n(38996),Z=n(3801),C=n(47101),S=n(66393),k=n(31691),I=n(82156),M=n(33833),A=n(50290),F=n(73053),D=n(1869);let _=[{error:"insufficient_conditions",message:"bonus.errorMessages.insufficientConditions"},{error:"time_expired",message:"bonus.errorMessages.timeExpired"},{error:"quota_exceeded",message:"bonus.errorMessages.quotaExceeded"},{error:"reuse",message:"bonus.errorMessages.reuse"}];function T(e){var t,n;let{open:u,onClose:T,type:R,promotion_name:N,bonus_amount:P,currency:W,transfer_type:B,error:L,bonus_id:E,bonus_setting_no:O,bonusTitle:q}=e,{t:z}=(0,s.$G)(),U=(0,k.Z)(),V=(0,I.Z)(U.breakpoints.down("sm")),{showMessage:H}=(0,d.useSnackbar)(),{authenticated:G}=(0,y.E)(),K=(0,i.v9)(e=>e.user.data),X=(0,i.v9)(e=>e.userBalance),{data:$}=(0,C.i)({authenticated:G,userId:(null==K?void 0:K._id)||""}),{data:J}=(0,Z.r)({authenticated:G}),{data:Y}=(0,S.s)(""),{data:Q}=(0,j.Xn)({currencyCode:"USD"}),{data:ee}=(0,w.T)({authenticated:G,vipLevel:null!==(n=null==K?void 0:K.levelInfo.vipLevel)&&void 0!==n?n:0}),[et,en]=(0,a.useState)([]),[er,ea]=(0,a.useState)(null),[ei,eo]=(0,a.useState)(""),[el,es]=(0,a.useState)({toCalendar:"100",toBalance:"0"}),[ec,ed]=(0,a.useState)(""),[eu,em]=(0,a.useState)(!1),ex=null===(t=_.find(e=>e.error===L))||void 0===t?void 0:t.message,eh=(e,t,n)=>{let r=new f.Z(t).dividedBy(new f.Z(ec)).multipliedBy(new f.Z(n)),a=new f.Z(e.replace("%",""));return r.multipliedBy(a).dividedBy(100).toNumber()};(0,a.useEffect)(()=>{if(!(null==J?void 0:J.data)||!(null==Y?void 0:Y.data)||!(null==$?void 0:$.data))return;let e=J.data.cryptos.map(e=>e),t=J.data.fiats.map(e=>e);en((0,D.re)(Y,{message:"success",data:{cryptos:e,fiats:t}}).map(e=>{var t,n;let r=null===(t=X.crypto)||void 0===t?void 0:t.find(t=>t.symbol===e.symbol),a=null===(n=X.fiat)||void 0===n?void 0:n.find(t=>t.symbol===e.symbol),i=r||a;return{...e,amount:(null==i?void 0:i.amount)||"0",type:r?"crypto":"fiat"}}))}
1,[J,Y,X.crypto,X.fiat,$]),(0,a.useEffect)(()=>{if(et.length>0){if(K){let e=et.find(e=>e.symbol===K.lastBonusCurrency);e?ea(e):ea(et[0])}else ea(et[0])}},[et,ea,K]),(0,a.useEffect)(()=>{er&&Q&&(eo(Q[er.symbol]||"0"),ed(Q[W&&"XCD"!==W?W:"XCD"]||"0"))},[Q,er,W]),(0,a.useEffect)(()=>{ee?es({toCalendar:ee.data.toCalendar,toBalance:ee.data.toBalance}):es({toCalendar:"100",toBalance:"0"})},[ee]);let ep=e=>{let t=et.find(t=>t.symbol===e);t&&ea(t)},eg=async()=>{em(!0);try{let e=c.Hv.promotions.claimToCalendar;await c.ZP.post(e,{locale:null==K?void 0:K.settings.language.toUpperCase(),id:E,currency:"XCD"===W?"XCD":null==er?void 0:er.symbol,bonusSettingNo:O}),H("Bonus claimed successfully","success"),T()}catch(e){H(e.error||z("errors.anErrorOccurred"),"error")}finally{em(!1)}},ef=()=>{T()};return(0,r.jsx)(m.Z,{open:u,onClose:ef,"aria-labelledby":"redeem-modal-title","aria-describedby":"redeem-modal-description",children:(0,r.jsxs)(x.Z,{sx:{position:"absolute",top:"50%",left:"50%",display:"flex",flexDirection:"column",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:500},bgcolor:"background.paper",borderRadius:2,boxShadow:o.y0.boxShadow,p:3},children:[(0,r.jsx)(x.Z,{component:"span",onClick:T,sx:{cursor:"pointer",lineHeight:1,position:"absolute",top:8,right:8},children:(0,r.jsx)(l.Z,{icon:"lucide:circle-x",color:"text.secondary"})}),(0,r.jsx)(x.Z,{children:(0,r.jsxs)(h.Z,{variant:"h2",component:"h2",mb:3,children:[(0,r.jsx)(g.default,{alt:"svip",src:"".concat("https://img.xyes.com/","assets/icons/logos/xyes-favicon-dark-mode.svg"),width:24,height:24,style:{marginRight:"8px"}}),"error"===R?z("bonus.errorMessages.redeemError"):z("bonus.bonus")]})}),"success"===R&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{textAlign:"left",sx:{width:"100%",maxWidth:"500px",mx:"auto",mb:2},children:(0,r.jsx)(h.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,children:N||q})}),(0,r.jsxs)(x.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",borderRadius:2},children:[(0,r.jsxs)(h.Z,{variant:"body1",sx:{fontWeight:"normal",color:"#A0AEC0"},children:[z("bonus.bonusAmount"),":"]}),(0,r.jsxs)(x.Z,{sx:{display:"flex",width:"20%",justifyContent:"space-between",alignItems:"baseline"},children:[(0,r.jsx)(h.Z,{variant:"h5",fontWeight:"bold",color:"white",children:W}),(0,r.jsx)(h.Z,{children:P})]})]}),"XCD"!==W&&"balance"===B?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center"},children:(0,r.jsxs)(x.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-15px",border:"6px solid ".concat(U.palette.background.paper)},children:[(0,r.jsx)(l.Z,{icon:"teenyicons:arrow-down-solid",color:"#f57c00",width:20}),(0,r.jsx)(l.Z,{icon:"teenyicons:arrow-down-solid",color:"#f57c00",width:20})]})}),(0,r.jsx)(x.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",maxWidth:"500px",backgroundColor:"#1E2332",borderRadius:2,p:2,my:1,mx:"auto",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.2)"},children:(0,r.jsxs)(x.Z,{sx:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)(h.Z,{variant:"body1",sx:{fontWeight:"normal",color:"#A0AEC0"},children:z("bonus.bonusTo")}),(0,r.jsxs)(x.Z,{sx:{textAlign:"right"},children:[(0,r.jsx)(h.Z,{variant:"h5",fontWeight:"bold",color:"white",children:"calendar"===B?"Calendar":"Balance"}),"XCD"===W?null:(0,r.jsxs)(h.Z,{color:"primary.main",fontWeight:"bold",children:["calendar"===B?el.toCalendar:el.toBalance,"%"]}),"XCD"===W?null:(0,r.jsxs)(x.Z,{sx:{display:"flex",flexDirection:"row",textAlign:"right",gap:1},children:[(0,r.jsx)(h.Z,{variant:"h5",children:W}),(0,r.jsx)(h.Z,{variant:"h5",children:(0,b.dN)(eh(el.toCalendar,Number(P),ei),(null==er?void 0:er.type)==="crypto"?"crypto/":"fiat/")})]})]})]})})]}),"XCD"!==W?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center"},children:(0,r.jsx)(x.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-15px",border:"6px solid ".concat(U.palette.background.paper)},children:"calendar"===B?(0,r.jsx)(h.Z,{variant:"h5",color:"text.secondary",children:"And"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Z,{icon:"teenyicons:arrow-down-solid",color:"#f57c00",width:20}),(0,r.jsx)(l.Z,{icon:"teenyicons:arrow-down-solid",color:"#f57c00",width:20})]})})}),(0,r.jsx)(x.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",maxWidth:"500px",backgroundColor:"#1E2332",borderRadius:2,p:2,my:2,boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.2)"},children:(0,r.jsxs)(x.Z,{sx:{width:"100%"},children:[(0,r.jsxs)(x.Z,{sx:{textAlign:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,r.jsx)(h.Z,{variant:"body1",color:"text.secondary",children:z("bonus.bonusTo")}),(0,r.jsxs)(x.Z,{sx:{display:"flex",flexDirection:"column",textAlign:"right"},children:[(0,r.jsx)(h.Z,{variant:"h5",fontWeight:"bold",children:"Balance"}),"XCD"!==W&&"balance"!==B&&(0,r.jsxs)(h.Z,{color:"primary",fontWeight:"bold",children:[el.toBalance,"%"]})]})]}),(0,r.jsxs)(x.Z,{sx:{display:"flex",gap:2,flexDirection:V?"column":"row",mt:V?2:0},children:[(0,r.jsx)(M.Z,{value:null==er?void 0:er.symbol,onChange:e=>ep(e.target.value),variant:"outlined",fullWidth:!0,sx:{height:"48px","& .MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},children:et.map(e=>(0,r.jsx)(A.Z,{value:e.symbol,children:(0,r.jsxs)(x.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(v.Z,{alt:e.symbol,width:"crypto"===e.type?20:25,src:e.logoUrl,borderRadius:.1}),(0,r.jsxs)(h.Z,{children:[e.symbol," - ",Number(e.amount).toFixed(2)]})]})},e.symbol))}),(0,r.jsxs)(x.Z,{sx:{minWidth:120,textAlign:"right",display:"flex",flexDirection:V?"row":"column",justifyContent:"end",gap:V?1:0},children:[(0,r.jsx)(h.Z,{variant:"h6",color:"text.primary",children:"XCD"===W?W:null==er?void 0:er.symbol}),(0,r.jsx)(h.Z,{variant:"h5",children:(0,b.dN)(eh("XCD"!==W&&"balance"!==B?el.toBalance:"100",Number(P),ei),(null==er?void 0:er.type)==="crypto"?"crypto/":"fiat/")})]})]})]})})]}):null,"XCD"!==W&&(0,r.jsx)(x.Z,{sx:{textAlign:"right",my:2},children:(0,r.jsxs)(h.Z,{variant:"body1",color:"text.secondary",children:["1 USD ≈ ",(0,b.dN)(Number(ei),"crypto/")," ",null==er?void 0:er.symbol]})}),(0,r.jsx)(p.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:eg,disabled:eu,children:eu?(0,r.jsx)(F.Z,{size:20}):z("wallet.continue")})]}),"error"===R&&(0,r.jsx)(x.Z,{sx:{width:"100%",height:"150px",display:"flex",justifyContent:"center"},children:(0,r.jsxs)(x.Z,{sx:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",borderRadius:1,p:1.2},children:[(0,r.jsx)(h.Z,{id:"redeem-modal-description",children:z(ex||"")}),(0,r.jsx)(p.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:ef,children:z("bonus.tryAgain")})]})})]})})}var R=n(61622);let N=[{error:"insufficient_conditions",message:"bonus.errorMessages.insufficientConditions"},{error:"time_expired",message:"bonus.errorMessages.timeExpired"},{error:"quota_exceeded",message:"bonus.errorMessages.quotaExceeded"},{error:"reuse",message:"bonus.errorMessages.reuse"}],P=e=>{let{t,open:n,handleClose:a,error:i}=e;return(0,r.jsx)(m.Z,{open:n,onClose:a,"aria-labelledby":"redeem-modal-title","aria-describedby":"redeem-modal-description",children:(0,r.jsxs)(x.Z,{sx:{position:"absolute",top:"50%",left:"50%",display:"flex",flexDirection:"column",transform:"translate(-50%, -50%)",width:{xs:"90%",sm:500},bgcolor:"background.paper",borderRadius:2,boxShadow:o.y0.boxShadow,p:3},children:[(0,r.jsx)(x.Z,{component:"span",onClick:a,sx:{cursor:"pointer",lineHeight:1,position:"absolute",top:8,right:8},children:(0,r.jsx)(l.Z,{icon:"lucide:circle-x",color:"text.secondary"})}),(0,r.jsxs)(x.Z,{display:"flex",justifyContent:"center",alignItems:"center",mb:3,children:[(0,r.jsx)(l.Z,{icon:"solar:danger-circle-linear",width:30,height:30,color:"primary.main"}),(0,r.jsx)(h.Z,{variant:"h2",component:"h2",ml:1,sx:{alignSelf:"center",justifySelf:"center",fontSize:"26px !important"},children:t("bonus.failed")})]}),(0,r.jsx)(x.Z,{sx:{width:"100%",height:"150px",display:"flex",justifyContent:"center"},children:(0,r.jsxs)(x.Z,{sx:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",borderRadius:1,p:1.2},children:[(0,r.jsx)(h.Z,{id:"redeem-modal-description",children:t(i)}),(0,r.jsx)(p.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:a,children:t("auth.reset.confirm")})]})})]})})},W=e=>{var t;let{open:n,handleClose:o,isClaimable:l,type:m,promotion_name:x,bonus_amount:h,currency:p,transfer_type:g,error:f,bonus_id:v,bonus_setting_no:b,bonusTitle:y,isActive:j}=e,{t:w}=(0,s.$G)(),Z=(0,i.v9)(e=>e.user.data),{showMessage:C}=(0,d.useSnackbar)(),S=null===(t=N.find(e=>e.error===f))||void 0===t?void 0:t.message,[k,I]=(0,a.useState)(null),M=async()=>{try{let e=c.Hv.promotions.claimToCalendar;await c.ZP.post(e,{locale:null==Z?void 0:Z.settings.language.toUpperCase(),id:v,currency:"XCD"===p?"XCD":null==k?void 0:k.symbol,bonusSettingNo:b,isUserBonus:!0}
1),C("Bonus claimed successfully","success"),o()}catch(e){C(e.error||w("errors.anErrorOccurred"),"error")}};return"XCD"===p||"calendar"!==g||f?"XCD"===p||"balance"!==g||f?"XCD"!==p||f?f?(0,r.jsx)(P,{t:w,open:n,handleClose:o,error:null!=S?S:"bonus.errorMessages.insufficientConditions"}):(0,r.jsx)(r.Fragment,{}):(0,r.jsx)(T,{open:n,onClose:o,type:m,promotion_name:x,bonus_amount:h,currency:p,transfer_type:g,error:f,bonus_id:v,bonus_setting_no:b,bonusTitle:y}):(0,r.jsx)(R.Z,{open:n,onClose:o,handleClaim:M,setSelectedCurrency:I,selectedCurrency:k,totalUnclaimedAmount:h?Number(h):0,title:y||x,currency:p,redeemingCode:!0}):(0,r.jsx)(u.A,{title:w("bonus.bonus"),showModal:n,type:"modalBonusClaim",handleModal:o,hasIcon:!0,modalProps:{bonusSettingNo:b,handleClaim:M,setIsModalOpen:o,setSelectedCurrency:I,selectedCurrency:k,claimAmount:h?Number(h):0,isClaimable:l,isMemberRebate:!1,title:y||x,redeemingCode:!0,currency:p,isActive:j}})}},30166:function(e,t,n){n.d(t,{Q:function(){return l}});var r=n(55447),a=n(49931),i=n(16593),o=n(45345);let l=e=>{let{populate:t,locale:n,filters:l}=e,s=new URL("".concat("https://api.xyes.com/api/v1").concat(r.Hv.cms.getBonusCategoryDetails));return Array.isArray(t)&&t.forEach(e=>{s.searchParams.append(e.key,e.value)}),n&&s.searchParams.append(n.key,n.value),Array.isArray(l)&&l.forEach(e=>{s.searchParams.append("filters[".concat(e.key,"][$eq]"),e.value)}),(0,i.a)({queryKey:["getCMSBonusDetails",s.toString()],queryFn:()=>(0,a.DQ)(s.toString(),"bonus-details"),placeholderData:o.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0})}},30276:function(e,t,n){n.d(t,{Ao:function(){return d},C6:function(){return o},Sn:function(){return s},Tr:function(){return u},dA:function(){return c},tK:function(){return l}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.monthlyBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getMonthlyBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})},l=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.birthdayBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getBirthdayBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})},s=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.weeklyRebateBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getWeeklyRebateBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})},c=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.instantRebateBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getInstantRebateBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})},d=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.weeklyTournamentsBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getWeeklyTournamentsBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})},u=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.monthlyTournamentsBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getMonthlyTournamentsBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},28389:function(e,t,n){n.d(t,{y:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.getMemberRebate)),o=async()=>(await i.ZP.get(n.toString())).data;return(0,r.a)({queryKey:["getMemberRebate"],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},96704:function(e,t,n){n.d(t,{W:function(){return l},v:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o="sports/?bt-path=%2Fbets",l=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.weeklySportsFreebet)),o=async()=>(await i.ZP.get(n.toString())).data;return(0,r.a)({queryKey:["getWeeklySportsFreebet",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t,retry:!1})}},43223:function(e,t,n){n.d(t,{B:function(){return s},w:function(){return c}});var r=n(2265),a=n(49337),i=n(16593),o=n(45345),l=n(99719);let s="useGetTotalBonusByMemberIdV2",c=e=>{let{authenticated:t}=e,n=(0,r.useMemo)(()=>new URL("".concat(a.aZ).concat(l.fS.games.totalBonusRecords)),[]),{data:c,isLoading:d,error:u,isError:m,refetch:x}=(0,i.a)({queryKey:[s],queryFn:async()=>(await l.ZP.get(n.toString())).data,placeholderData:o.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t});return{data:c,isLoading:d,error:u,isError:m,refetch:x}}},47101:function(e,t,n){n.d(t,{i:function(){return i}});var r=n(16593),a=n(55447);let i=e=>{let{authenticated:t,userId:n}=e,i=new URL("".concat("https://api.xyes.com/api/v1").concat(a.Hv.wallet.getUserAssets).concat(n)),o=async()=>(await a.ZP.get(i.toString())).data;return(0,r.a)({queryKey:["getUserAssets",i.toString()],queryFn:o,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},38996:function(e,t,n){n.d(t,{T:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t,vipLevel:n}=e,o=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.configs.getVipLevel).concat(n)),l=async()=>(await i.ZP.get(o.toString())).data;return(0,r.a)({queryKey:["getVipLevel",o.toString()],queryFn:l,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},67383:function(e,t,n){n.d(t,{y:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.getVipLevelUp)),o=async()=>(await i.ZP.get(n.toString())).data;return(0,r.a)({queryKey:["getVipLevelUp",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},17925:function(e,t,n){n.d(t,{_:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.weeklySportsBonus)),o=async()=>{try{return(await i.ZP.get(n.toString())).data}catch(e){throw e}};return(0,r.a)({queryKey:["getWeeklySportsBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},41680:function(e,t,n){n.d(t,{J:function(){return o}});var r=n(16593),a=n(45345),i=n(55447);let o=e=>{let{authenticated:t}=e,n=new URL("".concat("https://api.xyes.com/api/v1").concat(i.Hv.promotions.getWelcomeBonus)),o=async()=>(await i.ZP.get(n.toString())).data;return(0,r.a)({queryKey:["welcomeBonus",n.toString()],queryFn:o,placeholderData:a.Wk,refetchOnMount:!0,refetchOnWindowFocus:!0,enabled:t})}},97605:function(e,t,n){n.r(t),n.d(t,{default:function(){return q}});var r=n(57437),a=n(68575),i=n(2265),o=n(66393),l=n(89011),s=n(1869),c=n(82877),d=n(33145),u=n(68651),m=n(68720),x=n(43949),h=n(48116),p=n(33833),g=n(50290),f=n(46387);let v=e=>{let{alt:t,width:n,src:a,borderRadius:i}=e;return(0,r.jsx)("img",{alt:t,width:n,src:a||"/placeholder.svg",style:{borderRadius:"".concat(i,"rem")}})},b=(e,t)=>(0,h.dN)(e,"crypto"===t?"crypto/":"fiat/");function y(e){let{selectedCurrency:t,currencies:n,onCurrencyChange:a,showBalances:i=!1,disabled:o=!1}=e,l=e=>{let t=n.find(t=>t.symbol===e);t&&a(t)};return(0,r.jsx)(p.Z,{value:t.symbol,onChange:e=>l(e.target.value),variant:"standard",disabled:o,sx:{display:"flex",alignItems:"center",height:"34px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)","& .MuiSelect-select:focus":{bgcolor:"transparent"},"&:before":{display:"none"},"&:after":{display:"none"}},children:n.map(e=>
1(0,r.jsx)(g.Z,{value:e.symbol,sx:{display:"flex",alignItems:"center"},children:(0,r.jsxs)(f.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(v,{alt:"currency",width:"crypto"===e.type?20:25,src:e.logoUrl,borderRadius:.1}),e.symbol,i&&t.symbol!==e.symbol&&(0,r.jsxs)(r.Fragment,{children:[" - ",b(Number(e.amount),e.type||"")]})]})},e.symbol))})}let j=e=>{let{fromCurrency:t,toCurrency:n,rate:a}=e;return(0,r.jsxs)(f.Z,{variant:"caption",color:"grey.500",align:"right",display:"block",sx:{mt:1,mb:2},children:["1 ",t," ≈ ",(0,h.dN)(a,"crypto/")," ",n]})};var w=n(1899),Z=n(44811),C=n(73053);let S=e=>{var t;let n,{claimAmount:a,selectedCurrency:o,filteredCurrencies:l,exchangeRate:s,onClaim:c,onClose:p,onCurrencyChange:g}=e,{t:v}=(0,x.$G)(),[b,S]=(0,i.useState)(!1),k=async()=>{S(!0);try{await c(),p()}catch(e){}finally{S(!1)}};return(0,r.jsxs)(w.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[(0,r.jsx)(f.Z,{variant:"body2",color:"grey.500",mb:1,children:v("bonus.instructions.chooseCurrency",{currency:"XCD"})}),(0,r.jsx)(f.Z,{variant:"body2",color:"grey.500",mb:1,children:v("bonus.instructions.clickClaim")}),(0,r.jsxs)(w.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,r.jsxs)(w.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pb:"30px"},children:[(0,r.jsx)(w.Z,{sx:{display:"flex",alignItems:"center",height:"34px",width:"110px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)"},children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(d.default,{src:"".concat("https://img.xyes.com/","assets/icons/logos/xyes-favicon-dark-mode.svg"),alt:"XCD",width:24,height:24,style:{marginRight:"8px"}}),"XCD"]})}),(0,r.jsx)(f.Z,{variant:"h6",children:(0,h.dN)(a,"fiat/")})]}),(0,r.jsx)(w.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center",my:.5},children:(0,r.jsxs)(w.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-25px",border:"6px solid #111928"},children:[(0,r.jsx)(m.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20}),(0,r.jsx)(m.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20})]})}),(0,r.jsxs)(w.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pt:"30px"},children:[(0,r.jsx)(y,{currencies:l,selectedCurrency:o,onCurrencyChange:g}),(0,r.jsxs)(w.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,r.jsx)(f.Z,{color:"grey.400",variant:"caption",children:v("bonus.currency")}),(0,r.jsx)(f.Z,{variant:"h6",align:"right",children:(n="crypto"===(t=o.type||"")?new u.Z(a).dividedBy(new u.Z(o.usdRate)):new u.Z(a).multipliedBy(new u.Z(o.usdRate)),(0,h.dN)(n.toNumber(),"crypto"===t?"crypto/":"fiat/"))})]})]})]}),(0,r.jsx)(j,{fromCurrency:"XCD",toCurrency:o.symbol,rate:Number(s)}),(0,r.jsx)(Z.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:k,disabled:b,children:b?(0,r.jsx)(C.Z,{size:20}):v("bonus.claimNow")})]})};var k=n(38996),I=n(66274),M=n(43161),A=n(70795),F=n(55447),D=n(36067);let _=e=>{let{title:t,amount:n,currency:a,type:i="fiat",percentage:o,borderColor:l="#0072FF8C"}=e;return(0,r.jsxs)(w.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"20px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,border:"1px solid ".concat(l)},children:[(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(f.Z,{color:"grey.400",fontWeight:"bold",sx:{fontSize:{xs:"0.75rem",md:"1rem"}},children:t}),o&&(0,r.jsxs)(f.Z,{color:"primary.main",fontWeight:"bold",children:[o,"%"]})]}),(0,r.jsx)(w.Z,{textAlign:"right",children:(0,r.jsxs)(f.Z,{variant:"h4",children:[(0,h.dN)(n,"crypto"===i?"crypto/":"fiat/")," ",a]})})]})};var T=n(43223);let R=async e=>{var t,n;let{memberRebate:r,selectedCurrency:a,sessionData:i,setLoading:o,fetchBalance:l,showMessage:s,onClose:c,refetch:d}=e,u={bonusSettingNo:null===(t=r[0])||void 0===t?void 0:t.bonusSettingNo,id:null===(n=r[0])||void 0===n?void 0:n.id,memberId:i.memberId,currency:a.symbol,coinId:"coinId"in a?a.coinId:a.fiatId,currencyType:"type"in a?a.type:void 0,requestDate:r[0].requestTime};o(!0);try{let e=async()=>{await F.ZP.post(F.Hv.promotions.claimMemberRebate,u),await A.E.invalidateQueries({queryKey:["getMemberRebate"]}),await A.E.invalidateQueries({queryKey:["getBonusCalendar"]})};await e(),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}),l(),s("Bonus claimed successfully","success"),c(),null==d||d()}catch(e){s(e.message,"error"),c(),null==d||d()}finally{o(!1)}},N=async e=>{let{isVipLevelUp:t,vipLevelUp:n,sessionData:r,selectedCurrency:a,_id:i,member_id:o,fetchBalance:l,showMessage:s,onClose:c,refetch:d}=e,u={},m="";t?(u={bonusSettingNo:null==n?void 0:n.data.bonusSettingNo,id:null==n?void 0:n.data.id,locale:r.settings.language.toUpperCase(),currency:a.symbol,isUserBonus:!0},m=F.Hv.promotions.claimVipLevelUp):(u={eventId:i,memberId:o,language:r.settings.language.toUpperCase(),currencyTo:a.symbol},m=F.Hv.promotions.claimBonus);try{await F.ZP.post(m,u),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}),l(),s("Bonus claimed successfully","success")}catch(e){s(e.message,"error"),c(),null==d||d()}finally{await A.E.invalidateQueries({queryKey:["getVipLevelUp"]})}},P=e=>{let{claimAmount:t,selectedCurrency:n,filteredCurrencies:a,vipInfo:o,sessionData:s,exchangeRates:c,currencyExchange:m,currencySymbol:p,isActive:g,onClose:v,onCurrencyChange:b,title:j,bonusSettingNo:S,refetch:k,bonusData:P,bonusType:W,redirectAfterClaim:B}=e,{t:L}=(0,x.$G)(),E=(0,I.tv)(),{getLink:O}=(0,M.m)(),[q,z]=(0,i.useState)(!1),{fetchBalance:U}=(0,l.E)(),{showMessage:V}=(0,D.useSnackbar)(),H=(e,t,r)=>{g||(e="100");let a=new u.Z(t).dividedBy(new u.Z(r)).multipliedBy(new u.Z(c[n.symbol]||"1")),i=new u.Z(e.replace("%",""));return a.multipliedBy(i).dividedBy(100).toNumber()},G=(0,i.useCallback)(async()=>{let e={bonusSettingNo:S,currency:n.symbol};z(!0);try{await F.ZP.post(F.Hv.promotions.claimGeneralBonus,e),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}
1),U(),V("Bonus claimed successfully","success"),v(),B&&E.push(O(B))}catch(e){V(e.message,"error"),v()}finally{null==k||k(),z(!1)}},[S,n.symbol,z,U,V,v,k,B,E,O]),K=(0,i.useCallback)(()=>"memberRebate"===W?R({memberRebate:P,selectedCurrency:n,sessionData:s,setLoading:z,fetchBalance:U,showMessage:V,onClose:v,refetch:k}):"levelUpBonus"===W?N({isVipLevelUp:P.isVipLevelUp,vipLevelUp:P,selectedCurrency:n,sessionData:s,_id:P._id,member_id:P.member_id,fetchBalance:U,showMessage:V,onClose:v,refetch:k}):G(),[W,G,P,n,s,U,V,v,k]);return(0,r.jsxs)(w.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[j&&(0,r.jsx)(f.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,mb:2,children:j}),g&&(0,r.jsxs)(w.Z,{display:"flex",alignItems:"center",gap:2,mb:2,children:[(0,r.jsx)(d.default,{src:null==s?void 0:s.levelInfo.icon,alt:"VIP Level Icon",width:48,height:48}),(0,r.jsx)(f.Z,{color:"grey.500",variant:"h4",fontWeight:"bold",children:L("bonus.vipLevel")}),(0,r.jsx)(f.Z,{color:"secondary.main",variant:"h4",fontWeight:"bold",children:null==s?void 0:s.levelInfo.currentLevel})]}),(0,r.jsx)(_,{title:L("wallet.totalAmountTobeReceived"),amount:H("100",t,c[m]||"1"),currency:p,type:n.type,borderColor:"#0072FF8C"}),g&&(0,r.jsx)(_,{title:L("bonus.allocatedToBonusCalendar"),amount:H(o.toCalendar,t,c[m]||"1"),currency:n.symbol,type:n.type,percentage:o.toCalendar,borderColor:"#0072FF8C"}),g&&(0,r.jsx)(f.Z,{variant:"h3",color:"white",mb:1,align:"center",children:L("bonus.And")}),(0,r.jsxs)(w.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"12px 16px",mb:2,display:"flex",justifyContent:"space-between",alignItems:"center",border:"1px solid #FF79018C"},children:[(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(f.Z,{color:"grey.400",sx:{fontSize:{xs:"0.75rem",md:"1rem"},fontWeight:"bold"},children:L("bonus.allocatedToBalance")}),g&&(0,r.jsxs)(f.Z,{color:"primary.main",fontWeight:"bold",children:[o.toBalance,"%"]})]}),(0,r.jsxs)(w.Z,{textAlign:"right",children:[(0,r.jsx)(y,{currencies:a,selectedCurrency:n,onCurrencyChange:b}),(0,r.jsx)(f.Z,{variant:"h4",color:"primary.main",children:"".concat((0,h.dN)(H(o.toBalance,t,c[m]||"1"),"crypto"===n.type?"crypto/":"fiat/")," ").concat(n.symbol)})]})]}),(0,r.jsx)(Z.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:K,disabled:q,children:q?(0,r.jsx)(C.Z,{size:20}):L("bonus.claimNow")})]})};var W=n(3801),B=n(47101);let L=e=>{let{claimAmount:t,onClaim:n,onClose:a,title:o,currency:s="USD",bonusSettingNo:c,selectedCurrency:d,refetch:u,redirectAfterClaim:m}=e,{t:h}=(0,x.$G)(),p=(0,I.tv)(),{getLink:g}=(0,M.m)(),[v,b]=(0,i.useState)(!1),{fetchBalance:y}=(0,l.E)(),{showMessage:j}=(0,D.useSnackbar)(),S=async()=>{let e={bonusSettingNo:c,currency:d.symbol};b(!0);try{await F.ZP.post(F.Hv.promotions.claimGeneralBonus,e),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}),y(),j("Bonus claimed successfully","success"),a(),null==u||u(),m&&p.push(g(m))}catch(e){}finally{b(!1)}};return(0,r.jsxs)(w.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[o&&(0,r.jsx)(f.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,mb:2,children:o}),(0,r.jsx)(_,{title:h("bonus.bonusAmount"),amount:t,currency:s,borderColor:"#0072FF8C"}),(0,r.jsx)(f.Z,{variant:"body2",color:"grey.500",mb:2,children:h("bonus.instructions.generalBonus")}),(0,r.jsx)(Z.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:S,disabled:v,children:v?(0,r.jsx)(C.Z,{size:20}):h("bonus.claimNow")})]})},E=e=>{let{claimAmount:t,selectedCurrency:n,filteredCurrencies:a,isClaimable:o,onClaim:s,onClose:c,onCurrencyChange:d,title:u,bonusSettingNo:m,refetch:p}=e,{t:g}=(0,x.$G)(),[v,b]=(0,i.useState)(!1),{fetchBalance:j}=(0,l.E)(),{showMessage:S}=(0,D.useSnackbar)(),k=async()=>{let e={bonusSettingNo:m,currency:n.symbol};b(!0);try{await F.ZP.post(F.Hv.promotions.claimGeneralBonus,e),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}),j(),S("Bonus claimed successfully","success"),c(),null==p||p()}catch(e){}finally{b(!1)}};return(0,r.jsxs)(w.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[u&&(0,r.jsx)(f.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,mb:2,children:u}),(0,r.jsx)(_,{title:g("wallet.totalAmountTobeReceived"),amount:t,currency:"USD",borderColor:"#0072FF8C"}),(0,r.jsxs)(w.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"12px 16px",mb:2,display:"flex",justifyContent:"space-between",alignItems:"center",border:"1px solid #FF79018C"},children:[(0,r.jsx)(w.Z,{children:(0,r.jsx)(f.Z,{color:"grey.400",sx:{fontSize:{xs:"0.75rem",md:"1rem"},fontWeight:"bold"},children:g("bonus.allocatedToBalance")})}),(0,r.jsxs)(w.Z,{textAlign:"right",children:[(0,r.jsx)(y,{currencies:a,selectedCurrency:n,onCurrencyChange:d}),(0,r.jsxs)(f.Z,{variant:"h4",color:"primary.main",children:[(0,h.dN)("crypto"===n.type?t/Number(n.usdRate):t*Number(n.usdRate),"crypto"===n.type?"crypto/":"fiat/")," ",n.symbol]})]})]}),(0,r.jsx)(Z.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:k,disabled:!o||v,children:v?(0,r.jsx)(C.Z,{size:20}):g("bonus.claimNow")})]})},O=e=>{let{claimAmount:t,selectedCurrency:n,filteredCurrencies:a,exchangeRate:o,onClaim:s,onClose:c,onCurrencyChange:d,bonusSettingNo:u,refetch:p}=e,{t:g}=(0,x.$G)(),[v,b]=(0,i.useState)(!1),{fetchBalance:S}=(0,l.E)(),{showMessage:k}=(0,D.useSnackbar)(),I=async()=>{let e={bonusSettingNo:u,currency:n.symbol};b(!0);try{await F.ZP.post(F.Hv.promotions.claimGeneralBonus,e),await A.E.invalidateQueries({queryKey:["useGetTotalBonusByMemberId"]}),await A.E.invalidateQueries({queryKey:[T.B]}
1),S(),k("Bonus claimed successfully","success"),c(),null==p||p()}catch(e){}finally{b(!1)}};return(0,r.jsxs)(w.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[(0,r.jsx)(f.Z,{variant:"body2",color:"grey.500",mb:1,children:g("bonus.instructions.chooseCurrency",{currency:"USD"})}),(0,r.jsx)(f.Z,{variant:"body2",color:"grey.500",mb:1,children:g("bonus.instructions.clickClaim")}),(0,r.jsxs)(w.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,r.jsxs)(w.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pb:"30px"},children:[(0,r.jsx)(w.Z,{sx:{display:"flex",alignItems:"center",height:"34px",width:"110px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)"},children:(0,r.jsxs)(f.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)("img",{src:"".concat("https://img.xyes.com/","assets/images/fiat/usd.png"),alt:"USD",width:25,height:25,style:{marginRight:"8px"}}),"USD"]})}),(0,r.jsx)(f.Z,{variant:"h6",children:(0,h.dN)(t,"fiat/")})]}),(0,r.jsx)(w.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center",my:.5},children:(0,r.jsxs)(w.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-25px",border:"6px solid #111928"},children:[(0,r.jsx)(m.JO,{icon:"teenyicons:arrow-down-solid",color:"warning",width:20}),(0,r.jsx)(m.JO,{icon:"teenyicons:arrow-down-solid",color:"warning",width:20})]})}),(0,r.jsxs)(w.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pt:"30px"},children:[(0,r.jsx)(y,{currencies:a,selectedCurrency:n,onCurrencyChange:d}),(0,r.jsxs)(w.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,r.jsx)(f.Z,{color:"grey.400",variant:"caption",children:g("bonus.currency")}),(0,r.jsx)(f.Z,{variant:"h6",align:"right",children:(0,h.dN)("crypto"===n.type?t/Number(n.usdRate):t*Number(n.usdRate),"crypto"===n.type?"crypto/":"fiat/")})]})]})]}),(0,r.jsx)(j,{fromCurrency:"USD",toCurrency:n.symbol,rate:Number(o)}),(0,r.jsx)(Z.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:I,disabled:v,children:v?(0,r.jsx)(C.Z,{size:20}):g("bonus.claimNow")})]})};function q(e){var t;let{handleClaim:n,setIsModalOpen:d,isXCD:u,claimAmount:m,isCalendarBonus:x,isClaimable:h,isMemberRebate:p,isGeneralBonus:g,title:f,isActive:v,bonusSettingNo:b,refetch:y,bonusData:j,bonusType:w,redirectAfterClaim:Z}=e,[C,I]=(0,i.useState)(null),[M,A]=(0,i.useState)(""),{data:F}=(0,o.s)(""),{authenticated:D}=(0,l.E)(),[_,T]=(0,i.useState)([]),{data:R}=(0,W.r)({authenticated:D}),[N,q]=(0,i.useState)({toCalendar:"",toBalance:""}),z=(0,a.v9)(e=>e.user.data),U=(0,a.v9)(e=>e.userBalance),{data:V}=(0,k.T)({authenticated:D,vipLevel:null!==(t=null==z?void 0:z.levelInfo.vipLevel)&&void 0!==t?t:0}),{data:H}=(0,B.i)({authenticated:D,userId:(null==z?void 0:z._id)||""}),{data:G}=(0,c.Xn)({currencyCode:"USD"}),[K,X]=(0,i.useState)("");if((0,i.useEffect)(()=>{V?q({toCalendar:V.data.toCalendar,toBalance:V.data.toBalance}):q({toCalendar:"100",toBalance:"0"})},[V]),(0,i.useEffect)(()=>{C&&G&&(A(G[C.symbol]||"0"),X(G[C.symbol&&"XCD"!==C.symbol?C.symbol:"XCD"]||"0"))},[G,C,m]),(0,i.useEffect)(()=>{if(!(null==R?void 0:R.data)||!(null==F?void 0:F.data)||!(null==H?void 0:H.data))return;let e=R.data.cryptos.map(e=>e),t=R.data.fiats.map(e=>e);T((0,s.re)(F,{message:"success",data:{cryptos:e,fiats:t}}).map(e=>{var t,n;let r=null===(t=U.crypto)||void 0===t?void 0:t.find(t=>t.symbol===e.symbol),a=null===(n=U.fiat)||void 0===n?void 0:n.find(t=>t.symbol===e.symbol),i=r||a;return{...e,amount:(null==i?void 0:i.amount)||"0",type:r?"crypto":"fiat"}}))},[R,F,U.crypto,U.fiat,H]),(0,i.useEffect)(()=>{if(_.length>0){if(z){let e=_.find(e=>e.symbol===z.lastBonusCurrency);e?I(e):I(_[0])}else I(_[0])}},[_,I,z]),!C)return null;let $={bonusType:w,claimAmount:m,bonusSettingNo:b,selectedCurrency:C,filteredCurrencies:_,exchangeRate:M,onClaim:n,onClose:()=>d(!1),onCurrencyChange:I,title:f,refetch:y};return u?(0,r.jsx)(S,{...$}):x?(0,r.jsx)(O,{...$}):p?(0,r.jsx)(E,{...$,isClaimable:h}):g?(0,r.jsx)(L,{...$,redirectAfterClaim:Z}):(0,r.jsx)(P,{...$,vipInfo:N,sessionData:z,exchangeRates:G||{},currencyExchange:K,currencySymbol:C.symbol,isActive:null!=v&&v,bonusData:j,bonusType:w||"",redirectAfterClaim:Z})}},7299:function(e,t,n){n.r(t),n.d(t,{default:function(){return I}});var r=n(57437),a=n(33145),i=n(68651),o=n(68720),l=n(68575),s=n(2265),c=n(43949),d=n(48116),u=n(89011),m=n(1869),x=n(82877),h=n(38996),p=n(3801),g=n(47101),f=n(66393),v=n(1899),b=n(46387),y=n(33833),j=n(50290),w=n(44811),Z=n(73053),C=n(38954);let S=(e,t,n)=>{let r;return r="crypto"===n?new i.Z(e).dividedBy(new i.Z(t.usdRate)):new i.Z(e).multipliedBy(new i.Z(t.usdRate)),(0,d.dN)(r.toNumber(),"crypto"===n?"crypto/":"fiat/")},k=(e,t)=>(0,d.dN)(e,"crypto"===t?"crypto/":"fiat/");function I(e){var t;let{handleClaim:n,setIsModalOpen:I,claimAmount:M,isXCD:A=!1,isCalendarBonus:F=!1,setSelectedCurrency:D,selectedCurrency:_,isClaimable:T,isMemberRebate:R,isGeneralBonus:N,title:P,redeemingCode:W=!1,currency:B="USD",isActive:L}=e,{t:E}
1=(0,c.$G)(),[O,q]=(0,s.useState)(""),[z,U]=(0,s.useState)(""),{data:V}=(0,f.s)(""),[H,G]=(0,s.useState)(!1),{authenticated:K}=(0,u.E)(),[X,$]=(0,s.useState)([]),{data:J}=(0,p.r)({authenticated:K}),[Y,Q]=(0,s.useState)({toCalendar:"",toBalance:""}),ee=(0,l.v9)(e=>e.user.data),et=(0,l.v9)(e=>e.userBalance),{data:en}=(0,h.T)({authenticated:K,vipLevel:null!==(t=null==ee?void 0:ee.levelInfo.vipLevel)&&void 0!==t?t:0}),{data:er}=(0,g.i)({authenticated:K,userId:(null==ee?void 0:ee._id)||""}),{data:ea}=(0,x.Xn)({currencyCode:"USD"}),[ei,eo]=(0,s.useState)(""),[el,es]=(0,s.useState)(!1),ec=(e,t,n)=>{L||(e="100");let r=new i.Z(t).dividedBy(new i.Z(n)).multipliedBy(new i.Z(ei)),a=new i.Z(e.replace("%",""));return r.multipliedBy(a).dividedBy(100).toNumber()},ed=async()=>{es(!0);try{await n(),I(!1)}catch(e){}finally{es(!1)}},eu=e=>{let t=X.find(t=>t.symbol===e);t&&D(t)};return((0,s.useEffect)(()=>{var e;q(null!==(e=null==ee?void 0:ee.levelInfo.icon)&&void 0!==e?e:"")},[ee]),(0,s.useEffect)(()=>{en?Q({toCalendar:en.data.toCalendar,toBalance:en.data.toBalance}):Q({toCalendar:"100",toBalance:"0"})},[en]),(0,s.useEffect)(()=>{_&&ea&&(U(ea[_.symbol]||"0"),eo(ea[_.symbol&&"XCD"!==_.symbol?_.symbol:"XCD"]||"0"))},[ea,_,M]),(0,s.useEffect)(()=>{A||R&&!T?G(!0):G(!1)},[A,M,R,T]),(0,s.useEffect)(()=>{if(!(null==J?void 0:J.data)||!(null==V?void 0:V.data)||!(null==er?void 0:er.data))return;let e=J.data.cryptos.map(e=>e),t=J.data.fiats.map(e=>e);$((0,m.re)(V,{message:"success",data:{cryptos:e,fiats:t}}).map(e=>{var t,n;let r=null===(t=et.crypto)||void 0===t?void 0:t.find(t=>t.symbol===e.symbol),a=null===(n=et.fiat)||void 0===n?void 0:n.find(t=>t.symbol===e.symbol),i=r||a;return{...e,amount:(null==i?void 0:i.amount)||"0",type:r?"crypto":"fiat"}}))},[J,V,et.crypto,et.fiat,er]),(0,s.useEffect)(()=>{if(X.length>0){if(ee){let e=X.find(e=>e.symbol===ee.lastBonusCurrency);e?D(e):D(X[0])}else D(X[0])}},[X,D,ee]),_)?(0,r.jsxs)(v.Z,{sx:{width:{xs:"295px",md:"500px"}},children:[P&&(0,r.jsx)(b.Z,{variant:"h5",fontWeight:"bold",gutterBottom:!0,mb:2,children:P}),!W&&L&&(0,r.jsxs)(v.Z,{display:"flex",alignItems:"center",gap:2,mb:2,children:[(0,r.jsx)(a.default,{src:O,alt:"VIP Level Icon",width:48,height:48}),(0,r.jsx)(b.Z,{color:"grey.500",variant:"h4",fontWeight:"bold",children:E("bonus.vipLevel")}),(0,r.jsx)(b.Z,{color:"secondary.main",variant:"h4",fontWeight:"bold",children:null==ee?void 0:ee.levelInfo.currentLevel})]}),!A&&!F&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(v.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"20px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",mb:4,position:"relative",mt:{xs:2,md:0},border:"1px solid #0072FF8C"},children:[(0,r.jsx)(v.Z,{children:(0,r.jsx)(b.Z,{color:"grey.400",fontWeight:"bold",sx:{fontSize:{xs:"0.75rem",md:"1rem"}},children:E("wallet.totalAmountTobeReceived")})}),(0,r.jsx)(v.Z,{textAlign:"right",children:(0,r.jsx)(b.Z,{variant:"h4",children:"".concat((0,d.dN)(ec("100",Number(M),z),"fiat/")," ").concat(B)})})]}),L&&(0,r.jsxs)(v.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"20px 16px",display:"flex",justifyContent:"space-between",alignItems:"center",mb:1,position:"relative",mt:{xs:2,md:0},border:"1px solid #0072FF8C"},children:[(0,r.jsxs)(v.Z,{children:[(0,r.jsx)(b.Z,{color:"grey.400",fontWeight:"bold",sx:{fontSize:{xs:"0.75rem",md:"1rem"}},children:E("bonus.allocatedToBonusCalendar")}),(0,r.jsxs)(b.Z,{color:"primary.main",fontWeight:"bold",children:[Y.toCalendar,"%"]})]}),(0,r.jsx)(v.Z,{textAlign:"right",children:(0,r.jsx)(b.Z,{variant:"h4",children:"".concat((0,d.dN)(ec(Y.toCalendar,Number(M),ea?ea[B]:"1"),"crypto"===_.type?"crypto/":"fiat/")," ").concat(_.symbol)})})]}),L&&(0,r.jsx)(b.Z,{variant:"h3",color:"white",mb:1,align:"center",children:E("bonus.And")}),(0,r.jsxs)(v.Z,{sx:{background:"rgba(255, 255, 255, 0.05)",borderRadius:.5,padding:"12px 16px",mb:2,display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",mt:{xs:2,md:0},border:"1px solid #FF79018C"},children:[(0,r.jsxs)(v.Z,{children:[(0,r.jsx)(b.Z,{color:"grey.400",sx:{fontSize:{xs:"0.75rem",md:"1rem"},fontWeight:"bold"},children:E("bonus.allocatedToBalance")}),L&&(0,r.jsxs)(b.Z,{color:"primary.main",fontWeight:"bold",children:[Y.toBalance,"%"]})]}),(0,r.jsxs)(v.Z,{textAlign:"right",children:[(0,r.jsx)(y.Z,{value:_.symbol,onChange:e=>
1eu(e.target.value),variant:"standard",sx:{display:"flex",alignItems:"center",height:"34px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)","& .MuiSelect-select:focus":{bgcolor:"transparent"},"&:before":{display:"none"},"&:after":{display:"none"},mb:.2},children:X.map(e=>(0,r.jsx)(j.Z,{value:e.symbol,sx:{display:"flex",alignItems:"center"},children:(0,r.jsxs)(b.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(C.Z,{alt:"currency",width:"crypto"===e.type?20:25,src:e.logoUrl,borderRadius:.1}),e.symbol,_.symbol!==e.symbol&&(0,r.jsxs)(r.Fragment,{children:[" - ",k(Number(e.amount),e.type||"")]})]})},e.symbol))}),(0,r.jsxs)(b.Z,{variant:"h4",color:"primary.main",children:[(0,d.dN)(ec(Y.toBalance,M,ea?ea[B]:"1"),"crypto"===_.type?"crypto/":"fiat/")," ",_.symbol]})]})]})]}),(A||F)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.Z,{variant:"body2",color:"grey.500",mb:1,children:E("bonus.instructions.chooseCurrency",{currency:A?"XCD":"USD"})}),(0,r.jsx)(b.Z,{variant:"body2",color:"grey.500",mb:1,children:E("bonus.instructions.clickClaim")})]}),!N&&(0,r.jsxs)(v.Z,{sx:{borderRadius:2,overflow:"hidden"},children:[(0,r.jsxs)(v.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pb:{xs:"30px"}},children:[(0,r.jsx)(v.Z,{sx:{display:"flex",alignItems:"center",height:"34px",width:"110px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)"},children:A?(0,r.jsxs)(b.Z,{children:[(0,r.jsx)(a.default,{src:"".concat("https://img.xyes.com/","assets/icons/logos/xyes-favicon-dark-mode.svg"),alt:"XCD",width:24,height:24,style:{marginRight:"8px"}})," ","XCD"]}):(0,r.jsxs)(b.Z,{display:"flex",alignItems:"center",children:[(0,r.jsx)(C.Z,{alt:"currency",width:25,src:"".concat("https://img.xyes.com/","assets/images/fiat/usd.png"),style:{marginRight:"8px"}})," ","USD"]})}),(0,r.jsx)(b.Z,{variant:"h6",children:(0,d.dN)(Number(F||A?M:ec(Y.toBalance,M,z)),"crypto"===_.type?"crypto/":"fiat/")})]}),(0,r.jsx)(v.Z,{sx:{position:"relative",height:0,display:"flex",justifyContent:"center",my:.5},children:(0,r.jsxs)(v.Z,{sx:{width:50,height:50,bgcolor:"#1a1f2e",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",top:"-25px",border:"6px solid #111928"},children:[(0,r.jsx)(o.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20}),(0,r.jsx)(o.JO,{icon:"teenyicons:arrow-down-solid",color:"#ff9800",width:20})]})}),(0,r.jsxs)(v.Z,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",bgcolor:"rgba(255, 255, 255, 0.03)",pt:{xs:"30px"}},children:[(0,r.jsx)(y.Z,{value:_.symbol,onChange:e=>eu(e.target.value),variant:"standard",sx:{display:"flex",alignItems:"center",height:"34px",border:"1px solid grey",borderRadius:"4px",padding:"0 8px",bgcolor:"rgba(0, 0, 0, 0.2)","& .MuiSelect-select:focus":{bgcolor:"transparent"},"&:before":{display:"none"},"&:after":{display:"none"}},children:X.map(e=>(0,r.jsx)(j.Z,{value:e.symbol,sx:{display:"flex",alignItems:"center"},children:(0,r.jsxs)(b.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(C.Z,{alt:"currency",width:"crypto"===e.type?20:25,src:e.logoUrl,borderRadius:.1}),e.symbol,_.symbol!==e.symbol&&(0,r.jsxs)(r.Fragment,{children:[" - ",k(Number(e.amount),e.type||"")]})]})},e.symbol))}),(0,r.jsxs)(v.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,r.jsx)(b.Z,{color:"grey.400",variant:"caption",children:E("bonus.currency")}),(0,r.jsx)(b.Z,{variant:"h6",align:"right",children:A?S(M,_,_.type||""):S(ec(Y.toBalance,M,z),_,_.type||"")})]})]})]}),(0,r.jsxs)(b.Z,{variant:"caption",color:"grey.500",align:"right",display:"block",sx:{mt:1,mb:2},children:["1 ",A?"XCD":"USD"," ≈ ",(0,d.dN)(Number(z),"crypto/")," ",_.symbol]}),(0,r.jsx)(w.Z,{fullWidth:!0,variant:"contained",sx:{bgcolor:"#f57c00","&:hover":{bgcolor:"#fb8c00"},borderRadius:2,py:1.5,fontSize:"1.1rem",color:"white"},onClick:ed,disabled:H||el,children:el?(0,r.jsx)(Z.Z,{size:20}):E("bonus.claimNow")})]}):null}},1869:function(e,t,n){n.d(t,{bw:function(){return i},re:function(){return o},un:function(){return r}});let r=e=>{let t=e=>{let t=[e.claimAttempt1,e.claimAttempt2,e.claimAttempt3];if(t.every(e=>e.claimed)){var n;return Number((null===(n=e.toCalendarCommissionAmount)||void 0===n?void 0:n.$numberDecimal)||0)}return t.reduce((e,t)=>
1{var n;return t.claimed?e+Number((null===(n=t.amount)||void 0===n?void 0:n.$numberDecimal)||0):e},0)},n=e=>{let t=new Date,n=t>new Date(e.expirationTime),r=!e.claimed&&!n&&t>=new Date(e.availableTime);return{claimed:e.claimed,claimable:r,claimableAmount:Number(e.amount.$numberDecimal),expired:n,availableTime:e.availableTime,expirationTime:e.expirationTime,amount:Number(e.amount.$numberDecimal)}},r=new Map;return e.forEach(e=>{if(!r.has(e.requestDate)){var i;let o=[e.claimAttempt1,e.claimAttempt2,e.claimAttempt3].filter(Boolean).map(n);r.set(e.requestDate,{_id:e._id,userId:e.userId,memberId:e.memberId,calendarBonusType:e.calendarBonusType,expirationHours:e.expirationHours,totalAmount:Number((null===(i=e.toCalendarCommissionAmount)||void 0===i?void 0:i.$numberDecimal)||0),totalClaimed:t(e),bonusDay:a(e.requestDate),createdAt:e.createdAt,status:e.status,isClaimable:o.some(e=>e.claimable),claimAttempts:o,day:e.requestDate})}}),Array.from(r.values())},a=e=>{let t=new Date(e),n=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),r=Number(n.getUTCDate().toString().padStart(2,"0"));return{day:r,month:Number((n.getUTCMonth()+1).toString().padStart(2,"0")),year:n.getUTCFullYear(),dayOfWeek:n.toLocaleDateString("en-US",{weekday:"short",timeZone:"UTC"})}},i=e=>{if(!e||0===e.length)return"";let t=e.some(e=>e.claimable),n=e.some(e=>e.claimed),r=e.every(e=>e.expired&&!e.claimed);return e.some(e=>!e.claimed&&!e.claimable&&!e.expired)&&!t?{icon:"ic:outline-watch-later",color:"white"}:r?{icon:"humbleicons:times-circle",color:"#ff0000"}:t?{icon:"humbleicons:currency-dollar-circle",color:"#ff7901"}:n?{icon:"humbleicons:check-circle",color:"#22c55e"}:""},o=(e,t)=>{if(!(null==e?void 0:e.data)||!(null==t?void 0:t.data))return[];let{cryptos:n=[],fiats:r=[]}=t.data,{cryptos:a=[],fiats:i=[]}=e.data;return[...a.filter(e=>n.includes(e.symbol)),...i.filter(e=>r.includes(e.symbol))]}},19018:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}});var r=n(57437),a=n(60033),i=n(71923),o=n(73535),l=n(50979),s=n(23521),c=n(47080),d=n(1899);function u(e){let{router:t}=e,{getLang:n}=(0,a.i)(),u=n(),{data:m,isFetching:x}=(0,l._)({populate:[{key:"populate[image][populate]",value:"image"},{key:"populate[cta][populate]",value:"cta"},{key:"populate[backgroundImage][populate]",value:"backgroundImage"}],locale:{key:"locale",value:u}}),h=m?(m.data||[]).map((e,t)=>{var n;return(0,r.jsx)(o.r,{title:e.attributes.heading||"",subtitle:e.attributes.subHeading||"",description:e.attributes.description||"",cta:null!==(n=e.attributes.cta)&&void 0!==n?n:void 0},e.id||t)}):[],p=(0,s.t5)(m).map(e=>({backgroundImage:(0,s.WI)(e),cover:(0,s.eq)(e),children:h.find(t=>String(t.key)===String(e.id)),onClick:()=>{t.push((0,s.fC)(e))}})),g=null;return x?g=(0,r.jsx)(c.Z,{variant:"rectangular",width:"100%",sx:{borderRadius:2,height:{xs:195,sm:195,md:195,lg:350},width:"100%"}}):p.length>0&&(g=(0,r.jsx)(i.Z,{items:p})),(0,r.jsx)(d.Z,{my:1,children:g})}},82059:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var r=n(57437),a=n(2265),i=n(31301),o=n(59062),l=n(17475),s=n(7310),c=n.n(s);let d=(e,t)=>{let[n,r]=(0,a.useState)(void 0),i=(0,a.useMemo)(()=>c()(r,100),[]);(0,a.useEffect)(()=>()=>{i.cancel()},[i]);let o=(0,a.useCallback)(()=>{e?(null==t?void 0:t.token)?r(t):i(t):r({token:null})},[e,t,i]);return(0,a.useEffect)(()=>{o()},[e,t,o]),{token:n}};var u=n(31691),m=n(82156),x=n(89414),h=n(47080);function p(e){let{authenticated:t,loading:n}=e,s=(0,o.K$)(),c=(0,u.Z)(),p=(0,m.Z)(c.breakpoints.down("md")),g=(0,a.useMemo)(()=>t&&!!s.currencyType&&!!s.language,[t,s.currencyType,s.language]),{data:f,refetch:v,isLoading:b}=(0,l.O)(s.currencyType,s.language,t,g),{token:y}=d(t,f),j=(0,a.useMemo)(()=>n||b||!y||""===y.token,[n,b,y]);return(0,r.jsx)(r.Fragment,{children:j?(0,r.jsx)(x.ZP,{container:!0,spacing:1,children:Array.from(Array(p?1:3)).map((e,t)=>(0,r.jsx)(x.ZP,{item:!0,xs:12,sm:12,lg:4,xl:4,display:"flex",justifyContent:"center",my:1.5,children:(0,r.jsx)(h.Z,{variant:"rectangular",width:"100%",height:p?142:152,sx:{borderRadius:2}})},t))}):(0,r.jsx)(i.Z,{response:y,refetch:v})})}},94403:function(e,t,n){var r=n(57437),a=n(27648),i=n(33145),o=n(60033),l=n(63597),s=n(36067),c=n(1899),d=n(82156),u=n(46387);let m=e=>{let{src:t}=e;return(0,r.jsx)(c.Z,{sx:{width:24,height:24,position:"relative",mr:"0.1rem"},children:(0,r.jsx)(i.default,{src:t,alt:"icon",fill:!0,style:{objectFit:"contain"}})})},x=e=>{let{title:t,subtitle:n,icon:a,hideSubtitle:i,isCard:o,noGrid:l,isDrawer:s}=e,x="string"==typeof a?a:void 0,h=(0,d.Z)("(max-width:639px)"),p=(0,d.Z)("(min-width:1080px)");return(0,r.jsxs)(c.Z,{sx:{height:"100%",width:!o&&l?"60%":"100%",display:"flex",flexDirection:"column",...!i&&(h||p)?{justifyContent:"center",alignItems:"center"}:{justifyContent:s?"center":"flex-start",alignItems:s?"center":"flex-start"},pt:s?0:"0.5rem",...o&&{alignItems:"center",zIndex:2}},children:[(0,r.jsxs)(c.Z,{sx:{ml:l?0:{xs:s?0:"1rem",sm:0},display:"flex",alignItems:s?"center":"left",justifyContent:s?"center":"flex-start",width:"100%"},children:[x&&(0,r.jsx)(m,{src:x}),(0,r.jsx)(u.Z,{variant:"h3",sx:{ml:"0.3rem",color:s?"#8D98A9":"white",fontWeight:600,textAlign:"left",textDecoration:"none"},children:t})]}),!i&&(h||p)&&(0,r.jsx)(u.Z,{variant:"body2",sx:{color:"rgba(255, 255, 255, 0.7)",textDecoration:"none",textAlign:o?"center":"left",fontSize:"calc(0.25rem + 0.25vw)",...o&&{mt:"auto"},px:s&&n?"10px":0},children:n})]})};t.Z=e=>{let{avatar:t,href:n,subtitle:i,title:d,icon:u,hideSubtitle:m=!1,isCard:h=!1,noGrid:p=!1,isDrawer:g=!1}=e,{showMessage:f}
1=(0,s.useSnackbar)(),{t:v}=(0,o.i)();return(0,r.jsx)(a.default,{href:n||"#",passHref:!0,onClick:e=>{"/"===n&&(e.preventDefault(),f(v("errors.comingSoon"),"info"))},style:{textDecoration:"none"},children:(0,r.jsx)(c.Z,{sx:{height:"100%",display:"flex",textDecoration:"none"},children:(0,r.jsx)(l.Z,{hideSubtitle:m,image:t,borderColor:g?"orange.800":"secondary.main",background:"#1C2334",sx:{width:"100%",textDecoration:"none",height:h?"auto":"100%",flex:h?"1 1 auto":void 0,position:"relative",borderTop:g?"orange.800":"none"},isDrawer:g,children:(0,r.jsx)(x,{title:d,subtitle:i,hideSubtitle:m||g,icon:u,isCard:h,noGrid:p,isDrawer:g})})})})}},83220:function(e,t,n){n.d(t,{zi:function(){return h}});var r=n(57437),a=n(60033),i=n(20418),o=n(43161),l=n(57099),s=n(94403),c=n(77342),d=n(71872),u=n(1899),m=n(89414),x=n(82156);let h=e=>{let{isDrawer:t,toggleDrawer:n}=e,{getLink:h}=(0,o.m)(),{getLang:p}=(0,a.i)(),g=p(),{authenticated:f}=(0,i.E)(),v=(0,x.Z)("(min-width:640px)"),{data:b}=(0,c.z)({populate:[{key:"populate[image][populate]",value:"image"},{key:"populate[icon][populate]",value:"icon"},{key:"populate[cta][populate]",value:"cta"}],filter:{key:"locale",value:g}}),y=(null==b?void 0:b.data.length)?(0,d.f)(b.data.filter(e=>e.attributes.displayInDrawer),f):[];return(0,r.jsx)(u.Z,{sx:{display:"flex",flexDirection:v?"row":"column",gap:{xs:1,sm:2},width:"100%",height:"100%",backgroundColor:"palette.grey.900"},children:(0,r.jsx)(u.Z,{sx:{width:"100%",minWidth:0,backgroundColor:"palette.grey.900"},children:(0,r.jsx)(m.ZP,{container:!0,gap:t?"3vw":"1vw",sx:{display:"flex",justifyContent:"space-between",alignItems:"space-between",height:"100%",backgroundColor:"palette.grey.900",mt:0},children:y.map((e,a)=>{let{image:i,link:o,subtitle:c,title:d,icon:u,isExternal:x}=e;return(0,r.jsx)(m.ZP,{item:!0,xs:c?12:6,onClick:o?n:void 0,sx:{display:"flex",flexDirection:"column",width:c?"100%":{xs:"100%",sm:"50%"},flexBasis:c?"100%":t?"48%":"49%",justifyContent:"flex-start",backgroundColor:"#1C2334",borderRadius:1,"&:hover":{["& #".concat("card-image-container")]:{transform:"scale(1.02)",transition:"transform 0.3s ease-in-out"}}},children:(0,r.jsx)(s.Z,{avatar:i,href:x?o:h((0,l.zS)(o||"")),subtitle:c,title:d,hideSubtitle:!c,icon:u,isDrawer:t})},"quick-link-".concat(a))})})})})}},76212:function(e,t,n){n.r(t),n.d(t,{QuickLink:function(){return f},default:function(){return v},quickLinkItemId:function(){return g}});var r=n(57437),a=n(60033),i=n(20418),o=n(43161),l=n(57099),s=n(94403),c=n(77342),d=n(71872),u=n(1899),m=n(89414),x=n(82156),h=n(47080);let p=()=>{let e=(0,x.Z)("(min-width:640px)");return(0,r.jsxs)(u.Z,{sx:{display:"flex",flexDirection:e?"row":"column",gap:{xs:1,sm:2},width:"100%",height:"100%"},children:[(0,r.jsx)(u.Z,{sx:{width:{xs:"100%",sm:"50%"},display:"flex",flexDirection:e?"row":"column",gap:{xs:.5,sm:1},minWidth:0},children:Array.from([,,]).map((e,t)=>(0,r.jsx)(u.Z,{sx:{flex:1,minWidth:0},children:(0,r.jsx)(h.Z,{variant:"rectangular",width:"100%",sx:{borderRadius:2,height:{xs:119,sm:199,md:199,lg:295}}})},"large-skeleton-".concat(t)))}),(0,r.jsx)(u.Z,{sx:{width:{xs:"100%",sm:"50%"},minWidth:0},children:(0,r.jsx)(m.ZP,{container:!0,spacing:{xs:1,sm:2},sx:{height:"100%",mt:"0px !important","& > .MuiGrid-item":{pt:"0 !important",pl:"8px !important"}},children:Array.from([,,,,]).map((e,t)=>(0,r.jsx)(m.ZP,{item:!0,xs:6,sx:{mt:{xs:t>=2?.5:0,sm:t>=2?1:0}},children:(0,r.jsx)(h.Z,{variant:"rectangular",width:"100%",sx:{borderRadius:2,height:{xs:95,sm:95,md:95,lg:140}}})},"small-skeleton-".concat(t)))})})]})},g={imageContainer:"card-image-container",linkButton:"link-button"},f=e=>{let{isDrawer:t}=e,{getLink:n}=(0,o.m)(),{getLang:h}=(0,a.i)(),{authenticated:f}=(0,i.E)(),v=h(),b=(0,x.Z)("(min-width:640px)"),{data:y,isFetching:j}=(0,c.z)({populate:[{key:"populate[image][populate]",value:"image"},{key:"populate[icon][populate]",value:"icon"},{key:"populate[cta][populate]",value:"cta"}],filter:{key:"locale",value:v}}),w=(null==y?void 0:y.data.length)?(0,d.f)(y.data,f):[];return(0,r.jsx)(r.Fragment,{children:j?(0,r.jsx)(p,{}):(0,r.jsxs)(u.Z,{sx:{display:"flex",flexDirection:b?"row":"column",gap:{xs:1,sm:2},width:"100%",height:"100%"},children:[(0,r.jsx)(u.Z,{sx:{width:{xs:"100%",sm:"50%"},display:"flex",flexDirection:b?"row":"column",gap:{xs:.5,sm:1},minWidth:0},children:w.slice(t?1:0,2).map((e,a)=>{let{image:i,link:o,subtitle:c,title:d,icon:m,isExternal:x}=e;return(0,r.jsx)(u.Z,{sx:{flex:1,minWidth:0,"&:hover":{["& #".concat(g.imageContainer)]:{transform:"scale(1.02)",transition:"transform 0.3s ease-in-out"}}},children:(0,r.jsx)(s.Z,{avatar:i,href:x?o:n((0,l.zS)(o||"")),subtitle:c,title:d,icon:m,isCard:b,noGrid:!0,isDrawer:t})},"large-".concat(a))})}),(0,r.jsx)(u.Z,{sx:{width:{xs:"100%",sm:"50%"},minWidth:0},children:(0,r.jsx)(m.ZP,{container:!0,spacing:{xs:1,sm:2},sx:{height:"100%",mt:"0px !important","& > .MuiGrid-item":{pt:"0 !important",pl:"8px !important"}},children:w.slice(2).map((e,a)=>{let{image:i,link:o,subtitle:c,title:d,icon:u,isExternal:x}=e;return(0,r.jsx)(m.ZP,{item:!0,xs:6,sx:{mt:{xs:a>=2?.5:0,sm:a>=2?1:0},"&:hover":{["& #".concat(g.imageContainer)]:{transform:"scale(1.02)",transition:"transform 0.3s ease-in-out"},width:{xs:"100%",sm:"66%"}}},children:(0,r.jsx)(s.Z,{avatar:i,href:x?o:n((0,l.zS)(o||"")),subtitle:c,title:d,hideSubtitle:!0,icon:u,isDrawer:t})},"small-".concat(a))})})})]})})};var v=f},25252:function(e,t,n){n.r(t),n.d(t,{BetTable:function(){return A}});var r=n(57437),a=n(60033),i=n(2265),o=n(73992);let l={position:"relative",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",overflow:"hidden","&:after":{width:"100%",position:"absolute",bottom:0,left:0,content:'""',background:"linear-gradient(181deg,#0d131c00 21.34%,#0d131c 99.18%)",height:254,pointerEvents:"none"}};var s=n(16593),c=n(55447);let d=()=>{let e="".concat(c.Hv.betting.simulation);return(0,s.a)({queryKey:["getBettingSimulation",e],queryFn:async()=>{let t=(await c.ZP.get(e,{params:{limit:500}})).data.data;return{allData:t,firstTen:t.slice(0,10),rest:t.slice(10)}}})};var u=n(31691),m=n(82156),x=n(19643),h=n(1899),p=n(46387),g=n(22095),f=n(70208),v=n(32281),b=n(28314),y=n(52988),j=n(59469),w=n(33145),Z=n(8149);let C=e=>0===e?"warning.main":e>0?"success.main":"error";var S=e=>{let{bet:t,isNew:n}=e,a=(0,u.Z)(),i=(0,m.Z)(a.breakpoints.down("sm")),{gameName:o,user:{avatar:l,memberUsername:s},currency:{logoUrl:c,fiatId:d},betAmount:h,multiplier:g,payout:f,winLoss:v}=t;return(0,r.jsxs)(b.Z,{style:{backgroundColor:"#0b1529",animation:n?"slideIn 0.3s ease-out":"",opacity:1,transition:"opacity 0.3s ease-out"},sx:{"@keyframes slideIn":{from:{opacity:0,transform:"translateY(-20px)"},to:{opacity:1,transform:"translateY(0)"}},"& td:first-of-type":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& td:last-of-type":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:[(0,r.jsx)(y.Z,{sx:{width:i?"45%":"25%",maxWidth:0,overflow:"hidden"},children:(0,r.jsx)(x.Z,{alignItems:"center",direction:"row",gap:1,sx:{minWidth:0},children:(0,r.jsx)(p.Z,{variant:"td",noWrap:!0,children:o})})}),!i&&(0,r.jsx)(y.Z,{sx:{width:"30%",maxWidth:0,overflow:"hidden"},children:(0,r.jsxs)(x.Z,{alignItems:"center",direction:"row",gap:1,sx:{minWidth:0},children:[(0,r.jsx)(w.default,{alt:"avatar",height:25,src:l,width:25,style:{flexShrink:0}}),(0,r.jsx)(p.Z,{variant:"td",noWrap:!0,children:s})]})}),i&&(0,r.jsx)(y.Z,{sx:{width:"15%",maxWidth:0,overflow:"hidden"},children:(0,r.jsx)(w.default,{alt:"avatar",height:24,src:l,width:24,style:{flexShrink:0}})}),!i&&(0,r.jsx)(y.Z,{sx:{width:"15%",maxWidth:0,overflow:"hidden"},children:(0,r.jsxs)(x.Z,{alignItems:"center",direction:"row",gap:2,sx:{minWidth:0},children:[(0,r.jsx)(w.default,{alt:"chip",height:d?20:25,src:c||"".concat("https://img.xyes.com/","assets/fallback-2.png"),width:25,style:{flexShrink:0}}),(0,r.jsx)(p.Z,{fontWeight:a.typography.fontWeightMedium,variant:"td",noWrap:!0,children:(0,Z.q)(h)})]})}),!i&&(0,r.jsx)(y.Z,{sx:{width:"10%",maxWidth:0,overflow:"hidden"},children:(0,r.jsx)(x.Z,{alignItems:"center",direction:"row",sx:{minWidth:0,width:"100%"},justifyContent:"center",children:(0,r.jsxs)(p.Z,{fontWeight:a.typography.fontWeightMedium,variant:"td",noWrap:!0,children:["x",g]})})}),(0,r.jsx)(y.Z,{sx:{width:i?"40%":"20%",maxWidth:0,overflow:"hidden"},children:(0,r.jsxs)(x.Z,{alignItems:"center",direction:"row",gap:2,sx:{minWidth:0},children:[(0,r.jsx)(w.default,{alt:"chip",height:d?20:25,src:c||"".concat("https://img.xyes.com/","assets/fallback-2.png"),width:25,style:{flexShrink:0}}),(0,r.jsx)(p.Z,{fontWeight:a.typography.fontWeightBold,variant:"td",color:C(v),noWrap:!0,children:(0,Z.q)(f)})]})})]})};
1let k=[{type:"all-bets",icon:"/assets/icons/navbar/ic_crypto_swap.svg",label:"allBets"}],I=["game","user","betAmount","multiplicator","payout"],M=e=>{var t,n,r;return"string"==typeof(null==e?void 0:null===(t=e.user)||void 0===t?void 0:t.avatar)&&"string"==typeof(null==e?void 0:null===(n=e.user)||void 0===n?void 0:n.memberUsername)&&"string"==typeof(null==e?void 0:null===(r=e.currency)||void 0===r?void 0:r.symbol)&&"string"==typeof(null==e?void 0:e.gameName)&&"number"==typeof(null==e?void 0:e.betAmount)&&"number"==typeof(null==e?void 0:e.multiplier)&&"number"==typeof(null==e?void 0:e.payout)&&"number"==typeof(null==e?void 0:e.winLoss)},A=()=>{let{t:e}=(0,a.i)(),t=(0,u.Z)(),n=(0,m.Z)(t.breakpoints.down("sm")),{data:s,refetch:c}=d(),w=(0,i.useMemo)(()=>((null==s?void 0:s.firstTen)||[]).filter(M),[s]),[Z,C]=(0,i.useState)([]),[A,F]=(0,i.useState)(0),[D,_]=(0,i.useState)([]);return(0,i.useEffect)(()=>{C(((null==s?void 0:s.allData)||[]).filter(M)),F(0)},[s]),(0,i.useEffect)(()=>{let e=w.filter(M);_(e),F(e.length)},[w]),(0,i.useEffect)(()=>{let e=setInterval(()=>{c().then(e=>{var t;if(null===(t=e.data)||void 0===t?void 0:t.allData){let t=e.data.allData.filter(M);C(e=>[...e,...t])}})},6e4);return()=>clearInterval(e)},[c]),(0,i.useEffect)(()=>{if(0===Z.length)return()=>{};let e=setInterval(()=>{_(e=>{if(0===Z.length)return e;let t=A%Z.length,n=[Z[t],...e];return n.length>10&&n.pop(),n}),F(e=>(e+1)%Z.length)},1e3);return()=>clearInterval(e)},[Z,A]),(0,r.jsxs)(x.Z,{direction:"column",gap:2,children:[(0,r.jsx)(h.Z,{mt:2,position:"relative",children:(0,r.jsx)(h.Z,{sx:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start"},children:k.map((t,n)=>{let{type:a,icon:i,label:l}=t;return(0,r.jsxs)(x.Z,{direction:"row",alignItems:"center",spacing:1,sx:{cursor:"pointer","&:hover":{opacity:.8}},children:[(0,r.jsx)(o.d3,{iconUrl:i,style:{color:"primary.main",flexShrink:0,width:{xs:"18px",sm:"20px",md:"22px",lg:"24px"},height:{xs:"18px",sm:"20px",md:"22px",lg:"24px"}}}),(0,r.jsx)(p.Z,{variant:"h2",sx:{textAlign:"left",width:"100%"},children:e("dashboard.table.groupTypes.".concat(l))})]},n)})})}),(0,r.jsx)(g.Z,{sx:l,children:(0,r.jsxs)(f.Z,{sx:{width:"100%",".MuiTableCell-root":{borderBottom:"none"},borderCollapse:"separate",borderSpacing:"0 3px"},children:[(0,r.jsx)(v.Z,{children:(0,r.jsx)(b.Z,{sx:{"& th:first-of-type":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& th:last-of-type":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:I.filter((e,t)=>!n||[0,1,4].includes(t)).map((t,n)=>(0,r.jsx)(y.Z,{children:e("dashboard.table.headers.".concat(t))},n))})}),(0,r.jsx)(j.Z,{children:D.filter(M).map((e,t)=>(0,r.jsx)(S,{bet:e,isNew:0===t},"".concat(e.user.memberUsername,"-").concat(t)))})]})})]})}},77342:function(e,t,n){n.d(t,{z:function(){return l}});var r=n(55447),a=n(16593),i=n(45345),o=n(49931);let l=e=>{let{filter:t,populate:n,locale:l}=e,s=(0,o.Aj)(r.Hv.cms.getBettingCards,{filter:t,populate:n,locale:l});return(0,a.a)({queryKey:["getCMSBettingCards",s.toString()],queryFn:()=>(0,o.DQ)(s.toString(),"betting-cards"),placeholderData:i.Wk,refetchOnMount:!1,refetchOnWindowFocus:!1})}}}]);

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.