tweb/public/63.7ac6657334217aaadb5b.chu...

2 lines
8.9 KiB
JavaScript
Raw Normal View History

2023-03-01 13:58:47 +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),o=n(4541),r=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!==r.ZP.lastRequestedLangCode?Promise.all([e,r.ZP.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),r.ZP.getCacheLangPack()]):[])))).then((([t,n])=>{if(!t)return;const l=[];n.forEach((e=>{const t=r.ZP.strings.get(e.key);t&&(l.push(t),r.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,o.Z)({text:[r.ZP.format(g,!0)]}).then((()=>{window.requestAnimationFrame((()=>{e.append(p)}))})),s.Z.addEventListener("language_change",(()=>{p.remove()}),{once:!0}),l.forEach((e=>{r.ZP.strings.set(e.key,e)})),(0,i.fc)(p,(e=>{(0,a.Z)(e),u=!0,p.disabled=!0,(0,c.y)(p),r.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),o=n(9807),r=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),_=n(7922),L=n(3512),b=n(709),k=n(3855),w=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 w.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 b.Z({onInput:e=>{l.Z.loadLottieWorkers();const{country:n,code:a}=e||{},o=n?n.name||n.default_name:"";o===u.value||t&&n&&a&&(t===n||i.country_code===a.country_code)||u.override(n,a,o),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 M()}));const T=new o.Z({text:"Login.KeepSigned",name:"keepSession",withRipple:!0,checked:!0});T.input.addEventListener("change",(()=>{const e=T.checked;L.Z.managers.appStateManager.pushToState("keepSigned",e),k.Z.toggleStorages(e,!0)})),k.Z.getState().then((e=>{_.Z.isAvailable()?T.checked=e.keepSigned:(T.checked=!1,T.label.classList.add("checkbox-disabled"))})),E=(0,r.Z)("btn-primary btn-color-primary",{text:"Login.Next"}),E.style.visibility="hidden";const M=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;L.Z.managers.apiManager.invokeApi("auth.sendCode",{phone_number:i,api_id:d.Z.id,api_hash:d.Z.hash,settings:{_:"codeSettings",pFlags:{}}}).then((e=>{if("auth.sentCodeSuccess"===e._){const{authorization:t}=e;"auth.authorization"===t._&&(L.Z.managers.apiManager.setUser(t.user),n.e(781).then(n.bind(n,5436)).then((e=>{e.default.mount()})))}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,M),S=(0,r.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 R=document.createElement("div");R.classList.add("subtitle","text-center"),(0,c.$d)(R,"Login.StartText"),P.pageEl.querySelector(".container").append(A,R,e),s.Z||setTimeout((()=>{C.focus()}),0),(0,p.Z)(e),L.Z.managers.apiManager.invokeApi("help.getNearestDc").then((e=>{var t;const n=_.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 o;return e.nearest_dc!==e.this_dc&&(o=L.Z.managers.apiManager.getNetworkerVoid(e.nearest_dc).then((()=>{i.push(e.nearest_d
2023-03-03 16:47:48 +01:00
//# sourceMappingURL=63.7ac6657334217aaadb5b.chunk.js.map