1"use strict";(self.webpackChunkexchange=self.webpackChunkexchange||[]).push([[5587],{59219:function(e,t,o){o.d(t,{pc:function(){return ee}});var r,i,a,n,s,c,l,p,u,g,d,h,y,m,S,C,O,f,b,v,E,w,P,_,A,k,R,T,L,B,G,I,U,M,D,N,F,V,x,j,H=o(41876),$=o(7142),W=o(41961),z=o(77567),K=o(56218),Z=o.n(K),J=o(54424),Y=o(1239),q=o(94370);function Q(e,t,o,r){o&&Object.defineProperty(e,t,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(r):void 0})}function X(e,t,o,r,i){var a={};return Object.keys(r).forEach((function(e){a[e]=r[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=o.slice().reverse().reduce((function(o,r){return r(e,t,o)||o}),a),i&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}let ee=(r=(0,$.b2)(),i=H.action.bound,a=H.action.bound,n=H.action.bound,s=H.action.bound,c=H.action.bound,l=H.action.bound,p=H.action.bound,u=H.action.bound,g=H.action.bound,d=H.action.bound,h=H.action.bound,y=H.action.bound,m=H.action.bound,S=H.action.bound,C=H.action.bound,O=H.action.bound,f=H.action.bound,b=H.action.bound,v=H.action.bound,E=H.action.bound,w=H.action.bound,P=H.action.bound,_=H.action.bound,A=H.action.bound,k=H.action.bound,r((L=X((T=class{toggleSearchPopup(e){this.recentlyViewed=JSON.parse(localStorage.getItem("recentlyViewed")),this.recentlyViewed?.length>0&&(this.showSearchPopup=e)}clearRecentlyViewed(){localStorage.removeItem("recentlyViewed"),this.recentlyViewed=[],this.showSearchPopup=!1}changeToRecentToken(e){e.quoteCurrencyTag?this.routerService.push((0,q.KL)(e.baseCurrencyTag,e.quoteCurrencyTag)):this.routerService.push((0,q.s9)(e.slug)),this.setRecentlyViewedToken(e),this.toggleSearchPopup(!1)}setRecentlyViewedToken(e){const t=JSON.parse(localStorage.getItem("recentlyViewed"));this.recentlyViewed=[e],t&&(this.recentlyViewed=[...this.recentlyViewed,...t.filter((t=>t.baseCurrencyTag!==e.baseCurrencyTag))].slice(0,5)),localStorage.setItem("recentlyViewed",JSON.stringify(this.recentlyViewed))}resetFilters(){this.search.assets="",this.sort.assets.sortBy=Y.dJ,this.sort.assets.sortDirection="DESC",this.filter.assets.categories=[]}changeMobileColumnMode(e){this.mobileColumnsMode=e}resetSearch(){this.search.assets="",this.search.ieo=""}constructor(e){void 0===e&&(e=null),this.selfConfig=e,this.crowdsalesRepository=W.$.get(W.L.Repository.CrowdsalesRepository),this.currenciesRepository=W.$.get(W.L.Repository.CurrenciesRepository),this.currenciesInfoRepository=W.$.get(W.L.Repository.CurrenciesInfoRepository),this.crowdsaleService=W.$.get(W.L.Service.CrowdsaleService),this.tradingService=W.$.get(W.L.Service.TradingService),this.favouriteService=W.$.get(W.L.Service.FavouriteService),this.authService=W.$.get(W.L.Service.AuthService),this.projectService=W.$.get(W.L.Service.ProjectService),this.userRepository=W.$.get(W.L.Repository.UsersRepository),this.routerService=W.$.get(W.L.Service.RouterService),this.tradingCompetitionRepository=W.$.get(W.L.Repository.TradingCompetitionRepository),this.tokensDiscoveryRepository=W.$.get(W.L.Repository.TokensDiscoveryRepository),Q(this,"mobileColumnsMode",L,this),Q(this,"showSearchPopup",B,this),Q(this,"recentlyViewed",G,this),Q(this,"similarItems",I,this),Q(this,"isFavouriteVisibility",U,this),Q(this,"controlsModel",M,this),Q(this,"search",D,this),Q(this,"filter",N,this),Q(this,"sort",F,this),Q(this,"changePeriod",V,this),Q(this,"crowdsaleFilter",x,this),Q(this,"onSearchChange",j,this),this.selfConfig=e,this.tradingService.activeAssetsTab===z.c7.GLOBAL_MARKETS||this.tradingService.isFutures?this.controlsModel.hideZeroCrypto="0"!==sessionStorage.getItem("AssetsViewModelHideZeroStocks"):this.controlsModel.hideZeroCrypto="0"!==localStorage.getItem("AssetsViewModelHideZeroCrypto"),this.tradingCompetitionRepository.loadAll()}get crowdsaleStatusFilter(){return"ongoing"===this.crowdsaleFilter?"CROWDSALE_STATUS_ACTIVE":"past"===this.crowdsaleFilter?"CROWDSALE_STATUS_FINISHED":"CROWDSALE_STATUS_ACTIVE"}get changeFavouriteCrypto(){return this.favouriteService.changeFavouriteCrypto}get activeMarket(){return this.selfConfig?.market||this.tradingService.activeMarket}get activeIeoType(){return this.crowdsaleService.activeCrowdsaleType}get activeType(){return this.tradingService.activeTradingType}get activeAssetsTab(){return this.tradingService.activeAssetsTab}get searchItems(){return this.tradingService.searchItems}getCryptoSearchContent(e){const{baseCurrency:t}=e;return`${t.name} ${t.tag}`.toLowerCase()}sortByPopularity(e,t,o){const r=+e.popularity,i=+t.popularity;return"ASC"===o?r-i:i-r}get loadingCrypto(){const{state:e}=this.tradingService;return e.loading.crypto}get loadingIeo(){const{state:e}=this.crowdsaleService;return e.loading.ieo}onChangeSelfConfig(e){this.selfConfig=e}get currentPair(){return this.selfConfig?.activePair||this.tradingService.currentPair}
1get currentBase(){return this.tradingService.currentBase}get currentQuote(){return this.tradingService.currentQuote}get currentIeoId(){return this.crowdsaleService.activeCrowdsale?this.crowdsaleService.activeCrowdsale:""}get assetsTabs(){return this.tradingService.assetsTabs}get ieoTypes(){return this.crowdsaleService.crowdsaleTypes}get markets(){return this.tradingService.markets}get userId(){return this.userRepository.activeUserProfile.id}get isAuth(){return this.authService.isAuth}get isUnverified(){return this.authService.isUnverified}getIeoSearchContent(e){return`${e.currency.name} ${e.currency.tag}`.toLowerCase()}get ieo(){let e=this.crowdsalesRepository.list.filter((e=>e.status===this.crowdsaleStatusFilter)).map((e=>{const t=this.currenciesRepository.get(e.rewardCurrency),o=this.projectService.projectScores[e.rewardCurrency]||5,r=this.currenciesInfoRepository.get(t.id).logo||t.logo,i=this.projectService.projectIsPrivate[e.rewardCurrency]||!1;return{...e,score:o,currency:t,logo:r,isPrivate:i}})).filter((e=>!e.isPrivate&&e.currency?.id));if(this.search.ieo&&(e=e.filter((e=>this.getIeoSearchContent(e).includes(this.search.ieo.trim().toLowerCase())))),this.sort.ieo.sortBy&&this.sort.ieo.sortDirection){const t=this.sort.ieo.sortBy,o="ASC"===this.sort.ieo.sortDirection?-1:1,r="ASC"===this.sort.ieo.sortDirection?1:-1;e="currency"===this.sort.ieo.sortBy?e.sort(((e,t)=>{const i=e.currency.tag?.toLowerCase()??"",a=t.currency.tag?.toLowerCase()??"";return i<a?o:i>a?r:0})):e.sort(((e,i)=>+e[t]<+i[t]?o:+e[t]>+i[t]?r:0))}return{list:e}}changeActiveBase(e){this.tradingService.changeActiveBase(e)}changeActiveIeo(e){this.crowdsaleService.changeActiveCrowdsale(e)}changeActiveType(e){this.tradingService.changeActiveType(e)}changeActiveAssetsTab(e,t){e===z.c7.GLOBAL_MARKETS?this.controlsModel.hideZeroCrypto="0"!==sessionStorage.getItem("AssetsViewModelHideZeroStocks"):this.controlsModel.hideZeroCrypto="0"!==localStorage.getItem("AssetsViewModelHideZeroCrypto");const o="Click Currency Category",r="filter buttons";return t.trackEvent({name:o,category:r,action:o,value:Date.now(),label:"mini table - "+e,extra:{userId:this.userId,event_category:r}}),this.tradingService.changeActiveAssetsTab(e)}onChangeHideZeroCrypto(e){this.controlsModel.hideZeroCrypto=e,this.tradingService.activeAssetsTab===z.c7.GLOBAL_MARKETS?sessionStorage.setItem("AssetsViewModelHideZeroStocks",(+this.controlsModel.hideZeroCrypto).toString()):localStorage.setItem("AssetsViewModelHideZeroCrypto",(+this.controlsModel.hideZeroCrypto).toString())}changeMarket(e){this.selfConfig?.activePair?this.selfConfig.market=e:this.tradingService.changeMarket(e)}changeIeoType(e){this.crowdsaleService.changeCrowdsaleType(e)}onToggleFavoriteVisibilityCrypto(e){this.isFavouriteVisibility.crypto=e}onToggleFavoriteVisibilityIeo(e){this.isFavouriteVisibility.ieo=e}setAssetsCategories(e){this.filter.assets.categories=e,this.filterDiscoveryTokensByTags()}async filterDiscoveryTokensByTags(){const e=this.filter.assets.categories;await this.tokensDiscoveryRepository.load({quoteTag:this.activeMarket,tags:e})}assetsSort(e){let{sortBy:t,sortDirection:o}=e;this.sort.assets.sortBy=t,this.sort.assets.sortDirection=o}ieoSort(e){let{sortBy:t,sortDirection:o}=e;this.sort.ieo.sortBy=t,this.sort.ieo.sortDirection=o}setCrowdsaleStatusFilter(e){this.crowdsaleFilter=e}setChangePeriod(e){this.changePeriod=e}}).prototype,"mobileColumnsMode",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return J.gK.H_24}}),B=X(T.prototype,"showSearchPopup",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),G=X(T.prototype,"recentlyViewed",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),I=X(T.prototype,"similarItems",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),X(T.prototype,"toggleSearchPopup",[i],Object.getOwnPropertyDescriptor(T.prototype,"toggleSearchPopup"),T.prototype),X(T.prototype,"clearRecentlyViewed",[a],Object.getOwnPropertyDescriptor(T.prototype,"clearRecentlyViewed"),T.prototype),X(T.prototype,"changeToRecentToken",[n],Object.getOwnPropertyDescriptor(T.prototype,"changeToRecentToken"),T.prototype),X(T.prototype,"resetFilters",[s],Object.getOwnPropertyDescriptor(T.prototype,"resetFilters"),T.prototype),X(T.prototype,"changeMobileColumnMode",[c],Ob
1ject.getOwnPropertyDescriptor(T.prototype,"changeMobileColumnMode"),T.prototype),X(T.prototype,"resetSearch",[l],Object.getOwnPropertyDescriptor(T.prototype,"resetSearch"),T.prototype),U=X(T.prototype,"isFavouriteVisibility",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{crypto:!1,ieo:!1}}}),M=X(T.prototype,"controlsModel",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{hideZeroCrypto:!1}}}),D=X(T.prototype,"search",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{assets:"",ieo:""}}}),N=X(T.prototype,"filter",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{assets:{categories:[]}}}}),F=X(T.prototype,"sort",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{assets:{sortBy:Y.dJ,sortDirection:"DESC"},ieo:{sortBy:"score",sortDirection:"DESC"}}}}),V=X(T.prototype,"changePeriod",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"change24h"}}),x=X(T.prototype,"crowdsaleFilter",[H.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"ongoing"}}),X(T.prototype,"crowdsaleStatusFilter",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"crowdsaleStatusFilter"),T.prototype),X(T.prototype,"activeMarket",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"activeMarket"),T.prototype),X(T.prototype,"activeIeoType",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"activeIeoType"),T.prototype),X(T.prototype,"activeType",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"activeType"),T.prototype),X(T.prototype,"activeAssetsTab",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"activeAssetsTab"),T.prototype),X(T.prototype,"searchItems",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"searchItems"),T.prototype),X(T.prototype,"getCryptoSearchContent",[p],Object.getOwnPropertyDescriptor(T.prototype,"getCryptoSearchContent"),T.prototype),X(T.prototype,"loadingCrypto",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"loadingCrypto"),T.prototype),X(T.prototype,"loadingIeo",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"loadingIeo"),T.prototype),X(T.prototype,"onChangeSelfConfig",[u],Object.getOwnPropertyDescriptor(T.prototype,"onChangeSelfConfig"),T.prototype),X(T.prototype,"currentPair",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"currentPair"),T.prototype),X(T.prototype,"currentBase",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"currentBase"),T.prototype),X(T.prototype,"currentQuote",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"currentQuote"),T.prototype),X(T.prototype,"currentIeoId",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"currentIeoId"),T.prototype),X(T.prototype,"assetsTabs",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"assetsTabs"),T.prototype),X(T.prototype,"ieoTypes",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"ieoTypes"),T.prototype),X(T.prototype,"markets",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"markets"),T.prototype),X(T.prototype,"userId",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"userId"),T.prototype),X(T.prototype,"isAuth",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"isAuth"),T.prototype),X(T.prototype,"isUnverified",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"isUnverified"),T.prototype),X(T.prototype,"getIeoSearchContent",[g],Object.getOwnPropertyDescriptor(T.prototype,"getIeoSearchContent"),T.prototype),X(T.prototype,"ieo",[H.computed],Object.getOwnPropertyDescriptor(T.prototype,"ieo"),T.prototype),X(T.prototype,"changeActiveBase",[d],Object.getOwnPropertyDescriptor(T.prototype,"changeActiveBase"),T.prototype),X(T.prototype,"changeActiveIeo",[h],Object.getOwnPropertyDescriptor(T.prototype,"changeActiveIeo"),T.prototype),X(T.prototype,"changeActiveType",[y],Object.getOwnPropertyDescriptor(T.prototype,"changeActiveType"),T.prototype),X(T.prototype,"changeActiveAssetsTab",[m],Object.getOwnPropertyDescriptor(T.prototype,"changeActiveAssetsTab"),T.prototype),X(T.prototype,"onChangeHideZeroCrypto",[S],Object.getOwnPropertyDescriptor(T.prototype,"onChangeHideZeroCrypto"),T.prototype),j=X(T.prototype,"onSearchChange",[C],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Z()(((e,t)=>{this.search[e]=t}),200)}}),X(T.prototype,"changeMarket",[O],Object.getOwnPropertyDescriptor(T.prototype,"changeMarket"),T.prototype),X(T.prototype,"changeIeoType",[f],Object.getOwnPropertyDescriptor(T.prototype,"changeIeoType"),T.prototype),X(T.prototype,"onToggleFavoriteVisibilityCrypto",[b],Object.getOwnPropertyDescriptor(T.prototype,"onToggleFavoriteVisibilityCrypto"),T.prototype),X(T.prototype,"onToggleFavoriteVisibilityIeo",[v],Object.getOwnPropertyDescriptor(T.prototype,"onToggleFavoriteVisibilityIeo"),T.prototype),X(T.prototype,"setAssetsCategories",[E],Object.getOwnPropertyDescriptor(T.prototype,"setAssetsCategories"),T.prototype),X(T.prototype,"filterDiscoveryTokensByTags",[w],Object.getOwnPropertyDescriptor(T.prototype,"filterDiscoveryTokensByTags"),T.prototype),X(T.prototype,"assetsSort",[P],Object.getOwnPropertyDescriptor(T.prototype,"assetsSort"),T.prototype),X(T.prototype,"ieoSort",[_],Object.getOwnPropertyDescriptor(T.prototype,"ieoSort"),T.prototype),X(T.prototype,"setCrowdsaleStatusFilter",[A],Object.getOwnPropertyDescriptor(T.prototype,"setCrowdsaleStatusFilter"),T.prototype),X(T.prototype,"setChangePerio
1d",[k],Object.getOwnPropertyDescriptor(T.prototype,"setChangePeriod"),T.prototype),R=T))||R)},92130:function(e,t,o){o.d(t,{x:function(){return n}});var r=o(54688),i=o(65904);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},a.apply(this,arguments)}const n=e=>r.createElement(i._,a({noContentPadding:!1},e))},58488:function(e,t,o){o.d(t,{B:function(){return be},i:function(){return ve}});var r=o(54688),i=o(76602),a=o(44244),n=o(19433),s=o(31803),c=o(63221),l=o(99305),p=o(47829),u=o(2348),g=o(50746),d=o(41961),h=o(74460),y=o(13492),m=o(22044);const S=(0,m.f0)(((e,t)=>"payload"in t?{...e,...t.payload}:e)),C=(0,m.f0)((e=>({...e,loginMethod:"phone"}))),O=(0,m.f0)((e=>({...e,loginMethod:"email"}))),f={countryCode:"",mobileNumber:"",email:"",loginMethod:"email"};var b,v,E,w,P,_,A=o(98175),k=o(41876),R=o(38751),T=o(973),L=o(90558),B=o(62788),G=o(19288),I=o(37823);function U(e,t,o,r){o&&Object.defineProperty(e,t,{enumerable:o.enumerable,configurable:o.configurable,writable:o.writable,value:o.initializer?o.initializer.call(r):void 0})}function M(e,t,o,r,i){var a={};return Object.keys(r).forEach((function(e){a[e]=r[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=o.slice().reverse().reduce((function(o,r){return r(e,t,o)||o}),a),i&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}let D=(b=k.action.bound,v=k.action.bound,E=k.action.bound,P=M((w=class{notification(e,t){void 0===t&&(t="success"),this.notificationService.drawNotification({message:e,level:t})}constructor(e,t,o,r,i){var a=this;this.analyticsService=e,this.translate=t,this.http=o,this.segmentService=r,this.segmentRegistrationTrack=i,this.authService=d.$.get(d.L.Service.AuthService),this.notificationService=d.$.get(d.L.Service.NotificationService),this.usersRepository=d.$.get(d.L.Repository.UsersRepository),this.referralService=d.$.get(d.L.Service.ReferralListingService),this.popUpService=d.$.get(d.L.Service.PopUpService),U(this,"defaultCountry",P,this),this.fetchRegistrationState=async e=>(await this.http.post((0,g.zF)({email:e}))).data.registrationState,this.sendOneTimeCode=e=>this.http.post(A.fHb({phone:e})),this.verifyRegistrationByPhone=async function(e,t,o,r,i,n){void 0===n&&(n=!0);const s={phone:e,verificationCode:o,referralCode:r,password:t,password2:t,longSession:n};try{if(await a.http.post(A.FJK(s)),a.authService.isAuth)return a.reloadPageAfterMultilogin();a.authService.changeStateLogin(),await a.authService.getUser(a.analyticsService),r&&a.analyticsService.trackEvent({category:"Referral",action:"Registered with referral code"}),a.analyticsService.trackEvent({category:"Login",action:"SignUpPhone",label:"Success"})}catch(e){throw e.response||a.notification(i(R.cl),"error"),e.response.data.message&&a.notification(`${e.response.data.message}`,"error"),e}},this.resendPhoneVerificationCode=async e=>{await this.http.post(A.L1B({phone:e}))},this.checkPhonePasswordLogin=async(e,t)=>{try{return await this.http.post(A.Dh2({phone:e,password:t}))}catch(e){throw e?.response||this.notification(R.cl,"error"),e?.response&&this.notification(e.response.data.message,"error"),e}},this.registerUserByEmail=async function(e,t,o){void 0===o&&(o=""),await a.http.post(A.PEK({email:e,password:t,password2:t,referralCode:o,confirm1:!0,confirm2:!0})),a.segmentRegistrationTrack&&a.segmentRegistrationTrack(),o&&a.analyticsService.trackEvent({category:"Referral",action:"Registered with referral code"}),a.analyticsService.trackEvent({category:"Login",action:"SignUpEmail",label:"Success"}),a.authService.changeStateLogin(),await a.authService.getUser(a.analyticsService),a.segmentService.track("WEB__registration_success",{})},this.registerSubUserByEmail=async function(e,t,o){void 0===o&&(o="EMAIL"),await a.http.post(A.G7B({emailOrPhone:e,password:t,type:o})),a.analyticsService.trackEvent({category:"Login",action:"SignUpEmail",label:"Success"}),a.authService.changeStateLogin(),await a.authService.getUser(a.analyticsService),a.segmentService.track("WEB__registration_success",{})},this.login=async(e,t,o,r,i,a)=>{try{return await this.http.post(A.x4y({email:e,password:t,code:i,locationCode:a,rememberMe:o})),this.authService.isAuth?(await this.reloadPageAfterMultilogin(),this.usersRepository.activeUserProfile):(this.authService.changeStateLogin(),this.authService.setCheckSignedInUser(!1),await this.authService.getUser(this.analyticsService),this.segmentService.track("WEB__login_success",{}),this.analyticsService.trackEvent({category:"Login",action:"Login",label:"Success"}),this.usersRepository.activeUserProfile.amlFrozen&&this.popUpService.open({content:I.z,componentProps:{closePopup:()=>this.popUpService.close()}}),this.usersRepository.activeUserProfile)}catch(e){throw e.response||this.notification(r(R.cl),"error"),(0,G.Z7)(e)&&this.notification(`${(0,T.L)(e.response.data.message,r)}, try again`,"error"),(0,G.zz)(e)&&this.notification((0,T.L)(e.response.data.message,r),"error"),(0,G.zz)(e)||this.notification((0,T.L)(e.response.data.message,r),"error"),e}},this.oauthLogin=async e=>{let{password:t,twoFaCode:o,locationCode:r,provider:i,translate:a}=e;try{return await this.http.post((0,B.n9)({password:t,twoFaCode:o,locationCode:r})),await this.afterOAuthLoginSuccessUnsafe(i)}catch(e){throw this.analyticsService.trackEvent({category:"OAuthLogin",action:"Reject",label:i}),e.response||this.notification(a("Something is wrong, try again"),"error"),(0,G.Z7)(e)&&this.notification(`${(0,T.L)(e.response.data.message,a)}, try again`,"error"),(0,G.zz)(e)&&this.notification((0,T.L)(e.response.data.message,a),"error"),e}},this.afterOAuthLoginSuccessUnsafe=async e=>(this.analyticsService.trackEvent({category:"OAuthLogin",action:"Success",label:e}),this.authService.changeStateLogin(),this.authService.setCheckSignedInUser(!1),await this.authService.getUser(this.analyticsService),this.usersRepository.activeUserProfile),this.afterOAuthLoginSuccess=async e=>{let{provider:t,translate:o}=e;try{return await this.afterOAuthLoginSuccessUnsafe(t)}catch(e){throw this.analyticsService.trackEvent({category:"OAuthLogin",action:"Reject",label:t}),e.response||this.notification(o("Something is wrong, try again"),"error"),(0,G.Z7)(e)&&this.notification(`${(0,T.L)(e.response.data.message,o)}, try again`,"error"),(0,G.zz)(e)&&this.notification((0,T.L)(e.response.data.message,o),"error"),e}},this.reloadPageAfterMultilogin=async()=>(await this.authService.getUser(this.analyticsService),window.location.reload()),this.confirmEmail=async(e,t)=>{const o={email:e,verificationCode:t};try{if(await this.http.post(A.E4k(o)),this.checkRefCodeAndCreateRefProfile(),this.authService.isAuth)return this.reloadPageAfterMultilogin();await this.authService.getUser(this.analyticsService),this.authService.setCheckSignedInUser(!1),this.analyticsService.trackEvent({category:"SimpleSignUp",action:"Success",label:"Confirm"})}catch(e){throw this.analyticsService.trackEvent({category:"SimpleSignUp",action:"Rejected",label:"Confirm"}),this.notification((0,T.L)(e.response.data.message,this.translate),"error"),e}},this.resendEmailConfirmationCode=async e=>{await this.http.post(A.xp2({email:e}))},this.sendRestorePasswordCodeToEmail=async e=>{await this.http.post(A.fjy({email:e}))},this.sendRestorePasswordCodeToPhone=async e=>{await this.http.post(A.fjy({email:e}))},this.setupPasswordAndVerifyEmail=async(e,t,o)=>{try{await this.http.post(A.ZBx({email:e,password:t,verificationCode:o,longSession:!0})),this.authService.changeStateLogin(),this.authService.setCheckSignedInUser(!1),await this.authService.getUser(this.analyticsService),this.analyticsService.trackEvent({category:"Login",action:"AirdropLogin",label:"Success"})}catch(e){throw this.notification((0,T.L)(e.response.data.message,this.translate),"error"),e}},this.setupPasswordByOAuth=async e=>{try{await this.http.post((0,B.n9)({password:e})),this.authService.changeStateLogin(),this.authService.setCheckSignedInUser(!1),await this.authService.getUser(this.analyticsService),this.analyticsService.trackEvent({category:"Login",action:"AirdropLogin",label:"Success"})}catch(e){throw this.notification((0,T.L)(e.response.data.message,this.translate),"error"),e}},this.restorePasswordByEmail=async(e,t,o)=>{try{await this.http.post(A.nuH({email:e,password:t,code:o,confirmPassword:t}))}catch(e){throw this.notification((0,T.L)(e.response.data.message,this.translate),"error"),e}},this.restorePasswordByPhone=async(e,t,o)=>{try{await this.http.post(A.nuH({email:e,password:t,code:o,confirmPassword:t}))}catch(e){throw this.notification((0,T.L)(e.response.data.message,this.translate),"error"),e}},U(this,"checkRefCodeAndCreateRefProfile",_,this),this.setDefaultCountry().catch((e=>console.error("Cannot get defaultCountry",e,(0,L.c)(e)))),this.analyticsService.trackEvent({category:"Login",action:"OpenDialog",label:"Success"})}async setDefaultCountry(){const e=await this.http.get(A.BVJ);this.defaultCountry=e.data.country}async sendPasswordSetupVerificationCode(e){await this.http.post(A.lTx({email:e}))}}).prototype,"defaultCountry",[k.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),M(w.prototype,"setDefaultCountry",[b],Object.getOwnPropertyDescriptor(w.prototype,"setDefaultCountry"),w.prototype),M(w.prototype,"sendPasswordSetupVerificationCode",[v],Object.getOwnPropertyDescriptor(w.prototype,"sendPasswordSetupVerificationCode"),w.prototype),_=M(w.prototype,"checkRefCodeAndCreateRefProfile",[E],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>
1{if(this.referralService.inviterCode)try{await this.http.post(A.cn3({code:this.referralService.inviterCode}))}catch(e){console.error("Error,cannot create referral profile")}}}}),w);var N=o(89255);const F=(0,N.Z)((e=>({mobileWrapper:{maxWidth:"100%",width:"100%",[e.breakpoints.up("sm")]:{width:"312px"}}})));var V=o(81346),x=o(94917);const j=e=>{let{title:t,email:o,onSignup:a,onSetupPassword:n,onLogin:s,checkUserExistence:c,onOAuthLogin:l,onClose:p}=e;const u=d.$.get(d.L.Service.NotificationService),[g,h]=(0,r.useState)(!1),y=(0,r.useCallback)((async e=>{h(!0);try{const t=await c(e);"USER_REGISTRATION_STATE_AUTHENTICATE"===t?s(e):"USER_REGISTRATION_STATE_REGISTER"===t?a(e):"USER_REGISTRATION_STATE_SETUP_PASSWORD"===t?n(e):"USER_REGISTRATION_STATE_DELETED"===t&&u.drawNotification({message:t,level:"error"})}finally{h(!1)}}),[c,s,a,n,u]);return r.createElement(i.io,{onClose:p,title:t,onContinue:y,loading:g,email:o,onOAuthLogin:l})},H=e=>{let{sendOneTimeCode:t,onSignup:o,onLogin:a,defaultCountry:n,title:s,countryCode:c,mobileNumber:l,onOAuthLogin:p,onClose:u}=e;const h=d.$.get(d.L.Service.NotificationService),[y,m]=(0,r.useState)(!1),S=(0,r.useCallback)((async e=>{m(!0);let r=!0;try{await t(`+${e.countryCode}${e.mobileNumber}`)}catch(e){r=!1;const t=e;if((0,g.jq)(t)){r=!1;const e=t.response?.data.message;h.drawNotification({message:e,level:"error"})}console.error("Error calling sendOneTimeCode",{defaultCountry:n,title:s,countryCode:c,mobileNumber:l,...(0,L.c)(t)},t)}finally{if(r)switch(e.action){case"login":a(e);break;case"signup":o(e);break;default:console.error("Unexpected LoginEnterPhoneStep PhoneStepForm.action value",{value:e.action,defaultCountry:n,title:s,countryCode:c,mobileNumber:l})}m(!1)}}),[c,n,l,h,a,o,t,s]);return r.createElement(i.hd,{title:s,onContinue:S,loading:y,defaultCountry:n,countryCode:c,mobileNumber:l,onOAuthLogin:p,onClose:u})};let $;const W=e=>{let{onBack:t,onVerify:o,phone:a,verify:n,resend:s,password:l,referralCode:p,type:u,rememberMe:g,onClose:d}=e;const h=(0,c.$)(),[y,m]=(0,r.useState)(60),[S,C]=(0,r.useState)(!1),[O,f]=(0,r.useState)(!1),b=(0,r.useCallback)((async e=>{f(!1),C(!0);try{await n(a,l,e,p,h,g),o()}catch(e){f(!0)}finally{C(!1)}}),[]),v=(0,r.useCallback)((async()=>{C(!0),f(!1);try{await s(a),m(60)}finally{C(!1)}}),[]);return(0,r.useEffect)((()=>($=setTimeout((()=>{y>0&&m(y-1)}),1e3),()=>clearTimeout($))),[y]),"login"===u?r.createElement(i.Al,{error:O,onResend:v,time:y,loading:S,onBack:t,onContinue:b,phone:a,onClose:d}):"signup"===u?r.createElement(i.Gt,{error:O,onResend:v,time:y,loading:S,onBack:t,onContinue:b,phone:a,onClose:d}):null},z=e=>{let{email:t,onBack:o,register:a,onContinue:n,referralCode:s,onClose:c,noReferral:l}=e;const[p,u]=(0,r.useState)(!1),g=(0,r.useCallback)((async e=>{u(!0);try{await a(t,e.password,e.referralCode),n()}finally{u(!1)}}),[t,n,a]);return r.createElement(i.ut,{onClose:c,referralCode:s,loading:p,onBack:o,onContinue:g,email:t,noReferral:l})};var K=o(56325);const Z=e=>{let{onBack:t,onSuccess:o,login:a,email:n,onForgot:s,on2faGA:l,on2faSMS:p,onUnknownLocation:u,onVerify:g,onClose:d}=e;const h=(0,c.$)(),[y,m]=(0,r.useState)(!1),S=(0,r.useCallback)((async e=>{let{password:t,rememberMe:r}=e;m(!0);try{"UNVERIFIED"===(await a(n,t,r,h)).status?g():o()}catch(e){(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_GOOGLE_AUTH&&l({password:t,rememberMe:r}),(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_SMS&&p({password:t,rememberMe:r}),(0,G.vn)(e)&&u({password:t,rememberMe:r}),(0,G.uQ)(e)&&s(),(0,G.MO)(e)&&u({password:t,rememberMe:r})}finally{m(!1)}}),[n,a,l,p,s,o,u,g,h]);return r.createElement(i.xJ,{email:n,loading:y,onBack:t,onContinue:S,onForgot:s,onClose:d})},J=e=>{let{confirm:t,email:o,resend:a,onConfirm:n,onSkip:s,type:c,onClose:l}=e;const[p,u]=(0,r.useState)(60),[g,d]=(0,r.useState)(!1),[h,y]=(0,r.useState)(!1),m=(0,r.useCallback)((async e=>{d(!0),y(!1);try{await t(o,e),n()}catch(e){e.response.data.message.includes("invalid code provided")&&y(!0)}finally{d(!1)}}),[t]),S=(0,r.useCallback)((async()=>{d(!0),y(!1);try{await a(o),u(60)}finally{d(!1)}}),[a]);return(0,r.useEffect)((()=>{"login"===c&&S()}),[]),(0,r.useEffect)((()=>{const e=setTimeout((()=>{p>0&&u(p-1)}),1e3);return()=>clearTimeout(e)}),[p]),r.createElement(i.Bk,{onSkip:s,error:h,onContinue:m,time:p,loading:g,onResend:S,email:o,onClose:l})};let Y;const q=e=>{let{email:t,resend:o,restore:a,onRestored:n,onBack:s,onClose:c}=e;const[l,p]=(0,r.useState)(60),[u,g]=(0,r.useState)(!1),d=(0,r.useCallback)((async()=>{g(!0);try{await o(t),p(60)}finally{g(!1)}}),[o]),h=(0,r.useCallback)((async(e,o)=>{g(!0);try{await a(t,o,e),n()}finally{g(!1)}}),[a]);return(0,r.useEffect)((()=>{d()}),[]),(0,r.useEffect)((()=>(Y=setTimeout((()=>{l>0&&p(l-1)}),1e3),()=>clearTimeout(Y))),[l]),r.createElement(i.xf,{onClose:c,onResend:d,time:l,email:t,onContinue:h,onBack:s,loading:u})};let Q;const X=e=>{let{phone:t,resend:o,restore:a,onRestored:n,onBack:s,onClose:c}=e;const[l,p]=(0,r.useState)(60),[u,g]=(0,r.useState)(!1),d=(0,r.useCallback)((async()=>{g(!0);try{await o(t),p(60)}finally{g(!1)}}),[o]),h=(0,r.useCallback)((async(e,o)=>{g(!0);try{await a(t,o,e),n()}finally{g(!1)}}),[a]);return(0,r.useEffect)((()=>{d()}),[d]),(0,r.useEffect)((()=>(Q=setTimeout((()=>{l>0&&p(l-1)}),1e3),()=>clearTimeout(Q))),[l]),r.createElement(i.OU,{onClose:c,onResend:d,time:l,phone:t,onContinue:h,onBack:s,loading:u})};var ee=o(90333);const te=e=>{let{login:t,email:o,password:a,rememberMe:n,onBack:s,on2faGA:l,on2faSMS:p,onSuccess:u,onVerify:g,onClose:d}=e;const[h,y]=(0,r.useState)(!1),[m,S]=(0,r.useState)(60),C=(0,c.$)("customerJourney"),O=(0,r.useCallback)((async e=>{y(!0);try{"UNVERIFIED"===(await t(o,a,n,C,void 0,e)).status?g():u()}catch(e){(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_GOOGLE_AUTH&&l(),(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_SMS&&p()}finally{y(!1)}}),[o,t,l,p,u,g,a,n,C]),f=(0,r.useCallback)((async()=>{y(!0);try{await t(o,a,n,C,void 0,void 0)}catch(e){(0,G.vn)(e)&&S(60)}finally{y(!1)}}),[o,t,a,n,C]);return(0,r.useEffect)((()=>{const e=setTimeout((()=>{m>0&&S(m-1)}),1e3);return()=>clearTimeout(e)}),[m]),r.createElement(i.Cr,{onClose:d,loading:h,onBack:s,onResend:f,time:m,onContinue:O,title:C("Welcome back"),subTitle:C("You're trying to login from a new device. Check the code in your email_"),label:C("Verify location code"),startAdornment:r.createElement(ee.Z,{fontSize:"small",color:"disabled"})})},oe=e=>{let{provider:t,login:o,email:a,password:n,rememberMe:s,onSuccess:l,onBack:p,onVerify:u,onClose:g,onUnknownLocation:d}=e;const h=(0,c.$)(),[y,m]=(0,r.useState)(!1),[S,C]=(0,r.useState)(!1),O
1=(0,r.useCallback)((async e=>{m(!0),C(!1);try{"UNVERIFIED"===(await o(a,n,s,h,e)).status?u():l()}catch(e){(0,G.vn)(e)&&d({password:n,rememberMe:s}),(0,G.gy)(e)&&C("Invalid code provided")}finally{m(!1)}}),[a,o,l,d,u,n,s,h]);return"sms"===t?r.createElement(i.AI,{error:S,loading:y,onContinue:O,onBack:p,onClose:g}):"ga"===t?r.createElement(i.zX,{error:S,loading:y,onContinue:O,onBack:p,onClose:g}):null};let re;const ie=e=>{let{email:t,resend:o,setup:a,onSuccess:n,onBack:s,onClose:c}=e;const[l,p]=(0,r.useState)(60),[u,g]=(0,r.useState)(!1),d=(0,r.useCallback)((async()=>{g(!0);try{await o(t),p(60)}finally{g(!1)}}),[o]),h=(0,r.useCallback)((async(e,o)=>{g(!0);try{await a(t,o,e),n()}finally{g(!1)}}),[a]);return(0,r.useEffect)((()=>{d()}),[]),(0,r.useEffect)((()=>(re=setTimeout((()=>{l>0&&p(l-1)}),1e3),()=>clearTimeout(re))),[l]),r.createElement(i.Qw,{onClose:c,onResend:d,time:l,email:t,onContinue:h,onBack:s,loading:u})};var ae=o(63595),ne=o(19273),se=o(35254);(0,N.Z)((e=>({content:{padding:e.spacing(0,3,3)}}))),(0,ne.Z)((e=>{let{typography:t}=e;return{root:{minWidth:"50%",fontSize:1.15*t.fontSize}}}))(ae.OK);var ce=o(16098),le=o(92492);const pe=e=>{let{onBack:t,provider:o}=e;const a=(0,c.$)("customerJourney");return r.createElement(i.dP,{loading:!1,onBack:t,title:a("{{PROVIDER}} login",{PROVIDER:(0,le.k)(o)}),"data-tid":"form__oauth-waiting-feedback"},r.createElement(ce.Z,{variant:"body2",paragraph:!0},a("Proceed with {{PROVIDER}} login form at newly opened window",{PROVIDER:(0,le.k)(o)})),r.createElement(ce.Z,{variant:"body1",paragraph:!0},a("There is no login window? Probably your browser blocks it_ Allow popups for LATOKEN's page and try one more time_")),r.createElement(ce.Z,{variant:"body1"},a("If you already signed in with {{PROVIDER}}, try to refresh current page_",{PROVIDER:(0,le.k)(o)})))},ue=e=>{let{onBack:t,onClose:o,provider:a}=e;const n=(0,c.$)("customerJourney");return r.createElement(i.dP,{onClose:o,loading:!1,onBack:t,title:n("{{PROVIDER}} login",{PROVIDER:(0,le.k)(a)}),"data-tid":"form__oauth-error-feedback"},r.createElement(ce.Z,{variant:"body2",paragraph:!0},n("There is an issue to log in with {{PROVIDER}}, try one more time_",{PROVIDER:(0,le.k)(a)})))},ge=e=>{let{provider:t,login:o,onBack:a,on2faGA:n,on2faSMS:s,onSuccess:l,onVerify:p,onClose:u}=e;const[g,d]=(0,r.useState)(!1),[h,y]=(0,r.useState)(60),m=(0,c.$)(),S=(0,r.useCallback)((async e=>{d(!0);try{"UNVERIFIED"===(await o({locationCode:e,provider:t,translate:m})).status?p():l()}catch(e){(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_GOOGLE_AUTH&&n(),(0,G.gy)(e)&&e.response.data.twoFaProvider===K.v.TWO_FA_PROVIDER_SMS&&s()}finally{d(!1)}}),[o]),C=(0,r.useCallback)((async()=>{d(!0);try{await o({provider:t,translate:m})}catch(e){(0,G.vn)(e)&&y(60)}finally{d(!1)}}),[o]);return(0,r.useEffect)((()=>{const e=setTimeout((()=>{h>0&&y(h-1)}),1e3);return()=>clearTimeout(e)}),[h]),r.createElement(i.Cr,{onClose:u,loading:g,onBack:a,onResend:C,time:h,onContinue:S,title:m("Welcome back!"),subTitle:m("You're trying to login from a new device. Check the code in your email_"),label:m("Verify location code"),startAdornment:r.createElement(ee.Z,{fontSize:"small",color:"disabled"})})},de=e=>{let{provider:t,login:o,onSuccess:a,onBack:n,onVerify:s,onClose:l}=e;const p=(0,c.$)(),[u,g]=(0,r.useState)(!1),[d,h]=(0,r.useState)(!1),y=(0,r.useCallback)((async e=>{g(!0),h(!1);try{"UNVERIFIED"===(await o({twoFaCode:e,translate:p})).status?s():a()}catch(e){(0,G.gy)(e)&&h("Invalid code provided")}finally{g(!1)}}),[]);return"sms"===t?r.createElement(i.AI,{error:d,loading:u,onContinue:y,onBack:n,onClose:l}):"ga"===t?r.createElement(i.zX,{error:d,loading:u,onContinue:y,onBack:n,onClose:l}):null},he=e=>{let{setup:t,onSuccess:o,onBack:a,onClose:n}=e;const[s,c]=(0,r.useState)(60),[l,p]=(0,r.useState)(!1),u=(0,r.useCallback)((async e=>{p(!0);try{await t(e),o()}finally{p(!1)}}),[t]);return(0,r.useEffect)((()=>{const e=setTimeout((()=>{s>0&&c(s-1)}),1e3);return()=>clearTimeout(e)}),[s]),r.createElement(i.qF,{onContinue:u,onBack:a,loading:l,onClose:n})};var ye=o(64919);const me=(0,N.Z)((e=>{let{spacing:t}=e;return{content:{paddingBottom:t(4)}}})),Se=(0,ne.Z)((e=>{let{typography:t}=e;return{root:{minWidth:"50%",fontSize:1.15*t.fontSize}}}
1))(ae.OK),Ce=e=>{let{vm:t,email:o,sendNoAnim:i,sendForward:a,handleGoPasswordSignupEmail:n,handleGoPasswordLoginEmail:l,onSignupBegin:p,onLoginBegin:u,loginMethod:g,countryCode:d,mobileNumber:h,onClose:y,noPhone:m=!1}=e;const S=(0,c.$)("customerJourney"),C=me(),O=(0,s.G)("analytics"),f=(0,s.G)("oauth"),b=(0,r.useCallback)((async e=>{O.trackEvent({category:"Login",action:"SignUpOAuthTry",name:e}),await a({type:"GO_OAUTH_WAITING_FEEDBACK",payload:{oauthProviderRequested:e}}),await(0,ye.g)(250),f.login(e).catch((t=>console.error("Cannot sign in with oath",t,{provider:e})))}),[O,f,a]),v=(0,r.useCallback)((e=>{a({type:"GO_PASSWORD_SIGNUP_BY_PHONE",payload:e}),p&&p()}),[p,a]),E=(0,r.useCallback)((e=>{a({type:"GO_PASSWORD_SIGNUP_AIRDROP",payload:{email:e}}),p&&p()}),[p,a]),w=(0,r.useCallback)((e=>{a({type:"GO_PASSWORD_LOGIN_BY_PHONE",payload:e}),u&&u()}),[u,a]),P=(0,r.useCallback)(((e,t)=>{switch(t){case"email":i("GO_EMAIL");break;case"phone":i("GO_PHONE")}}),[i]);return r.createElement(r.Fragment,null,r.createElement(se.$,{onClose:y},S("Log in or Sign up")),r.createElement("div",{className:C.content},r.createElement(ae.mQ,{value:g,onTabChange:P,variant:"fullWidth"},r.createElement(Se,{key:"email",styling:"MUI",label:S("By Email"),value:"email"}),!m&&r.createElement(Se,{key:"phone",styling:"MUI",label:S("By Phone"),value:"phone"}))),r.createElement(ae.x4,{activeKey:g,tabKey:"email",relative:!1},r.createElement(j,{checkUserExistence:t.fetchRegistrationState,email:o,onSetupPassword:e=>{E(e)},onSignup:e=>{n(e),O.trackEvent({category:"authentication",action:"email-sign-up",label:e})},onLogin:l,onOAuthLogin:b})),r.createElement(ae.x4,{activeKey:g,tabKey:"phone"},r.createElement(H,{countryCode:d??"",mobileNumber:h??"",defaultCountry:t.defaultCountry,sendOneTimeCode:t.sendOneTimeCode,onLogin:w,onSignup:e=>{v(e),O.trackEvent({category:"authentication",action:"phone-number-sign-up",label:`${e.countryCode} ${e.mobileNumber}`})},onOAuthLogin:b,onClose:y})))},Oe=(0,x.Pi)((e=>{let{email:t,state:o,sendForward:a,sendBack:n,sendFade:c,sendNoAnim:l,onSignupBegin:p,onLoginBeg
1in:u,referralCode:g,vm:h,handleGoPasswordSignupEmail:y,handleGoPasswordLoginEmail:m,noPhone:S=!1}=e;const C=(0,r.useMemo)((()=>`+${o.context.countryCode}${o.context.mobileNumber}`),[o.context.countryCode,o.context.mobileNumber]),O=(0,s.G)("analytics"),f=(0,r.useCallback)((()=>{p&&p(),O.extendedModules.startTrackUserAuth.setAuthBeginPage("signup")}),[O,p]),b=(0,r.useCallback)((()=>{u&&u(),O.extendedModules.startTrackUserAuth.setAuthBeginPage("login")}),[O,u]),v=(0,r.useCallback)((()=>{a("GO_SUCCESS")}),[a]),E=(0,r.useCallback)((()=>{O.trackEvent({category:"authentication",action:"email-confirmed-sign-up",name:t}),v()}),[O,t,v]),w=(0,r.useCallback)((()=>{O.trackEvent({category:"authentication",action:"phone-confirmed-sign-up",name:C}),v()}),[O,C,v]),P=(0,r.useCallback)((()=>{c("GO_PHONE")}),[c]),_=(0,r.useCallback)((()=>{c("GO_EMAIL")}),[c]),A=(0,r.useCallback)((()=>{a("GO_FORGOT")}),[a]),k=(0,r.useCallback)((e=>{a({type:"GO_GOOGLE_AUTH",payload:e})}),[a]),R=(0,r.useCallback)((e=>{a({type:"GO_2FA_SMS",payload:e})}),[a]),T=(0,r.useCallback)((()=>{a({type:"GO_GOOGLE_AUTH",payload:{}})}),[a]),B=(0,r.useCallback)((()=>{a({type:"GO_2FA_SMS",payload:{}})}),[a]),G=(0,r.useCallback)((()=>{a({type:"GO_OAUTH_GOOGLE_AUTH",payload:{}})}),[a]),I=(0,r.useCallback)((()=>{a({type:"GO_OAUTH_2FA_SMS",payload:{}})}),[a]),U=(0,r.useCallback)((e=>{a({type:"GO_LOCATION_CONFIRM",payload:e})}),[a]),M=(0,r.useCallback)((()=>{a("GO_EMAIL_CONFIRM")}),[a]),D=(0,r.useCallback)((()=>{O.trackEvent({category:"Login",action:"SignUpEmailVerify",label:"Skip"}),h.authService.setCheckSignedInUser(!1),h.checkRefCodeAndCreateRefProfile(),a("GO_SUCCESS")}),[O,h,a]),N=(0,r.useCallback)((async e=>{a({type:"GO_SMS_CONFIRM_SIGNUP",payload:e});const t=`+${o.context.countryCode}${o.context.mobileNumber}`;try{await h.resendPhoneVerificationCode(t)}catch(e){throw console.error("Error at resendPhoneVerificationCode",e,{state:o.context,...(0,L.c)(e)}),e}}),[h,a,o.context]),F=(0,r.useCallback)((e=>{let{password:t,rememberMe:r}=e;const i=`+${o.context.countryCode}${o.context.mobileNumber}`;h.resendPhoneVerificationCode(i).catch((e=>console.error("Error at resendPhoneVerificationCode",e,{state:o.context,...(0,L.c)(e)}))),a({type:"GO_SMS_CONFIRM_LOGIN",payload:{password:t,rememberMe:r}})}),[a,o.context,h]),x=(0,r.useCallback)((async e=>{let{password:t,rememberMe:r}=e;const i=`+${o.context.countryCode}${o.context.mobileNumber}`;await h.checkPhonePasswordLogin(i,t).then((()=>F({password:t,rememberMe:r}))).catch((e=>{console.error("Error at checkPhonePasswordLogin",e,{state:o.context,...(0,L.c)(e)})}))}),[F,o.context,h]),j=(0,r.useCallback)((()=>{n("GO_BACK")}),[n]),H=(e=>{const t=(0,V.Hj)();return(0,r.useEffect)((()=>{if(t)switch(t.responseCode){case V.Js.SUCCESS:e("GO_SUCCESS");break;case V.Js.INVALID_2FA_CODE:switch(t.twoFAProvider){case K.v.TWO_FA_PROVIDER_SMS:e("GO_OAUTH_2FA_SMS");break;case K.v.TWO_FA_PROVIDER_GOOGLE_AUTH:e("GO_OAUTH_GOOGLE_AUTH");break;default:console.error("Unsupported 2fa provider reported at oauth feedback",{oauthFeedback:t}),e("GO_SUCCESS")}break;case V.Js.PASSWORD_MUST_BE_CREATED:e("GO_OAUTH_DEFINE_PASSWORD");break;case V.Js.UNKNOWN_LOCATION:e({type:"GO_OAUTH_LOCATION_CONFIRM",payload:{oauthFeedbackProvider:t.provider}});break;case V.Js.NO_RESPONSE:e({type:"GO_OAUTH_ERROR_FEEDBACK",payload:{oauthFeedbackProvider:t.provider}});break;default:console.error("oauthFeedback was provided with unexpected responseCode",{oauthFeedback:t}),window.location.reload()}}),[t,e]),t})(a),$=(0,r.useCallback)((e=>h.oauthLogin({provider:H?.provider??V.O4.UNKNOWN,...e})),[H,h]),Y=(()=>{const e=(0,r.useMemo)((()=>d.$.get(d.L.Service.PopUpService)),[]),t=(0,s.G)("analytics");return(0,r.useCallback)((()=>e.close({content:be,analyticsService:t})),[e])})();return r.createElement(r.Fragment,null,o.matches("locationConfirm")&&r.createElement(te,{onVerify:M,on2faGA:T,on2faSMS:B,email:o.context.email,password:o.context.password,rememberMe:o.context.rememberMe,login:h.login,onBack:j,onSuccess:v,onClose:Y}),o.matches("locationConfirmOAuth")&&r.createElement(ge,{onVerify:M,on2faGA:G,on2faSMS:I,login:h.oauthLogin,onBack:j,onSuccess:v,provider:o.context.oauthFeedbackProvider??V.O4.UNKNOWN,onClose:Y}),o.matches("enterSMSLoginByEmail")&&r.createElement(oe,{onVerify:M,onUnknownLocation:U,provider:"sms",email:o.context.email,password:o.context.password,rememberMe:o.context.rememberMe,login:h.login,onSuccess:v,onBack:j,onClose:Y}),o.matches("enterGALoginByEmail")&&r.createElement(oe,{onVerify:M,onUnknownLocation:U,provider:"ga",email:o.context.email,password:o.context.password,rememberMe:o.context.rememberMe,login:h.login,onSuccess:v,onBack:j,onClose:Y}),o.matches("enterGALoginByOAuth")&&r.createElement(de,{onVerify:M,provider:"ga",login:$,onSuccess:v,onBack:j,onClose:Y}),o.matches("enterSMSLoginByOAuth")&&r.createElement(de,{onVerify:M,provider:"sms",login:$,onSuccess:v,onBack:j,onClose:Y}),o.matches("setPasswordSignUpByPhone")&&r.createElement(i.ut,{referralCode:g,onBack:j,onContinue:N,email:t,onClose:Y}),o.matches("enterPasswordLoginByPhone")&&r.createElement(i.xJ,{phone:C,onBack:j,onForgot:A,onContinue:x,onClose:Y}),o.matches("enterPasswordLoginByEmail")&&r.createElement(Z,{onVerify:M,onUnknownLocation:U,onForgot:A,onSuccess:v,on2faGA:k,on2faSMS:R,email:o.context.email,onBack:j,login:h.login,onClose:Y}),o.matches("restorePasswordByPhone")&&r.createElement(X,{phone:C,resend:h.sendRestorePasswordCodeToPhone,restore:h.restorePasswordByPhone,onBack:j,onRestored:P,onClose:Y}),o.matches("restorePasswordByEmail")&&r.createElement(q,{email:o.context.email,resend:h.sendRestorePasswordCodeToEmail,restore:h.restorePasswordByEmail,onBack:j,onRestored:_,onClose:Y}),o.matches("signupAirdropSetupPassword")&&r.createElement(ie,{email:o.context.email,resend:h.sendPasswordSetupVerificationCode,setup:h.setupPasswordAndVerifyEmail,onBack:j,onSuccess:v,onClose:Y}),o.matches("oauthSetupPassword")&&r.createElement(he,{setup:h.setupPasswordByOAuth,onBack:j,onSuccess:v,onClose:Y}),o.matches("emailConfirmSignup")&&r.createElement(J,{type:"signup",email:o.context.email,resend:h.resendEmailConfirmationCode,confirm:h.confirmEmail,onSkip:D,onConfirm:E,onClose:Y}),o.matches("setPasswordSignUpByEmailSubUser")&&r.createElement(z,{email:o.context.email,register:h.registerSubUserByEmail,onBack:j,onContinue:v,onClose:Y,noReferral:!0}),o.matches("setPasswordSignUpByEmail")&&r.createElement(z,{referralCode:g,email:o.context.email,register:h.registerUserByEmail,onBack:j,onContinue:M,onClose:Y}),o.matches("smsConfirmSignup")&&r.createElement(W,{type:"signup",referralCode:o.context.referralCode,resend:h.resendPhoneVerificationCode,verify:h.verifyRegistrationByPhone,onVerify:w,onBack:j,password:o.context.password,rememberMe:o.context.rememberMe,phone:C,onClose:Y}),o.matches("smsConfirmLogin")&&r.createElement(W,{type:"login",resend:h.resendPhoneVerificationCode,verify:h.verifyRegistrationByPhone,onVerify:v,onBack:j,phone:C,password:o.context.password,rememberMe:o.context.rememberMe,onClose:Y}),o.matches("enterEmailOrPhone")&&r.createElement(Ce,{onSignupBeg
1in:f,onLoginBegin:b,vm:h,handleGoPasswordSignupEmail:y,handleGoPasswordLoginEmail:m,sendForward:a,sendNoAnim:l,email:o.context.email||t,loginMethod:o.context.loginMethod,countryCode:o.context.countryCode,mobileNumber:o.context.mobileNumber,onClose:Y,noPhone:S}),o.matches("verifyEmail")&&r.createElement(J,{type:"login",email:o.context.email,resend:h.resendEmailConfirmationCode,confirm:h.confirmEmail,onSkip:D,onConfirm:v,onClose:Y}),o.matches("oauthWaitingFeedback")&&r.createElement(pe,{onBack:j,provider:o.context.oauthProviderRequested||V.O4.UNKNOWN}),o.matches("oauthErrorFeedback")&&r.createElement(ue,{onBack:j,provider:o.context.oauthFeedbackProvider||V.O4.UNKNOWN,onClose:Y}))}));var fe;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.INVALID_2FA_CODE=1]="INVALID_2FA_CODE",e[e.PASSWORD_MUST_BE_CREATED=2]="PASSWORD_MUST_BE_CREATED",e[e.UNKNOWN_LOCATION=3]="UNKNOWN_LOCATION"}(fe||(fe={}));const be=(0,n.Pi)((e=>{let{onSuccessfulLogin:t,onLoginBegin:o,referralCode:n,onSignupBegin:m,email:b,segmentRegistrationTrack:v,registerType:E}=e;const w=(0,r.useMemo)((()=>d.$.get(d.L.Service.RouterService)),[]),P=d.$.get(d.L.Service.ReferralService),_=(0,s.G)("segment"),A=(0,s.G)("analytics"),k=(0,s.G)("http"),R=(0,c.$)(),T=(0,l.U)(),L=(0,p.Ux)(T),[B]=(0,r.useState)((()=>new D(A,R,k,_,v))),G=(0,u.n)(),I=(e=>{const t=(e=>{const t=(0,c.$)();return(0,r.useCallback)((o=>e({provider:o.oauthFeedbackProvider||o.oauthProviderRequested,translate:t}).catch((e=>console.error("Error calling afterOAuthLoginSuccess at loginMachine",e)))),[e,t])})(e),[o]=(0,r.useState)((()=>(0,y.J)({id:"loginMachine",initial:"enterEmailOrPhone",context:f,states:{verifyEmail:{on:{GO_SUCCESS:{target:"success"}}},locationConfirm:{on:{GO_EMAIL_CONFIRM:{target:"verifyEmail"},GO_2FA_SMS:{target:"enterSMSLoginByEmail"},GO_GOOGLE_AUTH:{target:"enterGALoginByEmail"},GO_BACK:{target:"enterPasswordLoginByEmail"},GO_SUCCESS:{target:"success"}}},enterSMSLoginByEmail:{on:{GO_EMAIL_CONFIRM:{target:"verifyEmail"},GO_BACK:{target:"enterPasswordLoginByEmail"},GO_SUCCESS:{target:"success"}}},enterGALoginByEmail:{on:{GO_EMAIL_CONFIRM:{target:"verifyEmail"},GO_LOCATION_CONFIRM:{target:"locationConfirm",actions:"assignData"},GO_BACK:{target:"enterPasswordLoginByEmail"},GO_SUCCESS:{target:"success"}}},restorePasswordByPhone:{on:{GO_PHONE:{target:"enterEmailOrPhone",actions:["assignData","setPhoneLoginMethod"]},GO_BACK:{target:"enterPasswordLoginByPhone"}}},restorePasswordByEmail:{on:{GO_EMAIL:{target:"enterEmailOrPhone",actions:["assignData","setEmailLoginMethod"]},GO_BACK:{target:"enterPasswordLoginByEmail"}}},emailConfirmSignup:{on:{GO_SUCCESS:{target:"success"}}},success:{type:"final"},enterPasswordLoginByEmail:{on:{GO_EMAIL_CONFIRM:{target:"verifyEmail"},GO_LOCATION_CONFIRM:{target:"locationConfirm",actions:"assignData"},GO_GOOGLE_AUTH:{target:"enterGALoginByEmail",actions:"assignData"},GO_2FA_SMS:{target:"enterSMSLoginByEmail",actions:"assignData"},GO_FORGOT:{target:"restorePasswordByEmail"},GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}},enterPasswordLoginByPhone:{on:{GO_FORGOT:{target:"restorePasswordByPhone"},GO_BACK:{target:"enterEmailOrPhone"},GO_SMS_CONFIRM_LOGIN:{target:"smsConfirmLogin",actions:"assignData"}}},setPasswordSignUpByPhone:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SMS_CONFIRM_SIGNUP:{target:"smsConfirmSignup",actions:"assignData"}}},setPasswordSignUpByEmail:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_EMAIL_CONFIRM:{target:"emailConfirmSignup"}}},setPasswordSignUpByEmailSubUser:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}},smsConfirmSignup:{on:{GO_BACK:{target:"setPasswordSignUpByPhone"},GO_SUCCESS:{target:"success"}}},smsConfirmLogin:{on:{GO_BACK:{target:"enterPasswordLoginByPhone"},GO_SUCCESS:{target:"success"}}},signupAirdropSetupPassword:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}},enterEmailOrPhone:{on:{GO_EMAIL:{target:"enterEmailOrPhone",actions:["assignData","setEmailLoginMethod"]},GO_PASSWORD_LOGIN_BY_PHONE:{target:"enterPasswordLoginByPhone",actions:["assignData","setPhoneLoginMethod"]},GO_PASSWORD_SIGNUP_BY_PHONE:{target:"setPasswordSignUpByPhone",actions:["assignData","setPhoneLoginMethod"]},GO_PHONE:{target:"enterEmailOrPhone",actions:["assignData","setPhoneLoginMethod"]},GO_PASSWORD_SIGNUP_AIRDROP:{target:"signupAirdropSetupPassword",actions:"assignData"},GO_PASSWORD_SIGNUP_BY_EMAIL:{target:"setPasswordSignUpByEmail",actions:["assignData","setEmailLoginMethod"]},GO_PASSWORD_SIGNUP_BY_EMAIL_SUB_USER:{target:"setPasswordSignUpByEmailSubUser",actions:["assignData","setEmailLoginMethod"]},GO_PASSWORD_LOGIN_BY_EMAIL:{target:"enterPasswordLoginByEmail",actions:["assignData","setEmailLoginMethod"]},GO_OAUTH_2FA_SMS:{target:"enterSMSLoginByOAuth"},GO_OAUTH_GOOGLE_AUTH:{target:"enterGALoginByOAuth"},GO_OAUTH_LOCATION_CONFIRM:{target:"locationConfirmOAuth"},GO_OAUTH_DEFINE_PASSWORD:{target:"oauthSetupPassword"},GO_OAUTH_WAITING_FEEDBACK:{target:"oauthWaitingFeedback",actions:"assignData"},GO_OAUTH_ERROR_FEEDBACK:{target:"oauthErrorFeedback",actions:"assignData"},GO_SUCCESS:{target:"success"}}},enterSMSLoginByOAuth:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}},enterGALoginByOAuth:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}},locationConfirmOAuth:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"},GO_OAUTH_GOOGLE_AUTH:{target:"enterGALoginByOAuth"},GO_OAUTH_2FA_SMS:{target:"enterSMSLoginByOAuth"},GO_EMAIL_CONFIRM:{target:"verifyEmail"}}},oauthWaitingFeedback:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success",actions:"userWasLoggedIn"},GO_OAUTH_ERROR_FEEDBACK:{target:"oauthErrorFeedback",actions:"assignData"},GO_OAUTH_2FA_SMS:{target:"enterSMSLoginByOAuth"},GO_OAUTH_GOOGLE_AUTH:{target:"enterGALoginByOAuth"},GO_OAUTH_LOCATION_CONFIRM:{target:"locationConfirmOAuth"},GO_OAUTH_DEFINE_PASSWORD:{target:"oauthSetupPassword"}}},oauthErrorFeedback:{on:{GO_BACK:{target:"enterEmailOrPhone"}}},oauthSetupPassword:{on:{GO_BACK:{target:"enterEmailOrPhone"},GO_SUCCESS:{target:"success"}}}}},{actions:{assignData:S,setPhoneLoginMethod:C,setEmailLoginMethod:O,userWasLoggedIn:t}})));return o}
1)(B.afterOAuthLoginSuccess),[U,M]=(0,a.eO)(I,{devTools:G}),[N,{sendForward:V,sendBack:x,sendFade:j,sendNoAnim:H}]=(0,i.vH)(M),$=E===h.R.GO_PASSWORD_SIGNUP_BY_EMAIL_SUB_USER,W=(0,r.useCallback)((e=>{V({type:E??h.R.GO_PASSWORD_SIGNUP_BY_EMAIL,payload:{email:e}}),m&&(m(),A.extendedModules.startTrackUserAuth.setAuthBeginPage("signup"))}),[A,m,E,V]),z=(0,r.useCallback)((e=>{V({type:"GO_PASSWORD_LOGIN_BY_EMAIL",payload:{email:e}}),o&&(o(),A.extendedModules.startTrackUserAuth.setAuthBeginPage("login"))}),[A,o,V]);(0,r.useEffect)((()=>{const e=new URLSearchParams(w.location.search);b&&"login"===e.get("do")&&B.fetchRegistrationState(b).then((e=>{e===g.bv.USER_REGISTRATION_STATE_AUTHENTICATE?z(b):W(b)}))}),[b,z,W,w.location.search,B]),(0,r.useEffect)((()=>{U.matches("success")&&(t?.(),A.extendedModules.startTrackUserAuth.setAuthEnded(U.context.email?"email":U.context.mobileNumber?"phone":"unknown"),A.trackEvent({category:"authentication",action:"success-log-in",label:`Email: ${U.context.email}; Phone: ${U.context.countryCode}
1 ${U.context.mobileNumber}`}))}),[A,t,U,U.value]);const K=F();return(0,r.useEffect)((()=>{A.extendedModules.startTrackUserAuth.setAuthFormOpen()}),[A]),r.createElement("div",{className:K.mobileWrapper},r.createElement(i.u$,{direction:L,transitionClass:N,transitionKey:U.toStrings()[0],padded:!1},r.createElement(Oe,{sendForward:V,sendBack:x,sendFade:j,sendNoAnim:H,state:U,vm:B,email:b,referralCode:n||P.inviterCode,handleGoPasswordSignupEmail:W,handleGoPasswordLoginEmail:z,noPhone:$})))}));be.displayName="AuthForm";const ve=(0,n.Pi)((e=>{let{onSuccessfulVerify:t,onClose:o}=e;const a=(0,s.G)("analytics"),u=(0,s.G)("segment"),g=(0,c.$)(),d=(0,s.G)("http"),h=(0,n.hN)((()=>new D(a,g,d,u))),y=(0,l.U)(),m=(0,p.Ux)(y),S=(0,r.useCallback)((()=>{t()}),[t]),C=(0,r.useCallback)((()=>{a.trackEvent({category:"Login",action:"SignUpEmailVerify",label:"Skip"}),h.authService.setCheckSignedInUser(!1),o()}),[a,o,h.authService]),O=F();return r.createElement("div",{className:O.mobileWrapper},r.createElement(i.u$,{direction:m,padded:!1},r.createElement("div",null,r.createElement(J,{type:"login",email:h.usersRepository.activeUserProfile.email,resend:h.resendEmailConfirmationCode,confirm:h.confirmEmail,onSkip:C,onConfirm:S,onClose:o}))))}));ve.displayName="Verify"}}]);
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.