2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3041],{51133:(e,t,a)=>{a.r(t),a.d(t,{AuthCode:()=>v,AuthPassword:()=>f,AuthRegister:()=>y});var n=a(14050),r=a(33555),o=a(77361),l=a(60782),s=a(32340),i=a(46590),c=a(59107),d=a(97687),u=a(34288),m=a(83716),h=a(13365),Z=a(97799);const g=o.wB?m.qp:m.z7,p=(0,n.X$)((e=>{let{code:t,codeLength:a,trackingDirection:r,isTracking:o,isBig:l}=e;const[s,i]=(0,n.eJ)(!1),c=165/a,d=(0,n.I4)((()=>i(!0)),[]);return n.ZP.createElement("div",{id:"monkey",className:l?"big":""},!s&&n.ZP.createElement("div",{className:"monkey-preview"}),n.ZP.createElement(Z.Z,{size:l?m.K2:g,className:o?"hidden":void 0,tgsUrl:h.l.MonkeyIdle,play:!o,onLoad:d}),n.ZP.createElement(Z.Z,{size:l?m.K2:g,className:o?"shown":"hidden",tgsUrl:h.l.MonkeyTracking,playSegment:o?function(){const e=t&&t.length>1||r<0?15+c*(t.length-1):0,n=t.length===a?180:15+c*t.length;return r<1?[n,e]:[e,n]}():void 0,speed:2,noLoop:!0}))})),v=(0,n.X$)((0,r.c$)((e=>(0,l.ei)(e,["authPhoneNumber","authIsCodeViaApp","authIsLoading","authError"])))((e=>{let{authPhoneNumber:t,authIsCodeViaApp:a,authIsLoading:l,authError:m}=e;const{setAuthCode:h,returnToAuthPhoneNumber:Z,clearAuthError:g}=(0,r.Sv)(),v=(0,c.Z)(),P=(0,n.sO)(null),[E,f]=(0,n.eJ)(""),[b,N]=(0,n.eJ)(!1),[y,C]=(0,n.eJ)(1);(0,n.d4)((()=>{o.$b||P.current.focus()}),[]),(0,i.Z)({isActive:!0,onBack:Z});const w=(0,n.I4)((e=>{m&&g();const{currentTarget:t}=e;t.value=t.value.replace(/[^\d]+/,"").substr(0,5),t.value!==E&&(f(t.value),b?t.value.length||N(!1):N(!0),E&&E.length>t.value.length?C(-1):C(1),5===t.value.length&&h({code:t.value}))}),[m,g,E,b,h]);return n.ZP.createElement("div",{id:"auth-code-form",className:"custom-scroll"},n.ZP.createElement("div",{className:"auth-form"},n.ZP.createElement(p,{code:E,codeLength:5,isTracking:b,trackingDirection:y}),n.ZP.createElement("h1",null,t,n.ZP.createElement("div",{className:"auth-number-edit",onClick:Z,role:"button",tabIndex:0,title:v("WrongNumber")},n.ZP.createElement("i",{className:"icon-edit"}))),n.ZP.createElement("p",{className:"note"},(0,s.Z)(v(a?"SentAppCode":"Login.JustSentSms"),["simple_markdown"])),n.ZP.createElement(d.Z,{ref:P,id:"sign-in-code",label:v("Code"),onInput:w,value:E,error:m&&v(m),autoComplete:"off",inputMode:"numeric"}),l&&n.ZP.createElement(u.Z,null)))})));var P=a(93490),E=a(99364);const f=(0,n.X$)((0,r.c$)((e=>(0,l.ei)(e,["authIsLoading","authError","authHint"])))((e=>{let{authIsLoading:t,authError:a,authHint:o}=e;const{setAuthPassword:l,clearAuthError:s}=(0,r.Sv)(),i=(0,c.Z)(),[d,u]=(0,n.eJ)(!1),m=(0,n.I4)((e=>{u(e)}),[]),h=(0,n.I4)((e=>{l({password:e})}),[l]);return n.ZP.createElement("div",{id:"auth-password-form",className:"custom-scroll"},n.ZP.createElement("div",{className:"auth-form"},n.ZP.createElement(P.Z,{isPasswordVisible:d}),n.ZP.createElement("h1",null,i("Login.Header.Password")),n.ZP.createElement("p",{className:"note"},i("Login.EnterPasswordDescription")),n.ZP.createElement(E.Z,{clearError:s,error:a&&i(a),hint:o,isLoading:t,isPasswordVisible:d,onChangePasswordVisibility:m,onSubmit:h})))})));var b=a(231),N=a(90710);const y=(0,n.X$)((0,r.c$)((e=>(0,l.ei)(e,["authIsLoading","authError"])))((e=>{let{authIsLoading:t,authError:a}=e;const{signUp:o,clearAuthError:l,uploadProfilePhoto:s}=(0,r.Sv)(),i=(0,c.Z)(),[u,m]=(0,n.eJ)(!1),[h,Z]=(0,n.eJ)(),[g,p]=(0,n.eJ)(""),[v,P]=(0,n.eJ)(""),E=(0,n.I4)((e=>{a&&l();const{target:t}=e;p(t.value),m(t.value.length>0)}),[a,l]),f=(0,n.I4)((e=>{const{target:t}=e;P(t.value)}),[]);return n.ZP.createElement("div",{id:"auth-registration-form",className:"custom-scroll"},n.ZP.createElement("div",{className:"auth-form"},n.ZP.createElement("form",{action:"",method:"post",onSubmit:function(e){e.preventDefault(),o({firstName:g,lastName:v}),h&&s({file:h})}},n.ZP.createElement(N.Z,{onChange:Z}),n.ZP.createElement("h2",null,i("YourName")),n.ZP.createElement("p",{className:"note"},i("Login.Register.Desc")),n.ZP.createElement(d.Z,{id:"registration-first-name",label:i("Login.Register.FirstName.Placeholder"),onChange:E,value:g,error:a&&i(a),autoComplete:"given-name"}),n.ZP.createElement(d.Z,{id:"registration-last-name",label:i("Login.Register.LastName.Placeholder"),onChange:f,value:v,autoComplete:"family-name"}),u&&n.ZP.createElement(b.Z,{type:"submit",ripple:!0,isLoading:t},i("Next")))))})))},99364:(e,t,a)=>{a.d(t,{Z:()=>m});var n=a(14050),r=a(83716),o=a(77361),l=a(46752),s=a(3858),i=a(59107),c=a(28183),d=a(231);const u=o.wB?550:400,m=(0,n.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:a,error:m,hint:h,placeholder:Z="Password",submitLabel:g="Next",description:p,shouldShowSubmit:v,shouldResetValue:P,shouldDisablePasswordManager:E=!1,noRipple:f=!1,clearError:b,onChangePasswordVisibility:N,onInputChange:y,onSubmit:C}=e;const w=(0,n.sO)(null),L=(0,i.Z)(),[k,I]=(0,n.eJ)(""),[A,S]=(0,n.eJ)(!1);return(0,n.d4)((()=>{P&&I("")}),[P]),(0,c.Z)((()=>{o.$b||w.current.focus()}),u),(0,n.d4)((()=>{m&&requestAnimationFrame((()=>{w.current.focus(),w.current.select()}))}),[m]),n.ZP.createElement("form",{action:"",onSubmit:C?function(e){e.preventDefault(),t||A&&C(k)}:s.Z,autoComplete:"off"},n.ZP.createElement("div",{className:(0,l.Z)("input-group password-input",k&&"touched",m&&"error"),dir:L.isRtl?"rtl":void 0},E&&n.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),n.ZP.createElement("input",{ref:w,className:"form-control",type:a?"text":"password",id:"sign-in-password",value:k||"",autoComplete:E?"one-time-code":"current-password",onChange:function(e){m&&b();const{target:t}=e;I(t.value),S(t.value.length>=r.lo),y&&y(t.value)},maxLength:256,dir:"auto"}),n.ZP.createElement("label",null,m||h||Z),n.ZP.createElement("div",{className:"toggle-password",onClick:function(){N(!a)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.ZP.createElement("i",{className:a?"icon-eye":"icon-eye-closed"}))),p&&n.ZP.createElement("p",{className:"description"},p),C&&(A||v)&&n.ZP.createElement(d.Z,{type:"submit",ripple:!f,isLoading:t,disabled:!A},g))}))},93490:(e,t,a)=>{a.d(t,{Z:()=>Z});var n=a(14050),r=a(83716),o=a(77361),l=a(13365),s=a(97799),i=a(28183),c=a(60706);const d=[0,50],u=[0,20],m=[20,0],h=o.wB?r.qp:r.z7,Z=(0,n.X$)((e=>{let{isPasswordVisible:t,isBig:a}=e;const[o,Z]=(0,c.Z)(!1),[g,p]=(0,c.Z)(!1);(0,i.Z)(p,2e3);const v=(0,n.I4)(Z,[Z]);return n.ZP.createElement("div",{id:"monkey",className:a?"big":""},!o&&n.ZP.createElement("div",{className:"monkey-preview"}),n.ZP.createElement(s.Z,{size:a?r.K2:h,className:g?"hidden":"shown",tgsUrl:l.l.MonkeyClose,playSegment:d,noLoop:!0,onLoad:v}),n.ZP.createElement(s.Z,{size:a?r.K2:h,className:g?"shown":"hidden",tgsUrl:l.l.MonkeyPeek,playSegment:t?u:m,noLoop:!0}))}))},90710:(e,t,a)=>{a.d(t,{Z:()=>p});var n=a(14050),r=a(46752),o=a(83716),l=a(71394),s=a(59107),i=a(231),c=a(13103),d=a(34288);const u={type:"blob",quality:1,format:"jpeg",circle:!1,size:{width:1024,height:1024}};let m,h,Z;const g=(0,n.X$)((e=>{let{file:t,onChange:r,onClose:g}=e;const[p,v]=(0,n.eJ)(!1);(0,n.d4)((()=>{t&&(p?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;Z=new m(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const r=await(0,l.YJ)(e);await Z.bind({url:r})}catch(e){o.eM&&console.error(e)}}(t):async function(){return h||(h=Promise.all([a.e(5099),a.e(3472)]).then(a.bind(a,23472)),m=(await h).default),h}().then((()=>v(!0))))}),[t,p]);const P=(0,s.Z)(),E=(0,n.I4)((async()=>{if(!Z)return;const e=await Z.result(u),t="string"==typeof e?e:(0,l.hl)(e,"avatar.jpg");r(t)}),[r]);return n.ZP.createElement(c.Z,{isOpen:Boolean(t),onClose:g,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},p?n.ZP.createElement("div",{id:"avatar-crop"}):n.ZP.createElement(d.Z,null),n.ZP.createElement(i.Z,{className:"confirm-button",round:!0,color:"primary",onClick:E,ariaLabel:P("CropImage")},n.ZP.createElement("i",{className:"icon-check"})))})),p=(0,n.X$)((e=>{let{title:t="Change your profile picture",disabled:a,currentAvatarBlobUrl:o,onChange:l}=e;const[s,i]=(0,n.eJ)(),[c,d]=(0,n.eJ)(o);(0,n.d4)((()=>{d(o)}),[o]);const u=(0,n.I4)((e=>{i(void 0),l(e),c&&URL.revokeObjectURL(c),d(URL.createObjectURL(e))}),[c,l]),m=(0,n.I4)((()=>{i(void 0)}),[]),h=(0,r.Z)(c&&"filled",a&&"disabled");return n.ZP.createElement("div",{className:"AvatarEditable"},n.ZP.createElement("label",{className:h,role:"button",tabIndex:0,title:t},n.ZP.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(i(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),n.ZP.createElement("i",{className:"icon-camera-add"}),c&&n.ZP.createElement("img",{src:c,alt:"Avatar"})),n.ZP.createElement(g,{file:s,onClose:m,onChange:u}))}))},13103:(e,t,a)=>{a.d(t,{Z:()=>h});var n=a(14050),r=a(517),o=a(46752),l=a(18674),s=a(31212),i=a(274),c=a(59107),d=a(46590),u=a(231),m=a(62898);const h=e=>{let{dialogRef:t,title:a,className:h,isOpen:Z,header:g,hasCloseButton:p,noBackdrop:v,children:P,style:E,onClose:f,onCloseAnimationEnd:b,onEnter:N,shouldSkipHistoryAnimations:y}=e;const{shouldRender:C,transitionClassNames:w}=(0,s.Z)(Z,b,y,void 0,y),L=(0,n.sO)(null);(0,n.d4)((()=>Z?(0,r.Z)({onEsc:f,onEnter:N}):void 0),[Z,f,N]),(0,n.d4)((()=>Z&&L.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const a=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!a.length)return;const n=a.findIndex((e=>e.isSameNode(document.activeElement)));let r=0;n>=0&&(r=t.shiftKey?n>0?n-1:a.length-1:n<a.length-1?n+1:0),a[r].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(L.current):void 0),[Z]),(0,d.Z)({isActive:Z,onBack:f}),(0,i.Z)((e=>{let[t]=e;return document.body.classList.toggle("has-open-dialog",Boolean(Z)),(Z||!Z&&void 0!==t)&&(0,l.YW)(200),()=>{document.body.classList.remove("has-open-dialog")}}),[Z]);const k=(0,c.Z)();if(!C)return;const I=(0,o.Z)("Modal",h,w,v&&"transparent-backdrop");return n.ZP.createElement(m.Z,null,n.ZP.createElement("div",{ref:L,className:I,tabIndex:-1,role:"dialog"},n.ZP.createElement("div",{className:"modal-container"},n.ZP.createElement("div",{className:"modal-backdrop",onClick:f}),n.ZP.createElement("div",{className:"modal-dialog",ref:t},g||(a?n.ZP.createElement("div",{className:"modal-header"},p&&n.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:k("Close"),onClick:f},n.ZP.createElement("i",{className:"icon-close"})),n.ZP.createElement("div",{className:"modal-title"},a)):void 0),n.ZP.createElement("div",{className:"modal-content custom-scroll",style:E},P)))))}},62898:(e,t,a)=>{a.d(t,{Z:()=>o});var n=a(14050),r=a(31664);const o=e=>{let{containerId:t,className:a,children:o}=e;const l=(0,n.sO)();return l.current||(l.current=document.createElement("div")),(0,n.bt)((()=>{const e=document.querySelector(t||"#portals");if(!e)return;const n=l.current;return a&&n.classList.add(a),e.appendChild(n),()=>{r.Z.render(void 0,n),e.removeChild(n)}}),[a,t]),r.Z.render(o,l.current)}},28183:(e,t,a)=>{a.d(t,{Z:()=>r});var n=a(14050);const r=function(e,t){const a=(0,n.sO)(e);(0,n.bt)((()=>{a.current=e}),[e]),(0,n.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>a.current()),t);return()=>clearTimeout(e)}),[t])}},3858:(e,t,a)=>{a.d(t,{Z:()=>n});const n=e=>{e.stopPropagation(),e.preventDefault()}}}]);
|
|
//# sourceMappingURL=3041.59c192ae5993ba0e9bfb.js.map
|