!function(e){function t(t){for(var n,a,i=t[0],r=t[1],c=0,s=[];c1)&&!o.a.MSStream,u=!!("safari"in o.a)||!(!a||!(/\b(iPad|iPhone|iPod)\b/.test(a)||a.match("Safari")&&!a.match("Chrome"))),d=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,l=u&&s,f=navigator.maxTouchPoints>0&&-1!=navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)},function(e,t,n){"use strict";n.r(t),n.d(t,"IS_TOUCH_SUPPORTED",(function(){return o}));const o="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;t.default=o},function(e,t,n){"use strict";const o="undefined"!=typeof window?window:self;t.a=o},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return s}));var o=n(1),a=n(0),i=n(6),r=n(4);const c=a.IS_SAFARI&&a.IS_MOBILE&&o.IS_TOUCH_SUPPORTED;if(c){let e="clientY",t=0;const n={capture:!0,passive:!1},o=n=>{const o=n.touches[0],a=Object(i.a)(o.target,"scrollable-y");if(a){const i=o[e],r=t-i,c=a.scrollTop,s=a.scrollHeight,u=a.clientHeight,d=c?Math.round(c+a.clientHeight+r):c+r;(s===u||d>=s||d<=0)&&n.preventDefault()}else n.preventDefault()};let a=0;document.addEventListener("focusin",i=>{!i.target.classList.contains("is-sticky-input-bugged")||i.timeStamp-a<50||(Object(r.a)(i.target),document.addEventListener("touchmove",o,n),document.addEventListener("touchstart",n=>{if(n.touches.length>1)return;const o=n.touches[0];t=o[e]}))},{passive:!0}),document.addEventListener("focusout",e=>{document.removeEventListener("touchmove",o,n),a=e.timeStamp},{passive:!0}),document.addEventListener("visibilitychange",()=>{document.activeElement&&document.activeElement.classList.contains("is-sticky-input-bugged")&&document.activeElement.blur&&Object(r.a)(document.activeElement)},{passive:!0})}function s(e){c&&e.classList.add("is-sticky-input-bugged")}},function(e,t,n){"use strict";function o(e){e.style.transform="translateY(-99999px)",e.focus(),setTimeout(()=>{e.style.transform=""},0)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";function o(e){if(e=e||window.event){e=e.originalEvent||e;try{e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.cancelBubble=!0}catch(e){}}return!1}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";function o(e,t){return e.closest("."+t)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";const o={id:1025907,hash:"452b0359b988148995f22ff0f4229750",version:"1.4.1",versionFull:"1.4.1 (156)",build:156,langPackVersion:"0.4.0",langPack:"macos",langPackCode:"en",domains:["web.telegram.org"],baseDcId:2,isMainDomain:"web.telegram.org"===location.hostname,suffix:"K"};o.isMainDomain&&(o.id=2496,o.hash="8da85b0d5bfe62527e5b244c209159c3"),t.a=o},function(e,t,n){"use strict";function o(){return!(!document.activeElement||!document.activeElement.blur)&&(document.activeElement.blur(),!0)}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";let o;function a(){return o||(o="fonts"in document?Promise.race([Promise.all(["400 1rem Roboto","500 1rem Roboto","500 1rem tgico"].map(e=>document.fonts.load(e))),new Promise(e=>setTimeout(e,1e3))]):Promise.resolve())}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";const o=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i);t.a=o},function(e,t,n){"use strict";n.r(t);var o=n(7),a=n(8),i=n(5),r=n(3),c=n(9),s=n(10),u=n(0),d=(n(12),n(13),n(14),function(e,t,n,o){return new(n||(n=Promise))((function(a,i){function r(e){try{s(o.next(e))}catch(e){i(e)}}function c(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}s((o=o.apply(e,t||[])).next())}))});document.addEventListener("DOMContentLoaded",()=>d(void 0,void 0,void 0,(function*(){Element.prototype.toggleAttribute||(Element.prototype.toggleAttribute=function(e,t){return void 0!==t&&(t=!!t),this.hasAttribute(e)?!!t||(this.removeAttribute(e),!1):!1!==t&&(this.setAttribute(e,""),!0)});const e=window.visualViewport||window;let t,d=!1;const l=()=>{const n=.01*(d&&!v.default.isOverlayActive?e.height||e.innerHeight:window.innerHeight);t!==n&&(b.IS_TOUCH_SUPPORTED&&t1&&Object(a.a)(),t=n,document.documentElement.style.setProperty("--vh",n+"px"))},f=new Proxy(Worker,{construct:(e,t)=>new e(t[0]+location.search)});Worker=f;const[m,b,h,v,g,p,P]=yield Promise.all([n.e(24).then(n.bind(null,27)),Promise.resolve().then(n.bind(null,1)),Promise.resolve().then(n.bind(null,0)),n.e(20).then(n.bind(null,15)),Promise.all([n.e(0),n.e(22)]).then(n.bind(null,17)),Promise.all([n.e(0),n.e(1)]).then(n.bind(null,16)),n.e(28).then(n.bind(null,28))]);if(window.addEventListener("resize",l),l(),r.a){const t=()=>{d=1===n&&r.a&&!v.default.isOverlayActive,l(),e!==window&&(d?(window.removeEventListener("resize",l),e.addEventListener("resize",l)):(e.removeEventListener("resize",l),window.addEventListener("resize",l)))};let n;v.default.addEventListener("im_tab_change",e=>{const o=void 0!==n;n=e,(o||1===n)&&t()}),v.default.addEventListener("overlay_toggle",()=>{t()})}h.IS_FIREFOX&&!s.a&&document.addEventListener("dragstart",e=>{const t=e.target;if("IMG"===t.tagName&&t.classList.contains("emoji"))return Object(i.a)(e),!1}),document.addEventListener("dragstart",e=>{var t;if("IMG"===(null===(t=e.target)||void 0===t?void 0:t.tagName))return e.preventDefault(),!1}),h.IS_FIREFOX&&document.documentElement.classList.add("is-firefox"),h.IS_MOBILE&&document.documentElement.classList.add("is-mobile"),h.IS_APPLE?(h.IS_SAFARI&&document.documentElement.classList.add("is-safari"),h.IS_APPLE_MOBILE?document.documentElement.classList.add("is-ios"):document.documentElement.classList.add("is-mac")):h.IS_ANDROID&&document.documentElement.classList.add("is-android"),b.IS_TOUCH_SUPPORTED?document.documentElement.classList.add("is-touch"):document.documentElement.classList.add("no-touch");const y=performance.now(),E=p.default.getCacheLangPack(),[S,w]=yield Promise.all([g.default.getState(),E]);function I(e,t){e.style.opacity="0",t.then(()=>{window.requestAnimationFrame(()=>{e.style.opacity=""})})}p.default.setTimeFormat(S.settings.timeFormat),v.default.setThemeListener(),w.appVersion!==o.a.langPackVersion&&p.default.getLangPack(w.lang_code),console.log("got state, time:",performance.now()-y);const O=S.authState;if("authStateSignedIn"!==O._){console.log("Will mount auth page:",O._,Date.now()/1e3);const e=document.getElementById("auth-pages");let t,o;if(e){t=e.querySelector(".scrollable"),b.IS_TOUCH_SUPPORTED&&!u.IS_MOBILE_SAFARI||t.classList.add("no-scrollbar"),t.style.opacity="0";const n=document.createElement("div");n.classList.add("auth-placeholder"),t.prepend(n),t.append(n.cloneNode())}try{yield Promise.all([Promise.all([n.e(0),n.e(1)]).then(n.bind(null,24)),Promise.all([n.e(0),n.e(1)]).then(n.bind(null,26))]).then(([e,t])=>{e.default.setAuthorized(!1),t.default.forceUnsubscribe()})}catch(e){}switch(O._){case"authStateSignIn":o=(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(13)]).then(n.bind(null,21))).default.mount();break;case"authStateSignQr":o=(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(21)]).then(n.bind(null,20))).default.mount();break;case"authStateAuthCode":o=(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(12)]).then(n.bind(null,22))).default.mount(O.sentCode);break;case"authStatePassword":o=(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(15)]).then(n.bind(null,23))).default.mount();break;case"authStateSignUp":o=(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(3),n.e(14)]).then(n.bind(null,25))).default.mount(O.authCode)}if(t){o&&(yield o);I(t,"fonts"in document?Promise.race([new Promise(e=>setTimeout(e,1e3)),document.fonts.ready]):Promise.resolve())}}else console.log("Will mount IM page:",Date.now()/1e3),I(document.getElementById("main-columns"),Object(c.a)()),(yield Promise.all([n.e(0),n.e(1),n.e(2),n.e(30)]).then(n.bind(null,19))).default.mount();const L=(yield n.e(17).then(n.bind(null,18))).ripple;Array.from(document.getElementsByClassName("rp")).forEach(e=>L(e))})))},function(e,t,n){},function(e,t,n){},function(e,t,n){}]); //# sourceMappingURL=main.e6b04e119390f0e1183e.bundle.js.map