tweb/public/16.dd165468586f22f31041.chu...

2 lines
15 KiB
JavaScript
Raw Normal View History

2022-03-25 16:07:29 +01:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[16,15,19],{107:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n=i(5),s=i(36);class a extends s.b{constructor(t={}){super(Object.assign({plainText:!0},t)),this.passwordVisible=!1,this.onVisibilityClick=t=>{Object(n.a)(t),this.passwordVisible=!this.passwordVisible,this.toggleVisible.classList.toggle("eye-hidden",this.passwordVisible),this.input.type=this.passwordVisible?"text":"password",this.onVisibilityClickAdditional&&this.onVisibilityClickAdditional()};const e=this.input;e.type="password",e.setAttribute("required",""),e.name="notsearch_password",e.autocomplete="off";const i=document.createElement("input");i.classList.add("stealthy"),i.tabIndex=-1,i.type="password",e.parentElement.prepend(i),e.parentElement.insertBefore(i.cloneNode(),e.nextSibling);const s=this.toggleVisible=document.createElement("span");s.classList.add("toggle-visible","tgico"),this.container.classList.add("input-field-password"),this.container.append(s),s.addEventListener("click",this.onVisibilityClick),s.addEventListener("touchend",this.onVisibilityClick)}}},117:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(51);class s{constructor(t,e){this.passwordInputField=t,this.size=e,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper")}load(){return this.loadPromise?this.loadPromise:this.loadPromise=n.a.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size,noCache:!0},"TwoFactorSetupMonkeyPeek").then(t=>(this.animation=t,this.animation.addEventListener("enterFrame",t=>{(1===this.animation.direction&&t>=this.needFrame||-1===this.animation.direction&&t<=this.needFrame)&&(this.animation.setSpeed(1),this.animation.pause())}),this.passwordInputField.onVisibilityClickAdditional=()=>{this.passwordInputField.passwordVisible?(this.animation.setDirection(1),this.animation.curFrame=0,this.needFrame=16,this.animation.play()):(this.animation.setDirection(-1),this.animation.curFrame=16,this.needFrame=0,this.animation.play())},n.a.waitForFirstFrame(t)))}remove(){this.animation&&this.animation.remove()}}},23:function(t,e,i){"use strict";i.r(e);var n=i(35),s=i(38),a=i(17),o=i(88),r=i(69),l=i(34),c=i(107),u=i(117),d=i(31),h=i(16),p=i(98),m=i(5),g=i(29),b=i(99),f=i(33),v=i(55);let w;const y=new r.a("page-password",!0,()=>{const t=new p.a({className:"page-password",withInputWrapper:!0,titleLangKey:"Login.Password.Title",subtitleLangKey:"Login.Password.Subtitle"}),e=Object(l.a)("btn-primary btn-color-primary"),a=new h.default.IntlElement({key:"Login.Next"});e.append(a.element);const r=new c.a({label:"LoginPassword",name:"password"});let y;w=r.input,t.inputWrapper.append(r.container,e);let E,L=()=>(y||(y=window.setInterval(L,1e4)),o.a.getState().then(t=>{E=t,E.hint?Object(f.a)(r.label,Object(b.a)(d.b.wrapEmojiText(E.hint))):r.setLabel()}));const k=t=>{if(t&&Object(m.a)(t),!w.value.length)return void w.classList.add("error");const s=Object(v.a)([w,e],!0);let l=w.value;a.update({key:"PleaseWait"});const c=Object(n.f)(e);r.setValueSilently(""+Math.random()),r.setValueSilently(l),o.a.check(l,E).then(t=>{switch(t._){case"auth.authorization":clearInterval(y),i.e(4).then(i.bind(null,19)).then(t=>{t.default.mount()}),T&&T.remove();break;default:e.removeAttribute("disabled"),a.update({key:t._}),c.remove()}}).catch(t=>{s(),r.input.classList.add("error"),t.type,a.update({key:"PASSWORD_HASH_INVALID"}),w.select(),c.remove(),L()})};Object(g.b)(e,k),w.addEventListener("keypress",(function(t){if(this.classList.remove("error"),a.update({key:"Login.Next"}),"Enter"===t.key)return k()}));const S=s.b.isMobile?100:166,T=new u.a(r,S);return t.imageDiv.append(T.container),Promise.all([T.load(),L()])},null,()=>{w.focus(),a.default.pushToState("authState",{_:"authStatePassword"})});e.default=y},33:function(t,e,i){"use strict";function n(t,e){if("string"==typeof e)return void(t.innerHTML=e);const i=t.firstChild;i?t.lastChild===i?i.replaceWith(e):(t.textContent="",t.append(e)):t.append(e)}i.d(e,"a",(function(
//# sourceMappingURL=16.dd165468586f22f31041.chunk.js.map