1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3952,3423,8761,6067,7302,4708],{25805:function(e,t,n){n.d(t,{Z:function(){return g}});var a=n(57437),i=n(2265),r=n(43949),o=n(32175),s=n(55447),l=n(19902),c=n(46387),d=n(73126),u=n(1899),p=n(44811);function g(e){let{siteKey:t="0b66a2cc-2420-41c6-9e3c-18d696fcd79c",onVerify:n,onExpire:g,onError:m,theme:h="light",size:x="normal",buttonText:f="Submit",title:y="register.verifyHuman"}=e,[v,j]=(0,i.useState)(null),[b,C]=(0,i.useState)(!1),{t:w}=(0,r.$G)(),Z=(0,i.useRef)(null),k=async e=>{j(null);try{var t,a,i;let r=await s.ZP.post("https://api.xyes.com/api/v1"+s.Hv.auth.verifyCaptcha,{captcha:e});(null===(t=r.data)||void 0===t?void 0:t.data)&&(null===(i=r.data)||void 0===i?void 0:null===(a=i.data)||void 0===a?void 0:a.success)?(C(!0),n&&n(e)):(j("Failed to verify captcha. Please try again."),C(!1))}catch(e){j("Failed to verify captcha. Please try again."),C(!1)}};return(0,a.jsxs)(l.Z,{elevation:3,sx:{p:3,maxWidth:500,mx:"auto"},children:[(0,a.jsx)(c.Z,{variant:"h6",gutterBottom:!0,children:w(y)}),v&&(0,a.jsx)(d.Z,{severity:"error",sx:{mb:2},children:v}),b&&(0,a.jsx)(d.Z,{severity:"success",sx:{mb:2},children:w("register.verificationSuccess")}),(0,a.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[(0,a.jsx)(o.Z,{sitekey:t,onVerify:k,onExpire:()=>{C(!1),g&&g()},onError:e=>{j("Error verifying captcha. Please try again."),C(!1),m&&m(e)},ref:Z,theme:h,size:x}),"invisible"!==x&&(0,a.jsx)(u.Z,{sx:{display:"flex",gap:2,mt:2},children:(0,a.jsx)(p.Z,{variant:"outlined",onClick:()=>{Z.current&&Z.current.resetCaptcha(),C(!1),j(null)},children:w("register.reset")})})]})]})}},47302:function(e,t,n){n.r(t),n.d(t,{default:function(){return r}});var a=n(57437),i=n(29501);function r(e){let{children:t,onSubmit:n,methods:r}=e;return(0,a.jsx)(i.RV,{...r,children:(0,a.jsx)("form",{onSubmit:n,children:t})})}},11417:function(e,t,n){n.d(t,{a:function(){return c},Z:function(){return a.default}});var a=n(47302),i=n(57437);n(2265);var r=n(29501),o=n(1899),s=n(89051),l=n(12713);function c(e){let{name:t,helperText:n,type:a,tooltip:c,handleTooltipClose:d,open:u,labelInput:p,boxStyles:g,maxLength:m,...h}=e,{control:x}=(0,r.Gc)(),f=g||{width:"100%"};return(0,i.jsx)(r.Qr,{name:t,control:x,render:e=>{let{field:r,fieldState:{error:g}}=e,x={...h.inputProps,autoComplete:"new-password",...m?{maxLength:m}:{}},y=p?(0,i.jsxs)(o.Z,{sx:f,children:[p,(0,i.jsx)(l.Z,{...r,id:t,fullWidth:!0,type:a,value:"number"===a&&0===r.value?"":r.value,onChange:e=>{"number"===a?r.onChange(Number(e.target.value)):r.onChange(e.target.value)},error:!!g,helperText:g?g.message:n,...h,inputProps:x})]}):(0,i.jsx)(l.Z,{...r,id:t,fullWidth:!0,type:a,value:"number"===a&&0===r.value?"":r.value,onChange:e=>{"number"===a?r.onChange(Number(e.target.value)):r.onChange(e.target.value)},error:!!g,helperText:g?g.message:n,...h,inputProps:{...h.inputProps,autoComplete:"new-password"}});return c?(0,i.jsx)(s.Z,{placement:"top-start",title:c,PopperProps:{disablePortal:!0},onClose:d,open:u,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,arrow:!0,children:y}):y}})}}
1,28761:function(e,t,n){var a=n(57437),i=n(2265),r=n(44811),o=n(12713),s=n(31691),l=n(82156),c=n(1899);function d(e){return e>5?5:e<0?0:e}let u={inputValues:Array(6).fill(""),focusedIndex:0,status:"idle"},p=e=>{let{index:t,value:n,onChange:r,onPaste:s,onBackspace:l,isFocused:c,onFocus:d,isDisabled:u}=e,p=(0,i.useRef)(null);return(0,i.useEffect)(()=>{p.current&&c&&p.current.focus()},[c]),(0,a.jsx)(o.Z,{inputRef:p,type:"text",value:n,onChange:e=>{r(t,e.target.value)},onPaste:e=>{s(e.clipboardData.getData("text"))},onKeyDown:e=>{"Backspace"===e.key&&""===n&&l(t)},inputProps:{maxLength:1,style:{textAlign:"center"},autoComplete:"off"},onFocus:()=>{d(t)},disabled:u,variant:"outlined",size:"medium"})};function g(e,t){switch(t.type){case"INPUT":return{...e,inputValues:[...e.inputValues.slice(0,t.payload.index),t.payload.value,...e.inputValues.slice(t.payload.index+1)],focusedIndex:d(t.payload.index+1)};case"BACK":{let n=d(t.payload.index-1);return{...e,inputValues:[...e.inputValues.slice(0,n),"",...e.inputValues.slice(n+1)],focusedIndex:n}}case"PASTE":return{...e,inputValues:e.inputValues.map((e,n)=>t.payload.pastedValue[n]||"")};case"FOCUS":return{...e,focusedIndex:t.payload.focusedIndex};case"VERIFY":return{...e,status:"pending"};case"VERIFY_SUCCESS":return{...e,status:"success"};case"VERIFY_FAILURE":return{...e,status:"failure"};case"CLEAR_INPUTS":return{...u};default:throw Error("unknown action")}}t.Z=e=>{let{defaultButtonText:t="Submit",footer:n,loadingButtonText:o="Loading...",handleSubmit:d,showButton:m=!0,buttonColor:h,fullWidthButton:x=!1,buttonMarginTop:f=0}=e,[{inputValues:y,focusedIndex:v,status:j},b]=(0,i.useReducer)(g,u),C=(0,s.Z)(),w=(0,l.Z)(C.breakpoints.down("sm")),Z=(e,t)=>{b({type:"INPUT",payload:{index:e,value:t}})},k=e=>{b({type:"BACK",payload:{index:e}})},S=e=>{b({type:"PASTE",payload:{pastedValue:e}})},I=e=>{b({type:"FOCUS",payload:{focusedIndex:e}})},P=y.every(e=>""!==e),E=async e=>{if(e.preventDefault(),P){b({type:"VERIFY"});try{await d(y),b({type:"VERIFY_SUCCESS"})}catch(e){b({type:"VERIFY_FAILURE"})}finally{setTimeout(()=>{b({type:"CLEAR_INPUTS"})},2e3)}}};return(0,i.useEffect)(()=>{P&&!m&&E(new Event("submit"))},[P,m]),(0,a.jsx)("form",{onSubmit:E,children:(0,a.jsxs)(c.Z,{display:"flex",flexDirection:"column",gap:2,alignItems:"center",children:[(0,a.jsx)(c.Z,{display:"flex",gap:w?.5:2,children:y.map((e,t)=>(0,a.jsx)(p,{index:t,value:e,onChange:Z,onBackspace:k,onPaste:S,isFocused:t===v,onFocus:I,isDisabled:"pending"===j},t))}),n&&(0,a.jsx)(c.Z,{width:"100%",children:n}),m&&(0,a.jsx)(r.Z,{type:"submit",disabled:"pending"===j||!P,variant:"header",fullWidth:x,sx:{mt:f,pt:1.5,pb:1.5,pr:4,pl:4,backgroundColor:h?"".concat(h,".main"):"primary.main","&:hover":{backgroundColor:h?"".concat(h,".dark"):"primary.dark"},...h&&{boxShadow:2,"&:hover":{backgroundColor:"".concat(h,".dark"),boxShadow:2}}},children:"pending"===j?o:t})]})})}},97918:function(e,t,n){n.d(t,{W:function(){return c}});var a=n(2265),i=n(68575),r=n(14086),o=n(77533),s=n(55844),l=n(20418);let c=()=>{let{initialize:e}=(0,l.E)(),[t,n]=(0,a.useState)(!1),c=(0,i.I0)();return{signIn:async(t,a,i,l,d)=>{try{if(n(!0),c((0,s.VH)()),c((0,o.j_)()),"success"===t.code){let{token:a,two_factor_enabled:o,email:s,getStreamToken:c,expiresIn:u}=t.data;if(o&&l&&d){l(!0),d(s||""),n(!1);return}i(!1),(0,r.KY)(a,c,u),await e(!0),n(!1)}else n(!1),a(t.error.message),i(!0)}catch(t){let e="An error occurred";t instanceof Error&&(e=t.message),n(!1),i(!0),a("string"==typeof t?t:e)}},pending:t}}},24468:function(e,t,n){var a=n(83464),i=n(2265);t.Z=()=>{let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(!0),[o,s]=(0,i.useState)(null),l=(0,i.useCallback)(async(e,n)=>{try{var i,r;let o=await a.default.get("https://api.ipify.org?format=json");if((null===(i=o.data)||void 0===i?void 0:i.ip)&&!["127.0.0.1","::1"].includes(o.data.ip)){t({ip:o.data.ip,country:"Unknown"});return}let l=await a.default.get("https://ipapi.co/json/");if((null===(r=l.data)||void 0===r?void 0:r.ip)&&!["127.0.0.1","::1"].includes(l.data.ip)){t({ip:l.data.ip,country:l.data.country||"Unknown"});return}e<3?(await new Promise(t=>setTimeout(t,1e3*(e+1))),await n(e+1)):(t({ip:"127.0.0.1",country:"Unknown"}),s("Could not get public IP address"))}catch(a){e<3?(await new Promise(t=>setTimeout(t,1e3*(e+1))),await n(e+1)):(s("All IP services failed"),t({ip:"127.0.0.1",country:"Unknown"}))}},[]),c=(0,i.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;r(!0);try{let n=await a.default.get("https://ipinfo.io/json?token=".concat("acf04414abd562"));n.data.ip&&!["127.0.0.1","::1"].includes(n.data.ip)?t(n.data):await l(e,c)}catch(t){await l(e,c)}finally{r(!1)}},[l]);return(0,i.useEffect)(()=>{c()},[c]),{ipData:e,loading:n,error:o}}},77116:function(e,t,n){n.r(t),n.d(t,{AuthDialog:function(){return e_}});var a=n(57437),i=n(27648),r=n(33145),o=n(60033),s=n(78948),l=n(55447),c=n(76975),d=n(20418),u=n(43161),p=n(2265),g=n(59062),m=n(60834),h=n(95671),x=n(17034),f=n(19643),y=n(6809),v=n(31691),j=n(82156);function b(e){let{setErrorMessage:t,setOpenMessage:n,setIs2FARequired:i,onGoogleSignUpSuccess:o}=e,{getPromotionCode:c}=(0,m.b)(),d=(0,v.Z)(),u=(0,j.Z)(d.breakpoints.down("md")),b=(0,g.K$)(),{trackClick:C}=(0,h.T)(),{signUpWithTelegram:w,connectingToTelegram:Z}=(0,x.Ou)({setErrorMessage:t,setOpenMessage:n,language:b.language,promotionCode:c}),{signUpWithGoogle:k,connectingToGoogle:S}=(0,x.IN)({setErrorMessage:t,setOpenMessage:n,setIs2FARequired:i,onGoogleSignUpSuccess:o,language:b.language,promotionCode:c}),{signUpWithMetamask:I,connectingToMetamask:P}=(0,x.cS)({setErrorMessage:t,setOpenMessage:n,language:b.language,promotionCode:c}),[E,_]=(0,p.useState)(!1),F=(0,p.useCallback)(async()=>{_(!0);try{let e=c(),t="".concat("https://api.xyes.com/api/v1").concat(l.Hv.auth.lineSignUpInit).concat(e?"?promo=".concat(e):""),n=await fetch(t),a=await n.json().catch(()=>null),i=null==a?void 0:a.authorizationUrl;window.location.href=i}catch(e){t((null==e?void 0:e.message)||"LINE sign up failed.")}finally{_(!1)}},[t,c]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(f.Z,{direction:"row",spacing:u?0:2,flexWrap:"wrap",gap:u?.9:2,justifyContent:u?"space-between":"left",children:[{connecting:S,onClick:()=>{k(),C("CompleteRegistration","google_signup_button")},iconAlt:"googleIcon",iconSrc:"ic_google.svg"},{connecting:E,onClick:()=>{F(),C("CompleteRegistration","line_signup_button")},iconAlt:"lineIcon",iconSrc:"ic_line.svg"},{connecting:Z,onClick:()=>{w(),C("CompleteRegistration","telegram_signup_button")},iconAlt:"telegramIcon",iconSrc:"ic_telegram.svg"},{connecting:P,onClick:()=>{I(),C("CompleteRegistration","metamask_signup_button")},iconAlt:"metamaskIcon",iconSrc:"ic_metamask.svg"}].map((e,t)=>{let{connecting:n,onClick:i,iconAlt:o,iconSrc:l}=e;return(0,a.jsx)(y.Z,{sx:{border:"1px solid",borderColor:s.y0.terciary,minWidth:"auto",padding:"8px",flexGrow:1},variant:"outlinedPrimary",loading:n,disabled:n,onClick:i,children:!n&&(0,a.jsx)(r.default,{alt:o,height:25,src:"".concat("https://img.xyes.com/","assets/icons/platforms/").concat(l),width:25})},t)})})})}var C=n(28761),w=n(16210),Z=n(8350),k=n(1899),S=n(46387);let I=(0,w.ZP)(Z.Z)(e=>{let{theme:t}=e;return{"&.MuiDivider-root":{"&::before, &::after":{borderColor:"rgba(255, 255, 255, 0.12)"}}}});function P(){return(0,a.jsx)(k.Z,{sx:{width:"100%",my:2},children:(0,a.jsx)(I,{children:(0,a.jsx)(S.Z,{variant:"body2",sx:{color:"text.secondary",px:2,textTransform:"uppercase"},children:"OR"})})})}var E=n(34422),_=n(66274),F=n(56982),A=n(29501),R=n(73904),T=n(10207),M=n(11417);let V=(0,w.ZP)(R.Z)(e=>{let{theme:t}=e;return{minHeight:"48px","& .MuiTabs-indicator":{display:"none"}}}),O=(0,w.ZP)(T.Z)(e=>{let{theme:t}=e;return{flex:1,minHeight:"36px",color:s.y0.terciary,backgroundColor:"transparent",border:"1px solid",borderColor:s.y0.terciary,margin:"0px !important",padding:"0px","&.Mu
1i-selected":{color:"#FFFFFF",backgroundColor:s.y0.terciary},"&:not(.Mui-selected)":{backgroundColor:"transparent"},"&:first-of-type":{borderRadius:"8px 0 0 8px"},"&:last-of-type":{borderRadius:"0 8px 8px 0"}}});function L(e){let{activeTab:t,setActiveTab:n,methods:i,t:r,PRIMARY_LIGHT:o,phoneValue:s,handlePhoneChange:l}=e;return(0,a.jsxs)(k.Z,{sx:{width:"100%"},children:[(0,a.jsxs)(V,{value:t,onChange:(e,t)=>{n(t),i.resetField("emailOrPhone"),i.clearErrors("emailOrPhone")},variant:"fullWidth",sx:{mb:2},children:[(0,a.jsx)(O,{label:(0,a.jsxs)(k.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,a.jsx)(c.Z,{icon:"system-uicons:mail"}),r("login.email")]}),value:"email"}),(0,a.jsx)(O,{label:(0,a.jsxs)(k.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,a.jsx)(c.Z,{icon:"ph:phone-call-light"}),r("login.phoneNumber")]}),value:"phone"})]}),(0,a.jsx)(k.Z,{children:(0,a.jsx)(A.Qr,{name:"emailOrPhone",control:i.control,render:e=>{let{field:n,fieldState:i}=e;return(0,a.jsx)(a.Fragment,{children:"phone"===t?(0,a.jsx)(F.Kr,{...n,value:s,defaultCountry:"CR",fullWidth:!0,label:(0,a.jsxs)(k.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,a.jsx)(c.Z,{icon:"ph:phone-call-light",color:o}),"\xa0",(0,a.jsx)("span",{children:r("login.phoneNumber")})]}),helperText:i.invalid?r("auth.validation.phoneInvalid"):"",error:i.invalid,onChange:e=>{n.onChange(e),l(e)}}):(0,a.jsx)(M.a,{...n,label:(0,a.jsxs)(k.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,a.jsx)(c.Z,{icon:"system-uicons:mail",color:o}),"\xa0",(0,a.jsx)("span",{children:r("login.email")})]}),helperText:i.invalid?r("auth.validation.emailInvalid"):"",error:i.invalid,onChange:e=>{n.onChange(e.target.value)}})})}})})]})}var q=n(97918),W=n(21770),D=n(18229),U=n(31162),z=n(61746);let H=e=>{let{setErrorMessage:t,setOpenMessage:n,setIs2FARequired:a,setEmail:i,promotionCode:r}=e,o=(0,W.D)({mutationKey:["sign-in-google"],mutationFn:e=>{let{credential:t,promotionCode:n}=e;return(0,U.nS)(t,void 0,"function"==typeof n?n():void 0)}}),{signIn:s,pending:l}=(0,q.W)(),c=(0,D.Nq)({onSuccess:async e=>{try{let l=await o.mutateAsync({credential:e.access_token,promotionCode:r});s(l,t,n,a,i)}catch(e){t(e.message||"errors.googleSignIn"),n(!0)}},onError(e){t(e.error_description||"errors.anErrorOccurred"),n(!0)}});return{signInWithGoogle:()=>{if((0,z.UV)()){try{(0,z.ju)({mode:"sign-in",promotionCode:"function"==typeof r?r():void 0})}catch(e){t(e instanceof Error?e.message:"errors.anErrorOccurred"),n(!0)}return}c()},connectingToGoogle:o.isPending||l}};n(82957).Buffer;var N=n(49218);n(45990);var B=n(7604);let K=e=>{let{setErrorMessage:t,setOpenMessage:n,promotionCode:a}=e,i=(0,W.D)({mutationKey:["sign-in-metamask"],mutationFn:U.Jx}),r=(0,W.D)({mutationKey:["sign-metamask-step-2"],mutationFn:U.sh}),{signIn:o,pending:s}=(0,q.W)();return{signInWithMetamask:async e=>{let s;let l=new B.cR,c=0;do await l.init(),s=l.getProvider(),c+=1;while(!s&&c<=3);if(!s){t("Metamask is not installed on your browser");return}try{let e=await s.request({method:"eth_requestAccounts"});if(!e||!Array.isArray(e)||"string"!=typeof e[0])throw Error("Failed to retrieve accounts from MetaMask");let l=e[0],c="function"==typeof a?a():void 0,d=await i.mutateAsync({publicAddress:l,promotionCode:c});if("success"===d.code){let{messageToSign:e}=d.data,a=await s.request({method:"personal_sign",params:[e,l]}),i={publicAddress:l,messageToSign:e,signature:"string"==typeof a?a:""};if(!i.signature)throw Error("Invalid signature received from MetaMask");let c=await r.mutateAsync(i);o(c,t,n)}else t(d.error.message)}catch(e){n(!0),t("string"==typeof e?e:e.message)}},connectedToMetamask:i.isSuccess,connectingToMetamask:i.isPending||r.isPending||s}};var G=n(45355),Y=n(79987);let Q=(0,Y.k3)(),$=e=>{let{setErrorMessage:t,setOpenMessage:n,promotionCode:a}=e,i=(0,W.D)({mutationKey:["sign-in-telegram"],mutationFn:U.YH}),{signIn:r}=(0,q.W)(),{onAuth:o,isLoading:s}=(0,G.Z)(Q,{windowFeatures:{width:500,height:800,popup:!0}},{onSuccess:async e=>{let o=await i.mutateAsync({telegramId:e.id?String(e.id):"",telegramUser:e.username,name:e.first_name,lastname:e.last_name,promotionCode:"function"==typeof a?a():void 0});await r(o,t,n)},onError:e=>{n(!0),t("string"==typeof e?e:e.message)}});return{signInWithTelegram:()=>{if((0,Y.T4)()){(0,Y.Q2)({mode:"sign-in",promotionCode:"function"==typeof a?a():void 0});return}o()},connectingToTelegram:s}},J=e=>{let{setErrorMessage:t,setOpenMessage:n,setIs2FARequired:a,setEmail:i,onGoogleSignInSuccess:r,promotionCode:o}=e,[,s]=(0,p.useState)(null),l=(0,W.D)({mutationKey:["sign-in-google-2fa"],mutationFn:e=>{let{credential:t,twoFactorCode:n,promotionCode:a}=e;return(0,U.nS)(t,n,"function"==typeof a?a():void 0)}}),{signIn:c,pending:d}=(0,q.W)(),u=(0,D.Nq)({onSuccess:async e=>{s(e.access_token),await g({credential:e.access_token,promotionCode:o})},onError(e){t(e.error_description||"errors.anErrorOccurred"),n(!0)}}),g=(0,p.useCallback)(async e=>{try{if(!e.credential){if((0,z.UV)()){let t;"function"==typeof o?t=o():"function"==typeof e.promotionCode&&(t=e.promotionCode()),(0,z.ju)({mode:"sign-in",promotionCode:t});return}u();return}let s=await l.mutateAsync(e);
1"success"===s.code&&s.data.two_factor_enabled&&!e.twoFactorCode?(r&&r({credential:e.credential,clientId:"",twoFactorCode:""}),a(!0)):c(s,t,n,a,i)}catch(e){t(("string"==typeof e?e:e.message)||"errors.googleSignIn"),n(!0)}},[l,c,t,n,a,i,u,r,o]);return{signInWithGoogle2Fa:g,connectingToGoogle2Fa:l.isPending||d}},X=e=>{let{setErrorMessage:t,setOpenMessage:n,setIs2FARequired:a,setEmail:i}=e,r=(0,W.D)({mutationKey:["sign-in-email-password"],mutationFn:U.ED}),{signIn:o,pending:s}=(0,q.W)();return{signInWithEmailAndPassword:async e=>{o(await r.mutateAsync(e),t,n,a,i)},connectingWithEmailAndPassword:r.isPending||s}};var ee=n(68575),et=n(27371),en=n(14086),ea=n(75349);let ei=e=>{let{setErrorMessage:t,setOpenMessage:n}=e,{useIsActivating:a}=ea.hooks,i=(0,ee.v9)(e=>e.user.data),r=(0,_.tv)(),{getLink:o}=(0,u.m)(),{initialize:s}=(0,d.E)(),l=a(),c=(0,N.useWeb3React)(),{account:g}=c,{connector:m}=c,h=(0,_.lr)(),x=h.get("modal"),f=h.get("tab"),y=(0,p.useRef)(!1),v=(0,p.useRef)(!1),j=(0,W.D)({mutationKey:["sign-in-walletconnect"],mutationFn:U.aL}),b=async()=>{try{await ea.walletConnectV2.resetState(),await ea.walletConnectV2.deactivate(),await ea.walletConnectV2.activate()}catch(e){}},C=(0,p.useCallback)(e=>{try{null==t||t(e||"errors.anErrorOccurred"),null==n||n(!0)}catch(e){}},[t,n]),w=(0,p.useCallback)(async e=>{if(y.current=!0,(0,et.UJ)(e)&&!(null==i?void 0:i._id))try{await j.mutateAsync(e).then(e=>{"success"===e.code&&e.data.token&&((0,en.KY)(e.data.token,e.data.getStreamToken,e.data.expiresIn),s()),y.current=!1,v.current=!0,r.push(o())}).catch(e=>{var t,n;y.current=!1;let a=(null==e?void 0:e.data)&&(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.message)?null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.message:(null==e?void 0:e.message)||"errors.anErrorOccurred";C(a)})}catch(e){y.current=!1,C(null==e?void 0:e.message)}},[o,s,j,r,C,null==i?void 0:i._id]);return(0,p.useEffect)(()=>{!g||m!==ea.walletConnectV2||(null==i?void 0:i._id)||v.current||y.current||"auth"!==x||1!==Number(f)||w(g)},[g,w,m,x,f,null==i?void 0:i._id]),{signInWithWalletConnect:b,isConnectingToWalletConnect:l}};var er=n(95576),eo=n(23996),es=n(98107);let el=E.Ry().shape({twoFactorCode:E.Z_().required("2FA Code is required")});function ec(e){let{setErrorMessage:t,setOpenMessage:n}=e,{t:i}=(0,o.i)(),l=(0,es.k)(),d=(0,_.tv)(),u=(0,v.Z)(),[g,m]=(0,p.useState)(!1),[x,j]=(0,p.useState)(null),[,b]=(0,p.useState)(""),[,w]=(0,p.useState)(!1),[Z,I]=(0,p.useState)(""),[P,R]=(0,p.useState)("email"),{trackClick:T}=(0,h.T)(),V=E.Ry().shape({emailOrPhone:E.Z_().required(i("auth.validation.emailOrPhoneRequire")).test("emailOrPhone",i("auth.validation.emailOrPhoneInvalid"),e=>"email"===P?E.Z_().email().isValidSync(e.trim()):(0,F.Cs)(e)),password:E.Z_().required("Password is required")}),O=async(e,t,n)=>{let{is2FARequired:a}=t;T("SignIn_Email","signin_button");try{return{values:await (a?el:V).validate(e,{abortEarly:!1}),errors:{}}}catch(e){if(e instanceof E.p8)return{values:{},errors:e.inner.reduce((e,t)=>{var n;return{...e,[t.path]:{type:null!==(n=t.type)&&void 0!==n?n:"validation",message:t.message}}},{})};return{values:{},errors:{}}}},{signInWithEmailAndPassword:q,connectingWithEmailAndPassword:W}=X({setErrorMessage:t,setOpenMessage:n,setIs2FARequired:e=>{if(m(e),e){let{emailOrPhone:e,password:t}=D.getValues();j({emailOrPhone:e.toLowerCase(),password:t}),b(e.toLowerCase())}},setEmail:b}),D=(0,A.cI)({resolver:O,defaultValues:{emailOrPhone:"",password:"",twoFactorCode:""},context:{is2FARequired:g}}),{handleSubmit:U,formState:{isSubmitting:z},setValue:H}=D;(0,p.useEffect)(()=>{g&&x&&(H("emailOrPhone",x.emailOrPhone),H("password",x.password))},[g,x,H]);let N=async e=>{H("twoFactorCode",e.join("")),await B()},B=U(async e=>{try{if(g&&x){let t="phone"===P?{phone:x.emailOrPhone}:{email:x.emailOrPhone.trim()};await q({...t,password:x.password,twoFactorCode:e.twoFactorCode})}else{let t=e.emailOrPhone.trim().toLocaleLowerCase(),n="phone"===P?{phone:t}:{email:t};b(t),j({emailOrPhone:t,password:e.password}),await q({...n,password:e.password})}}catch(e){n(!0),t("string"==typeof e?e:e.message)}}),K=u.palette.primary.light,G=(0,a.jsxs)(f.Z,{spacing:2.5,sx:{display:"flex",width:"100%"},children:[g?(0,a.jsxs)(k.Z,{mt:3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",children:[(0,a.jsx)(S.Z,{mb:2,color:u.palette.grey[400],variant:"h5",align:"center",children:i("login.verificationCode")}),(0,a.jsxs)(f.Z,{direction:"row",mb:5,alignItems:"center",gap:2,justifyContent:"space-between",sx:{backgroundColor:s.y0.buttonOutlinedBG,padding:"1rem",borderRadius:"0.5rem",border:e=>"1px solid ".concat(e.palette.orange[500])},children:[(0,a.jsx)(k.Z,{alignSelf:"center",children:(0,a.jsx)(r.default,{alt:"2fa_disable.svg icon",height:74,width:84,src:"".concat("https://img.xyes.com/","assets/images/security/2fa-icon.svg")})}),(0,a.jsx)(k.Z,{alignSelf:"center",children:(0,a.jsxs)(S.Z,{children:[" ",i("login.youHaveEnabled2FAVerification")]})})]}),(0,a.jsx)(C.Z,{handleSubmit:N,defaultButtonText:i("login.verify"),loadingButtonText:i("login.verifying"),showButton:!1})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{activeTab:P,setActiveTab:R,methods:D,t:i,PRIMARY_LIGHT:K,phoneValue:Z,handlePhoneChange:e=>{let t=e.replace(/^\+\s?/,"");/^\d[\d\s]*$/.test(t.trim())?(I("+ ".concat(t.trim())),w(!0)):(I(e),w(!1))}}),(0,a.jsx)(M.a,{autoComplete:"off",name:"password",label:(0,a.jsxs)(k.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,a.jsx)(c.Z,{icon:"solar:lock-password-linear",color:K}),"\xa0",(0,a.jsx)("span",{children:i("login.password")})]}),type:l.value?"text":"password",InputProps:{endAdornment:(0,a.jsx)(eo.Z,{position:"end",children:(0,a.jsx)(er.Z,{onClick:l.onToggle,edge:"end",children:(0,a.jsx)(c.Z,{icon:l.value?"solar:eye-bold":"solar:eye-closed-bold"})})})}})]}),!g&&(0,a.jsxs)(k.Z,{component:"span",onClick:()=>d.push("?modal=reset-password&step=send-message"),sx:{alignSelf:"flex-start",color:e=>e.palette.blue[1e3],cursor:"pointer","&:hover":{textDecoration:"underline"}},children:[i("login.forgotPassword"),"?"]}),(0,a.jsx)(y.Z,{fullWidth:!0,color:"inherit",size:"large",type:"submit",variant:"header",loading:z||W,children:i(g?"login.verify":"login.signIn")}
1),(0,a.jsx)(S.Z,{variant:"caption",color:"#9CA3AF",children:i("login.termsOfServiceConfirmation")})]});return(0,a.jsx)(M.Z,{methods:D,onSubmit:B,children:G})}var ed=n(24468),eu=n(73842),ep=n(25805),eg=n(85637),em=n(44811),eh=n(92566),ex=n(73053),ef=n(85860),ey=e=>{let{validationResults:t,passwordValue:n}=e,{t:i}=(0,o.i)(),r=[{key:"length",met:t.hasMinLength,text:i("validators.minimumCharacter",{minimum:8})},{key:"digit",met:t.hasDigit,text:i("validators.atLeastOneDigit")},{key:"letter",met:t.hasLowerCase,text:i("validators.atLeastOneCharacter")}].filter(e=>!e.met);return n?(0,a.jsx)(k.Z,{component:"span",children:(0,a.jsx)(S.Z,{variant:"caption",color:"error",children:r.map((e,t)=>(0,a.jsxs)("span",{children:[e.text,t<r.length-1?", ":""]},e.key))})}):null};let ev=(0,w.ZP)(em.Z)(e=>{let{theme:t}=e;return{flex:1,minHeight:"36px",color:s.y0.terciary,backgroundColor:"transparent",border:"1px solid",borderColor:s.y0.terciary,margin:"0px !important",padding:"0px","&.Mui-selected":{color:"#FFFFFF",backgroundColor:s.y0.terciary},"&:not(.Mui-selected)":{color:t.palette.grey[500]},"&:first-of-type":{borderRadius:"8px 0 0 8px"},"&:last-of-type":{borderRadius:"0 8px 8px 0"}}});function ej(e){let{setErrorMessage:t,setOpenMessage:n}=e,i=(0,g.K$)(),{t:l}=(0,o.i)(),[d]=(0,p.useState)(!1),[u,j]=(0,p.useState)(!1),{ipData:b}=(0,ed.Z)(),[w,Z]=(0,p.useState)("US"),{getPromotionCode:I,setPromotionCode:_}=(0,m.b)(),[R,T]=(0,p.useState)(!1),{trackClick:V}=(0,h.T)(),[O,L]=(0,p.useState)(!1),[q,W]=(0,p.useState)(!1),[D,U]=(0,p.useState)("");(0,p.useEffect)(()=>{b&&Z(b.country)},[b]);let z=(0,v.Z)(),{signUpWithEmailAndPassword:H}=(0,x._d)({setErrorMessage:t,setOpenMessage:n}),{activateUser:N}=(0,x.k1)({setErrorMessage:t,setOpenMessage:n}),[B,K]=(0,p.useState)(!0),G=(0,es.k)(),Y=z.palette.primary.light,Q=E.Ry().shape({phone:E.Z_().when("isEmail",{is:!1,then:e=>e.required(l("validators.phoneIsRequired")).test("is-valid-phone",l("validators.phoneIsInvalid"),e=>(0,F.Cs)(e)),otherwise:e=>e.notRequired()}),email:E.Z_().when("isEmail",{is:!0,then:e=>e.required(l("validators.emailIsRequired")).email(l("validators.emailMustBeaValidEmailAddress")),otherwise:e=>e.notRequired()}),password:E.Z_().matches(/(.*\d.*)/,l("validators.atLeastOneDigit")).min(1,l("validators.atLeastOneCharacter")).min(8,l("validators.minimumCharacter",{minimum:8})).required(l("validators.passwordIsRequired")),isEmail:E.O7().required(),promotionCode:E.Z_().nullable(),termsAccepted:E.O7().required(l("validators.termsRequired")).oneOf([!0],l("validators.termsRequired"))}),$=(0,A.cI)({resolver:(0,eu.X)(Q),defaultValues:{phone:"",email:"",password:"",isEmail:!0,promotionCode:"",termsAccepted:!0}}),{control:J,handleSubmit:X,formState:{isSubmitting:ee},setValue:et,watch:en}=$;(0,p.useEffect)(()=>{let e=I();e&&et("promotionCode",e)},[I,et]);let ea=async e=>{let t=$.getValues("isEmail")?$.getValues("email"):$.getValues("phone");if(t){let n={type:$.getValues("isEmail")?"email":"phone",contact:t,code:e.join("")};await N(n),V("CompleteRegistration","".concat($.getValues("isEmail")?"email":"phone","_signup_success_button"))}},ei=en("password",""),el=(0,eg.u)(ei),ec=(0,a.jsx)(f.Z,{direction:"row",sx:{mb:2},children:(0,a.jsxs)(ev,{"aria-label":"close",variant:B?"contained":"outlined",className:B?"Mui-selected":"",size:"small",fullWidth:!0,onClick:()=>{K(!0),et("isEmail",!0),W(!1),L(!1),U("")},children:[(0,a.jsx)(c.Z,{icon:"system-uicons:mail"}),l("register.email")]})}),em=async(e,a)=>{try{if(V("CompleteRegistration","signup"),!e.termsAccepted){t(l("validators.termsRequired")),n(!0);return}let r={email:e.email.toLowerCase(),phone:e.phone,password:e.password,repeatPassword:e.password,isEmail:e.isEmail,language:i.language,promotionCode:e.promotionCode||void 0,captcha:a};e.phone||await H(r)||j(!0)}catch(e){n(!0),t("string"==typeof e?e:e.message),L(!1),U("")}},ej=async e=>{try{if(!O){W(!0);return}await em(e,D)}catch(e){n(!0),t("string"==typeof e?e:e.message)}},eb=async e=>{L(!0),W(!1),U(e);let t=$.getValues();await em(t,e)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P,{}),ec,u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.Z,{my:3,color:z.palette.grey[400],variant:"h5",align:"center",children:l("login.verificationCode")}),(0,a.jsxs)(f.Z,{direction:"row",mb:5,alignItems:"center",gap:2,justifyContent:"space-between",sx:{backgroundColor:s.y0.buttonOutlinedBG,padding:"1rem",borderRadius:"0.5rem",border:"1px solid ".concat(z.palette.orange[500])},children:[(0,a.jsx)(k.Z,{alignSelf:"center",children:(0,a.jsx)(r.default,{alt:"2fa_disable.svg icon",height:74,width:84,src:"".concat("https://img.xyes.com/","assets/images/security/2fa-icon.svg")})}),(0,a.jsx)(k.Z,{alignSelf:"center",children:B?(0,a.jsx)(S.Z,{children:l("login.theEmailVerificationCodeHasBeenSentToYourInbox")}
1):(0,a.jsx)(S.Z,{children:l("login.theSMSVerificationCodeHasBeenSentYourPhoneNumber")})})]}),(0,a.jsx)(C.Z,{handleSubmit:ea,defaultButtonText:l("register.verifyAccount")})]}):(0,a.jsx)(M.Z,{methods:$,onSubmit:X(ej),children:(0,a.jsxs)(f.Z,{spacing:2.5,children:[B?(0,a.jsx)(M.a,{name:"email",type:"email",autoComplete:"true",label:(0,a.jsxs)(k.Z,{sx:{display:"flex",justifyContent:"left",zIndex:9},children:[(0,a.jsx)(c.Z,{icon:"system-uicons:mail",color:Y}),"\xa0",(0,a.jsx)("span",{children:l("register.email")})]})}):(0,a.jsx)(A.Qr,{name:"phone",control:J,rules:{validate:e=>(0,F.Cs)(e)},render:e=>{let{field:t,fieldState:n}=e;return(0,a.jsx)(F.Kr,{...t,defaultCountry:w,label:(0,a.jsxs)(k.Z,{sx:{display:"flex",justifyContent:"left",zIndex:9},children:[(0,a.jsx)(c.Z,{icon:"ph:phone-call-light",color:Y}),"\xa0",(0,a.jsx)("span",{children:l("register.phoneNumber")})]}),helperText:n.invalid?"Phone number is invalid":"",error:n.invalid})}}),(0,a.jsx)(M.a,{name:"password",type:G.value?"text":"password",autoComplete:"new-password",open:d,label:(0,a.jsxs)(k.Z,{sx:{display:"flex",justifyContent:"left",zIndex:9},children:[(0,a.jsx)(c.Z,{icon:"solar:lock-password-linear",color:Y}),"\xa0",(0,a.jsx)("span",{children:l("register.password")})]}),InputProps:{endAdornment:(0,a.jsx)(eo.Z,{position:"end",children:(0,a.jsx)(er.Z,{onClick:G.onToggle,edge:"end",children:(0,a.jsx)(c.Z,{icon:G.value?"solar:eye-bold":"solar:eye-closed-bold"})})})},FormHelperTextProps:{component:"div"},helperText:(0,a.jsx)(ey,{validationResults:el,passwordValue:ei})}),(0,a.jsx)(ef.Z,{control:(0,a.jsx)(eh.Z,{checked:R,onChange:e=>T(e.target.checked)}),label:(0,a.jsx)(S.Z,{component:"div",sx:{textAlign:"left",typography:"caption",color:"text.secondary"},children:l("register.promoCode")})}),R&&(0,a.jsx)(M.a,{name:"promotionCode",type:"text",onChange:e=>{$.setValue("promotionCode",e.target.value),_(e.target.value)},label:(0,a.jsxs)(k.Z,{sx:{display:"flex",justifyContent:"left",zIndex:9},children:[(0,a.jsx)(c.Z,{icon:"ph:gift-light",color:Y}),"\xa0",l("register.enterPromoCode")]}),placeholder:l("register.enterPromoCode")}),q&&(0,a.jsx)(ep.Z,{onVerify:eb,onError:e=>{t(e),n(!0)},title:l("register.verifyHuman"),buttonText:l("register.verify")}),(0,a.jsxs)(f.Z,{spacing:0,children:[(0,a.jsx)(A.Qr,{name:"termsAccepted",control:J,render:e=>{let{field:t}=e;return(0,a.jsx)(ef.Z,{control:(0,a.jsx)(eh.Z,{checked:t.value,onChange:e=>t.onChange(e.target.checked),required:!0,defaultChecked:!0}),sx:{marginRight:0,"& .MuiFormControlLabel-asterisk":{display:"none"}},label:(0,a.jsx)(S.Z,{component:"div",sx:{textAlign:"left",typography:"caption",color:"text.secondary"},children:l("register.userAgreement")})})}}),(0,a.jsx)(ef.Z,{control:(0,a.jsx)(eh.Z,{}),label:(0,a.jsx)(S.Z,{component:"div",sx:{textAlign:"center",typography:"caption",color:"text.secondary"},children:l("register.promotionsXyes")})})]}),(0,a.jsx)(y.Z,{fullWidth:!0,type:"submit",color:"inherit",size:"large",variant:"header",loading:ee,disabled:q&&!O,sx:{cursor:q&&!O?"not-allowed":"pointer",opacity:q&&!O?.7:1},loadingIndicator:(0,a.jsx)(ex.Z,{color:"primary",size:16}),children:l("register.createAccount")})]})})]})}var eb=n(67972),eC=n(35791),ew=n(77468),eZ=n(89414),ek=n(93062),eS=n(19902),eI=n(17162),eP=n(73126);let eE=e=>{let{isMobile:t,handleGoogleSignIn:n,handleLineSignIn:i,handleTelegramSignIn:o,handleMetamaskSignIn:s,handlePhantomSignIn:l,handleCoinbaseSignIn:c,handleWalletConnectSignIn:d,connectingToGoogle:u,connectingToLine:p,connectingToTelegram:g,connectingToMetamask:m,connectingToCoinbase:h,connectingToWalletConnect:x,connectingToPhantom:v}=e;return(0,a.jsx)(f.Z,{direction:"row",spacing:t?0:2,flexWrap:"wrap",gap:t?.9:2,justifyContent:t?"space-between":"left",children:[{alt:"googleIcon",loading:u,disabled:u,onClick:n,src:"ic_google.svg"},{alt:"lineIcon",loading:p,disabled:p,onClick:i,src:"ic_line.svg"},{alt:"telegramIcon",loading:g,disabled:g,onClick:o,src:"ic_telegram.svg"},{alt:"metamaskIcon",loading:m,disabled:m,onClick:s,src:"ic_metamask.svg"}].map(e=>{let{alt:t,loading:n,disabled:i,onClick:o,src:s}=e;return(0,a.jsx)(y.Z,{sx:{border:"1px solid",borderColor:"#1C2334",minWidth:"auto",padding:"8px",flexGrow:1},variant:"outlinedPrimary",loading:n,disabled:i,onClick:o,children:!n&&(0,a.jsx)(r.default,{alt:t,height:25,src:"".concat("https://img.xyes.com/","assets/icons/platforms/").concat(s),width:25})},t)})})},e_=()=>{let{authenticated:e}=(0,d.E)(),t=(0,v.Z)(),n=(0,j.Z)(t.breakpoints.down("md")),r=(0,_.tv)(),g=(0,_.lr)(),{t:x}=(0,o.i)(),y=g.get("modal"),w=g.get("tab")||"1",Z=(0,_.jD)(),[I,E]=(0,p.useState)(""),[F,A]=(0,p.useState)(!0),[R,T]=(0,p.useState)(!1),[,M]=(0,p.useState)(""),[V,O]=(0,p.useState)(null),[L,q]=(0,p.useState)(null),{getPromotionCode:W}=(0,m.b)(),[D,U]=(0,p.useState)(!1),{getLink:z}=(0,u.m)(),{trackClick:N}=(0,h.T)();(0,p.useEffect)(()=>{e&&r.replace(Z)},[e,Z,r]);let{signInWithTelegram:B,connectingToTelegram:G}=$({setErrorMessage:E,setOpenMessage:A,setIs2FARequired:T,setEmail:M,promotionCode:W}),{connectingToGoogle:Y}=H({setErrorMessage:E,setOpenMessage:A,setIs2FARequired:T,setEmail:M,promotionCode:W}),{signInWithGoogle2Fa:Q}=J({setErrorMessage:E,setOpenMessage:A,setIs2FARequired:T,setEmail:M,onGoogleSignInSuccess:e=>{q(e),T(!0),O("google")},promotionCode:W}),{signInWithMetamask:X,connectingToMetamask:ee}=K({setErrorMessage:E,setOpenMessage:A,setIs2FARequired:T,setEmail:M,promotionCode:W}),{signInWithWalletConnect:et,isConnectingToWalletConnect:en}
1=ei({setErrorMessage:E,setOpenMessage:A}),[ea,eo]=(0,p.useState)(!1),es=(0,p.useCallback)(async()=>{eo(!0);try{let e=W(),t="".concat("https://api.xyes.com/api/v1").concat(l.Hv.auth.lineSignIn).concat(e?"?promo=".concat(e):""),n=await fetch(t),a=await n.json().catch(()=>null),i=null==a?void 0:a.authorizationUrl;window.location.href=i}catch(n){var e,t;E((null==n?void 0:null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||(null==n?void 0:n.message)||"LINE sign in failed.")}finally{eo(!1)}},[W]),el=(0,p.useCallback)(()=>{O("google"),N("SignIn_Google","google_signin_button"),Q({credential:""})},[Q,N]),ed=(0,p.useCallback)(()=>{O("telegram"),N("SignIn_Telegram","telegram_signin_button"),B()},[B,N]),eu=(0,p.useCallback)(()=>{},[]),ep=(0,p.useCallback)(()=>{O("walletConnect"),N("SignIn_WalletConnect","walletconnect_signin_button"),et()},[et,N]),eg=(0,p.useCallback)(async e=>{O("metamask"),N("SignIn_Metamask","metamask_signin_button");try{if(!e){T(!0);return}await X(e),T(!1),""!==I&&r.replace(Z)}catch(e){"INVALID_2FA"===e.message?E("Invalid 2FA code"):E(e.message||"An error occurred during Metamask sign-in"),A(!0)}},[N,X,I,r,Z]),eh=(0,p.useCallback)(()=>{},[]);(0,p.useEffect)(()=>{"Metamask is not installed on your browser"===I?U(!0):U(!1)},[I]);let ex=e=>{r.push(e)},ef=(0,p.useCallback)(async e=>{let t=e.join("");try{"google"===V&&L?await Q({credential:L.credential,twoFactorCode:t}):"metamask"===V&&await X(t)}catch(e){E("Invalid 2FA code"),A(!0)}},[V,L,Q,X]);return e?null:(0,a.jsx)(eC.Z,{fullWidth:!0,maxWidth:"md",open:"auth"===y||"authRequired"===y,onClose:()=>{"authRequired"!==y&&r.replace(Z)},PaperProps:{sx:{boxShadow:s.y0.boxShadow}},children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er.Z,{"aria-label":"close",sx:{position:"absolute",right:8,top:8,zIndex:10,color:e=>e.palette.grey[500]},onClick:()=>{"authRequired"===y?r.replace("/"):(r.replace(Z),Z.startsWith("/crypto/")&&r.push(z("")))},children:(0,a.jsx)(c.Z,{icon:"solar:close-circle-linear",sx:{height:30,width:30}})}),(0,a.jsx)(ew.Z,{sx:{p:0},children:(0,a.jsxs)(eZ.ZP,{container:!0,component:"main",md:12,sx:{minHeight:{md:700}},children:[(0,a.jsx)(ek.ZP,{}),(0,a.jsx)(eZ.ZP,{item:!0,xs:!1,sm:!1,md:6,sx:{backgroundImage:"url(".concat("https://img.xyes.com/","assets/images/signIn/authtiger.png)"),backgroundRepeat:"no-repeat",backgroundColor:e=>"light"===e.palette.mode?e.palette.grey[50]:e.palette.grey[900],backgroundSize:"cover",backgroundPosition:"50% 35%"}}),(0,a.jsx)(eZ.ZP,{item:!0,xs:12,sm:12,md:6,component:eS.Z,elevation:6,square:!0,children:(0,a.jsxs)(k.Z,{sx:{py:3},children:[!R&&(0,a.jsxs)(f.Z,{direction:"row",spacing:2,sx:{mb:2,px:n?2:3},children:[(0,a.jsx)(em.Z,{LinkComponent:i.default,"data-test":"sign-in-modal-button",size:"large",variant:"1"===w?"header":"outlinedPrimary",onClick:()=>{ex("?modal=".concat(y,"&tab=1")),A(!1)},children:x("login.signIn")}),(0,a.jsx)(em.Z,{LinkComponent:i.default,"data-test":"sign-up-modal-button",size:"large",variant:"1"===w?"outlinedPrimary":"header",onClick:()=>{ex("?modal=".concat(y,"&tab=2")),A(!1)},children:x("register.signUp")})]}),R?(0,a.jsxs)(k.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",mt:4,minHeight:"480px",px:n?2:6},children:[(0,a.jsx)(S.Z,{variant:"h6",align:"center",gutterBottom:!0,children:x("login.verificationCode")}),(0,a.jsx)(k.Z,{sx:{width:"100%",mt:2,mb:2},children:!!I&&(0,a.jsx)(eI.Z,{in:F,children:(0,a.jsx)(eP.Z,{severity:"error",action:(0,a.jsx)(er.Z,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{A(!1)},children:(0,a.jsx)(c.Z,{icon:"solar:close-circle-bold"})}),children:(0,a.jsx)(S.Z,{variant:"inherit",children:x(I)})})})}),(0,a.jsx)(C.Z,{handleSubmit:ef,defaultButtonText:x("login.verify"),loadingButtonText:x("auth.verifying")})]}):(0,a.jsxs)(a.Fragment,{children:["1"===w&&(0,a.jsxs)(k.Z,{sx:{mt:2,px:n?2:3},children:[(0,a.jsxs)(k.Z,{sx:{mb:3},children:[(0,a.jsx)(eE,{isMobile:n,handleLineSignIn:es,handleGoogleSignIn:el,handleTelegramSignIn:ed,handleMetamaskSignIn:eg,handlePhantomSignIn:eh,connectingToGoogle:Y,connectingToLine:ea,connectingToTelegram:G,connectingToMetamask:ee,handleCoinbaseSignIn:eu,connectingToCoinbase:!1,handleWalletConnectSignIn:ep,connectingToWalletConnect:en,connectingToPhantom:!1}),(0,a.jsx)(P,{}),(0,a.jsx)(k.Z,{sx:{width:"100%",mt:2,mb:2},children:!!I&&(0,a.jsx)(eI.Z,{in:F,children:(0,a.jsx)(eP.Z,{severity:"error",action:(0,a.jsx)(er.Z,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{A(!1)},children:(0,a.jsx)(c.Z,{icon:"solar:close-circle-bold"})}),children:(0,a.jsx)(S.Z,{variant:"inherit",children:x(I)})})})})]}),(0,a.jsx)(ec,{setErrorMessage:E,setOpenMessage:A})]}),"2"===w&&(0,a.jsxs)(k.Z,{sx:{mt:2,px:n?2:3},children:[(0,a.jsx)(k.Z,{sx:{mb:3},children:(0,a.jsx)(b,{setErrorMessage:E,setOpenMessage:A,setIs2FARequired:T,onGoogleSignUpSuccess:e=>{q(e),T(!0),O("google")}})}),(0,a.jsx)(k.Z,{sx:{width:"100%",mt:2,mb:2},children:!!I&&(0,a.jsx)(eI.Z,{in:F,children:(0,a.jsx)(eP.Z,{severity:"error",action:(0,a.jsx)(er.Z,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{A(!1)},children:(0,a.jsx)(c.Z,{icon:"solar:close-circle-bold"})}),children:(0,a.jsx)(S.Z,{variant:"inherit",children:x(I)})})})}),(0,a.jsx)(ej,{setErrorMessage:E,setOpenMessage:A,errorMsg:I})]})]})]})})]})}),(0,a.jsx)(eb.A,{title:"",showTitle:!1,disablePadding:!0,size:"800px",showModal:D,handleModal:()=>{U(!1),E("")},type:"missingMetamaskInstallation",modalProps:{open:D},height:"800px"})]})})}},36067:function(e,t,n){n.r(t),n.d(t,{SnackbarProvider:function(){return d}
1,useSnackbar:function(){return u}});var a=n(57437),i=n(2265),r=n(60033),o=n(73986),s=n(73126);let l=i.createContext(void 0),c=i.forwardRef((e,t)=>(0,a.jsx)(s.Z,{elevation:6,ref:t,variant:"filled",...e})),d=e=>{let{children:t}=e,[n,s]=i.useState({open:!1,message:"",type:"success",position:{vertical:"top",horizontal:"center"},autoHideDuration:3e3}),{t:d}=(0,r.i)(),u=i.useCallback(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{vertical:"top",horizontal:"center"},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3e3;s({open:!0,message:e,type:t,position:n,autoHideDuration:a})},[]),p=()=>{s(e=>({...e,open:!1}))},g=i.useMemo(()=>({showMessage:u}),[u]);return(0,a.jsxs)(l.Provider,{value:g,children:[t,(0,a.jsx)(o.Z,{open:n.open,autoHideDuration:n.autoHideDuration,onClose:p,anchorOrigin:n.position,children:(0,a.jsx)(c,{onClose:p,severity:n.type,sx:{backgroundColor:"info"===n.type?"#2196F3":void 0},children:d(n.message)})})]})},u=()=>{let e=i.useContext(l);if(!e)throw Error("useSnackbar must be used within a SnackbarProvider");return e}},85637:function(e,t,n){n.d(t,{u:function(){return s}});let a=/[A-Z]/,i=/[a-z]/,r=/\d/,o=/[a-zA-Z]/;function s(e){return{hasUpperCase:a.test(e),hasLowerCase:i.test(e),hasDigit:r.test(e),hasLetter:o.test(e),hasMinLength:e.length>=8}}}}]);
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.