tweb/public/63.f3beda66b31880abf426.chunk.js

2 lines
8.8 KiB
JavaScript
Raw Normal View History

2022-11-18 11:21:09 +01:00
"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[63,709,810,641,776],{9638:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(3910),i=n(2738),r=n(4541),o=n(2325),s=n(3512),d=n(4494),c=n(279);let l,u=!1;function g(e){u||(l||(l=s.Z.managers.apiManager.getConfig().then((e=>e.suggested_lang_code!==o.ZP.lastRequestedLangCode?Promise.all([e,o.ZP.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),o.ZP.getCacheLangPack()]):[])))).then((([t,n])=>{if(!t)return;const l=[];n.forEach((e=>{const t=o.ZP.strings.get(e.key);t&&(l.push(t),o.ZP.strings.set(e.key,e))}));const g="Login.ContinueOnLanguage",p=(0,d.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:g});p.lastElementChild.classList.remove("i18n"),(0,r.Z)({text:[o.ZP.format(g,!0)]}).then((()=>{window.requestAnimationFrame((()=>{e.append(p)}))})),s.Z.addEventListener("language_change",(()=>{p.remove()}),{once:!0}),l.forEach((e=>{o.ZP.strings.set(e.key,e)})),(0,i.fc)(p,(e=>{(0,a.Z)(e),u=!0,p.disabled=!0,(0,c.y)(p),o.ZP.getLangPack(t.suggested_lang_code)}))}))}},810:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var a=n(279),i=n(4874),r=n(9807),o=n(4494),s=n(5432),d=n(4159),c=n(2325),l=n(1447),u=n(1405),g=n(9709),p=n(9638),h=n(3910),m=n(2738),y=n(5565),v=n(1656),f=n(7487),Z=n(2398),L=n(7922),_=n(3512),w=n(709),b=n(3855),k=n(5431);let S,E=null;const P=new i.Z("page-sign",!0,(()=>{const e=document.createElement("div");let t,i;e.classList.add("input-wrapper");const u=new k.Z({onCountryChange:(e,n)=>{t=e,i=n,n&&(x.value=x.lastValue="+"+n.country_code,setTimeout((()=>{C.focus(),(0,Z.Z)(C,!0)}),0))}}),x=new w.Z({onInput:e=>{l.Z.loadLottieWorkers();const{country:n,code:a}=e||{},r=n?n.name||n.default_name:"";r===u.value||t&&n&&a&&(t===n||i.country_code===a.country_code)||u.override(n,a,r),n||x.value.length-1>1?E.style.visibility="":E.style.visibility="hidden"}}),C=x.input;C.addEventListener("keypress",(e=>{if(!E.style.visibility&&"Enter"===e.key)return R()}));const T=new r.Z({text:"Login.KeepSigned",name:"keepSession",withRipple:!0,checked:!0});T.input.addEventListener("change",(()=>{const e=T.checked;_.Z.managers.appStateManager.pushToState("keepSigned",e),b.Z.toggleStorages(e,!0)})),b.Z.getState().then((e=>{L.Z.isAvailable()?T.checked=e.keepSigned:(T.checked=!1,T.label.classList.add("checkbox-disabled"))})),E=(0,o.Z)("btn-primary btn-color-primary",{text:"Login.Next"}),E.style.visibility="hidden";const R=e=>{e&&(0,h.Z)(e);const t=(0,v.Z)([E,S],!0);(0,y.Z)(E,(0,c.ag)("PleaseWait")),(0,a.y)(E);const i=x.value;_.Z.managers.apiManager.invokeApi("auth.sendCode",{phone_number:i,api_id:d.Z.id,api_hash:d.Z.hash,settings:{_:"codeSettings"}}).then((e=>{n.e(392).then(n.bind(n,6392)).then((t=>t.default.mount(Object.assign(e,{phone_number:i}))))})).catch((e=>{t(),"PHONE_NUMBER_INVALID"===e.type?(x.setError(),(0,y.Z)(x.label,(0,c.ag)("Login.PhoneLabelInvalid")),C.classList.add("error"),(0,y.Z)(E,(0,c.ag)("Login.Next"))):(console.error("auth.sendCode error:",e),E.innerText=e.type)}))};(0,m.fc)(E,R),S=(0,o.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:"Login.QR.Login"}),S.addEventListener("click",(()=>{g.default.mount()})),e.append(u.container,x.container,T.label,E,S);const A=document.createElement("h4");A.classList.add("text-center"),(0,c.$d)(A,"Login.Title");const M=document.createElement("div");M.classList.add("subtitle","text-center"),(0,c.$d)(M,"Login.StartText"),P.pageEl.querySelector(".container").append(A,M,e),s.Z||setTimeout((()=>{C.focus()}),0),(0,p.Z)(e),_.Z.managers.apiManager.invokeApi("help.getNearestDc").then((e=>{var t;const n=L.Z.getFromCache("langPack");n&&!(null===(t=n.countries)||void 0===t?void 0:t.hash)&&c.ZP.getLangPack(n.lang_code).then((()=>{x.simulateInputEvent()}));const a=new Set([1,2,3,4,5]),i=[e.this_dc];let r;return e.nearest_dc!==e.this_dc&&(r=_.Z.managers.apiManager.getNetworkerVoid(e.nearest_dc).then((()=>{i.push(e.nearest_dc)}))),(r||Promise.resolve()).then((()=>{i.forEach((e=>{a.delete(e)}));const e=[...a],t=()=>{return n=void 0,a=void 0,r=function*(){const n=e.shift();if(!n)return;const a=`dc${n}_auth_key`;if(yield f
2022-12-09 14:11:06 +01:00
//# sourceMappingURL=63.f3beda66b31880abf426.chunk.js.map