TelegramPWA/dist/8123.8fd17c8cfc4f43f47212.js
Alexander Zinchuk 6fd1d0c598 [Build]
2025-09-19 14:39:00 +02:00

2 lines
613 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. 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,s={98123:(e,t,s)=>{var n={};s.r(n),s.d(n,{Type:()=>Nd,clear:()=>Hd,fetch:()=>Gd,isCacheApiSupported:()=>Vd,remove:()=>qd,save:()=>Fd});var a={};s.r(a),s.d(a,{abortChatRequests:()=>ul,abortRequestGroup:()=>fl,acceptBotUrlAuth:()=>tm,acceptCall:()=>Dm,acceptLinkUrlAuth:()=>nm,acceptPhoneCall:()=>g_,activateStealthMode:()=>B_,addChatMembers:()=>Uu,allowBotSendMessages:()=>im,answerCallbackButton:()=>Nh,appendTodoList:()=>If,applyBoost:()=>W_,applyGiftCode:()=>Q_,blockUser:()=>Wp,broadcastLocalDbUpdateFull:()=>on,buildApiAccountDays:()=>Cl,buildApiAccountDaysTTL:()=>Ml,changeSessionSettings:()=>Sl,changeSessionTtl:()=>Il,changeStarsSubscription:()=>uy,checkBotDownloadFileParams:()=>cm,checkChatInvite:()=>Du,checkChatUsername:()=>yp,checkChatlistInvite:()=>$u,checkGiftCode:()=>J_,checkPassword:()=>Dh,checkSearchPostsFlood:()=>zf,checkUsername:()=>Vp,clearPassword:()=>Uh,clearRecentReactions:()=>Wm,clearRecentStickers:()=>Qg,clickSponsoredMessage:()=>ug,closePoll:()=>Qf,confirmCall:()=>Um,confirmPhoneCall:()=>f_,convertStarGift:()=>iy,createChalistInvite:()=>Zu,createChannel:()=>Xl,createGroupCall:()=>Im,createGroupChat:()=>nu,createPhoneCallState:()=>c_,createTopic:()=>Lu,deactivateAllUsernames:()=>wp,decodePhoneCallData:()=>u_,deleteChannel:()=>su,deleteChat:()=>eu,deleteChatFolder:()=>fu,deleteChatMember:()=>Eu,deleteChatUser:()=>Yl,deleteChatlistInvite:()=>Yu,deleteContact:()=>xg,deleteExportedChatInvite:()=>Cp,deleteHistory:()=>kf,deleteMessages:()=>Af,deleteParticipantHistory:()=>Rf,deleteProfilePhotos:()=>Hp,deleteRevokedExportedChatInvites:()=>Mp,deleteSavedHistory:()=>Df,deleteScheduledMessages:()=>Tf,deleteStory:()=>I_,deleteTopic:()=>Wu,destroy:()=>sl,destroyPhoneCallState:()=>d_,discardCall:()=>Am,discardGroupCall:()=>hm,disconnect:()=>nl,downloadMedia:()=>cl,editChatFolder:()=>uu,editChatPhoto:()=>au,editChatlistInvite:()=>ef,editExportedChatInvite:()=>vp,editGroupCallParticipant:()=>mm,editGroupCallTitle:()=>_m,editMessage:()=>wf,editStoryPrivacy:()=>T_,editTodo:()=>Sf,editTopic:()=>Ku,encodePhoneCallData:()=>l_,exportChatInvite:()=>Pp,exportGroupCallInvite:()=>ym,exportMessageLink:()=>Pg,faveSticker:()=>$g,fetchAccountTTL:()=>Al,fetchAlbumStories:()=>V_,fetchAlbums:()=>x_,fetchAllStories:()=>h_,fetchAnimatedEmojiEffects:()=>ep,fetchAnimatedEmojis:()=>Yg,fetchAppConfig:()=>_h,fetchAuthorizations:()=>Kp,fetchAvailableEffects:()=>Nm,fetchAvailableReactions:()=>Vm,fetchBlockedUsers:()=>jp,fetchBoostList:()=>K_,fetchBoostStatus:()=>z_,fetchBotApp:()=>Kh,fetchBotCanSendMessage:()=>am,fetchBotsRecommendations:()=>fm,fetchChannelMonetizationStatistics:()=>Qm,fetchChannelRecommendations:()=>af,fetchChannelStatistics:()=>Jm,fetchChat:()=>zl,fetchChatFolders:()=>cu,fetchChatInviteImporters:()=>Ap,fetchChatlistInvites:()=>tf,fetchChats:()=>ql,fetchCollectibleEmojiStatuses:()=>op,fetchCollectionInfo:()=>Y_,fetchCommonChats:()=>Ag,fetchConfig:()=>yh,fetchContactList:()=>Dg,fetchContactSignUpSetting:()=>eh,fetchContentSettings:()=>hh,fetchCountryList:()=>Sh,fetchCurrentUser:()=>gl,fetchCustomEmoji:()=>Zg,fetchCustomEmojiSets:()=>Lg,fetchDefaultStatusEmojis:()=>ip,fetchDefaultTagReactions:()=>zm,fetchDefaultTopicIcons:()=>ap,fetchDiscussionMessage:()=>Lf,fetchEmojiKeywords:()=>hp,fetchExportedChatInvites:()=>Ip,fetchExtendedMedia:()=>Zf,fetchFactChecks:()=>Ff,fetchFavoriteStickers:()=>Wg,fetchFeaturedEmojiStickers:()=>Kg,fetchFeaturedStickers:()=>zg,fetchFullChat:()=>Ol,fetchFullUser:()=>Mg,fetchGenericEmojiEffects:()=>tp,fetchGiveawayInfo:()=>$_,fetchGlobalPrivacySettings:()=>Ih,fetchGroupCallParticipants:()=>bm,fetchGroupStatistics:()=>Xm,fetchGroupsForDiscussion:()=>Ru,fetchInlineBot:()=>qh,fetchInlineBotResults:()=>Hh,fetchLangDifference:()=>ih,fetchLangPack:()=>ah,fetchLangStrings:()=>ch,fetchLanguage:()=>rh,fetchLanguages:()=>oh,fetchLeaveChatlistSuggestions:()=>Qu,fetchMember:()=>Au,fetchMembers:()=>Mu,fetchMessage:()=>gf,fetchMessagePublicForwards:()=>Ym,fetchMessageReactions:()=>qm,fetchMessageReactionsList:()=>Hm,fetchMessageStatistics:()=>Zm,fetchMessageViews:()=>Gf,fetchMessages:()=>ff,fetchMessagesById:()=>pf,fetchMonetizationRevenueWithdrawalUrl:()=>n_,fetchMyBoosts:()=>j_,fetchNearestCountry:()=>Tg,fetchNotificationExceptions:()=>Yp,fetchNotifyDefaultSettings:()=>th,fetchOutboxReadDate:()=>Sg,fetchPaidMessagesRevenue:()=>Ng,fetchPaidMessagesStarsAmount:()=>Rg,fetchPaidReactionPrivacy:()=>qf,fetchPeerColors:()=>bh,fetchPeerProfileStories:()=>__,fetchPeerSettings:()=>jl,fetchPeerStories:()=>m_,fetchPeerStoriesByIds:()=>b_,fetchPinnedDialogs:()=>du,fetchPinnedMessages:()=>ig,fetchPopularAppBots:()=>um,fetchPremiumGifts:()=>sp,fetchPremiumPromo:()=>L_,fetchPreparedInlineMessage:()=>Cg,fetchPreviewMedias:()=>rm,fetchPrivacySettings:()=>lh,fetchProfilePhotos:()=>Gg,fetchQuickReplies:()=>Ig,fetchRecentEmojiStatuses:()=>mp,fetchRecentReactions:()=>jm,fetchRecentStickers:()=>jg,fetchRecommendedChatFolders:()=>lu,fetchResaleGifts:()=>sy,fetchSavedChats:()=>Hl,fetchSavedGifs:()=>cp,fetchSavedReactionTags:()=>Km,fetchSavedStarGifts:()=>ny,fetchScheduledHistory:()=>ng,fetchSeenBy:()=>og,fetchSendAs:()=>rg,fetchSponsoredMessages:()=>dg,fetchSponsoredPeer:()=>rf,fetchStarGiftCollections:()=>Iy,fetchStarGiftUpgradePreview:()=>hy,fetchStarGiftWithdrawalUrl:()=>Sy,fetchStarGifts:()=>ty,fetchStarsGiveawayOptions:()=>ey,fetchStarsStatus:()=>ry,fetchStarsSubscriptions:()=>ly,fetchStarsTopupOptions:()=>gy,fetchStarsTransactionById:()=>dy,fetchStarsTransactions:()=>cy,fetchStatisticsAsyncGraph:()=>e_,fetchStickerSets:()=>Og,fetchStickers:()=>Xg,fetchStickersForEmoji:()=>pp,fetchStoriesArchive:()=>y_,fetchStoriesMaxIds:()=>D_,fetchStoriesViews:()=>M_,fetchStoryLink:()=>A_,fetchStoryPublicForwards:()=>s_,fetchStoryStatistics:()=>t_,fetchStoryViewList:()=>C_,fetchTemporaryPaymentPassword:()=>O_,fetchTimezones:()=>wh,fetchTonGifts:()=>np,fetchTopBotApps:()=>Fh,fetchTopInlineBots:()=>Gh,fetchTopReactions:()=>Om,fetchTopUsers:()=>kg,fetchTopicById:()=>ju,fetchTopics:()=>Ou,fetchUniqueStarGift:()=>py,fetchUniqueStarGiftValueInfo:()=>wy,fetchUnreadMentions:()=>hg,fetchUnreadReactions:()=>mg,fetchUsers:()=>Ug,fetchWallpapers:()=>Lp,fetchWebAuthorizations:()=>Qp,fetchWebPagePreview:()=>Kf,findFirstMessageIdAfterDate:()=>sg,forwardApiMessages:()=>eg,forwardMessages:()=>tg,forwardMessagesLocal:()=>Yf,fulfillStarsSubscription:()=>fy,getChatByPhoneNumber:()=>mu,getChatByUsername:()=>_u,getDhConfig:()=>Mm,getGroupCall:()=>pm,getPassword:()=>kh,getPasswordInfo:()=>Ah,getPaymentForm:()=>q_,getPremiumGiftCodeOptions:()=>X_,getReceipt:()=>H_,getStarsGiftOptions:()=>oy,getTemporaryPaymentPassword:()=>Th,hideAllChatJoinRequests:()=>Tp,hideChatJoinRequest:()=>Rp,hidePeerSettingsBar:()=>kp,importChatInvite:()=>Nu,importContact:()=>Eg,installStickerSet:()=>lp,invokeWebViewCustomMethod:()=>om,joinChannel:()=>Zl,joinChatlistInvite:()=>Ju,joinGroupCall:()=>Sm,joinGroupCallPresentation:()=>vm,launchPrepaidGiveaway:()=>Z_,leaveChannel:()=>tu,leaveChatlist:()=>Xu,leaveGroupCall:()=>wm,leaveGroupCallPresentation:()=>Cm,loadAttachBot:()=>Zh,loadAttachBots:()=>Xh,loadPollOptionResults:()=>Xf,markMessageListRead:()=>Vf,markMessagesRead:()=>Nf,markStoryRead:()=>S_,migrateChat:()=>ku,oldFetchLangPack:()=>dh,pinMessage:()=>Cf,prolongWebView:()=>Jh,provideAuthCode:()=>Rd,provideAuthPassword:()=>Td,provideAuthPhoneNumber:()=>Ad,provideAuthRegistration:()=>kd,provideRecoveryEmailCode:()=>xh,readAllMentions:()=>gg,readAllReactions:()=>pg,receivedCall:()=>km,registerDevice:()=>uh,removeRecentSticker:()=>Jg,reorderUsernames:()=>Ch,repairFileReference:()=>pl,reportChannelSpam:()=>Bf,reportMessages:()=>Ef,reportMessagesDelivery:()=>Hf,reportPeer:()=>bl,reportProfilePhoto:()=>wl,reportSpam:()=>Fg,reportSponsoredMessage:()=>fg,reportStory:()=>R_,requestAppWebView:()=>$h,requestBotUrlAuth:()=>em,requestCall:()=>Rm,requestChannelDifference:()=>yl,requestChatUpdate:()=>Kl,requestLinkUrlAuth:()=>sm,requestMainWebView:()=>Wh,requestPhoneCall:()=>p_,requestSimpleWebView:()=>zh,requestWebView:()=>jh,rescheduleMessage:()=>vf,resolveBusinessChatLink:()=>vl,restartAuth:()=>Dd,restartAuthWithQr:()=>Ud,saveCloseFriends:()=>Hg,saveDefaultSendAs:()=>cg,saveDraft:()=>$l,saveGif:()=>dp,saveStarGift:()=>ay,searchChats:()=>Wl,searchGifs:()=>gp,searchMessagesGlobal:()=>jf,searchMessagesInChat:()=>Of,searchPublicPosts:()=>Wf,searchStickers:()=>rp,sendApiMessage:()=>_f,sendEmojiInteraction:()=>xm,sendInlineBotResult:()=>Lh,sendMessage:()=>yf,sendMessageAction:()=>xf,sendMessageLocal:()=>mf,sendPaidReaction:()=>Fm,sendPaymentForm:()=>G_,sendPollVote:()=>$f,sendQuickReply:()=>vg,sendReaction:()=>Gm,sendScheduledMessages:()=>ag,sendSignalingData:()=>Em,sendStarPaymentForm:()=>F_,sendStoryReaction:()=>E_,sendWatchingEmojiInteraction:()=>Bm,sendWebViewData:()=>Qh,setAccountTTL:()=>Rl,setAllowHttpTransport:()=>ml,setBotInfo:()=>lm,setCallRating:()=>Tm,setChatEnabledReactions:()=>Gu,setChatUsername:()=>bp,setDefaultReaction:()=>Lm,setDiscussionGroup:()=>Tu,setForceHttpTransport:()=>hl,setPrivacySettings:()=>gh,setShouldDebugExportedSenders:()=>_l,setViewForumAsMessages:()=>nf,sortChatFolders:()=>gu,startBot:()=>Oh,terminateAllAuthorizations:()=>Jp,terminateAllWebAuthorizations:()=>Zp,terminateAuthorization:()=>$p,terminateWebAuthorization:()=>Xp,toggleAttachBot:()=>Yh,toggleAutoTranslation:()=>cf,toggleChatArchived:()=>ru,toggleChatPinned:()=>iu,toggleDialogFilterTags:()=>pu,toggleDialogUnread:()=>hu,toggleForum:()=>Hu,toggleGroupCallStartSubscription:()=>Pm,toggleIsProtected:()=>Fu,toggleJoinRequest:()=>xu,toggleJoinToSend:()=>Bu,toggleNoPaidMessagesException:()=>Vg,toggleParticipantsHidden:()=>qu,togglePeerTranslations:()=>sf,togglePinnedTopic:()=>zu,togglePreHistoryHidden:()=>bu,toggleSavedDialogPinned:()=>ou,toggleSavedGiftPinned:()=>yy,toggleSignatures:()=>Cu,toggleSponsoredMessages:()=>Pl,toggleStoriesHidden:()=>k_,toggleStoryInProfile:()=>v_,toggleStoryPinnedToTop:()=>P_,toggleSuggestedPostApproval:()=>Uf,toggleTodoCompleted:()=>Jf,toggleUserEmojiStatusPermission:()=>dm,toggleUsername:()=>Ph,transcribeAudio:()=>_g,transferStarGift:()=>_y,translateText:()=>yg,unblockUser:()=>zp,uninstallStickerSet:()=>up,unpinAllMessages:()=>Mf,unregisterDevice:()=>fh,updateChatAbout:()=>Pu,updateChatAdmin:()=>Iu,updateChatDefaultBannedRights:()=>wu,updateChatMemberBannedRights:()=>Su,updateChatNotifySettings:()=>Jl,updateChatTitle:()=>vu,updateContact:()=>Bg,updateContactSignUpNotification:()=>sh,updateContentSettings:()=>mh,updateEmojiStatus:()=>qg,updateGlobalPrivacySettings:()=>vh,updateIsOnline:()=>ph,updateNotificationSettings:()=>nh,updatePaidMessagesPrice:()=>of,updatePassword:()=>Eh,updatePrivateLink:()=>Sp,updateProfile:()=>xp,updateProfilePhoto:()=>Gp,updateRecoveryEmail:()=>Bh,updateSavedReactionTag:()=>$m,updateStarGiftPrice:()=>by,updateTopicMutedState:()=>Ql,updateUsername:()=>Np,upgradeStarGift:()=>my,uploadContactProfilePhoto:()=>qp,uploadProfilePhoto:()=>Fp,uploadWallpaper:()=>Op,validateRequestedInfo:()=>N_,viewSponsoredMessage:()=>lg,viewStory:()=>w_});const i="account",o=!1,r=!1,c="tt-media",d="tt-media-avatars",l=524288,u=16,f=16,g=("undefined"!=typeof window&&window.innerHeight,200),p="TON",h=100,m=100,_=20,y=3e5,b="XTR",w=2**31-1,S=w,I=0,v=Math.round(450),P=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory","deleteParticipantHistory"]),C=20,M=20,A="status-default-icon",R=(new Set(["svg","svgz"]),"video/webm"),T="image/gif",k="application/x-tgsticker",D=R,U=new Set(["image/png","image/jpeg",T]),E=new Set(["video/mp4","video/quicktime"]),B=new Set(["audio/mp3","audio/ogg","audio/wav","audio/mpeg","audio/flac","audio/aac","audio/m4a","audio/mp4","audio/x-m4a"]),x=(new Set([...U,...E]),"MESSAGE_ID_REQUIRED"),V=new Set(["USERNAME_PURCHASE_AVAILABLE","USERNAME_INVALID"]),N=(new Set(["t.me","web.t.me","a.t.me","k.t.me","z.t.me"]),"weba"),G="weba",F=(new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),"777000"),q=10**12,H="gif",L=0,O=1,j="-1000000000777",W=1,z=(new Set(["USER_CANCELED"]),["log","error","warn","info","debug"]);function K(e,t){let s,n,a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(){n=!0;for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];a=r,s||(i&&(n=!1,e(...a)),s=self.setInterval(()=>{if(!n)return self.clearInterval(s),void(s=void 0);n=!1,e(...a)},t))}}function $(e){return function(e,t){let s,n=!1;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];s=i,n||(n=!0,e(()=>{n=!1,t(...s)}))}}(X,e)}z.reduce((e,t)=>(e[t]=console[t],e),{});const J=e=>new Promise(t=>{setTimeout(()=>t(),e)});let Q;function X(e){Q?Q.push(e):(Q=[e],Promise.resolve().then(()=>{const e=Q;Q=void 0,e.forEach(e=>e())}))}var Z=s(92096),Y=s.n(Z),ee=s(7692);const te=1===new Uint8Array(new Uint32Array([16909060]))[0],se=te?function(e){return e.buffer}:function(e){const t=new Uint8Array(4*e.length);let s=0;for(let n=0;n<e.length;n++){const a=e[n];t[s++]=a>>>24,t[s++]=a>>16&255,t[s++]=a>>8&255,t[s++]=255&a}return t.buffer},ne=te?function(e){return new Uint32Array(e)}:function(e){const t=new Uint8Array(e),s=new Uint32Array(t.length/4);for(let e=0;e<t.length;e+=4)s[e/4]=t[e]<<24^t[e+1]<<16^t[e+2]<<8^t[e+3];return s};function ae(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}var ie=s(48287).hp;class oe{constructor(e){this._counter=ie.from(e)}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class re{constructor(e,t){t instanceof oe||(t=new oe(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new ee.Ay(function(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(let t=e.length%4;t<=4;t++)e+="\0x00";const t=new Uint32Array(e.length/4);for(let s=0;s<e.length;s+=4)t[s/4]=ae(e,s);return t}if(e instanceof Uint8Array){const t=new Uint32Array(e.length/4);for(let s=0;s<e.length;s+=4)t[s/4]=e[s]<<24^e[s+1]<<16^e[s+2]<<8^e[s+3];return t}throw new Error("Unable to create 32-bit words")}(e))}update(e){return this.encrypt(e)}encrypt(e){const t=ie.from(e);for(let e=0;e<t.length;e++)16===this._remainingCounterIndex&&(this._remainingCounter=ie.from(se(this._aes.encrypt(ne(this._counter._counter)))),this._remainingCounterIndex=0,this._counter.increment()),this._remainingCounter&&(t[e]^=this._remainingCounter[this._remainingCounterIndex++]);return t}}class ce{data=new Uint8Array(0);constructor(e){this.algorithm=e}update(e){this.data=new Uint8Array(e)}async digest(){return"sha1"===this.algorithm?ie.from(await self.crypto.subtle.digest("SHA-1",this.data)):ie.from(await self.crypto.subtle.digest("SHA-256",this.data))}}function de(e){return new ce(e)}var le=s(48287).hp;function ue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=le.from(e);const a=n.length;t&&(n=n.reverse());let i=Y()(n.toString("hex"),16);return s&&Math.floor(i.toString(2).length/8)>=a&&(i=i.subtract(Y()(2).pow(Y()(8*a)))),i}function fe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const s=Y()(e),n=[];for(let e=0;e<t;e++)n[e]=s.shiftRight(8*e).and(255).toJSNumber();return le.from(n)}function ge(e,t){let s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=e.bitLength().toJSNumber();if(t<Math.ceil(a/8))throw new Error("OverflowError: int too big to convert");if(!n&&e.lesser(Y()(0)))throw new Error("Cannot convert to unsigned");let i=!1;e.lesser(Y()(0))&&(i=!0,e=e.abs());const o=e.toString(16).padStart(2*t,"0");let r=le.from(o,"hex");if(n&&i){r[r.length-1]=256-r[r.length-1];for(let e=0;e<r.length-1;e++)r[e]=255-r[e]}return s&&(r=r.reverse()),r}function pe(e,t){return e.remainder(t).add(t).remainder(t)}function he(e){return le.from(function(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t}(e))}function me(e){const t=le.alloc(4*e.length);for(let s=0;s<e.length;s++)t.writeUInt32BE(e[s],4*s);return t}function _e(e){const t=de("sha1");return t.update(e),t.digest()}function ye(e){const t=de("sha256");return t.update(e),t.digest()}function be(e,t,s){e=e.remainder(s);let n=Y().one,a=e;for(;t.greater(Y().zero);){const e=t.remainder(Y()(2));t=t.divide(Y()(2)),e.eq(Y().one)&&(n=n.multiply(a),n=n.remainder(s)),a=a.multiply(a),a=a.remainder(s)}return n}function we(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=e.toString(2).length,n=Math.floor((s+8-1)/8);return ge(Y()(e),n,!1,t)}function Se(e){return new Promise(t=>{setTimeout(t,e)})}function Ie(e,t){const s=[];for(let n=0;n<e.length;n++)s.push(e[n]^t[n]);return le.from(s)}const ve=(()=>{let e;const t=[];for(let s=0;s<256;s++){e=s;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t})();function Pe(e){le.isBuffer(e)||(e=le.from(e));let t=-1;for(let s=0;s<e.length;s++){const n=e[s];t=ve[255&(t^n)]^t>>>8}return(-1^t)>>>0}var Ce=s(48287).hp;const Me=e=>e.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_","")),Ae=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),Re=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]),Te=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.flags.includes("g")||(e=new RegExp(e.source,"g"));const n=e.exec(t);return n&&(s.push(n.slice(1)),Te(e,t,s)),s},ke=(e,t)=>{const s=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!s)throw new Error(`Cannot parse TLObject ${e}`);const n=Te(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),a={name:s[1],constructorId:parseInt(s[2],16),argsConfig:{},subclassOfId:Pe(s[3]),result:s[3],isFunction:t,namespace:void 0};if(!a.constructorId){const e="";let t;t=Object.values(a.argsConfig).length?` ${Object.keys(a.argsConfig).map(e=>e.toString()).join(" ")}`:"";const s=`${a.name}${e}${t} = ${a.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/</g," ").replace(/>|{|}/g,"").replace(/ \w+:flags\d*\.\d+\?true/g,"");"inputMediaInvoice"===a.name&&a.name,a.constructorId=Pe(Ce.from(s,"utf8"))}for(const[e,t,s]of n)void 0===e&&(a.argsConfig[Me(t)]=De(t,s));return a.name.includes(".")&&([a.namespace,a.name]=a.name.split(/\.(.+)/)),a.name=a.name.replace(/(?:^|_)([a-z])/g,(e,t)=>t.toUpperCase()).replace(/_/g,""),a};function De(e,t){e="self"===e?"is_self":e;const s={isVector:!1,isFlag:!1,skipConstructorId:!1,flagGroup:0,flagIndex:-1,flagIndicator:!0,type:"",useVectorId:void 0};if("#"!==t){s.flagIndicator=!1,s.type=t.replace(/^!+/,"");const e=s.type.match(/flags(\d*)\.(\d+)\?([\w<>.]+)/);e&&(s.isFlag=!0,s.flagGroup=Number(e[1]||1),s.flagIndex=Number(e[2]),[,,,s.type]=e);const n=s.type.match(/[Vv]ector<([\w\d.]+)>/);n&&(s.isVector=!0,s.useVectorId="V"===s.type.charAt(0),[,s.type]=n),/^[a-z]$/.test(s.type.split(".").pop().charAt(0))&&(s.skipConstructorId=!0)}return s}function Ue(e){if(!(e instanceof Ce)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=Ce.from(e)}const t=[];let s;return e.length<254?(s=(e.length+1)%4,0!==s&&(s=4-s),t.push(Ce.from([e.length])),t.push(e)):(s=e.length%4,0!==s&&(s=4-s),t.push(Ce.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(Ce.alloc(s).fill(0)),Ce.concat(t)}var Ee=s(48287).hp;const Be="undefined"!=typeof self&&void 0!==self.localStorage,xe="GramJs:apiCache";function Ve(e){const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ae;return function*(){(t||[]).reduce((e,t)=>({...e,[t.name]:t}),{});const n=[],a={},i={},o=e;let r=!1;for(let e of o.split("\n")){const t=e.indexOf("//");if(-1!==t&&(e=e.slice(0,t)),e=e.trim(),!e)continue;const o=e.match(/---(\w+)---/);if(o){const[,e]=o;r="functions"===e}else try{const t=ke(e,r);if(s.has(t.constructorId))continue;n.push(t),t.isFunction||(i[t.result]||(i[t.result]=[]),a[t.name]=t,i[t.result].push(t))}catch(e){if(!e.toString().includes("vector#1cb5c415"))throw e}}for(const e of n)if(Re.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of n)yield e}()}(e),s=[],n=[];for(const e of t)e.isFunction?n.push(e):s.push(e);return[s,n]}function Ne(e,t){switch(t){case"int":{const t=Ee.alloc(4);return t.writeInt32LE(e,0),t}case"long":return fe(e,8);case"int128":return fe(e,16);case"int256":return fe(e,32);case"double":{const t=Ee.alloc(8);return t.writeDoubleLE(e,0),t}case"string":case"bytes":return Ue(e);case"Bool":return e?Ee.from("b5757299","hex"):Ee.from("379779bc","hex");case"true":return Ee.alloc(0);case"date":return function(e){if(!e)return Ce.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=Ce.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)}(e);default:return e.getBytes()}}function Ge(e,t){if(t.isVector){t.useVectorId&&e.readInt();const s=[],n=e.readInt();t.isVector=!1;for(let a=0;a<n;a++)s.push(Ge(e,t));return t.isVector=!0,s}if(t.flagIndicator)return e.readInt();switch(t.type){case"int":return e.readInt();case"long":return e.readLong();case"int128":return e.readLargeInt(128);case"int256":return e.readLargeInt(256);case"double":return e.readDouble();case"string":return e.tgReadString();case"Bool":return e.tgReadBool();case"true":return!0;case"bytes":return e.tgReadBytes();case"date":return e.tgReadDate();default:if(t.skipConstructorId)throw new Error(`Unknown type ${t}`);return e.tgReadObject()}}function Fe(e,t){const s={};for(const n of t){const{name:t,constructorId:a,subclassOfId:i,argsConfig:o,namespace:r,result:c}=n,d=[r,t].join(".").replace(/^\./,"");class l{static CONSTRUCTOR_ID=a;static SUBCLASS_OF_ID=i;static className=d;static classType=e;CONSTRUCTOR_ID=a;SUBCLASS_OF_ID=i;className=d;classType=e;constructor(e){e=e||{},Object.keys(e).forEach(t=>{this[t]=e[t]})}static fromReader(e){const t={};for(const s in o)if(o.hasOwnProperty(s)){const n=o[s];if(n.isFlag){const a=t[`flags${n.flagGroup>1?n.flagGroup:""}`]&1<<n.flagIndex;if("true"===n.type){t[s]=Boolean(a);continue}t[s]=a?Ge(e,n):void 0}else t[s]=Ge(e,n)}return new l(t)}getBytes(){const e=this.CONSTRUCTOR_ID,t=Ee.alloc(4);t.writeUInt32LE(e,0);const s=[t];for(const e in o)if(o.hasOwnProperty(e)){if(o[e].isFlag&&(!1===this[e]&&"true"===o[e].type||void 0===this[e]))continue;if(o[e].isVector){o[e].useVectorId&&s.push(Ee.from("15c4b51c","hex"));const t=Ee.alloc(4);t.writeInt32LE(this[e].length,0),s.push(t,Ee.concat(this[e].map(t=>Ne(t,o[e].type))))}else if(o[e].flagIndicator)if(Object.values(o).some(e=>e.isFlag)){let e=0;for(const t in o)o[t].isFlag&&(!1===this[t]&&"true"===o[t].type||void 0===this[t]?e|=0:e|=1<<o[t].flagIndex);const t=Ee.alloc(4);t.writeUInt32LE(e,0),s.push(t)}else s.push(Ee.alloc(4));else if(s.push(Ne(this[e],o[e].type)),this[e]&&"function"==typeof this[e].getBytes){const t=o[e].type.charAt(o[e].type.indexOf(".")+1);t===t.toUpperCase()||s.shift()}}return Ee.concat(s)}readResult(t){if("request"!==e)throw new Error("`readResult()` called for non-request instance");const s=c.match(/Vector<(int|long)>/);if(s){t.readInt();const e=[],n=t.readInt();if("int"===s[1])for(let s=0;s<n;s++)e.push(t.readInt());else for(let s=0;s<n;s++)e.push(t.readLong());return e}return t.tgReadObject()}}r?(s[r]||(s[r]={}),s[r][t]=l):s[t]=l}return s}const qe=function(){let e;const t=Be&&function(){const e=localStorage.getItem(xe);return e&&JSON.parse(e)}();return t?e=t:(e=function(){const[e,t]=Ve("boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#35a95cb9 chat_id:long = InputPeer;\ninputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;\ninputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;\ninputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;\ninputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#f21158c6 user_id:long access_hash:long = InputUser;\ninputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputFileStoryDocument#62dc8b48 id:InputDocument = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# spoiler:flags.1?true id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#37c9330 flags:# nosound_video:flags.3?true force_file:flags.4?true spoiler:flags.5?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> video_cover:flags.6?InputPhoto video_timestamp:flags.7?int ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#a8763ab5 flags:# spoiler:flags.2?true id:InputDocument video_cover:flags.3?InputPhoto video_timestamp:flags.4?int ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#779600f9 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int video_cover:flags.2?InputPhoto video_timestamp:flags.3?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#405fef0d flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:flags.3?string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;\ninputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia;\ninputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;\ninputMediaTodo#9fc55fde todo:TodoList = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;\npeerUser#59511722 user_id:long = Peer;\npeerChat#36c6019a chat_id:long = Peer;\npeerChannel#a2a5371e channel_id:long = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#d3bc4b7a id:long = User;\nuser#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#7b197dc8 flags:# by_me:flags.0?true = UserStatus;\nuserStatusLastWeek#541a1d1a flags:# by_me:flags.0?true = UserStatus;\nuserStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus;\nchatEmpty#29562865 id:long = Chat;\nchat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#6592a1a7 id:long title:string = Chat;\nchannel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat;\nchannelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull;\nchannelFull#e07429de flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long = ChatFull;\nchatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;\nchatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3cbc93f8 chat_id:long participants:Vector<ChatParticipant> version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#9815cec8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message;\nmessageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#52d8ccd9 flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_documents:flags.5?Vector<Document> video_cover:flags.9?Photo video_timestamp:flags.10?int ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;\nmessageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector<long> countries_iso2:flags.1?Vector<string> prize_description:flags.3?string quantity:int months:flags.4?int stars:flags.5?long until_date:int = MessageMedia;\nmessageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector<long> months:flags.4?int stars:flags.5?long prize_description:flags.1?string until_date:int = MessageMedia;\nmessageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;\nmessageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#15cefd00 users:Vector<long> = MessageAction;\nmessageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;\nmessageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;\nmessageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#ffa00ccc flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge subscription_until_date:flags.4?int = MessageAction;\nmessageActionPaymentSent#c624b16e flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long invoice_slug:flags.0?string subscription_until_date:flags.4?int = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#c516d679 flags:# attach_menu:flags.1?true from_request:flags.3?true domain:flags.0?string app:flags.2?BotApp = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;\nmessageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\nmessageActionSetChatTheme#aa786345 emoticon:string = MessageAction;\nmessageActionChatJoinedByRequest#ebbca3cb = MessageAction;\nmessageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;\nmessageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;\nmessageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;\nmessageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;\nmessageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;\nmessageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction;\nmessageActionRequestedPeer#31518e9b button_id:int peers:Vector<Peer> = MessageAction;\nmessageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;\nmessageActionGiftCode#56d03994 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer months:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;\nmessageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction;\nmessageActionGiveawayResults#87e2f155 flags:# stars:flags.0?true winners_count:int unclaimed_count:int = MessageAction;\nmessageActionBoostApply#cc02aa6d boosts:int = MessageAction;\nmessageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;\nmessageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;\nmessageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction;\nmessageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction;\nmessageActionStarGift#f24de7fa flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int = MessageAction;\nmessageActionStarGiftUnique#34f762f3 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction;\nmessageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;\nmessageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags.0?true stars:long = MessageAction;\nmessageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;\nmessageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;\nmessageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;\nmessageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;\nmessageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;\nmessageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;\nmessageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction;\ndialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;\nauth.sentCodePaymentRequired#d7cef980 store_product:string phone_code_hash:string = auth.SentCode;\nauth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputNotifyForumTopic#5c467992 peer:InputPeer top_msg_id:int = InputNotifyPeer;\ninputPeerNotifySettings#cacb6ae2 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_sound:flags.8?NotificationSound = InputPeerNotifySettings;\npeerNotifySettings#99622c0c flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_ios_sound:flags.8?NotificationSound stories_android_sound:flags.9?NotificationSound stories_other_sound:flags.10?NotificationSound = PeerNotifySettings;\npeerSettings#f47741f7 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true business_bot_paused:flags.11?true business_bot_can_reply:flags.12?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int business_bot_id:flags.13?long business_bot_manage_url:flags.13?string charge_paid_message_stars:flags.14?long registration_month:flags.15?string phone_country:flags.16?string name_change_date:flags.17?int photo_change_date:flags.18?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\ninputReportReasonIllegalDrugs#a8eb2be = ReportReason;\ninputReportReasonPersonalDetails#9ec7863d = ReportReason;\nuserFull#7e63ce1f flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int = UserFull;\ncontact#145ade0b user_id:long mutual:Bool = Contact;\nimportedContact#c13e3c50 user_id:long client_id:long = ImportedContact;\ncontactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.messagesSlice#762b263d flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;\nupdateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;\nupdateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;\nupdateUserName#a7848924 user_id:long first_name:string last_name:string usernames:Vector<Username> = Update;\nupdateNewAuthorization#8951abef flags:# unconfirmed:flags.0?true hash:long date:flags.0?int device:flags.0?string location:flags.0?string = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;\nupdateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true invert_media:flags.2?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;\nupdateUserPhone#5492a13 user_id:long phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#f8227181 flags:# messages:Vector<int> pts:int pts_count:int date:flags.0?int = Update;\nupdateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;\nupdateChannel#635b4c09 channel_id:long = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector<int> pts:int pts_count:int = Update;\nupdateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;\nupdateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true emojis:flags.1?true order:Vector<long> = Update;\nupdateStickerSets#31c24808 flags:# masks:flags.0?true emojis:flags.1?true = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;\nupdateDraftMessage#edfc111e flags:# peer:Peer top_msg_id:flags.0?int saved_peer_id:flags.1?Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector<DialogPeer> = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#25f324f7 flags:# channel_id:long top_msg_id:flags.0?int saved_peer_id:flags.1?Peer messages:Vector<int> = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;\nupdateDialogUnreadMark#b658f23e flags:# unread:flags.0?true peer:DialogPeer saved_peer_id:flags.1?Peer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#f2a71983 flags:# peer:Peer messages:Vector<int> sent_messages:flags.0?Vector<int> = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#24f40e77 poll_id:long peer:Peer options:Vector<bytes> qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector<int> = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#ebe07752 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer = Update;\nupdateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;\nupdateChat#f89a6a4e chat_id:long = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;\nupdateGroupCall#97d64341 flags:# chat_id:flags.0?long call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#985d3abb flags:# via_chatlist:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;\nupdatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector<long> = Update;\nupdateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;\nupdateMessageReactions#1e297bfa flags:# peer:Peer msg_id:int top_msg_id:flags.0?int saved_peer_id:flags.1?Peer reactions:MessageReactions = Update;\nupdateAttachMenuBots#17b7a20b = Update;\nupdateWebViewResultSent#1592b79d query_id:long = Update;\nupdateBotMenuButton#14b85813 bot_id:long button:BotMenuButton = Update;\nupdateSavedRingtones#74d8be99 = Update;\nupdateTranscribedAudio#84cd5a flags:# pending:flags.0?true peer:Peer msg_id:int transcription_id:long text:string = Update;\nupdateReadFeaturedEmojiStickers#fb4c496c = Update;\nupdateUserEmojiStatus#28373599 user_id:long emoji_status:EmojiStatus = Update;\nupdateRecentEmojiStatuses#30f443db = Update;\nupdateRecentReactions#6f7863f4 = Update;\nupdateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update;\nupdateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;\nupdateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;\nupdateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;\nupdateUser#20529438 user_id:long = Update;\nupdateAutoSaveSettings#ec05b097 = Update;\nupdateStory#75b3b798 peer:Peer story:StoryItem = Update;\nupdateReadStories#f74e932b peer:Peer max_id:int = Update;\nupdateStoryID#1bf335b9 id:int random_id:long = Update;\nupdateStoriesStealthMode#2c084dc1 stealth_mode:StoriesStealthMode = Update;\nupdateSentStoryReaction#7d627683 peer:Peer story_id:int reaction:Reaction = Update;\nupdateBotChatBoost#904dd49c peer:Peer boost:Boost qts:int = Update;\nupdateChannelViewForumAsMessages#7b68920 channel_id:long enabled:Bool = Update;\nupdatePeerWallpaper#ae3f101d flags:# wallpaper_overridden:flags.1?true peer:Peer wallpaper:flags.0?WallPaper = Update;\nupdateBotMessageReaction#ac21d3ce peer:Peer msg_id:int date:int actor:Peer old_reactions:Vector<Reaction> new_reactions:Vector<Reaction> qts:int = Update;\nupdateBotMessageReactions#9cb7759 peer:Peer msg_id:int date:int reactions:Vector<ReactionCount> qts:int = Update;\nupdateSavedDialogPinned#aeaf9e74 flags:# pinned:flags.0?true peer:DialogPeer = Update;\nupdatePinnedSavedDialogs#686c85a6 flags:# order:flags.0?Vector<DialogPeer> = Update;\nupdateSavedReactionTags#39c67432 = Update;\nupdateSmsJob#f16269d4 job_id:string = Update;\nupdateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update;\nupdateNewQuickReply#f53da717 quick_reply:QuickReply = Update;\nupdateDeleteQuickReply#53e6f1ec shortcut_id:int = Update;\nupdateQuickReplyMessage#3e050d0f message:Message = Update;\nupdateDeleteQuickReplyMessages#566fe7cd shortcut_id:int messages:Vector<int> = Update;\nupdateBotBusinessConnect#8ae5c97a connection:BotBusinessConnection qts:int = Update;\nupdateBotNewBusinessMessage#9ddb347c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;\nupdateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;\nupdateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector<int> qts:int = Update;\nupdateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;\nupdateStarsBalance#4e80a379 balance:StarsAmount = Update;\nupdateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;\nupdateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update;\nupdateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update;\nupdatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update;\nupdateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update;\nupdateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector<bytes> next_offset:int = Update;\nupdateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id:int = Update;\nupdateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;\nupdateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true this_port_only:flags.5?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#cc1a241e flags:# default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true force_try_ipv6:flags.14?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int channels_read_media_period:int tmp_sessions:flags.0?int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int reactions_default:flags.15?Reaction autologin_token:flags.16?string = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;\nencryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;\nencryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#a8008cd8 id:long access_hash:long size:long dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#8fd4c4d8 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:long thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nnotifyForumTopic#226e6308 peer:Peer top_msg_id:int = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\nsendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;\nsendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;\nsendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\ninputPrivacyKeyVoiceMessages#aee69d68 = InputPrivacyKey;\ninputPrivacyKeyAbout#3823cc40 = InputPrivacyKey;\ninputPrivacyKeyBirthday#d65a11cc = InputPrivacyKey;\ninputPrivacyKeyStarGiftsAutoSave#e1732341 = InputPrivacyKey;\ninputPrivacyKeyNoPaidMessages#bdc597b4 = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\nprivacyKeyVoiceMessages#697f414 = PrivacyKey;\nprivacyKeyAbout#a486b761 = PrivacyKey;\nprivacyKeyBirthday#2000a518 = PrivacyKey;\nprivacyKeyStarGiftsAutoSave#2ca4fdf8 = PrivacyKey;\nprivacyKeyNoPaidMessages#17d348d2 = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule;\ninputPrivacyValueAllowCloseFriends#2f453e49 = InputPrivacyRule;\ninputPrivacyValueAllowPremium#77cdc9f1 = InputPrivacyRule;\ninputPrivacyValueAllowBots#5a4fcce5 = InputPrivacyRule;\ninputPrivacyValueDisallowBots#c4e57915 = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#b8905fb2 users:Vector<long> = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule;\nprivacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule;\nprivacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule;\nprivacyValueAllowCloseFriends#f7e8d89b = PrivacyRule;\nprivacyValueAllowPremium#ece9814b = PrivacyRule;\nprivacyValueAllowBots#21461b5d = PrivacyRule;\nprivacyValueDisallowBots#f6a5f82f = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#43c57c48 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double video_codec:flags.5?string = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\ndocumentAttributeCustomEmoji#fd149899 flags:# free:flags.0?true text_color:flags.1?true alt:string stickerset:InputStickerSet = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#30a6ec7e hash:long stickers:Vector<Document> = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#211a1788 flags:# id:long url:flags.0?string = WebPage;\nwebPagePending#b0d13e47 flags:# id:long url:flags.0?string date:int = WebPage;\nwebPage#e89c45b2 flags:# has_large_media:flags.13?true video_cover_photo:flags.14?true id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations;\naccount.password#957b50fb flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int login_email_pattern:flags.6?string = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#a22cbd96 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int subscription_expired:flags.10?int title:flags.8?string subscription_pricing:flags.9?StarsSubscriptionPricing = ExportedChatInvite;\nchatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#5c9d3702 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true can_refulfill_subscription:flags.11?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> color:int subscription_pricing:flags.10?StarsSubscriptionPricing subscription_form_id:flags.12?long bot_verification:flags.13?BotVerification = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\ninputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;\ninputStickerSetPremiumGifts#c88b3b02 = InputStickerSet;\ninputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet;\ninputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet;\ninputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;\ninputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;\ninputStickerSetTonGifts#1cf671a0 = InputStickerSet;\nstickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;\nmessages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;\nmessages.stickerSetNotModified#d3f924eb = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#4d8a0299 flags:# has_preview_medias:flags.6?true user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton privacy_policy_url:flags.7?string app_settings:flags.8?BotAppSettings verifier_settings:flags.9?BotVerifierSettings = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#93b9fbb5 flags:# same_peer:flags.0?true text:string query:string peer_types:flags.1?Vector<InlineQueryPeerType> = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\ninputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = KeyboardButton;\nkeyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton;\nkeyboardButtonWebView#13767230 text:string url:string = KeyboardButton;\nkeyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;\nkeyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;\ninputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;\nkeyboardButtonCopy#75d2698e text:string copy_text:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\nmessageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;\nmessageEntityCustomEmoji#c8cf05f8 offset:int length:int document_id:long = MessageEntity;\nmessageEntityBlockquote#f1ccaaac flags:# collapsed:flags.0?true offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;\ninputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;\nchannelParticipant#cb397619 flags:# user_id:long date:int subscription_until_date:flags.0?int = ChannelParticipant;\nchannelParticipantSelf#4f607bef flags:# via_request:flags.0?true user_id:long inviter_id:long date:int subscription_until_date:flags.1?int = ChannelParticipant;\nchannelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector<ChannelParticipant> chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaWebPage#bddcc510 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true optional:flags.6?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaWebPage#809ad9a6 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true manual:flags.7?true safe:flags.8?true message:string entities:flags.1?Vector<MessageEntity> url:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#e021f2f6 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM switch_webview:flags.3?InlineBotWebView results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#4e4df4bb flags:# imported:flags.7?true saved_out:flags.11?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int saved_from_id:flags.8?Peer saved_from_name:flags.9?string saved_date:flags.10?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.codeTypeMissedCall#d61ad6ee = auth.CodeType;\nauth.codeTypeFragmentSms#6ed998c = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nauth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;\nauth.sentCodeTypeEmailCode#f450f59b flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true email_pattern:string length:int reset_available_period:flags.3?int reset_pending_date:flags.4?int = auth.SentCodeType;\nauth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType;\nauth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType;\nauth.sentCodeTypeFirebaseSms#9fd736 flags:# nonce:flags.0?bytes play_integrity_project_id:flags.2?long play_integrity_nonce:flags.2?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType;\nauth.sentCodeTypeSmsWord#a416ac81 flags:# beginning:flags.0?string = auth.SentCodeType;\nauth.sentCodeTypeSmsPhrase#b37794af flags:# beginning:flags.0?string = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryBotsApp#fd9e7bec = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#88d37c56 hash:long packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;\nstickerSetFullCovered#40d13c0e set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = StickerSetCovered;\nstickerSetNoCovered#77b15d1c set:StickerSet = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#73a379eb pos:int user_id:long score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector<RichText> = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector<PageListItem> = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector<PageTableRow> = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector<PageListOrderedItem> = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector<PageBlock> title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector<PageRelatedArticle> = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\nphoneCallDiscardReasonMigrateConferenceCall#9fbbf1f7 slug:string = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#49ee584 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string subscription_period:flags.11?int = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\ninputWebFileAudioAlbumThumbLocation#f46fe924 flags:# small:flags.2?true document:flags.0?InputDocument title:flags.1?string performer:flags.1?string = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector<PaymentFormMethod> saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector<PaymentSavedCredentials> users:Vector<User> = payments.PaymentForm;\npayments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector<User> = payments.PaymentForm;\npayments.paymentFormStarGift#b425cfe1 form_id:long invoice:Invoice = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;\npayments.paymentReceiptStars#dabbf83a flags:# date:int bot_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice currency:string total_amount:long transaction_id:string users:Vector<User> = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;\ninputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords keywords:flags.1?string = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true conference_supported:flags.8?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int custom_parameters:flags.7?DataJSON = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector<string> = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_chatlist:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAvailableReactions#be4e0ef8 prev_value:ChatReactions new_value:ChatReactions = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsernames#f04fb3a9 prev_value:Vector<string> new_value:Vector<string> = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleForum#2cc6383 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePeerColor#5796e780 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeProfilePeerColor#5e477b25 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeWallpaper#31bb5d52 prev_value:WallPaper new_value:WallPaper = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_value:EmojiStatus = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantSubExtend#64642db3 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleAutotranslation#c517f77e new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true sub_extend:flags.18?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#2cb51097 hash:long packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;\nrecentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;\nwebAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#8af09dd2 hash:long sets:Vector<StickerSetCovered> = messages.FoundStickerSets;\nfileHash#f39b035c offset:long limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#7d09c27e id:long access_hash:long size:long dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector<SecureFile> files:flags.4?Vector<SecureFile> plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector<InputSecureFile> files:flags.4?Vector<InputSecureFile> plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector<SecureRequiredType> = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector<JSONValue> = JSONValue;\njsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector<PageTableCell> = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector<PageBlock> = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector<PageBlock> = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo;\npollAnswer#ff16e2ca text:TextWithEntities option:bytes = PollAnswer;\npoll#58747131 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#7adf2420 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<Peer> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true manage_direct_messages:flags.17?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;\ncodeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true allow_firebase:flags.7?true unknown_number:flags.9?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings;\nwallPaperSettings#372efcd0 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int emoticon:flags.7?string = WallPaperSettings;\nautoDownloadSettings#baa57628 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true stories_preload:flags.4?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int small_queue_active_operations_max:int large_queue_active_operations_max:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector<string> = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector<string> = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector<EmojiKeyword> = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector<ThemeSettings> emoticon:flags.6?string installs_count:flags.4?int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector<int> chats:Vector<Chat> users:Vector<User> = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;\nwebPageAttributeStory#2e94c3e7 flags:# peer:Peer id:int story:flags.0?StoryItem = WebPageAttribute;\nwebPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags.1?true stickers:Vector<Document> = WebPageAttribute;\nwebPageAttributeUniqueStarGift#cf6f6db8 gift:StarGift = WebPageAttribute;\nwebPageAttributeStarGiftCollection#31cad303 icons:Vector<Document> = WebPageAttribute;\nmessages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;\ndialogFilter#aa472651 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;\ndialogFilterDefault#363293ae = DialogFilter;\ndialogFilterChatlist#96537bd7 flags:# has_my_invites:flags.26?true title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nstats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector<PostInteractionCounters> = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8a4d87a flags:# proxy:flags.0?true expires:int peer:flags.3?Peer psa_type:flags.1?string psa_message:flags.2?string pending_suggestions:Vector<string> dismissed_suggestions:Vector<string> custom_pending_suggestion:flags.4?PendingSuggestion chats:Vector<Chat> users:Vector<User> = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nvideoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector<int> = VideoSize;\nvideoSizeStickerMarkup#da082fe stickerset:InputStickerSet sticker_id:long background_colors:Vector<int> = VideoSize;\nstatsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;\nglobalPrivacySettings#fe41b34f flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true hide_read_marks:flags.3?true new_noncontact_peers_require_premium:flags.4?true display_gifts_button:flags.7?true noncontact_peers_paid_stars:flags.5?long disallowed_gifts:flags.6?DisallowedGiftsSettings = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector<help.CountryCode> = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;\nmessages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;\nmessageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader;\nmessageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader;\nmessageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ninputGroupCallSlug#fe06823f slug:string = InputGroupCall;\ninputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector<GroupCallParticipant> next_offset:string chats:Vector<Chat> users:Vector<User> version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\ninlineQueryPeerTypeBotPM#e3b2d0c = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;\nchatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_chatlist:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector<ChatInviteImporter> users:Vector<User> = messages.ChatInviteImporters;\nchatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector<ChatAdminWithInvites> users:Vector<User> = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\nsponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;\nmessages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;\nmessages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;\nsearchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;\nmessages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector<SearchResultsCalendarPeriod> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SearchResultsCalendar;\nsearchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;\nmessages.searchResultsPositions#53b22baf count:int positions:Vector<SearchResultsPosition> = messages.SearchResultsPositions;\nchannels.sendAsPeers#f496b0c6 peers:Vector<SendAsPeer> chats:Vector<Chat> users:Vector<User> = channels.SendAsPeers;\nusers.userFull#3b6d152e full_user:UserFull chats:Vector<Chat> users:Vector<User> = users.UserFull;\nmessages.peerSettings#6880b94d settings:PeerSettings chats:Vector<Chat> users:Vector<User> = messages.PeerSettings;\nauth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut;\nreactionCount#a3d1cb80 flags:# chosen_order:flags.0?int reaction:Reaction count:int = ReactionCount;\nmessageReactions#a339f0b flags:# min:flags.0?true can_see_list:flags.2?true reactions_as_tags:flags.3?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> top_reactors:flags.4?Vector<MessageReactor> = MessageReactions;\nmessages.messageReactionsList#31bd492d flags:# count:int reactions:Vector<MessagePeerReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList;\navailableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction;\nmessages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;\nmessages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions;\nmessagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true my:flags.2?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction;\ngroupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;\nphone.groupCallStreamChannels#d0e482b2 channels:Vector<GroupCallStreamChannel> = phone.GroupCallStreamChannels;\nphone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;\nattachMenuBotIconColor#4576f3f0 name:string color:int = AttachMenuBotIconColor;\nattachMenuBotIcon#b2a7386b flags:# name:string icon:Document colors:flags.0?Vector<AttachMenuBotIconColor> = AttachMenuBotIcon;\nattachMenuBot#d90d8dfe flags:# inactive:flags.0?true has_settings:flags.1?true request_write_access:flags.2?true show_in_attach_menu:flags.3?true show_in_side_menu:flags.4?true side_menu_disclaimer_needed:flags.5?true bot_id:long short_name:string peer_types:flags.3?Vector<AttachMenuPeerType> icons:Vector<AttachMenuBotIcon> = AttachMenuBot;\nattachMenuBotsNotModified#f1d88a5c = AttachMenuBots;\nattachMenuBots#3c4301c0 hash:long bots:Vector<AttachMenuBot> users:Vector<User> = AttachMenuBots;\nattachMenuBotsBot#93bf667f bot:AttachMenuBot users:Vector<User> = AttachMenuBotsBot;\nwebViewResultUrl#4d22ff98 flags:# fullsize:flags.1?true fullscreen:flags.2?true query_id:flags.0?long url:string = WebViewResult;\nwebViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;\nbotMenuButtonDefault#7533a588 = BotMenuButton;\nbotMenuButtonCommands#4258c205 = BotMenuButton;\nbotMenuButton#c7b57ce6 text:string url:string = BotMenuButton;\naccount.savedRingtonesNotModified#fbf6e8b1 = account.SavedRingtones;\naccount.savedRingtones#c1e92cc5 hash:long ringtones:Vector<Document> = account.SavedRingtones;\nnotificationSoundDefault#97e8bebe = NotificationSound;\nnotificationSoundNone#6f0c34df = NotificationSound;\nnotificationSoundLocal#830b9ae4 title:string data:string = NotificationSound;\nnotificationSoundRingtone#ff6c8049 id:long = NotificationSound;\naccount.savedRingtone#b7263f6d = account.SavedRingtone;\naccount.savedRingtoneConverted#1f307eb7 document:Document = account.SavedRingtone;\nattachMenuPeerTypeSameBotPM#7d6be90e = AttachMenuPeerType;\nattachMenuPeerTypeBotPM#c32bfa1a = AttachMenuPeerType;\nattachMenuPeerTypePM#f146d31f = AttachMenuPeerType;\nattachMenuPeerTypeChat#509113f = AttachMenuPeerType;\nattachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;\ninputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;\ninputInvoiceSlug#c326caef slug:string = InputInvoice;\ninputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;\ninputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice;\ninputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice;\ninputInvoiceStarGift#e8625e92 flags:# hide_name:flags.0?true include_upgrade:flags.2?true peer:InputPeer gift_id:long message:flags.1?TextWithEntities = InputInvoice;\ninputInvoiceStarGiftUpgrade#4d818d5d flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = InputInvoice;\ninputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPeer = InputInvoice;\ninputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice;\ninputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice;\ninputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice;\ninputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice;\npayments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;\nmessages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio;\nhelp.premiumPromo#5334759c status_text:string status_entities:Vector<MessageEntity> video_sections:Vector<string> videos:Vector<Document> period_options:Vector<PremiumSubscriptionOption> users:Vector<User> = help.PremiumPromo;\ninputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgrade:flags.1?true = InputStorePaymentPurpose;\ninputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentPremiumGiftCode#fb790393 flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long message:flags.1?TextWithEntities = InputStorePaymentPurpose;\ninputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentStarsTopup#dddd0f56 stars:long currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentStarsGiveaway#751f08fa flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true stars:long boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long users:int = InputStorePaymentPurpose;\ninputStorePaymentAuthCode#9bb2636d flags:# restore:flags.0?true phone_number:string phone_code_hash:string currency:string amount:long = InputStorePaymentPurpose;\npaymentFormMethod#88f8f21b url:string title:string = PaymentFormMethod;\nemojiStatusEmpty#2de11aae = EmojiStatus;\nemojiStatus#e7ff068a flags:# document_id:long until:flags.0?int = EmojiStatus;\nemojiStatusCollectible#7184603b flags:# collectible_id:long document_id:long title:string slug:string pattern_document_id:long center_color:int edge_color:int pattern_color:int text_color:int until:flags.0?int = EmojiStatus;\ninputEmojiStatusCollectible#7141dbf flags:# collectible_id:long until:flags.0?int = EmojiStatus;\naccount.emojiStatusesNotModified#d08ce645 = account.EmojiStatuses;\naccount.emojiStatuses#90c467d1 hash:long statuses:Vector<EmojiStatus> = account.EmojiStatuses;\nreactionEmpty#79f5d419 = Reaction;\nreactionEmoji#1b2286b8 emoticon:string = Reaction;\nreactionCustomEmoji#8935fc73 document_id:long = Reaction;\nreactionPaid#523da4eb = Reaction;\nchatReactionsNone#eafc32bc = ChatReactions;\nchatReactionsAll#52928bca flags:# allow_custom:flags.0?true = ChatReactions;\nchatReactionsSome#661d4037 reactions:Vector<Reaction> = ChatReactions;\nmessages.reactionsNotModified#b06fdbdf = messages.Reactions;\nmessages.reactions#eafdf716 hash:long reactions:Vector<Reaction> = messages.Reactions;\nemailVerifyPurposeLoginSetup#4345be73 phone_number:string phone_code_hash:string = EmailVerifyPurpose;\nemailVerifyPurposeLoginChange#527d22eb = EmailVerifyPurpose;\nemailVerifyPurposePassport#bbf51685 = EmailVerifyPurpose;\nemailVerificationCode#922e55a9 code:string = EmailVerification;\nemailVerificationGoogle#db909ec2 token:string = EmailVerification;\nemailVerificationApple#96d074fd token:string = EmailVerification;\naccount.emailVerified#2b96cd1b email:string = account.EmailVerified;\naccount.emailVerifiedLogin#e1bb0d61 email:string sent_code:auth.SentCode = account.EmailVerified;\npremiumSubscriptionOption#5f2d1df2 flags:# current:flags.1?true can_purchase_upgrade:flags.2?true transaction:flags.3?string months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumSubscriptionOption;\nsendAsPeer#b81c7034 flags:# premium_required:flags.0?true peer:Peer = SendAsPeer;\nmessageExtendedMediaPreview#ad628cc8 flags:# w:flags.0?int h:flags.0?int thumb:flags.1?PhotoSize video_duration:flags.2?int = MessageExtendedMedia;\nmessageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia;\nstickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword;\nusername#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;\nforumTopicDeleted#23f109b id:int = ForumTopic;\nforumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;\nmessages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;\ndefaultHistoryTTL#43b46b20 period:int = DefaultHistoryTTL;\nexportedContactToken#41bf109b url:string expires:int = ExportedContactToken;\nrequestPeerTypeUser#5f3b8a00 flags:# bot:flags.0?Bool premium:flags.1?Bool = RequestPeerType;\nrequestPeerTypeChat#c9f06e1b flags:# creator:flags.0?true bot_participant:flags.5?true has_username:flags.3?Bool forum:flags.4?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;\nrequestPeerTypeBroadcast#339bef6c flags:# creator:flags.0?true has_username:flags.3?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;\nemojiListNotModified#481eadfa = EmojiList;\nemojiList#7a1e11d1 hash:long document_id:Vector<long> = EmojiList;\nemojiGroup#7a9abda9 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;\nemojiGroupGreeting#80d26cc7 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;\nemojiGroupPremium#93bcf34 title:string icon_emoji_id:long = EmojiGroup;\nmessages.emojiGroupsNotModified#6fb4ad87 = messages.EmojiGroups;\nmessages.emojiGroups#881fb94b hash:int groups:Vector<EmojiGroup> = messages.EmojiGroups;\ntextWithEntities#751f3146 text:string entities:Vector<MessageEntity> = TextWithEntities;\nmessages.translateResult#33db32f8 result:Vector<TextWithEntities> = messages.TranslatedText;\nautoSaveSettings#c84834ce flags:# photos:flags.0?true videos:flags.1?true video_max_size:flags.2?long = AutoSaveSettings;\nautoSaveException#81602d47 peer:Peer settings:AutoSaveSettings = AutoSaveException;\naccount.autoSaveSettings#4c3e069d users_settings:AutoSaveSettings chats_settings:AutoSaveSettings broadcasts_settings:AutoSaveSettings exceptions:Vector<AutoSaveException> chats:Vector<Chat> users:Vector<User> = account.AutoSaveSettings;\nhelp.appConfigNotModified#7cde641d = help.AppConfig;\nhelp.appConfig#dd18782e hash:int config:JSONValue = help.AppConfig;\ninputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;\ninputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;\nbotAppNotModified#5da674b7 = BotApp;\nbotApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;\nmessages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true has_settings:flags.2?true app:BotApp = messages.BotApp;\ninlineBotWebView#b57295d5 text:string url:string = InlineBotWebView;\nreadParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate;\ninputChatlistDialogFilter#f3e0da33 filter_id:int = InputChatlist;\nexportedChatlistInvite#c5181ac flags:# title:string url:string peers:Vector<Peer> = ExportedChatlistInvite;\nchatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedChatlistInvite = chatlists.ExportedChatlistInvite;\nchatlists.exportedInvites#10ab6dc7 invites:Vector<ExportedChatlistInvite> chats:Vector<Chat> users:Vector<User> = chatlists.ExportedInvites;\nchatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector<Peer> already_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;\nchatlists.chatlistInvite#f10ece2f flags:# title_noanimate:flags.1?true title:TextWithEntities emoticon:flags.0?string peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;\nchatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistUpdates;\nbots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;\nmessagePeerVote#b6cc2d5c peer:Peer option:bytes date:int = MessagePeerVote;\nmessagePeerVoteInputOption#74cda504 peer:Peer date:int = MessagePeerVote;\nmessagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = MessagePeerVote;\nstoryViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_count:flags.2?int reactions:flags.3?Vector<ReactionCount> reactions_count:flags.4?int recent_viewers:flags.0?Vector<long> = StoryViews;\nstoryItemDeleted#51e6ee4f id:int = StoryItem;\nstoryItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;\nstoryItem#edf164f1 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction albums:flags.19?Vector<int> = StoryItem;\nstories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;\nstories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;\nstories.stories#63c3dd0a flags:# count:int stories:Vector<StoryItem> pinned_to_top:flags.0?Vector<int> chats:Vector<Chat> users:Vector<User> = stories.Stories;\nstoryView#b0bdeac5 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true user_id:long date:int reaction:flags.2?Reaction = StoryView;\nstoryViewPublicForward#9083670b flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true message:Message = StoryView;\nstoryViewPublicRepost#bd74cf49 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer story:StoryItem = StoryView;\nstories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count:int reactions_count:int views:Vector<StoryView> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryViewsList;\nstories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;\ninputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo;\ninputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;\ninputReplyToMonoForum#69d66c45 monoforum_peer_id:InputPeer = InputReplyTo;\nexportedStoryLink#3fc9053b link:string = ExportedStoryLink;\nstoriesStealthMode#712e27fd flags:# active_until_date:flags.0?int cooldown_until_date:flags.1?int = StoriesStealthMode;\nmediaAreaCoordinates#cfc9e002 flags:# x:double y:double w:double h:double rotation:double radius:flags.0?double = MediaAreaCoordinates;\nmediaAreaVenue#be82db9c coordinates:MediaAreaCoordinates geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MediaArea;\ninputMediaAreaVenue#b282217f coordinates:MediaAreaCoordinates query_id:long result_id:string = MediaArea;\nmediaAreaGeoPoint#cad5452d flags:# coordinates:MediaAreaCoordinates geo:GeoPoint address:flags.0?GeoPointAddress = MediaArea;\nmediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea;\nmediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea;\ninputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;\nmediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;\nmediaAreaWeather#49a6549c coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;\nmediaAreaStarGift#5787686d coordinates:MediaAreaCoordinates slug:string = MediaArea;\npeerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;\nstories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories;\nmessages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User> = messages.WebPage;\npremiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;\npayments.checkedGiftCode#284a1096 flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int months:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;\npayments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;\npayments.giveawayInfoResults#e175e66f flags:# winner:flags.0?true refunded:flags.1?true start_date:int gift_code_slug:flags.3?string stars_prize:flags.4?long finish_date:int winners_count:int activated_count:flags.2?int = payments.GiveawayInfo;\nprepaidGiveaway#b2539d54 id:long months:int quantity:int date:int = PrepaidGiveaway;\nprepaidStarsGiveaway#9a9d77e0 id:long stars:long quantity:int boosts:int date:int = PrepaidGiveaway;\nboost#4b3e14d6 flags:# gift:flags.1?true giveaway:flags.2?true unclaimed:flags.3?true id:string user_id:flags.0?long giveaway_msg_id:flags.2?int date:int expires:int used_gift_slug:flags.4?string multiplier:flags.5?int stars:flags.6?long = Boost;\npremium.boostsList#86f8613c flags:# count:int boosts:Vector<Boost> next_offset:flags.0?string users:Vector<User> = premium.BoostsList;\nmyBoost#c448415c flags:# slot:int peer:flags.0?Peer date:int expires:int cooldown_until_date:flags.1?int = MyBoost;\npremium.myBoosts#9ae228e2 my_boosts:Vector<MyBoost> chats:Vector<Chat> users:Vector<User> = premium.MyBoosts;\npremium.boostsStatus#4959427a flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int gift_boosts:flags.4?int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue boost_url:string prepaid_giveaways:flags.3?Vector<PrepaidGiveaway> my_boost_slots:flags.2?Vector<int> = premium.BoostsStatus;\nstoryFwdHeader#b826e150 flags:# modified:flags.3?true from:flags.0?Peer from_name:flags.1?string story_id:flags.2?int = StoryFwdHeader;\npostInteractionCountersMessage#e7058e7f msg_id:int views:int forwards:int reactions:int = PostInteractionCounters;\npostInteractionCountersStory#8a480e27 story_id:int views:int forwards:int reactions:int = PostInteractionCounters;\nstats.storyStats#50cd067c views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.StoryStats;\npublicForwardMessage#1f2bf4a message:Message = PublicForward;\npublicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward;\nstats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stats.PublicForwards;\npeerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;\nhelp.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;\nhelp.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;\nhelp.peerColorOption#adec6ebe flags:# hidden:flags.0?true color_id:int colors:flags.1?help.PeerColorSet dark_colors:flags.2?help.PeerColorSet channel_min_level:flags.3?int group_min_level:flags.4?int = help.PeerColorOption;\nhelp.peerColorsNotModified#2ba1f5ce = help.PeerColors;\nhelp.peerColors#f8ed08 hash:int colors:Vector<help.PeerColorOption> = help.PeerColors;\nstoryReaction#6090d6d5 peer_id:Peer date:int reaction:Reaction = StoryReaction;\nstoryReactionPublicForward#bbab2643 message:Message = StoryReaction;\nstoryReactionPublicRepost#cfcd0f13 peer_id:Peer story:StoryItem = StoryReaction;\nstories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryReactionsList;\nsavedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;\nmonoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;\nmessages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;\nmessages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;\nmessages.savedDialogsNotModified#c01f6fe8 count:int = messages.SavedDialogs;\nsavedReactionTag#cb6ff828 flags:# reaction:Reaction title:flags.0?string count:int = SavedReactionTag;\nmessages.savedReactionTagsNotModified#889b59ef = messages.SavedReactionTags;\nmessages.savedReactionTags#3259950a tags:Vector<SavedReactionTag> hash:long = messages.SavedReactionTags;\noutboxReadDate#3bb842ac date:int = OutboxReadDate;\nsmsjobs.eligibleToJoin#dc8b44cf terms_url:string monthly_sent_sms:int = smsjobs.EligibilityToJoin;\nsmsjobs.status#2aee9191 flags:# allow_international:flags.0?true recent_sent:int recent_since:int recent_remains:int total_sent:int total_since:int last_gift_slug:flags.1?string terms_url:string = smsjobs.Status;\nsmsJob#e6a1eeb8 job_id:string phone_number:string text:string = SmsJob;\nbusinessWeeklyOpen#120b1ab9 start_minute:int end_minute:int = BusinessWeeklyOpen;\nbusinessWorkHours#8c92b098 flags:# open_now:flags.0?true timezone_id:string weekly_open:Vector<BusinessWeeklyOpen> = BusinessWorkHours;\nbusinessLocation#ac5c1af7 flags:# geo_point:flags.0?GeoPoint address:string = BusinessLocation;\ninputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients;\nbusinessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients;\nbusinessAwayMessageScheduleAlways#c9b9e2b9 = BusinessAwayMessageSchedule;\nbusinessAwayMessageScheduleOutsideWorkHours#c3f2f501 = BusinessAwayMessageSchedule;\nbusinessAwayMessageScheduleCustom#cc4d9ecc start_date:int end_date:int = BusinessAwayMessageSchedule;\ninputBusinessGreetingMessage#194cb3b shortcut_id:int recipients:InputBusinessRecipients no_activity_days:int = InputBusinessGreetingMessage;\nbusinessGreetingMessage#e519abab shortcut_id:int recipients:BusinessRecipients no_activity_days:int = BusinessGreetingMessage;\ninputBusinessAwayMessage#832175e0 flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:InputBusinessRecipients = InputBusinessAwayMessage;\nbusinessAwayMessage#ef156a5c flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:BusinessRecipients = BusinessAwayMessage;\ntimezone#ff9289f5 id:string name:string utc_offset:int = Timezone;\nhelp.timezonesListNotModified#970708cc = help.TimezonesList;\nhelp.timezonesList#7b74ed71 timezones:Vector<Timezone> hash:int = help.TimezonesList;\nquickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply;\ninputQuickReplyShortcut#24596d41 shortcut:string = InputQuickReplyShortcut;\ninputQuickReplyShortcutId#1190cf1 shortcut_id:int = InputQuickReplyShortcut;\nmessages.quickReplies#c68d6695 quick_replies:Vector<QuickReply> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.QuickReplies;\nmessages.quickRepliesNotModified#5f91eb5b = messages.QuickReplies;\nconnectedBot#cd64636c flags:# bot_id:long recipients:BusinessBotRecipients rights:BusinessBotRights = ConnectedBot;\naccount.connectedBots#17d7f87b connected_bots:Vector<ConnectedBot> users:Vector<User> = account.ConnectedBots;\nmessages.dialogFilters#2ad93719 flags:# tags_enabled:flags.0?true filters:Vector<DialogFilter> = messages.DialogFilters;\nbirthday#6c8e1e06 flags:# day:int month:int year:flags.0?int = Birthday;\nbotBusinessConnection#8f34b2f5 flags:# disabled:flags.1?true connection_id:string user_id:long dc_id:int date:int rights:flags.2?BusinessBotRights = BotBusinessConnection;\ninputBusinessIntro#9c469cd flags:# title:string description:string sticker:flags.0?InputDocument = InputBusinessIntro;\nbusinessIntro#5a0a066d flags:# title:string description:string sticker:flags.0?Document = BusinessIntro;\nmessages.myStickers#faff629d count:int sets:Vector<StickerSetCovered> = messages.MyStickers;\ninputCollectibleUsername#e39460a9 username:string = InputCollectible;\ninputCollectiblePhone#a2e214a4 phone:string = InputCollectible;\nfragment.collectibleInfo#6ebdff91 purchase_date:int currency:string amount:long crypto_currency:string crypto_amount:long url:string = fragment.CollectibleInfo;\ninputBusinessBotRecipients#c4e5921e flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> exclude_users:flags.6?Vector<InputUser> = InputBusinessBotRecipients;\nbusinessBotRecipients#b88cf373 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> exclude_users:flags.6?Vector<long> = BusinessBotRecipients;\ncontactBirthday#1d998733 contact_id:long birthday:Birthday = ContactBirthday;\ncontacts.contactBirthdays#114ff30d contacts:Vector<ContactBirthday> users:Vector<User> = contacts.ContactBirthdays;\nmissingInvitee#628c9224 flags:# premium_would_allow_invite:flags.0?true premium_required_for_pm:flags.1?true user_id:long = MissingInvitee;\nmessages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers;\ninputBusinessChatLink#11679fa7 flags:# message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string = InputBusinessChatLink;\nbusinessChatLink#b4ae666f flags:# link:string message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string views:int = BusinessChatLink;\naccount.businessChatLinks#ec43a2d1 links:Vector<BusinessChatLink> chats:Vector<Chat> users:Vector<User> = account.BusinessChatLinks;\naccount.resolvedBusinessChatLinks#9a23af21 flags:# peer:Peer message:string entities:flags.0?Vector<MessageEntity> chats:Vector<Chat> users:Vector<User> = account.ResolvedBusinessChatLinks;\nrequestedPeerUser#d62ff46a flags:# user_id:long first_name:flags.0?string last_name:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;\nrequestedPeerChat#7307544f flags:# chat_id:long title:flags.0?string photo:flags.2?Photo = RequestedPeer;\nrequestedPeerChannel#8ba403e4 flags:# channel_id:long title:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;\nsponsoredMessageReportOption#430d3150 text:string option:bytes = SponsoredMessageReportOption;\nchannels.sponsoredMessageReportResultChooseOption#846f9e42 title:string options:Vector<SponsoredMessageReportOption> = channels.SponsoredMessageReportResult;\nchannels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMessageReportResult;\nchannels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;\nreactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;\nreactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;\nreactionsNotifySettings#56e34970 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;\navailableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;\nmessages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;\nmessages.availableEffects#bddb616e hash:int effects:Vector<AvailableEffect> documents:Vector<Document> = messages.AvailableEffects;\nfactCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck;\nstarsTransactionPeerUnsupported#95f2bfe4 = StarsTransactionPeer;\nstarsTransactionPeerAppStore#b457b375 = StarsTransactionPeer;\nstarsTransactionPeerPlayMarket#7b560a0b = StarsTransactionPeer;\nstarsTransactionPeerPremiumBot#250dbaf8 = StarsTransactionPeer;\nstarsTransactionPeerFragment#e92fd902 = StarsTransactionPeer;\nstarsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer;\nstarsTransactionPeerAds#60682812 = StarsTransactionPeer;\nstarsTransactionPeerAPI#f9677aad = StarsTransactionPeer;\nstarsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;\nstarsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;\npayments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;\nfoundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory;\nstories.foundStories#e2de7737 flags:# count:int stories:Vector<FoundStory> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stories.FoundStories;\ngeoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:flags.1?string street:flags.2?string = GeoPointAddress;\nstarsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;\npayments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;\npayments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;\npayments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAdsAccountUrl;\ninputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;\nstarsGiftOption#5e0589f1 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsGiftOption;\nbots.popularAppBots#1991b13b flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;\nbotPreviewMedia#23e91ba3 date:int media:MessageMedia = BotPreviewMedia;\nbots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;\nstarsSubscriptionPricing#5416d58 period:int amount:long = StarsSubscriptionPricing;\nstarsSubscription#2e6eab1a flags:# canceled:flags.0?true can_refulfill:flags.1?true missing_balance:flags.2?true bot_canceled:flags.7?true id:string peer:Peer until_date:int pricing:StarsSubscriptionPricing chat_invite_hash:flags.3?string title:flags.4?string photo:flags.5?WebDocument invoice_slug:flags.6?string = StarsSubscription;\nmessageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer count:int = MessageReactor;\nstarsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector<StarsGiveawayWinnersOption> = StarsGiveawayOption;\nstarsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;\nstarGift#bcff5b flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int = StarGift;\nstarGiftUnique#26a5553e flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector<StarsAmount> released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string = StarGift;\npayments.starGiftsNotModified#a388a368 = payments.StarGifts;\npayments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;\nmessageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;\nreportResultChooseOption#f0e4e0b6 title:string options:Vector<MessageReportOption> = ReportResult;\nreportResultAddComment#6f09ac31 flags:# optional:flags.0?true option:bytes = ReportResult;\nreportResultReported#8db33c4b = ReportResult;\nmessages.botPreparedInlineMessage#8ecf0511 id:string expire_date:int = messages.BotPreparedInlineMessage;\nmessages.preparedInlineMessage#ff57708d query_id:long result:BotInlineResult peer_types:Vector<InlineQueryPeerType> cache_time:int users:Vector<User> = messages.PreparedInlineMessage;\nbotAppSettings#c99b1950 flags:# placeholder_path:flags.0?bytes background_color:flags.1?int background_dark_color:flags.2?int header_color:flags.3?int header_dark_color:flags.4?int = BotAppSettings;\nstarRefProgram#dd0c66f2 flags:# bot_id:long commission_permille:int duration_months:flags.0?int end_date:flags.1?int daily_revenue_per_user:flags.2?StarsAmount = StarRefProgram;\nconnectedBotStarRef#19a13f71 flags:# revoked:flags.1?true url:string date:int bot_id:long commission_permille:int duration_months:flags.0?int participants:long revenue:long = ConnectedBotStarRef;\npayments.connectedStarRefBots#98d5ea1d count:int connected_bots:Vector<ConnectedBotStarRef> users:Vector<User> = payments.ConnectedStarRefBots;\npayments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<StarRefProgram> users:Vector<User> next_offset:flags.0?string = payments.SuggestedStarRefBots;\nstarsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;\nstarsTonAmount#74aee3e0 amount:long = StarsAmount;\nmessages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;\nmessages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;\nbotVerifierSettings#b0cd6617 flags:# can_modify_custom_description:flags.1?true icon:long company:string custom_description:flags.0?string = BotVerifierSettings;\nbotVerification#f93cd45c bot_id:long icon:long description:string = BotVerification;\nstarGiftAttributeModel#39d99013 name:string document:Document rarity_permille:int = StarGiftAttribute;\nstarGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute;\nstarGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute;\nstarGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute;\npayments.starGiftUpgradePreview#167bd90b sample_attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradePreview;\nusers.users#62d706b8 users:Vector<User> = users.Users;\nusers.usersSlice#315a4974 count:int users:Vector<User> = users.Users;\npayments.uniqueStarGift#caa2f60b gift:StarGift users:Vector<User> = payments.UniqueStarGift;\nmessages.webPagePreview#b53e8b21 media:MessageMedia users:Vector<User> = messages.WebPagePreview;\nsavedStarGift#19a9b572 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector<int> prepaid_upgrade_hash:flags.16?string = SavedStarGift;\npayments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;\ninputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift;\ninputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift;\ninputSavedStarGiftSlug#2085c238 slug:string = InputSavedStarGift;\npayments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl;\npaidReactionPrivacyDefault#206ad49e = PaidReactionPrivacy;\npaidReactionPrivacyAnonymous#1f0c1ad9 = PaidReactionPrivacy;\npaidReactionPrivacyPeer#dc6cfcf0 peer:InputPeer = PaidReactionPrivacy;\naccount.paidMessagesRevenue#1e109708 stars_amount:long = account.PaidMessagesRevenue;\nrequirementToContactEmpty#50a9839 = RequirementToContact;\nrequirementToContactPremium#e581e4e9 = RequirementToContact;\nrequirementToContactPaidMessages#b4f67e93 stars_amount:long = RequirementToContact;\nbusinessBotRights#a0624cf7 flags:# reply:flags.0?true read_messages:flags.1?true delete_sent_messages:flags.2?true delete_received_messages:flags.3?true edit_name:flags.4?true edit_bio:flags.5?true edit_profile_photo:flags.6?true edit_username:flags.7?true view_gifts:flags.8?true sell_gifts:flags.9?true change_gift_settings:flags.10?true transfer_and_upgrade_gifts:flags.11?true transfer_stars:flags.12?true manage_stories:flags.13?true = BusinessBotRights;\ndisallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true = DisallowedGiftsSettings;\nsponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer;\ncontacts.sponsoredPeersEmpty#ea32b4b1 = contacts.SponsoredPeers;\ncontacts.sponsoredPeers#eb032884 peers:Vector<SponsoredPeer> chats:Vector<Chat> users:Vector<User> = contacts.SponsoredPeers;\nstarGiftAttributeIdModel#48aaae3c document_id:long = StarGiftAttributeId;\nstarGiftAttributeIdPattern#4a162433 document_id:long = StarGiftAttributeId;\nstarGiftAttributeIdBackdrop#1f01c757 backdrop_id:int = StarGiftAttributeId;\nstarGiftAttributeCounter#2eb1b658 attribute:StarGiftAttributeId count:int = StarGiftAttributeCounter;\npayments.resaleStarGifts#947a12df flags:# count:int gifts:Vector<StarGift> next_offset:flags.0?string attributes:flags.1?Vector<StarGiftAttribute> attributes_hash:flags.1?long chats:Vector<Chat> counters:flags.2?Vector<StarGiftAttributeCounter> users:Vector<User> = payments.ResaleStarGifts;\nstories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount;\npendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;\ntodoItem#cba9a52f id:int title:TextWithEntities = TodoItem;\ntodoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;\ntodoCompletion#4cc120b7 id:int completed_by:long date:int = TodoCompletion;\nsuggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;\nstarsRating#1b0e4f07 flags:# level:int current_level_stars:long stars:long next_level_stars:flags.0?long = StarsRating;\nstarGiftCollection#9d6b13b0 flags:# collection_id:int title:string icon:flags.0?Document gifts_count:int hash:long = StarGiftCollection;\npayments.starGiftCollectionsNotModified#a0ba4f17 = payments.StarGiftCollections;\npayments.starGiftCollections#8a2932f3 collections:Vector<StarGiftCollection> = payments.StarGiftCollections;\nstoryAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo icon_video:flags.1?Document = StoryAlbum;\nstories.albumsNotModified#564edaeb = stories.Albums;\nstories.albums#c3987a3a hash:long albums:Vector<StoryAlbum> = stories.Albums;\nsearchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood;\npayments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo;\n---functions---\ninvokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#8d52a951 flags:# phone_number:string phone_code_hash:string phone_code:flags.0?string email_verification:flags.1?EmailVerification = auth.Authorization;\nauth.logOut#3e72ba19 = auth.LoggedOut;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#cae47523 flags:# phone_number:string phone_code_hash:string reason:flags.0?string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;\nauth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\nauth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization;\naccount.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;\naccount.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#7967d36 hash:long = account.WallPapers;\naccount.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;\naccount.getAccountTTL#8fc711d = AccountDaysTTL;\naccount.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.getWebAuthorizations#182e6d6f = account.WebAuthorizations;\naccount.resetWebAuthorization#2d01b9ef hash:long = Bool;\naccount.resetWebAuthorizations#682d2594 = Bool;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true compare_stories:flags.2?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\naccount.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;\naccount.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;\naccount.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;\naccount.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool;\naccount.changeAuthorizationSettings#40f48462 flags:# confirmed:flags.3?true hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;\naccount.updateEmojiStatus#fbd3de6b emoji_status:EmojiStatus = Bool;\naccount.getRecentEmojiStatuses#f578105 hash:long = account.EmojiStatuses;\naccount.reorderUsernames#ef500eab order:Vector<string> = Bool;\naccount.toggleUsername#58d6b376 username:string active:Bool = Bool;\naccount.resolveBusinessChatLink#5492e5ee slug:string = account.ResolvedBusinessChatLinks;\naccount.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool;\naccount.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;\naccount.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;\naccount.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;\nusers.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;\nusers.getFullUser#b60f5918 id:InputUser = users.UserFull;\ncontacts.getContacts#5dd69e12 hash:long = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;\ncontacts.block#2e2e8734 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;\ncontacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;\ncontacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#725afbbc flags:# username:string referer:flags.0?string = contacts.ResolvedPeer;\ncontacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers;\ncontacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;\ncontacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;\ncontacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool;\ncontacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers;\nmessages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;\nmessages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;\nmessages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.search#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#fe05dc9a flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;\nmessages.sendMedia#ac55d9c1 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;\nmessages.forwardMessages#978928ca flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;\nmessages.reportSpam#cf1592db peer:InputPeer = Bool;\nmessages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;\nmessages.report#fc78af9b peer:InputPeer id:Vector<int> option:bytes message:string = ReportResult;\nmessages.getChats#49e9528f id:Vector<long> = messages.Chats;\nmessages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;\nmessages.editChatTitle#73783ffd chat_id:long title:string = Updates;\nmessages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;\nmessages.addChatUser#cbc6d107 chat_id:long user_id:InputUser fwd_limit:int = messages.InvitedUsers;\nmessages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;\nmessages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;\nmessages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;\nmessages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;\nmessages.getWebPagePreview#570d6f6f flags:# message:string entities:flags.3?Vector<MessageEntity> = messages.WebPagePreview;\nmessages.exportChatInvite#a455de90 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string subscription_pricing:flags.5?StarsSubscriptionPricing = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;\nmessages.migrateChat#a2875319 chat_id:long = Updates;\nmessages.searchGlobal#4bc6589a flags:# broadcasts_only:flags.1?true groups_only:flags.2?true users_only:flags.3?true folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document;\nmessages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;\nmessages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#c0cf7646 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut allow_paid_stars:flags.21?long = Updates;\nmessages.editMessage#dfd14005 flags:# no_webpage:flags.1?true invert_media:flags.16?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int quick_reply_shortcut_id:flags.17?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;\nmessages.saveDraft#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = Bool;\nmessages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;\nmessages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;\nmessages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;\nmessages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;\nmessages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;\nmessages.getWebPage#8d9692a3 url:string hash:int = messages.WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#14967978 flags:# business_connection_id:flags.0?string peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;\nmessages.sendMultiMedia#1bf89d74 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;\nmessages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;\nmessages.markDialogUnread#8c5006f8 flags:# unread:flags.0?true parent_peer:flags.1?InputPeer peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;\nmessages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#efd48c89 = messages.DialogFilters;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;\nmessages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#62dd747 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = messages.AffectedHistory;\nmessages.deleteChat#5bd0ee50 chat_id:long = Bool;\nmessages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;\nmessages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;\nmessages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;\nmessages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;\nmessages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true subscription_expired:flags.3?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;\nmessages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;\nmessages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;\nmessages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates;\nmessages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;\nmessages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool;\nmessages.sendReaction#d30d78d4 flags:# big:flags.1?true add_to_recent:flags.2?true peer:InputPeer msg_id:int reaction:flags.0?Vector<Reaction> = Updates;\nmessages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector<int> = Updates;\nmessages.getMessageReactionsList#461b3f48 flags:# peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = messages.MessageReactionsList;\nmessages.setChatAvailableReactions#864b2581 flags:# peer:InputPeer available_reactions:ChatReactions reactions_limit:flags.0?int paid_enabled:flags.1?Bool = Updates;\nmessages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;\nmessages.setDefaultReaction#4f47a016 reaction:Reaction = Bool;\nmessages.translateText#63183030 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string = messages.TranslatedText;\nmessages.getUnreadReactions#bd7f90ac flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readReactions#9ec44f93 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = messages.AffectedHistory;\nmessages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots;\nmessages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot;\nmessages.toggleBotInAttachMenu#69f59d69 flags:# write_allowed:flags.0?true bot:InputUser enabled:Bool = Bool;\nmessages.requestWebView#269dc2c1 flags:# from_bot_menu:flags.4?true silent:flags.5?true compact:flags.7?true fullscreen:flags.8?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = WebViewResult;\nmessages.prolongWebView#b0d81a83 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = Bool;\nmessages.requestSimpleWebView#413a3e73 flags:# from_switch_webview:flags.1?true from_side_menu:flags.2?true compact:flags.7?true fullscreen:flags.8?true bot:InputUser url:flags.3?string start_param:flags.4?string theme_params:flags.0?DataJSON platform:string = WebViewResult;\nmessages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;\nmessages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;\nmessages.transcribeAudio#269e9a49 peer:InputPeer msg_id:int = messages.TranscribedAudio;\nmessages.getCustomEmojiDocuments#d9ab0f54 document_id:Vector<long> = Vector<Document>;\nmessages.getEmojiStickers#fbfca18f hash:long = messages.AllStickers;\nmessages.getFeaturedEmojiStickers#ecf6736 hash:long = messages.FeaturedStickers;\nmessages.getTopReactions#bb8125ba limit:int hash:long = messages.Reactions;\nmessages.getRecentReactions#39461db2 limit:int hash:long = messages.Reactions;\nmessages.clearRecentReactions#9dfeefb4 = Bool;\nmessages.getExtendedMedia#84f80814 peer:InputPeer id:Vector<int> = Updates;\nmessages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool;\nmessages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;\nmessages.requestAppWebView#53618bce flags:# write_allowed:flags.0?true compact:flags.7?true fullscreen:flags.8?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = WebViewResult;\nmessages.getSavedDialogs#1e91fc99 flags:# exclude_pinned:flags.0?true parent_peer:flags.1?InputPeer offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.SavedDialogs;\nmessages.getSavedHistory#998ab009 flags:# parent_peer:flags.0?InputPeer peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.deleteSavedHistory#4dc5085f flags:# parent_peer:flags.0?InputPeer peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;\nmessages.getPinnedSavedDialogs#d63d94e0 = messages.SavedDialogs;\nmessages.toggleSavedDialogPin#ac81bbde flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getSavedReactionTags#3637e05b flags:# peer:flags.0?InputPeer hash:long = messages.SavedReactionTags;\nmessages.updateSavedReactionTag#60297dec flags:# reaction:Reaction title:flags.0?string = Bool;\nmessages.getDefaultTagReactions#bdf93428 hash:long = messages.Reactions;\nmessages.getOutboxReadDate#8c4bfe5d peer:InputPeer msg_id:int = OutboxReadDate;\nmessages.getQuickReplies#d483f2a8 hash:long = messages.QuickReplies;\nmessages.getQuickReplyMessages#94a495c3 flags:# shortcut_id:int id:flags.0?Vector<int> hash:long = messages.Messages;\nmessages.sendQuickReplyMessages#6c750de1 peer:InputPeer shortcut_id:int id:Vector<int> random_id:Vector<long> = Updates;\nmessages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool;\nmessages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects;\nmessages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;\nmessages.requestMainWebView#c9e01e7b flags:# compact:flags.7?true fullscreen:flags.8?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?DataJSON platform:string = WebViewResult;\nmessages.sendPaidReaction#58bbcb50 flags:# peer:InputPeer msg_id:int count:int random_id:long private:flags.0?PaidReactionPrivacy = Updates;\nmessages.getPaidReactionPrivacy#472455aa = Updates;\nmessages.viewSponsoredMessage#269e3643 random_id:bytes = Bool;\nmessages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:flags.1?true random_id:bytes = Bool;\nmessages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;\nmessages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;\nmessages.getPreparedInlineMessage#857ebdb8 bot:InputUser id:string = messages.PreparedInlineMessage;\nmessages.reportMessagesDelivery#5a6d7395 flags:# push:flags.0?true peer:InputPeer id:Vector<int> = Bool;\nmessages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;\nmessages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;\nmessages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.updateProfilePhoto#9e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser id:InputPhoto = photos.Photo;\nphotos.uploadProfilePhoto#388a3b5 flags:# fallback:flags.3?true bot:flags.5?InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.4?VideoSize = photos.Photo;\nphotos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nphotos.uploadContactProfilePhoto#e14c4a71 flags:# suggest:flags.3?true save:flags.4?true user_id:InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.5?VideoSize = photos.Photo;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#be5335be flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:long limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nhelp.getAppConfig#61e3f854 hash:int = help.AppConfig;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nhelp.getPremiumPromo#b81b93d4 = help.PremiumPromo;\nhelp.getPeerColors#da80f42f hash:int = help.PeerColors;\nhelp.getTimezonesList#49b30240 hash:int = help.TimezonesList;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;\nchannels.reportSpam#f44a8315 channel:InputChannel participant:InputPeer id:Vector<int> = Bool;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;\nchannels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true forum:flags.5?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#c9e33d54 channel:InputChannel users:Vector<InputUser> = messages.InvitedUsers;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink;\nchannels.toggleSignatures#418d549c flags:# signatures_enabled:flags.0?true profiles_enabled:flags.1?true channel:InputChannel = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\nchannels.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true peer:InputPeer = channels.SendAsPeers;\nchannels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;\nchannels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates;\nchannels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;\nchannels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;\nchannels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;\nchannels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;\nchannels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;\nchannels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;\nchannels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;\nchannels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;\nchannels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;\nchannels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;\nchannels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;\nchannels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;\nchannels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates;\nchannels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats;\nchannels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;\nchannels.updatePaidMessagesPrice#4b12327b flags:# broadcast_messages_allowed:flags.0?true channel:InputChannel send_paid_messages_stars:long = Updates;\nchannels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Updates;\nchannels.checkSearchPostsFlood#22567115 flags:# query:flags.0?string = SearchPostsFlood;\nbots.setBotInfo#10cf3123 flags:# bot:flags.2?InputUser lang_code:string name:flags.3?string about:flags.0?string description:flags.1?string = Bool;\nbots.canSendMessage#1359f4e6 bot:InputUser = Bool;\nbots.allowSendMessage#f132e3ef bot:InputUser = Updates;\nbots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;\nbots.getPopularAppBots#c2510192 offset:string limit:int = bots.PopularAppBots;\nbots.getPreviewMedias#a2a5594d bot:InputUser = Vector<BotPreviewMedia>;\nbots.toggleUserEmojiStatusPermission#6de6392 bot:InputUser enabled:Bool = Bool;\nbots.checkDownloadFileParams#50077589 bot:InputUser file_name:string url:string = Bool;\nbots.getBotRecommendations#a1b70815 bot:InputUser = users.Users;\npayments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#b6c8f12b flags:# save:flags.0?true invoice:InputInvoice info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\npayments.getPremiumGiftCodeOptions#2757ba54 flags:# boost_peer:flags.0?InputPeer = Vector<PremiumGiftCodeOption>;\npayments.checkGiftCode#8e51b4c1 slug:string = payments.CheckedGiftCode;\npayments.applyGiftCode#f6e26854 slug:string = Updates;\npayments.getGiveawayInfo#f4239425 peer:InputPeer msg_id:int = payments.GiveawayInfo;\npayments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:InputStorePaymentPurpose = Updates;\npayments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;\npayments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;\npayments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;\npayments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;\npayments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;\npayments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;\npayments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;\npayments.getStarsSubscriptions#32512c5 flags:# missing_balance:flags.0?true peer:InputPeer offset:string = payments.StarsStatus;\npayments.changeStarsSubscription#c7770878 flags:# peer:InputPeer subscription_id:string canceled:flags.0?Bool = Bool;\npayments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string = Bool;\npayments.getStarsGiveawayOptions#bd1efd3e = Vector<StarsGiveawayOption>;\npayments.getStarGifts#c4563590 hash:int = payments.StarGifts;\npayments.saveStarGift#2a2a697c flags:# unsave:flags.0?true stargift:InputSavedStarGift = Bool;\npayments.convertStarGift#74bf076b stargift:InputSavedStarGift = Bool;\npayments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgradePreview;\npayments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates;\npayments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates;\npayments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift;\npayments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;\npayments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl;\npayments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector<InputSavedStarGift> = Bool;\npayments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector<StarGiftAttributeId> offset:string limit:int = payments.ResaleStarGifts;\npayments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates;\npayments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections;\npayments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo;\nphone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;\nphone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;\nphone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;\nphone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;\nphone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;\nphone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;\nphone.joinGroupCall#8fb53057 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string public_key:flags.3?int256 block:flags.3?bytes params:DataJSON = Updates;\nphone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;\nphone.discardGroupCall#7a777135 call:InputGroupCall = Updates;\nphone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;\nphone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;\nphone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;\nphone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;\nphone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;\nphone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;\nphone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;\nlangpack.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector<LangPackLanguage>;\nlangpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLanguage;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;\nstats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;\nstats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;\nstats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;\nstats.getMessagePublicForwards#5f150144 channel:InputChannel msg_id:int offset:string limit:int = stats.PublicForwards;\nstats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;\nstats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = stats.StoryStats;\nstats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;\nchatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;\nchatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;\nchatlists.editExportedInvite#653db63d flags:# chatlist:InputChatlist slug:string title:flags.1?string peers:flags.2?Vector<InputPeer> = ExportedChatlistInvite;\nchatlists.getExportedInvites#ce03da83 chatlist:InputChatlist = chatlists.ExportedInvites;\nchatlists.checkChatlistInvite#41c10fff slug:string = chatlists.ChatlistInvite;\nchatlists.joinChatlistInvite#a6b1e39a slug:string peers:Vector<InputPeer> = Updates;\nchatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>;\nchatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates;\nstories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;\nstories.deleteStories#ae59db5f peer:InputPeer id:Vector<int> = Vector<int>;\nstories.togglePinned#9a75a1ef peer:InputPeer id:Vector<int> pinned:Bool = Vector<int>;\nstories.getAllStories#eeb0d625 flags:# next:flags.1?true hidden:flags.2?true state:flags.0?string = stories.AllStories;\nstories.getPinnedStories#5821a5dc peer:InputPeer offset_id:int limit:int = stories.Stories;\nstories.getStoriesArchive#b4352016 peer:InputPeer offset_id:int limit:int = stories.Stories;\nstories.getStoriesByID#5774ca74 peer:InputPeer id:Vector<int> = stories.Stories;\nstories.readStories#a556dac8 peer:InputPeer max_id:int = Vector<int>;\nstories.incrementStoryViews#b2028afb peer:InputPeer id:Vector<int> = Bool;\nstories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true forwards_first:flags.3?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;\nstories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector<int> = stories.StoryViews;\nstories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;\nstories.report#19d8eb45 peer:InputPeer id:Vector<int> option:bytes message:string = ReportResult;\nstories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates;\nstories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates;\nstories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;\nstories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;\nstories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool;\nstories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;\nstories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums;\nstories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories;\npremium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;\npremium.getMyBoosts#be77b4a = premium.MyBoosts;\npremium.applyBoost#6b7da746 flags:# slots:flags.0?Vector<int> peer:InputPeer = premium.MyBoosts;\npremium.getBoostsStatus#42f1f61 peer:InputPeer = premium.BoostsStatus;\nfragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;"),[s,n]=Ve("resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\np_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;\np_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\np_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nrpc_answer_unknown#5e2ad36e = RpcDropAnswer;\nrpc_answer_dropped_running#cd78e586 = RpcDropAnswer;\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector<FutureSalt> = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\nipPort#d433ad73 ipv4:int port:int = IpPort;\nipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;\naccessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector<IpPort> = AccessPointRule;\nhelp.configSimple#5a592a6c date:int expires:int rules:vector<AccessPointRule> = help.ConfigSimple;\ntlsClientHello blocks:vector<TlsBlock> = TlsClientHello;\ntlsBlockString data:string = TlsBlock;\ntlsBlockRandom length:int = TlsBlock;\ntlsBlockZero length:int = TlsBlock;\ntlsBlockDomain = TlsBlock;\ntlsBlockGrease seed:int = TlsBlock;\ntlsBlockScope entries:Vector<TlsBlock> = TlsBlock;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;");return{constructors:[].concat(e,s),requests:[].concat(t,n)}}(),Be&&localStorage.setItem(xe,JSON.stringify(e))),function(e,t){const s={...e};return Object.keys(t).forEach(e=>{"function"!=typeof t[e]&&s[e]?Object.assign(s[e],t[e]):s[e]=t[e]}),s}(Fe("constructor",e.constructors),Fe("request",e.requests))}();class He extends Error{constructor(e,t,s){super("RPCError {0}: {1}{2}".replace("{0}",s?.toString()||"").replace("{1}",e).replace("{2}",He._fmtRequest(t))),this.code=s,this.errorMessage=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}class Le extends He{constructor(e,t,s){super(e,t,s),this.code=s||303,this.errorMessage=e||"ERROR_SEE_OTHER"}}class Oe extends He{code=400;errorMessage="BAD_REQUEST"}class je extends He{code=420;errorMessage="FLOOD"}class We extends He{code=500;errorMessage="INTERNAL"}class ze extends He{code=503;errorMessage="Timeout"}class Ke extends Le{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${He._fmtRequest(e.request)}`,e.request),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${He._fmtRequest(e.request)}`,this.newDc=t}}class $e extends Le{constructor(e){const t=Number(e.capture||0);super(`The phone number a user is trying to use for authorization is associated with DC ${t}${He._fmtRequest(e.request)}`,e.request),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${He._fmtRequest(e.request)}`,this.newDc=t}}class Je extends je{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${He._fmtRequest(e.request)}`,e.request),this.message=`A wait of ${t} seconds is required${He._fmtRequest(e.request)}`,this.seconds=t}}class Qe extends Je{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${He._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${He._fmtRequest(e.request)}`,this.seconds=t}}class Xe extends je{constructor(e){super(`Message failed to be sent.${He._fmtRequest(e.request)}`,e.request),this.message=`Message failed to be sent.${He._fmtRequest(e.request)}`}}class Ze extends je{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${He._fmtRequest(e.request)}`,e.request),this.message=`A wait of ${t} seconds is required in the test servers${He._fmtRequest(e.request)}`,this.seconds=t}}class Ye extends Le{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${He._fmtRequest(e.request)}`,e.request),this.message=`The source IP address is associated with DC ${t}${He._fmtRequest(e.request)}`,this.newDc=t}}class et extends Oe{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${He._fmtRequest(e.request)}`,e.request,400),this.message=`Email unconfirmed, the length of the code must be ${t}${He._fmtRequest(e.request)}`,this.codeLength=t}}class tt extends Oe{constructor(e){const t=Number(e.capture||0);super(`The password was modified less than 24 hours ago, try again in ${t} seconds.`,e.request),this.message=`The password was modified less than 24 hours ago, try again in ${t} seconds.`,this.seconds=t}}const st=new Map([[/FILE_MIGRATE_(\d+)/,class extends Le{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${He._fmtRequest(e.request)}`,e.request),this.message=`The file to be accessed is currently stored in DC ${t}${He._fmtRequest(e.request)}`,this.newDc=t}}],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,Ze],[/FLOOD_WAIT_(\d+)/,Je],[/FLOOD_PREMIUM_WAIT_(\d+)/,Qe],[/MSG_WAIT_(.*)/,Xe],[/PHONE_MIGRATE_(\d+)/,$e],[/SLOWMODE_WAIT_(\d+)/,class extends je{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat ${He._fmtRequest(e.request)}`,e.request),this.message=`A wait of ${t} seconds is required before sending another message in this chat${He._fmtRequest(e.request)}`,this.seconds=t}}],[/USER_MIGRATE_(\d+)/,Ke],[/NETWORK_MIGRATE_(\d+)/,Ye],[/EMAIL_UNCONFIRMED_(\d+)/,et],[/PASSWORD_TOO_FRESH_(\d+)/,tt],[/^Timeout$/,ze]]);Error;class nt extends Error{constructor(e,t){super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${e}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${t.length}`),"undefined"!=typeof alert&&alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${e}`),this.invalidConstructorId=e,this.remaining=t}}Error;class at extends Error{constructor(e){let t;4===e.length?(t=-e.readInt32LE(0),super(`Invalid response buffer (HTTP code ${t})`)):super(`Invalid response buffer (too short ${e.toString()})`),this.code=t,this.payload=e}}class it extends Error{constructor(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];t.length||(t=["A security check failed."]),super(...t)}}class ot extends Error{static ErrorMessages={16:"msg_id too low (most likely, client time is wrong it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted).",17:"msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id).",18:"Incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4).",19:"Container msg_id is the same as msg_id of a previously received message (this must never happen).",20:"Message too old, and it cannot be verified whether the server has received a message with this msg_id or not.",32:"msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno).",33:"msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno).",34:"An even msg_seqno expected (irrelevant message), but odd received.",35:"Odd msg_seqno expected (relevant message), but even received.",48:"Incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it).",64:"Invalid container."};constructor(e,t){let s=ot.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;s+=` Caused by ${e.className}`,super(s),this.errorMessage=s,this.code=t}}class rt{constructor(){this._queue=[],this.resolvePush=()=>{},this.resolveGet=()=>{},this.canGet=new Promise(e=>{this.resolveGet=e}),this.canPush=!0}async push(e){await this.canPush,this._queue.push(e),this.resolveGet(!0),this.canPush=new Promise(e=>{this.resolvePush=e})}async pop(){await this.canGet;const e=this._queue.pop();return this.resolvePush(!0),this.canGet=new Promise(e=>{this.resolveGet=e}),e}}var ct=s(87784),dt=s(48287).hp;class lt{static CONSTRUCTOR_ID=812830625;static classType="constructor";constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static async gzipIfSmaller(e,t){if(e&&t.length>512){const e=await new lt(t).toBytes();if(e.length<t.length)return e}return t}static gzip(e){return dt.from(e)}static ungzip(e){return dt.from((0,ct.inflate)(e))}async toBytes(){const e=dt.alloc(4);return e.writeUInt32LE(lt.CONSTRUCTOR_ID,0),dt.concat([e,Ue(await lt.gzip(this.data))])}static read(e){if(e.readInt(!1)!==lt.CONSTRUCTOR_ID)throw new Error("not equal");return lt.gzip(e.tgReadBytes())}static async fromReader(e){const t=e.tgReadBytes();return new lt(await lt.ungzip(t))}}class ut{static SIZE_OVERHEAD=12;static classType="constructor";constructor(e,t,s){this.msgId=e,this.seqNo=t,this.obj=s}}class ft{static CONSTRUCTOR_ID=1945237724;static classType="constructor";static MAXIMUM_SIZE=1044448;static MAXIMUM_LENGTH=100;constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],s=e.readInt();for(let n=0;n<s;n++){const s=e.readLong(),n=e.readInt(),a=e.readInt(),i=e.tellPosition(),o=e.tgReadObject();e.setPosition(i+a);const r=new ut(s,n,o);t.push(r)}return new ft(t)}}class gt{static CONSTRUCTOR_ID=4082920705;static classType="constructor";constructor(e,t,s){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=s,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),s=e.readInt(!1);return s===qe.RpcError.CONSTRUCTOR_ID?new gt(t,void 0,qe.RpcError.fromReader(e)):s===lt.CONSTRUCTOR_ID?new gt(t,(await lt.fromReader(e)).data):(e.seek(-4),new gt(t,e.read(),void 0))}}const pt=new Map([[gt.CONSTRUCTOR_ID,gt],[lt.CONSTRUCTOR_ID,lt],[ft.CONSTRUCTOR_ID,ft]]),ht={};for(const e of Object.values(qe))if("CONSTRUCTOR_ID"in e)ht[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))ht[t.CONSTRUCTOR_ID]=t;class mt{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(){let e;return e=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?this.stream.readUInt32LE(this.offset):this.stream.readInt32LE(this.offset),this.offset+=4,e}readLong(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return ue(this.read(Math.floor(e/8)),!0,t)}read(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1===e&&(e=this.stream.length-this.offset);const t=this.stream.slice(this.offset,this.offset+e);if(this.offset+=e,t.length!==e)throw Error(`No more data left to read (need ${e}, got ${t.length}: ${t.toString()}); last read ${this._last?.toString()}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,s;254===e?(s=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=s%4):(s=e,t=(s+1)%4);const n=this.read(s);return t>0&&(t=4-t,this.read(t)),n}tgReadString(){return this.tgReadBytes().toString("utf-8")}tgReadBool(){const e=this.readInt(!1);if(2574415285===e)return!0;if(3162085175===e)return!1;throw new Error(`Invalid boolean code ${e.toString(16)}`)}tgReadDate(){const e=this.readInt();return new Date(1e3*e)}tgReadObject(){const e=this.readInt(!1);let t=ht[e];if(void 0===t){if(2574415285===e)return!0;if(3162085175===e)return!1;if(481674261===e){const e=[],t=this.readInt();for(let s=0;s<t;s++)e.push(this.tgReadObject());return e}if(t=pt.get(e),void 0===t){this.seek(-4);const t=this.tellPosition(),s=new nt(e,this.read());throw this.setPosition(t),s}}return t.fromReader(this)}tgReadVector(){if(481674261!==this.readInt(!1))throw new Error("Invalid constructor code, vector was expected");const e=this.readInt(),t=[];for(let s=0;s<e;s++)t.push(this.tgReadObject());return t}tellPosition(){return this.offset}setPosition(e){this.offset=e}seek(e){this.offset+=e}}var _t=s(48287).hp;class yt{constructor(e){this._buffers=[e]}write(e){this._buffers.push(e)}getValue(){return _t.concat(this._buffers)}}var bt=s(48287).hp;const wt=new Error("HttpStream was closed");AbortSignal.timeout??=function(e){const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};class St{stream=[];canRead=Promise.resolve();constructor(e){this.isClosed=!0,this.disconnectedCallback=e}async readExactly(e){let t=bt.alloc(0);for(;;){const s=await this.read();if(t=bt.concat([t,s]),(e-=s.length)<=0)return t}}async read(){await this.canRead;const e=this.stream.shift();return 0===this.stream.length&&(this.canRead=new Promise((e,t)=>{this.resolveRead=e,this.rejectRead=t})),e}static getURL(e,t,s,n){return 443===t?`https://${e}:${t}/apiw1${s?"_test":""}${n?"_premium":""}`:`http://${e}:${t}/apiw1${s?"_test":""}${n?"_premium":""}`}async connect(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.stream=[],this.canRead=new Promise((e,t)=>{this.resolveRead=e,this.rejectRead=t}),this.url=St.getURL(t,e,s,n),await fetch(this.url,{method:"POST",body:bt.from([]),mode:"cors",signal:AbortSignal.timeout(1e4)}),this.isClosed=!1}write(e){if(this.isClosed||!this.url)throw this.handleDisconnect(),wt;return fetch(this.url,{method:"POST",body:e,mode:"cors",signal:AbortSignal.timeout(1e4)}).then(async e=>{if(this.isClosed)return void this.handleDisconnect();if(200!==e.status)throw wt;const t=await e.arrayBuffer();this.stream=this.stream.concat(bt.from(t)),this.resolveRead&&!this.isClosed&&this.resolveRead()}).catch(e=>{throw this.handleDisconnect(),e})}handleDisconnect(){this.disconnectedCallback?.(),this.rejectRead&&this.rejectRead()}close(){this.isClosed=!0,this.handleDisconnect(),this.disconnectedCallback=void 0}}let It;class vt{static LEVEL_MAP=new Map([["error",new Set(["error"])],["warn",new Set(["error","warn"])],["info",new Set(["error","warn","info"])],["debug",new Set(["error","warn","info","debug"])]]);constructor(e){It||(It=e||"debug"),this.colors={start:"%c",warn:"color : #ff00ff",info:"color : #ffff00",debug:"color : #00ffff",error:"color : #ff0000",end:""},this.messageFormat="[%t] [%l] - [%m]"}static setLevel(e){It=e}canSend(e){return!!It&&vt.LEVEL_MAP.get(It).has(e)}warn(e){this._log("warn",e,this.colors.warn)}info(e){this._log("info",e,this.colors.info)}debug(e){this._log("debug",e,this.colors.debug)}error(e){this._log("error",e,this.colors.error)}format(e,t){return this.messageFormat.replace("%t",(new Date).toISOString()).replace("%l",t.toUpperCase()).replace("%m",e)}_log(e,t,s){It&&this.canSend(e)&&console.log(this.colors.start+this.format(t,e),s)}}var Pt=s(48287).hp;const Ct=new Set(["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"]);class Mt{constructor(e,t){this._state=e,this._queue=[],this._pendingStates=[],this._ready=new Promise(e=>{this.setReady=e}),this._log=t}values(){return this._queue}clear(){this._queue=[],this.append(void 0)}append(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e&&Ct.has(e.request.className))if(s){for(let t=0;t<this._queue.length;t++)if(Ct.has(this._queue[t]?.request.className)){this._queue[t].after=e;break}}else for(let t=this._queue.length-1;t>=0;t--)if(Ct.has(this._queue[t]?.request.className)){e.after=this._queue[t];break}s?this._queue.unshift(e):this._queue.push(e),t&&this.setReady?.(!0),e&&1658238041!==e.request.CONSTRUCTOR_ID&&(this._pendingStates.push(e),e.promise?.catch(()=>{}).finally(()=>{this._pendingStates=this._pendingStates.filter(t=>t!==e)}))}prepend(e){e.reverse().forEach(e=>{this.append(e,!1,!0)}),this.setReady?.(!0)}extend(e){e.forEach(e=>{this.append(e,!1)}),this.setReady?.(!0)}async getBeacon(e){const t=new yt(Pt.alloc(0));if(e.data.length+ut.SIZE_OVERHEAD<=ft.MAXIMUM_SIZE){let s;return e.after&&(s=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId.toString()} to ${e.request.className||e.request.constructor.name}`),t.getValue()}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject?.(new Error("Request Payload is too big"))}async wait(){this._queue.length||(this._ready=new Promise(e=>{this.setReady=e}),await this._ready)}async get(){if(!this._queue[this._queue.length-1])return void(this._queue=this._queue.filter(Boolean));let e,t=new yt(Pt.alloc(0));const s=[];let n=0;for(;this._queue.length&&s.length<=ft.MAXIMUM_LENGTH;){const e=this._queue.shift();if(e)if(e.abortSignal?.aborted)e.reject?.(new Error("Request aborted"));else if(n+=e.data.length+ut.SIZE_OVERHEAD,n<=ft.MAXIMUM_SIZE){let n;e.after&&(n=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,n),this._log.debug(`Assigned msgId = ${e.msgId.toString()} to ${e.request.className||e.request.constructor.name}`),s.push(e)}else{if(s.length){this._queue.unshift(e);break}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject?.(new Error("Request Payload is too big")),n=0}}if(s.length){if(s.length>1){const n=Pt.alloc(8);n.writeUInt32LE(ft.CONSTRUCTOR_ID,0),n.writeInt32LE(s.length,4),e=Pt.concat([n,t.getValue()]),t=new yt(Pt.alloc(0));const a=await this._state.writeDataAsMessage(t,e,!1);for(const e of s)e.containerId=a}return e=t.getValue(),{batch:s,data:e}}}}var At=s(80129),Rt=s(48287).hp;const Tt=new At.eu,kt=new Error("WebSocket was closed");class Dt{constructor(e){this.client=void 0,this.closed=!0,this.stream=Rt.alloc(0),this.disconnectedCallback=e,this.timeout=3e3}async readExactly(e){let t=Rt.alloc(0);for(;;){const s=await this.read(e);if(t=Rt.concat([t,s]),!(e-=s.length))return t}}async read(e){if(this.closed)throw kt;if(await this.canRead,this.closed)throw kt;const t=this.stream.slice(0,e);return this.stream=this.stream.slice(e),0===this.stream.length&&(this.canRead=new Promise(e=>{this.resolveRead=e})),t}async readAll(){if(this.closed||!await this.canRead)throw kt;const e=this.stream;return this.stream=Rt.alloc(0),this.canRead=new Promise(e=>{this.resolveRead=e}),e}getWebSocketLink(e,t,s,n){return 443===t?`wss://${e}:${t}/apiws${s?"_test":""}${n?"_premium":""}`:`ws://${e}:${t}/apiws${s?"_test":""}${n?"_premium":""}`}connect(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.stream=Rt.alloc(0),this.canRead=new Promise(e=>{this.resolveRead=e}),this.closed=!1,this.website=this.getWebSocketLink(t,e,s,n),this.client=new WebSocket(this.website,"binary"),new Promise((e,s)=>{if(!this.client)return;let n,a=!1;this.client.onopen=()=>{this.receive(),e(this),a=!0,n&&clearTimeout(n)},this.client.onerror=e=>{console.error("WebSocket error",e),s(e),a=!0,n&&clearTimeout(n)},this.client.onclose=e=>{const{code:s,reason:i,wasClean:o}=e;1e3!==s&&console.error(`Socket ${t} closed. Code: ${s}, reason: ${i}, was clean: ${o}`),this.resolveRead?.(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback(),a=!0,n&&clearTimeout(n)},n=setTimeout(()=>{a||(s(new Error("WebSocket connection timeout")),this.resolveRead?.(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback(),this.client?.close(),this.timeout*=2,this.timeout=Math.min(this.timeout,3e4),n=void 0)},this.timeout),self.addEventListener("offline",()=>{this.close(),this.resolveRead?.(!1)})})}write(e){if(this.closed)throw kt;this.client?.send(e)}close(){this.client?.close(),this.closed=!0}receive(){this.client&&(this.client.onmessage=async e=>{await Tt.runExclusive(async()=>{const t=e.data instanceof ArrayBuffer?Rt.from(e.data):Rt.from(await new Response(e.data).arrayBuffer());this.stream=Rt.concat([this.stream,t]),this.resolveRead?.(!0)})})}}class Ut{constructor(e){let{ip:t,port:s,dcId:n,loggers:a,isPremium:i,isTestServer:o}=e;this._ip=t,this._port=s,this._dcId=n,this._log=a,this._isTestServer=o,this._isPremium=i,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new rt,this._recvArray=new rt,this.shouldLongPoll=!1,this.socket=new Dt(this.disconnectCallback.bind(this))}isConnected(){return this._connected}disconnectCallback(){this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this._isTestServer,this._isPremium),this._log.debug("Finished connecting"),await this._initConn()}async connect(){await this._connect(),this._connected=!0,this._sendTask||(this._sendTask=this._sendLoop()),this._recvTask=this._recvLoop()}disconnect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||this.socket.close())}async send(e){if(!this._connected)throw new Error("Not connected");await this._sendArray.push(e)}async recv(){for(;this._connected;){const e=await this._recvArray.pop();if(e)return e}throw new Error("Not connected")}async _sendLoop(){try{for(;this._connected;){const e=await this._sendArray.pop();if(!e)return void(this._sendTask=void 0);this._send(e)}}catch(e){this._log.info("The server closed the connection while sending")}}async _recvLoop(){let e;for(;this._connected;){try{if(e=await this._recv(),!e)throw new Error("no data received")}catch(e){return this._log.info("connection closed"),void this.disconnect()}await this._recvArray.push(e)}}async _initConn(){this._codec.tag&&await this.socket.write(this._codec.tag)}_send(e){const t=this._codec.encodePacket(e);this.socket.write(t)}_recv(){return this._codec.readPacket(this.socket)}toString(){return`${this._ip}:${this._port}/${this.constructor.name.replace("Connection","")}`}}class Et extends Ut{ObfuscatedIO=void 0;async _initConn(){this._obfuscation=new this.ObfuscatedIO(this),await this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}}class Bt{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}}class xt extends Ut{constructor(e){super(e),this.shouldLongPoll=!0,this.socket=new St(this.disconnectCallback.bind(this)),this.href=St.getURL(this._ip,this._port,this._isTestServer,this._isPremium)}send(e){return this.socket.write(e)}recv(){return this.socket.read()}async _connect(){this._log.debug("Connecting"),await this.socket.connect(this._port,this._ip,this._isTestServer,this._isPremium),this._log.debug("Finished connecting")}async connect(){await this._connect(),this._connected=!0}}var Vt=s(48287).hp;class Nt extends Bt{static tag=Vt.from("ef","hex");static obfuscateTag=Vt.from("efefefef","hex");constructor(e){super(e),this.tag=Nt.tag,this.obfuscateTag=Nt.obfuscateTag}encodePacket(e){const t=e.length>>2;let s;if(t<127){const e=Vt.alloc(1);e.writeUInt8(t,0),s=e}else s=Vt.concat([Vt.from("7f","hex"),ge(Y()(t),3)]);return Vt.concat([s,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=Vt.concat([await e.read(3),Vt.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}var Gt=s(48287).hp;class Ft{constructor(e,t){if(!Gt.isBuffer(e)||!Gt.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=function(e,t,s){if("AES-256-CTR".includes("ECB"))throw new Error("Not supported");return new re(t,s)}(0,e,t),this.decipher=function(e,t,s){if("AES-256-CTR".includes("ECB"))throw new Error("Not supported");return new re(t,s)}(0,e,t)}encrypt(e){return Gt.from(this.cipher.update(e))}decrypt(e){return Gt.from(this.decipher.update(e))}}var qt=s(48287).hp;class Ht{header=void 0;constructor(e){this.connection=e.socket;const t=this.initHeader(e.PacketCodecClass);this.header=t.random,this._encrypt=t.encryptor,this._decrypt=t.decryptor}initHeader(e){const t=[qt.from("50567247","hex"),qt.from("474554","hex"),qt.from("504f5354","hex"),qt.from("eeeeeeee","hex")];let s;for(;;)if(s=he(64),239!==s[0]&&!s.slice(4,8).equals(qt.alloc(4))){let e=!0;for(const n of t)if(n.equals(s.slice(0,4))){e=!1;break}if(e)break}s=s.toJSON().data;const n=qt.from(s.slice(8,56)).reverse(),a=qt.from(s.slice(8,40)),i=qt.from(s.slice(40,56)),o=qt.from(n.slice(0,32)),r=qt.from(n.slice(32,48)),c=new Ft(a,i),d=new Ft(o,r);return s=qt.concat([qt.from(s.slice(0,56)),e.obfuscateTag,qt.from(s.slice(60))]),s=qt.concat([qt.from(s.slice(0,56)),qt.from(c.encrypt(s).slice(56,64)),qt.from(s.slice(64))]),{random:s,encryptor:c,decryptor:d}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}class Lt extends Et{ObfuscatedIO=Ht;PacketCodecClass=Nt}class Ot{static disconnected=-1;static connected=1;static broken=0;constructor(e){this.state=e}}class jt{constructor(e){this.timeOffset=e}}var Wt=s(48287).hp;class zt{constructor(e,t){this.ige=new ee.gj(e,t)}decryptIge(e){return me(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=Wt.concat([e,he(16-t)])),me(this.ige.encrypt(e))}}var Kt=s(48287).hp;class $t{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.authKey=e,this._log=t,this._isCall=s,this._isOutgoing=n,this.timeOffset=0,this.salt=Y().zero,this.id=Y().zero,this._sequence=0,this._lastMsgId=Y().zero,this.msgIds=[],this.reset()}reset(){this.id=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return ue(he(8),!0,e)}(!0),this._sequence=0,this._lastMsgId=Y()(0),this.msgIds=[]}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,s){const n=this._isCall?128+(this._isOutgoing!==s?8:0):s?0:8,[a,i]=await Promise.all([ye(Kt.concat([t,e.slice(n,n+36)])),ye(Kt.concat([e.slice(n+40,n+76),t]))]),o=Kt.concat([a.slice(0,8),i.slice(8,24),a.slice(24,32)]);return this._isCall?{key:o,iv:Kt.concat([i.slice(0,4),a.slice(8,16),i.slice(24,28)])}:{key:o,iv:Kt.concat([i.slice(0,8),a.slice(8,24),i.slice(24,32)])}}async writeDataAsMessage(e,t,s,n){const a=this._getNewMsgId(),i=this._getSeqNo(s);let o;o=n?await lt.gzipIfSmaller(s,new qe.InvokeAfterMsg({msgId:n,query:{getBytes:()=>t}}).getBytes()):await lt.gzipIfSmaller(s,t);const r=Kt.alloc(4);r.writeInt32LE(i,0);const c=Kt.alloc(4);c.writeInt32LE(o.length,0);const d=fe(a,8);return e.write(Kt.concat([d,r,c])),e.write(o),a}async encryptMessageData(e){if(!this.authKey)throw new Error("Auth key unset");await this.authKey.waitForKey();const t=this.authKey.getKey();if(!t)throw new Error("Auth key unset");if(!(this.salt&&this.id&&t&&this.authKey.keyId))throw new Error("Unset params");if(this._isCall){const s=128+(this._isOutgoing?0:8),n=e.length;e=Kt.from(e),n%4!=0&&(e=Kt.concat([e,Kt.from(new Array(4-n%4).fill(32))]));const a=(await ye(Kt.concat([t.slice(88+s,88+s+32),Kt.from(e)]))).slice(8,24),{iv:i,key:o}=await this._calcKey(t,a,!0);return e=new Ft(o,i).encrypt(e),Kt.concat([a,e])}{const s=fe(this.salt,8),n=fe(this.id,8),a=he((-((e=Kt.concat([Kt.concat([s,n]),e])).length+12)%16+16)%16+12),i=(await ye(Kt.concat([t.slice(88,120),e,a]))).slice(8,24),{iv:o,key:r}=await this._calcKey(t,i,!0),c=ge(this.authKey.keyId,8);return Kt.concat([c,i,new zt(r,o).encryptIge(Kt.concat([e,a]))])}}async decryptMessageData(e){if(!this.authKey)throw new Error("Auth key unset");if(e.length<8)throw new at(e);if(e.length<0)throw new it("Server replied with negative length");if(e.length%4!=0&&!this._isCall)throw new it("Server replied with length not divisible by 4");if(!this._isCall){const t=ue(e.slice(0,8));if(!this.authKey.keyId||t.neq(this.authKey.keyId))throw new it("Server replied with an invalid auth key")}const t=this.authKey.getKey();if(!t)throw new it("Unset AuthKey");const s=this._isCall?e.slice(0,16):e.slice(8,24),n=this._isCall?128+(this._isOutgoing?8:0):0,{iv:a,key:i}=await this._calcKey(t,s,!1);if(this._isCall){const t=(e=e.slice(16)).length;e=Kt.concat([e,Kt.from(new Array(4-t%4).fill(0))]),e=(e=new Ft(i,a).decrypt(e)).slice(0,t)}else e=new zt(i,a).decryptIge(this._isCall?e.slice(16):e.slice(24));const o=this._isCall?await ye(Kt.concat([t.slice(88+n,88+n+32),e])):await ye(Kt.concat([t.slice(96,128),e]));if(!this._isCall&&!s.equals(o.slice(8,24)))throw new it("Received msg_key doesn't match with expected one");const r=new mt(e);if(this._isCall)return r.readInt(!1),r.read(e.length-4);{if(r.readLong(),!r.readLong().eq(this.id))throw new it("Server replied with a wrong session ID");const t=r.readLong();if(this.msgIds.includes(t.toString()))throw new it("Duplicate msgIds");this.msgIds.length>500&&this.msgIds.shift();const s=r.readInt(),n=r.readInt(),a=e.length-n;if(a<12||a>1024)throw new it("Server replied with the wrong message padding");const i=await r.tgReadObject();if(i?.className?.startsWith("Update")){const e=Math.floor(Date.now()/1e3),s=this.getMsgIdTimeLocal(t);if(s&&(s-e>30||e-s>300))throw new it("The message time is incorrect.")}return i&&!("errorCode"in i)&&this.msgIds.push(t.toString()),new ut(t,s,i)}}_getNewMsgId(){const e=Date.now()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let s=Y()(Math.floor(e)).shiftLeft(Y()(32)).or(Y()(t).shiftLeft(Y()(2)));return this._lastMsgId.greaterOrEquals(s)&&(s=this._lastMsgId.add(Y()(4))),this._lastMsgId=s,s}getMsgIdTimeLocal(e){return!this._lastMsgId.eq(0)&&e.shiftRight(Y()(32)).toJSNumber()-this.timeOffset}updateTimeOffset(e){const t=this._getNewMsgId(),s=this.timeOffset,n=Math.floor(Date.now()/1e3),a=e.shiftRight(Y()(32)).toJSNumber();return this.timeOffset=a-n,this.timeOffset!==s&&(this._lastMsgId=Y()(0),this._log.debug(`Updated time offset (old offset ${s}, bad ${t.toString()}, good ${e.toString()}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}var Jt=s(48287).hp;class Qt{constructor(e,t){this._state=new $t(void 0,t),this._connection=e}async send(e){let t=e.getBytes(),s=this._state._getNewMsgId();const n=fe(s,8),a=Jt.alloc(4);a.writeInt32LE(t.length,0);const i=Jt.concat([Jt.concat([Jt.alloc(8),n,a]),t]);if(await this._connection.send(i),t=await this._connection.recv(),t.length<8)throw new at(t);const o=new mt(t);if(o.readLong().neq(Y()(0)))throw new Error("Bad authKeyId");if(s=o.readLong(),s.eq(Y()(0)))throw new Error("Bad msgId");if(o.readInt()<=0)throw new Error("Bad length");return o.tgReadObject()}}var Xt=s(48287).hp;class Zt{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const s=new mt(t);this.auxHash=s.readLong(!1),s.read(4),this.keyId=s.readLong(!1)}async setKey(e){if(!e)return this._key=void 0,this.auxHash=void 0,this.keyId=void 0,void(this._hash=void 0);if(e instanceof Zt)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await _e(this._key);const t=new mt(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await Se(20)}getKey(){return this._key}async calcNewNonceHash(e,t){if(!this.auxHash)throw new Error("Auth key not set");const s=fe(e,32),n=Xt.alloc(1);n.writeUInt8(t,0);const a=Xt.concat([s,Xt.concat([n,ge(this.auxHash,8,!0)])]);return ue((await _e(a)).slice(4,20),!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&Xt.isBuffer(e.getKey())&&e.getKey()?.equals(this._key)}}class Yt{constructor(){this._pending=new Map}set(e,t){this._pending.set(e.toString(),t)}get(e){return this._pending.get(e.toString())}getAndDelete(e){const t=this.get(e);return this.delete(e),t}values(){return Array.from(this._pending.values())}delete(e){this._pending.delete(e.toString())}clear(){this._pending.clear()}}s(48287).hp;const es=[{fingerprint:Y()("-3414540481677951611"),n:Y()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537},{fingerprint:Y()("-5595554452916591101"),n:Y()("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),e:65537}].reduce((e,t)=>{let{fingerprint:s,...n}=t;return e.set(s.toString(),n),e},new Map);class ts{static gcd(e,t){for(;t.neq(Y().zero);){const s=t;t=e.remainder(t),e=s}return e}static factorize(e){if(e.remainder(2).equals(Y().zero))return{p:Y()(2),q:e.divide(Y()(2))};let t=Y().randBetween(Y()(1),e.minus(1));const s=Y().randBetween(Y()(1),e.minus(1)),n=Y().randBetween(Y()(1),e.minus(1));let a,i=Y().one,o=Y().one,r=Y().one,c=Y().zero,d=Y().zero;for(;i.eq(Y().one);){c=t;for(let n=0;Y()(n).lesser(o);n++)t=be(t,Y()(2),e).add(s).remainder(e);for(a=Y().zero;a.lesser(o)&&i.eq(Y().one);){d=t;const l=Y().min(n,o.minus(a));for(let n=0;Y()(n).lesser(l);n++)t=be(t,Y()(2),e).add(s).remainder(e),r=r.multiply(c.minus(t).abs()).remainder(e);i=ts.gcd(r,e),a=a.add(n)}o=o.multiply(2)}if(i.eq(e))for(;d=be(d,Y()(2),e).add(s).remainder(e),i=ts.gcd(c.minus(d).abs(),e),!i.greater(1););const l=i;return r=e.divide(i),l<r?{p:l,q:r}:{p:r,q:l}}}var ss=s(48287).hp;class ns{constructor(){this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}static resolved(e){const t=new ns;return t.resolve(e),t}}class as{constructor(e,t){this.containerId=void 0,this.msgId=void 0,this.request=e,this.data=e.getBytes(),this.after=void 0,this.result=void 0,this.abortSignal=t,this.finished=new ns,this.resetPromise()}isReady(){return!this.after||this.after.finished.promise}resetPromise(){this.reject?.(),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}var is=s(48287).hp;class os{static DEFAULT_OPTIONS={logger:void 0,retries:1/0,retriesToFallback:1,delay:2e3,retryMainConnectionDelay:1e4,shouldForceHttpTransport:!1,shouldAllowHttpTransport:!1,autoReconnect:!0,connectTimeout:void 0,authKeyCallback:void 0,updateCallback:void 0,autoReconnectCallback:void 0,isMainSender:void 0,onConnectionBreak:void 0,isExported:void 0,getShouldDebugExportedSenders:void 0};_isReconnectingToMain=!1;isConnecting=!1;_authenticated=!1;constructor(e,t){const s={...os.DEFAULT_OPTIONS,...t};this._connection=void 0,this._fallbackConnection=void 0,this._shouldForceHttpTransport=s.shouldForceHttpTransport,this._shouldAllowHttpTransport=s.shouldAllowHttpTransport,this._log=s.logger,this._dcId=s.dcId,this._senderIndex=s.senderIndex||0,this._retries=s.retries,this._retriesToFallback=s.retriesToFallback,this._delay=s.delay,this._retryMainConnectionDelay=s.retryMainConnectionDelay,this._authKeyCallback=s.authKeyCallback,this._updateCallback=s.updateCallback,this._autoReconnectCallback=s.autoReconnectCallback,this._isMainSender=Boolean(s.isMainSender),this._isExported=Boolean(s.isExported),this._onConnectionBreak=s.onConnectionBreak,this._isFallback=!1,this._getShouldDebugExportedSenders=s.getShouldDebugExportedSenders,this.userDisconnected=!1,this._userConnected=!1,this.isReconnecting=!1,this._disconnected=!0,this._sendLoopHandle=void 0,this._longPollLoopHandle=void 0,this._recvLoopHandle=void 0,this.authKey=e||new Zt,this._state=new $t(this.authKey,this._log),this._sendQueue=new Mt(this._state,this._log),this._sendQueueLongPoll=new Mt(this._state,this._log),this._pendingState=new Yt,this._pendingAck=new Set,this._lastAcks=[],this._handlers={[gt.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[ft.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[lt.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[qe.Pong.CONSTRUCTOR_ID]:this._handlePong.bind(this),[qe.BadServerSalt.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[qe.BadMsgNotification.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[qe.MsgDetailedInfo.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[qe.MsgNewDetailedInfo.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[qe.NewSessionCreated.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[qe.MsgsAck.CONSTRUCTOR_ID]:this._handleAck.bind(this),[qe.FutureSalts.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[qe.MsgsStateReq.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[qe.MsgResendReq.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[qe.MsgsAllInfo.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}logWithIndexCallback(e){var t=this;return function(){if(t._getShouldDebugExportedSenders&&t._getShouldDebugExportedSenders()){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];console[e](`[${t._isExported?`idx=${t._senderIndex} `:"M "}dcId=${t._dcId}]`,...n)}}}logWithIndex={debug:this.logWithIndexCallback("debug"),log:this.logWithIndexCallback("log"),warn:this.logWithIndexCallback("warn"),error:this.logWithIndexCallback("error")};getConnection(){return this._isFallback?this._fallbackConnection:this._connection}async connect(e,t,s){if(this.userDisconnected=!1,this._userConnected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._isFallback=this._shouldForceHttpTransport&&this._shouldAllowHttpTransport,this._connection=e,this._fallbackConnection=s;for(let e=0;e<this._retries+this._retriesToFallback;e++)try{e>=this._retriesToFallback&&this._shouldAllowHttpTransport&&(this._isFallback=!0,this.logWithIndex.warn("Using fallback connection"),this._log.warn("Using fallback connection")),this.logWithIndex.warn("Connecting..."),await this._connect(this.getConnection()),this.logWithIndex.warn("Connected!"),this._isExported||this._updateCallback?.(new Ot(Ot.connected));break}catch(t){this._isExported||0!==e||this._updateCallback?.(new Ot(Ot.disconnected)),this._log.error(`${this._isFallback?"HTTP":"WebSocket"} connection failed attempt: ${e+1}`),console.error(t),await Se(this._delay)}return this.isConnecting=!1,this._isFallback&&!this._shouldForceHttpTransport&&this.tryReconnectToMain(),!0}async tryReconnectToMain(){if(this.isConnecting||!this._isFallback||this._isReconnectingToMain||this.isReconnecting||this._shouldForceHttpTransport||this._isExported)await Se(this._retryMainConnectionDelay);else{this._log.debug("Trying to reconnect to main connection"),this._isReconnectingToMain=!0;try{await this._connection.connect(),this._log.info("Reconnected to main connection"),this.logWithIndex.warn("Reconnected to main connection"),this.isReconnecting=!0,this._fallbackConnection&&this._disconnect(this._fallbackConnection),await this.connect(this._connection,!0,this._fallbackConnection),this.isReconnecting=!1,this._isReconnectingToMain=!1}catch(e){this.isReconnecting=!1,this._isReconnectingToMain=!1,this._log.error(`Failed to reconnect to main connection, retrying in ${this._retryMainConnectionDelay}ms`),await Se(this._retryMainConnectionDelay),this.tryReconnectToMain()}}}isConnected(){return this._userConnected}disconnect(){this.userDisconnected=!0,this.logWithIndex.warn("Disconnecting...");const e=this.getConnection();e&&this._disconnect(e)}destroy(){this._sendQueue.clear()}send(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=new as(e,t);return s?this._sendQueueLongPoll.append(n):(this.logWithIndex.debug(`Send ${e.className}`),this._sendQueue.append(n)),n.promise}addStateToQueue(e){this._sendQueue.append(e)}async sendBeacon(e){if(!(this._userConnected&&this._fallbackConnection instanceof xt))throw new Error("Cannot send requests while disconnected");const t=new as(e,void 0),s=await this._sendQueue.getBeacon(t);if(!s)return;const n=await this._state.encryptMessageData(s);postMessage({type:"sendBeacon",data:n,url:this._fallbackConnection.href})}async _connect(e){if(e.isConnected()||(this._log.info("Connecting to {0}...".replace("{0}",e._ip)),await e.connect(),this._log.debug("Connection success!")),this.authKey.getKey())this._authenticated=!0,this._log.debug("Already have an auth key ...");else{const t=new Qt(e,this._log);this._log.debug("New auth_key attempt ...");const s=await async function(e,t){let s=he(16);const n=ue(s,!1,!0),a=await e.send(new qe.ReqPqMulti({nonce:n}));if(t.debug("Starting authKey generation step 1"),!(a instanceof qe.ResPQ))throw new it(`Step 1 answer was ${a}`);if(a.nonce.neq(n))throw new it("Step 1 invalid nonce from server");const i=ue(a.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:o,q:r}=ts.factorize(i),c=we(o),d=we(r);s=he(32);const l=ue(s,!0,!0),u=new qe.PQInnerData({pq:we(i),p:c,q:d,nonce:a.nonce,serverNonce:a.serverNonce,newNonce:l}).getBytes();if(u.length>144)throw new it("Step 1 invalid nonce from server");let f,g;for(const e of a.serverPublicKeyFingerprints)if(g=es.get(e.toString()),void 0!==g){f=e;break}if(void 0===f||void 0===g)throw new it("Step 2 could not find a valid key for fingerprints");const p=he(192-u.length),h=ss.concat([u,p]),m=ss.from(h).reverse();let _;for(let e=0;e<20;e++){const e=he(32),s=await ye(ss.concat([e,h])),n=ss.concat([m,s]),a=new zt(e,ss.alloc(32)).encryptIge(n),i=Ie(e,await ye(a)),o=ue(ss.concat([i,a]),!1,!1);if(!o.greaterOrEquals(g.n)){_=ge(be(o,Y()(g.e),g.n),256,!1,!1);break}t.debug("Aes key greater than RSA. retrying")}if(void 0===_)throw new it("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const y=await e.send(new qe.ReqDHParams({nonce:a.nonce,serverNonce:a.serverNonce,p:c,q:d,publicKeyFingerprint:f,encryptedData:_}));if(!(y instanceof qe.ServerDHParamsOk||y instanceof qe.ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${y}`);if(y.nonce.neq(a.nonce))throw new it("Step 2 invalid nonce from server");if(y.serverNonce.neq(a.serverNonce))throw new it("Step 2 invalid server nonce from server");if(y instanceof qe.ServerDHParamsFail){const e=ue(await _e(fe(l,32).slice(4,20)),!0,!0);if(y.newNonceHash.neq(e))throw new it("Step 2 invalid DH fail nonce from server")}if(!(y instanceof qe.ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${y.className}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:b,iv:w}=await async function(e,t){const s=fe(e,16),n=fe(t,32),[a,i,o]=await Promise.all([_e(le.concat([n,s])),_e(le.concat([s,n])),_e(le.concat([n,n]))]);return{key:le.concat([a,i.slice(0,12)]),iv:le.concat([i.slice(12,20),o,n.slice(0,4)])}}(a.serverNonce,l);if(y.encryptedAnswer.length%16!=0)throw new it("Step 3 AES block size mismatch");const S=new zt(b,w),I=S.decryptIge(y.encryptedAnswer),v=new mt(I),P=v.read(20),C=v.tgReadObject();if(!(C instanceof qe.ServerDHInnerData))throw new Error(`Step 3 answer was ${C}`);const M=await _e(C.getBytes());if(!P.equals(M))throw new it("Step 3 Invalid hash answer");if(C.nonce.neq(a.nonce))throw new it("Step 3 Invalid nonce in encrypted answer");if(C.serverNonce.neq(a.serverNonce))throw new it("Step 3 Invalid server nonce in encrypted answer");if(3!==C.g||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==C.dhPrime.toString("hex"))throw new it("Step 3 invalid dhPrime or g");const A=ue(C.dhPrime,!1,!1),R=ue(C.gA,!1,!1),T=C.serverTime-Math.floor(Date.now()/1e3),k=ue(he(256),!1,!1),D=be(Y()(C.g),k,A),U=be(R,k,A);if(R.lesserOrEquals(1))throw new it("Step 3 failed ga > 1 check");if(D.lesserOrEquals(1))throw new it("Step 3 failed gb > 1 check");if(R.greater(A.minus(1)))throw new it("Step 3 failed ga > dh_prime - 1 check");const E=Y()(2).pow(1984);if(!R.greaterOrEquals(E)||!R.lesserOrEquals(A.minus(E)))throw new it("Step 3 failed dh_prime - 2^{2048-64} < ga < 2^{2048-64} check");if(!D.greaterOrEquals(E)||!D.lesserOrEquals(A.minus(E)))throw new it("Step 3 failed dh_prime - 2^{2048-64} < gb < 2^{2048-64} check");const B=new qe.ClientDHInnerData({nonce:a.nonce,serverNonce:a.serverNonce,retryId:Y().zero,gB:we(D,!1)}).getBytes(),x=ss.concat([await _e(B),B]),V=S.encryptIge(x),N=await e.send(new qe.SetClientDHParams({nonce:a.nonce,serverNonce:a.serverNonce,encryptedData:V})),G=[qe.DhGenOk,qe.DhGenRetry,qe.DhGenFail];if(!(N instanceof G[0]||N instanceof G[1]||N instanceof G[2]))throw new Error(`Step 3.1 answer was ${N}`);const{name:F}=N.constructor;if(N.nonce.neq(a.nonce))throw new it(`Step 3 invalid ${F} nonce from server`);if(N.serverNonce.neq(a.serverNonce))throw new it(`Step 3 invalid ${F} server nonce from server`);const q=new Zt;await q.setKey(we(U));const H=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf(N.className),L=await q.calcNewNonceHash(l,H);if(N[`newNonceHash${H}`].neq(L))throw new it("Step 3 invalid new nonce hash");if(!(N instanceof qe.DhGenOk))throw new Error(`Step 3.2 answer was ${N.className}`);return t.debug("Finished authKey generation step 3"),{authKey:q,timeOffset:T}}(t,this._log);this._log.debug("Generated new auth_key successfully"),await this.authKey.setKey(s.authKey),this._state.timeOffset=s.timeOffset,this._isExported||this._updateCallback?.(new jt(this._state.timeOffset)),this._authKeyCallback&&await this._authKeyCallback(this.authKey,this._dcId)}this._userConnected=!0,this.isReconnecting=!1,this._sendLoopHandle||(this._log.debug("Starting send loop"),this._sendLoopHandle=this._sendLoop()),this._recvLoopHandle||(this._log.debug("Starting receive loop"),this._recvLoopHandle=this._recvLoop()),!this._longPollLoopHandle&&e.shouldLongPoll&&(this._log.debug("Starting long-poll loop"),this._longPollLoopHandle=this._longPollLoop()),this._log.info("Connection to %s complete!".replace("%s",e.toString()))}_disconnect(e){this._isExported||this._updateCallback?.(new Ot(Ot.disconnected)),void 0!==e?(this._log.info("Disconnecting from %s...".replace("%s",e.toString())),this._userConnected=!1,this._log.debug("Closing current connection..."),this.logWithIndex.warn("Disconnecting"),e.disconnect()):this._log.info("Not disconnecting (already have no connection)")}async _longPollLoop(){for(;this._userConnected&&!this.isReconnecting&&this._isFallback&&this.getConnection().shouldLongPoll;){await this._sendQueueLongPoll.wait();const e=await this._sendQueueLongPoll.get();if(this.isReconnecting||!this._isFallback)return void(this._longPollLoopHandle=void 0);if(!e)continue;let{data:t}=e;const{batch:s}=e;this._log.debug(`Encrypting ${s.length} message(s) in ${t.length} bytes for sending`),t=await this._state.encryptMessageData(t);try{await(this._fallbackConnection?.send(t))}catch(e){return this._log.error(e),this._log.info("Connection closed while sending data"),this._longPollLoopHandle=void 0,this.isSendingLongPoll=!1,void(this.userDisconnected||this.reconnect())}this.isSendingLongPoll=!1,this.checkLongPoll()}this._longPollLoopHandle=void 0}async _sendLoop(){for(this._sendQueue.prepend(this._pendingState.values()),this._pendingState.clear();this._userConnected&&!this.isReconnecting;){const e=()=>{if(this._pendingAck.size){const e=new as(new qe.MsgsAck({msgIds:Array(...this._pendingAck)}));this._sendQueue.append(e),this._lastAcks.push(e),this._lastAcks.length>=10&&this._lastAcks.shift(),this._pendingAck.clear()}};e(),this.logWithIndex.debug(`Waiting for messages to send... ${this.isReconnecting}`),this._log.debug(`Waiting for messages to send... ${this.isReconnecting}`),await this._sendQueue.wait(),this._isFallback&&this.send(new qe.HttpWait({maxDelay:0,waitAfter:0,maxWait:0})),e();const t=await this._sendQueue.get();if(this.logWithIndex.debug(`Got ${t?.batch.length} message(s) to send`),!t)continue;let{data:s}=t;const{batch:n}=t;for(const e of n)if(Array.isArray(e))for(const t of e)"request"===t.request.classType&&"HttpWait"!==t.request.className&&this._pendingState.set(t.msgId,t);else"request"===e.request.classType&&"HttpWait"!==e.request.className&&this._pendingState.set(e.msgId,e);if(this.isReconnecting)return this.logWithIndex.debug("Reconnecting :("),void(this._sendLoopHandle=void 0);this._log.debug(`Encrypting ${n.length} message(s) in ${s.length} bytes for sending`),this.logWithIndex.debug("Sending",n.map(e=>e.request.className)),s=await this._state.encryptMessageData(s);try{await this.getConnection().send(s)}catch(e){return this.logWithIndex.debug(`Connection closed while sending data ${e}`),this._log.error(e),this._log.info("Connection closed while sending data"),this._sendLoopHandle=void 0,void(this.userDisconnected||this.reconnect())}finally{for(const e of n)if(Array.isArray(e))for(const t of e)"HttpWait"===t.request.className&&e.resolve?.();else"HttpWait"===e.request.className&&e.resolve?.();this.logWithIndex.debug("Encrypted messages put in a queue to be sent"),this._log.debug("Encrypted messages put in a queue to be sent")}}this._sendLoopHandle=void 0}async _recvLoop(){let e,t;for(;this._userConnected&&!this.isReconnecting;){this._log.debug("Receiving items from the network..."),this.logWithIndex.debug("Receiving items from the network...");try{e=await this.getConnection().recv()}catch(e){return this.userDisconnected||(this._log.error(e),this._log.warn("Connection closed while receiving data"),this.reconnect()),void(this._recvLoopHandle=void 0)}try{t=await this._state.decryptMessageData(e)}catch(e){if(this.logWithIndex.debug(`Error while receiving items from the network ${e.toString()}`),e instanceof nt){this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining.length} bytes`);continue}if(e instanceof it){this._log.warn(`Security error while unpacking a received message: ${e.message}`);continue}return e instanceof at?(404===e.code?this._handleBadAuthKey():(this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`),this.reconnect()),void(this._recvLoopHandle=void 0)):(this._log.error("Unhandled error while receiving data"),this._log.error(e),this.reconnect(),void(this._recvLoopHandle=void 0))}try{await this._processMessage(t)}catch(e){e instanceof He?"AUTH_KEY_UNREGISTERED"!==e.errorMessage&&"SESSION_REVOKED"!==e.errorMessage&&"USER_DEACTIVATED"!==e.errorMessage||this._handleBadAuthKey(!0):(this._log.error("Unhandled error while receiving data"),this._log.error(e))}this.checkLongPoll()}this._recvLoopHandle=void 0}checkLongPoll(){!this.isSendingLongPoll&&this._isFallback&&(this.isSendingLongPoll=!0,this.send(new qe.HttpWait({maxDelay:500,waitAfter:150,maxWait:3e3}),void 0,!0))}_handleBadAuthKey(e){e&&this._isMainSender||(this._log.warn(`Broken authorization key for dc ${this._dcId}, resetting...`),this._isMainSender&&!this._isExported?this._updateCallback?.(new Ot(Ot.broken)):!this._isMainSender&&this._onConnectionBreak&&this._onConnectionBreak(this._dcId))}async _processMessage(e){if("MsgsAck"===e.obj.className)return;this.logWithIndex.debug(`Process message ${e.obj.className}`),this._pendingAck.add(e.msgId),this.getConnection().shouldLongPoll&&this._sendQueue.setReady?.(!0),e.obj=await e.obj;let t=this._handlers[e.obj.CONSTRUCTOR_ID];t||(t=this._handleUpdate.bind(this)),await t(e)}_popStates(e){const t=this._pendingState.getAndDelete(e);if(t)return[t];const s=[];for(const t of this._pendingState.values())t.containerId?.equals(e)&&s.push(t.msgId);if(s.length){const e=[];for(const t of s)e.push(this._pendingState.getAndDelete(t));return e}for(const t of this._lastAcks)if(t.msgId===e)return[t];return[]}_handleRPCResult(e){const t=e.obj,s=this._pendingState.getAndDelete(t.reqMsgId);if(this._log.debug(`Handling RPC result for message ${t.reqMsgId}`),s){if(t.error){const e=function(e,t){for(const[s,n]of st){const a=e.errorMessage.match(s);if(a)return new n({request:t,capture:2===a.length?parseInt(a[1],10):void 0})}return new He(e.errorMessage,t,e.errorCode)}(t.error,s.request);throw this._sendQueue.append(new as(new qe.MsgsAck({msgIds:[s.msgId]}))),s.reject?.(e),e}try{const e=new mt(t.body),n=s.request.readResult(e);this.logWithIndex.debug("Handling RPC result",n),s.resolve?.(n)}catch(e){throw s.reject?.(e),e}}else try{if(!(new mt(t.body).tgReadObject()instanceof qe.upload.File))throw new nt(0,is.alloc(0))}catch(e){if(e instanceof nt)return void this._log.info(`Received response without parent request: ${t.body}`);if(this._isFallback)return;throw e}}async _handleContainer(e){this._log.debug("Handling container");for(const t of e.obj.messages)await this._processMessage(t)}async _handleGzipPacked(e){this._log.debug("Handling gzipped data");const t=new mt(e.obj.data);e.obj=t.tgReadObject(),await this._processMessage(e)}_handleUpdate(e){2331323052===e.obj.SUBCLASS_OF_ID?(this._log.debug(`Handling update ${e.obj.className}`),this._isExported||this._updateCallback?.(e.obj)):this._log.warn(`Note: ${e.obj.className} is not an update, not dispatching it`)}_handlePong(e){const t=e.obj,s=this._state.updateTimeOffset(e.msgId);this._isExported||this._updateCallback?.(new jt(s)),this._log.debug(`Handling pong for message ${t.msgId}`);const n=this._pendingState.getAndDelete(t.msgId);n&&n.resolve?.(t)}_handleBadServerSalt(e){const t=e.obj;this._log.debug(`Handling bad salt for message ${t.badMsgId}`),this._state.salt=t.newServerSalt;const s=this._popStates(t.badMsgId);this._sendQueue.extend(s),this._log.debug(`${s.length} message(s) will be resent`)}_handleBadNotification(e){const t=e.obj,s=this._popStates(t.badMsgId);if(this._log.debug(`Handling bad msg ${JSON.stringify(t)}`),[16,17].includes(t.errorCode)){const t=this._state.updateTimeOffset(e.msgId);this._isExported||this._updateCallback?.(new jt(t)),this._log.info(`System clock is wrong, set time offset to ${t}s`)}else if(32===t.errorCode)this._state._sequence+=64;else{if(33!==t.errorCode){for(const e of s)e.reject(new ot(e.request,t.errorCode));return}this._state._sequence-=16}this._sendQueue.extend(s),this._log.debug(`${s.length} messages will be resent due to bad msg`)}_handleDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling detailed info for message ${t}`),this._pendingAck.add(t)}_handleNewDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling new detailed info for message ${t}`),this._pendingAck.add(t)}_handleNewSessionCreated(e){this._log.debug("Handling new session created"),this._state.salt=e.obj.serverSalt}_handleAck(){}_handleFutureSalts(e){this._log.debug(`Handling future salts for message ${e.msgId.toString()}`);const t=this._pendingState.getAndDelete(e.msgId);t&&t.resolve?.(e.obj)}_handleStateForgotten(e){this._sendQueue.append(new as(new qe.MsgsStateInfo({reqMsgId:e.msgId,info:String.fromCharCode(1).repeat(e.obj.msgIds)})))}_handleMsgAll(e){}reconnect(){this._userConnected&&!this.isReconnecting&&(this.isReconnecting=!0,Se(1e3).then(()=>{this.logWithIndex.log("Reconnecting..."),this._log.info("Started reconnecting"),this._reconnect()}))}async _reconnect(){const e=this._connection,t=this._fallbackConnection;this._log.debug("Closing current connection...");try{this.logWithIndex.warn("[Reconnect] Closing current connection..."),e&&this._disconnect(e),t&&this._disconnect(t)}catch(e){this._log.warn(e)}this._sendQueue.append(void 0),this._state.reset();const s=new e.constructor({ip:e._ip,port:e._port,dcId:e._dcId,loggers:e._log,isTestServer:e._isTestServer,isPremium:e._isPremium}),n=new this._fallbackConnection.constructor({ip:e._ip,port:e._port,dcId:e._dcId,loggers:e._log,isTestServer:e._isTestServer,isPremium:e._isPremium});await this.connect(s,!0,n),this.isReconnecting=!1,this._sendQueue.prepend(this._pendingState.values()),this._pendingState.clear(),this._autoReconnectCallback&&await this._autoReconnectCallback()}}var rs=s(48287).hp;const cs=rs.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),ds=rs.from("ffd9","hex");function ls(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e instanceof qe.User){if(e.self&&t)return new qe.InputPeerSelf;if(void 0===e.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new qe.InputPeerUser({userId:e.id,accessHash:e.accessHash})}if(e instanceof qe.Chat||e instanceof qe.ChatEmpty||e instanceof qe.ChatForbidden)return new qe.InputPeerChat({chatId:e.id});if(e instanceof qe.Channel){if(void 0===e.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new qe.InputPeerChannel({channelId:e.id,accessHash:e.accessHash})}return e instanceof qe.ChannelForbidden?new qe.InputPeerChannel({channelId:e.id,accessHash:e.accessHash}):(e instanceof qe.UserEmpty||function(e){throw new Error(`Cannot cast ${e.className} to any kind of InputPeer`)}(e),new qe.InputPeerEmpty)}function us(e){if(e.length<3||1!==e[0])return e;const t=rs.from(cs);return t[164]=e[1],t[166]=e[2],rs.concat([t,e.slice(3),ds])}function fs(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case 1:return{id:1,ipAddress:`zws1${t?"-1":""}.web.telegram.org`,port:443};case 2:return{id:2,ipAddress:`zws2${t?"-1":""}.web.telegram.org`,port:443};case 3:return{id:3,ipAddress:`zws3${t?"-1":""}.web.telegram.org`,port:443};case 4:return{id:4,ipAddress:`zws4${t?"-1":""}.web.telegram.org`,port:443};case 5:return{id:5,ipAddress:`zws5${t?"-1":""}.web.telegram.org`,port:443};default:throw new Error(`Cannot find the DC with the ID of ${e}`)}}class gs{}class ps extends gs{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._isTestServer=!1,this._entities=new Set}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get isTestServer(){return this._isTestServer}setDC(e,t,s,n){this._dcId=0|e,this._serverAddress=t,this._port=s,this._isTestServer=n}getAuthKey(e){return new Zt}setAuthKey(e,t){}async load(){}save(){}delete(){}}var hs=s(48287).hp;class ms extends ps{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,isTest:s}=this._sessionData,{ipAddress:n,port:a}=fs(e);this.setDC(e,n,a,s,!0),await Promise.all(Object.keys(t).map(async e=>{const s=Number(e),n=hs.from(t[s],"hex");this._authKeys[s]=new Zt,await this._authKeys[s].setKey(n)}))}setDC(e,t,s,n){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._dcId=e,this._serverAddress=t,this._port=s,this._isTestServer=n,delete this._authKeys[e],a||this._onUpdate()}getAuthKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._dcId;return this._authKeys[e]}setAuthKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._dcId;this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},isTest:this._isTestServer||void 0};return Object.keys(this._authKeys).forEach(t=>{const s=Number(t),n=this._authKeys[s];n?._key&&(e.keys[s]=n._key.toString("hex"))}),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}var _s=s(51072),ys=s(48287).hp;function bs(e,t){if(!ys.from([199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91]).equals(e)||![3,4,5,7].includes(t))throw new Error("Changing passwords unsupported")}function ws(e){return ys.concat([ys.alloc(256-e.length),e])}function Ss(e){return ge(e,256,!1)}function Is(e,t){const s=t.subtract(e);return!(s.lesser(Y()(0))||s.bitLength().toJSNumber()<1984||e.bitLength().toJSNumber()<1984||Math.floor((e.bitLength().toJSNumber()+7)/8)>256)}function vs(e,t){const s=Math.min(e.length,t.length);for(let n=0;n<s;n++)e[n]^=t[n];return e}async function Ps(e,t){const s=await ye(ys.concat([e.salt1,ys.from(t,"utf-8"),e.salt1])),n=await ye(ys.concat([e.salt2,s,e.salt2])),a=await function(e,t,s){return async function(e,t,s){const n=await crypto.subtle.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]);return ie.from(await crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:t,iterations:s},n,512))}(e,t,s)}(n,e.salt1,1e5);return ye(ys.concat([e.salt2,a,e.salt2]))}async function Cs(e,t){try{bs(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return Ss(be(Y()(e.g),ue(await Ps(e,t),!1),ue(e.p,!1)))}async function Ms(e,t){const s=e.currentAlgo;if(!(s instanceof qe.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow))throw new Error(`Unsupported password algorithm ${s?.className}`);const n=e.srp_B,a=e.srpId;if(!n||!a)throw new Error(`Undefined srp_b ${e.className}`);const i=await Ps(s,t),o=ue(s.p,!1),{g:r}=s,c=ue(n,!1);try{bs(s.p,r)}catch(e){throw new Error("bad /g in password")}if(!function(e,t){return e.greater(Y()(0))&&t.subtract(e).greater(Y()(0))}(c,o))throw new Error("bad b in check");const d=ue(i,!1),l=ws(s.p),u=Ss(Y()(r)),f=ws(n),g=be(Y()(r),d,o),p=pe(ue(await ye(ys.concat([l,u])),!1).multiply(g),o),{a:h,aForHash:m,u:_}=await(async()=>{for(;;){const e=ue(he(256),!1),t=be(Y()(r),e,o);if(Is(t,o)){const s=Ss(t),n=ue(await ye(ys.concat([s,f])),!1);if(n.greater(Y()(0)))return{a:e,aForHash:s,u:n}}}})(),y=pe(c.subtract(p),o);if(!Is(y,o))throw new Error("bad gB");const b=_.multiply(d),w=be(y,h.add(b),o),[S,I,v,P,C]=await Promise.all([ye(Ss(w)),ye(l),ye(u),ye(s.salt1),ye(s.salt2)]),M=await ye(ys.concat([vs(I,v),P,C,m,f,S]));return new qe.InputCheckPasswordSRP({srpId:a,A:ys.from(m),M1:M})}var As=s(48287).hp;let Rs=0;function Ts(){return Rs}function ks(){return Math.floor(Date.now()/1e3)+Rs}let Ds=function(e){return e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Spoiler="MessageEntitySpoiler",e.CustomEmoji="MessageEntityCustomEmoji",e.Timestamp="MessageEntityTimestamp",e.QuoteFocus="MessageEntityQuoteFocus",e.Unknown="MessageEntityUnknown",e}({});const Us=-1,Es="MESSAGE_DELETED";let Bs=function(e){return e[e.BlobUrl=0]="BlobUrl",e[e.Progressive=1]="Progressive",e[e.DownloadUrl=2]="DownloadUrl",e[e.Text=3]="Text",e}({});function xs(e,t){return e.reduce((e,s)=>(e[s[t]]=s,e),{})}function Vs(e,t){return e.reduce((e,s)=>{const[n,a]=t(s);return e[n]=a,e},{})}function Ns(e,t){return t.reduce((t,s)=>(t[s]=e[s],t),{})}function Gs(e,t){return t.reduce((t,s)=>(e[s]&&(t[s]=e[s]),t),{})}function Fs(e,t){const s=new Set(t.map(String));return Ns(e,Object.keys(e).filter(e=>!s.has(e)))}function qs(e){return Object.keys(e).reduce((t,s)=>{const n=s;return void 0!==e[n]&&(t[n]=e[n]),t},{})}function Hs(e){return e.filter(Boolean)}function Ls(e,t){const s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}var Os=s(55962);const js="SharedWorker"in globalThis,Ws=(Intl,new URL("tg://host").host,globalThis,(0,Os.isTauri)(),Boolean(globalThis.electron),"undefined"!=typeof WorkerGlobalScope&&globalThis.self instanceof WorkerGlobalScope?globalThis.self.name:void 0),zs=(Ws?Number(new URLSearchParams(Ws).get(i)):void 0)||(js?function(e){const t=new URL(e).searchParams.get(i),s=t?Number(t):1;return!s||Number.isNaN(s)||1===s?void 0:s}(globalThis.location.href):void 0),Ks=`tt-global_${zs||1}`;if("object"==typeof window){const e=new BroadcastChannel("tt-version");e.postMessage({version:"10.9.73"}),e.addEventListener("message",t=>{const{version:s}=t.data;s&&(-1===$s("10.9.73",s)&&window.location.reload(),1===$s("10.9.73",s)&&e.postMessage({version:"10.9.73"}))})}function $s(e,t){return e.startsWith(`${t}-`)?-1:t.startsWith(`${e}-`)?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function Js(e){return`${arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"":`data:${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/jpeg"};base64,`}${btoa(String.fromCharCode(...e))}`}function Qs(e){const{flags:t,CONSTRUCTOR_ID:s,SUBCLASS_OF_ID:n,className:a,classType:i,getBytes:o,...r}=e;return r}var Xs=s(48287).hp;const Zs=new BroadcastChannel(Ks);let Ys=[];const en=K(()=>{Zs.postMessage({type:"localDbUpdate",batchedUpdates:Ys}),Ys=[]},100);function tn(e){if(e instanceof Uint8Array)return Xs.from(e);if("object"==typeof e&&1===Object.keys(e).length&&"value"===Object.keys(e)[0])return Y()(e.value);if(Array.isArray(e))return e.map(tn);if("object"!=typeof e||!("CONSTRUCTOR_ID"in e))return e;const t=e.className.split(".").reduce((e,t)=>e[t],qe),s=Qs(e);return new t(Object.keys(s).reduce((e,t)=>(e[t]=tn(s[t]),e),{}))}function sn(e){return["localMessages","chats","users","messages","documents","stickerSets","photos","webDocuments","stories","commonBoxState","channelPtsById"].reduce((t,s)=>{const n=e?.[s]??{},a=Object.keys(n).reduce((e,t)=>{if("commonBoxState"===s||"channelPtsById"===s){const s=n;return e[t]=s[t],e}return e[t]=tn(n[t]),e},{});var i;return t[s]=(i=s,new Proxy(a,{get:(e,t,s)=>Reflect.get(e,t,s),set:(e,t,s)=>(Ys.push({name:i,prop:t,value:s}),en(),Reflect.set(e,t,s))})),t},{})}const nn=sn(),an=nn;function on(){Zs&&Zs.postMessage({type:"localDbUpdateFull",localDb:Object.keys(nn).reduce((e,t)=>(e[t]={...nn[t]},e),{})})}o&&(globalThis.getLocalDb=()=>nn);var rn=s(48287).hp;const cn={INT:0,BIGINT:Y()(0),STRING:""};function dn(e){const t=Number(e);return t>0?"user":t<-q?"channel":"chat"}function ln(e){const t=dn(e);return"user"===t?new qe.PeerUser({userId:xn(e,"user")}):"channel"===t?new qe.PeerChannel({channelId:xn(e,"channel")}):new qe.PeerChat({chatId:xn(e,"chat")})}function un(e,t){const s=dn(e);return"user"===s?new qe.InputPeerUser({userId:xn(e,"user"),accessHash:Y()(t)}):"channel"===s?new qe.InputPeerChannel({channelId:xn(e,"channel"),accessHash:Y()(t)}):new qe.InputPeerChat({chatId:xn(e,"chat")})}function fn(e,t){return t?new qe.InputUser({userId:xn(e,"user"),accessHash:Y()(t)}):new qe.InputUserEmpty}function gn(e,t){return t?new qe.InputChannel({channelId:xn(e,"channel"),accessHash:Y()(t)}):new qe.InputChannelEmpty}function pn(e){return Y()(e.slice(1))}function hn(e,t){if(e)return new qe.PaidReactionPrivacyAnonymous;if(t){const e=mn(t);if(e)return new qe.PaidReactionPrivacyPeer({peer:e})}return new qe.PaidReactionPrivacyDefault}function mn(e){const t=dn(e);let s;if("user"===t){if(s=an.users[e]?.accessHash,!s)return}else if("channel"===t&&(s=an.chats[e]?.accessHash,!s))return;return un(e,String(s))}function _n(e,t){return new qe.InputStickerSetID({id:Y()(e),accessHash:Y()(t)})}function yn(e){const t=an.documents[e.id];if(t)return new qe.InputDocument(Ns(t,["id","accessHash","fileReference"]))}function bn(e){const t=yn(e);if(t)return new qe.InputMediaDocument({id:t})}function wn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new qe.InputMediaPoll({poll:new qe.Poll({id:Y()(e.id),publicVoters:e.summary.isPublic,question:On(e.summary.question),answers:e.summary.answers.map(e=>{let{text:t,option:s}=e;return new qe.PollAnswer({text:On(t),option:qa(s)})}),quiz:e.summary.quiz,multipleChoice:e.summary.multipleChoice,closeDate:e.summary.closeDate,closePeriod:e.summary.closePeriod,closed:!!t||e.summary.closed}),correctAnswers:e.results.results?.filter(e=>e.isCorrect).map(e=>qa(e.option)),solution:e.results.solution,solutionEntities:e.results.solutionEntities?.map(Mn)})}function Sn(e){const{title:t,items:s}=e.todo,n=s.map(e=>new qe.TodoItem({id:e.id,title:On(e.title)})),a=new qe.TodoList({title:On(t),list:n,othersCanAppend:e.todo.othersCanAppend||void 0,othersCanComplete:e.todo.othersCanComplete||void 0});return new qe.InputMediaTodo({todo:a})}function In(){return ue(he(8),!0,!0)}function vn(){const e=he(8),t=rn.alloc(4);return t.writeUInt32LE(Math.floor(Date.now()/1e3),0),e.set(t,4),ue(e,!0,!0)}function Pn(){return ue(he(4),!0,!0).toJSNumber()}function Cn(e,t,s){return new qe.Message({id:e,peerId:ln(t),fromId:ln(t),media:s.media})}function Mn(e){const{type:t,offset:s,length:n}=e,a="userId"in e?an.users[e.userId]:void 0;switch(t){case Ds.Bold:return new qe.MessageEntityBold({offset:s,length:n});case Ds.Italic:return new qe.MessageEntityItalic({offset:s,length:n});case Ds.Underline:return new qe.MessageEntityUnderline({offset:s,length:n});case Ds.Strike:return new qe.MessageEntityStrike({offset:s,length:n});case Ds.Code:return new qe.MessageEntityCode({offset:s,length:n});case Ds.Pre:return new qe.MessageEntityPre({offset:s,length:n,language:e.language||""});case Ds.Blockquote:return new qe.MessageEntityBlockquote({offset:s,length:n});case Ds.TextUrl:return new qe.MessageEntityTextUrl({offset:s,length:n,url:e.url});case Ds.Url:return new qe.MessageEntityUrl({offset:s,length:n});case Ds.Hashtag:return new qe.MessageEntityHashtag({offset:s,length:n});case Ds.MentionName:return new qe.InputMessageEntityMentionName({offset:s,length:n,userId:new qe.InputUser({userId:Y()(a.id),accessHash:a.accessHash})});case Ds.Spoiler:return new qe.MessageEntitySpoiler({offset:s,length:n});case Ds.CustomEmoji:return new qe.MessageEntityCustomEmoji({offset:s,length:n,documentId:Y()(e.documentId)});default:return new qe.MessageEntityUnknown({offset:s,length:n})}}function An(e){const t=an.photos[e?.id];if(t)return new qe.InputPhoto(Ns(t,["id","accessHash","fileReference"]))}function Rn(e){let{phone:t,firstName:s,lastName:n}=e;return new qe.InputPhoneContact({clientId:Y()(1),phone:t,firstName:s,lastName:n})}function Tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new qe.ChatBannedRights({...e,untilDate:t})}function kn(e){return new qe.ChatAdminRights(e)}function Dn(e){const{shippingAddress:t}=e;return new qe.PaymentRequestedInfo({...e,shippingAddress:t?new qe.PostAddress(t):void 0})}function Un(e){switch(e){case"phoneNumber":return new qe.InputPrivacyKeyPhoneNumber;case"addByPhone":return new qe.InputPrivacyKeyAddedByPhone;case"lastSeen":return new qe.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new qe.InputPrivacyKeyProfilePhoto;case"forwards":return new qe.InputPrivacyKeyForwards;case"chatInvite":return new qe.InputPrivacyKeyChatInvite;case"phoneCall":return new qe.InputPrivacyKeyPhoneCall;case"phoneP2P":return new qe.InputPrivacyKeyPhoneP2P;case"voiceMessages":return new qe.InputPrivacyKeyVoiceMessages;case"bio":return new qe.InputPrivacyKeyAbout;case"birthday":return new qe.InputPrivacyKeyBirthday;case"gifts":return new qe.InputPrivacyKeyStarGiftsAutoSave;case"noPaidMessages":return new qe.InputPrivacyKeyNoPaidMessages}}function En(e){switch(e){case"spam":return new qe.InputReportReasonSpam;case"violence":return new qe.InputReportReasonViolence;case"childAbuse":return new qe.InputReportReasonChildAbuse;case"pornography":return new qe.InputReportReasonPornography;case"copyright":return new qe.InputReportReasonCopyright;case"fake":return new qe.InputReportReasonFake;case"geoIrrelevant":return new qe.InputReportReasonGeoIrrelevant;case"illegalDrugs":return new qe.InputReportReasonIllegalDrugs;case"personalDetails":return new qe.InputReportReasonPersonalDetails;default:return new qe.InputReportReasonOther}}function Bn(e){return new qe.DataJSON({data:JSON.stringify(e)})}function xn(e,t){if("user"===t)return Y()(e);const s=Number(e);return"channel"===t?Y()(-s-q):Y()(-1*s)}function Vn(e){return new qe.InputGroupCall({id:Y()(e.id),accessHash:Y()(e.accessHash)})}function Nn(e){let{id:t,accessHash:s}=e;return new qe.InputPhoneCall({id:Y()(t),accessHash:Y()(s)})}function Gn(e){if("stars"===e.type)return new qe.InputStorePaymentStarsTopup({stars:Y()(e.stars),currency:e.currency,amount:Y()(e.amount)});if("starsgift"===e.type)return new qe.InputStorePaymentStarsGift({userId:fn(e.user.id,e.user.accessHash),stars:Y()(e.stars),currency:e.currency,amount:Y()(e.amount)});if("giftcode"===e.type)return new qe.InputStorePaymentPremiumGiftCode({users:e.users.map(e=>fn(e.id,e.accessHash)),boostPeer:e.boostChannel?un(e.boostChannel.id,e.boostChannel.accessHash):void 0,currency:e.currency,amount:Y()(e.amount),message:e.message&&On(e.message)});const t=In();return"starsgiveaway"===e.type?new qe.InputStorePaymentStarsGiveaway({boostPeer:un(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map(e=>un(e.id,e.accessHash)),stars:Y()(e.stars),countriesIso2:e.countries,prizeDescription:e.prizeDescription,onlyNewSubscribers:e.isOnlyForNewSubscribers||void 0,winnersAreVisible:e.areWinnersVisible||void 0,untilDate:e.untilDate,currency:e.currency,amount:Y()(e.amount),users:e.users,randomId:t}):new qe.InputStorePaymentPremiumGiveaway({boostPeer:un(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map(e=>un(e.id,e.accessHash)),countriesIso2:e.countries,prizeDescription:e.prizeDescription,onlyNewSubscribers:e.isOnlyForNewSubscribers||void 0,winnersAreVisible:e.areWinnersVisible||void 0,untilDate:e.untilDate,currency:e.currency,amount:Y()(e.amount),randomId:t})}function Fn(e){return new qe.DisallowedGiftsSettings({disallowUnlimitedStargifts:e.shouldDisallowLimitedStarGifts,disallowLimitedStargifts:e.shouldDisallowUnlimitedStarGifts,disallowUniqueStargifts:e.shouldDisallowUniqueStarGifts,disallowPremiumGifts:e.shouldDisallowPremiumGifts})}function qn(e){switch(e.type){case"message":return new qe.InputInvoiceMessage({peer:un(e.chat.id,e.chat.accessHash),msgId:e.messageId});case"slug":return new qe.InputInvoiceSlug({slug:e.slug});case"stargiftResale":{const{peer:t,slug:s}=e;return new qe.InputInvoiceStarGiftResale({toId:un(t.id,t.accessHash),slug:s,ton:"TON"===e.currency||void 0})}case"stargift":{const{peer:t,shouldHideName:s,giftId:n,message:a,shouldUpgrade:i}=e;return new qe.InputInvoiceStarGift({peer:un(t.id,t.accessHash),hideName:s||void 0,giftId:Y()(n),message:a&&On(a),includeUpgrade:i})}case"stars":{const t=Gn(e.purpose);return new qe.InputInvoiceStars({purpose:t})}case"premiumGiftStars":{const{user:t,message:s,months:n}=e;return new qe.InputInvoicePremiumGiftStars({months:n,userId:fn(t.id,t.accessHash),message:s&&On(s)})}case"starsgiveaway":{const t=Gn(e.purpose);return new qe.InputInvoiceStars({purpose:t})}case"chatInviteSubscription":return new qe.InputInvoiceChatInviteSubscription({hash:e.hash});case"stargiftUpgrade":return new qe.InputInvoiceStarGiftUpgrade({stargift:Jn(e.inputSavedGift),keepOriginalDetails:e.shouldKeepOriginalDetails});case"stargiftTransfer":return new qe.InputInvoiceStarGiftTransfer({stargift:Jn(e.inputSavedGift),toId:un(e.recipient.id,e.recipient.accessHash)});default:{const s=Gn(e.purpose),n=(t=e.option,new qe.PremiumGiftCodeOption({users:t.users,months:t.months,currency:t.currency,amount:Y()(t.amount)}));return new qe.InputInvoicePremiumGiftCode({purpose:s,option:n})}}var t}function Hn(e){switch(e?.type){case"emoji":return new qe.ReactionEmoji({emoticon:e.emoticon});case"custom":return new qe.ReactionCustomEmoji({documentId:Y()(e.documentId)});case"paid":return new qe.ReactionPaid;default:return new qe.ReactionEmpty}}function Ln(e){return"collectible"===e.type?new qe.InputEmojiStatusCollectible({collectibleId:Y()(e.collectibleId),until:e.until}):e.documentId===A?new qe.EmojiStatusEmpty:new qe.EmojiStatus({documentId:Y()(e.documentId),until:e.until})}function On(e){return new qe.TextWithEntities({text:e.text,entities:e.entities?.map(Mn)||[]})}function jn(e){return new qe.InputBotAppID({id:Y()(e.id),accessHash:Y()(e.accessHash)})}function Wn(e){if("story"===e.type)return new qe.InputReplyToStory({peer:mn(e.peerId),storyId:e.storyId});if("message"===e.type){const{replyToMsgId:t,replyToTopId:s,replyToPeerId:n,quoteText:a,quoteOffset:i,monoforumPeerId:o}=e;return new qe.InputReplyToMessage({replyToMsgId:t,topMsgId:s,replyToPeerId:n?mn(n):void 0,monoforumPeerId:o?mn(o):void 0,quoteText:a?.text,quoteEntities:a?.entities?.map(Mn),quoteOffset:i})}}function zn(e){return e.currency===b?new qe.StarsAmount({amount:Y()(e.amount),nanos:e.nanos}):new qe.StarsTonAmount({amount:Y()(e.amount)})}function Kn(e){return new qe.SuggestedPost({price:e.price&&zn(e.price),scheduleDate:e.scheduleDate})}function $n(e){const t=[];if(e.allowedUsers?.length&&t.push(new qe.InputPrivacyValueAllowUsers({users:e.allowedUsers.map(e=>{let{id:t,accessHash:s}=e;return fn(t,s)})})),e.allowedChats?.length&&t.push(new qe.InputPrivacyValueAllowChatParticipants({chats:e.allowedChats.map(e=>{let{id:t,type:s}=e;return xn(t,"chatTypeBasicGroup"===s?"chat":"channel")})})),e.blockedUsers?.length&&t.push(new qe.InputPrivacyValueDisallowUsers({users:e.blockedUsers.map(e=>{let{id:t,accessHash:s}=e;return fn(t,s)})})),e.blockedChats?.length&&t.push(new qe.InputPrivacyValueDisallowChatParticipants({chats:e.blockedChats.map(e=>{let{id:t,type:s}=e;return xn(t,"chatTypeBasicGroup"===s?"chat":"channel")})})),e.shouldAllowPremium&&t.push(new qe.InputPrivacyValueAllowPremium),"allow"===e.botsPrivacy&&t.push(new qe.InputPrivacyValueAllowBots),"disallow"===e.botsPrivacy&&t.push(new qe.InputPrivacyValueDisallowBots),!e.isUnspecified)switch(e.visibility){case"everybody":t.push(new qe.InputPrivacyValueAllowAll);break;case"contacts":t.push(new qe.InputPrivacyValueAllowContacts);break;case"nonContacts":t.push(new qe.InputPrivacyValueDisallowContacts);break;case"nobody":t.push(new qe.InputPrivacyValueDisallowAll)}return t}function Jn(e){return"user"===e.type?new qe.InputSavedStarGiftUser({msgId:e.messageId}):new qe.InputSavedStarGiftChat({peer:un(e.chat.id,e.chat.accessHash),savedId:Y()(e.savedId)})}const Qn="phoneNumber";function Xn(e,t,s){const{initialMethod:n=Qn}=s;return"phoneNumber"===n?Yn(e,t,s):ea(e,t,s)}async function Zn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return await e.invoke(new qe.updates.GetState),!0}catch(e){if(e instanceof Error&&"Disconnect"===e.message||t)throw e;return!1}}async function Yn(e,t,s){let n,a,i,o=!1;for(;;)try{if("function"==typeof s.phoneNumber)try{n=await s.phoneNumber()}catch(n){if(n instanceof Error&&"RESTART_AUTH_WITH_QR"===n.message)return ea(e,t,s);throw n}else n=s.phoneNumber;const i=await ta(e,t,n,s.forceSMS);if(a=i.phoneCodeHash,o=i.isCodeViaApp,"string"!=typeof a)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof s.phoneNumber)throw e;s.onError(e)}let r,c=!1;for(;;)try{try{i=await s.phoneCode(o)}catch(n){if(n instanceof Error&&"RESTART_AUTH"===n.message)return Yn(e,t,s)}if(!i)throw new Error("Code is empty");const d=await e.invoke(new qe.auth.SignIn({phoneNumber:n,phoneCodeHash:a,phoneCode:i}));if(d instanceof qe.auth.AuthorizationSignUpRequired){c=!0,r=d.termsOfService;break}return d.user}catch(n){if(n instanceof He&&"SESSION_PASSWORD_NEEDED"===n.errorMessage)return sa(e,t,s);n instanceof Error?s.onError(n):console.warn("Unexpected error:",n)}if(c)for(;;)try{const[t,i]=await s.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:o}=await e.invoke(new qe.auth.SignUp({phoneNumber:n,phoneCodeHash:a,firstName:t,lastName:i||cn.STRING}));return r&&await e.invoke(new qe.help.AcceptTermsOfService({id:r.id})),o}catch(e){s.onError(e)}return s.onError(new Error("Auth failed")),Yn(e,t,s)}async function ea(e,t,s){let n=!1;const{apiId:a,apiHash:i}=t,o=(async()=>{for(;!n;){const t=await e.invoke(new qe.auth.ExportLoginToken({apiId:a,apiHash:i,exceptIds:s.accountIds?.map(e=>Y()(e))||[]}));if(!(t instanceof qe.auth.LoginToken))throw new Error("Unexpected");const{token:n,expires:o}=t;await Promise.race([s.qrCode({token:n,expires:o}),Se(1e3*(o-ks()))])}})(),r=new Promise(t=>{e.addEventHandler(e=>{e instanceof qe.UpdateLoginToken&&t()},{build:e=>e})});try{await Promise.race([r,o])}catch(n){if(n instanceof Error&&"RESTART_AUTH"===n.message)return await Yn(e,t,s);throw n}finally{n=!0}try{const t=await e.invoke(new qe.auth.ExportLoginToken({apiId:a,apiHash:i,exceptIds:s.accountIds?.map(e=>Y()(e))||[]}));if(t instanceof qe.auth.LoginTokenSuccess&&t.authorization instanceof qe.auth.Authorization)return t.authorization.user;if(t instanceof qe.auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const s=await e.invoke(new qe.auth.ImportLoginToken({token:t.token}));if(s instanceof qe.auth.LoginTokenSuccess&&s.authorization instanceof qe.auth.Authorization)return s.authorization.user}}catch(n){if(n instanceof He&&"SESSION_PASSWORD_NEEDED"===n.errorMessage)return sa(e,t,s);throw n}throw void 0}async function ta(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{const{apiId:a,apiHash:i}=t,o=await e.invoke(new qe.auth.SendCode({phoneNumber:s,apiId:a,apiHash:i,settings:new qe.CodeSettings}));if(!(o instanceof qe.auth.SentCode))throw Error("Unexpected SentCodeSuccess");if(!n||o.type instanceof qe.auth.SentCodeTypeSms)return{phoneCodeHash:o.phoneCodeHash,isCodeViaApp:o.type instanceof qe.auth.SentCodeTypeApp};const r=await e.invoke(new qe.auth.ResendCode({phoneNumber:s,phoneCodeHash:o.phoneCodeHash}));if(!(r instanceof qe.auth.SentCode))throw Error("Unexpected SentCodeSuccess");return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof qe.auth.SentCodeTypeApp}}catch(a){if(a instanceof He&&"AUTH_RESTART"===a.errorMessage)return ta(e,t,s,n);throw a}}async function sa(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(;;)try{const t=await e.invoke(new qe.account.GetPassword),a=await s.password(t.hint,n);if(!a)throw new Error("Password is empty");const i=await Ms(t,a),{user:o}=await e.invoke(new qe.auth.CheckPassword({password:i}));return o}catch(e){s.onError(e)}}class na{deferreds=[];priorityDeferreds=[];activeWorkers=0;constructor(e){this.maxWorkers=e}requestWorker(e){if(this.activeWorkers===this.maxWorkers){const t=new ns;return e?this.priorityDeferreds.push(t):this.deferreds.push(t),t.promise}return this.activeWorkers++,Promise.resolve()}releaseWorker(){this.queueLength?(this.priorityDeferreds.shift()||this.deferreds.shift()).resolve():this.activeWorkers--}get queueLength(){return this.deferreds.length+this.priorityDeferreds.length}}class aa{constructor(e){this.isUpload=e}}var ia=s(48287).hp;const oa=4096,ra=1048576;class ca{constructor(e){this.size=e,this.type=e&&e>self.maxBufferSize?"opfs":"memory"}async init(){if("opfs"===this.type){if(!FileSystemFileHandle?.prototype.createSyncAccessHandle)throw new Error("`createSyncAccessHandle` is not available. Cannot download files larger than 2GB.");const e=await navigator.storage.getDirectory(),t=await e.getDirectoryHandle("downloads",{create:!0});this.largeFile=await t.getFileHandle(Math.random().toString(),{create:!0}),this.largeFileAccessHandle=await this.largeFile.createSyncAccessHandle()}else this.buffer=this.size?ia.alloc(this.size):ia.alloc(0)}write(e,t){if("opfs"===this.type)this.largeFileAccessHandle.write(e,{at:t});else if(this.size)for(let s=0;s<e.length;s++){if(t+s>=this.buffer.length)return;this.buffer.writeUInt8(e[s],t+s)}else this.buffer=ia.concat([this.buffer,e])}async getData(){return"opfs"===this.type?this.largeFile.getFile():Promise.resolve(this.buffer)}}const da=Array(6).fill(void 0).map(()=>new na(10));async function la(e,t,s,n){let{partSizeKb:a,end:i=0}=s;const{fileSize:o,dcId:r,progressCallback:c,isPriority:d,start:l=0}=s,u="id"in t?t.id:void 0,f=function(){if(n){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];console.log(`⬇️ [${u?.toString()}/${s.dcId}]`,...t)}};f("Downloading file...");const g=Boolean(e.isPremium);o&&(i=i&&i<o?i:o-1);const p=i?i-l+1:void 0;a||(a=o?function(e){if(e<=65536)return 64;if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;if(e<=4194304e3)return 1024;throw new Error("File size too large")}(p||o):64);const h=1024*a,m=p?Math.ceil(p/h):1,_=!i,y=Boolean(o)&&o>=10485760&&!_;let b;if(h%oa!==0)throw new Error("The part size must be evenly divisible by 4096");e._log.info(`Downloading file in chunks of ${h} bytes`);const w=new ca(p),S=[];let I=l,v=!1,P=0;c&&c(P);let C=!1;for(await w.init();;){let s=h,a=!1;Math.floor(I/ra)!==Math.floor((I+s-1)/ra)&&(s=ra-I%ra,a=!0),I%oa===0&&s%oa===0||(a=!0);const o=ua(g,y);if(await da[o].requestWorker(d),b&&await b.promise,_&&(b=new ns),v){da[o].releaseWorker();break}const u=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];f(`[${o}/${r}]`,...t)};if(S.push((async d=>{for(;;){let f;try{let p=!1;n&&setTimeout(()=>{p||u(`❗️️ getSender took too long ${d}`)},8e3),f=await e.getSender(r,o,g),p=!0;let h=!1;n&&setTimeout(()=>{h||u(`❗️️ sender.send took too long ${d}`)},6e3);const _=await Promise.race([f.send(new qe.upload.GetFile({location:t,offset:Y()(d),limit:s,precise:a||void 0})),Se(6e4).then(()=>r===e.session.dcId?(u(`Download timed out ${d}`),Promise.reject(new Error("USER_CANCELED"))):(u(`Download timed out [not main] ${d}`),Promise.reject(new Error("SESSION_REVOKED"))))]);if(e.releaseExportedSender(f),_ instanceof qe.upload.FileCdnRedirect)throw new Error("CDN download not supported");if(h=!0,c){if(c.isCanceled)throw new Error("USER_CANCELED");P+=1/m,u(`⬇️️ ${100*P}%`),c(P)}return!i&&_.bytes.length<s&&(v=!0),da[o].releaseWorker(),b&&b.resolve(),void w.write(_.bytes,d-l)}catch(t){if(f&&!f.isConnected()){await Se(1e3);continue}if(t instanceof Je){t instanceof Qe&&!C&&(f?._updateCallback(new aa(!1)),C=!0),await Se(1e3*t.seconds);continue}throw u(`Ended not gracefully ${d}`),da[o].releaseWorker(),b&&b.resolve(),v=!0,f&&e.releaseExportedSender(f),t}}})(I)),I+=s,i&&I>i)break}return await Promise.all(S),w.getData()}function ua(e,t){const s=e?6:3;let n=0,a=1/0;for(let e=0;e<s;e++){const s=da[e];if(!s.queueLength)return e;if(!t&&s.queueLength<=5)return e;s.queueLength<=a&&(n=e,a=s.activeWorkers)}return n}var fa=s(48287).hp;const ga=Array(6).fill(void 0).map(()=>new na(10));var pa=s(48287).hp;const ha=131072,ma=["u","v","w","y","d","x","c","m","b","a","s","f","i","j"];class _a{static DEFAULT_OPTIONS={connection:Lt,fallbackConnection:xt,useIPV6:!1,timeout:10,requestRetries:5,connectionRetries:1/0,connectionRetriesToFallback:1,retryDelay:1e3,retryMainConnectionDelay:1e4,autoReconnect:!0,sequentialUpdates:!1,floodSleepLimit:60,deviceModel:void 0,systemVersion:void 0,appVersion:void 0,langCode:"en",langPack:"weba",systemLangCode:"en",baseLogger:"gramjs",useWSS:!1,additionalDcsDisabled:!1,dcId:2,isTestServerRequested:!1,shouldAllowHttpTransport:!1,shouldForceHttpTransport:!1,shouldDebugExportedSenders:!1};_exportedSenderPromises={};_exportedSenderRefCounter={};_waitingForAuthKey={};_exportedSenderReleaseTimeouts={};_loopStarted=!1;_isSwitchingDc=!1;_destroyed=!1;_connectedDeferred=new ns;isPremium=!1;_lastRequest=Date.now();constructor(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_a.DEFAULT_OPTIONS;if(!t||!s||!Number.isFinite(t))throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const a={..._a.DEFAULT_OPTIONS,...n};if(this.apiId=t,this.apiHash=s,this.defaultDcId=a.dcId||2,this._useIPV6=a.useIPV6,this._shouldForceHttpTransport=a.shouldForceHttpTransport,this._shouldAllowHttpTransport=a.shouldAllowHttpTransport,this._shouldDebugExportedSenders=a.shouldDebugExportedSenders,"string"==typeof a.baseLogger?this._log=new vt:this._log=a.baseLogger,"string"!=typeof e&&e){if(!(e instanceof gs))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new ps}this.session=e,this.floodSleepLimit=a.floodSleepLimit,this._eventBuilders=[],this._requestRetries=a.requestRetries,this._connectionRetries=a.connectionRetries,this._connectionRetriesToFallback=a.connectionRetriesToFallback,this._retryDelay=a.retryDelay||0,this._retryMainConnectionDelay=a.retryMainConnectionDelay||0,this._timeout=a.timeout,this._autoReconnect=a.autoReconnect,this._connection=a.connection,this._fallbackConnection=a.fallbackConnection,this._initWith=e=>new qe.InvokeWithLayer({layer:212,query:new qe.InitConnection({apiId:this.apiId,deviceModel:a.deviceModel||_s.type().toString()||"Unknown",systemVersion:a.systemVersion||_s.release().toString()||"1.0",appVersion:a.appVersion||"1.0",langCode:a.langCode,langPack:a.langPack,systemLangCode:a.systemLangCode,query:e,proxy:void 0})}),this._args=a}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new os(this.session.getAuthKey(),{logger:this._log,dcId:this.session.dcId,retries:this._connectionRetries,retriesToFallback:this._connectionRetriesToFallback,shouldForceHttpTransport:this._shouldForceHttpTransport,shouldAllowHttpTransport:this._shouldAllowHttpTransport,delay:this._retryDelay,retryMainConnectionDelay:this._retryMainConnectionDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),updateCallback:this._handleUpdate.bind(this),getShouldDebugExportedSenders:this.getShouldDebugExportedSenders.bind(this),isMainSender:!0}));const e=new this._connection({ip:this.session.serverAddress,port:this.session.port,dcId:this.session.dcId,loggers:this._log,isTestServer:this.session.isTestServer}),t=new this._fallbackConnection({ip:this.session.serverAddress,port:this.session.port,dcId:this.session.dcId,loggers:this._log,isTestServer:this.session.isTestServer});if(!await this._sender.connect(e,!1,t))return void(this._loopStarted||(this._updateLoop(),this._loopStarted=!0));this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new qe.help.GetConfig)),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._connectedDeferred.resolve(),this._isSwitchingDc=!1;const s=await this._borrowExportedSender(this.session.dcId,!1,void 0,0,this.isPremium);s&&this.releaseExportedSender(s)}async _initSession(){if(await this.session.load(),!this.session.serverAddress||this.session.serverAddress.includes(":")!==this._useIPV6){const e=fs(this.defaultDcId);this.session.setDC(this.defaultDcId,e.ipAddress,this._args.useWSS?443:80,this._args.isTestServerRequested)}}setPingCallback(e){this.pingCallback=e}async setForceHttpTransport(e){this._shouldForceHttpTransport=e,await this.disconnect(),this._sender=void 0,await this.connect()}async setAllowHttpTransport(e){this._shouldAllowHttpTransport=e,await this.disconnect(),this._sender=void 0,await this.connect()}setShouldDebugExportedSenders(e){this._shouldDebugExportedSenders=e}getShouldDebugExportedSenders(){return this._shouldDebugExportedSenders}async _updateLoop(){let e;const t=this._sender;if(!t)throw new Error("Sender is not initialized");for(;!this._destroyed;)if(await Se(3e3),t.isReconnecting||this._isSwitchingDc)e=void 0;else{try{const s=()=>{var e,s;if(!this._destroyed)return t.send(new qe.PingDelayDisconnect({pingId:Y()((e=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,e=Math.ceil(e),s=Math.floor(s),Math.floor(Math.random()*(s-e+1))+e)),disconnectDelay:6e4}))},n=Date.now(),a=e?n-e:void 0;if(!a||a<5e3)await ba(()=>ya(s,5e3),3,100);else{let e=setTimeout(()=>{this._handleUpdate(new Ot(Ot.disconnected)),e=void 0},1e3);await ya(s,3e3),e&&(clearTimeout(e),e=void 0),this._handleUpdate(new Ot(Ot.connected))}e=Date.now()}catch(s){if(console.warn(s),e=void 0,t.isReconnecting||this._isSwitchingDc)continue;if(this._destroyed)break;t.reconnect()}if(Date.now()-this._lastRequest>18e5){try{await(this.pingCallback?.())}catch(e){}e=void 0}}await this.disconnect()}async disconnect(){this._sender?.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map(e=>Object.values(e).map(e=>e?.then(e=>e?.disconnect()))).flat()),Object.values(this._exportedSenderReleaseTimeouts).forEach(e=>{Object.values(e).forEach(e=>{clearTimeout(e)})}),this._exportedSenderRefCounter={},this._exportedSenderPromises={},this._waitingForAuthKey={}}async destroy(){this._destroyed=!0;try{await this.disconnect(),this._sender?.destroy()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){if(!this._sender)throw new Error("Sender is not initialized");this._log.info(`Reconnecting to new data center ${e}`);const t=fs(e),s=this.session.isTestServer||this._args.isTestServerRequested;return this.session.setDC(e,t.ipAddress,t.port,s),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._isSwitchingDc=!0,await this.disconnect(),this._sender=void 0,this.connect()}_authKeyCallback(e,t){this.session.setAuthKey(e,t)}async _cleanupExportedSender(e,t){this.session.dcId!==e&&this.session.setAuthKey(void 0,e),this._shouldDebugExportedSenders&&console.log(`🧹 Cleanup idx=${t} dcId=${e}`);const s=await this._exportedSenderPromises[e][t];delete this._exportedSenderPromises[e][t],delete this._exportedSenderRefCounter[e][t],s?.disconnect()}async _cleanupExportedSenders(e){const t=Object.values(this._exportedSenderPromises[e]);t.length&&(this.session.dcId!==e&&this.session.setAuthKey(void 0,e),this._exportedSenderPromises[e]={},this._exportedSenderRefCounter[e]={},await Promise.all(t.map(async e=>{const t=await e;t?.disconnect()})))}async _connectSender(e,t,s){let n,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Boolean(e.authKey.getKey());if(!i)if(this._waitingForAuthKey[t]){await this._waitingForAuthKey[t];const s=this.session.getAuthKey(t);i=Boolean(e.authKey?.getKey()),i&&await e.authKey.setKey(s.getKey())}else this._waitingForAuthKey[t]=new Promise(e=>{n=e});const o=fs(t,i);for(;;)try{return await e.connect(new this._connection({ip:o.ipAddress,port:o.port,dcId:t,loggers:this._log,isTestServer:this.session.isTestServer,isPremium:!!i&&a}),!1,new this._fallbackConnection({ip:o.ipAddress,port:o.port,dcId:t,loggers:this._log,isTestServer:this.session.isTestServer,isPremium:!!i&&a})),this.session.dcId===t||e._authenticated||await navigator.locks.request("GRAMJS_AUTH_EXPORT",async()=>{this._log.info(`Exporting authorization for data center ${o.ipAddress}`);const s=await this.invoke(new qe.auth.ExportAuthorization({dcId:t})),n=this._initWith(new qe.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(n),e._authenticated=!0}),e._dcId=t,e.userDisconnected=!1,n&&(n(),delete this._waitingForAuthKey[t]),this._shouldDebugExportedSenders&&console.warn(`✅ Connected to exported sender idx=${s} dc=${t}`),e}catch(n){this._shouldDebugExportedSenders&&console.error(`☠️ ERROR! idx=${s} dcId=${t} ${n.message}`),console.error(n),await Se(1e3),e.disconnect()}}releaseExportedSender(e){const t=e._dcId,s=e._senderIndex;this._exportedSenderRefCounter[t]&&this._exportedSenderRefCounter[t][s]&&(this._exportedSenderRefCounter[t][s]-=1,this._exportedSenderRefCounter[t][s]<=0&&(this._exportedSenderReleaseTimeouts[t]||(this._exportedSenderReleaseTimeouts[t]={}),this._exportedSenderReleaseTimeouts[t][s]=setTimeout(()=>{this._shouldDebugExportedSenders&&console.log(`[CC] [idx=${s} dcId=${t}] 🚪 Release`),e.disconnect(),this._exportedSenderReleaseTimeouts[t][s]=void 0,this._exportedSenderPromises[t][s]=void 0},3e4)))}async _borrowExportedSender(e,t,s,n,a){const i=n||0;let o,r=!1;this._exportedSenderPromises[e]||(this._exportedSenderPromises[e]={},r=!0),this._exportedSenderRefCounter[e]||(this._exportedSenderRefCounter[e]={}),this._exportedSenderPromises[e][i]&&!t||(this._shouldDebugExportedSenders&&console.warn(`🕒 Connecting to exported sender idx=${i} dc=${e} `+(t?"(reconnect)":"")),this._exportedSenderRefCounter[e][i]=0,this._exportedSenderPromises[e][i]=this._connectSender(s||this._createExportedSender(e,i),e,n,a));try{if(o=await this._exportedSenderPromises[e][i],!o?.isConnected())return o?.isConnecting?(await Se(1e3),this._borrowExportedSender(e,!1,o,i,a)):this._borrowExportedSender(e,!0,o,i,a)}catch(t){return console.error(t),this._borrowExportedSender(e,!0,void 0,i,a)}return this._exportedSenderRefCounter[e][i]+=1,this._exportedSenderReleaseTimeouts[e]||(this._exportedSenderReleaseTimeouts[e]={}),this._exportedSenderReleaseTimeouts[e][i]&&(clearTimeout(this._exportedSenderReleaseTimeouts[e][i]),this._exportedSenderReleaseTimeouts[e][i]=void 0),r&&o.send(this._initWith(new qe.help.GetConfig)),o}_createExportedSender(e,t){return new os(this.session.getAuthKey(e),{logger:this._log,dcId:e,senderIndex:t,retries:this._connectionRetries,retriesToFallback:this._connectionRetriesToFallback,delay:this._retryDelay,retryMainConnectionDelay:this._retryMainConnectionDelay,shouldForceHttpTransport:this._shouldForceHttpTransport,shouldAllowHttpTransport:this._shouldAllowHttpTransport,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),isMainSender:e===this.session.dcId,isExported:!0,updateCallback:this._handleUpdate.bind(this),getShouldDebugExportedSenders:this.getShouldDebugExportedSenders.bind(this),onConnectionBreak:()=>this._cleanupExportedSender(e,t)})}getSender(e,t,s){return e?this._borrowExportedSender(e,void 0,void 0,t,s):Promise.resolve(this._sender)}downloadFile(e,t){return async function(e,t,s,n){const{dcId:a}=s;for(let i=0;i<5;i++)try{return await la(e,t,s,n)}catch(t){if(!(t instanceof He&&(t.errorMessage.startsWith("SESSION_REVOKED")||t.errorMessage.startsWith("CONNECTION_NOT_INITED"))&&i<4))throw t;await e._cleanupExportedSenders(a)}}(this,e,t,this._shouldDebugExportedSenders)}downloadMedia(e,t){let s;if(e instanceof qe.Message||e instanceof qe.StoryItem)s=e.media;else if(e instanceof qe.MessageService){const t=e.action;"photo"in t&&(s=t.photo)}else s=e;return s instanceof qe.MessageMediaWebPage&&s.webpage instanceof qe.WebPage&&(s=s.webpage.document||s.webpage.photo),s instanceof qe.MessageMediaPhoto||s instanceof qe.Photo?this._downloadPhoto(s,t):s instanceof qe.MessageMediaDocument||s instanceof qe.Document?this._downloadDocument(s,t):s instanceof qe.WebDocument||s instanceof qe.WebDocumentNoProxy?this._downloadWebDocument(s):void 0}downloadProfilePhoto(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=e.photo;if(!(s instanceof qe.UserProfilePhoto||s instanceof qe.ChatPhoto))return;const n=s.dcId,a=new qe.InputPeerPhotoFileLocation({peer:ls(e),photoId:s.photoId,big:t||void 0});return this.downloadFile(a,{dcId:n,isPriority:!0})}downloadStickerSetThumb(e){if(!e.thumbs?.length&&!e.thumbDocumentId)return;const t=e.thumbVersion;return e.thumbDocumentId?this.invoke(new qe.messages.GetCustomEmojiDocuments({documentId:[e.thumbDocumentId]})).then(e=>{const t=e[0];if(t&&!(t instanceof qe.DocumentEmpty))return this.downloadFile(new qe.InputDocumentFileLocation({id:t.id,accessHash:t.accessHash,fileReference:t.fileReference,thumbSize:""}),{fileSize:t.size.toJSNumber(),dcId:t.dcId})}):this.downloadFile(new qe.InputStickerSetThumb({stickerset:new qe.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}pickFileSize(e,t){if(!e?.length)return;if(!t)return e.reduce((e,t)=>"w"in t?e&&"w"in e&&e.w>t.w?e:t:e,void 0);let s;for(let n=ma.indexOf(t);n<ma.length;n++)if(s=e.find(e=>"type"in e&&e.type===ma[n]),s)return s}_downloadCachedPhotoSize(e){let t;return t=e instanceof qe.PhotoStrippedSize?us(e.bytes):e.bytes,t}_downloadPhoto(e,t){let s=e;if(e instanceof qe.MessageMediaPhoto&&e.photo instanceof qe.Photo&&(s=e.photo),!(s instanceof qe.Photo))return;const n="u"===t.sizeType||"v"===t.sizeType?s.videoSizes:[],a=this.pickFileSize([...n,...s.sizes],t.sizeType);if(!a||a instanceof qe.PhotoSizeEmpty||a instanceof qe.VideoSizeEmojiMarkup||a instanceof qe.VideoSizeStickerMarkup)return;if(a instanceof qe.PhotoCachedSize||a instanceof qe.PhotoStrippedSize)return this._downloadCachedPhotoSize(a);let i;return i=a instanceof qe.PhotoSizeProgressive?Math.max(...a.sizes):"size"in a?a.size:512,this.downloadFile(new qe.InputPhotoFileLocation({id:s.id,accessHash:s.accessHash,fileReference:s.fileReference,thumbSize:a.type}),{dcId:s.dcId,fileSize:i,progressCallback:t.progressCallback})}_downloadDocument(e,t){let s,n=e;if(n instanceof qe.MessageMediaDocument&&n.document instanceof qe.Document&&(n=n.document),n instanceof qe.Document){if(t.sizeType){if(s=this.pickFileSize([...n.thumbs||[],...n.videoThumbs||[]],t.sizeType),!s&&n.mimeType.startsWith("video/"))return;if(s&&(s instanceof qe.PhotoCachedSize||s instanceof qe.PhotoStrippedSize))return this._downloadCachedPhotoSize(s)}return this.downloadFile(new qe.InputDocumentFileLocation({id:n.id,accessHash:n.accessHash,fileReference:n.fileReference,thumbSize:s&&"type"in s?s.type:""}),{fileSize:s&&"size"in s?s.size:n.size.toJSNumber(),progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:n.dcId,workers:t.workers})}}async _downloadWebDocument(e){if(e instanceof qe.WebDocumentNoProxy){const t=await fetch(e.url).then(e=>e.arrayBuffer());return pa.from(t)}try{const t=[];let s=0;for(;;){const n=new qe.upload.GetWebFile({location:new qe.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:s,limit:ha}),a=await this._borrowExportedSender(this._config?.webfileDcId||4);if(!a)throw new Error("Failed to obtain sender");const i=await a.send(n);if(this.releaseExportedSender(a),s+=ha,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length<ha)break}return pa.concat(t)}catch(e){if(e instanceof He&&"WEBFILE_NOT_AVAILABLE"===e.errorMessage)return pa.alloc(0);throw e}}async downloadStaticMap(e,t,s,n,a,i,o,r){try{const c=[];let d=0;for(;;)try{const l=new qe.upload.GetWebFile({location:new qe.InputWebFileGeoPointLocation({geoPoint:new qe.InputGeoPoint({lat:s,long:t,accuracyRadius:r}),accessHash:e,w:n,h:a,zoom:i,scale:o}),offset:d,limit:ha}),u=await this._borrowExportedSender(4);if(!u)throw new Error("Failed to obtain sender");const f=await u.send(l);if(this.releaseExportedSender(u),d+=ha,!f.bytes.length)break;if(c.push(f.bytes),f.bytes.length<ha)break}catch(e){if(e instanceof Je){console.warn(`getWebFile: sleeping for ${e.seconds}s on flood wait`),await Se(1e3*e.seconds);continue}}return pa.concat(c)}catch(e){if(e instanceof He&&"WEBFILE_NOT_AVAILABLE"===e.errorMessage)return pa.alloc(0);throw e}}async invoke(e,t,s,n){if("request"!==e.classType)throw new Error("You can only invoke MTProtoRequests");const a=void 0!==t;let i=a?await this.getSender(t):this._sender;this._lastRequest=Date.now(),await this._connectedDeferred.promise;const o=new as(e,s);let r=0;for(r=0;r<this._requestRetries;r++){i.addStateToQueue(o);try{const e=await o.promise;return o.finished.resolve(),a&&this.releaseExportedSender(i),e}catch(e){if(e instanceof We||e instanceof He&&("RPC_CALL_FAIL"===e.errorMessage||"RPC_MCGET_FAIL"===e.errorMessage||e.errorMessage.match(/INTERDC_\d_CALL(_RICH)?_ERROR/)))this._log.warn(`Telegram is having internal issues ${e.constructor.name}`),await Se(2e3);else if(e instanceof Je||e instanceof Ze){if(!(e.seconds<=this.floodSleepLimit))throw o.finished.resolve(),a&&this.releaseExportedSender(i),e;this._log.info(`Sleeping for ${e.seconds}s on flood wait`),await Se(1e3*e.seconds)}else if(e instanceof $e||e instanceof Ye||e instanceof Ke){if(this._log.info(`Phone migrated to ${e.newDc}`),(e instanceof $e||e instanceof Ye)&&await Zn(this))throw o.finished.resolve(),a&&this.releaseExportedSender(i),e;await this._switchDC(e.newDc),a&&this.releaseExportedSender(i),i=void 0===t?this._sender:await this.getSender(t)}else if(e instanceof Xe)await o.isReady(),o.after=void 0;else if(e instanceof He&&"CONNECTION_NOT_INITED"===e.errorMessage)await this.disconnect(),await Se(2e3),await this.connect();else{if(!(e instanceof ze))throw o.finished.resolve(),a&&this.releaseExportedSender(i),e;if(!n)throw o.finished.resolve(),a&&this.releaseExportedSender(i),e}}o.resetPromise()}throw a&&this.releaseExportedSender(i),new Error(`Request was unsuccessful ${r} time(s)`)}async invokeBeacon(e,t){if("request"!==e.classType)throw new Error("You can only invoke MTProtoRequests");const s=void 0!==t,n=s?await this.getSender(t):this._sender;n.sendBeacon(e),s&&this.releaseExportedSender(n)}setIsPremium(e){this.isPremium=e}async getMe(){try{return(await this.invoke(new qe.users.GetUsers({id:[new qe.InputUserSelf]})))[0]}catch(e){this._log.warn("error while getting me"),this._log.warn(e)}}async loadConfig(){this._config||(this._config=await this.invoke(new qe.help.GetConfig))}async start(e,t){if(this.isConnected()||await this.connect(),t?.(),this.loadConfig(),await Zn(this,e.shouldThrowIfUnauthorized))return;const s={apiId:this.apiId,apiHash:this.apiHash};await async function(e,t,s){let n;var a;n="botAuthToken"in s?await async function(e,t,s){const{apiId:n,apiHash:a}=t,{botAuthToken:i}=s,{user:o}=await e.invoke(new qe.auth.ImportBotAuthorization({apiId:n,apiHash:a,botAuthToken:i}));return o}(e,t,s):"webAuthToken"in s&&s.webAuthToken?await async function(e,t,s){try{const{apiId:n,apiHash:a}=t,i=await e.invoke(new qe.auth.ImportWebTokenAuthorization({webAuthToken:s.webAuthToken,apiId:n,apiHash:a}));if(i instanceof qe.auth.Authorization)return i.user;throw new Error("SIGN_UP_REQUIRED")}catch(n){return n instanceof He&&"SESSION_PASSWORD_NEEDED"===n.errorMessage?sa(e,t,s,!0):(e._log.error(`Failed to login with web token: ${String(n)}`),s.webAuthTokenFailed(),Xn(e,t,{...s,webAuthToken:void 0}))}}(e,t,s):await Xn(e,t,s),e._log.info(`Signed in successfully as ${a=n,a instanceof qe.User?a.lastName&&a.firstName?`${a.firstName} ${a.lastName}`:a.firstName?a.firstName:a.lastName?a.lastName:"":a instanceof qe.Chat||a instanceof qe.Channel?a.title:""}`)}(this,s,e)}uploadFile(e){return async function(e,t,s){const{file:n,onProgress:a}=t,i=Boolean(e.isPremium),{name:o,size:r}=n,c=ue(he(8),!0,!0),d=r>10485760,l=function(){if(s){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];console.log(`⬆️ [${c.toString()}]`,...t)}};l("Uploading file...");const u=1024*function(e){if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;if(e<=4194304e3)return 512;throw new Error("File size too large")}(r),f=Math.floor((r+u-1)/u),g=ga.map(e=>{let{activeWorkers:t}=e;return t});let p=g.indexOf(Math.min(...g)),h=0;a&&a(h);let m=!1;const _=[];for(let t=0;t<f;t++){const o=p%(i?6:3);if(await ga[o].requestWorker(),a?.isCanceled){ga[o].releaseWorker();break}const r=function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];l(`[${o}]`,...t)},g=n.slice(t*u,(t+1)*u);_.push((async(t,n)=>{for(;;){let l;try{let a=!1;s&&setTimeout(()=>{a||r(`❗️️ getSender took too long j=${t}`)},8e3),l=await e.getSender(e.session.dcId,o,i),a=!0;let u=!1;const g=await n.arrayBuffer();s&&setTimeout(()=>{u||r(`❗️️ sender.send took too long j=${t}`)},6e3),await l.send(d?new qe.upload.SaveBigFilePart({fileId:c,filePart:t,fileTotalParts:f,bytes:fa.from(g)}):new qe.upload.SaveFilePart({fileId:c,filePart:t,bytes:fa.from(g)})),e.releaseExportedSender(l),u=!0}catch(s){if(r(`Upload part failed ${s?.toString()} j=${t}`),l&&!l.isConnected()){await Se(1e3);continue}if(s instanceof Je){s instanceof Qe&&!m&&(l?._updateCallback(new aa(!0)),m=!0),await Se(1e3*s.seconds);continue}throw ga[o].releaseWorker(),l&&e.releaseExportedSender(l),s}if(ga[o].releaseWorker(),a){if(a.isCanceled)throw new Error("USER_CANCELED");h+=1/f,r(100*h+"%"),a(h)}break}})(t,g)),p++}return await Promise.all(_),d?new qe.InputFileBig({id:c,parts:f,name:o}):new qe.InputFile({id:c,parts:f,name:o,md5Checksum:""})}(this,e,this._shouldDebugExportedSenders)}updateTwoFaSettings(e){return async function(e,t){let{isCheckPassword:s,currentPassword:n,newPassword:a,hint:i="",email:o,emailCodeCallback:r,onEmailCodeError:c}=t;if(!a&&!n)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(o&&(!r||!c))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const d=await e.invoke(new qe.account.GetPassword),l=d.newAlgo;if(l instanceof qe.PasswordKdfAlgoUnknown)throw new Error("Password algorithm is unknown");l.salt1=As.concat([l.salt1,he(32)]),!d.hasPassword&&n&&(n=void 0);const u=n?await Ms(d,n):new qe.InputCheckPasswordEmpty;if(s)await e.invoke(new qe.auth.CheckPassword({password:u}));else try{await e.invoke(new qe.account.UpdatePasswordSettings({password:u,newSettings:new qe.account.PasswordInputSettings({newAlgo:l,newPasswordHash:a?await Cs(l,a):As.alloc(0),hint:i,email:o,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof et))throw t;for(;;)try{const s=await r(t.codeLength);if(!s)throw new Error("Code is empty");await e.invoke(new qe.account.ConfirmPasswordEmail({code:s}));break}catch(e){c(e)}}}(this,e)}getTmpPassword(e,t){return async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;const n=await e.invoke(new qe.account.GetPassword);if(!n)return;const a=await Ms(n,t);return await e.invoke(new qe.account.GetTmpPassword({password:a,period:s}))}(this,e,t)}getCurrentPassword(e){return async function(e,t){const s=await e.invoke(new qe.account.GetPassword);if(s)return t?await Ms(s,t):new qe.InputCheckPasswordEmpty}(this,e)}addEventHandler(e,t){this._eventBuilders.push([t,e])}_handleUpdate(e){if(e instanceof qe.Updates||e instanceof qe.UpdatesCombined){const t=[];for(const s of[...e.users,...e.chats])t.push(s);this._processUpdate(e,t)}else e instanceof qe.UpdateShort?this._processUpdate(e.update,void 0):this._processUpdate(e,void 0)}_processUpdate(e,t){e._entities=t||[];const s={update:e};this._dispatchUpdate(s)}async _dispatchUpdate(e){for(const[t,s]of this._eventBuilders){const n=t.build(e.update);n&&await s(n)}}isConnected(){return!(!this._sender||!this._sender.isConnected())}}function ya(e,t){let s=!1;return Promise.race([e(),Se(t).then(()=>s?void 0:Promise.reject(new Error("TIMEOUT")))]).finally(()=>{s=!0})}async function ba(e,t,s){for(let n=0;n<t;n++)try{return await e()}catch(e){if(n===t-1)throw e;await Se(s)}}const wa=_a,Sa=60,Ia=3600,va=86400;function Pa(e,t,s){return e*Ia+t*Sa+s}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,s){if(s){const{type:t,...n}=s;super(e,{type:t}),Object.assign(this,n)}else super(e);this.name=t}});const Ca=e=>`#${e.toString(16).padStart(6,"0")}`;function Ma(e){return e.hasOwnProperty("userId")}function Aa(e){return e.hasOwnProperty("chatId")}function Ra(e,t){return"user"===t?e.toString():"channel"===t?e.add(q).negate().toString():e.negate().toString()}function Ta(e){return Ma(e)?Ra(e.userId,"user"):Aa(e)?Ra(e.chatId,"chat"):Ra(e.channelId,"channel")}function ka(e){const{color:t,backgroundEmojiId:s}=e;return{color:t,backgroundEmojiId:s?.toString()}}function Da(e){return e instanceof qe.EmojiStatus?{type:"regular",documentId:e.documentId.toString(),until:e.until}:e instanceof qe.EmojiStatusCollectible?{type:"collectible",collectibleId:e.collectibleId.toString(),documentId:e.documentId.toString(),title:e.title,slug:e.slug,patternDocumentId:e.patternDocumentId.toString(),centerColor:Ca(e.centerColor),edgeColor:Ca(e.edgeColor),patternColor:Ca(e.patternColor),textColor:Ca(e.textColor),until:e.until}:void 0}var Ua=s(48287).hp;const Ea="#111111DD",Ba="#E4D00A",xa={INVOKE:"#49DBF5",BEACON:"#F549DB",RESPONSE:"#6887F7",CONNECTING:"#E4D00A",CONNECTED:"#26D907","CONNECTING ERROR":"#D1191C","INVOKE ERROR":"#D1191C",UPDATE:"#0DD151","UNEXPECTED UPDATE":"#9C9C9C","UNEXPECTED RESPONSE":"#D1191C"},Va={PHONE_NUMBER_INVALID:"ErrorPhoneNumberInvalid",PHONE_CODE_INVALID:"ErrorCodeInvalid",PASSWORD_HASH_INVALID:"ErrorIncorrectPassword",PHONE_PASSWORD_FLOOD:"ErrorPasswordFlood",PHONE_NUMBER_BANNED:"ErrorPhoneBanned",EMAIL_UNCONFIRMED:"ErrorEmailUnconfirmed",EMAIL_HASH_EXPIRED:"ErrorEmailHashExpired",NEW_SALT_INVALID:"ErrorNewSaltInvalid",SRP_PASSWORD_CHANGED:"ErrorPasswordChanged",CODE_INVALID:"ErrorEmailCodeInvalid",PASSWORD_MISSING:"ErrorPasswordMissing"};function Na(e){if(e instanceof qe.Message||e instanceof qe.MessageService)return Ta(e.peerId)}function Ga(e){return e instanceof qe.DialogFilter||e instanceof qe.DialogFilterChatlist}function Fa(e){return String.fromCharCode(...e)}function qa(e){return Ua.from(e,"binary")}function Ha(e){const t="UNEXPECTED RESPONSE"===e?console.error:"INVOKE ERROR"===e||"UNEXPECTED UPDATE"===e?console.warn:console.log;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];t(`%cGramJS%c${e}`,`color: ${Ba}; background: ${Ea}; padding: 0.25rem; border-radius: 0.25rem;`,`color: ${xa[e]}; background: ${Ea}; padding: 0.25rem; border-radius: 0.25rem; margin-left: 0.25rem;`,...n)}function La(e){return e instanceof Error||(o&&console.warn("Unexpected error type",e),!1)}function Oa(e){let t;const s=e instanceof He?e.errorMessage:void 0;return e instanceof Je?t={key:"ErrorFloodTime",variables:{time:ja(e.seconds)}}:e instanceof tt?t={key:"ErrorPasswordFresh",variables:{time:ja(e.seconds)}}:e instanceof He&&(t={key:Va[e.errorMessage]}),t||(t=e.message?{key:"ErrorUnexpectedMessage",variables:{error:e.message}}:{key:"ErrorUnexpected"}),{messageKey:t,errorMessage:s,error:e}}function ja(e){if(e<Sa)return{key:"Seconds",variables:{count:e},options:{pluralValue:e}};if(e<Ia){const t=function(e){return(0,Math.ceil)(e/Sa)}(e);return{key:"Minutes",variables:{count:t},options:{pluralValue:t}}}if(e<va){const t=function(e){return(0,Math.ceil)(e/Ia)}(e);return{key:"Hours",variables:{count:t},options:{pluralValue:t}}}const t=function(e){return(0,Math.ceil)(e/va)}(e);return{key:"Days",variables:{count:t},options:{pluralValue:t}}}let Wa;function za(e){!function(e){Xa?Xa.push(e):Xa=[e],Ja&&!P.has(e["@type"])||(Ja=K($a,v,!0),Qa=Math.random()),Ja(Qa)}(e)}function Ka(e){Wa(e)}const $a=$(function(e){if(!Xa||e!==Qa)return;const t=Xa;Xa=void 0,t.forEach(Wa)});let Ja,Qa,Xa;String.fromCharCode(8205);const Za=/(?:\ud83c[\udd70\udd71\udd7e\udd7f]\ufe0f)|(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])(?:\u200d\u27a1\ufe0f)?|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f(?:\u200d\u27a1\ufe0f)?)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f(?:\u200d\u27a1\ufe0f)?|(?:\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2|\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u26d3\ufe0f\u200d\ud83d\udca5|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udf44\u200d\ud83d\udfeb|\ud83c\udf4b\u200d\ud83d\udfe9|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc26\u200d\ud83d\udd25|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83d\ude42\u200d\u2194\ufe0f|\ud83d\ude42\u200d\u2195\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddd1\u200d\ud83e\uddd2|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b|\ud83d\udc26\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|\ud83e\udef0|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c\udfc3|\ud83d\udeb6|\ud83e\uddce)(?:\ud83c[\udffb-\udfff])?(?:\u200d\u27a1\ufe0f)?|(?:\ud83c[\udf85\udfc2\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4\udeb5\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd\uddcf\uddd1-\udddd\udec3-\udec5\udef1-\udef8]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udc8e\udc90\udc92-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udedc-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude7c\ude80-\ude89\ude8f-\udec2\udec6\udece-\udedc\udedf-\udee9]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,Ya=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f?/gu,"🏳️‍⚧️"],[/\u26d3\u200d\u{1f4a5}/gu,"⛓️‍💥"],[/\u200d([\u2640\u2642])(?!\ufe0f)/gu,"$1"]],ei=100,ti=8*ei;function si(e){const t=e.matchAll(Za);let s=0,n=0;for(const e of t){if(e.index!==n)return!1;s++,n=e.index+e[0].length}return n===e.length&&s}function ni(e,t){if(e.text)return!t&&1===Object.keys(e).length&&!e.text.entities?.some(e=>e.type!==Ds.CustomEmoji)&&function(e){const t=function(e){if(!e.match(Za))return e;for(const[t,s]of Ya)e=e.replace(t,s);return e}(e).split("\n"),s=t.join("");if(s.length>ti)return!1;const n=si(s);if(!n||n>ei)return!1;let a=t.length;for(const e of t){const t=si(e);if(!1===t)return!1;t>a&&(a=t)}return a}(e.text.text)||void 0}const ai=/\b(?:(\d{1,2}):)?([0-5]?\d):([0-5]\d)\b/g;function ii(e){const t={text:e.text,entities:e.entities?.filter(e=>e.type!==Ds.Timestamp)||[]},s=t.text;for(const e of s.matchAll(ai)){const s=e[0],n=e[1],a=e[2],i=e[3],o=e.index??0,r=s.length,c=parseInt(a,10),d=parseInt(i,10);if(c>59||d>59)continue;let l;l=Pa(void 0!==n?parseInt(n,10):0,c,d);let u=!1;for(const e of t.entities)if(o<e.offset+e.length&&o+r>e.offset){u=!0;break}if(u)continue;const f={type:Ds.Timestamp,offset:o,length:r,timestamp:l};let g=!1;for(let e=0;e<t.entities.length;e++)if(o<t.entities[e].offset){t.entities.splice(e,0,f),g=!0;break}g||t.entities.push(f)}return t}function oi(e,t){let s=0;const n=new Array(t),a=e.length/t,i=e[0],o=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*a),c=((e[t-1]??i)+(e[t]??i)+(e[t+1]??o))/3;n[r]=c,s<c&&(s=c)}return{data:n,peak:s}}function ri(e){e instanceof qe.Message&&(e.media&&ci(e.media,e),e.replyTo instanceof qe.MessageReplyHeader&&e.replyTo.replyMedia&&ci(e.replyTo.replyMedia,e)),e instanceof qe.MessageService&&"photo"in e.action&&li(gi(e.action.photo,e)),e instanceof qe.SponsoredMessage&&e.photo&&li(e.photo)}function ci(e,t){e instanceof qe.MessageMediaDocument&&e.document&&ui(gi(e.document,t)),e instanceof qe.MessageMediaGame&&(e.game.document&&ui(gi(e.game.document,t)),li(gi(e.game.photo,t))),e instanceof qe.MessageMediaPhoto&&e.photo&&li(gi(e.photo,t)),e instanceof qe.MessageMediaInvoice&&(e.photo&&hi(gi(e.photo,t)),e.extendedMedia instanceof qe.MessageExtendedMedia&&ci(e.extendedMedia.media,t)),e instanceof qe.MessageMediaPaidMedia&&e.extendedMedia.forEach(e=>{e instanceof qe.MessageExtendedMedia&&ci(e.media,t)})}function di(e,t){if(e instanceof qe.StoryItem&&(e.media instanceof qe.MessageMediaPhoto&&e.media.photo&&li(fi(e.media.photo,t,e)),e.media instanceof qe.MessageMediaDocument&&(e.media.document instanceof qe.Document&&ui(fi(e.media.document,t,e)),e.media.altDocuments)))for(const s of e.media.altDocuments)ui(fi(s,t,e))}function li(e){e instanceof qe.Photo&&(an.photos[String(e.id)]=e)}function ui(e){e instanceof qe.Document&&(an.documents[String(e.id)]=e)}function fi(e,t,s){if(!(e instanceof qe.Document||e instanceof qe.Photo))return e;const n=e;return n.localRepairInfo={type:"story",peerId:t,id:s.id},n}function gi(e,t){if(!t?.peerId)return e;if(!(e instanceof qe.Document||e instanceof qe.Photo||e instanceof qe.WebDocument))return e;const s=e;return s.localRepairInfo={type:"message",peerId:Ta(t.peerId),id:t.id},s}function pi(e){if(e instanceof qe.UserEmpty)return;const t=Ra(e.id,"user"),s=an.users[t];e.photo instanceof qe.Photo&&li(e.photo),s&&!s.min&&e.min||(an.users[t]=e)}function hi(e){an.webDocuments[e.url]=e}const mi='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 {{width}} {{height}}" xml:space="preserve"><path fill-opacity="0.1" d="{{path}}" /></svg>',_i="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,";function yi(e){let t="M";const s=e.length;for(let n=0;n<s;n++){const s=e[n];s>=192?t+=_i[s-128-64]:(s>=128?t+=",":s>=64&&(t+="-"),t+=String(63&s))}return t+="z",t}const bi={w:100,h:100};function wi(e,t){if(!e||!e.length)return;const s=e.find(e=>e instanceof qe.PhotoStrippedSize);if(!s)return;const n=e.filter(e=>e instanceof qe.PhotoSize),{w:a,h:i}=n.length?n[n.length-1]:bi,{bytes:o}=s;return{dataUri:Js(t&&"image/jpeg"!==t?o:us(o),void 0,t),width:a,height:i}}function Si(e,t){const{w:s,h:n}=t;var a,i,o;return{dataUri:`data:image/svg+xml;utf8,${a=e.bytes,i=s,o=n,mi.replace("{{path}}",yi(a)).replace("{{width}}",String(i)).replace("{{height}}",String(o))}`,width:s,height:n}}function Ii(e,t){const s=e.sizes.filter(e=>e instanceof qe.PhotoSize||e instanceof qe.PhotoSizeProgressive).map(Ci);return{mediaType:"photo",id:String(e.id),thumbnail:wi(e.sizes),sizes:s,isSpoiler:t,date:e.date,...e.videoSizes&&{videoSizes:Hs(e.videoSizes.map(Pi)),isVideo:!0}}}function vi(e){return e.filter(e=>e instanceof qe.PhotoSize||e instanceof qe.PhotoSizeProgressive).map(Ci)}function Pi(e){if(!(e instanceof qe.VideoSize))return;const{videoStartTs:t,size:s,h:n,w:a,type:i}=e;return{videoStartTs:t,size:s,height:n,width:a,type:i}}function Ci(e){const{w:t,h:s,type:n}=e;return{width:t,height:s,type:n}}function Mi(e){if(!("usernames"in e&&e.usernames||"username"in e&&e.username))return;const t=[];return"username"in e&&e.username&&t.push({username:e.username,isActive:!0,isEditable:!0}),e.usernames&&e.usernames.forEach(e=>{let{username:s,active:n,editable:a}=e;t.push({username:s,...n&&{isActive:!0},...a&&{isEditable:!0}})}),t}function Ai(e){let t,s,n,a,i,o,r,c="none";const d=an.chats;return e.forEach(e=>{e instanceof qe.PrivacyValueAllowAll?t||="everybody":e instanceof qe.PrivacyValueAllowContacts?t||="contacts":e instanceof qe.PrivacyValueAllowCloseFriends?t||="closeFriends":e instanceof qe.PrivacyValueDisallowContacts?t||="nonContacts":e instanceof qe.PrivacyValueDisallowAll?t||="nobody":e instanceof qe.PrivacyValueAllowUsers?n=e.users.map(e=>Ra(e,"user")):e instanceof qe.PrivacyValueDisallowUsers?i=e.users.map(e=>Ra(e,"user")):e instanceof qe.PrivacyValueAllowChatParticipants?a=e.chats.map(e=>{const t=Ra(e,"chat"),s=Ra(e,"channel");return d[t]?t:s}):e instanceof qe.PrivacyValueDisallowChatParticipants?o=e.chats.map(e=>{const t=Ra(e,"chat"),s=Ra(e,"channel");return d[t]?t:s}):e instanceof qe.PrivacyValueAllowPremium?r=!0:e instanceof qe.PrivacyValueAllowBots?c="allow":e instanceof qe.PrivacyValueDisallowBots&&(c="disallow")}),t||(t="nobody",s=!0),{visibility:t,isUnspecified:s,allowUserIds:n||[],allowChatIds:a||[],blockUserIds:i||[],blockChatIds:o||[],shouldAllowPremium:r,botsPrivacy:c}}function Ri(e){const{text:t,entities:s}=e;return{text:t,entities:s.map(Ti)}}function Ti(e){const{className:t,offset:s,length:n}=e;return e instanceof qe.MessageEntityMentionName?{type:Ds.MentionName,offset:s,length:n,userId:Ra(e.userId,"user")}:e instanceof qe.MessageEntityTextUrl?{type:Ds.TextUrl,offset:s,length:n,url:e.url}:e instanceof qe.MessageEntityPre?{type:Ds.Pre,offset:s,length:n,language:e.language}:e instanceof qe.MessageEntityCustomEmoji?{type:Ds.CustomEmoji,offset:s,length:n,documentId:e.documentId.toString()}:e instanceof qe.MessageEntityBlockquote?{type:Ds.Blockquote,canCollapse:e.collapsed,offset:s,length:n}:{type:t,offset:s,length:n}}function ki(e){if("photoId"in e)return e.photoId.toString()}function Di(e){return{botId:Ra(e.botId,"user"),iconId:e.icon.toString(),description:e.description}}const Ui=30;function Ei(e,t,s){if(e instanceof qe.DocumentEmpty)return;const{mimeType:n,videoThumbs:a}=e,i=e.attributes.find(e=>e instanceof qe.DocumentAttributeSticker),o=e.attributes.find(e=>e instanceof qe.DocumentAttributeCustomEmoji);if(!i&&!o)return;const r=n===k,c=n===D,d=Boolean(o),l=d&&o.textColor,u=e.attributes.find(e=>e instanceof qe.DocumentAttributeImageSize),f=e.attributes.find(e=>e instanceof qe.DocumentAttributeVideo),g=u||f,p=i||o,h=(b=p?.stickerset,b instanceof qe.InputStickerSetID?{id:String(b.id),accessHash:String(b.accessHash)}:b instanceof qe.InputStickerSetShortName?{shortName:b.shortName}:{isMissing:!0}),m=p?.alt,_=Boolean(o?.free??!0)&&!s,y=e.thumbs&&e.thumbs.find(e=>e instanceof qe.PhotoCachedSize);var b;if(!(n!==D||self.isWebmSupported||y||e.thumbs&&e.thumbs.find(e=>e instanceof qe.PhotoSize)))return;const w=e.thumbs&&e.thumbs.find(e=>e instanceof qe.PhotoPathSize),S=y?function(e){const{w:t,h:s,bytes:n}=e;return{dataUri:Js(n,void 0,"image/webp"),width:t,height:s}}(y):w&&g?Si(w,g):void 0,I=e.thumbs&&vi(e.thumbs),{w:v,h:P}=y||g||{},C=!t&&a&&Hs(a?.filter(e=>e instanceof qe.VideoSize)).some(e=>{let{type:t}=e;return"f"===t});return{mediaType:"sticker",id:String(e.id),stickerSetInfo:h,emoji:m,isCustomEmoji:d,isLottie:r,isVideo:c,width:v,height:P,thumbnail:S,hasEffect:C,isFree:_,shouldUseTextColor:l,previewPhotoSizes:I}}function Bi(e){const{archived:t,installedDate:s,id:n,accessHash:a,title:i,thumbs:o,count:r,shortName:c,emojis:d,thumbDocumentId:l}=e,u=o?.some(e=>"s"===e.type),f=o?.some(e=>"a"===e.type),g=o?.some(e=>"v"===e.type),p=l&&String(l),h=u||f||g||Boolean(p);return{isArchived:t,isEmoji:d,installedDate:s,id:String(n),accessHash:String(a),title:i,hasStaticThumb:u,hasAnimatedThumb:f,hasVideoThumb:g,hasThumbnail:h,thumbCustomEmojiId:p,count:r,shortName:c}}function xi(e){const t=Bi(e.set);if(e instanceof qe.StickerSetNoCovered)return t;const s=Ni(e instanceof qe.StickerSetCovered?[e.cover]:e instanceof qe.StickerSetMultiCovered?e.covers:e.documents);return e instanceof qe.StickerSetFullCovered?{...t,stickers:s,packs:Vi(e.packs)}:{...t,covers:s}}function Vi(e){return e.reduce((e,t)=>{let{emoticon:s,documents:n}=t;return e[s]=n.map(e=>{const t=an.documents[String(e)];if(t)return Ei(t)}).filter(Boolean),e},{})}function Ni(e){return e.map(e=>{if(e instanceof qe.Document){const t=Ei(e);if(t)return an.documents[String(e.id)]=e,t}}).filter(Boolean)}function Gi(e,t){if(!(e instanceof qe.ReplyKeyboardMarkup||e instanceof qe.ReplyInlineMarkup))return;const s=e.rows.map(e=>{let{buttons:s}=e;return s.map(e=>{const{text:s}=e;return e instanceof qe.KeyboardButton?{type:"command",text:s}:e instanceof qe.KeyboardButtonUrl?e.url.includes("?startgroup=")?{type:"unsupported",text:s}:{type:"url",text:s,url:e.url}:e instanceof qe.KeyboardButtonCallback?e.requiresPassword?{type:"unsupported",text:s}:{type:"callback",text:s,data:Fa(e.data)}:e instanceof qe.KeyboardButtonRequestPoll?{type:"requestPoll",text:s,isQuiz:e.quiz}:e instanceof qe.KeyboardButtonRequestPhone?{type:"requestPhone",text:s}:e instanceof qe.KeyboardButtonBuy?t?{type:"receipt",receiptMessageId:t}:{type:"buy",text:s}:e instanceof qe.KeyboardButtonGame?{type:"game",text:s}:e instanceof qe.KeyboardButtonSwitchInline?{type:"switchBotInline",text:s,query:e.query,isSamePeer:e.samePeer}:e instanceof qe.KeyboardButtonUserProfile?{type:"userProfile",text:s,userId:e.userId.toString()}:e instanceof qe.KeyboardButtonSimpleWebView?{type:"simpleWebView",text:s,url:e.url}:e instanceof qe.KeyboardButtonWebView?{type:"webView",text:s,url:e.url}:e instanceof qe.KeyboardButtonUrlAuth?{type:"urlAuth",text:s,url:e.url,buttonId:e.buttonId}:e instanceof qe.KeyboardButtonCopy?{type:"copy",text:s,copyText:e.copyText}:{type:"unsupported",text:s}}).filter(Boolean)});return s.every(e=>!e.length)?void 0:{[e instanceof qe.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:s,...e instanceof qe.ReplyKeyboardMarkup&&{keyboardPlaceholder:e.placeholder,isKeyboardSingleUse:e.singleUse,isKeyboardSelective:e.selective}}}function Fi(e,t,s,n){const a={};return e instanceof qe.BotInlineMessageText?a.text={text:e.message,entities:e.entities?.map(Ti)}:e instanceof qe.BotInlineMessageMediaAuto?"photo"===t&&n instanceof qe.Photo?a.photo=Ii(n):"audio"===t&&s instanceof qe.Document?a.audio=mo(s):"video"===t&&s instanceof qe.Document?a.video=ho(s):"sticker"===t&&s instanceof qe.Document?a.sticker=Ei(s):"file"===t&&s instanceof qe.Document?a.document=yo(s):"gif"===t&&s instanceof qe.Document?a.video=ho(s):a.text={text:e.message,entities:e.entities?.map(Ti)}:e instanceof qe.BotInlineMessageMediaGeo?a.location={mediaType:"geo",geo:wo(e.geo)}:e instanceof qe.BotInlineMessageMediaVenue?a.location={mediaType:"venue",geo:wo(e.geo),title:e.title,address:e.address,provider:e.provider,venueId:e.venueId,venueType:e.venueType}:e instanceof qe.BotInlineMessageMediaContact?a.contact={mediaType:"contact",phoneNumber:e.phoneNumber,firstName:e.firstName,lastName:e.lastName,userId:"0"}:e instanceof qe.BotInlineMessageMediaInvoice&&(a.invoice={mediaType:"invoice",isTest:e.test,title:e.title,description:e.description,photo:Ro(e.photo),currency:e.currency,amount:e.totalAmount.toJSNumber()}),{content:a,replyMarkup:Gi(e.replyMarkup)||void 0}}function qi(e,t){const{id:s,type:n,title:a,description:i,url:o,thumb:r,content:c,sendMessage:d}=e;return{id:s,queryId:t,type:n,sendMessage:Fi(d,n),title:a,description:i,url:o,content:Ro(c),webThumbnail:Ro(r)}}function Hi(e,t){const{id:s,type:n,title:a,description:i,sendMessage:o,photo:r,document:c}=e;return{id:s,queryId:t,type:n,title:a,description:i,..."sticker"===n&&c instanceof qe.Document&&{sticker:Ei(c)},...r instanceof qe.Photo&&{photo:Ii(r)},..."gif"===n&&c instanceof qe.Document&&{gif:ho(c)},..."file"===n&&c instanceof qe.Document&&{document:yo(c)},..."audio"===n&&c instanceof qe.Document&&{audio:mo(c)},..."video"===n&&c instanceof qe.Document&&{video:ho(c)},sendMessage:Fi(o,n,c,r)}}function Li(e){return{id:e.botId.toString(),shouldRequestWriteAccess:e.requestWriteAccess,shortName:e.shortName,isForAttachMenu:e.showInAttachMenu,isForSideMenu:e.showInSideMenu,attachMenuPeerTypes:e.peerTypes&&(t=e.peerTypes,t.flatMap(e=>e instanceof qe.AttachMenuPeerTypeBotPM?["bots"]:e instanceof qe.AttachMenuPeerTypePM?["users"]:e instanceof qe.AttachMenuPeerTypeChat?["chats","groups"]:e instanceof qe.AttachMenuPeerTypeBroadcast?["channels"]:e instanceof qe.AttachMenuPeerTypeSameBotPM?["self"]:[])),icons:e.icons.map(Oi).filter(Boolean),isInactive:e.inactive,isDisclaimerNeeded:e.sideMenuDisclaimerNeeded};var t}function Oi(e){if(!(e.icon instanceof qe.Document))return;const t=yo(e.icon);return t?(ui(e.icon),{name:e.name,document:t}):void 0}function ji(e,t){const{description:s,descriptionPhoto:n,descriptionDocument:a,userId:i,commands:o,menuButton:r,privacyPolicyUrl:c,hasPreviewMedias:d,appSettings:l}=e,u=i&&Ra(i,"user"),f=n instanceof qe.Photo?Ii(n):void 0,g=a instanceof qe.Document?ho(a):void 0,p=o?.map(e=>zi(u||t,e));return{botId:u||t,description:s,gif:g,photo:f,menuButton:Ki(r),privacyPolicyUrl:c,commands:p?.length?p:void 0,hasPreviewMedia:d,appSettings:l&&Wi(l)}}function Wi(e){const t=e.placeholderPath&&yi(e.placeholderPath);return{backgroundColor:e.backgroundColor?Ca(e.backgroundColor):void 0,backgroundDarkColor:e.backgroundDarkColor?Ca(e.backgroundDarkColor):void 0,headerColor:e.headerColor?Ca(e.headerColor):void 0,headerDarkColor:e.headerDarkColor?Ca(e.headerDarkColor):void 0,placeholderPath:t}}function zi(e,t){return{botId:e,...Qs(t)}}function Ki(e){return e instanceof qe.BotMenuButton?{type:"webApp",text:e.text,url:e.url}:{type:"commands"}}function $i(e){if(e instanceof qe.BotAppNotModified)return;const{id:t,accessHash:s,title:n,description:a,shortName:i,photo:o,document:r}=e,c=o instanceof qe.Photo?Ii(o):void 0,d=r instanceof qe.Document?yo(r):void 0;return{id:t.toString(),accessHash:s.toString(),title:n,description:a,shortName:i,photo:c,document:d}}function Ji(e){return e instanceof qe.InlineQueryPeerTypeBotPM?"bots":e instanceof qe.InlineQueryPeerTypePM?"users":e instanceof qe.InlineQueryPeerTypeChat?"chats":e instanceof qe.InlineQueryPeerTypeMegagroup?"supergroups":e instanceof qe.InlineQueryPeerTypeBroadcast?"channels":e instanceof qe.InlineQueryPeerTypeSameBotPM?"self":void 0}function Qi(e){const{address:t,geoPoint:s}=e;return{address:t,geo:s&&wo(s)}}function Xi(e){const{timezoneId:t,weeklyOpen:s}=e;return{timezoneId:t,workHours:s.map(e=>{let{startMinute:t,endMinute:s}=e;return{startMinute:t,endMinute:s}})}}function Zi(e){const{title:t,description:s,sticker:n}=e;return{title:t,description:s,sticker:n&&Ei(n)}}function Yi(e){const{fullUser:{about:t,commonChatsCount:s,pinnedMsgId:n,botInfo:a,blocked:i,profilePhoto:o,voiceMessagesForbidden:r,hasScheduled:c,fallbackPhoto:d,personalPhoto:l,translationsDisabled:u,storiesPinnedAvailable:f,contactRequirePremium:g,businessWorkHours:p,businessLocation:h,businessIntro:m,birthday:_,personalChannelId:y,personalChannelMessage:b,sponsoredEnabled:w,stargiftsCount:S,botVerification:I,botCanManageEmojiStatus:v,settings:P,sendPaidMessagesStars:C,displayGiftsButton:M,disallowedGifts:A,starsRating:R,starsMyPendingRating:T,starsMyPendingRatingDate:k},users:D}=e,U=Ra(D[0].id,"user");return{bio:t,commonChatsCount:s,pinnedMessageId:n,isBlocked:Boolean(i),noVoiceMessages:r,hasPinnedStories:Boolean(f),isTranslationDisabled:u,profilePhoto:o instanceof qe.Photo?Ii(o):void 0,fallbackPhoto:d instanceof qe.Photo?Ii(d):void 0,personalPhoto:l instanceof qe.Photo?Ii(l):void 0,botInfo:a&&ji(a,U),isContactRequirePremium:g,shouldDisplayGiftsButton:M,disallowedGifts:A&&co(A),birthday:_&&ao(_),businessLocation:h&&Qi(h),businessWorkHours:p&&Xi(p),businessIntro:m&&Zi(m),personalChannelId:y&&Ra(y,"channel"),personalChannelMessageId:b,botVerification:I&&Di(I),areAdsEnabled:w,starGiftCount:S,starsRating:R&&io(R),starsMyPendingRating:T&&io(T),starsMyPendingRatingDate:k,isBotCanManageEmojiStatus:v,hasScheduledMessages:c,paidMessagesStars:C?.toJSNumber(),settings:eo(P)}}function eo(e){let{autoarchived:t,reportSpam:s,addContact:n,blockContact:a,registrationMonth:i,phoneCountry:o,nameChangeDate:r,photoChangeDate:c,chargePaidMessageStars:d}=e;return{isAutoArchived:Boolean(t),canReportSpam:Boolean(s),canAddContact:Boolean(n),canBlockContact:Boolean(a),registrationMonth:i,phoneCountry:o,nameChangeDate:r,photoChangeDate:c,chargedPaidMessageStars:d?.toJSNumber()}}function to(e){if(!(e instanceof qe.User))return;const{id:t,firstName:s,lastName:n,fake:a,scam:i,support:o,closeFriend:r,storiesUnavailable:c,storiesMaxId:d,bot:l,botActiveUsers:u,botVerificationIcon:f,botInlinePlaceholder:g,botAttachMenu:p,botCanEdit:h,sendPaidMessagesStars:m,username:_}=e,y=e.photo instanceof qe.UserProfilePhoto?Boolean(e.photo.hasVideo):void 0,b=e.photo&&ki(e.photo),w=(v=e).bot?"userTypeBot":v.deleted?"userTypeDeleted":"userTypeRegular",S=Mi(e),I=e.emojiStatus?Da(e.emojiStatus):void 0;var v;return{id:Ra(t,"user"),isMin:Boolean(e.min),fakeType:i?"scam":a?"fake":void 0,...e.self&&{isSelf:!0},isPremium:Boolean(e.premium),...e.verified&&{isVerified:!0},...r&&{isCloseFriend:!0},...o&&{isSupport:!0},...(e.contact||e.mutualContact)&&{isContact:!0},type:w,firstName:s,lastName:n,hasMainMiniApp:Boolean(e.botHasMainApp),canEditBot:h,..."userTypeBot"===w&&{canBeInvitedToGroup:!e.botNochats},...S&&{usernames:S},hasUsername:Boolean(_),phoneNumber:e.phone||"",noStatus:!e.status,...e.accessHash&&{accessHash:String(e.accessHash)},avatarPhotoId:b,emojiStatus:I,hasVideoAvatar:y,areStoriesHidden:Boolean(e.storiesHidden),maxStoryId:d,hasStories:Boolean(d)&&!c,...l&&g&&{botPlaceholder:g},...l&&p&&{isAttachBot:p},botActiveUsers:u,botVerificationIconId:f?.toString(),color:e.color&&ka(e.color),paidMessagesStars:m?.toJSNumber()}}function so(e){return!e||e instanceof qe.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof qe.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof qe.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof qe.UserStatusRecently?{type:"userStatusRecently",isReadDateRestrictedByMe:e.byMe}:e instanceof qe.UserStatusLastWeek?{type:"userStatusLastWeek",isReadDateRestrictedByMe:e.byMe}:{type:"userStatusLastMonth",isReadDateRestrictedByMe:e.byMe}}function no(e){const t={};return e.forEach(e=>{if("status"in e){const s=Ra(e.id,"user");t[s]=so(e.status)}}),t}function ao(e){return Qs(e)}function io(e){return{level:e.level,currentLevelStars:e.currentLevelStars.toJSNumber(),stars:e.stars.toJSNumber(),nextLevelStars:e.nextLevelStars?.toJSNumber()}}function oo(e){if(e instanceof qe.StarGiftUnique){const{id:t,num:s,ownerId:n,ownerName:a,title:i,attributes:o,availabilityIssued:r,availabilityTotal:c,slug:d,ownerAddress:l,giftAddress:u,resellAmount:f,releasedBy:g,resaleTonOnly:p,requirePremium:h,valueCurrency:m,valueAmount:_,giftId:y}=e;return{type:"starGiftUnique",id:t.toString(),number:s,ownerId:n&&Ta(n),ownerName:a,ownerAddress:l,attributes:o.map(ro).filter(Boolean),title:i,totalCount:c,issuedCount:r,slug:d,giftAddress:u,resellPrice:f&&f.map(e=>Or(e)).filter(Boolean),releasedByPeerId:g&&Ta(g),requirePremium:h,resaleTonOnly:p,valueCurrency:m,valueAmount:_?.toJSNumber(),regularGiftId:y.toString()}}const{id:t,limited:s,stars:n,availabilityRemains:a,availabilityTotal:i,convertStars:o,firstSaleDate:r,lastSaleDate:c,soldOut:d,birthday:l,upgradeStars:u,resellMinStars:f,title:g,availabilityResale:p,releasedBy:h,requirePremium:m,limitedPerUser:_,perUserTotal:y,perUserRemains:b}=e;ui(e.sticker);const w=Ei(e.sticker);return{type:"starGift",id:t.toString(),isLimited:s,sticker:w,stars:n.toJSNumber(),availabilityRemains:a,availabilityTotal:i,starsToConvert:o.toJSNumber(),firstSaleDate:r,lastSaleDate:c,isSoldOut:d,isBirthday:l,upgradeStars:u?.toJSNumber(),title:g,resellMinStars:f?.toJSNumber(),releasedByPeerId:h&&Ta(h),availabilityResale:p?.toJSNumber(),requirePremium:m,limitedPerUser:_,perUserTotal:y,perUserRemains:b}}function ro(e){if(e instanceof qe.StarGiftAttributeModel){const t=Ei(e.document);if(!t)return;return ui(e.document),{type:"model",name:e.name,rarityPercent:e.rarityPermille/10,sticker:t}}if(e instanceof qe.StarGiftAttributePattern){const t=Ei(e.document);if(!t)return;return ui(e.document),{type:"pattern",name:e.name,rarityPercent:e.rarityPermille/10,sticker:t}}if(e instanceof qe.StarGiftAttributeBackdrop){const{name:t,rarityPermille:s,centerColor:n,edgeColor:a,patternColor:i,textColor:o,backdropId:r}=e;return{type:"backdrop",backdropId:r,name:t,rarityPercent:s/10,centerColor:Ca(n),edgeColor:Ca(a),patternColor:Ca(i),textColor:Ca(o)}}if(e instanceof qe.StarGiftAttributeOriginalDetails){const{date:t,recipientId:s,message:n,senderId:a}=e;return{type:"originalDetails",date:t,recipientId:s&&Ta(s),message:n&&Ri(n),senderId:a&&Ta(a)}}}function co(e){const{disallowUnlimitedStargifts:t,disallowLimitedStargifts:s,disallowUniqueStargifts:n,disallowPremiumGifts:a}=e;return{shouldDisallowUnlimitedStarGifts:t,shouldDisallowLimitedStarGifts:s,shouldDisallowUniqueStarGifts:n,shouldDisallowPremiumGifts:a}}function lo(e){return e.map(e=>{switch(e.type){case"model":return new qe.StarGiftAttributeIdModel({documentId:Y()(e.documentId)});case"pattern":return new qe.StarGiftAttributeIdPattern({documentId:Y()(e.documentId)});case"backdrop":return new qe.StarGiftAttributeIdBackdrop({backdropId:e.backdropId});default:throw new Error(`Unknown attribute type: ${e.type}`)}})}function uo(e){if(!e)return;const{collectionId:t,title:s,icon:n,giftsCount:a,hash:i}=e;return n&&ui(n),{collectionId:t,title:s,icon:n&&Ei(n),giftsCount:a,hash:i.toString()}}function fo(e){let t={};if(e.media){const s="peerId"in e?e:void 0;t={...po(e.media,s)}}const s=e.media instanceof qe.MessageMediaUnsupported;if(e.message&&!s&&!t.sticker&&!t.pollId&&!t.todo&&!t.contact&&!t.video?.isRound){const s=ii(go(e.message,e.entities));t={...t,text:s}}return t}function go(e,t){return{text:e,...t&&{entities:t.map(Ti)}}}function po(e,t){ci(e,t);const s="ttlSeconds"in e?e.ttlSeconds:void 0,n=function(e){return e instanceof qe.MessageMediaDocument&&Boolean(!e.document&&e.voice)}(e);if(n)return{action:{mediaType:"action",type:"expired",isVoice:!0}};const a=function(e){return e instanceof qe.MessageMediaDocument&&Boolean(!e.document&&e.round)}(e);if(a)return{action:{mediaType:"action",type:"expired",isRoundVideo:!0}};const i=function(e){if(!(e instanceof qe.MessageMediaDocument&&e.document&&e.document instanceof qe.Document))return;const t=e.document.attributes.find(e=>e instanceof qe.DocumentAttributeAudio);if(!t||!t.voice)return;const{duration:s,waveform:n}=t;return{mediaType:"voice",id:String(e.document.id),size:e.document.size.toJSNumber(),duration:s,waveform:n?Array.from(n):void 0}}(e);if(i)return{voice:i,ttlSeconds:s};if("round"in e&&e.round){const t=_o(e);if(t)return{video:t,ttlSeconds:s}}if(void 0!==s)return;if(e instanceof qe.MessageMediaInvoice&&e.extendedMedia instanceof qe.MessageExtendedMedia)return po(e.extendedMedia.media,t);const o=function(e){if(e instanceof qe.MessageMediaDocument&&e.document&&e.document instanceof qe.Document)return Ei(e.document,e.nopremium)}(e);if(o)return{sticker:o};const r=function(e){if(e instanceof qe.MessageMediaPhoto&&e.photo&&e.photo instanceof qe.Photo)return Ii(e.photo,e.spoiler)}(e);if(r)return{photo:r};const c=_o(e),d=function(e){if(!(e instanceof qe.MessageMediaDocument&&e.altDocuments))return;const t=e.altDocuments.filter(e=>e instanceof qe.Document&&e.mimeType.startsWith("video")).map(t=>ho(t,{isSpoiler:e.spoiler})).filter(Boolean);return t.length?t:void 0}(e);if(c)return{video:c,altVideos:d};const l=function(e){if(!(e instanceof qe.MessageMediaDocument&&e.document&&e.document instanceof qe.Document))return;const t=e.document.attributes.find(e=>e instanceof qe.DocumentAttributeAudio);if(!t||t.voice)return;const s=e.document.thumbs&&e.document.thumbs.filter(e=>e instanceof qe.PhotoSize).map(e=>Ci(e));return{mediaType:"audio",id:String(e.document.id),fileName:Mo(e.document,"audio"),thumbnailSizes:s,size:e.document.size.toJSNumber(),...Ns(e.document,["mimeType"]),...Ns(t,["duration","performer","title"])}}(e);if(l)return{audio:l};const u=function(e){if(e instanceof qe.MessageMediaDocument&&e.document)return yo(e.document)}(e);if(u)return{document:u};const f=function(e){if(!(e instanceof qe.MessageMediaContact))return;const{firstName:t,lastName:s,phoneNumber:n,userId:a}=e;return{mediaType:"contact",firstName:t,lastName:s,phoneNumber:n,userId:Ra(a,"user")}}(e);if(f)return{contact:f};const g=function(e){if(e instanceof qe.MessageMediaPoll)return e.poll.id.toString()}(e);if(g)return{pollId:g};const p=function(e){if(e instanceof qe.MessageMediaToDo)return function(e,t){const{title:s,list:n}=e,a=n.map(Io),i=t?.map(e=>({itemId:e.id,completedBy:e.completedBy.toString(),completedAt:e.date}));return{mediaType:"todo",todo:{title:Ri(s),items:a,othersCanAppend:e.othersCanAppend,othersCanComplete:e.othersCanComplete},completions:i}}(e.todo,e.completions)}(e);if(p)return{todo:p};const h=function(e){if(!(e instanceof qe.MessageMediaWebPage)||e.webpage instanceof qe.WebPageNotModified)return;const{webpage:t,forceLargeMedia:s,forceSmallMedia:n,safe:a}=e;return{id:t.id.toString(),isSafe:a,mediaSize:n?"small":s?"large":void 0}}(e);if(h)return{webPage:h};const m=function(e){if(e instanceof qe.MessageMediaInvoice)return function(e){const{description:t,title:s,photo:n,test:a,totalAmount:i,currency:o,receiptMsgId:r,extendedMedia:c}=e,d=c instanceof qe.MessageExtendedMediaPreview?Ao(c):void 0;return{mediaType:"invoice",title:s,description:t,photo:Ro(n),receiptMessageId:r,amount:i.toJSNumber(),currency:o,isTest:a,extendedMedia:d}}(e)}(e);if(m)return{invoice:m};const _=function(e){return e instanceof qe.MessageMediaGeo?function(e){const t=wo(e.geo);return t&&{mediaType:"geo",geo:t}}(e):e instanceof qe.MessageMediaVenue?function(e){const{geo:t,title:s,provider:n,address:a,venueId:i,venueType:o}=e,r=wo(t);return r&&{mediaType:"venue",geo:r,title:s,provider:n,address:a,venueId:i,venueType:o}}(e):e instanceof qe.MessageMediaGeoLive?function(e){const{geo:t,period:s,heading:n}=e,a=wo(t);return a&&{mediaType:"geoLive",geo:a,period:s,heading:n}}(e):void 0}(e);if(_)return{location:_};const y=function(e){if(e instanceof qe.MessageMediaGame)return function(e){const{id:t,accessHash:s,shortName:n,title:a,description:i,photo:o,document:r}=e.game,c=o instanceof qe.Photo?Ii(o):void 0,d=r instanceof qe.Document?yo(r):void 0;return{mediaType:"game",id:t.toString(),accessHash:s.toString(),shortName:n,title:a,description:i,photo:c,document:d}}(e)}(e);if(y)return{game:y};const b=function(e){if(!(e instanceof qe.MessageMediaStory))return;const t=Ta(e.peer);return{mediaType:"storyData",id:e.id,peerId:t,...e.viaMention&&{isMention:!0}}}(e);if(b)return{storyData:b};const w=function(e){if(e instanceof qe.MessageMediaGiveaway)return function(e){const{channels:t,months:s,stars:n,quantity:a,untilDate:i,countriesIso2:o,onlyNewSubscribers:r,prizeDescription:c}=e,d=t.map(e=>Ra(e,"channel"));return{mediaType:"giveaway",channelIds:d,months:s,stars:n?.toJSNumber(),quantity:a,untilDate:i,countries:o,isOnlyForNewSubscribers:r,prizeDescription:c}}(e)}(e);if(w)return{giveaway:w};const S=function(e){if(e instanceof qe.MessageMediaGiveawayResults)return function(e){const{months:t,untilDate:s,onlyNewSubscribers:n,launchMsgId:a,unclaimedCount:i,winners:o,winnersCount:r,additionalPeersCount:c,prizeDescription:d,refunded:l,channelId:u}=e,f=o.map(e=>Ra(e,"user"));return{mediaType:"giveawayResults",months:t,untilDate:s,isOnlyForNewSubscribers:n,launchMessageId:a,channelId:Ra(u,"channel"),unclaimedCount:i,additionalPeersCount:c,isRefunded:l,prizeDescription:d,winnerIds:f,winnersCount:r}}(e)}(e);if(S)return{giveawayResults:S};const I=function(e){if(!(e instanceof qe.MessageMediaPaidMedia))return;const{starsAmount:t,extendedMedia:s}=e,n=s[0]instanceof qe.MessageExtendedMedia;return n?{mediaType:"paidMedia",starsAmount:t.toJSNumber(),isBought:n,extendedMedia:To(s)}:{mediaType:"paidMedia",starsAmount:t.toJSNumber(),extendedMedia:s.filter(e=>e instanceof qe.MessageExtendedMediaPreview).map(e=>Ao(e))}}(e);return I?{paidMedia:I}:void 0}function ho(e,t){if(e instanceof qe.DocumentEmpty)return;const{isSpoiler:s,timestamp:n}=t||{},{id:a,mimeType:i,thumbs:o,size:r,videoThumbs:c,attributes:d}=e;if(i===R&&!self.isWebmSupported)return;const l=d.find(e=>e instanceof qe.DocumentAttributeVideo);if(!l)return;const u=d.find(e=>e instanceof qe.DocumentAttributeAnimated),f=c?.some(e=>e instanceof qe.VideoSize&&"v"===e.type),g=o&&vi(o),{duration:p,w:h,h:m,supportsStreaming:_=!1,roundMessage:y=!1,nosound:b}=l,w=y?function(e){const t=Math.min(Math.round(e),Ui);return Array.from({length:t},()=>Math.floor(256*Math.random()))}(p):void 0;return{mediaType:"video",id:String(a),mimeType:i,duration:p,fileName:Mo(e,"video"),width:h,height:m,supportsStreaming:_,isRound:y,isGif:Boolean(u),thumbnail:wi(o),size:r.toJSNumber(),isSpoiler:s,timestamp:n,hasVideoPreview:f,previewPhotoSizes:g,waveform:w,...b&&{noSound:!0}}}function mo(e){if(e instanceof qe.DocumentEmpty)return;const{id:t,mimeType:s,size:n,attributes:a}=e,i=a.find(e=>e instanceof qe.DocumentAttributeAudio);if(!i)return;const{duration:o,title:r,performer:c}=i;return{mediaType:"audio",id:String(t),mimeType:s,duration:o,fileName:Mo(e,"audio"),title:r,performer:c,size:n.toJSNumber()}}function _o(e){if(e instanceof qe.MessageMediaDocument&&e.document instanceof qe.Document&&e.document.mimeType.startsWith("video"))return ho(e.document,{isSpoiler:e.spoiler,timestamp:e.videoTimestamp})}function yo(e){if(!(e instanceof qe.Document))return;const{id:t,size:s,mimeType:n,date:a,thumbs:i,attributes:o}=e,r=i&&i.find(e=>e instanceof qe.PhotoSize);let c=i&&wi(i);if(!c&&i&&r){const e=i.find(e=>e instanceof qe.PhotoPathSize);e&&(c=Si(e,r))}const d=i&&vi(i);let l,u;if(r)if(u={width:r.w,height:r.h},U.has(n)){l="photo";const e=o.find(e=>e instanceof qe.DocumentAttributeImageSize);if(e){const{w:t,h:s}=e;u={width:t,height:s,fromDocumentAttribute:!0}}}else if(E.has(n)){l="video";const e=o.find(e=>e instanceof qe.DocumentAttributeVideo);if(e){const{w:t,h:s}=e;u={width:t,height:s}}}return{mediaType:"document",id:String(t),size:s.toJSNumber(),mimeType:n,timestamp:a,fileName:Mo(e),thumbnail:c,innerMediaType:l,mediaSize:u,previewPhotoSizes:d}}function bo(e){if(e instanceof qe.MessageMediaPoll)return So(e.poll,e.results)}function wo(e){if(e instanceof qe.GeoPointEmpty)return;const{long:t,lat:s,accuracyRadius:n,accessHash:a}=e;return{long:t,lat:s,accessHash:a.toString(),accuracyRadius:n}}function So(e,t){const{id:s,answers:n}=e,a=n.map(e=>({text:Ri(e.text),option:Fa(e.option)}));return{mediaType:"poll",id:String(s),summary:{isPublic:e.publicVoters,question:Ri(e.question),...Ns(e,["closed","multipleChoice","quiz","closePeriod","closeDate"]),answers:a},results:vo(t)}}function Io(e){return{id:e.id,title:Ri(e.title)}}function vo(e){const{results:t,totalVoters:s,recentVoters:n,solution:a,solutionEntities:i,min:o}=e,r=t?.map(e=>{let{option:t,chosen:s,correct:n,voters:a}=e;return{isChosen:s,isCorrect:n,option:Fa(t),votersCount:a}});return{isMin:o,totalVoters:s,recentVoterIds:n?.map(e=>Ta(e)),results:r,solution:a,...i&&{solutionEntities:i.map(Ti)}}}function Po(e){if(!(e instanceof qe.MessageMediaWebPage))return;const{webpage:t}=e;return Co(t)}function Co(e){if(function(e,t){e instanceof qe.WebPage&&(e.document&&ui(gi(e.document,t)),e.photo&&li(gi(e.photo,t)))}(e),e instanceof qe.WebPageEmpty)return{mediaType:"webpage",webpageType:"empty",id:e.id.toString(),url:e.url};if(e instanceof qe.WebPagePending)return{mediaType:"webpage",webpageType:"pending",id:e.id.toString(),url:e.url};if(e instanceof qe.WebPage){const{id:t,photo:s,document:n,attributes:a}=e;let i,o,r,c,d;n instanceof qe.Document&&n.mimeType.startsWith("video/")&&(i=ho(n)),n instanceof qe.Document&&n.mimeType.startsWith("audio/")&&(o=mo(n));const l=a?.find(e=>e instanceof qe.WebPageAttributeStory),u=a?.find(e=>e instanceof qe.WebPageAttributeUniqueStarGift);if(l){const e=Ta(l.peer);r={id:l.id,peerId:e},l.story instanceof qe.StoryItem&&di(l.story,e)}if(u){const e=oo(u.gift);c="starGiftUnique"===e.type?e:void 0}const f=a?.find(e=>e instanceof qe.WebPageAttributeStickerSet);return f&&(d={documents:Ni(f.stickers),isEmoji:f.emojis,isWithTextColor:f.textColor}),{mediaType:"webpage",webpageType:"full",id:t.toString(),...Ns(e,["url","displayUrl","type","siteName","title","description","duration","hasLargeMedia"]),photo:s instanceof qe.Photo?Ii(s):void 0,document:i||o||!n?void 0:yo(n),video:i,audio:o,story:r,gift:c,stickers:d}}}function Mo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";const{mimeType:s,attributes:n}=e,a=n.find(e=>e instanceof qe.DocumentAttributeFilename);if(a)return a.fileName;const i=s.split("/")[1];return`${t}${String(e.id)}.${i}`}function Ao(e){const{w:t,h:s,thumb:n,videoDuration:a}=e;return{mediaType:"extendedMediaPreview",width:t,height:s,duration:a,thumbnail:n?wi([n]):void 0}}function Ro(e){if(!e)return;const{url:t,size:s,mimeType:n}=e,a=e instanceof qe.WebDocument?e.accessHash.toString():void 0,i=e.attributes.find(e=>e instanceof qe.DocumentAttributeImageSize);return{mediaType:"webDocument",url:t,accessHash:a,size:s,mimeType:n,dimensions:i&&{width:i.w,height:i.h}}}function To(e){const t=e.filter(e=>e instanceof qe.MessageExtendedMedia).map(e=>po(e.media)).filter(Boolean);if(t.length)return t}function ko(e){const{recentReactions:t,results:s,canSeeList:n,reactionsAsTags:a,topReactors:i}=e;return{areTags:a,canSeeList:n,results:s.map(Uo).filter(Boolean).sort(Do),recentReactions:t?.map(Bo).filter(Boolean),topReactors:i?.map(Eo).filter(Boolean)}}function Do(e,t){if("paid"===e.reaction.type)return-1;if("paid"===t.reaction.type)return 1;return t.count-e.count||(void 0!==e.chosenOrder&&void 0!==t.chosenOrder?e.chosenOrder-t.chosenOrder:void 0!==e.chosenOrder?1:void 0!==t.chosenOrder?-1:0)}function Uo(e){const{chosenOrder:t,count:s,reaction:n}=e,a=xo(n,!0);if(a)return{chosenOrder:t,count:s,reaction:a}}function Eo(e){const{count:t,my:s,top:n,anonymous:a,peerId:i}=e;return{peerId:i&&Ta(i),count:t,isMy:s,isTop:n,isAnonymous:a}}function Bo(e){const{peerId:t,reaction:s,big:n,unread:a,date:i,my:o}=e,r=xo(s);if(r)return{peerId:Ta(t),reaction:r,addedDate:i,isUnread:a,isBig:n,isOwn:o}}function xo(e,t){return e instanceof qe.ReactionEmoji?{type:"emoji",emoticon:e.emoticon}:e instanceof qe.ReactionCustomEmoji?{type:"custom",documentId:e.documentId.toString()}:t&&e instanceof qe.ReactionPaid?{type:"paid"}:void 0}function Vo(e){const{reaction:t,title:s,count:n}=e,a=xo(t);if(a)return{reaction:a,title:s,count:n}}function No(e){const{selectAnimation:t,staticIcon:s,reaction:n,title:a,appearAnimation:i,inactive:o,aroundAnimation:r,centerIcon:c,effectAnimation:d,activateAnimation:l,premium:u}=e;return{selectAnimation:yo(t),appearAnimation:yo(i),activateAnimation:yo(l),effectAnimation:yo(d),staticIcon:yo(s),aroundAnimation:r?yo(r):void 0,centerIcon:c?yo(c):void 0,reaction:{type:"emoji",emoticon:n},title:a,isInactive:o,isPremium:u}}function Go(e){const{id:t,emoticon:s,premiumRequired:n,staticIconId:a,effectStickerId:i,effectAnimationId:o}=e;return{id:t.toString(),emoticon:s,isPremium:n,staticIconId:a?.toString(),effectStickerId:i.toString(),effectAnimationId:o?.toString()}}function Fo(e){if(e instanceof qe.WallPaperNoFile)return;const{slug:t}=e,s=yo(e.document);return s?{slug:t,document:s}:void 0}function qo(e){return{isCurrent:Boolean(e.current),isOfficialApp:Boolean(e.officialApp),isPasswordPending:Boolean(e.passwordPending),hash:String(e.hash),areCallsEnabled:!e.callRequestsDisabled,areSecretChatsEnabled:!e.encryptedRequestsDisabled,isUnconfirmed:e.unconfirmed,...Ns(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function Ho(e){return{hash:String(e.hash),botId:Ra(e.botId,"user"),...Ns(e,["platform","browser","dateCreated","dateActive","ip","region","domain"])}}function Lo(e){const{silent:t,muteUntil:s,showPreviews:n,otherSound:a}=e;return{hasSound:!(a instanceof qe.NotificationSoundNone),isSilentPosting:t,mutedUntil:s,shouldShowPreviews:n}}function Oo(e,t){const{hidden:s,iso2:n,defaultName:a,name:i}=e,{countryCode:o,prefixes:r,patterns:c}=t||{};return{isHidden:s,iso2:n,defaultName:a,name:i,countryCode:o,prefixes:r,patterns:c}}function jo(e){if(!(e instanceof qe.JsonNull))return e instanceof qe.JsonString||e instanceof qe.JsonBool||e instanceof qe.JsonNumber?e.value:e instanceof qe.JsonArray?e.value.map(jo):e.value.reduce((e,t)=>(e[t.key]=jo(t.value),e),{})}function Wo(e){if(e instanceof qe.UrlAuthResultRequest){const{bot:t,domain:s,requestWriteAccess:n}=e,a=to(t);if(!a)return;return pi(t),{type:"request",domain:s,shouldRequestWriteAccess:n,bot:a}}return e instanceof qe.UrlAuthResultAccepted?{type:"accepted",url:e.url}:e instanceof qe.UrlAuthResultDefault?{type:"default"}:void 0}function zo(e){return e.strings.reduce((e,t)=>(e[t.key]=function(e){return e instanceof qe.LangPackString?e.value:e instanceof qe.LangPackStringPluralized?Fs(Qs(e),["key"]):void 0}(t),e),{})}function Ko(e){const t=[],s=e.reduce((e,s)=>(s instanceof qe.LangPackStringDeleted&&t.push(s.key),s instanceof qe.LangPackString&&(e[s.key]=s.value),s instanceof qe.LangPackStringPluralized&&(e[s.key]=qs({zero:s.zeroValue,one:s.oneValue,two:s.twoValue,few:s.fewValue,many:s.manyValue,other:s.otherValue})),e),{});return{keysToRemove:t,strings:s}}function $o(e){const{name:t,nativeName:s,langCode:n,pluralCode:a,rtl:i,stringsCount:o,translatedCount:r,translationsUrl:c,beta:d,official:l}=e;return{name:t,nativeName:s,langCode:n,pluralCode:a,isRtl:i,isBeta:d,isOfficial:l,stringsCount:o,translatedCount:r,translationsUrl:c}}function Jo(e){if(e instanceof qe.help.PeerColorSet)return e.colors.map(e=>Ca(e))}function Qo(e){const{id:t,name:s,utcOffset:n}=e;return{id:t,name:s,utcOffset:n}}function Xo(e){if(e)return e.map(e=>{let{reason:t,text:s,platform:n}=e;return{reason:t,text:s,platform:n}})}function Zo(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=e instanceof qe.User?e:void 0,n=e instanceof qe.Channel?e:void 0,a=s||n,i=Boolean("min"in e&&e.min),o="accessHash"in e?String(e.accessHash):void 0,r="photo"in e&&e.photo&&"hasVideo"in e.photo&&e.photo.hasVideo,c="photo"in e&&e.photo?ki(e.photo):void 0,d=Boolean("username"in e&&e.username),l=Mi(e),u="callActive"in e&&e.callActive,f="callNotEmpty"in e&&e.callNotEmpty,g="date"in e?e.date:void 0,p="participantsCount"in e?e.participantsCount:void 0,h="noforwards"in e&&e.noforwards,m="creator"in e&&e.creator,_=a?.scam,y=a?.fake,b=a?.storiesHidden,w=a?.storiesMaxId,S=a?.botVerificationIcon?.toString(),I=a?.storiesUnavailable,v=a?.color?ka(a.color):void 0,P=a?.emojiStatus?Da(a.emojiStatus):void 0,C=a?.sendPaidMessagesStars,M=a?.verified;return{isMin:i,isLinkedInDiscussion:n?.hasLink,areSignaturesShown:n?.signatures,areProfilesShown:n?.signatureProfiles,usernames:l,accessHash:o,hasVideoAvatar:r,avatarPhotoId:c,isVerified:M,isCallActive:u,isCallNotEmpty:f,creationDate:g,hasUsername:d,...void 0!==p&&{membersCount:p},isProtected:h,isSupport:t||void 0,isCreator:m,fakeType:_?"scam":y?"fake":void 0,color:v,isJoinToSend:n?.joinToSend,isJoinRequest:n?.joinRequest,isForum:n?.forum,isMonoforum:n?.monoforum,linkedMonoforumId:n?.linkedMonoforumId&&Ra(n.linkedMonoforumId,"channel"),areChannelMessagesAllowed:n?.broadcastMessagesAllowed,areStoriesHidden:b,maxStoryId:w,hasStories:Boolean(w)&&!I,emojiStatus:P,boostLevel:n?.level,botVerificationIconId:S,hasGeo:n?.hasGeo,subscriptionUntil:n?.subscriptionUntilDate,paidMessagesStars:C?.toJSNumber(),level:n?.level,hasAutoTranslation:n?.autotranslation,withForumTabs:n?.forumTabs,...er(e),...tr(e),...sr(e)}}function Yo(e,t){const{peer:s,folderId:n,unreadMark:a,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,readOutboxMaxId:c,readInboxMaxId:d,draft:l,viewForumAsMessages:u}=e;return{id:Ta(s),...n&&{folderId:n},type:ar(t),title:or(s,t),lastReadOutboxMessageId:c,lastReadInboxMessageId:d,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,...a&&{hasUnreadMark:!0},...l instanceof qe.DraftMessage&&{draftDate:l.date},...u&&{isForumAsMessages:!0},...Zo(t)}}function er(e){return e instanceof qe.Chat||e instanceof qe.Channel?{adminRights:e.adminRights?Qs(e.adminRights):void 0,currentUserBannedRights:"bannedRights"in e&&e.bannedRights?Qs(e.bannedRights):void 0,defaultBannedRights:e.defaultBannedRights?Qs(e.defaultBannedRights):void 0}:{}}function tr(e){if(e instanceof qe.ChatForbidden)return{isForbidden:!0};if(e instanceof qe.ChannelForbidden)return{isRestricted:!0};const t={};if("restricted"in e&&!e.min){const s=Xo(e.restrictionReason);Object.assign(t,{restrictionReasons:s})}return e instanceof qe.Chat&&Object.assign(t,{isNotJoined:e.left}),e instanceof qe.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function sr(e){return!("migratedTo"in e)||!e.migratedTo||e.migratedTo instanceof qe.InputChannelEmpty?{}:{migratedTo:{chatId:Ta(e.migratedTo),...e.migratedTo instanceof qe.InputChannel&&{accessHash:String(e.migratedTo.accessHash)}}}}function nr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof qe.ChatEmpty||e instanceof qe.UserEmpty))return{id:Ra(e.id,e instanceof qe.User?"user":e instanceof qe.Chat||e instanceof qe.ChatForbidden?"chat":"channel"),type:ar(e),title:e instanceof qe.User?rr(e):e.title,...Zo(e,t)}}function ar(e){return e instanceof qe.User||e instanceof qe.UserEmpty?"chatTypePrivate":e instanceof qe.Chat||e instanceof qe.ChatForbidden||e instanceof qe.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function ir(e){return Ma(e)?`user${e.userId.toString()}`:Aa(e)?`chat${e.chatId.toString()}`:`chat${e.channelId.toString()}`}function or(e,t){return Ma(e)?rr(t):t.title}function rr(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||""}function cr(e){return{userId:e instanceof qe.ChannelParticipantBanned||e instanceof qe.ChannelParticipantLeft?Ta(e.peer):Ra(e.userId,"user"),inviterId:"inviterId"in e&&e.inviterId?Ra(e.inviterId,"user"):void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e&&e.kickedBy?Ra(e.kickedBy,"user"):void 0,promotedByUserId:"promotedBy"in e&&e.promotedBy?Ra(e.promotedBy,"user"):void 0,bannedRights:"bannedRights"in e?Qs(e.bannedRights):void 0,adminRights:"adminRights"in e?Qs(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,isViaRequest:"viaRequest"in e?e.viaRequest:void 0,...(e instanceof qe.ChannelParticipantAdmin||e instanceof qe.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof qe.ChannelParticipantCreator||e instanceof qe.ChatParticipantCreator)&&{isOwner:!0}}}function dr(e){return e instanceof qe.ChatParticipants||e instanceof qe.channels.ChannelParticipants?e.participants.map(cr).filter(Boolean):void 0}function lr(e){let t,s="";if(!(e.action instanceof qe.SendMessageCancelAction)){if(e.action instanceof qe.SendMessageTypingAction)s="lng_user_typing";else if(e.action instanceof qe.SendMessageRecordVideoAction)s="lng_send_action_record_video";else if(e.action instanceof qe.SendMessageUploadVideoAction)s="lng_send_action_upload_video";else if(e.action instanceof qe.SendMessageRecordAudioAction)s="lng_send_action_record_audio";else if(e.action instanceof qe.SendMessageUploadAudioAction)s="lng_send_action_upload_audio";else if(e.action instanceof qe.SendMessageUploadPhotoAction)s="lng_send_action_upload_photo";else if(e.action instanceof qe.SendMessageUploadDocumentAction)s="lng_send_action_upload_file";else if(e.action instanceof qe.SendMessageGeoLocationAction)s="selecting a location to share";else if(e.action instanceof qe.SendMessageChooseContactAction)s="selecting a contact to share";else if(e.action instanceof qe.SendMessageGamePlayAction)s="lng_playing_game";else if(e.action instanceof qe.SendMessageRecordRoundAction)s="lng_send_action_record_round";else if(e.action instanceof qe.SendMessageUploadRoundAction)s="lng_send_action_upload_round";else if(e.action instanceof qe.SendMessageChooseStickerAction)s="lng_send_action_choose_sticker";else{if(e.action instanceof qe.SpeakingInGroupCallAction)return;if(e.action instanceof qe.SendMessageEmojiInteractionSeen)s="lng_user_action_watching_animations",t=e.action.emoticon;else if(e.action instanceof qe.SendMessageEmojiInteraction)return}return{action:s,...t&&{emoji:t},...!(e instanceof qe.UpdateUserTyping)&&{userId:Ta(e.fromId)},timestamp:Date.now()+1e3*Ts()}}}function ur(e){return e instanceof qe.DialogFilterChatlist?{...Gs(e,["id","emoticon"]),excludedChatIds:[],includedChatIds:e.includePeers.map(Ta).filter(Boolean),pinnedChatIds:e.pinnedPeers.map(Ta).filter(Boolean),hasMyInvites:e.hasMyInvites,isChatList:!0,noTitleAnimations:e.titleNoanimate,color:e.color,title:Ri(e.title)}:{...Gs(e,["id","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"]),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(Ta).filter(Boolean),includedChatIds:e.includePeers.map(Ta).filter(Boolean),excludedChatIds:e.excludePeers.map(Ta).filter(Boolean),color:e.color,title:Ri(e.title),noTitleAnimations:e.titleNoanimate}}function fr(e){let{filter:t,description:s}=e;if(t instanceof qe.DialogFilter||t instanceof qe.DialogFilterChatlist)return{...ur(t),description:s}}function gr(e){return e.reduce((e,t)=>{const s=Ra(t.userId,"user");return t.commands&&(e=e.concat(t.commands.map(e=>({botId:s,...Qs(e)})))),e},[])}function pr(e){const{revoked:t,date:s,expireDate:n,link:a,permanent:i,startDate:o,usage:r,usageLimit:c,requested:d,requestNeeded:l,title:u,adminId:f}=e;return{isRevoked:t,date:s,expireDate:n,link:a,isPermanent:i,startDate:o,usage:r,usageLimit:c,isRequestNeeded:l,requested:d,title:u,adminId:Ra(f,"user")}}function hr(e){return e instanceof qe.ChatReactionsAll?{type:"all",areCustomAllowed:e.allowCustom}:e instanceof qe.ChatReactionsSome?{type:"some",allowed:e.reactions.map(e=>xo(e)).filter(Boolean)}:void 0}function mr(e){return{id:Ta(e.peer),isPremium:e.premiumRequired}}function _r(e){if(e instanceof qe.ForumTopicDeleted)return;const{id:t,my:s,closed:n,pinned:a,hidden:i,short:o,date:r,title:c,iconColor:d,iconEmojiId:l,topMessage:u,unreadCount:f,unreadMentionsCount:g,unreadReactionsCount:p,fromId:h,notifySettings:m}=e;return{id:t,isClosed:n,isPinned:a,isHidden:i,isOwner:s,isMin:o,date:r,title:c,iconColor:d,iconEmojiId:l?.toString(),lastMessageId:u,unreadCount:f,unreadMentionsCount:g,unreadReactionsCount:p,fromId:Ta(h),notifySettings:Lo(m)}}function yr(e){if(!(e instanceof qe.ExportedChatlistInvite))return;const{title:t,url:s,peers:n}=e;return{title:t,url:s,peerIds:n.map(Ta).filter(Boolean)}}function br(e){return{id:e.userId.toString(),isRequiringPremiumToMessage:e.premiumRequiredForPm,isRequiringPremiumToInvite:e.premiumWouldAllowInvite}}function wr(e){const{color:t,participants:s,participantsCount:n,photo:a,title:i,about:o,scam:r,fake:c,verified:d,megagroup:l,channel:u,broadcast:f,requestNeeded:g,subscriptionFormId:p,subscriptionPricing:h,canRefulfillSubscription:m,botVerification:_}=e;let y;return a instanceof qe.Photo&&(li(a),y=Ii(a)),s?.forEach(pi),{title:i,about:o,isFake:c,isScam:r,isVerified:d,isSuperGroup:l,isPublic:e.public,participantsCount:n,color:t,isChannel:u,isBroadcast:f,isRequestNeeded:g,photo:y,subscriptionFormId:p?.toString(),subscriptionPricing:h&&Sr(h),canRefulfillSubscription:m,participantIds:s?.map(e=>Ra(e.id,"user")).filter(Boolean),botVerification:_&&Di(_)}}function Sr(e){return{period:e.period,amount:e.amount.toJSNumber()}}const Ir=10**9;function vr(e){return e instanceof qe.PostInteractionCountersMessage?{type:"message",msgId:e.msgId,forwardsCount:e.forwards,viewsCount:e.views,reactionsCount:e.reactions}:e instanceof qe.PostInteractionCountersStory?{type:"story",storyId:e.storyId,reactionsCount:e.reactions,viewsCount:e.views,forwardsCount:e.forwards}:void 0}function Pr(e){return{viewsGraph:Ar(e.viewsGraph),reactionsGraph:Ar(e.reactionsByEmotionGraph)}}function Cr(e){if(e)return e.forwards.map(t=>{if(!(t instanceof qe.PublicForwardStory))return Dr(t.message,e.chats)}).filter(Boolean)}function Mr(e){if(e&&"forwards"in e)return e.forwards.map(t=>{if(t instanceof qe.PublicForwardMessage)return Dr(t.message,e.chats);const{peer:s,story:n}=t;return{peerId:Ta(s),storyId:n.id,viewsCount:n.views?.viewsCount||0,reactionsCount:n.views?.reactionsCount||0}})}function Ar(e,t,s,n){if(e instanceof qe.StatsGraphError)return{graphType:"error",error:e.error};if(e instanceof qe.StatsGraphAsync)return{graphType:"async",token:e.token};const a=JSON.parse(e.json.data),[i,...o]=a.columns,r=a.y_scaled;return{graphType:"graph",type:t?"area":a.types.y0,zoomToken:e.zoomToken,labelFormatter:a.xTickFormatter,tooltipFormatter:a.xTooltipFormatter,labels:i.slice(1),hideCaption:!a.subchart.show,hasSecondYAxis:r,isStacked:a.stacked&&!r,isPercentage:t,isCurrency:s,currencyRate:n,datasets:o.map(e=>{const t=e[0];return{name:a.names[t],color:(s=a.colors[t],s.substring(s.indexOf("#"))),values:e.slice(1)};var s}),...Rr(a.subchart.defaultZoom,i.slice(1))}}function Rr(e,t){const[s,n]=e;let a=0,i=t.length-1;return t.forEach((e,t)=>{!a&&e>=s&&(a=t),!i&&e>=n&&(i=t)}),{minimapRange:{begin:Math.max(0,a/(t.length-1)),end:Math.min(1,i/(t.length-1))},labelFromIndex:a,labelToIndex:i}}function Tr(e){let{current:t,previous:s}=e;const n=t-s;return{current:t,change:n,percentage:(n?Math.abs(n)/s*100:0).toFixed(2)}}function kr(e){return{part:e.part,total:e.total,percentage:(e.part/e.total*100).toFixed(2)}}function Dr(e,t){const s=Ta(e.peerId),n=t.find(e=>Ra(e.id,"channel")===s),a=n&&"photo"in n&&n.photo instanceof qe.ChatPhoto?n.photo:void 0;return{messageId:e.id,views:e.views,title:n.title,chat:{id:s,type:"chatTypeChannel",title:n.title,usernames:Mi(n),avatarPhotoId:a&&ki(a),hasVideoAvatar:Boolean(a?.hasVideo)}}}function Ur(e){let{currentBalance:t,availableBalance:s,overallRevenue:n,withdrawalEnabled:a}=e;return{currentBalance:Number(t)/Ir,availableBalance:Number(s)/Ir,overallRevenue:Number(n)/Ir,isWithdrawalEnabled:a}}function Er(e){if(e)return Object.values(e).map(e=>({id:e.id,title:e.title,amount:e.prices.reduce((e,t)=>e+t.amount.toJSNumber(),0),prices:e.prices.map(e=>{let{label:t,amount:s}=e;return{label:t,amount:s.toJSNumber()}})}))}function Br(e){const{photo:t}=e;if(t&&hi(t),e instanceof qe.payments.PaymentReceiptStars){const{botId:s,currency:n,date:a,description:i,title:o,totalAmount:r,transactionId:c,invoice:d}=e;return{type:"stars",currency:n,date:a,botId:Ra(s,"user"),description:i,title:o,totalAmount:-r.toJSNumber(),transactionId:c,photo:Ro(t),invoice:xr(d)}}const{invoice:s,info:n,shipping:a,totalAmount:i,credentialsTitle:o,tipAmount:r,title:c,description:d,botId:l,currency:u,date:f,providerId:g}=e,{shippingAddress:p,phone:h,name:m}=n||{};let _,y;return a&&(_=a.prices.map(e=>{let{label:t,amount:s}=e;return{label:t,amount:s.toJSNumber()}}),y=a.title),{type:"regular",info:{shippingAddress:p,phone:h,name:m},totalAmount:i.toJSNumber(),currency:u,date:f,credentialsTitle:o,shippingPrices:_,shippingMethod:y,tipAmount:r?r.toJSNumber():0,title:c,description:d,botId:Ra(l,"user"),providerId:g.toString(),photo:t&&Ro(t),invoice:xr(s)}}function xr(e){const{test:t,currency:s,prices:n,recurring:a,termsUrl:i,maxTipAmount:o,suggestedTipAmounts:r,emailRequested:c,emailToProvider:d,nameRequested:l,phoneRequested:u,phoneToProvider:f,shippingAddressRequested:g,flexible:p,subscriptionPeriod:h}=e,m=n.map(e=>{let{label:t,amount:s}=e;return{label:t,amount:s.toJSNumber()}});return{totalAmount:n.reduce((e,t)=>e.add(t.amount),Y()(0)).toJSNumber(),currency:s,isTest:t,isRecurring:a,termsUrl:i,prices:m,maxTipAmount:o?.toJSNumber(),suggestedTipAmounts:r?.map(e=>e.toJSNumber()),isEmailRequested:c,isEmailSentToProvider:d,isNameRequested:l,isPhoneRequested:u,isPhoneSentToProvider:f,isShippingAddressRequested:g,isFlexible:p,subscriptionPeriod:h}}function Vr(e){const{statusText:t,statusEntities:s,videos:n,videoSections:a,periodOptions:i}=e;return{statusText:t,statusEntities:s.map(Ti),videoSections:a,videos:n.map(yo).filter(Boolean),options:i.map(Nr)}}function Nr(e){const{current:t,canPurchaseUpgrade:s,currency:n,amount:a,botUrl:i,months:o}=e;return{isCurrent:t,canPurchaseUpgrade:s,currency:n,amount:a.toJSNumber(),botUrl:i,months:o}}function Gr(e){const{userId:t,multiplier:s,expires:n,giveaway:a,gift:i,stars:o}=e;return{userId:t&&Ra(t,"user"),multiplier:s,expires:n,isFromGiveaway:a,isGift:i,stars:o?.toJSNumber()}}function Fr(e){const{date:t,expires:s,slot:n,cooldownUntilDate:a,peer:i}=e;return{date:t,expires:s,slot:n,cooldownUntil:a,chatId:i&&Ta(i)}}function qr(e){const{date:t,fromId:s,months:n,giveawayMsgId:a,toId:i,usedDate:o,viaGiveaway:r}=e;return{date:t,months:n,toId:i&&Ra(i,"user"),fromId:s&&Ta(s),usedAt:o,isFromGiveaway:r,giveawayMessageId:a}}function Hr(e){const{amount:t,currency:s,months:n,users:a}=e;return{amount:t.toJSNumber(),currency:s,months:n,users:a}}function Lr(e){const{extended:t,stars:s,amount:n,currency:a}=e;return{isExtended:t,stars:s.toJSNumber(),amount:n.toJSNumber(),currency:a}}function Or(e){return e instanceof qe.StarsAmount?{currency:b,amount:e.amount.toJSNumber(),nanos:e.nanos}:e instanceof qe.StarsTonAmount?{currency:p,amount:e.amount.toJSNumber()}:void 0}function jr(e){const{extended:t,default:s,stars:n,yearlyBoosts:a,amount:i,winners:o,currency:r}=e,c=o?.map(e=>function(e){const{default:t,users:s,perUserStars:n}=e;return{isDefault:t,users:s,perUserStars:n.toJSNumber()}}(e)).filter(Boolean);return{isExtended:t,isDefault:s,yearlyBoosts:a,stars:n.toJSNumber(),amount:i.toJSNumber(),currency:r,winners:c}}function Wr(e){return e instanceof qe.StarsTransactionPeerAppStore?{type:"appStore"}:e instanceof qe.StarsTransactionPeerPlayMarket?{type:"playMarket"}:e instanceof qe.StarsTransactionPeerPremiumBot?{type:"premiumBot"}:e instanceof qe.StarsTransactionPeerFragment?{type:"fragment"}:e instanceof qe.StarsTransactionPeerAds?{type:"ads"}:e instanceof qe.StarsTransactionPeerAPI?{type:"api"}:e instanceof qe.StarsTransactionPeer?{type:"peer",id:Ta(e.peer)}:{type:"unsupported"}}function zr(e){const{date:t,id:s,peer:n,amount:a,description:i,photo:o,title:r,refund:c,extendedMedia:d,failed:l,msgId:u,pending:f,gift:g,reaction:p,subscriptionPeriod:h,stargift:m,giveawayPostId:_,starrefCommissionPermille:y,stargiftUpgrade:b,paidMessages:w,stargiftResale:S,postsSearch:I}=e;o&&hi(o);const v=d?.map(e=>po(e)).filter(Boolean),P=y?y/10:void 0,C=Or(a);if(C)return{id:s,date:t,peer:Wr(n),amount:C,title:r,description:i,photo:o&&Ro(o),isRefund:c,hasFailed:l,isPending:f,messageId:u,isGift:g,extendedMedia:v,subscriptionPeriod:h,isReaction:p,starGift:m&&oo(m),giveawayPostId:_,starRefCommision:P,isGiftUpgrade:b,isGiftResale:S,paidMessages:w,isPostsSearch:I}}function Kr(e){const{id:t,peer:s,pricing:n,untilDate:a,canRefulfill:i,canceled:o,chatInviteHash:r,missingBalance:c,botCanceled:d,photo:l,title:u,invoiceSlug:f}=e;return l&&hi(l),{id:t,peerId:Ta(s),until:a,pricing:Sr(n),isCancelled:o,canRefulfill:i,hasMissingBalance:c,chatInviteHash:r,hasBotCancelled:d,title:u,photo:l&&Ro(l),invoiceSlug:f}}function $r(e){const{amount:t,currency:s,stars:n,extended:a}=e;return{amount:t.toJSNumber(),currency:s,stars:n.toJSNumber(),isExtended:a}}const Jr={mediaType:"action",type:"unsupported"};function Qr(e){return e instanceof qe.PhoneCallDiscardReasonBusy?"busy":e instanceof qe.PhoneCallDiscardReasonHangup?"hangup":e instanceof qe.PhoneCallDiscardReasonMissed?"missed":"disconnect"}const Xr=1e6,Zr="temp",Yr=63,ec=10;let tc,sc=0;function nc(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+ ++sc/Xr}function ac(e){const t=Na(e);if(t&&(e instanceof qe.Message||e instanceof qe.MessageService))return ic(t,e)}function ic(e,t){const s="user"===dn(e),n=t.fromId&&!s?Ta(t.fromId):void 0,a=!n&&e===tc,i=t.fwdFrom&&rc(t.fwdFrom,a),o=Boolean(!i||i.fromId===tc||i.isSavedOutgoing),r=a?o:Boolean(t.out&&!t.post),c=fo(t),d=t.action&&function(e){if(e instanceof qe.MessageActionChatCreate){const{title:t,users:s}=e;return{mediaType:"action",type:"chatCreate",title:t,userIds:s.map(e=>Ra(e,"user"))}}if(e instanceof qe.MessageActionChatEditTitle){const{title:t}=e;return{mediaType:"action",type:"chatEditTitle",title:t}}if(e instanceof qe.MessageActionChatEditPhoto){const{photo:t}=e;return{mediaType:"action",type:"chatEditPhoto",photo:t instanceof qe.Photo?Ii(t):void 0}}if(e instanceof qe.MessageActionChatDeletePhoto)return{mediaType:"action",type:"chatDeletePhoto"};if(e instanceof qe.MessageActionChatAddUser){const{users:t}=e;return{mediaType:"action",type:"chatAddUser",userIds:t.map(e=>Ra(e,"user"))}}if(e instanceof qe.MessageActionChatDeleteUser){const{userId:t}=e;return{mediaType:"action",type:"chatDeleteUser",userId:Ra(t,"user")}}if(e instanceof qe.MessageActionChatJoinedByLink){const{inviterId:t}=e;return{mediaType:"action",type:"chatJoinedByLink",inviterId:Ra(t,"user")}}if(e instanceof qe.MessageActionChannelCreate){const{title:t}=e;return{mediaType:"action",type:"channelCreate",title:t}}if(e instanceof qe.MessageActionChatMigrateTo){const{channelId:t}=e;return{mediaType:"action",type:"chatMigrateTo",channelId:Ra(t,"channel")}}if(e instanceof qe.MessageActionChannelMigrateFrom){const{title:t,chatId:s}=e;return{mediaType:"action",type:"channelMigrateFrom",title:t,chatId:Ra(s,"chat")}}if(e instanceof qe.MessageActionPinMessage)return{mediaType:"action",type:"pinMessage"};if(e instanceof qe.MessageActionHistoryClear)return{mediaType:"action",type:"historyClear"};if(e instanceof qe.MessageActionGameScore){const{gameId:t,score:s}=e;return{mediaType:"action",type:"gameScore",gameId:t.toString(),score:s}}if(e instanceof qe.MessageActionPaymentSent){const{recurringInit:t,recurringUsed:s,currency:n,totalAmount:a,invoiceSlug:i,subscriptionUntilDate:o}=e;return{mediaType:"action",type:"paymentSent",isRecurringInit:t,isRecurringUsed:s,currency:n,totalAmount:a.toJSNumber(),invoiceSlug:i,subscriptionUntilDate:o}}if(e instanceof qe.MessageActionPhoneCall){const{video:t,callId:s,reason:n,duration:a}=e;return{mediaType:"action",type:"phoneCall",isVideo:t,callId:s.toString(),reason:n&&Qr(n),duration:a}}if(e instanceof qe.MessageActionScreenshotTaken)return{mediaType:"action",type:"screenshotTaken"};if(e instanceof qe.MessageActionCustomAction){const{message:t}=e;return{mediaType:"action",type:"customAction",message:t}}if(e instanceof qe.MessageActionBotAllowed){const{attachMenu:t,fromRequest:s,domain:n,app:a}=e;return{mediaType:"action",type:"botAllowed",isAttachMenu:t,isFromRequest:s,domain:n,app:a&&$i(a)}}if(e instanceof qe.MessageActionBoostApply){const{boosts:t}=e;return{mediaType:"action",type:"boostApply",boosts:t}}if(e instanceof qe.MessageActionContactSignUp)return{mediaType:"action",type:"contactSignUp"};if(e instanceof qe.MessageActionGroupCall){const{call:t,duration:s}=e;return t instanceof qe.InputGroupCall?{mediaType:"action",type:"groupCall",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},duration:s}:Jr}if(e instanceof qe.MessageActionInviteToGroupCall){const{call:t,users:s}=e;return t instanceof qe.InputGroupCall?{mediaType:"action",type:"inviteToGroupCall",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},userIds:s.map(e=>Ra(e,"user"))}:Jr}if(e instanceof qe.MessageActionGroupCallScheduled){const{call:t,scheduleDate:s}=e;return t instanceof qe.InputGroupCall?{mediaType:"action",type:"groupCallScheduled",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},scheduleDate:s}:Jr}if(e instanceof qe.MessageActionChatJoinedByRequest)return{mediaType:"action",type:"chatJoinedByRequest"};if(e instanceof qe.MessageActionWebViewDataSent){const{text:t}=e;return{mediaType:"action",type:"webViewDataSent",text:t}}if(e instanceof qe.MessageActionGiftPremium){const{currency:t,amount:s,months:n,cryptoCurrency:a,cryptoAmount:i,message:o}=e;return{mediaType:"action",type:"giftPremium",currency:t,amount:s.toJSNumber(),months:n,cryptoCurrency:a,cryptoAmount:i?.toJSNumber(),message:o&&Ri(o)}}if(e instanceof qe.MessageActionTopicCreate){const{title:t,iconColor:s,iconEmojiId:n}=e;return{mediaType:"action",type:"topicCreate",title:t,iconColor:s,iconEmojiId:n?.toString()}}if(e instanceof qe.MessageActionTopicEdit){const{title:t,iconEmojiId:s,closed:n,hidden:a}=e;return{mediaType:"action",type:"topicEdit",title:t,iconEmojiId:s?.toString(),isClosed:n,isHidden:a}}if(e instanceof qe.MessageActionSuggestProfilePhoto){const{photo:t}=e;return t instanceof qe.Photo?{mediaType:"action",type:"suggestProfilePhoto",photo:Ii(t)}:Jr}if(e instanceof qe.MessageActionGiftCode){const{viaGiveaway:t,unclaimed:s,boostPeer:n,months:a,slug:i,currency:o,amount:r,cryptoCurrency:c,cryptoAmount:d,message:l}=e;return{mediaType:"action",type:"giftCode",isViaGiveaway:t,isUnclaimed:s,boostPeerId:n&&Ta(n),months:a,slug:i,currency:o,amount:r?.toJSNumber(),cryptoCurrency:c,cryptoAmount:d?.toJSNumber(),message:l&&Ri(l)}}if(e instanceof qe.MessageActionGiveawayLaunch){const{stars:t}=e;return{mediaType:"action",type:"giveawayLaunch",stars:t?.toJSNumber()}}if(e instanceof qe.MessageActionGiveawayResults){const{stars:t,winnersCount:s,unclaimedCount:n}=e;return{mediaType:"action",type:"giveawayResults",isStars:t,winnersCount:s,unclaimedCount:n}}if(e instanceof qe.MessageActionPaymentRefunded){const{peer:t,currency:s,totalAmount:n}=e;return{mediaType:"action",type:"paymentRefunded",peerId:Ta(t),currency:s,totalAmount:n.toJSNumber()}}if(e instanceof qe.MessageActionGiftStars){const{currency:t,amount:s,stars:n,cryptoCurrency:a,cryptoAmount:i,transactionId:o}=e;return{mediaType:"action",type:"giftStars",currency:t,amount:s.toJSNumber(),stars:n.toJSNumber(),cryptoCurrency:a,cryptoAmount:i?.toJSNumber(),transactionId:o}}if(e instanceof qe.MessageActionGiftTon){const{currency:t,amount:s,cryptoCurrency:n,cryptoAmount:a,transactionId:i}=e;return{mediaType:"action",type:"giftTon",currency:t,amount:s.toJSNumber(),cryptoCurrency:n,cryptoAmount:a.toJSNumber(),transactionId:i}}if(e instanceof qe.MessageActionPrizeStars){const{unclaimed:t,stars:s,transactionId:n,boostPeer:a,giveawayMsgId:i}=e;return{mediaType:"action",type:"prizeStars",isUnclaimed:t,stars:s.toJSNumber(),transactionId:n,boostPeerId:Ta(a),giveawayMsgId:i}}if(e instanceof qe.MessageActionStarGift){const{nameHidden:t,saved:s,converted:n,upgraded:a,refunded:i,canUpgrade:o,gift:r,message:c,convertStars:d,upgradeMsgId:l,upgradeStars:u,fromId:f,peer:g,savedId:p}=e,h=oo(r);return"starGift"!==h.type?Jr:{mediaType:"action",type:"starGift",isNameHidden:t,isSaved:s,isConverted:n,isUpgraded:a,isRefunded:i,canUpgrade:o,gift:h,message:c&&Ri(c),starsToConvert:d?.toJSNumber(),upgradeMsgId:l,alreadyPaidUpgradeStars:u?.toJSNumber(),fromId:f&&Ta(f),peerId:g&&Ta(g),savedId:p&&Ra(p,"user")}}if(e instanceof qe.MessageActionStarGiftUnique){const{upgrade:t,transferred:s,saved:n,refunded:a,gift:i,canExportAt:o,transferStars:r,fromId:c,peer:d,savedId:l,resaleAmount:u}=e,f=oo(i);return"starGiftUnique"!==f.type?Jr:{mediaType:"action",type:"starGiftUnique",isUpgrade:t,isTransferred:s,isSaved:n,isRefunded:a,gift:f,canExportAt:o,transferStars:r?.toJSNumber(),fromId:c&&Ta(c),peerId:d&&Ta(d),savedId:l&&Ra(l,"user"),resaleAmount:u?Or(u):void 0}}if(e instanceof qe.MessageActionPaidMessagesPrice){const{stars:t,broadcastMessagesAllowed:s}=e;return{mediaType:"action",type:"paidMessagesPrice",isAllowedInChannel:s,stars:t.toJSNumber()}}if(e instanceof qe.MessageActionPaidMessagesRefunded){const{stars:t,count:s}=e;return{mediaType:"action",type:"paidMessagesRefunded",stars:t.toJSNumber(),count:s}}if(e instanceof qe.MessageActionSuggestedPostApproval){const{rejected:t,balanceTooLow:s,rejectComment:n,scheduleDate:a,price:i}=e;return{mediaType:"action",type:"suggestedPostApproval",isRejected:Boolean(t),isBalanceTooLow:Boolean(s),rejectComment:n,scheduleDate:a,amount:i?Or(i):void 0}}if(e instanceof qe.MessageActionSuggestedPostSuccess){const{price:t}=e;return{mediaType:"action",type:"suggestedPostSuccess",amount:Or(t)}}if(e instanceof qe.MessageActionSuggestedPostRefund){const{payerInitiated:t}=e;return{mediaType:"action",type:"suggestedPostRefund",payerInitiated:Boolean(t)}}if(e instanceof qe.MessageActionTodoCompletions){const{completed:t,incompleted:s}=e;return{mediaType:"action",type:"todoCompletions",completedIds:t,incompletedIds:s}}if(e instanceof qe.MessageActionTodoAppendTasks){const{list:t}=e;return{mediaType:"action",type:"todoAppendTasks",items:t.map(Io)}}return Jr}(t.action);d&&(c.action=d);const l=t.date>ks()+ec,u=t.media instanceof qe.MessageMediaInvoice&&Boolean(t.media.extendedMedia),f=Boolean(t.editDate)&&!t.editHide,{inlineButtons:g,keyboardButtons:p,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:_}=Gi(t.replyMarkup,t.media instanceof qe.MessageMediaInvoice?t.media.receiptMsgId:void 0)||{},{mediaUnread:y,postAuthor:b}=t,w=t.groupedId&&String(t.groupedId),S=Boolean(w)&&!(c.document||c.audio||c.sticker),I=t.replyMarkup instanceof qe.ReplyKeyboardHide,v=t.replyMarkup instanceof qe.ReplyKeyboardHide&&t.replyMarkup.selective,P=t.noforwards||u,C=!t.noforwards,M=ni(c,w),A=t.replies?.comments,R=t.fromBoostsApplied,T=t.factcheck&&dc(t.factcheck),k=t.videoProcessingPending,D=t.reactionsArePossible,U=t.invertMedia,E=t.savedPeerId&&Ta(t.savedPeerId),B=Xo(t.restrictionReason);return{id:t.id,chatId:e,isOutgoing:r,content:c,date:t.date,senderId:n,viewsCount:t.views,forwardsCount:t.forwards,isScheduled:l,isFromScheduled:t.fromScheduled,isSilent:t.silent,isPinned:t.pinned,reactions:t.reactions&&ko(t.reactions),emojiOnlyCount:M,...t.replyTo&&{replyInfo:cc(t.replyTo,t)},...t.suggestedPost&&{suggestedPostInfo:(x=t.suggestedPost,{isAccepted:x.accepted,isRejected:x.rejected,price:x.price?Or(x.price):void 0,scheduleDate:x.scheduleDate})},forwardInfo:i,isEdited:f,editDate:t.editDate,isMediaUnread:y,hasUnreadMention:t.mentioned&&y,areReactionsPossible:D,isMentioned:t.mentioned,...w&&{groupedId:w,isInAlbum:S},inlineButtons:g,...p&&{keyboardButtons:p,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:_},...I&&{shouldHideKeyboardButtons:I,isHideKeyboardSelective:v},...t.viaBotId&&{viaBotId:Ra(t.viaBotId,"user")},postAuthorTitle:b,isProtected:P,isForwardingAllowed:C,hasComments:A,savedPeerId:E,senderBoosts:R,viaBusinessBotId:t.viaBusinessBotId?.toString(),factCheck:T,effectId:t.effect?.toString(),isInvertedMedia:U,isVideoProcessingPending:k,reportDeliveryUntilDate:t.reportDeliveryUntilDate,paidMessageStars:t.paidMessageStars?.toJSNumber(),restrictionReasons:B};var x}function oc(e){if(e instanceof qe.DraftMessageEmpty)return;const{message:t,entities:s,replyTo:n,date:a,effect:i,suggestedPost:o}=e,r=n instanceof qe.InputReplyToMessage?{type:"message",replyToMsgId:n.replyToMsgId,replyToTopId:n.topMsgId,replyToPeerId:n.replyToPeerId&&Ta(n.replyToPeerId),monoforumPeerId:n.monoforumPeerId&&Ta(n.monoforumPeerId),quoteText:n.quoteText?go(n.quoteText,n.quoteEntities):void 0,quoteOffset:n.quoteOffset}:void 0,c=o instanceof qe.SuggestedPost?{isAccepted:o.accepted,isRejected:o.rejected,price:o.price?Or(o.price):void 0,scheduleDate:o.scheduleDate}:void 0;return{text:t?go(t,s):void 0,replyInfo:r,suggestedPostInfo:c,date:a,effectId:i?.toString()}}function rc(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=e.savedFromPeer&&Ta(e.savedFromPeer),n=e.fromId&&Ta(e.fromId);return{date:e.date,savedDate:e.savedDate,isImported:e.imported,isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&s===n&&e.savedFromMsgId===e.channelPost&&!t),savedFromPeerId:s,isSavedOutgoing:e.savedOut,fromId:n,fromChatId:n||s,fromMessageId:e.savedFromMsgId||e.channelPost,hiddenUserName:e.fromName,postAuthorTitle:e.postAuthor}}function cc(e,t){if(e instanceof qe.MessageReplyStoryHeader)return{type:"story",peerId:Ta(e.peer),storyId:e.storyId};if(e instanceof qe.MessageReplyHeader){const{replyFrom:s,replyToMsgId:n,replyToTopId:a,replyMedia:i,replyToPeerId:o,forumTopic:r,quote:c,quoteText:d,quoteEntities:l,quoteOffset:u}=e;return{type:"message",replyToMsgId:n,replyToTopId:a,isForumTopic:r,replyFrom:s&&rc(s),replyToPeerId:o&&Ta(o),replyMedia:i&&po(i,t),isQuote:c,quoteText:d?go(d,l):void 0,quoteOffset:u}}}function dc(e){return{shouldFetch:e.needCheck,hash:e.hash.toString(),text:e.text&&Ri(e.text),countryCode:e.country}}function lc(e){const{filename:t,blobUrl:s,previewBlobUrl:n,mimeType:a,size:i,audio:o,shouldSendAsFile:r,shouldSendAsSpoiler:c,ttlSeconds:d}=e;if(!r){if(e.quick){if(U.has(a)){const{width:t,height:a}=e.quick;return{photo:{mediaType:"photo",id:Zr,sizes:[],thumbnail:{width:t,height:a,dataUri:n||s},blobUrl:s,date:Math.round(Date.now()/1e3),isSpoiler:c}}}if(E.has(a)){const{width:o,height:r,duration:d}=e.quick;return{video:{mediaType:"video",id:Zr,mimeType:a,duration:d||0,fileName:t,width:o,height:r,blobUrl:s,...n&&{thumbnail:{width:o,height:r,dataUri:n}},size:i,isSpoiler:c}}}}if(e.voice){const{duration:t,waveform:s}=e.voice,{data:n}=oi(s,Yr);return{voice:{mediaType:"voice",id:Zr,duration:t,waveform:n,size:i},ttlSeconds:d}}if(B.has(a)){const{duration:e,performer:s,title:n}=o||{};return{audio:{mediaType:"audio",id:Zr,mimeType:a,fileName:t,size:i,duration:e||0,title:n,performer:s}}}}return{document:{mediaType:"document",mimeType:a,fileName:t,size:i,...n&&{previewBlobUrl:n}}}}function uc(e){const t=Na(e);if(t&&e instanceof qe.Message&&e.replies)return fc(e.replies,e.id,t)}function fc(e,t,s){const{channelId:n,replies:a,maxId:i,readMaxId:o,recentRepliers:r,comments:c}=e,d=n?Ra(n,"channel"):void 0;if(d===j)return;const l={messagesCount:a,...i&&{lastMessageId:i},...o&&{lastReadMessageId:o},...r&&{recentReplierIds:r.map(Ta)}};return c?{...l,isCommentsInfo:!0,chatId:d,originChannelId:s,originMessageId:t}:{...l,isCommentsInfo:!1,chatId:s,threadId:t}}function gc(e){const{shortcutId:t,shortcut:s,topMessage:n}=e;return{id:t,shortcut:s,topMessageId:n}}function pc(e){return e instanceof qe.ReportResultReported?{type:"reported"}:e instanceof qe.ReportResultAddComment?{type:"comment",isOptional:e.optional,option:Fa(e.option)}:{type:"selectOption",title:e.title,options:e.options.map(e=>({text:e.text,option:Fa(e.option)}))}}function hc(e,t){return t instanceof qe.BotInlineMediaResult?(t.document instanceof qe.Document&&ui(t.document),t.photo instanceof qe.Photo&&li(t.photo),Hi(t,e)):(t.thumb&&hi(t.thumb),qi(t,e))}function mc(e,t){return{query:t,queryIsFree:e.queryIsFree,totalDaily:e.totalDaily,remains:e.remains,waitTill:e.waitTill,starsAmount:e.starsAmount.toJSNumber()}}function _c(e,t){if(t instanceof qe.StoryItemDeleted)return{id:t.id,peerId:e,isDeleted:!0};if(t instanceof qe.StoryItemSkipped){const{id:s,date:n,expireDate:a,closeFriends:i}=t;return{id:s,peerId:e,...i&&{isForCloseFriends:!0},date:n,expireDate:a}}const{edited:s,pinned:n,expireDate:a,id:i,date:o,caption:r,entities:c,media:d,privacy:l,views:u,public:f,noforwards:g,closeFriends:p,contacts:h,selectedContacts:m,mediaAreas:_,sentReaction:y,out:b,fwdFrom:w,fromId:S}=t,I={...po(d)};r&&(I.text=go(r,c));const v=y&&xo(y);return qs({id:i,peerId:e,date:o,expireDate:a,content:I,isPublic:f,isEdited:s,isInProfile:n,isForContacts:h,isForSelectedContacts:m,isForCloseFriends:p,noForwards:g,views:u&&yc(u),isOut:b,visibility:l&&Ai(l),mediaAreas:_?.map(Sc).filter(Boolean),sentReaction:v,forwardInfo:w&&Ic(w),fromId:S&&Ta(S)})}function yc(e){return qs({hasViewers:e.hasViewers,viewsCount:e.viewsCount,forwardsCount:e.forwardsCount,reactionsCount:e.reactionsCount,reactions:e.reactions?.map(Uo).filter(Boolean),recentViewerIds:e.recentViewers?.map(e=>Ra(e,"user"))})}function bc(e){const{blockedMyStoriesFrom:t,blocked:s}=e;if(e instanceof qe.StoryView)return qs({type:"user",peerId:Ra(e.userId,"user"),date:e.date,reaction:e.reaction&&xo(e.reaction),areStoriesBlocked:s||t,isUserBlocked:s});if(e instanceof qe.StoryViewPublicForward){const n=ac(e.message);if(!n)return;return{type:"forward",peerId:n.chatId,messageId:n.id,message:n,date:n.date,areStoriesBlocked:s||t,isUserBlocked:s}}if(e instanceof qe.StoryViewPublicRepost){const n=Ta(e.peerId),a=_c(n,e.story);if(!("content"in a))return;return{type:"repost",peerId:n,storyId:e.story.id,date:a.date,story:a,areStoriesBlocked:s||t,isUserBlocked:s}}}function wc(e){return{activeUntil:e.activeUntilDate,cooldownUntil:e.cooldownUntilDate}}function Sc(e){const t=function(e){const{x:t,y:s,w:n,h:a,rotation:i,radius:o}=e;return{x:t,y:s,width:n,height:a,rotation:i,radius:o}}(e.coordinates);if(e instanceof qe.MediaAreaVenue){const{geo:s,title:n}=e,a=wo(s);if(!a)return;return{type:"venue",coordinates:t,geo:a,title:n}}if(e instanceof qe.MediaAreaGeoPoint){const{geo:s}=e,n=wo(s);if(!n)return;return{type:"geoPoint",coordinates:t,geo:n}}if(e instanceof qe.MediaAreaSuggestedReaction){const{reaction:s,dark:n,flipped:a}=e,i=xo(s);if(!i)return;return{type:"suggestedReaction",coordinates:t,reaction:i,...n&&{isDark:!0},...a&&{isFlipped:!0}}}if(e instanceof qe.MediaAreaChannelPost){const{channelId:s,msgId:n}=e;return{type:"channelPost",coordinates:t,channelId:Ra(s,"channel"),messageId:n}}if(e instanceof qe.MediaAreaUrl){const{url:s}=e;return{type:"url",coordinates:t,url:s}}if(e instanceof qe.MediaAreaWeather){const{emoji:s,temperatureC:n,color:a}=e;return{type:"weather",coordinates:t,emoji:s,temperatureC:n,color:a}}if(e instanceof qe.MediaAreaStarGift){const{slug:s}=e;return{type:"uniqueGift",coordinates:t,slug:s}}}function Ic(e){const{from:t,fromName:s,storyId:n,modified:a}=e;return{storyId:n,fromPeerId:t&&Ta(t),fromName:s,isModified:a}}function vc(e){const{albumId:t,title:s,iconPhoto:n,iconVideo:a}=e;return n&&li(n),a&&ui(a),{albumId:t,title:s,iconPhoto:n&&n instanceof qe.Photo?Ii(n):void 0,iconVideo:a?yo(a):void 0}}const Pc=new Set(["User","UserEmpty"]),Cc=new Set(["ChatEmpty","Chat","ChatForbidden","Channel","ChannelForbidden"]),Mc=new Set(["Message","MessageEmpty","MessageService"]);function Ac(e){if(!e||"object"!=typeof e)return;if(!("users"in e||"chats"in e||"messages"in e))return;let t,s;const n=[],a=[],i=[];"users"in e&&Array.isArray(e.users)&&Pc.has(e.users[0]?.className)&&(t=xs(e.users.map(e=>(e instanceof qe.User&&pi(e),to(e))).filter(Boolean),"id")),"chats"in e&&Array.isArray(e.chats)&&Cc.has(e.chats[0]?.className)&&(s=xs(e.chats.map(e=>((e instanceof qe.Chat||e instanceof qe.Channel)&&function(e){const t=Ra(e.id,e instanceof qe.Chat?"chat":"channel"),s=an.chats[t],n=s&&"min"in s&&s.min,a="min"in e&&e.min;s&&!n&&a||(an.chats[t]=e)}(e),nr(e))).filter(Boolean),"id")),"messages"in e&&Array.isArray(e.messages)&&Mc.has(e.messages[0]?.className)&&e.messages.forEach(e=>{ri(e);const t=uc(e);if(t&&n.push(t),"media"in e&&e.media){const t=bo(e.media);t&&a.push(t);const s=Po(e.media);s&&i.push(s)}}),(t||s||n?.length)&&Ka({"@type":"updateEntities",users:t,chats:s,threadInfos:n?.length?n:void 0,polls:a?.length?a:void 0,webPages:i?.length?i:void 0})}function Rc(e){ri(e);const t=uc(e);t&&Ka({"@type":"updateThreadInfo",threadInfo:t})}class Tc{constructor(e){this.comparator=e,this.queue=[]}add(e){const t=this.binarySearch(e);this.queue.splice(t,0,e)}pop(){return this.queue.shift()}get size(){return this.queue.length}clear(){this.queue=[]}binarySearch(e){let t=0,s=this.queue.length;for(;t<s;){const n=Math.floor((t+s)/2),a=this.comparator(e,this.queue[n]);if(0===a)return n;a>0?t=n+1:s=n}return t}}function kc(e){const{self:t,min:s,about:n,date:a,versioned:i,canSelfUnmute:o,justJoined:r,left:c,muted:d,mutedByYou:l,source:u,volume:f,volumeByAdmin:g,videoJoined:p,peer:h,video:m,presentation:_,raiseHandRating:y}=e;return{isSelf:t,isMin:s,canSelfUnmute:o,isLeft:c,isMuted:d,isMutedByMe:l,hasJustJoined:r,isVolumeByAdmin:g,isVersioned:i,isVideoJoined:p,about:n,source:u,raiseHandRating:y?.toString(),volume:f,date:new Date(a),isUser:Ma(h),id:Ta(h),video:m?Dc(m):void 0,presentation:_?Dc(_):void 0}}function Dc(e){const{audioSource:t,endpoint:s,paused:n,sourceGroups:a}=e;return{audioSource:t,endpoint:s,isPaused:n,sourceGroups:a.map(Uc)}}function Uc(e){return{semantics:e.semantics,sources:e.sources}}function Ec(e){const{id:t,accessHash:s}=e;if(e instanceof qe.GroupCallDiscarded)return{connectionState:"discarded",id:t.toString(),accessHash:s.toString(),participantsCount:0,version:0,participants:{}};const{version:n,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:d,scheduleStartSubscribed:l}=e;return{connectionState:"disconnected",isLoaded:!0,id:t.toString(),accessHash:s.toString(),version:n,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:d,scheduleStartSubscribed:l,participants:{}}}function Bc(e){const{id:t}=e;let s={id:t.toString()};if(e instanceof qe.PhoneCallAccepted||e instanceof qe.PhoneCallWaiting||e instanceof qe.PhoneCall||e instanceof qe.PhoneCallRequested){const{accessHash:t,adminId:n,date:a,video:i,participantId:o,protocol:r}=e;s={...s,accessHash:t.toString(),adminId:n.toString(),participantId:o.toString(),date:a,isVideo:i,protocol:Vc(r)}}if(e instanceof qe.PhoneCall){const{p2pAllowed:t,gAOrB:n,keyFingerprint:a,connections:i,startDate:o}=e;s={...s,state:"active",gAOrB:Array.from(n),keyFingerprint:a.toString(),startDate:o,isP2pAllowed:Boolean(t),connections:i.map(xc).filter(Boolean)}}return e instanceof qe.PhoneCallDiscarded&&(s={...s,state:"discarded",duration:e.duration,reason:(n=e.reason,n instanceof qe.PhoneCallDiscardReasonMissed?"missed":n instanceof qe.PhoneCallDiscardReasonBusy?"busy":n instanceof qe.PhoneCallDiscardReasonHangup?"hangup":"disconnect"),needRating:e.needRating,needDebug:e.needDebug}),e instanceof qe.PhoneCallWaiting&&(s={...s,state:"waiting",receiveDate:e.receiveDate}),e instanceof qe.PhoneCallAccepted&&(s={...s,state:"accepted",gB:Array.from(e.gB)}),e instanceof qe.PhoneCallRequested&&(s={...s,state:"requested",gAHash:Array.from(e.gAHash)}),s;var n}function xc(e){if(e instanceof qe.PhoneConnectionWebrtc){const{username:t,password:s,turn:n,stun:a,ip:i,ipv6:o,port:r}=e;return{username:t,password:s,isTurn:n,isStun:a,ip:i,ipv6:o,port:r}}}function Vc(e){const{libraryVersions:t,minLayer:s,maxLayer:n,udpP2p:a,udpReflector:i}=e;return{libraryVersions:t,minLayer:s,maxLayer:n,isUdpP2p:a,isUdpReflector:i}}function Nc(){return new qe.PhoneCallProtocol({libraryVersions:["4.0.0"],minLayer:92,maxLayer:92,udpReflector:!0,udpP2p:!0})}const Gc=new Map,Fc=[],qc=(e,t)=>{const s=e.topicId?`${e.chatId}-${e.topicId}`:e.chatId;if(Gc.has(s)&&(clearTimeout(Gc.get(s)),Gc.delete(s)),e.mutedUntil===S||e.mutedUntil<=ks())return;if(Fc.push(e),Fc.sort((e,t)=>t.mutedUntil-e.mutedUntil),!Fc.pop())return;const n=setTimeout(()=>{if(t(),Fc.length){const e=Fc.pop();e&&qc(e,t)}},1e3*(e.mutedUntil-ks()));Gc.set(s,n)};function Hc(e,t,s){qc({chatId:e,mutedUntil:t},()=>s({"@type":"updateChatNotifySettings",chatId:e,settings:{mutedUntil:void 0}}))}class Lc{constructor(e,t){this.pts=e,this.ptsCount=t}}class Oc{constructor(e,t,s){this.channelId=e,this.pts=t,this.ptsCount=s}}function jc(e){if(e instanceof jt)a=e.timeOffset,Rs=a,za({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset});else if(e instanceof Ot){let t;switch(e.state){case Ot.disconnected:t="connectionStateConnecting";break;case Ot.broken:t="connectionStateBroken";break;case Ot.connected:default:t="connectionStateReady"}za({"@type":"updateConnectionState",connectionState:t})}else if(e instanceof qe.UpdateNewMessage||e instanceof qe.UpdateNewScheduledMessage||e instanceof qe.UpdateNewChannelMessage||e instanceof qe.UpdateShortChatMessage||e instanceof qe.UpdateShortMessage){let t,s,a,i;if(e instanceof qe.UpdateShortChatMessage)t=ic(Ra((n=e).chatId,"chat"),{...n,fromId:ln(Ra(n.fromId,"user")),peerId:ln(Ra(n.chatId,"chat"))});else if(e instanceof qe.UpdateShortMessage)t=function(e){return ic(Ra(e.userId,"user"),{...e,peerId:ln(e.out?Ra(e.userId,"user"):tc)})}(e);else{const n=e.message;if(n instanceof qe.MessageEmpty)return void(o&&console.error("Unexpected update:",e.className,e));Rc(n),t=ac(n),n instanceof qe.Message&&(s=n.media&&bo(n.media),a=n.media&&Po(n.media)),i="replyMarkup"in e.message&&e.message?.replyMarkup instanceof qe.ReplyKeyboardForceReply&&(!e.message.replyMarkup.selective||t.isMentioned)}if(e instanceof qe.UpdateNewScheduledMessage?za({"@type":"updateScheduledMessage",id:t.id,chatId:t.chatId,message:t,poll:s,webPage:a,isFromNew:!0}):za({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t,shouldForceReply:i,poll:s,webPage:a,isFromNew:!0}),e.message instanceof qe.MessageService){const{action:s}=e.message;if(s instanceof qe.MessageActionChatEditTitle)za({"@type":"updateChat",id:t.chatId,chat:{title:s.title}});else if(s instanceof qe.MessageActionChatEditPhoto){const n=s.photo instanceof qe.Photo&&Ii(s.photo);if(!n)return;const a=function(e){if(e instanceof qe.PhotoEmpty)return new qe.ChatPhotoEmpty;const{dcId:t,id:s}=e;return new qe.ChatPhoto({dcId:t,photoId:s})}(s.photo),i=Na(e.message);an.chats[i]&&(an.chats[i].photo=a),li(s.photo),za({"@type":"updateNewProfilePhoto",peerId:t.chatId,photo:n})}else if(s instanceof qe.MessageActionChatDeletePhoto){const s=Na(e.message);an.chats[s]&&(an.chats[s].photo=new qe.ChatPhotoEmpty),za({"@type":"updateDeleteProfilePhoto",peerId:t.chatId})}else if(s instanceof qe.MessageActionChatDeleteUser)e._entities&&e._entities.some(e=>e instanceof qe.User&&Boolean(e.self)&&e.id===s.userId)&&za({"@type":"updateChat",id:t.chatId,chat:{isForbidden:!0,isNotJoined:!0}});else if(s instanceof qe.MessageActionChatAddUser)e._entities&&e._entities.some(e=>e instanceof qe.User&&Boolean(e.self)&&s.users.includes(e.id))&&za({"@type":"updateChatJoin",id:t.chatId});else if(s instanceof qe.MessageActionGroupCall){const e=s.call instanceof qe.InputGroupCall?s.call:void 0;!s.duration&&e&&za({"@type":"updateGroupCallChatId",chatId:t.chatId,call:{id:e.id.toString(),accessHash:e.accessHash.toString()}})}else if(s instanceof qe.MessageActionTopicEdit){const t=e.message.replyTo instanceof qe.MessageReplyHeader?e.message.replyTo:void 0,{replyToMsgId:s,replyToTopId:n,forumTopic:a}=t||{},i=a&&(n||s)||W;za({"@type":"updateTopic",chatId:Ta(e.message.peerId),topicId:i})}else s instanceof qe.MessageActionTopicCreate&&za({"@type":"updateTopics",chatId:Ta(e.message.peerId)})}}else if(e instanceof qe.UpdateQuickReplyMessage){const t=ac(e.message);if(!t)return;const s=e.message instanceof qe.Message&&e.message.media?bo(e.message.media):void 0,n=e.message instanceof qe.Message&&e.message.media?Po(e.message.media):void 0;za({"@type":"updateQuickReplyMessage",id:t.id,message:t,poll:s,webPage:n})}else if(e instanceof qe.UpdateDeleteQuickReplyMessages)za({"@type":"deleteQuickReplyMessages",quickReplyId:e.shortcutId,messageIds:e.messages});else if(e instanceof qe.UpdateQuickReplies)za({"@type":"updateQuickReplies",quickReplies:e.quickReplies.map(gc)});else if(e instanceof qe.UpdateNewQuickReply)za({"@type":"updateQuickReplies",quickReplies:[gc(e.quickReply)]});else if(e instanceof qe.UpdateDeleteQuickReply)za({"@type":"deleteQuickReply",quickReplyId:e.shortcutId});else if(e instanceof qe.UpdateEditMessage||e instanceof qe.UpdateEditChannelMessage){const t=e.message;if(t instanceof qe.MessageEmpty)return void(o&&console.error("Unexpected update:",e.className,e));Rc(t);const s=Fs(ac(t),["isOutgoing"]),n=t instanceof qe.Message&&t.media?bo(t.media):void 0,a=t instanceof qe.Message&&t.media?Po(t.media):void 0;za({"@type":"updateMessage",id:s.id,chatId:s.chatId,message:s,poll:n,webPage:a})}else if(e instanceof qe.UpdateMessageReactions)za({"@type":"updateMessageReactions",id:e.msgId,chatId:Ta(e.peer),reactions:ko(e.reactions)});else if(e instanceof qe.UpdateMessageExtendedMedia){const t=Ta(e.peer),s=e.extendedMedia[0]instanceof qe.MessageExtendedMedia;if(s){const n=To(e.extendedMedia);if(!n?.length)return;return void za({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,isBought:s,extendedMedia:n})}const n=s?void 0:e.extendedMedia.filter(e=>e instanceof qe.MessageExtendedMediaPreview).map(e=>Ao(e)).filter(Boolean);if(!n?.length)return;za({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,extendedMedia:n})}else if(e instanceof qe.UpdateDeleteMessages)za({"@type":"deleteMessages",ids:e.messages});else if(e instanceof qe.UpdateDeleteScheduledMessages)za({"@type":"deleteScheduledMessages",ids:e.messages,newIds:e.sentMessages,chatId:Ta(e.peer)});else if(e instanceof qe.UpdateDeleteChannelMessages){const t=Ra(e.channelId,"channel");za({"@type":"deleteMessages",ids:e.messages,chatId:t})}else if(e instanceof qe.UpdateServiceNotification)if(e.popup)za({"@type":"error",error:{message:e.message}});else{const t=function(e,t){const s=nc(t),n=fo(e);return{id:s,chatId:F,date:e.inboxDate||t,content:n,isInvertedMedia:e.invertMedia,isOutgoing:!1}}(e,Date.now()/1e3+Ts());Rc(Cn(t.id,t.chatId,e)),za({"@type":"updateServiceNotification",message:t})}else if(e instanceof qe.UpdateReadMessagesContents)za({"@type":"updateCommonBoxMessages",ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof qe.UpdateChannelReadMessagesContents)za({"@type":"updateChannelMessages",channelId:Ra(e.channelId,"channel"),ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof qe.UpdateMessagePoll){const{pollId:t,poll:s,results:n}=e;if(s){const e=So(s,n);za({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:e})}else{const e=vo(n);za({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:{results:e}})}}else if(e instanceof qe.UpdateMessagePollVote)za({"@type":"updateMessagePollVote",pollId:String(e.pollId),peerId:Ta(e.peer),options:e.options.map(Fa)});else if(e instanceof qe.UpdateChannelMessageViews)za({"@type":"updateMessage",chatId:Ra(e.channelId,"channel"),id:e.id,message:{viewsCount:e.views}});else if(e instanceof qe.UpdateChannelMessageForwards)za({"@type":"updateMessage",chatId:Ra(e.channelId,"channel"),id:e.id,message:{forwardsCount:e.forwards}});else if(e instanceof qe.UpdateReadHistoryInbox)za({"@type":"updateChatInbox",id:Ta(e.peer),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof qe.UpdateReadHistoryOutbox)za({"@type":"updateChat",id:Ta(e.peer),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof qe.UpdateReadChannelInbox)za({"@type":"updateChat",id:Ra(e.channelId,"channel"),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof qe.UpdateReadChannelOutbox)za({"@type":"updateChat",id:Ra(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof qe.UpdateReadChannelDiscussionInbox)za({"@type":"updateThreadInfo",threadInfo:{chatId:Ra(e.channelId,"channel"),threadId:e.topMsgId,lastReadInboxMessageId:e.readMaxId}});else if(e instanceof qe.UpdateReadChannelDiscussionOutbox)za({"@type":"updateChat",id:Ra(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.readMaxId}});else if(e instanceof qe.UpdateDialogPinned&&e.peer instanceof qe.DialogPeer)za({"@type":"updateChatPinned",id:Ta(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof qe.UpdatePinnedDialogs){const t=e.order?.filter(e=>e instanceof qe.DialogPeer).map(e=>Ta(e.peer));za({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof qe.UpdateSavedDialogPinned&&e.peer instanceof qe.DialogPeer)za({"@type":"updateSavedDialogPinned",id:Ta(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof qe.UpdatePinnedSavedDialogs)za({"@type":"updatePinnedSavedDialogIds",ids:e.order?e.order.filter(e=>e instanceof qe.DialogPeer).map(e=>Ta(e.peer)):[]});else if(e instanceof qe.UpdateFolderPeers)e.folderPeers.forEach(e=>{const{folderId:t,peer:s}=e;za({"@type":"updateChatListType",id:Ta(s),folderId:t})});else if(e instanceof qe.UpdateDialogFilter){const{id:t,filter:s}=e;za({"@type":"updateChatFolder",id:t,folder:Ga(s)?ur(s):void 0})}else if(e instanceof qe.UpdateDialogFilterOrder)za({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof qe.UpdateChatParticipants){const t=dr(e.participants);za({"@type":"updateChatMembers",id:Ra(e.participants.chatId,"chat"),replacedMembers:t})}else if(e instanceof qe.UpdateChatParticipantAdd){const t=cr(Ns(e,["userId","inviterId","date"]));za({"@type":"updateChatMembers",id:Ra(e.chatId,"chat"),addedMember:t})}else if(e instanceof qe.UpdateChatParticipantDelete)za({"@type":"updateChatMembers",id:Ra(e.chatId,"chat"),deletedMemberId:Ra(e.userId,"user")});else if(e instanceof qe.UpdatePinnedMessages||e instanceof qe.UpdatePinnedChannelMessages)za({"@type":"updatePinnedIds",chatId:e instanceof qe.UpdatePinnedMessages?Ta(e.peer):Ra(e.channelId,"channel"),messageIds:e.messages,isPinned:e.pinned});else if(e instanceof qe.UpdateUserTyping||e instanceof qe.UpdateChatUserTyping){const t=e instanceof qe.UpdateUserTyping?Ra(e.userId,"user"):Ra(e.chatId,"chat");e.action instanceof qe.SendMessageEmojiInteraction?za({"@type":"updateStartEmojiInteraction",id:t,emoji:e.action.emoticon,messageId:e.action.msgId,interaction:(s=JSON.parse(e.action.interaction.data),{timestamps:s.a.map(e=>{let{t}=e;return t})})}):za({"@type":"updateChatTypingStatus",id:t,typingStatus:lr(e)})}else if(e instanceof qe.UpdateChannelUserTyping)za({"@type":"updateChatTypingStatus",id:Ra(e.channelId,"channel"),threadId:e.topMsgId,typingStatus:lr(e)});else if(e instanceof qe.UpdateChannel){const{_entities:t}=e;if(!t)return;const s=t.find(e=>e instanceof qe.Channel||e instanceof qe.ChannelForbidden);if(s instanceof qe.Channel){const t=nr(s);t&&(za({"@type":"updateChat",id:t.id,chat:t}),za({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:Ra(e.channelId,"channel")}))}else if(s instanceof qe.ChannelForbidden){const t=Ra(e.channelId,"channel");za({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),za({"@type":"updateChatLeave",id:t})}else 0===t.length&&za({"@type":"resetMessages",id:Ra(e.channelId,"channel")})}else if(e instanceof qe.UpdateDialogUnreadMark&&e.peer instanceof qe.DialogPeer)za({"@type":"updateChat",id:Ta(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof qe.UpdateChatDefaultBannedRights)za({"@type":"updateChat",id:Ta(e.peer),chat:{defaultBannedRights:Qs(e.defaultBannedRights)}});else if(e instanceof qe.UpdateUserStatus)za({"@type":"updateUserStatus",userId:Ra(e.userId,"user"),status:so(e.status)});else if(e instanceof qe.UpdateUser)za({"@type":"updateRequestUserUpdate",id:Ra(e.userId,"user")});else if(e instanceof qe.UpdateUserEmojiStatus){const t=Da(e.emojiStatus);za({"@type":"updateUserEmojiStatus",userId:Ra(e.userId,"user"),emojiStatus:t})}else if(e instanceof qe.UpdateUserName){const t=Ra(e.userId,"user"),s=an.users[t];za({"@type":"updateUser",id:t,user:{...s?.mutualContact&&!s.self?Ns(e,[]):Ns(e,["firstName","lastName"]),usernames:Mi(e)}})}else if(e instanceof qe.UpdateUserPhone){const{userId:t,phone:s}=e;za({"@type":"updateUser",id:Ra(t,"user"),user:{phoneNumber:s}})}else if(e instanceof qe.UpdatePeerSettings){const{peer:t,settings:s}=e;za({"@type":"updatePeerSettings",id:Ta(t),settings:eo(s)})}else if(e instanceof qe.UpdateNotifySettings){const{notifySettings:t,peer:s}=e,n=s.className,a=Lo(t);if(s instanceof qe.NotifyPeer){const e=Ta(s.peer);return a.mutedUntil&&Hc(e,a.mutedUntil,za),void za({"@type":"updateChatNotifySettings",chatId:e,settings:a})}if(s instanceof qe.NotifyForumTopic){const e=Ta(s.peer);return a.mutedUntil&&function(e,t,s,n){qc({chatId:e,topicId:t,mutedUntil:s},()=>n({"@type":"updateTopicNotifySettings",chatId:e,topicId:t,settings:{mutedUntil:void 0}}))}(e,s.topMsgId,a.mutedUntil,za),void za({"@type":"updateTopicNotifySettings",chatId:e,topicId:s.topMsgId,settings:a})}const i="NotifyUsers"===n?"users":"NotifyChats"===n?"groups":"NotifyBroadcasts"===n?"channels":void 0;if(!i)return;za({"@type":"updateDefaultNotifySettings",peerType:i,settings:a})}else if(e instanceof qe.UpdatePeerBlocked)za({"@type":"updatePeerBlocked",id:Ta(e.peerId),isBlocked:e.blocked,isBlockedFromStories:e.blockedMyStoriesFrom});else if(e instanceof qe.UpdatePrivacy){const t=function(e){switch(e.className){case"PrivacyKeyPhoneNumber":return"phoneNumber";case"PrivacyKeyAddedByPhone":return"addByPhone";case"PrivacyKeyStatusTimestamp":return"lastSeen";case"PrivacyKeyProfilePhoto":return"profilePhoto";case"PrivacyKeyPhoneCall":return"phoneCall";case"PrivacyKeyPhoneP2P":return"phoneP2P";case"PrivacyKeyForwards":return"forwards";case"PrivacyKeyVoiceMessages":return"voiceMessages";case"PrivacyKeyChatInvite":return"chatInvite";case"PrivacyKeyAbout":return"bio";case"PrivacyKeyBirthday":return"birthday";case"PrivacyKeyStarGiftsAutoSave":return"gifts";case"PrivacyKeyNoPaidMessages":return"noPaidMessages"}}(e.key);t&&za({"@type":"updatePrivacy",key:t,rules:Ai(e.rules)})}else if(e instanceof qe.UpdateDraftMessage)za({"@type":"draftMessage",chatId:Ta(e.peer),threadId:e.topMsgId,draft:oc(e.draft)});else if(e instanceof qe.UpdateContactsReset)za({"@type":"updateResetContactList"});else if(e instanceof qe.UpdateFavedStickers)za({"@type":"updateFavoriteStickers"});else if(e instanceof qe.UpdateRecentStickers)za({"@type":"updateRecentStickers"});else if(e instanceof qe.UpdateRecentReactions)za({"@type":"updateRecentReactions"});else if(e instanceof qe.UpdateSavedReactionTags)za({"@type":"updateSavedReactionTags"});else if(e instanceof qe.UpdateMoveStickerSetToTop)e.masks||za({"@type":"updateMoveStickerSetToTop",isCustomEmoji:e.emojis,id:e.stickerset.toString()});else if(e instanceof qe.UpdateStickerSets)za({"@type":"updateStickerSets"});else if(e instanceof qe.UpdateStickerSetsOrder)e.masks||za({"@type":"updateStickerSetsOrder",order:e.order.map(e=>e.toString()),isCustomEmoji:e.emojis});else if(e instanceof qe.UpdateNewStickerSet){if(e.stickerset instanceof qe.messages.StickerSet){const t=Bi(e.stickerset.set);za({"@type":"updateStickerSet",id:t.id,stickerSet:t})}}else if(e instanceof qe.UpdateSavedGifs)za({"@type":"updateSavedGifs"});else if(e instanceof qe.UpdateGroupCall)za({"@type":"updateGroupCall",call:Ec(e.call)});else if(e instanceof qe.UpdateGroupCallConnection)za({"@type":"updateGroupCallConnection",data:JSON.parse(e.params.data),presentation:Boolean(e.presentation)});else if(e instanceof qe.UpdateGroupCallParticipants){const t=function(e){if(e instanceof qe.InputGroupCall)return e.id.toString()}(e.call);t&&za({"@type":"updateGroupCallParticipants",groupCallId:t,participants:e.participants.map(kc)})}else if(e instanceof qe.UpdatePendingJoinRequests)za({"@type":"updatePendingJoinRequests",chatId:Ta(e.peer),recentRequesterIds:e.recentRequesters.map(e=>Ra(e,"user")),requestsPending:e.requestsPending});else if(e instanceof qe.UpdatePhoneCall)za({"@type":"updatePhoneCall",call:Bc(e.phoneCall)});else if(e instanceof qe.UpdatePhoneCallSignalingData)za({"@type":"updatePhoneCallSignalingData",callId:e.phoneCallId.toString(),data:Array.from(e.data)});else if(e instanceof qe.UpdateWebViewResultSent){const{queryId:t}=e;za({"@type":"updateWebViewResultSent",queryId:t.toString()})}else if(e instanceof qe.UpdateWebPage||e instanceof qe.UpdateChannelWebPage){const t=Co(e.webpage);t&&za({"@type":"updateWebPage",webPage:t})}else if(e instanceof qe.UpdateBotMenuButton){const{botId:t,button:s}=e;za({"@type":"updateBotMenuButton",botId:Ra(t,"user"),button:Ki(s)})}else if(e instanceof qe.UpdateBotCommands){const{botId:t,commands:s}=e,n=Ra(t,"user"),a=s.map(e=>zi(n,e));za({"@type":"updateBotCommands",botId:n,commands:a.length?a:void 0})}else if(e instanceof qe.UpdateTranscribedAudio)za({"@type":"updateTranscribedAudio",transcriptionId:e.transcriptionId.toString(),text:e.text,isPending:e.pending});else if(e instanceof qe.UpdateConfig)za({"@type":"updateConfig"});else if(e instanceof qe.UpdateChannelPinnedTopic)za({"@type":"updatePinnedTopic",chatId:Ra(e.channelId,"channel"),topicId:e.topicId,isPinned:Boolean(e.pinned)});else if(e instanceof qe.UpdateChannelPinnedTopics)za({"@type":"updatePinnedTopicsOrder",chatId:Ra(e.channelId,"channel"),order:e.order||[]});else if(e instanceof qe.UpdateRecentEmojiStatuses)za({"@type":"updateRecentEmojiStatuses"});else if(e instanceof qe.UpdateStory){const{story:t}=e,s=Ta(e.peer),n=_c(s,t);di(t,s),t instanceof qe.StoryItemDeleted?za({"@type":"deleteStory",peerId:s,storyId:t.id}):za({"@type":"updateStory",peerId:s,story:n})}else if(e instanceof qe.UpdateReadStories)za({"@type":"updateReadStories",peerId:Ta(e.peer),lastReadId:e.maxId});else if(e instanceof qe.UpdateSentStoryReaction){const t=xo(e.reaction);za({"@type":"updateSentStoryReaction",peerId:Ta(e.peer),storyId:e.storyId,reaction:t})}else if(e instanceof qe.UpdateStoriesStealthMode)za({"@type":"updateStealthMode",stealthMode:wc(e.stealthMode)});else if(e instanceof qe.UpdateAttachMenuBots)za({"@type":"updateAttachMenuBots"});else if(e instanceof qe.UpdateNewAuthorization)za({"@type":"updateNewAuthorization",hash:e.hash.toString(),date:e.date,device:e.device,location:e.location,isUnconfirmed:e.unconfirmed});else if(e instanceof qe.UpdateChannelViewForumAsMessages)za({"@type":"updateViewForumAsMessages",chatId:Ra(e.channelId,"channel"),isEnabled:!!e.enabled||void 0});else if(e instanceof qe.UpdateStarsBalance){const t=Or(e.balance);if(!t)return;za({"@type":"updateStarsBalance",balance:t})}else if(e instanceof qe.UpdatePaidReactionPrivacy)za({"@type":"updatePaidReactionPrivacy",private:(t=e.private,t instanceof qe.PaidReactionPrivacyAnonymous?{type:"anonymous"}:t instanceof qe.PaidReactionPrivacyPeer?{type:"peer",peerId:Ta(t.peer)}:{type:"default"})});else if(e instanceof qe.UpdateLangPackTooLong)za({"@type":"updateLangPackTooLong",langCode:e.langCode});else if(e instanceof qe.UpdateLangPack){const{strings:t,keysToRemove:s}=Ko(e.difference.strings);za({"@type":"updateLangPack",version:e.difference.version,strings:t,keysToRemove:s})}else e instanceof aa?za({"@type":"updatePremiumFloodWait",isUpload:e.isUpload}):e instanceof Lc||e instanceof Oc||e instanceof qe.UpdateMessageID||e instanceof qe.UpdateShortSentMessage||o&&Ha("UNEXPECTED UPDATE","object"==typeof e&&"className"in e?e.className:e);var t,s,n,a}const Wc="0",zc=1e3,Kc=500;let $c,Jc,Qc=!1;const Xc=new Map,Zc=new Tc(function(e,t){return("seqStart"in e?e.seqStart:e.seq)-("seqStart"in t?t.seqStart:t.seq)}),Yc=new Map;function ed(e){an.commonBoxState.seq=e.seq,an.commonBoxState.date=e.date,an.commonBoxState.pts=e.pts,an.commonBoxState.qts=e.qts}function td(e,t,s){if(e instanceof Ot)return e.state===Ot.connected&&Qc&&rd(),void jc(e);if(e instanceof jt)jc(e);else if(void 0!==an.commonBoxState.seq)return e instanceof qe.Updates||e instanceof qe.UpdatesCombined?(t&&(e._isFromDifference=!0),void function(e,t){Zc.add(e),t||ad()}(e,s)):"pts"in e?e instanceof qe.UpdateChannelTooLong?void ld(cd(e)):(t&&(e._isFromDifference=!0),void function(e,t){const s=cd(e),n=Yc.get(s)||new Tc(_d);n.add(e),Yc.set(s,n),t||id(s)}(e,s)):void jc(e)}function sd(e,t){if(!(an.chats[e]instanceof qe.Channel))return void(o&&console.error(`[UpdateManager] Channel ${e} not found in localDb`));const s=an.channelPtsById[e];s&&s<t?od(e):an.channelPtsById[e]=t}function nd(e){if("seq"in e&&e.seq&&(an.commonBoxState.seq=e.seq,an.commonBoxState.date=e.date),"qts"in e&&(an.commonBoxState.qts=e.qts),"pts"in e){const t=cd(e);t!==Wc?an.channelPtsById[t]=e.pts:an.commonBoxState.pts=e.pts}if(e instanceof qe.UpdatesCombined||e instanceof qe.Updates){Ac(e);const t=e.users.concat(e.chats);e.updates.forEach(e=>{t&&(e._entities=t),td(e)})}else jc(e)}function ad(){if(!Zc.size)return;const e=Zc.pop(),t=an.commonBoxState.seq,s="seqStart"in e?e.seqStart:e.seq;if(0===s||e._isFromDifference&&s>=t+1)nd(e);else if(s===t+1)clearTimeout(Jc),Jc=void 0,nd(e);else if(s>t+1)return Zc.add(e),void rd();ad()}function id(e){const t=Yc.get(e);if(!t?.size)return;const s=t.pop(),n=e===Wc?an.commonBoxState.pts:an.channelPtsById[e],a=s.pts,i=md(s);if(void 0!==n){if(s._isFromDifference&&a>=n+i)nd(s);else if(a===n+i)clearTimeout(Xc.get(e)),Xc.delete(e),nd(s);else if(a>n+i)return t.add(s),void(e===Wc?rd():od(e));id(e)}}function od(e){if(Xc.has(e))return;const t=setTimeout(async()=>{await ld(e),Xc.delete(e)},Kc);Xc.set(e,t)}function rd(){Jc||(Jc=setTimeout(async()=>{await dd(),Jc=void 0},Kc))}function cd(e){return"channelId"in e&&"pts"in e?Ra(e.channelId,"channel"):e instanceof qe.UpdateNewChannelMessage||e instanceof qe.UpdateEditChannelMessage?Ra(e.message.peerId.channelId,"channel"):Wc}async function dd(){if(!Qc)throw new Error("UpdatesManager not initialized");if(!an.commonBoxState?.date)return void ud();za({"@type":"updateFetchingDifference",isFetching:!0});const e=await $c(new qe.updates.GetDifference({pts:an.commonBoxState.pts,date:an.commonBoxState.date,qts:an.commonBoxState.qts}));if(!e||e instanceof qe.updates.DifferenceTooLong)ud();else{if(e instanceof qe.updates.DifferenceEmpty)return an.commonBoxState.seq=e.seq,an.commonBoxState.date=e.date,void za({"@type":"updateFetchingDifference",isFetching:!1});hd(e),ed(e instanceof qe.updates.DifferenceSlice?e.intermediateState:e.state),e instanceof qe.updates.DifferenceSlice?dd():za({"@type":"updateFetchingDifference",isFetching:!1})}}async function ld(e){const t=an.chats[e];if(!(t&&t instanceof qe.Channel&&t.accessHash&&an.channelPtsById[e]))return void(o&&console.error("[UpdateManager] Channel for difference not found",e,t));const s=await $c(new qe.updates.GetChannelDifference({channel:gn(e,t.accessHash.toString()),pts:an.channelPtsById[e],filter:new qe.ChannelMessagesFilterEmpty,limit:zc}));s?s instanceof qe.updates.ChannelDifferenceTooLong?ud():(an.channelPtsById[e]=s.pts,s instanceof qe.updates.ChannelDifferenceEmpty?id(e):(hd(s,e),s.final||ld(e))):o&&console.warn("[UpdatesManager] Failed to get ChannelDifference",e,t)}function ud(){fd(),za({"@type":"requestSync"}),pd()}function fd(){Yc.clear(),Zc.clear(),clearTimeout(Jc),Jc=void 0,Xc.forEach(e=>{clearTimeout(e)}),Xc.clear(),an.commonBoxState={},Object.keys(an.channelPtsById).forEach(e=>{an.channelPtsById[e]=0}),Qc=!1}function gd(e,t){const s="chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?xn(e.id,"channel"):void 0;var n,a,i;td((n=t.pts,a=t.ptsCount,(i=s)?new Oc(i,n,a):new Lc(n,a)))}async function pd(){const e=await $c(new qe.updates.GetState);e&&(ed(e),Qc=!0)}function hd(e,t){e.newMessages.forEach(e=>{jc(new qe.UpdateNewMessage({message:e,pts:0,ptsCount:0}))}),Ac(e);const s=new Set;e.otherUpdates.forEach(e=>{const t=cd(e);e instanceof qe.UpdateChannelTooLong&&s.add(cd(e));const n=!s.has(t);td(e,n,!n)}),t?id(t):ad()}function md(e){return"ptsCount"in e?e.ptsCount:0}function _d(e,t){const s=e.pts-t.pts;return 0!==s?s:md(t)-md(e)}const yd={};function bd(){za({"@type":"updateWebAuthTokenFailed"})}function wd(){return za(Md("authorizationStateWaitPhoneNumber")),new Promise((e,t)=>{yd.resolve=e,yd.reject=t})}function Sd(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return za({...Md("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise((e,t)=>{yd.resolve=e,yd.reject=t})}function Id(e,t){return za({...Md("authorizationStateWaitPassword"),hint:e,noReset:t}),new Promise(e=>{yd.resolve=e})}function vd(){return za(Md("authorizationStateWaitRegistration")),new Promise(e=>{yd.resolve=e})}function Pd(e){return za({...Md("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise((e,t)=>{yd.reject=t})}function Cd(e){const{messageKey:t}=Oa(e);za({"@type":"updateAuthorizationError",errorKey:t})}function Md(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function Ad(e){yd.resolve&&yd.resolve(e)}function Rd(e){yd.resolve&&yd.resolve(e)}function Td(e){yd.resolve&&yd.resolve(e)}function kd(e){const{firstName:t,lastName:s}=e;yd.resolve&&yd.resolve([t,s])}function Dd(){yd.reject&&yd.reject(new Error("RESTART_AUTH"))}function Ud(){yd.reject&&yd.reject(new Error("RESTART_AUTH_WITH_QR"))}const Ed=self.caches,Bd=zs?`_${zs}`:"";let xd;async function Vd(){return!!Ed&&(xd=xd??await Ed.has("test").then(()=>!0).catch(()=>!1),xd)}let Nd=function(e){return e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json",e[e.ArrayBuffer=3]="ArrayBuffer",e}({});async function Gd(e,t,s){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Ed)try{const a=new Request(t.replace(/:/g,"_")),i=await Ed.open(`${e}${Bd}`),o=await i.match(a);if(!o)return;const r=o.headers.get("Content-Type");switch(s){case Nd.Text:return await o.text();case Nd.Blob:{if(t.startsWith("avatar")&&r&&r.startsWith("text"))return;const e=await o.blob(),s=!e.type||!n&&e.type.includes("html");let a=e.type||r;return s&&a?(n||(a=a.replace(/html/gi,"")),new Blob([e],{type:a})):e}case Nd.Json:return await o.json();case Nd.ArrayBuffer:return await o.arrayBuffer();default:return}}catch(e){return void console.warn(e)}}async function Fd(e,t,s){if(!Ed)return!1;try{const n="string"==typeof s||s instanceof Blob||s instanceof ArrayBuffer?s:JSON.stringify(s),a=new Request(t.replace(/:/g,"_")),i=new Response(n),o=await Ed.open(`${e}${Bd}`);return await o.put(a,i),!0}catch(e){return console.warn(e),!1}}async function qd(e,t){try{if(!Ed)return;const s=await Ed.open(`${e}${Bd}`);return await s.delete(t)}catch(e){return void console.warn(e)}}async function Hd(e){try{if(!Ed)return;return await Ed.delete(`${e}${Bd}`)}catch(e){return void console.warn(e)}}const Ld=new Set(["sticker","wallpaper","photo","webDocument","document"]),Od=new Set(["s","m","x","y","w","a","b","c","d"]),jd=new Set(["u","v"]);async function Wd(e,t,s){let{url:a,mediaFormat:i,start:o,end:f,isHtmlAllowed:g}=e;const{data:p,mimeType:h,fullSize:m}=await async function(e,t,s,n,a,i){const o=Kd(e);if(!o)return;const{entityType:r,entityId:c,sizeType:d,params:l,mediaMatchType:f}=o;if("staticMap"===r){const e=Y()(c),s=new URLSearchParams(l),n=Number(s.get("long")),a=Number(s.get("lat")),i=Number(s.get("w")),o=Number(s.get("h")),r=Number(s.get("zoom")),d=Number(s.get("scale")),u=s.get("accuracy_radius"),f=u?Number(u):void 0;return{mimeType:"image/png",data:await t.downloadStaticMap(e,n,a,i,o,r,d,f)}}let g;switch(r){case"channel":case"chat":g=an.chats[c];break;case"user":g=an.users[c];break;case"sticker":case"wallpaper":case"document":g=an.documents[c];break;case"photo":g=an.photos[c];break;case"stickerSet":g=an.stickerSets[c];break;case"webDocument":g=an.webDocuments[c]}if(g){if(Ld.has(r)){const e=g,o=await t.downloadMedia(e,{sizeType:d,start:n,end:a,progressCallback:s,workers:u});let r,c;return d&&Od.has(d)?r="image/jpeg":d&&jd.has(d)?r="video/mp4":g instanceof qe.Photo?r="image/jpeg":g instanceof qe.WebDocument?(r=g.mimeType,c=g.size):g instanceof qe.Document&&(r=g.mimeType,c=g.size.toJSNumber()),!i&&r&&(r=r.replace(/html/gi,"")),{mimeType:r,data:o,fullSize:c}}if("stickerSet"===r){const e=await t.downloadStickerSetThumb(g);return{mimeType:e&&zd(e),data:e}}{const e=await t.downloadProfilePhoto(g,"profile"===f);return{mimeType:e&&zd(e),data:e}}}}(a,t,s,o,f,g)||{};if(!p)return;const _=function(e,t,s){if(e instanceof File)return e;switch(t){case Bs.BlobUrl:return new Blob([e],{type:s});case Bs.Text:return e.toString();case Bs.Progressive:case Bs.DownloadUrl:return e.buffer}}(p,i,h);if(!_)return;const y=i!==Bs.Progressive&&(i!==Bs.BlobUrl||_.size<=l);return!r&&n&&y&&Fd(a.startsWith("avatar")?d:c,a,_),{dataBlob:i===Bs.Progressive?"":_,arrayBuffer:i===Bs.Progressive?_:void 0,mimeType:h,fullSize:m}}function zd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg";if(e.length<4)return t;let s=t;switch(e.subarray(0,4).reduce((e,t)=>e+t.toString(16),"")){case"89504e47":s="image/png";break;case"47494638":s="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;case"52494646":s="image/webp"}return s}function Kd(e){const t=e.startsWith("staticMap")?e.match(/(staticMap):([0-9-]+)(\?.+)/):e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|stickerSet|sticker|wallpaper|document)([-\d\w./]+)(?::\d+)?(\?size=\w+)?/);if(!t)return;const s=t[1],n=t[2];let a;const i=t[3],o=i?.replace("?size=","")||void 0;return a="avatar"===t[1]||"profile"===t[1]?dn(n):t[1],{mediaMatchType:s,entityType:a,entityId:n,sizeType:o,params:i}}class $d extends AbortController{threads=new Map;getThreadSignal(e){let t=this.threads.get(e);return t||(t=new AbortController,this.threads.set(e,t)),t.signal}abortThread(e,t){this.threads.get(e)?.abort(t),this.threads.delete(e)}abort(e){super.abort(e),this.threads.forEach(t=>t.abort(e)),this.threads.clear()}}vt.setLevel("warn");const Jd={build:e=>e},Qd=new Map,Xd=new Map;let Zd,Yd;function el(e){let{isPremium:t}=e;Zd.setIsPremium(t)}const tl=2500;async function sl(){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&Zd.isConnected()&&await Promise.race([ol(new qe.auth.LogOut),J(tl)]),e||(Object.assign(nn,sn()),fd()),await Zd.destroy()}async function nl(){await Zd.disconnect()}function al(e){za({"@type":"updateSession",sessionData:e})}function il(e){td(e),e instanceof qe.UpdatesTooLong?async function(){try{await ol(new qe.users.GetFullUser({id:new qe.InputUserSelf}),{shouldThrow:!0})}catch(e){"AUTH_KEY_UNREGISTERED"!==e.errorMessage&&"SESSION_REVOKED"!==e.errorMessage&&"USER_DEACTIVATED"!==e.errorMessage||za({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():("updates"in e?e.updates:[e]).forEach(e=>{if(!(e instanceof qe.UpdateConfig))return;const t=e._entities?.find(e=>e instanceof qe.User&&Ra(e.id,"user")===Yd);t instanceof qe.User&&el({isPremium:Boolean(t.premium)})})}async function ol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{shouldThrow:s,shouldIgnoreUpdates:n,dcId:a,shouldIgnoreErrors:i,abortControllerChatId:r,abortControllerThreadId:c,shouldRetryOnTimeout:d,abortControllerGroup:l}=t,u=Boolean(t.shouldReturnTrue);let f;if(r){let e=Qd.get(r);e||(e=new $d,Qd.set(r,e)),f=c?e.getThreadSignal(c):e.signal}if(l){let e=Xd.get(l);e||(e=new AbortController,Xd.set(l,e)),f=e.signal}try{o&&Ha("INVOKE",e.className);const t=await Zd.invoke(e,a,f,d);return Ac(t),o&&Ha("RESPONSE",e.className,t),!n&&function(e){return e instanceof qe.UpdatesTooLong||e instanceof qe.UpdateShortMessage||e instanceof qe.UpdateShortChatMessage||e instanceof qe.UpdateShort||e instanceof qe.UpdatesCombined||e instanceof qe.Updates||e instanceof qe.UpdateShortSentMessage}(t)&&td(t),u?t&&!0:t}catch(t){if(i)return;if(o&&(Ha("INVOKE ERROR",e.className),console.debug("invokeRequest failed with payload",e),console.error(t)),(t instanceof He?t.errorMessage:t.message).includes("FROZEN_METHOD_INVALID")&&function(e,t){if(!(e instanceof He))return;const s=e.errorMessage;t instanceof qe.messages.GetPinnedDialogs||t instanceof qe.phone.GetGroupParticipants||t instanceof qe.channels.GetParticipant||t instanceof qe.channels.GetParticipants||t instanceof qe.channels.GetForumTopics||za({"@type":"notSupportedInFrozenAccount",error:{message:s}})}(t,e),s)throw t;return void function(e,t){const s=e instanceof He?e.errorMessage:e.message;za({"@type":"error",error:{message:s,isSlowMode:"FLOOD"===s&&(t instanceof qe.messages.SendMessage||t instanceof qe.messages.SendMedia||t instanceof qe.messages.SendMultiMedia),hasErrorKey:!0}})}(t,e)}}function rl(e,t){o&&Ha("BEACON",e.className),Zd.invokeBeacon(e,t)}async function cl(e,t){try{return await Wd(e,Zd,t)}catch(s){if(s instanceof He){if(s.errorMessage.startsWith("FILE_REFERENCE")){if(o&&console.warn("Trying to repair file reference",e.url),await pl({url:e.url}))return Wd(e,Zd,t);o&&console.error("Failed to repair file reference",e.url)}if("FILE_ID_INVALID"===s.errorMessage&&e.url.includes("avatar"))return void(o&&console.warn("Inaccessible avatar image",e.url))}throw o&&console.error("Failed to download media",e.url,s),s}}function dl(e,t){return Zd.uploadFile({file:e,onProgress:t,workers:f})}function ll(e){return Zd.updateTwoFaSettings(e)}function ul(e){const{chatId:t,threadId:s}=e,n=Qd.get(t);if(!s)return n?.abort("Chat change"),void Qd.delete(t);n?.abortThread(s,"Thread change")}function fl(e){Xd.get(e)?.abort(),Xd.delete(e)}async function gl(){const e=await ol(new qe.users.GetFullUser({id:new qe.InputUserSelf}));if(!(e&&e.users[0]instanceof qe.User))return;const t=e.users[0];pi(t);const s=Yi(e),n=to(t);var a;a=n.id,tc=a,function(e,t){za({"@type":"updateCurrentUser",currentUser:e,currentUserFullInfo:t})}(n,s),Yd=n.id,el({isPremium:Boolean(n.isPremium)})}async function pl(e){let{url:t}=e;const s=Kd(t);if(!s)return;const{entityId:n,mediaMatchType:a}=s;if("document"===a||"photo"===a||"webDocument"===a){const e="document"===a?an.documents[n]:"webDocument"===a?an.webDocuments[n]:an.photos[n];if(!e)return!1;const t=e;if(!t.localRepairInfo)return!1;const{localRepairInfo:s}=t;if("story"===s.type)return await async function(e,t){const s=mn(e);if(!s)return!1;const n=await ol(new qe.stories.GetStoriesByID({peer:s,id:[t]}),{shouldIgnoreErrors:!0});return!!n&&(n.stories.forEach(t=>{const s=_c(e,t);s&&!("isDeleted"in s)&&(di(t,e),za({"@type":"updateStory",peerId:e,story:s}))}),!0)}(s.peerId,s.id);if("message"===s.type){const e=await async function(e,t){const s=dn(e),n=function(e){const t=an.chats[e];if(t&&t instanceof qe.Channel)return gn(e,String(t.accessHash))}(e);let a;if(a="channel"===s&&n?await ol(new qe.channels.GetMessages({channel:n,id:[new qe.InputMessageID({id:t})]}),{shouldIgnoreErrors:!0}):await ol(new qe.messages.GetMessages({id:[new qe.InputMessageID({id:t})]}),{shouldIgnoreErrors:!0}),!a||a instanceof qe.messages.MessagesNotModified)return!1;n&&"pts"in a&&sd(e,a.pts);const i=a.messages[0];if(i instanceof qe.MessageEmpty)return!1;Rc(i);const o=ac(i);return o&&za({"@type":"updateMessage",chatId:o.chatId,id:o.id,message:o}),!0}(s.peerId,s.id);return e}}return!1}function hl(e){Zd.setForceHttpTransport(e)}function ml(e){Zd.setAllowHttpTransport(e)}function _l(e){Zd.setShouldDebugExportedSenders(e)}function yl(e){od(e)}async function bl(e){let{peer:t,reason:s,description:n=cn.STRING}=e;return await ol(new qe.account.ReportPeer({peer:un(t.id,t.accessHash),reason:En(s),message:n}))}async function wl(e){let{peer:t,photo:s,reason:n,description:a=cn.STRING}=e;const i=An(s);if(i)return await ol(new qe.account.ReportProfilePhoto({peer:un(t.id,t.accessHash),photoId:i,reason:En(n),message:a}))}async function Sl(e){let{hash:t,areCallsEnabled:s,areSecretChatsEnabled:n,isConfirmed:a}=e;return await ol(new qe.account.ChangeAuthorizationSettings({hash:Y()(t),...void 0!==s?{callRequestsDisabled:!s}:void 0,...void 0!==n?{encryptedRequestsDisabled:!n}:void 0,...a&&{confirmed:a}}))}async function Il(e){let{days:t}=e;return await ol(new qe.account.SetAuthorizationTTL({authorizationTtlDays:t}))}async function vl(e){let{slug:t}=e;const s=await ol(new qe.account.ResolveBusinessChatLink({slug:t}),{shouldIgnoreErrors:!0});var n;if(s)return{chatLink:{chatId:Ta((n=s).peer),text:go(n.message,n.entities)}}}function Pl(e){let{enabled:t}=e;return ol(new qe.account.ToggleSponsoredMessages({enabled:t}),{shouldReturnTrue:!0})}function Cl(e){return{days:e.days}}function Ml(e){return new qe.AccountDaysTTL({days:e})}async function Al(){const e=await ol(new qe.account.GetAccountTTL);if(e)return Cl(e)}function Rl(e){let{days:t}=e;return ol(new qe.account.SetAccountTTL({ttl:Ml(t)}),{shouldReturnTrue:!0})}const Tl=100,kl=100,Dl=100,Ul=50,El=100,Bl=20,xl=100,Vl=50,Nl=100,Gl={uploadMaxFileparts:[4e3,8e3],stickersFaved:[5,10],savedGifs:[200,400],dialogFiltersChats:[100,200],dialogFilters:[10,20],dialogFolderPinned:[5,10],captionLength:[1024,4096],channels:[500,1e3],channelsPublic:[10,20],aboutLength:[70,140],chatlistInvites:[3,100],chatlistJoined:[2,20],recommendedChannels:[10,100],savedDialogsPinned:[5,100],maxReactions:[1,3],moreAccounts:[3,6]},Fl={hash:0,limits:{uploadMaxFileparts:Gl.uploadMaxFileparts,stickersFaved:Gl.stickersFaved,savedGifs:Gl.savedGifs,dialogFiltersChats:Gl.dialogFiltersChats,dialogFilters:Gl.dialogFilters,dialogFolderPinned:Gl.dialogFolderPinned,captionLength:Gl.captionLength,channels:Gl.channels,channelsPublic:Gl.channelsPublic,aboutLength:Gl.aboutLength,chatlistInvites:Gl.chatlistInvites,chatlistJoined:Gl.chatlistJoined,recommendedChannels:Gl.recommendedChannels,savedDialogsPinned:Gl.savedDialogsPinned,moreAccounts:Gl.moreAccounts,maxReactions:Gl.maxReactions},autologinDomains:["instantview.telegram.org","translations.telegram.org","contest.dev","contest.com","bugs.telegram.org","suggestions.telegram.org","themes.telegram.org","promote.telegram.org","ads.telegram.org"],channelLevelMax:100,boostsPerSentGift:3,channelRestrictAdsLevelMin:50,seenByExpiresAt:604800,seenByMaxChatMembers:100,defaultEmojiStatusesStickerSetId:"773947703670341676",emojiSounds:{},giveawayAddPeersMax:10,giveawayBoostsPerPremium:4,giveawayCountriesMax:10,isGiveawayGiftsPurchaseAvailable:!1,groupTranscribeLevelMin:6,hiddenMembersMinCount:100,ignoreRestrictionReasons:[],canLimitNewMessagesWithoutPremium:!1,readDateExpiresAt:604800,premiumBotUsername:"PremiumBot",premiumPromoOrder:["stories","more_upload","double_limits","last_seen","voice_to_text","faster_download","translations","animated_emoji","emoji_status","saved_tags","profile_badge","message_privacy","advanced_chat_management","no_ads","infinite_reactions","animated_userpics","premium_stickers","effects"],isPremiumPurchaseBlocked:!1,maxUniqueReactions:11,starGiftMaxConvertPeriod:7776e3,starGiftMaxMessageLength:255,starRefStartPrefixes:["_tgr_"],isStarsGiftEnabled:!0,paidReactionMaxAmount:2500,starsUsdWithdrawRateX1000:1300,storyChangelogUserId:"777000",maxPinnedStoriesCount:3,starsSuggestedPostAmountMax:1e5,starsSuggestedPostAmountMin:5,starsSuggestedPostAgeMin:86400,starsSuggestedPostFutureMin:300,starsSuggestedPostFutureMax:2678400,starsSuggestedPostCommissionPermille:850,tonSuggestedPostCommissionPermille:850,todoItemLengthMax:64,todoItemsMax:30,todoTitleLengthMax:32,tonSuggestedPostAmountMax:1e13,tonSuggestedPostAmountMin:1e7,tonTopupUrl:"https://fragment.com/ads/topup",storyViewersExpirePeriod:86400,topicsPinnedLimit:5,bandwidthPremiumDownloadSpeedup:10,bandwidthPremiumNotifyPeriod:3600,bandwidthPremiumUploadSpeedup:10,urlAuthDomains:["web.telegram.org","web.t.me","k.t.me","z.t.me","a.t.me"],whitelistedDomains:["telegram.dog","telegram.me","telegram.org","t.me","telesco.pe","fragment.com","translations.telegram.org"]};async function ql(e){let{limit:t,offsetDate:s,offsetPeer:n,offsetId:a,archived:i,withPinned:o,lastLocalServiceMessageId:r}=e;const c=n&&un(n.id,n.accessHash)||new qe.InputPeerEmpty,d=await ol(new qe.messages.GetDialogs({hash:cn.BIGINT,offsetPeer:c,offsetId:a??cn.INT,limit:t,offsetDate:s??cn.INT,folderId:i?O:void 0,...o&&{excludePinned:!0}})),l=o?await ol(new qe.messages.GetPinnedDialogs({folderId:i?O:L})):void 0;if(!d||d instanceof qe.messages.DialogsNotModified)return;const u=(l?l.messages:[]).concat(d.messages).map(ac).filter(Boolean),f=Vu(d);l&&Object.assign(f,Vu(l,f));const g=[],p={},h={},m=(l?.dialogs||[]).concat(d.dialogs),_=[],y={};m.forEach(e=>{if(!(e instanceof qe.Dialog)||!i&&e.folderId===O||i&&e.folderId!==O)return;const t=Yo(e,f[ir(e.peer)]);y[t.id]=e.topMessage,e.pts&&sd(t.id,e.pts),t.id===F&&r&&r>e.topMessage&&(y[t.id]=r),t.isListed=!0,g.push(t);const s=Lo(e.notifySettings);if(Object.values(qs(s)).length&&(h[t.id]=s,s.mutedUntil&&Hc(t.id,s.mutedUntil,za)),o&&e.pinned&&_.push(t.id),e.draft){const s=oc(e.draft);s&&(p[t.id]=s)}});const b=g.map(e=>e.id),w=d.users.map(to).filter(Boolean),S=no((l?.users||[]).concat(d.users));let I;I=d instanceof qe.messages.DialogsSlice?d.count:b.length;const v=g[g.length-1],P=y[v?.id],C=P,M=v?.id,A=u.reverse().find(e=>e.chatId===v?.id&&e.id===P)?.date;return{chatIds:b,chats:g,users:w,userStatusesById:S,draftsById:p,orderedPinnedIds:o?_:void 0,totalChatCount:I,lastMessageByChatId:y,messages:u,notifyExceptionById:h,nextOffsetId:C,nextOffsetPeerId:M,nextOffsetDate:A}}async function Hl(e){let{limit:t,offsetDate:s,offsetPeer:n,offsetId:a,withPinned:i}=e;const o=n&&un(n.id,n.accessHash)||new qe.InputPeerEmpty,r=await ol(new qe.messages.GetSavedDialogs({offsetPeer:o,offsetId:a??cn.INT,limit:t,offsetDate:s??cn.INT,hash:cn.BIGINT,...i&&{excludePinned:!0}})),c=i?await ol(new qe.messages.GetPinnedSavedDialogs):void 0;if(!r||r instanceof qe.messages.SavedDialogsNotModified)return;const d=c&&!(c instanceof qe.messages.SavedDialogsNotModified),l=(d?c.messages:[]).concat(r.messages).map(ac).filter(Boolean),u=Vu(r);d&&Object.assign(u,Vu(c,u));const f=(d?c.dialogs:[]).concat(r.dialogs),g=[],p=[],h={},m=[];f.forEach(e=>{if(e instanceof qe.MonoForumDialog)return;const t=function(e,t){const{peer:s}=e;return{id:Ta(s),type:ar(t),title:or(s,t),...Zo(t)}}(e,u[ir(e.peer)]),s=Ta(e.peer);g.push(s),i&&e.pinned&&p.push(s),h[s]=e.topMessage,m.push(t)});const _=r.users.map(to).filter(Boolean),y=no((d?c.users:[]).concat(r.users));let b;b=r instanceof qe.messages.SavedDialogsSlice?r.count:g.length;const w=m[m.length-1],S=h[w?.id],I=S,v=w?.id,P=l.reverse().find(e=>e.chatId===w?.id&&e.id===S)?.date;return{chatIds:g,chats:m,users:_,userStatusesById:y,orderedPinnedIds:i?p:void 0,totalChatCount:b,lastMessageByChatId:h,messages:l,draftsById:{},notifyExceptionById:{},nextOffsetId:I,nextOffsetPeerId:v,nextOffsetDate:P}}const Ll=new Map;async function Ol(e){const{id:t}=e;if(Ll.has(t))return Ll.get(t);const s="channel"===dn(e.id)?async function(e){const{id:t,adminRights:s,isMonoforum:n}=e,a=e.accessHash,i=await ol(new qe.channels.GetFullChannel({channel:gn(t,a)}));if(!(i&&i.fullChat instanceof qe.ChannelFull))return;const{about:o,onlineCount:r,exportedInvite:c,slowmodeSeconds:d,slowmodeNextSendDate:l,migratedFromChatId:u,migratedFromMaxId:f,canViewParticipants:g,canViewStats:p,linkedChatId:h,hiddenPrehistory:m,call:_,botInfo:y,availableReactions:b,reactionsLimit:w,defaultSendAs:S,requestsPending:I,recentRequesters:v,statsDc:P,participantsCount:C,stickerset:M,chatPhoto:A,participantsHidden:R,translationsDisabled:T,storiesPinnedAvailable:k,viewForumAsMessages:D,emojiset:U,boostsApplied:E,boostsUnrestrict:B,botVerification:x,canViewRevenue:V,paidReactionsAvailable:N,hasScheduled:G,stargiftsCount:F,stargiftsAvailable:q,paidMessagesAvailable:H}=i.fullChat;A&&li(A);const L=c instanceof qe.ChatInviteExported?c.link:void 0,O=g&&!n,{members:j,userStatusesById:W}=O&&await Mu({chat:e})||{},{members:z,userStatusesById:K}=O&&s&&await Mu({chat:e,memberFilter:"kicked"})||{},{members:$,userStatusesById:J}=O&&await Mu({chat:e,memberFilter:"admin"})||{},Q=y?gr(y):void 0,X=e.isNotJoined||"chatTypeChannel"!==e.type?void 0:await Au({chat:e}),Z=X?.member,Y=Z?.joinedDate?{joinedDate:Z.joinedDate,inviterId:Z.inviterId,isViaRequest:Z.isViaRequest}:void 0,ee=i.chats.map(e=>nr(e)).filter(Boolean);if(i?.chats?.length>1){const[,e]=i.chats,t=nr(e);t&&za({"@type":"updateChat",id:t.id,chat:t})}i.fullChat.pts&&sd(e.id,i.fullChat.pts);const te={...W,...K,...J},se=_ instanceof qe.InputGroupCall?_:void 0;return{fullInfo:{...A instanceof qe.Photo&&{profilePhoto:Ii(A)},about:o,onlineCount:r,inviteLink:L,slowMode:d?{seconds:d,nextSendDate:l}:void 0,migratedFrom:u?{chatId:Ra(u,"chat"),maxMessageId:f}:void 0,canViewMembers:O,canViewStatistics:p,canViewMonetization:V,isPreHistoryHidden:m,joinInfo:Y,members:j,kickedMembers:z,adminMembersById:$?xs($,"userId"):void 0,groupCallId:se?String(se.id):void 0,linkedChatId:h?Ra(h,"channel"):void 0,botCommands:Q,enabledReactions:hr(b),reactionsLimit:w,sendAsId:S?Ta(S):void 0,requestsPending:I,recentRequesterIds:v?.map(e=>Ra(e,"user")),statisticsDcId:P,stickerSet:M?Bi(M):void 0,emojiSet:U?Bi(U):void 0,areParticipantsHidden:R,isTranslationDisabled:T,hasPinnedStories:Boolean(k),boostsApplied:E,boostsToUnrestrict:B,botVerification:x&&Di(x),isPaidReactionAvailable:N,hasScheduledMessages:G,starGiftCount:F,areStarGiftsAvailable:Boolean(q),arePaidMessagesAvailable:H},chats:ee,userStatusesById:te,groupCall:se?{chatId:t,isLoaded:!1,id:se.id.toString(),accessHash:se?.accessHash.toString(),participants:{},version:0,participantsCount:0,connectionState:"disconnected"}:void 0,membersCount:C,...D&&{isForumAsMessages:!0}}}(e):async function(e){const t=await ol(new qe.messages.GetFullChat({chatId:pn(e)}));if(!(t&&t.fullChat instanceof qe.ChatFull))return;const{about:s,participants:n,exportedInvite:a,botInfo:i,call:o,availableReactions:r,recentRequesters:c,requestsPending:d,chatPhoto:l,translationsDisabled:u,reactionsLimit:f,hasScheduled:g}=t.fullChat;l&&li(l);const p=dr(n),h=p?p.filter(e=>{let{isAdmin:t,isOwner:s}=e;return t||s}):void 0,m=i?gr(i):void 0,_=a instanceof qe.ChatInviteExported?a.link:void 0,y=no(t.users),b=t.chats.map(e=>nr(e)).filter(Boolean),w=o instanceof qe.InputGroupCall?o:void 0;return{fullInfo:{...l instanceof qe.Photo&&{profilePhoto:Ii(l)},about:s,members:p,adminMembersById:h?xs(h,"userId"):void 0,canViewMembers:!0,botCommands:m,inviteLink:_,groupCallId:w?.id.toString(),enabledReactions:hr(r),reactionsLimit:f,requestsPending:d,recentRequesterIds:c?.map(e=>Ra(e,"user")),isTranslationDisabled:u,isPreHistoryHidden:!0,hasScheduledMessages:g},chats:b,userStatusesById:y,groupCall:w?{chatId:e,isLoaded:!1,id:w.id.toString(),accessHash:w.accessHash.toString(),connectionState:"disconnected",participantsCount:0,version:0,participants:{}}:void 0,membersCount:p?.length}}(t);return Ll.set(t,s),s.finally(()=>{Ll.delete(t)}),s}async function jl(e){const{id:t,accessHash:s}=e,n=await ol(new qe.messages.GetPeerSettings({peer:un(t,s)}),{abortControllerChatId:t});if(n)return{settings:eo(n.settings)}}async function Wl(e){let{query:t}=e;const s=await ol(new qe.contacts.Search({q:t,limit:Bl}));if(!s)return;const n=s.myResults.map(Ta),a=s.results.map(Ta).filter(e=>!n.includes(e));return{accountResultIds:n,globalResultIds:a}}async function zl(e){let t,{type:s,user:n}=e;if("self"===s||"user"===s){const e=await ol(new qe.users.GetUsers({id:["user"===s&&n?fn(n.id,n.accessHash):new qe.InputUserSelf]}));if(!e||!e.length)return;[t]=e}else if("support"===s){const e=await ol(new qe.help.GetSupport);if(!e||!e.user)return;t=e.user}const a=nr(t,"support"===s);if(a)return za({"@type":"updateChat",id:a.id,chat:a}),{chatId:a.id}}async function Kl(e){let{chat:t,lastLocalMessage:s,noLastMessage:n}=e;const{id:a,accessHash:i}=t,o=await ol(new qe.messages.GetPeerDialogs({peers:[new qe.InputDialogPeer({peer:un(a,i)})]}));if(!o)return;const r=o.dialogs[0];if(!(r&&r instanceof qe.Dialog))return;const c=Vu(o)[ir(r.peer)];if(!c)return;const d=ac(o.messages[0]),l=s&&(!d||s.date>d.date)?s:d,u=Yo(r,c);za({"@type":"updateChat",id:a,chat:u}),!n&&l&&za({"@type":"updateChatLastMessage",id:a,lastMessage:l}),ed(o.state);const f=Lo(r.notifySettings);f.mutedUntil&&Hc(u.id,f.mutedUntil,za)}function $l(e){let{chat:t,draft:s}=e;return ol(new qe.messages.SaveDraft({peer:un(t.id,t.accessHash),message:s?.text?.text||cn.STRING,entities:s?.text?.entities?.map(Mn),replyTo:s?.replyInfo&&Wn(s.replyInfo),suggestedPost:s?.suggestedPostInfo&&Kn(s.suggestedPostInfo)}))}function Jl(e){let{chat:t,settings:s}=e;ol(new qe.account.UpdateNotifySettings({peer:new qe.InputNotifyPeer({peer:un(t.id,t.accessHash)}),settings:new qe.InputPeerNotifySettings({muteUntil:s.mutedUntil,showPreviews:s.shouldShowPreviews,silent:s.isSilentPosting})})),za({"@type":"updateChatNotifySettings",chatId:t.id,settings:s}),Kl({chat:t,noLastMessage:!0})}function Ql(e){let{chat:t,topicId:s,mutedUntil:n}=e;ol(new qe.account.UpdateNotifySettings({peer:new qe.InputNotifyForumTopic({peer:un(t.id,t.accessHash),topMsgId:s}),settings:new qe.InputPeerNotifySettings({muteUntil:n})})),za({"@type":"updateTopicNotifySettings",chatId:t.id,topicId:s,settings:{mutedUntil:n}})}async function Xl(e){let{title:t,about:s=cn.STRING,users:n,isBroadcast:a,isMegagroup:i}=e;const r=await ol(new qe.channels.CreateChannel({broadcast:a,title:t,about:s,megagroup:i}),{shouldThrow:!0});if(!(r instanceof qe.Updates))return void(o&&console.error("Unexpected channel creation update",r));const c=r.chats[0];if(!(c&&c instanceof qe.Channel))return void(o&&console.error("Created channel not found",r));const d=nr(c);let l;if(n?.length){const e=await ol(new qe.channels.InviteToChannel({channel:gn(d.id,d.accessHash),users:n.map(e=>{let{id:t,accessHash:s}=e;return fn(t,s)})}));if(!e)return;il(e.updates),l=e.missingInvitees.map(br)}return{channel:d,missingUsers:l}}function Zl(e){let{channelId:t,accessHash:s}=e;return ol(new qe.channels.JoinChannel({channel:gn(t,s)}),{shouldReturnTrue:!0,shouldThrow:!0})}function Yl(e){let{chat:t,user:s,shouldRevokeHistory:n}=e;if("chatTypeBasicGroup"===t.type)return ol(new qe.messages.DeleteChatUser({chatId:pn(t.id),userId:fn(s.id,s.accessHash),revokeHistory:n||void 0}),{shouldReturnTrue:!0})}function eu(e){let{chatId:t}=e;return ol(new qe.messages.DeleteChat({chatId:pn(t)}),{shouldReturnTrue:!0})}function tu(e){let{channelId:t,accessHash:s}=e;return ol(new qe.channels.LeaveChannel({channel:gn(t,s)}),{shouldReturnTrue:!0})}function su(e){let{channelId:t,accessHash:s}=e;return ol(new qe.channels.DeleteChannel({channel:gn(t,s)}),{shouldReturnTrue:!0})}async function nu(e){let{title:t,users:s}=e;const n=await ol(new qe.messages.CreateChat({title:t,users:s.map(e=>{let{id:t,accessHash:s}=e;return fn(t,s)})}));if(!n)return;il(n.updates);const a=n.missingInvitees.map(br),i=n.updates.chats[0];if(i&&i instanceof qe.Chat)return{chat:nr(i),missingUsers:a};o&&console.error("Created chat not found",n.updates)}async function au(e){let{chatId:t,accessHash:s,photo:n}=e;const a=dn(t);let i;if(n instanceof File){const e=await dl(n);i=new qe.InputChatUploadedPhoto({file:e})}else if(n){const e=An(n);if(!e)return!1;i=new qe.InputChatPhoto({id:e})}else i=new qe.InputChatPhotoEmpty;return ol("channel"===a?new qe.channels.EditPhoto({channel:gn(t,s),photo:i}):new qe.messages.EditChatPhoto({chatId:pn(t),photo:i}),{shouldReturnTrue:!0})}async function iu(e){let{chat:t,shouldBePinned:s}=e;const{id:n,accessHash:a}=t;await ol(new qe.messages.ToggleDialogPin({peer:new qe.InputDialogPeer({peer:un(n,a)}),pinned:s||void 0}))&&za({"@type":"updateChatPinned",id:t.id,isPinned:s})}async function ou(e){let{chat:t,shouldBePinned:s}=e;const{id:n,accessHash:a}=t;await ol(new qe.messages.ToggleSavedDialogPin({peer:new qe.InputDialogPeer({peer:un(n,a)}),pinned:s||void 0}))&&za({"@type":"updateSavedDialogPinned",id:t.id,isPinned:s})}function ru(e){let{chat:t,folderId:s}=e;const{id:n,accessHash:a}=t;return ol(new qe.folders.EditPeerFolders({folderPeers:[new qe.InputFolderPeer({peer:un(n,a),folderId:s})]}),{shouldReturnTrue:!0})}async function cu(){const e=await ol(new qe.messages.GetDialogFilters);if(!e)return;const{filters:t,tagsEnabled:s}=e,n=t.findIndex(e=>e instanceof qe.DialogFilterDefault),a=t.filter(Ga),i=a.map(e=>{let{id:t}=e;return t});return-1!==n&&i.splice(n,0,L),{byId:xs(a.map(ur),"id"),orderedIds:i,areTagsEnabled:s}}async function du(e){let{listType:t}=e;const s=await ol(new qe.messages.GetPinnedDialogs({folderId:"archived"===t?O:L}));if(!s)return;const{dialogs:n,messages:a,chats:i,users:o}=s;return{dialogIds:n.map(e=>Ta(e.peer)),messages:a.map(e=>ac(e)).filter(Boolean),chats:i.map(e=>nr(e)).filter(Boolean),users:o.map(e=>to(e)).filter(Boolean)}}async function lu(){const e=await ol(new qe.messages.GetSuggestedDialogFilters);if(e)return e.map(fr).filter(Boolean)}async function uu(e){let{id:t,folderUpdate:s}=e;s.excludedChatIds=s.excludedChatIds.filter(e=>!s.includedChatIds.includes(e));const n=function(e){const{emoticon:t,contacts:s,nonContacts:n,groups:a,channels:i,bots:o,color:r,excludeArchived:c,excludeMuted:d,excludeRead:l,pinnedChatIds:u,includedChatIds:f,excludedChatIds:g,noTitleAnimations:p}=e,h=u?u.map(mn).filter(Boolean):[],m=f?f.map(mn).filter(Boolean):[],_=g?g.map(mn).filter(Boolean):[];return e.isChatList?new qe.DialogFilterChatlist({id:e.id,title:On(e.title),color:r,emoticon:t||void 0,pinnedPeers:h,includePeers:m,hasMyInvites:e.hasMyInvites,titleNoanimate:p}):new qe.DialogFilter({id:e.id,title:On(e.title),emoticon:t||void 0,contacts:s||void 0,nonContacts:n||void 0,groups:a||void 0,bots:o||void 0,color:r,excludeArchived:c||void 0,excludeMuted:d||void 0,excludeRead:l||void 0,broadcasts:i||void 0,pinnedPeers:h,includePeers:m,excludePeers:_,titleNoanimate:p})}(s);await ol(new qe.messages.UpdateDialogFilter({id:t,filter:n}))&&za({"@type":"updateChatFolder",id:t,folder:s})}async function fu(e){const t=await ol(new qe.messages.UpdateDialogFilter({id:e,filter:void 0})),s=await lu();t&&za({"@type":"updateChatFolder",id:e,folder:void 0}),s&&za({"@type":"updateRecommendedChatFolders",folders:s})}function gu(e){return ol(new qe.messages.UpdateDialogFiltersOrder({order:e}))}function pu(e){return ol(new qe.messages.ToggleDialogFilterTags({enabled:e}))}async function hu(e){let{chat:t,hasUnreadMark:s}=e;const{id:n,accessHash:a}=t;await ol(new qe.messages.MarkDialogUnread({peer:new qe.InputDialogPeer({peer:un(n,a)}),unread:s||void 0}))&&za({"@type":"updateChat",id:t.id,chat:{hasUnreadMark:s}})}async function mu(e){return yu(await ol(new qe.contacts.ResolvePhone({phone:e})))}async function _u(e,t){return yu(await ol(new qe.contacts.ResolveUsername({username:e,referer:t})))}function yu(e){if(!e)return;const{users:t,chats:s}=e,n=s.length?nr(s[0]):nr(t[0]);return n?{chat:n,user:to(t[0])}:void 0}function bu(e){let{chat:t,isEnabled:s}=e;const{id:n,accessHash:a}=t,i=gn(n,a);return ol(new qe.channels.TogglePreHistoryHidden({channel:i,enabled:s}),{shouldReturnTrue:!0})}function wu(e){let{chat:t,bannedRights:s}=e;const{id:n,accessHash:a}=t,i=un(n,a);return ol(new qe.messages.EditChatDefaultBannedRights({peer:i,bannedRights:Tn(s)}),{shouldReturnTrue:!0})}function Su(e){let{chat:t,user:s,bannedRights:n,untilDate:a}=e;const i=gn(t.id,t.accessHash),o=un(s.id,s.accessHash);return ol(new qe.channels.EditBanned({channel:i,participant:o,bannedRights:Tn(n,a)}),{shouldReturnTrue:!0})}function Iu(e){let{chat:t,user:s,adminRights:n,customTitle:a=cn.STRING}=e;const i=gn(t.id,t.accessHash),o=fn(s.id,s.accessHash);return ol(new qe.channels.EditAdmin({channel:i,userId:o,adminRights:kn(n),rank:a}),{shouldReturnTrue:!0})}async function vu(e,t){const s=dn(e.id);await ol("channel"===s?new qe.channels.EditTitle({channel:gn(e.id,e.accessHash),title:t}):new qe.messages.EditChatTitle({chatId:pn(e.id),title:t}),{shouldReturnTrue:!0})}async function Pu(e,t){await ol(new qe.messages.EditChatAbout({peer:un(e.id,e.accessHash),about:t}))&&za({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function Cu(e){let{chat:t,areSignaturesEnabled:s,areProfilesEnabled:n}=e;const{id:a,accessHash:i}=t,o=gn(a,i);return ol(new qe.channels.ToggleSignatures({channel:o,signaturesEnabled:s||void 0,profilesEnabled:n||void 0}),{shouldReturnTrue:!0})}async function Mu(e){let t,{chat:s,memberFilter:n="recent",offset:a,query:i=cn.STRING}=e;switch(n){case"kicked":t=new qe.ChannelParticipantsKicked({q:i});break;case"admin":t=new qe.ChannelParticipantsAdmins;break;case"search":t=new qe.ChannelParticipantsSearch({q:i});break;default:t=new qe.ChannelParticipantsRecent}const o=await ol(new qe.channels.GetParticipants({channel:gn(s.id,s.accessHash),filter:t,offset:a??cn.INT,hash:cn.BIGINT,limit:g}),{abortControllerChatId:s.id});if(!o||o instanceof qe.channels.ChannelParticipantsNotModified)return;const r=no(o.users);return{members:dr(o),userStatusesById:r}}async function Au(e){let{chat:t,peer:s}=e;const n=s?un(s.id,s.accessHash):new qe.InputPeerSelf,a=await ol(new qe.channels.GetParticipant({channel:gn(t.id,t.accessHash),participant:n}),{abortControllerChatId:t.id});if(!a)return;const i=no(a.users),o=cr(a.participant);return o?{member:o,userStatusesById:i}:void 0}async function Ru(){const e=await ol(new qe.channels.GetGroupsForDiscussion);if(e)return e.chats.map(e=>nr(e))}function Tu(e){let{channel:t,chat:s}=e;return ol(new qe.channels.SetDiscussionGroup({broadcast:gn(t.id,t.accessHash),group:s?gn(s.id,s.accessHash):new qe.InputChannelEmpty}),{shouldReturnTrue:!0})}async function ku(e){const t=await ol(new qe.messages.MigrateChat({chatId:pn(e.id)}),{shouldThrow:!0});if(!(t&&t instanceof qe.Updates))return void(o&&console.error("Unexpected channel creation update",t));const s=t.updates.find(e=>e instanceof qe.UpdateChannel).channelId;return nr(t.chats.find(e=>e instanceof qe.Channel&&e.id.toString()===s.toString()))}async function Du(e){const t=await ol(new qe.messages.CheckChatInvite({hash:e}));if(!t)return;if(t instanceof qe.ChatInvite)return{chat:void 0,invite:wr(t),users:t.participants?.map(to).filter(Boolean)};const s=nr(t.chat);return s?{chat:s,invite:void 0,users:void 0}:void 0}async function Uu(e,t){try{if("chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type){const s=await ol(new qe.channels.InviteToChannel({channel:gn(e.id,e.accessHash),users:t.map(e=>fn(e.id,e.accessHash))}));if(!s)return;return il(s.updates),s.missingInvitees.map(br)}const s=await Promise.all(t.map(async t=>{const s=await ol(new qe.messages.AddChatUser({chatId:pn(e.id),userId:fn(t.id,t.accessHash),fwdLimit:cn.INT}));if(s)return il(s.updates),s.missingInvitees.map(br)}));if(s)return s.flat().filter(Boolean)}catch(e){za({"@type":"error",error:{message:e instanceof He?e.errorMessage:e.message}})}}function Eu(e,t){return ol(new qe.messages.DeleteChatUser({chatId:pn(e.id),userId:fn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function Bu(e,t){return ol(new qe.channels.ToggleJoinToSend({channel:gn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function xu(e,t){return ol(new qe.channels.ToggleJoinRequest({channel:gn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function Vu(e,t){const s={};return e.chats?.forEach(e=>{const n=`chat${e.id.toString()}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)}),e.users?.forEach(e=>{const n=`user${e.id.toString()}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)}),s}async function Nu(e){let{hash:t}=e;const s=await ol(new qe.messages.ImportChatInvite({hash:t}));if(s instanceof qe.Updates&&s.chats.length)return nr(s.chats[0])}function Gu(e){let{chat:t,enabledReactions:s,reactionsLimit:n}=e;return ol(new qe.messages.SetChatAvailableReactions({peer:un(t.id,t.accessHash),availableReactions:(a=s,"all"===a?.type?new qe.ChatReactionsAll({allowCustom:a.areCustomAllowed}):"some"===a?.type?new qe.ChatReactionsSome({reactions:a.allowed.map(Hn)}):new qe.ChatReactionsNone),reactionsLimit:n}),{shouldReturnTrue:!0});var a}function Fu(e){let{chat:t,isProtected:s}=e;const{id:n,accessHash:a}=t;return ol(new qe.messages.ToggleNoForwards({peer:un(n,a),enabled:s}),{shouldReturnTrue:!0})}function qu(e){let{chat:t,isEnabled:s}=e;const{id:n,accessHash:a}=t;return ol(new qe.channels.ToggleParticipantsHidden({channel:gn(n,a),enabled:s}),{shouldReturnTrue:!0})}function Hu(e){let{chat:t,isEnabled:s}=e;const{id:n,accessHash:a}=t;return ol(new qe.channels.ToggleForum({channel:gn(n,a),enabled:s,tabs:Boolean(t.withForumTabs)}),{shouldReturnTrue:!0,shouldThrow:!0})}async function Lu(e){let{chat:t,title:s,iconColor:n,iconEmojiId:a,sendAs:i}=e;const{id:o,accessHash:r}=t,c=await ol(new qe.channels.CreateForumTopic({channel:gn(o,r),title:s,iconColor:n,iconEmojiId:a?Y()(a):void 0,sendAs:i?un(i.id,i.accessHash):void 0,randomId:In()}));if(c instanceof qe.Updates&&c.updates.length)return c.updates?.find(e=>e instanceof qe.UpdateMessageID)?.id}async function Ou(e){let{chat:t,query:s,offsetTopicId:n,offsetId:a,offsetDate:i,limit:o=_}=e;const{id:r,accessHash:c}=t,d=await ol(new qe.channels.GetForumTopics({channel:gn(r,c),limit:o,q:s,offsetTopic:n??cn.INT,offsetId:a??cn.INT,offsetDate:i??cn.INT}));if(!d)return;const{count:l,orderByCreateDate:u}=d;return{topics:d.topics.map(_r).filter(Boolean),messages:d.messages.map(ac).filter(Boolean),count:l+1,shouldOrderByCreateDate:u,draftsById:d.topics.reduce((e,t)=>(t instanceof qe.ForumTopic&&t.draft&&(e[t.id]=oc(t.draft)),e),{}),readInboxMessageIdByTopicId:d.topics.reduce((e,t)=>(t instanceof qe.ForumTopic&&t.readInboxMaxId&&(e[t.id]=t.readInboxMaxId),e),{})}}async function ju(e){let{chat:t,topicId:s}=e;const{id:n,accessHash:a}=t,i=await ol(new qe.channels.GetForumTopicsByID({channel:gn(n,a),topics:[s]}));if(!(i?.topics.length&&i.topics[0]instanceof qe.ForumTopic))return;const o=i.messages.map(ac).filter(Boolean);return{topic:_r(i.topics[0]),messages:o}}async function Wu(e){let{chat:t,topicId:s}=e;const{id:n,accessHash:a}=t,i=await ol(new qe.channels.DeleteTopicHistory({channel:gn(n,a),topMsgId:s}));i&&(gd(t,i),i.offset&&await Wu({chat:t,topicId:s}))}function zu(e){let{chat:t,topicId:s,isPinned:n}=e;const{id:a,accessHash:i}=t;return ol(new qe.channels.UpdatePinnedForumTopic({channel:gn(a,i),topicId:s,pinned:n}),{shouldReturnTrue:!0})}function Ku(e){let{chat:t,topicId:s,title:n,iconEmojiId:a,isClosed:i,isHidden:o}=e;const{id:r,accessHash:c}=t;return ol(new qe.channels.EditForumTopic({channel:gn(r,c),topicId:s,title:n,iconEmojiId:s!==W&&a?Y()(a):void 0,closed:i,hidden:o}),{shouldReturnTrue:!0})}async function $u(e){let{slug:t}=e;const s=await ol(new qe.chatlists.CheckChatlistInvite({slug:t})),n=function(e,t){return e instanceof qe.chatlists.ChatlistInvite?{slug:t,title:Ri(e.title),noTitleAnimations:e.titleNoanimate,emoticon:e.emoticon,peerIds:e.peers.map(Ta).filter(Boolean)}:e instanceof qe.chatlists.ChatlistInviteAlready?{slug:t,folderId:e.filterId,missingPeerIds:e.missingPeers.map(Ta).filter(Boolean),alreadyPeerIds:e.alreadyPeers.map(Ta).filter(Boolean)}:void 0}(s,t);if(s&&n)return{invite:n}}function Ju(e){let{slug:t,peers:s}=e;return ol(new qe.chatlists.JoinChatlistInvite({slug:t,peers:s.map(e=>un(e.id,e.accessHash))}),{shouldReturnTrue:!0,shouldThrow:!0})}async function Qu(e){let{folderId:t}=e;const s=await ol(new qe.chatlists.GetLeaveChatlistSuggestions({chatlist:new qe.InputChatlistDialogFilter({filterId:t})}));if(s)return s.map(Ta)}function Xu(e){let{folderId:t,peers:s}=e;return ol(new qe.chatlists.LeaveChatlist({chatlist:new qe.InputChatlistDialogFilter({filterId:t}),peers:s.map(e=>un(e.id,e.accessHash))}),{shouldReturnTrue:!0})}async function Zu(e){let{folderId:t,title:s=cn.STRING,peers:n}=e;const a=await ol(new qe.chatlists.ExportChatlistInvite({chatlist:new qe.InputChatlistDialogFilter({filterId:t}),title:s,peers:n.map(e=>un(e.id,e.accessHash))}),{shouldThrow:!0});if(a&&!(a.filter instanceof qe.DialogFilterDefault))return{filter:ur(a.filter),invite:yr(a.invite)}}function Yu(e){let{folderId:t,slug:s}=e;return ol(new qe.chatlists.DeleteExportedInvite({chatlist:new qe.InputChatlistDialogFilter({filterId:t}),slug:s}))}async function ef(e){let{folderId:t,slug:s,title:n,peers:a}=e;const i=await ol(new qe.chatlists.EditExportedInvite({chatlist:new qe.InputChatlistDialogFilter({filterId:t}),slug:s,title:n,peers:a.map(e=>un(e.id,e.accessHash))}),{shouldThrow:!0});if(i)return yr(i)}async function tf(e){let{folderId:t}=e;const s=await ol(new qe.chatlists.GetExportedInvites({chatlist:new qe.InputChatlistDialogFilter({filterId:t})}));if(s)return{invites:s.invites.map(yr).filter(Boolean)}}function sf(e){let{chat:t,isEnabled:s}=e;return ol(new qe.messages.TogglePeerTranslations({disabled:!s||void 0,peer:un(t.id,t.accessHash)}))}function nf(e){let{chat:t,isEnabled:s}=e;const{id:n,accessHash:a}=t,i=gn(n,a);return ol(new qe.channels.ToggleViewForumAsMessages({channel:i,enabled:Boolean(s)}),{shouldReturnTrue:!0})}async function af(e){let{chat:t}=e;const s=await ol(new qe.channels.GetChannelRecommendations({channel:t&&gn(t.id,t.accessHash)}));if(!s)return;const n=s?.chats.map(e=>nr(e)).filter(Boolean);return{similarChannels:n,count:s instanceof qe.messages.ChatsSlice?s.count:n.length}}function of(e){let{chat:t,paidMessagesStars:s}=e;return ol(new qe.channels.UpdatePaidMessagesPrice({channel:t?gn(t.id,t.accessHash):new qe.InputChannelEmpty,sendPaidMessagesStars:Y()(s)}),{shouldReturnTrue:!0})}async function rf(e){let{query:t}=e;const s=await ol(new qe.contacts.GetSponsoredPeers({q:t}));if(s&&!(s instanceof qe.contacts.SponsoredPeersEmpty))return function(e){const{peer:t,randomId:s,additionalInfo:n,sponsorInfo:a}=e;return{peerId:Ta(t),randomId:Fa(s),additionalInfo:n,sponsorInfo:a}}(s.peers[0])}function cf(e){let{chat:t,isEnabled:s}=e;return ol(new qe.channels.ToggleAutotranslation({channel:gn(t.id,t.accessHash),enabled:s}),{shouldReturnTrue:!0})}var df=s(48287).hp;const lf=1e3,uf=63;async function ff(e){let{chat:t,threadId:s,offsetId:n,isSavedDialog:a,addOffset:i,limit:o}=e;const r=s===Us?qe.messages.GetHistory:a?qe.messages.GetSavedHistory:qe.messages.GetReplies;let c;try{c=await ol(new r({hash:cn.BIGINT,maxId:cn.INT,minId:cn.INT,offsetDate:cn.INT,peer:un(t.id,t.accessHash),...s!==Us&&!a&&{msgId:Number(s)},offsetId:n?Math.min(n,w):cn.INT,addOffset:i??cn.INT,limit:o}),{shouldThrow:!0,abortControllerChatId:t.id,abortControllerThreadId:s})}catch(e){"CHANNEL_PRIVATE"===e.errorMessage&&za({"@type":"updateChat",id:t.id,chat:{isRestricted:!0}})}if(c&&!(c instanceof qe.messages.MessagesNotModified)&&c.messages)return{messages:c.messages.map(ac).filter(Boolean),users:c.users.map(to).filter(Boolean),chats:c.chats.map(e=>nr(e)).filter(Boolean),count:!(c instanceof qe.messages.Messages)&&c.count}}async function gf(e){let{chat:t,messageId:s}=e;const n="channel"===dn(t.id);let a;try{a=await ol(n?new qe.channels.GetMessages({channel:gn(t.id,t.accessHash),id:[new qe.InputMessageID({id:s})]}):new qe.messages.GetMessages({id:[new qe.InputMessageID({id:s})]}),{shouldThrow:!0,abortControllerChatId:t.id})}catch(e){const{message:t}=e;"CHANNEL_PRIVATE"!==t&&za({"@type":"error",error:{message:t,isSlowMode:!1,hasErrorKey:!0}})}if(!a||a instanceof qe.messages.MessagesNotModified)return;"pts"in a&&sd(t.id,a.pts);const i=a.messages[0];if(!i)return;if(i instanceof qe.MessageEmpty)return Es;Rc(i);const o=ac(i);return o?{message:o}:void 0}async function pf(e){let{chat:t,messageIds:s}=e;const n="channel"===dn(t.id),a=await ol(n?new qe.channels.GetMessages({channel:gn(t.id,t.accessHash),id:s.map(e=>new qe.InputMessageID({id:e}))}):new qe.messages.GetMessages({id:s.map(e=>new qe.InputMessageID({id:e}))}),{shouldThrow:!0});if(a&&!(a instanceof qe.messages.MessagesNotModified))return a.messages.map(ac).filter(Boolean)}let hf=Promise.resolve();function mf(e){const{chat:t,lastMessageId:s,text:n,entities:a,replyInfo:i,suggestedPostInfo:o,attachment:r,sticker:c,story:d,gif:l,poll:u,todo:f,contact:g,scheduledAt:p,groupedId:h,sendAs:m,wasDrafted:_,isInvertedMedia:y,effectId:b,isPending:w,messagePriceInStars:S}=e;if(!t)return;const{message:I,poll:v}=function(e,t,s,n,a,i,o,r,c,d,l,u,f,g,p,h,m,_,y,b){const w=nc(t),S=o&&lc(o),I="chatTypeChannel"===e.type,v=a&&(T=a,k=e.isForum,"story"===T.type?{type:"story",peerId:T.peerId,storyId:T.storyId}:{type:"message",replyToMsgId:T.replyToMsgId,replyToTopId:T.replyToTopId,replyToPeerId:T.replyToPeerId,quoteText:T.quoteText,quoteOffset:T.quoteOffset,isForumTopic:!(!k||!T.replyToTopId)||void 0,...Boolean(T.quoteText)&&{isQuote:!0}}),P=d&&function(e,t){return{mediaType:"poll",id:String(t),summary:Ns(e.summary,["question","answers"]),results:{}}}(d,w),C=l&&function(e){return{mediaType:"todo",todo:e.todo}}(l),M=s?ii({text:s,entities:n}):void 0,A={id:w,chatId:e.id,content:qs({text:M,...S,sticker:r,video:c||S?.video,contact:u,storyData:h&&{mediaType:"storyData",...h},pollId:P?.id,todo:C}),date:g||Math.round(Date.now()/1e3)+Ts(),isOutgoing:!I,senderId:"chatTypePrivate"!==e.type?p?.id||tc:void 0,replyInfo:v,suggestedPostInfo:i,...f&&{groupedId:f,...S&&(S.photo||S.video)&&{isInAlbum:!0}},...g&&{isScheduled:!0},isForwardingAllowed:!0,isInvertedMedia:m,effectId:_,...y&&{sendingState:"messageSendingStatePending"},...b&&{paidMessageStars:b}},R=ni(A.content,A.groupedId);var T,k;return{message:{...A,...R&&{emojiOnlyCount:R}},poll:P}}(t,s,n,a,i,o,r,c,l,u,f,g,h,p,m,d,y,b,w,S);return za({"@type":I.isScheduled?"newScheduledMessage":"newMessage",id:I.id,chatId:t.id,message:I,poll:v,wasDrafted:_}),Promise.resolve(I)}function _f(e,t,s){const{chat:n,text:a,entities:i,replyInfo:r,suggestedPostInfo:c,suggestedMedia:d,attachment:l,sticker:u,story:f,gif:g,poll:p,todo:h,contact:m,isSilent:_,scheduledAt:y,groupedId:b,noWebPage:w,sendAs:S,shouldUpdateStickerSetOrder:I,isInvertedMedia:v,effectId:P,webPageMediaSize:C,webPageUrl:M,messagePriceInStars:A}=e;if(!n)return;const R=setTimeout(()=>{za({"@type":t.isScheduled?"updateScheduledMessage":"updateMessage",id:t.id,chatId:n.id,message:{sendingState:"messageSendingStatePending"}})},lf),T=In();if(b)return function(e,t,s,n){let{chat:a,text:i=cn.STRING,entities:r,replyInfo:c,suggestedPostInfo:d,attachment:l,groupedId:u,isSilent:f,scheduledAt:g,sendAs:p,messagePriceInStars:h}=e,m=-1;bf[u]||(bf[u]={counter:0,singleMediaByIndex:{},localMessages:{}}),m=bf[u].counter++;const _=hf;return hf=(async()=>{let e;try{e=await Pf(s,l,n)}catch(e){return o&&console.warn(e),bf[u].counter--,void await _}const y=await async function(e,t){const s=await ol(new qe.messages.UploadMedia({peer:e,media:t})),n=t.spoiler;if(s instanceof qe.MessageMediaPhoto&&s.photo&&s.photo instanceof qe.Photo){const{photo:{id:e,accessHash:t,fileReference:a}}=s;return new qe.InputMediaPhoto({id:new qe.InputPhoto({id:e,accessHash:t,fileReference:a}),spoiler:n})}if(s instanceof qe.MessageMediaDocument&&s.document&&s.document instanceof qe.Document){const{document:{id:e,accessHash:t,fileReference:a}}=s;return new qe.InputMediaDocument({id:new qe.InputDocument({id:e,accessHash:t,fileReference:a}),spoiler:n})}}(un(a.id,a.accessHash),e);if(await _,!y)return bf[u].counter--,void(o&&console.warn("Failed to upload grouped media"));if(bf[u].singleMediaByIndex[m]=new qe.InputSingleMedia({media:y,randomId:t,message:i,entities:r?r.map(Mn):void 0}),bf[u].localMessages[t.toString()]=s,Object.keys(bf[u].singleMediaByIndex).length<bf[u].counter)return;const{singleMediaByIndex:b,localMessages:w}=bf[u];delete bf[u];const S=Object.values(b).length,I=await ol(new qe.messages.SendMultiMedia({clearDraft:!0,peer:un(a.id,a.accessHash),multiMedia:Object.values(b),replyTo:c&&Wn(c),...f&&{silent:f},...g&&{scheduleDate:g},...p&&{sendAs:un(p.id,p.accessHash)},...h&&{allowPaidStars:Y()(h*S)},...d&&{suggestedPost:Kn(d)}}),{shouldIgnoreUpdates:!0});I&&bg(w,I)})(),hf}({chat:n,text:a,entities:i,replyInfo:r,suggestedPostInfo:c,attachment:l,groupedId:b,isSilent:_,scheduledAt:y,messagePriceInStars:A},T,t,s);const k=(async()=>{let e;if(c&&d&&!l)if(d.photo){const t=An(d.photo);t&&(e=new qe.InputMediaPhoto({id:t,spoiler:d.photo.isSpoiler||void 0}))}else if(d.video){const t=yn(d.video);t&&(e=new qe.InputMediaDocument({id:t,spoiler:d.video.isSpoiler||void 0}))}else if(d.document){const t=d.document;if(t.id){const s=an.documents[t.id];if(s){const t=new qe.InputDocument({id:s.id,accessHash:s.accessHash,fileReference:s.fileReference});e=new qe.InputMediaDocument({id:t})}}}if(!e&&l)try{e=await Pf(t,l,s)}catch(e){return o&&console.warn(e),void await hf}else u?e=bn(u):g?e=bn(g):p?e=function(e,t){const{summary:s,quiz:n}=e,a=new qe.Poll({id:t,publicVoters:s.isPublic,question:On(s.question),answers:s.answers.map(e=>{let{text:t,option:s}=e;return new qe.PollAnswer({text:On(t),option:qa(s)})}),quiz:s.quiz,multipleChoice:s.multipleChoice});if(!n)return new qe.InputMediaPoll({poll:a});const i=n.correctAnswers.map(qa),{solution:o}=n,r=n.solutionEntities?n.solutionEntities.map(Mn):[];return new qe.InputMediaPoll({poll:a,correctAnswers:i,...o&&{solution:o,solutionEntities:r}})}(p,T):h?e=Sn(h):f?e=function(e){const t=mn(e.peerId);return new qe.InputMediaStory({peer:t,id:e.id})}(f):M&&C?e=new qe.InputMediaWebPage({url:M,forceLargeMedia:"large"===C||void 0,forceSmallMedia:"small"===C||void 0}):m&&(e=new qe.InputMediaContact({phoneNumber:m.phoneNumber,firstName:m.firstName,lastName:m.lastName,vcard:cn.STRING}));const b={clearDraft:!0,message:a||cn.STRING,entities:i?i.map(Mn):void 0,peer:un(n.id,n.accessHash),randomId:T,replyTo:r&&Wn(r),silent:_||void 0,scheduleDate:y,sendAs:S&&un(S.id,S.accessHash),updateStickersetsOrder:I||void 0,invertMedia:v||void 0,effect:P?Y()(P):void 0,allowPaidStars:A?Y()(A):void 0,suggestedPost:c&&Kn(c)};try{let s;s=e?await ol(new qe.messages.SendMedia({...b,media:e}),{shouldThrow:!0,shouldIgnoreUpdates:!0}):await ol(new qe.messages.SendMessage({...b,noWebpage:w||void 0}),{shouldThrow:!0,shouldIgnoreUpdates:!0}),s&&wg(t,s)}catch(e){"PRIVACY_PREMIUM_REQUIRED"===e.errorMessage&&za({"@type":"updateRequestUserUpdate",id:n.id}),za({"@type":"updateMessageSendFailed",chatId:n.id,localId:t.id,error:e.message}),clearTimeout(R)}})();return k}async function yf(e,t){const s=e.localMessage||await mf(e);return s?_f(e,s,t):void 0}const bf={};async function wf(e,t){let{chat:s,message:n,text:a,entities:i,attachment:r,noWebPage:c}=e;const d=1e3*n.date>1e3*ks(),l=r&&lc(r),u=a&&!r?.shouldSendAsFile?n.isInvertedMedia:void 0,f={...l||n.content,...a&&{text:{text:a,entities:i}}},g={...n,content:f,isInvertedMedia:u};za({"@type":d?"updateScheduledMessage":"updateMessage",id:n.id,chatId:s.id,message:g});try{let e;r&&(e=await Pf(n,r,t));const o=i&&i.map(Mn);await ol(new qe.messages.EditMessage({message:a,entities:o,media:e,peer:un(s.id,s.accessHash),id:n.id,...d&&{scheduleDate:n.date},...c&&{noWebpage:c},...u&&{invertMedia:u}}),{shouldThrow:!0})}catch(e){o&&console.warn(e);const{message:t}=e;za({"@type":"error",error:{message:t,hasErrorKey:!0}}),za({"@type":d?"updateScheduledMessage":"updateMessage",id:n.id,chatId:s.id,message:n})}}async function Sf(e){let{chat:t,message:s,todo:n}=e;const a=Sn(n),i=1e3*s.date>1e3*ks(),r={...s.content,todo:{mediaType:"todo",todo:n.todo}},c={...s,content:r};za({"@type":i?"updateScheduledMessage":"updateMessage",id:s.id,chatId:t.id,message:c});try{await ol(new qe.messages.EditMessage({media:a,peer:un(t.id,t.accessHash),id:s.id}),{shouldThrow:!0})}catch(e){o&&console.warn(e);const{message:n}=e;za({"@type":"error",error:{message:n,hasErrorKey:!0}}),za({"@type":"updateMessage",id:s.id,chatId:t.id,message:s})}}async function If(e){let{chat:t,message:s,items:n}=e;const a=n.map(e=>new qe.TodoItem({id:e.id,title:On(e.title)}));try{await ol(new qe.messages.AppendTodoList({peer:un(t.id,t.accessHash),msgId:s.id,list:a}),{shouldThrow:!0})}catch(e){o&&console.warn(e);const{message:t}=e;za({"@type":"error",error:{message:t,hasErrorKey:!0}})}}async function vf(e){let{chat:t,message:s,scheduledAt:n}=e;await ol(new qe.messages.EditMessage({peer:un(t.id,t.accessHash),id:s.id,scheduleDate:n}))}async function Pf(e,t,s){const{filename:n,blobUrl:a,mimeType:i,quick:o,voice:r,audio:c,previewBlobUrl:d,shouldSendAsFile:l,shouldSendAsSpoiler:u,ttlSeconds:f}=t,g=t=>{s.isCanceled?g.isCanceled=!0:s(t,function(e){const{chatId:t}=e;return function(e,t){return`msg${e}-${t}`}(t,"randomId"in e?Number(e.randomId):e.previousLocalId||e.id)}(e))},p=async(e,t)=>dl(await async function(e,t){const s=await async function(e){return(await fetch(e)).blob()}(e);return function(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}(s,t)}(e,n),t),h=E.has(i),m=c||h||l,[_,y]=await Promise.all(Hs([p(a,g),m&&d&&p(d)])),b=[new qe.DocumentAttributeFilename({fileName:n})];if(!l){if(o){if(U.has(i)&&i!==T)return new qe.InputMediaUploadedPhoto({file:_,spoiler:u});if(h){const{width:e,height:t,duration:s}=o;void 0!==s&&b.push(new qe.DocumentAttributeVideo({duration:s,w:e,h:t,supportsStreaming:!0}))}}if(c){const{duration:e,title:t,performer:s}=c;b.push(new qe.DocumentAttributeAudio({duration:e,title:t,performer:s}))}if(r){const{duration:e,waveform:t}=r,{data:s}=oi(t,uf);b.push(new qe.DocumentAttributeAudio({voice:!0,duration:e,waveform:df.from(s)}))}}return new qe.InputMediaUploadedDocument({file:_,mimeType:i,attributes:b,thumb:y,forceFile:l,spoiler:u,ttlSeconds:f})}async function Cf(e){let{chat:t,messageId:s,isUnpin:n,isOneSide:a,isSilent:i}=e;await ol(new qe.messages.UpdatePinnedMessage({peer:un(t.id,t.accessHash),id:s,...n&&{unpin:!0},...a&&{pmOneside:!0},...i&&{silent:!0}}))}async function Mf(e){let{chat:t,threadId:s}=e;const n=await ol(new qe.messages.UnpinAllMessages({peer:un(t.id,t.accessHash),...s&&{topMsgId:Number(s)}}));n&&(gd(t,n),n.offset&&await Mf({chat:t,threadId:s}))}async function Af(e){let{chat:t,messageIds:s,shouldDeleteForAll:n}=e;const a="channel"===dn(t.id),i=await ol(a?new qe.channels.DeleteMessages({channel:gn(t.id,t.accessHash),id:s}):new qe.messages.DeleteMessages({id:s,...n&&{revoke:!0}}));i&&(gd(t,i),za({"@type":"deleteMessages",ids:s,...a&&{chatId:t.id}}))}async function Rf(e){let{chat:t,peer:s,isRepeat:n=!1}=e;const a=await ol(new qe.channels.DeleteParticipantHistory({channel:gn(t.id,t.accessHash),participant:un(s.id,s.accessHash)}));a&&(gd(t,a),n||za({"@type":"deleteParticipantHistory",chatId:t.id,peerId:s.id}),a.offset&&await Rf({chat:t,peer:s,isRepeat:!0}))}function Tf(e){let{chat:t,messageIds:s}=e;ol(new qe.messages.DeleteScheduledMessages({peer:un(t.id,t.accessHash),id:s}))}async function kf(e){let{chat:t,shouldDeleteForAll:s,maxId:n}=e;const a="channel"===dn(t.id),i=await ol(a?new qe.channels.DeleteHistory({channel:gn(t.id,t.accessHash),maxId:n??cn.INT}):new qe.messages.DeleteHistory({peer:un(t.id,t.accessHash),maxId:n??cn.INT,...s&&{revoke:!0},...!s&&{just_clear:!0}}));i&&("offset"in i&&(gd(t,i),i.offset)?await kf({chat:t,shouldDeleteForAll:s}):za({"@type":"deleteHistory",chatId:t.id}))}async function Df(e){let{chat:t}=e;const s=await ol(new qe.messages.DeleteSavedHistory({peer:un(t.id,t.accessHash),maxId:cn.INT}));s&&(gd(t,s),s.offset?await Df({chat:t}):za({"@type":"deleteSavedHistory",chatId:t.id}))}async function Uf(e){let{chat:t,messageId:s,reject:n,scheduleDate:a,rejectComment:i}=e;return await ol(new qe.messages.ToggleSuggestedPostApproval({peer:un(t.id,t.accessHash),msgId:s,reject:n||void 0,scheduleDate:a,rejectComment:i}))}async function Ef(e){let{peer:t,messageIds:s,description:n,option:a}=e;try{const e=await ol(new qe.messages.Report({peer:un(t.id,t.accessHash),id:s,option:qa(a),message:n}),{shouldThrow:!0});if(!e)return;return{result:pc(e),error:void 0}}catch(e){const t=e.message;if(t===x)return{result:void 0,error:t};throw e}}function Bf(e){let{peer:t,chat:s,messageIds:n}=e;return ol(new qe.channels.ReportSpam({participant:un(t.id,t.accessHash),channel:gn(s.id,s.accessHash),id:n}))}async function xf(e){let{peer:t,threadId:s,action:n}=e;const a=function(e){switch(e.type){case"cancel":return new qe.SendMessageCancelAction;case"typing":return new qe.SendMessageTypingAction;case"recordAudio":return new qe.SendMessageRecordAudioAction;case"chooseSticker":return new qe.SendMessageChooseStickerAction;case"playingGame":return new qe.SendMessageGamePlayAction}}(n);if(a)try{return await ol(new qe.messages.SetTyping({peer:un(t.id,t.accessHash),topMsgId:Number(s),action:a}),{shouldThrow:!0,abortControllerChatId:t.id,abortControllerThreadId:s})}catch(e){}else o&&console.warn("Unsupported message action",n)}async function Vf(e){let{chat:t,threadId:s,maxId:n=0}=e;const a="channel"===dn(t.id),i=Math.min(n,w);if(a&&s===Us)await ol(new qe.channels.ReadHistory({channel:gn(t.id,t.accessHash),maxId:i}));else if(a)await ol(new qe.messages.ReadDiscussion({peer:un(t.id,t.accessHash),msgId:Number(s),readMaxId:i}));else{const e=await ol(new qe.messages.ReadHistory({peer:un(t.id,t.accessHash),maxId:i}));e&&gd(t,e)}s===Us?Kl({chat:t,noLastMessage:!0}):t.isForum&&za({"@type":"updateTopic",chatId:t.id,topicId:Number(s)})}async function Nf(e){let{chat:t,messageIds:s}=e;const n="channel"===dn(t.id),a=await ol(n?new qe.channels.ReadMessageContents({channel:gn(t.id,t.accessHash),id:s}):new qe.messages.ReadMessageContents({id:s}));a&&(!0!==a&&gd(t,a),za({...n?{"@type":"updateChannelMessages",channelId:t.id}:{"@type":"updateCommonBoxMessages"},ids:s,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}}))}async function Gf(e){let{chat:t,ids:s,shouldIncrement:n}=e;const a=Ls(s,Dl),i=await Promise.all(a.map(e=>ol(new qe.messages.GetMessagesViews({peer:un(t.id,t.accessHash),id:e,increment:Boolean(n)}))));if(!i||i.some(e=>!e))return;const o=i.flatMap(e=>e.views);return{viewsInfo:s.map((e,s)=>{const{views:n,forwards:a,replies:i}=o[s];return{id:e,views:n,forwards:a,threadInfo:i?fc(i,e,t.id):void 0}})}}async function Ff(e){let{chat:t,ids:s}=e;const n=Ls(s,Dl),a=await Promise.all(n.map(e=>ol(new qe.messages.GetFactCheck({peer:un(t.id,t.accessHash),msgId:e}))));if(a&&!a.some(e=>!e))return a.flatMap(e=>e).map(dc)}function qf(){return ol(new qe.messages.GetPaidReactionPrivacy,{shouldReturnTrue:!0})}function Hf(e){let{chat:t,messageIds:s}=e;return ol(new qe.messages.ReportMessagesDelivery({peer:un(t.id,t.accessHash),id:s}))}async function Lf(e){let{chat:t,messageId:s}=e;const[n,a]=await Promise.all([ol(new qe.messages.GetDiscussionMessage({peer:un(t.id,t.accessHash),msgId:s}),{abortControllerChatId:t.id,abortControllerThreadId:s}),ff({chat:t,threadId:s,offsetId:1,addOffset:-1,limit:1})]);if(!n||!a)return;const i=n.messages.map(ac).filter(Boolean),o=i.concat(a.messages),r=n.messages[n.messages.length-1]?.id;if(!r)return;const{unreadCount:c,maxId:d,readInboxMaxId:l,readOutboxMaxId:u}=n;return{messages:o,topMessages:i,unreadCount:c,threadId:r,lastReadInboxMessageId:l,lastReadOutboxMessageId:u,lastMessageId:d,chatId:i[0]?.chatId,firstMessageId:a.messages[0]?.id}}async function Of(e){let t,{peer:s,isSavedDialog:n,savedTag:a,type:i,query:o=cn.STRING,threadId:r,minDate:c,maxDate:d,offsetId:l,addOffset:u,limit:f}=e;switch(i){case"media":t=new qe.InputMessagesFilterPhotoVideo;break;case"documents":t=new qe.InputMessagesFilterDocument;break;case"links":t=new qe.InputMessagesFilterUrl;break;case"audio":t=new qe.InputMessagesFilterMusic;break;case"voice":t=new qe.InputMessagesFilterRoundVoice;break;case"profilePhoto":t=new qe.InputMessagesFilterChatPhotos;break;default:t=new qe.InputMessagesFilterEmpty}const g=un(s.id,s.accessHash),p=await ol(new qe.messages.Search({peer:n?new qe.InputPeerSelf:g,savedPeerId:n?g:void 0,savedReaction:a&&[Hn(a)],topMsgId:r===Us||n?void 0:Number(r),filter:t,q:o,minDate:c??cn.INT,maxDate:d??cn.INT,maxId:cn.INT,minId:cn.INT,hash:cn.BIGINT,offsetId:l??cn.INT,addOffset:u??cn.INT,limit:f}),{abortControllerChatId:s.id,abortControllerThreadId:r});if(!p||p instanceof qe.messages.MessagesNotModified||!p.messages)return;const h=no(p.users),m=p.messages.map(ac).filter(Boolean);let _,y=m.length;return(p instanceof qe.messages.MessagesSlice||p instanceof qe.messages.ChannelMessages)&&(y=p.count,m.length&&(_=m[m.length-1].id)),{userStatusesById:h,messages:m,totalCount:y,nextOffsetId:_}}async function jf(e){let t,{query:s,offsetRate:n=0,offsetPeer:a,offsetId:i,limit:o,type:r="text",minDate:c,maxDate:d,context:l="all"}=e;if("publicPosts"===r)return Wf({query:s,offsetRate:n,offsetPeer:a,offsetId:i,limit:o});switch(r){case"media":t=new qe.InputMessagesFilterPhotoVideo;break;case"documents":t=new qe.InputMessagesFilterDocument;break;case"links":t=new qe.InputMessagesFilterUrl;break;case"audio":t=new qe.InputMessagesFilterMusic;break;case"voice":t=new qe.InputMessagesFilterRoundVoice;break;default:if(!(s||d&&c))return;t=new qe.InputMessagesFilterEmpty}const u=a&&un(a.id,a.accessHash)||new qe.InputPeerEmpty,f=await ol(new qe.messages.SearchGlobal({q:s,offsetRate:n,offsetPeer:u,offsetId:i??cn.INT,broadcastsOnly:"channels"===r||"channels"===l||void 0,groupsOnly:"groups"===l||void 0,usersOnly:"users"===l||void 0,limit:o,filter:t,minDate:c??cn.INT,maxDate:d??cn.INT}));if(!f||f instanceof qe.messages.MessagesNotModified||!f.messages)return;const g=no(f.users),p=f.messages.map(ac).filter(Boolean);let h=p.length;h=f instanceof qe.messages.MessagesSlice||f instanceof qe.messages.ChannelMessages?f.count:f.messages.length;const m=f.messages[f.messages.length-1],_=Na(m),y="nextRate"in f&&f.nextRate?f.nextRate:void 0,b=m?.id;return{messages:p,userStatusesById:g,totalCount:h,nextOffsetRate:y,nextOffsetPeerId:_,nextOffsetId:b}}async function Wf(e){let{hashtag:t,query:s,offsetRate:n,offsetPeer:a,offsetId:i,limit:o}=e;const r=a&&un(a.id,a.accessHash)||new qe.InputPeerEmpty,c=await zf(s);if(!c)return;const d=await ol(new qe.channels.SearchPosts({hashtag:t,query:s,offsetRate:n??cn.INT,offsetId:i??cn.INT,offsetPeer:r,limit:o??cn.INT,allowPaidStars:Y()(c.starsAmount)}));if(!d||d instanceof qe.messages.MessagesNotModified)return;const l=no(d.users),u=d.messages.map(ac).filter(Boolean);let f=u.length;f=d instanceof qe.messages.MessagesSlice||d instanceof qe.messages.ChannelMessages?d.count:d.messages.length;const g=d.messages[d.messages.length-1],p=Na(g),h="nextRate"in d&&d.nextRate?d.nextRate:void 0,m=g?.id;return{messages:u,userStatusesById:l,totalCount:f,nextOffsetRate:h,nextOffsetPeerId:p,nextOffsetId:m,searchFlood:d instanceof qe.messages.MessagesSlice&&d.searchFlood?mc(d.searchFlood,s):void 0}}async function zf(e){const t=await ol(new qe.channels.CheckSearchPostsFlood({query:e}));if(t)return mc(t,e)}async function Kf(e){let{text:t}=e;const s=On(t),n=await ol(new qe.messages.GetWebPagePreview({message:s.text,entities:s.entities}));if(n)return Po(n.media)}async function $f(e){let{chat:t,messageId:s,options:n}=e;const{id:a,accessHash:i}=t;await ol(new qe.messages.SendVote({peer:un(a,i),msgId:s,options:n.map(qa)}))}async function Jf(e){let{chat:t,messageId:s,completedIds:n,incompletedIds:a}=e;const{id:i,accessHash:o}=t;await ol(new qe.messages.ToggleTodoCompleted({peer:un(i,o),msgId:s,completed:n,incompleted:a}))}async function Qf(e){let{chat:t,messageId:s,poll:n}=e;const{id:a,accessHash:i}=t;await ol(new qe.messages.EditMessage({peer:un(a,i),id:s,media:wn(n,!0)}))}async function Xf(e){let{chat:t,messageId:s,option:n,offset:a,limit:i,shouldResetVoters:o}=e;const{id:r,accessHash:c}=t,d=await ol(new qe.messages.GetPollVotes({peer:un(r,c),id:s,limit:i??cn.INT,option:n?qa(n):void 0,offset:a}));if(!d)return;const l=d.votes.map(e=>({peerId:Ta(e.peer),date:e.date}));return{count:d.count,votes:l,nextOffset:d.nextOffset,shouldResetVoters:o}}async function Zf(e){let{chat:t,ids:s}=e;await ol(new qe.messages.GetExtendedMedia({peer:un(t.id,t.accessHash),id:s}))}function Yf(e){const{toChat:t,toThreadId:s,messages:n,scheduledAt:a,sendAs:i,noAuthors:o,noCaptions:r,isCurrentUserPremium:c,wasDrafted:d,lastMessageId:l}=e,u=n.map(e=>{let{id:t}=e;return t}),f=[];return n.forEach(e=>{const n=function(e){let{toChat:t,toThreadId:s,message:n,scheduledAt:a,noAuthors:i,noCaptions:o,isCurrentUserPremium:r,lastMessageId:c,sendAs:d}=e;const l=nc(c),{content:u,chatId:f,id:g,senderId:p,groupedId:h,isInAlbum:m,isInvertedMedia:_}=n,y=u.audio,b=t.id===tc&&(f!==t.id||n.forwardInfo)&&!y,w=Object.keys(u).length>1&&u.text&&o,S=!r,I=u.text?.entities&&S?{text:u.text.text,entities:u.text.entities.filter(e=>e.type!==Ds.CustomEmoji)}:u.text,v=I&&ii(I),P=ni(u,h),C={...u,text:w?void 0:v},M=s&&s!==Us?{type:"message",replyToMsgId:s,replyToTopId:s,isForumTopic:t.isForum||void 0}:void 0;return{id:l,chatId:t.id,content:C,date:a||Math.round(Date.now()/1e3)+Ts(),isOutgoing:!b&&"chatTypeChannel"!==t.type,senderId:"chatTypePrivate"!==t.type?d?.id||tc:void 0,sendingState:"messageSendingStatePending",groupedId:h,isInAlbum:m,isForwardingAllowed:!0,replyInfo:M,isInvertedMedia:_,...s&&t?.isForum&&{isTopicReply:!0},...P&&{emojiOnlyCount:P},...n.chatId!==tc&&!y&&!i&&{forwardInfo:{date:n.forwardInfo?.date||n.date,savedDate:n.date,isChannelPost:!1,fromChatId:f,fromMessageId:g,fromId:p,savedFromPeerId:n.chatId}},...n.chatId===tc&&!i&&{forwardInfo:n.forwardInfo},...a&&{isScheduled:!0}}}({toChat:t,toThreadId:Number(s),message:e,scheduledAt:a,noAuthors:o,noCaptions:r,isCurrentUserPremium:c,lastMessageId:l,sendAs:i});f.push(n),za({"@type":n.isScheduled?"newScheduledMessage":"newMessage",id:n.id,chatId:t.id,message:n,wasDrafted:d})}),Promise.resolve({messageIds:u,localMessages:f})}async function eg(e){const{fromChat:t,toChat:s,toThreadId:n,isSilent:a,scheduledAt:i,sendAs:o,withMyScore:r,noAuthors:c,noCaptions:d,forwardedLocalMessagesSlice:l,messagePriceInStars:u}=e;if(!l)return;const{messageIds:f,localMessages:g}=l,p=u?u*f.length:void 0,h=f.map(In);try{const e=await ol(new qe.messages.ForwardMessages({fromPeer:un(t.id,t.accessHash),toPeer:un(s.id,s.accessHash),randomId:h,id:f,withMyScore:r||void 0,silent:a||void 0,dropAuthor:c||void 0,dropMediaCaptions:d||void 0,...n&&{topMsgId:Number(n)},...i&&{scheduleDate:i},...o&&{sendAs:un(o.id,o.accessHash)},...p&&{allowPaidStars:Y()(p)}}),{shouldThrow:!0,shouldIgnoreUpdates:!0}),l={};g.forEach((e,t)=>{l[h[t].toString()]=e}),e&&bg(l,e)}catch(e){Object.values(g).forEach(t=>{za({"@type":"updateMessageSendFailed",chatId:s.id,localId:t.id,error:e.message})})}}async function tg(e){if(e.forwardedLocalMessagesSlice)await eg(e);else{const t={...e,forwardedLocalMessagesSlice:await Yf(e)};await eg(t)}}async function sg(e){let{chat:t,timestamp:s}=e;const n=await ol(new qe.messages.GetHistory({peer:un(t.id,t.accessHash),offsetDate:s,addOffset:-1,limit:1,offsetId:cn.INT,maxId:cn.INT,minId:cn.INT,hash:cn.BIGINT}));if(n&&!(n instanceof qe.messages.MessagesNotModified)&&n.messages&&n.messages.length)return n.messages[0].id}async function ng(e){let{chat:t}=e;const{id:s,accessHash:n}=t,a=await ol(new qe.messages.GetScheduledHistory({peer:un(s,n),hash:cn.BIGINT}),{abortControllerChatId:s});if(a&&!(a instanceof qe.messages.MessagesNotModified)&&a.messages)return{messages:a.messages.map(ac).filter(Boolean)}}async function ag(e){let{chat:t,ids:s}=e;const{id:n,accessHash:a}=t;await ol(new qe.messages.SendScheduledMessages({peer:un(n,a),id:s}))}async function ig(e){let{chat:t,threadId:s}=e;const n=await ol(new qe.messages.Search({peer:un(t.id,t.accessHash),filter:new qe.InputMessagesFilterPinned,q:cn.STRING,limit:Ul,topMsgId:Number(s),minDate:cn.INT,maxDate:cn.INT,offsetId:cn.INT,addOffset:cn.INT,maxId:cn.INT,minId:cn.INT,hash:cn.BIGINT}),{abortControllerChatId:t.id,abortControllerThreadId:s});if(n&&!(n instanceof qe.messages.MessagesNotModified)&&n.messages)return{messages:n.messages.map(ac).filter(Boolean)}}async function og(e){let{chat:t,messageId:s}=e;const n=await ol(new qe.messages.GetMessageReadParticipants({peer:un(t.id,t.accessHash),msgId:s}));return n?n.reduce((e,t)=>(e[t.userId.toString()]=t.date,e),{}):void 0}async function rg(e){let{chat:t,isForPaidReactions:s}=e;const n=await ol(new qe.channels.GetSendAs({forPaidReactions:s,peer:un(t.id,t.accessHash)}),{shouldIgnoreErrors:!0,abortControllerChatId:t.id});if(n)return n.peers.map(mr)}function cg(e){let{sendAs:t,chat:s}=e;return ol(new qe.messages.SaveDefaultSendAs({peer:un(s.id,s.accessHash),sendAs:un(t.id,t.accessHash)}))}async function dg(e){let{peer:t}=e;const s=await ol(new qe.messages.GetSponsoredMessages({peer:un(t.id,t.accessHash)}));if(s&&!(s instanceof qe.messages.SponsoredMessagesEmpty)&&s.messages.length)return{messages:s.messages.map(e=>function(e,t){const{message:s,entities:n,randomId:a,recommended:i,sponsorInfo:o,additionalInfo:r,buttonText:c,canReport:d,title:l,url:u,color:f}=e;let g,p;return e.photo instanceof qe.Photo&&(li(e.photo),g=Ii(e.photo)),e.media&&(p=po(e.media)),{chatId:t,randomId:Fa(a),expiresAt:Math.round(Date.now()/1e3)+y,isRecommended:i,sponsorInfo:o,additionalInfo:r,buttonText:c,canReport:d,title:l,url:u,peerColor:f&&ka(f),photo:g,content:{...p,text:go(s,n)}}}(e,t.id)).filter(Boolean)}}async function lg(e){let{random:t}=e;await ol(new qe.messages.ViewSponsoredMessage({randomId:qa(t)}))}function ug(e){let{random:t,isMedia:s,isFullscreen:n}=e;return ol(new qe.messages.ClickSponsoredMessage({media:s||void 0,fullscreen:n||void 0,randomId:qa(t)}))}async function fg(e){let{randomId:t,option:s}=e;try{const e=await ol(new qe.messages.ReportSponsoredMessage({randomId:qa(t),option:qa(s)}),{shouldThrow:!0});if(!e)return;return function(e){return e instanceof qe.channels.SponsoredMessageReportResultReported?{type:"reported"}:e instanceof qe.channels.SponsoredMessageReportResultAdsHidden?{type:"hidden"}:{type:"selectOption",title:e.title,options:e.options.map(e=>({text:e.text,option:Fa(e.option)}))}}(e)}catch(e){return e instanceof He&&"PREMIUM_ACCOUNT_REQUIRED"===e.errorMessage?{type:"premiumRequired"}:void 0}}async function gg(e){let{chat:t,threadId:s}=e;const n=await ol(new qe.messages.ReadMentions({peer:un(t.id,t.accessHash),topMsgId:s?Number(s):void 0}));n&&(gd(t,n),n.offset&&await gg({chat:t,threadId:s}))}async function pg(e){let{chat:t,threadId:s}=e;const n=await ol(new qe.messages.ReadReactions({peer:un(t.id,t.accessHash),topMsgId:s?Number(s):void 0}));n&&(gd(t,n),n.offset&&await pg({chat:t,threadId:s}))}async function hg(e){let{chat:t,threadId:s,offsetId:n,addOffset:a,maxId:i,minId:o}=e;const r=await ol(new qe.messages.GetUnreadMentions({peer:un(t.id,t.accessHash),topMsgId:s?Number(s):void 0,limit:m,offsetId:n??cn.INT,addOffset:a??cn.INT,maxId:i??cn.INT,minId:o??cn.INT}));if(r&&!(r instanceof qe.messages.MessagesNotModified)&&r.messages)return{messages:r.messages.map(ac).filter(Boolean)}}async function mg(e){let{chat:t,threadId:s,offsetId:n,addOffset:a,maxId:i,minId:o}=e;const r=await ol(new qe.messages.GetUnreadReactions({peer:un(t.id,t.accessHash),topMsgId:s?Number(s):void 0,limit:h,offsetId:n??cn.INT,addOffset:a??cn.INT,maxId:i??cn.INT,minId:o??cn.INT}));if(r&&!(r instanceof qe.messages.MessagesNotModified)&&r.messages)return{messages:r.messages.map(ac).filter(Boolean)}}async function _g(e){let{chat:t,messageId:s}=e;const n=await ol(new qe.messages.TranscribeAudio({msgId:s,peer:un(t.id,t.accessHash)}));if(n)return za({"@type":"updateTranscribedAudio",isPending:n.pending,transcriptionId:n.transcriptionId.toString(),text:n.text}),n.transcriptionId.toString()}async function yg(e){let t;const s="chat"in e;if(s){const{chat:s,messageIds:n,toLanguageCode:a}=e;t=await ol(new qe.messages.TranslateText({peer:un(s.id,s.accessHash),id:n,toLang:a}))}else{const{text:s,toLanguageCode:n}=e;t=await ol(new qe.messages.TranslateText({text:s.map(e=>On(e)),toLang:n}))}if(!t)return void(s&&za({"@type":"failedMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,toLanguageCode:e.toLanguageCode}));const n=t.result.map(e=>Ri(e));return s&&za({"@type":"updateMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,translations:n,toLanguageCode:e.toLanguageCode}),n}function bg(e,t){if(!("updates"in t))return void il(t);t.updates.filter(e=>e instanceof qe.UpdateMessageID).forEach(s=>{const n=t.updates.find(e=>e instanceof qe.UpdateNewScheduledMessage&&e.message.id===s.id);wg(e[s.randomId.toString()],s,n)});const s=t.updates.filter(e=>!(e instanceof qe.UpdateMessageID||e instanceof qe.UpdateNewScheduledMessage));t.updates=s,il(t)}function wg(e,t,s){let n,a,i,o;if(t instanceof qe.UpdateShortSentMessage||t instanceof qe.UpdateMessageID?n=t:"updates"in t&&(n=t.updates.find(e=>e instanceof qe.UpdateMessageID),s=t.updates.find(e=>e instanceof qe.UpdateNewScheduledMessage)),!n)return void il(t);n instanceof qe.UpdateShortSentMessage&&(e.content.text&&n.entities&&(a={text:go(e.content.text.text,n.entities)}),n.media&&(a={...a,...po(n.media,{peerId:ln(e.chatId),id:n.id})},i=bo(n.media),o=Po(n.media)),Rc(Cn(n.id,e.chatId,n)));const r=s?.message&&ac(s.message),c="date"in n&&n.date<ks();if(r?.isVideoProcessingPending)za({"@type":"updateVideoProcessingPending",chatId:e.chatId,localId:e.id,newScheduledMessageId:r?.id});else{const t={...e,...a&&{content:{...e.content,...a}},id:n.id,sendingState:void 0,..."date"in n&&{date:n.date}};za({"@type":e.isScheduled&&!c?"updateScheduledMessageSendSucceeded":"updateMessageSendSucceeded",chatId:e.chatId,localId:e.id,message:t,poll:i,webPage:o})}il(t)}async function Sg(e){let{chat:t,messageId:s}=e;const{id:n,accessHash:a}=t,i=un(n,a),o=await ol(new qe.messages.GetOutboxReadDate({peer:i,msgId:s}),{shouldThrow:!0});if(o)return{date:o.date}}async function Ig(){const e=await ol(new qe.messages.GetQuickReplies({hash:cn.BIGINT}));if(e&&!(e instanceof qe.messages.QuickRepliesNotModified))return{messages:e.messages.map(ac).filter(Boolean),quickReplies:e.quickReplies.map(gc)}}async function vg(e){let{chat:t,shortcutId:s}=e;const n=await ol(new qe.messages.GetQuickReplyMessages({shortcutId:s,hash:cn.BIGINT}));if(!n||n instanceof qe.messages.MessagesNotModified)return;const a=n.messages.map(e=>e.id),i=a.map(In),o=await ol(new qe.messages.SendQuickReplyMessages({peer:un(t.id,t.accessHash),shortcutId:s,id:a,randomId:i}),{shouldIgnoreUpdates:!0});if(o){if("updates"in o){const e=o.updates.filter(e=>!(e instanceof qe.UpdateMessageID));o.updates=e}il(o)}}async function Pg(e){let{id:t,chat:s,shouldIncludeThread:n,shouldIncludeGrouped:a}=e;const i=await ol(new qe.channels.ExportMessageLink({channel:gn(s.id,s.accessHash),id:t,thread:n||void 0,grouped:a||void 0}));return i?.link}async function Cg(e){let{bot:t,id:s}=e;const n=await ol(new qe.messages.GetPreparedInlineMessage({bot:fn(t.id,t.accessHash),id:s}));if(n)return function(e){const t=e.queryId.toString();return{queryId:t,result:hc(t,e.result),peerTypes:e.peerTypes?.map(Ji),cacheTime:e.cacheTime}}(n)}async function Mg(e){let{id:t,accessHash:s}=e;const n=fn(t,s);if(!(n instanceof qe.InputUser))return;const a=await ol(new qe.users.GetFullUser({id:n}));if(!a)return;a.fullUser.profilePhoto&&li(a.fullUser.profilePhoto),a.fullUser.personalPhoto&&li(a.fullUser.personalPhoto),a.fullUser.fallbackPhoto&&li(a.fullUser.fallbackPhoto);const i=a.fullUser.botInfo;i?.descriptionPhoto&&li(i.descriptionPhoto),i?.descriptionDocument instanceof qe.Document&&(an.documents[i.descriptionDocument.id.toString()]=i.descriptionDocument),a.fullUser.businessIntro?.sticker instanceof qe.Document&&(an.documents[a.fullUser.businessIntro.sticker.id.toString()]=a.fullUser.businessIntro.sticker);const o=Yi(a),r=a.users.map(to).filter(Boolean),c=a.chats.map(e=>nr(e)).filter(Boolean),d=r.find(e=>{let{id:s}=e;return s===t});return za({"@type":"updateUser",id:t,user:d,fullInfo:o}),{user:d,fullInfo:o,users:r,chats:c}}async function Ag(e,t){const s=await ol(new qe.messages.GetCommonChats({userId:fn(e.id,e.accessHash),maxId:t?xn(t,dn(t)):cn.BIGINT,limit:cn.INT}));if(!s)return;const n=s.chats.map(e=>nr(e)).filter(Boolean).map(e=>{let{id:t}=e;return t});return{chatIds:n,count:"count"in s?s.count:n.length}}async function Rg(e){const t=await ol(new qe.users.GetRequirementsToContact({id:[fn(e.id,e.accessHash)]}));if(t)return t[0]instanceof qe.RequirementToContactPaidMessages?t[0].starsAmount?.toJSNumber():void 0}async function Tg(){const e=await ol(new qe.help.GetNearestDc);return e?.country}async function kg(){const e=await ol(new qe.contacts.GetTopPeers({correspondents:!0,offset:cn.INT,limit:cn.INT,hash:cn.BIGINT}));if(e instanceof qe.contacts.TopPeers)return{ids:e.users.map(to).filter(e=>Boolean(e)&&!e.isSelf).map(e=>{let{id:t}=e;return t})}}async function Dg(){const e=await ol(new qe.contacts.GetContacts({hash:Y()("0")}));if(e&&!(e instanceof qe.contacts.ContactsNotModified))return{users:e.users.map(to).filter(Boolean),userStatusesById:no(e.users)}}async function Ug(e){let{users:t}=e;const s=await ol(new qe.users.GetUsers({id:t.map(e=>{let{id:t,accessHash:s}=e;return fn(t,s)})}));if(s&&s.length)return{users:s.map(to).filter(Boolean),userStatusesById:no(s)}}async function Eg(e){let{phone:t=cn.STRING,firstName:s=cn.STRING,lastName:n=cn.STRING}=e;const a=await ol(new qe.contacts.ImportContacts({contacts:[Rn({phone:t,firstName:s,lastName:n})]}));return a instanceof qe.contacts.ImportedContacts&&a.users.length&&pi(a.users[0]),a?.imported.length?Ra(a.imported[0].userId,"user"):void 0}function Bg(e){let{id:t,accessHash:s,phoneNumber:n=cn.STRING,firstName:a=cn.STRING,lastName:i=cn.STRING,shouldSharePhoneNumber:o=!1}=e;return ol(new qe.contacts.AddContact({id:fn(t,s),firstName:a,lastName:i,phone:n,...o&&{addPhonePrivacyException:o}}),{shouldReturnTrue:!0})}async function xg(e){let{id:t,accessHash:s}=e;const n=fn(t,s);n instanceof qe.InputUser&&await ol(new qe.contacts.DeleteContacts({id:[n]}))&&za({"@type":"deleteContact",id:t})}async function Vg(e){let{user:t,shouldRefundCharged:s}=e;return await ol(new qe.account.ToggleNoPaidMessagesException({refundCharged:!!s||void 0,userId:fn(t.id,t.accessHash)}))}async function Ng(e){let{user:t}=e;const s=await ol(new qe.account.GetPaidMessagesRevenue({userId:fn(t.id,t.accessHash)}));if(s)return s.starsAmount.toJSNumber()}async function Gg(e){let{peer:t,offset:s=0,limit:n=0}=e;const a=("title"in t?t:void 0)?void 0:t;if(a){const{id:e,accessHash:t}=a,i=await ol(new qe.photos.GetUserPhotos({userId:fn(e,t),limit:n,offset:s,maxId:Y()("0")}));if(!i)return;i.photos.forEach(li);const o=i instanceof qe.photos.PhotosSlice?i.count:i.photos.length,r=s+i.photos.length,c=r<o?r:void 0;return{count:o,photos:i.photos.filter(e=>e instanceof qe.Photo).map(e=>Ii(e)),nextOffsetId:c}}const i=await Of({peer:t,type:"profilePhoto",limit:n});if(!i)return;const{messages:o,totalCount:r,nextOffsetId:c}=i;return{count:r,photos:o.map(e=>"chatEditPhoto"===e.content.action?.type&&e.content.action.photo).filter(Boolean),nextOffsetId:c}}function Fg(e){const{id:t,accessHash:s}=e;return ol(new qe.messages.ReportSpam({peer:un(t,s)}),{shouldReturnTrue:!0})}function qg(e){return ol(new qe.account.UpdateEmojiStatus({emojiStatus:Ln(e)}),{shouldReturnTrue:!0})}function Hg(e){const t=e.map(e=>xn(e,"user"));return ol(new qe.contacts.EditCloseFriends({id:t}),{shouldReturnTrue:!0})}async function Lg(e){let{hash:t}=e;const s=await ol(new qe.messages.GetEmojiStickers({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.AllStickersNotModified))return s.sets.forEach(e=>{(e.thumbs?.length||e.thumbDocumentId)&&(an.stickerSets[String(e.id)]=e)}),{hash:String(s.hash),sets:s.sets.map(Bi)}}async function Og(e){let{hash:t}=e;const s=await ol(new qe.messages.GetAllStickers({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.AllStickersNotModified))return s.sets.forEach(e=>{e.thumbs?.length&&(an.stickerSets[String(e.id)]=e)}),{hash:String(s.hash),sets:s.sets.map(Bi)}}async function jg(e){let{hash:t}=e;const s=await ol(new qe.messages.GetRecentStickers({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.RecentStickersNotModified))return{hash:String(s.hash),stickers:Ni(s.stickers.slice(0,C))}}async function Wg(e){let{hash:t}=e;const s=await ol(new qe.messages.GetFavedStickers({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.FavedStickersNotModified))return{hash:String(s.hash),stickers:Ni(s.stickers)}}async function zg(e){let{hash:t}=e;const s=await ol(new qe.messages.GetFeaturedStickers({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.FeaturedStickersNotModified))return{hash:String(s.hash),isPremium:Boolean(s.premium),sets:s.sets.map(xi)}}async function Kg(){const e=await ol(new qe.messages.GetFeaturedEmojiStickers({hash:Y()(0)}));if(e&&!(e instanceof qe.messages.FeaturedStickersNotModified))return e.sets.forEach(e=>{let{set:t}=e;t.thumbDocumentId&&(an.stickerSets[String(t.id)]=t)}),{isPremium:Boolean(e.premium),sets:e.sets.map(xi)}}async function $g(e){let{sticker:t,unfave:s}=e;const n=yn(t);if(!n)return;const a=new qe.messages.FaveSticker({id:n,unfave:Boolean(s)});await ol(a)&&za({"@type":"updateFavoriteStickers"})}function Jg(e){let{sticker:t}=e;const s=yn(t);if(s)return ol(new qe.messages.SaveRecentSticker({id:s,unsave:!0}))}function Qg(){return ol(new qe.messages.ClearRecentStickers)}async function Xg(e){let{stickerSetInfo:t}=e;if("isMissing"in t)return;const s="id"in t?_n(t.id,t.accessHash):(n=t.shortName,new qe.InputStickerSetShortName({shortName:n}));var n;const a=await ol(new qe.messages.GetStickerSet({stickerset:s,hash:cn.INT}),{shouldThrow:!0});return a instanceof qe.messages.StickerSet?(an.stickerSets[String(a.set.id)]=a.set,{set:Bi(a.set),stickers:Ni(a.documents),packs:Vi(a.packs)}):void 0}async function Zg(e){let{documentId:t}=e;if(!t.length)return;const s=await ol(new qe.messages.GetCustomEmojiDocuments({documentId:t.map(e=>Y()(e))}));return s?Ni(s):void 0}async function Yg(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetAnimatedEmoji,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function ep(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetAnimatedEmojiAnimations,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function tp(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetEmojiGenericAnimations,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function sp(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetPremiumGifts,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function np(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetTonGifts,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function ap(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetEmojiDefaultTopicIcons,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function ip(){const e=await ol(new qe.messages.GetStickerSet({stickerset:new qe.InputStickerSetEmojiDefaultStatuses,hash:cn.INT}));if(e instanceof qe.messages.StickerSet)return{set:Bi(e.set),stickers:Ni(e.documents)}}async function op(e){let{hash:t}=e;const s=await ol(new qe.account.GetCollectibleEmojiStatuses({hash:t?Y()(t):cn.BIGINT}));if(s instanceof qe.account.EmojiStatuses)return{statuses:s.statuses.map(Da).filter(Boolean),hash:String(s.hash)}}async function rp(e){let{query:t,hash:s}=e;const n=await ol(new qe.messages.SearchStickerSets({q:t,hash:s?Y()(s):cn.BIGINT}));if(n&&!(n instanceof qe.messages.FoundStickerSetsNotModified))return{hash:String(n.hash),sets:n.sets.map(xi)}}async function cp(e){let{hash:t}=e;const s=await ol(new qe.messages.GetSavedGifs({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.SavedGifsNotModified))return{hash:String(s.hash),gifs:_p(s.gifs)}}function dp(e){let{gif:t,shouldUnsave:s}=e;const n=yn(t);if(n)return ol(new qe.messages.SaveGif({id:n,unsave:Boolean(s)}),{shouldReturnTrue:!0})}async function lp(e){let{stickerSetId:t,accessHash:s}=e;await ol(new qe.messages.InstallStickerSet({stickerset:_n(t,s),archived:!1}))&&za({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:Date.now()}})}async function up(e){let{stickerSetId:t,accessHash:s}=e;await ol(new qe.messages.UninstallStickerSet({stickerset:_n(t,s)}))&&za({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:void 0}})}let fp;async function gp(e){let{query:t,offset:s=cn.STRING,username:n=H}=e;if(!fp){const e=await ol(new qe.contacts.ResolveUsername({username:n}));if(!(e&&e.users[0]instanceof qe.User))return;fp=new qe.InputUser({userId:e.peer.userId,accessHash:e.users[0].accessHash})}const a=await ol(new qe.messages.GetInlineBotResults({bot:fp,peer:new qe.InputPeerEmpty,query:t,offset:s}));if(!a)return;const i=a.results.map(e=>{if(e instanceof qe.BotInlineMediaResult)return e.document}).filter(Boolean);return{nextOffset:a.nextOffset,gifs:_p(i)}}async function pp(e){let{emoji:t,hash:s}=e;const n=await ol(new qe.messages.GetStickers({emoticon:t,hash:s?Y()(s):cn.BIGINT}));if(n&&!(n instanceof qe.messages.StickersNotModified))return{stickers:Ni(n.stickers),hash:String(n.hash)}}async function hp(e){let{language:t,fromVersion:s=cn.INT}=e;const n=await ol(new qe.messages.GetEmojiKeywordsDifference({langCode:t,fromVersion:s}));if(n)return{language:n.langCode,version:n.version,keywords:n.keywords.reduce((e,t)=>(e[t.keyword]=t.emoticons,e),{})}}async function mp(e){const t=await ol(new qe.account.GetRecentEmojiStatuses({hash:e?Y()(e):cn.BIGINT}));if(!t||t instanceof qe.account.EmojiStatusesNotModified)return;const s=t.statuses.slice(0,M).map(Da).filter(Boolean).map(e=>{let{documentId:t}=e;return t}),n=await Zg({documentId:s});return{hash:String(t.hash),emojiStatuses:n}}function _p(e){return e.map(e=>{if(e instanceof qe.Document){const t=ho(e);if(t)return an.documents[String(e.id)]=e,t}}).filter(Boolean)}async function yp(e){let{username:t}=e;try{return{result:await ol(new qe.channels.CheckUsername({channel:new qe.InputChannelEmpty,username:t}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(V.has(t))return{result:!1,error:t};throw e}}async function bp(e){let{chat:t,username:s}=e;const n=await ol(new qe.channels.UpdateUsername({channel:gn(t.id,t.accessHash),username:s}));let a=s?[{username:s,isEditable:!0,isActive:!0}]:[];return t.usernames&&(a=a.concat(t.usernames.filter(e=>e.username&&!e.isEditable))),n&&za({"@type":"updateChat",id:t.id,chat:{usernames:a.length?a:void 0}}),n}async function wp(e){let{chat:t}=e;const s=await ol(new qe.channels.DeactivateAllUsernames({channel:gn(t.id,t.accessHash)}));if(s){const e=t.usernames?t.usernames.map(e=>({...e,isActive:!1})).filter(e=>e.username):void 0;za({"@type":"updateChat",id:t.id,chat:{usernames:e}})}return s}async function Sp(e){let{chat:t,usageLimit:s,expireDate:n}=e;const a=await ol(new qe.messages.ExportChatInvite({peer:un(t.id,t.accessHash),usageLimit:s,expireDate:n}));if(a instanceof qe.ChatInviteExported)return za({"@type":"updateChatFullInfo",id:t.id,fullInfo:{inviteLink:a.link}}),a.link}async function Ip(e){let{peer:t,admin:s,limit:n=0,isRevoked:a}=e;const i=await ol(new qe.messages.GetExportedChatInvites({peer:un(t.id,t.accessHash),adminId:fn(s.id,s.accessHash),limit:n,revoked:a||void 0}),{abortControllerChatId:t.id});if(i)return{invites:i.invites.filter(e=>e instanceof qe.ChatInviteExported).map(pr)}}async function vp(e){let{peer:t,isRevoked:s,link:n,expireDate:a,usageLimit:i,isRequestNeeded:o,title:r}=e;const c=await ol(new qe.messages.EditExportedChatInvite({link:n,peer:un(t.id,t.accessHash),expireDate:a,usageLimit:o?void 0:i,requestNeeded:o,title:r,revoked:s||void 0}));if(c){if(c instanceof qe.messages.ExportedChatInvite&&c.invite instanceof qe.ChatInviteExported){const e=pr(c.invite);return{oldInvite:e,newInvite:e}}if(c instanceof qe.messages.ExportedChatInviteReplaced&&c.invite instanceof qe.ChatInviteExported&&c.newInvite instanceof qe.ChatInviteExported)return{oldInvite:pr(c.invite),newInvite:pr(c.newInvite)}}}async function Pp(e){let{peer:t,expireDate:s,usageLimit:n,isRequestNeeded:a,title:i}=e;const o=await ol(new qe.messages.ExportChatInvite({peer:un(t.id,t.accessHash),expireDate:s,usageLimit:a?void 0:n,requestNeeded:a||void 0,title:i}));if(o instanceof qe.ChatInviteExported)return pr(o)}async function Cp(e){let{peer:t,link:s}=e;return await ol(new qe.messages.DeleteExportedChatInvite({peer:un(t.id,t.accessHash),link:s}))}async function Mp(e){let{peer:t,admin:s}=e;return await ol(new qe.messages.DeleteRevokedExportedChatInvites({peer:un(t.id,t.accessHash),adminId:fn(s.id,s.accessHash)}))}async function Ap(e){let{peer:t,link:s,offsetDate:n=0,offsetUser:a,limit:i=0,isRequested:o}=e;const r=await ol(new qe.messages.GetChatInviteImporters({peer:un(t.id,t.accessHash),link:s,offsetDate:n,offsetUser:a?fn(a.id,a.accessHash):new qe.InputUserEmpty,limit:i,requested:o||void 0}),{abortControllerChatId:t.id});if(r)return{importers:r.importers.map(e=>function(e){const{userId:t,date:s,about:n,requested:a,viaChatlist:i}=e;return{userId:Ra(t,"user"),date:s,about:n,isRequested:a,isFromChatList:i}}(e))}}function Rp(e){let{peer:t,user:s,isApproved:n}=e;return ol(new qe.messages.HideChatJoinRequest({peer:un(t.id,t.accessHash),userId:fn(s.id,s.accessHash),approved:n||void 0}),{shouldReturnTrue:!0})}function Tp(e){let{peer:t,isApproved:s,link:n}=e;return ol(new qe.messages.HideAllChatJoinRequests({peer:un(t.id,t.accessHash),approved:s||void 0,link:n}),{shouldReturnTrue:!0})}function kp(e){const{id:t,accessHash:s}=e;return ol(new qe.messages.HidePeerSettingsBar({peer:un(t,s)}))}var Dp=s(48287).hp;function Up(e){const{emojies_sounds:t}=e;return t?Object.keys(t).reduce((e,s)=>{const n=t[s];return an.documents[n.id]=new qe.Document({id:Y()(n.id),accessHash:Y()(n.access_hash),dcId:1,mimeType:"audio/ogg",fileReference:Dp.alloc(0),size:Y()(0)}),e[s]=n.id,e},{}):{}}function Ep(e,t,s){return[e[`${t}_default`]||Gl[s][0],e[`${t}_premium`]||Gl[s][1]]}const Bp=["ar","fa","id","ko","uz","en"];function xp(e){let{firstName:t,lastName:s,about:n}=e;return ol(new qe.account.UpdateProfile({firstName:t,lastName:s,about:n}),{shouldReturnTrue:!0})}async function Vp(e){try{return{result:await ol(new qe.account.CheckUsername({username:e}),{shouldThrow:!0}),error:void 0}}catch(e){if(e instanceof He&&V.has(e.errorMessage))return{result:!1,error:e.errorMessage};throw e}}function Np(e){return ol(new qe.account.UpdateUsername({username:e}),{shouldReturnTrue:!0})}async function Gp(e,t){const s=e&&An(e),n=await ol(new qe.photos.UpdateProfilePhoto({id:s||new qe.InputPhotoEmpty,...t?{fallback:!0}:void 0}));if(n)return n.photo instanceof qe.Photo?(li(n.photo),{photo:Ii(n.photo)}):void 0}async function Fp(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0;const i=await dl(e),o=await ol(new qe.photos.UploadProfilePhoto({...a?{bot:fn(a.id,a.accessHash)}:void 0,...s?{video:i,videoStartTs:n}:{file:i},...t?{fallback:!0}:void 0}));if(o)return o.photo instanceof qe.Photo?(li(o.photo),{photo:Ii(o.photo)}):void 0}async function qp(e){let{file:t,isSuggest:s,user:n}=e;const a=t?await dl(t):void 0,i=await ol(new qe.photos.UploadContactProfilePhoto({userId:fn(n.id,n.accessHash),file:a,...s?{suggest:!0}:{save:!0}}));if(i)return i.photo instanceof qe.Photo?(li(i.photo),{photo:Ii(i.photo)}):{photo:void 0}}async function Hp(e){const t=e.map(An).filter(Boolean),s=await ol(new qe.photos.DeletePhotos({id:t}),{shouldReturnTrue:!0});return s&&e.forEach(e=>{delete an.photos[e.id]}),s}async function Lp(){const e=await ol(new qe.account.GetWallPapers({hash:Y()("0")}));if(!e||e instanceof qe.account.WallPapersNotModified)return;const t=e.wallpapers.filter(e=>e instanceof qe.WallPaper&&e.document instanceof qe.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType);return t.forEach(e=>{an.documents[String(e.document.id)]=e.document}),{wallpapers:t.map(Fo).filter(Boolean)}}async function Op(e){const t=await dl(e),s=await ol(new qe.account.UploadWallPaper({file:t,mimeType:e.type,settings:new qe.WallPaperSettings}));if(!(s&&s instanceof qe.WallPaper))return;const n=Fo(s);return n?(an.documents[String(s.document.id)]=s.document,{wallpaper:n}):void 0}async function jp(e){let{isOnlyStories:t}=e;const s=await ol(new qe.contacts.GetBlocked({myStoriesFrom:t,offset:cn.INT,limit:El}));if(s)return{blockedIds:s.blocked.map(e=>Ta(e.peerId)),totalCount:s instanceof qe.contacts.BlockedSlice?s.count:s.blocked.length}}function Wp(e){let{user:t,isOnlyStories:s}=e;return ol(new qe.contacts.Block({id:un(t.id,t.accessHash),myStoriesFrom:s}))}function zp(e){let{user:t,isOnlyStories:s}=e;return ol(new qe.contacts.Unblock({id:un(t.id,t.accessHash),myStoriesFrom:s}))}async function Kp(){const e=await ol(new qe.account.GetAuthorizations);if(e)return{authorizations:xs(e.authorizations.map(qo),"hash"),ttlDays:e.authorizationTtlDays}}function $p(e){return ol(new qe.account.ResetAuthorization({hash:Y()(e)}))}function Jp(){return ol(new qe.auth.ResetAuthorizations)}async function Qp(){const e=await ol(new qe.account.GetWebAuthorizations);if(e)return{webAuthorizations:xs(e.authorizations.map(Ho),"hash")}}function Xp(e){return ol(new qe.account.ResetWebAuthorization({hash:Y()(e)}))}function Zp(){return ol(new qe.account.ResetWebAuthorizations)}async function Yp(){const e=await ol(new qe.account.GetNotifyExceptions({compareSound:!0}),{shouldIgnoreUpdates:!0});if(e instanceof qe.Updates||e instanceof qe.UpdatesCombined)return e.updates.reduce((e,t)=>t instanceof qe.UpdateNotifySettings&&t.peer instanceof qe.NotifyPeer?(e[Ta(t.peer.peer)]=Lo(t.notifySettings),e):e,{})}async function eh(){return await ol(new qe.account.GetContactSignUpNotification)}async function th(){const[e,t,s]=await Promise.all([ol(new qe.account.GetNotifySettings({peer:new qe.InputNotifyUsers})),ol(new qe.account.GetNotifySettings({peer:new qe.InputNotifyChats})),ol(new qe.account.GetNotifySettings({peer:new qe.InputNotifyBroadcasts}))]);if(e&&t&&s)return{users:Lo(e),groups:Lo(t),channels:Lo(s)}}function sh(e){return ol(new qe.account.SetContactSignUpNotification({silent:e}))}function nh(e,t){let s,{isMuted:n,shouldShowPreviews:a}=t;s="users"===e?new qe.InputNotifyUsers:"groups"===e?new qe.InputNotifyChats:new qe.InputNotifyBroadcasts;const i={showPreviews:a,muteUntil:n?S:I};return ol(new qe.account.UpdateNotifySettings({peer:s,settings:new qe.InputPeerNotifySettings(i)}))}async function ah(e){let{langPack:t,langCode:s}=e;const n=await ol(new qe.langpack.GetLangPack({langPack:t,langCode:s}));if(!n)return;const{strings:a,keysToRemove:i}=Ko(n.strings);return{version:n.version,strings:a,keysToRemove:i}}async function ih(e){let{langPack:t,langCode:s,fromVersion:n}=e;const a=await ol(new qe.langpack.GetDifference({langPack:t,langCode:s,fromVersion:n}));if(!a)return;const{strings:i,keysToRemove:o}=Ko(a.strings);return{version:a.version,strings:i,keysToRemove:o}}async function oh(){const e=await ol(new qe.langpack.GetLanguages({langPack:G}));if(e)return e.map($o)}async function rh(e){let{langPack:t,langCode:s}=e;const n=await ol(new qe.langpack.GetLanguage({langPack:t,langCode:s}));if(n)return $o(n)}async function ch(e){let{langPack:t,langCode:s,keys:n}=e;const a=await ol(new qe.langpack.GetStrings({langPack:t,langCode:s,keys:n}));if(a)return Ko(a)}async function dh(e){let{sourceLangPacks:t,langCode:s}=e;const n=(await Promise.all(t.map(e=>ol(new qe.langpack.GetLangPack({langPack:e,langCode:Bp.includes(s)?`${s}-raw`:s}))))).filter(Boolean).map(zo);if(n.length)return{langPack:Object.assign({},...n.reverse())}}async function lh(e){const t=Un(e);if(!t)return;const s=await ol(new qe.account.GetPrivacy({key:t}));return s?{rules:Ai(s.rules)}:void 0}function uh(e){const t=Zd.session.getAuthKey().getKey();return ol(new qe.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function fh(e){return ol(new qe.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function gh(e,t){const s=Un(e),n=$n(t);if(!s)return;const a=await ol(new qe.account.SetPrivacy({key:s,rules:n}));return a?{rules:Ai(a.rules)}:void 0}async function ph(e){await ol(new qe.account.UpdateStatus({offline:!e}))}async function hh(){const e=await ol(new qe.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function mh(e){return ol(new qe.account.SetContentSettings({sensitiveEnabled:e||void 0}))}async function _h(e){const t=await ol(new qe.help.GetAppConfig({hash:e??cn.INT}));if(!t||t instanceof qe.help.AppConfigNotModified)return;const{config:s,hash:n}=t;return function(e,t){const s=jo(e),n={emojiSounds:Up(s),seenByMaxChatMembers:s.chat_read_mark_size_threshold,seenByExpiresAt:s.chat_read_mark_expire_period,readDateExpiresAt:s.pm_read_date_expire_period,autologinDomains:s.autologin_domains||[],urlAuthDomains:s.url_auth_domains||[],whitelistedDomains:s.whitelisted_domains||[],maxUniqueReactions:s.reactions_uniq_max,premiumBotUsername:s.premium_bot_username,premiumInvoiceSlug:s.premium_invoice_slug,premiumPromoOrder:s.premium_promo_order,isPremiumPurchaseBlocked:s.premium_purchase_blocked,isGiveawayGiftsPurchaseAvailable:s.giveaway_gifts_purchase_available,defaultEmojiStatusesStickerSetId:s.default_emoji_statuses_stickerset_id,topicsPinnedLimit:s.topics_pinned_limit,hiddenMembersMinCount:s.hidden_members_group_size_min,giveawayAddPeersMax:s.giveaway_add_peers_max,giveawayBoostsPerPremium:s.giveaway_boosts_per_premium,giveawayCountriesMax:s.giveaway_countries_max,boostsPerSentGift:s.boosts_per_sent_gift,canDisplayAutoarchiveSetting:s.autoarchive_setting_available,limits:{uploadMaxFileparts:Ep(s,"upload_max_fileparts","uploadMaxFileparts"),stickersFaved:Ep(s,"stickers_faved_limit","stickersFaved"),savedGifs:Ep(s,"saved_gifs_limit","savedGifs"),dialogFiltersChats:Ep(s,"dialog_filters_chats_limit","dialogFiltersChats"),dialogFilters:Ep(s,"dialog_filters_limit","dialogFilters"),dialogFolderPinned:Ep(s,"dialogs_pinned_limit","dialogFolderPinned"),captionLength:Ep(s,"caption_length_limit","captionLength"),channels:Ep(s,"channels_limit","channels"),channelsPublic:Ep(s,"channels_public_limit","channelsPublic"),aboutLength:Ep(s,"about_length_limit","aboutLength"),chatlistInvites:Ep(s,"chatlist_invites_limit","chatlistInvites"),chatlistJoined:Ep(s,"chatlist_joined_limit","chatlistJoined"),recommendedChannels:Ep(s,"recommended_channels_limit","recommendedChannels"),savedDialogsPinned:Ep(s,"saved_dialogs_pinned_limit","savedDialogsPinned"),maxReactions:Ep(s,"reactions_user_max","maxReactions"),moreAccounts:Gl.moreAccounts},hash:t,storyViewersExpirePeriod:s.story_viewers_expire_period,storyChangelogUserId:s.stories_changelog_user_id?.toString(),maxPinnedStoriesCount:s.stories_pinned_to_top_count_max,groupTranscribeLevelMin:s.group_transcribe_level_min,canLimitNewMessagesWithoutPremium:s.new_noncontact_peers_require_premium_without_ownpremium,starsPaidMessagesAvailable:s.stars_paid_messages_available,starsPaidMessageCommissionPermille:s.stars_paid_message_commission_permille,starsPaidMessageAmountMax:s.stars_paid_message_amount_max,starsUsdWithdrawRateX1000:s.stars_usd_withdraw_rate_x1000,bandwidthPremiumNotifyPeriod:s.upload_premium_speedup_notify_period,bandwidthPremiumUploadSpeedup:s.upload_premium_speedup_upload,bandwidthPremiumDownloadSpeedup:s.upload_premium_speedup_download,channelRestrictAdsLevelMin:s.channel_restrict_sponsored_level_min,channelAutoTranslationLevelMin:s.channel_autotranslation_level_min,paidReactionMaxAmount:s.stars_paid_reaction_amount_max,isChannelRevenueWithdrawalEnabled:s.channel_revenue_withdrawal_enabled,isStarsGiftEnabled:s.stars_gifts_enabled,starGiftMaxMessageLength:s.stargifts_message_length_max,starGiftMaxConvertPeriod:s.stargifts_convert_period_max,starRefStartPrefixes:s.starref_start_param_prefixes,tonExplorerUrl:s.ton_blockchain_explorer_url,savedGiftPinLimit:s.stargifts_pinned_to_top_limit,freezeSinceDate:s.freeze_since_date,freezeUntilDate:s.freeze_until_date,freezeAppealUrl:s.freeze_appeal_url,starsStargiftResaleAmountMin:s.stars_stargift_resale_amount_min,starsStargiftResaleAmountMax:s.stars_stargift_resale_amount_max,starsStargiftResaleCommissionPermille:s.stars_stargift_resale_commission_permille,tonStargiftResaleAmountMin:s.ton_stargift_resale_amount_min,tonStargiftResaleAmountMax:s.ton_stargift_resale_amount_max,tonStargiftResaleCommissionPermille:s.ton_stargift_resale_commission_permille,starsSuggestedPostAmountMax:s.stars_suggested_post_amount_max,starsSuggestedPostAmountMin:s.stars_suggested_post_amount_min,starsSuggestedPostCommissionPermille:s.stars_suggested_post_commission_permille,starsSuggestedPostAgeMin:s.stars_suggested_post_age_min,starsSuggestedPostFutureMax:s.stars_suggested_post_future_max,starsSuggestedPostFutureMin:s.stars_suggested_post_future_min,tonSuggestedPostCommissionPermille:s.ton_suggested_post_commission_permille,tonSuggestedPostAmountMax:s.ton_suggested_post_amount_max,tonSuggestedPostAmountMin:s.ton_suggested_post_amount_min,tonUsdRate:s.ton_usd_rate,tonTopupUrl:s.ton_topup_url,pollMaxAnswers:s.poll_answers_max,todoItemsMax:s.todo_items_max,todoTitleLengthMax:s.todo_title_length_max,todoItemLengthMax:s.todo_item_length_max,ignoreRestrictionReasons:s.ignore_restriction_reasons,needAgeVideoVerification:s.need_age_video_verification,verifyAgeBotUsername:s.verify_age_bot_username,verifyAgeCountry:s.verify_age_country,verifyAgeMin:s.verify_age_min};return{...Fl,...qs(n)}}(s,n)}async function yh(){const e=await ol(new qe.help.GetConfig);if(e)return function(e){const{testMode:t,expires:s,gifSearchUsername:n,chatSizeMax:a,autologinToken:i,reactionsDefault:o,messageLengthMax:r,editTimeLimit:c,forwardedCountMax:d}=e;return{isTestServer:t,expiresAt:s,gifSearchUsername:n,defaultReaction:o&&xo(o),maxGroupSize:a,autologinToken:i,maxMessageLength:r,editTimeLimit:c,maxForwardedCount:d}}(e)}async function bh(e){const t=await ol(new qe.help.GetPeerColors({hash:e??cn.INT}));if(!t)return;const s=function(e){if(e instanceof qe.help.PeerColors)return Vs(e.colors,e=>[e.colorId,{isHidden:e.hidden,colors:e.colors&&Jo(e.colors),darkColors:e.darkColors&&Jo(e.darkColors)}])}(t);return s?{colors:s,hash:t instanceof qe.help.PeerColors?t.hash:void 0}:void 0}async function wh(e){const t=await ol(new qe.help.GetTimezonesList({hash:e??cn.INT}));if(t&&!(t instanceof qe.help.TimezonesListNotModified))return{timezones:t.timezones.map(Qo),hash:t.hash}}async function Sh(e){let{langCode:t="en"}=e;const s=await ol(new qe.help.GetCountriesList({langCode:t,hash:cn.INT}));if(s instanceof qe.help.CountriesList)return function(e){const t=e.filter(e=>{let{hidden:t}=e;return!t});return{phoneCodes:t.map(e=>e.countryCodes.map(t=>Oo(e,t))).flat().sort((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)),general:t.map(e=>Oo(e,e.countryCodes[0])).sort((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))}}(s.countries)}async function Ih(){const e=await ol(new qe.account.GetGlobalPrivacySettings);if(e)return{shouldArchiveAndMuteNewNonContact:Boolean(e.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(e.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(e.newNoncontactPeersRequirePremium),nonContactPeersPaidStars:Number(e.noncontactPeersPaidStars),shouldDisplayGiftsButton:Boolean(e.displayGiftsButton),disallowedGifts:e.disallowedGifts&&co(e.disallowedGifts)}}async function vh(e){let{shouldArchiveAndMuteNewNonContact:t,shouldHideReadMarks:s,shouldNewNonContactPeersRequirePremium:n,nonContactPeersPaidStars:a,shouldDisplayGiftsButton:i,disallowedGifts:o}=e;const r=await ol(new qe.account.SetGlobalPrivacySettings({settings:new qe.GlobalPrivacySettings({...t&&{archiveAndMuteNewNoncontactPeers:!0},...s&&{hideReadMarks:!0},...n&&{newNoncontactPeersRequirePremium:!0},displayGiftsButton:i||void 0,noncontactPeersPaidStars:Y()(a||0),disallowedGifts:o&&Fn(o)})}));if(r)return{shouldArchiveAndMuteNewNonContact:Boolean(r.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(r.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(r.newNoncontactPeersRequirePremium),nonContactPeersPaidStars:Number(r.noncontactPeersPaidStars),shouldDisplayGiftsButton:i,disallowedGifts:o}}function Ph(e){let{chatId:t,accessHash:s,username:n,isActive:a}=e;return ol(t?new qe.channels.ToggleUsername({channel:gn(t,s),username:n,active:a}):new qe.account.ToggleUsername({username:n,active:a}))}function Ch(e){let{chatId:t,accessHash:s,usernames:n}=e;return ol(t?new qe.channels.ReorderUsernames({channel:gn(t,s),order:n}):new qe.account.ReorderUsernames({order:n}))}const Mh={};async function Ah(){const e=await ol(new qe.account.GetPassword);if(!e)return;const{hint:t,hasPassword:s}=e;return{hint:t,hasPassword:s}}function Rh(e){return za({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise((e,t)=>{Mh.resolve=e,Mh.reject=t})}function Th(e,t){try{return function(e,t){return Zd.getTmpPassword(e,t)}(e,t)}catch(e){if(!La(e))return;return Promise.resolve(Oa(e))}}function kh(e){try{return t=e,Zd.getCurrentPassword(t)}catch(e){if(!La(e))return;return Promise.resolve(Oa(e))}var t}async function Dh(e){try{return await ll({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Vh(e),!1}}async function Uh(e){try{return await ll({currentPassword:e}),!0}catch(e){return Vh(e),!1}}async function Eh(e,t,s,n){try{return await ll({currentPassword:e,newPassword:t,hint:s,email:n,emailCodeCallback:Rh,onEmailCodeError:Vh}),!0}catch(e){return Vh(e),!1}}async function Bh(e,t){try{return await ll({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Rh,onEmailCodeError:Vh}),!0}catch(e){return Vh(e),!1}}function xh(e){Mh.resolve(e)}function Vh(e){za({"@type":"updateTwoFaError",messageKey:Oa(e).messageKey})}async function Nh(e){let{chatId:t,accessHash:s,messageId:n,data:a,isGame:i}=e;const o=await ol(new qe.messages.GetBotCallbackAnswer({peer:un(t,s),msgId:n,data:a?qa(a):void 0,game:i||void 0}));return o?Qs(o):void 0}async function Gh(){const e=await ol(new qe.contacts.GetTopPeers({botsInline:!0,limit:cn.INT,offset:cn.INT,hash:cn.BIGINT}));if(e instanceof qe.contacts.TopPeers)return{ids:e.users.map(to).filter(Boolean).map(e=>{let{id:t}=e;return t})}}async function Fh(){const e=await ol(new qe.contacts.GetTopPeers({botsApp:!0,limit:cn.INT,offset:cn.INT,hash:cn.BIGINT}));if(e instanceof qe.contacts.TopPeers)return{ids:e.users.map(to).filter(Boolean).map(e=>{let{id:t}=e;return t})}}async function qh(e){let{username:t}=e;const s=await ol(new qe.contacts.ResolveUsername({username:t}));if(s&&s.users[0]instanceof qe.User&&s.users[0].bot&&s.users[0].botInlinePlaceholder)return pi(s.users[0]),{user:to(s.users[0]),chat:nr(s.users[0])}}async function Hh(e){let{bot:t,chat:s,query:n,offset:a=cn.STRING}=e;const i=await ol(new qe.messages.GetInlineBotResults({bot:fn(t.id,t.accessHash),peer:un(s.id,s.accessHash),query:n,offset:a}));var o,r,c,d,l,u;if(i)return{isGallery:Boolean(i.gallery),help:t.botPlaceholder,nextOffset:(l=t.usernames[0].username,u=i.nextOffset,"gif"===l&&"0"===u?"":u),switchPm:(d=i.switchPm,d?Ns(d,["text","startParam"]):void 0),switchWebview:(c=i.switchWebview,c?Ns(c,["text","url"]):void 0),results:(o=String(i.queryId),r=i.results,r.map(e=>e instanceof qe.BotInlineMediaResult?(e.document instanceof qe.Document&&ui(e.document),e.photo instanceof qe.Photo&&li(e.photo),Hi(e,o)):(e.thumb&&hi(e.thumb),qi(e,o)))),cacheTime:i.cacheTime}}async function Lh(e){let{chat:t,replyInfo:s,resultId:n,queryId:a,sendAs:i,isSilent:o,scheduleDate:r,allowPaidStars:c}=e;const d=In();await ol(new qe.messages.SendInlineBotResult({clearDraft:!0,randomId:d,queryId:Y()(a),peer:un(t.id,t.accessHash),id:n,scheduleDate:r,replyTo:s&&Wn(s),...o&&{silent:!0},...i&&{sendAs:un(i.id,i.accessHash)},...c&&{allowPaidStars:Y()(c)}}))}async function Oh(e){let{bot:t,startParam:s}=e;const n=In();await ol(new qe.messages.StartBot({bot:fn(t.id,t.accessHash),peer:un(t.id,t.accessHash),randomId:n,startParam:s??cn.STRING}))}async function jh(e){let{isSilent:t,peer:s,bot:n,url:a,startParam:i,replyInfo:o,theme:r,sendAs:c,isFromBotMenu:d,isFullscreen:l}=e;const u=await ol(new qe.messages.RequestWebView({silent:t||void 0,peer:un(s.id,s.accessHash),bot:fn(n.id,n.accessHash),url:a,startParam:i,themeParams:r?Bn(r):void 0,fromBotMenu:d||void 0,platform:N,replyTo:o&&Wn(o),fullscreen:!!l||void 0,...c&&{sendAs:un(c.id,c.accessHash)}}));if(u instanceof qe.WebViewResultUrl)return{url:u.url,queryId:u.queryId?.toString(),isFullScreen:Boolean(u.fullscreen)}}async function Wh(e){let{peer:t,bot:s,startParam:n,mode:a,theme:i}=e;const o=await ol(new qe.messages.RequestMainWebView({peer:un(t.id,t.accessHash),bot:fn(s.id,s.accessHash),startParam:n,fullscreen:"fullscreen"===a||void 0,themeParams:i?Bn(i):void 0,platform:N}));if(o instanceof qe.WebViewResultUrl)return{url:o.url,queryId:o.queryId?.toString(),isFullscreen:Boolean(o.fullscreen)}}async function zh(e){let{bot:t,url:s,theme:n,startParam:a,isFromSwitchWebView:i,isFromSideMenu:o}=e;const r=await ol(new qe.messages.RequestSimpleWebView({url:s,bot:fn(t.id,t.accessHash),themeParams:n?Bn(n):void 0,platform:N,startParam:a,fromSwitchWebview:i||void 0,fromSideMenu:o||void 0}));return r?.url}async function Kh(e){let{bot:t,appName:s}=e;const n=await ol(new qe.messages.GetBotApp({app:new qe.InputBotAppShortName({botId:fn(t.id,t.accessHash),shortName:s}),hash:cn.BIGINT}));if(n&&!(n instanceof qe.BotAppNotModified))return function(e){const{app:t,inactive:s,requestWriteAccess:n}=e,a=$i(t);if(a)return{...a,isInactive:s,shouldRequestWriteAccess:n}}(n)}async function $h(e){let{peer:t,app:s,startParam:n,mode:a,theme:i,isWriteAllowed:o}=e;const r=await ol(new qe.messages.RequestAppWebView({peer:un(t.id,t.accessHash),app:jn(s),startParam:n,themeParams:i?Bn(i):void 0,platform:N,writeAllowed:o||void 0,fullscreen:"fullscreen"===a||void 0}));return{url:r?.url,isFullscreen:Boolean(r?.fullscreen)}}function Jh(e){let{isSilent:t,peer:s,bot:n,queryId:a,replyInfo:i,sendAs:o}=e;return ol(new qe.messages.ProlongWebView({silent:t||void 0,peer:un(s.id,s.accessHash),bot:fn(n.id,n.accessHash),queryId:Y()(a),replyTo:i&&Wn(i),...o&&{sendAs:un(o.id,o.accessHash)}}))}async function Qh(e){let{bot:t,buttonText:s,data:n}=e;const a=In();await ol(new qe.messages.SendWebViewData({bot:fn(t.id,t.accessHash),buttonText:s,data:n,randomId:a}))}async function Xh(e){let{hash:t}=e;const s=await ol(new qe.messages.GetAttachMenuBots({hash:t?Y()(t):cn.BIGINT}));if(s instanceof qe.AttachMenuBots)return{hash:s.hash.toString(),bots:xs(s.bots.map(Li),"id")}}async function Zh(e){let{bot:t}=e;const s=await ol(new qe.messages.GetAttachMenuBot({bot:fn(t.id,t.accessHash)}));if(s instanceof qe.AttachMenuBotsBot)return{bot:Li(s.bot)}}function Yh(e){let{bot:t,isWriteAllowed:s,isEnabled:n}=e;return ol(new qe.messages.ToggleBotInAttachMenu({bot:fn(t.id,t.accessHash),writeAllowed:s||void 0,enabled:n}))}async function em(e){let{chat:t,buttonId:s,messageId:n}=e;const a=await ol(new qe.messages.RequestUrlAuth({peer:un(t.id,t.accessHash),buttonId:s,msgId:n}));if(!a)return;const i=Wo(a);return"request"===i?.type&&za({"@type":"updateUser",id:i.bot.id,user:i.bot}),i}async function tm(e){let{chat:t,messageId:s,buttonId:n,isWriteAllowed:a}=e;const i=await ol(new qe.messages.AcceptUrlAuth({peer:un(t.id,t.accessHash),msgId:s,buttonId:n,writeAllowed:a||void 0}));if(!i)return;const o=Wo(i);return"request"===o?.type&&za({"@type":"updateUser",id:o.bot.id,user:o.bot}),o}async function sm(e){let{url:t}=e;const s=await ol(new qe.messages.RequestUrlAuth({url:t}));if(!s)return;const n=Wo(s);return"request"===n?.type&&za({"@type":"updateUser",id:n.bot.id,user:n.bot}),n}async function nm(e){let{url:t,isWriteAllowed:s}=e;const n=await ol(new qe.messages.AcceptUrlAuth({url:t,writeAllowed:s||void 0}));if(!n)return;const a=Wo(n);return"request"===a?.type&&za({"@type":"updateUser",id:a.bot.id,user:a.bot}),a}function am(e){let{bot:t}=e;return ol(new qe.bots.CanSendMessage({bot:fn(t.id,t.accessHash)}))}function im(e){let{bot:t}=e;return ol(new qe.bots.AllowSendMessage({bot:fn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}async function om(e){let{bot:t,customMethod:s,parameters:n}=e;try{const e=await ol(new qe.bots.InvokeWebViewCustomMethod({bot:fn(t.id,t.accessHash),params:new qe.DataJSON({data:n}),customMethod:s}),{shouldThrow:!0});return{result:JSON.parse(e.data)}}catch(e){return{error:e.message}}}async function rm(e){let{bot:t}=e;const s=await ol(new qe.bots.GetPreviewMedias({bot:fn(t.id,t.accessHash)}));if(s)return s.map(e=>({content:po(e.media),date:e.date}))}function cm(e){let{bot:t,fileName:s,url:n}=e;return ol(new qe.bots.CheckDownloadFileParams({bot:fn(t.id,t.accessHash),fileName:s,url:n}),{shouldReturnTrue:!0})}function dm(e){let{bot:t,isEnabled:s}=e;return ol(new qe.bots.ToggleUserEmojiStatusPermission({bot:fn(t.id,t.accessHash),enabled:s}),{shouldReturnTrue:!0})}function lm(e){let{bot:t,langCode:s,name:n,about:a,description:i}=e;return ol(new qe.bots.SetBotInfo({bot:fn(t.id,t.accessHash),langCode:s,name:n,about:a,description:i}),{shouldReturnTrue:!0})}async function um(e){let{offset:t=cn.STRING,limit:s}=e;const n=await ol(new qe.bots.GetPopularAppBots({offset:t,limit:s??cn.INT}));if(n)return{peerIds:n.users.map(to).filter(Boolean).map(e=>{let{id:t}=e;return t}),nextOffset:n.nextOffset}}async function fm(e){let{user:t}=e;if(!t)return;const s=fn(t.id,t.accessHash),n=await ol(new qe.bots.GetBotRecommendations({bot:s}));if(!n)return;const a=n?.users.map(to).filter(Boolean);return{similarBots:a,count:n instanceof qe.users.UsersSlice?n.count:a.length}}var gm=s(48287).hp;async function pm(e){let{call:t}=e;const s=await ol(new qe.phone.GetGroupCall({call:Vn(t),limit:cn.INT}));if(s)return{groupCall:Ec(s.call)}}function hm(e){let{call:t}=e;return ol(new qe.phone.DiscardGroupCall({call:Vn(t)}),{shouldReturnTrue:!0})}function mm(e){let{call:t,participant:s,muted:n,presentationPaused:a,videoStopped:i,videoPaused:o,volume:r,raiseHand:c}=e;return ol(new qe.phone.EditGroupCallParticipant({call:Vn(t),participant:un(s.id,s.accessHash),...void 0!==i&&{videoStopped:i},...void 0!==o&&{videoPaused:o},...void 0!==n&&{muted:n},...void 0!==a&&{presentationPaused:a},...void 0!==c&&{raiseHand:c},...void 0!==r&&{volume:r}}),{shouldReturnTrue:!0})}function _m(e){let{groupCall:t,title:s}=e;return ol(new qe.phone.EditGroupCallTitle({title:s,call:Vn(t)}),{shouldReturnTrue:!0})}async function ym(e){let{call:t,canSelfUnmute:s}=e;const n=await ol(new qe.phone.ExportGroupCallInvite({canSelfUnmute:s||void 0,call:Vn(t)}));if(n)return n.link}async function bm(e){let{call:t,offset:s=cn.STRING}=e;const n=await ol(new qe.phone.GetGroupParticipants({call:Vn(t),ids:[],sources:[],offset:s,limit:Tl}));n&&za({"@type":"updateGroupCallParticipants",groupCallId:t.id,participants:n.participants.map(kc),nextOffset:n.nextOffset})}function wm(e){let{call:t,isPageUnload:s}=e;const n=new qe.phone.LeaveGroupCall({call:Vn(t),source:cn.INT});s?rl(n):ol(n,{shouldReturnTrue:!0})}async function Sm(e){let{call:t,inviteHash:s,params:n}=e;const a=await ol(new qe.phone.JoinGroupCall({call:Vn(t),joinAs:new qe.InputPeerSelf,muted:!0,videoStopped:!0,params:new qe.DataJSON({data:JSON.stringify(n)}),inviteHash:s}),{shouldRetryOnTimeout:!0,abortControllerGroup:"call"});if(a&&a instanceof qe.Updates){const e=a.updates.find(e=>e instanceof qe.UpdateGroupCall);if(!(e instanceof qe.UpdateGroupCall))return;return Ec(e.call)}}async function Im(e){let{peer:t}=e;const s=Pn(),n=await ol(new qe.phone.CreateGroupCall({peer:un(t.id,t.accessHash),randomId:s}));if(n&&n instanceof qe.Updates){const e=n.updates[0];if(e instanceof qe.UpdateGroupCall)return Ec(e.call)}}function vm(e){let{call:t,params:s}=e;return ol(new qe.phone.JoinGroupCallPresentation({call:Vn(t),params:new qe.DataJSON({data:JSON.stringify(s)})}),{shouldReturnTrue:!0})}function Pm(e){let{call:t,subscribed:s}=e;return ol(new qe.phone.ToggleGroupCallStartSubscription({call:Vn(t),subscribed:s}),{shouldReturnTrue:!0,shouldIgnoreErrors:!0})}function Cm(e){let{call:t}=e;return ol(new qe.phone.LeaveGroupCallPresentation({call:Vn(t)}),{shouldReturnTrue:!0})}async function Mm(){const e=await ol(new qe.messages.GetDhConfig({version:cn.INT,randomLength:cn.INT}));if(e&&!(e instanceof qe.messages.DhConfigNotModified))return{g:e.g,p:Array.from(e.p),random:Array.from(e.random)}}function Am(e){let{call:t,isBusy:s,isPageUnload:n}=e;const a=new qe.phone.DiscardCall({peer:Nn(t),reason:s?new qe.PhoneCallDiscardReasonBusy:new qe.PhoneCallDiscardReasonHangup,duration:cn.INT,connectionId:cn.BIGINT});n?rl(a):ol(a,{shouldReturnTrue:!0})}async function Rm(e){let{user:t,gAHash:s,isVideo:n}=e;const a=await ol(new qe.phone.RequestCall({randomId:Pn(),userId:fn(t.id,t.accessHash),gAHash:gm.from(s),...n&&{video:!0},protocol:Nc()}));if(a)return za({"@type":"updatePhoneCall",call:Bc(a.phoneCall)}),!0}function Tm(e){let{call:t,rating:s,comment:n}=e;return ol(new qe.phone.SetCallRating({rating:s,peer:Nn(t),comment:n}),{shouldReturnTrue:!0})}function km(e){let{call:t}=e;return ol(new qe.phone.ReceivedCall({peer:Nn(t)}))}async function Dm(e){let{call:t,gB:s}=e;const n=await ol(new qe.phone.AcceptCall({peer:Nn(t),gB:gm.from(s),protocol:Nc()}));if(n)return t=Bc(n.phoneCall),za({"@type":"updatePhoneCall",call:t}),!0}async function Um(e){let{call:t,gA:s,keyFingerprint:n}=e;const a=await ol(new qe.phone.ConfirmCall({peer:Nn(t),gA:gm.from(s),keyFingerprint:Y()(n),protocol:Nc()}));if(a)return t=Bc(a.phoneCall),za({"@type":"updatePhoneCall",call:t}),!0}function Em(e){let{data:t,call:s}=e;return ol(new qe.phone.SendSignalingData({data:gm.from(t),peer:Nn(s)}))}function Bm(e){let{chat:t,emoticon:s}=e;return ol(new qe.messages.SetTyping({peer:un(t.id,t.accessHash),action:new qe.SendMessageEmojiInteractionSeen({emoticon:s})}),{abortControllerChatId:t.id})}function xm(e){let{chat:t,emoticon:s,messageId:n,timestamps:a}=e;return ol(new qe.messages.SetTyping({peer:un(t.id,t.accessHash),action:new qe.SendMessageEmojiInteraction({emoticon:s,msgId:n,interaction:new qe.DataJSON({data:JSON.stringify({v:1,a:a.map(e=>({t:e,i:1}))})})})}),{abortControllerChatId:t.id})}async function Vm(){const e=await ol(new qe.messages.GetAvailableReactions({hash:cn.INT}));if(e&&!(e instanceof qe.messages.AvailableReactionsNotModified))return e.reactions.forEach(e=>{e.staticIcon instanceof qe.Document&&(an.documents[String(e.staticIcon.id)]=e.staticIcon),e.selectAnimation instanceof qe.Document&&(an.documents[String(e.selectAnimation.id)]=e.selectAnimation),e.aroundAnimation instanceof qe.Document&&(an.documents[String(e.aroundAnimation.id)]=e.aroundAnimation),e.appearAnimation instanceof qe.Document&&(an.documents[String(e.appearAnimation.id)]=e.appearAnimation),e.centerIcon instanceof qe.Document&&(an.documents[String(e.centerIcon.id)]=e.centerIcon)}),e.reactions.map(No)}async function Nm(){const e=await ol(new qe.messages.GetAvailableEffects({hash:cn.INT}));if(!e||e instanceof qe.messages.AvailableEffectsNotModified)return;const t=new Map(e.documents.map(e=>[String(e.id),e]));e.documents.forEach(e=>{e instanceof qe.Document&&(an.documents[String(e.id)]=e)});const s=e.effects.map(Go),n=[],a=[];for(const e of s)if(e.effectAnimationId){const s=t.get(e.effectStickerId),n=s&&Ei(s,!1,e.isPremium);n&&a.push(n)}else{const t=Ei(an.documents[e.effectStickerId]);t&&n.push(t)}return{effects:s,emojis:a,stickers:n}}function Gm(e){let{chat:t,messageId:s,reactions:n,shouldAddToRecent:a}=e;return ol(new qe.messages.SendReaction({reaction:n?.map(e=>Hn(e)),peer:un(t.id,t.accessHash),msgId:s,...a&&{addToRecent:!0}}),{shouldReturnTrue:!0,shouldThrow:!0})}function Fm(e){let{chat:t,messageId:s,count:n,isPrivate:a,peerId:i}=e;return ol(new qe.messages.SendPaidReaction({peer:un(t.id,t.accessHash),msgId:s,randomId:vn(),count:n,private:hn(a,i)}),{shouldReturnTrue:!0,shouldThrow:!0})}function qm(e){let{ids:t,chat:s}=e;Ls(t,Dl).forEach(e=>{ol(new qe.messages.GetMessagesReactions({id:e,peer:un(s.id,s.accessHash)}),{shouldReturnTrue:!0,abortControllerChatId:s.id})})}async function Hm(e){let{chat:t,messageId:s,reaction:n,offset:a}=e;const i=await ol(new qe.messages.GetMessageReactionsList({peer:un(t.id,t.accessHash),id:s,...n&&{reaction:Hn(n)},limit:Nl,...a&&{offset:a}}));if(!i)return;const{nextOffset:o,reactions:r,count:c}=i;return{nextOffset:o,reactions:r.map(Bo).filter(Boolean),count:c}}function Lm(e){let{reaction:t}=e;return ol(new qe.messages.SetDefaultReaction({reaction:Hn(t)}))}async function Om(e){let{hash:t}=e;const s=await ol(new qe.messages.GetTopReactions({limit:xl,hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.ReactionsNotModified))return{hash:String(s.hash),reactions:s.reactions.map(e=>xo(e)).filter(Boolean)}}async function jm(e){let{hash:t}=e;const s=await ol(new qe.messages.GetRecentReactions({limit:Vl,hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.ReactionsNotModified))return{hash:String(s.hash),reactions:s.reactions.map(e=>xo(e)).filter(Boolean)}}function Wm(){return ol(new qe.messages.ClearRecentReactions)}async function zm(e){let{hash:t}=e;const s=await ol(new qe.messages.GetDefaultTagReactions({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.ReactionsNotModified))return{hash:String(s.hash),reactions:s.reactions.map(e=>xo(e)).filter(Boolean)}}async function Km(e){let{hash:t}=e;const s=await ol(new qe.messages.GetSavedReactionTags({hash:t?Y()(t):cn.BIGINT}));if(s&&!(s instanceof qe.messages.SavedReactionTagsNotModified))return{hash:String(s.hash),tags:s.tags.map(Vo).filter(Boolean)}}function $m(e){let{reaction:t,title:s}=e;return ol(new qe.messages.UpdateSavedReactionTag({reaction:Hn(t),title:s}),{shouldReturnTrue:!0})}async function Jm(e){let{chat:t,dcId:s}=e;const n=await ol(new qe.stats.GetBroadcastStats({channel:gn(t.id,t.accessHash)}),{dcId:s});var a;if(n)return{stats:(a=n,{type:"channel",growthGraph:Ar(a.growthGraph),followersGraph:Ar(a.followersGraph),muteGraph:Ar(a.muteGraph),topHoursGraph:Ar(a.topHoursGraph),languagesGraph:Ar(a.languagesGraph),viewsBySourceGraph:Ar(a.viewsBySourceGraph),newFollowersBySourceGraph:Ar(a.newFollowersBySourceGraph),interactionsGraph:Ar(a.interactionsGraph),reactionsByEmotionGraph:Ar(a.reactionsByEmotionGraph),storyInteractionsGraph:Ar(a.storyInteractionsGraph),storyReactionsByEmotionGraph:Ar(a.storyReactionsByEmotionGraph),followers:Tr(a.followers),viewsPerPost:Tr(a.viewsPerPost),sharesPerPost:Tr(a.sharesPerPost),enabledNotifications:kr(a.enabledNotifications),reactionsPerPost:Tr(a.reactionsPerPost),viewsPerStory:Tr(a.viewsPerStory),sharesPerStory:Tr(a.sharesPerStory),reactionsPerStory:Tr(a.reactionsPerStory),recentPosts:a.recentPostsInteractions.map(vr).filter(Boolean)}),users:[]}}async function Qm(e){let{peer:t,dcId:s}=e;const n=await ol(new qe.payments.GetStarsRevenueStats({peer:un(t.id,t.accessHash)}),{dcId:s});var a;if(n)return{topHoursGraph:(a=n).topHoursGraph?Ar(a.topHoursGraph):void 0,revenueGraph:Ar(a.revenueGraph,void 0,!0,a.usdRate),balances:Ur(a.status),usdRate:a.usdRate}}async function Xm(e){let{chat:t,dcId:s}=e;const n=await ol(new qe.stats.GetMegagroupStats({channel:gn(t.id,t.accessHash)}),{dcId:s});var a,i;if(n)return{stats:(a=n,{type:"group",growthGraph:Ar(a.growthGraph),membersGraph:Ar(a.membersGraph),topHoursGraph:Ar(a.topHoursGraph),languagesGraph:Ar(a.languagesGraph),messagesGraph:Ar(a.messagesGraph),actionsGraph:Ar(a.actionsGraph),period:(i=a.period,{maxDate:i.maxDate,minDate:i.minDate}),members:Tr(a.members),viewers:Tr(a.viewers),messages:Tr(a.messages),posters:Tr(a.posters)})}}async function Zm(e){let{chat:t,messageId:s,dcId:n}=e;const a=await ol(new qe.stats.GetMessageStats({channel:gn(t.id,t.accessHash),msgId:s}),{dcId:n});if(a)return Pr(a)}async function Ym(e){let{chat:t,messageId:s,dcId:n,offset:a=cn.STRING,limit:i=cn.INT}=e;const o=await ol(new qe.stats.GetMessagePublicForwards({channel:gn(t.id,t.accessHash),msgId:s,offset:a,limit:i}),{dcId:n});if(o)return{forwards:Cr(o),count:o.count,nextOffset:o.nextOffset}}async function e_(e){let{token:t,x:s,isPercentage:n,dcId:a}=e;const i=await ol(new qe.stats.LoadAsyncGraph({token:t,...s&&{x:Y()(s)}}),{dcId:a});if(!i)return;const o=Ar(i,n);return"graph"===o.graphType?o:void 0}async function t_(e){let{chat:t,storyId:s,dcId:n}=e;const a=await ol(new qe.stats.GetStoryStats({peer:un(t.id,t.accessHash),id:s}),{dcId:n});if(a)return Pr(a)}async function s_(e){let{chat:t,storyId:s,dcId:n,offset:a=cn.STRING,limit:i=cn.INT}=e;const o=await ol(new qe.stats.GetStoryPublicForwards({peer:un(t.id,t.accessHash),id:s,offset:a,limit:i}),{dcId:n});if(o)return{publicForwards:Mr(o),count:o.count,nextOffset:o.nextOffset}}async function n_(e){let{peer:t,currentPassword:s}=e;try{const e=await kh(s);if(!e)return;if("error"in e)return e;const n=await ol(new qe.payments.GetStarsRevenueWithdrawalUrl({peer:un(t.id,t.accessHash),password:e}),{shouldThrow:!0});if(!n)return;return{url:n.url}}catch(e){if(!La(e))return;return Oa(e)}}var a_=s(48287).hp;let i_;class o_{seq=0;constructor(e){this.isOutgoing=e,this.waitForState=new Promise(e=>{this.resolveState=e})}async requestCall(e){let{p:t,g:s,random:n}=e;const a=ue(a_.from(t),!1),i=ue(a_.from(n),!1),o=be(Y()(s),i,a);this.gA=o,this.p=a,this.random=i;const r=await ye(we(o));return Array.from(r)}acceptCall(e){let{p:t,g:s,random:n}=e;const a=ue(t,!1),i=ue(n,!1),o=be(Y()(s),i,a);return this.gB=o,this.p=a,this.random=i,Array.from(we(o))}async confirmCall(e,t,s){if(!this.random||!this.p)throw new Error("Values not set");this.isOutgoing?this.gB=ue(a_.from(e),!1):this.gA=ue(a_.from(e),!1);const n=be(this.isOutgoing?this.gB:this.gA,this.random,this.p),a=ue((await _e(we(n))).slice(-8).reverse(),!1),i=await async function(e,t,s,n){const a=await ye(a_.concat([new Uint8Array(e),new Uint8Array(t)])),i=[],o=n.length-1;for(let e=0;e!==a.byteLength;e+=8){const t=r_(a.subarray(e,e+8)).modPow(1,o).toJSNumber(),r=n[t],c=n[t+1]-r;i.push(String.fromCharCode(...s.subarray(r,r+c)))}return i.join("")}(we(n),we(this.gA),t,s),o=new Zt;return await o.setKey(we(n)),this.state=new $t(o,new vt,!0,this.isOutgoing),this.resolveState(),{gA:Array.from(we(this.gA)),keyFingerprint:a.toString(),emojis:i}}async encode(e){if(!this.state)return;const t=new Uint32Array(1);t[0]=this.seq++;const s=await this.state.encryptMessageData(a_.concat([me(t),a_.from(e)]));return Array.from(s)}async decode(e){if(!this.state)return this.waitForState.then(()=>this.decode(e));const t=await this.state.decryptMessageData(a_.from(e));return JSON.parse(t.toString())}}function r_(e){return Y()(e[0]).and(127).shiftLeft(56).or(Y()(e[1]).shiftLeft(48)).or(Y()(e[2]).shiftLeft(40)).or(Y()(e[3]).shiftLeft(32)).or(Y()(e[4]).shiftLeft(24)).or(Y()(e[5]).shiftLeft(16)).or(Y()(e[6]).shiftLeft(8)).or(Y()(e[7]))}function c_(e){i_=new o_(...e)}function d_(){i_=void 0}function l_(e){return i_.encode(...e)}async function u_(e){if(i_)return await i_.decode(...e)}function f_(e){return i_.confirmCall(...e)}function g_(e){return i_.acceptCall(...e)}function p_(e){return i_.requestCall(...e)}async function h_(e){let{stateHash:t,isFirstRequest:s=!1,isHidden:n=!1}=e;const a=s?n?{hidden:!0}:{}:{state:t,next:!0,...n&&{hidden:!0}},i=await ol(new qe.stories.GetAllStories(a));if(!i)return;if(i instanceof qe.stories.AllStoriesNotModified)return{state:i.state,stealthMode:wc(i.stealthMode)};const o=i.peerStories.reduce((e,t)=>{const s=Ta(t.peer),n=function(e){const t=Ta(e.peer);return Vs(e.stories,e=>[e.id,_c(t,e)])}(t),{profileIds:a,orderedIds:i,lastUpdatedAt:o}=Object.values(n).reduce((e,t)=>("isInProfile"in t&&t.isInProfile&&e.profileIds.push(t.id),"isDeleted"in t||(e.orderedIds.push(t.id),e.lastUpdatedAt=Math.max(t.date,e.lastUpdatedAt||0)),e),{profileIds:[],orderedIds:[],lastUpdatedAt:void 0});return 0===i.length||(e[s]={byId:n,orderedIds:i,profileIds:a,lastUpdatedAt:o,lastReadId:t.maxReadId}),e},{});return i.peerStories.forEach(e=>e.stories.forEach(t=>di(t,Ta(e.peer)))),{peerStories:o,hasMore:i.hasMore,state:i.state,stealthMode:wc(i.stealthMode)}}async function m_(e){let{peer:t}=e;const s=await ol(new qe.stories.GetPeerStories({peer:un(t.id,t.accessHash)}));if(!s)return;const n=Vs(s.stories.stories,e=>[e.id,_c(t.id,e)]);return s.stories.stories.forEach(e=>di(e,t.id)),{stories:n,lastReadStoryId:s.stories.maxReadId}}function __(e){let{peer:t,offsetId:s=cn.INT}=e;return U_({method:new qe.stories.GetPinnedStories({peer:un(t.id,t.accessHash),offsetId:s,limit:kl}),peerId:t.id})}function y_(e){let{peer:t,offsetId:s=cn.INT}=e;return U_({method:new qe.stories.GetStoriesArchive({peer:t&&un(t.id,t.accessHash),offsetId:s,limit:kl}),peerId:t.id})}async function b_(e){let{peer:t,ids:s}=e;const n=await ol(new qe.stories.GetStoriesByID({peer:un(t.id,t.accessHash),id:s}));if(!n)return;const a=s.reduce((e,s)=>{const a=n.stories.find(e=>{let{id:t}=e;return t===s});return e[s]=a?_c(t.id,a):{id:s,peerId:t.id,isDeleted:!0},e},{});return n.stories.forEach(e=>di(e,t.id)),{pinnedIds:n.pinnedToTop,stories:a}}function w_(e){let{peer:t,storyId:s}=e;return ol(new qe.stories.IncrementStoryViews({peer:un(t.id,t.accessHash),id:[s]}))}function S_(e){let{peer:t,storyId:s}=e;return ol(new qe.stories.ReadStories({peer:un(t.id,t.accessHash),maxId:s}))}function I_(e){let{peer:t,storyId:s}=e;return ol(new qe.stories.DeleteStories({peer:un(t.id,t.accessHash),id:[s]}))}function v_(e){let{peer:t,storyId:s,isInProfile:n}=e;return ol(new qe.stories.TogglePinned({peer:un(t.id,t.accessHash),id:[s],pinned:Boolean(n)}))}function P_(e){let{peer:t,storyIds:s}=e;return ol(new qe.stories.TogglePinnedToTop({peer:un(t.id,t.accessHash),id:s}))}async function C_(e){let{peer:t,storyId:s,areJustContacts:n,query:a,areReactionsFirst:i,limit:o=kl,offset:r=cn.STRING}=e;const c=await ol(new qe.stories.GetStoryViewsList({peer:un(t.id,t.accessHash),id:s,justContacts:n,q:a,reactionsFirst:i,limit:o,offset:r}));if(c)return{views:c.views.map(bc).filter(Boolean),nextOffset:c.nextOffset,reactionsCount:c.reactionsCount,viewsCount:c.count}}async function M_(e){let{peer:t,storyIds:s}=e;const n=await ol(new qe.stories.GetStoriesViews({peer:un(t.id,t.accessHash),id:s}));if(n?.views[0])return{views:yc(n.views[0])}}async function A_(e){let{peer:t,storyId:s}=e;const n=await ol(new qe.stories.ExportStoryLink({peer:un(t.id,t.accessHash),id:s}));if(n)return n.link}async function R_(e){let{peer:t,storyId:s,description:n,option:a}=e;try{const e=await ol(new qe.stories.Report({peer:un(t.id,t.accessHash),id:[s],option:qa(a),message:n}),{shouldThrow:!0});if(!e)return;return{result:pc(e),error:void 0}}catch(e){const t=e.message;if(t===x)return{result:void 0,error:t};throw e}}function T_(e){let{peer:t,id:s,privacy:n}=e;return ol(new qe.stories.EditStory({peer:un(t.id,t.accessHash),id:s,privacyRules:$n(n)}),{shouldReturnTrue:!0})}function k_(e){let{peer:t,isHidden:s}=e;return ol(new qe.stories.TogglePeerStoriesHidden({peer:un(t.id,t.accessHash),hidden:s}))}function D_(e){let{peers:t}=e;return ol(new qe.stories.GetPeerMaxIDs({id:t.map(e=>un(e.id,e.accessHash))}),{shouldIgnoreErrors:!0})}async function U_(e){let{method:t,peerId:s}=e;const n=await ol(t);if(!n)return;const a=Vs(n.stories,e=>[e.id,_c(s,e)]);return n.stories.forEach(e=>di(e,s)),{count:n.count,stories:a,pinnedIds:n.pinnedToTop}}function E_(e){let{peer:t,storyId:s,reaction:n,shouldAddToRecent:a}=e;return ol(new qe.stories.SendReaction({reaction:n?Hn(n):new qe.ReactionEmpty,peer:un(t.id,t.accessHash),storyId:s,...a&&{addToRecent:!0}}),{shouldReturnTrue:!0})}function B_(e){let{isForPast:t,isForFuture:s}=e;return ol(new qe.stories.ActivateStealthMode({past:t,future:s}),{shouldReturnTrue:!0})}async function x_(e){let{peer:t}=e;const s=await ol(new qe.stories.GetAlbums({peer:un(t.id,t.accessHash),hash:cn.BIGINT}));if(s&&!(s instanceof qe.stories.AlbumsNotModified))return s.albums.map(vc)}async function V_(e){let{peer:t,albumId:s,offset:n=0,limit:a=kl}=e;const i=await ol(new qe.stories.GetAlbumStories({peer:un(t.id,t.accessHash),albumId:s,offset:n,limit:a}));if(!i)return;const o=Vs(i.stories,e=>[e.id,_c(t.id,e)]);return i.stories.forEach(e=>{e&&e instanceof qe.StoryItem&&di(e,t.id)}),{stories:o,pinnedIds:i.pinnedToTop,count:i.count}}async function N_(e){let{inputInvoice:t,requestInfo:s,shouldSave:n}=e;const a=await ol(new qe.payments.ValidateRequestedInfo({invoice:qn(t),save:n||void 0,info:Dn(s)}));if(!a)return;const{id:i,shippingOptions:o}=a;return i?{id:i,shippingOptions:Er(o)}:void 0}async function G_(e){let{inputInvoice:t,formId:s,requestedInfoId:n,shippingOptionId:a,credentials:i,savedCredentialId:o,temporaryPassword:r,tipAmount:c}=e;const d=r&&o?new qe.InputPaymentCredentialsSaved({id:o,tmpPassword:qa(r)}):new qe.InputPaymentCredentials({save:i.save,data:new qe.DataJSON({data:JSON.stringify(i.data)})}),l=await ol(new qe.payments.SendPaymentForm({formId:Y()(s),invoice:qn(t),requestedInfoId:n,shippingOptionId:a,credentials:d,...c&&{tipAmount:Y()(c)}}));return!!l&&(l instanceof qe.payments.PaymentVerificationNeeded?void za({"@type":"updatePaymentVerificationNeeded",url:l.url}):(il(l.updates),Boolean(l)))}async function F_(e){let{formId:t,inputInvoice:s}=e;const n=await ol(new qe.payments.SendStarsForm({formId:Y()(t),invoice:qn(s)}));if(n){if(!(n instanceof qe.payments.PaymentVerificationNeeded)){if(il(n.updates),"chatInviteSubscription"===s.type){const e="updates"in n.updates?n.updates.updates:void 0,t=e?.find(e=>e instanceof qe.UpdateChannel)?.channelId;if(!t)return;return{channelId:Ra(t,"channel")}}return{completed:!0}}o&&console.warn("Unexpected PaymentVerificationNeeded in sendStarsForm")}}async function q_(e,t){try{const s=await ol(new qe.payments.GetPaymentForm({invoice:qn(e),themeParams:t?Bn(t):void 0}),{shouldThrow:!0});if(!s)return;return function(e){if(e instanceof qe.payments.PaymentFormStarGift){const{formId:t}=e;return{type:"stargift",formId:String(t),invoice:xr(e.invoice)}}if(e instanceof qe.payments.PaymentFormStars){const{botId:t,formId:s,title:n,description:a,photo:i}=e;return i&&hi(i),{type:"stars",botId:Ra(t,"user"),formId:String(s),title:n,description:a,photo:Ro(i),invoice:xr(e.invoice)}}const{formId:t,canSaveCredentials:s,passwordMissing:n,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:c,savedCredentials:d,url:l,botId:u,description:f,title:g,photo:p}=e;p&&hi(p);const{shippingAddress:h}=r||{},m=r?Qs(r):void 0;m&&h&&(m.shippingAddress=Qs(h));const _=o?JSON.parse(o.data):{};return{type:"regular",title:g,description:f,photo:Ro(p),url:l,botId:Ra(u,"user"),canSaveCredentials:s,isPasswordMissing:n,formId:String(t),providerId:String(a),nativeProvider:i,savedInfo:m,invoice:xr(c),nativeParams:{needCardholderName:Boolean(_?.need_cardholder_name),needCountry:Boolean(_?.need_country),needZip:Boolean(_?.need_zip),publishableKey:_?.publishable_key,publicToken:_?.public_token,tokenizeUrl:_?.tokenize_url},savedCredentials:d&&(y=d,y.map(e=>{let{id:t,title:s}=e;return{id:t,title:s}}))};var y}(s)}catch(e){if(e instanceof He)return{error:e.errorMessage};throw e}}async function H_(e,t){const s=await ol(new qe.payments.GetPaymentReceipt({peer:un(e.id,e.accessHash),msgId:t}));if(s)return{receipt:Br(s)}}async function L_(){const e=await ol(new qe.help.GetPremiumPromo);if(e)return e.videos.forEach(e=>{e instanceof qe.Document&&(an.documents[e.id.toString()]=e)}),{promo:Vr(e)}}async function O_(e){const t=await Th(e);if(t)return"error"in t?t:{value:Fa(t.tmpPassword),validUntil:t.validUntil}}async function j_(){const e=await ol(new qe.premium.GetMyBoosts);if(e)return{boosts:e.myBoosts.map(Fr)}}async function W_(e){let{chat:t,slots:s}=e;const n=await ol(new qe.premium.ApplyBoost({peer:un(t.id,t.accessHash),slots:s}));if(n)return{boosts:n.myBoosts.map(Fr)}}async function z_(e){let{chat:t}=e;const s=await ol(new qe.premium.GetBoostsStatus({peer:un(t.id,t.accessHash)}));if(s)return function(e){const{level:t,boostUrl:s,boosts:n,giftBoosts:a,myBoost:i,currentLevelBoosts:o,nextLevelBoosts:r,premiumAudience:c,prepaidGiveaways:d}=e;return{level:t,currentLevelBoosts:o,boosts:n,hasMyBoost:Boolean(i),boostUrl:s,giftBoosts:a,nextLevelBoosts:r,...c&&{premiumSubscribers:kr(c)},...d&&{prepaidGiveaways:d.map(e=>{return(t=e)instanceof qe.PrepaidGiveaway?{type:"giveaway",id:t.id.toString(),date:t.date,months:t.months,quantity:t.quantity}:{type:"starsGiveaway",id:t.id.toString(),stars:t.stars.toJSNumber(),quantity:t.quantity,boosts:t.boosts,date:t.date};var t})}}}(s)}async function K_(e){let{chat:t,isGifts:s,offset:n=cn.STRING,limit:a=cn.INT}=e;const i=await ol(new qe.premium.GetBoostsList({peer:un(t.id,t.accessHash),gifts:s||void 0,offset:n,limit:a}));if(!i)return;const o=i.boosts.map(Gr);return{count:i.count,boostList:o,nextOffset:i.nextOffset}}async function $_(e){let{peer:t,messageId:s}=e;const n=await ol(new qe.payments.GetGiveawayInfo({peer:un(t.id,t.accessHash),msgId:s}));if(n)return function(e){if(e instanceof qe.payments.GiveawayInfo){const{startDate:t,adminDisallowedChatId:s,disallowedCountry:n,joinedTooEarlyDate:a,participating:i,preparingResults:o}=e;return{type:"active",startDate:t,isParticipating:i,adminDisallowedChatId:s&&Ra(s,"channel"),disallowedCountry:n,joinedTooEarlyDate:a,isPreparingResults:o}}{const{activatedCount:t,finishDate:s,giftCodeSlug:n,winner:a,refunded:i,startDate:o,winnersCount:r,starsPrize:c}=e;return{type:"results",startDate:o,activatedCount:t,finishDate:s,winnersCount:r,giftCodeSlug:n,isRefunded:i,isWinner:a,starsPrize:c?.toJSNumber()}}}(n)}async function J_(e){let{slug:t}=e;const s=await ol(new qe.payments.CheckGiftCode({slug:t}));if(s)return{code:qr(s)}}function Q_(e){let{slug:t}=e;return ol(new qe.payments.ApplyGiftCode({slug:t}),{shouldReturnTrue:!0})}async function X_(e){let{chat:t}=e;const s=await ol(new qe.payments.GetPremiumGiftCodeOptions({boostPeer:t&&un(t.id,t.accessHash)}));if(s)return s.map(Hr)}function Z_(e){let{chat:t,giveawayId:s,paymentPurpose:n}=e;return ol(new qe.payments.LaunchPrepaidGiveaway({peer:un(t.id,t.accessHash),giveawayId:Y()(s),purpose:Gn(n)}),{shouldReturnTrue:!0})}async function Y_(e){const t="username"in e?new qe.InputCollectibleUsername({username:e.username}):new qe.InputCollectiblePhone({phone:e.phone}),s=await ol(new qe.fragment.GetCollectibleInfo({collectible:t}));if(s)return function(e){const{amount:t,currency:s,cryptoAmount:n,cryptoCurrency:a,purchaseDate:i,url:o}=e;return{amount:t.toJSNumber(),currency:s,cryptoAmount:n.toJSNumber(),cryptoCurrency:a,purchaseDate:i,url:o}}(s)}async function ey(){const e=await ol(new qe.payments.GetStarsGiveawayOptions);if(e)return e.map(jr)}async function ty(){const e=await ol(new qe.payments.GetStarGifts({hash:cn.INT}));if(!e||e instanceof qe.payments.StarGiftsNotModified)return;const t=e.chats?.map(e=>nr(e)).filter(Boolean),s=e.users?.map(to).filter(Boolean);return{gifts:e.gifts.map(oo).filter(e=>"starGift"===e.type),chats:t,users:s}}async function sy(e){let{giftId:t,offset:s=cn.STRING,limit:n=cn.INT,attributesHash:a,filter:i}=e;const o=[...i?.backdropAttributes??[],...i?.modelAttributes??[],...i?.patternAttributes??[]],r={giftId:Y()(t),offset:s,limit:n,attributesHash:a?Y()(a):cn.BIGINT,attributes:lo(o),...i&&{sortByPrice:"byPrice"===i.sortType||void 0,sortByNum:"byNumber"===i.sortType||void 0}},c=await ol(new qe.payments.GetResaleStarGifts(r));if(c)return function(e){const{count:t,nextOffset:s,attributesHash:n}=e,a=e.gifts.map(e=>oo(e)),i=e.attributes?.map(e=>ro(e)).filter(Boolean),o=e.users.map(e=>to(e)).filter(Boolean),r=e.chats.map(e=>nr(e)).filter(Boolean),c=e.counters?.map(e=>function(e){const{count:t}=e,s=function(e){return e instanceof qe.StarGiftAttributeIdModel?{type:"model",documentId:e.documentId.toString()}:e instanceof qe.StarGiftAttributeIdPattern?{type:"pattern",documentId:e.documentId.toString()}:e instanceof qe.StarGiftAttributeIdBackdrop?{type:"backdrop",backdropId:e.backdropId}:void 0}(e.attribute);if(s)return{count:t,attribute:s}}(e)).filter(Boolean);return{count:t,gifts:a,nextOffset:s,attributes:i,attributesHash:n?.toString(),chats:r,counters:c,users:o}}(c)}async function ny(e){let{peer:t,offset:s=cn.STRING,limit:n=cn.INT,filter:a,collectionId:i}=e;const o={peer:un(t.id,t.accessHash),offset:s,limit:n,collectionId:i,...a&&{sortByValue:"byValue"===a.sortType||void 0,excludeUnlimited:!a.shouldIncludeUnlimited||void 0,excludeUpgradable:!a.shouldIncludeUpgradable||void 0,excludeUnupgradable:!a.shouldIncludeLimited||void 0,excludeUnique:!a.shouldIncludeUnique||void 0,excludeSaved:!a.shouldIncludeDisplayed||void 0,excludeUnsaved:!a.shouldIncludeHidden||void 0}},r=await ol(new qe.payments.GetSavedStarGifts(o));if(r)return{gifts:r.gifts.map(e=>function(e,t){const{gift:s,date:n,convertStars:a,fromId:i,message:o,msgId:r,nameHidden:c,unsaved:d,upgradeStars:l,transferStars:u,canUpgrade:f,savedId:g,canExportAt:p,pinnedToTop:h,canResellAt:m,canTransferAt:_}=e,y=g&&t?{type:"chat",chatId:t,savedId:g.toString()}:r?{type:"user",messageId:r}:void 0;return{gift:oo(s),date:n,starsToConvert:a?.toJSNumber(),fromId:i&&Ta(i),message:o&&Ri(o),messageId:r,isNameHidden:c,isUnsaved:d,canUpgrade:f,alreadyPaidUpgradeStars:l?.toJSNumber(),transferStars:u?.toJSNumber(),inputGift:y,savedId:g?.toString(),canExportAt:p,canResellAt:m,canTransferAt:_,isPinned:h}}(e,t.id)),nextOffset:r.nextOffset}}function ay(e){let{inputGift:t,shouldUnsave:s}=e;return ol(new qe.payments.SaveStarGift({stargift:Jn(t),unsave:s||void 0}))}function iy(e){let{inputSavedGift:t}=e;return ol(new qe.payments.ConvertStarGift({stargift:Jn(t)}))}async function oy(e){let{chat:t}=e;const s=await ol(new qe.payments.GetStarsGiftOptions({userId:t&&fn(t.id,t.accessHash)}));if(s)return s.map(Lr)}async function ry(){let{isTon:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=await ol(new qe.payments.GetStarsStatus({peer:new qe.InputPeerSelf,ton:e||void 0}));if(!t)return;const s=Or(t.balance);return s?{nextHistoryOffset:t.nextOffset,history:t.history?.map(zr).filter(Boolean),nextSubscriptionOffset:t.subscriptionsNextOffset,subscriptions:t.subscriptions?.map(Kr),balance:s}:void 0}async function cy(e){let{peer:t,offset:s=cn.STRING,limit:n=cn.INT,isInbound:a,isOutbound:i,isTon:o}=e;const r=t?un(t.id,t.accessHash):new qe.InputPeerSelf,c=await ol(new qe.payments.GetStarsTransactions({peer:r,offset:s,limit:n,inbound:a||void 0,outbound:i||void 0,ton:o||void 0}));if(!c)return;const d=Or(c.balance);return d?{nextOffset:c.nextOffset,history:c.history?.map(zr).filter(Boolean),balance:d}:void 0}async function dy(e){let{id:t,peer:s,ton:n}=e;const a=s?un(s.id,s.accessHash):new qe.InputPeerSelf,i=await ol(new qe.payments.GetStarsTransactionsByID({peer:a,ton:n,id:[new qe.InputStarsTransaction({id:t})]}));if(i?.history?.[0])return{transaction:zr(i?.history[0])}}async function ly(e){let{offset:t=cn.STRING,peer:s}=e;const n=s?un(s.id,s.accessHash):new qe.InputPeerSelf,a=await ol(new qe.payments.GetStarsSubscriptions({peer:n,offset:t}));if(!a?.subscriptions)return;const i=Or(a.balance);return i?{nextOffset:a.subscriptionsNextOffset,subscriptions:a.subscriptions.map(Kr),balance:i}:void 0}async function uy(e){let{peer:t,subscriptionId:s,isCancelled:n}=e;return await ol(new qe.payments.ChangeStarsSubscription({peer:t?un(t.id,t.accessHash):new qe.InputPeerSelf,subscriptionId:s,canceled:n}))}async function fy(e){let{peer:t,subscriptionId:s}=e;return await ol(new qe.payments.FulfillStarsSubscription({peer:t?un(t.id,t.accessHash):new qe.InputPeerSelf,subscriptionId:s}))}async function gy(){const e=await ol(new qe.payments.GetStarsTopupOptions);if(e)return e.map($r)}async function py(e){let{slug:t}=e;const s=await ol(new qe.payments.GetUniqueStarGift({slug:t}));if(!s)return;const n=oo(s.gift);return"starGiftUnique"===n.type?n:void 0}async function hy(e){let{giftId:t}=e;const s=await ol(new qe.payments.GetStarGiftUpgradePreview({giftId:Y()(t)}));if(s)return s.sampleAttributes.map(ro).filter(Boolean)}function my(e){let{inputSavedGift:t,shouldKeepOriginalDetails:s}=e;return ol(new qe.payments.UpgradeStarGift({stargift:Jn(t),keepOriginalDetails:s}),{shouldReturnTrue:!0})}function _y(e){let{inputSavedGift:t,toPeer:s}=e;return ol(new qe.payments.TransferStarGift({stargift:Jn(t),toId:un(s.id,s.accessHash)}),{shouldReturnTrue:!0})}function yy(e){let{inputSavedGifts:t,peer:s}=e;return ol(new qe.payments.ToggleStarGiftsPinnedToTop({stargift:t.map(Jn),peer:un(s.id,s.accessHash)}),{shouldReturnTrue:!0})}function by(e){let{inputSavedGift:t,price:s}=e;return ol(new qe.payments.UpdateStarGiftPrice({stargift:Jn(t),resellAmount:zn(s)}),{shouldReturnTrue:!0})}async function wy(e){let{slug:t}=e;const s=await ol(new qe.payments.GetUniqueStarGiftValueInfo({slug:t}));if(s)return function(e){const{lastSaleOnFragment:t,currency:s,value:n,initialSaleDate:a,initialSaleStars:i,initialSalePrice:o,lastSaleDate:r,lastSalePrice:c,floorPrice:d,averagePrice:l,listedCount:u,fragmentListedCount:f,fragmentListedUrl:g,valueIsAverage:p}=e;return{isLastSaleOnFragment:t,isValueAverage:p,currency:s,value:n.toJSNumber(),initialSaleDate:a,initialSaleStars:i.toJSNumber(),initialSalePrice:o.toJSNumber(),lastSaleDate:r,lastSalePrice:c?.toJSNumber(),floorPrice:d?.toJSNumber(),averagePrice:l?.toJSNumber(),listedCount:u,fragmentListedCount:f,fragmentListedUrl:g}}(s)}async function Sy(e){let{inputGift:t,password:s}=e;try{const e=await kh(s);if(!e)return;if("error"in e)return e;const n=await ol(new qe.payments.GetStarGiftWithdrawalUrl({stargift:Jn(t),password:e}),{shouldThrow:!0});if(!n)return;return{url:n.url}}catch(e){if(!La(e))return;return Oa(e)}}async function Iy(e){let{peer:t,hash:s}=e;const n=await ol(new qe.payments.GetStarGiftCollections({peer:un(t.id,t.accessHash),hash:s?Y()(s):cn.BIGINT}));if(n&&!(n instanceof qe.payments.StarGiftCollectionsNotModified))return{collections:n.collections.map(uo).filter(Boolean)}}function vy(e,t,s){var n;!function(e){Wa=e}(e),s&&(n=s,Object.assign(nn,sn(n)));const a=new ns;return async function(e,t){o&&console.log(">>> START INIT API");const{userAgent:s,platform:n,sessionData:a,isWebmSupported:i,maxBufferSize:r,webAuthToken:c,dcId:d,mockScenario:l,shouldForceHttpTransport:u,shouldAllowHttpTransport:f,shouldDebugExportedSenders:g,langCode:p,isTestServerRequested:h,accountIds:m}=e,_=new ms(a,al);self.isWebmSupported=i,self.maxBufferSize=r,Zd=new wa(_,Number("2496"),"8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||s||"Unknown UserAgent",systemVersion:n||"Unknown platform",appVersion:"10.9.73 A",useWSS:!0,additionalDcsDisabled:!1,shouldDebugExportedSenders:g,shouldForceHttpTransport:u,shouldAllowHttpTransport:f,dcId:d,langPack:G,langCode:p,systemLangCode:navigator.language,isTestServerRequested:h}),Zd.addEventHandler(il,Jd);try{o&&(Ha("CONNECTING"),self.invoke=ol,self.GramJs=qe);try{Zd.setPingCallback(dd),await Zd.start({phoneNumber:wd,phoneCode:Sd,password:Id,firstAndLastNames:vd,qrCode:Pd,onError:Cd,initialMethod:"iOS"===n||"Android"===n?"phoneNumber":"qrCode",shouldThrowIfUnauthorized:Object.values(a?.keys||{}).length>0,webAuthToken:c,webAuthTokenFailed:bd,mockScenario:l,accountIds:m},t)}catch(e){if(console.error(e),"Disconnect"!==e.message&&"Cannot send requests while disconnected"!==e.message)return void za({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}o&&(console.log(">>> FINISH INIT API"),Ha("CONNECTED")),za(Md("authorizationStateReady")),al(_.getSessionData()),za({"@type":"updateApiReady"}),async function(e){$c=e,await pd(),Qc=!0,rd()}(ol),gl()}catch(e){throw o&&Ha("CONNECTING ERROR",e),e}}(t,()=>a.resolve()),a.promise}const Py=z.reduce((e,t)=>(e[t]=console[t],e),{});self.onerror=e=>{console.error(e),ky({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",e=>{console.error(e),ky({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})});let Cy=[],My=[],Ay=[];const Ry=new Map;o&&console.log(">>> FINISH LOAD WORKER"),onmessage=e=>{let{data:t}=e;t.payloads.forEach(async e=>{switch(e.type){case"initApi":{const{messageId:t,args:s}=e;vy(Dy,s[0],s[1]).then(()=>{t&&ky({type:"methodResponse",messageId:t,response:!0})});break}case"callMethod":{const{messageId:t,name:s,args:n,withCallback:i}=e;try{if(t&&i){const e=function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];const a=s[s.length-1];ky({type:"methodCallback",messageId:t,callbackArgs:s},a instanceof ArrayBuffer?a:void 0)};Ry.set(t,e),n.push(e)}const e=await function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return a[e](...s)}(s,...n);o&&"object"==typeof e&&"CONSTRUCTOR_ID"in e&&Ha("UNEXPECTED RESPONSE",`${s}: ${e.className}`);const{arrayBuffer:r}="object"==typeof e&&"arrayBuffer"in e&&e||{};t&&ky({type:"methodResponse",messageId:t,response:e},r)}catch(e){o&&console.error(e),t&&ky({type:"methodResponse",messageId:t,error:{message:e.message}})}t&&Ry.delete(t);break}case"cancelProgress":{const t=Ry.get(e.messageId);t&&(t.isCanceled=!0);break}case"ping":ky({type:"methodResponse",messageId:e.messageId});break;case"toggleDebugMode":e.isEnabled?z.forEach(e=>{console[e]=function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];postMessage({type:"debugLog",level:e,args:JSON.parse(JSON.stringify(s,(e,t)=>"bigint"==typeof t?t.toString():t))})}}):z.forEach(e=>{console[e]=Py[e]})}})};const Ty=$(()=>{Ay.length&&Cy.unshift({type:"updates",updates:Ay});const e={payloads:Cy},t=My;Ay=[],Cy=[],My=[],t.length?postMessage(e,t):postMessage(e)});function ky(e,t){Cy.push(e),t&&My.push(t),Ty()}function Dy(e){o&&"updateUserStatus"!==e["@type"]&&"updateServerTimeOffset"!==e["@type"]&&Ha("UPDATE",e["@type"],e),Ay.push(e),Ty()}}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return s[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=s,a.x=()=>{var e=a.O(void 0,[8287,7784,6231],()=>a(98123));return a.O(e)},e=[],a.O=(t,s,n,i)=>{if(!s){var o=1/0;for(l=0;l<e.length;l++){for(var[s,n,i]=e[l],r=!0,c=0;c<s.length;c++)(!1&i||o>=i)&&Object.keys(a.O).every(e=>a.O[e](s[c]))?s.splice(c--,1):(r=!1,i<o&&(o=i));if(r){e.splice(l--,1);var d=n();void 0!==d&&(t=d)}}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]=[s,n,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,s)=>(a.f[s](e,t),t),[])),a.u=e=>e+"."+{6231:"a5c25a26dfcd2ef0ad20",7784:"10772103a35e3b9d37c2",8287:"ca57178ed54d9e61396c"}[e]+".js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=s[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={8123:1};a.f.i=(t,s)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],s=t.push.bind(t);t.push=t=>{var[n,i,o]=t;for(var r in i)a.o(i,r)&&(a.m[r]=i[r]);for(o&&o(a);n.length;)e[n.pop()]=1;s(t)}})(),t=a.x,a.x=()=>Promise.all([8287,7784,6231].map(a.e,a)).then(t),a.x()})();
//# sourceMappingURL=8123.8fd17c8cfc4f43f47212.js.map