tweb/public/main.1fe88778f443685606bb.b...

2 lines
60 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{"use strict";var e,t,n,s,i,o,r,a,c,l={236:(e,t,n)=>{n.d(t,{h:()=>c});var s=n(4762),i=n(144),o=n(4159);const r=o.Z.version,a=o.Z.build,c={allDialogsLoaded:{},pinnedOrders:{},contactsListCachedTime:0,updates:{},filtersArr:[],maxSeenMsgId:0,stateCreatedTime:Date.now(),recentEmoji:[],recentCustomEmoji:[],topPeersCache:{},recentSearch:[],version:r,build:a,authState:{_:s.IS_MOBILE?"authStateSignIn":"authStateSignQr"},hiddenPinnedMessages:{},settings:{messagesTextSize:16,distanceUnit:"kilometers",sendShortcut:"enter",animationsEnabled:!0,autoDownload:{photo:{contacts:!0,private:!0,groups:!0,channels:!0},video:{contacts:!0,private:!0,groups:!0,channels:!0},file:{contacts:!0,private:!0,groups:!0,channels:!0}},autoDownloadNew:{_:"autoDownloadSettings",file_size_max:3145728,pFlags:{video_preload_large:!0,audio_preload_next:!0},photo_size_max:1048576,video_size_max:15728640,video_upload_maxbitrate:100},autoPlay:{gifs:!0,videos:!0},stickers:{suggest:!0,loop:!0},emoji:{suggest:!0,big:!0},themes:[{name:"day",background:s.IS_MOBILE?{blur:!1,slug:"",color:"#dbddbb,#6ba587,#d5d88d,#88b884",highlightningColor:"hsla(86.4, 43.846153%, 45.117647%, .4)",intensity:0,id:"1"}:{blur:!1,slug:"pattern",color:"#dbddbb,#6ba587,#d5d88d,#88b884",highlightningColor:"hsla(86.4, 43.846153%, 45.117647%, .4)",intensity:50,id:"1"}},{name:"night",background:s.IS_MOBILE?{blur:!1,slug:"",color:"#0f0f0f",highlightningColor:"hsla(0, 0%, 3.82353%, 0.4)",intensity:0,id:"-1"}:{blur:!1,slug:"pattern",color:"#fec496,#dd6cb9,#962fbf,#4f5bd5",highlightningColor:"hsla(299.142857, 44.166666%, 37.470588%, .4)",intensity:-50,id:"-1"}}],theme:"system",notifications:{sound:!1},timeFormat:(new Date).toLocaleString().match(/\s(AM|PM)/)?"h12":"h23"},playbackParams:{volume:1,muted:!1,playbackRate:1,playbackRates:{voice:1,video:1,audio:1},loop:!1,round:!1},keepSigned:!0,chatContextMenuHintWasShown:!1,stateId:(0,i.d)(32),notifySettings:{}}},8189:(e,t,n)=>{n.d(t,{Z:()=>i});let s=!1;try{const e=document.createElement("canvas").getContext("webgl"),t=e.getExtension("WEBGL_debug_renderer_info"),n=t&&e.getParameter(t.UNMASKED_RENDERER_WEBGL)||"";(n.match(/Apple/)&&!n.match(/Apple GPU/)||-1===e.getSupportedExtensions().indexOf("WEBGL_compressed_texture_s3tc_srgb"))&&(s=!0)}catch(e){}const i=s},993:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},7328:(e,t,n)=>{let s;if(n.d(t,{Z:()=>i}),n(4762).IS_SAFARI)try{s=+navigator.userAgent.match(/Version\/(.+?) /)[1]>=14}catch(e){s=!1}else s=!0;const i=s},6663:(e,t,n)=>{n.d(t,{Z:()=>s});const s="filter"in(document.createElement("canvas").getContext("2d")||{})},9976:(e,t,n)=>{n.d(t,{Z:()=>s});const s=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i)},3731:(e,t,n)=>{var s;n.d(t,{Z:()=>i});const i=!!(null===(s=null===navigator||void 0===navigator?void 0:navigator.geolocation)||void 0===s?void 0:s.getCurrentPosition)&&!1},6818:(e,t,n)=>{n.d(t,{Z:()=>s});const s=n(4089).Z},1174:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(5269);const i=new Set(["image/jpeg","image/png","image/bmp"]);s.Z&&i.add("image/webp");const o=i},2341:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(1174),i=n(554);const o=[...s.Z].concat([...i.Z]),r=new Set(o)},9030:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/quicktime")||s.IS_SAFARI||s.IS_APPLE_MOBILE},5783:(e,t,n)=>{n.d(t,{Z:()=>i});const s=document.createElement("audio"),i=!(!s.canPlayType||!s.canPlayType("audio/ogg;").replace(/no/,""))},2365:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!n(4762).IS_FIREFOX&&!1},2820:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!("getDisplayMedia"in((null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||{}))},2045:(e,t,n)=>{n.d(t,{Z:()=>s});const s="undefined"!=typeof SharedWorker},5432:(e,t,n)=>{n.d(t,{Z:()=>s});const s="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch},4762:(e,t,n)=>{n.r(t),n.d(t,{IS_ANDROID:()=>r,IS_APPLE:()=>o,IS_APPLE_MOBILE:()=>c,IS_CHROMIUM:()=>a,IS_FIREFOX:()=>u,IS_MOBILE:()=>h,IS_MOBILE_SAFARI:()=>d,IS_SAFARI:()=>l,USER_AGENT:()=>i});var s=n(6761);const i=navigator?navigator.userAgent:null,o=-1!==navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i),r=-1!==navigator.userAgent.toLowerCase().indexOf("android"),a=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),c=(/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!s.Z.MSStream,l=!!("safari"in s.Z)||!(!i||!(/\b(iPad|iPhone|iPod)\b/.test(i)||i.match("Safari")&&!i.match("Chrome"))),u=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,d=l&&c,h=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)},2131:(e,t,n)=>{n.d(t,{Z:()=>s});const s=!!(null===navigator||void 0===navigator?void 0:navigator.vibrate)},554:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(9030);const i=new Set(["image/gif","video/mp4","video/webm"]);s.Z&&i.add("video/quicktime");const o=i},393:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!!document.createElement("video").canPlayType("video/webm")&&!s.IS_SAFARI&&!s.IS_APPLE_MOBILE},5269:(e,t,n)=>{n.d(t,{Z:()=>s});const s=document.createElement("canvas").toDataURL("image/webp").startsWith("data:image/webp")},4089:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(4762);const i=!("undefined"==typeof RTCPeerConnection||s.IS_FIREFOX)},2064:(e,t,n)=>{function s(e,t,n,s=1){e/=255,t/=255,n/=255;const i=Math.max(e,t,n),o=Math.min(e,t,n);let r,a;const c=(i+o)/2;if(i===o)r=a=0;else{const s=i-o;switch(a=c>.5?s/(2-i-o):s/(i+o),i){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:360*r,s:100*a,l:100*c,a:s}}function i(e,t,n,s){let i,o,r;if(e/=360,n/=100,0==(t/=100))i=o=r=n;else{const s=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=s(c,a,e+1/3),o=s(c,a,e),r=s(c,a,e-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*r),Math.round(255*s)]}function o(e){const t=[],n="#"===e[0]?1:0;if(e.length===5+n&&(e=(n?"#":"")+"0"+e.slice(n)),e.length===3+n)for(let s=n;s<e.length;++s)t.push(parseInt(e[s]+e[s],16));else if(e.length===4+n){for(let s=n;s<e.length-1;++s)t.push(parseInt(e[s]+e[s],16));t.push(parseInt(e[e.length-1],16))}else for(let s=n;s<e.length;s+=2)t.push(parseInt(e.slice(s,s+2),16));return t}function r(e){return o(e.slice(0,7))}function a(e){const t=o(e);return s(t[0],t[1],t[2],t[3])}function c(e){return"#"+e.map((e=>("0"+e.toString(16)).slice(-2))).join("")}function l(e){return function(e){return c(function(e){const t=e.slice(5,-1).split(", "),n=+t.pop(),s=t.map((e=>e.endsWith("%")?+e.slice(0,-1):+e));return i(s[0],s[1],s[2],n)}(e))}(e).slice(0,-2)}n.d(t,{K5:()=>l,Pi:()=>o,Y6:()=>i,cw:()=>a,dI:()=>s,oo:()=>r,t1:()=>c})},6009:(e,t,n)=>{function s(e,t){e=e.split(" ",1)[0],t=t.split(" ",1)[0];const n=e.split("."),s=t.split(".");for(let e=0;e<n.length;++e){const t=+n[e],i=+s[e];if(t>i)return 1;if(t<i)return-1}return 0}n.d(t,{Z:()=>s})},8799:(e,t,n)=>{function s(){var e;return!!(null===(e=document.activeElement)||void 0===e?void 0:e.blur)&&(document.activeElement.blur(),!0)}n.d(t,{Z:()=>s})},3910:(e,t,n)=>{function s(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,{Z:()=>s})},8497:(e,t,n)=>{function s(e,t){return e.closest("."+t)}n.d(t,{Z:()=>s})},5494:(e,t,n)=>{n.d(t,{Z:()=>i});var s=n(3035);function i(e){e.style.transform="translateY(-99999px)",e.focus(),(0,s.d1)().then((()=>{e.style.transform=""}))}},8090:(e,t,n)=>{n.d(t,{T:()=>a,Z:()=>c});var s=n(5432),i=n(4762),o=n(8497),r=n(5494);const a=i.IS_SAFARI&&i.IS_MOBILE&&s.Z;if(a){const e="clientY";let t=0;const n={capture:!0,passive:!1},s=n=>{const s=n.touches[0],i=(0,o.Z)(s.target,"scrollable-y");if(i){const o=s[e],r=t-o,a=i.scrollTop,c=i.scrollHeight,l=i.clientHeight,u=a?Math.round(a+i.clientHeight+r):a+r;(c===l||u>=c||u<=0)&&n.preventDefault()}else n.preventDefault()};let i=0;document.addEventListener("focusin",(o=>{!o.target.classList.contains("is-sticky-input-bugged")||o.timeStamp-i<50||((0,r.Z)(o.target),document.addEventListener("touchmove",s,n),document.addEventListener("touchstart",(n=>{if(n.touches.length>1)return;const s=n.touches[0];t=s[e]})))}),{passive:!0}),document.addEventListener("focusout",(e=>{document.removeEventListener("touchmove",s,n),i=e.timeStamp}),{passive:!0}),document.addEventListener("visibilitychange",(()=>{document.activeElement&&document.activeElement.classList.contains("is-sticky-input-bugged")&&document.activeElement.blur&&(0,r.Z)(document.activeElement)}),{passive:!0})}function c(e){a&&e.classList.add("is-sticky-input-bugged")}},4541:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(319),i=n(5418);const o=["b","б"],r={},a={text:"Roboto",icons:"tgico",monospace:"Roboto Mono"};function c(e={text:o,icons:void 0,monospace:o}){if(!("fonts"in document))return Promise.resolve();const t=[];for(const n in e){let s=e[n];"all"===s&&(s=o);const i=a[n],c="icons"===n?[500]:[400,500];for(const e of c){const n=(s||[void 0]).map((t=>{var n,s,o,a;const c=[e,"1rem",i].join(" ");return null!==(s=(o=null!==(n=r[c])&&void 0!==n?n:r[c]={})[a=t||""])&&void 0!==s?s:o[a]=document.fonts.load(c,t)}));t.push(...n)}}return Promise.race([Promise.all(t).catch(s.Z),(0,i.Z)(1e3)])}},2586:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(5432),i=n(3241);const o=s.Z?"touchstart":"mousemove";class r extends i.Z{constructor(){super(),this._isIdle=!0,this.focusPromise=Promise.resolve(),this.focusResolve=()=>{},window.addEventListener("blur",(()=>{this.isIdle=!0,window.addEventListener("focus",(()=>{this.isIdle=!1}),{once:!0})})),window.addEventListener(o,(()=>{this.isIdle=!1}),{once:!0,passive:!0}),this.addEventListener("change",(e=>{e?this.focusPromise=new Promise((e=>{this.focusResolve=e})):this.focusResolve()}))}getFocusPromise(){return this.focusPromise}get isIdle(){return this._isIdle}set isIdle(e){this._isIdle!==e&&(this._isIdle=e,this.dispatchEvent("change",e))}}const a=new r},3815:(e,t,n)=>{n.d(t,{Z:()=>o});var s=n(3241);class i extends s.Z{constructor(){super(...arguments),this.overlaysActive=0}get isOverlayActive(){return this.overlaysActive>0}set isOverlayActive(e){this.overlaysActive+=e?1:-1,this.dispatchEvent("change",this.isOverlayActive)}}const o=new i},3035:(e,t,n)=>{let s;function i(e){s?s.push(e):(s=[e],requestAnimationFrame((()=>{const e=s;s=void 0,e.forEach((e=>e()))})))}n.d(t,{AD:()=>l,T2:()=>i,TR:()=>c,d1:()=>u});let o,r,a=!1;function c(e){o?a?e():o.push(e):(o=[e],requestAnimationFrame((()=>{a=!0;for(let e=0;e<o.length;++e)o[e]();o=void 0,a=!1})))}function l(){return r||(r=new Promise((e=>i((()=>e())))),r.then((()=>{r=void 0})),r)}function u(){return new Promise((e=>{i((()=>{i(e)}))}))}},764:(e,t,n)=>{function s(e,t=e.split("?")){const n={};return t[1]?(t[1].split("&").forEach((e=>{n[e.split("=")[0]]=decodeURIComponent(e.split("=")[1])})),n):n}n.d(t,{Z:()=>s})},6714:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(5432),i=n(3512),o=n(2064);const r=new class{constructor(){i.Z.addEventListener("theme_change",(()=>{this.setTheme()}))}get themeColorElem(){return void 0!==this._themeColorElem?this._themeColorElem:this._themeColorElem=document.head.querySelector('[name="theme-color"]')||null}setThemeColor(e=this.themeColor){e||(e=this.isNight()?"#212121":"#ffffff");const t=this.themeColorElem;t&&t.setAttribute("content",e)}setThemeListener(){try{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{this.systemTheme=e.matches?"night":"day",i.Z.myId?i.Z.dispatchEvent("theme_change"):this.setTheme()};"addEventListener"in e?e.addEventListener("change",t):"addListener"in e&&e.addListener(t),t()}catch(e){}}applyHighlightningColor(){let e;const t=r.getTheme();t.background.highlightningColor?(e=t.background.highlightningColor,document.documentElement.style.setProperty("--message-highlightning-color",e)):document.documentElement.style.removeProperty("--message-highlightning-color"),!s.Z&&e&&(r.themeColor=(0,o.K5)(e))}setTheme(){const e=this.isNight(),t=document.head.querySelector('[name="color-scheme"]');t&&t.setAttribute("content",e?"dark":"light"),document.documentElement.classList.toggle("night",e),this.setThemeColor(),this.applyHighlightningColor()}isNight(){return"night"===this.getTheme().name}getTheme(e=("system"===i.Z.settings.theme?this.systemTheme:i.Z.settings.theme)){return i.Z.settings.themes.find((t=>t.name===e))}},a=r},6873:(e,t,n)=>{var s=n(4159),i=n(8799),o=n(3910),r=n(8090),a=n(4541),c=n(9976),l=n(4762),u=n(5418);!function(){const e={construct(e,t){let n=t[0]+"";return 0!==n.indexOf("blob:")&&(n+=location.search),new e(n)}};[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean).forEach((t=>{window[t.name]=new Proxy(t,e)}))}();var d=n(3512),h=n(5432),g=n(2325),m=(n(4110),n(690),n(3855)),f=n(2554),v=n(6714),p=n(3815),b=n(490),S=n(764),w=n(1267);document.addEventListener("DOMContentLoaded",(()=>{return e=void 0,t=void 0,P=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)}),void 0===Node.prototype.replaceChildren&&(Node.prototype.replaceChildren=function(...e){this.textContent="",e&&this.append(...e)}),d.Z.managers=(0,f.Z)(),document.getElementById("manifest").href=`site${l.IS_APPLE&&!l.IS_APPLE_MOBILE?"_apple":""}.webmanifest?v=jw3mK7G9Aq`,b.Z.start();const e=window.visualViewport||window;let t,y=!1;const P=()=>{const n=.01*(y&&!p.Z.isOverlayActive?e.height||e.innerHeight:window.innerHeight);t!==n&&(h.Z&&t<n&&n-t>1&&(0,i.Z)(),t=n,document.documentElement.style.setProperty("--vh",`${n}px`))};if(window.addEventListener("resize",P),P(),r.T){const t=()=>{y=1===n&&r.T&&!p.Z.isOverlayActive,P(),e!==window&&(y?(window.removeEventListener("resize",P),e.addEventListener("resize",P)):(e.removeEventListener("resize",P),window.addEventListener("resize",P)))};let n;window.onImTabChange=e=>{const s=void 0!==n;n=e,(s||1===n)&&t()},p.Z.addEventListener("change",(()=>{t()}))}l.IS_FIREFOX&&!c.Z&&document.addEventListener("dragstart",(e=>{const t=e.target;if("IMG"===t.tagName&&t.classList.contains("emoji"))return(0,o.Z)(e),!1})),c.Z&&document.documentElement.classList.add("native-emoji"),document.addEventListener("dragstart",(e=>{var t;if("IMG"===(null===(t=e.target)||void 0===t?void 0:t.tagName))return e.preventDefault(),!1})),document.addEventListener("contextmenu",(e=>{"IMG"!==e.target.tagName||window.appMediaViewer||(0,o.Z)(e)})),l.IS_FIREFOX&&document.documentElement.classList.add("is-firefox","no-backdrop"),l.IS_MOBILE&&document.documentElement.classList.add("is-mobile"),l.IS_APPLE?(l.IS_SAFARI&&document.documentElement.classList.add("is-safari"),l.IS_APPLE_MOBILE?document.documentElement.classList.add("is-ios"):document.documentElement.classList.add("is-mac")):l.IS_ANDROID&&document.documentElement.classList.add("is-android"),h.Z?document.documentElement.classList.add("is-touch"):document.documentElement.classList.add("no-touch");const k=performance.now(),E=g.ZP.getCacheLangPack(),[A,_]=yield Promise.all([m.Z.sendState().then((([e])=>e)),E]);function Z(e,t){e.style.opacity="0",t.then((()=>{window.requestAnimationFrame((()=>{e.style.opacity=""}))}))}g.ZP.setTimeFormat(A.state.settings.timeFormat),d.Z.managers.rootScope.getPremium().then((e=>{d.Z.premium=e})),v.Z.setThemeListener(),_.appVersion!==s.Z.langPackVersion&&g.ZP.getLangPack(_.lang_code),console.log("got state, time:",performance.now()-k);let I=A.state.authState;const C=location.hash,L=C.split("?"),T=(0,S.Z)(C,L);if(T.tgWebAuthToken&&"authStateSignedIn"!==I._){const e={token:T.tgWebAuthToken,dcId:+T.tgWebAuthDcId,userId:T.tgWebAuthUserId.toUserId(),isTest:void 0!==T.tgWebAuthTest&&!!+T.tgWebAuthTest,tgAddr:T.tgaddr};if(e.isTest!==w.Z.test){const e=new URLSearchParams(location.search);return+T.tgWebAuthTest?e.set("test","1"):e.delete("test"),void(location.search=e.toString())}d.Z.managers.appStateManager.pushToState("authState",I={_:"authStateSignImport",data:e})}if("authStateSignedIn"!==I._){console.log("Will mount auth page:",I._,Date.now()/1e3);const e=document.getElementById("auth-pages");let t,s;if(e){t=e.querySelector(".scrollable"),h.Z&&!l.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.resolve().then(n.bind(n,2831)),Promise.resolve().then(n.bind(n,6702))]).then((([e,t])=>{e.default.setAuthorized(!1),t.default.forceUnsubscribe()}))}catch(e){}switch(I._){case"authStateSignIn":s=(yield Promise.all([n.e(51),n.e(408),n.e(63)]).then(n.bind(n,810))).default.mount();break;case"authStateSignQr":s=(yield Promise.all([n.e(51),n.e(408),n.e(709)]).then(n.bind(n,9709))).default.mount();break;case"authStateAuthCode":s=(yield Promise.all([n.e(51),n.e(408),n.e(53)]).then(n.bind(n,6392))).default.mount(I.sentCode);break;case"authStatePassword":s=(yield Promise.all([n.e(51),n.e(408),n.e(442)]).then(n.bind(n,9437))).default.mount();break;case"authStateSignUp":s=(yield Promise.all([n.e(51),n.e(408),n.e(339)]).then(n.bind(n,8339))).default.mount(I.authCode);break;case"authStateSignImport":s=(yield Promise.all([n.e(51),n.e(408),n.e(231)]).then(n.bind(n,3231))).default.mount(I.data)}t&&(s&&(yield s),Z(t,"fonts"in document?Promise.race([(0,u.Z)(1e3),document.fonts.ready]):Promise.resolve()))}else console.log("Will mount IM page:",Date.now()/1e3),Z(document.getElementById("main-columns"),(0,a.Z)()),(yield Promise.all([n.e(51),n.e(408),n.e(436)]).then(n.bind(n,5436))).default.mount()},new((y=void 0)||(y=Promise))((function(n,s){function i(e){try{r(P.next(e))}catch(e){s(e)}}function o(e){try{r(P.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?n(e.value):(t=e.value,t instanceof y?t:new y((function(e){e(t)}))).then(i,o)}r((P=P.apply(e,t||[])).next())}));var e,t,y,P}))},1722:(e,t,n)=>{n.d(t,{Z:()=>s});const s=new class{reload(){try{location.reload()}catch(e){}}close(){try{window.close()}catch(e){}}focus(){window.focus()}}},2554:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(3855),i=n(410);const o={};function r(e,t){return new Proxy(e,{get:(e,n,r)=>{var a;return null!==(a=e[n])&&void 0!==a?a:e[n]=function(e,t){return new Proxy({},{get:(n,r,a)=>(...n)=>{var a;const c=s.Z.invoke("manager",{name:e,method:r,args:n},t);return i.ZP&&(null===(a=o[e])||void 0===a?void 0:a.has(r))&&console.warn("manager request",e,r,n),c}})}(n,t)}})}let a;function c(){return a||(a=r({},!1),a.acknowledged=r({},!0),a)}i.ZP&&(window.DEBUG_MANAGER_REQUESTS=o)},6666:(e,t,n)=>{n.d(t,{Z:()=>c});var s=n(1267),i=n(5471),o=n(5953),r=n(5003);class a{constructor(e){(0,o.Z)(this,e),s.Z.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=(0,r.kg)(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),a.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(e,t)=>{var n;const s=Array.from(e.indexNames);for(const t of s)e.deleteIndex(t);if(null===(n=t.indexes)||void 0===n?void 0:n.length)for(const n of t.indexes)e.indexNames.contains(n.indexName)||e.createIndex(n.indexName,n.keyPath,n.objectParameters)};try{var n=indexedDB.open(this.name,this.version);if(!n)return Promise.reject()}catch(e){return this.log.error("error opening db",e.message),this.storageIsAvailable=!1,Promise.reject(e)}let s=!1;return setTimeout((()=>{s||n.onerror((0,i.Z)("IDB_CREATE_TIMEOUT"))}),3e3),this.openDbPromise=new Promise(((e,i)=>{n.onsuccess=t=>{s=!0;const o=n.result;let r=!1;this.log("Opened"),o.onerror=e=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},o.onclose=e=>{this.log.error("closed:",e),!r&&this.openDatabase()},o.onabort=e=>{this.log.error("abort:",e);const t=e.target;this.openDatabase(r=!0),t.onerror&&t.onerror(e),o.close()},o.onversionchange=e=>{this.log.error("onversionchange, lol?")},e(this.db=o)},n.onerror=e=>{s=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",e),i(e)},n.onupgradeneeded=e=>{s=!0,this.log.warn("performing idb upgrade from",e.oldVersion,"to",e.newVersion);const n=e.target,i=n.result;this.stores.forEach((e=>{if(i.objectStoreNames.contains(e.name)){const s=n.transaction.objectStore(e.name);t(s,e)}else((e,n)=>{const s=e.createObjectStore(n.name);t(s,n)})(i,e)}))}}))}static create(e){var t;return null!==(t=this.INSTANCES.find((t=>t.name===e.name)))&&void 0!==t?t:new a(e)}static closeDatabases(e){this.INSTANCES.forEach((t=>{if(e&&e===t)return;const n=t.db;n&&(n.onclose=()=>{},n.close())}))}}a.INSTANCES=[];class c{constructor(e,t){this.storeName=t,this.log=(0,r.kg)(["IDB",e.name,t].join("-")),this.idb=a.create(e)}delete(e,t){return Array.isArray(e)||(e=[].concat(e)),this.getObjectStore("readwrite",(t=>e.map((e=>t.delete(e)))),"",t)}clear(e){return this.getObjectStore("readwrite",(e=>e.clear()),"",e)}save(e,t,n){return Array.isArray(e)||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",(n=>e.map(((e,s)=>n.put(t[s],e)))),"",n)}get(e,t){return Array.isArray(e)||(e=[].concat(e)),e.length?this.getObjectStore("readonly",(t=>e.map((e=>t.get(e)))),"",t):Promise.resolve([])}getObjectStore(e,t,n,s=this.storeName){let i;return n&&(i=performance.now(),this.log(n+": start")),this.idb.openDatabase().then((o=>new Promise(((r,a)=>{const c=o.transaction([s],e),l=()=>{clearTimeout(h),a(c.error)},u=()=>{clearTimeout(h),n&&this.log(n+": end",performance.now()-i);const e=f.map((e=>e.result));r(m?e:e[0])};c.onerror=l;const d="readwrite"===e;d&&(c.oncomplete=()=>u());const h=setTimeout((()=>{this.log.error("transaction not finished",c,n)}),1e4),g=t(c.objectStore(s)),m=Array.isArray(g),f=m?g:[].concat(g);if(d)return;const v=f.length;let p=v;const b=()=>{c.error||--p||u()};for(let e=0;e<v;++e){const t=f[e];t.onerror=l,t.onsuccess=b}}))))}getAll(e){return this.getObjectStore("readonly",(e=>e.getAll()),"",e)}}},2325:(e,t,n)=>{n.d(t,{$d:()=>S,A1:()=>w,Hz:()=>g,XZ:()=>b,ZP:()=>v,ag:()=>p,nK:()=>m,v_:()=>y});var s=n(410),i=n(7922),o=n(4159),r=n(3512),a=n(4762),c=n(6848),l=n(5953),u=n(9005),d=n(6637),h=n(3591);const g={messageActionChatCreate:"ActionCreateGroup",messageActionChatCreateYou:"ActionYouCreateGroup",messageActionChatEditTitle:"ActionChangedTitle",messageActionChatEditPhoto:"ActionChangedPhoto",messageActionChatEditVideo:"ActionChangedVideo",messageActionChatDeletePhoto:"ActionRemovedPhoto",messageActionChatReturn:"ActionAddUserSelf",messageActionChatReturnYou:"ActionAddUserSelfYou",messageActionChatJoined:"ActionAddUserSelfMega",messageActionChatJoinedYou:"ChannelMegaJoined",messageActionChatAddUser:"ActionAddUser",messageActionChatAddUsers:"ActionAddUser",messageActionChatLeave:"ActionLeftUser",messageActionChatLeaveYou:"YouLeft",messageActionChatDeleteUser:"ActionKickUser",messageActionChatJoinedByLink:"ActionInviteUser",messageActionPinMessage:"Chat.Service.Group.UpdatedPinnedMessage",messageActionContactSignUp:"Chat.Service.PeerJoinedTelegram",messageActionChannelCreate:"ActionCreateChannel",messageActionChannelEditTitle:"Chat.Service.Channel.UpdatedTitle",messageActionChannelEditPhoto:"Chat.Service.Channel.UpdatedPhoto",messageActionChannelEditVideo:"Chat.Service.Channel.UpdatedVideo",messageActionChannelDeletePhoto:"Chat.Service.Channel.RemovedPhoto",messageActionHistoryClear:"HistoryCleared",messageActionDiscussionStarted:"DiscussionStarted",messageActionChannelMigrateFrom:"ActionMigrateFromGroup","messageActionPhoneCall.video_in_ok":"ChatList.Service.VideoCall.incoming","messageActionPhoneCall.video_out_ok":"ChatList.Service.VideoCall.outgoing","messageActionPhoneCall.video_missed":"ChatList.Service.VideoCall.Missed","messageActionPhoneCall.video_cancelled":"ChatList.Service.VideoCall.Cancelled","messageActionPhoneCall.in_ok":"ChatList.Service.Call.incoming","messageActionPhoneCall.out_ok":"ChatList.Service.Call.outgoing","messageActionPhoneCall.missed":"ChatList.Service.Call.Missed","messageActionPhoneCall.cancelled":"ChatList.Service.Call.Cancelled","messageActionGroupCall.started":"Chat.Service.VoiceChatStarted.Channel","messageActionGroupCall.started_by":"Chat.Service.VoiceChatStarted","messageActionGroupCall.started_byYou":"Chat.Service.VoiceChatStartedYou","messageActionGroupCall.ended":"Chat.Service.VoiceChatFinished.Channel","messageActionGroupCall.ended_by":"Chat.Service.VoiceChatFinished","messageActionGroupCall.ended_byYou":"Chat.Service.VoiceChatFinishedYou",messageActionBotAllowed:"Chat.Service.BotPermissionAllowed"},m=a.IS_MOBILE?"Message.Unsupported.Mobile":"Message.Unsupported.Desktop";var f;!function(e){let t,a;function g(t){e.lastRequestedLangCode=t,e.lastRequestedNormalizedLangCode=t.split("-")[0]}function m(){if("h12"===e.timeFormat)try{const t=A({hour:"numeric",minute:"numeric",hour12:!0}),n=new Date;n.setHours(0);const s=t.format(n);e.amPmCache.am=s.split(" ")[1],n.setHours(12);const i=t.format(n);e.amPmCache.pm=i.split(" ")[1]}catch(t){console.error("cannot get am/pm",t),e.amPmCache={am:"AM",pm:"PM"}}}function f(){const e=o.Z.langPackCode;return g(e),Promise.all([n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),n.e(8).then(n.bind(n,9179))]).then((([t,n,s])=>{const i=[];return p(t.default,i),p(n.default,i),b({_:"langPackDifference",from_version:0,lang_code:e,strings:i,version:0,local:!0,countries:s.default})}))}function v(t,s){e.requestedServerLanguage=!0;const i=r.Z.managers;return Promise.all([i.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:t,lang_pack:"web"}),!1,n.e(104).then(n.bind(n,9104)),n.e(301).then(n.bind(n,9301)),i.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:t,hash:0}),e.polyfillPromise])}function p(e,t=[]){for(const n in e){const s=e[n];"string"==typeof s?t.push({_:"langPackString",key:n,value:s}):t.push(Object.assign({_:"langPackStringPluralized",key:n},s))}return t}function b(e){return e.appVersion=o.Z.langPackVersion,i.Z.set({langPack:e}).then((()=>(S(e),e)))}function S(n){const s=e.lastRequestedLangCode;if(n.lang_code===s){try{t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode)}catch(n){console.error("pluralRules error",n),t=new Intl.PluralRules(e.lastRequestedNormalizedLangCode.split("-",1)[0])}try{t=new Intl.PluralRules(n.lang_code)}catch(e){console.error("pluralRules error",e),t=new Intl.PluralRules(n.lang_code.split("-",1)[0])}e.strings.clear();for(const t of n.strings)e.strings.set(t.key,t);n.countries&&(e.countriesList.length=0,e.countriesList.push(...n.countries.countries),n.countries.countries.forEach((t=>{if(t.name){const n=t.default_name;e.strings.set(n,{_:"langPackString",key:n,value:t.name})}}))),e.lastAppliedLangCode!==s&&(r.Z.dispatchEvent("language_change",s),e.lastAppliedLangCode=s,E.clear(),m()),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n&&n.update()}))}}function w(e,t,n={i:0}){const s=[];let i=0;return e.replace(/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%./g,((e,o,r,a,c,l,u)=>{if(s.push(u.slice(i,l)),o){let e;switch(o){case"**":e=document.createElement("b");break;case"__":e=document.createElement("i")}e.append(...w(r,t,n)),s.push(e)}else if(a)s.push(document.createElement("br"));else if(c){const e=c.lastIndexOf("]"),i=c.slice(1,e),o=c.slice(e+2,c.length-1);let r;if(o&&(0,d.Z)(o)){r=document.createElement("a");const e=(0,h.Z)(o);r.href=e.url,e.onclick&&r.setAttribute("onclick",e.onclick),r.target="_blank"}else r=t[n.i++],r instanceof DocumentFragment&&(r=r.firstChild),r.textContent="";r.append(...w(i,t,n)),s.push(r)}else t&&function(e,t,n){const s=t[n.i++];Array.isArray(s)?e.push(...s):e.push(s)}(s,t,n);return i=l+e.length,""})),i!==e.length&&s.push(e.slice(i)),s}function y(n,s=!1,i){const o=e.strings.get(n);let r;if(o)if("langPackStringPluralized"===o._&&(null==i?void 0:i.length)){let e=i[0];"string"==typeof e&&(e=+e.replace(/\D/g,"")),r=o[t.select(e)+"_value"]||o.other_value}else r="langPackString"===o._?o.value:n;else r=n;const a=w(r,i);return s?a.map((e=>e instanceof Node?e.textContent:e)).join(""):a}e.strings=new Map,e.countriesList=[],e.requestedServerLanguage=!1,e.getCacheLangPack=function(){return a||(a=Promise.all([i.Z.get("langPack"),e.polyfillPromise]).then((([t])=>t?(s.ZP,e.lastRequestedLangCode||g(t.lang_code),S(t),t):f())).finally((()=>{a=void 0})))},e.setTimeFormat=function(t,n=!!e.timeFormat&&e.timeFormat!==t){e.timeFormat=t,m(),n&&(E.clear(),Array.from(document.querySelectorAll(".i18n")).forEach((t=>{const n=e.weakMap.get(t);n instanceof _&&n.update()})))},e.loadLocalLangPack=f,e.loadLangPack=v,e.getStrings=function(e,t){return r.Z.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:o.Z.langPack,lang_code:e,keys:t})},e.formatLocalStrings=p,e.getLangPack=function(e,t){return g(e),v(e).then((([e,t,n,s,i,o])=>{let r=[];return[n,s].forEach((e=>{p(e.default,r)})),r=r.concat(...[e.strings,t.strings].filter(Boolean)),e.strings=r,e.countries=i,b(e)}))},e.saveLangPack=b,e.polyfillPromise="undefined"!=typeof Intl&&void 0!==Intl.PluralRules?Promise.resolve():n.e(642).then(n.bind(n,4642)).then((e=>{window.Intl=Object.assign("undefined"!=typeof Intl?Intl:{},e.default)})),e.applyLangPack=S,e.superFormatter=w,e.format=y,e.weakMap=new WeakMap;class P{constructor(t){this.element=(null==t?void 0:t.element)||document.createElement("span"),this.element.classList.add("i18n"),this.property=null==t?void 0:t.property,t&&(t.key||t.date)&&this.update(t),e.weakMap.set(this.element,this)}}class k extends P{constructor(e={}){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"innerHTML"}))}update(e){if((0,l.Z)(this,e),"innerHTML"===this.property)this.element.textContent="",this.element.append(...y(this.key,!1,this.args));else{const e=this.element[this.property],t=y(this.key,!0,this.args);void 0===e?this.element.dataset[this.property]=t:this.element[this.property]=t}}compareAndUpdate(e){if(this.key!==e.key||!(0,c.Z)(this.args,e.args))return this.update(e)}}e.IntlElement=k;const E=new Map;function A(t={}){const n=JSON.stringify(t);let s=E.get(n);return s||(s=new Intl.DateTimeFormat(e.lastRequestedNormalizedLangCode+"-u-hc-"+e.timeFormat,t),E.set(n,s)),s}e.amPmCache={am:"AM",pm:"PM"};class _ extends P{constructor(e){var t;super(Object.assign(Object.assign({},e),{property:null!==(t=e.property)&&void 0!==t?t:"textContent"}))}update(t){let n;if((0,l.Z)(this,t),this.options.hour&&this.options.minute&&2===Object.keys(this.options).length){const t=this.date.getHours();n=("0"+("h12"===e.timeFormat?t%12||12:t)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),"h12"===e.timeFormat&&(n+=" "+(t<12?e.amPmCache.am:e.amPmCache.pm))}else{const e=A(this.options);n=(0,u.Z)(e.format(this.date))}this.element[this.property]=n}}e.IntlDateElement=_,e.i18n=function(e,t){return new k({key:e,args:t}).element},e.i18n_=function(e){return new k(e).element},e._i18n=function(e,t,n,s){return new k({element:e,key:t,args:n,property:s}).element}}(f||(f={}));const v=f,p=f.i18n,b=f.i18n_,S=f._i18n;function w(e,t){const n=e.slice(0,1);for(let s=1;s<e.length;++s){const i=e.length-1===s;n.push("function"==typeof t?t(i):t),n.push(e[s])}return n}function y(e,t=!0,n){const s=w(e,(e=>{const s=e&&t?"AutoDownloadSettings.LastDelimeter":"AutoDownloadSettings.Delimeter";return n?f.format(s,!0):p(s)}));return n?s.join(""):s}s.GO.I18n=f},1507:(e,t,n)=>{n.d(t,{DZ:()=>g,IA:()=>o,Iw:()=>l,J$:()=>d,NM:()=>s,Pt:()=>u,Zi:()=>h,gZ:()=>c,hj:()=>i,rU:()=>a,yF:()=>r});const s=0,i=1271266957,o=777,r=777e3,a=2147483647,c="",l=20971520,u="",d=0,h=1,g=new Set([d,h]);Math.max(...Array.from(g))},3855:(e,t,n)=>{n.d(t,{Z:()=>se});var s=n(3512),i=n(7730),o=n(410),r=n(7487),a=n(6702),c=n(1722),l=n(2831),u=n(5418),d=n(993),h=n(7328),g=n(6663),m=n(9976),f=n(3731),v=n(6818),p=n(1174),b=n(2341),S=n(9030),w=n(2365),y=n(2820),P=n(5432),k=n(2131),E=n(554),A=n(393),_=n(5269),Z=n(4089),I=n(4762),C=n(5783),L=n(2045),T=n(8189);const O=Object.assign({CAN_USE_TRANSFERABLES:h.Z,IS_APPLE_MX:T.Z,IS_CALL_SUPPORTED:d.Z,IS_CANVAS_FILTER_SUPPORTED:g.Z,IS_EMOJI_SUPPORTED:m.Z,IS_GEOLOCATION_SUPPORTED:f.Z,IS_GROUP_CALL_SUPPORTED:v.Z,IS_MOV_SUPPORTED:S.Z,IS_PARALLAX_SUPPORTED:w.Z,IS_SCREEN_SHARING_SUPPORTED:y.Z,IS_TOUCH_SUPPORTED:P.Z,IS_VIBRATE_SUPPORTED:k.Z,IS_OPUS_SUPPORTED:C.Z,IS_SHARED_WORKER_SUPPORTED:L.Z,IS_WEBM_SUPPORTED:A.Z,IS_WEBP_SUPPORTED:_.Z,IS_WEBRTC_SUPPORTED:Z.Z,IMAGE_MIME_TYPES_SUPPORTED:p.Z,MEDIA_MIME_TYPES_SUPPORTED:b.Z,VIDEO_MIME_TYPES_SUPPORTED:E.Z},I);var M=n(4159),W=n(236),D=n(6009),R=n(8479),x=n(946),N=n(7922),U=n(5466),F=n(5003);const j=W.h.version,B=W.h.build,V=Object.keys(W.h),G=["contactsListCachedTime","stateCreatedTime","maxSeenMsgId","filtersArr"];function z(){return e=this,t=void 0,i=function*(){const e=(0,F.kg)("STATE-LOADER"),t=performance.now(),n=(0,U.$)(e),i=V.map((e=>n(N.Z.get(e),"state "+e))).concat(n(r.Z.get("user_auth"),"auth"),n(r.Z.get("state_id"),"auth"),n(r.Z.get("k_build"),"auth")).concat(n(N.Z.get("user_auth"),"old auth")),a=yield Promise.all(i);e.warn("promises",performance.now()-t);const c=[],l=(e,t)=>{u[e]=t,c.push(e)};let u={};for(let e=0,t=V.length;e<t;++e){const t=V[e],n=a[e];void 0!==n?u[t]=n:l(t,(0,R.Z)(W.h[t]))}a.splice(0,V.length);let d=a.shift();const h=a.shift(),g=a.shift(),m=a.shift();if(!d&&m){d=m;const e=["dc","server_time_offset","xt_instance"];for(let t=1;t<=5;++t)e.push(`dc${t}_server_salt`),e.push(`dc${t}_auth_key`);const t=yield Promise.all(e.map((e=>N.Z.get(e))));e.push("user_auth"),t.push("number"==typeof d||"string"==typeof d?{dcID:t[0]||M.Z.baseDcId,date:Date.now()/1e3|0,id:d.toPeerId(!1)}:d);const n={};e.forEach(((e,s)=>{n[e]=t[s]})),yield r.Z.set(n)}d&&(u.authState={_:"authStateSignedIn"},s.Z.dispatchEvent("user_auth","number"==typeof d||"string"==typeof d?{dcID:0,date:Date.now()/1e3|0,id:d.toPeerId(!1)}:d));const f=new Set;if(u.stateId!==h){if(void 0!==h){const e=new Map([["authState",void 0],["stateId",void 0]]);e.forEach(((t,n)=>{e.set(n,(0,R.Z)(u[n]))})),u=(0,R.Z)(W.h),e.forEach(((e,t)=>{u[t]=e}));const t={chats:1,dialogs:1,users:1};for(const e in t)f.add(e);v=u,c.length=0,u=v,c.push(...Object.keys(u))}yield r.Z.set({state_id:u.stateId})}var v;const p=Date.now();if(u.stateCreatedTime+864e5<p&&(o.ZP&&e("will refresh state",u.stateCreatedTime,p),G.forEach((e=>{l(e,(0,R.Z)(W.h[e]))}))),!u.settings.hasOwnProperty("theme")&&u.settings.hasOwnProperty("nightTheme")&&(u.settings.theme=u.settings.nightTheme?"night":"day",l("settings",u.settings)),!u.settings.hasOwnProperty("themes")&&u.settings.background){u.settings.themes=(0,R.Z)(W.h.settings.themes);const e=u.settings.themes.find((e=>e.name===u.settings.theme));e&&(e.background=u.settings.background,l("settings",u.settings))}const b=u.settings.autoDownload;if(void 0!==(null==b?void 0:b.private)){const e=["contacts","private","groups","channels"];["photo","video","file"].forEach((t=>{const n=b[t]={};e.forEach((e=>{n[e]=b[e]}))})),e.forEach((e=>{delete b[e]})),l("settings",u.settings)}let S,w;if((0,x.Z)(W.h,u,(e=>{l(e,u[e])})),u.version!==j||u.build!==B){if(u.build<217&&(u.allDialogsLoaded=(0,R.Z)(W.h.allDialogsLoaded),u.pinnedOrders=(0,R.Z)(W.h.pinnedOrders),u.filtersArr=(0,R.Z)(W.h.filtersArr),f.add("dialogs")),-1===(0,D.Z)(u.version,"1.3.0")){let e=!1;u.settings.themes.forEach(((t,n,s)=>{if("day"===t.name&&"ByxGo2lrMFAIAAAAmkJxZabh8eM"===t.background.slug&&"image"===t.background.type||"night"===t.name&&"#0f0f0f"===t.background.color&&"color"===t.background.type){const i=W.h.settings.themes.find((e=>e.name===t.name));i&&(s[n]=(0,R.Z)(i),e=!0)}})),e&&l("settings",u.settings)}0!==(0,D.Z)(u.version,j)&&(S=j,w=u.version),l("version",j),l("build",B)}return g!==B&&(!g||g<B)&&r.Z.set({k_build:B}),s.Z.settings=u.settings,o.ZP&&e("state res",u,(0,R.Z)(u)),e.warn("total",performance.now()-t),{state:u,resetStorages:f,newVersion:S,oldVersion:w,pushedKeys:c}},new((n=void 0)||(n=Promise))((function(s,o){function r(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((i=i.apply(e,t||[])).next())}));var e,t,n,i}let q;var $=n(9043),H=n(3206),Y=n(8630),J=n(8453),X=n(2586),K=n(3655),Q=n(3725),ee=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};class te extends H.Z{constructor(){super(),this.onMirrorTask=e=>{var t,n;const{name:s,key:i,value:o}=e;if(!e.hasOwnProperty("key"))return void(this.mirrors[s]=o);const r=null!==(t=(n=this.mirrors)[s])&&void 0!==t?t:n[s]={};void 0===o?delete r[i]:r[i]=o},this.mirrors={},this.tabState={chatPeerIds:[],idleStartTime:0},this.log("constructor"),this.registerWorker(),this.registerServiceWorker(),this.registerCryptoWorker(),this.addMultipleEventsListeners({convertWebp:({fileName:e,bytes:t})=>i.Z.convert(e,t),convertOpus:({fileName:e,bytes:t})=>$.Z.pushDecodeTask(t,!1).then((e=>e.bytes)),event:({name:e,args:t})=>{s.Z.dispatchEventSingle(e,...t)},localStorageProxy:e=>{const t=e;return r.Z[t.type](...t.args)},mirror:this.onMirrorTask}),s.Z.addEventListener("language_change",(e=>{s.Z.managers.networkerFactory.setLanguage(e)})),window.addEventListener("online",(()=>{s.Z.managers.networkerFactory.forceReconnectTimeout()})),s.Z.addEventListener("logging_out",(()=>{Promise.all([(0,J.Z)(!1,!0),r.Z.clear(),Promise.race([l.default.setAuthorized(!1),(0,u.Z)(3e3)]),a.default.forceUnsubscribe(),Promise.all(["cachedFiles","cachedStreamChunks"].map((e=>caches.delete(e))))]).finally((()=>{c.Z.reload()}))})),X.Z.addEventListener("change",(e=>{this.updateTabStateIdle(e)})),this.updateTabStateIdle(X.Z.isIdle),this.log("Passing environment:",O),this.invoke("environment",O)}pingServiceWorkerWithIframe(){if(this.pingServiceWorkerPromise)return this.pingServiceWorkerPromise;const e=this.pingServiceWorkerPromise=(0,Q.Z)(),t=document.createElement("iframe");t.hidden=!0;const n=()=>{setTimeout((()=>{this.pingServiceWorkerPromise=void 0}),1e4),clearTimeout(s),t.remove(),t.removeEventListener("load",n),t.removeEventListener("error",n),e.resolve()};t.addEventListener("load",n),t.addEventListener("error",n),t.src="ping/"+(4294967295*Math.random()|0),document.body.append(t);const s=window.setTimeout(n,1e3);return e}attachServiceWorker(e){this.lastServiceWorker&&this.serviceMessagePort.detachPort(this.lastServiceWorker),this.serviceMessagePort.attachSendPort(this.lastServiceWorker=e),this.serviceMessagePort.invokeVoid("hello",void 0)}_registerServiceWorker(){navigator.serviceWorker.register(new URL(n.p+n.u(670),n.b),{scope:"./"}).then((e=>{if(this.log("SW registered",e),e.active&&!navigator.serviceWorker.controller)return e.unregister().then((()=>{window.location.reload()}));(e.installing||e.waiting||e.active).addEventListener("statechange",(e=>{this.log("SW statechange",e)}));const t=navigator.serviceWorker.controller||e.installing||e.waiting||e.active;this.attachServiceWorker(t)}),(e=>{this.log.error("SW registration failed!",e),this.invokeVoid("serviceWorkerOnline",!1)}))}registerServiceWorker(){if(!("serviceWorker"in navigator))return;this.serviceMessagePort=new K.Z;const e=navigator.serviceWorker;this._registerServiceWorker(),e.addEventListener("controllerchange",(()=>{this.log.warn("controllerchange");const t=e.controller;this.attachServiceWorker(t),t.addEventListener("error",(e=>{this.log.error("controller error:",e)}))})),this.serviceMessagePort.attachListenPort(e),this.serviceMessagePort.addMultipleEventsListeners({port:(e,t,n)=>{this.invokeVoid("serviceWorkerPort",void 0,void 0,[n.ports[0]])},hello:(e,t)=>{this.serviceMessagePort.resendLockTask(t)}}),e.addEventListener("messageerror",(e=>{this.log.error("SW messageerror:",e)}))}registerCryptoWorker(){return ee(this,void 0,void 0,(function*(){const e={construct:(e,t)=>({url:t[0]+location.search})},t=[Worker,"undefined"!=typeof SharedWorker&&SharedWorker].filter(Boolean);t.forEach((t=>window[t.name]=new Proxy(t,e)));const s=new Worker(new URL(n.p+n.u(589),n.b),{type:void 0});t.forEach((e=>window[e.name]=e));const i=s.url,o=e=>new a(e,{type:"module"}),r=e=>this.attachWorkerToPort(e,Y.Z,"crypto"),a=L.Z?SharedWorker:Worker;Y.Z.addEventListener("port",((e,t,n)=>{this.invokeVoid("cryptoPort",void 0,void 0,[n.ports[0]])})),r(o(i));const c=yield(l=i,fetch(l).then((e=>e.text())).then((e=>{const t=location.pathname.split("/");return t[t.length-1]="",e=`\n var originalImportScripts = importScripts; \n importScripts = (url) => {\n console.log('importScripts', url);\n var newUrl = '${location.origin+t.join("/")}' + url.split('/').pop();\n return originalImportScripts(newUrl);\n };\n ${e}`,new Blob([e],{type:"application/javascript"})})));var l;(yield this.invoke("createProxyWorkerURLs",{originalUrl:i,blob:c})).slice(1).map(o).forEach(r)}))}registerWorker(){let e;e=L.Z?new SharedWorker(new URL(n.p+n.u(678),n.b),{type:void 0}):new Worker(new URL(n.p+n.u(678),n.b),{type:void 0}),this.onWorkerFirstMessage(e)}attachWorkerToPort(e,t,n){const s=e.port||e;t.attachPort(s),e.addEventListener("error",(e=>{this.log.error(n,"worker error",e)}))}onWorkerFirstMessage(e){this.log("set webWorker"),this.attachWorkerToPort(e,this,"mtproto")}loadState(){return Promise.all([(null!=q?q:q=z()).then((e=>(this.newVersion=e.newVersion,this.oldVersion=e.oldVersion,this.mirrors.state=e.state,e)))])}sendState(){return this.loadState().then((e=>{const[t]=e;return this.invoke("state",Object.assign(Object.assign({},t),{userId:s.Z.myId.toUserId()})),e}))}invokeCrypto(e,...t){return Y.Z.invokeCrypto(e,...t)}toggleStorages(e,t){return ee(this,void 0,void 0,(function*(){yield(0,J.Z)(e,t),this.invoke("toggleStorages",{enabled:e,clearWrite:t}),this.serviceMessagePort.invokeVoid("toggleStorages",{enabled:e,clearWrite:t})}))}getMirror(e){return ee(this,void 0,void 0,(function*(){return this.mirrors[e]}))}getState(){return this.getMirror("state")}updateTabState(e,t){this.tabState[e]=t,this.invokeVoid("tabState",this.tabState)}updateTabStateIdle(e){this.updateTabState("idleStartTime",e?Date.now():0)}}const ne=new te;o.GO.apiManagerProxy=ne;const se=ne},490:(e,t,n)=>{n.d(t,{Z:()=>v});var s=n(4159),i=n(410),o=n(2219),r=n(2045),a=n(3241),c=n(2586),l=n(5003),u=n(3512),d=n(7487),h=n(3855);const g=r.Z;class m extends a.Z{constructor(){super(!1),this.log=(0,l.kg)("INSTANCE"),this.clearInstance=()=>{this.masterInstance&&!this.deactivated&&(this.log.warn("clear master instance"),d.Z.delete("xt_instance"))},this.checkInstance=(e=c.Z.isIdle)=>{return t=this,n=void 0,o=function*(){if(this.deactivated)return;const t=Date.now(),n={id:this.instanceId,idle:e,time:t},[i,o=s.Z.build]=yield Promise.all([d.Z.get("xt_instance",!1),d.Z.get("k_build",!1)]);if(o>s.Z.build)return this.masterInstance=!1,u.Z.managers.networkerFactory.stopAll(),this.deactivateInstance("version"),void h.Z.toggleStorages(!1,!1);g?d.Z.set({xt_instance:n}):!e||!i||i.id===this.instanceId||i.time<t-2e4?(d.Z.set({xt_instance:n}),this.masterInstance||(this.masterInstance=!0,u.Z.managers.networkerFactory.startAll(),this.log.warn("now master instance",n)),this.clearDeactivateTimeout()):this.masterInstance&&(this.masterInstance=!1,u.Z.managers.networkerFactory.stopAll(),this.log.warn("now idle instance",n),this.deactivateTimeout||(this.deactivateTimeout=window.setTimeout((()=>this.deactivateInstance("tabs")),3e4)))},new((i=void 0)||(i=Promise))((function(e,s){function r(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o.throw(e))}catch(e){s(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}c((o=o.apply(t,n||[])).next())}));var t,n,i,o},this.log=(0,l.kg)("INSTANCE"),this.instanceId=o.Z}get deactivatedReason(){return this.deactivated}start(){if(this.reset(),!this.started){this.started=!0,c.Z.addEventListener("change",this.checkInstance),setInterval(this.checkInstance,5e3),this.checkInstance();try{document.documentElement.addEventListener("beforeunload",this.clearInstance)}catch(e){}}}reset(){this.masterInstance=!1,this.clearDeactivateTimeout(),this.deactivated=void 0}activateInstance(){this.deactivated&&(this.reset(),this.checkInstance(!1),this.dispatchEvent("activated"))}deactivateInstance(e){this.masterInstance||this.deactivated||(this.log.warn("deactivate",e),this.clearDeactivateTimeout(),this.deactivated=e,this.dispatchEvent("deactivated",e))}clearDeactivateTimeout(){this.deactivateTimeout&&(clearTimeout(this.deactivateTimeout),this.deactivateTimeout=0)}}const f=new m;i.GO&&(i.GO.singleInstance=f);const v=f},2831:(e,t,n)=>{n.r(t),n.d(t,{TelegramMeWebManager:()=>c,default:()=>u});var s=n(4159),i=n(410),o=n(1267),r=n(7298),a=n(7487);class c{constructor(){this.disabled=o.Z.test||-1===s.Z.domains.indexOf(location.hostname)}setAuthorized(e){if(!this.disabled)return a.Z.get("tgme_sync").then((t=>{const n=(0,r.Z)(!0);if(e&&(null==t?void 0:t.canRedirect)===e&&t.ts+86400>n)return;a.Z.set({tgme_sync:{canRedirect:e,ts:n}});const i=`_websync_?authed=${e?"1":"0"}&version=${encodeURIComponent(s.Z.version+" "+s.Z.suffix)}`,o=["//telegram.me/"+i,"//t.me/"+i].map((e=>function(e){const t=document.createElement("script"),n=new Promise((e=>{t.onload=t.onerror=()=>{e(t)}}));return t.src=e,document.body.appendChild(t),n}(e).then((e=>{e.remove()}))));return Promise.all(o)}))}}const l=new c;i.GO&&(i.GO.telegramMeWebManager=l);const u=l},6702:(e,t,n)=>{n.r(t),n.d(t,{WebPushApiManager:()=>h,default:()=>m});var s=n(410),i=n(5003),o=n(3855),r=n(2325),a=n(4762),c=n(1722),l=n(8479),u=n(490),d=n(3241);class h extends d.Z{constructor(){super(!1),this.isAvailable=!0,this.isPushEnabled=!1,this.localNotificationsAvailable=!0,this.started=!1,this.settings={},this.isFirefox=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,this.userVisibleOnly=!this.isFirefox,this.log=(0,i.kg)("PM"),this.subscribe=()=>{this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.subscribe({userVisibleOnly:this.userVisibleOnly}).then((e=>{this.isPushEnabled=!0,this.pushSubscriptionNotify("subscribe",e)})).catch((e=>{"denied"===Notification.permission?this.log("Permission for Notifications was denied"):(this.log("Unable to subscribe to push.",e),this.userVisibleOnly||(this.userVisibleOnly=!0,setTimeout(this.subscribe,0)))}))}))},this.isAliveNotify=()=>{if(!this.isAvailable||u.Z.deactivatedReason)return;this.settings.baseUrl=(location.href||"").replace(/#.*$/,"");const e={},t={push_action_mute1d:a.IS_MOBILE?"PushNotification.Action.Mute1d.Mobile":"PushNotification.Action.Mute1d",push_action_settings:a.IS_MOBILE?"PushNotification.Action.Settings.Mobile":"PushNotification.Action.Settings",push_message_nopreview:"PushNotification.Message.NoPreview"};for(const n in t)e[n]=r.ZP.format(t[n],!0);o.Z.serviceMessagePort.invokeVoid("pushPing",{localNotifications:this.localNotificationsAvailable,lang:e,settings:this.settings}),this.isAliveTO=setTimeout(this.isAliveNotify,1e4)},"PushManager"in window&&"Notification"in window&&"serviceWorker"in navigator||(this.log.warn("Push messaging is not supported."),this.isAvailable=!1,this.localNotificationsAvailable=!1),this.isAvailable&&"denied"===Notification.permission&&this.log.warn("The user has blocked notifications.")}start(){this.started||(this.started=!0,this.getSubscription(),this.setUpServiceWorkerChannel())}setLocalNotificationsDisabled(){this.localNotificationsAvailable=!1}getSubscription(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!!e,this.pushSubscriptionNotify("init",e)})).catch((e=>{this.log.error("Error during getSubscription()",e)}))}))}unsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.isPushEnabled=!1,e&&(this.pushSubscriptionNotify("unsubscribe",e),setTimeout((()=>{e.unsubscribe().then((e=>{this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))}),3e3))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}forceUnsubscribe(){this.isAvailable&&navigator.serviceWorker.ready.then((e=>{e.pushManager.getSubscription().then((e=>{this.log.warn("force unsubscribe",e),e&&e.unsubscribe().then((e=>{this.log.warn("force unsubscribe successful",e),this.isPushEnabled=!1})).catch((e=>{this.log.error("Unsubscription error: ",e)}))})).catch((e=>{this.log.error("Error thrown while unsubscribing from push messaging.",e)}))}))}setSettings(e){this.settings=(0,l.Z)(e),clearTimeout(this.isAliveTO),this.isAliveNotify()}hidePushNotifications(){this.isAvailable&&o.Z.serviceMessagePort.invokeVoid("notificationsClear",void 0)}setUpServiceWorkerChannel(){this.isAvailable&&(o.Z.serviceMessagePort.addEventListener("pushClick",(e=>{u.Z.deactivatedReason?c.Z.reload():this.dispatchEvent("push_notification_click",e)})),navigator.serviceWorker.ready.then(this.isAliveNotify))}pushSubscriptionNotify(e,t){if(t){const n=t.toJSON();if(!(n&&n.endpoint&&n.keys&&n.keys.p256dh&&n.keys.auth))return this.log.warn("Invalid push subscription",n),this.unsubscribe(),this.isAvailable=!1,void this.pushSubscriptionNotify(e);this.log.warn("Push",e,n),this.dispatchEvent("push_"+e,{tokenType:10,tokenValue:JSON.stringify(n)})}else this.log.warn("Push",e,!1),this.dispatchEvent("push_"+e,!1)}}const g=new h;s.GO&&(s.GO.webPushApiManager=g);const m=g},9043:(e,t,n)=>{n.d(t,{Z:()=>u});var s=n(410),i=n(5783),o=n(4762),r=n(5003),a=n(3855),c=function(e,t,n,s){return new(n||(n=Promise))((function(i,o){function r(e){try{c(s.next(e))}catch(e){o(e)}}function a(e){try{c(s.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((s=s.apply(e,t||[])).next())}))};const l=new class{constructor(){this.sampleRate=48e3,this.tasks=[],this.keepAlive=!1,this.log=(0,r.kg)("OPUS",r.v9.Error)}isPlaySupported(){return i.Z}loadWavWorker(){this.wavWorker||(this.wavWorker=new Worker("waveWorker.min.js"),this.wavWorker.addEventListener("message",(e=>{const t=e.data;if(this.log("[WAV] got message:",t),t&&t.page){const e=t.page;this.onTaskEnd(this.tasks.shift(),e)}})))}loadWorker(){this.worker||(this.worker=new Worker("decoderWorker.min.js"),this.worker.addEventListener("message",(e=>{const t=e.data;this.log("[DECODER] got message",t),"done"===t.type?(this.wavWorker.postMessage({command:"done"}),t.waveform&&(this.tasks[0].waveform=t.waveform)):this.wavWorker.postMessage({command:"encode",buffers:e.data},o.IS_SAFARI?void 0:t.map((e=>e.buffer)))})))}setKeepAlive(e){this.keepAlive=e,this.keepAlive?(this.loadWorker(),this.loadWavWorker()):this.tasks.length||this.terminateWorkers()}onTaskEnd(e,t){t?(clearTimeout(e.timeout),e.callback.resolve({bytes:t,waveform:e.waveform})):e.callback.reject("timeout"),this.tasks.length&&this.executeNewTask(this.tasks[0]),this.terminateWorkers()}terminateWorkers(e=!1){(!this.keepAlive&&!this.tasks.length||e)&&(this.worker&&(this.worker.terminate(),this.worker=null),this.wavWorker&&(this.wavWorker.terminate(),this.wavWorker=null))}executeNewTask(e){this.worker.postMessage({command:"init",decoderSampleRate:this.sampleRate,outputBufferSampleRate:this.sampleRate}),this.wavWorker.postMessage({command:"init",wavBitDepth:16,wavSampleRate:this.sampleRate}),this.log("[DECODER] send decode"),this.worker.postMessage({command:"decode",pages:e.pages,waveform:e.withWaveform},o.IS_SAFARI?void 0:[e.pages.buffer]),e.timeout=window.setTimeout((()=>{this.log.error("decode timeout"),this.terminateWorkers(!0),this.tasks.length&&(this.loadWorker(),this.loadWavWorker()),this.onTaskEnd(this.tasks.shift())}),1e4)}pushDecodeTask(e,t){return new Promise(((n,s)=>{const i={pages:e,withWaveform:t,callback:{resolve:n,reject:s},timeout:0};this.loadWorker(),this.loadWavWorker(),1===this.tasks.push(i)&&this.executeNewTask(i)}))}decode(e,t=!1){return c(this,void 0,void 0,(function*(){return this.pushDecodeTask(e,t).then((e=>c(this,void 0,void 0,(function*(){const t=new Blob([e.bytes],{type:"audio/wav"});return{url:yield a.Z.invoke("createObjectURL",t),waveform:e.waveform}}))))}))}};s.GO.opusDecodeController=l;const u=l},2423:(e,t,n)=>{n.d(t,{$2:()=>l,E:()=>u,Hk:()=>h,QB:()=>d,SC:()=>g,bu:()=>c,it:()=>a,kO:()=>f,tY:()=>m});var s=n(1229);const i="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",o="["+i+"0-9]",r="((?:https?|ftp)://|mailto:)?",a=r+"(?:"+o+"{1,64}(?::"+o+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+o+"["+i+"·0-9-]{0,64}(?:\\."+o+"["+i+"·0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+i+"]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>\"'])?)?",c=(new RegExp("^"+r.slice(0,-1),"i"),/^((?:[^\/]+?):\/\/|mailto:)/),l=new RegExp("(^| )(@)([a-zA-Z\\d_]{5,32})|("+a+")|(\\n)|("+s.Z+")|(^|[\\s\\(\\]])(#[0-9_a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc]{2,64})|(^|\\s)\\/([a-zA-Z\\d_]{1,32})(?:@([a-zA-Z\\d_]{5,32}))?(\\b|$)","i"),u=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,d=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,h={Telegram:"tg://search_hashtag?hashtag={1}",Twitter:"https://twitter.com/hashtag/{1}",Instagram:"https://instagram.com/explore/tags/{1}/","Google Plus":"https://plus.google.com/explore/{1}"},g={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"},m=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]);for(const e in g)m.add(g[e]);const f=/^\+\d+$/},3512:(e,t,n)=>{n.d(t,{Z:()=>u});var s=n(1507),i=n(3241),o=n(410),r=n(3206),a=n(1352);class c extends i.Z{constructor(){super(),this.myId=s.NM,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",(({id:e})=>{this.myId=e.toPeerId()})),this.addEventListener("premium_toggle",(e=>{this.premium=e})),this.addEventListener("connection_status_change",(e=>{this.connectionStatus[e.name]=e})),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),r.Z.getInstance().invokeVoid("event",{name:e,args:t})},a.kC||this.addEventListener("settings_updated",(({settings:e})=>{this.settings=e}))}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const l=new c;o.GO.rootScope=l;const u=l},7730:(e,t,n)=>{n.d(t,{Z:()=>r});var s=n(410),i=n(3725);const o=new class{constructor(){this.convertPromises={}}init(){this.worker=new Worker(new URL(n.p+n.u(61),n.b)),this.worker.addEventListener("message",(e=>{const t=e.data.payload,n=this.convertPromises[t.fileName];n&&(t.bytes?n.resolve(t.bytes):n.reject(),delete this.convertPromises[t.fileName])}))}postMessage(e){this.init&&(this.init(),this.init=null),this.worker.postMessage(e)}convert(e,t){if(this.convertPromises.hasOwnProperty(e))return this.convertPromises[e];const n=(0,i.Z)();return this.postMessage({type:"convertWebp",payload:{fileName:e,bytes:t}}),this.convertPromises[e]=n}};s.GO.webpWorkerController=o;const r=o}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return l[e].call(n.exports,n,n.exports,d),n.exports}d.m=l,e=[],d.O=(t,n,s,i)=>{if(!n){var o=1/0;for(l=0;l<e.length;l++){for(var[n,s,i]=e[l],r=!0,a=0;a<n.length;a++)(!1&i||o>=i)&&Object.keys(d.O).every((e=>d.O[e](n[a])))?n.splice(a--,1):(r=!1,i<o&&(o=i));if(r){e.splice(l--,1);var c=s();void 0!==c&&(t=c)}}return t}i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,s,i]},d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(e,s){if(1&s&&(e=this(e)),8&s)return e;if("object"==typeof e&&e){if(4&s&&e.__esModule)return e;if(16&s&&"function"==typeof e.then)return e}var i=Object.create(null);d.r(i);var o={};t=t||[null,n({}),n([]),n(n)];for(var r=2&s&&e;"object"==typeof r&&!~t.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,d.d(i,o),i},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce(((t,n)=>(d.f[n](e,t),t)),[])),d.u=e=>(({589:"crypto.worker",630:"npm.qr-code-styling",670:"sw",678:"mtproto.worker"}[e]||e)+"."+{8:"0544e00385e42a07883b",51:"015549e15aab2a59d3a0",53:"3829958682207da0768c",61:"21ea8f96aad63bd2211c",63:"f3beda66b31880abf426",77:"808c5b447b007ee7aa9d",104:"d9383d4cf03fc631a3a9",231:"071dbf1017e65586295d",301:"a3f22008d452affb1ae4",339:"764b22e455094abfa43f",392:"eb2cde6a1063177ee3ad",408:"03880fedecb1e421da3b",436:"a3c8c35b715fcb7c4d9f",442:"aee5aa5c25ff95c14b4d",508:"648a1c3659fa38d09b83",589:"a0cf65ddba162cb08d08",630:"5c8af6e9c411419a66e1",641:"1fc33fe3e0c4c0c41a9e",642:"d6b90b5bc53545046507",670:"c12b91543b047629a922",678:"b6bdf87282369207cefc",709:"03eeac190dc611bf8d97",774:"be0952a2ec87ed053042",776:"8ab4eee78bc43703a976",781:"5b082181115fbfebcf63",783:"a5ff7c878494d8a1624d",810:"3f514515bc74111bee6d",813:"e7782ee52edafa426cd5"}[e]+".chunk.js"),d.miniCssF=e=>{},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},i="tweb:",d.l=(e,t,n,o)=>{if(s[e])s[e].push(t);else{var r,a;if(void 0!==n)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var u=c[l];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+n){r=u;break}}r||(a=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,d.nc&&r.setAttribute("nonce",d.nc),r.setAttribute("data-webpack",i+n),r.src=e),s[e]=[t];var h=(t,n)=>{r.onerror=r.onload=null,clearTimeout(g);var i=s[e];if(delete s[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((e=>e(n))),t)return t(n)},g=setTimeout(h.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),a&&document.head.appendChild(r)}},d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;d.g.importScripts&&(e=d.g.location+"");var t=d.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),d.p=e})(),o=d.u,r=d.e,a=new Map,c=new Map,d.u=function(e){return o(e)+(a.has(e)?"?"+a.get(e):"")},d.e=function(e){return r(e).catch((function(t){var n=c.has(e)?c.get(e):999999;if(n<1){var s=o(e);throw t.message="Loading chunk "+e+" failed after 999999 retries.\n("+s+")",t.request=s,t}return new Promise((function(t){setTimeout((function(){var s=Date.now();a.set(e,s),c.set(e,n-1),t(d.e(e))}),3e3)}))}))},(()=>{d.b=document.baseURI||self.location.href;var e={179:0};d.f.j=(t,n)=>{var s=d.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var i=new Promise(((n,i)=>s=e[t]=[n,i]));n.push(s[2]=i);var o=d.p+d.u(t),r=new Error;d.l(o,(n=>{if(d.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",r.name="ChunkLoadError",r.type=i,r.request=o,s[1](r)}}),"chunk-"+t,t)}},d.O.j=t=>0===e[t];var t=(t,n)=>{var s,i,[o,r,a]=n,c=0;if(o.some((t=>0!==e[t]))){for(s in r)d.o(r,s)&&(d.m[s]=r[s]);if(a)var l=a(d)}for(t&&t(n);c<o.length;c++)i=o[c],d.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return d.O(l)},n=this.webpackChunktweb=this.webpackChunktweb||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var h=d.O(void 0,[437,570],(()=>d(6873)));h=d.O(h)})();
//# sourceMappingURL=main.1fe88778f443685606bb.bundle.js.map