2022-02-04 21:37:36 +01:00
|
|
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[133],{1133:(e,t,n)=>{n.r(t),n.d(t,{AuthCode:()=>Z,AuthPassword:()=>P,AuthRegister:()=>w});var a=n(4050),o=n(5116),r=n(7361),s=n(782),l=n(2340),i=n(6590),c=n(9107),d=n(7687),u=n(4288),m=n(3716),p=n(7324),g=n(7799);const h=r.wB?m.qp:m.z7,f=(0,a.X$)((e=>{let{code:t,codeLength:n,trackingDirection:o,isTracking:r,isBig:s}=e;const[l,i]=(0,a.eJ)(),[c,d]=(0,a.eJ)(),[u,f]=(0,a.eJ)(!1),Z=165/n;(0,a.d4)((()=>{l||(0,p.Z)("MonkeyIdle").then(i)}),[l]),(0,a.d4)((()=>{c||(0,p.Z)("MonkeyTracking").then(d)}),[c]);const v=(0,a.I4)((()=>f(!0)),[]);return a.ZP.createElement("div",{id:"monkey",className:s?"big":""},!u&&a.ZP.createElement("div",{className:"monkey-preview"}),l&&a.ZP.createElement(g.Z,{id:"idleMonkey",size:s?m.K2:h,className:r?"hidden":void 0,animationData:l,play:!r,onLoad:v}),c&&a.ZP.createElement(g.Z,{id:"trackingMonkey",size:s?m.K2:h,className:r?"shown":"hidden",animationData:c,playSegment:r?function(){const e=t&&t.length>1||o<0?15+Z*(t.length-1):0,a=t.length===n?180:15+Z*t.length;return o<1?[a,e]:[e,a]}():void 0,speed:2,noLoop:!0}))})),Z=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authPhoneNumber","authIsCodeViaApp","authIsLoading","authError"])))((e=>{let{authPhoneNumber:t,authIsCodeViaApp:n,authIsLoading:s,authError:m}=e;const{setAuthCode:p,returnToAuthPhoneNumber:g,clearAuthError:h}=(0,o.uC)(),Z=(0,c.Z)(),v=(0,a.sO)(null),[b,P]=(0,a.eJ)(""),[E,y]=(0,a.eJ)(!1),[w,k]=(0,a.eJ)(1);(0,a.d4)((()=>{r.$b||v.current.focus()}),[]),(0,i.ZP)(!0,g);const N=(0,a.I4)((e=>{m&&h();const{currentTarget:t}=e;t.value=t.value.replace(/[^\d]+/,"").substr(0,5),t.value!==b&&(P(t.value),E?t.value.length||y(!1):y(!0),b&&b.length>t.value.length?k(-1):k(1),5===t.value.length&&p({code:t.value}))}),[m,h,b,E,p]);return a.ZP.createElement("div",{id:"auth-code-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement(f,{code:b,codeLength:5,isTracking:E,trackingDirection:w}),a.ZP.createElement("h2",null,t,a.ZP.createElement("div",{className:"auth-number-edit",onClick:g,role:"button",tabIndex:0,title:Z("WrongNumber")},a.ZP.createElement("i",{className:"icon-edit"}))),a.ZP.createElement("p",{className:"note"},(0,l.Z)(Z(n?"SentAppCode":"Login.JustSentSms"),["simple_markdown"])),a.ZP.createElement(d.Z,{ref:v,id:"sign-in-code",label:Z("Code"),onInput:N,value:b,error:m&&Z(m),autoComplete:"one-time-code",inputMode:"numeric"}),s&&a.ZP.createElement(u.Z,null)))})));var v=n(3490),b=n(9364);const P=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authIsLoading","authError","authHint"])))((e=>{let{authIsLoading:t,authError:n,authHint:r}=e;const{setAuthPassword:s,clearAuthError:l}=(0,o.uC)(),i=(0,c.Z)(),[d,u]=(0,a.eJ)(!1),m=(0,a.I4)((e=>{u(e)}),[]),p=(0,a.I4)((e=>{s({password:e})}),[s]);return a.ZP.createElement("div",{id:"auth-password-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement(v.Z,{isPasswordVisible:d}),a.ZP.createElement("h2",null,i("Login.Header.Password")),a.ZP.createElement("p",{className:"note"},i("Login.EnterPasswordDescription")),a.ZP.createElement(b.Z,{clearError:l,error:n&&i(n),hint:r,isLoading:t,isPasswordVisible:d,onChangePasswordVisibility:m,onSubmit:p})))})));var E=n(231),y=n(710);const w=(0,a.X$)((0,o.c$)((e=>(0,s.ei)(e,["authIsLoading","authError"])))((e=>{let{authIsLoading:t,authError:n}=e;const{signUp:r,clearAuthError:s,uploadProfilePhoto:l}=(0,o.uC)(),i=(0,c.Z)(),[u,m]=(0,a.eJ)(!1),[p,g]=(0,a.eJ)(),[h,f]=(0,a.eJ)(""),[Z,v]=(0,a.eJ)("");return a.ZP.createElement("div",{id:"auth-registration-form",className:"custom-scroll"},a.ZP.createElement("div",{className:"auth-form"},a.ZP.createElement("form",{action:"",method:"post",onSubmit:function(e){e.preventDefault(),r({firstName:h,lastName:Z}),p&&l({file:p})}},a.ZP.createElement(y.Z,{onChange:g}),a.ZP.createElement("h2",null,i("YourName")),a.ZP.createElement("p",{className:"note"},i("Login.Register.Desc")),a.ZP.createElement(d.Z,{id:"registration-first-name",label:i("Login.Register.FirstName.Placeholder"),onChange:function(e){n&&s();const{target:t}=
|