tweb/public/437.613a8ab2d0385dea0bb4.chunk.js
Eduard Kuzmenko a232961f0d Build
2022-07-24 23:08:51 +02:00

2 lines
8.6 KiB
JavaScript

"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[437,442,774],{4494:(e,t,i)=>{i.d(t,{Z:()=>a});var s=i(2325),n=i(1405);const a=(e,t={})=>{const i=document.createElement(t.asDiv?"div":"button");return i.className=e+(t.icon?" tgico-"+t.icon:""),t.noRipple||(t.rippleSquare&&i.classList.add("rp-square"),(0,n.Z)(i)),t.onlyMobile&&i.classList.add("only-handhelds"),t.disabled&&i.setAttribute("disabled","true"),t.text&&i.append((0,s.ag)(t.text)),i}},4425:(e,t,i)=>{i.d(t,{Z:()=>n});var s=i(2384);class n{constructor(e,t){this.passwordInputField=e,this.size=t,this.needFrame=0,this.container=document.createElement("div"),this.container.classList.add("media-sticker-wrapper")}load(){return this.loadPromise?this.loadPromise:this.loadPromise=s.Z.loadAnimationAsAsset({container:this.container,loop:!1,autoplay:!1,width:this.size,height:this.size,noCache:!0},"TwoFactorSetupMonkeyPeek").then((e=>(this.animation=e,this.animation.addEventListener("enterFrame",(e=>{(1===this.animation.direction&&e>=this.needFrame||-1===this.animation.direction&&e<=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())},s.Z.waitForFirstFrame(e))))}remove(){this.animation&&this.animation.remove()}}},6830:(e,t,i)=>{i.d(t,{Z:()=>a});var s=i(3910),n=i(503);class a extends n.Z{constructor(e={}){super(Object.assign({plainText:!0},e)),this.passwordVisible=!1,this.onVisibilityClick=e=>{(0,s.Z)(e),this.passwordVisible=!this.passwordVisible,this.toggleVisible.classList.toggle("eye-hidden",this.passwordVisible),this.input.type=this.passwordVisible?"text":"password",this.onVisibilityClickAdditional&&this.onVisibilityClickAdditional()};const t=this.input;t.type="password",t.setAttribute("required",""),t.name="notsearch_password",t.autocomplete="off";const i=document.createElement("input");i.classList.add("stealthy"),i.tabIndex=-1,i.type="password",t.parentElement.prepend(i),t.parentElement.insertBefore(i.cloneNode(),t.nextSibling);const n=this.toggleVisible=document.createElement("span");n.classList.add("toggle-visible","tgico"),this.container.classList.add("input-field-password"),this.container.append(n),n.addEventListener("click",this.onVisibilityClick),n.addEventListener("touchend",this.onVisibilityClick)}}},279:(e,t,i)=>{function s(e,t=!1){const i='\n <svg xmlns="http://www.w3.org/2000/svg" class="preloader-circular" viewBox="25 25 50 50">\n <circle class="preloader-path" cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"/>\n </svg>';if(t){const t=document.createElement("div");return t.classList.add("preloader"),t.innerHTML=i,e&&e.appendChild(t),t}return e.insertAdjacentHTML("beforeend",i),e.lastElementChild}function n(e,t="check"){return e.classList.remove("tgico-"+t),e.disabled=!0,s(e),()=>{e.innerHTML="",e.classList.add("tgico-"+t),e.removeAttribute("disabled")}}i.d(t,{p:()=>n,y:()=>s}),i(410).GO.putPreloader=s},1405:(e,t,i)=>{i.d(t,{Z:()=>d});var s=i(8497),n=i(9674),a=i(5432),r=i(3512),o=i(5975);let l=0;function d(e,t=(()=>Promise.resolve()),i=null,d=!1,c=e){if(e.querySelector(".c-ripple"))return;e.classList.add("rp");let p,h=document.createElement("div");h.classList.add("c-ripple"),e.classList.contains("rp-square")&&h.classList.add("is-square"),e[d?"prepend":"append"](h);const u=(e,s)=>{const r=Date.now(),o=document.createElement("div"),d=l++,c=1e3*+window.getComputedStyle(h).getPropertyValue("--ripple-duration").replace("s","");p=()=>{let e=Date.now()-r;const t=()=>{n.Z.mutate((()=>{o.remove()})),i&&i(d)};if(e<c){let i=Math.max(c-e,c/2);setTimeout((()=>o.classList.add("hiding")),Math.max(i-c/2,0)),setTimeout(t,i)}else o.classList.add("hiding"),setTimeout(t,c/2);a.Z||window.removeEventListener("contextmenu",p),p=null,w=!1},t&&t(d),window.requestAnimationFrame((()=>{const t=h.getBoundingClientRect();o.classList.add("c-ripple__circle");const i=e-t.left,n=s-t.top,a=Math.sqrt(Math.pow(Math.abs(n-t.height/2)+t.height/2,2)+Math.pow(Math.abs(i-t.width/2)+t.width/2,2)),r=i-a/2,l=n-a/2;o.style.width=o.style.height=a+"px",o.style.left=r+"px",o.style.top=l+"px",h.append(o)}))},m=t=>t.target!==e&&(["BUTTON","A"].includes(t.target.tagName)||(0,s.Z)(t.target,"c-ripple")!==h)&&(c===e||!(0,o.Z)(t.target,c));let w=!1;if(a.Z){let e=()=>{p&&p()};c.addEventListener("touchstart",(t=>{if(!r.Z.settings.animationsEnabled)return;if(t.touches.length>1||w||m(t))return;w=!0;let{clientX:i,clientY:s}=t.touches[0];u(i,s),c.addEventListener("touchend",e,{once:!0}),window.addEventListener("touchmove",(t=>{t.cancelBubble=!0,t.stopPropagation(),e(),c.removeEventListener("touchend",e)}),{once:!0})}),{passive:!0})}else c.addEventListener("mousedown",(e=>{if(![0,2].includes(e.button))return;if(!r.Z.settings.animationsEnabled)return;if("0"===c.dataset.ripple||m(e))return;if(w)return void(w=!1);let{clientX:t,clientY:i}=e;u(t,i),window.addEventListener("mouseup",p,{once:!0,passive:!0}),window.addEventListener("contextmenu",p,{once:!0,passive:!0})}),{passive:!0})}},2614:(e,t,i)=>{function s(e){const t=document.createElement("span");return"string"==typeof e?t.innerHTML=e:t.append(e),t}i.d(t,{Z:()=>s})},1656:(e,t,i)=>{function s(e,t){return t?e.forEach((e=>e.setAttribute("disabled","true"))):e.forEach((e=>e.removeAttribute("disabled"))),()=>s(e,!t)}i.d(t,{Z:()=>s})},9674:(e,t,i)=>{i.d(t,{Z:()=>l});var s=i(3035),n=i(3725),a=i(410),r=i(8487);const o=new class{constructor(){this.promises={},this.raf=s.T2.bind(null),this.scheduled=!1}do(e,t){let i=this.promises[e];return i||(this.scheduleFlush(),i=this.promises[e]=(0,n.Z)()),void 0!==t&&i.then((()=>t())),i}measure(e){return this.do("read",e)}mutate(e){return this.do("write",e)}mutateElement(e,t){const i=(0,r.Z)(e),s=i?this.mutate():Promise.resolve();return void 0!==t&&(i?t():s.then((()=>t()))),s}scheduleFlush(){this.scheduled||(this.scheduled=!0,this.raf((()=>{this.promises.read&&this.promises.read.resolve(),this.promises.write&&this.promises.write.resolve(),this.scheduled=!1,this.promises={}})))}};a.GO&&(a.GO.sequentialDom=o);const l=o},2582:(e,t,i)=>{i.d(t,{Z:()=>n});var s=i(2325);class n{constructor(e){this.element=document.body.querySelector("."+e.className),this.container=document.createElement("div"),this.container.className="container center-align",this.imageDiv=document.createElement("div"),this.imageDiv.className="auth-image",this.title=document.createElement("h4"),e.titleLangKey&&this.title.append((0,s.ag)(e.titleLangKey)),this.subtitle=document.createElement("p"),this.subtitle.className="subtitle",e.subtitleLangKey&&this.subtitle.append((0,s.ag)(e.subtitleLangKey)),this.container.append(this.imageDiv,this.title,this.subtitle),e.withInputWrapper&&(this.inputWrapper=document.createElement("div"),this.inputWrapper.className="input-wrapper",this.container.append(this.inputWrapper)),this.element.append(this.container)}}},9437:(e,t,i)=>{i.r(t),i.d(t,{default:()=>L});var s=i(279),n=i(4755),a=i(4874),r=i(4494),o=i(6830),l=i(4425),d=i(2325),c=i(2582),p=i(3910),h=i(2738),u=i(2614),m=i(5565),w=i(1656),g=i(8115),v=i(3512);let b;const L=new a.Z("page-password",!0,(()=>{const e=new c.Z({className:"page-password",withInputWrapper:!0,titleLangKey:"Login.Password.Title",subtitleLangKey:"Login.Password.Subtitle"}),t=(0,r.Z)("btn-primary btn-color-primary"),a=new d.ZP.IntlElement({key:"Login.Next"});t.append(a.element);const L=new o.Z({label:"LoginPassword",name:"password"});let y;b=L.input,e.inputWrapper.append(L.container,t);let Z,f=()=>(y||(y=window.setInterval(f,1e4)),v.Z.managers.passwordManager.getState().then((e=>{Z=e,Z.hint?(0,m.Z)(L.label,(0,u.Z)((0,g.Z)(Z.hint))):L.setLabel()})));const E=e=>{if(e&&(0,p.Z)(e),!b.value.length)return void b.classList.add("error");const n=(0,w.Z)([b,t],!0);let r=b.value;a.update({key:"PleaseWait"});const o=(0,s.y)(t);L.setValueSilently(""+Math.random()),L.setValueSilently(r),v.Z.managers.passwordManager.check(r,Z).then((e=>{"auth.authorization"===e._?(clearInterval(y),i.e(781).then(i.bind(i,5436)).then((e=>{e.default.mount()})),x&&x.remove()):(t.removeAttribute("disabled"),a.update({key:e._}),o.remove())})).catch((e=>{n(),L.input.classList.add("error"),e.type,a.update({key:"PASSWORD_HASH_INVALID"}),b.select(),o.remove(),f()}))};(0,h.fc)(t,E),b.addEventListener("keypress",(function(e){if(this.classList.remove("error"),a.update({key:"Login.Next"}),"Enter"===e.key)return E()}));const k=n.Z.isMobile?100:166,x=new l.Z(L,k);return e.imageDiv.append(x.container),Promise.all([x.load(),f()])}),null,(()=>{b.focus(),v.Z.managers.appStateManager.pushToState("authState",{_:"authStatePassword"})}))}}]);
//# sourceMappingURL=437.613a8ab2d0385dea0bb4.chunk.js.map