2 lines
590 KiB
JavaScript
2 lines
590 KiB
JavaScript
(()=>{var e,t,s={86453:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});class n{constructor(e){this.isUpload=e}}},93229:(e,t,s)=>{"use strict";var n={};s.r(n),s.d(n,{Type:()=>Co,clear:()=>To,fetch:()=>Mo,isCacheApiSupported:()=>Po,remove:()=>ko,save:()=>Ro});var a={};s.r(a),s.d(a,{abortChatRequests:()=>sr,abortRequestGroup:()=>nr,acceptBotUrlAuth:()=>cf,acceptCall:()=>Vf,acceptLinkUrlAuth:()=>uf,acceptPhoneCall:()=>Ap,activateStealthMode:()=>Wp,addChatMembers:()=>ic,allowBotSendMessages:()=>ff,answerCallbackButton:()=>Ll,applyBoost:()=>eg,applyGiftCode:()=>ig,blockUser:()=>Qu,broadcastLocalDbUpdateFull:()=>Ue,changeSessionSettings:()=>fr,changeSessionTtl:()=>pr,changeStarsSubscription:()=>_g,checkBotDownloadFileParams:()=>hf,checkChatInvite:()=>ac,checkChatUsername:()=>Iu,checkChatlistInvite:()=>Sc,checkGiftCode:()=>ag,checkPassword:()=>Vl,checkUsername:()=>Hu,clearPassword:()=>Nl,clearRecentReactions:()=>Qf,clearRecentStickers:()=>nu,clickSponsoredMessage:()=>vd,closePoll:()=>dd,confirmCall:()=>Nf,confirmPhoneCall:()=>Ip,convertStarGift:()=>fg,createChalistInvite:()=>Pc,createChannel:()=>Cr,createGroupCall:()=>Mf,createGroupChat:()=>Br,createPhoneCallState:()=>bp,createTopic:()=>hc,deactivateAllUsernames:()=>Pu,decodePhoneCallData:()=>vp,deleteChannel:()=>Er,deleteChat:()=>kr,deleteChatFolder:()=>qr,deleteChatMember:()=>oc,deleteChatUser:()=>Rr,deleteChatlistInvite:()=>Cc,deleteContact:()=>jd,deleteExportedChatInvite:()=>Tu,deleteHistory:()=>Kc,deleteMessages:()=>Wc,deleteProfilePhotos:()=>zu,deleteRevokedExportedChatInvites:()=>Eu,deleteSavedHistory:()=>$c,deleteScheduledMessages:()=>zc,deleteStory:()=>Dp,deleteTopic:()=>_c,destroy:()=>Ko,destroyPhoneCallState:()=>wp,discardCall:()=>Bf,discardGroupCall:()=>wf,disconnect:()=>$o,downloadMedia:()=>Zo,editChatFolder:()=>Gr,editChatPhoto:()=>Dr,editChatlistInvite:()=>Mc,editExportedChatInvite:()=>Ru,editGroupCallParticipant:()=>Sf,editGroupCallTitle:()=>vf,editMessage:()=>qc,editStoryPrivacy:()=>qp,editTopic:()=>wc,encodePhoneCallData:()=>Sp,exportChatInvite:()=>ku,exportGroupCallInvite:()=>If,exportMessageLink:()=>xd,faveSticker:()=>tu,fetchAllStories:()=>Cp,fetchAnimatedEmojiEffects:()=>ru,fetchAnimatedEmojis:()=>ou,fetchAppConfig:()=>Sl,fetchAuthorizations:()=>Yu,fetchAvailableEffects:()=>Of,fetchAvailableReactions:()=>Hf,fetchBlockedUsers:()=>Ju,fetchBoostList:()=>sg,fetchBoostStatus:()=>tg,fetchBotApp:()=>Zl,fetchBotCanSendMessage:()=>lf,fetchChannelMonetizationStatistics:()=>tp,fetchChannelRecommendations:()=>Ec,fetchChannelStatistics:()=>ep,fetchChat:()=>Sr,fetchChatFolders:()=>Nr,fetchChatInviteImporters:()=>Bu,fetchChatSettings:()=>br,fetchChatlistInvites:()=>Rc,fetchChats:()=>mr,fetchCollectionInfo:()=>Sg,fetchCommonChats:()=>Nd,fetchConfig:()=>vl,fetchContactList:()=>qd,fetchContentSettings:()=>bl,fetchCountryList:()=>Pl,fetchCurrentUser:()=>ar,fetchCustomEmoji:()=>iu,fetchCustomEmojiSets:()=>Jd,fetchDefaultStatusEmojis:()=>lu,fetchDefaultTagReactions:()=>Xf,fetchDefaultTopicIcons:()=>uu,fetchDiscussionMessage:()=>nd,fetchEmojiKeywords:()=>wu,fetchExportedChatInvites:()=>Mu,fetchExtendedMedia:()=>ld,fetchFactChecks:()=>td,fetchFavoriteStickers:()=>Yd,fetchFeaturedEmojiStickers:()=>eu,fetchFeaturedStickers:()=>Zd,fetchFullChat:()=>_r,fetchFullUser:()=>Vd,fetchGenericEmojiEffects:()=>cu,fetchGiveawayInfo:()=>ng,fetchGlobalPrivacySettings:()=>Cl,fetchGroupCallParticipants:()=>Af,fetchGroupStatistics:()=>sp,fetchGroupsForDiscussion:()=>tc,fetchInlineBot:()=>zl,fetchInlineBotResults:()=>Kl,fetchLangDifference:()=>dl,fetchLangPack:()=>cl,fetchLanguage:()=>ll,fetchLanguages:()=>ul,fetchLeaveChatlistSuggestions:()=>Ic,fetchMember:()=>ec,fetchMembers:()=>Zr,fetchMessage:()=>Vc,fetchMessagePublicForwards:()=>ap,fetchMessageReactions:()=>Wf,fetchMessageReactionsList:()=>zf,fetchMessageStatistics:()=>np,fetchMessageViews:()=>ed,fetchMessages:()=>xc,fetchMyBoosts:()=>Zp,fetchNearestCountry:()=>Fd,fetchNotificationExceptions:()=>al,fetchNotificationSettings:()=>il,fetchOutboxReadDate:()=>Bd,fetchPaidReactionPrivacy:()=>sd,fetchPeerColors:()=>Il,fetchPeerProfileStories:()=>Rp,fetchPeerStories:()=>Mp,fetchPeerStoriesByIds:()=>Tp,fetchPinnedMessages:()=>md,fetchPopularAppBots:()=>yf,fetchPremiumGifts:()=>du,fetchPremiumPromo:()=>Xp,fetchPreviewMedias:()=>gf,fetchPrivacySettings:()=>gl,fetchProfilePhotos:()=>Wd,fetchQuickReplies:()=>Dd,fetchRecentEmojiStatuses:()=>Su,fetchRecentReactions:()=>Jf,fetchRecentStickers:()=>Xd,fetchRecommendedChatFolders:()=>Fr,fetchSavedChats:()=>yr,fetchSavedGifs:()=>pu,fetchSavedReactionTags:()=>Yf,fetchScheduledHistory:()=>gd,fetchSeenBy:()=>yd,fetchSendAs:()=>_d,fetchSponsoredMessages:()=>wd,fetchStarGifts:()=>dg,fetchStarsGiveawayOptions:()=>cg,fetchStarsStatus:()=>gg,fetchStarsSubscriptions:()=>yg,fetchStarsTopupOptions:()=>wg,fetchStarsTransactionById:()=>mg,fetchStarsTransactions:()=>hg,fetchStatisticsAsyncGraph:()=>ip,fetchStickerSets:()=>Qd,fetchStickers:()=>au,fetchStickersForEmoji:()=>bu,fetchStoriesArchive:()=>kp,fetchStoriesMaxIds:()=>Op,fetchStoriesViews:()=>Np,fetchStoryLink:()=>Fp,fetchStoryPublicForwards:()=>rp,fetchStoryStatistics:()=>op,fetchStoryViewList:()=>Vp,fetchTemporaryPaymentPassword:()=>Yp,fetchTimezones:()=>Al,fetchTopBotApps:()=>Wl,fetchTopInlineBots:()=>jl,fetchTopReactions:()=>$f,fetchTopUsers:()=>Gd,fetchTopicById:()=>yc,fetchTopics:()=>mc,fetchUnreadMentions:()=>Cd,fetchUnreadReactions:()=>Md,fetchUserStarGifts:()=>ug,fetchUsers:()=>Hd,fetchWallpapers:()=>Ku,fetchWebAuthorizations:()=>tl,fetchWebPagePreview:()=>rd,findFirstMessageIdAfterDate:()=>pd,forwardMessages:()=>fd,fulfillStarsSubscription:()=>bg,getChatByPhoneNumber:()=>Lr,getChatByUsername:()=>jr,getDhConfig:()=>Ef,getGroupCall:()=>bf,getPassword:()=>xl,getPasswordInfo:()=>Bl,getPaymentForm:()=>Jp,getPremiumGiftCodeOptions:()=>og,getReceipt:()=>Qp,getStarsGiftOptions:()=>rg,getTemporaryPaymentPassword:()=>Ul,hideAllChatJoinRequests:()=>Uu,hideChatJoinRequest:()=>Du,hideChatReportPane:()=>xu,importChatInvite:()=>uc,importContact:()=>Od,installStickerSet:()=>hu,invokeWebViewCustomMethod:()=>pf,joinChannel:()=>Mr,joinChatlistInvite:()=>vc,joinGroupCall:()=>Cf,joinGroupCallPresentation:()=>Rf,launchPrepaidGiveaway:()=>pg,leaveChannel:()=>Tr,leaveChatlist:()=>Ac,leaveGroupCall:()=>Pf,leaveGroupCallPresentation:()=>Tf,loadAttachBot:()=>af,loadAttachBots:()=>nf,loadMonetizationRevenueWithdrawalUrl:()=>cp,loadPollOptionResults:()=>ud,markMessageListRead:()=>Yc,markMessagesRead:()=>Zc,markStoryRead:()=>Bp,migrateChat:()=>nc,oldFetchLangPack:()=>fl,oldFetchLangStrings:()=>pl,onPasswordError:()=>Ol,pinMessage:()=>Lc,prolongWebView:()=>tf,provideAuthCode:()=>_o,provideAuthPassword:()=>bo,provideAuthPhoneNumber:()=>yo,provideAuthRegistration:()=>wo,provideRecoveryEmailCode:()=>ql,readAllMentions:()=>Ad,readAllReactions:()=>Pd,receivedCall:()=>xf,registerDevice:()=>hl,removeRecentSticker:()=>su,reorderUsernames:()=>kl,repairFileReference:()=>ir,reportChannelSpam:()=>Qc,reportMessages:()=>Jc,reportPeer:()=>ur,reportProfilePhoto:()=>lr,reportSpam:()=>zd,reportSponsoredMessage:()=>Id,reportStory:()=>Gp,requestAppWebView:()=>ef,requestBotUrlAuth:()=>rf,requestCall:()=>Df,requestChannelDifference:()=>dr,requestChatUpdate:()=>vr,requestLinkUrlAuth:()=>df,requestMainWebView:()=>Xl,requestPhoneCall:()=>Pp,requestSimpleWebView:()=>Yl,requestWebView:()=>Ql,rescheduleMessage:()=>Hc,resolveBusinessChatLink:()=>gr,restartAuth:()=>So,restartAuthWithQr:()=>vo,saveCloseFriends:()=>$d,saveDefaultSendAs:()=>bd,saveDraft:()=>Ir,saveGif:()=>gu,saveStarGift:()=>lg,searchChats:()=>wr,searchGifs:()=>_u,searchHashtagPosts:()=>od,searchMessagesGlobal:()=>id,searchMessagesInChat:()=>ad,searchStickers:()=>fu,sendEmojiInteraction:()=>qf,sendInlineBotResult:()=>$l,sendMessage:()=>Fc,sendMessageAction:()=>Xc,sendPaidReaction:()=>jf,sendPaymentForm:()=>Kp,sendPollVote:()=>cd,sendQuickReply:()=>Ud,sendReaction:()=>Lf,sendScheduledMessages:()=>hd,sendSignalingData:()=>Ff,sendStarPaymentForm:()=>$p,sendStoryReaction:()=>jp,sendWatchingEmojiInteraction:()=>Gf,sendWebViewData:()=>sf,setAllowHttpTransport:()=>rr,setBotInfo:()=>mf,setCallRating:()=>Uf,setChatEnabledReactions:()=>lc,setChatUsername:()=>Au,setDefaultReaction:()=>Kf,setDiscussionGroup:()=>sc,setForceHttpTransport:()=>or,setPrivacySettings:()=>yl,setShouldDebugExportedSenders:()=>cr,setViewForumAsMessages:()=>Tc,sortChatFolders:()=>Hr,startBot:()=>Jl,terminateAllAuthorizations:()=>el,terminateAllWebAuthorizations:()=>nl,terminateAuthorization:()=>Zu,terminateWebAuthorization:()=>sl,toggleAttachBot:()=>of,toggleChatArchived:()=>Vr,toggleChatPinned:()=>Ur,toggleDialogUnread:()=>Or,toggleForum:()=>gc,toggleGroupCallStartSubscription:()=>kf,toggleIsProtected:()=>fc,toggleJoinRequest:()=>cc,toggleJoinToSend:()=>rc,toggleParticipantsHidden:()=>pc,togglePeerTranslations:()=>kc,togglePinnedTopic:()=>bc,togglePreHistoryHidden:()=>zr,toggleSavedDialogPinned:()=>xr,toggleSignatures:()=>Yr,toggleSponsoredMessages:()=>hr,toggleStoriesHidden:()=>Hp,toggleStoryInProfile:()=>Up,toggleStoryPinnedToTop:()=>xp,toggleUsername:()=>Rl,transcribeAudio:()=>Rd,translateText:()=>kd,unblockUser:()=>Xu,uninstallStickerSet:()=>mu,unpinAllMessages:()=>jc,unregisterDevice:()=>ml,updateChatAbout:()=>Xr,updateChatAdmin:()=>Jr,updateChatDefaultBannedRights:()=>Kr,updateChatMemberBannedRights:()=>$r,updateChatMutedState:()=>Ar,updateChatTitle:()=>Qr,updateContact:()=>Ld,updateContactSignUpNotification:()=>ol,updateContentSettings:()=>wl,updateEmojiStatus:()=>Kd,updateGlobalPrivacySettings:()=>Ml,updateIsOnline:()=>_l,updateNotificationSettings:()=>rl,updatePassword:()=>Fl,updatePrivateLink:()=>Cu,updateProfile:()=>qu,updateProfilePhoto:()=>Lu,updateRecoveryEmail:()=>Gl,updateSavedReactionTag:()=>Zf,updateTopicMutedState:()=>Pr,updateUsername:()=>Ou,uploadContactProfilePhoto:()=>Wu,uploadProfilePhoto:()=>ju,uploadWallpaper:()=>$u,validateRequestedInfo:()=>zp,viewSponsoredMessage:()=>Sd,viewStory:()=>Ep});const i="A",o=!1,r=!1,c=!1,d="https://telegram-a-host",u=!1,l="tt-media",f="tt-media-avatars",p=524288,g=16,h=16,m=("undefined"!=typeof window&&window.innerHeight,20),y=200,_=50,b=100,w=100,S=100,v=100,I=50,A=100,P=50,C=100,M=100,R=100,k=20,T=3e5,E="XTR",B=2**31-1,D=Math.round(450),U=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),x=20,V=20,N="status-default-icon",F="video/webm",G="image/gif",q="application/x-tgsticker",H=F,O=new Set(["image/png","image/jpeg",G]),L=new Set(["video/mp4","video/quicktime"]),j=new Set(["audio/mp3","audio/ogg","audio/wav","audio/mpeg","audio/flac","audio/aac","audio/m4a","audio/mp4","audio/x-m4a"]),W=(new Set([...O,...L]),"MESSAGE_ID_REQUIRED"),z=new Set(["USERNAME_PURCHASE_AVAILABLE","USERNAME_INVALID"]),K=(new Set(["t.me","web.t.me","a.t.me","k.t.me","z.t.me"]),"weba"),$="weba",J=(new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),"777000"),Q=14,X="gif",Y=0,Z=1,ee="-1000000000777",te="android",se=1,ne=86400,ae=86400,ie=11,oe=(new Set(["USER_CANCELED"]),{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]}),re=["log","error","warn","info","debug"];function ce(e,t,s=!0){let n,a,i;return(...o)=>{a=!0,i=o,n||(s&&(a=!1,e(...i)),n=self.setInterval((()=>{if(!a)return self.clearInterval(n),void(n=void 0);a=!1,e(...i)}),t))}}function de(e){return function(e,t){let s,n=!1;return(...a)=>{s=a,n||(n=!0,e((()=>{n=!1,t(...s)})))}}(fe,e)}re.reduce(((e,t)=>(e[t]=console[t],e)),{});const ue=e=>new Promise((t=>{setTimeout((()=>t()),e)}));let le;function fe(e){le?le.push(e):(le=[e],Promise.resolve().then((()=>{const e=le;le=void 0,e.forEach((e=>e()))})))}var pe=s(45174);function ge(e){return e.hasOwnProperty("userId")}function he(e){return e.hasOwnProperty("chatId")}function me(e,t){return"user"===t?e.toString():"channel"===t?`-1${e.toString().padStart(Q-2,"0")}`:`-${e}`}function ye(e){return ge(e)?me(e.userId,"user"):he(e)?me(e.chatId,"chat"):me(e.channelId,"channel")}function _e(e){const{color:t,backgroundEmojiId:s}=e;return{color:t,backgroundEmojiId:s?.toString()}}function be(e){return e instanceof pe.Api.EmojiStatus?{documentId:e.documentId.toString()}:e instanceof pe.Api.EmojiStatusUntil?{documentId:e.documentId.toString(),until:e.until}:void 0}var we=s(92096),Se=s.n(we),ve=s(43355);function Ie(e,t=!1,s="image/jpeg"){return`${t?"":`data:${s};base64,`}${btoa(String.fromCharCode(...e))}`}function Ae(e){const{flags:t,CONSTRUCTOR_ID:s,SUBCLASS_OF_ID:n,className:a,classType:i,getBytes:o,...r}=e;return r}var Pe=s(48287).hp;const Ce="BroadcastChannel"in self,Me=Ce?new BroadcastChannel("tt-global"):void 0;let Re=[];const ke=ce((()=>{Me.postMessage({type:"localDbUpdate",batchedUpdates:Re}),Re=[]}),100);function Te(e){if(e instanceof Uint8Array)return Pe.from(e);if("object"==typeof e&&1===Object.keys(e).length&&"value"===Object.keys(e)[0])return Se()(e.value);if(Array.isArray(e))return e.map(Te);if("object"!=typeof e||!("CONSTRUCTOR_ID"in e))return e;const t=e.className.split(".").reduce(((e,t)=>e[t]),ve.constructors),s=Ae(e);return new t(Object.keys(s).reduce(((e,t)=>(e[t]=Te(s[t]),e)),{}))}function Ee(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]=Te(n[t]),e}),{});var i;return t[s]=Ce?(i=s,new Proxy(a,{get:(e,t,s)=>Reflect.get(e,t,s),set:(e,t,s)=>(Re.push({name:i,prop:t,value:s}),ke(),Reflect.set(e,t,s))})):a,t}),{})}const Be=Ee(),De=Be;function Ue(){Me&&Me.postMessage({type:"localDbUpdateFull",localDb:Object.keys(Be).reduce(((e,t)=>(e[t]={...Be[t]},e)),{})})}c&&(globalThis.getLocalDb=()=>Be);var xe=s(48287).hp;const Ve="#111111DD",Ne="#E4D00A",Fe={INVOKE:"#49DBF5",BEACON:"#F549DB",RESPONSE:"#6887F7",CONNECTING:"#E4D00A",CONNECTED:"#26D907","CONNECTING ERROR":"#D1191C","INVOKE ERROR":"#D1191C",UPDATE:"#0DD151","UNEXPECTED UPDATE":"#9C9C9C","UNEXPECTED RESPONSE":"#D1191C"};function Ge(e){if(e instanceof pe.Api.Message||e instanceof pe.Api.MessageService)return ye(e.peerId)}function qe(e){return e instanceof pe.Api.DialogFilter||e instanceof pe.Api.DialogFilterChatlist}function He(e){e instanceof pe.Api.Message&&(e.media&&Oe(e.media,e),e.replyTo instanceof pe.Api.MessageReplyHeader&&e.replyTo.replyMedia&&Oe(e.replyTo.replyMedia,e)),e instanceof pe.Api.MessageService&&"photo"in e.action&&je(Ke(e.action.photo,e)),e instanceof pe.Api.SponsoredMessage&&e.photo&&je(e.photo)}function Oe(e,t){e instanceof pe.Api.MessageMediaDocument&&e.document&&We(Ke(e.document,t)),e instanceof pe.Api.MessageMediaWebPage&&e.webpage instanceof pe.Api.WebPage&&(e.webpage.document&&We(Ke(e.webpage.document,t)),e.webpage.photo&&je(Ke(e.webpage.photo,t))),e instanceof pe.Api.MessageMediaGame&&(e.game.document&&We(Ke(e.game.document,t)),je(Ke(e.game.photo,t))),e instanceof pe.Api.MessageMediaPhoto&&e.photo&&je(Ke(e.photo,t)),e instanceof pe.Api.MessageMediaInvoice&&(e.photo&&Je(Ke(e.photo,t)),e.extendedMedia instanceof pe.Api.MessageExtendedMedia&&Oe(e.extendedMedia.media,t)),e instanceof pe.Api.MessageMediaPaidMedia&&e.extendedMedia.forEach((e=>{e instanceof pe.Api.MessageExtendedMedia&&Oe(e.media,t)}))}function Le(e,t){if(e instanceof pe.Api.StoryItem&&(e.media instanceof pe.Api.MessageMediaPhoto&&e.media.photo&&je(ze(e.media.photo,t,e)),e.media instanceof pe.Api.MessageMediaDocument&&(e.media.document instanceof pe.Api.Document&&We(ze(e.media.document,t,e)),e.media.altDocuments)))for(const s of e.media.altDocuments)We(ze(s,t,e))}function je(e){e instanceof pe.Api.Photo&&(De.photos[String(e.id)]=e)}function We(e){e instanceof pe.Api.Document&&(De.documents[String(e.id)]=e)}function ze(e,t,s){if(!(e instanceof pe.Api.Document&&e instanceof pe.Api.Photo))return e;const n=e;return n.localRepairInfo={type:"story",peerId:t,id:s.id},n}function Ke(e,t){if(!t?.peerId)return e;if(!(e instanceof pe.Api.Document||e instanceof pe.Api.Photo||e instanceof pe.Api.WebDocument))return e;const s=e;return s.localRepairInfo={type:"message",peerId:ye(t.peerId),id:t.id},s}function $e(e){const t=me(e.id,"user"),s=De.users[t];e.photo instanceof pe.Api.Photo&&je(e.photo),s&&!s.min&&e.min||(De.users[t]=e)}function Je(e){De.webDocuments[e.url]=e}function Qe(e){return String.fromCharCode(...e)}function Xe(e){return xe.from(e,"binary")}function Ye(e,...t){("UNEXPECTED RESPONSE"===e?console.error:"INVOKE ERROR"===e||"UNEXPECTED UPDATE"===e?console.warn:console.log)(`%cGramJS%c${e}`,`color: ${Ne}; background: ${Ve}; padding: 0.25rem; border-radius: 0.25rem;`,`color: ${Fe[e]}; background: ${Ve}; padding: 0.25rem; border-radius: 0.25rem; margin-left: 0.25rem;`,...t)}let Ze;function et(e){!function(e){it?it.push(e):it=[e],nt&&!U.has(e["@type"])||(nt=ce(st,D,!0),at=Math.random()),nt(at)}(e)}function tt(e){Ze(e)}const st=de((function(e){if(!it||e!==at)return;const t=it;it=void 0,t.forEach(Ze)}));let nt,at,it;var ot=s(26462),rt=s.n(ot),ct=s(4681);let dt=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.Unknown="MessageEntityUnknown",e}({});const ut=-1,lt="MESSAGE_DELETED";let ft=function(e){return e[e.BlobUrl=0]="BlobUrl",e[e.Progressive=1]="Progressive",e[e.DownloadUrl=2]="DownloadUrl",e[e.Text=3]="Text",e}({});String.fromCharCode(8205);const pt=/(?:\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)|(?:\ud83c\udfc3|\ud83d\udeb6|\ud83e\uddce)(?:\ud83c[\udffb-\udfff])?(?:\u200d[\u2640\u2642]\ufe0f)?(?:\u200d\u27a1\ufe0f)|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\ud83e[\uddaf\uddbc\uddbd])(?:\u200d\u27a1\ufe0f)|(?:\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\uddaf-\uddb3\uddbc\uddbc\uddbd\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd\uddce\uddce\uddcf\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\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[\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-\udeb6\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-\uddf5\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-\ude88\ude90-\udebd\udebf-\udec2\udece-\udedb\udee0-\udee8]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,gt=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f?/gu,"🏳️⚧️"],[/\u26d3\u200d\u{1f4a5}/gu,"⛓️💥"],[/\u200d([\u2640\u2642])(?!\ufe0f)/gu,"$1️"]],ht=100,mt=8*ht;function yt(e){const t=e.matchAll(pt);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 _t(e,t){if(e.text)return!t&&1===Object.keys(e).length&&!e.text.entities?.some((e=>e.type!==dt.CustomEmoji))&&function(e){const t=function(e){if(!e.match(pt))return e;for(const[t,s]of gt)e=e.replace(t,s);return e}(e).split("\n"),s=t.join("");if(s.length>mt)return!1;const n=yt(s);if(!n||n>ht)return!1;let a=t.length;for(const e of t){const t=yt(e);if(!1===t)return!1;t>a&&(a=t)}return a}(e.text.text)||void 0}function bt(e,t){return e.reduce(((e,s)=>(e[s[t]]=s,e)),{})}function wt(e,t){return e.reduce(((e,s)=>{const[n,a]=t(s);return e[n]=a,e}),{})}function St(e,t){return t.reduce(((t,s)=>(t[s]=e[s],t)),{})}function vt(e,t){return t.reduce(((t,s)=>(e[s]&&(t[s]=e[s]),t)),{})}function It(e,t){const s=new Set(t.map(String));return St(e,Object.keys(e).filter((e=>!s.has(e))))}function At(e){return Object.keys(e).reduce(((t,s)=>{const n=s;return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Pt(e){return e.filter(Boolean)}function Ct(e,t){const s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}let Mt=0;function Rt(){return Mt}function kt(){return Math.floor(Date.now()/1e3)+Mt}function Tt(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}}var Et=s(80071),Bt=s.n(Et),Dt=s(48287).hp;function Ut(e){return e.startsWith("-")?(t=e).length===Q&&t.startsWith("-1")?"channel":"chat":"user";var t}function xt(e){const t=Ut(e);return"user"===t?new pe.Api.PeerUser({userId:ss(e,"user")}):"channel"===t?new pe.Api.PeerChannel({channelId:ss(e,"channel")}):new pe.Api.PeerChat({chatId:ss(e,"chat")})}function Vt(e,t){const s=Ut(e);return"user"===s?new pe.Api.InputPeerUser({userId:ss(e,"user"),accessHash:Se()(t)}):"channel"===s?new pe.Api.InputPeerChannel({channelId:ss(e,"channel"),accessHash:Se()(t)}):new pe.Api.InputPeerChat({chatId:ss(e,"chat")})}function Nt(e){const t=Ut(e);let s;if("user"===t){if(s=De.users[e]?.accessHash,!s)return}else if("channel"===t&&(s=De.chats[e]?.accessHash,!s))return;return Vt(e,String(s))}function Ft(e,t){const s=Ut(e);return"user"===s?new pe.Api.InputUser({userId:ss(e,"user"),accessHash:Se()(t)}):"channel"===s?new pe.Api.InputChannel({channelId:ss(e,"channel"),accessHash:Se()(t)}):ss(e,"chat")}function Gt(e,t){return new pe.Api.InputStickerSetID({id:Se()(e),accessHash:Se()(t)})}function qt(e){const t=De.documents[e.id];if(t)return new pe.Api.InputDocument(St(t,["id","accessHash","fileReference"]))}function Ht(e){const t=qt(e);if(t)return new pe.Api.InputMediaDocument({id:t})}function Ot(e,t=!1){return new pe.Api.InputMediaPoll({poll:new pe.Api.Poll({id:Se()(e.id),publicVoters:e.summary.isPublic,question:ds(e.summary.question),answers:e.summary.answers.map((({text:e,option:t})=>new pe.Api.PollAnswer({text:ds(e),option:Xe(t)}))),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=>Xe(e.option))),solution:e.results.solution,solutionEntities:e.results.solutionEntities?.map(Kt)})}function Lt(){return(0,Et.readBigIntFromBuffer)((0,Et.generateRandomBytes)(8),!0,!0)}function jt(){const e=(0,Et.generateRandomBytes)(8),t=Dt.alloc(4);return t.writeUInt32LE(Math.floor(Date.now()/1e3),0),e.set(t,4),(0,Et.readBigIntFromBuffer)(e,!0,!0)}function Wt(){return(0,Et.readBigIntFromBuffer)((0,Et.generateRandomBytes)(4),!0,!0).toJSNumber()}function zt(e,t,s){return new pe.Api.Message({id:e,peerId:xt(t),fromId:xt(t),media:s.media})}function Kt(e){const{type:t,offset:s,length:n}=e,a="userId"in e?De.users[e.userId]:void 0;switch(t){case dt.Bold:return new pe.Api.MessageEntityBold({offset:s,length:n});case dt.Italic:return new pe.Api.MessageEntityItalic({offset:s,length:n});case dt.Underline:return new pe.Api.MessageEntityUnderline({offset:s,length:n});case dt.Strike:return new pe.Api.MessageEntityStrike({offset:s,length:n});case dt.Code:return new pe.Api.MessageEntityCode({offset:s,length:n});case dt.Pre:return new pe.Api.MessageEntityPre({offset:s,length:n,language:e.language||""});case dt.Blockquote:return new pe.Api.MessageEntityBlockquote({offset:s,length:n});case dt.TextUrl:return new pe.Api.MessageEntityTextUrl({offset:s,length:n,url:e.url});case dt.Url:return new pe.Api.MessageEntityUrl({offset:s,length:n});case dt.Hashtag:return new pe.Api.MessageEntityHashtag({offset:s,length:n});case dt.MentionName:return new pe.Api.InputMessageEntityMentionName({offset:s,length:n,userId:new pe.Api.InputUser({userId:Se()(a.id),accessHash:a.accessHash})});case dt.Spoiler:return new pe.Api.MessageEntitySpoiler({offset:s,length:n});case dt.CustomEmoji:return new pe.Api.MessageEntityCustomEmoji({offset:s,length:n,documentId:Se()(e.documentId)});default:return new pe.Api.MessageEntityUnknown({offset:s,length:n})}}function $t(e){const t=De.photos[e?.id];if(t)return new pe.Api.InputPhoto(St(t,["id","accessHash","fileReference"]))}function Jt({phone:e,firstName:t,lastName:s}){return new pe.Api.InputPhoneContact({clientId:Se()(1),phone:e,firstName:t,lastName:s})}function Qt(e,t=0){return new pe.Api.ChatBannedRights({...e,untilDate:t})}function Xt(e){return new pe.Api.ChatAdminRights(e)}function Yt(e){const{shippingAddress:t}=e;return new pe.Api.PaymentRequestedInfo({...e,shippingAddress:t?new pe.Api.PostAddress(t):void 0})}function Zt(e){switch(e){case"phoneNumber":return new pe.Api.InputPrivacyKeyPhoneNumber;case"addByPhone":return new pe.Api.InputPrivacyKeyAddedByPhone;case"lastSeen":return new pe.Api.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new pe.Api.InputPrivacyKeyProfilePhoto;case"forwards":return new pe.Api.InputPrivacyKeyForwards;case"chatInvite":return new pe.Api.InputPrivacyKeyChatInvite;case"phoneCall":return new pe.Api.InputPrivacyKeyPhoneCall;case"phoneP2P":return new pe.Api.InputPrivacyKeyPhoneP2P;case"voiceMessages":return new pe.Api.InputPrivacyKeyVoiceMessages;case"bio":return new pe.Api.InputPrivacyKeyAbout;case"birthday":return new pe.Api.InputPrivacyKeyBirthday;case"gifts":return new pe.Api.InputPrivacyKeyStarGiftsAutoSave}}function es(e){switch(e){case"spam":return new pe.Api.InputReportReasonSpam;case"violence":return new pe.Api.InputReportReasonViolence;case"childAbuse":return new pe.Api.InputReportReasonChildAbuse;case"pornography":return new pe.Api.InputReportReasonPornography;case"copyright":return new pe.Api.InputReportReasonCopyright;case"fake":return new pe.Api.InputReportReasonFake;case"geoIrrelevant":return new pe.Api.InputReportReasonGeoIrrelevant;case"illegalDrugs":return new pe.Api.InputReportReasonIllegalDrugs;case"personalDetails":return new pe.Api.InputReportReasonPersonalDetails;case"other":return new pe.Api.InputReportReasonOther}}function ts(e){return new pe.Api.DataJSON({data:JSON.stringify(e)})}function ss(e,t){return"user"===t?Se()(e):"channel"===t?Se()(e.slice(2)):Se()(e.slice(1))}function ns(e){return new pe.Api.InputGroupCall({id:Se()(e.id),accessHash:Se()(e.accessHash)})}function as({id:e,accessHash:t}){return new pe.Api.InputPhoneCall({id:Se()(e),accessHash:Se()(t)})}function is(e){if("stars"===e.type)return new pe.Api.InputStorePaymentStarsTopup({stars:Se()(e.stars),currency:e.currency,amount:Se()(e.amount)});if("starsgift"===e.type)return new pe.Api.InputStorePaymentStarsGift({userId:Ft(e.user.id,e.user.accessHash),stars:Se()(e.stars),currency:e.currency,amount:Se()(e.amount)});if("giftcode"===e.type)return new pe.Api.InputStorePaymentPremiumGiftCode({users:e.users.map((e=>Ft(e.id,e.accessHash))),boostPeer:e.boostChannel?Vt(e.boostChannel.id,e.boostChannel.accessHash):void 0,currency:e.currency,amount:Se()(e.amount),message:e.message&&ds(e.message)});const t=Lt();return"starsgiveaway"===e.type?new pe.Api.InputStorePaymentStarsGiveaway({boostPeer:Vt(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map((e=>Vt(e.id,e.accessHash))),stars:Se()(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:Se()(e.amount),users:e.users,randomId:t}):new pe.Api.InputStorePaymentPremiumGiveaway({boostPeer:Vt(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map((e=>Vt(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:Se()(e.amount),randomId:t})}function os(e){switch(e.type){case"message":return new pe.Api.InputInvoiceMessage({peer:Vt(e.chat.id,e.chat.accessHash),msgId:e.messageId});case"slug":return new pe.Api.InputInvoiceSlug({slug:e.slug});case"stargift":{const{user:t,shouldHideName:s,giftId:n,message:a}=e;return new pe.Api.InputInvoiceStarGift({userId:Ft(t.id,t.accessHash),hideName:s||void 0,giftId:Se()(n),message:a&&ds(a)})}case"stars":{const t=is(e.purpose);return new pe.Api.InputInvoiceStars({purpose:t})}case"starsgiveaway":{const t=is(e.purpose);return new pe.Api.InputInvoiceStars({purpose:t})}case"chatInviteSubscription":return new pe.Api.InputInvoiceChatInviteSubscription({hash:e.hash});default:{const s=is(e.purpose),n=(t=e.option,new pe.Api.PremiumGiftCodeOption({users:t.users,months:t.months,currency:t.currency,amount:Se()(t.amount)}));return new pe.Api.InputInvoicePremiumGiftCode({purpose:s,option:n})}}var t}function rs(e){switch(e?.type){case"emoji":return new pe.Api.ReactionEmoji({emoticon:e.emoticon});case"custom":return new pe.Api.ReactionCustomEmoji({documentId:Se()(e.documentId)});case"paid":return new pe.Api.ReactionPaid;default:return new pe.Api.ReactionEmpty}}function cs(e,t){return e===N?new pe.Api.EmojiStatusEmpty:t?new pe.Api.EmojiStatusUntil({documentId:Se()(e),until:t}):new pe.Api.EmojiStatus({documentId:Se()(e)})}function ds(e){return new pe.Api.TextWithEntities({text:e.text,entities:e.entities?.map(Kt)||[]})}function us(e){return new pe.Api.InputBotAppID({id:Se()(e.id),accessHash:Se()(e.accessHash)})}function ls(e){if("story"===e.type)return new pe.Api.InputReplyToStory({peer:Nt(e.peerId),storyId:e.storyId});if("message"===e.type){const{replyToMsgId:t,replyToTopId:s,replyToPeerId:n,quoteText:a}=e;return new pe.Api.InputReplyToMessage({replyToMsgId:t,topMsgId:s,replyToPeerId:n?Nt(n):void 0,quoteText:a?.text,quoteEntities:a?.entities?.map(Kt)})}}function fs(e){const t=[];if(e.allowedUsers?.length&&t.push(new pe.Api.InputPrivacyValueAllowUsers({users:e.allowedUsers.map((({id:e,accessHash:t})=>Ft(e,t)))})),e.allowedChats?.length&&t.push(new pe.Api.InputPrivacyValueAllowChatParticipants({chats:e.allowedChats.map((({id:e,type:t})=>ss(e,"chatTypeBasicGroup"===t?"chat":"channel")))})),e.blockedUsers?.length&&t.push(new pe.Api.InputPrivacyValueDisallowUsers({users:e.blockedUsers.map((({id:e,accessHash:t})=>Ft(e,t)))})),e.blockedChats?.length&&t.push(new pe.Api.InputPrivacyValueDisallowChatParticipants({chats:e.blockedChats.map((({id:e,type:t})=>ss(e,"chatTypeBasicGroup"===t?"chat":"channel")))})),e.shouldAllowPremium&&t.push(new pe.Api.InputPrivacyValueAllowPremium),"allow"===e.botsPrivacy&&t.push(new pe.Api.InputPrivacyValueAllowBots),"disallow"===e.botsPrivacy&&t.push(new pe.Api.InputPrivacyValueDisallowBots),!e.isUnspecified)switch(e.visibility){case"everybody":t.push(new pe.Api.InputPrivacyValueAllowAll);break;case"contacts":t.push(new pe.Api.InputPrivacyValueAllowContacts);break;case"nonContacts":t.push(new pe.Api.InputPrivacyValueDisallowContacts);break;case"nobody":t.push(new pe.Api.InputPrivacyValueDisallowAll)}return t}function ps(e){const{self:t,min:s,about:n,date:a,versioned:i,canSelfUnmute:o,justJoined:r,left:c,muted:d,mutedByYou:u,source:l,volume:f,volumeByAdmin:p,videoJoined:g,peer:h,video:m,presentation:y,raiseHandRating:_}=e;return{isSelf:t,isMin:s,canSelfUnmute:o,isLeft:c,isMuted:d,isMutedByMe:u,hasJustJoined:r,isVolumeByAdmin:p,isVersioned:i,isVideoJoined:g,about:n,source:l,raiseHandRating:_?.toString(),volume:f,date:new Date(a),isUser:ge(h),id:ye(h),video:m?gs(m):void 0,presentation:y?gs(y):void 0}}function gs(e){const{audioSource:t,endpoint:s,paused:n,sourceGroups:a}=e;return{audioSource:t,endpoint:s,isPaused:n,sourceGroups:a.map(hs)}}function hs(e){return{semantics:e.semantics,sources:e.sources}}function ms(e){const{id:t,accessHash:s}=e;if(e instanceof pe.Api.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:u}=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:u,participants:{}}}function ys(e){const{id:t}=e;let s={id:t.toString()};if(e instanceof pe.Api.PhoneCallAccepted||e instanceof pe.Api.PhoneCallWaiting||e instanceof pe.Api.PhoneCall||e instanceof pe.Api.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:ws(r)}}if(e instanceof pe.Api.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(bs).filter(Boolean)}}return e instanceof pe.Api.PhoneCallDiscarded&&(s={...s,state:"discarded",duration:e.duration,reason:_s(e.reason),needRating:e.needRating,needDebug:e.needDebug}),e instanceof pe.Api.PhoneCallWaiting&&(s={...s,state:"waiting",receiveDate:e.receiveDate}),e instanceof pe.Api.PhoneCallAccepted&&(s={...s,state:"accepted",gB:Array.from(e.gB)}),e instanceof pe.Api.PhoneCallRequested&&(s={...s,state:"requested",gAHash:Array.from(e.gAHash)}),s}function _s(e){return e instanceof pe.Api.PhoneCallDiscardReasonMissed?"missed":e instanceof pe.Api.PhoneCallDiscardReasonBusy?"busy":e instanceof pe.Api.PhoneCallDiscardReasonHangup?"hangup":"disconnect"}function bs(e){if(e instanceof pe.Api.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 ws(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 Ss(){return new pe.Api.PhoneCallProtocol({libraryVersions:["4.0.0"],minLayer:92,maxLayer:92,udpReflector:!0,udpP2p:!0})}var vs=s(56215);const Is='<?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>',As="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,";function Ps(e){let t="M";const s=e.length;for(let n=0;n<s;n++){const s=e[n];s>=192?t+=As[s-128-64]:(s>=128?t+=",":s>=64&&(t+="-"),t+=String(63&s))}return t+="z",t}const Cs={w:100,h:100};function Ms(e,t){if(!e||!e.length)return;const s=e.find((e=>e instanceof pe.Api.PhotoStrippedSize));if(!s)return;const n=e.filter((e=>e instanceof pe.Api.PhotoSize)),{w:a,h:i}=n.length?n[n.length-1]:Cs,{bytes:o}=s;return{dataUri:Ie(t&&"image/jpeg"!==t?o:(0,vs.strippedPhotoToJpg)(o),void 0,t),width:a,height:i}}function Rs(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,Is.replace("{{path}}",Ps(a)).replace("{{width}}",String(i)).replace("{{height}}",String(o))}`,width:s,height:n}}function ks(e,t){const s=e.sizes.filter((e=>e instanceof pe.Api.PhotoSize||e instanceof pe.Api.PhotoSizeProgressive)).map(Bs);return{mediaType:"photo",id:String(e.id),thumbnail:Ms(e.sizes),sizes:s,isSpoiler:t,date:e.date,...e.videoSizes&&{videoSizes:Pt(e.videoSizes.map(Es)),isVideo:!0}}}function Ts(e){return e.filter((e=>e instanceof pe.Api.PhotoSize||e instanceof pe.Api.PhotoSizeProgressive)).map(Bs)}function Es(e){if(!(e instanceof pe.Api.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 Bs(e){const{w:t,h:s,type:n}=e;return{width:t,height:s,type:n}}function Ds(e){if(!(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((({username:e,active:s,editable:n})=>{t.push({username:e,...s&&{isActive:!0},...n&&{isEditable:!0}})})),t}function Us(e){let t,s,n,a,i,o,r,c="none";const d=De.chats;return e.forEach((e=>{e instanceof pe.Api.PrivacyValueAllowAll?t||(t="everybody"):e instanceof pe.Api.PrivacyValueAllowContacts?t||(t="contacts"):e instanceof pe.Api.PrivacyValueAllowCloseFriends?t||(t="closeFriends"):e instanceof pe.Api.PrivacyValueDisallowContacts?t||(t="nonContacts"):e instanceof pe.Api.PrivacyValueDisallowAll?t||(t="nobody"):e instanceof pe.Api.PrivacyValueAllowUsers?n=e.users.map((e=>me(e,"user"))):e instanceof pe.Api.PrivacyValueDisallowUsers?i=e.users.map((e=>me(e,"user"))):e instanceof pe.Api.PrivacyValueAllowChatParticipants?a=e.chats.map((e=>{const t=me(e,"chat"),s=me(e,"channel");return d[t]?t:s})):e instanceof pe.Api.PrivacyValueDisallowChatParticipants?o=e.chats.map((e=>{const t=me(e,"chat"),s=me(e,"channel");return d[t]?t:s})):e instanceof pe.Api.PrivacyValueAllowPremium?r=!0:e instanceof pe.Api.PrivacyValueAllowBots?c="allow":e instanceof pe.Api.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 xs(e){const{text:t,entities:s}=e;return{text:t,entities:s.map(Vs)}}function Vs(e){const{className:t,offset:s,length:n}=e;return e instanceof pe.Api.MessageEntityMentionName?{type:dt.MentionName,offset:s,length:n,userId:me(e.userId,"user")}:e instanceof pe.Api.MessageEntityTextUrl?{type:dt.TextUrl,offset:s,length:n,url:e.url}:e instanceof pe.Api.MessageEntityPre?{type:dt.Pre,offset:s,length:n,language:e.language}:e instanceof pe.Api.MessageEntityCustomEmoji?{type:dt.CustomEmoji,offset:s,length:n,documentId:e.documentId.toString()}:e instanceof pe.Api.MessageEntityBlockquote?{type:dt.Blockquote,canCollapse:e.collapsed,offset:s,length:n}:{type:t,offset:s,length:n}}function Ns(e){if("photoId"in e)return e.photoId.toString()}function Fs(e){return{botId:me(e.botId,"user"),iconId:e.icon.toString(),description:e.description}}const Gs=30;function qs(e,t,s){if(e instanceof pe.Api.DocumentEmpty)return;const{mimeType:n,videoThumbs:a}=e,i=e.attributes.find((e=>e instanceof pe.Api.DocumentAttributeSticker)),o=e.attributes.find((e=>e instanceof pe.Api.DocumentAttributeCustomEmoji));if(!i&&!o)return;const r=n===q,c=n===H,d=Boolean(o),u=d&&o.textColor,l=e.attributes.find((e=>e instanceof pe.Api.DocumentAttributeImageSize)),f=e.attributes.find((e=>e instanceof pe.Api.DocumentAttributeVideo)),p=l||f,g=i||o,h=(b=g?.stickerset,b instanceof pe.Api.InputStickerSetID?{id:String(b.id),accessHash:String(b.accessHash)}:b instanceof pe.Api.InputStickerSetShortName?{shortName:b.shortName}:{isMissing:!0}),m=g?.alt,y=Boolean(o?.free??!0)&&!s,_=e.thumbs&&e.thumbs.find((e=>e instanceof pe.Api.PhotoCachedSize));var b;if(!(n!==H||self.isWebmSupported||_||e.thumbs&&e.thumbs.find((e=>e instanceof pe.Api.PhotoSize))))return;const w=e.thumbs&&e.thumbs.find((e=>e instanceof pe.Api.PhotoPathSize)),S=_?function(e){const{w:t,h:s,bytes:n}=e;return{dataUri:Ie(n,void 0,"image/webp"),width:t,height:s}}(_):w&&p?Rs(w,p):void 0,v=e.thumbs&&Ts(e.thumbs),{w:I,h:A}=_||p||{},P=!t&&a&&Pt(a?.filter((e=>e instanceof pe.Api.VideoSize))).some((({type:e})=>"f"===e));return{mediaType:"sticker",id:String(e.id),stickerSetInfo:h,emoji:m,isCustomEmoji:d,isLottie:r,isVideo:c,width:I,height:A,thumbnail:S,hasEffect:P,isFree:y,shouldUseTextColor:u,previewPhotoSizes:v}}function Hs(e){const{archived:t,installedDate:s,id:n,accessHash:a,title:i,thumbs:o,count:r,shortName:c,emojis:d,thumbDocumentId:u}=e,l=o?.some((e=>"s"===e.type)),f=o?.some((e=>"a"===e.type)),p=o?.some((e=>"v"===e.type)),g=u&&String(u),h=l||f||p||Boolean(g);return{isArchived:t,isEmoji:d,installedDate:s,id:String(n),accessHash:String(a),title:i,hasStaticThumb:l,hasAnimatedThumb:f,hasVideoThumb:p,hasThumbnail:h,thumbCustomEmojiId:g,count:r,shortName:c}}function Os(e){const t=Hs(e.set);if(e instanceof pe.Api.StickerSetNoCovered)return t;const s=js(e instanceof pe.Api.StickerSetCovered?[e.cover]:e instanceof pe.Api.StickerSetMultiCovered?e.covers:e.documents);return e instanceof pe.Api.StickerSetFullCovered?{...t,stickers:s,packs:Ls(e.packs)}:{...t,covers:s}}function Ls(e){return e.reduce(((e,{emoticon:t,documents:s})=>(e[t]=s.map((e=>{const t=De.documents[String(e)];if(t)return qs(t)})).filter(Boolean),e)),{})}function js(e){return e.map((e=>{if(e instanceof pe.Api.Document){const t=qs(e);if(t)return De.documents[String(e.id)]=e,t}})).filter(Boolean)}function Ws(e){let t={};if(e.media){const s="peerId"in e?e:void 0;t={...Ks(e.media,s)}}const s=e.media instanceof pe.Api.MessageMediaUnsupported;return!e.message||s||t.sticker||t.pollId||t.contact||t.video?.isRound||(t={...t,text:zs(e.message,e.entities)}),t}function zs(e,t){return{text:e,...t&&{entities:t.map(Vs)}}}function Ks(e,t){Oe(e,t);const s="ttlSeconds"in e?e.ttlSeconds:void 0,n=function(e){return e instanceof pe.Api.MessageMediaDocument&&(!e.document&&e.voice)}(e);if(n)return{isExpiredVoice:n};const a=function(e){return e instanceof pe.Api.MessageMediaDocument&&(!e.document&&e.round)}(e);if(a)return{isExpiredRoundVideo:a};const i=function(e){if(!(e instanceof pe.Api.MessageMediaDocument&&e.document&&e.document instanceof pe.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof pe.Api.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=Js(e);if(t)return{video:t,ttlSeconds:s}}if(void 0!==s)return;if(e instanceof pe.Api.MessageMediaInvoice&&e.extendedMedia instanceof pe.Api.MessageExtendedMedia)return Ks(e.extendedMedia.media,t);const o=function(e){if(e instanceof pe.Api.MessageMediaDocument&&e.document&&e.document instanceof pe.Api.Document)return qs(e.document,e.nopremium)}(e);if(o)return{sticker:o};const r=function(e){if(e instanceof pe.Api.MessageMediaPhoto&&e.photo&&e.photo instanceof pe.Api.Photo)return ks(e.photo,e.spoiler)}(e);if(r)return{photo:r};const c=Js(e),d=function(e){if(!(e instanceof pe.Api.MessageMediaDocument&&e.altDocuments))return;const t=e.altDocuments.filter((e=>e instanceof pe.Api.Document&&e.mimeType.startsWith("video"))).map((t=>$s(t,e.spoiler))).filter(Boolean);return t.length?t:void 0}(e);if(c)return{video:c,altVideos:d};const u=function(e){if(!(e instanceof pe.Api.MessageMediaDocument&&e.document&&e.document instanceof pe.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof pe.Api.DocumentAttributeAudio));if(!t||t.voice)return;const s=e.document.thumbs&&e.document.thumbs.filter((e=>e instanceof pe.Api.PhotoSize)).map((e=>Bs(e)));return{mediaType:"audio",id:String(e.document.id),fileName:sn(e.document,"audio"),thumbnailSizes:s,size:e.document.size.toJSNumber(),...St(e.document,["mimeType"]),...St(t,["duration","performer","title"])}}(e);if(u)return{audio:u};const l=function(e){if(e instanceof pe.Api.MessageMediaDocument&&e.document)return Qs(e.document)}(e);if(l)return{document:l};const f=function(e){if(!(e instanceof pe.Api.MessageMediaContact))return;const{firstName:t,lastName:s,phoneNumber:n,userId:a}=e;return{mediaType:"contact",firstName:t,lastName:s,phoneNumber:n,userId:me(a,"user")}}(e);if(f)return{contact:f};const p=function(e){if(e instanceof pe.Api.MessageMediaPoll)return e.poll.id.toString()}(e);if(p)return{pollId:p};const g=tn(e);if(g)return{webPage:g};const h=function(e){if(e instanceof pe.Api.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 pe.Api.MessageExtendedMediaPreview?nn(c):void 0;return{mediaType:"invoice",title:s,description:t,photo:an(n),receiptMessageId:r,amount:i.toJSNumber(),currency:o,isTest:a,extendedMedia:d}}(e)}(e);if(h)return{invoice:h};const m=function(e){return e instanceof pe.Api.MessageMediaGeo?function(e){const t=Ys(e.geo);return t&&{mediaType:"geo",geo:t}}(e):e instanceof pe.Api.MessageMediaVenue?function(e){const{geo:t,title:s,provider:n,address:a,venueId:i,venueType:o}=e,r=Ys(t);return r&&{mediaType:"venue",geo:r,title:s,provider:n,address:a,venueId:i,venueType:o}}(e):e instanceof pe.Api.MessageMediaGeoLive?function(e){const{geo:t,period:s,heading:n}=e,a=Ys(t);return a&&{mediaType:"geoLive",geo:a,period:s,heading:n}}(e):void 0}(e);if(m)return{location:m};const y=function(e){if(e instanceof pe.Api.MessageMediaGame)return function(e){const{id:t,accessHash:s,shortName:n,title:a,description:i,photo:o,document:r}=e.game,c=o instanceof pe.Api.Photo?ks(o):void 0,d=r instanceof pe.Api.Document?Qs(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 _=function(e){if(!(e instanceof pe.Api.MessageMediaStory))return;const t=ye(e.peer);return{mediaType:"storyData",id:e.id,peerId:t,...e.viaMention&&{isMention:!0}}}(e);if(_)return{storyData:_};const b=function(e){if(e instanceof pe.Api.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=>me(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(b)return{giveaway:b};const w=function(e){if(e instanceof pe.Api.MessageMediaGiveawayResults)return function(e){const{months:t,untilDate:s,onlyNewSubscribers:n,launchMsgId:a,unclaimedCount:i,winners:o,winnersCount:r,additionalPeersCount:c,prizeDescription:d,refunded:u,channelId:l}=e,f=o.map((e=>me(e,"user")));return{mediaType:"giveawayResults",months:t,untilDate:s,isOnlyForNewSubscribers:n,launchMessageId:a,channelId:me(l,"channel"),unclaimedCount:i,additionalPeersCount:c,isRefunded:u,prizeDescription:d,winnerIds:f,winnersCount:r}}(e)}(e);if(w)return{giveawayResults:w};const S=function(e){if(!(e instanceof pe.Api.MessageMediaPaidMedia))return;const{starsAmount:t,extendedMedia:s}=e,n=s[0]instanceof pe.Api.MessageExtendedMedia;return n?{mediaType:"paidMedia",starsAmount:t.toJSNumber(),isBought:n,extendedMedia:on(s)}:{mediaType:"paidMedia",starsAmount:t.toJSNumber(),extendedMedia:s.filter((e=>e instanceof pe.Api.MessageExtendedMediaPreview)).map((e=>nn(e)))}}(e);return S?{paidMedia:S}:void 0}function $s(e,t){if(e instanceof pe.Api.DocumentEmpty)return;const{id:s,mimeType:n,thumbs:a,size:i,videoThumbs:o,attributes:r}=e;if(n===F&&!self.isWebmSupported)return;const c=r.find((e=>e instanceof pe.Api.DocumentAttributeVideo));if(!c)return;const d=r.find((e=>e instanceof pe.Api.DocumentAttributeAnimated)),u=o?.some((e=>e instanceof pe.Api.VideoSize&&"v"===e.type)),l=a&&Ts(a),{duration:f,w:p,h:g,supportsStreaming:h=!1,roundMessage:m=!1,nosound:y}=c,_=m?function(e){const t=Math.min(Math.round(e),Gs);return Array.from({length:t},(()=>Math.floor(256*Math.random())))}(f):void 0;return{mediaType:"video",id:String(s),mimeType:n,duration:f,fileName:sn(e,"video"),width:p,height:g,supportsStreaming:h,isRound:m,isGif:Boolean(d),thumbnail:Ms(a),size:i.toJSNumber(),isSpoiler:t,hasVideoPreview:u,previewPhotoSizes:l,waveform:_,...y&&{noSound:!0}}}function Js(e){if(e instanceof pe.Api.MessageMediaDocument&&e.document instanceof pe.Api.Document&&e.document.mimeType.startsWith("video"))return $s(e.document,e.spoiler)}function Qs(e){if(!(e instanceof pe.Api.Document))return;const{id:t,size:s,mimeType:n,date:a,thumbs:i,attributes:o}=e,r=i&&i.find((e=>e instanceof pe.Api.PhotoSize));let c=i&&Ms(i);if(!c&&i&&r){const e=i.find((e=>e instanceof pe.Api.PhotoPathSize));e&&(c=Rs(e,r))}const d=i&&Ts(i);let u,l;if(r)if(l={width:r.w,height:r.h},O.has(n)){u="photo";const e=o.find((e=>e instanceof pe.Api.DocumentAttributeImageSize));if(e){const{w:t,h:s}=e;l={width:t,height:s}}}else if(L.has(n)){u="video";const e=o.find((e=>e instanceof pe.Api.DocumentAttributeVideo));if(e){const{w:t,h:s}=e;l={width:t,height:s}}}return{mediaType:"document",id:String(t),size:s.toJSNumber(),mimeType:n,timestamp:a,fileName:sn(e),thumbnail:c,innerMediaType:u,mediaSize:l,previewPhotoSizes:d}}function Xs(e){if(e instanceof pe.Api.MessageMediaPoll)return Zs(e.poll,e.results)}function Ys(e){if(e instanceof pe.Api.GeoPointEmpty)return;const{long:t,lat:s,accuracyRadius:n,accessHash:a}=e;return{long:t,lat:s,accessHash:a.toString(),accuracyRadius:n}}function Zs(e,t){const{id:s,answers:n}=e,a=n.map((e=>({text:xs(e.text),option:Qe(e.option)})));return{mediaType:"poll",id:String(s),summary:{isPublic:e.publicVoters,question:xs(e.question),...St(e,["closed","multipleChoice","quiz","closePeriod","closeDate"]),answers:a},results:en(t)}}function en(e){const{results:t,totalVoters:s,recentVoters:n,solution:a,solutionEntities:i,min:o}=e,r=t?.map((({option:e,chosen:t,correct:s,voters:n})=>({isChosen:t,isCorrect:s,option:Qe(e),votersCount:n})));return{isMin:o,totalVoters:s,recentVoterIds:n?.map((e=>ye(e))),results:r,solution:a,...i&&{solutionEntities:i.map(Vs)}}}function tn(e){if(!(e instanceof pe.Api.MessageMediaWebPage&&e.webpage instanceof pe.Api.WebPage))return;const{id:t,photo:s,document:n,attributes:a}=e.webpage;let i,o,r,c;n instanceof pe.Api.Document&&n.mimeType.startsWith("video/")&&(i=$s(n)),n instanceof pe.Api.Document&&n.mimeType.startsWith("audio/")&&(o=function(e){if(e instanceof pe.Api.DocumentEmpty)return;const{id:t,mimeType:s,size:n,attributes:a}=e,i=a.find((e=>e instanceof pe.Api.DocumentAttributeAudio));if(!i)return;const{duration:o,title:r,performer:c}=i;return{mediaType:"audio",id:String(t),mimeType:s,duration:o,fileName:sn(e,"audio"),title:r,performer:c,size:n.toJSNumber()}}(n));const d=a?.find((e=>e instanceof pe.Api.WebPageAttributeStory));if(d){const e=ye(d.peer);r={id:d.id,peerId:e},d.story instanceof pe.Api.StoryItem&&Le(d.story,e)}const u=a?.find((e=>e instanceof pe.Api.WebPageAttributeStickerSet));u&&(c={documents:js(u.stickers),isEmoji:u.emojis,isWithTextColor:u.textColor});const l=e.forceSmallMedia?"small":e.forceLargeMedia?"large":void 0;return{mediaType:"webpage",id:Number(t),...St(e.webpage,["url","displayUrl","type","siteName","title","description","duration","hasLargeMedia"]),photo:s instanceof pe.Api.Photo?ks(s):void 0,document:i||o||!n?void 0:Qs(n),video:i,audio:o,story:r,stickers:c,mediaSize:l}}function sn(e,t="file"){const{mimeType:s,attributes:n}=e,a=n.find((e=>e instanceof pe.Api.DocumentAttributeFilename));if(a)return a.fileName;const i=s.split("/")[1];return`${t}${String(e.id)}.${i}`}function nn(e){const{w:t,h:s,thumb:n,videoDuration:a}=e;return{mediaType:"extendedMediaPreview",width:t,height:s,duration:a,thumbnail:n?Ms([n]):void 0}}function an(e){if(!e)return;const{url:t,size:s,mimeType:n}=e,a=e instanceof pe.Api.WebDocument?e.accessHash.toString():void 0,i=e.attributes.find((e=>e instanceof pe.Api.DocumentAttributeImageSize));return{mediaType:"webDocument",url:t,accessHash:a,size:s,mimeType:n,dimensions:i&&{width:i.w,height:i.h}}}function on(e){const t=e.filter((e=>e instanceof pe.Api.MessageExtendedMedia)).map((e=>Ks(e.media))).filter(Boolean);if(t.length)return t}function rn(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,s){if(s){const{type:t,...n}=s;super(e,{type:t}),rn(this,"name",void 0),Object.assign(this,n)}else super(e),rn(this,"name",void 0);this.name=t}});const cn=e=>`#${e.toString(16).padStart(6,"0")}`;function dn(e){const{recentReactions:t,results:s,canSeeList:n,reactionsAsTags:a,topReactors:i}=e;return{areTags:a,canSeeList:n,results:s.map(ln).filter(Boolean).sort(un),recentReactions:t?.map(pn).filter(Boolean),topReactors:i?.map(fn).filter(Boolean)}}function un(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 ln(e){const{chosenOrder:t,count:s,reaction:n}=e,a=gn(n,!0);if(a)return{chosenOrder:t,count:s,reaction:a}}function fn(e){const{count:t,my:s,top:n,anonymous:a,peerId:i}=e;return{peerId:i&&ye(i),count:t,isMe:s,isTop:n,isAnonymous:a}}function pn(e){const{peerId:t,reaction:s,big:n,unread:a,date:i,my:o}=e,r=gn(s);if(r)return{peerId:ye(t),reaction:r,addedDate:i,isUnread:a,isBig:n,isOwn:o}}function gn(e,t){return e instanceof pe.Api.ReactionEmoji?{type:"emoji",emoticon:e.emoticon}:e instanceof pe.Api.ReactionCustomEmoji?{type:"custom",documentId:e.documentId.toString()}:t&&e instanceof pe.Api.ReactionPaid?{type:"paid"}:void 0}function hn(e){const{reaction:t,title:s,count:n}=e,a=gn(t);if(a)return{reaction:a,title:s,count:n}}function mn(e){const{selectAnimation:t,staticIcon:s,reaction:n,title:a,appearAnimation:i,inactive:o,aroundAnimation:r,centerIcon:c,effectAnimation:d,activateAnimation:u,premium:l}=e;return{selectAnimation:Qs(t),appearAnimation:Qs(i),activateAnimation:Qs(u),effectAnimation:Qs(d),staticIcon:Qs(s),aroundAnimation:r?Qs(r):void 0,centerIcon:c?Qs(c):void 0,reaction:{type:"emoji",emoticon:n},title:a,isInactive:o,isPremium:l}}function yn(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 _n(e,t=!1){const s=Boolean("min"in e&&e.min),n="accessHash"in e?String(e.accessHash):void 0,a="photo"in e&&e.photo&&"hasVideo"in e.photo&&e.photo.hasVideo,i="photo"in e&&e.photo?Ns(e.photo):void 0,o=Boolean("signatures"in e&&e.signatures),r=Boolean("hasLink"in e&&e.hasLink),c=Boolean("scam"in e&&e.scam),d=Boolean("fake"in e&&e.fake),u=Boolean("joinToSend"in e&&e.joinToSend),l=Boolean("joinRequest"in e&&e.joinRequest),f=Ds(e),p=Boolean("forum"in e&&e.forum),g=Boolean("storiesHidden"in e&&e.storiesHidden),h="storiesMaxId"in e?e.storiesMaxId:void 0,m="botVerificationIcon"in e?e.botVerificationIcon?.toString():void 0,y=Boolean("storiesUnavailable"in e&&e.storiesUnavailable),_="color"in e&&e.color?_e(e.color):void 0,b="emojiStatus"in e&&e.emojiStatus?be(e.emojiStatus):void 0,w="level"in e?e.level:void 0,S=Boolean("signatureProfiles"in e&&e.signatureProfiles),v="subscriptionUntilDate"in e?e.subscriptionUntilDate:void 0;return{isMin:s,hasPrivateLink:r,areSignaturesShown:o,areProfilesShown:S,usernames:f,accessHash:n,hasVideoAvatar:a,avatarPhotoId:i,..."verified"in e&&{isVerified:e.verified},..."callActive"in e&&{isCallActive:e.callActive},..."callNotEmpty"in e&&{isCallNotEmpty:e.callNotEmpty},..."date"in e&&{creationDate:e.date},..."participantsCount"in e&&void 0!==e.participantsCount&&{membersCount:e.participantsCount},..."noforwards"in e&&{isProtected:Boolean(e.noforwards)},isSupport:t||void 0,...wn(e),..."creator"in e&&{isCreator:e.creator},...Sn(e),...vn(e),fakeType:c?"scam":d?"fake":void 0,color:_,isJoinToSend:u,isJoinRequest:l,isForum:p,areStoriesHidden:g,maxStoryId:h,hasStories:Boolean(h)&&!y,emojiStatus:b,boostLevel:w,botVerificationIconId:m,subscriptionUntil:v}}function bn(e,t){const{peer:s,folderId:n,unreadMark:a,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,notifySettings:{silent:c,muteUntil:d},readOutboxMaxId:u,readInboxMaxId:l,draft:f,viewForumAsMessages:p}=e,g=c||"number"==typeof d&&kt()<d;return{id:ye(s),...n&&{folderId:n},type:An(t),title:Cn(s,t),lastReadOutboxMessageId:u,lastReadInboxMessageId:l,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,isMuted:g,muteUntil:d,...a&&{hasUnreadMark:!0},...f instanceof pe.Api.DraftMessage&&{draftDate:f.date},...p&&{isForumAsMessages:!0},..._n(t)}}function wn(e){return e instanceof pe.Api.Chat||e instanceof pe.Api.Channel?{adminRights:e.adminRights?Ae(e.adminRights):void 0,currentUserBannedRights:"bannedRights"in e&&e.bannedRights?Ae(e.bannedRights):void 0,defaultBannedRights:e.defaultBannedRights?Ae(e.defaultBannedRights):void 0}:{}}function Sn(e){if(e instanceof pe.Api.ChatForbidden)return{isForbidden:!0};if(e instanceof pe.Api.ChannelForbidden)return{isRestricted:!0};const t={};if("restricted"in e){const s=e.restricted?function(e){if(!e)return;const t=e.find((({platform:e})=>"all"===e));return t?St(t,["reason","text"]):void 0}(e.restrictionReason):void 0;s&&Object.assign(t,{isRestricted:!0,restrictionReason:s})}return e instanceof pe.Api.Chat&&Object.assign(t,{isNotJoined:e.left}),e instanceof pe.Api.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function vn(e){return!("migratedTo"in e)||!e.migratedTo||e.migratedTo instanceof pe.Api.InputChannelEmpty?{}:{migratedTo:{chatId:ye(e.migratedTo),...e.migratedTo instanceof pe.Api.InputChannel&&{accessHash:String(e.migratedTo.accessHash)}}}}function In(e,t=!1){if(!(e instanceof pe.Api.ChatEmpty||e instanceof pe.Api.UserEmpty))return{id:me(e.id,e instanceof pe.Api.User?"user":e instanceof pe.Api.Chat||e instanceof pe.Api.ChatForbidden?"chat":"channel"),type:An(e),title:e instanceof pe.Api.User?Mn(e):e.title,..._n(e,t)}}function An(e){return e instanceof pe.Api.User||e instanceof pe.Api.UserEmpty?"chatTypePrivate":e instanceof pe.Api.Chat||e instanceof pe.Api.ChatForbidden||e instanceof pe.Api.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function Pn(e){return ge(e)?`user${e.userId}`:he(e)?`chat${e.chatId}`:`chat${e.channelId}`}function Cn(e,t){return ge(e)?Mn(t):t.title}function Mn(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||""}function Rn(e){return{userId:e instanceof pe.Api.ChannelParticipantBanned||e instanceof pe.Api.ChannelParticipantLeft?ye(e.peer):me(e.userId,"user"),inviterId:"inviterId"in e&&e.inviterId?me(e.inviterId,"user"):void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e&&e.kickedBy?me(e.kickedBy,"user"):void 0,promotedByUserId:"promotedBy"in e&&e.promotedBy?me(e.promotedBy,"user"):void 0,bannedRights:"bannedRights"in e?Ae(e.bannedRights):void 0,adminRights:"adminRights"in e?Ae(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,isViaRequest:"viaRequest"in e?e.viaRequest:void 0,...(e instanceof pe.Api.ChannelParticipantAdmin||e instanceof pe.Api.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof pe.Api.ChannelParticipantCreator||e instanceof pe.Api.ChatParticipantCreator)&&{isOwner:!0}}}function kn(e){return e instanceof pe.Api.ChatParticipants||e instanceof pe.Api.channels.ChannelParticipants?e.participants.map(Rn).filter(Boolean):void 0}function Tn(e){let t,s="";if(!(e.action instanceof pe.Api.SendMessageCancelAction)){if(e.action instanceof pe.Api.SendMessageTypingAction)s="lng_user_typing";else if(e.action instanceof pe.Api.SendMessageRecordVideoAction)s="lng_send_action_record_video";else if(e.action instanceof pe.Api.SendMessageUploadVideoAction)s="lng_send_action_upload_video";else if(e.action instanceof pe.Api.SendMessageRecordAudioAction)s="lng_send_action_record_audio";else if(e.action instanceof pe.Api.SendMessageUploadAudioAction)s="lng_send_action_upload_audio";else if(e.action instanceof pe.Api.SendMessageUploadPhotoAction)s="lng_send_action_upload_photo";else if(e.action instanceof pe.Api.SendMessageUploadDocumentAction)s="lng_send_action_upload_file";else if(e.action instanceof pe.Api.SendMessageGeoLocationAction)s="selecting a location to share";else if(e.action instanceof pe.Api.SendMessageChooseContactAction)s="selecting a contact to share";else if(e.action instanceof pe.Api.SendMessageGamePlayAction)s="lng_playing_game";else if(e.action instanceof pe.Api.SendMessageRecordRoundAction)s="lng_send_action_record_round";else if(e.action instanceof pe.Api.SendMessageUploadRoundAction)s="lng_send_action_upload_round";else if(e.action instanceof pe.Api.SendMessageChooseStickerAction)s="lng_send_action_choose_sticker";else{if(e.action instanceof pe.Api.SpeakingInGroupCallAction)return;if(e.action instanceof pe.Api.SendMessageEmojiInteractionSeen)s="lng_user_action_watching_animations",t=e.action.emoticon;else if(e.action instanceof pe.Api.SendMessageEmojiInteraction)return}return{action:s,...t&&{emoji:t},...!(e instanceof pe.Api.UpdateUserTyping)&&{userId:ye(e.fromId)},timestamp:Date.now()+1e3*Rt()}}}function En(e){return e instanceof pe.Api.DialogFilterChatlist?{...vt(e,["id","emoticon"]),excludedChatIds:[],includedChatIds:e.includePeers.map(ye).filter(Boolean),pinnedChatIds:e.pinnedPeers.map(ye).filter(Boolean),hasMyInvites:e.hasMyInvites,isChatList:!0,noTitleAnimations:e.titleNoanimate,title:xs(e.title)}:{...vt(e,["id","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"]),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(ye).filter(Boolean),includedChatIds:e.includePeers.map(ye).filter(Boolean),excludedChatIds:e.excludePeers.map(ye).filter(Boolean),title:xs(e.title),noTitleAnimations:e.titleNoanimate}}function Bn({filter:e,description:t}){if(e instanceof pe.Api.DialogFilter||e instanceof pe.Api.DialogFilterChatlist)return{...En(e),description:t}}function Dn(e){return e.reduce(((e,t)=>{const s=me(t.userId,"user");return t.commands&&(e=e.concat(t.commands.map((e=>({botId:s,...Ae(e)}))))),e}),[])}function Un(e){const{revoked:t,date:s,expireDate:n,link:a,permanent:i,startDate:o,usage:r,usageLimit:c,requested:d,requestNeeded:u,title:l,adminId:f}=e;return{isRevoked:t,date:s,expireDate:n,link:a,isPermanent:i,startDate:o,usage:r,usageLimit:c,isRequestNeeded:u,requested:d,title:l,adminId:me(f,"user")}}function xn({autoarchived:e,reportSpam:t,addContact:s,blockContact:n}){return{isAutoArchived:Boolean(e),canReportSpam:Boolean(t),canAddContact:Boolean(s),canBlockContact:Boolean(n)}}function Vn(e){return e instanceof pe.Api.ChatReactionsAll?{type:"all",areCustomAllowed:e.allowCustom}:e instanceof pe.Api.ChatReactionsSome?{type:"some",allowed:e.reactions.map((e=>gn(e))).filter(Boolean)}:void 0}function Nn(e){return{id:ye(e.peer),isPremium:e.premiumRequired}}function Fn(e){if(e instanceof pe.Api.ForumTopicDeleted)return;const{id:t,my:s,closed:n,pinned:a,hidden:i,short:o,date:r,title:c,iconColor:d,iconEmojiId:u,topMessage:l,unreadCount:f,unreadMentionsCount:p,unreadReactionsCount:g,fromId:h,notifySettings:{silent:m,muteUntil:y}}=e;return{id:t,isClosed:n,isPinned:a,isHidden:i,isOwner:s,isMin:o,date:r,title:c,iconColor:d,iconEmojiId:u?.toString(),lastMessageId:l,unreadCount:f,unreadMentionsCount:p,unreadReactionsCount:g,fromId:ye(h),isMuted:m||("number"==typeof y?kt()<y:void 0),muteUntil:y}}function Gn(e){if(!(e instanceof pe.Api.ExportedChatlistInvite))return;const{title:t,url:s,peers:n}=e;return{title:t,url:s,peerIds:n.map(ye).filter(Boolean)}}function qn(e){return{id:e.userId.toString(),isRequiringPremiumToMessage:e.premiumRequiredForPm,isRequiringPremiumToInvite:e.premiumWouldAllowInvite}}function Hn(e){const{color:t,participants:s,participantsCount:n,photo:a,title:i,about:o,scam:r,fake:c,verified:d,megagroup:u,channel:l,broadcast:f,requestNeeded:p,subscriptionFormId:g,subscriptionPricing:h,canRefulfillSubscription:m,botVerification:y}=e;let _;return a instanceof pe.Api.Photo&&(je(a),_=ks(a)),s?.forEach($e),{title:i,about:o,isFake:c,isScam:r,isVerified:d,isSuperGroup:u,isPublic:e.public,participantsCount:n,color:t,isChannel:l,isBroadcast:f,isRequestNeeded:p,photo:_,subscriptionFormId:g?.toString(),subscriptionPricing:h&&On(h),canRefulfillSubscription:m,participantIds:s?.map((e=>me(e.id,"user"))).filter(Boolean),botVerification:y&&Fs(y)}}function On(e){return{period:e.period,amount:e.amount.toJSNumber()}}const Ln=10**9;function jn(e){return e instanceof pe.Api.PostInteractionCountersMessage?{msgId:e.msgId,forwardsCount:e.forwards,viewsCount:e.views,reactionsCount:e.reactions}:e instanceof pe.Api.PostInteractionCountersStory?{storyId:e.storyId,reactionsCount:e.reactions,viewsCount:e.views,forwardsCount:e.forwards}:void 0}function Wn(e){return{viewsGraph:$n(e.viewsGraph),reactionsGraph:$n(e.reactionsByEmotionGraph)}}function zn(e){if(e&&"messages"in e)return e.messages.map((t=>Yn(t,e.chats)))}function Kn(e){if(e&&"forwards"in e)return e.forwards.map((t=>{if(t instanceof pe.Api.PublicForwardMessage)return Yn(t.message,e.chats);const{peer:s,story:n}=t;return{peerId:ye(s),storyId:n.id,viewsCount:n.views?.viewsCount||0,reactionsCount:n.views?.reactionsCount||0}}))}function $n(e,t,s,n){if(e.error)return;const a=JSON.parse(e.json.data),[i,...o]=a.columns,r=a.y_scaled;return{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})),...Jn(a.subchart.defaultZoom,i.slice(1))}}function Jn(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 Qn({current:e,previous:t}){const s=e-t;return{current:e,change:s,...t&&{percentage:(s?Math.abs(s)/t*100:0).toFixed(2)}}}function Xn(e){return{part:e.part,total:e.total,percentage:(e.part/e.total*100).toFixed(2)}}function Yn(e,t){const s=ye(e.peerId),n=t.find((e=>me(e.id,"channel")===s)),a=n&&"photo"in n&&n.photo instanceof pe.Api.Photo?n.photo:void 0;return{messageId:e.id,views:e.views,title:n.title,chat:{id:s,type:"chatTypeChannel",title:n.title,usernames:Ds(n),avatarPhotoId:a&&Ns(a),hasVideoAvatar:Boolean(a?.videoSizes)}}}function Zn({currentBalance:e,availableBalance:t,overallRevenue:s,withdrawalEnabled:n}){return{currentBalance:Number(e)/Ln,availableBalance:Number(t)/Ln,overallRevenue:Number(s)/Ln,isWithdrawalEnabled:n}}function ea(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((({label:e,amount:t})=>({label:e,amount:t.toJSNumber()})))})))}function ta(e){const{photo:t}=e;if(t&&Je(t),e instanceof pe.Api.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:me(s,"user"),description:i,title:o,totalAmount:-r.toJSNumber(),transactionId:c,photo:an(t),invoice:sa(d)}}const{invoice:s,info:n,shipping:a,totalAmount:i,credentialsTitle:o,tipAmount:r,title:c,description:d,botId:u,currency:l,date:f,providerId:p}=e,{shippingAddress:g,phone:h,name:m}=n||{};let y,_;return a&&(y=a.prices.map((({label:e,amount:t})=>({label:e,amount:t.toJSNumber()}))),_=a.title),{type:"regular",info:{shippingAddress:g,phone:h,name:m},totalAmount:i.toJSNumber(),currency:l,date:f,credentialsTitle:o,shippingPrices:y,shippingMethod:_,tipAmount:r?r.toJSNumber():0,title:c,description:d,botId:me(u,"user"),providerId:p.toString(),photo:t&&an(t),invoice:sa(s)}}function sa(e){const{test:t,currency:s,prices:n,recurring:a,termsUrl:i,maxTipAmount:o,suggestedTipAmounts:r,emailRequested:c,emailToProvider:d,nameRequested:u,phoneRequested:l,phoneToProvider:f,shippingAddressRequested:p,flexible:g,subscriptionPeriod:h}=e,m=n.map((({label:e,amount:t})=>({label:e,amount:t.toJSNumber()})));return{totalAmount:n.reduce(((e,t)=>e.add(t.amount)),Se()(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:u,isPhoneRequested:l,isPhoneSentToProvider:f,isShippingAddressRequested:p,isFlexible:g,subscriptionPeriod:h}}function na(e){const{statusText:t,statusEntities:s,videos:n,videoSections:a,periodOptions:i}=e;return{statusText:t,statusEntities:s.map(Vs),videoSections:a,videos:n.map(Qs).filter(Boolean),options:i.map(aa)}}function aa(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 ia(e){const{userId:t,multiplier:s,expires:n,giveaway:a,gift:i,stars:o}=e;return{userId:t&&me(t,"user"),multiplier:s,expires:n,isFromGiveaway:a,isGift:i,stars:o?.toJSNumber()}}function oa(e){const{date:t,expires:s,slot:n,cooldownUntilDate:a,peer:i}=e;return{date:t,expires:s,slot:n,cooldownUntil:a,chatId:i&&ye(i)}}function ra(e){const{date:t,fromId:s,months:n,giveawayMsgId:a,toId:i,usedDate:o,viaGiveaway:r}=e;return{date:t,months:n,toId:i&&me(i,"user"),fromId:s&&ye(s),usedAt:o,isFromGiveaway:r,giveawayMessageId:a}}function ca(e){const{amount:t,currency:s,months:n,users:a}=e;return{amount:t.toJSNumber(),currency:s,months:n,users:a}}function da(e){const{extended:t,stars:s,amount:n,currency:a}=e;return{isExtended:t,stars:s.toJSNumber(),amount:n.toJSNumber(),currency:a}}function ua(e){return{amount:e.amount.toJSNumber(),nanos:e.nanos}}function la(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 fa(e){return e instanceof pe.Api.StarsTransactionPeerAppStore?{type:"appStore"}:e instanceof pe.Api.StarsTransactionPeerPlayMarket?{type:"playMarket"}:e instanceof pe.Api.StarsTransactionPeerPremiumBot?{type:"premiumBot"}:e instanceof pe.Api.StarsTransactionPeerFragment?{type:"fragment"}:e instanceof pe.Api.StarsTransactionPeerAds?{type:"ads"}:e instanceof pe.Api.StarsTransactionPeerAPI?{type:"api"}:e instanceof pe.Api.StarsTransactionPeer?{type:"peer",id:ye(e.peer)}:{type:"unsupported"}}function pa(e){const{date:t,id:s,peer:n,stars:a,description:i,photo:o,title:r,refund:c,extendedMedia:d,failed:u,msgId:l,pending:f,gift:p,reaction:g,subscriptionPeriod:h,stargift:m,giveawayPostId:y,starrefCommissionPermille:_,stargiftUpgrade:b}=e;o&&Je(o);const w=d?.map((e=>Ks(e))).filter(Boolean),S=_?_/10:void 0;return{id:s,date:t,peer:fa(n),stars:ua(a),title:r,description:i,photo:o&&an(o),isRefund:c,hasFailed:u,isPending:f,messageId:l,isGift:p,extendedMedia:w,subscriptionPeriod:h,isReaction:g,starGift:m&&ma(m),giveawayPostId:y,starRefCommision:S,isGiftUpgrade:b}}function ga(e){const{id:t,peer:s,pricing:n,untilDate:a,canRefulfill:i,canceled:o,chatInviteHash:r,missingBalance:c,botCanceled:d,photo:u,title:l,invoiceSlug:f}=e;return u&&Je(u),{id:t,peerId:ye(s),until:a,pricing:On(n),isCancelled:o,canRefulfill:i,hasMissingBalance:c,chatInviteHash:r,hasBotCancelled:d,title:l,photo:u&&an(u),invoiceSlug:f}}function ha(e){const{amount:t,currency:s,stars:n,extended:a}=e;return{amount:t.toJSNumber(),currency:s,stars:n.toJSNumber(),isExtended:a}}function ma(e){if(e instanceof pe.Api.StarGiftUnique){const{id:t,num:s,ownerId:n,title:a,attributes:i,availabilityIssued:o,availabilityTotal:r}=e;return{type:"starGiftUnique",id:t.toString(),number:s,ownerId:me(n,"user"),attributes:i.map(ya).filter(Boolean),title:a,totalCount:r,issuedCount:o}}const{id:t,limited:s,stars:n,availabilityRemains:a,availabilityTotal:i,convertStars:o,firstSaleDate:r,lastSaleDate:c,soldOut:d,birthday:u,upgradeStars:l}=e;We(e.sticker);const f=qs(e.sticker);return{type:"starGift",id:t.toString(),isLimited:s,sticker:f,stars:n.toJSNumber(),availabilityRemains:a,availabilityTotal:i,starsToConvert:o.toJSNumber(),firstSaleDate:r,lastSaleDate:c,isSoldOut:d,isBirthday:u,upgradeStars:l?.toJSNumber()}}function ya(e){if(e instanceof pe.Api.StarGiftAttributeModel){const t=qs(e.document);if(!t)return;return We(e.document),{type:"model",name:e.name,rarityPercent:e.rarityPermille/10,sticker:t}}if(e instanceof pe.Api.StarGiftAttributePattern){const t=qs(e.document);if(!t)return;return We(e.document),{type:"pattern",name:e.name,rarityPercent:e.rarityPermille/10,sticker:t}}if(e instanceof pe.Api.StarGiftAttributeBackdrop){const{name:t,rarityPermille:s,centerColor:n,edgeColor:a,patternColor:i,textColor:o}=e;return{type:"backdrop",name:t,rarityPercent:s/10,centerColor:cn(n),edgeColor:cn(a),patternColor:cn(i),textColor:cn(o)}}if(e instanceof pe.Api.StarGiftAttributeOriginalDetails){const{date:t,recipientId:s,message:n,senderId:a}=e;return{type:"originalDetails",date:t,recipientId:s&&me(s,"user"),message:n&&xs(n),senderId:a&&me(a,"user")}}}function _a(e){const{gift:t,date:s,convertStars:n,fromId:a,message:i,msgId:o,nameHidden:r,unsaved:c}=e;return{gift:ma(t),date:s,starsToConvert:n?.toJSNumber(),fromId:a&&me(a,"user"),message:i&&xs(i),messageId:o,isNameHidden:r,isUnsaved:c}}const ba=1e6,wa="temp",Sa=63,va=10;let Ia,Aa=0;function Pa(e=0){return e+ ++Aa/ba}function Ca(e){const t=Ge(e);if(t&&(e instanceof pe.Api.Message||e instanceof pe.Api.MessageService))return Ma(t,e)}function Ma(e,t){const s=t.fromId?ye(t.fromId):void 0,n=t.peerId?ye(t.peerId):void 0,a=!s&&e===Ia,i=t.fwdFrom&&ka(t.fwdFrom,a),o=Boolean(!i||i.fromId===Ia||i.isSavedOutgoing),r=a?o:Boolean(t.out&&!t.post),c=Ws(t),d=t.action&&function(e,t,s,n,a){if(e instanceof pe.Api.MessageActionEmpty)return;let i,o,r,c,d,u,l,f;const p=[];let g,h,m,y,_,b,w,S,v,I,A,P,C="other",M="users"in e?e.users&&e.users.map((e=>me(e,"user"))):"userId"in e&&[me(e.userId,"user")]||[];if(e instanceof pe.Api.MessageActionChatCreate)f="Notification.CreatedChatWithTitle",p.push("%action_origin%",e.title),C="chatCreate";else if(e instanceof pe.Api.MessageActionChatEditTitle)n?(f="Channel.MessageTitleUpdated",p.push(e.title)):(f="Notification.ChangedGroupName",p.push("%action_origin%",e.title));else if(e instanceof pe.Api.MessageActionChatEditPhoto)n?f="Channel.MessagePhotoUpdated":(f="Notification.ChangedGroupPhoto",p.push("%action_origin%")),C="updateProfilePhoto";else if(e instanceof pe.Api.MessageActionChatDeletePhoto)f=n?"Channel.MessagePhotoRemoved":"Group.MessagePhotoRemoved";else if(e instanceof pe.Api.MessageActionChatAddUser)!t||M.includes(t)?(f="Notification.JoinedChat",p.push("%target_user%")):(f="Notification.Invited",p.push("%action_origin%","%target_user%"));else if(e instanceof pe.Api.MessageActionChatDeleteUser)!t||M.includes(t)?(f="Notification.LeftChat",p.push("%target_user%")):(f="Notification.Kicked",p.push("%action_origin%","%target_user%"));else if(e instanceof pe.Api.MessageActionChatJoinedByLink)f="Notification.JoinedGroupByLink",p.push("%action_origin%");else if(e instanceof pe.Api.MessageActionChannelCreate)f="Notification.CreatedChannel";else if(e instanceof pe.Api.MessageActionChatMigrateTo)P=ye(e),f="Migrated to %target_chat%",p.push("%target_chat%");else if(e instanceof pe.Api.MessageActionChannelMigrateFrom)P=ye(e),f="Migrated from %target_chat%",p.push("%target_chat%");else if(e instanceof pe.Api.MessageActionPinMessage)f="Chat.Service.Group.UpdatedPinnedMessage1",p.push("%action_origin%","%message%");else if(e instanceof pe.Api.MessageActionHistoryClear)f="HistoryCleared",C="historyClear";else if(e instanceof pe.Api.MessageActionPhoneCall){const t=Boolean(e.duration);if(f=[t?"ChatList.Service":"Chat",e.video?"VideoCall":"Call",a?t?"outgoing":"Outgoing":t?"incoming":"Incoming"].join("."),t){const t=Math.max(Math.round(e.duration/60),1);p.push(`${t} min${t>1?"s":""}`)}i={isOutgoing:a,isVideo:e.video,duration:e.duration,reason:_s(e.reason)}}else if(e instanceof pe.Api.MessageActionInviteToGroupCall)f="Notification.VoiceChatInvitation",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()},p.push("%action_origin%","%target_user%");else if(e instanceof pe.Api.MessageActionContactSignUp)f="Notification.Joined",p.push("%action_origin%"),C="contactSignUp";else if(e instanceof pe.Api.MessageActionPaymentSent)r=Number(e.totalAmount),u=e.currency,f="PaymentSuccessfullyPaid",C="receipt",s&&M.push(s),p.push("%payment_amount%","%target_user%","%product%");else if(e instanceof pe.Api.MessageActionGroupCall)if(e.duration){const t=Math.max(Math.round(e.duration/60),1);f="Notification.VoiceChatEnded",p.push(`${t} min${t>1?"s":""}`)}else f="Notification.VoiceChatStartedChannel",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()};else if(e instanceof pe.Api.MessageActionBotAllowed)e.domain?(f="ActionBotAllowed",p.push(e.domain)):f=e.fromRequest?"lng_action_webapp_bot_allowed":"ActionAttachMenuBotAllowed";else if(e instanceof pe.Api.MessageActionCustomAction)f=e.message;else if(e instanceof pe.Api.MessageActionChatJoinedByRequest)f="ChatService.UserJoinedGroupByRequest",p.push("%action_origin%");else if(e instanceof pe.Api.MessageActionGameScore)f=t===Ia?"ActionYouScoredInGame":"ActionUserScoredInGame",p.push("%score%"),h=e.score;else if(e instanceof pe.Api.MessageActionWebViewDataSent)f="Notification.WebAppSentData",p.push(e.text);else if(e instanceof pe.Api.MessageActionGiftPremium)C="giftPremium",f=a?"ActionGiftOutbound":"ActionGiftInbound",a?p.push("%gift_payment_amount%"):p.push("%action_origin%","%gift_payment_amount%"),e.message&&(A=xs(e.message)),s&&M.push(s),u=e.currency,e.cryptoCurrency&&(l={currency:e.cryptoCurrency,amount:e.cryptoAmount.toJSNumber()}),r=e.amount.toJSNumber(),m=e.months;else if(e instanceof pe.Api.MessageActionTopicCreate)f="TopicWasCreatedAction",C="topicCreate",p.push(e.title);else if(e instanceof pe.Api.MessageActionTopicEdit)void 0!==e.closed?(f=e.closed?"TopicWasClosedAction":"TopicWasReopenedAction",p.push("%action_origin%","%action_topic%")):void 0!==e.hidden?f=e.hidden?"TopicHidden2":"TopicShown":e.title?(f="TopicRenamedTo",p.push("%action_origin%",e.title)):e.iconEmojiId?(f="TopicWasIconChangedToAction",p.push("%action_origin%","%action_topic_icon%"),y=e.iconEmojiId.toString()):f="ChatList.UnsupportedMessage",_=!0;else if(e instanceof pe.Api.MessageActionSuggestProfilePhoto){const n=e.photo instanceof pe.Api.Photo&&e.photo.videoSizes?.length;f=t===Ia?n?"ActionSuggestVideoFromYouDescription":"ActionSuggestPhotoFromYouDescription":n?"ActionSuggestVideoToYouDescription":"ActionSuggestPhotoToYouDescription",C="suggestProfilePhoto",p.push("%target_user%"),s&&M.push(s)}else e instanceof pe.Api.MessageActionGiveawayLaunch?(f="BoostingGiveawayJustStarted",p.push("%action_origin%")):e instanceof pe.Api.MessageActionGiftCode?(C="giftCode",f=a?"ActionGiftOutbound":"BoostingReceivedGiftNoName",b=e.slug,m=e.months,r=e.amount?.toJSNumber(),w=Boolean(e.viaGiveaway),S=Boolean(e.unclaimed),a&&p.push("%gift_payment_amount%"),e.message&&(A=xs(e.message)),u=e.currency,e.cryptoCurrency&&(l={currency:e.cryptoCurrency,amount:e.cryptoAmount.toJSNumber()}),e.boostPeer&&(P=ye(e.boostPeer)),s&&M.push(s)):e instanceof pe.Api.MessageActionGiveawayResults?e.winnersCount?e.unclaimedCount?f="lng_action_giveaway_results_some":(f="BoostingGiveawayServiceWinnersSelected",p.push("%amount%"),r=e.winnersCount,v=e.winnersCount):f="lng_action_giveaway_results_none":e instanceof pe.Api.MessageActionPrizeStars?(C="prizeStars",S=Boolean(e.unclaimed),e.boostPeer&&(P=ye(e.boostPeer)),f="Notification.StarsPrize",c=e.stars.toJSNumber(),I=e.transactionId):e instanceof pe.Api.MessageActionBoostApply?(C="chatBoost",1===e.boosts?(f=t===Ia?"BoostingBoostsGroupByYouServiceMsg":"BoostingBoostsGroupByUserServiceMsg",p.push("%action_origin%")):(f=t===Ia?"BoostingBoostsGroupByYouServiceMsgCount":"BoostingBoostsGroupByUserServiceMsgCount",p.push(e.boosts.toString()),t!==Ia&&p.unshift("%action_origin%"),v=e.boosts)):e instanceof pe.Api.MessageActionPaymentRefunded?(f="ActionRefunded",r=Number(e.totalAmount),u=e.currency):e instanceof pe.Api.MessageActionRequestedPeer?(f="ActionRequestedPeer",e.peers&&(M=e.peers?.map((e=>ye(e)))),s&&p.unshift("%action_origin%")):e instanceof pe.Api.MessageActionGiftStars?(C="giftStars",f=a?"ActionGiftOutbound":s?"ActionGiftInbound":"BoostingReceivedGiftNoName",a?p.push("%gift_payment_amount%"):p.push("%action_origin%","%gift_payment_amount%"),s&&(M.push(s),P=s),e.cryptoCurrency&&(l={currency:e.cryptoCurrency,amount:e.cryptoAmount.toJSNumber()}),u=e.currency,r=e.amount.toJSNumber(),c=e.stars.toJSNumber(),I=e.transactionId):e instanceof pe.Api.MessageActionStarGift&&e.gift instanceof pe.Api.StarGift?(C="starGift",d=function(e){const{nameHidden:t,saved:s,converted:n,gift:a,message:i,convertStars:o}=e;return{isNameHidden:Boolean(t),isSaved:Boolean(s),isConverted:Boolean(n),gift:ma(a),message:i&&xs(i),starsToConvert:o?.toJSNumber()}}(e),a?(f="ActionGiftOutbound",p.push("%gift_payment_amount%")):(f="ActionGiftInbound",p.push("%action_origin%","%gift_payment_amount%")),s&&(M.push(s),P=s),r=e.gift.stars.toJSNumber(),u=E):e instanceof pe.Api.MessageActionStarGiftUnique&&e.gift instanceof pe.Api.StarGiftUnique?(C="starGiftUnique",f=a?"Notification.StarsGift.UpgradeYou":"Notification.StarsGift.Upgrade",d=function(e){const{gift:t,canExportAt:s,refunded:n,saved:a,transferStars:i,transferred:o,upgrade:r}=e;return{gift:ma(t),canExportAt:s,isRefunded:n,isSaved:a,transferStars:i?.toJSNumber(),isTransferred:o,isUpgrade:r}}(e),s&&(M.push(s),P=s)):f="ChatList.UnsupportedMessage";return"photo"in e&&e.photo instanceof pe.Api.Photo&&(je(e.photo),g=ks(e.photo)),{mediaType:"action",text:f,type:C,targetUserIds:M,targetChatId:P,photo:g,amount:r,stars:c,starGift:d,currency:u,giftCryptoInfo:l,isGiveaway:w,slug:b,translationValues:p,call:o,phoneCall:i,score:h,months:m,topicEmojiIconId:y,isTopicAction:_,isUnclaimed:S,pluralValue:v,transactionId:I,message:A}}(t.action,s,n,Boolean(t.post),r);d&&(c.action=d);const u=t.date>kt()+va,l=t.media instanceof pe.Api.MessageMediaInvoice&&Boolean(t.media.extendedMedia),f=Boolean(t.editDate)&&!t.editHide,{inlineButtons:p,keyboardButtons:g,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:y}=function(e,t){const{replyMarkup:s,media:n}=e;if(!(s instanceof pe.Api.ReplyKeyboardMarkup||s instanceof pe.Api.ReplyInlineMarkup))return;const a=s.rows.map((({buttons:e})=>e.map((e=>{const{text:s}=e;if(e instanceof pe.Api.KeyboardButton)return{type:"command",text:s};if(e instanceof pe.Api.KeyboardButtonUrl)return e.url.includes("?startgroup=")?{type:"unsupported",text:s}:{type:"url",text:s,url:e.url};if(e instanceof pe.Api.KeyboardButtonCallback)return e.requiresPassword?{type:"unsupported",text:s}:{type:"callback",text:s,data:Qe(e.data)};if(e instanceof pe.Api.KeyboardButtonRequestPoll)return{type:"requestPoll",text:s,isQuiz:e.quiz};if(e instanceof pe.Api.KeyboardButtonRequestPhone)return{type:"requestPhone",text:s};if(e instanceof pe.Api.KeyboardButtonBuy){if(n instanceof pe.Api.MessageMediaInvoice&&n.receiptMsgId)return{type:"receipt",receiptMessageId:n.receiptMsgId};if(t)return;return{type:"buy",text:s}}return e instanceof pe.Api.KeyboardButtonGame?{type:"game",text:s}:e instanceof pe.Api.KeyboardButtonSwitchInline?{type:"switchBotInline",text:s,query:e.query,isSamePeer:e.samePeer}:e instanceof pe.Api.KeyboardButtonUserProfile?{type:"userProfile",text:s,userId:e.userId.toString()}:e instanceof pe.Api.KeyboardButtonSimpleWebView?{type:"simpleWebView",text:s,url:e.url}:e instanceof pe.Api.KeyboardButtonWebView?{type:"webView",text:s,url:e.url}:e instanceof pe.Api.KeyboardButtonUrlAuth?{type:"urlAuth",text:s,url:e.url,buttonId:e.buttonId}:e instanceof pe.Api.KeyboardButtonCopy?{type:"copy",text:s,copyText:e.copyText}:{type:"unsupported",text:s}})).filter(Boolean)));return a.every((e=>!e.length))?void 0:{[s instanceof pe.Api.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:a,...s instanceof pe.Api.ReplyKeyboardMarkup&&{keyboardPlaceholder:s.placeholder,isKeyboardSingleUse:s.singleUse,isKeyboardSelective:s.selective}}}(t,l)||{},{mediaUnread:_,postAuthor:b}=t,w=t.groupedId&&String(t.groupedId),S=Boolean(w)&&!(c.document||c.audio||c.sticker),v=t.replyMarkup instanceof pe.Api.ReplyKeyboardHide,I=t.replyMarkup instanceof pe.Api.ReplyKeyboardHide&&t.replyMarkup.selective,A=t.noforwards||l,P=!t.noforwards,C=_t(c,w),M=t.replies?.comments,R=t.fromBoostsApplied,k=t.factcheck&&Ea(t.factcheck),T=t.videoProcessingPending,B=t.reactionsArePossible,D=t.invertMedia,U=t.savedPeerId&&ye(t.savedPeerId);return At({id:t.id,chatId:e,isOutgoing:r,content:c,date:t.date,senderId:s,viewsCount:t.views,forwardsCount:t.forwards,isScheduled:u,isFromScheduled:t.fromScheduled,isSilent:t.silent,isPinned:t.pinned,reactions:t.reactions&&dn(t.reactions),emojiOnlyCount:C,...t.replyTo&&{replyInfo:Ta(t.replyTo,t)},forwardInfo:i,isEdited:f,editDate:t.editDate,isMediaUnread:_,hasUnreadMention:t.mentioned&&_,areReactionsPossible:B,isMentioned:t.mentioned,...w&&{groupedId:w,isInAlbum:S},inlineButtons:p,...g&&{keyboardButtons:g,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:y},...v&&{shouldHideKeyboardButtons:v,isHideKeyboardSelective:I},...t.viaBotId&&{viaBotId:me(t.viaBotId,"user")},postAuthorTitle:b,isProtected:A,isForwardingAllowed:P,hasComments:M,savedPeerId:U,senderBoosts:R,viaBusinessBotId:t.viaBusinessBotId?.toString(),factCheck:k,effectId:t.effect?.toString(),isInvertedMedia:D,isVideoProcessingPending:T})}function Ra(e){if(e instanceof pe.Api.DraftMessageEmpty)return;const{message:t,entities:s,replyTo:n,date:a,effect:i}=e,o=n instanceof pe.Api.InputReplyToMessage?{type:"message",replyToMsgId:n.replyToMsgId,replyToTopId:n.topMsgId,replyToPeerId:n.replyToPeerId&&ye(n.replyToPeerId),quoteText:n.quoteText?zs(n.quoteText,n.quoteEntities):void 0}:void 0;return{text:t?zs(t,s):void 0,replyInfo:o,date:a,effectId:i?.toString()}}function ka(e,t=!1){const s=e.savedFromPeer&&ye(e.savedFromPeer),n=e.fromId&&ye(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 Ta(e,t){if(e instanceof pe.Api.MessageReplyStoryHeader)return{type:"story",peerId:ye(e.peer),storyId:e.storyId};if(e instanceof pe.Api.MessageReplyHeader){const{replyFrom:s,replyToMsgId:n,replyToTopId:a,replyMedia:i,replyToPeerId:o,forumTopic:r,quote:c,quoteText:d,quoteEntities:u}=e;return{type:"message",replyToMsgId:n,replyToTopId:a,isForumTopic:r,replyFrom:s&&ka(s),replyToPeerId:o&&ye(o),replyMedia:i&&Ks(i,t),isQuote:c,quoteText:d?zs(d,u):void 0}}}function Ea(e){return{shouldFetch:e.needCheck,hash:e.hash.toString(),text:e.text&&xs(e.text),countryCode:e.country}}function Ba(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(O.has(a)){const{width:t,height:a}=e.quick;return{photo:{mediaType:"photo",id:wa,sizes:[],thumbnail:{width:t,height:a,dataUri:n||s},blobUrl:s,date:Math.round(Date.now()/1e3),isSpoiler:c}}}if(L.has(a)){const{width:o,height:r,duration:d}=e.quick;return{video:{mediaType:"video",id:wa,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}=Tt(s,Sa);return{voice:{mediaType:"voice",id:wa,duration:t,waveform:n,size:i},ttlSeconds:d}}if(j.has(a)){const{duration:e,performer:s,title:n}=o||{};return{audio:{mediaType:"audio",id:wa,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 Da(e){const t=Ge(e);if(t&&e instanceof pe.Api.Message&&e.replies)return Ua(e.replies,e.id,t)}function Ua(e,t,s){const{channelId:n,replies:a,maxId:i,readMaxId:o,recentRepliers:r,comments:c}=e,d=n?me(n,"channel"):void 0;if(d===ee)return;const u={messagesCount:a,...i&&{lastMessageId:i},...o&&{lastReadMessageId:o},...r&&{recentReplierIds:r.map(ye)}};return c?{...u,isCommentsInfo:!0,chatId:d,originChannelId:s,originMessageId:t}:{...u,isCommentsInfo:!1,chatId:s,threadId:t}}function xa(e){const{shortcutId:t,shortcut:s,topMessage:n}=e;return{id:t,shortcut:s,topMessageId:n}}function Va(e){return e instanceof pe.Api.ReportResultReported?{type:"reported"}:e instanceof pe.Api.ReportResultAddComment?{type:"comment",isOptional:e.optional,option:Qe(e.option)}:{type:"selectOption",title:e.title,options:e.options.map((e=>({text:e.text,option:Qe(e.option)})))}}function Na(e,t){if(t instanceof pe.Api.StoryItemDeleted)return{id:t.id,peerId:e,isDeleted:!0};if(t instanceof pe.Api.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:u,views:l,public:f,noforwards:p,closeFriends:g,contacts:h,selectedContacts:m,mediaAreas:y,sentReaction:_,out:b,fwdFrom:w,fromId:S}=t,v={...Ks(d)};r&&(v.text=zs(r,c));const I=_&&gn(_);return At({id:i,peerId:e,date:o,expireDate:a,content:v,isPublic:f,isEdited:s,isInProfile:n,isForContacts:h,isForSelectedContacts:m,isForCloseFriends:g,noForwards:p,views:l&&Fa(l),isOut:b,visibility:u&&Us(u),mediaAreas:y?.map(Oa).filter(Boolean),sentReaction:I,forwardInfo:w&&La(w),fromId:S&&ye(S)})}function Fa(e){return At({hasViewers:e.hasViewers,viewsCount:e.viewsCount,forwardsCount:e.forwardsCount,reactionsCount:e.reactionsCount,reactions:e.reactions?.map(ln).filter(Boolean),recentViewerIds:e.recentViewers?.map((e=>me(e,"user")))})}function Ga(e){const{blockedMyStoriesFrom:t,blocked:s}=e;if(e instanceof pe.Api.StoryView)return At({type:"user",peerId:me(e.userId,"user"),date:e.date,reaction:e.reaction&&gn(e.reaction),areStoriesBlocked:s||t,isUserBlocked:s});if(e instanceof pe.Api.StoryViewPublicForward){const n=Ca(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 pe.Api.StoryViewPublicRepost){const n=ye(e.peerId),a=Na(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 qa(e){return{activeUntil:e.activeUntilDate,cooldownUntil:e.cooldownUntilDate}}function Ha(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}}function Oa(e){if(e instanceof pe.Api.MediaAreaVenue){const{geo:t,title:s,coordinates:n}=e,a=Ys(t);if(!a)return;return{type:"venue",coordinates:Ha(n),geo:a,title:s}}if(e instanceof pe.Api.MediaAreaGeoPoint){const{geo:t,coordinates:s}=e,n=Ys(t);if(!n)return;return{type:"geoPoint",coordinates:Ha(s),geo:n}}if(e instanceof pe.Api.MediaAreaSuggestedReaction){const{coordinates:t,reaction:s,dark:n,flipped:a}=e,i=gn(s);if(!i)return;return{type:"suggestedReaction",coordinates:Ha(t),reaction:i,...n&&{isDark:!0},...a&&{isFlipped:!0}}}if(e instanceof pe.Api.MediaAreaChannelPost){const{coordinates:t,channelId:s,msgId:n}=e;return{type:"channelPost",coordinates:Ha(t),channelId:me(s,"channel"),messageId:n}}if(e instanceof pe.Api.MediaAreaUrl){const{coordinates:t,url:s}=e;return{type:"url",coordinates:Ha(t),url:s}}if(e instanceof pe.Api.MediaAreaWeather){const{coordinates:t,emoji:s,temperatureC:n,color:a}=e;return{type:"weather",coordinates:Ha(t),emoji:s,temperatureC:n,color:a}}}function La(e){const{from:t,fromName:s,storyId:n,modified:a}=e;return{storyId:n,fromPeerId:t&&ye(t),fromName:s,isModified:a}}function ja(e){return{id:e.botId.toString(),shouldRequestWriteAccess:e.requestWriteAccess,shortName:e.shortName,isForAttachMenu:e.showInAttachMenu,isForSideMenu:e.showInSideMenu,attachMenuPeerTypes:e.peerTypes?.map(Wa),icons:e.icons.map(za).filter(Boolean),isInactive:e.inactive,isDisclaimerNeeded:e.sideMenuDisclaimerNeeded}}function Wa(e){return e instanceof pe.Api.AttachMenuPeerTypeBotPM?"bots":e instanceof pe.Api.AttachMenuPeerTypePM?"users":e instanceof pe.Api.AttachMenuPeerTypeChat?"chats":e instanceof pe.Api.AttachMenuPeerTypeBroadcast?"channels":e instanceof pe.Api.AttachMenuPeerTypeSameBotPM?"self":void 0}function za(e){if(!(e.icon instanceof pe.Api.Document))return;const t=Qs(e.icon);return t?(We(e.icon),{name:e.name,document:t}):void 0}function Ka(e,t){const{description:s,descriptionPhoto:n,descriptionDocument:a,userId:i,commands:o,menuButton:r,privacyPolicyUrl:c,hasPreviewMedias:d,appSettings:u}=e,l=i&&me(i,"user"),f=n instanceof pe.Api.Photo?ks(n):void 0,p=a instanceof pe.Api.Document?$s(a):void 0,g=o?.map((e=>function(e,t){return{botId:e,...Ae(t)}}(l||t,e)));return{botId:l||t,description:s,gif:p,photo:f,menuButton:Ja(r),privacyPolicyUrl:c,commands:g?.length?g:void 0,hasPreviewMedia:d,appSettings:u&&$a(u)}}function $a(e){const t=e.placeholderPath&&Ps(e.placeholderPath);return{backgroundColor:e.backgroundColor?cn(e.backgroundColor):void 0,backgroundDarkColor:e.backgroundDarkColor?cn(e.backgroundDarkColor):void 0,headerColor:e.headerColor?cn(e.headerColor):void 0,headerDarkColor:e.headerDarkColor?cn(e.headerDarkColor):void 0,placeholderPath:t}}function Ja(e){return e instanceof pe.Api.BotMenuButton?{type:"webApp",text:e.text,url:e.url}:{type:"commands"}}function Qa(e){const{address:t,geoPoint:s}=e;return{address:t,geo:s&&Ys(s)}}function Xa(e){const{timezoneId:t,weeklyOpen:s}=e;return{timezoneId:t,workHours:s.map((({startMinute:e,endMinute:t})=>({startMinute:e,endMinute:t})))}}function Ya(e){const{title:t,description:s,sticker:n}=e;return{title:t,description:s,sticker:n&&qs(n)}}function Za(e){const{fullUser:{about:t,commonChatsCount:s,pinnedMsgId:n,botInfo:a,blocked:i,profilePhoto:o,voiceMessagesForbidden:r,premiumGifts:c,hasScheduled:d,fallbackPhoto:u,personalPhoto:l,translationsDisabled:f,storiesPinnedAvailable:p,contactRequirePremium:g,businessWorkHours:h,businessLocation:m,businessIntro:y,birthday:_,personalChannelId:b,personalChannelMessage:w,sponsoredEnabled:S,stargiftsCount:v,botVerification:I},users:A}=e,P=me(A[0].id,"user");return{bio:t,commonChatsCount:s,pinnedMessageId:n,isBlocked:Boolean(i),noVoiceMessages:r,hasPinnedStories:Boolean(p),isTranslationDisabled:f,profilePhoto:o instanceof pe.Api.Photo?ks(o):void 0,fallbackPhoto:u instanceof pe.Api.Photo?ks(u):void 0,personalPhoto:l instanceof pe.Api.Photo?ks(l):void 0,premiumGifts:c?.map((e=>function(e){const{months:t,currency:s,amount:n,botUrl:a}=e;return{months:t,currency:s,amount:n.toJSNumber(),botUrl:a}}(e))),botInfo:a&&Ka(a,P),isContactRequirePremium:g,birthday:_&&ni(_),businessLocation:m&&Qa(m),businessWorkHours:h&&Xa(h),businessIntro:y&&Ya(y),personalChannelId:b&&me(b,"channel"),personalChannelMessageId:w,botVerification:I&&Fs(I),areAdsEnabled:S,starGiftCount:v,hasScheduledMessages:d}}function ei(e){if(!(e instanceof pe.Api.User))return;const{id:t,firstName:s,lastName:n,fake:a,scam:i,support:o,closeFriend:r,storiesUnavailable:c,storiesMaxId:d,bot:u,botActiveUsers:l,botVerificationIcon:f,botInlinePlaceholder:p,botAttachMenu:g,botCanEdit:h}=e,m=e.photo instanceof pe.Api.UserProfilePhoto?Boolean(e.photo.hasVideo):void 0,y=e.photo&&Ns(e.photo),_=(S=e).bot?"userTypeBot":S.deleted?"userTypeDeleted":"userTypeRegular",b=Ds(e),w=e.emojiStatus?be(e.emojiStatus):void 0;var S;return{id:me(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:_,firstName:s,lastName:n,hasMainMiniApp:Boolean(e.botHasMainApp),canEditBot:h,..."userTypeBot"===_&&{canBeInvitedToGroup:!e.botNochats},...b&&{usernames:b},phoneNumber:e.phone||"",noStatus:!e.status,...e.accessHash&&{accessHash:String(e.accessHash)},avatarPhotoId:y,emojiStatus:w,hasVideoAvatar:m,areStoriesHidden:Boolean(e.storiesHidden),maxStoryId:d,hasStories:Boolean(d)&&!c,...u&&p&&{botPlaceholder:p},...u&&g&&{isAttachBot:g},botActiveUsers:l,botVerificationIconId:f?.toString(),color:e.color&&_e(e.color)}}function ti(e){return!e||e instanceof pe.Api.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof pe.Api.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof pe.Api.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof pe.Api.UserStatusRecently?{type:"userStatusRecently",isReadDateRestrictedByMe:e.byMe}:e instanceof pe.Api.UserStatusLastWeek?{type:"userStatusLastWeek",isReadDateRestrictedByMe:e.byMe}:{type:"userStatusLastMonth",isReadDateRestrictedByMe:e.byMe}}function si(e){const t={};return e.forEach((e=>{if("status"in e){const s=me(e.id,"user");t[s]=ti(e.status)}})),t}function ni(e){return Ae(e)}const ai=new Set(["User","UserEmpty"]),ii=new Set(["ChatEmpty","Chat","ChatForbidden","Channel","ChannelForbidden"]),oi=new Set(["Message","MessageEmpty","MessageService"]);function ri(e){if(!e||"object"!=typeof e)return;if(!("users"in e||"chats"in e||"messages"in e))return;let t,s;const n=[],a=[];"users"in e&&Array.isArray(e.users)&&ai.has(e.users[0]?.className)&&(t=bt(e.users.map((e=>(e instanceof pe.Api.User&&$e(e),ei(e)))).filter(Boolean),"id")),"chats"in e&&Array.isArray(e.chats)&&ii.has(e.chats[0]?.className)&&(s=bt(e.chats.map((e=>((e instanceof pe.Api.Chat||e instanceof pe.Api.Channel)&&function(e){const t=me(e.id,e instanceof pe.Api.Chat?"chat":"channel"),s=De.chats[t],n=s&&"min"in s&&s.min,a="min"in e&&e.min;s&&!n&&a||(De.chats[t]=e)}(e),In(e)))).filter(Boolean),"id")),"messages"in e&&Array.isArray(e.messages)&&oi.has(e.messages[0]?.className)&&e.messages.forEach((e=>{He(e);const t=Da(e);t&&n.push(t);const s="media"in e&&e.media&&Xs(e.media);s&&a.push(s)})),(t||s||n?.length)&&tt({"@type":"updateEntities",users:t,chats:s,threadInfos:n?.length?n:void 0,polls:a?.length?a:void 0})}function ci(e){He(e);const t=Da(e);t&&tt({"@type":"updateThreadInfo",threadInfo:t})}var di=s(51227);class ui{constructor(e){var t,s,n,a;this.comparator=e,t=this,n=void 0,(s="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(s="queue"))?a:a+"")in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,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 li(e){if(e instanceof pe.Api.WallPaperNoFile)return;const{slug:t}=e,s=Qs(e.document);return s?{slug:t,document:s}:void 0}function fi(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,...St(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function pi(e){return{hash:String(e.hash),botId:me(e.botId,"user"),...St(e,["platform","browser","dateCreated","dateActive","ip","region","domain"])}}function gi(e,t){const{silent:s,muteUntil:n,showPreviews:a,otherSound:i}=e,o=Boolean(i&&!(i instanceof pe.Api.NotificationSoundNone));return{chatId:ye(t),isMuted:s||"number"==typeof n&&kt()<n,...!o&&{isSilent:!0},...void 0!==a&&{shouldShowPreviews:Boolean(a)},muteUntil:n}}function hi(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 mi(e){if(!(e instanceof pe.Api.JsonNull))return e instanceof pe.Api.JsonString||e instanceof pe.Api.JsonBool||e instanceof pe.Api.JsonNumber?e.value:e instanceof pe.Api.JsonArray?e.value.map(mi):e.value.reduce(((e,t)=>(e[t.key]=mi(t.value),e)),{})}function yi(e){if(e instanceof pe.Api.UrlAuthResultRequest){const{bot:t,domain:s,requestWriteAccess:n}=e,a=ei(t);if(!a)return;return $e(t),{type:"request",domain:s,shouldRequestWriteAccess:n,bot:a}}return e instanceof pe.Api.UrlAuthResultAccepted?{type:"accepted",url:e.url}:e instanceof pe.Api.UrlAuthResultDefault?{type:"default"}:void 0}function _i(e){return e.strings.reduce(((e,t)=>(e[t.key]=bi(t),e)),{})}function bi(e){return e instanceof pe.Api.LangPackString?e.value:e instanceof pe.Api.LangPackStringPluralized?It(Ae(e),["key"]):void 0}function wi(e){const t=[],s=e.reduce(((e,s)=>(s instanceof pe.Api.LangPackStringDeleted&&t.push(s.key),s instanceof pe.Api.LangPackString&&(e[s.key]=s.value),s instanceof pe.Api.LangPackStringPluralized&&(e[s.key]=At({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 Si(e){const{name:t,nativeName:s,langCode:n,pluralCode:a,rtl:i,stringsCount:o,translatedCount:r,translationsUrl:c,beta:d,official:u}=e;return{name:t,nativeName:s,langCode:n,pluralCode:a,isRtl:i,isBeta:d,isOfficial:u,stringsCount:o,translatedCount:r,translationsUrl:c}}function vi(e){if(e instanceof pe.Api.help.PeerColorSet)return e.colors.map((e=>cn(e)))}function Ii(e){const{id:t,name:s,utcOffset:n}=e;return{id:t,name:s,utcOffset:n}}const Ai=new Map,Pi=[],Ci=(e,t)=>{const s=e.topicId?`${e.chatId}-${e.topicId}`:e.chatId;if(Ai.has(s)&&(clearTimeout(Ai.get(s)),Ai.delete(s)),e.muteUntil===B||e.muteUntil<=kt())return;if(Pi.push(e),Pi.sort(((e,t)=>t.muteUntil-e.muteUntil)),!Pi.pop())return;const n=setTimeout((()=>{if(t(),Pi.length){const e=Pi.pop();e&&Ci(e,t)}}),1e3*(e.muteUntil-kt()));Ai.set(s,n)};function Mi(e,t=0,s){Ci({chatId:e,muteUntil:t},(()=>s({"@type":"updateNotifyExceptions",chatId:e,isMuted:!1})))}var Ri=s(86453);class ki{constructor(e,t){this.pts=e,this.ptsCount=t}}class Ti{constructor(e,t,s){this.channelId=e,this.pts=t,this.ptsCount=s}}const Ei=new Set;function Bi(e){if(e instanceof pe.connection.UpdateServerTimeOffset)a=e.timeOffset,Mt=a,et({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset});else if(e instanceof pe.connection.UpdateConnectionState){let t;switch(e.state){case pe.connection.UpdateConnectionState.disconnected:t="connectionStateConnecting";break;case pe.connection.UpdateConnectionState.broken:t="connectionStateBroken";break;case pe.connection.UpdateConnectionState.connected:default:t="connectionStateReady"}et({"@type":"updateConnectionState",connectionState:t})}else if(e instanceof pe.Api.UpdateNewMessage||e instanceof pe.Api.UpdateNewScheduledMessage||e instanceof pe.Api.UpdateNewChannelMessage||e instanceof pe.Api.UpdateShortChatMessage||e instanceof pe.Api.UpdateShortMessage){let t,s,a;if(e instanceof pe.Api.UpdateShortChatMessage)t=Ma(me((n=e).chatId,"chat"),{...n,fromId:xt(me(n.fromId,"user")),peerId:xt(me(n.chatId,"chat"))});else if(e instanceof pe.Api.UpdateShortMessage)t=function(e){return Ma(me(e.userId,"user"),{...e,fromId:xt(e.out?Ia:me(e.userId,"user")),peerId:xt(e.out?me(e.userId,"user"):Ia)})}(e);else{const n=e.message;if(n instanceof pe.Api.MessageEmpty)return void(c&&console.error("Unexpected update:",e.className,e));ci(n),t=Ca(n),n instanceof pe.Api.Message&&(s=n.media&&Xs(n.media)),a="replyMarkup"in e.message&&e.message?.replyMarkup instanceof pe.Api.ReplyKeyboardForceReply&&(!e.message.replyMarkup.selective||t.isMentioned)}if(e instanceof pe.Api.UpdateNewScheduledMessage?et({"@type":Ei.has(t.id)?"updateScheduledMessage":"newScheduledMessage",id:t.id,chatId:t.chatId,message:t,poll:s}):et({"@type":!Ei.has(t.id)||t.viaBotId||t.content.action?"newMessage":"updateMessage",id:t.id,chatId:t.chatId,message:t,shouldForceReply:a,poll:s}),e.message instanceof pe.Api.MessageService){const{action:s}=e.message;if(s instanceof pe.Api.MessageActionChatEditTitle)et({"@type":"updateChat",id:t.chatId,chat:{title:s.title}});else if(s instanceof pe.Api.MessageActionChatEditPhoto){const n=s.photo instanceof pe.Api.Photo&&ks(s.photo);if(!n)return;const a=function(e){if(e instanceof pe.Api.PhotoEmpty)return new pe.Api.ChatPhotoEmpty;const{dcId:t,id:s}=e;return new pe.Api.ChatPhoto({dcId:t,photoId:s})}(s.photo),i=Ge(e.message);De.chats[i]&&(De.chats[i].photo=a),je(s.photo),et({"@type":"updateNewProfilePhoto",peerId:t.chatId,photo:n})}else if(s instanceof pe.Api.MessageActionChatDeletePhoto){const s=Ge(e.message);De.chats[s]&&(De.chats[s].photo=new pe.Api.ChatPhotoEmpty),et({"@type":"updateDeleteProfilePhoto",peerId:t.chatId})}else if(s instanceof pe.Api.MessageActionChatDeleteUser)e._entities&&e._entities.some((e=>e instanceof pe.Api.User&&Boolean(e.self)&&e.id===s.userId))&&et({"@type":"updateChat",id:t.chatId,chat:{isForbidden:!0,isNotJoined:!0}});else if(s instanceof pe.Api.MessageActionChatAddUser)e._entities&&e._entities.some((e=>e instanceof pe.Api.User&&Boolean(e.self)&&s.users.includes(e.id)))&&et({"@type":"updateChatJoin",id:t.chatId});else if(s instanceof pe.Api.MessageActionGroupCall)!s.duration&&s.call&&et({"@type":"updateGroupCallChatId",chatId:t.chatId,call:{id:s.call.id.toString(),accessHash:s.call.accessHash.toString()}});else if(s instanceof pe.Api.MessageActionTopicEdit){const t=e.message.replyTo instanceof pe.Api.MessageReplyHeader?e.message.replyTo:void 0,{replyToMsgId:s,replyToTopId:n,forumTopic:a}=t||{},i=a&&(n||s)||se;et({"@type":"updateTopic",chatId:ye(e.message.peerId),topicId:i})}else s instanceof pe.Api.MessageActionTopicCreate&&et({"@type":"updateTopics",chatId:ye(e.message.peerId)})}}else if(e instanceof pe.Api.UpdateQuickReplyMessage){const t=Ca(e.message);if(!t)return;et({"@type":"updateQuickReplyMessage",id:t.id,message:t})}else if(e instanceof pe.Api.UpdateDeleteQuickReplyMessages)et({"@type":"deleteQuickReplyMessages",quickReplyId:e.shortcutId,messageIds:e.messages});else if(e instanceof pe.Api.UpdateQuickReplies)et({"@type":"updateQuickReplies",quickReplies:e.quickReplies.map(xa)});else if(e instanceof pe.Api.UpdateNewQuickReply)et({"@type":"updateQuickReplies",quickReplies:[xa(e.quickReply)]});else if(e instanceof pe.Api.UpdateDeleteQuickReply)et({"@type":"deleteQuickReply",quickReplyId:e.shortcutId});else if(e instanceof pe.Api.UpdateEditMessage||e instanceof pe.Api.UpdateEditChannelMessage){const t=e.message;if(t instanceof pe.Api.MessageEmpty)return void(c&&console.error("Unexpected update:",e.className,e));ci(t);const s=It(Ca(t),["isOutgoing"]),n=t instanceof pe.Api.Message&&t.media?Xs(t.media):void 0;et({"@type":"updateMessage",id:s.id,chatId:s.chatId,message:s,poll:n})}else if(e instanceof pe.Api.UpdateMessageReactions)et({"@type":"updateMessageReactions",id:e.msgId,chatId:ye(e.peer),reactions:dn(e.reactions)});else if(e instanceof pe.Api.UpdateMessageExtendedMedia){const t=ye(e.peer),s=e.extendedMedia[0]instanceof pe.Api.MessageExtendedMedia;if(s){const n=on(e.extendedMedia);if(!n?.length)return;return void et({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,isBought:s,extendedMedia:n})}const n=s?void 0:e.extendedMedia.filter((e=>e instanceof pe.Api.MessageExtendedMediaPreview)).map((e=>nn(e))).filter(Boolean);if(!n?.length)return;et({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,extendedMedia:n})}else if(e instanceof pe.Api.UpdateDeleteMessages)et({"@type":"deleteMessages",ids:e.messages});else if(e instanceof pe.Api.UpdateDeleteScheduledMessages)et({"@type":"deleteScheduledMessages",ids:e.messages,newIds:e.sentMessages,chatId:ye(e.peer)});else if(e instanceof pe.Api.UpdateDeleteChannelMessages){const t=me(e.channelId,"channel");et({"@type":"deleteMessages",ids:e.messages,chatId:t})}else if(e instanceof pe.Api.UpdateServiceNotification)if(e.popup)et({"@type":"error",error:{message:e.message}});else{const t=function(e,t){const s=Pa(t),n=Ws(e);return{id:s,chatId:J,date:e.inboxDate||t,content:n,isOutgoing:!1}}(e,Date.now()/1e3+Rt());ci(zt(t.id,t.chatId,e)),et({"@type":"updateServiceNotification",message:t})}else if(e instanceof pe.Api.UpdateMessageID||e instanceof pe.Api.UpdateShortSentMessage)Ei.add(e.id);else if(e instanceof pe.Api.UpdateReadMessagesContents)et({"@type":"updateCommonBoxMessages",ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof pe.Api.UpdateChannelReadMessagesContents)et({"@type":"updateChannelMessages",channelId:me(e.channelId,"channel"),ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof pe.Api.UpdateMessagePoll){const{pollId:t,poll:s,results:n}=e;if(s){const e=Zs(s,n);et({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:e})}else{const e=en(n);et({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:{results:e}})}}else if(e instanceof pe.Api.UpdateMessagePollVote)et({"@type":"updateMessagePollVote",pollId:String(e.pollId),peerId:ye(e.peer),options:e.options.map(Qe)});else if(e instanceof pe.Api.UpdateChannelMessageViews)et({"@type":"updateMessage",chatId:me(e.channelId,"channel"),id:e.id,message:{viewsCount:e.views}});else if(e instanceof pe.Api.UpdateReadHistoryInbox)et({"@type":"updateChatInbox",id:ye(e.peer),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof pe.Api.UpdateReadHistoryOutbox)et({"@type":"updateChat",id:ye(e.peer),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof pe.Api.UpdateReadChannelInbox)et({"@type":"updateChat",id:me(e.channelId,"channel"),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof pe.Api.UpdateReadChannelOutbox)et({"@type":"updateChat",id:me(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof pe.Api.UpdateReadChannelDiscussionInbox)et({"@type":"updateThreadInfo",threadInfo:{chatId:me(e.channelId,"channel"),threadId:e.topMsgId,lastReadInboxMessageId:e.readMaxId}});else if(e instanceof pe.Api.UpdateReadChannelDiscussionOutbox)et({"@type":"updateChat",id:me(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.readMaxId}});else if(e instanceof pe.Api.UpdateDialogPinned&&e.peer instanceof pe.Api.DialogPeer)et({"@type":"updateChatPinned",id:ye(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof pe.Api.UpdatePinnedDialogs)et({"@type":"updatePinnedChatIds",ids:e.order?e.order.filter((e=>e instanceof pe.Api.DialogPeer)).map((e=>ye(e.peer))):[],folderId:e.folderId||void 0});else if(e instanceof pe.Api.UpdateSavedDialogPinned&&e.peer instanceof pe.Api.DialogPeer)et({"@type":"updateSavedDialogPinned",id:ye(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof pe.Api.UpdatePinnedSavedDialogs)et({"@type":"updatePinnedSavedDialogIds",ids:e.order?e.order.filter((e=>e instanceof pe.Api.DialogPeer)).map((e=>ye(e.peer))):[]});else if(e instanceof pe.Api.UpdateFolderPeers)e.folderPeers.forEach((e=>{const{folderId:t,peer:s}=e;et({"@type":"updateChatListType",id:ye(s),folderId:t})}));else if(e instanceof pe.Api.UpdateDialogFilter){const{id:t,filter:s}=e;et({"@type":"updateChatFolder",id:t,folder:qe(s)?En(s):void 0})}else if(e instanceof pe.Api.UpdateDialogFilterOrder)et({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof pe.Api.UpdateChatParticipants){const t=kn(e.participants);et({"@type":"updateChatMembers",id:me(e.participants.chatId,"chat"),replacedMembers:t})}else if(e instanceof pe.Api.UpdateChatParticipantAdd){const t=Rn(St(e,["userId","inviterId","date"]));et({"@type":"updateChatMembers",id:me(e.chatId,"chat"),addedMember:t})}else if(e instanceof pe.Api.UpdateChatParticipantDelete)et({"@type":"updateChatMembers",id:me(e.chatId,"chat"),deletedMemberId:me(e.userId,"user")});else if(e instanceof pe.Api.UpdatePinnedMessages||e instanceof pe.Api.UpdatePinnedChannelMessages)et({"@type":"updatePinnedIds",chatId:e instanceof pe.Api.UpdatePinnedMessages?ye(e.peer):me(e.channelId,"channel"),messageIds:e.messages,isPinned:e.pinned});else if(e instanceof pe.Api.UpdateNotifySettings&&e.peer instanceof pe.Api.NotifyPeer){const t=gi(e.notifySettings,e.peer.peer);Mi(t.chatId,t.muteUntil,et),et({"@type":"updateNotifyExceptions",...t})}else if(e instanceof pe.Api.UpdateNotifySettings&&e.peer instanceof pe.Api.NotifyForumTopic){const t=function(e,t,s){const{silent:n,muteUntil:a,showPreviews:i,otherSound:o}=e,r=Boolean(o&&!(o instanceof pe.Api.NotificationSoundNone));return{chatId:ye(t),topicId:s,isMuted:n||"number"==typeof a&&kt()<a,...!r&&{isSilent:!0},...void 0!==i&&{shouldShowPreviews:Boolean(i)},muteUntil:a}}(e.notifySettings,e.peer.peer,e.peer.topMsgId);!function(e,t,s=0,n){Ci({chatId:e,topicId:t,muteUntil:s},(()=>n({"@type":"updateTopicNotifyExceptions",chatId:e,topicId:t,isMuted:!1})))}(t.chatId,t.topicId,t.muteUntil,et),et({"@type":"updateTopicNotifyExceptions",...t})}else if(e instanceof pe.Api.UpdateUserTyping||e instanceof pe.Api.UpdateChatUserTyping){const t=e instanceof pe.Api.UpdateUserTyping?me(e.userId,"user"):me(e.chatId,"chat");e.action instanceof pe.Api.SendMessageEmojiInteraction?et({"@type":"updateStartEmojiInteraction",id:t,emoji:e.action.emoticon,messageId:e.action.msgId,interaction:(s=JSON.parse(e.action.interaction.data),{timestamps:s.a.map((({t:e})=>e))})}):et({"@type":"updateChatTypingStatus",id:t,typingStatus:Tn(e)})}else if(e instanceof pe.Api.UpdateChannelUserTyping)et({"@type":"updateChatTypingStatus",id:me(e.channelId,"channel"),threadId:e.topMsgId,typingStatus:Tn(e)});else if(e instanceof pe.Api.UpdateChannel){const{_entities:t}=e;if(!t)return;const s=t.find((e=>e instanceof pe.Api.Channel||e instanceof pe.Api.ChannelForbidden));if(s instanceof pe.Api.Channel){const t=In(s);t&&(et({"@type":"updateChat",id:t.id,chat:t}),et({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:me(e.channelId,"channel")}))}else if(s instanceof pe.Api.ChannelForbidden){const t=me(e.channelId,"channel");et({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),et({"@type":"updateChatLeave",id:t})}else 0===t.length&&et({"@type":"resetMessages",id:me(e.channelId,"channel")})}else if(e instanceof pe.Api.UpdateDialogUnreadMark&&e.peer instanceof pe.Api.DialogPeer)et({"@type":"updateChat",id:ye(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof pe.Api.UpdateChatDefaultBannedRights)et({"@type":"updateChat",id:ye(e.peer),chat:{defaultBannedRights:Ae(e.defaultBannedRights)}});else if(e instanceof pe.Api.UpdateUserStatus)et({"@type":"updateUserStatus",userId:me(e.userId,"user"),status:ti(e.status)});else if(e instanceof pe.Api.UpdateUser)et({"@type":"updateRequestUserUpdate",id:me(e.userId,"user")});else if(e instanceof pe.Api.UpdateUserEmojiStatus){const t=be(e.emojiStatus);et({"@type":"updateUserEmojiStatus",userId:me(e.userId,"user"),emojiStatus:t})}else if(e instanceof pe.Api.UpdateUserName){const t=me(e.userId,"user"),s=De.users[t];et({"@type":"updateUser",id:t,user:{...s?.mutualContact&&!s.self?St(e,[]):St(e,["firstName","lastName"]),usernames:Ds(e)}})}else if(e instanceof pe.Api.UpdateUserPhone){const{userId:t,phone:s}=e;et({"@type":"updateUser",id:me(t,"user"),user:{phoneNumber:s}})}else if(e instanceof pe.Api.UpdatePeerSettings){const{_entities:t,settings:s}=e;if(!t)return;t?.length&&(t.filter((e=>e instanceof pe.Api.User&&!e.contact)).forEach((e=>{et({"@type":"deleteContact",id:me(e.id,"user")})})),t.filter((e=>e instanceof pe.Api.User&&e.contact)).map(ei).forEach((e=>{e&&et({"@type":"updateUser",id:e.id,user:{...e,...s&&{settings:xn(s)}}})})))}else if(e instanceof pe.Api.UpdateNotifySettings){const{notifySettings:{showPreviews:t,silent:s,muteUntil:n},peer:{className:a}}=e,i="NotifyUsers"===a?"contact":"NotifyChats"===a?"group":"NotifyBroadcasts"===a?"broadcast":void 0;if(!i)return;et({"@type":"updateNotifySettings",peerType:i,isSilent:Boolean(s||"number"==typeof n&&Date.now()+1e3*Rt()<1e3*n),shouldShowPreviews:Boolean(t)})}else if(e instanceof pe.Api.UpdatePeerBlocked)et({"@type":"updatePeerBlocked",id:ye(e.peerId),isBlocked:e.blocked,isBlockedFromStories:e.blockedMyStoriesFrom});else if(e instanceof pe.Api.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"}}(e.key);t&&et({"@type":"updatePrivacy",key:t,rules:Us(e.rules)})}else if(e instanceof pe.Api.UpdateDraftMessage)et({"@type":"draftMessage",chatId:ye(e.peer),threadId:e.topMsgId,draft:Ra(e.draft)});else if(e instanceof pe.Api.UpdateContactsReset)et({"@type":"updateResetContactList"});else if(e instanceof pe.Api.UpdateFavedStickers)et({"@type":"updateFavoriteStickers"});else if(e instanceof pe.Api.UpdateRecentStickers)et({"@type":"updateRecentStickers"});else if(e instanceof pe.Api.UpdateRecentReactions)et({"@type":"updateRecentReactions"});else if(e instanceof pe.Api.UpdateSavedReactionTags)et({"@type":"updateSavedReactionTags"});else if(e instanceof pe.Api.UpdateMoveStickerSetToTop)e.masks||et({"@type":"updateMoveStickerSetToTop",isCustomEmoji:e.emojis,id:e.stickerset.toString()});else if(e instanceof pe.Api.UpdateStickerSets)et({"@type":"updateStickerSets"});else if(e instanceof pe.Api.UpdateStickerSetsOrder)e.masks||et({"@type":"updateStickerSetsOrder",order:e.order.map((e=>e.toString())),isCustomEmoji:e.emojis});else if(e instanceof pe.Api.UpdateNewStickerSet){if(e.stickerset instanceof pe.Api.messages.StickerSet){const t=Hs(e.stickerset.set);et({"@type":"updateStickerSet",id:t.id,stickerSet:t})}}else if(e instanceof pe.Api.UpdateSavedGifs)et({"@type":"updateSavedGifs"});else if(e instanceof pe.Api.UpdateGroupCall)et({"@type":"updateGroupCall",call:ms(e.call)});else if(e instanceof pe.Api.UpdateGroupCallConnection)et({"@type":"updateGroupCallConnection",data:JSON.parse(e.params.data),presentation:Boolean(e.presentation)});else if(e instanceof pe.Api.UpdateGroupCallParticipants)et({"@type":"updateGroupCallParticipants",groupCallId:(t=e.call,t.id.toString()),participants:e.participants.map(ps)});else if(e instanceof pe.Api.UpdatePendingJoinRequests)et({"@type":"updatePendingJoinRequests",chatId:ye(e.peer),recentRequesterIds:e.recentRequesters.map((e=>me(e,"user"))),requestsPending:e.requestsPending});else if(e instanceof pe.Api.UpdatePhoneCall)et({"@type":"updatePhoneCall",call:ys(e.phoneCall)});else if(e instanceof pe.Api.UpdatePhoneCallSignalingData)et({"@type":"updatePhoneCallSignalingData",callId:e.phoneCallId.toString(),data:Array.from(e.data)});else if(e instanceof pe.Api.UpdateWebViewResultSent){const{queryId:t}=e;et({"@type":"updateWebViewResultSent",queryId:t.toString()})}else if(e instanceof pe.Api.UpdateBotMenuButton){const{botId:t,button:s}=e;et({"@type":"updateBotMenuButton",botId:me(t,"user"),button:Ja(s)})}else if(e instanceof pe.Api.UpdateTranscribedAudio)et({"@type":"updateTranscribedAudio",transcriptionId:e.transcriptionId.toString(),text:e.text,isPending:e.pending});else if(e instanceof pe.Api.UpdateConfig)et({"@type":"updateConfig"});else if(e instanceof pe.Api.UpdateChannelPinnedTopic)et({"@type":"updatePinnedTopic",chatId:me(e.channelId,"channel"),topicId:e.topicId,isPinned:Boolean(e.pinned)});else if(e instanceof pe.Api.UpdateChannelPinnedTopics)et({"@type":"updatePinnedTopicsOrder",chatId:me(e.channelId,"channel"),order:e.order||[]});else if(e instanceof pe.Api.UpdateRecentEmojiStatuses)et({"@type":"updateRecentEmojiStatuses"});else if(e instanceof pe.Api.UpdateStory){const{story:t}=e,s=ye(e.peer),n=Na(s,t);Le(t,s),t instanceof pe.Api.StoryItemDeleted?et({"@type":"deleteStory",peerId:s,storyId:t.id}):et({"@type":"updateStory",peerId:s,story:n})}else if(e instanceof pe.Api.UpdateReadStories)et({"@type":"updateReadStories",peerId:ye(e.peer),lastReadId:e.maxId});else if(e instanceof pe.Api.UpdateSentStoryReaction){const t=gn(e.reaction);et({"@type":"updateSentStoryReaction",peerId:ye(e.peer),storyId:e.storyId,reaction:t})}else if(e instanceof pe.Api.UpdateStoriesStealthMode)et({"@type":"updateStealthMode",stealthMode:qa(e.stealthMode)});else if(e instanceof pe.Api.UpdateAttachMenuBots)et({"@type":"updateAttachMenuBots"});else if(e instanceof pe.Api.UpdateNewAuthorization)et({"@type":"updateNewAuthorization",hash:e.hash.toString(),date:e.date,device:e.device,location:e.location,isUnconfirmed:e.unconfirmed});else if(e instanceof pe.Api.UpdateChannelViewForumAsMessages)et({"@type":"updateViewForumAsMessages",chatId:me(e.channelId,"channel"),isEnabled:!!e.enabled||void 0});else if(e instanceof pe.Api.UpdateStarsBalance)et({"@type":"updateStarsBalance",balance:ua(e.balance)});else if(e instanceof pe.Api.UpdatePaidReactionPrivacy)et({"@type":"updatePaidReactionPrivacy",isPrivate:e.private});else if(e instanceof pe.Api.UpdateLangPackTooLong)et({"@type":"updateLangPackTooLong",langCode:e.langCode});else if(e instanceof pe.Api.UpdateLangPack){const{strings:t,keysToRemove:s}=wi(e.difference.strings);et({"@type":"updateLangPack",version:e.difference.version,strings:t,keysToRemove:s})}else e instanceof Ri.A?et({"@type":"updatePremiumFloodWait",isUpload:e.isUpload}):e instanceof ki||e instanceof Ti||c&&Ye("UNEXPECTED UPDATE","object"==typeof e&&"className"in e?e.className:e);var t,s,n,a}const Di="0",Ui=1e3,xi=500;let Vi,Ni,Fi=!1;const Gi=new Map,qi=new ui((function(e,t){return("seqStart"in e?e.seqStart:e.seq)-("seqStart"in t?t.seqStart:t.seq)})),Hi=new Map;function Oi(e){De.commonBoxState.seq=e.seq,De.commonBoxState.date=e.date,De.commonBoxState.pts=e.pts,De.commonBoxState.qts=e.qts}function Li(e,t,s){if(e instanceof di.UpdateConnectionState)return e.state===di.UpdateConnectionState.connected&&Fi&&Ji(),void Bi(e);if(e instanceof di.UpdateServerTimeOffset)Bi(e);else if(void 0!==De.commonBoxState.seq)return e instanceof pe.Api.Updates||e instanceof pe.Api.UpdatesCombined?(t&&(e._isFromDifference=!0),void function(e,t){qi.add(e),t||zi()}(e,s)):"pts"in e?e instanceof pe.Api.UpdateChannelTooLong?void Yi(Qi(e)):(t&&(e._isFromDifference=!0),void function(e,t){const s=Qi(e),n=Hi.get(s)||new ui(io);n.add(e),Hi.set(s,n),t||Ki(s)}(e,s)):void Bi(e)}function ji(e,t){if(!(De.chats[e]instanceof pe.Api.Channel))return void(c&&console.error(`[UpdateManager] Channel ${e} not found in localDb`));const s=De.channelPtsById[e];s&&s<t?$i(e):De.channelPtsById[e]=t}function Wi(e){if("seq"in e&&e.seq&&(De.commonBoxState.seq=e.seq,De.commonBoxState.date=e.date),"qts"in e&&(De.commonBoxState.qts=e.qts),"pts"in e){const t=Qi(e);t!==Di?De.channelPtsById[t]=e.pts:De.commonBoxState.pts=e.pts}if(e instanceof pe.Api.UpdatesCombined||e instanceof pe.Api.Updates){ri(e);const t=e.users.concat(e.chats);e.updates.forEach((e=>{t&&(e._entities=t),Li(e)}))}else Bi(e)}function zi(){if(!qi.size)return;const e=qi.pop(),t=De.commonBoxState.seq,s="seqStart"in e?e.seqStart:e.seq;if(0===s||e._isFromDifference&&s>=t+1)Wi(e);else if(s===t+1)clearTimeout(Ni),Ni=void 0,Wi(e);else if(s>t+1)return qi.add(e),void Ji();zi()}function Ki(e){const t=Hi.get(e);if(!t?.size)return;const s=t.pop(),n=e===Di?De.commonBoxState.pts:De.channelPtsById[e],a=s.pts,i=ao(s);if(void 0!==n){if(s._isFromDifference&&a>=n+i)Wi(s);else if(a===n+i)clearTimeout(Gi.get(e)),Gi.delete(e),Wi(s);else if(a>n+i)return t.add(s),void(e===Di?Ji():$i(e));Ki(e)}}function $i(e){if(Gi.has(e))return;const t=setTimeout((async()=>{await Yi(e),Gi.delete(e)}),xi);Gi.set(e,t)}function Ji(){Ni||(Ni=setTimeout((async()=>{await Xi(),Ni=void 0}),xi))}function Qi(e){return"channelId"in e&&"pts"in e?me(e.channelId,"channel"):e instanceof pe.Api.UpdateNewChannelMessage||e instanceof pe.Api.UpdateEditChannelMessage?me(e.message.peerId.channelId,"channel"):Di}async function Xi(){if(!Fi)throw new Error("UpdatesManager not initialized");if(!De.commonBoxState?.date)return void Zi();et({"@type":"updateFetchingDifference",isFetching:!0});const e=await Vi(new pe.Api.updates.GetDifference({pts:De.commonBoxState.pts,date:De.commonBoxState.date,qts:De.commonBoxState.qts}));if(!e||e instanceof pe.Api.updates.DifferenceTooLong)Zi();else{if(e instanceof pe.Api.updates.DifferenceEmpty)return De.commonBoxState.seq=e.seq,De.commonBoxState.date=e.date,void et({"@type":"updateFetchingDifference",isFetching:!1});no(e),Oi(e instanceof pe.Api.updates.DifferenceSlice?e.intermediateState:e.state),e instanceof pe.Api.updates.DifferenceSlice?Xi():et({"@type":"updateFetchingDifference",isFetching:!1})}}async function Yi(e){const t=De.chats[e];if(!(t&&t instanceof pe.Api.Channel&&t.accessHash&&De.channelPtsById[e]))return void(c&&console.error("[UpdateManager] Channel for difference not found",e,t));const s=await Vi(new pe.Api.updates.GetChannelDifference({channel:Ft(e,t.accessHash.toString()),pts:De.channelPtsById[e],filter:new pe.Api.ChannelMessagesFilterEmpty,limit:Ui}));s?s instanceof pe.Api.updates.ChannelDifferenceTooLong?Zi():(De.channelPtsById[e]=s.pts,s instanceof pe.Api.updates.ChannelDifferenceEmpty?Ki(e):(no(s,e),s.final||Yi(e))):c&&console.warn("[UpdatesManager] Failed to get ChannelDifference",e,t)}function Zi(){eo(),et({"@type":"requestSync"}),so()}function eo(){Hi.clear(),qi.clear(),clearTimeout(Ni),Ni=void 0,Gi.forEach((e=>{clearTimeout(e)})),Gi.clear(),De.commonBoxState={},Object.keys(De.channelPtsById).forEach((e=>{De.channelPtsById[e]=0})),Fi=!1}function to(e,t){const s="chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?ss(e.id,"channel"):void 0;var n,a,i;Li((n=t.pts,a=t.ptsCount,(i=s)?new Ti(i,n,a):new ki(n,a)))}async function so(){const e=await Vi(new pe.Api.updates.GetState);e&&(Oi(e),Fi=!0)}function no(e,t){e.newMessages.forEach((e=>{Bi(new pe.Api.UpdateNewMessage({message:e,pts:0,ptsCount:0}))})),ri(e);const s=new Set;e.otherUpdates.forEach((e=>{const t=Qi(e);e instanceof pe.Api.UpdateChannelTooLong&&s.add(Qi(e));const n=!s.has(t);Li(e,n,!n)})),t?Ki(t):zi()}function ao(e){return"ptsCount"in e?e.ptsCount:0}function io(e,t){const s=e.pts-t.pts;return 0!==s?s:ao(t)-ao(e)}const oo={PHONE_NUMBER_INVALID:"Invalid phone number.",PHONE_CODE_INVALID:"Invalid code.",PASSWORD_HASH_INVALID:"Incorrect password.",PHONE_PASSWORD_FLOOD:"Limit exceeded. Please try again later.",PHONE_NUMBER_BANNED:"This phone number is banned."},ro={};function co(){et({"@type":"updateWebAuthTokenFailed"})}function uo(){return et(mo("authorizationStateWaitPhoneNumber")),new Promise(((e,t)=>{ro.resolve=e,ro.reject=t}))}function lo(e=!1){return et({...mo("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise(((e,t)=>{ro.resolve=e,ro.reject=t}))}function fo(e,t){return et({...mo("authorizationStateWaitPassword"),hint:e,noReset:t}),new Promise((e=>{ro.resolve=e}))}function po(){return et(mo("authorizationStateWaitRegistration")),new Promise((e=>{ro.resolve=e}))}function go(e){return et({...mo("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise(((e,t)=>{ro.reject=t}))}function ho(e){let t;if(e instanceof pe.errors.FloodWaitError){const s=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(s>1?`${s} hours`:"an hour")}else t=oo[e.message];t||(t="Unexpected Error",c&&console.error(e)),et({"@type":"updateAuthorizationError",message:t})}function mo(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function yo(e){ro.resolve&&ro.resolve(e)}function _o(e){ro.resolve&&ro.resolve(e)}function bo(e){ro.resolve&&ro.resolve(e)}function wo(e){const{firstName:t,lastName:s}=e;ro.resolve&&ro.resolve([t,s])}function So(){ro.reject&&ro.reject(new Error("RESTART_AUTH"))}function vo(){ro.reject&&ro.reject(new Error("RESTART_AUTH_WITH_QR"))}const Io=self.caches;let Ao;async function Po(){return!!Io&&(Ao=Ao??await Io.has("test").then((()=>!0)).catch((()=>!1)),Ao)}let Co=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 Mo(e,t,s,n=!1){if(Io)try{const a=r?`${d}/${t.replace(/:/g,"_")}`:new Request(t.replace(/:/g,"_")),i=await Io.open(e),o=await i.match(a);if(!o)return;const c=o.headers.get("Content-Type");switch(s){case Co.Text:return await o.text();case Co.Blob:{if(t.startsWith("avatar")&&c&&c.startsWith("text"))return;const e=await o.blob(),s=!e.type||!n&&e.type.includes("html");let a=e.type||c;return s&&a?(n||(a=a.replace(/html/gi,"")),new Blob([e],{type:a})):e}case Co.Json:return await o.json();case Co.ArrayBuffer:return await o.arrayBuffer();default:return}}catch(e){return void console.warn(e)}}async function Ro(e,t,s){if(!Io)return!1;try{const n="string"==typeof s||s instanceof Blob||s instanceof ArrayBuffer?s:JSON.stringify(s),a=r?`${d}/${t.replace(/:/g,"_")}`:new Request(t.replace(/:/g,"_")),i=new Response(n),o=await Io.open(e);return await o.put(a,i),!0}catch(e){return console.warn(e),!1}}async function ko(e,t){try{if(!Io)return;const s=await Io.open(e);return await s.delete(t)}catch(e){return void console.warn(e)}}async function To(e){try{if(!Io)return;return await Io.delete(e)}catch(e){return void console.warn(e)}}const Eo=new Set(["sticker","wallpaper","photo","webDocument","document"]),Bo=new Set(["s","m","x","y","w","a","b","c","d"]),Do=new Set(["u","v"]);async function Uo({url:e,mediaFormat:t,start:s,end:a,isHtmlAllowed:i},o,r){const{data:c,mimeType:d,fullSize:h}=await async function(e,t,s,n,a,i){const o=Vo(e);if(!o)return;const{entityType:r,entityId:c,sizeType:d,params:u,mediaMatchType:l}=o;if("staticMap"===r){const e=c,s=new URLSearchParams(u),n=s.get("long"),a=s.get("lat"),i=s.get("w"),o=s.get("h"),r=s.get("zoom"),d=s.get("scale"),l=s.get("accuracy_radius");return{mimeType:"image/png",data:await t.downloadStaticMap(e,n,a,i,o,r,d,l)}}let f;switch(r){case"channel":case"chat":f=De.chats[c];break;case"user":f=De.users[c];break;case"sticker":case"wallpaper":case"document":f=De.documents[c];break;case"photo":f=De.photos[c];break;case"stickerSet":f=De.stickerSets[c];break;case"webDocument":f=De.webDocuments[c]}if(f){if(Eo.has(r)){const e=await t.downloadMedia(f,{sizeType:d,start:n,end:a,progressCallback:s,workers:g});let o,r;return d&&Bo.has(d)?o="image/jpeg":d&&Do.has(d)?o="video/mp4":f instanceof pe.Api.Photo?o="image/jpeg":f instanceof pe.Api.WebDocument?(o=f.mimeType,r=f.size):f instanceof pe.Api.Document&&(o=f.mimeType,r=f.size.toJSNumber()),!i&&o&&(o=o.replace(/html/gi,"")),{mimeType:o,data:e,fullSize:r}}if("stickerSet"===r){const e=await t.downloadStickerSetThumb(f);return{mimeType:xo(e),data:e}}{const e=await t.downloadProfilePhoto(f,"profile"===l);return{mimeType:xo(e),data:e}}}}(e,o,r,s,a,i)||{};if(!c)return;const m=await async function(e,t,s){switch(t){case ft.BlobUrl:return new Blob([e],{type:s});case ft.Text:return e.toString();case ft.Progressive:case ft.DownloadUrl:return e.buffer}}(c,t,d);if(!m)return;const y=t!==ft.Progressive&&(t!==ft.BlobUrl||m.size<=p);return!u&&n&&y&&Ro(e.startsWith("avatar")?f:l,e,m),{dataBlob:t===ft.Progressive?"":m,arrayBuffer:t===ft.Progressive?m:void 0,mimeType:d,fullSize:h}}function xo(e,t="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 Vo(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]?Ut(n):t[1],{mediaMatchType:s,entityType:a,entityId:n,sizeType:o,params:i}}class No extends AbortController{constructor(...e){var t,s,n,a;super(...e),t=this,s="threads",n=new Map,(s="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(s))?a:a+"")in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n}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()}}const Fo="Unknown UserAgent",Go="Unknown platform";ct.Logger.setLevel("warn");const qo={build:e=>e},Ho=new Map,Oo=new Map;let Lo,jo;function Wo({isPremium:e}){Lo.setIsPremium(e)}const zo=2500;async function Ko(e=!1,t=!1){!e&&Lo.isConnected()&&await Promise.race([Xo(new pe.Api.auth.LogOut),ue(zo)]),t||(Object.assign(Be,Ee()),eo()),await Lo.destroy()}async function $o(){await Lo.disconnect()}function Jo(e){et({"@type":"updateSession",sessionData:e})}function Qo(e){Li(e),e instanceof pe.Api.UpdatesTooLong?async function(){try{await Xo(new pe.Api.users.GetFullUser({id:new pe.Api.InputUserSelf}),{shouldThrow:!0})}catch(e){"AUTH_KEY_UNREGISTERED"!==e.message&&"SESSION_REVOKED"!==e.message||et({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():("updates"in e?e.updates:[e]).forEach((e=>{if(!(e instanceof pe.Api.UpdateConfig))return;const t=e._entities?.find((e=>e instanceof pe.Api.User&&me(e.id,"user")===jo));t instanceof pe.Api.User&&Wo({isPremium:Boolean(t.premium)})}))}async function Xo(e,t={}){const{shouldThrow:s,shouldIgnoreUpdates:n,dcId:a,shouldIgnoreErrors:i,abortControllerChatId:o,abortControllerThreadId:r,shouldRetryOnTimeout:d,abortControllerGroup:u}=t,l=Boolean(t.shouldReturnTrue);let f;if(o){let e=Ho.get(o);e||(e=new No,Ho.set(o,e)),f=r?e.getThreadSignal(r):e.signal}if(u){let e=Oo.get(u);e||(e=new AbortController,Oo.set(u,e)),f=e.signal}try{c&&Ye("INVOKE",e.className);const t=await Lo.invoke(e,a,f,d);return ri(t),c&&Ye("RESPONSE",e.className,t),!n&&function(e){return e instanceof pe.Api.UpdatesTooLong||e instanceof pe.Api.UpdateShortMessage||e instanceof pe.Api.UpdateShortChatMessage||e instanceof pe.Api.UpdateShort||e instanceof pe.Api.UpdatesCombined||e instanceof pe.Api.Updates||e instanceof pe.Api.UpdateShortSentMessage}(t)&&Li(t),l?t&&!0:t}catch(t){if(i)return;if(c&&(Ye("INVOKE ERROR",e.className),console.debug("invokeRequest failed with payload",e),console.error(t)),s)throw t;return void function(e,t){const s=e.message.startsWith("A wait of")&&(t instanceof pe.Api.messages.SendMessage||t instanceof pe.Api.messages.SendMedia||t instanceof pe.Api.messages.SendMultiMedia),{message:n}=e;et({"@type":"error",error:{message:n,isSlowMode:s,hasErrorKey:!0}})}(t,e)}}function Yo(e,t){c&&Ye("BEACON",e.className),Lo.invokeBeacon(e,t)}async function Zo(e,t){try{return await Uo(e,Lo,t)}catch(s){if(s.message.startsWith("FILE_REFERENCE")){if(await ir({url:e.url}))return Uo(e,Lo,t);c&&console.error("Failed to repair file reference",e.url)}if("FILE_ID_INVALID"===s.message&&e.url.includes("avatar"))return void(c&&console.warn("Inaccessible avatar image",e.url));throw c&&console.error("Failed to download media",e.url,s),s}}function er(e,t){return Lo.uploadFile({file:e,onProgress:t,workers:h})}function tr(e){return Lo.updateTwoFaSettings(e)}function sr(e){const{chatId:t,threadId:s}=e,n=Ho.get(t);if(!s)return n?.abort("Chat change"),void Ho.delete(t);n?.abortThread(s,"Thread change")}function nr(e){Oo.get(e)?.abort(),Oo.delete(e)}async function ar(){const e=await Xo(new pe.Api.users.GetFullUser({id:new pe.Api.InputUserSelf}));if(!(e&&e.users[0]instanceof pe.Api.User))return;const t=e.users[0];$e(t);const s=Za(e),n=ei(t);var a;a=n.id,Ia=a,function(e,t){et({"@type":"updateCurrentUser",currentUser:e,currentUserFullInfo:t})}(n,s),jo=n.id,Wo({isPremium:Boolean(n.isPremium)})}async function ir({url:e}){const t=Vo(e);if(!t)return;const{entityId:s,mediaMatchType:n}=t;if("document"===n||"photo"===n||"webDocument"===n){const e="document"===n?De.documents[s]:"webDocument"===n?De.webDocuments[s]:De.photos[s];if(!e)return!1;const t=e;if(!t.localRepairInfo)return!1;const{localRepairInfo:a}=t;if("story"===a.type)return await async function(e,t){const s=Nt(e);if(!s)return!1;const n=await Xo(new pe.Api.stories.GetStoriesByID({peer:s,id:[t]}),{shouldIgnoreErrors:!0});return!!n&&(n.stories.forEach((t=>{const s=Na(e,t);s&&!("isDeleted"in s)&&(Le(t,e),et({"@type":"updateStory",peerId:e,story:s}))})),!0)}(a.peerId,a.id);if("message"===a.type)return await async function(e,t){const s=Ut(e),n=Nt(e);if(!n)return!1;const a=await Xo("channel"===s?new pe.Api.channels.GetMessages({channel:n,id:[new pe.Api.InputMessageID({id:t})]}):new pe.Api.messages.GetMessages({id:[new pe.Api.InputMessageID({id:t})]}),{shouldIgnoreErrors:!0});if(!a||a instanceof pe.Api.messages.MessagesNotModified)return!1;n&&"pts"in a&&ji(e,a.pts);const i=a.messages[0];if(i instanceof pe.Api.MessageEmpty)return!1;ci(i);const o=Ca(i);return o&&et({"@type":"updateMessage",chatId:o.chatId,id:o.id,message:o}),!0}(a.peerId,a.id)}return!1}function or(e){Lo.setForceHttpTransport(e)}function rr(e){Lo.setAllowHttpTransport(e)}function cr(e){Lo.setShouldDebugExportedSenders(e)}function dr(e){$i(e)}async function ur({peer:e,reason:t,description:s}){return await Xo(new pe.Api.account.ReportPeer({peer:Vt(e.id,e.accessHash),reason:es(t),message:s}))}async function lr({peer:e,photo:t,reason:s,description:n}){const a=$t(t);if(a)return await Xo(new pe.Api.account.ReportProfilePhoto({peer:Vt(e.id,e.accessHash),photoId:a,reason:es(s),message:n}))}async function fr({hash:e,areCallsEnabled:t,areSecretChatsEnabled:s,isConfirmed:n}){return await Xo(new pe.Api.account.ChangeAuthorizationSettings({hash:Se()(e),...void 0!==t?{callRequestsDisabled:!t}:void 0,...void 0!==s?{encryptedRequestsDisabled:!s}:void 0,...n&&{confirmed:n}}))}async function pr({days:e}){return await Xo(new pe.Api.account.SetAuthorizationTTL({authorizationTtlDays:e}))}async function gr({slug:e}){const t=await Xo(new pe.Api.account.ResolveBusinessChatLink({slug:e}),{shouldIgnoreErrors:!0});var s;if(t)return{chatLink:{chatId:ye((s=t).peer),text:zs(s.message,s.entities)}}}function hr({enabled:e}){return Xo(new pe.Api.account.ToggleSponsoredMessages({enabled:e}),{shouldReturnTrue:!0})}async function mr({limit:e,offsetDate:t,offsetPeer:s,offsetId:n,archived:a,withPinned:i,lastLocalServiceMessageId:o}){const r=s&&Vt(s.id,s.accessHash)||new pe.Api.InputPeerEmpty,c=await Xo(new pe.Api.messages.GetDialogs({offsetPeer:r,offsetId:n,limit:e,offsetDate:t,folderId:a?Z:void 0,...i&&{excludePinned:!0}})),d=i?await Xo(new pe.Api.messages.GetPinnedDialogs({folderId:a?Z:void 0})):void 0;if(!c||c instanceof pe.Api.messages.DialogsNotModified)return;const u=(d?d.messages:[]).concat(c.messages).map(Ca).filter(Boolean),l=dc(c);d&&Object.assign(l,dc(d,l));const f=[],p={},g=(d?.dialogs||[]).concat(c.dialogs),h=[],m={};g.forEach((e=>{if(!(e instanceof pe.Api.Dialog)||!a&&e.folderId===Z||a&&e.folderId!==Z)return;const t=bn(e,l[Pn(e.peer)]);if(m[t.id]=e.topMessage,e.pts&&ji(t.id,e.pts),t.id===J&&o&&o>e.topMessage&&(m[t.id]=o),t.isListed=!0,f.push(t),Mi(t.id,t.muteUntil,et),i&&e.pinned&&h.push(t.id),e.draft){const s=Ra(e.draft);s&&(p[t.id]=s)}}));const y=f.map((e=>e.id)),_=c.users.map(ei).filter(Boolean),b=si((d?.users||[]).concat(c.users));let w;w=c instanceof pe.Api.messages.DialogsSlice?c.count:y.length;const S=f[f.length-1],v=m[S?.id],I=v,A=S?.id,P=u.reverse().find((e=>e.chatId===S?.id&&e.id===v))?.date;return{chatIds:y,chats:f,users:_,userStatusesById:b,draftsById:p,orderedPinnedIds:i?h:void 0,totalChatCount:w,lastMessageByChatId:m,messages:u,nextOffsetId:I,nextOffsetPeerId:A,nextOffsetDate:P}}async function yr({limit:e,offsetDate:t,offsetPeer:s,offsetId:n,withPinned:a}){const i=s&&Vt(s.id,s.accessHash)||new pe.Api.InputPeerEmpty,o=await Xo(new pe.Api.messages.GetSavedDialogs({offsetPeer:i,offsetId:n,limit:e,offsetDate:t,...a&&{excludePinned:!0}})),r=a?await Xo(new pe.Api.messages.GetPinnedSavedDialogs):void 0;if(!o||o instanceof pe.Api.messages.SavedDialogsNotModified)return;const c=r&&!(r instanceof pe.Api.messages.SavedDialogsNotModified),d=(c?r.messages:[]).concat(o.messages).map(Ca).filter(Boolean),u=dc(o);c&&Object.assign(u,dc(r,u));const l=(c?r.dialogs:[]).concat(o.dialogs),f=[],p=[],g={},h=[];l.forEach((e=>{const t=function(e,t){const{peer:s}=e;return{id:ye(s),type:An(t),title:Cn(s,t),..._n(t)}}(e,u[Pn(e.peer)]),s=ye(e.peer);f.push(s),a&&e.pinned&&p.push(s),g[s]=e.topMessage,h.push(t)}));const m=o.users.map(ei).filter(Boolean),y=si((c?r.users:[]).concat(o.users));let _;_=o instanceof pe.Api.messages.SavedDialogsSlice?o.count:f.length;const b=h[h.length-1],w=g[b?.id],S=w,v=b?.id,I=d.reverse().find((e=>e.chatId===b?.id&&e.id===w))?.date;return{chatIds:f,chats:h,users:m,userStatusesById:y,orderedPinnedIds:a?p:void 0,totalChatCount:_,lastMessageByChatId:g,messages:d,draftsById:{},nextOffsetId:S,nextOffsetPeerId:v,nextOffsetDate:I}}function _r(e){const{id:t,accessHash:s}=e;return Ft(t,s)instanceof pe.Api.InputChannel?async function(e){const{id:t,adminRights:s}=e,n=e.accessHash,a=await Xo(new pe.Api.channels.GetFullChannel({channel:Ft(t,n)}));if(!(a&&a.fullChat instanceof pe.Api.ChannelFull))return;const{about:i,onlineCount:o,exportedInvite:r,slowmodeSeconds:c,slowmodeNextSendDate:d,migratedFromChatId:u,migratedFromMaxId:l,canViewParticipants:f,canViewStats:p,linkedChatId:g,hiddenPrehistory:h,call:m,botInfo:y,availableReactions:_,reactionsLimit:b,defaultSendAs:w,requestsPending:S,recentRequesters:v,statsDc:I,participantsCount:A,stickerset:P,chatPhoto:C,participantsHidden:M,translationsDisabled:R,storiesPinnedAvailable:k,viewForumAsMessages:T,emojiset:E,boostsApplied:B,boostsUnrestrict:D,botVerification:U,canViewRevenue:x,paidReactionsAvailable:V,hasScheduled:N}=a.fullChat;C&&je(C);const F=r instanceof pe.Api.ChatInviteExported?r.link:void 0,{members:G,userStatusesById:q}=f&&await Zr(t,n)||{},{members:H,userStatusesById:O}=f&&s&&await Zr(t,n,"kicked")||{},{members:L,userStatusesById:j}=f&&await Zr(t,n,"admin")||{},W=y?Dn(y):void 0,z=e.isNotJoined||"chatTypeChannel"!==e.type?void 0:await ec({chat:e}),K=z?.member,$=K?.joinedDate?{joinedDate:K.joinedDate,inviter:K.inviterId,isViaRequest:K.isViaRequest}:void 0,J=a.chats.map((e=>In(e))).filter(Boolean);if(a?.chats?.length>1){const[,e]=a.chats,t=In(e);t&&et({"@type":"updateChat",id:t.id,chat:t})}a.fullChat.pts&&ji(e.id,a.fullChat.pts);const Q={...q,...O,...j};return{fullInfo:{...C instanceof pe.Api.Photo&&{profilePhoto:ks(C)},about:i,onlineCount:o,inviteLink:F,slowMode:c?{seconds:c,nextSendDate:d}:void 0,migratedFrom:u?{chatId:me(u,"chat"),maxMessageId:l}:void 0,canViewMembers:f,canViewStatistics:p,canViewMonetization:x,isPreHistoryHidden:h,joinInfo:$,members:G,kickedMembers:H,adminMembersById:L?bt(L,"userId"):void 0,groupCallId:m?String(m.id):void 0,linkedChatId:g?me(g,"channel"):void 0,botCommands:W,enabledReactions:Vn(_),reactionsLimit:b,sendAsId:w?ye(w):void 0,requestsPending:S,recentRequesterIds:v?.map((e=>me(e,"user"))),statisticsDcId:I,stickerSet:P?Hs(P):void 0,emojiSet:E?Hs(E):void 0,areParticipantsHidden:M,isTranslationDisabled:R,hasPinnedStories:Boolean(k),boostsApplied:B,boostsToUnrestrict:D,botVerification:U&&Fs(U),isPaidReactionAvailable:V,hasScheduledMessages:N},chats:J,userStatusesById:Q,groupCall:m?{chatId:t,isLoaded:!1,id:m.id.toString(),accessHash:m?.accessHash.toString(),participants:{},version:0,participantsCount:0,connectionState:"disconnected"}:void 0,membersCount:A,...T&&{isForumAsMessages:!0}}}(e):async function(e){const t=await Xo(new pe.Api.messages.GetFullChat({chatId:Ft(e)}));if(!(t&&t.fullChat instanceof pe.Api.ChatFull))return;const{about:s,participants:n,exportedInvite:a,botInfo:i,call:o,availableReactions:r,recentRequesters:c,requestsPending:d,chatPhoto:u,translationsDisabled:l,reactionsLimit:f,hasScheduled:p}=t.fullChat;u&&je(u);const g=kn(n),h=g?g.filter((({isAdmin:e,isOwner:t})=>e||t)):void 0,m=i?Dn(i):void 0,y=a instanceof pe.Api.ChatInviteExported?a.link:void 0,_=si(t.users),b=t.chats.map((e=>In(e))).filter(Boolean);return{fullInfo:{...u instanceof pe.Api.Photo&&{profilePhoto:ks(u)},about:s,members:g,adminMembersById:h?bt(h,"userId"):void 0,canViewMembers:!0,botCommands:m,inviteLink:y,groupCallId:o?.id.toString(),enabledReactions:Vn(r),reactionsLimit:f,requestsPending:d,recentRequesterIds:c?.map((e=>me(e,"user"))),isTranslationDisabled:l,isPreHistoryHidden:!0,hasScheduledMessages:p},chats:b,userStatusesById:_,groupCall:o?{chatId:e,isLoaded:!1,id:o.id.toString(),accessHash:o.accessHash.toString(),connectionState:"disconnected",participantsCount:0,version:0,participants:{}}:void 0,membersCount:g?.length}}(t)}async function br(e){const{id:t,accessHash:s}=e,n=await Xo(new pe.Api.messages.GetPeerSettings({peer:Vt(t,s)}),{abortControllerChatId:t});if(n)return{settings:xn(n.settings)}}async function wr({query:e}){const t=await Xo(new pe.Api.contacts.Search({q:e,limit:m}));if(!t)return;const s=t.myResults.map(ye),n=t.results.map(ye).filter((e=>!s.includes(e)));return{accountResultIds:s,globalResultIds:n}}async function Sr({type:e,user:t}){let s;if("self"===e||"user"===e){const n=await Xo(new pe.Api.users.GetUsers({id:["user"===e&&t?Ft(t.id,t.accessHash):new pe.Api.InputUserSelf]}));if(!n||!n.length)return;[s]=n}else if("support"===e){const e=await Xo(new pe.Api.help.GetSupport);if(!e||!e.user)return;s=e.user}const n=In(s,"support"===e);if(n)return et({"@type":"updateChat",id:n.id,chat:n}),{chatId:n.id}}async function vr({chat:e,lastLocalMessage:t,noLastMessage:s}){const{id:n,accessHash:a}=e,i=await Xo(new pe.Api.messages.GetPeerDialogs({peers:[new pe.Api.InputDialogPeer({peer:Vt(n,a)})]}));if(!i)return;const o=i.dialogs[0];if(!(o&&o instanceof pe.Api.Dialog))return;const r=dc(i)[Pn(o.peer)];if(!r)return;const c=Ca(i.messages[0]),d=t&&(!c||t.date>c.date)?t:c,u=bn(o,r);et({"@type":"updateChat",id:n,chat:u}),!s&&d&&et({"@type":"updateChatLastMessage",id:n,lastMessage:d}),Oi(i.state),Mi(u.id,u.muteUntil,et)}function Ir({chat:e,draft:t}){return Xo(new pe.Api.messages.SaveDraft({peer:Vt(e.id,e.accessHash),message:t?.text?.text||"",entities:t?.text?.entities?.map(Kt),replyTo:t?.replyInfo&&ls(t.replyInfo)}))}async function Ar({chat:e,isMuted:t,muteUntil:s=0}){t&&!s&&(s=B),await Xo(new pe.Api.account.UpdateNotifySettings({peer:new pe.Api.InputNotifyPeer({peer:Vt(e.id,e.accessHash)}),settings:new pe.Api.InputPeerNotifySettings({muteUntil:s})})),et({"@type":"updateNotifyExceptions",chatId:e.id,isMuted:t}),vr({chat:e,noLastMessage:!0})}async function Pr({chat:e,topicId:t,isMuted:s,muteUntil:n=0}){s&&!n&&(n=B),await Xo(new pe.Api.account.UpdateNotifySettings({peer:new pe.Api.InputNotifyForumTopic({peer:Vt(e.id,e.accessHash),topMsgId:t}),settings:new pe.Api.InputPeerNotifySettings({muteUntil:n})})),et({"@type":"updateTopicNotifyExceptions",chatId:e.id,topicId:t,isMuted:s})}async function Cr({title:e,about:t="",users:s}){const n=await Xo(new pe.Api.channels.CreateChannel({broadcast:!0,title:e,about:t}),{shouldThrow:!0});if(!(n instanceof pe.Api.Updates))return void(c&&console.error("Unexpected channel creation update",n));const a=n.chats[0];if(!(a&&a instanceof pe.Api.Channel))return void(c&&console.error("Created channel not found",n));const i=In(a);let o;if(s?.length){const e=await Xo(new pe.Api.channels.InviteToChannel({channel:Ft(i.id,i.accessHash),users:s.map((({id:e,accessHash:t})=>Ft(e,t)))}));if(!e)return;Qo(e.updates),o=e.missingInvitees.map(qn)}return{channel:i,missingUsers:o}}function Mr({channelId:e,accessHash:t}){return Xo(new pe.Api.channels.JoinChannel({channel:Ft(e,t)}),{shouldReturnTrue:!0,shouldThrow:!0})}function Rr({chat:e,user:t}){if("chatTypeBasicGroup"===e.type)return Xo(new pe.Api.messages.DeleteChatUser({chatId:Ft(e.id,e.accessHash),userId:Ft(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function kr({chatId:e}){return Xo(new pe.Api.messages.DeleteChat({chatId:Ft(e)}),{shouldReturnTrue:!0})}function Tr({channelId:e,accessHash:t}){return Xo(new pe.Api.channels.LeaveChannel({channel:Ft(e,t)}),{shouldReturnTrue:!0})}function Er({channelId:e,accessHash:t}){return Xo(new pe.Api.channels.DeleteChannel({channel:Ft(e,t)}),{shouldReturnTrue:!0})}async function Br({title:e,users:t}){const s=await Xo(new pe.Api.messages.CreateChat({title:e,users:t.map((({id:e,accessHash:t})=>Ft(e,t)))}));if(!s)return;Qo(s.updates);const n=s.missingInvitees.map(qn),a=s.updates.chats[0];if(a&&a instanceof pe.Api.Chat)return{chat:In(a),missingUsers:n};c&&console.error("Created chat not found",s.updates)}async function Dr({chatId:e,accessHash:t,photo:s}){const n=Ft(e,t);let a;if(s instanceof File){const e=await er(s);a=new pe.Api.InputChatUploadedPhoto({file:e})}else if(s){const e=$t(s);if(!e)return!1;a=new pe.Api.InputChatPhoto({id:e})}else a=new pe.Api.InputChatPhotoEmpty;return Xo(n instanceof pe.Api.InputChannel?new pe.Api.channels.EditPhoto({channel:n,photo:a}):new pe.Api.messages.EditChatPhoto({chatId:n,photo:a}),{shouldReturnTrue:!0})}async function Ur({chat:e,shouldBePinned:t}){const{id:s,accessHash:n}=e;await Xo(new pe.Api.messages.ToggleDialogPin({peer:new pe.Api.InputDialogPeer({peer:Vt(s,n)}),pinned:t||void 0}))&&et({"@type":"updateChatPinned",id:e.id,isPinned:t})}async function xr({chat:e,shouldBePinned:t}){const{id:s,accessHash:n}=e;await Xo(new pe.Api.messages.ToggleSavedDialogPin({peer:new pe.Api.InputDialogPeer({peer:Vt(s,n)}),pinned:t||void 0}))&&et({"@type":"updateSavedDialogPinned",id:e.id,isPinned:t})}function Vr({chat:e,folderId:t}){const{id:s,accessHash:n}=e;return Xo(new pe.Api.folders.EditPeerFolders({folderPeers:[new pe.Api.InputFolderPeer({peer:Vt(s,n),folderId:t})]}),{shouldReturnTrue:!0})}async function Nr(){const e=await Xo(new pe.Api.messages.GetDialogFilters);if(!e)return;const{filters:t}=e,s=t.findIndex((e=>e instanceof pe.Api.DialogFilterDefault)),n=t.filter(qe),a=n.map((({id:e})=>e));return-1!==s&&a.splice(s,0,Y),{byId:bt(n.map(En),"id"),orderedIds:a}}async function Fr(){const e=await Xo(new pe.Api.messages.GetSuggestedDialogFilters);if(e)return e.map(Bn).filter(Boolean)}async function Gr({id:e,folderUpdate:t}){t.excludedChatIds=t.excludedChatIds.filter((e=>!t.includedChatIds.includes(e)));const s=function(e){const{emoticon:t,contacts:s,nonContacts:n,groups:a,channels:i,bots:o,excludeArchived:r,excludeMuted:c,excludeRead:d,pinnedChatIds:u,includedChatIds:l,excludedChatIds:f,noTitleAnimations:p}=e,g=u?u.map(Nt).filter(Boolean):[],h=l?l.map(Nt).filter(Boolean):[],m=f?f.map(Nt).filter(Boolean):[];return e.isChatList?new pe.Api.DialogFilterChatlist({id:e.id,title:ds(e.title),emoticon:t||void 0,pinnedPeers:g,includePeers:h,hasMyInvites:e.hasMyInvites,titleNoanimate:p}):new pe.Api.DialogFilter({id:e.id,title:ds(e.title),emoticon:t||void 0,contacts:s||void 0,nonContacts:n||void 0,groups:a||void 0,bots:o||void 0,excludeArchived:r||void 0,excludeMuted:c||void 0,excludeRead:d||void 0,broadcasts:i||void 0,pinnedPeers:g,includePeers:h,excludePeers:m,titleNoanimate:p})}(t);await Xo(new pe.Api.messages.UpdateDialogFilter({id:e,filter:s}))&&et({"@type":"updateChatFolder",id:e,folder:t})}async function qr(e){const t=await Xo(new pe.Api.messages.UpdateDialogFilter({id:e,filter:void 0})),s=await Fr();t&&et({"@type":"updateChatFolder",id:e,folder:void 0}),s&&et({"@type":"updateRecommendedChatFolders",folders:s})}function Hr(e){return Xo(new pe.Api.messages.UpdateDialogFiltersOrder({order:e}))}async function Or({chat:e,hasUnreadMark:t}){const{id:s,accessHash:n}=e;await Xo(new pe.Api.messages.MarkDialogUnread({peer:new pe.Api.InputDialogPeer({peer:Vt(s,n)}),unread:t||void 0}))&&et({"@type":"updateChat",id:e.id,chat:{hasUnreadMark:t}})}async function Lr(e){return Wr(await Xo(new pe.Api.contacts.ResolvePhone({phone:e})))}async function jr(e,t){return Wr(await Xo(new pe.Api.contacts.ResolveUsername({username:e,referer:t})))}function Wr(e){if(!e)return;const{users:t,chats:s}=e,n=s.length?In(s[0]):In(t[0]);return n?{chat:n,user:ei(t[0])}:void 0}function zr({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e,a=Ft(s,n);return Xo(new pe.Api.channels.TogglePreHistoryHidden({channel:a,enabled:t}),{shouldReturnTrue:!0})}function Kr({chat:e,bannedRights:t}){const{id:s,accessHash:n}=e,a=Vt(s,n);return Xo(new pe.Api.messages.EditChatDefaultBannedRights({peer:a,bannedRights:Qt(t)}),{shouldReturnTrue:!0})}function $r({chat:e,user:t,bannedRights:s,untilDate:n}){const a=Ft(e.id,e.accessHash),i=Vt(t.id,t.accessHash);return Xo(new pe.Api.channels.EditBanned({channel:a,participant:i,bannedRights:Qt(s,n)}),{shouldReturnTrue:!0})}function Jr({chat:e,user:t,adminRights:s,customTitle:n=""}){const a=Ft(e.id,e.accessHash),i=Ft(t.id,t.accessHash);return Xo(new pe.Api.channels.EditAdmin({channel:a,userId:i,adminRights:Xt(s),rank:n}),{shouldReturnTrue:!0})}async function Qr(e,t){const s=Ft(e.id,e.accessHash);await Xo(s instanceof pe.Api.InputChannel?new pe.Api.channels.EditTitle({channel:s,title:t}):new pe.Api.messages.EditChatTitle({chatId:s,title:t}),{shouldReturnTrue:!0})}async function Xr(e,t){await Xo(new pe.Api.messages.EditChatAbout({peer:Vt(e.id,e.accessHash),about:t}))&&et({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function Yr({chat:e,areSignaturesEnabled:t,areProfilesEnabled:s}){const{id:n,accessHash:a}=e,i=Ft(n,a);return Xo(new pe.Api.channels.ToggleSignatures({channel:i,signaturesEnabled:t||void 0,profilesEnabled:s||void 0}),{shouldReturnTrue:!0})}async function Zr(e,t,s="recent",n){let a;switch(s){case"kicked":a=new pe.Api.ChannelParticipantsKicked({q:""});break;case"admin":a=new pe.Api.ChannelParticipantsAdmins;break;default:a=new pe.Api.ChannelParticipantsRecent}const i=await Xo(new pe.Api.channels.GetParticipants({channel:Ft(e,t),filter:a,offset:n,limit:y}),{abortControllerChatId:e});if(!i||i instanceof pe.Api.channels.ChannelParticipantsNotModified)return;const o=si(i.users);return{members:kn(i),userStatusesById:o}}async function ec({chat:e,peer:t}){const s=t?Vt(t.id,t.accessHash):new pe.Api.InputPeerSelf,n=await Xo(new pe.Api.channels.GetParticipant({channel:Ft(e.id,e.accessHash),participant:s}),{abortControllerChatId:e.id});if(!n)return;const a=si(n.users),i=Rn(n.participant);return i?{member:i,userStatusesById:a}:void 0}async function tc(){const e=await Xo(new pe.Api.channels.GetGroupsForDiscussion);if(e)return e.chats.map((e=>In(e)))}function sc({channel:e,chat:t}){return Xo(new pe.Api.channels.SetDiscussionGroup({broadcast:Vt(e.id,e.accessHash),group:t?Vt(t.id,t.accessHash):new pe.Api.InputChannelEmpty}),{shouldReturnTrue:!0})}async function nc(e){const t=await Xo(new pe.Api.messages.MigrateChat({chatId:Ft(e.id)}),{shouldThrow:!0});if(!(t&&t instanceof pe.Api.Updates))return void(c&&console.error("Unexpected channel creation update",t));const s=t.updates.find((e=>e instanceof pe.Api.UpdateChannel)).channelId;return In(t.chats.find((e=>e instanceof pe.Api.Channel&&e.id.toString()===s.toString())))}async function ac(e){const t=await Xo(new pe.Api.messages.CheckChatInvite({hash:e}));if(!t)return;if(t instanceof pe.Api.ChatInvite)return{chat:void 0,invite:Hn(t),users:t.participants?.map(ei).filter(Boolean)};const s=In(t.chat);return s?{chat:s,invite:void 0,users:void 0}:void 0}async function ic(e,t){try{if("chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type){const s=await Xo(new pe.Api.channels.InviteToChannel({channel:Ft(e.id,e.accessHash),users:t.map((e=>Ft(e.id,e.accessHash)))}));if(!s)return;return Qo(s.updates),s.missingInvitees.map(qn)}const s=await Promise.all(t.map((async t=>{const s=await Xo(new pe.Api.messages.AddChatUser({chatId:Ft(e.id),userId:Ft(t.id,t.accessHash)}));if(s)return Qo(s.updates),s.missingInvitees.map(qn)})));if(s)return s.flat().filter(Boolean)}catch(e){et({"@type":"error",error:{message:e.message}})}}function oc(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?$r({chat:e,user:t,bannedRights:{viewMessages:!0,sendMessages:!0,sendMedia:!0,sendStickers:!0,sendGifs:!0,sendGames:!0,sendInline:!0,embedLinks:!0,sendPolls:!0,changeInfo:!0,inviteUsers:!0,pinMessages:!0,manageTopics:!0,sendPhotos:!0,sendVideos:!0,sendRoundvideos:!0,sendAudios:!0,sendVoices:!0,sendDocs:!0,sendPlain:!0},untilDate:B}):Xo(new pe.Api.messages.DeleteChatUser({chatId:Ft(e.id),userId:Ft(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function rc(e,t){return Xo(new pe.Api.channels.ToggleJoinToSend({channel:Ft(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function cc(e,t){return Xo(new pe.Api.channels.ToggleJoinRequest({channel:Ft(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function dc(e,t){const s={};return e.chats?.forEach((e=>{const n=`chat${e.id}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)})),e.users?.forEach((e=>{const n=`user${e.id}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)})),s}async function uc({hash:e}){const t=await Xo(new pe.Api.messages.ImportChatInvite({hash:e}));if(t instanceof pe.Api.Updates&&t.chats.length)return In(t.chats[0])}function lc({chat:e,enabledReactions:t,reactionsLimit:s}){return Xo(new pe.Api.messages.SetChatAvailableReactions({peer:Vt(e.id,e.accessHash),availableReactions:(n=t,"all"===n?.type?new pe.Api.ChatReactionsAll({allowCustom:n.areCustomAllowed}):"some"===n?.type?new pe.Api.ChatReactionsSome({reactions:n.allowed.map(rs)}):new pe.Api.ChatReactionsNone),reactionsLimit:s}),{shouldReturnTrue:!0});var n}function fc({chat:e,isProtected:t}){const{id:s,accessHash:n}=e;return Xo(new pe.Api.messages.ToggleNoForwards({peer:Vt(s,n),enabled:t}),{shouldReturnTrue:!0})}function pc({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e;return Xo(new pe.Api.channels.ToggleParticipantsHidden({channel:Vt(s,n),enabled:t}),{shouldReturnTrue:!0})}function gc({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e;return Xo(new pe.Api.channels.ToggleForum({channel:Vt(s,n),enabled:t}),{shouldReturnTrue:!0,shouldThrow:!0})}async function hc({chat:e,title:t,iconColor:s,iconEmojiId:n,sendAs:a}){const{id:i,accessHash:o}=e,r=await Xo(new pe.Api.channels.CreateForumTopic({channel:Vt(i,o),title:t,iconColor:s,iconEmojiId:n?Se()(n):void 0,sendAs:a?Vt(a.id,a.accessHash):void 0,randomId:Lt()}));if(r instanceof pe.Api.Updates&&r.updates.length)return r.updates?.find((e=>e instanceof pe.Api.UpdateMessageID))?.id}async function mc({chat:e,query:t,offsetTopicId:s,offsetId:n,offsetDate:a,limit:i=k}){const{id:o,accessHash:r}=e,c=await Xo(new pe.Api.channels.GetForumTopics({channel:Vt(o,r),limit:i,q:t,offsetTopic:s,offsetId:n,offsetDate:a}));if(!c)return;const{count:d,orderByCreateDate:u}=c;return{topics:c.topics.map(Fn).filter(Boolean),messages:c.messages.map(Ca).filter(Boolean),count:d+1,shouldOrderByCreateDate:u,draftsById:c.topics.reduce(((e,t)=>(t instanceof pe.Api.ForumTopic&&t.draft&&(e[t.id]=Ra(t.draft)),e)),{}),readInboxMessageIdByTopicId:c.topics.reduce(((e,t)=>(t instanceof pe.Api.ForumTopic&&t.readInboxMaxId&&(e[t.id]=t.readInboxMaxId),e)),{})}}async function yc({chat:e,topicId:t}){const{id:s,accessHash:n}=e,a=await Xo(new pe.Api.channels.GetForumTopicsByID({channel:Vt(s,n),topics:[t]}));if(!(a?.topics.length&&a.topics[0]instanceof pe.Api.ForumTopic))return;const i=a.messages.map(Ca).filter(Boolean);return{topic:Fn(a.topics[0]),messages:i}}async function _c({chat:e,topicId:t}){const{id:s,accessHash:n}=e,a=await Xo(new pe.Api.channels.DeleteTopicHistory({channel:Vt(s,n),topMsgId:t}));a&&(to(e,a),a.offset&&await _c({chat:e,topicId:t}))}function bc({chat:e,topicId:t,isPinned:s}){const{id:n,accessHash:a}=e;return Xo(new pe.Api.channels.UpdatePinnedForumTopic({channel:Vt(n,a),topicId:t,pinned:s}),{shouldReturnTrue:!0})}function wc({chat:e,topicId:t,title:s,iconEmojiId:n,isClosed:a,isHidden:i}){const{id:o,accessHash:r}=e;return Xo(new pe.Api.channels.EditForumTopic({channel:Vt(o,r),topicId:t,title:s,iconEmojiId:t!==se&&n?Se()(n):void 0,closed:a,hidden:i}),{shouldReturnTrue:!0})}async function Sc({slug:e}){const t=await Xo(new pe.Api.chatlists.CheckChatlistInvite({slug:e})),s=function(e,t){return e instanceof pe.Api.chatlists.ChatlistInvite?{slug:t,title:xs(e.title),noTitleAnimations:e.titleNoanimate,emoticon:e.emoticon,peerIds:e.peers.map(ye).filter(Boolean)}:e instanceof pe.Api.chatlists.ChatlistInviteAlready?{slug:t,folderId:e.filterId,missingPeerIds:e.missingPeers.map(ye).filter(Boolean),alreadyPeerIds:e.alreadyPeers.map(ye).filter(Boolean)}:void 0}(t,e);if(t&&s)return{invite:s}}function vc({slug:e,peers:t}){return Xo(new pe.Api.chatlists.JoinChatlistInvite({slug:e,peers:t.map((e=>Vt(e.id,e.accessHash)))}),{shouldReturnTrue:!0,shouldThrow:!0})}async function Ic({folderId:e}){const t=await Xo(new pe.Api.chatlists.GetLeaveChatlistSuggestions({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e})}));if(t)return t.map(ye)}function Ac({folderId:e,peers:t}){return Xo(new pe.Api.chatlists.LeaveChatlist({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e}),peers:t.map((e=>Vt(e.id,e.accessHash)))}),{shouldReturnTrue:!0})}async function Pc({folderId:e,title:t,peers:s}){const n=await Xo(new pe.Api.chatlists.ExportChatlistInvite({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e}),title:t||"",peers:s.map((e=>Vt(e.id,e.accessHash)))}),{shouldThrow:!0});if(n&&!(n.filter instanceof pe.Api.DialogFilterDefault))return{filter:En(n.filter),invite:Gn(n.invite)}}function Cc({folderId:e,slug:t}){return Xo(new pe.Api.chatlists.DeleteExportedInvite({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e}),slug:t}))}async function Mc({folderId:e,slug:t,title:s,peers:n}){const a=await Xo(new pe.Api.chatlists.EditExportedInvite({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e}),slug:t,title:s,peers:n.map((e=>Vt(e.id,e.accessHash)))}),{shouldThrow:!0});if(a)return Gn(a)}async function Rc({folderId:e}){const t=await Xo(new pe.Api.chatlists.GetExportedInvites({chatlist:new pe.Api.InputChatlistDialogFilter({filterId:e})}));if(t)return{invites:t.invites.map(Gn).filter(Boolean)}}function kc({chat:e,isEnabled:t}){return Xo(new pe.Api.messages.TogglePeerTranslations({disabled:!t||void 0,peer:Vt(e.id,e.accessHash)}))}function Tc({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e,a=Ft(s,n);return Xo(new pe.Api.channels.ToggleViewForumAsMessages({channel:a,enabled:Boolean(t)}),{shouldReturnTrue:!0})}async function Ec({chat:e}){const t=await Xo(new pe.Api.channels.GetChannelRecommendations({channel:e&&Ft(e.id,e.accessHash)}));if(!t)return;const s=t?.chats.map((e=>In(e))).filter(Boolean);return{similarChannels:s,count:t instanceof pe.Api.messages.ChatsSlice?t.count:s.length}}var Bc=s(48287).hp;const Dc=1e3,Uc=63;async function xc({chat:e,threadId:t,offsetId:s,isSavedDialog:n,...a}){const i=t===ut?pe.Api.messages.GetHistory:n?pe.Api.messages.GetSavedHistory:pe.Api.messages.GetReplies;let o;try{o=await Xo(new i({peer:Vt(e.id,e.accessHash),...t!==ut&&!n&&{msgId:Number(t)},...s&&{offsetId:Math.min(s,B)},...a}),{shouldThrow:!0,abortControllerChatId:e.id,abortControllerThreadId:t})}catch(t){"CHANNEL_PRIVATE"===t.message&&et({"@type":"updateChat",id:e.id,chat:{isRestricted:!0}})}if(o&&!(o instanceof pe.Api.messages.MessagesNotModified)&&o.messages)return{messages:o.messages.map(Ca).filter(Boolean),users:o.users.map(ei).filter(Boolean),chats:o.chats.map((e=>In(e))).filter(Boolean),count:!(o instanceof pe.Api.messages.Messages)&&o.count}}async function Vc({chat:e,messageId:t}){const s="channel"===Ut(e.id);let n;try{n=await Xo(s?new pe.Api.channels.GetMessages({channel:Ft(e.id,e.accessHash),id:[new pe.Api.InputMessageID({id:t})]}):new pe.Api.messages.GetMessages({id:[new pe.Api.InputMessageID({id:t})]}),{shouldThrow:!0,abortControllerChatId:e.id})}catch(e){const{message:t}=e;"CHANNEL_PRIVATE"!==t&&et({"@type":"error",error:{message:t,isSlowMode:!1,hasErrorKey:!0}})}if(!n||n instanceof pe.Api.messages.MessagesNotModified)return;"pts"in n&&ji(e.id,n.pts);const a=n.messages[0];if(!a)return;if(a instanceof pe.Api.MessageEmpty)return lt;ci(a);const i=Ca(a);return i?{message:i}:void 0}let Nc=Promise.resolve();function Fc({chat:e,lastMessageId:t,text:s,entities:n,replyInfo:a,attachment:i,sticker:o,story:r,gif:d,poll:u,contact:l,isSilent:f,scheduledAt:p,groupedId:g,noWebPage:h,sendAs:m,shouldUpdateStickerSetOrder:y,wasDrafted:_,isInvertedMedia:b,effectId:w,webPageMediaSize:S,webPageUrl:v},I){const{message:A,poll:P}=function(e,t,s,n,a,i,o,r,c,d,u,l,f,p,g,h){const m=Pa(t),y=i&&Ba(i),_="chatTypeChannel"===e.type,b=a&&(I=a,A=e.isForum,"story"===I.type?{type:"story",peerId:I.peerId,storyId:I.storyId}:{type:"message",replyToMsgId:I.replyToMsgId,replyToTopId:I.replyToTopId,replyToPeerId:I.replyToPeerId,quoteText:I.quoteText,isForumTopic:!(!A||!I.replyToTopId)||void 0,...Boolean(I.quoteText)&&{isQuote:!0}}),w=c&&function(e,t){return{mediaType:"poll",id:String(t),summary:St(e.summary,["question","answers"]),results:{}}}(c,m),S={id:m,chatId:e.id,content:At({text:s?{text:s,entities:n}:void 0,...y,sticker:o,video:r||y?.video,contact:d,storyData:p&&{mediaType:"storyData",...p},pollId:w?.id}),date:l||Math.round(Date.now()/1e3)+Rt(),isOutgoing:!_,senderId:f?.id||Ia,replyInfo:b,...u&&{groupedId:u,...y&&(y.photo||y.video)&&{isInAlbum:!0}},...l&&{isScheduled:!0},isForwardingAllowed:!0,isInvertedMedia:g,effectId:h},v=_t(S.content,S.groupedId);var I,A;return{message:{...S,...v&&{emojiOnlyCount:v}},poll:w}}(e,t,s,n,a,i,o,d,u,l,g,p,m,r,b,w);et({"@type":A.isScheduled?"newScheduledMessage":"newMessage",id:A.id,chatId:e.id,message:A,poll:P,wasDrafted:_});const C=setTimeout((()=>{et({"@type":A.isScheduled?"updateScheduledMessage":"updateMessage",id:A.id,chatId:e.id,message:{sendingState:"messageSendingStatePending"}})}),Dc),M=Lt();if(g)return function({chat:e,text:t,entities:s,replyInfo:n,attachment:a,groupedId:i,isSilent:o,scheduledAt:r,sendAs:d},u,l,f){let p=-1;Gc[i]||(Gc[i]={counter:0,singleMediaByIndex:{},localMessages:{}}),p=Gc[i].counter++;const g=Nc;return Nc=(async()=>{let h;try{h=await Oc(l,a,f)}catch(e){return c&&console.warn(e),Gc[i].counter--,void await g}const m=await async function(e,t){const s=await Xo(new pe.Api.messages.UploadMedia({peer:e,media:t})),n=t.spoiler;if(s instanceof pe.Api.MessageMediaPhoto&&s.photo&&s.photo instanceof pe.Api.Photo){const{photo:{id:e,accessHash:t,fileReference:a}}=s;return new pe.Api.InputMediaPhoto({id:new pe.Api.InputPhoto({id:e,accessHash:t,fileReference:a}),spoiler:n})}if(s instanceof pe.Api.MessageMediaDocument&&s.document&&s.document instanceof pe.Api.Document){const{document:{id:e,accessHash:t,fileReference:a}}=s;return new pe.Api.InputMediaDocument({id:new pe.Api.InputDocument({id:e,accessHash:t,fileReference:a}),spoiler:n})}}(Vt(e.id,e.accessHash),h);if(await g,!m)return Gc[i].counter--,void(c&&console.warn("Failed to upload grouped media"));if(Gc[i].singleMediaByIndex[p]=new pe.Api.InputSingleMedia({media:m,randomId:u,message:t||"",entities:s?s.map(Kt):void 0}),Gc[i].localMessages[u.toString()]=l,Object.keys(Gc[i].singleMediaByIndex).length<Gc[i].counter)return;const{singleMediaByIndex:y,localMessages:_}=Gc[i];delete Gc[i];const b=await Xo(new pe.Api.messages.SendMultiMedia({clearDraft:!0,peer:Vt(e.id,e.accessHash),multiMedia:Object.values(y),replyTo:n&&ls(n),...o&&{silent:o},...r&&{scheduleDate:r},...d&&{sendAs:Vt(d.id,d.accessHash)}}),{shouldIgnoreUpdates:!0});b&&Td(_,b)})(),Nc}({chat:e,text:s,entities:n,replyInfo:a,attachment:i,groupedId:g,isSilent:f,scheduledAt:p},M,A,I);const R=(async()=>{let t;if(i)try{t=await Oc(A,i,I)}catch(e){return c&&console.warn(e),void await Nc}else o?t=Ht(o):d?t=Ht(d):u?t=function(e,t){const{summary:s,quiz:n}=e,a=new pe.Api.Poll({id:t,publicVoters:s.isPublic,question:ds(s.question),answers:s.answers.map((({text:e,option:t})=>new pe.Api.PollAnswer({text:ds(e),option:Xe(t)}))),quiz:s.quiz,multipleChoice:s.multipleChoice});if(!n)return new pe.Api.InputMediaPoll({poll:a});const i=n.correctAnswers.map(Xe),{solution:o}=n,r=n.solutionEntities?n.solutionEntities.map(Kt):[];return new pe.Api.InputMediaPoll({poll:a,correctAnswers:i,...o&&{solution:o,solutionEntities:r}})}(u,M):r?t=function(e){const t=Nt(e.peerId);return new pe.Api.InputMediaStory({peer:t,id:e.id})}(r):v&&S?t=new pe.Api.InputMediaWebPage({url:v,forceLargeMedia:"large"===S||void 0,forceSmallMedia:"small"===S||void 0}):l&&(t=new pe.Api.InputMediaContact({phoneNumber:l.phoneNumber,firstName:l.firstName,lastName:l.lastName,vcard:""}));const g=t?pe.Api.messages.SendMedia:pe.Api.messages.SendMessage;try{const i=await Xo(new g({clearDraft:!0,message:s||"",entities:n?n.map(Kt):void 0,peer:Vt(e.id,e.accessHash),randomId:M,replyTo:a&&ls(a),...f&&{silent:f},...p&&{scheduleDate:p},...t&&{media:t},...h&&{noWebpage:h},...m&&{sendAs:Vt(m.id,m.accessHash)},...y&&{updateStickersetsOrder:y},...b&&{invertMedia:b},...w&&{effect:Se()(w)}}),{shouldThrow:!0,shouldIgnoreUpdates:!0});i&&Ed(A,i)}catch(t){"PRIVACY_PREMIUM_REQUIRED"===t.message&&et({"@type":"updateRequestUserUpdate",id:e.id}),et({"@type":"updateMessageSendFailed",chatId:e.id,localId:A.id,error:t.message}),clearTimeout(C)}})();return R}const Gc={};async function qc({chat:e,message:t,text:s,entities:n,attachment:a,noWebPage:i},o){const r=1e3*t.date>Date.now()+1e3*Rt(),d=a&&Ba(a),u=s&&!a?.shouldSendAsFile?t.isInvertedMedia:void 0,l={...d||t.content,...s&&{text:{text:s,entities:n}}},f={...t,content:l,emojiOnlyCount:_t(l,t.groupedId),isInvertedMedia:u};et({"@type":r?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:f});try{let c;a&&(c=await Oc(t,a,o));const d=n&&n.map(Kt);await Xo(new pe.Api.messages.EditMessage({message:s||"",entities:d,media:c,peer:Vt(e.id,e.accessHash),id:t.id,...r&&{scheduleDate:t.date},...i&&{noWebpage:i},...u&&{invertMedia:u}}),{shouldThrow:!0})}catch(s){c&&console.warn(s);const{message:n}=s;et({"@type":"error",error:{message:n,hasErrorKey:!0}}),et({"@type":r?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:t})}}async function Hc({chat:e,message:t,scheduledAt:s}){await Xo(new pe.Api.messages.EditMessage({peer:Vt(e.id,e.accessHash),id:t.id,scheduleDate:s}))}async function Oc(e,t,s){const{filename:n,blobUrl:a,mimeType:i,quick:o,voice:r,audio:c,previewBlobUrl:d,shouldSendAsFile:u,shouldSendAsSpoiler:l,ttlSeconds:f}=t,p=t=>{s.isCanceled?p.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))},g=async(e,t)=>er(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=L.has(i),m=c||h||u,[y,_]=await Promise.all(Pt([g(a,p),m&&d&&g(d)])),b=[new pe.Api.DocumentAttributeFilename({fileName:n})];if(!u){if(o){if(O.has(i)&&i!==G)return new pe.Api.InputMediaUploadedPhoto({file:y,spoiler:l});if(h){const{width:e,height:t,duration:s}=o;void 0!==s&&b.push(new pe.Api.DocumentAttributeVideo({duration:s,w:e,h:t,supportsStreaming:!0}))}}if(c){const{duration:e,title:t,performer:s}=c;b.push(new pe.Api.DocumentAttributeAudio({duration:e,title:t,performer:s}))}if(r){const{duration:e,waveform:t}=r,{data:s}=Tt(t,Uc);b.push(new pe.Api.DocumentAttributeAudio({voice:!0,duration:e,waveform:Bc.from(s)}))}}return new pe.Api.InputMediaUploadedDocument({file:y,mimeType:i,attributes:b,thumb:_,forceFile:u,spoiler:l,ttlSeconds:f})}async function Lc({chat:e,messageId:t,isUnpin:s,isOneSide:n,isSilent:a}){await Xo(new pe.Api.messages.UpdatePinnedMessage({peer:Vt(e.id,e.accessHash),id:t,...s&&{unpin:!0},...n&&{pmOneside:!0},...a&&{silent:!0}}))}async function jc({chat:e,threadId:t}){const s=await Xo(new pe.Api.messages.UnpinAllMessages({peer:Vt(e.id,e.accessHash),...t&&{topMsgId:Number(t)}}));s&&(to(e,s),s.offset&&await jc({chat:e,threadId:t}))}async function Wc({chat:e,messageIds:t,shouldDeleteForAll:s}){const n="channel"===Ut(e.id),a=await Xo(n?new pe.Api.channels.DeleteMessages({channel:Ft(e.id,e.accessHash),id:t}):new pe.Api.messages.DeleteMessages({id:t,...s&&{revoke:!0}}));a&&(to(e,a),et({"@type":"deleteMessages",ids:t,...n&&{chatId:e.id}}))}function zc({chat:e,messageIds:t}){Xo(new pe.Api.messages.DeleteScheduledMessages({peer:Vt(e.id,e.accessHash),id:t}))}async function Kc({chat:e,shouldDeleteForAll:t}){const s="channel"===Ut(e.id),n=await Xo(s?new pe.Api.channels.DeleteHistory({channel:Ft(e.id,e.accessHash)}):new pe.Api.messages.DeleteHistory({peer:Vt(e.id,e.accessHash),...t&&{revoke:!0},...!t&&{just_clear:!0}}));n&&("offset"in n&&(to(e,n),n.offset)?await Kc({chat:e,shouldDeleteForAll:t}):et({"@type":"deleteHistory",chatId:e.id}))}async function $c({chat:e}){const t=await Xo(new pe.Api.messages.DeleteSavedHistory({peer:Vt(e.id,e.accessHash)}));t&&(to(e,t),t.offset?await $c({chat:e}):et({"@type":"deleteSavedHistory",chatId:e.id}))}async function Jc({peer:e,messageIds:t,description:s,option:n}){try{const a=await Xo(new pe.Api.messages.Report({peer:Vt(e.id,e.accessHash),id:t,option:Xe(n),message:s}),{shouldThrow:!0});if(!a)return;return{result:Va(a),error:void 0}}catch(e){const t=e.message;if(t===W)return{result:void 0,error:t};throw e}}function Qc({peer:e,chat:t,messageIds:s}){return Xo(new pe.Api.channels.ReportSpam({participant:Vt(e.id,e.accessHash),channel:Ft(t.id,t.accessHash),id:s}))}async function Xc({peer:e,threadId:t,action:s}){const n=function(e){switch(e.type){case"cancel":return new pe.Api.SendMessageCancelAction;case"typing":return new pe.Api.SendMessageTypingAction;case"recordAudio":return new pe.Api.SendMessageRecordAudioAction;case"chooseSticker":return new pe.Api.SendMessageChooseStickerAction;case"playingGame":return new pe.Api.SendMessageGamePlayAction}}(s);if(n)try{return await Xo(new pe.Api.messages.SetTyping({peer:Vt(e.id,e.accessHash),topMsgId:Number(t),action:n}),{shouldThrow:!0,abortControllerChatId:e.id,abortControllerThreadId:t})}catch(e){}else c&&console.warn("Unsupported message action",s)}async function Yc({chat:e,threadId:t,maxId:s=0}){const n="channel"===Ut(e.id),a=Math.min(s,B);if(n&&t===ut)await Xo(new pe.Api.channels.ReadHistory({channel:Ft(e.id,e.accessHash),maxId:a}));else if(n)await Xo(new pe.Api.messages.ReadDiscussion({peer:Vt(e.id,e.accessHash),msgId:Number(t),readMaxId:a}));else{const t=await Xo(new pe.Api.messages.ReadHistory({peer:Vt(e.id,e.accessHash),maxId:a}));t&&to(e,t)}t===ut?vr({chat:e,noLastMessage:!0}):e.isForum&&et({"@type":"updateTopic",chatId:e.id,topicId:Number(t)})}async function Zc({chat:e,messageIds:t}){const s="channel"===Ut(e.id),n=await Xo(s?new pe.Api.channels.ReadMessageContents({channel:Ft(e.id,e.accessHash),id:t}):new pe.Api.messages.ReadMessageContents({id:t}));n&&(!0!==n&&to(e,n),et({...s?{"@type":"updateChannelMessages",channelId:e.id}:{"@type":"updateCommonBoxMessages"},ids:t,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}}))}async function ed({chat:e,ids:t,shouldIncrement:s}){const n=Ct(t,v),a=await Promise.all(n.map((t=>Xo(new pe.Api.messages.GetMessagesViews({peer:Vt(e.id,e.accessHash),id:t,increment:s})))));if(!a||a.some((e=>!e)))return;const i=a.flatMap((e=>e.views));return{viewsInfo:t.map(((t,s)=>{const{views:n,forwards:a,replies:o}=i[s];return{id:t,views:n,forwards:a,threadInfo:o?Ua(o,t,e.id):void 0}}))}}async function td({chat:e,ids:t}){const s=Ct(t,v),n=await Promise.all(s.map((t=>Xo(new pe.Api.messages.GetFactCheck({peer:Vt(e.id,e.accessHash),msgId:t})))));if(n&&!n.some((e=>!e)))return n.flatMap((e=>e)).map(Ea)}function sd(){return Xo(new pe.Api.messages.GetPaidReactionPrivacy,{shouldReturnTrue:!0})}async function nd({chat:e,messageId:t}){const[s,n]=await Promise.all([Xo(new pe.Api.messages.GetDiscussionMessage({peer:Vt(e.id,e.accessHash),msgId:t}),{abortControllerChatId:e.id,abortControllerThreadId:t}),xc({chat:e,threadId:t,offsetId:1,addOffset:-1,limit:1})]);if(!s||!n)return;const a=s.messages.map(Ca).filter(Boolean),i=a.concat(n.messages),o=s.messages[s.messages.length-1]?.id;if(!o)return;const{unreadCount:r,maxId:c,readInboxMaxId:d,readOutboxMaxId:u}=s;return{messages:i,topMessages:a,unreadCount:r,threadId:o,lastReadInboxMessageId:d,lastReadOutboxMessageId:u,lastMessageId:c,chatId:a[0]?.chatId,firstMessageId:n.messages[0]?.id}}async function ad({peer:e,isSavedDialog:t,savedTag:s,type:n,query:a="",threadId:i,minDate:o,maxDate:r,...c}){let d;switch(n){case"media":d=new pe.Api.InputMessagesFilterPhotoVideo;break;case"documents":d=new pe.Api.InputMessagesFilterDocument;break;case"links":d=new pe.Api.InputMessagesFilterUrl;break;case"audio":d=new pe.Api.InputMessagesFilterMusic;break;case"voice":d=new pe.Api.InputMessagesFilterRoundVoice;break;case"profilePhoto":d=new pe.Api.InputMessagesFilterChatPhotos;break;default:d=new pe.Api.InputMessagesFilterEmpty}const u=Vt(e.id,e.accessHash),l=await Xo(new pe.Api.messages.Search({peer:t?new pe.Api.InputPeerSelf:u,savedPeerId:t?u:void 0,savedReaction:s&&[rs(s)],topMsgId:i===ut||t?void 0:Number(i),filter:d,q:a,minDate:o,maxDate:r,...c}),{abortControllerChatId:e.id,abortControllerThreadId:i});if(!l||l instanceof pe.Api.messages.MessagesNotModified||!l.messages)return;const f=si(l.users),p=l.messages.map(Ca).filter(Boolean);let g,h=p.length;return(l instanceof pe.Api.messages.MessagesSlice||l instanceof pe.Api.messages.ChannelMessages)&&(h=l.count,p.length&&(g=p[p.length-1].id)),{userStatusesById:f,messages:p,totalCount:h,nextOffsetId:g}}async function id({query:e,offsetRate:t=0,offsetPeer:s,offsetId:n,limit:a,type:i="text",minDate:o,maxDate:r,context:c="all"}){let d;switch(i){case"media":d=new pe.Api.InputMessagesFilterPhotoVideo;break;case"documents":d=new pe.Api.InputMessagesFilterDocument;break;case"links":d=new pe.Api.InputMessagesFilterUrl;break;case"audio":d=new pe.Api.InputMessagesFilterMusic;break;case"voice":d=new pe.Api.InputMessagesFilterRoundVoice;break;default:if(!(e||r&&o))return;d=new pe.Api.InputMessagesFilterEmpty}const u=s&&Vt(s.id,s.accessHash)||new pe.Api.InputPeerEmpty,l=await Xo(new pe.Api.messages.SearchGlobal({q:e,offsetRate:t,offsetPeer:u,offsetId:n,broadcastsOnly:"channels"===i||"channels"===c||void 0,groupsOnly:"groups"===c||void 0,usersOnly:"users"===c||void 0,limit:a,filter:d,minDate:o,maxDate:r}));if(!l||l instanceof pe.Api.messages.MessagesNotModified||!l.messages)return;const f=si(l.users),p=l.messages.map(Ca).filter(Boolean);let g=p.length;g=l instanceof pe.Api.messages.MessagesSlice||l instanceof pe.Api.messages.ChannelMessages?l.count:l.messages.length;const h=l.messages[l.messages.length-1],m=Ge(h),y="nextRate"in l&&l.nextRate?l.nextRate:void 0,_=h?.id;return{messages:p,userStatusesById:f,totalCount:g,nextOffsetRate:y,nextOffsetPeerId:m,nextOffsetId:_}}async function od({hashtag:e,offsetRate:t,offsetPeer:s,offsetId:n,limit:a}){const i=s&&Vt(s.id,s.accessHash)||new pe.Api.InputPeerEmpty,o=await Xo(new pe.Api.channels.SearchPosts({hashtag:e,offsetRate:t,offsetId:n,offsetPeer:i,limit:a}));if(!o||o instanceof pe.Api.messages.MessagesNotModified)return;const r=si(o.users),c=o.messages.map(Ca).filter(Boolean);let d=c.length;d=o instanceof pe.Api.messages.MessagesSlice||o instanceof pe.Api.messages.ChannelMessages?o.count:o.messages.length;const u=o.messages[o.messages.length-1],l=Ge(u),f="nextRate"in o&&o.nextRate?o.nextRate:void 0,p=u?.id;return{messages:c,userStatusesById:r,totalCount:d,nextOffsetRate:f,nextOffsetPeerId:l,nextOffsetId:p}}async function rd({text:e}){const t=ds(e),s=await Xo(new pe.Api.messages.GetWebPagePreview({message:t.text,entities:t.entities}));return s&&tn(s)}async function cd({chat:e,messageId:t,options:s}){const{id:n,accessHash:a}=e;await Xo(new pe.Api.messages.SendVote({peer:Vt(n,a),msgId:t,options:s.map(Xe)}))}async function dd({chat:e,messageId:t,poll:s}){const{id:n,accessHash:a}=e;await Xo(new pe.Api.messages.EditMessage({peer:Vt(n,a),id:t,media:Ot(s,!0)}))}async function ud({chat:e,messageId:t,option:s,offset:n,limit:a,shouldResetVoters:i}){const{id:o,accessHash:r}=e,c=await Xo(new pe.Api.messages.GetPollVotes({peer:Vt(o,r),id:t,...s&&{option:Xe(s)},...n&&{offset:n},...a&&{limit:a}}));if(!c)return;const d=c.votes.map((e=>({peerId:ye(e.peer),date:e.date})));return{count:c.count,votes:d,nextOffset:c.nextOffset,shouldResetVoters:i}}async function ld({chat:e,ids:t}){await Xo(new pe.Api.messages.GetExtendedMedia({peer:Vt(e.id,e.accessHash),id:t}))}async function fd({fromChat:e,toChat:t,toThreadId:s,messages:n,isSilent:a,scheduledAt:i,sendAs:o,withMyScore:r,noAuthors:c,noCaptions:d,isCurrentUserPremium:u,wasDrafted:l,lastMessageId:f}){const p=n.map((({id:e})=>e)),g=n.map(Lt),h={};n.forEach(((e,n)=>{const a=function({toChat:e,toThreadId:t,message:s,scheduledAt:n,noAuthors:a,noCaptions:i,isCurrentUserPremium:o,lastMessageId:r,sendAs:c}){const d=Pa(r),{content:u,chatId:l,id:f,senderId:p,groupedId:g,isInAlbum:h,isInvertedMedia:m}=s,y=u.audio,_=e.id===Ia&&(l!==e.id||s.forwardInfo)&&!y,b=Object.keys(u).length>1&&u.text&&i,w=!o,S=u.text?.entities&&w?{text:u.text.text,entities:u.text.entities.filter((e=>e.type!==dt.CustomEmoji))}:u.text,v=_t(u,g),I={...u,text:b?void 0:S},A=t&&t!==ut?{type:"message",replyToMsgId:t,replyToTopId:t,isForumTopic:e.isForum||void 0}:void 0;return{id:d,chatId:e.id,content:I,date:n||Math.round(Date.now()/1e3)+Rt(),isOutgoing:!_&&"chatTypeChannel"!==e.type,senderId:c?.id||Ia,sendingState:"messageSendingStatePending",groupedId:g,isInAlbum:h,isForwardingAllowed:!0,replyInfo:A,isInvertedMedia:m,...t&&e?.isForum&&{isTopicReply:!0},...v&&{emojiOnlyCount:v},...s.chatId!==Ia&&!y&&!a&&{forwardInfo:{date:s.forwardInfo?.date||s.date,savedDate:s.date,isChannelPost:!1,fromChatId:l,fromMessageId:f,fromId:p,savedFromPeerId:s.chatId}},...s.chatId===Ia&&!a&&{forwardInfo:s.forwardInfo},...n&&{isScheduled:!0}}}({toChat:t,toThreadId:Number(s),message:e,scheduledAt:i,noAuthors:c,noCaptions:d,isCurrentUserPremium:u,lastMessageId:f,sendAs:o});h[g[n].toString()]=a,et({"@type":a.isScheduled?"newScheduledMessage":"newMessage",id:a.id,chatId:t.id,message:a,wasDrafted:l})}));try{const n=await Xo(new pe.Api.messages.ForwardMessages({fromPeer:Vt(e.id,e.accessHash),toPeer:Vt(t.id,t.accessHash),randomId:g,id:p,withMyScore:r||void 0,silent:a||void 0,dropAuthor:c||void 0,dropMediaCaptions:d||void 0,...s&&{topMsgId:Number(s)},...i&&{scheduleDate:i},...o&&{sendAs:Vt(o.id,o.accessHash)}}),{shouldThrow:!0,shouldIgnoreUpdates:!0});n&&Td(h,n)}catch(e){Object.values(h).forEach((s=>{et({"@type":"updateMessageSendFailed",chatId:t.id,localId:s.id,error:e.message})}))}}async function pd({chat:e,timestamp:t}){const s=await Xo(new pe.Api.messages.GetHistory({peer:Vt(e.id,e.accessHash),offsetDate:t,addOffset:-1,limit:1}));if(s&&!(s instanceof pe.Api.messages.MessagesNotModified)&&s.messages&&s.messages.length)return s.messages[0].id}async function gd({chat:e}){const{id:t,accessHash:s}=e,n=await Xo(new pe.Api.messages.GetScheduledHistory({peer:Vt(t,s)}),{abortControllerChatId:t});if(n&&!(n instanceof pe.Api.messages.MessagesNotModified)&&n.messages)return{messages:n.messages.map(Ca).filter(Boolean)}}async function hd({chat:e,ids:t}){const{id:s,accessHash:n}=e;await Xo(new pe.Api.messages.SendScheduledMessages({peer:Vt(s,n),id:t}))}async function md({chat:e,threadId:t}){const s=await Xo(new pe.Api.messages.Search({peer:Vt(e.id,e.accessHash),filter:new pe.Api.InputMessagesFilterPinned,q:"",limit:_,topMsgId:Number(t)}),{abortControllerChatId:e.id,abortControllerThreadId:t});if(s&&!(s instanceof pe.Api.messages.MessagesNotModified)&&s.messages)return{messages:s.messages.map(Ca).filter(Boolean)}}async function yd({chat:e,messageId:t}){const s=await Xo(new pe.Api.messages.GetMessageReadParticipants({peer:Vt(e.id,e.accessHash),msgId:t}));return s?s.reduce(((e,t)=>(e[t.userId.toString()]=t.date,e)),{}):void 0}async function _d({chat:e}){const t=await Xo(new pe.Api.channels.GetSendAs({peer:Vt(e.id,e.accessHash)}),{shouldIgnoreErrors:!0,abortControllerChatId:e.id});if(t)return{sendAs:t.peers.map(Nn)}}function bd({sendAs:e,chat:t}){return Xo(new pe.Api.messages.SaveDefaultSendAs({peer:Vt(t.id,t.accessHash),sendAs:Vt(e.id,e.accessHash)}))}async function wd({peer:e}){const t=await Xo(new pe.Api.messages.GetSponsoredMessages({peer:Vt(e.id,e.accessHash)}));if(t&&!(t instanceof pe.Api.messages.SponsoredMessagesEmpty)&&t.messages.length)return{messages:t.messages.map((t=>function(e,t){const{message:s,entities:n,randomId:a,recommended:i,sponsorInfo:o,additionalInfo:r,buttonText:c,canReport:d,title:u,url:l,color:f}=e;let p,g;return e.photo instanceof pe.Api.Photo&&(je(e.photo),p=ks(e.photo)),e.media&&(g=Ks(e.media)),{chatId:t,randomId:Qe(a),expiresAt:Math.round(Date.now()/1e3)+T,isRecommended:i,sponsorInfo:o,additionalInfo:r,buttonText:c,canReport:d,title:u,url:l,peerColor:f&&_e(f),photo:p,content:{...g,text:zs(s,n)}}}(t,e.id))).filter(Boolean)}}async function Sd({peer:e,random:t}){await Xo(new pe.Api.messages.ViewSponsoredMessage({peer:Vt(e.id,e.accessHash),randomId:Xe(t)}))}function vd({peer:e,random:t,isMedia:s,isFullscreen:n}){return Xo(new pe.Api.messages.ClickSponsoredMessage({media:s||void 0,fullscreen:n||void 0,peer:Vt(e.id,e.accessHash),randomId:Xe(t)}))}async function Id({peer:e,randomId:t,option:s}){try{const n=await Xo(new pe.Api.messages.ReportSponsoredMessage({peer:Vt(e.id,e.accessHash),randomId:Xe(t),option:Xe(s)}),{shouldThrow:!0});if(!n)return;return function(e){return e instanceof pe.Api.channels.SponsoredMessageReportResultReported?{type:"reported"}:e instanceof pe.Api.channels.SponsoredMessageReportResultAdsHidden?{type:"hidden"}:{type:"selectOption",title:e.title,options:e.options.map((e=>({text:e.text,option:Qe(e.option)})))}}(n)}catch(e){return e instanceof Error&&"PREMIUM_ACCOUNT_REQUIRED"===e.message?{type:"premiumRequired"}:void 0}}async function Ad({chat:e}){const t=await Xo(new pe.Api.messages.ReadMentions({peer:Vt(e.id,e.accessHash)}));t&&(to(e,t),t.offset&&await Ad({chat:e}))}async function Pd({chat:e}){const t=await Xo(new pe.Api.messages.ReadReactions({peer:Vt(e.id,e.accessHash)}));t&&(to(e,t),t.offset&&await Pd({chat:e}))}async function Cd({chat:e,...t}){const s=await Xo(new pe.Api.messages.GetUnreadMentions({peer:Vt(e.id,e.accessHash),limit:R,...t}));if(s&&!(s instanceof pe.Api.messages.MessagesNotModified)&&s.messages)return{messages:s.messages.map(Ca).filter(Boolean)}}async function Md({chat:e,...t}){const s=await Xo(new pe.Api.messages.GetUnreadReactions({peer:Vt(e.id,e.accessHash),limit:M,...t}));if(s&&!(s instanceof pe.Api.messages.MessagesNotModified)&&s.messages)return{messages:s.messages.map(Ca).filter(Boolean)}}async function Rd({chat:e,messageId:t}){const s=await Xo(new pe.Api.messages.TranscribeAudio({msgId:t,peer:Vt(e.id,e.accessHash)}));if(s)return et({"@type":"updateTranscribedAudio",isPending:s.pending,transcriptionId:s.transcriptionId.toString(),text:s.text}),s.transcriptionId.toString()}async function kd(e){let t;const s="chat"in e;if(s){const{chat:s,messageIds:n,toLanguageCode:a}=e;t=await Xo(new pe.Api.messages.TranslateText({peer:Vt(s.id,s.accessHash),id:n,toLang:a}))}else{const{text:s,toLanguageCode:n}=e;t=await Xo(new pe.Api.messages.TranslateText({text:s.map((e=>ds(e))),toLang:n}))}if(!t)return;const n=t.result.map((e=>xs(e)));return s&&et({"@type":"updateMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,translations:n,toLanguageCode:e.toLanguageCode}),n}function Td(e,t){if(!("updates"in t))return void Qo(t);t.updates.filter((e=>e instanceof pe.Api.UpdateMessageID)).forEach((s=>{const n=t.updates.find((e=>e instanceof pe.Api.UpdateNewScheduledMessage&&e.message.id===s.id));Ed(e[s.randomId.toString()],s,n)}));const s=t.updates.filter((e=>!(e instanceof pe.Api.UpdateMessageID||e instanceof pe.Api.UpdateNewScheduledMessage)));t.updates=s,Qo(t)}function Ed(e,t,s){let n,a,i;if(t instanceof pe.Api.UpdateShortSentMessage||t instanceof pe.Api.UpdateMessageID?n=t:"updates"in t&&(n=t.updates.find((e=>e instanceof pe.Api.UpdateMessageID)),s=t.updates.find((e=>e instanceof pe.Api.UpdateNewScheduledMessage))),!n)return void Qo(t);n instanceof pe.Api.UpdateShortSentMessage&&(e.content.text&&n.entities&&(a={text:zs(e.content.text.text,n.entities)}),n.media&&(a={...a,...Ks(n.media,{peerId:xt(e.chatId),id:n.id})},i=Xs(n.media)),ci(zt(n.id,e.chatId,n)));const o=s?.message&&Ca(s.message),r="date"in n&&n.date<kt();if(o?.isVideoProcessingPending)et({"@type":"updateVideoProcessingPending",chatId:e.chatId,localId:e.id,newScheduledMessageId:o?.id});else{const t={...e,...a&&{content:{...e.content,...a}},id:n.id,sendingState:void 0,..."date"in n&&{date:n.date}};et({"@type":e.isScheduled&&!r?"updateScheduledMessageSendSucceeded":"updateMessageSendSucceeded",chatId:e.chatId,localId:e.id,message:t,poll:i})}Qo(t)}async function Bd({chat:e,messageId:t}){const{id:s,accessHash:n}=e,a=Vt(s,n),i=await Xo(new pe.Api.messages.GetOutboxReadDate({peer:a,msgId:t}),{shouldThrow:!0});if(i)return{date:i.date}}async function Dd(){const e=await Xo(new pe.Api.messages.GetQuickReplies({}));if(e&&!(e instanceof pe.Api.messages.QuickRepliesNotModified))return{messages:e.messages.map(Ca).filter(Boolean),quickReplies:e.quickReplies.map(xa)}}async function Ud({chat:e,shortcutId:t}){const s=await Xo(new pe.Api.messages.GetQuickReplyMessages({shortcutId:t}));if(!s||s instanceof pe.Api.messages.MessagesNotModified)return;const n=s.messages.map((e=>e.id)),a=n.map(Lt),i=await Xo(new pe.Api.messages.SendQuickReplyMessages({peer:Vt(e.id,e.accessHash),shortcutId:t,id:n,randomId:a}),{shouldIgnoreUpdates:!0});if(i){if("updates"in i){const e=i.updates.filter((e=>!(e instanceof pe.Api.UpdateMessageID)));i.updates=e}Qo(i)}}async function xd({id:e,chat:t,shouldIncludeThread:s,shouldIncludeGrouped:n}){const a=await Xo(new pe.Api.channels.ExportMessageLink({channel:Ft(t.id,t.accessHash),id:e,thread:s||void 0,grouped:n||void 0}));return a?.link}async function Vd({id:e,accessHash:t}){const s=Ft(e,t);if(!(s instanceof pe.Api.InputUser))return;const n=await Xo(new pe.Api.users.GetFullUser({id:s}));if(!n)return;n.fullUser.profilePhoto&&je(n.fullUser.profilePhoto),n.fullUser.personalPhoto&&je(n.fullUser.personalPhoto),n.fullUser.fallbackPhoto&&je(n.fullUser.fallbackPhoto);const a=n.fullUser.botInfo;a?.descriptionPhoto&&je(a.descriptionPhoto),a?.descriptionDocument instanceof pe.Api.Document&&(De.documents[a.descriptionDocument.id.toString()]=a.descriptionDocument),n.fullUser.businessIntro?.sticker instanceof pe.Api.Document&&(De.documents[n.fullUser.businessIntro.sticker.id.toString()]=n.fullUser.businessIntro.sticker);const i=Za(n),o=n.users.map(ei).filter(Boolean),r=n.chats.map((e=>In(e))).filter(Boolean),c=o.find((({id:t})=>t===e));return et({"@type":"updateUser",id:e,user:c,fullInfo:i}),{user:c,fullInfo:i,users:o,chats:r}}async function Nd(e,t){const s=await Xo(new pe.Api.messages.GetCommonChats({userId:Ft(e.id,e.accessHash),maxId:t?ss(t,Ut(t)):void 0}));if(!s)return;const n=s.chats.map((e=>In(e))).filter(Boolean).map((({id:e})=>e));return{chatIds:n,count:"count"in s?s.count:n.length}}async function Fd(){const e=await Xo(new pe.Api.help.GetNearestDc);return e?.country}async function Gd(){const e=await Xo(new pe.Api.contacts.GetTopPeers({correspondents:!0}));if(e instanceof pe.Api.contacts.TopPeers)return{ids:e.users.map(ei).filter((e=>Boolean(e)&&!e.isSelf)).map((({id:e})=>e))}}async function qd(){const e=await Xo(new pe.Api.contacts.GetContacts({hash:Se()("0")}));if(e&&!(e instanceof pe.Api.contacts.ContactsNotModified))return{users:e.users.map(ei).filter(Boolean),userStatusesById:si(e.users)}}async function Hd({users:e}){const t=await Xo(new pe.Api.users.GetUsers({id:e.map((({id:e,accessHash:t})=>Vt(e,t)))}));if(t&&t.length)return{users:t.map(ei).filter(Boolean),userStatusesById:si(t)}}async function Od({phone:e,firstName:t,lastName:s}){const n=await Xo(new pe.Api.contacts.ImportContacts({contacts:[Jt({phone:e||"",firstName:t||"",lastName:s||""})]}));return n instanceof pe.Api.contacts.ImportedContacts&&n.users.length&&$e(n.users[0]),n?.imported.length?me(n.imported[0].userId,"user"):void 0}function Ld({id:e,accessHash:t,phoneNumber:s="",firstName:n="",lastName:a="",shouldSharePhoneNumber:i=!1}){return Xo(new pe.Api.contacts.AddContact({id:Ft(e,t),firstName:n,lastName:a,phone:s,...i&&{addPhonePrivacyException:i}}),{shouldReturnTrue:!0})}async function jd({id:e,accessHash:t}){const s=Ft(e,t);s instanceof pe.Api.InputUser&&await Xo(new pe.Api.contacts.DeleteContacts({id:[s]}))&&et({"@type":"deleteContact",id:e})}async function Wd({peer:e,offset:t=0,limit:s=0}){const n="title"in e?e:void 0,a=n?void 0:e;if(a){const{id:e,accessHash:n}=a,i=await Xo(new pe.Api.photos.GetUserPhotos({userId:Ft(e,n),limit:s,offset:t,maxId:Se()("0")}));if(!i)return;i.photos.forEach(je);const o=i instanceof pe.Api.photos.PhotosSlice?i.count:i.photos.length,r=t+i.photos.length,c=r<o?r:void 0;return{count:o,photos:i.photos.filter((e=>e instanceof pe.Api.Photo)).map((e=>ks(e))),nextOffsetId:c}}if(n?.isRestricted)return;const i=await ad({peer:e,type:"profilePhoto",limit:s});if(!i)return;const{messages:o,totalCount:r,nextOffsetId:c}=i;return{count:r,photos:o.map((e=>e.content.action.photo)).filter(Boolean),nextOffsetId:c}}function zd(e){const{id:t,accessHash:s}=e;return Xo(new pe.Api.messages.ReportSpam({peer:Vt(t,s)}),{shouldReturnTrue:!0})}function Kd(e,t){return Xo(new pe.Api.account.UpdateEmojiStatus({emojiStatus:cs(e,t)}),{shouldReturnTrue:!0})}function $d(e){const t=e.map((e=>ss(e,"user")));return Xo(new pe.Api.contacts.EditCloseFriends({id:t}),{shouldReturnTrue:!0})}async function Jd({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetEmojiStickers({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.AllStickersNotModified))return t.sets.forEach((e=>{(e.thumbs?.length||e.thumbDocumentId)&&(De.stickerSets[String(e.id)]=e)})),{hash:String(t.hash),sets:t.sets.map(Hs)}}async function Qd({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetAllStickers({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.AllStickersNotModified))return t.sets.forEach((e=>{e.thumbs?.length&&(De.stickerSets[String(e.id)]=e)})),{hash:String(t.hash),sets:t.sets.map(Hs)}}async function Xd({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetRecentStickers({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.RecentStickersNotModified))return{hash:String(t.hash),stickers:js(t.stickers.slice(0,x))}}async function Yd({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetFavedStickers({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.FavedStickersNotModified))return{hash:String(t.hash),stickers:js(t.stickers)}}async function Zd({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetFeaturedStickers({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.FeaturedStickersNotModified))return{hash:String(t.hash),isPremium:Boolean(t.premium),sets:t.sets.map(Os)}}async function eu(){const e=await Xo(new pe.Api.messages.GetFeaturedEmojiStickers({hash:Se()(0)}));if(e&&!(e instanceof pe.Api.messages.FeaturedStickersNotModified))return e.sets.forEach((({set:e})=>{e.thumbDocumentId&&(De.stickerSets[String(e.id)]=e)})),{isPremium:Boolean(e.premium),sets:e.sets.map(Os)}}async function tu({sticker:e,unfave:t}){const s=new pe.Api.messages.FaveSticker({id:qt(e),unfave:t});await Xo(s)&&et({"@type":"updateFavoriteStickers"})}function su({sticker:e}){return Xo(new pe.Api.messages.SaveRecentSticker({id:qt(e),unsave:!0}))}function nu(){return Xo(new pe.Api.messages.ClearRecentStickers)}async function au({stickerSetInfo:e}){if("isMissing"in e)return;const t=await Xo(new pe.Api.messages.GetStickerSet({stickerset:"id"in e?Gt(e.id,e.accessHash):(s=e.shortName,new pe.Api.InputStickerSetShortName({shortName:s}))}),{shouldThrow:!0});var s;return t instanceof pe.Api.messages.StickerSet?(De.stickerSets[String(t.set.id)]=t.set,{set:Hs(t.set),stickers:js(t.documents),packs:Ls(t.packs)}):void 0}async function iu({documentId:e}){if(!e.length)return;const t=await Xo(new pe.Api.messages.GetCustomEmojiDocuments({documentId:e.map((e=>Se()(e)))}));return t?js(t):void 0}async function ou(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetAnimatedEmoji}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function ru(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetAnimatedEmojiAnimations}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function cu(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetEmojiGenericAnimations}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function du(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetPremiumGifts}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function uu(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetEmojiDefaultTopicIcons}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function lu(){const e=await Xo(new pe.Api.messages.GetStickerSet({stickerset:new pe.Api.InputStickerSetEmojiDefaultStatuses}));if(e instanceof pe.Api.messages.StickerSet)return{set:Hs(e.set),stickers:js(e.documents)}}async function fu({query:e,hash:t="0"}){const s=await Xo(new pe.Api.messages.SearchStickerSets({q:e,hash:Se()(t)}));if(s&&!(s instanceof pe.Api.messages.FoundStickerSetsNotModified))return{hash:String(s.hash),sets:s.sets.map(Os)}}async function pu({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetSavedGifs({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.SavedGifsNotModified))return{hash:String(t.hash),gifs:vu(t.gifs)}}function gu({gif:e,shouldUnsave:t}){return Xo(new pe.Api.messages.SaveGif({id:qt(e),unsave:t}),{shouldReturnTrue:!0})}async function hu({stickerSetId:e,accessHash:t}){await Xo(new pe.Api.messages.InstallStickerSet({stickerset:Gt(e,t)}))&&et({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:Date.now()}})}async function mu({stickerSetId:e,accessHash:t}){await Xo(new pe.Api.messages.UninstallStickerSet({stickerset:Gt(e,t)}))&&et({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:void 0}})}let yu;async function _u({query:e,offset:t="",username:s=X}){if(!yu){const e=await Xo(new pe.Api.contacts.ResolveUsername({username:s}));if(!(e&&e.users[0]instanceof pe.Api.User))return;yu=new pe.Api.InputUser({userId:e.peer.userId,accessHash:e.users[0].accessHash})}const n=await Xo(new pe.Api.messages.GetInlineBotResults({bot:yu,peer:new pe.Api.InputPeerEmpty,query:e,offset:t}));if(!n)return;const a=n.results.map((e=>{if(e instanceof pe.Api.BotInlineMediaResult)return e.document})).filter(Boolean);return{nextOffset:n.nextOffset,gifs:vu(a)}}async function bu({emoji:e,hash:t="0"}){const s=await Xo(new pe.Api.messages.GetStickers({emoticon:e,hash:Se()(t)}));if(s&&!(s instanceof pe.Api.messages.StickersNotModified))return{stickers:js(s.stickers),hash:String(s.hash)}}async function wu({language:e,fromVersion:t}){const s=await Xo(new pe.Api.messages.GetEmojiKeywordsDifference({langCode:e,fromVersion:t}));if(s)return{language:s.langCode,version:s.version,keywords:s.keywords.reduce(((e,t)=>(e[t.keyword]=t.emoticons,e)),{})}}async function Su(e="0"){const t=await Xo(new pe.Api.account.GetRecentEmojiStatuses({hash:Se()(e)}));if(!t||t instanceof pe.Api.account.EmojiStatusesNotModified)return;const s=t.statuses.slice(0,V).map(be).filter(Boolean).map((({documentId:e})=>e)),n=await iu({documentId:s});return{hash:String(t.hash),emojiStatuses:n}}function vu(e){return e.map((e=>{if(e instanceof pe.Api.Document){const t=$s(e);if(t)return De.documents[String(e.id)]=e,t}})).filter(Boolean)}async function Iu({username:e}){try{return{result:await Xo(new pe.Api.channels.CheckUsername({channel:new pe.Api.InputChannelEmpty,username:e}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(z.has(t))return{result:!1,error:t};throw e}}async function Au({chat:e,username:t}){const s=await Xo(new pe.Api.channels.UpdateUsername({channel:Ft(e.id,e.accessHash),username:t}));let n=t?[{username:t,isEditable:!0,isActive:!0}]:[];return e.usernames&&(n=n.concat(e.usernames.filter((e=>e.username&&!e.isEditable)))),s&&et({"@type":"updateChat",id:e.id,chat:{usernames:n.length?n:void 0}}),s}async function Pu({chat:e}){const t=await Xo(new pe.Api.channels.DeactivateAllUsernames({channel:Ft(e.id,e.accessHash)}));if(t){const t=e.usernames?e.usernames.map((e=>({...e,isActive:!1}))).filter((e=>e.username)):void 0;et({"@type":"updateChat",id:e.id,chat:{usernames:t}})}return t}async function Cu({chat:e,usageLimit:t,expireDate:s}){const n=await Xo(new pe.Api.messages.ExportChatInvite({peer:Vt(e.id,e.accessHash),usageLimit:t,expireDate:s}));if(n instanceof pe.Api.ChatInviteExported)return et({"@type":"updateChatFullInfo",id:e.id,fullInfo:{inviteLink:n.link}}),n.link}async function Mu({peer:e,admin:t,limit:s=0,isRevoked:n}){const a=await Xo(new pe.Api.messages.GetExportedChatInvites({peer:Vt(e.id,e.accessHash),adminId:Ft(t.id,t.accessHash),limit:s,revoked:n||void 0}),{abortControllerChatId:e.id});if(a)return{invites:a.invites.filter((e=>e instanceof pe.Api.ChatInviteExported)).map(Un)}}async function Ru({peer:e,isRevoked:t,link:s,expireDate:n,usageLimit:a,isRequestNeeded:i,title:o}){const r=await Xo(new pe.Api.messages.EditExportedChatInvite({link:s,peer:Vt(e.id,e.accessHash),expireDate:n,usageLimit:i?void 0:a,requestNeeded:i,title:o,revoked:t||void 0}));if(r){if(r instanceof pe.Api.messages.ExportedChatInvite&&r.invite instanceof pe.Api.ChatInviteExported){const e=Un(r.invite);return{oldInvite:e,newInvite:e}}if(r instanceof pe.Api.messages.ExportedChatInviteReplaced&&r.invite instanceof pe.Api.ChatInviteExported&&r.newInvite instanceof pe.Api.ChatInviteExported)return{oldInvite:Un(r.invite),newInvite:Un(r.newInvite)}}}async function ku({peer:e,expireDate:t,usageLimit:s,isRequestNeeded:n,title:a}){const i=await Xo(new pe.Api.messages.ExportChatInvite({peer:Vt(e.id,e.accessHash),expireDate:t,usageLimit:n?void 0:s,requestNeeded:n||void 0,title:a}));if(i instanceof pe.Api.ChatInviteExported)return Un(i)}async function Tu({peer:e,link:t}){return await Xo(new pe.Api.messages.DeleteExportedChatInvite({peer:Vt(e.id,e.accessHash),link:t}))}async function Eu({peer:e,admin:t}){return await Xo(new pe.Api.messages.DeleteRevokedExportedChatInvites({peer:Vt(e.id,e.accessHash),adminId:Ft(t.id,t.accessHash)}))}async function Bu({peer:e,link:t,offsetDate:s=0,offsetUser:n,limit:a=0,isRequested:i}){const o=await Xo(new pe.Api.messages.GetChatInviteImporters({peer:Vt(e.id,e.accessHash),link:t,offsetDate:s,offsetUser:n?Ft(n.id,n.accessHash):new pe.Api.InputUserEmpty,limit:a,requested:i||void 0}),{abortControllerChatId:e.id});if(o)return{importers:o.importers.map((e=>function(e){const{userId:t,date:s,about:n,requested:a,viaChatlist:i}=e;return{userId:me(t,"user"),date:s,about:n,isRequested:a,isFromChatList:i}}(e)))}}function Du({peer:e,user:t,isApproved:s}){return Xo(new pe.Api.messages.HideChatJoinRequest({peer:Vt(e.id,e.accessHash),userId:Ft(t.id,t.accessHash),approved:s||void 0}),{shouldReturnTrue:!0})}function Uu({peer:e,isApproved:t,link:s}){return Xo(new pe.Api.messages.HideAllChatJoinRequests({peer:Vt(e.id,e.accessHash),approved:t||void 0,link:s}),{shouldReturnTrue:!0})}function xu(e){const{id:t,accessHash:s}=e;return Xo(new pe.Api.messages.HidePeerSettingsBar({peer:Vt(t,s)}))}var Vu=s(48287).hp;function Nu(e){const{emojies_sounds:t}=e;return t?Object.keys(t).reduce(((e,s)=>{const n=t[s];return De.documents[n.id]=new pe.Api.Document({id:Se()(n.id),accessHash:Se()(n.access_hash),dcId:1,mimeType:"audio/ogg",fileReference:Vu.alloc(0),size:Se()(0)}),e[s]=n.id,e}),{}):{}}function Fu(e,t,s){return[e[`${t}_default`]||oe[s][0],e[`${t}_premium`]||oe[s][1]]}const Gu=["ar","fa","id","ko","uz","en"];function qu({firstName:e,lastName:t,about:s}){return Xo(new pe.Api.account.UpdateProfile({firstName:e||"",lastName:t||"",about:s||""}),{shouldReturnTrue:!0})}async function Hu(e){try{return{result:await Xo(new pe.Api.account.CheckUsername({username:e}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(z.has(t))return{result:!1,error:t};throw e}}function Ou(e){return Xo(new pe.Api.account.UpdateUsername({username:e}),{shouldReturnTrue:!0})}async function Lu(e,t){const s=e?$t(e):new pe.Api.InputPhotoEmpty,n=await Xo(new pe.Api.photos.UpdateProfilePhoto({id:s,...t?{fallback:!0}:void 0}));if(n)return n.photo instanceof pe.Api.Photo?(je(n.photo),{photo:ks(n.photo)}):void 0}async function ju(e,t,s=!1,n=0,a){const i=await er(e),o=await Xo(new pe.Api.photos.UploadProfilePhoto({...a?{bot:Vt(a.id,a.accessHash)}:void 0,...s?{video:i,videoStartTs:n}:{file:i},...t?{fallback:!0}:void 0}));if(o)return o.photo instanceof pe.Api.Photo?(je(o.photo),{photo:ks(o.photo)}):void 0}async function Wu({file:e,isSuggest:t,user:s}){const n=e?await er(e):void 0,a=await Xo(new pe.Api.photos.UploadContactProfilePhoto({userId:Ft(s.id,s.accessHash),file:n,...t?{suggest:!0}:{save:!0}}));if(a)return a.photo instanceof pe.Api.Photo?(je(a.photo),{photo:ks(a.photo)}):{photo:void 0}}async function zu(e){const t=e.map($t).filter(Boolean),s=await Xo(new pe.Api.photos.DeletePhotos({id:t}),{shouldReturnTrue:!0});return s&&e.forEach((e=>{delete De.photos[e.id]})),s}async function Ku(){const e=await Xo(new pe.Api.account.GetWallPapers({hash:Se()("0")}));if(!e||e instanceof pe.Api.account.WallPapersNotModified)return;const t=e.wallpapers.filter((e=>e instanceof pe.Api.WallPaper&&e.document instanceof pe.Api.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType));return t.forEach((e=>{De.documents[String(e.document.id)]=e.document})),{wallpapers:t.map(li).filter(Boolean)}}async function $u(e){const t=await er(e),s=await Xo(new pe.Api.account.UploadWallPaper({file:t,mimeType:e.type,settings:new pe.Api.WallPaperSettings}));if(!(s&&s instanceof pe.Api.WallPaper))return;const n=li(s);return n?(De.documents[String(s.document.id)]=s.document,{wallpaper:n}):void 0}async function Ju({isOnlyStories:e}){const t=await Xo(new pe.Api.contacts.GetBlocked({myStoriesFrom:e,limit:b}));if(t)return{blockedIds:t.blocked.map((e=>ye(e.peerId))),totalCount:t instanceof pe.Api.contacts.BlockedSlice?t.count:t.blocked.length}}function Qu({user:e,isOnlyStories:t}){return Xo(new pe.Api.contacts.Block({id:Vt(e.id,e.accessHash),myStoriesFrom:t}))}function Xu({user:e,isOnlyStories:t}){return Xo(new pe.Api.contacts.Unblock({id:Vt(e.id,e.accessHash),myStoriesFrom:t}))}async function Yu(){const e=await Xo(new pe.Api.account.GetAuthorizations);if(e)return{authorizations:bt(e.authorizations.map(fi),"hash"),ttlDays:e.authorizationTtlDays}}function Zu(e){return Xo(new pe.Api.account.ResetAuthorization({hash:Se()(e)}))}function el(){return Xo(new pe.Api.auth.ResetAuthorizations)}async function tl(){const e=await Xo(new pe.Api.account.GetWebAuthorizations);if(e)return{webAuthorizations:bt(e.authorizations.map(pi),"hash")}}function sl(e){return Xo(new pe.Api.account.ResetWebAuthorization({hash:Se()(e)}))}function nl(){return Xo(new pe.Api.account.ResetWebAuthorizations)}async function al(){const e=await Xo(new pe.Api.account.GetNotifyExceptions({compareSound:!0}),{shouldIgnoreUpdates:!0});if(e instanceof pe.Api.Updates||e instanceof pe.Api.UpdatesCombined)return e.updates.reduce(((e,t)=>t instanceof pe.Api.UpdateNotifySettings&&t.peer instanceof pe.Api.NotifyPeer?(e.push(gi(t.notifySettings,t.peer.peer)),e):e),[])}async function il(){const[e,t,s,n]=await Promise.all([Xo(new pe.Api.account.GetContactSignUpNotification),Xo(new pe.Api.account.GetNotifySettings({peer:new pe.Api.InputNotifyUsers})),Xo(new pe.Api.account.GetNotifySettings({peer:new pe.Api.InputNotifyChats})),Xo(new pe.Api.account.GetNotifySettings({peer:new pe.Api.InputNotifyBroadcasts}))]);if(!t||!s||!n)return!1;const{silent:a,muteUntil:i,showPreviews:o}=t,{silent:r,muteUntil:c,showPreviews:d}=s,{silent:u,muteUntil:l,showPreviews:f}=n;return{hasContactJoinedNotifications:!e,hasPrivateChatsNotifications:!(a||"number"==typeof i&&kt()<i),hasPrivateChatsMessagePreview:o,hasGroupNotifications:!(r||"number"==typeof c&&kt()<c),hasGroupMessagePreview:d,hasBroadcastNotifications:!(u||"number"==typeof l&&kt()<l),hasBroadcastMessagePreview:f}}function ol(e){return Xo(new pe.Api.account.SetContactSignUpNotification({silent:e}))}function rl(e,{isSilent:t,shouldShowPreviews:s}){let n;n="contact"===e?new pe.Api.InputNotifyUsers:"group"===e?new pe.Api.InputNotifyChats:new pe.Api.InputNotifyBroadcasts;const a={showPreviews:s,silent:t,muteUntil:t?B:0};return Xo(new pe.Api.account.UpdateNotifySettings({peer:n,settings:new pe.Api.InputPeerNotifySettings(a)}))}async function cl({langPack:e,langCode:t}){const s=await Xo(new pe.Api.langpack.GetLangPack({langPack:e,langCode:t}));if(!s)return;const{strings:n,keysToRemove:a}=wi(s.strings);return{version:s.version,strings:n,keysToRemove:a}}async function dl({langPack:e,langCode:t,fromVersion:s}){const n=await Xo(new pe.Api.langpack.GetDifference({langPack:e,langCode:t,fromVersion:s}));if(!n)return;const{strings:a,keysToRemove:i}=wi(n.strings);return{version:n.version,strings:a,keysToRemove:i}}async function ul(){const e=await Xo(new pe.Api.langpack.GetLanguages({langPack:te}));if(e)return e.map(Si)}async function ll({langPack:e,langCode:t}){const s=await Xo(new pe.Api.langpack.GetLanguage({langPack:e,langCode:t}));if(s)return Si(s)}async function fl({sourceLangPacks:e,langCode:t}){const s=(await Promise.all(e.map((e=>Xo(new pe.Api.langpack.GetLangPack({langPack:e,langCode:Gu.includes(t)?`${t}-raw`:t})))))).filter(Boolean).map(_i);if(s.length)return{langPack:Object.assign({},...s.reverse())}}async function pl({langPack:e,langCode:t,keys:s}){const n=await Xo(new pe.Api.langpack.GetStrings({langPack:e,langCode:Gu.includes(t)?`${t}-raw`:t,keys:s}));if(n)return n.map(bi)}async function gl(e){const t=Zt(e),s=await Xo(new pe.Api.account.GetPrivacy({key:t}));if(s)return{rules:Us(s.rules)}}function hl(e){const t=Lo.session.getAuthKey().getKey();return Xo(new pe.Api.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function ml(e){return Xo(new pe.Api.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function yl(e,t){const s=Zt(e),n=fs(t),a=await Xo(new pe.Api.account.SetPrivacy({key:s,rules:n}));if(a)return{rules:Us(a.rules)}}async function _l(e){await Xo(new pe.Api.account.UpdateStatus({offline:!e}))}async function bl(){const e=await Xo(new pe.Api.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function wl(e){return Xo(new pe.Api.account.SetContentSettings({sensitiveEnabled:e||void 0}))}async function Sl(e){const t=await Xo(new pe.Api.help.GetAppConfig({hash:e}));if(!t||t instanceof pe.Api.help.AppConfigNotModified)return;const{config:s,hash:n}=t;return function(e,t){const s=mi(e);return{emojiSounds:Nu(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||[],maxUniqueReactions:s.reactions_uniq_max??ie,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,maxUserReactionsDefault:s.reactions_user_max_default,maxUserReactionsPremium:s.reactions_user_max_premium,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:Fu(s,"upload_max_fileparts","uploadMaxFileparts"),stickersFaved:Fu(s,"stickers_faved_limit","stickersFaved"),savedGifs:Fu(s,"saved_gifs_limit","savedGifs"),dialogFiltersChats:Fu(s,"dialog_filters_chats_limit","dialogFiltersChats"),dialogFilters:Fu(s,"dialog_filters_limit","dialogFilters"),dialogFolderPinned:Fu(s,"dialogs_pinned_limit","dialogFolderPinned"),captionLength:Fu(s,"caption_length_limit","captionLength"),channels:Fu(s,"channels_limit","channels"),channelsPublic:Fu(s,"channels_public_limit","channelsPublic"),aboutLength:Fu(s,"about_length_limit","aboutLength"),chatlistInvites:Fu(s,"chatlist_invites_limit","chatlistInvites"),chatlistJoined:Fu(s,"chatlist_joined_limit","chatlistJoined"),recommendedChannels:Fu(s,"recommended_channels_limit","recommendedChannels"),savedDialogsPinned:Fu(s,"saved_dialogs_pinned_limit","savedDialogsPinned")},hash:t,areStoriesHidden:s.stories_all_hidden,storyExpirePeriod:s.story_expire_period??ne,storyViewersExpirePeriod:s.story_viewers_expire_period??ae,storyChangelogUserId:s.stories_changelog_user_id?.toString()??J,maxPinnedStoriesCount:s.stories_pinned_to_top_count_max,groupTranscribeLevelMin:s.group_transcribe_level_min,canLimitNewMessagesWithoutPremium:s.new_noncontact_peers_require_premium_without_ownpremium,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,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}}(s,n)}async function vl(){const e=await Xo(new pe.Api.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&&gn(o),maxGroupSize:a,autologinToken:i,maxMessageLength:r,editTimeLimit:c,maxForwardedCount:d}}(e)}async function Il(e){const t=await Xo(new pe.Api.help.GetPeerColors({hash:e}));if(!t)return;const s=function(e){if(e instanceof pe.Api.help.PeerColors)return wt(e.colors,(e=>[e.colorId,{isHidden:e.hidden,colors:e.colors&&vi(e.colors),darkColors:e.darkColors&&vi(e.darkColors)}]))}(t);return s?{colors:s,hash:t instanceof pe.Api.help.PeerColors?t.hash:void 0}:void 0}async function Al(e){const t=await Xo(new pe.Api.help.GetTimezonesList({hash:e}));if(t&&!(t instanceof pe.Api.help.TimezonesListNotModified))return{timezones:t.timezones.map(Ii),hash:t.hash}}async function Pl({langCode:e="en"}){const t=await Xo(new pe.Api.help.GetCountriesList({langCode:e}));if(t instanceof pe.Api.help.CountriesList)return function(e){const t=e.filter((({hidden:e})=>!e));return{phoneCodes:t.map((e=>e.countryCodes.map((t=>hi(e,t))))).flat().sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))),general:t.map((e=>hi(e,e.countryCodes[0]))).sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)))}}(t.countries)}async function Cl(){const e=await Xo(new pe.Api.account.GetGlobalPrivacySettings);if(e)return{shouldArchiveAndMuteNewNonContact:Boolean(e.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(e.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(e.newNoncontactPeersRequirePremium)}}async function Ml({shouldArchiveAndMuteNewNonContact:e,shouldHideReadMarks:t,shouldNewNonContactPeersRequirePremium:s}){const n=await Xo(new pe.Api.account.SetGlobalPrivacySettings({settings:new pe.Api.GlobalPrivacySettings({...e&&{archiveAndMuteNewNoncontactPeers:!0},...t&&{hideReadMarks:!0},...s&&{newNoncontactPeersRequirePremium:!0}})}));if(n)return{shouldArchiveAndMuteNewNonContact:Boolean(n.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(n.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(n.newNoncontactPeersRequirePremium)}}function Rl({chatId:e,accessHash:t,username:s,isActive:n}){return Xo(e?new pe.Api.channels.ToggleUsername({channel:Ft(e,t),username:s,active:n}):new pe.Api.account.ToggleUsername({username:s,active:n}))}function kl({chatId:e,accessHash:t,usernames:s}){return Xo(e?new pe.Api.channels.ReorderUsernames({channel:Ft(e,t),order:s}):new pe.Api.account.ReorderUsernames({order:s}))}const Tl={EMAIL_UNCONFIRMED:"Email unconfirmed",EMAIL_HASH_EXPIRED:"Email hash expired",NEW_SALT_INVALID:"The new salt is invalid",NEW_SETTINGS_INVALID:"The new password settings are invalid",CODE_INVALID:"Invalid Code",PASSWORD_HASH_INVALID:"Invalid Password",PASSWORD_MISSING:"You must enable 2FA before executing this operation"},El={};async function Bl(){const e=await Xo(new pe.Api.account.GetPassword);if(!e)return;const{hint:t,hasPassword:s}=e;return{hint:t,hasPassword:s}}function Dl(e){return et({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise(((e,t)=>{El.resolve=e,El.reject=t}))}function Ul(e,t){return function(e,t){return Lo.getTmpPassword(e,t)}(e,t)}function xl(e){try{return t={currentPassword:e,onPasswordCodeError:Ol},Lo.getCurrentPassword(t)}catch(e){return void Ol(e)}var t}async function Vl(e){try{return await tr({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Hl(e),!1}}async function Nl(e){try{return await tr({currentPassword:e}),!0}catch(e){return Hl(e),!1}}async function Fl(e,t,s,n){try{return await tr({currentPassword:e,newPassword:t,hint:s,email:n,emailCodeCallback:Dl,onEmailCodeError:Hl}),!0}catch(e){return Hl(e),!1}}async function Gl(e,t){try{return await tr({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Dl,onEmailCodeError:Hl}),!0}catch(e){return Hl(e),!1}}function ql(e){El.resolve(e)}function Hl(e){let t;if(e instanceof pe.errors.FloodWaitError){const s=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(s>1?`${s} hours`:"an hour")}else t=Tl[e.message];t||(t="Unexpected Error",c&&console.error(e)),et({"@type":"updateTwoFaError",message:t})}function Ol(e){let t;if(e instanceof pe.errors.PasswordModifiedError){const s=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(s>1?`${s} hours`:"an hour")}else t=Tl[e.message];t||(t="Unexpected Error",c&&console.error(e)),et({"@type":"updatePasswordError",error:t})}async function Ll({chatId:e,accessHash:t,messageId:s,data:n,isGame:a}){const i=await Xo(new pe.Api.messages.GetBotCallbackAnswer({peer:Vt(e,t),msgId:s,data:n?Xe(n):void 0,game:a||void 0}));return i?Ae(i):void 0}async function jl(){const e=await Xo(new pe.Api.contacts.GetTopPeers({botsInline:!0}));if(e instanceof pe.Api.contacts.TopPeers)return{ids:e.users.map(ei).filter(Boolean).map((({id:e})=>e))}}async function Wl(){const e=await Xo(new pe.Api.contacts.GetTopPeers({botsApp:!0}));if(e instanceof pe.Api.contacts.TopPeers)return{ids:e.users.map(ei).filter(Boolean).map((({id:e})=>e))}}async function zl({username:e}){const t=await Xo(new pe.Api.contacts.ResolveUsername({username:e}));if(t&&t.users[0]instanceof pe.Api.User&&t.users[0].bot&&t.users[0].botInlinePlaceholder)return $e(t.users[0]),{user:ei(t.users[0]),chat:In(t.users[0])}}async function Kl({bot:e,chat:t,query:s,offset:n=""}){const a=await Xo(new pe.Api.messages.GetInlineBotResults({bot:Vt(e.id,e.accessHash),peer:Vt(t.id,t.accessHash),query:s,offset:n}));var i,o,r,c,d,u;if(a)return{isGallery:Boolean(a.gallery),help:e.botPlaceholder,nextOffset:(d=e.usernames[0].username,u=a.nextOffset,"gif"===d&&"0"===u?"":u),switchPm:(c=a.switchPm,c?St(c,["text","startParam"]):void 0),switchWebview:(r=a.switchWebview,r?St(r,["text","url"]):void 0),results:(i=String(a.queryId),o=a.results,o.map((e=>e instanceof pe.Api.BotInlineMediaResult?(e.document instanceof pe.Api.Document&&We(e.document),e.photo instanceof pe.Api.Photo&&je(e.photo),function(e,t){const{id:s,type:n,title:a,description:i,photo:o,document:r}=e;return{id:s,queryId:t,type:n,title:a,description:i,..."sticker"===n&&r instanceof pe.Api.Document&&{sticker:qs(r)},...o instanceof pe.Api.Photo&&{photo:ks(o)},..."gif"===n&&r instanceof pe.Api.Document&&{gif:$s(r)},..."video"===n&&r instanceof pe.Api.Document&&{thumbnail:Ms(r.thumbs)}}}(e,i)):(e.thumb&&Je(e.thumb),function(e,t){const{id:s,type:n,title:a,description:i,url:o,thumb:r}=e;return{id:s,queryId:t,type:n,title:a,description:i,url:o,webThumbnail:an(r)}}(e,i))))),cacheTime:a.cacheTime}}async function $l({chat:e,replyInfo:t,resultId:s,queryId:n,sendAs:a,isSilent:i,scheduleDate:o}){const r=Lt();await Xo(new pe.Api.messages.SendInlineBotResult({clearDraft:!0,randomId:r,queryId:Se()(n),peer:Vt(e.id,e.accessHash),id:s,scheduleDate:o,replyTo:t&&ls(t),...i&&{silent:!0},...a&&{sendAs:Vt(a.id,a.accessHash)}}))}async function Jl({bot:e,startParam:t}){const s=Lt();await Xo(new pe.Api.messages.StartBot({bot:Vt(e.id,e.accessHash),peer:Vt(e.id,e.accessHash),randomId:s,startParam:t}))}async function Ql({isSilent:e,peer:t,bot:s,url:n,startParam:a,replyInfo:i,theme:o,sendAs:r,isFromBotMenu:c,isFullscreen:d}){const u=await Xo(new pe.Api.messages.RequestWebView({silent:e||void 0,peer:Vt(t.id,t.accessHash),bot:Vt(s.id,s.accessHash),url:n,startParam:a,themeParams:o?ts(o):void 0,fromBotMenu:c||void 0,platform:K,replyTo:i&&ls(i),fullscreen:!!d||void 0,...r&&{sendAs:Vt(r.id,r.accessHash)}}));if(u instanceof pe.Api.WebViewResultUrl)return{url:u.url,queryId:u.queryId?.toString(),isFullScreen:Boolean(u.fullscreen)}}async function Xl({peer:e,bot:t,startParam:s,mode:n,theme:a}){const i=await Xo(new pe.Api.messages.RequestMainWebView({peer:Vt(e.id,e.accessHash),bot:Vt(t.id,t.accessHash),startParam:s,fullscreen:"fullscreen"===n||void 0,themeParams:a?ts(a):void 0,platform:K}));if(i instanceof pe.Api.WebViewResultUrl)return{url:i.url,queryId:i.queryId?.toString(),isFullscreen:Boolean(i.fullscreen)}}async function Yl({bot:e,url:t,theme:s,startParam:n,isFromSwitchWebView:a,isFromSideMenu:i}){const o=await Xo(new pe.Api.messages.RequestSimpleWebView({url:t,bot:Vt(e.id,e.accessHash),themeParams:s?ts(s):void 0,platform:K,startParam:n,fromSwitchWebview:a||void 0,fromSideMenu:i||void 0}));return o?.url}async function Zl({bot:e,appName:t}){const s=await Xo(new pe.Api.messages.GetBotApp({app:new pe.Api.InputBotAppShortName({botId:Ft(e.id,e.accessHash),shortName:t})}));if(s&&!(s instanceof pe.Api.BotAppNotModified))return function(e){const{app:t,inactive:s,requestWriteAccess:n}=e,a=function(e){if(e instanceof pe.Api.BotAppNotModified)return;const{id:t,accessHash:s,title:n,description:a,shortName:i,photo:o,document:r}=e,c=o instanceof pe.Api.Photo?ks(o):void 0,d=r instanceof pe.Api.Document?Qs(r):void 0;return{id:t.toString(),accessHash:s.toString(),title:n,description:a,shortName:i,photo:c,document:d}}(t);if(a)return{...a,isInactive:s,shouldRequestWriteAccess:n}}(s)}async function ef({peer:e,app:t,startParam:s,mode:n,theme:a,isWriteAllowed:i}){const o=await Xo(new pe.Api.messages.RequestAppWebView({peer:Vt(e.id,e.accessHash),app:us(t),startParam:s,themeParams:a?ts(a):void 0,platform:K,writeAllowed:i||void 0,fullscreen:"fullscreen"===n||void 0}));return{url:o?.url,isFullscreen:Boolean(o?.fullscreen)}}function tf({isSilent:e,peer:t,bot:s,queryId:n,replyInfo:a,sendAs:i}){return Xo(new pe.Api.messages.ProlongWebView({silent:e||void 0,peer:Vt(t.id,t.accessHash),bot:Vt(s.id,s.accessHash),queryId:Se()(n),replyTo:a&&ls(a),...i&&{sendAs:Vt(i.id,i.accessHash)}}))}async function sf({bot:e,buttonText:t,data:s}){const n=Lt();await Xo(new pe.Api.messages.SendWebViewData({bot:Vt(e.id,e.accessHash),buttonText:t,data:s,randomId:n}))}async function nf({hash:e}){const t=await Xo(new pe.Api.messages.GetAttachMenuBots({hash:e?Se()(e):void 0}));if(t instanceof pe.Api.AttachMenuBots)return{hash:t.hash.toString(),bots:bt(t.bots.map(ja),"id")}}async function af({bot:e}){const t=await Xo(new pe.Api.messages.GetAttachMenuBot({bot:Vt(e.id,e.accessHash)}));if(t instanceof pe.Api.AttachMenuBotsBot)return{bot:ja(t.bot)}}function of({bot:e,isWriteAllowed:t,isEnabled:s}){return Xo(new pe.Api.messages.ToggleBotInAttachMenu({bot:Vt(e.id,e.accessHash),writeAllowed:t||void 0,enabled:s}))}async function rf({chat:e,buttonId:t,messageId:s}){const n=await Xo(new pe.Api.messages.RequestUrlAuth({peer:Vt(e.id,e.accessHash),buttonId:t,msgId:s}));if(!n)return;const a=yi(n);return"request"===a?.type&&et({"@type":"updateUser",id:a.bot.id,user:a.bot}),a}async function cf({chat:e,messageId:t,buttonId:s,isWriteAllowed:n}){const a=await Xo(new pe.Api.messages.AcceptUrlAuth({peer:Vt(e.id,e.accessHash),msgId:t,buttonId:s,writeAllowed:n||void 0}));if(!a)return;const i=yi(a);return"request"===i?.type&&et({"@type":"updateUser",id:i.bot.id,user:i.bot}),i}async function df({url:e}){const t=await Xo(new pe.Api.messages.RequestUrlAuth({url:e}));if(!t)return;const s=yi(t);return"request"===s?.type&&et({"@type":"updateUser",id:s.bot.id,user:s.bot}),s}async function uf({url:e,isWriteAllowed:t}){const s=await Xo(new pe.Api.messages.AcceptUrlAuth({url:e,writeAllowed:t||void 0}));if(!s)return;const n=yi(s);return"request"===n?.type&&et({"@type":"updateUser",id:n.bot.id,user:n.bot}),n}function lf({bot:e}){return Xo(new pe.Api.bots.CanSendMessage({bot:Ft(e.id,e.accessHash)}))}function ff({bot:e}){return Xo(new pe.Api.bots.AllowSendMessage({bot:Ft(e.id,e.accessHash)}),{shouldReturnTrue:!0})}async function pf({bot:e,customMethod:t,parameters:s}){try{const n=await Xo(new pe.Api.bots.InvokeWebViewCustomMethod({bot:Vt(e.id,e.accessHash),params:new pe.Api.DataJSON({data:s}),customMethod:t}),{shouldThrow:!0});return{result:JSON.parse(n.data)}}catch(e){return{error:e.message}}}async function gf({bot:e}){const t=await Xo(new pe.Api.bots.GetPreviewMedias({bot:Vt(e.id,e.accessHash)}));if(t)return t.map((e=>({content:Ks(e.media),date:e.date})))}function hf({bot:e,fileName:t,url:s}){return Xo(new pe.Api.bots.CheckDownloadFileParams({bot:Vt(e.id,e.accessHash),fileName:t,url:s}),{shouldReturnTrue:!0})}function mf({bot:e,langCode:t,name:s,about:n,description:a}){return Xo(new pe.Api.bots.SetBotInfo({bot:Vt(e.id,e.accessHash),langCode:t,name:s||"",about:n||"",description:a||""}),{shouldReturnTrue:!0})}async function yf({offset:e="",limit:t}){const s=await Xo(new pe.Api.bots.GetPopularAppBots({offset:e,limit:t}));if(s)return{peerIds:s.users.map(ei).filter(Boolean).map((({id:e})=>e)),nextOffset:s.nextOffset}}var _f=s(48287).hp;async function bf({call:e}){const t=await Xo(new pe.Api.phone.GetGroupCall({call:ns(e)}));if(t)return{groupCall:ms(t.call)}}function wf({call:e}){return Xo(new pe.Api.phone.DiscardGroupCall({call:ns(e)}),{shouldReturnTrue:!0})}function Sf({call:e,participant:t,muted:s,presentationPaused:n,videoStopped:a,videoPaused:i,volume:o,raiseHand:r}){return Xo(new pe.Api.phone.EditGroupCallParticipant({call:ns(e),participant:Vt(t.id,t.accessHash),...void 0!==a&&{videoStopped:a},...void 0!==i&&{videoPaused:i},...void 0!==s&&{muted:s},...void 0!==n&&{presentationPaused:n},...void 0!==r&&{raiseHand:r},...void 0!==o&&{volume:o}}),{shouldReturnTrue:!0})}function vf({groupCall:e,title:t}){return Xo(new pe.Api.phone.EditGroupCallTitle({title:t,call:ns(e)}),{shouldReturnTrue:!0})}async function If({call:e,canSelfUnmute:t}){const s=await Xo(new pe.Api.phone.ExportGroupCallInvite({canSelfUnmute:t||void 0,call:ns(e)}));if(s)return s.link}async function Af({call:e,offset:t}){const s=await Xo(new pe.Api.phone.GetGroupParticipants({call:ns(e),ids:[],sources:[],offset:t||"",limit:w}));s&&et({"@type":"updateGroupCallParticipants",groupCallId:e.id,participants:s.participants.map(ps),nextOffset:s.nextOffset})}function Pf({call:e,isPageUnload:t}){const s=new pe.Api.phone.LeaveGroupCall({call:ns(e)});t?Yo(s):Xo(s,{shouldReturnTrue:!0})}async function Cf({call:e,inviteHash:t,params:s}){const n=await Xo(new pe.Api.phone.JoinGroupCall({call:ns(e),joinAs:new pe.Api.InputPeerSelf,muted:!0,videoStopped:!0,params:new pe.Api.DataJSON({data:JSON.stringify(s)}),inviteHash:t}),{shouldRetryOnTimeout:!0,abortControllerGroup:"call"});if(n&&n instanceof pe.Api.Updates){const e=n.updates.find((e=>e instanceof pe.Api.UpdateGroupCall));if(!(e instanceof pe.Api.UpdateGroupCall))return;return ms(e.call)}}async function Mf({peer:e}){const t=Wt(),s=await Xo(new pe.Api.phone.CreateGroupCall({peer:Vt(e.id,e.accessHash),randomId:t}));if(s&&s instanceof pe.Api.Updates){const e=s.updates[0];if(e instanceof pe.Api.UpdateGroupCall)return ms(e.call)}}function Rf({call:e,params:t}){return Xo(new pe.Api.phone.JoinGroupCallPresentation({call:ns(e),params:new pe.Api.DataJSON({data:JSON.stringify(t)})}),{shouldReturnTrue:!0})}function kf({call:e,subscribed:t}){return Xo(new pe.Api.phone.ToggleGroupCallStartSubscription({call:ns(e),subscribed:t}),{shouldReturnTrue:!0,shouldIgnoreErrors:!0})}function Tf({call:e}){return Xo(new pe.Api.phone.LeaveGroupCallPresentation({call:ns(e)}),{shouldReturnTrue:!0})}async function Ef(){const e=await Xo(new pe.Api.messages.GetDhConfig({}));if(e&&!(e instanceof pe.Api.messages.DhConfigNotModified))return{g:e.g,p:Array.from(e.p),random:Array.from(e.random)}}function Bf({call:e,isBusy:t,isPageUnload:s}){const n=new pe.Api.phone.DiscardCall({peer:as(e),reason:t?new pe.Api.PhoneCallDiscardReasonBusy:new pe.Api.PhoneCallDiscardReasonHangup});s?Yo(n):Xo(n,{shouldReturnTrue:!0})}async function Df({user:e,gAHash:t,isVideo:s}){const n=await Xo(new pe.Api.phone.RequestCall({randomId:Wt(),userId:Vt(e.id,e.accessHash),gAHash:_f.from(t),...s&&{video:!0},protocol:Ss()}));if(n)return et({"@type":"updatePhoneCall",call:ys(n.phoneCall)}),!0}function Uf({call:e,rating:t,comment:s}){return Xo(new pe.Api.phone.SetCallRating({rating:t,peer:as(e),comment:s}),{shouldReturnTrue:!0})}function xf({call:e}){return Xo(new pe.Api.phone.ReceivedCall({peer:as(e)}))}async function Vf({call:e,gB:t}){const s=await Xo(new pe.Api.phone.AcceptCall({peer:as(e),gB:_f.from(t),protocol:Ss()}));if(s)return et({"@type":"updatePhoneCall",call:e=ys(s.phoneCall)}),!0}async function Nf({call:e,gA:t,keyFingerprint:s}){const n=await Xo(new pe.Api.phone.ConfirmCall({peer:as(e),gA:_f.from(t),keyFingerprint:Se()(s),protocol:Ss()}));if(n)return et({"@type":"updatePhoneCall",call:e=ys(n.phoneCall)}),!0}function Ff({data:e,call:t}){return Xo(new pe.Api.phone.SendSignalingData({data:_f.from(e),peer:as(t)}))}function Gf({chat:e,emoticon:t}){return Xo(new pe.Api.messages.SetTyping({peer:Vt(e.id,e.accessHash),action:new pe.Api.SendMessageEmojiInteractionSeen({emoticon:t})}),{abortControllerChatId:e.id})}function qf({chat:e,emoticon:t,messageId:s,timestamps:n}){return Xo(new pe.Api.messages.SetTyping({peer:Vt(e.id,e.accessHash),action:new pe.Api.SendMessageEmojiInteraction({emoticon:t,msgId:s,interaction:new pe.Api.DataJSON({data:JSON.stringify({v:1,a:n.map((e=>({t:e,i:1})))})})})}),{abortControllerChatId:e.id})}async function Hf(){const e=await Xo(new pe.Api.messages.GetAvailableReactions({}));if(e&&!(e instanceof pe.Api.messages.AvailableReactionsNotModified))return e.reactions.forEach((e=>{e.staticIcon instanceof pe.Api.Document&&(De.documents[String(e.staticIcon.id)]=e.staticIcon),e.selectAnimation instanceof pe.Api.Document&&(De.documents[String(e.selectAnimation.id)]=e.selectAnimation),e.aroundAnimation instanceof pe.Api.Document&&(De.documents[String(e.aroundAnimation.id)]=e.aroundAnimation),e.appearAnimation instanceof pe.Api.Document&&(De.documents[String(e.appearAnimation.id)]=e.appearAnimation),e.centerIcon instanceof pe.Api.Document&&(De.documents[String(e.centerIcon.id)]=e.centerIcon)})),e.reactions.map(mn)}async function Of(){const e=await Xo(new pe.Api.messages.GetAvailableEffects({}));if(!e||e instanceof pe.Api.messages.AvailableEffectsNotModified)return;const t=new Map(e.documents.map((e=>[String(e.id),e])));e.documents.forEach((e=>{e instanceof pe.Api.Document&&(De.documents[String(e.id)]=e)}));const s=e.effects.map(yn),n=[],a=[];for(const e of s)if(e.effectAnimationId){const s=t.get(e.effectStickerId),n=s&&qs(s,!1,e.isPremium);n&&a.push(n)}else{const t=qs(De.documents[e.effectStickerId]);t&&n.push(t)}return{effects:s,emojis:a,stickers:n}}function Lf({chat:e,messageId:t,reactions:s,shouldAddToRecent:n}){return Xo(new pe.Api.messages.SendReaction({reaction:s?.map((e=>rs(e))),peer:Vt(e.id,e.accessHash),msgId:t,...n&&{addToRecent:!0}}),{shouldReturnTrue:!0,shouldThrow:!0})}function jf({chat:e,messageId:t,count:s,isPrivate:n}){return Xo(new pe.Api.messages.SendPaidReaction({peer:Vt(e.id,e.accessHash),msgId:t,randomId:jt(),count:s,private:n||void 0}),{shouldReturnTrue:!0,shouldThrow:!0})}function Wf({ids:e,chat:t}){Ct(e,v).forEach((e=>{Xo(new pe.Api.messages.GetMessagesReactions({id:e,peer:Vt(t.id,t.accessHash)}),{shouldReturnTrue:!0,abortControllerChatId:t.id})}))}async function zf({chat:e,messageId:t,reaction:s,offset:n}){const a=await Xo(new pe.Api.messages.GetMessageReactionsList({peer:Vt(e.id,e.accessHash),id:t,...s&&{reaction:rs(s)},limit:C,...n&&{offset:n}}));if(!a)return;const{nextOffset:i,reactions:o,count:r}=a;return{nextOffset:i,reactions:o.map(pn).filter(Boolean),count:r}}function Kf({reaction:e}){return Xo(new pe.Api.messages.SetDefaultReaction({reaction:rs(e)}))}async function $f({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetTopReactions({limit:A,hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map((e=>gn(e))).filter(Boolean)}}async function Jf({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetRecentReactions({limit:P,hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map((e=>gn(e))).filter(Boolean)}}function Qf(){return Xo(new pe.Api.messages.ClearRecentReactions)}async function Xf({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetDefaultTagReactions({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map((e=>gn(e))).filter(Boolean)}}async function Yf({hash:e="0"}){const t=await Xo(new pe.Api.messages.GetSavedReactionTags({hash:Se()(e)}));if(t&&!(t instanceof pe.Api.messages.SavedReactionTagsNotModified))return{hash:String(t.hash),tags:t.tags.map(hn).filter(Boolean)}}function Zf({reaction:e,title:t}){return Xo(new pe.Api.messages.UpdateSavedReactionTag({reaction:rs(e),title:t}),{shouldReturnTrue:!0})}async function ep({chat:e,dcId:t}){const s=await Xo(new pe.Api.stats.GetBroadcastStats({channel:Ft(e.id,e.accessHash)}),{dcId:t});var n;if(s)return{stats:(n=s,{growthGraph:$n(n.growthGraph),followersGraph:$n(n.followersGraph),muteGraph:$n(n.muteGraph),topHoursGraph:$n(n.topHoursGraph),languagesGraph:n.languagesGraph.token,viewsBySourceGraph:n.viewsBySourceGraph.token,newFollowersBySourceGraph:n.newFollowersBySourceGraph.token,interactionsGraph:n.interactionsGraph.token,reactionsByEmotionGraph:n.reactionsByEmotionGraph.token,storyInteractionsGraph:n.storyInteractionsGraph.token,storyReactionsByEmotionGraph:n.storyReactionsByEmotionGraph.token,followers:Qn(n.followers),viewsPerPost:Qn(n.viewsPerPost),sharesPerPost:Qn(n.sharesPerPost),enabledNotifications:Xn(n.enabledNotifications),reactionsPerPost:Qn(n.reactionsPerPost),viewsPerStory:Qn(n.viewsPerStory),sharesPerStory:Qn(n.sharesPerStory),reactionsPerStory:Qn(n.reactionsPerStory),recentPosts:n.recentPostsInteractions.map(jn).filter(Boolean)}),users:[]}}async function tp({peer:e,dcId:t}){const s=await Xo(new pe.Api.stats.GetBroadcastRevenueStats({peer:Vt(e.id,e.accessHash)}),{dcId:t});var n;if(s)return{topHoursGraph:$n((n=s).topHoursGraph),revenueGraph:$n(n.revenueGraph,void 0,!0,n.usdRate),balances:Zn(n.balances),usdRate:n.usdRate}}async function sp({chat:e,dcId:t}){const s=await Xo(new pe.Api.stats.GetMegagroupStats({channel:Ft(e.id,e.accessHash)}),{dcId:t});var n,a;if(s)return{stats:(n=s,{growthGraph:$n(n.growthGraph),membersGraph:$n(n.membersGraph),topHoursGraph:$n(n.topHoursGraph),languagesGraph:n.languagesGraph.token,messagesGraph:n.messagesGraph.token,actionsGraph:n.actionsGraph.token,period:(a=n.period,{maxDate:a.maxDate,minDate:a.minDate}),members:Qn(n.members),viewers:Qn(n.viewers),messages:Qn(n.messages),posters:Qn(n.posters)})}}async function np({chat:e,messageId:t,dcId:s}){const n=await Xo(new pe.Api.stats.GetMessageStats({channel:Ft(e.id,e.accessHash),msgId:t}),{dcId:s});if(n)return Wn(n)}async function ap({chat:e,messageId:t,dcId:s,offset:n}){const a=await Xo(new pe.Api.stats.GetMessagePublicForwards({channel:Ft(e.id,e.accessHash),msgId:t,offset:n,limit:I}),{dcId:s});if(a)return{forwards:zn(a),count:a.count,nextOffset:a.nextOffset}}async function ip({token:e,x:t,isPercentage:s,dcId:n}){const a=await Xo(new pe.Api.stats.LoadAsyncGraph({token:e,...t&&{x:Se()(t)}}),{dcId:n});if(a)return $n(a,s)}async function op({chat:e,storyId:t,dcId:s}){const n=await Xo(new pe.Api.stats.GetStoryStats({peer:Vt(e.id,e.accessHash),id:t}),{dcId:s});if(n)return Wn(n)}async function rp({chat:e,storyId:t,dcId:s,offset:n}){const a=await Xo(new pe.Api.stats.GetStoryPublicForwards({peer:Vt(e.id,e.accessHash),id:t,offset:n,limit:I}),{dcId:s});if(a)return{publicForwards:Kn(a),count:a.count,nextOffset:a.nextOffset}}async function cp({peer:e,currentPassword:t}){try{const s=await xl(t);if(!s||"error"in s)return;const n=await Xo(new pe.Api.stats.GetBroadcastRevenueWithdrawalUrl({peer:Vt(e.id,e.accessHash),password:s}),{shouldThrow:!0});if(!n)return;return n}catch(e){Ol(e)}}var dp=s(21051),up=s.n(dp),lp=s(51369),fp=s.n(lp),pp=s(35897),gp=s.n(pp),hp=s(48287).hp;function mp(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}let yp;class _p{constructor(e){this.isOutgoing=e,mp(this,"state",void 0),mp(this,"seq",0),mp(this,"gA",void 0),mp(this,"gB",void 0),mp(this,"p",void 0),mp(this,"random",void 0),mp(this,"waitForState",void 0),mp(this,"resolveState",void 0),this.waitForState=new Promise((e=>{this.resolveState=e}))}async requestCall({p:e,g:t,random:s}){const n=Bt().readBigIntFromBuffer(hp.from(e),!1),a=Bt().readBigIntFromBuffer(hp.from(s),!1),i=Bt().modExp(Se()(t),a,n);this.gA=i,this.p=n,this.random=a;const o=await Bt().sha256(Bt().getByteArray(i));return Array.from(o)}acceptCall({p:e,g:t,random:s}){const n=Bt().readBigIntFromBuffer(e,!1),a=Bt().readBigIntFromBuffer(s,!1),i=Bt().modExp(Se()(t),a,n);return this.gB=i,this.p=n,this.random=a,Array.from(Bt().getByteArray(i))}async confirmCall(e,t,s){this.isOutgoing?this.gB=Bt().readBigIntFromBuffer(hp.from(e),!1):this.gA=Bt().readBigIntFromBuffer(hp.from(e),!1);const n=Bt().modExp(this.isOutgoing?this.gB:this.gA,this.random,this.p),a=await Bt().sha1(Bt().getByteArray(n)),i=Bt().readBigIntFromBuffer(a.slice(-8).reverse(),!1),o=await async function(e,t,s,n){const a=await Bt().sha256(hp.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),Se()(r[0]).and(127).shiftLeft(56).or(Se()(r[1]).shiftLeft(48)).or(Se()(r[2]).shiftLeft(40)).or(Se()(r[3]).shiftLeft(32)).or(Se()(r[4]).shiftLeft(24)).or(Se()(r[5]).shiftLeft(16)).or(Se()(r[6]).shiftLeft(8)).or(Se()(r[7]))).modPow(1,o).toJSNumber(),c=n[t],d=n[t+1]-c;i.push(String.fromCharCode(...s.subarray(c,c+d)))}var r;return i.join("")}(Bt().getByteArray(n),Bt().getByteArray(this.gA),t,s),r=new(up());return await r.setKey(Bt().getByteArray(n)),this.state=new(gp())(r,new(fp()),!0,this.isOutgoing),this.resolveState(),{gA:Array.from(Bt().getByteArray(this.gA)),keyFingerprint:i.toString(),emojis:o}}async encode(e){if(!this.state)return;const t=new Uint32Array(1);t[0]=this.seq++;const s=await this.state.encryptMessageData(hp.concat([Bt().convertToLittle(t),hp.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(hp.from(e));return JSON.parse(t.toString())}}function bp(e){yp=new _p(...e)}function wp(){yp=void 0}function Sp(e){return yp.encode(...e)}async function vp(e){if(yp)return await yp.decode(...e)}function Ip(e){return yp.confirmCall(...e)}function Ap(e){return yp.acceptCall(...e)}function Pp(e){return yp.requestCall(...e)}async function Cp({stateHash:e,isFirstRequest:t=!1,isHidden:s=!1}){const n=t?s?{hidden:!0}:{}:{state:e,next:!0,...s&&{hidden:!0}},a=await Xo(new pe.Api.stories.GetAllStories(n));if(!a)return;if(a instanceof pe.Api.stories.AllStoriesNotModified)return{state:a.state,stealthMode:qa(a.stealthMode)};const i=a.peerStories.reduce(((e,t)=>{const s=ye(t.peer),n=function(e){const t=ye(e.peer);return wt(e.stories,(e=>[e.id,Na(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 a.peerStories.forEach((e=>e.stories.forEach((t=>Le(t,ye(e.peer)))))),{peerStories:i,hasMore:a.hasMore,state:a.state,stealthMode:qa(a.stealthMode)}}async function Mp({peer:e}){const t=await Xo(new pe.Api.stories.GetPeerStories({peer:Vt(e.id,e.accessHash)}));if(!t)return;const s=wt(t.stories.stories,(t=>[t.id,Na(e.id,t)]));return t.stories.stories.forEach((t=>Le(t,e.id))),{stories:s,lastReadStoryId:t.stories.maxReadId}}function Rp({peer:e,offsetId:t}){return Lp({method:new pe.Api.stories.GetPinnedStories({peer:Vt(e.id,e.accessHash),offsetId:t,limit:S}),peerId:e.id})}function kp({peer:e,offsetId:t}){return Lp({method:new pe.Api.stories.GetStoriesArchive({peer:e&&Vt(e.id,e.accessHash),offsetId:t,limit:S}),peerId:e.id})}async function Tp({peer:e,ids:t}){const s=await Xo(new pe.Api.stories.GetStoriesByID({peer:Vt(e.id,e.accessHash),id:t}));if(!s)return;const n=t.reduce(((t,n)=>{const a=s.stories.find((({id:e})=>e===n));return t[n]=a?Na(e.id,a):{id:n,peerId:e.id,isDeleted:!0},t}),{});return s.stories.forEach((t=>Le(t,e.id))),{pinnedIds:s.pinnedToTop,stories:n}}function Ep({peer:e,storyId:t}){return Xo(new pe.Api.stories.IncrementStoryViews({peer:Vt(e.id,e.accessHash),id:[t]}))}function Bp({peer:e,storyId:t}){return Xo(new pe.Api.stories.ReadStories({peer:Vt(e.id,e.accessHash),maxId:t}))}function Dp({peer:e,storyId:t}){return Xo(new pe.Api.stories.DeleteStories({peer:Vt(e.id,e.accessHash),id:[t]}))}function Up({peer:e,storyId:t,isInProfile:s}){return Xo(new pe.Api.stories.TogglePinned({peer:Vt(e.id,e.accessHash),id:[t],pinned:s}))}function xp({peer:e,storyIds:t}){return Xo(new pe.Api.stories.TogglePinnedToTop({peer:Vt(e.id,e.accessHash),id:t}))}async function Vp({peer:e,storyId:t,areJustContacts:s,query:n,areReactionsFirst:a,limit:i=S,offset:o=""}){const r=await Xo(new pe.Api.stories.GetStoryViewsList({peer:Vt(e.id,e.accessHash),id:t,justContacts:s,q:n,reactionsFirst:a,limit:i,offset:o}));if(r)return{views:r.views.map(Ga).filter(Boolean),nextOffset:r.nextOffset,reactionsCount:r.reactionsCount,viewsCount:r.count}}async function Np({peer:e,storyIds:t}){const s=await Xo(new pe.Api.stories.GetStoriesViews({peer:Vt(e.id,e.accessHash),id:t}));if(s?.views[0])return{views:Fa(s.views[0])}}async function Fp({peer:e,storyId:t}){const s=await Xo(new pe.Api.stories.ExportStoryLink({peer:Vt(e.id,e.accessHash),id:t}));if(s)return s.link}async function Gp({peer:e,storyId:t,description:s,option:n}){try{const a=await Xo(new pe.Api.stories.Report({peer:Vt(e.id,e.accessHash),id:[t],option:Xe(n),message:s}),{shouldThrow:!0});if(!a)return;return{result:Va(a),error:void 0}}catch(e){const t=e.message;if(t===W)return{result:void 0,error:t};throw e}}function qp({peer:e,id:t,privacy:s}){return Xo(new pe.Api.stories.EditStory({peer:Vt(e.id,e.accessHash),id:t,privacyRules:fs(s)}),{shouldReturnTrue:!0})}function Hp({peer:e,isHidden:t}){return Xo(new pe.Api.stories.TogglePeerStoriesHidden({peer:Vt(e.id,e.accessHash),hidden:t}))}function Op({peers:e}){return Xo(new pe.Api.stories.GetPeerMaxIDs({id:e.map((e=>Vt(e.id,e.accessHash)))}),{shouldIgnoreErrors:!0})}async function Lp({method:e,peerId:t}){const s=await Xo(e);if(!s)return;const n=wt(s.stories,(e=>[e.id,Na(t,e)]));return s.stories.forEach((e=>Le(e,t))),{stories:n,pinnedIds:s.pinnedToTop}}function jp({peer:e,storyId:t,reaction:s,shouldAddToRecent:n}){return Xo(new pe.Api.stories.SendReaction({reaction:s?rs(s):new pe.Api.ReactionEmpty,peer:Vt(e.id,e.accessHash),storyId:t,...n&&{addToRecent:!0}}),{shouldReturnTrue:!0})}function Wp({isForPast:e,isForFuture:t}){return Xo(new pe.Api.stories.ActivateStealthMode({past:e,future:t}),{shouldReturnTrue:!0})}async function zp({inputInvoice:e,requestInfo:t,shouldSave:s}){const n=await Xo(new pe.Api.payments.ValidateRequestedInfo({invoice:os(e),save:s||void 0,info:Yt(t)}));if(!n)return;const{id:a,shippingOptions:i}=n;return a?{id:a,shippingOptions:ea(i)}:void 0}async function Kp({inputInvoice:e,formId:t,requestedInfoId:s,shippingOptionId:n,credentials:a,savedCredentialId:i,temporaryPassword:o,tipAmount:r}){const c=o&&i?new pe.Api.InputPaymentCredentialsSaved({id:i,tmpPassword:Xe(o)}):new pe.Api.InputPaymentCredentials({save:a.save,data:new pe.Api.DataJSON({data:JSON.stringify(a.data)})}),d=await Xo(new pe.Api.payments.SendPaymentForm({formId:Se()(t),invoice:os(e),requestedInfoId:s,shippingOptionId:n,credentials:c,...r&&{tipAmount:Se()(r)}}));return!!d&&(d instanceof pe.Api.payments.PaymentVerificationNeeded?void et({"@type":"updatePaymentVerificationNeeded",url:d.url}):(Qo(d.updates),Boolean(d)))}async function $p({formId:e,inputInvoice:t}){const s=await Xo(new pe.Api.payments.SendStarsForm({formId:Se()(e),invoice:os(t)}));if(s){if(!(s instanceof pe.Api.payments.PaymentVerificationNeeded)){if(Qo(s.updates),"chatInviteSubscription"===t.type){const e="updates"in s.updates?s.updates.updates:void 0,t=e?.find((e=>e instanceof pe.Api.UpdateChannel))?.channelId;if(!t)return;return{channelId:me(t,"channel")}}return{completed:!0}}c&&console.warn("Unexpected PaymentVerificationNeeded in sendStarsForm")}}async function Jp(e,t){try{const s=await Xo(new pe.Api.payments.GetPaymentForm({invoice:os(e),themeParams:t?ts(t):void 0}),{shouldThrow:!0});if(!s)return;return function(e){if(e instanceof pe.Api.payments.PaymentFormStarGift){const{formId:t}=e;return{type:"stargift",formId:String(t),invoice:sa(e.invoice)}}if(e instanceof pe.Api.payments.PaymentFormStars){const{botId:t,formId:s,title:n,description:a,photo:i}=e;return i&&Je(i),{type:"stars",botId:me(t,"user"),formId:String(s),title:n,description:a,photo:an(i),invoice:sa(e.invoice)}}const{formId:t,canSaveCredentials:s,passwordMissing:n,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:c,savedCredentials:d,url:u,botId:l,description:f,title:p,photo:g}=e;g&&Je(g);const{shippingAddress:h}=r||{},m=r?Ae(r):void 0;m&&h&&(m.shippingAddress=Ae(h));const y=o?JSON.parse(o.data):{};return{type:"regular",title:p,description:f,photo:an(g),url:u,botId:me(l,"user"),canSaveCredentials:s,isPasswordMissing:n,formId:String(t),providerId:String(a),nativeProvider:i,savedInfo:m,invoice:sa(c),nativeParams:{needCardholderName:Boolean(y?.need_cardholder_name),needCountry:Boolean(y?.need_country),needZip:Boolean(y?.need_zip),publishableKey:y?.publishable_key,publicToken:y?.public_token,tokenizeUrl:y?.tokenize_url},savedCredentials:d&&(_=d,_.map((({id:e,title:t})=>({id:e,title:t}))))};var _}(s)}catch(e){return e instanceof Error?(et({"@type":"error",error:{message:e.message,hasErrorKey:!0}}),{error:e.message}):void 0}}async function Qp(e,t){const s=await Xo(new pe.Api.payments.GetPaymentReceipt({peer:Vt(e.id,e.accessHash),msgId:t}));if(s)return{receipt:ta(s)}}async function Xp(){const e=await Xo(new pe.Api.help.GetPremiumPromo);if(e)return e.videos.forEach((e=>{e instanceof pe.Api.Document&&(De.documents[e.id.toString()]=e)})),{promo:na(e)}}async function Yp(e){const t=await Ul(e);if(t)return"error"in t?t:{value:Qe(t.tmpPassword),validUntil:t.validUntil}}async function Zp(){const e=await Xo(new pe.Api.premium.GetMyBoosts);if(e)return{boosts:e.myBoosts.map(oa)}}async function eg({chat:e,slots:t}){const s=await Xo(new pe.Api.premium.ApplyBoost({peer:Vt(e.id,e.accessHash),slots:t}));if(s)return{boosts:s.myBoosts.map(oa)}}async function tg({chat:e}){const t=await Xo(new pe.Api.premium.GetBoostsStatus({peer:Vt(e.id,e.accessHash)}));if(t)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:Xn(c)},...d&&{prepaidGiveaways:d.map((e=>{return(t=e)instanceof pe.Api.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}))}}}(t)}async function sg({chat:e,isGifts:t,offset:s="",limit:n}){const a=await Xo(new pe.Api.premium.GetBoostsList({peer:Vt(e.id,e.accessHash),gifts:t||void 0,offset:s,limit:n}));if(!a)return;const i=a.boosts.map(ia);return{count:a.count,boostList:i,nextOffset:a.nextOffset}}async function ng({peer:e,messageId:t}){const s=await Xo(new pe.Api.payments.GetGiveawayInfo({peer:Vt(e.id,e.accessHash),msgId:t}));if(s)return function(e){if(e instanceof pe.Api.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&&me(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()}}}(s)}async function ag({slug:e}){const t=await Xo(new pe.Api.payments.CheckGiftCode({slug:e}));if(t)return{code:ra(t)}}function ig({slug:e}){return Xo(new pe.Api.payments.ApplyGiftCode({slug:e}),{shouldReturnTrue:!0})}async function og({chat:e}){const t=await Xo(new pe.Api.payments.GetPremiumGiftCodeOptions({boostPeer:e&&Vt(e.id,e.accessHash)}));if(t)return t.map(ca)}async function rg({chat:e}){const t=await Xo(new pe.Api.payments.GetStarsGiftOptions({userId:e&&Vt(e.id,e.accessHash)}));if(t)return t.map(da)}async function cg(){const e=await Xo(new pe.Api.payments.GetStarsGiveawayOptions);if(e)return e.map(la)}async function dg(){const e=await Xo(new pe.Api.payments.GetStarGifts({}));if(e&&!(e instanceof pe.Api.payments.StarGiftsNotModified))return e.gifts.map(ma).filter((e=>"starGift"===e.type))}async function ug({user:e,offset:t="",limit:s}){const n=await Xo(new pe.Api.payments.GetUserStarGifts({userId:Vt(e.id,e.accessHash),offset:t,limit:s}));if(n)return{gifts:n.gifts.map(_a),nextOffset:n.nextOffset}}function lg({messageId:e,shouldUnsave:t}){return Xo(new pe.Api.payments.SaveStarGift({msgId:e,unsave:t||void 0}))}function fg({messageId:e}){return Xo(new pe.Api.payments.ConvertStarGift({msgId:e}))}function pg({chat:e,giveawayId:t,paymentPurpose:s}){return Xo(new pe.Api.payments.LaunchPrepaidGiveaway({peer:Vt(e.id,e.accessHash),giveawayId:Se()(t),purpose:is(s)}),{shouldReturnTrue:!0})}async function gg(){const e=await Xo(new pe.Api.payments.GetStarsStatus({peer:new pe.Api.InputPeerSelf}));if(e)return{nextHistoryOffset:e.nextOffset,history:e.history?.map(pa),nextSubscriptionOffset:e.subscriptionsNextOffset,subscriptions:e.subscriptions?.map(ga),balance:ua(e.balance)}}async function hg({peer:e,offset:t,isInbound:s,isOutbound:n}){const a=e?Vt(e.id,e.accessHash):new pe.Api.InputPeerSelf,i=await Xo(new pe.Api.payments.GetStarsTransactions({peer:a,offset:t,inbound:s,outbound:n}));if(i)return{nextOffset:i.nextOffset,history:i.history?.map(pa),balance:ua(i.balance)}}async function mg({id:e,peer:t}){const s=t?Vt(t.id,t.accessHash):new pe.Api.InputPeerSelf,n=await Xo(new pe.Api.payments.GetStarsTransactionsByID({peer:s,id:[new pe.Api.InputStarsTransaction({id:e})]}));if(n?.history?.[0])return{transaction:pa(n?.history[0])}}async function yg({offset:e,peer:t}){const s=t?Vt(t.id,t.accessHash):new pe.Api.InputPeerSelf,n=await Xo(new pe.Api.payments.GetStarsSubscriptions({peer:s,offset:e}));if(n?.subscriptions)return{nextOffset:n.subscriptionsNextOffset,subscriptions:n.subscriptions.map(ga),balance:ua(n.balance)}}async function _g({peer:e,subscriptionId:t,isCancelled:s}){return await Xo(new pe.Api.payments.ChangeStarsSubscription({peer:e?Vt(e.id,e.accessHash):new pe.Api.InputPeerSelf,subscriptionId:t,canceled:s}))}async function bg({peer:e,subscriptionId:t}){return await Xo(new pe.Api.payments.FulfillStarsSubscription({peer:e?Vt(e.id,e.accessHash):new pe.Api.InputPeerSelf,subscriptionId:t}))}async function wg(){const e=await Xo(new pe.Api.payments.GetStarsTopupOptions);if(e)return e.map(ha)}async function Sg(e){const t="username"in e?new pe.Api.InputCollectibleUsername({username:e.username}):new pe.Api.InputCollectiblePhone({phone:e.phone}),s=await Xo(new pe.Api.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)}function vg(e,t,s){var n;!function(e){Ze=e}(e),s&&(n=s,Object.assign(Be,Ee(n))),async function(e){c&&console.log(">>> START INIT API");const{userAgent:t,platform:s,sessionData:n,isWebmSupported:a,maxBufferSize:r,webAuthToken:d,dcId:u,mockScenario:l,shouldForceHttpTransport:f,shouldAllowHttpTransport:p,shouldDebugExportedSenders:g,langCode:h,isTestServerRequested:m}=e,y=new pe.sessions.CallbackSession(n,Jo);self.isWebmSupported=a,self.maxBufferSize=r,Lo=new(rt())(y,"2496","8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||t||Fo,systemVersion:s||Go,appVersion:`10.9.34 ${i}`,useWSS:!0,additionalDcsDisabled:o,shouldDebugExportedSenders:g,shouldForceHttpTransport:f,shouldAllowHttpTransport:p,dcId:u,langPack:$,langCode:h,systemLangCode:navigator.language,isTestServerRequested:m}),Lo.addEventHandler(Qo,qo);try{c&&(Ye("CONNECTING"),self.invoke=Xo,self.GramJs=pe.Api);try{Lo.setPingCallback(Xi),await Lo.start({phoneNumber:uo,phoneCode:lo,password:fo,firstAndLastNames:po,qrCode:go,onError:ho,initialMethod:"iOS"===s||"Android"===s?"phoneNumber":"qrCode",shouldThrowIfUnauthorized:Boolean(n),webAuthToken:d,webAuthTokenFailed:co,mockScenario:l})}catch(e){if(console.error(e),"Disconnect"!==e.message&&"Cannot send requests while disconnected"!==e.message)return void et({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}c&&(console.log(">>> FINISH INIT API"),Ye("CONNECTED")),et(mo("authorizationStateReady")),Jo(y.getSessionData()),et({"@type":"updateApiReady"}),async function(e){Vi=e,await so(),Fi=!0,Ji()}(Xo),ar()}catch(e){throw c&&Ye("CONNECTING ERROR",e),e}}(t)}const Ig=re.reduce(((e,t)=>(e[t]=console[t],e)),{});self.onerror=e=>{console.error(e),kg({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),kg({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));let Ag=[],Pg=[],Cg=[];const Mg=new Map;c&&console.log(">>> FINISH LOAD WORKER"),onmessage=({data:e})=>{e.payloads.forEach((async e=>{switch(e.type){case"initApi":{const{messageId:t,args:s}=e;await vg(Tg,s[0],s[1]),t&&kg({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=(...e)=>{const s=e[e.length-1];kg({type:"methodCallback",messageId:t,callbackArgs:e},s instanceof ArrayBuffer?s:void 0)};Mg.set(t,e),n.push(e)}const e=await function(e,...t){return a[e](...t)}(s,...n);c&&"object"==typeof e&&"CONSTRUCTOR_ID"in e&&Ye("UNEXPECTED RESPONSE",`${s}: ${e.className}`);const{arrayBuffer:o}="object"==typeof e&&"arrayBuffer"in e&&e||{};t&&kg({type:"methodResponse",messageId:t,response:e},o)}catch(e){c&&console.error(e),t&&kg({type:"methodResponse",messageId:t,error:{message:e.message}})}t&&Mg.delete(t);break}case"cancelProgress":{const t=Mg.get(e.messageId);t&&(t.isCanceled=!0);break}case"ping":kg({type:"methodResponse",messageId:e.messageId});break;case"toggleDebugMode":e.isEnabled?re.forEach((e=>{console[e]=(...t)=>{postMessage({type:"debugLog",level:e,args:JSON.parse(JSON.stringify(t,((e,t)=>"bigint"==typeof t?t.toString():t)))})}})):re.forEach((e=>{console[e]=Ig[e]}))}}))};const Rg=de((()=>{Cg.length&&Ag.unshift({type:"updates",updates:Cg});const e={payloads:Ag},t=Pg;Cg=[],Ag=[],Pg=[],t.length?postMessage(e,t):postMessage(e)}));function kg(e,t){Ag.push(e),t&&Pg.push(t),Rg()}function Tg(e){c&&"updateUserStatus"!==e["@type"]&&"updateServerTimeOffset"!==e["@type"]&&Ye("UPDATE",e["@type"],e),Cg.push(e),Rg()}},80071:(e,t,s)=>{var n=s(48287).hp;const a=s(92096),i=s(97157);function o(e,t=!0,s=!1){let i=n.from(e);const o=i.length;t&&(i=i.reverse());let r=a(i.toString("hex"),16);return s&&Math.floor(r.toString(2).length/8)>=o&&(r=r.subtract(a(2).pow(a(8*o)))),r}function r(e,t=8){const s=a(e),i=[];for(let e=0;e<t;e++)i[e]=s.shiftRight(8*e).and(255);return n.from(i)}function c(e,t,s=!0,i=!1){const o=(e=a(e)).bitLength().toJSNumber();if(t<Math.ceil(o/8))throw new Error("OverflowError: int too big to convert");if(!i&&e.lesser(a(0)))throw new Error("Cannot convert to unsigned");let r=!1;e.lesser(a(0))&&(r=!0,e=e.abs());const c=e.toString(16).padStart(2*t,"0");let d=n.from(c,"hex");if(i&&r){d[d.length-1]=256-d[d.length-1];for(let e=0;e<d.length-1;e++)d[e]=255-d[e]}return s&&(d=d.reverse()),d}function d(e){return n.from(i.randomBytes(e))}function u(e){const t=i.createHash("sha1");return t.update(e),t.digest()}let l;e.exports={readBigIntFromBuffer:o,readBufferFromBigInt:c,generateRandomLong:function(e=!0){return o(d(8),!0,e)},mod:function(e,t){return(e%t+t)%t},crc32:function(e){l||(l=function(){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}()),n.isBuffer(e)||(e=n.from(e));let t=-1;for(let s=0;s<e.length;s++){const n=e[s];t=l[255&(t^n)]^t>>>8}return~t>>>0},generateRandomBytes:d,generateKeyDataFromNonce:async function(e,t){e=r(e,16),t=r(t,32);const[s,a,i]=await Promise.all([u(n.concat([t,e])),u(n.concat([e,t])),u(n.concat([t,t]))]);return{key:n.concat([s,a.slice(0,12)]),iv:n.concat([a.slice(12,20),i,t.slice(0,4)])}},sha1:u,sha256:function(e){const t=i.createHash("sha256");return t.update(e),t.digest()},bigIntMod:function(e,t){return e.remainder(t).add(t).remainder(t)},modExp:function(e,t,s){e=e.remainder(s);let n=a.one,i=e;for(;t.greater(a.zero);){const e=t.remainder(a(2));t=t.divide(a(2)),e.eq(a.one)&&(n=n.multiply(i),n=n.remainder(s)),i=i.multiply(i),i=i.remainder(s)}return n},getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},sleep:e=>new Promise((t=>{setTimeout(t,e)})),getByteArray:function(e,t=!1){const s=e.toString(2).length,n=Math.floor((s+8-1)/8);return c(a(e),n,!1,t)},toSignedLittleBuffer:r,convertToLittle:function(e){const t=n.alloc(4*e.length);for(let s=0;s<e.length;s++)t.writeUInt32BE(e[s],4*s);return t},bufferXor:function(e,t){const s=[];for(let n=0;n<e.length;n++)s.push(e[n]^t[n]);return n.from(s)}}},61257:(e,t,s)=>{var n=s(48287).hp;const a=s(92096),{constructors:i}=s(43355),{readBigIntFromBuffer:o,readBufferFromBigInt:r,sha256:c,bigIntMod:d,modExp:u,generateRandomBytes:l}=s(80071),f=s(97157);function p(e,t){if(!n.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 g(e){return n.concat([n.alloc(256-e.length),e])}function h(e){return r(e,256,!1)}function m(e,t){const s=t.subtract(e);return!(s.lesser(a(0))||s.bitLength()<1984||e.bitLength()<1984||Math.floor((e.bitLength()+7)/8)>256)}function y(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 _(e,t){const s=await c(n.concat([e.salt1,n.from(t,"utf-8"),e.salt1])),a=await c(n.concat([e.salt2,s,e.salt2])),i=await function(e,t,s){return f.pbkdf2(e,t,1e5,64,"sha512")}(a,e.salt1);return c(n.concat([e.salt2,i,e.salt2]))}e.exports={computeCheck:async function(e,t){const s=e.currentAlgo;if(!(s instanceof i.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow))throw new Error(`Unsupported password algorithm ${s.className}`);const r=await _(s,t),f=o(s.p,!1),{g:b}=s,w=o(e.srp_B,!1);try{p(s.p,b)}catch(e){throw new Error("bad /g in password")}if(!function(e,t){return e.greater(a(0))&&t.subtract(e).greater(a(0))}(w,f))throw new Error("bad b in check");const S=o(r,!1),v=g(s.p),I=h(b),A=g(e.srp_B),P=u(a(b),S,f),C=o(await c(n.concat([v,I])),!1),M=d(C.multiply(P),f),[R,k,T]=await(async()=>{for(;;){const e=l(256),t=o(e,!1),s=u(a(b),t,f);if(m(s,f)){const e=h(s),i=o(await c(n.concat([e,A])),!1);if(i.greater(a(0)))return[t,e,i]}}})(),E=d(w.subtract(M),f);if(!m(E,f))throw new Error("bad gB");const B=T.multiply(S),D=R.add(B),U=u(E,D,f),[x,V,N,F,G]=await Promise.all([c(h(U)),c(v),c(I),c(s.salt1),c(s.salt2)]),q=await c(n.concat([y(V,N),F,G,k,A,x]));return new i.InputCheckPasswordSRP({srpId:e.srpId,A:n.from(k),M1:q})},computeDigest:async function(e,t){try{p(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return h(u(a(e.g),o(await _(e,t),!1),o(e.p,!1)))}}},56215:(e,t,s)=>{var n=s(48287).hp;const{constructors:a}=s(43355),i=n.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),o=n.from("ffd9","hex");function r(e,t){throw new Error(`Cannot cast ${e.className} to any kind of ${t}`)}e.exports={getMessageId:function(e){if(void 0!==e){if("number"==typeof e)return e;if(2030045667===e.SUBCLASS_OF_ID)return e.id;throw new Error(`Invalid message type: ${e.constructor.name}`)}},getInputPeer:function e(t,s=!0,n=!0){if(void 0===t.SUBCLASS_OF_ID){if(s&&"inputEntity"in t)return t.inputEntity;if("entity"in t)return e(t.entity);r(t,"InputPeer")}if(3374092470===t.SUBCLASS_OF_ID)return t;if(t instanceof a.User){if(t.isSelf&&s)return new a.InputPeerSelf;if(void 0===t.accessHash&&n)throw new Error("User without accessHash or min info cannot be input");return new a.InputPeerUser({userId:t.id,accessHash:t.accessHash})}if(t instanceof a.Chat||t instanceof a.ChatEmpty||t instanceof a.ChatForbidden)return new a.InputPeerChat({chatId:t.id});if(t instanceof a.Channel){if(void 0===t.accessHash&&n)throw new TypeError("Channel without accessHash or min info cannot be input");return new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash})}return t instanceof a.ChannelForbidden?new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash}):t instanceof a.InputUser?new a.InputPeerUser({userId:t.userId,accessHash:t.accessHash}):t instanceof a.InputChannel?new a.InputPeerChannel({channelId:t.channelId,accessHash:t.accessHash}):t instanceof a.UserEmpty?new a.InputPeerEmpty:t instanceof a.UserFull?e(t.user):t instanceof a.ChatFull?new a.InputPeerChat({chatId:t.id}):t instanceof a.PeerChat?new a.InputPeerChat(t.chatId):void r(t,"InputPeer")},getDisplayName:function(e){return e instanceof a.User?e.lastName&&e.firstName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:"":e instanceof a.Chat||e instanceof a.Channel?e.title:""},getDownloadPartSize: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")},getUploadPartSize: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")},strippedPhotoToJpg:function(e){if(e.length<3||1!==e[0])return e;const t=n.from(i);return t[164]=e[1],t[166]=e[2],n.concat([t,e.slice(3),o])},getDC:function(e,t=!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}`)}}}},58946:e=>{e.exports="0.0.2"},31837:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getCurrentPassword:()=>f,getTmpPassword:()=>l,updateTwoFaSettings:()=>u});var n=s(9396),a=s.n(n),i=s(96847),o=s.n(i),r=s(80071),c=s(61257),d=s(48287).hp;async function u(e,{isCheckPassword:t,currentPassword:s,newPassword:n,hint:i="",email:u,emailCodeCallback:l,onEmailCodeError:f}){if(!n&&!s)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(u&&(!l||!f))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const p=await e.invoke(new(o().account.GetPassword));p.newAlgo instanceof o().PasswordKdfAlgoUnknown||(p.newAlgo.salt1=d.concat([p.newAlgo.salt1,(0,r.generateRandomBytes)(32)])),!p.hasPassword&&s&&(s=void 0);const g=s?await(0,c.computeCheck)(p,s):new(o().InputCheckPasswordEmpty);if(t)await e.invoke(new(o().auth.CheckPassword)({password:g}));else try{await e.invoke(new(o().account.UpdatePasswordSettings)({password:g,newSettings:new(o().account.PasswordInputSettings)({newAlgo:p.newAlgo,newPasswordHash:n?await(0,c.computeDigest)(p.newAlgo,n):d.alloc(0),hint:i,email:u,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof a().EmailUnconfirmedError))throw t;for(;;)try{const s=await l(t.codeLength);if(!s)throw new Error("Code is empty");await e.invoke(new(o().account.ConfirmPasswordEmail)({code:s}));break}catch(e){f(e)}}}async function l(e,t,s=60){const n=await e.invoke(new(o().account.GetPassword));if(!n)return;const a=await(0,c.computeCheck)(n,t);try{return await e.invoke(new(o().account.GetTmpPassword)({password:a,period:s}))}catch(e){if("PASSWORD_HASH_INVALID"===e.message)return{error:e.message};throw e}}async function f(e,{currentPassword:t,onPasswordCodeError:s}){const n=await e.invoke(new(o().account.GetPassword));if(n)try{return t?await(0,c.computeCheck)(n,t):new(o().InputCheckPasswordEmpty)}catch(e){if(e instanceof a().PasswordModifiedError)return s(e);if("PASSWORD_HASH_INVALID"===e.message)return{error:e.message};throw e}}},26462:(e,t,s)=>{var n=s(48287).hp;const a=s(51072),i=s(51369),{sleep:o}=s(80071),r=s(9396),c=s(90155),d=s(80071),u=s(56215),l=s(79258),{LAYER:f}=s(50114),{constructors:p,requests:g}=s(43355),{ConnectionTCPObfuscated:h,MTProtoSender:m,UpdateConnectionState:y,HttpConnection:_}=s(51227),{authFlow:b,checkAuthorization:w}=s(53386),{downloadFile:S}=s(32538),{uploadFile:v}=s(38751),{updateTwoFaSettings:I,getTmpPassword:A,getCurrentPassword:P}=s(31837),C=s(83701),M=s(9705).A,R=131072,k=["u","v","w","y","d","x","c","m","b","a","s","f"];class T{constructor(e,t,s,n=T.DEFAULT_OPTIONS){if(!t||!s)throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const o={...T.DEFAULT_OPTIONS,...n};if(this.apiId=t,this.apiHash=s,this.defaultDcId=o.dcId||2,this._useIPV6=o.useIPV6,this._shouldForceHttpTransport=o.shouldForceHttpTransport,this._shouldAllowHttpTransport=o.shouldAllowHttpTransport,this._shouldDebugExportedSenders=o.shouldDebugExportedSenders,"string"==typeof o.baseLogger?this._log=new i:this._log=o.baseLogger,"string"!=typeof e&&e){if(!(e instanceof l))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new c}this.floodSleepLimit=o.floodSleepLimit,this._eventBuilders=[],this._phoneCodeHash={},this.session=e,this.apiId=parseInt(t,10),this.apiHash=s,this._requestRetries=o.requestRetries,this._connectionRetries=o.connectionRetries,this._connectionRetriesToFallback=o.connectionRetriesToFallback,this._retryDelay=o.retryDelay||0,this._retryMainConnectionDelay=o.retryMainConnectionDelay||0,o.proxy&&this._log.warn("proxies are not supported"),this._proxy=o.proxy,this._timeout=o.timeout,this._autoReconnect=o.autoReconnect,this._connection=o.connection,this._fallbackConnection=o.fallbackConnection,this._floodWaitedRequests={},this._initWith=e=>new g.InvokeWithLayer({layer:f,query:new g.InitConnection({apiId:this.apiId,deviceModel:o.deviceModel||a.type().toString()||"Unknown",systemVersion:o.systemVersion||a.release().toString()||"1.0",appVersion:o.appVersion||"1.0",langCode:o.langCode,langPack:o.langPack,systemLangCode:o.systemLangCode,query:e,proxy:void 0})}),this._args=o,this._config=void 0,this.phoneCodeHashes=[],this._exportedSenderPromises={},this._exportedSenderRefCounter={},this._waitingForAuthKey={},this._exportedSenderReleaseTimeouts={},this._additionalDcsDisabled=o.additionalDcsDisabled,this._loopStarted=!1,this._isSwitchingDc=!1,this._destroyed=!1,this._connectedDeferred=new M}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new m(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})),this._sender.userDisconnected=!1,this._sender._user_connected=!1,this._sender.isReconnecting=!1,this._sender._disconnected=!0;const e=new this._connection(this.session.serverAddress,this.session.port,this.session.dcId,this._log,this.session.isTestServer),t=new this._fallbackConnection(this.session.serverAddress,this.session.port,this.session.dcId,this._log,this.session.isTestServer);if(!await this._sender.connect(e,void 0,t))return void(this._loopStarted||(this._updateLoop(),this._loopStarted=!0));this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new g.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=u.getDC(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;for(;!this._destroyed;)if(await d.sleep(3e3),this._sender.isReconnecting||this._isSwitchingDc)e=void 0;else{try{const t=()=>{if(!this._destroyed)return this._sender.send(new g.PingDelayDisconnect({pingId:d.getRandomInt(Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),disconnectDelay:6e4}))},s=Date.now(),n=e?s-e:void 0;if(!n||n<5e3)await V((()=>x(t,5e3)),3,100);else{let e=setTimeout((()=>{this._handleUpdate(new y(y.disconnected)),e=void 0}),1e3);await x(t,3e3),e&&(clearTimeout(e),e=void 0),this._handleUpdate(new y(y.connected))}e=Date.now()}catch(t){if(console.warn(t),e=void 0,this._sender.isReconnecting||this._isSwitchingDc)continue;if(this._destroyed)break;this._sender.reconnect()}if(Date.now()-this._lastRequest>18e5){try{await this.pingCallback()}catch(e){}e=void 0}}await this.disconnect()}async disconnect(){this._sender&&await this._sender.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map((e=>Object.values(e).map((e=>e&&e.then((e=>{if(e)return 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){this._log.info(`Reconnecting to new data center ${e}`);const t=u.getDC(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],await 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;await t.disconnect()}))))}async _connectSender(e,t,s,n=!1){let a,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=>{a=e}));const o=u.getDC(t,i);for(;;)try{return await e.connect(new this._connection(o.ipAddress,o.port,t,this._log,this.session.isTestServer,!!i&&n),void 0,new this._fallbackConnection(o.ipAddress,o.port,t,this._log,this.session.isTestServer,!!i&&n)),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 g.auth.ExportAuthorization({dcId:t})),n=this._initWith(new g.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(n),e._authenticated=!0})),e.dcId=t,e.userDisconnected=!1,a&&(a(),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 d.sleep(1e3),await 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){if(this._additionalDcsDisabled)return;const i=n||0;let o;this._exportedSenderPromises[e]||(this._exportedSenderPromises[e]={}),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 d.sleep(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),o}_createExportedSender(e,t){return new m(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 S(this,e,t,this._shouldDebugExportedSenders)}downloadMedia(e,t){let s;if(s=e instanceof p.Message||e instanceof p.StoryItem?e.media:e instanceof p.MessageService?e.action.photo:e,"string"==typeof s)throw new Error("not implemented");return s instanceof p.MessageMediaWebPage&&s.webpage instanceof p.WebPage&&(s=s.webpage.document||s.webpage.photo),s instanceof p.MessageMediaPhoto||s instanceof p.Photo?this._downloadPhoto(s,t):s instanceof p.MessageMediaDocument||s instanceof p.Document?this._downloadDocument(s,t):s instanceof p.MessageMediaContact?this._downloadContact(s,t):s instanceof p.WebDocument||s instanceof p.WebDocumentNoProxy?this._downloadWebDocument(s,t):void 0}downloadProfilePhoto(e,t=!1){const s=e.photo;if(!(s instanceof p.UserProfilePhoto||s instanceof p.ChatPhoto))return;const n=s.dcId,a=new p.InputPeerPhotoFileLocation({peer:u.getInputPeer(e),photoId:s.photoId,big:t});return this.downloadFile(a,{dcId:n,isPriority:!0})}downloadStickerSetThumb(e){if(!e.thumbs?.length&&!e.thumbDocumentId)return;const{thumbVersion:t}=e;return e.thumbDocumentId?this.invoke(new p.messages.GetCustomEmojiDocuments({documentId:[e.thumbDocumentId]})).then((e=>{const t=e[0];return this.downloadFile(new p.InputDocumentFileLocation({id:t.id,accessHash:t.accessHash,fileReference:t.fileReference,thumbSize:""}),{fileSize:t.size.toJSNumber(),dcId:t.dcId})})):this.downloadFile(new p.InputStickerSetThumb({stickerset:new p.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}_pickFileSize(e,t){if(!t||!e||!e.length)return;let s;for(let n=k.indexOf(t);n<k.length;n++)if(s=e.find((e=>e.type===k[n])),s)return s}_downloadCachedPhotoSize(e){let t;return t=e instanceof p.PhotoStrippedSize?u.strippedPhotoToJpg(e.bytes):e.bytes,t}_downloadPhoto(e,t){if(e instanceof p.MessageMediaPhoto&&(e=e.photo),!(e instanceof p.Photo))return;const s=e.sizes.reduce(((e,t)=>t.w?e.w>t.w?e:t:e)),n="u"===t.sizeType||"v"===t.sizeType,a=t.sizeType?this._pickFileSize(n?[...e.videoSizes,...e.sizes]:e.sizes,t.sizeType):s;return!a||a instanceof p.PhotoSizeEmpty?void 0:a instanceof p.PhotoCachedSize||a instanceof p.PhotoStrippedSize?this._downloadCachedPhotoSize(a):this.downloadFile(new p.InputPhotoFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:a.type}),{dcId:e.dcId,fileSize:a.size||Math.max(...a.sizes||[]),progressCallback:t.progressCallback})}_downloadDocument(e,t){if(e instanceof p.MessageMediaDocument&&(e=e.document),!(e instanceof p.Document))return;let s;if(t.sizeType){if(s=e.thumbs?this._pickFileSize([...e.videoThumbs||[],...e.thumbs],t.sizeType):void 0,!s&&e.mimeType.startsWith("video/"))return;if(s&&(s instanceof p.PhotoCachedSize||s instanceof p.PhotoStrippedSize))return this._downloadCachedPhotoSize(s)}return this.downloadFile(new p.InputDocumentFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:s?s.type:""}),{fileSize:s?s.size:e.size.toJSNumber(),progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:e.dcId,workers:t.workers})}_downloadContact(e,t){throw new Error("not implemented")}async _downloadWebDocument(e){if(e.url&&!("accessHash"in e)){const t=await fetch(e.url).then((e=>e.arrayBuffer()));return n.from(t)}try{const t=[];let s=0;for(;;){const n=new g.upload.GetWebFile({location:new p.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:s,limit:R}),a=await this._borrowExportedSender(this._config?.webfileDcId||4),i=await a.send(n);if(this.releaseExportedSender(a),s+=131072,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length<R)break}return n.concat(t)}catch(e){if("WEBFILE_NOT_AVAILABLE"===e.message)return n.alloc(0);throw e}}async downloadStaticMap(e,t,s,a,i,c,d,u){try{const l=[];let f=0;for(;;)try{const n=new g.upload.GetWebFile({location:new p.InputWebFileGeoPointLocation({geoPoint:new p.InputGeoPoint({lat:s,long:t,accuracyRadius:u}),accessHash:e,w:a,h:i,zoom:c,scale:d}),offset:f,limit:R}),o=await this._borrowExportedSender(4),r=await o.send(n);if(this.releaseExportedSender(o),f+=131072,!r.bytes.length)break;if(l.push(r.bytes),r.bytes.length<R)break}catch(e){if(e instanceof r.FloodWaitError){console.warn(`getWebFile: sleeping for ${e.seconds}s on flood wait`),await o(1e3*e.seconds);continue}}return n.concat(l)}catch(e){if("WEBFILE_NOT_AVAILABLE"===e.message)return n.alloc(0);throw e}}async invoke(e,t,s,n=!1){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 c=new C(e,s);let d=0;for(d=0;d<this._requestRetries;d++){i.addStateToQueue(c);try{const e=await c.promise;return c.finished.resolve(),a&&this.releaseExportedSender(i),e}catch(e){if(e instanceof r.ServerError||"RPC_CALL_FAIL"===e.message||"RPC_MCGET_FAIL"===e.message||e.message.match(/INTERDC_\d_CALL(_RICH)?_ERROR/))this._log.warn(`Telegram is having internal issues ${e.constructor.name}`),await o(2e3);else if(e instanceof r.FloodWaitError||e instanceof r.FloodTestPhoneWaitError){if(!(e.seconds<=this.floodSleepLimit))throw c.finished.resolve(),a&&this.releaseExportedSender(i),e;this._log.info(`Sleeping for ${e.seconds}s on flood wait`),await o(1e3*e.seconds)}else if(e instanceof r.PhoneMigrateError||e instanceof r.NetworkMigrateError||e instanceof r.UserMigrateError){if(this._log.info(`Phone migrated to ${e.newDc}`),(e instanceof r.PhoneMigrateError||e instanceof r.NetworkMigrateError)&&await w(this))throw c.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 r.MsgWaitError)await c.isReady(),c.after=void 0;else if("CONNECTION_NOT_INITED"===e.message)await this.disconnect(),await o(2e3),await this.connect();else{if(!(e instanceof r.TimedOutError))throw c.finished.resolve(),a&&this.releaseExportedSender(i),e;if(!n)throw c.finished.resolve(),a&&this.releaseExportedSender(i),e}}c.resetPromise()}throw a&&this.releaseExportedSender(i),new Error(`Request was unsuccessful ${d} 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 g.users.GetUsers({id:[new p.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 g.help.GetConfig))}async start(e){if(this.isConnected()||await this.connect(),this.loadConfig(),await w(this,e.shouldThrowIfUnauthorized))return;const t={apiId:this.apiId,apiHash:this.apiHash};await b(this,t,e)}uploadFile(e){return v(this,e,this._shouldDebugExportedSenders)}updateTwoFaSettings(e){return I(this,e)}getTmpPassword(e,t){return A(this,e,t)}getCurrentPassword(e){return P(this,e)}addEventHandler(e,t){this._eventBuilders.push([t,e])}_handleUpdate(e){if(e instanceof p.Updates||e instanceof p.UpdatesCombined){const t=[];for(const s of[...e.users,...e.chats])t.push(s);this._processUpdate(e,t)}else e instanceof p.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={update:void 0}){for(const[t,s]of this._eventBuilders){const n=t.build(e.update);n&&await s(n)}}isConnected(){return!(!this._sender||!this._sender.isConnected())}}var E,B,D,U;function x(e,t){let s=!1;return Promise.race([e(),d.sleep(t).then((()=>s?void 0:Promise.reject(new Error("TIMEOUT"))))]).finally((()=>{s=!0}))}async function V(e,t,s){for(let n=0;n<t;n++)try{return await e()}catch(e){if(n===t-1)throw e;await d.sleep(s)}}E=T,D={connection:h,fallbackConnection:_,useIPV6:!1,proxy:void 0,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},(B="symbol"==typeof(U=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(B="DEFAULT_OPTIONS"))?U:U+"")in E?Object.defineProperty(E,B,{value:D,enumerable:!0,configurable:!0,writable:!0}):E[B]=D,e.exports=T},53386:(e,t,s)=>{"use strict";s.r(t),s.d(t,{authFlow:()=>l,checkAuthorization:()=>p,signInUserWithPreferredMethod:()=>f});var n=s(96847),a=s.n(n),i=s(80071),o=s(61257),r=s(56215),c=s.n(r);const d="phoneNumber",u=3e4;async function l(e,t,s){let n;n="botAuthToken"in s?await async function(e,t,s){const{apiId:n,apiHash:i}=t,{botAuthToken:o}=s,{user:r}=await e.invoke(new(a().auth.ImportBotAuthorization)({apiId:n,apiHash:i,botAuthToken:o}));return r}(e,t,s):"webAuthToken"in s&&s.webAuthToken?await async function(e,t,s){try{const{apiId:n,apiHash:i}=t,o=await e.invoke(new(a().auth.ImportWebTokenAuthorization)({webAuthToken:s.webAuthToken,apiId:n,apiHash:i}));if(o instanceof a().auth.Authorization)return o.user;throw new Error("SIGN_UP_REQUIRED")}catch(n){return"SESSION_PASSWORD_NEEDED"===n.message?y(e,0,s,!0):(e._log.error(`Failed to login with web token: ${n}`),s.webAuthTokenFailed(),f(e,t,{...s,webAuthToken:void 0}))}}(e,t,s):await f(e,t,s),e._log.info("Signed in successfully as",c().getDisplayName(n))}function f(e,t,s){const{initialMethod:n=d}=s;return"phoneNumber"===n?g(e,t,s):h(e,t,s)}async function p(e,t=!1){try{return await e.invoke(new(a().updates.GetState)),!0}catch(e){if("Disconnect"===e.message||t)throw e;return!1}}async function g(e,t,s){let n,i,o,r=!1;for(;;)try{if("function"==typeof s.phoneNumber)try{n=await s.phoneNumber()}catch(n){if("RESTART_AUTH_WITH_QR"===n.message)return h(e,t,s);throw n}else n=s.phoneNumber;const a=await m(e,t,n,s.forceSMS);if(i=a.phoneCodeHash,r=a.isCodeViaApp,"string"!=typeof i)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof s.phoneNumber)throw e;s.onError(e)}let c,d=!1;for(;;)try{try{o=await s.phoneCode(r)}catch(n){if("RESTART_AUTH"===n.message)return g(e,t,s)}if(!o)throw new Error("Code is empty");const u=await e.invoke(new(a().auth.SignIn)({phoneNumber:n,phoneCodeHash:i,phoneCode:o}));if(u instanceof a().auth.AuthorizationSignUpRequired){d=!0,c=u.termsOfService;break}return u.user}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return y(e,0,s);s.onError(t)}if(d)for(;;)try{const[t,o]=await s.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:r}=await e.invoke(new(a().auth.SignUp)({phoneNumber:n,phoneCodeHash:i,firstName:t,lastName:o}));return c&&await e.invoke(new(a().help.AcceptTermsOfService)({id:c.id})),r}catch(e){s.onError(e)}return s.onError(new Error("Auth failed")),g(e,t,s)}async function h(e,t,s){let n=!1;const o=(async()=>{for(;!n;){const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(!(t instanceof a().auth.LoginToken))throw new Error("Unexpected");const{token:n,expires:o}=t;await Promise.race([s.qrCode({token:n,expires:o}),(0,i.sleep)(u)])}})(),r=new Promise((t=>{e.addEventHandler((e=>{e instanceof a().UpdateLoginToken&&t()}),{build:e=>e})}));try{await Promise.race([r,o])}catch(n){if("RESTART_AUTH"===n.message)return await g(e,t,s);throw n}finally{n=!0}try{const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(t instanceof a().auth.LoginTokenSuccess&&t.authorization instanceof a().auth.Authorization)return t.authorization.user;if(t instanceof a().auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const s=await e.invoke(new(a().auth.ImportLoginToken)({token:t.token}));if(s instanceof a().auth.LoginTokenSuccess&&s.authorization instanceof a().auth.Authorization)return s.authorization.user}}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return y(e,0,s);throw t}throw void 0}async function m(e,t,s,n=!1){try{const{apiId:i,apiHash:o}=t,r=await e.invoke(new(a().auth.SendCode)({phoneNumber:s,apiId:i,apiHash:o,settings:new(a().CodeSettings)}));if(!(r instanceof a().auth.SentCode))throw Error("Unexpected SentCodeSuccess");if(!n||r.type instanceof a().auth.SentCodeTypeSms)return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof a().auth.SentCodeTypeApp};const c=await e.invoke(new(a().auth.ResendCode)({phoneNumber:s,phoneCodeHash:r.phoneCodeHash}));if(!(c instanceof a().auth.SentCode))throw Error("Unexpected SentCodeSuccess");return{phoneCodeHash:c.phoneCodeHash,isCodeViaApp:c.type instanceof a().auth.SentCodeTypeApp}}catch(a){if("AUTH_RESTART"===a.message)return m(e,t,s,n);throw a}}async function y(e,t,s,n=!1){for(;;)try{const t=await e.invoke(new(a().account.GetPassword)),i=await s.password(t.hint,n);if(!i)throw new Error("Password is empty");const r=await(0,o.computeCheck)(t,i),{user:c}=await e.invoke(new(a().auth.CheckPassword)({password:r}));return c}catch(e){s.onError(e)}}},32538:(e,t,s)=>{"use strict";s.r(t),s.d(t,{downloadFile:()=>A});var n=s(92096),a=s.n(n),i=s(9705),o=s(84846),r=s(9396),c=s.n(r),d=s(96847),u=s.n(d),l=s(86453),f=s(80071),p=s(56215),g=s(48287).hp;function h(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const m=4096,y=64,_=1048576,b=1e3,w=5,S=6e4,v=5;class I{constructor(e){h(this,"type",void 0),h(this,"size",void 0),h(this,"buffer",void 0),h(this,"largeFile",void 0),h(this,"largeFileAccessHandle",void 0),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?g.alloc(this.size):g.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=g.concat([this.buffer,e])}getData(){return"opfs"===this.type?this.largeFile.getFile():Promise.resolve(this.buffer)}}async function A(e,t,s,n){const{dcId:a}=s;for(let i=0;i<v;i++)try{return await k(e,t,s,n)}catch(t){if(!((t.message.startsWith("SESSION_REVOKED")||t.message.startsWith("CONNECTION_NOT_INITED"))&&i<v-1))throw t;await e._cleanupExportedSenders(a)}}const P=3,C=6,M=10485760,R=Array(C).fill(void 0).map((()=>new o.j(10)));async function k(e,t,s,n){let{partSizeKb:o,end:r}=s;const{fileSize:d,dcId:g,progressCallback:h,isPriority:w,start:v=0}=s,A="id"in t?t.id:void 0,P=(...e)=>{n&&console.log(`⬇️ [${A}/${s.dcId}]`,...e)};P("Downloading file...");const C=Boolean(e.isPremium);r=r&&r<d?r:d-1,o||(o=d?(0,p.getDownloadPartSize)(v?r-v+1:d):y);const k=1024*o,E=r?Math.ceil((r+1-v+1)/k):1,B=!r,D=Boolean(d)&&d>=M&&!B;let U;if(k%m!=0)throw new Error(`The part size must be evenly divisible by ${m}`);e._log.info(`Downloading file in chunks of ${k} bytes`);const x=new I(r-v+1),V=[];let N=v,F=!1,G=0;h&&h(G);let q=!1;for(await x.init();;){let s=k,o=!1;Math.floor(N/_)!==Math.floor((N+s-1)/_)&&(s=_-N%_,o=!0),N%m==0&&s%m==0||(o=!0);const d=T(C,D);if(await R[d].requestWorker(w),U&&await U.promise,B&&(U=new i.A),F){R[d].releaseWorker();break}const p=(...e)=>{P(`[${d}/${g}]`,...e)};if(V.push((async i=>{for(;;){let m;try{let c=!1;n&&setTimeout((()=>{c||p(`❗️️ getSender took too long ${i}`)}),8e3),m=await e.getSender(g,d,C),c=!0;let l=!1;n&&setTimeout((()=>{l||p(`❗️️ sender.send took too long ${i}`)}),6e3);const y=await Promise.race([m.send(new(u().upload.GetFile)({location:t,offset:a()(i),limit:s,precise:o||void 0})),(0,f.sleep)(S).then((()=>g===e.session.dcId?(p(`Download timed out ${i}`),Promise.reject(new Error("USER_CANCELED"))):(p(`Download timed out [not main] ${i}`),Promise.reject(new Error("SESSION_REVOKED")))))]);if(e.releaseExportedSender(m),l=!0,h){if(h.isCanceled)throw new Error("USER_CANCELED");G+=1/E,p(`⬇️️ ${100*G}%`),h(G)}return!r&&y.bytes.length<s&&(F=!0),R[d].releaseWorker(),U&&U.resolve(),void x.write(y.bytes,i-v)}catch(t){if(m&&!m.isConnected()){await(0,f.sleep)(b);continue}if(t instanceof c().FloodWaitError){t instanceof c().FloodPremiumWaitError&&!q&&(m?._updateCallback(new l.A(!1)),q=!0),await(0,f.sleep)(1e3*t.seconds);continue}throw p(`Ended not gracefully ${i}`),R[d].releaseWorker(),U&&U.resolve(),F=!0,e.releaseExportedSender(m),t}}})(N)),N+=s,r&&N>r)break}return await Promise.all(V),x.getData()}function T(e,t){const s=e?C:P;let n=0,a=1/0;for(let e=0;e<s;e++){const s=R[e];if(!s.queueLength)return e;if(!t&&s.queueLength<=w)return e;s.queueLength<=a&&(n=e,a=s.activeWorkers)}return n}},38751:(e,t,s)=>{"use strict";s.r(t),s.d(t,{uploadFile:()=>_});var n=s(84846),a=s(9396),i=s.n(a),o=s(96847),r=s.n(o),c=s(86453),d=s(80071),u=s(56215),l=s(48287).hp;const f=1024,p=10485760,g=1e3,h=3,m=6,y=Array(m).fill(void 0).map((()=>new n.j(10)));async function _(e,t,s){const{file:n,onProgress:a}=t,o=Boolean(e.isPremium),{name:_,size:b}=n,w=(0,d.readBigIntFromBuffer)((0,d.generateRandomBytes)(8),!0,!0),S=b>p,v=(...e)=>{s&&console.log(`⬆️ [${w}]`,...e)};v("Uploading file...");const I=(0,u.getUploadPartSize)(b)*f,A=Math.floor((b+I-1)/I),P=y.map((({activeWorkers:e})=>e));let C=P.indexOf(Math.min(...P)),M=0;a&&a(M);let R=!1;const k=[];for(let t=0;t<A;t++){const u=C%(o?m:h);if(await y[u].requestWorker(),a?.isCanceled){y[u].releaseWorker();break}const f=(...e)=>{v(`[${u}]`,...e)},p=n.slice(t*I,(t+1)*I);k.push((async(t,n)=>{for(;;){let p;try{let a=!1;s&&setTimeout((()=>{a||f(`❗️️ getSender took too long j=${t}`)}),8e3),p=await e.getSender(e.session.dcId,u,o),a=!0;let i=!1;const c=await n.arrayBuffer();s&&setTimeout((()=>{i||f(`❗️️ sender.send took too long j=${t}`)}),6e3),await p.send(S?new(r().upload.SaveBigFilePart)({fileId:w,filePart:t,fileTotalParts:A,bytes:l.from(c)}):new(r().upload.SaveFilePart)({fileId:w,filePart:t,bytes:l.from(c)})),e.releaseExportedSender(p),i=!0}catch(s){if(f(`❗️️️Upload part failed ${s?.toString()} j=${t}`),p&&!p.isConnected()){await(0,d.sleep)(g);continue}if(s instanceof i().FloodWaitError){s instanceof i().FloodPremiumWaitError&&!R&&(p?._updateCallback(new c.A(!0)),R=!0),await(0,d.sleep)(1e3*s.seconds);continue}throw y[u].releaseWorker(),e.releaseExportedSender(p),s}if(y[u].releaseWorker(),a){if(a.isCanceled)throw new Error("USER_CANCELED");M+=1/A,f(100*M+"%"),a(M)}break}})(t,p)),C++}return await Promise.all(k),S?new(r().InputFileBig)({id:w,parts:A,name:_}):new(r().InputFile)({id:w,parts:A,name:_,md5Checksum:""})}},21051:(e,t,s)=>{var n=s(48287).hp;const{sha1:a,toSignedLittleBuffer:i,readBufferFromBigInt:o,readBigIntFromBuffer:r}=s(80071),c=s(28427),{sleep:d}=s(80071);class u{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const s=new c(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 u)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await a(this._key);const t=new c(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await d(20)}getKey(){return this._key}async calcNewNonceHash(e,t){e=i(e,32);const s=n.alloc(1);s.writeUInt8(t,0);const c=n.concat([e,n.concat([s,o(this.auxHash,8,!0)])]),d=(await a(c)).slice(4,20);return r(d,!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&e.getKey()&&e.getKey().equals(this._key)}}e.exports=u},52637:(e,t,s)=>{var n=s(48287).hp;const a=s(97157);e.exports=class{constructor(e,t){if(!n.isBuffer(e)||!n.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=a.createCipheriv("AES-256-CTR",e,t)}encrypt(e){return n.from(this.cipher.update(e))}}},25356:(e,t,s)=>{const n=s(92096),{modExp:a}=s(80071);class i{static gcd(e,t){for(;t.neq(n.zero);){const s=t;t=e.remainder(t),e=s}return e}static factorize(e){if(e.remainder(2).equals(n.zero))return{p:n(2),q:e.divide(n(2))};let t=n.randBetween(n(1),e.minus(1));const s=n.randBetween(n(1),e.minus(1)),o=n.randBetween(n(1),e.minus(1));let r,c=n.one,d=n.one,u=n.one,l=n.zero,f=n.zero;for(;c.eq(n.one);){l=t;for(let i=0;n(i).lesser(d);i++)t=a(t,n(2),e).add(s).remainder(e);for(r=n.zero;r.lesser(d)&&c.eq(n.one);){f=t;const p=n.min(o,d.minus(r));for(let i=0;n(i).lesser(p);i++)t=a(t,n(2),e).add(s).remainder(e),u=u.multiply(l.minus(t).abs()).remainder(e);c=i.gcd(u,e),r=r.add(o)}d=d.multiply(2)}if(c.eq(e))for(;f=a(f,n(2),e).add(s).remainder(e),c=i.gcd(l.minus(f).abs(),e),!c.greater(1););const p=c;return u=e.divide(c),p<u?{p,q:u}:{p:u,q:p}}}e.exports=i},72469:(e,t,s)=>{var n=s(48287).hp;const{IGE:a}=s(7692),i=s(80071);e.exports=class{constructor(e,t){this.ige=new a(e,t)}decryptIge(e){return i.convertToLittle(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=n.concat([e,i.generateRandomBytes(16-t)])),i.convertToLittle(this.ige.encrypt(e))}}},76611:(e,t,s)=>{"use strict";function n(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}function a(e){return e.buffer}function i(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 o(e){return new Uint32Array(e)}s.r(t),s.d(t,{ab2i:()=>d,ab2iBig:()=>o,ab2iLow:()=>i,i2ab:()=>c,i2abBig:()=>a,i2abLow:()=>n,isBigEndian:()=>r});const r=1===new Uint8Array(new Uint32Array([16909060]))[0],c=r?a:n,d=r?o:i},97157:(e,t,s)=>{var n=s(48287).hp;const a=s(7692).default,{i2ab:i,ab2i:o}=s(76611),{getWords:r}=s(86001);class c{constructor(e){this.setBytes(e)}setBytes(e){e=n.from(e),this._counter=e}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class d{constructor(e,t){t instanceof c||(t=new c(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new a(r(e))}update(e){return this.encrypt(e)}encrypt(e){const t=n.from(e);for(let e=0;e<t.length;e++)16===this._remainingCounterIndex&&(this._remainingCounter=n.from(i(this._aes.encrypt(o(this._counter._counter)))),this._remainingCounterIndex=0,this._counter.increment()),t[e]^=this._remainingCounter[this._remainingCounterIndex++];return t}}class u{constructor(e){this.algorithm=e}update(e){this.data=new Uint8Array(e)}async digest(){return"sha1"===this.algorithm?n.from(await self.crypto.subtle.digest("SHA-1",this.data)):"sha256"===this.algorithm?n.from(await self.crypto.subtle.digest("SHA-256",this.data)):void 0}}e.exports={createCipheriv:function(e,t,s){if(e.includes("ECB"))throw new Error("Not supported");return new d(t,s)},createDecipheriv:function(e,t,s){if(e.includes("ECB"))throw new Error("Not supported");return new d(t,s)},randomBytes:function(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t},createHash:function(e){return new u(e)},pbkdf2:async function(e,t,s){const a=await crypto.subtle.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]);return n.from(await crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:t,iterations:s},a,512))}}},86001:(e,t,s)=>{"use strict";function n(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}function a(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]=n(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")}function i(e,t,s=e){for(let n=0;n<e.length;n++)s[n]=e[n]^t[n]}s.r(t),s.d(t,{getWords:()=>a,s2i:()=>n,xor:()=>i})},48383:e=>{class t extends Error{constructor(){super("The read operation was cancelled.")}}class s 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}}class n extends Error{constructor(e,t){super(`Invalid checksum (${e} when ${t} was expected). This packet should be skipped.`),this.checksum=e,this.validChecksum=t}}class a 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})`),this.code=t,this.payload=e}}class i extends Error{constructor(...e){e.length||(e=["A security check failed."]),super(...e)}}class o extends Error{constructor(e,t){let s=o.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;s+=` Caused by ${e.className}`,super(s),this.message=s,this.code=t}}var r,c,d,u;r=o,d={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."},(c="symbol"==typeof(u=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(c="ErrorMessages"))?u:u+"")in r?Object.defineProperty(r,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):r[c]=d,e.exports={ReadCancelledError:t,TypeNotFoundError:s,InvalidChecksumError:n,InvalidBufferError:a,SecurityError:i,CdnFileTamperedError:class extends i{constructor(){super("The CDN file has been altered and its download cancelled.")}},BadMessageError:o}},74681:e=>{function t(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class s extends Error{constructor(e,t,n=void 0){super("RPCError {0}: {1}{2}".replace("{0}",n).replace("{1}",e).replace("{2}",s._fmtRequest(t))),this.code=n,this.message=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}e.exports={RPCError:s,InvalidDCError:class extends s{constructor(e,t,s){super(t,e,s),this.code=s||303,this.message=t||"ERROR_SEE_OTHER"}},BadRequestError:class extends s{constructor(...e){super(...e),t(this,"code",400),t(this,"message","BAD_REQUEST")}},UnauthorizedError:class extends s{constructor(...e){super(...e),t(this,"code",401),t(this,"message","UNAUTHORIZED")}},ForbiddenError:class extends s{constructor(...e){super(...e),t(this,"code",403),t(this,"message","FORBIDDEN")}},NotFoundError:class extends s{constructor(...e){super(...e),t(this,"code",404),t(this,"message","NOT_FOUND")}},AuthKeyError:class extends s{constructor(...e){super(...e),t(this,"code",406),t(this,"message","AUTH_KEY")}},FloodError:class extends s{constructor(...e){super(...e),t(this,"code",420),t(this,"message","FLOOD")}},ServerError:class extends s{constructor(...e){super(...e),t(this,"code",500),t(this,"message","INTERNAL")}},TimedOutError:class extends s{constructor(...e){super(...e),t(this,"code",503),t(this,"message","Timeout")}}}},77389:(e,t,s)=>{const{RPCError:n,InvalidDCError:a,FloodError:i,BadRequestError:o,TimedOutError:r}=s(74681);class c extends a{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${n._fmtRequest(e.request)}`),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${n._fmtRequest(e.request)}`,this.newDc=t}}class d extends a{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}${n._fmtRequest(e.request)}`),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${n._fmtRequest(e.request)}`,this.newDc=t}}class u extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat${n._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required before sending another message in this chat${n._fmtRequest(e.request)}`,this.seconds=t}}class l extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${n._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${n._fmtRequest(e.request)}`,this.seconds=t}}class f extends l{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${n._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${n._fmtRequest(e.request)}`,this.seconds=t}}class p extends i{constructor(e){super(`Message failed to be sent.${n._fmtRequest(e.request)}`),this.message=`Message failed to be sent.${n._fmtRequest(e.request)}`}}class g extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${n._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required in the test servers${n._fmtRequest(e.request)}`,this.seconds=t}}class h extends a{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${n._fmtRequest(e.request)}`),this.message=`The file to be accessed is currently stored in DC ${t}${n._fmtRequest(e.request)}`,this.newDc=t}}class m extends a{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${n._fmtRequest(e.request)}`),this.message=`The source IP address is associated with DC ${t}${n._fmtRequest(e.request)}`,this.newDc=t}}class y extends o{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${n._fmtRequest(e.request)}`),this.message=`Email unconfirmed, the length of the code must be ${t}${n._fmtRequest(e.request)}`,this.codeLength=t}}class _ extends o{constructor(e){const t=Number(e.capture||0);super(`The password was modified less than 24 hours ago, try again in ${t} seconds.`),this.message=`The password was modified less than 24 hours ago, try again in ${t} seconds.`,this.seconds=t}}const b=[[/FILE_MIGRATE_(\d+)/,h],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,g],[/FLOOD_WAIT_(\d+)/,l],[/FLOOD_PREMIUM_WAIT_(\d+)/,f],[/MSG_WAIT_(.*)/,p],[/PHONE_MIGRATE_(\d+)/,d],[/SLOWMODE_WAIT_(\d+)/,u],[/USER_MIGRATE_(\d+)/,c],[/NETWORK_MIGRATE_(\d+)/,m],[/EMAIL_UNCONFIRMED_(\d+)/,y],[/PASSWORD_TOO_FRESH_(\d+)/,_],[/^Timeout$/,r]];e.exports={rpcErrorRe:b,FileMigrateError:h,FloodTestPhoneWaitError:g,FloodWaitError:l,FloodPremiumWaitError:f,PhoneMigrateError:d,SlowModeWaitError:u,UserMigrateError:c,NetworkMigrateError:m,MsgWaitError:p,EmailUnconfirmedError:y,PasswordModifiedError:_}},9396:(e,t,s)=>{const{RPCError:n}=s(74681),{rpcErrorRe:a}=s(77389),i=s(48383),o=s(74681),r=s(77389);e.exports={RPCMessageToError:function(e,t){for(const[s,n]of a){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 n(e.errorMessage,t)},...i,...o,...r}},55769:()=>{},73300:(e,t,s)=>{const{EventBuilder:n}=s(53505);e.exports=class extends n{constructor(e={types:void 0,func:void 0}){super(),e.types?this.types=e.types:this.types=!0}build(e){return e}}},53505:e=>{e.exports={EventBuilder:class{constructor(e={chats:void 0,blacklistChats:void 0,func:void 0}){this.chats=e.chats,this.blacklistChats=Boolean(e.blacklistChats),this.resolved=!1,this.func=e.func}build(e){}}}},65230:(e,t,s)=>{const n=s(55769),a=s(73300);class i extends Error{}e.exports={NewMessage:n,StopPropagation:i,Raw:a}},60010:e=>{e.exports=class{constructor(){this._queue=[],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}}},28427:(e,t,s)=>{const{TypeNotFoundError:n}=s(48383),{coreObjects:a}=s(48075),{tlobjects:i}=s(50114),{readBigIntFromBuffer:o}=s(80071);e.exports=class{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(e=!0){let t;return t=e?this.stream.readInt32LE(this.offset):this.stream.readUInt32LE(this.offset),this.offset+=4,t}readLong(e=!0){return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e,t=!0){const s=this.read(Math.floor(e/8));return o(s,!0,t)}read(e=-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}); last read ${this._last}`);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=i[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=a[e],void 0===t){this.seek(-4);const t=this.tellPosition(),s=new n(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}close(){this.stream=void 0}tellPosition(){return this.offset}setPosition(e){this.offset=e}seek(e){this.offset+=e}}},70747:(e,t,s)=>{var n=s(48287).hp;e.exports=class{constructor(e){this._stream=e}write(e){this._stream=n.concat([this._stream,e])}getValue(){return this._stream}}},93671:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var n,a=s(48287).hp;function i(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const o=new Error("HttpStream was closed");(n=AbortSignal).timeout??(n.timeout=function(e){const t=new AbortController;return setTimeout((()=>t.abort()),e),t.signal});class r{constructor(e){i(this,"url",void 0),i(this,"isClosed",void 0),i(this,"stream",[]),i(this,"canRead",Promise.resolve()),i(this,"resolveRead",void 0),i(this,"rejectRead",void 0),i(this,"disconnectedCallback",void 0),this.isClosed=!0,this.disconnectedCallback=e}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,s=!1,n=!1){this.stream=[],this.canRead=new Promise(((e,t)=>{this.resolveRead=e,this.rejectRead=t})),this.url=r.getURL(t,e,s,n),await fetch(this.url,{method:"POST",body:a.from([]),mode:"cors",signal:AbortSignal.timeout(1e4)}),this.isClosed=!1}write(e){if(this.isClosed||!this.url)throw this.handleDisconnect(),o;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 o;const t=await e.arrayBuffer();this.stream=this.stream.concat(a.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}}const c=r},51369:e=>{let t;class s{constructor(e){t||(t=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){t=e}canSend(e){return s.LEVEL_MAP.get(t).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,s,n){t&&this.canSend(e)&&console.log(this.colors.start+this.format(s,e),n)}}var n,a,i,o;n=s,a="LEVEL_MAP",i=new Map([["error",new Set(["error"])],["warn",new Set(["error","warn"])],["info",new Set(["error","warn","info"])],["debug",new Set(["error","warn","info","debug"])]]),(a="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a))?o:o+"")in n?Object.defineProperty(n,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[a]=i,e.exports=s},77552:(e,t,s)=>{var n=s(48287).hp;const a=s(30293),i=s(61028),o=s(70747),r=new Set(["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"]);e.exports=class{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,t=!0,s=!1){if(e&&r.has(e.request.className))if(s){for(let t=0;t<this._queue.length;t++)if(r.has(this._queue[t]?.request.className)){this._queue[t].after=e;break}}else for(let t=this._queue.length-1;t>=0;t--)if(r.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 o(n.alloc(0));if(e.data.length+i.SIZE_OVERHEAD<=a.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} 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("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 o(n.alloc(0));const s=[];let r=0;for(;this._queue.length&&s.length<=a.MAXIMUM_LENGTH;){const e=this._queue.shift();if(e)if(e.abortSignal?.aborted)e.reject(new Error("Request aborted"));else if(r+=e.data.length+i.SIZE_OVERHEAD,r<=a.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} 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("Request Payload is too big"),r=0}}if(s.length){if(s.length>1){const i=n.alloc(8);i.writeUInt32LE(a.CONSTRUCTOR_ID,0),i.writeInt32LE(s.length,4),e=n.concat([i,t.getValue()]),t=new o(n.alloc(0));const r=await this._state.writeDataAsMessage(t,e,!1);for(const e of s)e.containerId=r}return e=t.getValue(),{batch:s,data:e}}}}},40041:e=>{e.exports=class{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()}}},68338:(e,t,s)=>{var n=s(48287).hp;const{Mutex:a}=s(56693),i=new a,o=new Error("WebSocket was closed");e.exports=class{constructor(e){this.client=void 0,this.closed=!0,this.disconnectedCallback=e,this.timeout=3e3}async readExactly(e){let t=n.alloc(0);for(;;){const s=await this.read(e);if(t=n.concat([t,s]),!(e-=s.length))return t}}async read(e){if(this.closed)throw o;if(await this.canRead,this.closed)throw o;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 o;const e=this.stream;return this.stream=n.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,s=!1,a=!1){return this.stream=n.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),this.closed=!1,this.website=this.getWebSocketLink(t,e,s,a),this.client=new WebSocket(this.website,"binary"),new Promise(((e,s)=>{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",(async()=>{await this.close(),this.resolveRead(!1)}))}))}write(e){if(this.closed)throw o;this.client.send(e)}async close(){await this.client.close(),this.closed=!0}receive(){this.client.onmessage=async e=>{await i.runExclusive((async()=>{const t=e.data instanceof ArrayBuffer?n.from(e.data):n.from(await new Response(e.data).arrayBuffer());this.stream=n.concat([this.stream,t]),this.resolveRead(!0)}))}}}},4681:(e,t,s)=>{const n=s(51369),a=s(70747),i=s(28427),o=s(68338),r=s(77552),c=s(60010);e.exports={BinaryWriter:a,BinaryReader:i,MessagePacker:r,AsyncQueue:c,Logger:n,PromisedWebSockets:o}},45174:(e,t,s)=>{const n=s(96847),a=s(26462),i=s(51227),o=s(43355),r=s(58946),c=s(65230),d=s(56215),u=s(9396),l=s(47306),f=s(4681),p=s(80071);e.exports={Api:n,TelegramClient:a,sessions:l,connection:i,extensions:f,tl:o,version:r,events:c,utils:d,errors:u,helpers:p}},83620:(e,t,s)=>{"use strict";s.r(t),s.d(t,{doAuthentication:()=>y});var n=s(96847),a=s.n(n),i=s(9396),o=s(92096),r=s.n(o);s(80071),s(48287).hp;const c=[{fingerprint:r()("-3414540481677951611"),n:r()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537},{fingerprint:r()("-5595554452916591101"),n:r()("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),e:65537}].reduce(((e,{fingerprint:t,...s})=>(e.set(t.toString(),s),e)),new Map);var d=s(48287).hp;const u=s(92096),l=s(72469),f=s(21051),p=s(25356),g=s(80071),h=s(28427),m=20;async function y(e,t){let s=g.generateRandomBytes(16);const n=g.readBigIntFromBuffer(s,!1,!0),o=await e.send(new(a().ReqPqMulti)({nonce:n}));if(t.debug("Starting authKey generation step 1"),!(o instanceof a().ResPQ))throw new i.SecurityError(`Step 1 answer was ${o}`);if(o.nonce.neq(n))throw new i.SecurityError("Step 1 invalid nonce from server");const r=g.readBigIntFromBuffer(o.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:y,q:_}=p.factorize(r),b=g.getByteArray(y),w=g.getByteArray(_);s=g.generateRandomBytes(32);const S=g.readBigIntFromBuffer(s,!0,!0),v=new(a().PQInnerData)({pq:g.getByteArray(r),p:b,q:w,nonce:o.nonce,serverNonce:o.serverNonce,newNonce:S}).getBytes();if(v.length>144)throw new i.SecurityError("Step 1 invalid nonce from server");let I,A;for(const e of o.serverPublicKeyFingerprints)if(A=c.get(e.toString()),void 0!==A){I=e;break}if(void 0===I||void 0===A)throw new i.SecurityError("Step 2 could not find a valid key for fingerprints");const P=g.generateRandomBytes(192-v.length),C=d.concat([v,P]),M=d.from(C).reverse();let R;for(let e=0;e<m;e++){const e=g.generateRandomBytes(32),s=await g.sha256(d.concat([e,C])),n=d.concat([M,s]),a=new l(e,d.alloc(32)).encryptIge(n),i=g.bufferXor(e,await g.sha256(a)),o=d.concat([i,a]),r=g.readBigIntFromBuffer(o,!1,!1);if(r.greaterOrEquals(A.n)){t.debug("Aes key greater than RSA. retrying");continue}const c=g.modExp(r,u(A.e),A.n);R=g.readBufferFromBigInt(c,256,!1,!1);break}if(void 0===R)throw new i.SecurityError("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const k=await e.send(new(a().ReqDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,p:b,q:w,publicKeyFingerprint:I,encryptedData:R}));if(!(k instanceof a().ServerDHParamsOk||k instanceof a().ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${k}`);if(k.nonce.neq(o.nonce))throw new i.SecurityError("Step 2 invalid nonce from server");if(k.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 2 invalid server nonce from server");if(k instanceof a().ServerDHParamsFail){const e=await g.sha1(g.toSignedLittleBuffer(S,32).slice(4,20)),t=g.readBigIntFromBuffer(e,!0,!0);if(k.newNonceHash.neq(t))throw new i.SecurityError("Step 2 invalid DH fail nonce from server")}if(!(k instanceof a().ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${k}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:T,iv:E}=await g.generateKeyDataFromNonce(o.serverNonce,S);if(k.encryptedAnswer.length%16!=0)throw new i.SecurityError("Step 3 AES block size mismatch");const B=new l(T,E),D=B.decryptIge(k.encryptedAnswer),U=new h(D),x=U.read(20),V=U.tgReadObject();if(!(V instanceof a().ServerDHInnerData))throw new Error(`Step 3 answer was ${V}`);const N=await g.sha1(V.getBytes());if(!x.equals(N))throw new i.SecurityError("Step 3 Invalid hash answer");if(V.nonce.neq(o.nonce))throw new i.SecurityError("Step 3 Invalid nonce in encrypted answer");if(V.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 3 Invalid server nonce in encrypted answer");if(3!==V.g||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==V.dhPrime.toString("hex"))throw new i.SecurityError("Step 3 invalid dhPrime or g");const F=g.readBigIntFromBuffer(V.dhPrime,!1,!1),G=g.readBigIntFromBuffer(V.gA,!1,!1),q=V.serverTime-Math.floor(Date.now()/1e3),H=g.readBigIntFromBuffer(g.generateRandomBytes(256),!1,!1),O=g.modExp(u(V.g),H,F),L=g.modExp(G,H,F);if(G.lesserOrEquals(1))throw new i.SecurityError("Step 3 failed ga > 1 check");if(O.lesserOrEquals(1))throw new i.SecurityError("Step 3 failed gb > 1 check");if(G.greater(F.minus(1)))throw new i.SecurityError("Step 3 failed ga > dh_prime - 1 check");const j=u(2).pow(1984);if(!G.greaterOrEquals(j)||!G.lesserOrEquals(F.minus(j)))throw new i.SecurityError("Step 3 failed dh_prime - 2^{2048-64} < ga < 2^{2048-64} check");if(!O.greaterOrEquals(j)||!O.lesserOrEquals(F.minus(j)))throw new i.SecurityError("Step 3 failed dh_prime - 2^{2048-64} < gb < 2^{2048-64} check");const W=new(a().ClientDHInnerData)({nonce:o.nonce,serverNonce:o.serverNonce,retryId:u.zero,gB:g.getByteArray(O,!1)}).getBytes(),z=d.concat([await g.sha1(W),W]),K=B.encryptIge(z),$=await e.send(new(a().SetClientDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,encryptedData:K})),J=[a().DhGenOk,a().DhGenRetry,a().DhGenFail];if(!($ instanceof J[0]||$ instanceof J[1]||$ instanceof J[2]))throw new Error(`Step 3.1 answer was ${$}`);const{name:Q}=$.constructor;if($.nonce.neq(o.nonce))throw new i.SecurityError(`Step 3 invalid ${Q} nonce from server`);if($.serverNonce.neq(o.serverNonce))throw new i.SecurityError(`Step 3 invalid ${Q} server nonce from server`);const X=new f;await X.setKey(g.getByteArray(L));const Y=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf($.className),Z=await X.calcNewNonceHash(S,Y);if($[`newNonceHash${Y}`].neq(Z))throw new i.SecurityError("Step 3 invalid new nonce hash");if(!($ instanceof a().DhGenOk))throw new Error(`Step 3.2 answer was ${$}`);return t.debug("Finished authKey generation step 3"),{authKey:X,timeOffset:q}}},83821:(e,t,s)=>{var n=s(48287).hp;const a=s(92096),i=s(35897),o=s(28427),{InvalidBufferError:r}=s(48383),{toSignedLittleBuffer:c}=s(80071);e.exports=class{constructor(e,t){this._state=new i(e,t),this._connection=e}async send(e){let t=e.getBytes(),s=this._state._getNewMsgId();const i=c(s,8),d=n.alloc(4);d.writeInt32LE(t.length,0);const u=n.concat([n.concat([n.alloc(8),i,d]),t]);if(await this._connection.send(u),t=await this._connection.recv(),t.length<8)throw new r(t);const l=new o(t);if(l.readLong().neq(a(0)))throw new Error("Bad authKeyId");if(s=l.readLong(),s.eq(a(0)))throw new Error("Bad msgId");if(l.readInt()<=0)throw new Error("Bad length");return l.tgReadObject()}}},11523:(e,t,s)=>{function n(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const{RPCError:a}=s(9396),i=s(83821),o=s(35897),r=s(80071),c=s(21051),{doAuthentication:d}=s(83620),u=s(9309),l=s(30293),f=s(31187),p=s(83701),{MsgsAck:g,upload:h,MsgsStateInfo:m,Pong:y}=s(43355).constructors,_=s(77552),b=s(28427),w=s(40041),{UpdateConnectionState:S,UpdateServerTimeOffset:v}=s(44337),{BadMessageError:I}=s(48383),{BadServerSalt:A,BadMsgNotification:P,MsgDetailedInfo:C,MsgNewDetailedInfo:M,NewSessionCreated:R,FutureSalts:k,MsgsStateReq:T,MsgResendReq:E,MsgsAllInfo:B,HttpWait:D}=s(43355).constructors,{SecurityError:U}=s(48383),{InvalidBufferError:x}=s(48383),{RPCMessageToError:V}=s(9396),{TypeNotFoundError:N}=s(48383);class F{constructor(e,t){n(this,"logWithIndex",{debug:this.logWithIndexCallback("debug"),log:this.logWithIndexCallback("log"),warn:this.logWithIndexCallback("warn"),error:this.logWithIndexCallback("error")});const s={...F.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,this._retries=s.retries,this._retriesToFallback=s.retriesToFallback,this._delay=s.delay,this._retryMainConnectionDelay=s.retryMainConnectionDelay,this._autoReconnect=s.autoReconnect,this._connectTimeout=s.connectTimeout,this._authKeyCallback=s.authKeyCallback,this._updateCallback=s.updateCallback,this._autoReconnectCallback=s.autoReconnectCallback,this._isMainSender=s.isMainSender,this._isExported=s.isExported,this._onConnectionBreak=s.onConnectionBreak,this._isFallback=!1,this._getShouldDebugExportedSenders=s.getShouldDebugExportedSenders,this.userDisconnected=!1,this._user_connected=!1,this.isReconnecting=!1,this._disconnected=!0,this._send_loop_handle=void 0,this._long_poll_loop_handle=void 0,this._recv_loop_handle=void 0,this.authKey=e||new c,this._state=new o(this.authKey,this._log),this._send_queue=new _(this._state,this._log),this._send_queue_long_poll=new _(this._state,this._log),this._pending_state=new w,this._pending_ack=new Set,this._last_acks=[],this._handlers={[u.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[l.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[f.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[y.CONSTRUCTOR_ID]:this._handlePong.bind(this),[A.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[P.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[C.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[M.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[R.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[g.CONSTRUCTOR_ID]:this._handleAck.bind(this),[k.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[T.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[E.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[B.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}logWithIndexCallback(e){return(...t)=>{this._getShouldDebugExportedSenders&&this._getShouldDebugExportedSenders()&&console[e](`[${this._isExported?`idx=${this._senderIndex} `:"M "}dcId=${this._dcId}]`,...t)}}getConnection(){return this._isFallback?this._fallbackConnection:this._connection}async connect(e,t,s){if(this.userDisconnected=!1,this._user_connected&&!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 S(S.connected));break}catch(t){this._isExported||0!==e||this._updateCallback?.(new S(S.disconnected)),this._log.error(`${this._isFallback?"HTTP":"WebSocket"} connection failed attempt: ${e+1}`),console.error(t),await r.sleep(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 r.sleep(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,await 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 r.sleep(this._retryMainConnectionDelay),this.tryReconnectToMain()}}}isConnected(){return this._user_connected}async disconnect(){this.userDisconnected=!0,this.logWithIndex.warn("Disconnecting..."),await this._disconnect(this.getConnection())}destroy(){this._send_queue.clear()}send(e,t,s=!1){const n=new p(e,t);return s?this._send_queue_long_poll.append(n):(this.logWithIndex.debug(`Send ${e.className}`),this._send_queue.append(n)),n.promise}addStateToQueue(e){this._send_queue.append(e)}async sendBeacon(e){if(!this._user_connected)throw new Error("Cannot send requests while disconnected");const t=new p(e,void 0),s=await this._send_queue.getBeacon(t),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)),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 i(e,this._log);this._log.debug("New auth_key attempt ...");const s=await d(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 v(this._state.timeOffset)),this._authKeyCallback&&await this._authKeyCallback(this.authKey,this._dcId)}this._user_connected=!0,this.isReconnecting=!1,this._send_loop_handle||(this._log.debug("Starting send loop"),this._send_loop_handle=this._sendLoop()),this._recv_loop_handle||(this._log.debug("Starting receive loop"),this._recv_loop_handle=this._recvLoop()),!this._long_poll_loop_handle&&e.shouldLongPoll&&(this._log.debug("Starting long-poll loop"),this._long_poll_loop_handle=this._longPollLoop()),this._log.info("Connection to %s complete!".replace("%s",e.toString()))}async _disconnect(e){this._isExported||this._updateCallback?.(new S(S.disconnected)),void 0!==e?(this._log.info("Disconnecting from %s...".replace("%s",e.toString())),this._user_connected=!1,this._log.debug("Closing current connection..."),this.logWithIndex.warn("Disconnecting"),await e.disconnect()):this._log.info("Not disconnecting (already have no connection)")}async _longPollLoop(){for(;this._user_connected&&!this.isReconnecting&&this._isFallback&&this.getConnection().shouldLongPoll;){await this._send_queue_long_poll.wait();const e=await this._send_queue_long_poll.get();if(this.isReconnecting||!this._isFallback)return void(this._long_poll_loop_handle=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._long_poll_loop_handle=void 0,this.isSendingLongPoll=!1,void(this.userDisconnected||this.reconnect())}this.isSendingLongPoll=!1,this.checkLongPoll()}this._long_poll_loop_handle=void 0}async _sendLoop(){for(this._send_queue.prepend(this._pending_state.values()),this._pending_state.clear();this._user_connected&&!this.isReconnecting;){const e=()=>{if(this._pending_ack.size){const e=new p(new g({msgIds:Array(...this._pending_ack)}));this._send_queue.append(e),this._last_acks.push(e),this._last_acks.length>=10&&this._last_acks.shift(),this._pending_ack.clear()}};e(),this.logWithIndex.debug(`Waiting for messages to send... ${this.isReconnecting}`),this._log.debug(`Waiting for messages to send... ${this.isReconnecting}`),await this._send_queue.wait(),this._isFallback&&this.send(new D({maxDelay:0,waitAfter:0,maxWait:0})),e();const t=await this._send_queue.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._pending_state.set(t.msgId,t);else"request"===e.request.classType&&"HttpWait"!==e.request.className&&this._pending_state.set(e.msgId,e);if(this.isReconnecting)return this.logWithIndex.debug("Reconnecting :("),void(this._send_loop_handle=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._send_loop_handle=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._send_loop_handle=void 0}async _recvLoop(){let e,t;for(;this._user_connected&&!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._recv_loop_handle=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 N){this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);continue}if(e instanceof U){this._log.warn(`Security error while unpacking a received message: ${e}`);continue}return e instanceof x?(404===e.code?this._handleBadAuthKey():(this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`),this.reconnect()),void(this._recv_loop_handle=void 0)):(this._log.error("Unhandled error while receiving data"),this._log.error(e),this.reconnect(),void(this._recv_loop_handle=void 0))}try{await this._processMessage(t)}catch(e){e instanceof a?"AUTH_KEY_UNREGISTERED"!==e.message&&"SESSION_REVOKED"!==e.message||this._handleBadAuthKey(!0):(this._log.error("Unhandled error while receiving data"),this._log.error(e))}this.checkLongPoll()}this._recv_loop_handle=void 0}checkLongPoll(){!this.isSendingLongPoll&&this._isFallback&&(this.isSendingLongPoll=!0,this.send(new D({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 S(S.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._pending_ack.add(e.msgId),this.getConnection().shouldLongPoll&&this._send_queue.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._pending_state.getAndDelete(e);if(t)return[t];const s=[];for(const t of this._pending_state.values())t.containerId?.equals(e)&&s.push(t.msgId);if(s.length){const e=[];for(const t of s)e.push(this._pending_state.getAndDelete(t));return e}for(const t of this._last_acks)if(t.msgId===e)return[t];return[]}_handleRPCResult(e){const t=e.obj,s=this._pending_state.getAndDelete(t.reqMsgId);if(this._log.debug(`Handling RPC result for message ${t.reqMsgId}`),s){if(t.error){const e=V(t.error,s.request);throw this._send_queue.append(new p(new g({msgIds:[s.msgId]}))),s.reject(e),e}try{const e=new b(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 b(t.body).tgReadObject()instanceof h.File))throw new N("Not an upload.File")}catch(e){if(e instanceof N)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 b(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 v(s)),this._log.debug(`Handling pong for message ${t.msgId}`);const n=this._pending_state.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._send_queue.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 v(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 I(e.request,t.errorCode));return}this._state._sequence-=16}this._send_queue.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._pending_ack.add(t)}_handleNewDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling new detailed info for message ${t}`),this._pending_ack.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}`);const t=this._pending_state.getAndDelete(e.msgId);t&&t.resolve(e.obj)}_handleStateForgotten(e){this._send_queue.append(new p(new m({msgId:e.msgId,query:String.fromCharCode(1).repeat(e.obj.msgIds)})))}_handleMsgAll(e){}reconnect(){this._user_connected&&!this.isReconnecting&&(this.isReconnecting=!0,r.sleep(1e3).then((()=>{this.logWithIndex.log("Reconnecting..."),this._log.info("Started reconnecting"),this._reconnect()})))}async _reconnect(){this._log.debug("Closing current connection...");try{this.logWithIndex.warn("[Reconnect] Closing current connection..."),await this._disconnect(this.getConnection())}catch(e){this._log.warn(e)}this._send_queue.append(void 0),this._state.reset();const e=new this._connection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log,this._connection._testServers),t=new this._fallbackConnection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log,this._connection._testServers);await this.connect(e,!0,t),this.isReconnecting=!1,this._send_queue.prepend(this._pending_state.values()),this._pending_state.clear(),this._autoReconnectCallback&&await this._autoReconnectCallback()}}n(F,"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}),e.exports=F},35897:(e,t,s)=>{var n=s(48287).hp;const a=s(92096),i=s(7692),o=s(80071),r=s(72469),c=s(28427),d=s(31187),{TLMessage:u}=s(48075),{SecurityError:l,InvalidBufferError:f}=s(48383),{InvokeAfterMsg:p}=s(43355).requests,{toSignedLittleBuffer:g}=s(80071);e.exports=class{constructor(e,t,s=!1,n=!1){this.authKey=e,this._log=t,this._isCall=s,this._isOutgoing=n,this.timeOffset=0,this.salt=0,this.id=void 0,this._sequence=void 0,this._lastMsgId=void 0,this.msgIds=[],this.reset()}reset(){this.id=o.generateRandomLong(!0),this._sequence=0,this._lastMsgId=a(0),this.msgIds=[]}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,s){const a=this._isCall?128+(this._isOutgoing^s?8:0):!0===s?0:8,[i,r]=await Promise.all([o.sha256(n.concat([t,e.slice(a,a+36)])),o.sha256(n.concat([e.slice(a+40,a+76),t]))]),c=n.concat([i.slice(0,8),r.slice(8,24),i.slice(24,32)]);return this._isCall?{key:c,iv:n.concat([r.slice(0,4),i.slice(8,16),r.slice(24,28)])}:{key:c,iv:n.concat([r.slice(0,8),i.slice(8,24),r.slice(24,32)])}}async writeDataAsMessage(e,t,s,a){const i=this._getNewMsgId(),o=this._getSeqNo(s);let r;r=a?await d.gzipIfSmaller(s,new p({msgId:a,query:{getBytes:()=>t}}).getBytes()):await d.gzipIfSmaller(s,t);const c=n.alloc(4);c.writeInt32LE(o,0);const u=n.alloc(4);u.writeInt32LE(r.length,0);const l=g(i,8);return e.write(n.concat([l,c,u])),e.write(r),i}async encryptMessageData(e){if(await this.authKey.waitForKey(),this._isCall){const t=128+(this._isOutgoing?0:8),s=e.length;e=n.from(e),s%4!=0&&(e=n.concat([e,n.from(new Array(4-s%4).fill(32))]));const a=(await o.sha256(n.concat([this.authKey.getKey().slice(88+t,88+t+32),n.from(e)]))).slice(8,24),{iv:r,key:c}=await this._calcKey(this.authKey.getKey(),a,!0);return e=o.convertToLittle(new i.CTR(c,r).encrypt(e)),n.concat([a,e])}{const t=g(this.salt,8),s=g(this.id,8);e=n.concat([n.concat([t,s]),e]);const a=o.generateRandomBytes(o.mod(-(e.length+12),16)+12),i=(await o.sha256(n.concat([this.authKey.getKey().slice(88,120),e,a]))).slice(8,24),{iv:c,key:d}=await this._calcKey(this.authKey.getKey(),i,!0),u=o.readBufferFromBigInt(this.authKey.keyId,8);return n.concat([u,i,new r(d,c).encryptIge(n.concat([e,a]))])}}async decryptMessageData(e){if(e.length<8)throw new f(e);if(e.length<0)throw new l("Server replied with negative length");if(e.length%4!=0&&!this._isCall)throw new l("Server replied with length not divisible by 4");if(!this._isCall&&o.readBigIntFromBuffer(e.slice(0,8)).neq(this.authKey.keyId))throw new l("Server replied with an invalid auth key");const t=this._isCall?e.slice(0,16):e.slice(8,24),s=this._isCall?128+(this.isOutgoing?8:0):void 0,{iv:a,key:d}=await this._calcKey(this.authKey.getKey(),t,!1);if(this._isCall){const t=(e=e.slice(16)).length;e=n.concat([e,n.from(new Array(4-t%4).fill(0))]),e=(e=o.convertToLittle(new i.CTR(d,a).decrypt(e))).slice(0,t)}else e=new r(d,a).decryptIge(this._isCall?e.slice(16):e.slice(24));const p=this._isCall?await o.sha256(n.concat([this.authKey.getKey().slice(88+s,88+s+32),e])):await o.sha256(n.concat([this.authKey.getKey().slice(96,128),e]));if(!this._isCall&&!t.equals(p.slice(8,24)))throw new l("Received msg_key doesn't match with expected one");const g=new c(e);if(this._isCall)return g.readInt(!1),g.read(e.length-4);{if(g.readLong(),!g.readLong().eq(this.id))throw new l("Server replied with a wrong session ID");const t=g.readLong();if(this.msgIds.includes(t.toString()))throw new l("Duplicate msgIds");this.msgIds.length>500&&this.msgIds.shift();const s=g.readInt(),n=g.readInt(),a=e.length-n;if(a<12||a>1024)throw new l("Server replied with the wrong message padding");const i=await g.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 l("The message time is incorrect.")}return i&&!("errorCode"in i)&&this.msgIds.push(t.toString()),new u(t,s,i)}}_getNewMsgId(){const e=Date.now()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let s=a(Math.floor(e)).shiftLeft(a(32)).or(a(t).shiftLeft(a(2)));return this._lastMsgId.greaterOrEquals(s)&&(s=this._lastMsgId.add(a(4))),this._lastMsgId=s,s}getMsgIdTimeLocal(e){return!this._lastMsgId.eq(0)&&e.shiftRight(a(32)).toJSNumber()-this.timeOffset}updateTimeOffset(e){const t=this._getNewMsgId(),s=this.timeOffset,n=Math.floor(Date.now()/1e3),i=e.shiftRight(a(32));return this.timeOffset=i-n,this.timeOffset!==s&&(this._lastMsgId=a(0),this._log.debug(`Updated time offset (old offset ${s}, bad ${t}, good ${e}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}},83701:(e,t,s)=>{const n=s(9705).A;e.exports=class{constructor(e,t=void 0){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 n,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}))}}},46026:(e,t,s)=>{function n(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const a=s(68338),i=s(93671).A,o=s(60010);class r{constructor(e,t,s,i,r,c){n(this,"PacketCodecClass",void 0),this._ip=e,this._port=t,this._dcId=s,this._log=i,this._testServers=r,this._isPremium=c,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new o,this._recvArray=new o,this.shouldLongPoll=!1,this.socket=new a(this.disconnectCallback.bind(this))}isConnected(){return this._connected}async disconnectCallback(){await this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this._testServers,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()}async disconnect(e=!1){this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||await 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);await 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","")}`}}e.exports={Connection:r,PacketCodec:class{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}},ObfuscatedConnection:class extends r{constructor(...e){super(...e),n(this,"ObfuscatedIO",void 0)}_initConn(){this._obfuscation=new this.ObfuscatedIO(this),this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}},HttpConnection:class extends r{constructor(e,t,s,n,a,o){super(e,t,s,n,a,o),this.shouldLongPoll=!0,this.socket=new i(this.disconnectCallback.bind(this)),this.href=i.getURL(this._ip,this._port,this._testServers,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._testServers,this._isPremium),this._log.debug("Finished connecting")}async connect(){await this._connect(),this._connected=!0}}}},47677:(e,t,s)=>{var n=s(48287).hp;function a(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const i=s(92096),{readBufferFromBigInt:o}=s(80071),{Connection:r,PacketCodec:c}=s(46026);class d extends c{constructor(e){super(e),this.tag=d.tag,this.obfuscateTag=d.obfuscateTag}encodePacket(e){let t=e.length>>2;if(t<127){const e=n.alloc(1);e.writeUInt8(t,0),t=e}else t=n.concat([n.from("7f","hex"),o(i(t),3)]);return n.concat([t,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=n.concat([await e.read(3),n.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}a(d,"tag",n.from("ef","hex")),a(d,"obfuscateTag",n.from("efefefef","hex")),e.exports={ConnectionTCPAbridged:class extends r{constructor(...e){super(...e),a(this,"PacketCodecClass",d)}},AbridgedPacketCodec:d}},34886:()=>{},7433:(e,t,s)=>{var n=s(48287).hp;function a(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const{generateRandomBytes:i}=s(80071),{ObfuscatedConnection:o}=s(46026),{AbridgedPacketCodec:r}=s(47677),c=s(52637);class d{constructor(e){a(this,"header",void 0),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=[n.from("50567247","hex"),n.from("474554","hex"),n.from("504f5354","hex"),n.from("eeeeeeee","hex")];let s;for(;;)if(s=i(64),239!==s[0]&&!s.slice(4,8).equals(n.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 a=n.from(s.slice(8,56)).reverse(),o=n.from(s.slice(8,40)),r=n.from(s.slice(40,56)),d=n.from(a.slice(0,32)),u=n.from(a.slice(32,48)),l=new c(o,r),f=new c(d,u);return s=n.concat([n.from(s.slice(0,56)),e.obfuscateTag,n.from(s.slice(60))]),s=n.concat([n.from(s.slice(0,56)),n.from(l.encrypt(s).slice(56,64)),n.from(s.slice(64))]),{random:s,encryptor:l,decryptor:f}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}e.exports={ConnectionTCPObfuscated:class extends o{constructor(...e){super(...e),a(this,"ObfuscatedIO",d),a(this,"PacketCodecClass",r)}}}},99200:(e,t,s)=>{const{Connection:n,HttpConnection:a}=s(46026),{ConnectionTCPFull:i}=s(34886),{ConnectionTCPAbridged:o}=s(47677),{ConnectionTCPObfuscated:r}=s(7433);e.exports={Connection:n,HttpConnection:a,ConnectionTCPFull:i,ConnectionTCPAbridged:o,ConnectionTCPObfuscated:r}},51227:(e,t,s)=>{const n=s(83821),a=s(11523),{Connection:i,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c,HttpConnection:d}=s(99200),{UpdateConnectionState:u,UpdateServerTimeOffset:l}=s(44337);e.exports={Connection:i,HttpConnection:d,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c,MTProtoPlainSender:n,MTProtoSender:a,UpdateConnectionState:u,UpdateServerTimeOffset:l}},44337:e=>{function t(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class s{constructor(e,t){this.state=e,this.origin=t}}t(s,"disconnected",-1),t(s,"connected",1),t(s,"broken",0),e.exports={UpdateConnectionState:s,UpdateServerTimeOffset:class{constructor(e){this.timeOffset=e}}}},79258:e=>{e.exports=class{get dcId(){throw new Error("Not Implemented")}get serverAddress(){throw new Error("Not Implemented")}get port(){throw new Error("Not Implemented")}get authKey(){throw new Error("Not Implemented")}set authKey(e){throw new Error("Not Implemented")}setDC(e,t,s){throw new Error("Not implemented")}save(){throw new Error("Not Implemented")}delete(){throw new Error("Not Implemented")}}},25340:(e,t,s)=>{const n=s(75139),a="GramJs";e.exports=class extends n{async _delete(){const e=new Request(this._storageKey);return(await self.caches.open(a)).delete(e)}async _fetchFromCache(){const e=new Request(this._storageKey),t=await self.caches.open(a),s=await t.match(e);return s?s.text():void 0}async _saveToCache(e){const t=new Request(this._storageKey),s=new Response(e);return(await self.caches.open(a)).put(t,s)}}},70095:(e,t,s)=>{var n=s(48287).hp;const a=s(90155),i=s(21051),o=s(56215);e.exports=class extends a{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,hashes:s,isTest:a}=this._sessionData,{ipAddress:r,port:c}=o.getDC(e);this.setDC(e,r,c,a,!0),await Promise.all(Object.keys(t).map((async e=>{const a="string"==typeof t[e]?n.from(t[e],"hex"):n.from(t[e]);if(s[e]){const t="string"==typeof s[e]?n.from(s[e],"hex"):n.from(s[e]);this._authKeys[e]=new i(a,t)}else this._authKeys[e]=new i,await this._authKeys[e].setKey(a,!0)})))}setDC(e,t,s,n,a=!1){this._dcId=e,this._serverAddress=t,this._port=s,this._isTestServer=n,delete this._authKeys[e],a||this._onUpdate()}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},hashes:{},isTest:this._isTestServer||void 0};return Object.keys(this._authKeys).forEach((t=>{const s=this._authKeys[t];s&&s._key&&(e.keys[t]=s._key.toString("hex"),e.hashes[t]=s._hash.toString("hex"))})),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}},89127:(e,t,s)=>{const n=s(77783),a=s(75139),i="GramJs";e.exports=class extends a{_delete(){return n.del(`${i}:${this._storageKey}`)}_fetchFromCache(){return n.get(`${i}:${this._storageKey}`)}_saveToCache(e){return n.set(`${i}:${this._storageKey}`,e)}}},86074:(e,t,s)=>{const n=s(75139);e.exports=class extends n{_delete(){return localStorage.removeItem(this._storageKey)}_fetchFromCache(){return localStorage.getItem(this._storageKey)}_saveToCache(e){return localStorage.setItem(this._storageKey,e)}}},90155:(e,t,s)=>{const n=s(79258);e.exports=class extends n{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._isTestServer=!1,this._entities=new Set,this._updateStates={}}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get authKey(){return this._authKey}set authKey(e){this._authKey=e}get isTestServer(){return this._isTestServer}setDC(e,t,s,n){this._dcId=0|e,this._serverAddress=t,this._port=s,this._isTestServer=n}}},75139:(e,t,s)=>{var n=s(48287).hp;const a=s(90155),i=s(21051),o=s(56215);e.exports=class extends a{constructor(e){super(),this._authKeys={},e&&e.startsWith("session:")?this._sessionString=e:e&&(this._storageKey=e)}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(this._sessionString)await this._loadFromSessionString();else if(this._storageKey)try{const e=await this._fetchFromCache(),{mainDcId:t,keys:s,hashes:a}=JSON.parse(e),{ipAddress:r,port:c}=o.getDC(t);this.setDC(t,r,c,!0),Object.keys(s).forEach((e=>{s[e]&&a[e]&&(this._authKeys[e]=new i(n.from(s[e].data),n.from(a[e].data)))}))}catch(e){console.warn("Failed to retrieve or parse session from storage"),console.warn(e)}}setDC(e,t,s,n=!1){this._dcId=e,this._serverAddress=t,this._port=s,delete this._authKeys[e],n||this._updateStorage()}async save(){return this._storageKey||(this._storageKey=`GramJs-session-${Date.now()}`),await this._updateStorage(),this._storageKey}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._updateStorage()}getSessionData(e){const t={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((s=>{const n=this._authKeys[s];n._key&&(t.keys[s]=e?n._key.toString("hex"):n._key,t.hashes[s]=e?n._hash.toString("hex"):n._hash)})),t}async _loadFromSessionString(){const[,e,t]=this._sessionString.split(":"),s=Number(e),{ipAddress:a,port:r}=o.getDC(s);this.setDC(s,a,r);const c=new i;await c.setKey(n.from(t,"hex"),!0),this.setAuthKey(c,s)}async _updateStorage(){if(this._storageKey)try{await this._saveToCache(JSON.stringify(this.getSessionData()))}catch(e){console.warn("Failed to update session in storage"),console.warn(e)}}async delete(){try{return await this._delete()}catch(e){console.warn("Failed to delete session from storage"),console.warn(e)}}_delete(){throw new Error("Not Implemented")}_fetchFromCache(){throw new Error("Not Implemented")}_saveToCache(e){throw new Error("Not Implemented")}}},10909:(e,t,s)=>{var n=s(48287).hp;const a=s(90155),i=s(21051),o=s(28427);class r extends a{constructor(e=void 0){if(super(),e){if("1"!==e[0])throw new Error("Not a valid string");e=e.slice(1);const t=r.decode(e),s=new o(t);this._dcId=s.read(1).readUInt8(0);const n=s.read(2).readInt16BE(0);this._serverAddress=String(s.read(n)),this._port=s.read(2).readInt16BE(0),this._key=s.read(-1)}}static encode(e){return e.toString("base64")}static decode(e){return n.from(e,"base64")}async load(){this._key&&(this._authKey=new i,await this._authKey.setKey(this._key))}save(){if(!this.authKey)return"";const e=n.from([this.dcId]),t=n.from(this.serverAddress),s=n.alloc(2);s.writeInt16BE(t.length,0);const a=n.alloc(2);return a.writeInt16BE(this.port,0),"1"+r.encode(n.concat([e,s,t,a,this.authKey.getKey()]))}getAuthKey(e){if(!e||e===this.dcId)return this.authKey}setAuthKey(e,t){t&&t!==this.dcId||(this.authKey=e)}}e.exports=r},47306:(e,t,s)=>{const n=s(90155),a=s(10909),i=s(25340),o=s(86074),r=s(89127),c=s(70095);e.exports={Memory:n,StringSession:a,CacheApiSession:i,LocalStorageSession:o,IdbSession:r,CallbackSession:c}},50114:(e,t,s)=>{const n=s(96847),a={};for(const e of Object.values(n))if(e.CONSTRUCTOR_ID)a[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))a[t.CONSTRUCTOR_ID]=t;e.exports={LAYER:196,tlobjects:a}},96847:(e,t,s)=>{var n=s(48287).hp;function a(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const{parseTl:i,serializeBytes:o,serializeDate:r}=s(73192),{toSignedLittleBuffer:c}=s(80071),d=s(59759),u=s(68656),l="undefined"!=typeof self&&void 0!==self.localStorage,f="GramJs:apiCache";function p(e){const t=i(e),s=[],n=[];for(const e of t)e.isFunction?n.push(e):s.push(e);return[s,n]}function g(e,t){switch(t){case"int":{const t=n.alloc(4);return t.writeInt32LE(e,0),t}case"long":return c(e,8);case"int128":return c(e,16);case"int256":return c(e,32);case"double":{const t=n.alloc(8);return t.writeDoubleLE(e,0),t}case"string":case"bytes":return o(e);case"Bool":return e?n.from("b5757299","hex"):n.from("379779bc","hex");case"true":return n.alloc(0);case"date":return r(e);default:return e.getBytes()}}function h(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(h(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 m(e,t){const s={};for(const i of t){const{name:t,constructorId:o,subclassOfId:r,argsConfig:c,namespace:d,result:u}=i,l=[d,t].join(".").replace(/^\./,"");class f{constructor(t){a(this,"CONSTRUCTOR_ID",o),a(this,"SUBCLASS_OF_ID",r),a(this,"className",l),a(this,"classType",e),t=t||{},Object.keys(t).forEach((e=>{this[e]=t[e]}))}static fromReader(e){const t={};for(const s in c)if(c.hasOwnProperty(s)){const n=c[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?h(e,n):void 0}else t[s]=h(e,n)}return new f(t)}getBytes(){const e=this.CONSTRUCTOR_ID,t=n.alloc(4);t.writeUInt32LE(e,0);const s=[t];for(const e in c)if(c.hasOwnProperty(e)){if(c[e].isFlag&&(!1===this[e]&&"true"===c[e].type||void 0===this[e]))continue;if(c[e].isVector){c[e].useVectorId&&s.push(n.from("15c4b51c","hex"));const t=n.alloc(4);t.writeInt32LE(this[e].length,0),s.push(t,n.concat(this[e].map((t=>g(t,c[e].type)))))}else if(c[e].flagIndicator)if(Object.values(c).some((e=>e.isFlag))){let e=0;for(const t in c)c[t].isFlag&&(!1===this[t]&&"true"===c[t].type||void 0===this[t]?e|=0:e|=1<<c[t].flagIndex);const t=n.alloc(4);t.writeUInt32LE(e,0),s.push(t)}else s.push(n.alloc(4));else if(s.push(g(this[e],c[e].type)),this[e]&&"function"==typeof this[e].getBytes){let t=c[e].type.charAt(c[e].type.indexOf(".")+1);t=t===t.toUpperCase(),t||s.shift()}}return n.concat(s)}readResult(t){if("request"!==e)throw new Error("`readResult()` called for non-request instance");const s=u.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()}}a(f,"CONSTRUCTOR_ID",o),a(f,"SUBCLASS_OF_ID",r),a(f,"className",l),a(f,"classType",e),d?(s[d]||(s[d]={}),s[d][t]=f):s[t]=f}return s}e.exports=function(){let e;const t=l&&function(){const e=localStorage.getItem(f);return e&&JSON.parse(e)}();return t?e=t:(e=function(){const[e,t]=p(d),[s,n]=p(u);return{constructors:[].concat(e,s),requests:[].concat(t,n)}}(),l&&localStorage.setItem(f,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}(m("constructor",e.constructors),m("request",e.requests))}()},59759:e=>{e.exports="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#5b38c6c1 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> ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# spoiler:flags.2?true id:InputDocument 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#fb52dc99 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?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;\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#4b46c37e 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 = 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#e00998b7 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 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 = 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#9ff3b858 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 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 = 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#96fdbbe9 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 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 = Message;\nmessageService#d3d28540 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 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#dd570bd5 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> 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;\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.2?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#d8f4f0a7 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 gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long = MessageAction;\nmessageActionStarGiftUnique#26077b99 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long = 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.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#acd66c5e 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 = 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#4d975bbc 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 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 premium_gifts:flags.19?Vector<PremiumGiftOption> 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 = 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#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int 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#1b49ec6d flags:# peer:Peer top_msg_id:flags.0?int 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#ea29055d flags:# channel_id:long top_msg_id:flags.0?int messages:Vector<int> = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = 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#5e1b3cb8 flags:# peer:Peer msg_id:int top_msg_id:flags.0?int 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;\nupdateBroadcastRevenueTransactions#dfd961f5 peer:Peer balances:BroadcastRevenueBalances = 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#51ca7aec private:Bool = 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;\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;\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 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;\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#2d65321f 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 = 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;\nphoneCallDiscardReasonAllowGroupCall#afe2b839 encrypted_key:bytes = 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#eed42858 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 conference_call:flags.8?InputGroupCall = PhoneCall;\nphoneCallRequested#45361c63 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall;\nphoneCallAccepted#22fd7181 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol conference_call:flags.8?InputGroupCall = PhoneCall;\nphoneCall#3ba5940c flags:# p2p_allowed:flags.5?true video:flags.6?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 conference_call:flags.8?InputGroupCall = PhoneCall;\nphoneCallDiscarded#f9d25503 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 conference_call:flags.8?InputGroupCall = 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;\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 = 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;\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#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = 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#734c4ccb 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 = 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#afbc09db 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 = 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#cdf8d3e3 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 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 conference_from_call:flags.14?long = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = 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#4d93a990 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 = SponsoredMessage;\nmessages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?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#25d8c1d8 flags:# hide_name:flags.0?true include_upgrade:flags.2?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice;\ninputInvoiceStarGiftUpgrade#5ebe7262 flags:# keep_original_details:flags.0?true msg_id:int = InputInvoice;\ninputInvoiceStarGiftTransfer#ae3ba9ed msg_id:int to_id:InputUser = 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;\npremiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption;\npaymentFormMethod#88f8f21b url:string title:string = PaymentFormMethod;\nemojiStatusEmpty#2de11aae = EmojiStatus;\nemojiStatus#929b619d document_id:long = EmojiStatus;\nemojiStatusUntil#fa30a8c7 document_id:long until: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#79b26a24 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 = 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#22c0f6d5 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 = InputReplyTo;\ninputReplyToStory#5881323a peer:InputPeer story_id:int = 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;\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;\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#bd068601 flags:# can_reply:flags.0?true bot_id:long recipients:BusinessBotRecipients = 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#896433b4 flags:# can_reply:flags.0?true disabled:flags.1?true connection_id:string user_id:long dc_id:int date:int = 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;\nstats.broadcastRevenueStats#5407e297 top_hours_graph:StatsGraph revenue_graph:StatsGraph balances:BroadcastRevenueBalances usd_rate:double = stats.BroadcastRevenueStats;\nstats.broadcastRevenueWithdrawalUrl#ec659737 url:string = stats.BroadcastRevenueWithdrawalUrl;\nbroadcastRevenueTransactionProceeds#557e2cc4 amount:long from_date:int to_date:int = BroadcastRevenueTransaction;\nbroadcastRevenueTransactionWithdrawal#5a590978 flags:# pending:flags.0?true failed:flags.2?true amount:long date:int provider:string transaction_date:flags.1?int transaction_url:flags.1?string = BroadcastRevenueTransaction;\nbroadcastRevenueTransactionRefund#42d30d2e amount:long date:int provider:string = BroadcastRevenueTransaction;\nstats.broadcastRevenueTransactions#87158466 count:int transactions:Vector<BroadcastRevenueTransaction> = stats.BroadcastRevenueTransactions;\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;\nbroadcastRevenueBalances#c3ff71e7 flags:# withdrawal_enabled:flags.0?true current_balance:long available_balance:long overall_revenue:long = BroadcastRevenueBalances;\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#64dfc926 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 id:string stars: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 = 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#c92bb73b 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#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift;\nstarGiftUnique#6a1407cd id:long title:string num:int owner_id:long attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int = StarGift;\npayments.starGiftsNotModified#a388a368 = payments.StarGifts;\npayments.starGifts#901689ea hash:int gifts:Vector<StarGift> = payments.StarGifts;\nuserStarGift#325835e1 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long = UserStarGift;\npayments.userStarGifts#6b65b517 flags:# count:int gifts:Vector<UserStarGift> next_offset:flags.0?string users:Vector<User> = payments.UserStarGifts;\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;\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#94271762 name:string center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute;\nstarGiftAttributeOriginalDetails#c02c4f4b flags:# sender_id:flags.0?long recipient_id:long date:int message:flags.1?TextWithEntities = StarGiftAttribute;\npayments.starGiftUpgradePreview#167bd90b sample_attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradePreview;\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.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;\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;\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#983f9745 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 = Updates;\nmessages.sendMedia#7852834e 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 = Updates;\nmessages.forwardMessages#d5039208 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 schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = 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#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;\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#3ebee86a 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 = 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#d372c5ce 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 = 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#37b74355 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 = Updates;\nmessages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true 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#ee22b9a8 flags:# peer:InputPeer top_msg_id:flags.0?int = 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#3223495b 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.readReactions#54aa7f8e flags:# peer:InputPeer top_msg_id:flags.0?int = 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#5381d21a flags:# exclude_pinned:flags.0?true offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.SavedDialogs;\nmessages.getSavedHistory#3d9a414d 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#6e98102b flags:# 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.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#9dd6a67b flags:# peer:InputPeer msg_id:int count:int random_id:long private:flags.0?Bool = Updates;\nmessages.getPaidReactionPrivacy#472455aa = Updates;\nmessages.viewSponsoredMessage#673ad8f1 peer:InputPeer random_id:bytes = Bool;\nmessages.clickSponsoredMessage#f093465 flags:# media:flags.0?true fullscreen:flags.1?true peer:InputPeer random_id:bytes = Bool;\nmessages.reportSponsoredMessage#1af3dbb8 peer:InputPeer random_id:bytes option:bytes = channels.SponsoredMessageReportResult;\nmessages.getSponsoredMessages#9bd2f439 peer:InputPeer = messages.SponsoredMessages;\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#dc770ee peer:InputPeer = channels.SendAsPeers;\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#a4298b29 channel:InputChannel enabled: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#d19f987b hashtag:string offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\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.checkDownloadFileParams#50077589 bot:InputUser file_name:string url:string = Bool;\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#104fcfa7 peer:InputPeer = payments.StarsStatus;\npayments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?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#27842d2e 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.getUserStarGifts#5e72c7e1 user_id:InputUser offset:string limit:int = payments.UserStarGifts;\npayments.saveStarGift#92fd2aae flags:# unsave:flags.0?true msg_id:int = Bool;\npayments.convertStarGift#72770c83 msg_id:int = Bool;\nphone.requestCall#a6c4600c flags:# video:flags.0?true user_id:InputUser conference_call:flags.1?InputGroupCall 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#d61e1df3 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string key_fingerprint:flags.3?long 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;\nstats.getBroadcastRevenueStats#f788ee19 flags:# dark:flags.0?true peer:InputPeer = stats.BroadcastRevenueStats;\nstats.getBroadcastRevenueWithdrawalUrl#9df4faad peer:InputPeer password:InputCheckPasswordSRP = stats.BroadcastRevenueWithdrawalUrl;\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;\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;"},31187:(e,t,s)=>{var n=s(48287).hp;function a(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const{inflate:i}=s(87784),{serializeBytes:o}=s(43355);class r{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 r(t).toBytes();if(e.length<t.length)return e}return t}static gzip(e){return n.from(e)}static ungzip(e){return n.from(i(e))}static read(e){if(e.readInt(!1)!==r.CONSTRUCTOR_ID)throw new Error("not equal");return r.gzip(e.tgReadBytes())}static async fromReader(e){return new r(await r.ungzip(e.tgReadBytes()))}async toBytes(){const e=n.alloc(4);return e.writeUInt32LE(r.CONSTRUCTOR_ID,0),n.concat([e,o(await r.gzip(this.data))])}}a(r,"CONSTRUCTOR_ID",812830625),a(r,"classType","constructor"),e.exports=r},30293:(e,t,s)=>{function n(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const a=s(61028);class i{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(),i=e.readInt(),o=e.tellPosition(),r=e.tgReadObject();e.setPosition(o+i);const c=new a(s,n,r);t.push(c)}return new i(t)}}n(i,"CONSTRUCTOR_ID",1945237724),n(i,"classType","constructor"),n(i,"MAXIMUM_SIZE",1044448),n(i,"MAXIMUM_LENGTH",100),e.exports=i},9309:(e,t,s)=>{function n(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const{RpcError:a}=s(43355).constructors,i=s(31187);class o{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===a.CONSTRUCTOR_ID?new o(t,void 0,a.fromReader(e)):s===i.CONSTRUCTOR_ID?new o(t,(await i.fromReader(e)).data):(e.seek(-4),new o(t,e.read(),void 0))}}n(o,"CONSTRUCTOR_ID",4082920705),n(o,"classType","constructor"),e.exports=o},61028:e=>{function t(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class s{constructor(e,t,s){this.msgId=e,this.seqNo=t,this.obj=s,this.classType="constructor"}}t(s,"SIZE_OVERHEAD",12),t(s,"classType","constructor"),e.exports=s},48075:(e,t,s)=>{const n=s(61028),a=s(9309),i=s(30293),o=s(31187),r={[a.CONSTRUCTOR_ID]:a,[o.CONSTRUCTOR_ID]:o,[i.CONSTRUCTOR_ID]:i};e.exports={TLMessage:n,RPCResult:a,MessageContainer:i,GZIPPacked:o,coreObjects:r}},73192:(e,t,s)=>{var n=s(48287).hp;const a=e=>e.replace(/(?:^|_)([a-z])/g,((e,t)=>t.toUpperCase())).replace(/_/g,""),i=e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),o=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),r=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]);let c;function d(e){c||(c=function(){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}()),n.isBuffer(e)||(e=n.from(e));let t=-1;for(let s=0;s<e.length;s++){const n=e[s];t=c[255&(t^n)]^t>>>8}return~t>>>0}const u=(e,t,s=[])=>{e.flags.includes("g")||(e=new RegExp(e.source,"g"));const n=e.exec(t);return n&&(s.push(n.slice(1)),u(e,t,s)),s},l=(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 o=u(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),r={name:s[1],constructorId:parseInt(s[2],16),argsConfig:{},subclassOfId:d(s[3]),result:s[3],isFunction:t,namespace:void 0};if(!r.constructorId){const e="";let t;t=Object.values(r.argsConfig).length?` ${Object.keys(r.argsConfig).map((e=>e.toString())).join(" ")}`:"";const s=`${r.name}${e}${t} = ${r.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/</g," ").replace(/>|{|}/g,"").replace(/ \w+:flags\d*\.\d+\?true/g,"");"inputMediaInvoice"===r.name&&r.name,r.constructorId=d(n.from(s,"utf8"))}for(const[e,t,s]of o)void 0===e&&(r.argsConfig[i(t)]=f(t,s));return r.name.includes(".")&&([r.namespace,r.name]=r.name.split(/\.(.+)/)),r.name=a(r.name),r};function f(e,t){e="self"===e?"is_self":e;const s={isVector:!1,isFlag:!1,skipConstructorId:!1,flagGroup:0,flagIndex:-1,flagIndicator:!0,type:void 0,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}e.exports={findAll:u,parseTl:function*(e,t=[],s=o){(t||[]).reduce(((e,t)=>({...e,[t.name]:t})),{});const n=[],a={},i={},c=e;let d=!1;for(let e of c.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;d="functions"===e}else try{const t=l(e,d);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(r.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},buildArgConfig:f,fromLine:l,CORE_TYPES:o,serializeDate:function(e){if(!e)return n.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=n.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)},serializeBytes:function(e){if(!(e instanceof n)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=n.from(e)}const t=[];let s;return e.length<254?(s=(e.length+1)%4,0!==s&&(s=4-s),t.push(n.from([e.length])),t.push(e)):(s=e.length%4,0!==s&&(s=4-s),t.push(n.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(n.alloc(s).fill(0)),n.concat(t)},snakeToCamelCase:a,variableSnakeToCamelCase:i}},43355:(e,t,s)=>{const n=s(96847),{serializeBytes:a,serializeDate:i}=s(73192);e.exports={constructors:n,requests:n,serializeBytes:a,serializeDate:i}},68656:e=>{e.exports="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<future_salt> = 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;"},9705:(e,t,s)=>{"use strict";function n(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}s.d(t,{A:()=>a});class a{constructor(){n(this,"promise",void 0),n(this,"reject",void 0),n(this,"resolve",void 0),this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}static resolved(e){const t=new a;return t.resolve(e),t}}},84846:(e,t,s)=>{"use strict";s.d(t,{j:()=>i});var n=s(9705);function a(e,t,s){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var n=s.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class i{constructor(e){this.maxWorkers=e,a(this,"deferreds",[]),a(this,"priorityDeferreds",[]),a(this,"activeWorkers",0)}requestWorker(e){if(this.activeWorkers===this.maxWorkers){const t=new n.A;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}}}},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,[7784,8287,3046],(()=>a(93229)));return a.O(e)},e=[],a.O=(t,s,n,i)=>{if(!s){var o=1/0;for(u=0;u<e.length;u++){for(var[s,n,i]=e[u],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(u--,1);var d=n();void 0!==d&&(t=d)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[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+"."+{3046:"1fba2d7e327c53d1e37e",7784:"4e167a928464165e6412",8287:"9cf863b4d9b47c10d271"}[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&&(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(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={3229: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([7784,8287,3046].map(a.e,a)).then(t),a.x()})();
|
||
//# sourceMappingURL=3229.e261ca8be078a4517e9a.js.map
|