mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-04 18:50:31 +01:00
2 lines
208 KiB
JavaScript
2 lines
208 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{104:function(e,t,a){"use strict";a.r(t),a.d(t,"Main",(function(){return Tn}));var s=a(2),n=a(1),c=a(0),r=(a(84),a(37)),o=a(6);window.addEventListener("popstate",e=>{if(!e.state)return;const{chatId:t,threadId:a,messageListType:n}=e.state;Object(s.d)().openChat({id:t,threadId:a,type:n,noPushState:!0})}),Object(s.b)("openChat",(e,t,a)=>{const{id:n,threadId:c=-1,type:i="thread",noPushState:l}=a,d=Object(o.y)(e);return d&&d.chatId===n&&d.threadId===c&&d.type===i||(e=Object(r.n)(e),e={...e,messages:{...e.messages,contentToBeScheduled:void 0},...n!==e.forwardMessages.toChatId&&{forwardMessages:{}}},Object(s.g)(e),l||window.history.pushState({chatId:n,threadId:c,messageListType:i},"")),Object(r.N)(e,n,c,i)}),Object(s.b)("openChatWithInfo",(e,t,a)=>{Object(s.g)({...e,isChatInfoShown:!0}),t.openChat(a)}),Object(s.b)("resetChatCreation",e=>({...e,chatCreation:void 0}));var i=a(5),l=a(20),d=a(3);let b;Object(s.b)("setScrollOffset",(e,t,a)=>{const{chatId:s,threadId:n,scrollOffset:c}=a;return Object(r.x)(e,s,n,"scrollOffset",c)}),Object(s.b)("setReplyingToId",(e,t,a)=>{const{messageId:s}=a,n=Object(o.y)(e);if(!n)return;const{chatId:c,threadId:i}=n;return Object(r.x)(e,c,i,"replyingToId",s)}),Object(s.b)("setEditingId",(e,t,a)=>{const{messageId:s}=a,n=Object(o.y)(e);if(!n)return;const{chatId:c,threadId:i,type:l}=n,d="scheduled"===l?"editingScheduledId":"editingId";return Object(r.x)(e,c,i,d,s)}),Object(s.b)("editLastMessage",e=>{const{chatId:t,threadId:a}=Object(o.y)(e)||{};if(!t||!a)return;const s=Object(o.m)(e,t),n=Object(o.Hb)(e,t,a);if(!s||!n)return;const c=Object(d.g)(n,t=>Boolean(s[t]&&Object(o.b)(e,s[t],a).canEdit));return c?Object(r.x)(e,t,a,"editingId",c):void 0}),Object(s.b)("replyToNextMessage",(e,t,a)=>{const{targetIndexDelta:s}=a,{chatId:n,threadId:c}=Object(o.y)(e)||{};if(!n||!c)return;const r=Object(o.m)(e,n),l=Object(o.Hb)(e,n,c);if(!r||!l)return;const d=Object(o.mb)(e,n,c);let b;if(Object(o.X)(e,n,c)&&d){const e=Object.keys(r),t=e.indexOf(d.toString())+s;b=t<=e.length+1&&t>=0?Number(e[t]):void 0}else if(c===i.MAIN_THREAD_ID){const t=Object(o.f)(e,n);b=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(o.Cb)(e,n,c);b=t?t.lastMessageId:void 0}t.setReplyingToId({messageId:b}),t.focusMessage({chatId:n,threadId:c,messageId:b})}),Object(s.b)("openMediaViewer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c,avatarOwnerId:r,profilePhotoIndex:o,origin:i}=a;return{...e,mediaViewer:{chatId:s,threadId:n,messageId:c,avatarOwnerId:r,profilePhotoIndex:o,origin:i},forwardMessages:{}}}),Object(s.b)("closeMediaViewer",e=>({...e,mediaViewer:{}})),Object(s.b)("openAudioPlayer",(e,t,a)=>{const{chatId:s,threadId:n,messageId:c}=a;return{...e,audioPlayer:{chatId:s,threadId:n,messageId:c}}}),Object(s.b)("closeAudioPlayer",e=>({...e,audioPlayer:{}})),Object(s.b)("openPollResults",(e,t,a)=>{const{chatId:n,messageId:c}=a;Object(o.W)(e)?n===e.pollResults.chatId&&c===e.pollResults.messageId||Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}}):window.setTimeout(()=>{const e=Object(s.e)();Object(s.g)({...e,pollResults:{chatId:n,messageId:c,voters:{}}})},450)}),Object(s.b)("closePollResults",e=>{Object(s.g)({...e,pollResults:{}})}),Object(s.b)("focusLastMessage",(e,t)=>{const a=Object(o.y)(e);if(!a)return;const{chatId:s,threadId:n}=a;let c;if(n===i.MAIN_THREAD_ID){const t=Object(o.f)(e,s);c=t&&t.lastMessage?t.lastMessage.id:void 0}else{const t=Object(o.Cb)(e,s,n);c=t?t.lastMessageId:void 0}c&&t.focusMessage({chatId:s,threadId:n,messageId:c,noHighlight:!0})}),Object(s.b)("focusMessage",(e,t,a)=>{const{chatId:n,threadId:c=i.MAIN_THREAD_ID,messageListType:d="thread",noHighlight:u,groupedId:m,groupedChatId:h}=a;let{messageId:O}=a;if(void 0!==m){const t=Object(o.J)(e,h,m);t&&t.length&&([O]=t)}const j=Object(o.y)(e),g=!j||n!==j.chatId||c!==j.threadId||d!==j.type;b&&(clearTimeout(b),b=void 0),b=window.setTimeout(()=>{let e=Object(s.e)();e=Object(r.P)(e),e=Object(r.O)(e),Object(s.g)(e)},2e3),e=Object(r.P)(e,n,O,u),e=Object(r.O)(e,void 0),g&&(e=Object(r.O)(e,l.b.Static));const f=Object(o.Hb)(e,n,c);if(f&&f.includes(O))return Object(s.g)(e),void t.openChat({id:n,threadId:c});if(g&&(e=Object(r.x)(e,n,c,"viewportIds",void 0)),e=Object(r.x)(e,n,c,"outlyingIds",void 0),f&&!g){const t=O>f[0]?l.b.Down:l.b.Up;e=Object(r.O)(e,t)}Object(s.g)(e),t.openChat({id:n,threadId:c}),t.loadViewportMessages()}),Object(s.b)("openForwardMenu",(e,t,a)=>{const{fromChatId:s,messageIds:n,groupedId:c}=a;let r;return c&&(r=Object(o.ab)(e,s,c)),{...e,forwardMessages:{fromChatId:s,messageIds:r||n,isModalShown:!0}}}),Object(s.b)("exitForwardMode",e=>{Object(s.g)({...e,forwardMessages:{}})}),Object(s.b)("setForwardChatId",(e,t,a)=>{const{id:n}=a;Object(s.g)({...e,forwardMessages:{...e.forwardMessages,toChatId:n,isModalShown:!1}}),t.openChat({id:n}),t.closeMediaViewer(),t.exitMessageSelectMode()}),Object(s.b)("openForwardMenuForSelectedMessages",(e,t)=>{if(!e.selectedMessages)return;const{chatId:a,messageIds:s}=e.selectedMessages;t.openForwardMenu({fromChatId:a,messageIds:s})}),Object(s.b)("enterMessageSelectMode",(e,t,a)=>{const{messageId:s}=a||{},n=Object(o.r)(e);return n?Object(r.m)(e,n.id,s):e}),Object(s.b)("toggleMessageSelection",(e,t,a)=>{const{messageId:s,groupedId:n,childMessageIds:c,withShift:i}=a,l=Object(o.y)(e);if(!l)return;const{chatId:d,threadId:b,type:u}=l;return Object(r.G)(e,d,b,u,s,n,c,i)}),Object(s.b)("exitMessageSelectMode",r.n),Object(s.b)("openPollModal",e=>({...e,isPollModalOpen:!0})),Object(s.b)("closePollModal",e=>({...e,isPollModalOpen:!1}));Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{query:s}=a,{chatId:n}=e.globalSearch;return Object(r.R)(e,{globalResults:{},localResults:{},resultsByType:void 0,...s?{fetchingStatus:{chats:!n,messages:!0}}:{fetchingStatus:void 0},query:s})}),Object(s.b)("addRecentlyFoundChatId",(e,t,a)=>{const{id:s}=a,{recentlyFoundChatIds:n}=e.globalSearch;if(!n)return Object(r.R)(e,{recentlyFoundChatIds:[s]});const c=n.filter(e=>e!==s);return c.unshift(s),c.length>10&&c.pop(),Object(r.R)(e,{recentlyFoundChatIds:c})}),Object(s.b)("clearRecentlyFoundChats",e=>Object(r.R)(e,{recentlyFoundChatIds:void 0})),Object(s.b)("setGlobalSearchContent",(e,t,a)=>{const{content:s}=a;return Object(r.S)(e,s)}),Object(s.b)("setGlobalSearchChatId",(e,t,a)=>{const{id:s}=a;return Object(r.R)(e,{chatId:s,query:void 0,resultsByType:void 0})});var u=a(50),m=a(4);Object(s.b)("openLocalTextSearch",e=>{const{chatId:t,threadId:a}=Object(o.y)(e)||{};if(t&&a)return Object(r.Y)(e,t,a,!0)}),Object(s.b)("closeLocalTextSearch",e=>{const{chatId:t,threadId:a}=Object(o.y)(e)||{};if(t&&a)return e=Object(r.Y)(e,t,a,!1),e=Object(r.t)(e,t,a,void 0)}),Object(s.b)("setLocalTextSearchQuery",(e,t,a)=>{const{chatId:s,threadId:n}=Object(o.y)(e)||{};if(!s||!n)return;const{query:c}=a,i=Object(m.a)(s,n),{query:l}=e.localTextSearch.byChatThreadKey[i]||{};return c!==l&&(e=Object(r.t)(e,s,n,u.a)),e=Object(r.Y)(e,s,n,!0,c)}),Object(s.b)("setLocalMediaSearchType",(e,t,a)=>{const{chatId:s}=Object(o.y)(e)||{};if(!s)return;const{mediaType:n}=a;return Object(r.X)(e,s,n)}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,stickers:{...e.stickers,search:{query:s,resultIds:void 0}}}}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;return{...e,gifs:{...e.gifs,search:{query:s,offsetId:void 0,results:void 0}}}}),Object(s.b)("openUserInfo",(e,t,a)=>{const{id:s}=a;t.openChat({id:s})});Object(s.b)("openChat",e=>Object(r.fb)(e,void 0)),Object(s.b)("setSettingOption",(e,t,a)=>Object(r.v)(e,a)),Object(s.b)("setThemeSettings",(e,t,a)=>{const{theme:s,...n}=a;return Object(r.w)(e,s,n)});var h=a(7),O=a(169);Object(s.b)("toggleChatInfo",e=>({...e,isChatInfoShown:!e.isChatInfoShown})),Object(s.b)("toggleManagement",e=>{const{chatId:t}=Object(o.y)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!(e.management.byChatId[t]||{}).isActive}}}}}),Object(s.b)("closeManagement",e=>{const{chatId:t}=Object(o.y)(e)||{};if(t)return{...e,management:{byChatId:{...e.management.byChatId,[t]:{...e.management.byChatId[t],isActive:!1}}}}}),Object(s.b)("openChat",(e,t,a)=>{if(!h.g)return;const{id:s}=a;return{...e,isLeftColumnShown:void 0===s}}),Object(s.b)("toggleLeftColumn",e=>({...e,isLeftColumnShown:!e.isLeftColumnShown})),Object(s.b)("addRecentEmoji",(e,t,a)=>{const{emoji:s}=a,{recentEmojis:n}=e;if(!n)return{...e,recentEmojis:[s]};const c=n.filter(e=>e!==s);return c.unshift(s),c.length>18&&c.pop(),{...e,recentEmojis:c}}),Object(s.b)("addRecentSticker",(e,t,a)=>{const{sticker:s}=a,{recent:n}=e.stickers;if(!n)return{...e,stickers:{...e.stickers,recent:{hash:0,stickers:[s]}}};const c=n.stickers.filter(e=>e.id!==s.id);return c.unshift(s),{...e,stickers:{...e.stickers,recent:{...n,stickers:c}}}}),Object(s.b)("showNotification",(e,t,a)=>{const s=a,n=[...e.notifications],c=n.findIndex(e=>e.message===s.message);return-1!==c&&n.splice(c,1),n.push(s),{...e,notifications:n}}),Object(s.b)("dismissNotification",e=>{const t=[...e.notifications];return t.pop(),{...e,notifications:t}}),Object(s.b)("showError",(e,t,a)=>{const{error:s}=a;if(!Object(O.a)(s))return e;const n=[...e.errors],c=n.findIndex(e=>e.message===s.message);return-1!==c&&n.splice(c,1),n.push(s),{...e,errors:n}}),Object(s.b)("dismissError",e=>{const t=[...e.errors];return t.pop(),{...e,errors:t}}),Object(s.b)("toggleSafeLinkModal",(e,t,a)=>{const{url:s}=a;return{...e,safeLinkModalUrl:s}}),Object(s.b)("openHistoryCalendar",(e,t,a)=>{const{selectedAt:s}=a;return{...e,historyCalendarSelectedAt:s}}),Object(s.b)("closeHistoryCalendar",e=>({...e,historyCalendarSelectedAt:void 0})),Object(s.b)("openPaymentModal",(e,t,a)=>{const{messageId:s}=a;return{...e,payment:{...e.payment,messageId:s,isPaymentModalOpen:!0}}}),Object(s.b)("closePaymentModal",e=>{const t=Object(r.h)(e);return Object(r.i)(t)});a(85);var j=a(10),g=a(9);const f=Object(g.g)(e=>e(),1e3,!0),p=Object(g.g)(e=>e(),3e3,!0),I=Object(g.a)(e=>e(),500,!1,!0);async function v(e,t,a){const c=await Object(j.a)("fetchChats",{limit:n.j,offsetDate:a,archived:"archived"===e,withPinned:void 0===Object(s.e)().chats.orderedPinnedIds[e]});if(!c)return;const{chatIds:o}=c;o.length>0&&o[0]===t&&o.shift();let l=Object(s.e)();l=Object(r.f)(l,Object(d.c)(c.users,"id")),l=Object(r.M)(l,Object(d.c)(c.chats,"id")),l=Object(r.I)(l,e,o),l=Object(r.J)(l,e,c),Object.keys(c.draftsById).map(Number).forEach(e=>{l=Object(r.x)(l,e,i.MAIN_THREAD_ID,"draft",c.draftsById[e])}),Object.keys(c.replyingToById).map(Number).forEach(e=>{l=Object(r.x)(l,e,i.MAIN_THREAD_ID,"replyingToId",c.replyingToById[e])}),0!==o.length||l.chats.isFullyLoaded[e]||(l={...l,chats:{...l.chats,isFullyLoaded:{...l.chats.isFullyLoaded,[e]:!0}}}),Object(s.g)(l)}async function y(e){const t=await Object(j.a)("fetchFullChat",e);if(!t)return;const{users:a,fullInfo:n}=t;let c=Object(s.e)();a&&(c=Object(r.f)(c,Object(d.c)(a,"id"))),c=Object(r.H)(c,e.id,{fullInfo:n}),Object(s.g)(c)}async function C(e,t,a){const n=Object(s.e)(),c=Object(o.h)(n,t);if(c&&!c.isMin)return void(a?e.focusMessage({chatId:c.id,messageId:a}):e.openChat({id:c.id}));const i=Object(o.r)(n);e.openChat({id:-1});const l=await Object(j.a)("getChatByUsername",t);if(!l)return i&&e.openChat({id:i.id}),void e.showNotification({message:"User does not exist"});Object(s.g)(Object(r.H)(Object(s.e)(),l.id,l)),a?e.focusMessage({chatId:l.id,messageId:a}):e.openChat({id:l.id})}Object(s.b)("preloadTopChatMessages",(e,t)=>{(async()=>{const a=[];for(let c=0;c<n.Db;c++){await Object(g.e)(100);const{byId:n,listIds:{active:c},orderedPinnedIds:{active:r}}=Object(s.e)().chats;if(!c)return;const{chatId:l}=Object(o.y)(e)||{},{pinnedChats:d,otherChats:b}=Object(m.Ab)(n,c,r),u=[...d,...b].find(({id:e})=>e!==l&&!a.includes(e));if(!u)return;a.push(u.id),t.loadViewportMessages({chatId:u.id,threadId:i.MAIN_THREAD_ID})}})()}),Object(s.b)("openChat",(e,t,a)=>{const{id:s,threadId:n}=a,{currentUserId:c}=e,r=Object(o.f)(e,s);if(r&&r.hasUnreadMark&&t.toggleChatUnread({id:s}),r)Object(m.mb)(r)&&!r.isMin&&t.requestChatUpdate({chatId:s});else if(s===c)Object(j.a)("fetchChat",{type:"self"});else{const t=Object(o.Gb)(e,s);t&&Object(j.a)("fetchChat",{type:"user",user:t})}if(n!==i.MAIN_THREAD_ID){Object(o.Eb)(e,s,n)||t.requestThreadInfoUpdate({chatId:s,threadId:n})}}),Object(s.b)("openSupportChat",(e,t)=>{const a=Object(o.Ab)(e);t.openChat({id:a?a.id:-1}),a||(async()=>{const e=await Object(j.a)("fetchChat",{type:"support"});e&&t.openChat({id:e.chatId})})()}),Object(s.b)("openTipsChat",(e,t)=>{t.openChatByUsername({username:n.Cb})}),Object(s.b)("loadMoreChats",(e,t,a)=>{const{listType:s="active"}=a,n=e.chats.listIds[s];if(e.chats.isFullyLoaded[s])return;const c=n?n.map(t=>e.chats.byId[t]).filter(t=>Boolean(t&&t.lastMessage)&&!Object(o.N)(e,t.id)).sort((e,t)=>e.lastMessage.date-t.lastMessage.date)[0]:void 0;f(c?()=>v(s,c.id,c.lastMessage.date):()=>v(s))}),Object(s.b)("loadFullChat",(e,t,a)=>{const{chatId:s,force:n}=a,c=Object(o.f)(e,s);c&&(n?y(c):I(()=>y(c)))}),Object(s.b)("loadTopChats",()=>{p(()=>v("active"))}),Object(s.b)("requestChatUpdate",(e,t,a)=>{const{chatId:s}=a,n=Object(o.f)(e,s);n&&Object(j.a)("requestChatUpdate",n)}),Object(s.b)("updateChatMutedState",(e,t,a)=>{const{chatId:s,isMuted:n}=a,c=Object(o.f)(e,s);c&&Object(j.a)("updateChatMutedState",{chat:c,isMuted:n})}),Object(s.b)("createChannel",(e,t,a)=>{const{title:n,about:c,photo:i,memberIds:d}=a;!async function(e,t,a,n){Object(s.g)({...Object(s.e)(),chatCreation:{progress:l.a.InProgress}});const c=await Object(j.a)("createChannel",{title:e,about:a,users:t});if(!c)return;const{id:o,accessHash:i}=c;let d=Object(s.e)();d=Object(r.H)(d,o,c),d={...d,chatCreation:{...d.chatCreation,progress:c?l.a.Complete:l.a.Error}},Object(s.g)(d),Object(s.d)().openChat({id:o}),o&&i&&n&&await Object(j.a)("editChatPhoto",{chatId:o,accessHash:i,photo:n})}(n,d.map(t=>Object(o.Gb)(e,t)).filter(Boolean),c,i)}),Object(s.b)("joinChannel",(e,t,a)=>{const{chatId:s}=a,n=Object(o.f)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&Object(j.a)("joinChannel",{channelId:c,accessHash:r})}),Object(s.b)("leaveChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(o.f)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&await Object(j.a)("leaveChannel",{channelId:c,accessHash:r}),t.openChat({id:void 0})})()}),Object(s.b)("deleteChannel",(e,t,a)=>{(async()=>{const{chatId:s}=a,n=Object(o.f)(e,s);if(!n)return;const{id:c,accessHash:r}=n;c&&r&&await Object(j.a)("deleteChannel",{channelId:c,accessHash:r}),t.openChat({id:void 0})})()}),Object(s.b)("createGroupChat",(e,t,a)=>{const{title:n,memberIds:c,photo:i}=a;!async function(e,t,a){Object(s.g)({...Object(s.e)(),chatCreation:{progress:l.a.InProgress}});const n=await Object(j.a)("createGroupChat",{title:e,users:t});if(!n)return;const{id:c}=n;let o=Object(s.e)();o=Object(r.H)(o,c,n),o={...o,chatCreation:{...o.chatCreation,progress:n?l.a.Complete:l.a.Error}},Object(s.g)(o),Object(s.d)().openChat({id:c}),c&&a&&await Object(j.a)("editChatPhoto",{chatId:c,photo:a})}(n,c.map(t=>Object(o.Gb)(e,t)).filter(Boolean),i)}),Object(s.b)("toggleChatPinned",(e,t,a)=>{const{id:s,folderId:c}=a,r=Object(o.f)(e,s);if(r)if(c){const t=Object(o.i)(e,c);if(t){const a=!Object(o.N)(e,s,c),{pinnedChatIds:n,includedChatIds:r}=t,i=a?[s,...n||[]]:(n||[]).filter(e=>e!==s),l=[s,...r];Object(j.a)("editChatFolder",{id:c,folderUpdate:{...t,pinnedChatIds:i,includedChatIds:l}})}}else{const t=Object(o.j)(e,s),a=Object(o.N)(e,s,"archived"===t?n.h:void 0);Object(j.a)("toggleChatPinned",{chat:r,shouldBePinned:!a})}}),Object(s.b)("toggleChatArchived",(e,t,a)=>{const{id:s}=a,c=Object(o.f)(e,s);c&&Object(j.a)("toggleChatArchived",{chat:c,folderId:Object(m.hb)(c)?0:n.h})}),Object(s.b)("loadChatFolders",()=>{!async function(){const e=await Object(j.a)("fetchChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,...e}})}}()}),Object(s.b)("loadRecommendedChatFolders",()=>{!async function(){const e=await Object(j.a)("fetchRecommendedChatFolders");if(e){const t=Object(s.e)();Object(s.g)({...t,chatFolders:{...t.chatFolders,recommended:e}})}}()}),Object(s.b)("editChatFolder",(e,t,a)=>{const{id:s,folderUpdate:n}=a,c=Object(o.i)(e,s);c&&Object(j.a)("editChatFolder",{id:s,folderUpdate:{id:s,emoticon:c.emoticon,pinnedChatIds:c.pinnedChatIds,...n}})}),Object(s.b)("addChatFolder",(e,t,a)=>{const{folder:c}=a,{orderedIds:r}=e.chatFolders;!async function(e,t){const{id:a,description:n,...c}=e;if(await Object(j.a)("editChatFolder",{id:t+1,folderUpdate:{id:t+1,...c}}),!n)return;const r=Object(s.e)(),{recommended:o}=r.chatFolders;o&&Object(s.g)({...r,chatFolders:{...r.chatFolders,recommended:o.filter(({id:e})=>e!==a)}})}(c,r&&r.length?Math.max.apply(Math.max,r):n.h)}),Object(s.b)("deleteChatFolder",(e,t,a)=>{const{id:s}=a;Object(o.i)(e,s)&&async function(e){await Object(j.a)("deleteChatFolder",e)}(s)}),Object(s.b)("toggleChatUnread",(e,t,a)=>{const{id:s}=a,n=Object(o.f)(e,s);n&&(n.unreadCount?Object(j.a)("markMessageListRead",{chat:n,threadId:i.MAIN_THREAD_ID}):Object(j.a)("toggleDialogUnread",{chat:n,hasUnreadMark:!n.hasUnreadMark}))}),Object(s.b)("openTelegramLink",(e,t,a)=>{const{url:s}=a;let c=n.hb.exec(s);if(c){const e=c[1];(async()=>{const a=await Object(j.a)("openChatByInvite",e);a&&t.openChat({id:a.id})})()}else{c=n.ib.exec(s);const e=c[1],a=c[2]?Number(c[2]):void 0;C(t,e,a)}}),Object(s.b)("openChatByUsername",(e,t,a)=>{const{username:s}=a;C(t,s)}),Object(s.b)("togglePreHistoryHidden",(e,t,a)=>{const{chatId:s,isEnabled:n}=a;let c=Object(o.f)(e,s);c&&(async()=>{if(Object(m.ib)(c)){if(c=await Object(j.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}Object(j.a)("togglePreHistoryHidden",{chat:c,isEnabled:n})})()}),Object(s.b)("updateChatDefaultBannedRights",(e,t,a)=>{const{chatId:s,bannedRights:n}=a,c=Object(o.f)(e,s);c&&Object(j.a)("updateChatDefaultBannedRights",{chat:c,bannedRights:n})}),Object(s.b)("updateChatMemberBannedRights",(e,t,a)=>{const{chatId:n,userId:c,bannedRights:i}=a;let l=Object(o.f)(e,n);const d=Object(o.Gb)(e,c);l&&d&&(async()=>{if(Object(m.ib)(l)){if(l=await Object(j.a)("migrateChat",l),!l)return;t.openChat({id:l.id})}await Object(j.a)("updateChatMemberBannedRights",{chat:l,user:d,bannedRights:i});const e=Object(s.e)(),a=Object(o.f)(e,n);if(!a||!a.fullInfo)return;const{members:b,kickedMembers:u}=a.fullInfo,h=!!i.viewMessages,O=!Object.keys(i).length;Object(s.g)(Object(r.H)(e,n,{fullInfo:{...a.fullInfo,...b&&h&&{members:b.filter(e=>e.userId!==c)},...b&&!h&&{members:b.map(e=>e.userId===c?{...e,bannedRights:i}:e)},...O&&u&&{kickedMembers:u.filter(e=>e.userId!==c)}}}))})()}),Object(s.b)("updateChatAdmin",(e,t,a)=>{const{chatId:n,userId:c,adminRights:i,customTitle:l}=a;let d=Object(o.f)(e,n);const b=Object(o.Gb)(e,c);d&&b&&(async()=>{if(Object(m.ib)(d)){if(d=await Object(j.a)("migrateChat",d),!d)return;t.openChat({id:d.id})}await Object(j.a)("updateChatAdmin",{chat:d,user:b,adminRights:i,customTitle:l});const e=Object(s.e)(),a=Object(o.f)(e,n);if(!a||!a.fullInfo)return;const{adminMembers:u}=a.fullInfo,h=!Object.keys(i).length;Object(s.g)(Object(r.H)(e,n,{fullInfo:{...a.fullInfo,...u&&h&&{adminMembers:u.filter(e=>e.userId!==c)},...u&&!h&&{adminMembers:u.map(e=>e.userId===c?{...e,adminRights:i,customTitle:l}:e)}}}))})()}),Object(s.b)("updateChat",(e,t,a)=>{const{chatId:n,title:c,about:i,photo:d}=a,b=Object(o.f)(e,n);b&&(async()=>{Object(s.g)(Object(r.bb)(Object(s.e)(),l.f.InProgress)),await Promise.all([b.title!==c?Object(j.a)("updateChatTitle",b,c):void 0,b.fullInfo&&b.fullInfo.about!==i?Object(j.a)("updateChatAbout",b,i):void 0,d?Object(j.a)("editChatPhoto",{chatId:n,accessHash:b.accessHash,photo:d}):void 0]),Object(s.g)(Object(r.bb)(Object(s.e)(),l.f.Complete))})()}),Object(s.b)("toggleSignatures",(e,t,a)=>{const{chatId:s,isEnabled:n}=a,c=Object(o.f)(e,s);c&&Object(j.a)("toggleSignatures",{chat:c,isEnabled:n})}),Object(s.b)("loadGroupsForDiscussion",()=>{(async()=>{const e=await Object(j.a)("fetchGroupsForDiscussion");if(!e)return;const t=e.reduce((e,t)=>(t&&(e[t.id]=t),e),{}),a=Object(r.c)(Object(s.e)(),t);Object(s.g)({...a,chats:{...a.chats,forDiscussionIds:Object.keys(t).map(Number)}})})()}),Object(s.b)("linkDiscussionGroup",(e,t,a)=>{const{channelId:s,chatId:n}=a,c=Object(o.f)(e,s);let r=Object(o.f)(e,n);c&&r&&(async()=>{if(Object(m.ib)(r)){if(r=await Object(j.a)("migrateChat",r),!r)return;t.openChat({id:r.id})}let{fullInfo:e}=r;if(!e){const t=await Object(j.a)("fetchFullChat",r);if(!t)return;e=t.fullInfo}e.isPreHistoryHidden&&await Object(j.a)("togglePreHistoryHidden",{chat:r,isEnabled:!1}),Object(j.a)("setDiscussionGroup",{channel:c,chat:r})})()}),Object(s.b)("unlinkDiscussionGroup",(e,t,a)=>{const{channelId:s}=a,n=Object(o.f)(e,s);if(!n)return;let c;n.fullInfo&&n.fullInfo.linkedChatId&&(c=Object(o.f)(e,n.fullInfo.linkedChatId)),(async()=>{await Object(j.a)("setDiscussionGroup",{channel:n}),c&&y(c)})()}),Object(s.b)("setActiveChatFolder",(e,t,a)=>({...e,chatFolders:{...e.chatFolders,activeChatFolder:a}})),Object(s.b)("loadMoreMembers",e=>{(async()=>{const{chatId:t}=Object(o.y)(e)||{},a=t?Object(o.f)(e,t):void 0;if(!a||Object(m.ib)(a))return;const n=a.fullInfo&&a.fullInfo.members&&a.fullInfo.members.length||void 0,c=await Object(j.a)("fetchMembers",a.id,a.accessHash,"recent",n);if(!c)return;const{members:i,users:l}=c;i&&i.length&&(e=Object(s.e)(),e=Object(r.f)(e,Object(d.c)(l,"id")),e=Object(r.H)(e,a.id,{fullInfo:{...a.fullInfo,members:[...(a.fullInfo||{}).members||[],...i||[]]}}),Object(s.g)(e))})()});var E=a(153);const w=new Map,M=Object(g.g)(e=>e(),1e3,!0);async function S(e,t,a,c,i=!1,b=!1){const u=e.id;let m;switch(c){case l.e.Backwards:m=void 0;break;case l.e.Around:m=-(Math.round(n.V/2)+1);break;case l.e.Forwards:m=-(n.V+1)}const h=await Object(j.a)("fetchMessages",{chat:Object(o.Db)(Object(s.e)(),u,t),offsetId:a,addOffset:m,limit:n.V,threadId:t});if(!h)return;const{messages:O,users:g,chats:f,threadInfos:p}=h,I=Object(d.c)(O,"id"),v=Object.keys(I).map(Number);let y=Object(s.e)();y=Object(r.b)(y,u,I),y=i?Object(r.db)(y,u,t,v):Object(r.V)(y,u,t,v),y=Object(r.f)(y,Object(d.c)(g,"id")),y=Object(r.c)(y,Object(d.c)(f,"id")),y=Object(r.lb)(y,u,p);let C=Object(o.Y)(y,u,t);const E=Object(o.gb)(y,u,t);if(i&&C&&E&&Object(d.b)(C,E)&&(y=Object(r.V)(y,u,t,E),C=Object(o.Y)(y,u,t),y=Object(r.x)(y,u,t,"outlyingIds",void 0),i=!1),!b){const e=i?E:C,{newViewportIds:s}=k(e,a,c);y=Object(r.z)(y,u,t,s)}Object(s.g)(y)}function k(e,t,a){const{length:s}=e,c=t?function(e,t){return t<e[0]?0:t>e[e.length-1]?e.length-1:e.findIndex((a,s)=>a===t||a<t&&e[s+1]>t)}(e,t):-1,r=a===l.e.Backwards?c:c+1||s,o=r-n.V,i=r+n.V-1,d=e.slice(Math.max(0,o),i+1);let b,u;switch(a){case l.e.Backwards:b=r>0,u=o>=0;break;case l.e.Forwards:b=r<s,u=i<=s-1;break;case l.e.Around:default:b=d.length>0,u=d.length===n.V}return{newViewportIds:d,areSomeLocal:b,areAllLocal:u}}async function N(e){let t;const a=e.attachment?(e,n)=>{w.has(n)||(t=n,w.set(n,a));const c=Object(s.e)();Object(s.g)({...c,fileUploads:{byMessageLocalId:{...c.fileUploads.byMessageLocalId,[n]:{progress:e}}}})}:void 0;e.replyingTo&&await Object(g.f)();const n=Object(s.e)(),c=Object(o.y)(n);if(!c)return;const{threadId:r}=c;e.replyingTo||r===i.MAIN_THREAD_ID||(e.replyingTo=Object(o.Eb)(n,e.chat.id,r)),await Object(j.a)("sendMessage",e,a),a&&t&&w.delete(t)}Object(s.b)("loadViewportMessages",(e,t,a)=>{const{direction:s=l.e.Around,isBudgetPreload:c=!1}=a||{};let{chatId:i,threadId:d}=a||{};if(!i){const t=Object(o.y)(e);if(!t)return;i=t.chatId,d=t.threadId}const b=Object(o.f)(e,i);if(!b||b.isRestricted)return;const u=Object(o.Hb)(e,i,d),m=Object(o.Y)(e,i,d),h=Object(o.gb)(e,i,d);if(u&&u.length&&s!==l.e.Around){const a=s===l.e.Backwards?u[0]:u[u.length-1],n=Boolean(h),o=n?h:m,{newViewportIds:O,areSomeLocal:j,areAllLocal:g}=k(o,a,s);if(j&&(e=Object(r.z)(e,i,d,O)),async function(e,t,a,s,n,c,r,o){t||await S(n,c,o,r,a,s);s||(await Promise.resolve(),e.loadViewportMessages({chatId:n.id,threadId:c,direction:r,isBudgetPreload:!0}))}(t,g,n,c,b,d,s,a),c)return}else{const t=Object(o.I)(e,i)||Object(o.lb)(e,i,d),a=Boolean(t&&m&&!m.includes(t)),s=(a?h:m)||[],{newViewportIds:u,areSomeLocal:O,areAllLocal:j}=k(s,t,l.e.Around);O&&u.length>=n.V&&(e=Object(r.z)(e,i,d,u)),j||S(b,d,t,l.e.Around,a,c)}return e}),Object(s.b)("loadMessage",(e,t,a)=>{const{chatId:n,messageId:c,replyOriginForId:l}=a,b=Object(o.f)(e,n);b&&async function(e,t,a){const n=await Object(j.a)("fetchMessage",{chat:e,messageId:t});if(!n)return;if(n===i.MESSAGE_DELETED){if(a){let t=Object(s.e)();const n=Object(o.k)(t,e.id,a);t=Object(r.L)(t,e.id,a,{...n,replyToMessageId:void 0}),Object(s.g)(t)}return}let c=Object(s.e)();c=Object(r.L)(c,e.id,t,n.message),c=Object(r.f)(c,Object(d.c)(n.users,"id")),Object(s.g)(c)}(b,c,l)}),Object(s.b)("sendMessage",(e,t,a)=>{const s=Object(o.y)(e);if(!s)return;const{chatId:c,threadId:r,type:i}=s;if("scheduled"===i&&!a.scheduledAt)return{...e,messages:{...e.messages,contentToBeScheduled:a}};const l=Object(o.f)(e,c);t.setReplyingToId({messageId:void 0}),t.clearWebPagePreview({chatId:c,threadId:r,value:!1});const b={...a,chat:l,replyingTo:Object(o.mb)(e,c,r),noWebPage:Object(o.cb)(e,c,r)},u=!a.attachments||a.attachments.length<=1,m=!u&&a.attachments&&a.attachments.length>1;if(u){const{attachments:e,...t}=b;N({...t,attachment:e?e[0]:void 0})}else if(m){const{text:e,entities:t,attachments:a,...s}=b,c=Object(d.n)(a,n.L);for(let a=0;a<c.length;a++){const[n,...r]=c[a],o=`${Date.now()}${a}`;N({...s,text:0===a?e:void 0,entities:0===a?t:void 0,attachment:n,groupedId:r.length>0?o:void 0}),r.forEach(e=>{N({...s,attachment:e,groupedId:o})})}}else{const{text:e,entities:t,attachments:a,replyingTo:s,...n}=b;e&&N({...n,text:e,entities:t,replyingTo:s}),a.forEach(e=>{N({...n,attachment:e})})}}),Object(s.b)("editMessage",(e,t,a)=>{const{text:s,entities:n}=a,c=Object(o.y)(e);if(!c)return;const{chatId:r,threadId:i,type:l}=c,d=Object(o.f)(e,r),b=Object(o.D)(e,r,i,l);d&&b&&(Object(j.a)("editMessage",{chat:d,message:b,text:s,entities:n,noWebPage:Object(o.cb)(e,r,i)}),t.setEditingId({messageId:void 0}))}),Object(s.b)("cancelSendingMessage",(e,t,a)=>{const{chatId:s,messageId:n}=a,c=Object(o.k)(e,s,n),r=c&&w.get(c.previousLocalId||c.id);r&&Object(j.b)(r),t.apiUpdate({"@type":"deleteMessages",ids:[n],chatId:s})}),Object(s.b)("saveDraft",(e,t,a)=>{const{chatId:s,threadId:n,draft:c}=a;if(!c)return;const{text:l,entities:d}=c,b=Object(o.f)(e,s);return n===i.MAIN_THREAD_ID&&Object(j.a)("saveDraft",{chat:b,text:l,entities:d,replyToMsgId:Object(o.mb)(e,s,n)}),Object(r.x)(e,s,n,"draft",c)}),Object(s.b)("clearDraft",(e,t,a)=>{const{chatId:s,threadId:n,localOnly:c}=a;if(!Object(o.B)(e,s,n))return;const l=Object(o.f)(e,s);return c||n!==i.MAIN_THREAD_ID||Object(j.a)("clearDraft",l),Object(r.x)(e,s,n,"draft",void 0)}),Object(s.b)("toggleMessageWebPage",(e,t,a)=>{const{chatId:s,threadId:n,noWebPage:c}=a;return Object(r.x)(e,s,n,"noWebPage",c)}),Object(s.b)("pinMessage",(e,t,a)=>{const s=Object(o.r)(e);if(!s)return;const{messageId:n,isUnpin:c,isOneSide:r,isSilent:i}=a;Object(j.a)("pinMessage",{chat:s,messageId:n,isUnpin:c,isOneSide:r,isSilent:i})}),Object(s.b)("unpinAllMessages",(e,t,a)=>{const n=Object(o.f)(e,a.chatId);n&&async function(e){await Object(j.a)("unpinAllMessages",{chat:e});let t=Object(s.e)();t=Object(r.x)(t,e.id,i.MAIN_THREAD_ID,"pinnedIds",[]),Object(s.g)(t)}(n)}),Object(s.b)("deleteMessages",(e,t,a)=>{const{messageIds:s,shouldDeleteForAll:n}=a,c=Object(o.y)(e);if(!c)return;const{chatId:r,threadId:i}=c,l=Object(o.f)(e,r);Object(j.a)("deleteMessages",{chat:l,messageIds:s,shouldDeleteForAll:n});const d=Object(o.C)(e,r,i);s.includes(d)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteScheduledMessages",(e,t,a)=>{const{messageIds:s}=a,n=Object(o.y)(e);if(!n)return;const{chatId:c}=n,r=Object(o.f)(e,c);Object(j.a)("deleteScheduledMessages",{chat:r,messageIds:s});const i=Object(o.E)(e,c);s.includes(i)&&t.setEditingId({messageId:void 0})}),Object(s.b)("deleteHistory",(e,t,a)=>{(async()=>{const{chatId:s,shouldDeleteForAll:n}=a,c=Object(o.f)(e,s);if(!c)return;const r=c.lastMessage&&c.lastMessage.id;await Object(j.a)("deleteHistory",{chat:c,shouldDeleteForAll:n,maxId:r}),t.openChat({id:void 0})})()}),Object(s.b)("markMessageListRead",(e,t,a)=>{const s=Object(o.y)(e);if(!s)return;const{chatId:n,threadId:c}=s,r=Object(o.Db)(e,n,c);if(!r)return;const{maxId:i}=a;M(()=>{Object(j.a)("markMessageListRead",{chat:r,threadId:c,maxId:i})})}),Object(s.b)("markMessagesRead",(e,t,a)=>{const s=Object(o.r)(e);if(!s)return;const{messageIds:n}=a;Object(j.a)("markMessagesRead",{chat:s,messageIds:n})}),Object(s.b)("loadWebPagePreview",(e,t,a)=>{const{text:n}=a;!async function(e){const t=await Object(j.a)("fetchWebPagePreview",{message:e});Object(s.g)({...Object(s.e)(),webPagePreview:t})}(n)}),Object(s.b)("clearWebPagePreview",e=>{if(e.webPagePreview)return{...e,webPagePreview:void 0}}),Object(s.b)("sendPollVote",(e,t,a)=>{const{chatId:s,messageId:n,options:c}=a,r=Object(o.f)(e,s);r&&Object(j.a)("sendPollVote",{chat:r,messageId:n,options:c})}),Object(s.b)("loadPollOptionResults",(e,t,a)=>{const{chat:n,messageId:c,option:o,offset:i,limit:l,shouldResetVoters:b}=a;!async function(e,t,a,n,c,o){const i=await Object(j.a)("loadPollOptionResults",{chat:e,messageId:t,option:a,offset:n,limit:c});if(!i)return;let l=Object(s.e)();l=Object(r.f)(l,Object(d.c)(i.users,"id"));const{voters:b}=l.pollResults;Object(s.g)({...l,pollResults:{...l.pollResults,voters:{...b,[a]:[...!o&&b&&b[a]?b[a]:[],...i&&i.users.map(e=>e.id)].filter((e,t,a)=>a.indexOf(e)===t)},offsets:{...l.pollResults.offsets?l.pollResults.offsets:{},[a]:i.nextOffset||""}}})}(n,c,o,i,l,b)}),Object(s.b)("forwardMessages",e=>{const{fromChatId:t,messageIds:a,toChatId:n}=e.forwardMessages,c=t?Object(o.f)(e,t):void 0,r=n?Object(o.f)(e,n):void 0,i=t&&a?a.sort((e,t)=>e-t).map(a=>Object(o.k)(e,t,a)).filter(Boolean):void 0;c&&r&&i&&i.length&&function(e,t,a){Object(j.a)("forwardMessages",{fromChat:e,toChat:t,messages:a}),Object(s.g)({...Object(s.e)(),forwardMessages:{}})}(c,r,i)}),Object(s.b)("loadScheduledHistory",e=>{const t=Object(o.r)(e);if(!t)return;const{hash:a}=e.scheduledMessages.byChatId[t.id]||{};!async function(e,t){const a=await Object(j.a)("fetchScheduledHistory",{chat:e,hash:t});if(!a)return;const{hash:n,messages:c}=a,o=Object(d.c)(c,"id"),l=Object.keys(o).map(Number).sort((e,t)=>t-e);let b=Object(s.e)();b=Object(r.u)(b,e.id,o,n),b=Object(r.x)(b,e.id,i.MAIN_THREAD_ID,"scheduledIds",l),Object(s.g)(b)}(t,a)}),Object(s.b)("sendScheduledMessages",(e,t,a)=>{const{chatId:s,id:n}=a,c=Object(o.f)(e,s);c&&Object(j.a)("sendScheduledMessages",{chat:c,ids:[n]})}),Object(s.b)("rescheduleMessage",(e,t,a)=>{const{chatId:s,messageId:n,scheduledAt:c}=a,r=Object(o.f)(e,s),i=r&&Object(o.pb)(e,r.id,n);r&&i&&Object(j.a)("rescheduleMessage",{chat:r,message:i,scheduledAt:c})}),Object(s.b)("requestThreadInfoUpdate",(e,t,a)=>{const{chatId:s,threadId:n}=a,c=Object(o.Db)(e,s,n);c&&Object(j.a)("requestThreadInfoUpdate",{chat:c,threadId:n})}),Object(s.b)("loadPinnedMessages",(e,t,a)=>{const{chatId:n}=a,c=Object(o.f)(e,n);c&&async function(e){const t=await Object(j.a)("fetchPinnedMessages",{chat:e});if(!t)return;const{messages:a,chats:n,users:c}=t,o=Object(d.c)(a,"id"),l=Object.keys(o).map(Number).sort((e,t)=>t-e);let b=Object(s.e)();b=Object(r.b)(b,e.id,o),b=Object(r.x)(b,e.id,i.MAIN_THREAD_ID,"pinnedIds",l),b=Object(r.f)(b,Object(d.c)(c,"id")),b=Object(r.c)(b,Object(d.c)(n,"id")),Object(s.g)(b)}(c)}),Object(s.b)("loadMessageLink",(e,t,a)=>{const{messageId:s,chatId:n}=a,c=Object(o.f)(e,n),r=Object(o.k)(e,n,s);c&&r&&(async()=>{const e=await Object(j.a)("fetchMessageLink",{chat:c,message:r});e&&Object(E.c)(e.link)})()});var P=a(52);const T=Object(g.g)(e=>e(),500,!1);async function A(e,t){const a=await Object(j.a)("searchGifs",{query:e,offset:t});a&&Object(s.g)(Object(r.Q)(Object(s.e)(),!t,a.gifs,a.nextOffset))}Object(s.b)("loadStickerSets",e=>{const{hash:t}=e.stickers.added||{};!async function(e=0){const t=await Object(j.a)("fetchStickerSets",{hash:e});if(!t)return;Object(s.g)(Object(r.ib)(Object(s.e)(),"added",t.hash,t.sets))}(t)}),Object(s.b)("loadAddedStickers",(e,t)=>{const{setIds:a}=e.stickers.added;a&&a.length&&(async()=>{for(let e=0;e<a.length;e++)t.loadStickers({stickerSetId:a[e]}),e%50==0&&e>0&&await Object(g.e)(500)})()}),Object(s.b)("loadRecentStickers",e=>{const{hash:t}=e.stickers.recent||{};!async function(e=0){const t=await Object(j.a)("fetchRecentStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,recent:t}})}(t)}),Object(s.b)("loadFavoriteStickers",e=>{const{hash:t}=e.stickers.favorite||{};!async function(e=0){const t=await Object(j.a)("fetchFavoriteStickers",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,favorite:t}})}(t)}),Object(s.b)("loadFeaturedStickers",e=>{const{hash:t}=e.stickers.featured||{};!async function(e=0){const t=await Object(j.a)("fetchFeaturedStickers",{hash:e});if(!t)return;Object(s.g)(Object(r.ib)(Object(s.e)(),"featured",t.hash,t.sets))}(t)}),Object(s.b)("loadStickers",(e,t,a)=>{const{stickerSetId:n}=a;let{stickerSetAccessHash:c}=a;if(!c){const t=Object(o.xb)(e,n);if(!t)return;c=t.accessHash}!async function(e,t){const a=await Object(j.a)("fetchStickers",{stickerSetId:e,accessHash:t});if(!a)return;const{set:n,stickers:c,packs:o}=a;let i=Object(s.e)();i=Object(r.hb)(i,n.id,{...n,stickers:c,packs:o});const l=i.stickers.forEmoji.emoji;l&&o[l]&&(i=Object(r.o)(i));Object(s.g)(i)}(n,c)}),Object(s.b)("loadAnimatedEmojis",()=>{!async function(){const e=await Object(j.a)("fetchAnimatedEmojis");if(!e)return;const{set:t,stickers:a}=e;Object(s.g)(Object(r.q)(Object(s.e)(),{...t,stickers:a}))}()}),Object(s.b)("loadSavedGifs",e=>{const{hash:t}=e.gifs.saved;!async function(e=0){const t=await Object(j.a)("fetchSavedGifs",{hash:e});if(!t)return;const a=Object(s.e)();Object(s.g)({...a,gifs:{...a.gifs,saved:t}})}(t)}),Object(s.b)("faveSticker",(e,t,a)=>{const{sticker:s}=a;s&&Object(j.a)("faveSticker",{sticker:s})}),Object(s.b)("unfaveSticker",(e,t,a)=>{const{sticker:n}=a;n&&function(e){const t=Object(s.e)();Object(s.g)({...t,stickers:{...t.stickers,favorite:{...t.stickers.favorite,stickers:t.stickers.favorite.stickers.filter(({id:t})=>t!==e.id)}}}),Object(j.a)("faveSticker",{sticker:e,unfave:!0})}(n)}),Object(s.b)("toggleStickerSet",(e,t,a)=>{const{stickerSetId:s}=a,n=Object(o.xb)(e,s);if(!n)return;const{accessHash:c,installedDate:r}=n;Object(j.a)(r?"uninstallStickerSet":"installStickerSet",{stickerSetId:s,accessHash:c})}),Object(s.b)("loadEmojiKeywords",(e,t,a)=>{const{language:n}=a;let c=Object(o.F)(e,n);c&&c.isLoading||(Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!0}}}),(async()=>{const t=await Object(j.a)("fetchEmojiKeywords",{language:n,fromVersion:c?c.version:0});e=Object(s.e)(),c=Object(o.F)(e,n),t?Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{isLoading:!1,version:t.version,keywords:{...c&&c.keywords,...t.keywords}}}}):Object(s.g)({...e,emojiKeywords:{...e.emojiKeywords,[n]:{...c,isLoading:!1}}})})())}),Object(s.b)("setStickerSearchQuery",(e,t,a)=>{const{query:n}=a;n&&T(()=>{!async function(e,t=0){const a=await Object(j.a)("searchStickers",{query:e,hash:t});if(!a)return;const n=Object(s.e)(),{setsById:c,added:o}=n.stickers,i=a.sets.map(({id:e})=>e);o.setIds&&o.setIds.forEach(t=>{if(!i.includes(t)){const{title:a}=c[t]||{};a&&Object(P.a)(a,e)&&i.unshift(t)}});Object(s.g)(Object(r.ib)(n,"search",a.hash,a.sets,i))}(n)})}),Object(s.b)("setGifSearchQuery",(e,t,a)=>{const{query:s}=a;"string"==typeof s&&T(()=>{A(s)})}),Object(s.b)("searchMoreGifs",e=>{const{query:t,offset:a}=e.gifs.search;"string"==typeof t&&T(()=>{A(t,a)})}),Object(s.b)("loadStickersForEmoji",(e,t,a)=>{const{emoji:n}=a,{hash:c}=e.stickers.forEmoji;T(()=>{!async function(e,t=0){let a=Object(s.e)();Object(s.g)({...a,stickers:{...a.stickers,forEmoji:{...a.stickers.forEmoji,emoji:e}}});const n=await Object(j.a)("fetchStickersForEmoji",{emoji:e,hash:t});if(a=Object(s.e)(),!n||a.stickers.forEmoji.emoji!==e)return;a=Object(r.jb)(a,e,n.stickers,n.hash),Object(s.g)(a)}(n,c)})}),Object(s.b)("clearStickersForEmoji",e=>({...e,stickers:{...e.stickers,forEmoji:{}}}));var x=a(36);const R=Object(g.g)(e=>e(),500,!1);async function L(e="",t,a,c,i,l){let b;if(c){const s=await Object(j.a)("searchMessagesLocal",{chatOrUser:c,query:e,type:t,limit:n.y,offsetId:a,minDate:l,maxDate:i});if(s){const{messages:e,users:t,totalCount:a,nextOffsetId:n}=s;b={messages:e,users:t,chats:[],totalCount:a,nextRate:n}}}else b=await Object(j.a)("searchMessagesGlobal",{query:e,offsetRate:a,limit:n.y,type:t,maxDate:i,minDate:l});let u=Object(s.e)();const m=Object(o.t)(u);if(!b||""!==e&&e!==m)return void Object(s.g)(Object(r.T)(u,{messages:!1}));const{messages:h,users:O,chats:g,totalCount:f,nextRate:p}=b;g.length&&(u=Object(r.c)(u,Object(d.c)(g,"id"))),O.length&&(u=Object(r.f)(u,Object(d.c)(O,"id"))),h.length&&(u=Object(r.d)(u,h)),u=Object(r.U)(u,h,f,t,p),Object(s.g)(u)}async function F(){const e=await Object(j.a)("fetchChats",{limit:n.j,archived:!0,withPinned:!0});if(!e)return;let t=Object(s.e)();t=Object(r.ob)(t,Object(d.c)(e.users,"id")),t=Object(r.M)(t,Object(d.c)(e.chats,"id")),t=Object(r.r)(t,"archived",e.chatIds),t=Object(r.J)(t,"archived",e),Object(s.g)(t)}async function D(){let e=Object(s.e)();const{recentlyFoundChatIds:t}=e.globalSearch,{userIds:a}=e.contactList||{};if(!(a&&a.length||t&&t.length))return;const n=[...t||[],...a||[]].map(t=>Object(o.Gb)(e,t)).filter(Boolean),c=await Object(j.a)("fetchUsers",{users:n});c&&(e=Object(s.e)(),e=Object(r.ob)(e,Object(d.c)(c,"id")),Object(s.g)(e))}Object(s.b)("setGlobalSearchQuery",(e,t,a)=>{const{chatId:n}=e.globalSearch,{query:c}=a;c&&!n&&R(()=>{!async function(e){const t=await Object(j.a)("searchChats",{query:e});let a=Object(s.e)();const n=Object(o.t)(a);if(!t||!n||e!==n)return void Object(s.g)(Object(r.T)(a,{chats:!1}));const{localChats:c,localUsers:i,globalChats:l,globalUsers:b}=t;(c.length||l.length)&&(a=Object(r.c)(a,Object(d.c)([...c,...l],"id")));(i.length||b.length)&&(a=Object(r.f)(a,Object(d.c)([...i,...b],"id")));a=Object(r.T)(a,{chats:!1}),a=Object(r.R)(a,{localResults:{chatIds:c.map(({id:e})=>e),userIds:i.map(({id:e})=>e)},globalResults:{...a.globalSearch.globalResults,chatIds:b.map(({id:e})=>e),userIds:l.map(({id:e})=>e)}}),Object(s.g)(a)}(c)})}),Object(s.b)("setGlobalSearchDate",(e,t,a)=>{const{date:n}=a,c=n?Object(x.m)(n):n,i=Object(r.R)(e,{date:n,query:"",resultsByType:{...e.globalSearch.resultsByType,text:{totalCount:void 0,foundIds:[],nextOffsetId:0}}});Object(s.g)(i);const{chatId:l}=e.globalSearch;L("","text",void 0,l?Object(o.f)(e,l):void 0,c,n)}),Object(s.b)("searchMessagesGlobal",(e,t,a)=>{const{query:s,resultsByType:n,chatId:c,date:r}=e.globalSearch,i=r?Object(x.m)(r):r,{type:l}=a,{nextOffsetId:d}=n&&n[l]||{};L(s,l,d,c?Object(o.f)(e,c):void 0,i,r)}),Object(s.b)("searchTextMessagesLocal",e=>{const{chatId:t,threadId:a}=Object(o.y)(e)||{},c=t?Object(o.f)(e,t):void 0,l=Object(o.A)(e);if(!c||!l||!a)return;const{query:b,results:u}=l,m=u?u.nextOffsetId:void 0;let h;if(a!==i.MAIN_THREAD_ID){const s=Object(o.Cb)(e,t,a);h=s?s.topMessageId:void 0}!async function(e,t,a,c,i){const l=await Object(j.a)("searchMessagesLocal",{chatOrUser:e,type:"text",query:c,topMessageId:a,limit:n.X,offsetId:i});if(!l)return;const{messages:b,users:u,totalCount:m,nextOffsetId:h}=l,O=Object(d.c)(b,"id"),g=Object.keys(O).map(Number);let f=Object(s.e)();const p=Object(o.A)(f);if(!p||c&&c!==p.query)return;f=Object(r.b)(f,e.id,O),f=Object(r.f)(f,Object(d.c)(u,"id")),f=Object(r.Z)(f,e.id,t,g,m,h),Object(s.g)(f)}(c,a,h,b,m)}),Object(s.b)("searchMediaMessagesLocal",e=>{const t=Object(o.w)(e),a=t?e.users.byId[t]||e.chats.byId[t]:void 0,c=Object(o.v)(e);if(!a||!c)return;const{currentType:i,resultsByType:l}=c,b=i&&l&&l[i],u=b?b.nextOffsetId:void 0;i&&async function(e,t,a){const c=await Object(j.a)("searchMessagesLocal",{chatOrUser:e,type:t,limit:n.ob,offsetId:a});if(!c)return;const{messages:i,users:l,totalCount:b,nextOffsetId:u}=c,m=Object(d.c)(i,"id"),h=Object.keys(m).map(Number);let O=Object(s.e)();if(!Object(o.v)(O))return;O=Object(r.b)(O,e.id,m),O=Object(r.f)(O,Object(d.c)(l,"id")),O=Object(r.W)(O,e.id,t,h,b,u),Object(s.g)(O)}(a,i,u)}),Object(s.b)("searchMessagesByDate",(e,t,a)=>{const{timestamp:n}=a,{chatId:c}=Object(o.y)(e)||{};if(!c)return;const r=Object(o.f)(e,c);r&&async function(e,t){const a=await Object(j.a)("findFirstMessageIdAfterDate",{chat:e,timestamp:t});if(!a)return;Object(s.d)().focusMessage({chatId:e.id,messageId:a})}(r,n)}),Object(s.b)("checkPublicLink",(e,t,a)=>{const{chatId:n}=Object(o.y)(e)||{};if(!n)return;if(e.management.progress===l.f.InProgress)return;const{username:c}=a;(async()=>{e=Object(r.bb)(e,l.f.InProgress),e=Object(r.ab)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e);const t=await Object(j.a)("checkChatUsername",{username:c});e=Object(s.e)(),e=Object(r.bb)(e,t?l.f.Complete:l.f.Error),e=Object(r.ab)(e,n,{isUsernameAvailable:t}),Object(s.g)(e)})()}),Object(s.b)("updatePublicLink",(e,t,a)=>{const{chatId:n}=Object(o.y)(e)||{};let c=n&&Object(o.f)(e,n);if(!n||!c)return;const{username:i}=a;(async()=>{if(e=Object(r.bb)(e,l.f.InProgress),Object(s.g)(e),Object(m.ib)(c)){if(c=await Object(j.a)("migrateChat",c),!c)return;t.openChat({id:c.id})}const a=await Object(j.a)("setChatUsername",{chat:c,username:i});e=Object(s.e)(),e=Object(r.bb)(e,a?l.f.Complete:l.f.Error),e=Object(r.ab)(e,n,{isUsernameAvailable:void 0}),Object(s.g)(e)})()}),Object(s.b)("updatePrivateLink",e=>{const{chatId:t}=Object(o.y)(e)||{},a=t&&Object(o.f)(e,t);t&&a&&Object(j.a)("updatePrivateLink",{chat:a})}),Object(s.b)("sync",(e,t)=>{!async function(e){n.p&&console.log(">>> START SYNC");await Object(j.a)("fetchCurrentUser");const t=await async function(){const e=await Object(j.a)("fetchChats",{limit:n.j,withPinned:!0});if(!e)return;let t=Object(s.e)();const{recentlyFoundChatIds:a}=t.globalSearch,{userIds:c}=t.contactList||{},{currentUserId:l}=t,b=[...a||[],...c||[],...l?[l]:[]],u=b.map(e=>Object(o.Gb)(t,e)).filter(Boolean),h=b.map(e=>Object(o.f)(t,e)).filter(Boolean),{chatId:O}=Object(o.y)(t)||{};if(O){const e=Object(o.f)(t,O);if(e&&!b.includes(O)&&h.push(e),Object(m.lb)(O)){const e=Object(o.Gb)(t,O);e&&!b.includes(O)&&u.push(e)}}u.push(...e.users),h.push(...e.chats),t=Object(r.s)(t,Object(d.c)(h,"id")),t=Object(r.r)(t,"active",e.chatIds),t={...t,chats:{...t.chats}},t=Object(r.J)(t,"active",e),Object.keys(e.draftsById).map(Number).forEach(a=>{t=Object(r.x)(t,a,i.MAIN_THREAD_ID,"draft",e.draftsById[a])}),Object.keys(e.replyingToById).map(Number).forEach(a=>{t=Object(r.x)(t,a,i.MAIN_THREAD_ID,"replyingToId",e.replyingToById[a])}),Object(s.g)(t),O&&!t.chats.byId[O]&&Object(s.d)().openChat({id:void 0});return u}();await async function(e){let t=!1,a=e||[],c=Object(s.e)();const{chatId:l}=Object(o.y)(c)||{},b=Object.keys(c.messages.byChatId).map(Number).reduce((e,t)=>{const a=Object(o.B)(c,t,i.MAIN_THREAD_ID);return a?{...e,[t]:a}:e},{});if(l){const e=await(u=c.chats.byId[l],Object(j.a)("fetchMessages",{chat:u,threadId:i.MAIN_THREAD_ID,offsetId:u.lastReadInboxMessageId,addOffset:-(Math.round(n.V/2)+1),limit:n.V}));c=Object(s.e)();const{chatId:b}=Object(o.y)(c)||{};if(e&&b===l){const s=c.messages.byChatId[l],n=Object(d.c)(e.messages,"id"),o=Object.keys(n).map(Number);c={...c,messages:{...c.messages,byChatId:{[l]:{byId:n,threadsById:{[i.MAIN_THREAD_ID]:{...s&&s.threadsById[i.MAIN_THREAD_ID],listedIds:o,viewportIds:o,outlyingIds:void 0}}}}}},c=Object(r.M)(c,Object(d.c)(e.chats,"id")),c=Object(r.lb)(c,l,e.threadInfos),t=!0,a=Array.prototype.concat(a,e.users)}}var u;t||(c={...c,messages:{...c.messages,byChatId:{}}});Object.keys(b).map(Number).forEach(e=>{c=Object(r.x)(c,e,i.MAIN_THREAD_ID,"draft",b[e])}),e?c=Object(r.y)(c,Object(d.c)(a,"id")):a&&(c=Object(r.ob)(c,Object(d.c)(a,"id")));Object(s.g)(c);const{chatId:m,messageId:h}=c.audioPlayer;m&&h&&!Object(o.k)(c,m,h)&&Object(s.d)().closeAudioPlayer()}(t),Object(s.g)({...Object(s.e)(),lastSyncTime:Date.now()}),n.p&&console.log(">>> FINISH SYNC");e()}(t.afterSync)}),Object(s.b)("afterSync",(e,t)=>{!async function(e){n.p&&console.log(">>> START AFTER-SYNC");e.loadFavoriteStickers(),await Promise.all([D(),F()]),await Object(j.a)("fetchCurrentUser"),n.p&&console.log(">>> FINISH AFTER-SYNC")}(t)});const B=Object(g.a)(e=>e(),500,!1,!0);function U(e,{visibility:t,allowedIds:a,deniedIds:s}){const{users:{byId:n},chats:{byId:c}}=e,r={visibility:t};let o,i;const l=e=>{if(!Object(m.lb)(e))return;const{id:t,accessHash:a}=n[e]||{};return t?{id:t,accessHash:a}:void 0},d=e=>{if(Object(m.lb)(e))return;const t=c[e];return t?{id:t.id}:void 0};return"contacts"!==t&&"nobody"!==t||(o=a.map(l).filter(Boolean),i=a.map(d).filter(Boolean),o.length>0&&(r.allowedUsers=o),i.length>0&&(r.allowedChats=i)),"everybody"!==t&&"contacts"!==t||(o=s.map(l).filter(Boolean),i=s.map(d).filter(Boolean),o.length>0&&(r.blockedUsers=o),i.length>0&&(r.blockedChats=i)),r}Object(s.b)("loadFullUser",(e,t,a)=>{const{userId:s}=a,n=Object(o.Gb)(e,s);if(!n)return;const{id:c,accessHash:r}=n;B(()=>Object(j.a)("fetchFullUser",{id:c,accessHash:r}))}),Object(s.b)("loadUser",(e,t,a)=>{const{userId:n}=a,c=Object(o.Gb)(e,n);c&&(async()=>{const t=await Object(j.a)("fetchUsers",{users:[c]});t&&(e=Object(s.e)(),e=Object(r.ob)(e,Object(d.c)(t,"id")),Object(s.g)(e))})()}),Object(s.b)("loadTopUsers",e=>{const{hash:t,lastRequestedAt:a}=e.topPeers;(!a||Date.now()-a>6e4)&&async function(e){const t=await Object(j.a)("fetchTopUsers",{hash:e});if(!t)return;const{hash:a,ids:n,users:c}=t;let o=Object(s.e)();o=Object(r.f)(o,Object(d.c)(c,"id")),o={...o,topPeers:{...o.topPeers,hash:a,userIds:n,lastRequestedAt:Date.now()}},Object(s.g)(o)}(t)}),Object(s.b)("loadContactList",e=>{const{hash:t}=e.contactList||{};!async function(e){const t=await Object(j.a)("fetchContactList",{hash:e});if(!t)return;let a=Object(r.f)(Object(s.e)(),Object(d.c)(t.users,"id"));a=Object(r.c)(a,Object(d.c)(t.chats,"id"));const n=e=>e.lastName||e.firstName||"",c=new Intl.Collator("en-US"),o=t.users.sort((e,t)=>c.compare(n(e),n(t))).filter(e=>!e.isSelf);Object(s.g)({...a,contactList:{hash:t.hash,userIds:o.map(e=>e.id)}})}(t)}),Object(s.b)("loadCurrentUser",()=>{Object(j.a)("fetchCurrentUser")}),Object(s.b)("updateContact",(e,t,a)=>{const{userId:n,isMuted:c,firstName:i,lastName:d}=a;!async function(e,t,a,n){const c=Object(s.e)(),i=Object(o.Gb)(c,e);if(!i)return;Object(s.d)().updateChatMutedState({chatId:e,isMuted:t}),Object(s.g)(Object(r.bb)(Object(s.e)(),l.f.InProgress));await Object(j.a)("updateContact",{phone:i.phoneNumber,firstName:a,lastName:n})&&Object(s.g)(Object(r.nb)(Object(s.e)(),i.id,{firstName:a,lastName:n}));Object(s.g)(Object(r.bb)(Object(s.e)(),l.f.Complete))}(n,c,i,d)}),Object(s.b)("deleteUser",(e,t,a)=>{const{userId:n}=a;!async function(e){const t=Object(s.e)(),a=Object(o.Gb)(t,e);if(!a)return;const{id:n,accessHash:c}=a;await Object(j.a)("deleteUser",{id:n,accessHash:c})}(n)}),Object(s.b)("loadProfilePhotos",(e,t,a)=>{const{profileId:n}=a,c=Object(m.lb)(n),i=c?Object(o.Gb)(e,n):void 0,l=c?void 0:Object(o.f)(e,n);(async()=>{const e=await Object(j.a)("fetchProfilePhotos",i,l);if(!e||!e.photos)return;let t=Object(s.e)();c?t=Object(r.nb)(t,n,{photos:e.photos}):(t=Object(r.f)(t,Object(d.c)(e.users,"id")),t=Object(r.H)(t,n,{photos:e.photos})),Object(s.g)(t)})()}),Object(s.b)("clickInlineButton",(e,t,a)=>{const{button:c}=a;switch(c.type){case"command":t.sendBotCommand({command:c.value});break;case"url":c.value.match(n.hb)||c.value.match(n.ib)?t.openTelegramLink({url:c.value}):t.toggleSafeLinkModal({url:c.value});break;case"callback":{const t=Object(o.r)(e);if(!t)return;!async function(e,t,a){const n=await Object(j.a)("answerCallbackButton",{chatId:e.id,accessHash:e.accessHash,messageId:t,data:a});if(!n||!n.message)return;const{message:c,alert:r}=n;r?Object(s.d)().showError({error:{message:c}}):Object(s.d)().showNotification({message:c})}(t,c.messageId,c.value);break}case"requestPoll":t.openPollModal();break;case"buy":{const a=Object(o.r)(e),{messageId:s,value:n}=c;if(!a)return;n?t.getReceipt({receiptMessageId:n,chatId:a.id,messageId:s}):(t.getPaymentForm({messageId:s}),t.setInvoiceMessageInfo(Object(o.k)(e,a.id,s)),t.openPaymentModal({messageId:s}));break}}}),Object(s.b)("sendBotCommand",(e,t,a)=>{const{command:s}=a,{currentUserId:n}=e,c=Object(o.r)(e);n&&c&&async function(e,t,a){await Object(j.a)("sendMessage",{chat:e,text:a})}(c,0,s)}),Object(s.b)("updateProfile",(e,t,a)=>{const{photo:n,firstName:c,lastName:i,bio:d,username:b}=a;(async()=>{const{currentUserId:t}=e;if(t){if(Object(s.g)({...Object(s.e)(),profileEdit:{progress:l.j.InProgress}}),n&&await Object(j.a)("updateProfilePhoto",n),c||i||d){if(await Object(j.a)("updateProfile",{firstName:c,lastName:i,about:d})){e=Object(s.e)();const a=t&&Object(o.Gb)(e,t);a&&Object(s.g)(Object(r.nb)(e,a.id,{firstName:c,lastName:i,fullInfo:{...a.fullInfo,bio:d}}))}}if(b){await Object(j.a)("updateUsername",b)&&t&&Object(s.g)(Object(r.nb)(Object(s.e)(),t,{username:b}))}Object(s.g)({...Object(s.e)(),profileEdit:{progress:l.j.Complete}})}})()}),Object(s.b)("checkUsername",(e,t,a)=>{const{username:n}=a;(async()=>{if(e.profileEdit&&e.profileEdit.progress===l.j.InProgress)return;Object(s.g)({...e,profileEdit:{progress:e.profileEdit?e.profileEdit.progress:l.j.Idle,isUsernameAvailable:void 0}});const t=await Object(j.a)("checkUsername",n);e=Object(s.e)(),Object(s.g)({...e,profileEdit:{...e.profileEdit,isUsernameAvailable:t}})})()}),Object(s.b)("loadWallpapers",()=>{(async()=>{const e=await Object(j.a)("fetchWallpapers",0);if(!e)return;const t=Object(s.e)();Object(s.g)({...t,settings:{...t.settings,loadedWallpapers:e.wallpapers}})})()}),Object(s.b)("uploadWallpaper",(e,t,a)=>{const n=a,c=URL.createObjectURL(n);Object(s.g)({...e,settings:{...e.settings,loadedWallpapers:[{slug:l.n,document:{fileName:"",size:n.size,mimeType:n.type,previewBlobUrl:c}},...e.settings.loadedWallpapers||[]]}}),(async()=>{const t=await Object(j.a)("uploadWallpaper",n);if(!t)return;const{wallpaper:a}=t;if(!(e=Object(s.e)()).settings.loadedWallpapers)return;const r=e.settings.loadedWallpapers[0];if(!r||r.slug!==l.n)return;const o={...a,document:{...a.document,previewBlobUrl:c}};Object(s.g)({...e,settings:{...e.settings,loadedWallpapers:[o,...e.settings.loadedWallpapers.slice(1)]}})})()}),Object(s.b)("loadBlockedContacts",()=>{(async()=>{const e=await Object(j.a)("fetchBlockedContacts");if(!e)return;let t=Object(s.e)();e.users&&e.users.length&&(t=Object(r.f)(t,Object(d.c)(e.users,"id"))),e.chats&&e.chats.length&&(t=Object(r.M)(t,Object(d.c)(e.chats,"id"))),t={...t,blocked:{...t.blocked,ids:[...t.blocked.ids||[],...e.blockedIds],totalCount:e.totalCount}},Object(s.g)(t)})()}),Object(s.b)("blockContact",(e,t,a)=>{const{contactId:n}=a;(async()=>{if(!await Object(j.a)("blockContact",n))return;const e=Object(s.e)();Object(s.g)(Object(r.a)(e,n))})()}),Object(s.b)("unblockContact",(e,t,a)=>{const{contactId:n}=a;let c;if(Object(m.lb)(n)){const t=Object(o.Gb)(e,n);if(!t)return;c=t.accessHash}(async()=>{if(!await Object(j.a)("unblockContact",n,c))return;const e=Object(s.e)();Object(s.g)(Object(r.p)(e,n))})()}),Object(s.b)("loadAuthorizations",()=>{(async()=>{const e=await Object(j.a)("fetchAuthorizations");e&&Object(s.g)({...Object(s.e)(),activeSessions:e})})()}),Object(s.b)("terminateAuthorization",(e,t,a)=>{const{hash:n}=a;(async()=>{if(!await Object(j.a)("terminateAuthorization",n))return;const e=Object(s.e)();Object(s.g)({...e,activeSessions:e.activeSessions.filter(e=>e.hash!==n)})})()}),Object(s.b)("terminateAllAuthorizations",()=>{(async()=>{if(!await Object(j.a)("terminateAllAuthorizations"))return;const e=Object(s.e)();Object(s.g)({...e,activeSessions:e.activeSessions.filter(e=>e.isCurrent)})})()}),Object(s.b)("loadNotificationExceptions",()=>{Object(j.a)("fetchNotificationExceptions")}),Object(s.b)("loadNotificationSettings",()=>{(async()=>{const e=await Object(j.a)("fetchNotificationSettings");e&&Object(s.g)(Object(r.v)(Object(s.e)(),e))})()}),Object(s.b)("updateNotificationSettings",(e,t,a)=>{const{peerType:n,isSilent:c,shouldShowPreviews:o}=a;(async()=>{await Object(j.a)("updateNotificationSettings",n,{isSilent:c,shouldShowPreviews:o})&&Object(s.g)(Object(r.cb)(Object(s.e)(),n,c,o))})()}),Object(s.b)("updateContactSignUpNotification",(e,t,a)=>{const{isSilent:n}=a;(async()=>{await Object(j.a)("updateContactSignUpNotification",n)&&Object(s.g)(Object(r.v)(Object(s.e)(),{hasContactJoinedNotifications:!n}))})()}),Object(s.b)("loadLanguages",()=>{(async()=>{const e=await Object(j.a)("fetchLanguages");e&&Object(s.g)(Object(r.v)(Object(s.e)(),{languages:e}))})()}),Object(s.b)("loadPrivacySettings",()=>{(async()=>{const[e,t,a,n,c]=await Promise.all([Object(j.a)("fetchPrivacySettings","phoneNumber"),Object(j.a)("fetchPrivacySettings","lastSeen"),Object(j.a)("fetchPrivacySettings","profilePhoto"),Object(j.a)("fetchPrivacySettings","forwards"),Object(j.a)("fetchPrivacySettings","chatInvite")]);if(!(e&&t&&a&&n&&c))return;const r=Object(s.e)();r.settings.privacy.phoneNumber=e,r.settings.privacy.lastSeen=t,r.settings.privacy.profilePhoto=a,r.settings.privacy.forwards=n,r.settings.privacy.chatInvite=c,Object(s.g)(r)})()}),Object(s.b)("setPrivacyVisibility",(e,t,a)=>{const{privacyKey:n,visibility:c}=a,{privacy:{[n]:r}}=e.settings;if(!r)return;const o=U(e,{visibility:c,allowedIds:[...r.allowUserIds,...r.allowChatIds],deniedIds:[...r.blockUserIds,...r.blockChatIds]});(async()=>{const e=await Object(j.a)("setPrivacySettings",n,o);if(e){const t=Object(s.e)();t.settings.privacy[n]=e,Object(s.g)(t)}})()}),Object(s.b)("setPrivacySettings",(e,t,a)=>{const{privacyKey:n,isAllowList:c,contactsIds:r}=a,{privacy:{[n]:o}}=e.settings;if(!o)return;const i=U(e,{visibility:o.visibility,allowedIds:c?r:[...o.allowUserIds,...o.allowChatIds],deniedIds:c?[...o.blockUserIds,...o.blockChatIds]:r});(async()=>{const e=await Object(j.a)("setPrivacySettings",n,i);if(e){const t=Object(s.e)();t.settings.privacy[n]=e,Object(s.g)(t)}})()}),Object(s.b)("loadPasswordInfo",()=>{(async()=>{const e=await Object(j.a)("getPasswordInfo");if(!e)return;let t=Object(s.e)();t=Object(r.v)(t,{hasPassword:e.hasPassword}),t=Object(r.mb)(t,{hint:e.hint}),Object(s.g)(t)})()}),Object(s.b)("checkPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(r.mb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(j.a)("checkPassword",n);Object(s.g)(Object(r.mb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("clearPassword",(e,t,a)=>{const{currentPassword:n,onSuccess:c}=a;Object(s.g)(Object(r.mb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(j.a)("clearPassword",n);Object(s.g)(Object(r.mb)(Object(s.e)(),{isLoading:!1})),e&&c()})()}),Object(s.b)("updatePassword",(e,t,a)=>{const{currentPassword:n,password:c,hint:o,email:i,onSuccess:l}=a;Object(s.g)(Object(r.mb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(j.a)("updatePassword",n,c,o,i);Object(s.g)(Object(r.mb)(Object(s.e)(),{isLoading:!1})),e&&l()})()}),Object(s.b)("updateRecoveryEmail",(e,t,a)=>{const{currentPassword:n,email:c,onSuccess:o}=a;Object(s.g)(Object(r.mb)(e,{isLoading:!0,error:void 0})),(async()=>{const e=await Object(j.a)("updateRecoveryEmail",n,c);Object(s.g)(Object(r.mb)(Object(s.e)(),{isLoading:!1,waitingEmailCodeLength:void 0})),e&&o()})()}),Object(s.b)("provideTwoFaEmailCode",(e,t,a)=>{const{code:s}=a;Object(j.a)("provideRecoveryEmailCode",s)}),Object(s.b)("clearTwoFaError",e=>Object(r.mb)(e,{error:void 0}));var H=a(60);Object(s.b)("validateRequestedInfo",(e,t,a)=>{const{requestInfo:n,saveInfo:c}=a,i=Object(o.hb)(e);i&&async function(e,t,a){const n=await Object(j.a)("validateRequestedInfo",{messageId:e,requestInfo:t,shouldSave:a});if(!n)return;const{id:c,shippingOptions:o}=n;if(!c)return;let i=Object(r.E)(Object(s.e)(),c);o?(i=Object(r.gb)(i,o),i=Object(r.C)(i,l.i.Shipping)):i=Object(r.C)(i,l.i.PaymentInfo);Object(s.g)(i)}(i,n,c)}),Object(s.b)("getPaymentForm",(e,t,a)=>{const{messageId:n}=a;n&&async function(e){const t=await Object(j.a)("getPaymentForm",{messageId:e});if(!t)return;let a=Object(r.B)(Object(s.e)(),t),n=l.i.PaymentInfo;a.payment.invoice&&(a.payment.invoice.shippingAddressRequested||a.payment.invoice.nameRequested||a.payment.invoice.phoneRequested||a.payment.invoice.emailRequested)&&(n=l.i.ShippingInfo);a=Object(r.C)(a,n),Object(s.g)(a)}(n)}),Object(s.b)("getReceipt",(e,t,a)=>{const{receiptMessageId:n,chatId:c,messageId:i}=a;i&&n&&c&&async function(e,t,a){const n=await Object(j.a)("getReceipt",t);if(!n)return;let c=Object(s.e)();const i=Object(o.k)(c,a,e);c=Object(r.D)(c,n,i),Object(s.g)(c)}(i,n,c)}),Object(s.b)("clearPaymentError",e=>{Object(s.g)({...e,payment:{...e.payment,error:void 0}})}),Object(s.b)("clearReceipt",e=>{Object(s.g)({...e,payment:{...e.payment,receipt:void 0}})}),Object(s.b)("sendCredentialsInfo",(e,t,a)=>{const n=Object(o.kb)(e);if(!n)return;const{credentials:c}=a,{data:i}=c;!async function(e,t){const a=function(e){const t=Object.keys(e).map(t=>`${t}=${e[t]}`).join("&");return t.length>0?"?"+t:""}({"card[number]":e.cardNumber,"card[exp_month]":e.expiryMonth,"card[exp_year]":e.expiryYear,"card[cvc]":e.cvv,"card[address_zip]":e.zip,"card[address_country]":e.country}),n=await fetch("https://api.stripe.com/v1/tokens"+a,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Bearer "+t}}),c=await n.json();if(c.error){const e=Object(H.b)(c.error),t=Object(s.e)();return void Object(s.g)({...t,payment:{...t.payment,error:{...e}}})}let o=Object(r.F)(Object(s.e)(),{type:c.type,id:c.id});o=Object(r.C)(o,l.i.Checkout),Object(s.g)(o)}(i,n)}),Object(s.b)("sendPaymentForm",(e,t,a)=>{const{shippingOptionId:n,saveCredentials:c}=a,i=Object(o.hb)(e),l=Object(o.ib)(e),d=Object(o.kb)(e),b=Object(o.zb)(e);i&&d&&async function(e,t,a,n){if(await Object(j.a)("sendPaymentForm",{messageId:e,credentials:t,requestedInfoId:a,shippingOptionId:n})){const e=Object(r.h)(Object(s.e)());Object(s.g)(Object(r.i)(e))}}(i,{save:c,data:b},l,n)}),Object(s.b)("setPaymentStep",(e,t,a={})=>Object(r.C)(e,a.step||l.i.ShippingInfo)),Object(s.b)("setInvoiceMessageInfo",(e,t,a)=>Object(r.A)(e,a));a(87);var G=a(29),q=a(78);const _=Object(g.g)(e=>e(),1e3,!0);Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateChat":{a.noTopChatsRequest||Object(o.M)(e,a.id)||t.loadTopChats();const n=Object(r.H)(e,a.id,a.chat,a.newProfilePhoto);Object(s.g)(n);const c=Object(o.q)(n);_(()=>Object(q.a)(c));break}case"updateChatJoin":{const n=Object(o.j)(e,a.id);if(!n)break;e=Object(r.I)(e,n,[a.id]),e=Object(r.H)(e,a.id,{isNotJoined:!1}),Object(s.g)(e);const c=Object(o.f)(e,a.id);c&&t.requestChatUpdate({chatId:c.id});break}case"updateChatLeave":{const t=Object(o.j)(e,a.id);if(!t)break;const{[t]:n}=e.chats.listIds;n&&(e=Object(r.r)(e,t,n.filter(e=>e!==a.id))),e=Object(r.H)(e,a.id,{isNotJoined:!0}),Object(s.g)(e);break}case"updateChatInbox":Object(s.g)(Object(r.H)(e,a.id,a.chat));break;case"updateChatTypingStatus":{const{id:t,typingStatus:n}=a;Object(s.g)(Object(r.H)(e,t,{typingStatus:n})),setTimeout(()=>{const e=Object(s.e)(),a=Object(o.f)(e,t);a&&n&&a.typingStatus&&a.typingStatus.timestamp===n.timestamp&&Object(s.g)(Object(r.H)(e,t,{typingStatus:void 0}))},6e3);break}case"newMessage":{const{message:n}=a,{chatId:c,threadId:l,type:d}=Object(o.y)(e)||{};if(n.senderId===e.currentUserId&&!n.isFromScheduled)return;const b=Object(o.f)(e,a.chatId);if(!b)return;const u="thread"===d&&l===i.MAIN_THREAD_ID&&a.chatId===c;u?setTimeout(()=>{t.requestChatUpdate({chatId:a.chatId})},1e3):Object(s.g)(Object(r.H)(e,a.chatId,{unreadCount:b.unreadCount?b.unreadCount+1:1,...a.message.hasUnreadMention&&{unreadMentionsCount:b.unreadMentionsCount?b.unreadMentionsCount+1:1}}));const m=Object(o.q)(Object(s.e)());Object(q.a)(m),Object(G.b)({chat:b,message:n,isActiveChat:u});break}case"updateCommonBoxMessages":case"updateChannelMessages":{const{ids:t,messageUpdate:n}=a;if(!1!==n.hasUnreadMention)return;t.forEach(t=>{const s="channelId"in a?a.channelId:Object(o.p)(e,t),n=Object(o.f)(e,s);n&&n.unreadMentionsCount&&(e=Object(r.H)(e,s,{unreadMentionsCount:n.unreadMentionsCount-1}))}),Object(s.g)(e);break}case"updateChatFullInfo":{const{fullInfo:t}=a,n=e.chats.byId[a.id];if(!n)return;Object(s.g)(Object(r.H)(e,a.id,{fullInfo:{...n.fullInfo,...t}}));break}case"updatePinnedChatIds":{const{ids:t,folderId:c}=a,r=c===n.h?"archived":"active";e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:t.length?t:void 0}}},Object(s.g)(e);break}case"updateChatPinned":{const{id:t,isPinned:c}=a,r=Object(o.j)(e,t);if(r){const{[r]:a}=e.chats.orderedPinnedIds;let s=a||[];if(c){if(!s.includes(t)){if("active"===r&&s.length>=n.K){const t=e.chats.listIds.active;s=s.filter(e=>t&&t.includes(e))}s=[t,...s]}}else s=s.filter(e=>e!==t);e={...e,chats:{...e.chats,orderedPinnedIds:{...e.chats.orderedPinnedIds,[r]:s.length?s:void 0}}}}Object(s.g)(e);break}case"updateChatListType":{const{id:t,folderId:n}=a;Object(s.g)(Object(r.K)(e,t,n));break}case"updateChatFolder":{const{id:t,folder:n}=a,{byId:c,orderedIds:r}=e.chatFolders,o=n?{...c,[t]:n}:Object(d.l)(c,Object.keys(c).map(Number).filter(e=>e!==t)),i=n?r&&r.includes(t)?r:[...r||[],t]:r?r.filter(e=>e!==t):void 0;Object(s.g)({...e,chatFolders:{...e.chatFolders,byId:o,orderedIds:i}});break}case"updateChatFoldersOrder":{const{orderedIds:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,orderedIds:t}});break}case"updateRecommendedChatFolders":{const{folders:t}=a;Object(s.g)({...e,chatFolders:{...e.chatFolders,recommended:t}});break}case"updateChatMembers":{const t=e.chats.byId[a.id],{replacedMembers:n,addedMember:c,deletedMemberId:o}=a;if(!t)return;let i=!1,l=t.fullInfo&&t.fullInfo.members?[...t.fullInfo.members]:[];if(n)l=n,i=!0;else if(c)l.length&&l.some(e=>e.userId===c.userId)||(l.push(c),i=!0);else if(l.length&&o){const e=l.findIndex(e=>e.userId===o);e>-1&&(l.slice(e,1),i=!0)}if(i){const n=l.filter(({isOwner:e,isAdmin:t})=>e||t);Object(s.g)(Object(r.H)(e,a.id,{membersCount:l.length,fullInfo:{...t.fullInfo,members:l,adminMembers:n}}))}break}case"deleteProfilePhotos":{const{chatId:t,ids:n}=a,c=e.chats.byId[t];c&&c.photos&&Object(s.g)(Object(r.H)(e,t,{photos:c.photos.filter(e=>!n.includes(e.id))}));break}}});function V(e,t,a,s,n=!1){const c=n?Object(o.pb)(e,t,a):Object(o.k)(e,t,a);if(c&&s.content){const{photo:e,video:t,sticker:a,document:n}=Object(m.v)(c);e&&s.content.photo?(s.content.photo.blobUrl=e.blobUrl,s.content.photo.thumbnail=e.thumbnail):t&&s.content.video?s.content.video.blobUrl=t.blobUrl:a&&s.content.sticker?s.content.sticker.isPreloadedGlobally=a.isPreloadedGlobally:n&&s.content.document&&(s.content.document.previewBlobUrl=n.previewBlobUrl)}return n?Object(r.eb)(e,t,a,s):Object(r.L)(e,t,a,s)}function $(e,t){const{id:a,chatId:s}=t;if(e=Object(r.V)(e,s,i.MAIN_THREAD_ID,[a]),Object(o.X)(e,s,i.MAIN_THREAD_ID)){const t=Object(o.H)(e,s,i.MAIN_THREAD_ID),n=Object(r.g)(e,s,i.MAIN_THREAD_ID,a),c=Object(o.Hb)(n,s,i.MAIN_THREAD_ID);t&&!c.includes(t)||(e=n)}const{threadInfo:n,firstMessageId:c}=Object(o.Bb)(e,s,t)||{};return!c&&Object(m.sb)(t)||n&&(e=Object(r.V)(e,s,n.threadId,[a]),Object(o.X)(e,s,n.threadId)&&(e=Object(r.g)(e,s,n.threadId,a),c||(e=Object(r.x)(e,s,n.threadId,"firstMessageId",t.id)),n.lastMessageId||(e=Object(r.x)(e,s,n.threadId,"threadInfo",{...n,lastMessageId:t.id})))),e}function z(e,t,a,s=!1){const{chats:n}=e,c=n.byId[t]&&n.byId[t].lastMessage;if(c&&!s){if(!(c.id===a.id||c.id===a.previousLocalId||a.id>c.id))return e}return Object(r.H)(e,t,{lastMessage:a})}function W(e,t){const a=Object(o.m)(e,t),s=Object(o.Y)(e,t,i.MAIN_THREAD_ID);if(!a||!s)return;let n=s.length;for(;n--;){const e=a[s[n]];if(!e.isDeleting)return e}}function K(e,t,a,n){if(e){t.forEach(t=>{const a=W(n=Object(r.L)(n,e,t,{isDeleting:!0}),e);a&&(n=z(n,e,a,!0))}),Object(s.g)(n),a.requestChatUpdate({chatId:e});const c=[];return t.forEach(t=>{const a=Object(o.k)(n,e,t);if(!a)return;const{threadInfo:s}=Object(o.Bb)(n,e,a)||{};s&&c.push(s.threadId)}),Object(d.o)(c).forEach(t=>{a.requestThreadInfoUpdate({chatId:e,threadId:t})}),void setTimeout(()=>{Object(s.g)(Object(r.j)(Object(s.e)(),e,t))},350)}const c=[];t.forEach(e=>{const t=Object(o.p)(n,e);if(t){c.push(t);const a=W(n=Object(r.L)(n,t,e,{isDeleting:!0}),t);a&&(n=z(n,t,a,!0)),setTimeout(()=>{Object(s.g)(Object(r.j)(Object(s.e)(),t,[e]))},350)}}),Object(s.g)(n),Object(d.o)(c).forEach(e=>{a.requestChatUpdate({chatId:e})})}Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"newMessage":{const{chatId:n,id:c,message:i}=a;e=$(e=V(e,n,c,i),i),i.threadInfo&&(e=Object(r.kb)(e,i.threadInfo.chatId,i.threadInfo.threadId,i.threadInfo)),Object(s.g)(e);const l=Object(o.k)(e,n,c);if(Object(o.a)(e,n,i)){if(i.isOutgoing&&(!i.content||!i.content.action)){const a=Object(o.y)(e);a&&t.focusMessage({chatId:n,threadId:a.threadId,messageId:i.id,noHighlight:!0})}const{threadInfo:a}=Object(o.Bb)(e,n,i)||{};a&&t.requestThreadInfoUpdate({chatId:n,threadId:a.threadId}),Object(m.sb)(i)||setTimeout(()=>{Object(s.g)(z(Object(s.e)(),n,l))},350)}else Object(s.g)(z(Object(s.e)(),n,l));Object(o.M)(e,n)||t.loadTopChats();break}case"newScheduledMessage":{const{chatId:t,id:n,message:c}=a;e=V(e,t,n,c,!0);const l=Object(o.ob)(e,t)||[];e=Object(r.x)(e,t,i.MAIN_THREAD_ID,"scheduledIds",Object(d.o)([...l,n])),Object(s.g)(e);break}case"updateMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(o.k)(e,t,n))return;e=V(e,t,n,c);const i=Object(o.k)(e,t,n);c.threadInfo&&(e=Object(r.kb)(e,c.threadInfo.chatId,c.threadInfo.threadId,c.threadInfo)),e=z(e,t,i),Object(s.g)(e);break}case"updateScheduledMessage":{const{chatId:t,id:n,message:c}=a;if(!Object(o.pb)(e,t,n))return;e=V(e,t,n,c,!0);const l=Object.keys(Object(o.qb)(e,t)||{}).map(Number).sort((e,t)=>t-e);e=Object(r.x)(e,t,i.MAIN_THREAD_ID,"scheduledIds",l),Object(s.g)(e);break}case"updateMessageSendSucceeded":{const{chatId:t,localId:n,message:c}=a;e=$(e,c);const i=Object(o.k)(e,t,n);e=Object(r.j)(e,t,[n]),c.isScheduled&&(e=Object(r.k)(e,t,[n])),e=Object(r.L)(e,t,c.id,{...i,...c,previousLocalId:n});const l=Object(o.k)(e,t,c.id);e=z(e,t,l),Object(s.g)(e);break}case"updateScheduledMessageSendSucceeded":{const{chatId:t,localId:n,message:c}=a,l=Object(o.ob)(e,t)||[];e=Object(r.x)(e,t,i.MAIN_THREAD_ID,"scheduledIds",[...l,c.id]);const d=Object(o.pb)(e,t,n);e=Object(r.k)(e,t,[n]),e=Object(r.eb)(e,t,c.id,{...d,...c,previousLocalId:n}),Object(s.g)(e);break}case"updatePinnedIds":{const{chatId:t,isPinned:n,messageIds:c}=a,l=Object(o.jb)(e,t)||[],d=n?[...l,...c].sort((e,t)=>t-e):l.filter(e=>!c.includes(e));Object(s.g)(Object(r.x)(e,t,i.MAIN_THREAD_ID,"pinnedIds",d));break}case"updateThreadInfo":{const{chatId:t,threadId:n,threadInfo:c,firstMessageId:i}=a,l={...Object(o.Cb)(e,t,n),...c};if(!l.threadId)return;e=Object(r.kb)(e,t,n,l),i&&(e=Object(r.x)(e,t,n,"firstMessageId",i)),Object(s.g)(e);break}case"resetMessages":{const{id:n}=a,c=Object(o.m)(e,n);c&&!Object(m.lb)(n)&&(e=Object(r.j)(e,n,Object.keys(c).map(Number)),Object(s.g)(e),t.loadFullChat({chatId:n,force:!0}));break}case"deleteMessages":{const{ids:s,chatId:n}=a;K(n,s,t,e);break}case"deleteScheduledMessages":{const{ids:t,chatId:n}=a;!function(e,t,a,n){if(!e)return;t.forEach(t=>{n=Object(r.eb)(n,e,t,{isDeleting:!0})}),Object(s.g)(n),setTimeout(()=>{n=Object(r.k)(Object(s.e)(),e,t);const a=Object(o.qb)(n,e);n=Object(r.x)(n,e,i.MAIN_THREAD_ID,"scheduledIds",Object.keys(a||{}).map(Number)),Object(s.g)(n)},350)}(n,t,0,e);break}case"deleteHistory":{const{chatId:s}=a;K(s,Object.keys(e.messages.byChatId[s].byId).map(Number),t,e);break}case"updateCommonBoxMessages":{const{ids:t,messageUpdate:n}=a;t.forEach(t=>{const a=Object(o.p)(e,t);a&&(e=Object(r.L)(e,a,t,n))}),Object(s.g)(e);break}case"updateChannelMessages":{const{channelId:t,ids:n,messageUpdate:c}=a;n.forEach(a=>{e=Object(r.L)(e,t,a,c)}),Object(s.g)(e);break}case"updateMessagePoll":{const{pollId:t,pollUpdate:n}=a,c=Object(o.l)(e,t);if(c&&c.content.poll){const t={...c.content.poll,...n},{results:a}=t.results||{};if(a&&!a.some(e=>e.isChosen)){const{results:e}=c.content.poll.results,s=e&&e.filter(e=>e.isChosen);s&&s.forEach(e=>{const s=a.findIndex(t=>t.option===e.option);s>=0&&(t.results.results[s].isChosen=!0)})}Object(s.g)(Object(r.L)(e,c.chatId,c.id,{content:{...c.content,poll:t}}))}break}case"updateMessagePollVote":{const{pollId:t,userId:n,options:c}=a,i=Object(o.l)(e,t);if(!i||!i.content.poll||!i.content.poll.results)break;const{poll:l}=i.content,{recentVoterIds:d,totalVoters:b,results:u}=l.results,m=d?[...d]:[],h=b?b+1:1,O=u?[...u]:[];m.push(n),c.forEach(t=>{const a=O.find(e=>e.option===t),s=O.findIndex(e=>e.option===t),c=a?{...a}:{option:t,votersCount:0};c.votersCount+=1,n===e.currentUserId&&(c.isChosen=!0),s?O[s]=c:O.push(c)}),Object(s.g)(Object(r.L)(e,i.chatId,i.id,{content:{...i.content,poll:{...l,results:{...l.results,recentVoterIds:m,totalVoters:h,results:O}}}}));break}}});const Q=Object(g.g)((function(){let e=Object(s.e)();Y.forEach(([t,a])=>{e=Object(r.nb)(e,t,{status:a})}),Object(s.g)(e),Y=[]}),3e3,!0);let Y=[];Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"deleteUser":return Object(r.l)(e,a.id);case"updateUser":return Object(r.nb)(e,a.id,a.user);case"updateUserStatus":return s=a.userId,n=a.status,Y.push([s,n]),void Q();case"updateUserFullInfo":{const{id:t,fullInfo:s}=a,n=e.users.byId[t];if(!n)return;return Object(r.nb)(e,t,{fullInfo:{...n.fullInfo,...s}})}}var s,n}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateStickerSet":return Object(r.hb)(e,a.id,a.stickerSet)}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updatePeerBlocked":return a.isBlocked?Object(r.a)(Object(s.e)(),a.id):Object(r.p)(Object(s.e)(),a.id);case"updateResetContactList":Object(s.g)({...Object(s.e)(),contactList:{hash:0,userIds:[]}});break;case"updateFavoriteStickers":t.loadFavoriteStickers();break;case"updatePrivacy":e.settings.privacy[a.key]=a.rules}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateNotifySettings":return Object(r.cb)(e,a.peerType,a.isSilent,a.shouldShowPreviews);case"updateNotifyExceptions":{const{id:t,isMuted:n,isSilent:c,shouldShowPreviews:o}=a;e.chats.byId[t]&&(e=Object(r.H)(e,t,{isMuted:n})),Object(s.g)(Object(r.e)(e,t,{isMuted:n,isSilent:c,shouldShowPreviews:o}));break}}}),Object(s.b)("apiUpdate",(e,t,a)=>{switch(a["@type"]){case"updateTwoFaStateWaitCode":return{...e,twoFaSettings:{...e.twoFaSettings,isLoading:!1,waitingEmailCodeLength:a.length}};case"updateTwoFaError":return{...e,twoFaSettings:{...e.twoFaSettings,error:a.message}}}});var X=a(48),J=a(8),Z=a(35),ee=a(131),te=a(47),ae=a(111),se=a(77),ne=a(25),ce=a(62),re=a(42),oe=a(32),ie=a(154),le=a(141);a(197);var de=Object(c.h)(({id:e,name:t,value:a,label:s,checked:n=!1,disabled:r,inactive:o,noAnimation:i,onChange:l,onCheck:d})=>{const b=Object(c.m)(e=>{l&&l(e),d&&d(e.currentTarget.checked)},[l,d]),u=Object(J.a)("Switcher",r&&"disabled",o&&"inactive",i&&"no-animation");return c.a.createElement("label",{className:u,title:s},c.a.createElement("input",{type:"checkbox",id:e,name:t,value:a,checked:n,disabled:r,onChange:b}),c.a.createElement("span",{className:"widget"}))});a(198);const be=[0,1,2];var ue=Object(c.h)(Object(s.h)(e=>{const{query:t,fetchingStatus:a,chatId:s,date:n}=e.globalSearch,{currentUserId:c}=e,{byId:r}=e.chats,{theme:o,animationLevel:i}=e.settings.byKey;return{searchQuery:t,isLoading:!!a&&Boolean(a.chats||a.messages),currentUserId:c,chatsById:r,globalSearchChatId:s,searchDate:n,theme:o,animationLevel:i}},(e,t)=>Object(d.l)(t,["openChat","openTipsChat","setGlobalSearchDate","setGlobalSearchChatId","setSettingOption"]))(({content:e,contactsFilter:t,onSearchQuery:a,onSelectSettings:s,onSelectContacts:r,onSelectArchived:o,setGlobalSearchChatId:i,onReset:d,searchQuery:b,isLoading:u,currentUserId:O,globalSearchChatId:j,searchDate:g,theme:f,animationLevel:p,chatsById:I,openChat:v,openTipsChat:y,setGlobalSearchDate:C,setSettingOption:E})=>{const w=Object(ne.a)(),M=e===l.d.ChatList,S={date:void 0},k={id:void 0},N=Object(c.p)(()=>g?Object(x.a)(new Date(1e3*g)):void 0,[g]),P=Object(c.p)(()=>M&&I?Object.values(I).reduce((e,t)=>Object(m.hb)(t)&&t.unreadCount?e+1:e,0):0,[M,I]),T=Object(c.p)(()=>({onTrigger:e,isOpen:t})=>c.a.createElement(oe.a,{round:!0,ripple:M&&!h.g,size:"smaller",color:"translucent",className:t?"active":"",onClick:M?e:()=>d(),ariaLabel:M?w("AccDescrOpenMenu2"):"Return to chat list"},c.a.createElement("div",{className:Object(J.a)("animated-menu-icon",!M&&"state-back")})),[M,w,d]),A=Object(c.m)(()=>{b||a("")},[b,a]),R=Object(c.m)(()=>{v({id:O})},[O,v]),L=Object(c.m)(e=>{e.stopPropagation();const t="light"===f?"dark":"light";E({theme:t}),Object(se.a)(t,p>0)},[p,E,f]),F=Object(c.m)(e=>{e.stopPropagation();const t=0===p?2:0;be.forEach((e,a)=>{document.body.classList.toggle("animation-level-"+a,t===a)}),E({animationLevel:t})},[p,E]),D=Boolean(j)||e===l.d.GlobalSearch||e===l.d.Contacts,B=e===l.d.Contacts?w("SearchFriends"):w("Search");return c.a.createElement("div",{className:"LeftMainHeader"},c.a.createElement("div",{id:"LeftMainHeader",className:"left-header"},c.a.createElement(ce.a,{trigger:T,footer:`${n.f} alpha ${n.g}`},c.a.createElement(re.a,{icon:"saved-messages",onClick:R},w("SavedMessages")),c.a.createElement(re.a,{icon:"archive",onClick:o},c.a.createElement("span",{className:"menu-item-name"},w("ArchivedChats")),P>0&&c.a.createElement("div",{className:"archived-badge"},P)),c.a.createElement(re.a,{icon:"user",onClick:r},w("Contacts")),c.a.createElement(re.a,{icon:"settings",onClick:s},w("Settings")),c.a.createElement(re.a,{icon:"darkmode",onClick:L},c.a.createElement("span",{className:"menu-item-name"},w("lng_menu_night_mode")),c.a.createElement(de,{id:"darkmode",label:w("dark"===f?"lng_settings_disable_night_theme":"lng_settings_enable_night_theme"),checked:"dark"===f,noAnimation:!0})),c.a.createElement(re.a,{icon:"animations",onClick:F},c.a.createElement("span",{className:"menu-item-name capitalize"},w("Appearance.Animations").toLowerCase()),c.a.createElement(de,{id:"animations",label:"Toggle Animations",checked:p>0})),c.a.createElement(re.a,{icon:"help",onClick:y},w("TelegramFeatures")),c.a.createElement(re.a,{icon:"bug",href:n.x},"Report Bug"),c.a.createElement(re.a,{icon:"char-K",href:"https://web.telegram.org/k/",onClick:()=>{localStorage.setItem("kz_version",JSON.stringify("K"))}},"Switch to K Version"),c.a.createElement(re.a,{icon:"char-W",href:"https://web.telegram.org/?legacy=1"},"Switch to Old Version")),c.a.createElement(ie.a,{inputId:"telegram-search-input",parentContainerClassName:"LeftSearch",className:j||g?"with-picker-item":"",value:t||b,focused:D,isLoading:u,placeholder:B,autoComplete:"off",canClose:Boolean(j||g),onChange:a,onReset:d,onFocus:A},N&&c.a.createElement(le.a,{icon:"calendar",title:N,canClose:!0,isMinimized:Boolean(j),className:"search-date",onClick:C,clickArg:S}),j&&c.a.createElement(le.a,{chatOrUserId:j,onClick:i,canClose:!0,clickArg:k}))))})),me=a(21);a(199);var he=Object(s.h)(e=>Object(d.l)(e,["connectionState"]))(({connectionState:e})=>{const t=Object(ne.a)();return"connectionStateConnecting"===e&&c.a.createElement("div",{id:"ConnectionState",dir:t.isRtl?"rtl":void 0},c.a.createElement(me.a,{color:"black"}),c.a.createElement("div",{className:"state-text"},t("WaitingForNetwork")))}),Oe=a(132),je=a(51),ge=a(26),fe=(e,t,a)=>{const s=Object(c.q)(),n=(e=>Object(c.p)(()=>Object(g.g)(e=>e(),e),[e]))(t),r=Object(ge.a)();return Object(je.a)(()=>{let t=!0;n(()=>{s.current=e(),t||r()}),t=!1},a),s.current},pe=a(168),Ie=a(189);var ve=Object(c.h)(Object(s.h)(e=>{const{chats:{byId:t},users:{byId:a},chatFolders:{byId:s,orderedIds:n,activeChatFolder:c},currentUserId:r,lastSyncTime:i}=e;return{chatsById:t,usersById:a,chatFoldersById:s,orderedFolderIds:n,lastSyncTime:i,notifySettings:Object(o.eb)(e),notifyExceptions:Object(o.db)(e),activeChatFolder:c,currentUserId:r}},(e,t)=>Object(d.l)(t,["loadChatFolders","setActiveChatFolder","openChat"]))(({chatsById:e,usersById:t,chatFoldersById:a,notifySettings:s,notifyExceptions:n,orderedFolderIds:r,activeChatFolder:o,currentUserId:i,lastSyncTime:l,loadChatFolders:b,setActiveChatFolder:u,openChat:O})=>{const j=Object(c.q)(null),g=Object(ne.a)();Object(c.n)(()=>{l&&b()},[l,b]);const f=Object(c.p)(()=>r?r.map(e=>a[e]||{}).filter(Boolean):void 0,[a,r]),p=fe(()=>{if(!f||!f.length)return;const a=Object.keys(e).map(Number),c=f.map(c=>{const{unreadDialogsCount:r,hasActiveDialogs:o}=Object(m.p)(e,t,c,a,s,n)||{};return{id:c.id,badgeCount:r,isBadgeActive:o}});return Object(d.c)(c,"id")},3e3,[f,e,t,s,n]),I=Object(c.p)(()=>{if(f&&f.length)return[{title:g("FilterAllChats")},...f.map(e=>({title:e.title,...p&&p[e.id]}))]},[f,p,g]),v=Object(c.m)(e=>{u(e)},[u]);Object(c.n)(()=>{I&&I.length&&o>=I.length&&u(0)},[o,I,u]),Object(c.n)(()=>{if(j.current&&h.l&&I&&I.length)return Object(Oe.b)(j.current,{onSwipe:(e,t)=>{t===Oe.a.Left?u(Math.min(o+1,I.length-1)):t===Oe.a.Right&&u(Math.max(0,o-1))}})},[o,I,u]);const y=Object(c.q)();y.current=0!==o,Object(c.n)(()=>y.current?Object(te.a)(()=>{y.current&&u(0)}):void 0,[o,u]),Object(c.n)(()=>{const e=e=>{if(e.metaKey&&e.code.startsWith("Digit")&&I){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;if("0"===t)return void O({id:i});const a=Number(t)-1;if(a>I.length-1)return;u(a),e.preventDefault()}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}});const{shouldRender:C,transitionClassNames:E}=Object(Z.a)(!r,void 0,!0);function w(e){const t=Object.values(a).find(({title:e})=>e===I[o].title);return t&&0!==o?c.a.createElement(Ie.a,{folderType:"folder",folderId:t.id,noChatsText:g("FilterNoChatsToDisplay"),isActive:e}):c.a.createElement(Ie.a,{folderType:"all",isActive:e})}return c.a.createElement("div",{className:"ChatFolders"},I&&I.length?c.a.createElement(pe.a,{tabs:I,activeTab:o,onSwitchTab:v}):C?c.a.createElement("div",{className:Object(J.a)("tabs-placeholder",E)}):void 0,c.a.createElement(ae.a,{ref:j,name:g.isRtl?"slide-reversed":"slide",activeKey:o,renderCount:I?I.length:void 0},w))})),ye=a(11),Ce=a(17),Ee=a(16);var we=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"LeftSearch");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});var Me=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"ContactList");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)}),Se=a(53);a(210);let ke;var Ne=Object(c.h)(({isShown:e,onNewPrivateChat:t,onNewChannel:a,onNewGroup:s})=>{const[n,r]=Object(c.r)(!1);Object(c.n)(()=>{e||r(!1)},[e]);const o=Object(ne.a)(),i=Object(J.a)("NewChatButton",e&&"revealed",n&&"menu-is-open"),l=Object(c.m)(()=>{ke&&(clearTimeout(ke),ke=void 0)},[]),d=Object(c.m)(()=>{ke&&(clearTimeout(ke),ke=void 0),ke=window.setTimeout(()=>{r(!1)},750)},[]);return c.a.createElement("div",{className:i,onMouseEnter:l,onMouseLeave:d},c.a.createElement(oe.a,{round:!0,color:"primary",className:n?"active":"",onClick:()=>{r(!n)},ariaLabel:o(n?"Close":"NewMessageTitle"),tabIndex:-1},c.a.createElement("i",{className:"icon-new-chat-filled"}),c.a.createElement("i",{className:"icon-close"})),c.a.createElement(Se.a,{isOpen:n,positionX:"right",positionY:"bottom",autoClose:!0,onClose:()=>{r(!1)}},c.a.createElement(re.a,{icon:"channel",onClick:a},o("NewChannel")),c.a.createElement(re.a,{icon:"group",onClick:s},o("NewGroup")),c.a.createElement(re.a,{icon:"user",onClick:t},o("NewMessageTitle"))))});a(211);const Pe=Object.keys(l.d).length/2;let Te;var Ae=Object(c.h)(({content:e,searchQuery:t,searchDate:a,contactsFilter:s,onSearchQuery:n,onContentChange:r,onReset:o})=>{const[i,d]=Object(c.r)(h.l),b=Object(c.q)(!1),u=Object(c.m)(()=>{r(l.d.Settings)},[r]),m=Object(c.m)(()=>{r(l.d.Contacts)},[r]),O=Object(c.m)(()=>{r(l.d.NewChannelStep1)},[r]),j=Object(c.m)(()=>{r(l.d.NewGroupStep1)},[r]),g=Object(c.m)(()=>{r(l.d.Archived)},[r]),f=Object(c.m)(()=>{e===l.d.ChatList&&(b.current=!0,d(!0))},[e]),p=Object(c.m)(()=>{b.current=!1,Te&&(clearTimeout(Te),Te=void 0),Te=window.setTimeout(()=>{b.current||d(!1)},250)},[]);return Object(c.n)(()=>{let t;return e!==l.d.ChatList?t=window.setTimeout(()=>{d(!1)},250):(b.current||h.l)&&d(!0),()=>{t&&(clearTimeout(t),t=void 0)}},[e]),c.a.createElement("div",{id:"LeftColumn-main",onMouseEnter:h.l?void 0:f,onMouseLeave:h.l?void 0:p},c.a.createElement(ue,{content:e,contactsFilter:s,onSearchQuery:n,onSelectSettings:u,onSelectContacts:m,onSelectArchived:g,onReset:o}),c.a.createElement(he,null),c.a.createElement(ae.a,{name:"zoom-fade",renderCount:Pe,activeKey:e},n=>{switch(e){case l.d.ChatList:return c.a.createElement(ve,null);case l.d.GlobalSearch:return c.a.createElement(we,{searchQuery:t,searchDate:a,isActive:n,onReset:o});case l.d.Contacts:return c.a.createElement(Me,{filter:s});default:return}}),c.a.createElement(Ne,{isShown:i,onNewPrivateChat:m,onNewChannel:O,onNewGroup:j}))});var xe=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"Settings");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});var Re=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"NewChat");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});var Le,Fe=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"ArchivedChats");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});a(212);!function(e){e[e.Main=0]="Main",e[e.Settings=1]="Settings",e[e.Archived=2]="Archived",e[e.NewGroup=3]="NewGroup",e[e.NewChannel=4]="NewChannel"}(Le||(Le={}));const De=Object.keys(Le).length/2;var Be=Object(c.h)(Object(s.h)(e=>{const{globalSearch:{query:t,date:a},chatFolders:{activeChatFolder:s}}=e;return{searchQuery:t,searchDate:a,activeChatFolder:s}},(e,t)=>Object(d.l)(t,["setGlobalSearchQuery","setGlobalSearchChatId","resetChatCreation","setGlobalSearchDate","loadPasswordInfo","clearTwoFaError"]))(({searchQuery:e,searchDate:t,activeChatFolder:a,setGlobalSearchQuery:s,setGlobalSearchChatId:n,resetChatCreation:r,setGlobalSearchDate:o,loadPasswordInfo:i,clearTwoFaError:d})=>{const[b,u]=Object(c.r)(l.d.ChatList),[m,O]=Object(c.r)(l.m.Main),[j,g]=Object(c.r)(""),[f,p]=Object(c.r)(0);let I=Le.Main;switch(b){case l.d.Archived:I=Le.Archived;break;case l.d.Settings:I=Le.Settings;break;case l.d.NewChannelStep1:case l.d.NewChannelStep2:I=Le.NewChannel;break;case l.d.NewGroupStep1:case l.d.NewGroupStep2:I=Le.NewGroup}const v=Object(c.m)(e=>{if(b!==l.d.NewGroupStep2||e){if(b===l.d.NewGroupStep1){const e=document.getElementById("new-group-picker-search");e&&e.blur()}if(b===l.d.Settings)switch(m){case l.m.EditProfile:case l.m.Folders:case l.m.General:case l.m.Notifications:case l.m.Privacy:case l.m.Language:return void O(l.m.Main);case l.m.GeneralChatBackground:return void O(l.m.General);case l.m.GeneralChatBackgroundColor:return void O(l.m.GeneralChatBackground);case l.m.PrivacyPhoneNumber:case l.m.PrivacyLastSeen:case l.m.PrivacyProfilePhoto:case l.m.PrivacyForwarding:case l.m.PrivacyGroupChats:case l.m.PrivacyActiveSessions:case l.m.PrivacyBlockedUsers:case l.m.TwoFaDisabled:case l.m.TwoFaEnabled:case l.m.TwoFaCongratulations:return void O(l.m.Privacy);case l.m.PrivacyPhoneNumberAllowedContacts:case l.m.PrivacyPhoneNumberDeniedContacts:return void O(l.m.PrivacyPhoneNumber);case l.m.PrivacyLastSeenAllowedContacts:case l.m.PrivacyLastSeenDeniedContacts:return void O(l.m.PrivacyLastSeen);case l.m.PrivacyProfilePhotoAllowedContacts:case l.m.PrivacyProfilePhotoDeniedContacts:return void O(l.m.PrivacyProfilePhoto);case l.m.PrivacyForwardingAllowedContacts:case l.m.PrivacyForwardingDeniedContacts:return void O(l.m.PrivacyForwarding);case l.m.PrivacyGroupChatsAllowedContacts:case l.m.PrivacyGroupChatsDeniedContacts:return void O(l.m.PrivacyGroupChats);case l.m.TwoFaNewPassword:return void O(l.m.TwoFaDisabled);case l.m.TwoFaNewPasswordConfirm:return void O(l.m.TwoFaNewPassword);case l.m.TwoFaNewPasswordHint:return void O(l.m.TwoFaNewPasswordConfirm);case l.m.TwoFaNewPasswordEmail:return void O(l.m.TwoFaNewPasswordHint);case l.m.TwoFaNewPasswordEmailCode:return void O(l.m.TwoFaNewPasswordEmail);case l.m.TwoFaChangePasswordCurrent:case l.m.TwoFaTurnOff:case l.m.TwoFaRecoveryEmailCurrentPassword:return void O(l.m.TwoFaEnabled);case l.m.TwoFaChangePasswordNew:return void O(l.m.TwoFaChangePasswordCurrent);case l.m.TwoFaChangePasswordConfirm:return void O(l.m.TwoFaChangePasswordNew);case l.m.TwoFaChangePasswordHint:return void O(l.m.TwoFaChangePasswordConfirm);case l.m.TwoFaRecoveryEmail:return void O(l.m.TwoFaRecoveryEmailCurrentPassword);case l.m.TwoFaRecoveryEmailCode:return void O(l.m.TwoFaRecoveryEmail);case l.m.FoldersCreateFolder:case l.m.FoldersEditFolder:return void O(l.m.Folders)}b!==l.d.ChatList||0!==a?(u(l.d.ChatList),g(""),s({query:""}),o({date:void 0}),n({id:void 0}),r(),setTimeout(()=>{p(Date.now())},250)):u(l.d.GlobalSearch)}else u(l.d.NewGroupStep1)},[b,a,s,o,n,r,m]),y=Object(c.m)(t=>{b!==l.d.Contacts?(u(l.d.GlobalSearch),t!==e&&s({query:t})):g(t)},[b,s,e]);return Object(c.n)(()=>b!==l.d.ChatList||0===a?Object(te.a)(()=>v()):void 0,[a,b,v]),Object(c.n)(()=>{d(),m===l.m.Privacy&&i()},[d,i,m]),c.a.createElement(ae.a,{id:"LeftColumn",name:h.g?"slide-layers":"push-slide",renderCount:De,activeKey:I},a=>{switch(I){case Le.Archived:return c.a.createElement(Fe,{isActive:a,onReset:v});case Le.Settings:return c.a.createElement(xe,{currentScreen:m,onScreenSelect:O,onReset:v});case Le.NewChannel:return c.a.createElement(Re,{key:f,isChannel:!0,content:b,onContentChange:u,onReset:v});case Le.NewGroup:return c.a.createElement(Re,{key:f,content:b,onContentChange:u,onReset:v});default:return c.a.createElement(Ae,{content:b,searchQuery:e,searchDate:t,contactsFilter:j,onContentChange:u,onSearchQuery:y,onReset:v})}})})),Ue=a(139),He=a(12),Ge=a(13),qe=a(56);var _e=()=>{const[e,t]=Object(c.r)(qe.a.get());return Object(c.n)(()=>{const e=Object(g.g)(()=>{t(qe.a.get())},250,!1);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e},Ve=a(175);function $e(e,t){const a=e<=n.db?16:32,s=function(e){if(e>n.ab){const t=Math.min(Math.max(.25*e,288),424),a=Math.min(.25*e,424);return Math.min(e-t-a,728)}if(e>n.Z){const t=Math.min(Math.max(.4*e,288),424);return Math.min(e-t,728)}if(e>728)return 728;return e}(e),c=e<=n.db?54:64,r=t?s-a-c:s-a,o=e>n.db?Math.min(s-a,512):s-a,i=o/r,l=r/o;return{composerHiddenScale:i,toolbarHiddenScale:l,composerTranslateX:t?c/2*l:0,toolbarTranslateX:t?c/2*-1*i:0,unpinHiddenScale:o/258,toolbarForUnpinHiddenScale:258/o}}var ze=a(134),We=a(144),Ke=a(135),Qe=a(49),Ye=a(109),Xe=a(123);var Je=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"HeaderMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var Ze=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const n=Object(o.f)(e,t),c=Boolean(n&&Object(m.jb)(n));if(n&&n.isRestricted)return{noMenu:!0};const r=Object(o.P)(e,t),l="thread"===s&&a===i.MAIN_THREAD_ID,d="thread"===s&&a!==i.MAIN_THREAD_ID,b=Object(o.W)(e),u=Boolean(Object(o.L)(e,t)),O=Boolean(l&&n&&(c||Object(m.nb)(n))&&n.isNotJoined),j=l||d,g=l&&!r&&!O,f=!Object(o.S)(e),p=l&&!O;return{noMenu:!(h.g&&O||h.g&&j||g||f||p),isChannel:c,isRightColumnShown:b,canStartBot:u,canSubscribe:O,canSearch:j,canMute:g,canSelect:f,canLeave:p}},(e,t)=>Object(d.l)(t,["joinChannel","sendBotCommand","openLocalTextSearch"]))(({chatId:e,threadId:t,noMenu:a,isChannel:s,canStartBot:n,canSubscribe:r,canSearch:o,canMute:i,canSelect:l,canLeave:d,isRightColumnShown:b,joinChannel:u,sendBotCommand:m,openLocalTextSearch:O})=>{const j=Object(c.q)(null),[g,f]=Object(c.r)(!1),[p,I]=Object(c.r)(void 0),v=Object(c.m)(()=>{f(!0);const e=j.current.getBoundingClientRect();I({x:e.right,y:e.bottom})},[]),y=Object(c.m)(()=>{f(!1)},[]),C=Object(c.m)(()=>{I(void 0)},[]),E=Object(c.m)(()=>{u({chatId:e})},[u,e]),w=Object(c.m)(()=>{m({command:"/start"})},[m]),M=Object(c.m)(()=>{if(O(),h.g){document.querySelector("#MobileSearch input").focus()}else setTimeout(()=>{const e=document.querySelector(".RightHeader .SearchInput input");e&&e.focus()},400)},[O]),S=Object(ne.a)();return c.a.createElement("div",{className:"HeaderActions"},!h.g&&r&&c.a.createElement(oe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:E},S(s?"Subscribe":"Join Group")),!h.g&&n&&c.a.createElement(oe.a,{size:"tiny",ripple:!0,fluid:!0,onClick:w},S("Start")),!h.g&&o&&c.a.createElement(oe.a,{round:!0,ripple:b,color:"translucent",size:"smaller",onClick:M,ariaLabel:"Search in this chat"},c.a.createElement("i",{className:"icon-search"})),(h.g||!r)&&c.a.createElement(oe.a,{ref:j,className:g?"active":"",round:!0,ripple:!h.g,size:"smaller",color:"translucent",disabled:a,ariaLabel:"More actions",onClick:v},c.a.createElement("i",{className:"icon-more"})),p&&c.a.createElement(Je,{chatId:e,threadId:t,isOpen:g,anchor:p,isChannel:s,canSubscribe:r,canSearch:o,canMute:i,canSelect:l,canLeave:d,onSubscribeChannel:E,onSearchClick:M,onClose:y,onCloseAnimationEnd:C}))})),et=a(115),tt=a(23),at=a(108),st=a(44);function nt(e){const t=e&&Object(m.E)(e),{sticker:a}=e&&e.content||{},s=t&&a&&!Object(h.p)()&&t.includes("image/webp"),[r,o]=Object(c.r)(st.a),i=e&&e.id;return Object(c.o)(()=>{s&&Object(st.c)("b64-"+i,t).then(o).catch(e=>{n.p&&console.error(e)})},[i,s,t]),s?r:t}var ct=a(117),rt=a(43),ot=a(34);function it(e,t,a,s,n){return`M${e},${t+n}a${n},${n},0,0,1,\n ${a},0v${s-2*n}a${n},${n},0,0,1,${-a},0Z`}var lt=Object(c.h)(({count:e,index:t})=>{const a=Object(c.q)(null),s=Object(c.p)(()=>function(e,t){const a=e-t-1,s=function(e){let t=8;1===e?t=36:2===e?t=17:3===e?t=11:(4===e||e>3)&&(t=7.5);return t}(e),n=function(e,t){let a=36;1===e?a=36:2===e?a=17:3===e?a=1===t?12:11:(4===e||e>3)&&(a=7.5);return a}(e,a),c=function(e,t){return e<=3?36:t*e+2*(e-1)}(e,s),r="clipPath"+e,o=function(e,t,a){let s="";if(3===a)s=it(0,0,2,t,1)+it(0,12,2,t+1,1)+it(0,25,2,t,1);else for(let e=0;e<a;e++)s+=it(0,(t+2)*e,2,t,1);return`<clipPath id="${e}">\n <path d="${s}" />\n </clipPath>`}(r,s,e),i=function(e,t,a){if(1===a)return 0;if(2===a)return 0===e?0:t+2;return 3===a?0===e?0:1===e?12:25:(t+2)*e}(a,s,e),l=function(e,t,a,s){if(t<=4)return 0;if(e<=1)return 0;if(e>=t-2)return s-36;return(a+4)/2+(e-2)*(a+2)}(a,e,s,c);return{markHeight:n,clipPath:o,markTranslateY:i,trackTranslateY:l,trackHeight:c,clipPathId:r}}(e,t),[e,t]);if(Object(c.n)(()=>{if(!a.current)return;const{trackHeight:e,trackTranslateY:t,markHeight:n,markTranslateY:c,clipPathId:r,clipPath:o}=s,i=a.current.firstElementChild;if(a&&a.current){const s=a.current,{style:l}=s;l.height=e+"px",l.transform=`translateY(-${t}px)`,l.clipPath=`url("#${r}")`;const d=s.querySelector("svg"),b=s.querySelector("div"),u=s.querySelector("defs");d||i&&(i.innerHTML=`<svg height="0" width="0"><defs> ${o} </defs></svg>`),u&&(u.innerHTML=o),b&&(b.style.height=n+"px",b.style.transform=`translateY(${c}px)`)}},[s]),1===e)return c.a.createElement("div",{className:"pinned-message-border"},c.a.createElement("div",{className:"pinned-message-border-wrapper-1",ref:a}));const{trackHeight:n,trackTranslateY:r,markHeight:o,markTranslateY:i,clipPathId:l}=s;return c.a.createElement("div",{className:Object(J.a)("pinned-message-border",e>4&&"pinned-message-border-mask")},c.a.createElement("div",{className:"pinned-message-border-wrapper",ref:a,style:`clip-path: url("#${l}"); width: 2px;\n height: ${n}px; transform: translateY(-${r}px);`},c.a.createElement("span",null),c.a.createElement("div",{className:"pinned-message-border-mark",style:`height: ${o}px; transform: translateY(${i}px);`})))});var dt=Object(c.h)(({message:e,count:t,index:a,customTitle:s,className:n,onUnpinMessage:r,onClick:o,onAllPinnedClick:i})=>{const l=Object(ne.a)(),d=nt(e),b=Object(at.a)(Object(m.D)(e,"pictogram")),u=Object(m.N)(l,e,Boolean(d)),[h,O,j]=Object(ot.a)(),g=Object(c.m)(()=>{j(),r&&r(e.id)},[j,r,e.id]);return c.a.createElement("div",{className:Object(J.a)("HeaderPinnedMessage-wrapper",n)},t>1&&c.a.createElement(oe.a,{round:!0,size:"smaller",color:"translucent",className:"pin-list-button",ariaLabel:l("EventLogFilterPinnedMessages"),onClick:i},c.a.createElement("i",{className:"icon-pin-list"})),r&&c.a.createElement(oe.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:l("UnpinMessageAlertTitle"),className:"unpin-button",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(ct.a,{isOpen:h,onClose:j,text:"Would you like to unpin this message?",confirmLabel:"Unpin",confirmHandler:g}),c.a.createElement("div",{className:"HeaderPinnedMessage",onClick:o,dir:l.isRtl?"rtl":void 0},c.a.createElement(lt,{count:t,index:a}),d&&function(e,t){const{width:a,height:s}=Object(et.k)();return c.a.createElement("img",{src:t||e,width:a,height:s,alt:""})}(d,b),c.a.createElement("div",{className:"message-text"},c.a.createElement("div",{className:"title",dir:"auto"},s||`${l("PinnedMessage")} ${a>0?"#"+(t-a):""}`),c.a.createElement("p",{dir:"auto"},Object(tt.a)(u))),c.a.createElement(rt.a,null)))}),bt=a(54),ut=a(176);a(215);var mt=Object(s.h)((e,{message:t})=>({sender:Object(o.tb)(e,t)}),(e,t)=>Object(d.l)(t,["focusMessage","closeAudioPlayer"]))(({message:e,className:t,noUi:a,sender:s,focusMessage:n,closeAudioPlayer:r})=>{const o=Object(ne.a)(),i=s?Object(m.V)(o,s):void 0,l=bt.c(Object(m.D)(e,"inline")),{playPause:d,isPlaying:b}=Object(ut.a)(Object(m.A)(e),Object(m.r)(e),l,void 0,void 0,!0),u=Object(c.m)(()=>{n({chatId:e.chatId,messageId:e.id})},[n,e.chatId,e.id]),O=Object(c.m)(()=>{b&&d(),r()},[r,b,d]);if(a)return;const j=Object(m.u)(e);return c.a.createElement("div",{className:Object(J.a)("AudioPlayer",t),dir:o.isRtl?"rtl":void 0},c.a.createElement(oe.a,{round:!0,ripple:!h.g,color:"translucent",size:"smaller",className:Object(J.a)("toggle-play",b?"pause":"play"),onClick:d,ariaLabel:b?"Pause audio":"Play audio"},c.a.createElement("i",{className:"icon-play"}),c.a.createElement("i",{className:"icon-pause"})),c.a.createElement("div",{className:"AudioPlayer-content",onClick:u},j?function(e){const{title:t,performer:a,fileName:s}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},Object(tt.a)(t||s)),a&&c.a.createElement("div",{className:"subtitle",dir:"auto"},Object(tt.a)(a)))}(j):function(e,t){return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"title",dir:"auto"},t&&Object(tt.a)(t)),c.a.createElement("div",{className:"subtitle",dir:"auto"},e))}(o("AttachAudio"),i),c.a.createElement(rt.a,null)),c.a.createElement(oe.a,{round:!0,className:"player-close",color:"translucent",size:"smaller",onClick:O,ariaLabel:"Close player"},c.a.createElement("i",{className:"icon-close"})))});a(216);var ht=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const{isLeftColumnShown:n,lastSyncTime:c}=e,{byId:r}=e.chats,l=Object(o.f)(e,t),{typingStatus:d}=l||{},{chatId:b,messageId:u}=e.audioPlayer,m=b&&u?Object(o.k)(e,b,u):void 0,h=Object(o.Db)(e,t,a);let O;if("pinned"===s){const a=Object(o.jb)(e,t);O=a&&a.length}else if("scheduled"===s){const a=Object(o.ob)(e,t);O=a&&a.length}else if("thread"===s&&a!==i.MAIN_THREAD_ID){const s=Object(o.Cb)(e,t,a);s&&(O=s.messagesCount)}const j={typingStatus:d,isLeftColumnShown:n,isRightColumnShown:Object(o.W)(e),isSelectModeActive:Object(o.S)(e),audioMessage:m,chat:l,chatsById:r,originChatId:h?h.id:t,messagesCount:O,isChatWithSelf:Object(o.P)(e,t),isChatWithBot:l&&Object(o.O)(e,l),lastSyncTime:c,notifySettings:Object(o.eb)(e),notifyExceptions:Object(o.db)(e)},g=Object(o.m)(e,t);if("thread"!==s||!g)return j;if(Object.assign(j,{messagesById:g}),a!==i.MAIN_THREAD_ID){const s=Object(o.Eb)(e,t,a),n=s?Object(o.k)(e,t,s):void 0,c=n?Object(o.K)(e,n):void 0;return{...j,pinnedMessageIds:s,canUnpin:!1,topMessageSender:c}}const f=Object(o.jb)(e,t);if(f&&f.length){const t=g[f[0]],{canUnpin:s}=t&&Object(o.b)(e,t,a)||{};return{...j,pinnedMessageIds:f,canUnpin:s}}return j},(e,t)=>Object(d.l)(t,["openChatWithInfo","pinMessage","focusMessage","openChat","loadPinnedMessages","toggleLeftColumn","exitMessageSelectMode"]))(({chatId:e,threadId:t,messageListType:a,pinnedMessageIds:s,messagesById:r,canUnpin:o,topMessageSender:l,typingStatus:d,isSelectModeActive:b,isLeftColumnShown:u,isRightColumnShown:O,audioMessage:j,chat:g,chatsById:f,originChatId:p,messagesCount:I,isChatWithSelf:v,isChatWithBot:y,lastSyncTime:C,notifySettings:E,notifyExceptions:w,openChatWithInfo:M,pinMessage:S,focusMessage:k,openChat:N,loadPinnedMessages:P,toggleLeftColumn:T,exitMessageSelectMode:A})=>{const x=Object(ne.a)(),[R,L]=Object(c.r)(0),F=Array.isArray(s)?s[R]:s,D=r&&F?r[F]:void 0,B=Array.isArray(s)?s.length:s?1:0,U=g&&Object(m.l)(x,g).length,H=l?Object(m.V)(x,l):void 0;Object(c.n)(()=>{t===i.MAIN_THREAD_ID&&C&&P({chatId:e})},[e,P,C,t]),Object(c.n)(()=>{L(0)},[s]),Object(We.a)(e,F,D);const{width:G}=_e(),q=G<=n.Z,_=G>=n.db&&u,V=Object(c.q)(null),$=Object(c.q)(!0),z=Object(c.m)(()=>{M({id:e})},[M,e]),W=Object(c.m)(t=>{S({chatId:e,messageId:t,isUnpin:!0})},[S,e]),K=Object(c.m)(()=>{if(D){k({chatId:D.chatId,threadId:t,messageId:D.id});const e=Object(ze.a)(B,R+1);L(e)}},[D,k,t,B,R]),Q=Object(c.m)(()=>{N({id:e,threadId:i.MAIN_THREAD_ID,type:"pinned"})},[N,e]),Y=Object(c.m)(()=>{if(h.g){const e=document.getElementById(n.v);e&&e.blur()}t!==i.MAIN_THREAD_ID||"thread"!==a?("scheduled"===a&&b&&A(),N({id:p,threadId:i.MAIN_THREAD_ID})):h.g?N({id:void 0}):T()},[N,p,t,a,T,b,A]),X=Object(c.p)(()=>{if(!q||!f)return;let e=!1;const t=Object.values(f).reduce((t,a)=>{if(Object(m.hb)(a))return t;const s=a.unreadCount||0;return!s||Object(m.Cb)(a,E,w)&&!a.unreadMentionsCount||(e=!0),t+s},0);return t?{isActive:e,totalCount:t}:void 0},[q,f,E,w]),ee=G>=n.Z&&G<n.jb||G>n.db&&G<n.Z&&(!U||U>30),te=ee||G>n.ab&&G<n.kb,{shouldRender:se,transitionClassNames:ce}=Object(Z.a)(Boolean(j)),re=Object(Ke.a)(j),{shouldRender:ie,transitionClassNames:le}=Object(Z.a)(D&&!se),de=Object(Ke.a)(D),be=Object(Ke.a)(H),ue=ie&&de||se&&re;function me(){return"thread"===a&&t===i.MAIN_THREAD_ID?c.a.createElement(c.a.Fragment,null,q&&he(_,X),c.a.createElement("div",{className:"chat-info-wrapper",onClick:z},Object(m.lb)(e)?c.a.createElement(Ye.a,{userId:e,typingStatus:d,withFullInfo:y,withMediaViewer:!0,withUpdatingStatus:!0,noRtl:!0}):c.a.createElement(Xe.a,{chatId:e,typingStatus:d,noRtl:!0,withMediaViewer:!0,withFullInfo:!0,withUpdatingStatus:!0}))):"thread"===a?c.a.createElement(c.a.Fragment,null,he(),c.a.createElement("h3",null,x("CommentsCount",I))):"pinned"===a?c.a.createElement(c.a.Fragment,null,he(),c.a.createElement("h3",null,x("PinnedMessagesCount",I))):"scheduled"===a?c.a.createElement(c.a.Fragment,null,he(),c.a.createElement("h3",null,v?x("Reminders"):x("messages",I))):void 0}function he(e=!1,t){return c.a.createElement("div",{className:"back-button"},c.a.createElement(oe.a,{round:!0,size:"smaller",color:"translucent",onClick:Y,ariaLabel:e?"Close":"Back"},c.a.createElement("div",{className:Object(J.a)("animated-close-icon",!e&&"state-back")})),t&&c.a.createElement("div",{className:"unread-count "+(t.isActive?"active":"")},Object(Qe.b)(t.totalCount)))}return Object(c.n)(()=>{const e=V.current;if(e)return te&&ue?void(O||ee?($.current&&(e.classList.add("tools-stacked","animated"),$.current=!1),setTimeout(()=>{e.classList.remove("animated")},350)):(e.classList.remove("tools-stacked"),$.current=!0)):(e.classList.remove("tools-stacked","animated"),void($.current=!0))},[te,ue,ee,O]),c.a.createElement("div",{className:"MiddleHeader",ref:V},c.a.createElement(ae.a,{name:"slide-fade",activeKey:"thread"===a?t:1},me),c.a.createElement("div",{className:"header-tools"},ie&&de&&!se&&c.a.createElement(dt,{key:e,message:de,count:B,index:R,customTitle:be,className:le,onUnpinMessage:o?W:void 0,onClick:K,onAllPinnedClick:Q}),se&&re&&c.a.createElement(mt,{key:Object(m.A)(re),message:re,className:ce}),c.a.createElement(Ze,{chatId:e,threadId:t,messageListType:a})))})),Ot=a(159);function jt(e){return"albumId"in e}function gt(e,t){let a,s=[],n={originalDate:e[0].date,datetime:Number(Object(x.j)(1e3*e[0].date)),senderGroups:[s]};const c=[n];return e.forEach((r,o)=>{r.isInAlbum?a?(a.messages.push(r),r.content.text&&(a.mainMessage=r)):a={albumId:r.groupedId,messages:[r],mainMessage:r}:s.push(r);const i=e[o+1];if(!a||i&&i.groupedId&&i.groupedId===a.albumId||(s.push(a),a=void 0),i){const e=Number(Object(x.j)(1e3*i.date));n.datetime!==e?(n={originalDate:i.date,datetime:e,senderGroups:[]},c.push(n),s=[],n.senderGroups.push(s)):(i.id===t||r.senderId!==i.senderId||r.isOutgoing!==i.isOutgoing||Object(m.db)(r)||Object(m.db)(i)||r.forwardInfo&&i.forwardInfo&&(r.forwardInfo.senderUserId!==i.forwardInfo.senderUserId||r.forwardInfo.fromChatId!==i.forwardInfo.fromChatId||r.forwardInfo.hiddenUserName!==i.forwardInfo.hiddenUserName)||r.inlineButtons||i.inlineButtons)&&(s=[],n.senderGroups.push(s))}}),c}var ft=a(107);function pt(){const[e,t]=Object(ot.a)(!1),a=(s=1e3,n=!1,Object(c.p)(()=>Object(g.a)(e=>e(),s,n,r),[s,n,r]));var s,n,r;return{isScrolled:e,updateStickyDates:Object(c.m)((e,s)=>{t(),document.body.classList.contains("is-scrolling-messages")||Object(g.b)(()=>{document.body.classList.add("is-scrolling-messages")}),a(()=>{Object(g.b)(()=>{const t=document.querySelector(".stuck");t&&t.classList.remove("stuck");const a=function(e,t){const a=e.querySelectorAll(".sticky-date"),s=e.scrollTop;return Array.from(a).find(e=>{const{offsetTop:a,offsetHeight:n}=e,c=a-s;return-n<=c&&c<=(t?60:10)})}(e,s);a&&a.classList.add("stuck"),document.body.classList.remove("is-scrolling-messages")})})},[t,a])}}var It=a(155),vt=a(124);let yt=!1;var Ct=({containerRef:e,className:t,messageIds:a,focusingId:s,loadMoreForwards:r,loadMoreBackwards:o,isViewportNewest:i,firstUnreadId:l,onFabToggle:d,onNotchToggle:b,children:u})=>{const m=Object(c.q)(null),h=Object(c.q)(null),O=Object(c.q)(null),j=Object(c.m)(()=>{if(yt)return;if(!a||!a.length)return d(!1),void b(!1);if(!i)return d(!0),void b(!0);const{offsetHeight:t,scrollHeight:s,scrollTop:n}=e.current,c=s-n-t,r=c<=0;d(l?!r:!(c<=50)),b(!r)},[a,i,e,d,l,b]),{observe:g,freeze:f,unfreeze:p}=Object(ft.a)({rootRef:e,margin:n.U},t=>{if(!r||!o)return;const a=t.find(({isIntersecting:e})=>e);if(!a)return;const{target:s}=a;"backwards-trigger"===s.className?(Object(It.a)(e.current),o()):"forwards-trigger"===s.className&&(Object(It.a)(e.current),r())});Object(ft.c)(m,g),Object(ft.c)(h,g);const{observe:I,freeze:v,unfreeze:y}=Object(ft.a)({rootRef:e,margin:50},j);Object(ft.c)(O,I);const{observe:C}=Object(ft.a)({rootRef:e},j);return Object(ft.c)(O,C),Object(je.a)(()=>{s?(f(),v()):(y(),p())},[s]),Object(je.a)(()=>{yt=!0,setTimeout(()=>{yt=!1},100)},[a]),Object(c.n)(j,[l]),c.a.createElement("div",{className:t,teactFastList:!0},c.a.createElement("div",{ref:m,key:"backwards-trigger",className:"backwards-trigger"}),u,c.a.createElement("div",{ref:h,key:"forwards-trigger",className:"forwards-trigger"}),c.a.createElement("div",{ref:O,key:"fab-trigger",className:"fab-trigger"}))},Et=a(145),wt=a(146);function Mt(e){return"number"==typeof e}function St(e,t){return e?t?238:175:100}function kt(e){const t=Object(m.tb)(e),a=Object(m.qb)(e),s=Object(m.G)(e)||Object(m.R)(e),n=Object(m.P)(e),c=Boolean(Object(m.R)(e)),{width:r,height:o}=s?Object(et.f)(s,t,a,c):Object(et.h)(n,t,a),i=St(Boolean(Object(m.O)(e)));let l=1;r<i&&i-r<12&&(l=i/r),o*l<90&&90-o*l<12&&(l=90/o);const d=Math.round(r*l),b=Math.round(o*l);return{width:d,height:b,isSmall:d<i||b<90}}const Nt=0,Pt=1,Tt=2,At=4,xt=8;function Rt(e,t){return e.reduce((e,t)=>e+t,t)}function Lt(e,t,a){return e<t?t:e>a?a:e}function Ft(e){const t={width:0,height:0};return e.forEach(({dimensions:e,sides:a})=>{a&Tt&&(t.width=e.width+e.x),a&At&&(t.height=e.height+e.y)}),t}function Dt(e,t,a,s){const c=a.messages.map(e=>{const t=kt(e);return t.width/t.height});const r=function(e){return e.map(e=>e>1.2?"w":e<.8?"n":"q").join("")}(c),o=function(e){return e.reduce((e,t)=>t+e,1)/e.length}(c),i=c.length,l=c.some(e=>e>2),d=function(e,t,a){return a<=n.db?a/100*69-(t?1.625:0)*et.c:((e?30:29)-(t?1.625:0))*et.c}(e,t,s);let b;const u={ratios:c,proportions:r,averageRatio:o,maxWidth:d,minWidth:100,maxHeight:d,spacing:2};return b=i>=5||l?function({ratios:e,averageRatio:t,maxWidth:a,minWidth:s,spacing:n,maxHeight:c=4*a/3}){const r=function(e,t){return e.map(e=>t>1.1?Lt(e,1,2.75):Lt(e,.6667,1))}(e,t),o=e.length,i=new Array(o),l=[],d=e=>{const t=[];let s=0;e.forEach(e=>{t.push(((e,t)=>{const s=Rt(r.slice(e,e+t),0);return(a-(t-1)*n)/s})(s,e)),s+=e}),l.push({lineCounts:e,heights:t})};for(let e=1;e!==o;++e){const t=o-e;e<=3&&t<=3&&d([e,t])}for(let e=1;e!==o-1;++e)for(let a=1;a!==o-e;++a){const s=o-e-a;e<=3&&a<=(t<.85?4:3)&&s<=3&&d([e,a,s])}for(let e=1;e!==o-1;++e)for(let t=1;t!==o-e;++t)for(let a=1;a!==o-e-t;++a){const s=o-e-t-a;e<=3&&t<=3&&a<=3&&s<=4&&d([e,t,a,s])}let b,u=0;for(let e=0;e<l.length;e++){const{heights:t,lineCounts:a}=l[e],r=a.length,o=Rt(t,0)+n*(r-1),i=Math.min(...t)<s?1.5:1,d=(()=>{for(let e=1;e!==r;++e)if(a[e-1]>a[e])return 1.5;return 1})(),m=Math.abs(o-c)*i*d;(!b||m<u)&&(b=l[e],u=m)}const m=b.lineCounts,h=b.heights,O=m.length;let j=0,g=0;for(let e=0;e!==O;++e){const t=m[e],s=h[e],c=Math.round(s);let o=0;for(let l=0;l!==t;++l){const d=Nt|(0===e?Pt:Nt)|(e===O-1?At:Nt)|(0===l?xt:Nt)|(l===t-1?Tt:Nt),b=r[j],u=l===t-1?a-o:Math.round(b*s);i[j]={dimensions:{x:o,y:g,width:u,height:c},sides:d},o+=u+n,++j}g+=c+n}return i}(u):2===i?function(e){const{ratios:t,proportions:a,averageRatio:s}=e;return"ww"===a&&s>1.4&&t[1]-t[0]<.2?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=Math.round(Math.min(a/t[0],Math.min(a/t[1],(n-s)/2)));return[{dimensions:{x:0,y:0,width:a,height:c},sides:xt|Pt|Tt},{dimensions:{x:0,y:c+s,width:a,height:c},sides:xt|At|Tt}]}(e):"ww"===a||"qq"===a?function(e){const{ratios:t,maxWidth:a,spacing:s,maxHeight:n}=e,c=(a-s)/2,r=Math.round(Math.min(c/t[0],Math.min(c/t[1],n)));return[{dimensions:{x:0,y:0,width:c,height:r},sides:Pt|xt|At},{dimensions:{x:c+s,y:0,width:c,height:r},sides:Pt|Tt|At}]}(e):function(e){const{ratios:t,minWidth:a,maxWidth:s,spacing:n,maxHeight:c}=e,r=Math.round(1.5*a),o=Math.min(Math.round(Math.max(.4*(s-n),(s-n)/t[0]/(1/t[0]+1/t[1]))),s-n-r),i=s-o-n,l=Math.min(c,Math.round(Math.min(i/t[0],o/t[1])));return[{dimensions:{x:0,y:0,width:i,height:l},sides:Pt|xt|At},{dimensions:{x:i+n,y:0,width:o,height:l},sides:Pt|Tt|At}]}(e)}(u):3===i?function(e){const{proportions:t}=e;return"n"===t[0]?function(e){const{maxHeight:t,spacing:a,ratios:s,maxWidth:n,minWidth:c}=e,r=t,o=Math.round(Math.min((t-a)/2,s[1]*(n-a)/(s[2]+s[1]))),i=r-o-a,l=Math.max(c,Math.round(Math.min((n-a)/2,Math.min(o*s[2],i*s[1])))),d=Math.min(Math.round(r*s[0]),n-a-l);return[{dimensions:{x:0,y:0,width:d,height:r},sides:Pt|xt|At},{dimensions:{x:d+a,y:0,width:l,height:i},sides:Pt|Tt},{dimensions:{x:d+a,y:i+a,width:l,height:o},sides:At|Tt}]}(e):function(e){const{maxWidth:t,ratios:a,maxHeight:s,spacing:n}=e,c=t,r=Math.round(Math.min(c/a[0],.66*(s-n))),o=(t-n)/2,i=Math.min(s-r-n,Math.round(Math.min(o/a[1],o/a[2])));return[{dimensions:{x:0,y:0,width:c,height:r},sides:xt|Pt|Tt},{dimensions:{x:0,y:r+n,width:o,height:i},sides:At|xt},{dimensions:{x:o+n,y:r+n,width:c-o-n,height:i},sides:At|Tt}]}(e)}(u):function(e){const{proportions:t}=e;return"w"===t[0]?function({maxWidth:e,ratios:t,spacing:a,maxHeight:s,minWidth:n}){const c=e,r=Math.round(Math.min(c/t[0],.66*(s-a))),o=Math.round((e-2*a)/(t[1]+t[2]+t[3])),i=Math.max(n,Math.round(Math.min(.4*(e-2*a),o*t[1]))),l=Math.round(Math.max(Math.max(n,.33*(e-2*a)),o*t[3])),d=c-i-l-2*a,b=Math.min(s-r-a,o);return[{dimensions:{x:0,y:0,width:c,height:r},sides:xt|Pt|Tt},{dimensions:{x:0,y:r+a,width:i,height:b},sides:At|xt},{dimensions:{x:i+a,y:r+a,width:d,height:b},sides:At},{dimensions:{x:i+a+d+a,y:r+a,width:l,height:b},sides:Tt|At}]}(e):function({maxHeight:e,ratios:t,maxWidth:a,spacing:s,minWidth:n}){const c=e,r=Math.round(Math.min(c*t[0],.6*(a-s))),o=Math.round((e-2*s)/(1/t[1]+1/t[2]+1/t[3])),i=Math.round(o/t[1]),l=Math.round(o/t[2]),d=c-i-l-2*s,b=Math.max(n,Math.min(a-r-s,o));return[{dimensions:{x:0,y:0,width:r,height:c},sides:Pt|xt|At},{dimensions:{x:r+s,y:0,width:b,height:i},sides:Pt|Tt},{dimensions:{x:r+s,y:i+s,width:b,height:l},sides:Tt},{dimensions:{x:r+s,y:i+l+2*s,width:b,height:d},sides:At|Tt}]}(e)}(u),{layout:b,containerStyle:Ft(b)}}let Bt;function Ut(e){return Bt||(Bt=document.createElement("span"),Bt.style.font='400 12px Roboto, "Helvetica Neue", "Apple Color Emoji", sans-serif',Bt.style.whiteSpace="nowrap",Bt.style.position="absolute",Bt.style.left="-999px",Bt.style.opacity=".01",document.body.appendChild(Bt)),Bt.innerHTML=e,Bt.offsetWidth}function Ht(e,t,a,s,n){Object(c.o)(()=>{if(a&&e.current){const t=e.current.closest(".MessageList");Object(vt.a)(t,e.current,n?"end":"center",20,void 0===s?1500:1e3,s)}},[e,t,a,s,n])}var Gt=a(112),qt=a(67);var _t=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"ContextMenuContainer",!t);return a?c.a.createElement(a,e):void 0});var Vt=Object(c.h)(Object(s.h)((e,{message:t})=>{const a=t.senderId,{targetUserId:s,targetChatId:n}=t.content.action||{},c=t.replyToMessageId,r=c?Object(o.k)(e,t.chatId,c):void 0,i=Object(o.U)(e,t),{direction:l,noHighlight:d}=i&&e.focusedMessage||{},b=Object(o.f)(e,t.chatId);return{sender:b&&(Object(m.jb)(b)||a===t.chatId)?b:a?Object(o.Gb)(e,a):void 0,...s&&{targetUser:Object(o.Gb)(e,s)},targetChatId:n,targetMessage:r,isFocused:i,...i&&{focusDirection:l,noFocusHighlight:d}}})(({message:e,observeIntersection:t,isEmbedded:a,appearanceOrder:s=0,isLastInList:n,sender:r,targetUser:o,targetMessage:i,targetChatId:l,isFocused:d,focusDirection:b,noFocusHighlight:u})=>{const m=Object(c.q)(null);Object(ft.c)(m,t),Object(We.a)(e.chatId,e.replyToMessageId,i),Ht(m,e.chatId,d,b,u);const h=Object(ne.a)(),O=s<=0,[j,g]=Object(ot.a)(O);Object(c.n)(()=>{O||setTimeout(g,10*s)},[s,g,O]);const{transitionClassNames:f}=Object(Z.a)(j,void 0,O,!1),p=Object(qt.a)(h,e,r,o,i,l,a?{isEmbedded:!0,asPlain:!0}:void 0),{isContextMenuOpen:I,contextMenuPosition:v,handleBeforeContextMenu:y,handleContextMenu:C,handleContextMenuClose:E,handleContextMenuHide:w}=Object(Et.a)(m),M=void 0!==v;if(a)return c.a.createElement("span",{className:"embedded-action-message"},Object(tt.a)(p));const S=Object(J.a)("ActionMessage message-list-item",d&&!u&&"focused",M&&"has-menu-open",n&&"last-in-list",f);return c.a.createElement("div",{ref:m,id:"message"+e.id,className:S,"data-message-id":e.id,onMouseDown:y,onContextMenu:C},c.a.createElement("span",null,p),v&&c.a.createElement(_t,{isOpen:I,anchor:v,message:e,messageListType:"thread",onClose:E,onCloseAnimationEnd:w}))}));a(217);var $t=({className:e,message:t,sender:a,title:s,customText:n,observeIntersection:r,onClick:o})=>{const i=Object(c.q)(null),l=Object(ft.b)(i,r),d=Object(at.a)(t&&Object(m.D)(t,"pictogram"),!l),b=t&&"sticker-reply-thumb"+t.id,u=nt(t),h=Boolean(t&&Object(m.I)(t)),O=Object(ne.a)(),j=a&&Object(m.V)(O,a);return c.a.createElement("div",{ref:i,className:Object(J.a)("EmbeddedMessage",e),onClick:t?o:void 0},u&&function(e,t,a,s){const{width:n,height:r}=Object(et.k)();return c.a.createElement("img",{id:e,src:a||t,width:n,height:r,alt:"",className:s?"round":""})}(b,u,d,h),c.a.createElement("div",{className:"message-text"},c.a.createElement("p",{dir:"auto"},t?Object(m.db)(t)?c.a.createElement(Vt,{message:t,isEmbedded:!0}):Object(tt.a)(Object(m.N)(O,t,Boolean(u))):n||" "),c.a.createElement("div",{className:"message-title",dir:"auto"},Object(tt.a)(j||s||" "))))},zt=a(160),Wt=a(167),Kt=a(172);a(221);var Qt=Object(c.h)(({message:e,outgoingStatus:t,signature:a,onClick:s})=>{const n=Object(ne.a)();return c.a.createElement("span",{className:"MessageMeta",dir:n.isRtl?"rtl":"ltr",onClick:s},Boolean(e.views)&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"message-views"},Object(Qe.b)(e.views)),c.a.createElement("i",{className:"icon-channelviews"})),a&&c.a.createElement("span",{className:"message-signature"},Object(tt.a)(a)),c.a.createElement("span",{className:"message-time"},e.isEdited&&n("EditedMessage")+" ",Object(x.h)(1e3*e.date)),t&&c.a.createElement(Kt.a,{status:t}))}),Yt=a(114),Xt=a(116),Jt=a(161);a(222);var Zt=({message:e,observeIntersection:t,observeIntersectionForPlaying:a,shouldLoop:s,lastSyncTime:r})=>{const o=Object(c.q)(null),[i,l,d]=Object(ot.a)(),b=e.content.sticker,{isAnimated:u,stickerSetId:h}=b,O=h===n.S,j=Object(ft.b)(o,t),g=Object(ft.b)(o,a),f=b.isPreloadedGlobally?"sticker"+b.id:Object(m.D)(e,"inline"),p=nt(e),I=Object(at.a)(f,!j,Object(m.C)(e,"inline",!0),r),v=Boolean(I),[y,C]=Object(ot.a)(v),E=u?y:v,{shouldRenderFullMedia:w,transitionClassNames:M}=Object(Yt.a)(E,"slow"),{width:S,height:k}=Object(et.l)(b),N=Object(J.a)("thumbnail",!p&&"empty"),P=Object(J.a)("Sticker media-inner",O&&"inactive");return c.a.createElement("div",{ref:o,className:P,onClick:O?void 0:l},!E&&c.a.createElement("img",{id:"sticker-thumb-"+e.id,src:p,width:S,height:k,alt:"",className:N}),!u&&w&&c.a.createElement("img",{id:"sticker-"+e.id,src:I,width:S,height:k,alt:"",className:Object(J.a)("full-media",M)}),u&&v&&c.a.createElement(Xt.a,{key:f,className:Object(J.a)("full-media",M),id:f,animationData:I,size:S,play:g,noLoop:!s,onLoad:C}),c.a.createElement(Jt.a,{isOpen:i,fromSticker:b,onClose:d}))},ea=a(128),ta=a(120),aa=a(162);function sa(e,t){return Object(aa.a)(Object(m.E)(e),Boolean(t),h.g&&!h.c)}var na=a(38);var ca=async(e,t,a,s)=>s?"rgba(255,255,255,1)":async function(e,t){const a=new Image;a.src=e,a.width||await new Promise(e=>{a.onload=e});const s=document.createElement("canvas"),n=s.getContext("2d");s.width=a.width,s.height=a.height,n.drawImage(a,0,0,a.width,a.height);const c=t?a.width-1:0,r=a.height-1;return`rgba(${Array.from(n.getImageData(c,r,1,1).data).join(",")})`}(e,t);var ra=a(121);var oa=({id:e,message:t,observeIntersection:a,shouldAutoLoad:s,isInSelectMode:n,isSelected:r,uploadProgress:o,size:i="inline",dimensions:l,nonInteractive:d,shouldAffectAppendix:b,onClick:u,onCancelUpload:h})=>{const O=Object(c.q)(null),j=(Object(m.G)(t)||Object(m.R)(t)).blobUrl,g=Object(ft.b)(O,a),[f,p]=Object(c.r)(s),I=f&&g,{mediaData:v,downloadProgress:y}=Object(ta.a)(Object(m.D)(t,i),!I),C=j||v,E=sa(t,C),{isUploading:w,isTransferring:M,transferProgress:S}=Object(m.s)(t,o||y,I&&!C),k=!1===Object(na.a)(f),{shouldRender:N,transitionClassNames:P}=Object(Z.a)(M,void 0,k,"slow"),{shouldRenderThumb:T,shouldRenderFullMedia:A,transitionClassNames:x}=Object(Yt.a)(C,"slow"),R=Object(c.m)(()=>{w?h&&h(t):C?u&&u(t.id):p(e=>!e)},[C,w,t,h,u]),L=Object(m.tb)(t);Object(c.o)(()=>{if(!b)return;const e=O.current.closest(".message-content");C?ca(C,L,0,r).then(t=>{e.style.setProperty("--appendix-bg",t),e.setAttribute("data-has-custom-appendix","")}):e.classList.add("has-appendix-thumb")},[C,L,b,n,r]);const{width:F,height:D,isSmall:B}=l||kt(t),U=Object(J.a)("media-inner",!w&&!d&&"interactive",B&&"small-image",F===D&&"square-image"),H=l?`width: ${F}px; height: ${D}px; left: ${l.x}px; top: ${l.y}px;`:"";return c.a.createElement("div",{id:e,ref:O,className:U,style:H,onClick:w?void 0:R},T&&c.a.createElement("canvas",{ref:E,className:"thumbnail",style:`width: ${F}px; height: ${D}px`}),A&&c.a.createElement("img",{src:C,className:"full-media "+x,width:F,height:D,alt:""}),N&&c.a.createElement("div",{className:"media-loading "+P},c.a.createElement(ra.a,{progress:S,onClick:w?R:void 0})),!C&&!f&&c.a.createElement("i",{className:"icon-download"}),M&&c.a.createElement("span",{className:"message-upload-progress"},Math.round(100*S),"%"))},ia=a(137),la=a(136);function da(e,t){const a=Object(c.q)();a.current=t;const s=Object(c.m)(()=>{e.current&&e.current.pause()},[e]),n=Object(c.m)(()=>{e.current&&a.current&&Object(la.a)(e.current)},[e]);Object(X.a)(s,n)}var ba=a(147),ua=(e,t=!1)=>{const a=Object(c.q)(!1),s=Object(c.q)(!1),n=Object(c.m)(()=>{s.current=!0,t&&e.current&&(a.current||(a.current=!e.current.paused),e.current.pause())},[t,e]),r=Object(c.m)(()=>{t&&e.current&&a.current&&document.body.contains(e.current)&&Object(la.a)(e.current),a.current=!1,s.current=!1},[t,e]),o=Object(c.m)(()=>{Object(g.b)(r)},[r]);document.hasFocus()||n(),Object(ee.a)(n,o)};function ma(){return(ma=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}var ha=({id:e,message:t,observeIntersection:a,shouldAutoLoad:s,shouldAutoPlay:n,uploadProgress:r,lastSyncTime:o,dimensions:i,onClick:l,onCancelUpload:d})=>{const b=Object(c.q)(null),u=Object(c.q)(null),h=t.content.video,O=h.blobUrl,j=Boolean(O)||Object(m.b)(h),g=Object(ft.b)(b,a),[f,p]=Object(c.r)(s),I=Boolean(f&&g&&o),[v,y]=Object(c.r)(n),C=Object(at.a)(Object(m.D)(t,"pictogram"),!(g&&o),Object(m.C)(t,"pictogram"),o),E=sa(t),{mediaData:w,downloadProgress:M}=Object(ta.a)(Object(m.D)(t,"inline"),!I,Object(m.C)(t,"inline"),o),S=O||w,k=Boolean(j&&g&&S),{isBuffered:N,bufferingHandlers:P}=Object(ia.a)(!s),{isUploading:T,isTransferring:A,transferProgress:R}=Object(m.s)(t,r||M,I&&j&&!N),L=!1===Object(na.a)(f),{shouldRender:F,transitionClassNames:D}=Object(Z.a)(A,void 0,L),{shouldRenderThumb:B,transitionClassNames:U}=Object(Yt.a)(S,"slow"),[H,G]=Object(c.r)(0),q=Object(c.m)(e=>{G(Math.max(0,e.currentTarget.currentTime-1))},[]),_=Object(m.tb)(t),V=Object(m.qb)(t),{width:$,height:z}=i||Object(et.h)(h,_,V);da(u,Boolean(k&&n)),ua(u,v),Object(ba.a)(u,[k]);const W=Object(c.m)(()=>{T?d&&d(t):j&&!S?p(e=>!e):j&&S&&!v?(y(!0),u.current.play()):l&&l(t.id)},[T,j,S,v,l,d,t]),K=Object(J.a)("media-inner dark",!T&&"interactive"),Q=Object(J.a)("full-media",U),Y=i?`width: ${$}px; height: ${z}px; left: ${i.x}px; top: ${i.y}px;`:"",X=k,ee=!j&&w,te=!j||f&&!v&&!F,ae=j&&!f;return c.a.createElement("div",{ref:b,id:e,className:K,style:Y,onClick:T?void 0:W},(!k||B)&&c.a.createElement("canvas",{ref:E,className:"thumbnail",style:`width: ${$}px; height: ${z}px;`}),C&&c.a.createElement("img",{src:C,className:"thumbnail",style:`width: ${$}px; height: ${z}px;`,alt:""}),X&&c.a.createElement("video",ma({ref:u,className:Q,width:$,height:z,autoPlay:v,muted:!0,loop:!0,playsInline:!0},P,{onTimeUpdate:q}),c.a.createElement("source",{src:S})),ee&&c.a.createElement("img",{src:w,className:"full-media "+U,width:$,height:z,alt:""}),te&&c.a.createElement("i",{className:"icon-large-play"}),F&&c.a.createElement("div",{className:"media-loading "+D},c.a.createElement(ra.a,{progress:R,onClick:T?W:void 0})),ae&&c.a.createElement("i",{className:"icon-download"}),A&&!j?c.a.createElement("span",{className:"message-upload-progress"},Math.round(100*R),"%"):A&&j?c.a.createElement("span",{className:"message-upload-progress"},"..."):c.a.createElement("div",{className:"message-media-duration"},h.isGif?"GIF":Object(x.e)(h.duration-H)))},Oa=a(18);a(224);var ja=Object(s.h)((e,{contact:t})=>({user:Object(o.Gb)(e,t.userId)}),(e,t)=>Object(d.l)(t,["openUserInfo"]))(({contact:e,user:t,openUserInfo:a})=>{const{firstName:s,lastName:n,phoneNumber:r,userId:o}=e,i=Object(c.m)(()=>{a({id:o})},[a,o]);return c.a.createElement("div",{className:Object(J.a)("Contact",Boolean(o)&&"interactive"),onClick:o?i:void 0},c.a.createElement(Gt.a,{size:"large",user:t,text:s||n}),c.a.createElement("div",{className:"contact-info"},c.a.createElement("div",{className:"contact-name"},s," ",n),c.a.createElement("div",{className:"contact-phone"},Object(Oa.c)(r))))}),ga=a(46);var fa=Object(c.h)(({id:e,options:t,selected:a=[],disabled:s,round:n,loadingOptions:r,onChange:o})=>{const[i,l]=Object(c.r)([]),d=Object(c.m)(e=>{const{value:t,checked:a}=e.currentTarget;let s;s=a?[...i,t]:i.filter(e=>e!==t),l(s),o(s)},[o,i]);return c.a.createElement("div",{id:e,className:"radio-group"},t.map(e=>c.a.createElement(ga.a,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==a.indexOf(e.value),disabled:s,round:n,isLoading:r?-1!==r.indexOf(e.value):void 0,onChange:d})))}),pa=a(126),Ia=a(180);a(227);function va(e,t){return t>0?(e/t*100).toFixed():0}var ya=({answer:e,voteResults:t,totalVoters:a,maxVotersCount:s,correctResults:n,shouldAnimate:r})=>{const o=t&&t.find(t=>t.option===e.option),i=0===n.length||-1!==n.indexOf(e.option),l=n.length>0&&i||o&&o.isChosen,d=o?va(o.votersCount,a||0):0,[b,u]=Object(c.r)(r?0:d),m=Object(c.q)(null),h=o?va(o.votersCount,s||0):0,O=b<d;if(Object(c.n)(()=>{r&&u(d)},[r,d]),Object(c.n)(()=>{const e=m.current;if(e&&r){const t=e.firstElementChild,a=O?"":"stroke-dasharray: 100% 200%; stroke-dashoffset: -44";t?t.setAttribute("style",a):e.innerHTML=`\n <svg class="poll-line" xmlns="http://www.w3.org/2000/svg" style="${a}">\n <path d="M4.47 5.33v13.6a9 9 0 009 9h13"/>\n </svg>`}},[O,r]),!t||!o)return;const j=`width: ${h}%; transform:scaleX(${O?0:1})`;return c.a.createElement("div",{className:"PollOption",dir:"ltr"},c.a.createElement("div",{className:"poll-option-share "+("100"===d?"limit-width":"")},d,"%",l&&c.a.createElement("span",{className:Object(J.a)("poll-option-chosen",!i&&"wrong",r&&"animate")},c.a.createElement("i",{className:i?"icon-check":"icon-close"}))),c.a.createElement("div",{className:"poll-option-right"},c.a.createElement("div",{className:"poll-option-text",dir:"auto"},Object(tt.a)(e.text)),c.a.createElement("div",{className:Object(J.a)("poll-option-answer",l&&!i&&"wrong")},c.a.createElement("div",{className:"poll-option-corner",ref:m}),c.a.createElement("div",{className:"poll-option-line",style:j}))))};a(228);var Ca=Object(c.h)(Object(s.h)((e,{poll:t})=>{const{recentVoterIds:a}=t.results,{byId:s}=e.users;return a&&0!==a.length?{recentVoterIds:a,usersById:s}:{}},(e,t)=>Object(d.l)(t,["loadMessage","openPollResults"]))(({message:e,poll:t,recentVoterIds:a,usersById:s,loadMessage:n,onSendVote:r,openPollResults:o})=>{const{id:i,chatId:l}=e,{summary:d,results:b}=t,[u,m]=Object(c.r)(!1),[h,O]=Object(c.r)([]),[j,g]=Object(c.r)(!1),[f,p]=Object(c.r)(!1),[I,v]=Object(c.r)(!d.closed&&d.closeDate&&d.closeDate>0?Math.min(d.closeDate-Math.floor(Date.now()/1e3),d.closePeriod):0),y=Object(c.q)(null),{results:C,totalVoters:E}=b,w=C&&C.some(e=>e.isChosen),M=!d.closed&&!w,S=!M&&d.isPublic&&Number(b.totalVoters)>0,k=M&&d.multipleChoice,N=C?Math.max(...C.map(e=>e.votersCount)):E,P=C?C.reduce((e,t)=>(t.isCorrect&&e.push(t.option),e),[]):[],T=d.answers.map(e=>({label:e.text,value:e.option,hidden:Boolean(d.quiz&&d.closePeriod&&I<=0)}));Object(c.n)(()=>{u&&t.results.results&&t.results.results.some(e=>e.isChosen)&&m(!1)},[u,t.results.results]),Object(c.n)(()=>{I>0&&setTimeout(()=>v(I-1),1e3);const e=y.current;if(e){const t=12*Math.PI,a=e.lastElementChild,s=e.firstElementChild;if(I<=5&&e.classList.add("hurry-up"),a&&s){const e=(d.closePeriod-I)/d.closePeriod*t;s.textContent=Object(x.e)(I),a.firstElementChild.setAttribute("stroke-dashoffset","-"+e)}else e.innerHTML=`\n <span>${Object(x.e)(I)}</span>\n <svg width="16px" height="16px">\n <circle cx="8" cy="8" r="6" class="poll-countdown-progress" transform="rotate(-90, 8, 8)"\n stroke-dasharray="${t} ${t}"\n stroke-dashoffset="0"\n />\n </svg>`}},[I,d.closePeriod]),Object(c.n)(()=>{d.quiz&&(I<=0||w&&!d.closed)&&n({chatId:l,messageId:i})},[l,I,w,n,i,d.closed,d.quiz]),Object(c.n)(()=>{let e;return d.quiz&&!d.closed&&d.closePeriod&&d.closePeriod>0&&(e=window.setTimeout(()=>{n({chatId:l,messageId:i})},1e3*d.closePeriod)),()=>{e&&window.clearTimeout(e)}},[M,l,n,i,d.closePeriod,d.closed,d.quiz]);const A=Object(c.p)(()=>a?a.reduce((e,t)=>{const a=s[t];return a&&e.push(a),e},[]):[],[s,a]),R=Object(c.m)(e=>{O([e]),m(!0),p(!0),r([e])},[r]),L=Object(c.m)(e=>{O(e)},[]),F=Object(c.m)(()=>{m(!0),p(!0),r(h)},[r,h]),D=Object(c.m)(()=>{o({chatId:l,messageId:i})},[l,i,o]),B=Object(c.m)(()=>{g(!0)},[]),U=Object(c.m)(()=>{g(!1),p(!1)},[]);Object(c.n)(()=>{if(f&&w&&d.quiz&&b.results&&t.results.solution){b.results.find(e=>e.isChosen&&e.isCorrect)||g(!0)}},[w,f,b.results,d.quiz,t.results.solution]);const H=Object(ne.a)();return c.a.createElement("div",{className:"Poll",dir:H.isRtl?"auto":"ltr"},j&&t.results.solution&&c.a.createElement(Ia.a,{message:Object(wt.b)(t.results.solution,t.results.solutionEntities),duration:5e3,onDismiss:U,containerId:"#middle-column-portals"}),c.a.createElement("div",{className:"poll-question"},Object(tt.a)(d.question)),c.a.createElement("div",{className:"poll-type"},H(function(e){if(void 0===e.isPublic)return" ";if(e.quiz)return e.isPublic?"QuizPoll":"AnonymousQuizPoll";if(e.closed)return"FinalResults";return e.isPublic?"PublicPoll":"AnonymousPoll"}(d)),A.length>0&&c.a.createElement("div",{className:"poll-recent-voters"},A.map(e=>c.a.createElement(Gt.a,{size:"micro",user:e}))),I>0&&M&&c.a.createElement("div",{ref:y,className:"poll-countdown"}),d.quiz&&t.results.solution&&!M&&c.a.createElement(oe.a,{round:!0,size:"tiny",color:"translucent",className:"poll-quiz-help",disabled:j,onClick:B,ariaLabel:"Show Solution"},c.a.createElement("i",{className:"icon-lamp"}))),M&&c.a.createElement("div",{className:"poll-answers"},k?c.a.createElement(fa,{options:T,onChange:L,disabled:e.isScheduled||u,loadingOptions:u?h:void 0,round:!0}):c.a.createElement(pa.a,{name:"poll-"+i,options:T,onChange:R,disabled:e.isScheduled||u,loadingOption:u?h[0]:void 0})),!M&&c.a.createElement("div",{className:"poll-results"},d.answers.map((function(e){return c.a.createElement(ya,{key:e.option,shouldAnimate:f,answer:e,voteResults:C,totalVoters:E,maxVotersCount:N,correctResults:P})}))),!S&&!k&&c.a.createElement("div",{className:"poll-voters-count"},function(e,t,a){if(!a)return e(t?"Chat.Quiz.TotalVotesEmpty":"Chat.Poll.TotalVotesResultEmpty");return e(t?"Answer":"Vote",a,"i")}(H,d.quiz,b.totalVoters)),k&&c.a.createElement(oe.a,{isText:!0,disabled:0===h.length,size:"tiny",onClick:F},H("PollSubmitVotes")),S&&c.a.createElement(oe.a,{isText:!0,size:"tiny",onClick:D},H("PollViewResults")))})),Ea=a(39),wa=a(57);a(229);var Ma=Object(c.h)(({message:e,observeIntersection:t,shouldAutoLoad:a,inPreview:s,onMediaClick:n,onCancelMediaTransfer:r})=>{const o=Object(m.Q)(e);let i=!1;if(o&&o.photo){const{width:t,height:a}=kt(e);i=t===a}const l=Object(c.m)(()=>{n()},[n]);if(!o)return;const{siteName:d,url:b,displayUrl:u,title:h,description:O,photo:j}=o,g=j&&n&&!i&&!o.hasDocument,f=Object(Ea.a)(O,170),p=Object(J.a)("WebPage",j?i&&"with-square-photo":!s&&"without-photo");return c.a.createElement("div",{className:p,"data-initial":(d||u)[0],dir:"auto"},j&&c.a.createElement(oa,{message:e,observeIntersection:t,shouldAutoLoad:a,size:i?"pictogram":"inline",nonInteractive:!g,onClick:g?l:void 0,onCancelUpload:r}),c.a.createElement("div",{className:"WebPage-text"},c.a.createElement(wa.a,{className:"site-name",url:b,text:d||u}),!s&&h&&c.a.createElement("p",{className:"site-title"},Object(tt.a)(h)),f&&c.a.createElement("p",{className:"site-description"},Object(tt.a)(f,["emoji","br"]))))});a(230);var Sa=Object(c.h)(({message:e})=>{const t=Object(m.z)(e),{title:a,text:s,description:n,photoUrl:r}=t;return c.a.createElement("div",{className:"Invoice"},a&&c.a.createElement("p",{className:"title"},Object(tt.a)(a)),s&&c.a.createElement("p",null,Object(tt.a)(s,["emoji","br"])),c.a.createElement("div",{className:"description "+(r?"has-image":"")},r&&c.a.createElement("img",{className:"invoice-image",src:r,alt:""}),n&&c.a.createElement("p",{className:"description-text"},Object(tt.a)(n,["emoji","br"]))))});function ka(e){return Object(c.h)(Object(s.h)((e,t)=>{const{message:a}=t;return{isInSelectMode:Object(o.S)(e),isSelected:Object(o.V)(e,a.id)}},(e,t)=>Object(d.l)(t,["toggleMessageSelection"]))(t=>{const{isInSelectMode:a,isSelected:s,message:n,toggleMessageSelection:r,dimensions:o}=t,i=Object(c.m)(e=>{e.stopPropagation(),r({messageId:n.id,withShift:e&&e.shiftKey})},[r,n]),l=Object(c.p)(()=>({...t,isInSelectMode:a,isSelected:s,dimensions:{...t.dimensions,x:0,y:0},onClick:a?void 0:t.onClick}),[t,a,s]);return c.a.createElement("div",{className:Object(J.a)("album-item-select-wrapper",s&&"is-selected"),style:o?`left: ${o.x}px; top: ${o.y}px;`:"",onClick:a?i:void 0},a&&c.a.createElement("div",{className:"message-select-control"},s&&c.a.createElement("i",{className:"icon-select"})),c.a.createElement(e,l))}))}a(231);const Na=ka(oa),Pa=ka(ha);var Ta=Object(s.h)(e=>({uploadsById:e.fileUploads.byMessageLocalId}),(e,t)=>Object(d.l)(t,["cancelSendingMessage"]))(({album:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,hasCustomAppendix:n,lastSyncTime:r,isOwn:o,albumLayout:i,onMediaClick:l,uploadsById:d,cancelSendingMessage:b})=>{const u=e.messages.length,h=Object(c.m)(e=>{b({chatId:e.chatId,messageId:e.id})},[b]);const{width:O,height:j}=i.containerStyle;return c.a.createElement("div",{className:"Album",style:`width: ${O}px; height: ${j}px;`},e.messages.map((function(e,b){const{photo:O,video:j}=Object(m.v)(e),g=d[e.previousLocalId||e.id],f=g?g.progress:void 0,{dimensions:p,sides:I}=i.layout[b];if(O){const s=n&&(o?b===u-1:Boolean(I&xt&&I&At));return c.a.createElement(Na,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAffectAppendix:s,uploadProgress:f,dimensions:p,onClick:l,onCancelUpload:h})}if(j)return c.a.createElement(Pa,{id:"album-media-"+e.id,message:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,uploadProgress:f,lastSyncTime:r,dimensions:p,onClick:l,onCancelUpload:h})})))});a(232);function Aa(){return(Aa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}let xa;var Ra=({message:e,observeIntersection:t,shouldAutoLoad:a,shouldAutoPlay:s,lastSyncTime:n})=>{const r=Object(c.q)(null),o=Object(c.q)(null),i=Object(c.q)(null),l=e.content.video,d=Object(ft.b)(r,t),[b,u]=Object(c.r)(a&&s),h=Boolean(b&&d&&n),{mediaData:O,downloadProgress:j}=Object(ta.a)(Object(m.D)(e,"inline"),!h,Object(m.C)(e,"inline"),n),g=sa(e,O),{isBuffered:f,bufferingHandlers:p}=Object(ia.a)(),I=b&&!f,v=!1===Object(na.a)(b),{shouldRender:y,transitionClassNames:C}=Object(Z.a)(I||!f,void 0,v),{shouldRenderThumb:E,transitionClassNames:w}=Object(Yt.a)(O,"slow"),[M,S]=Object(c.r)(!1),[k,N]=Object(c.r)(0);Object(c.n)(()=>{if(!M)return;const e=188*Math.PI,t=e-k*e,a=i.current,s=o.current,n=s.firstElementChild;n?n.firstElementChild.setAttribute("stroke-dashoffset",t.toString()):s.innerHTML=`<svg width="200px" height="200px">\n <circle cx="100" cy="100" r="94" class="progress-circle" transform="rotate(-90, 100, 100)"\n stroke-dasharray="${e} ${e}"\n stroke-dashoffset="${e}"\n />\n </svg>`,N(a.currentTime/a.duration)},[M,k]);const P=Boolean(O&&d),T=()=>{S(!1),N(0),Object(la.a)(i.current),requestAnimationFrame(()=>{o.current.innerHTML=""})},A=(R=T,()=>{xa&&xa(),xa=R});var R;Object(c.n)(()=>{i.current&&(P?Object(la.a)(i.current):i.current.pause())},[P]),da(i,P),ua(i,Boolean(O)),Object(ba.a)(i,[O]);const L=Object(c.m)(()=>{if(!O)return void u(e=>!e);const e=i.current;M?e.paused?Object(la.a)(e):e.pause():(A(),e.currentTime=0,S(!0))},[A,M,O]),F=Object(c.m)(e=>{const t=e.currentTarget;N(t.currentTime/t.duration)},[]),D=Object(J.a)("full-media",w);return c.a.createElement("div",{ref:r,className:"RoundVideo media-inner",onClick:L},E&&c.a.createElement("div",{className:"thumbnail-wrapper"},c.a.createElement("canvas",{ref:g,className:"thumbnail",style:`width: ${et.d}px; height: ${et.d}px`})),O&&c.a.createElement("div",{className:"video-wrapper"},c.a.createElement("video",Aa({ref:i,className:D,width:et.d,height:et.d,autoPlay:!0,muted:!M,loop:!M,playsInline:!0,onEnded:M?T:void 0},p,{onTimeUpdate:M?F:void 0}),c.a.createElement("source",{src:O}))),c.a.createElement("div",{className:"progress",ref:o}),y&&c.a.createElement("div",{className:"media-loading "+C},c.a.createElement(ra.a,{progress:j})),!O&&!b&&c.a.createElement("i",{className:"icon-large-play"}),c.a.createElement("div",{className:"message-media-duration"},M?Object(x.e)(i.current.currentTime):Object(x.e)(l.duration),(!M||i.current.paused)&&c.a.createElement("i",{className:"icon-muted-chat"})))};a(233);var La=({message:e,onClick:t})=>c.a.createElement("div",{className:"InlineButtons"},e.inlineButtons.map(e=>c.a.createElement("div",{className:"row"},e.map(e=>c.a.createElement(oe.a,{size:"tiny",ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>t({button:e})},e.text,"url"===e.type&&c.a.createElement("i",{className:"icon-arrow-right"}))))));a(234);var Fa=Object(c.h)(Object(s.h)((e,{message:t})=>{const{threadId:a,chatId:s}=t.threadInfo,n=Object(o.Cb)(e,s,a)||t.threadInfo,{byId:c}=e.users,{byId:r}=e.chats;return{threadInfo:n,usersById:c,chatsById:r}},(e,t)=>Object(d.l)(t,["openChat"]))(({disabled:e,threadInfo:t,usersById:a,chatsById:s,openChat:n})=>{const r=Object(ne.a)(),{threadId:o,chatId:i,messagesCount:l,lastMessageId:d,lastReadInboxMessageId:b,recentReplierIds:u}=t,h=Object(c.m)(()=>{n({id:i,threadId:o})},[n,i,o]);if(void 0===l)return;const O=u&&u.map(e=>Object(m.lb)(e)?a[e]:s[e]).filter(Boolean);const j=Boolean(b&&d&&b<d);return c.a.createElement("div",{"data-cnt":Object(Qe.b)(l),className:Object(J.a)("CommentButton",j&&"has-unread",e&&"disabled"),dir:r.isRtl?"rtl":"ltr",onClick:h},c.a.createElement("i",{className:"icon-comments-sticker"}),(!O||0===O.length)&&c.a.createElement("i",{className:"icon-comments"}),O&&O.length>0&&c.a.createElement("div",{className:"recent-repliers",dir:r.isRtl?"rtl":"ltr"},O.map(e=>c.a.createElement(Gt.a,{key:e.id,size:"small",user:Object(m.lb)(e.id)?e:void 0,chat:Object(m.lb)(e.id)?void 0:e}))),c.a.createElement("div",{className:"label",dir:"auto"},l?r("Comments",l,"i"):r("LeaveAComment")),c.a.createElement("i",{className:"icon-next"}))}));a(235);function Da(e){const t=Ua(e.currentTarget);t&&t.setAttribute("data-is-document-group-hover","")}function Ba(e){const t=Ua(e.currentTarget);t&&t.removeAttribute("data-is-document-group-hover")}function Ua(e){let t=e;do{t=t.nextElementSibling}while(t&&!t.classList.contains("last-in-document-group"));return t}var Ha=Object(c.h)(Object(s.h)((e,t)=>{const{focusedMessage:a,forwardMessages:s,lastSyncTime:n}=e,{message:c,album:r,withSenderName:i,withAvatar:l,threadId:d,messageListType:b}=t,{id:u,chatId:h,viaBotId:O,replyToMessageId:j,isOutgoing:g}=c,f=Object(o.f)(e,h),p=Object(o.P)(e,h),I=f&&Object(m.jb)(f),v=!p&&Object(m.eb)(c),y=i||l||v?Object(o.tb)(e,c):void 0,C=Object(o.K)(e,c),E=O?Object(o.Gb)(e,O):void 0,w=d?Object(o.Eb)(e,h,d):void 0,M=c.id===w,S=j===w,k=j&&!S?Object(o.k)(e,h,j):void 0,N=k&&Object(o.tb)(e,k),P=Object(o.Fb)(e,c),T="thread"===b&&(r?r.messages.some(t=>Object(o.U)(e,t)):Object(o.U)(e,c)),{direction:A,noHighlight:x}=T&&a||{},R=s.messageIds&&s.messageIds.includes(u),{query:L}=Object(o.A)(e)||{},F=Object(m.L)(c);let D;return D=r&&r.messages?r.messages.every(({id:t})=>Object(o.V)(e,t)):Object(o.V)(e,u),{forceSenderName:v,sender:y,originSender:C,botSender:E,shouldHideReply:S,isThreadTop:M,replyMessage:k,replyMessageSender:N,...g&&{outgoingStatus:Object(o.fb)(e,c,"scheduled"===b)},..."number"==typeof P&&{uploadProgress:P},isFocused:T,...T&&{focusDirection:A,noFocusHighlight:x},isForwarding:R,isChatWithSelf:p,isChannel:I,lastSyncTime:n,highlight:L,isSingleEmoji:Boolean(F),animatedEmoji:F?Object(o.c)(e,F):void 0,isInSelectMode:Object(o.S)(e),isSelected:D,isGroupSelected:!!c.groupedId&&!c.isInAlbum&&Object(o.Q)(e,h,c.groupedId),threadId:d,isPinnedList:"pinned"===b,shouldAutoLoadMedia:f?Object(o.ub)(e,c,f,y):void 0,shouldAutoPlayMedia:Object(o.vb)(e,c),shouldLoopStickers:Object(o.wb)(e)}},(e,t)=>Object(d.l)(t,["focusMessage","openMediaViewer","openAudioPlayer","cancelSendingMessage","openUserInfo","openChat","markMessagesRead","sendPollVote","toggleMessageSelection","setReplyingToId","openForwardMenu","clickInlineButton"]))(({message:e,observeIntersectionForBottom:t,observeIntersectionForMedia:a,observeIntersectionForAnimatedStickers:s,album:n,withAvatar:r,withSenderName:o,noComments:d,appearanceOrder:b,isFirstInGroup:u,isLastInGroup:h,isFirstInDocumentGroup:O,isLastInDocumentGroup:j,isLastInList:g,forceSenderName:f,sender:p,originSender:I,botSender:v,isThreadTop:y,shouldHideReply:C,replyMessage:E,replyMessageSender:w,outgoingStatus:M,uploadProgress:S,isFocused:k,focusDirection:N,noFocusHighlight:P,isForwarding:T,isChatWithSelf:A,isChannel:x,lastSyncTime:R,highlight:L,animatedEmoji:F,isInSelectMode:D,isSelected:B,isGroupSelected:U,threadId:H,messageListType:G,isPinnedList:q,shouldAutoLoadMedia:_,shouldAutoPlayMedia:V,shouldLoopStickers:$,focusMessage:z,openMediaViewer:W,openAudioPlayer:K,openUserInfo:Q,openChat:Y,cancelSendingMessage:X,markMessagesRead:ee,sendPollVote:te,toggleMessageSelection:ae,setReplyingToId:se,openForwardMenu:ce,clickInlineButton:re})=>{const ie=Object(c.q)(null),le=Object(c.q)(null),de=Object(c.q)(null);Object(ft.c)(le,t);const{width:be}=_e(),{isContextMenuOpen:ue,contextMenuPosition:me,handleBeforeContextMenu:he,handleContextMenu:Oe,handleContextMenuClose:je,handleContextMenuHide:ge}=Object(Et.a)(ie,!1,!0),fe=b<=0,[pe,Ie]=Object(ot.a)(fe);Object(c.n)(()=>{fe||setTimeout(Ie,10*b)},[b,Ie,fe]);const{transitionClassNames:ve}=Object(Z.a)(pe,void 0,fe,!1),{chatId:ye,id:Ce,threadInfo:Ee}=e,we=Object(m.tb)(e),Me="scheduled"===G||e.isScheduled,Se=Object(m.ub)(e)&&!C,ke=Boolean(Ee)&&"thread"===G,{forwardInfo:Ne,viaBotId:Pe}=e,Te=Ne&&!A&&!Ne.isLinkedChannelPost,Ae=!!e.groupedId&&!e.isInAlbum,xe=Boolean(n)&&n.messages.length>1,{text:Re,photo:Le,video:Fe,audio:De,voice:Be,document:Ue,sticker:He,contact:Ge,poll:qe,webPage:Ve,invoice:$e}=Object(m.v)(e),ze=Object(m.x)(e),Ke=Object(wt.a)(e,L,Mt(ze)),Qe=void 0!==me,Ye=Object(J.a)("Message message-list-item",u&&"first-in-group",h&&"last-in-group",O&&"first-in-document-group",j&&"last-in-document-group",g&&"last-in-list",we&&"own",Boolean(e.views)&&"has-views",e.isEdited&&"was-edited",Se&&"has-reply",Qe&&"has-menu-open",k&&!P&&"focused",T&&"is-forwarding",e.isDeleting&&"is-deleting",Ae&&"is-in-document-group",xe&&"is-album",e.hasUnreadMention&&"has-unread-mention",B&&"is-selected",D&&"is-in-selection-mode",y&&"is-thread-top",Boolean(e.inlineButtons)&&"has-inline-buttons",ve),Xe=function(e,{hasReply:t,customShape:a,isLastInGroup:s,asForwarded:n,hasThread:c,forceSenderName:r,hasComments:o}={}){const{text:i,photo:l,video:d,audio:b,voice:u,document:h,poll:O,webPage:j,contact:g}=Object(m.v)(e),f=["message-content"],p=(l||d)&&!i,I=Boolean(e.viaBotId);return Mt(a)?f.push("emoji-only emoji-only-"+a):i&&f.push("text"),a&&(f.push("custom-shape"),d&&d.isRound&&f.push("round"),o&&f.push("has-comments")),l||d?f.push("media"):b?f.push("audio"):u?f.push("voice"):h?f.push("document"):g?f.push("contact"):O?f.push("poll"):j&&(f.push("web-page"),j.photo&&f.push("media")),n&&!a&&f.push("is-forwarded"),t&&f.push("is-reply"),c&&f.push("has-replies"),I&&f.push("is-via-bot"),r&&f.push("force-sender-name"),a||(f.push("has-shadow"),(t||n||!p||I||r)&&f.push("has-solid-background"),!s||!l&&p||f.push("has-appendix")),f.join(" ")}(e,{hasReply:Se,customShape:ze,isLastInGroup:h,asForwarded:Te,hasThread:ke,forceSenderName:f,hasComments:e.threadInfo&&e.threadInfo.messagesCount>0}),Je=!Ne||!A&&p?p:I,Ze=Ne?I:p,at=x&&e.adminTitle||Ne&&!Te&&Ne.adminTitle||void 0,st=e.threadInfo&&(!Ae||j)&&"thread"===G&&!d,nt=Xe.includes("has-appendix");Object(We.a)(ye,Se?e.replyToMessageId:void 0,E,e.id),Ht(ie,ye,k,N,P),Object(c.o)(()=>{de.current&&(de.current.innerHTML=we?'<svg width="9" height="20" xmlns="http://www.w3.org/2000/svg"><defs><filter x="-50%" y="-14.7%" width="200%" height="141.2%" filterUnits="objectBoundingBox" id="a"><feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0" in="shadowBlurOuter1"/></filter></defs><g fill="none" fill-rule="evenodd"><path d="M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z" fill="#000" filter="url(#a)"/><path d="M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z" fill="#EEFFDE" class="corner"/></g></svg>':'<svg width="9" height="20" xmlns="http://www.w3.org/2000/svg"><defs><filter x="-50%" y="-14.7%" width="200%" height="141.2%" filterUnits="objectBoundingBox" id="a"><feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0" in="shadowBlurOuter1"/></filter></defs><g fill="none" fill-rule="evenodd"><path d="M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z" fill="#000" filter="url(#a)"/><path d="M3 17h6V0c-.193 2.84-.876 5.767-2.05 8.782-.904 2.325-2.446 4.485-4.625 6.48A1 1 0 003 17z" fill="#FFF" class="corner"/></g></svg>')},[we,nt]);const ct=Object(c.m)(t=>{t.stopPropagation(),ae({messageId:Ce,groupedId:e.groupedId})},[Ce,e.groupedId,ae]),rt=Object(c.m)(e=>{const t=xe&&n&&n.messages?{messageId:Ce,childMessageIds:n.messages.map(({id:e})=>e),withShift:e&&e.shiftKey}:{messageId:Ce,withShift:e&&e.shiftKey};ae(t)},[ae,Ce,xe,n]),it=Object(c.m)(()=>{se({messageId:Ce})},[se,Ce]),lt=Object(c.m)(e=>{e.stopPropagation()},[]),dt=Object(c.m)(()=>{Je&&(Object(m.lb)(Je.id)?Q({id:Je.id}):Y({id:Je.id}))},[Je,Q,Y]),bt=Object(c.m)(()=>{Ze&&(Object(m.lb)(Ze.id)?Q({id:Ze.id}):Y({id:Ze.id}))},[Ze,Q,Y]),ut=Object(c.m)(()=>{v&&Q({id:v.id})},[v,Q]),mt=Object(c.m)(()=>{z({chatId:ye,threadId:H,messageId:e.replyToMessageId})},[z,ye,H,e.replyToMessageId]),ht=Object(c.m)(()=>{W({chatId:ye,threadId:H,messageId:Ce,origin:Me?l.h.ScheduledInline:l.h.Inline})},[ye,H,Ce,W,Me]),Ot=Object(c.m)(()=>{K({chatId:ye,messageId:Ce})},[ye,Ce,K]),jt=Object(c.m)(e=>{W({chatId:ye,threadId:H,messageId:e,origin:Me?l.h.ScheduledAlbum:l.h.Album})},[ye,H,W,Me]),gt=Object(c.m)(()=>{ee({messageIds:[Ce]})},[Ce,ee]),pt=Object(c.m)(()=>{X({chatId:ye,messageId:Ce})},[X,ye,Ce]),It=Object(c.m)(e=>{te({chatId:ye,messageId:Ce,options:e})},[ye,Ce,te]),vt=Object(c.m)(()=>{ce({fromChatId:ye,groupedId:e.groupedId})},[ce,ye,e.groupedId]),yt=Object(c.m)(()=>{if(n&&n.messages){const e=n.messages.map(({id:e})=>e);ce({fromChatId:ye,messageIds:e})}else ce({fromChatId:ye,messageIds:[Ce]})},[n,ce,ye,Ce]),Ct=Object(c.m)(()=>{z({chatId:ye,threadId:i.MAIN_THREAD_ID,messageId:Ce})},[z,ye,Ce]),Nt=Object(c.m)(()=>{z(Ae?{chatId:Ne.fromChatId,groupedId:e.groupedId,groupedChatId:ye}:{chatId:Ne.fromChatId,messageId:Ne.fromMessageId})},[z,Ne,e,ye,Ae]),Pt=Object(ne.a)();let Tt,At="",xt=!1;const Rt=Object(c.p)(()=>xe?Dt(we,Boolean(Te),n,be):void 0,[xe,be,we,Te,n]),Lt=Te?28:0;if(xe||!Le&&!Fe)Rt&&(Tt=Math.max(St(Boolean(Re),st),Rt.containerStyle.width),Tt-Rt.containerStyle.width>18&&(xt=!0));else{let t;Le?t=kt(e).width:Fe&&(t=Fe.isRound?et.d:kt(e).width),t&&(Tt=Math.max(St(Boolean(Re),st),t),Tt-t>18&&(xt=!0))}Tt&&(At=`width: ${Tt+Lt}px`);const Ft=Object(c.p)(()=>at?Ut(at):void 0,[at]),Bt=!(Qe||D||T)&&(!Ae||j),qt=Bt&&x&&!Me,Vt=Bt&&(Ne&&(Ne.isChannelPost||A&&!we)&&Ne.fromMessageId||q);return c.a.createElement("div",{ref:ie,id:"message"+Ce,className:Ye,style:Ft?`--meta-safe-author-width: ${Ft}px`:void 0,"data-message-id":Ce,onClick:D?rt:void 0,onDoubleClick:D?void 0:it,onMouseDown:D?void 0:he,onContextMenu:D?void 0:Oe,onMouseEnter:Ae&&!j?Da:void 0,onMouseLeave:Ae&&!j?Ba:void 0},c.a.createElement("div",{ref:le,className:"bottom-marker","data-message-id":Ce,"data-last-message-id":n?n.messages[n.messages.length-1].id:void 0,"data-has-unread-mention":e.hasUnreadMention}),!Ae&&c.a.createElement("div",{className:"message-select-control"},B&&c.a.createElement("i",{className:"icon-select"})),j&&c.a.createElement("div",{className:Object(J.a)("message-select-control group-select",U&&"is-selected"),onClick:ct},U&&c.a.createElement("i",{className:"icon-select"})),r&&function(){const e=Je&&Object(m.lb)(Je.id),t=Je&&e?Je:void 0,a=Je&&!e?Je:void 0,s=!Je&&Ne?Ne.hiddenUserName:void 0;return c.a.createElement(Gt.a,{size:"small",user:t,chat:a,text:s,lastSyncTime:R,onClick:t||a?dt:void 0})}(),c.a.createElement("div",{className:"message-content-wrapper",onClick:D&&Ae?rt:void 0},c.a.createElement("div",{className:Xe,style:At,dir:"auto"},nt&&c.a.createElement("div",{className:"svg-appendix",ref:de}),Te&&!ze&&(!Ae||O)&&c.a.createElement("div",{className:"message-title"},Pt("ForwardedMessage")),function(){const t=Object(J.a)("content-inner",Te&&!ze&&"forwarded-message",Se&&"reply-message",xt&&"no-media-corners"),r=h&&!Ke&&!Te&&!ke,i=!Ve&&!F&&Ke;return c.a.createElement("div",{className:t,onDoubleClick:lt,dir:"auto"},function(){if(ze||!(o&&!Le&&!Fe||Te||Pe||f)||Ae&&!O)return;let t,a;Ze?(t=Object(m.V)(Pt,Ze),Te||(a="color-"+Object(m.X)(Ze))):Ne&&Ne.hiddenUserName&&(t=Ne.hiddenUserName);return c.a.createElement("div",{className:"message-title",dir:"ltr"},t?c.a.createElement("span",{className:Object(J.a)(Ze&&"interactive",a),onClick:Ze?bt:void 0,dir:"auto"},Object(tt.a)(t)):v?void 0:" ",v&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",{className:"via"},Pt("ViaBot")),c.a.createElement("span",{className:"interactive",onClick:ut},Object(tt.a)("@"+v.username))),Ne&&Ne.isLinkedChannelPost?c.a.createElement("span",{className:"admin-title",dir:"auto"},Pt("DiscussChannel")):e.adminTitle&&!x?c.a.createElement("span",{className:"admin-title",dir:"auto"},e.adminTitle):void 0)}(),Se&&c.a.createElement($t,{message:E,sender:w,observeIntersection:a,onClick:mt}),He&&c.a.createElement(Zt,{message:e,observeIntersection:a,observeIntersectionForPlaying:s,shouldLoop:$,lastSyncTime:R}),F&&c.a.createElement(ea.a,{isInline:!0,sticker:F,observeIntersection:a,lastSyncTime:R}),xe&&c.a.createElement(Ta,{album:n,albumLayout:Rt,observeIntersection:a,shouldAutoLoad:_,shouldAutoPlay:V,isOwn:we,hasCustomAppendix:r,lastSyncTime:R,onMediaClick:jt}),!xe&&Le&&c.a.createElement(oa,{message:e,observeIntersection:a,shouldAutoLoad:_,uploadProgress:S,shouldAffectAppendix:r,onClick:ht,onCancelUpload:pt}),!xe&&Fe&&Fe.isRound&&c.a.createElement(Ra,{message:e,observeIntersection:a,shouldAutoLoad:_,shouldAutoPlay:V,lastSyncTime:R}),!xe&&Fe&&!Fe.isRound&&c.a.createElement(ha,{message:e,observeIntersection:a,shouldAutoLoad:_,shouldAutoPlay:V,uploadProgress:S,lastSyncTime:R,onClick:ht,onCancelUpload:pt}),(De||Be)&&c.a.createElement(Wt.a,{message:e,uploadProgress:S,lastSyncTime:R,isSelectable:Ae,isSelected:B,onPlay:Ot,onReadMedia:!Be||we&&!A?void 0:gt,onCancelUpload:pt}),Ue&&c.a.createElement(zt.a,{message:e,observeIntersection:a,uploadProgress:S,isSelectable:Ae,isSelected:B,onCancelUpload:pt}),Ge&&c.a.createElement(ja,{contact:Ge}),qe&&c.a.createElement(Ca,{message:e,poll:qe,onSendVote:It}),!F&&Ke&&c.a.createElement("p",{className:"text-content "+(i?"with-meta":""),dir:"auto"},Ke,i&&c.a.createElement(Qt,{message:e,outgoingStatus:M,signature:at,onClick:rt})),Ve&&c.a.createElement(Ma,{message:e,observeIntersection:a,shouldAutoLoad:_,onMediaClick:ht,onCancelMediaTransfer:pt}),$e&&c.a.createElement(Sa,{message:e}))}(),(!Ae||j)&&!(!Ve&&!F&&Ke)&&c.a.createElement(Qt,{message:e,outgoingStatus:M,signature:at,onClick:rt}),qt?c.a.createElement(oe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:Pt("lng_context_forward_msg"),onClick:j?vt:yt},c.a.createElement("i",{className:"icon-share-filled"})):Vt?c.a.createElement(oe.a,{className:"message-action-button",color:"translucent-white",round:!0,size:"tiny",ariaLabel:"Focus message",onClick:q?Ct:Nt},c.a.createElement("i",{className:"icon-arrow-right"})):void 0,st&&c.a.createElement(Fa,{message:e,disabled:d}),Xe.includes("has-appendix")&&c.a.createElement("div",{className:"svg-appendix",ref:de})),e.inlineButtons&&c.a.createElement(La,{message:e,onClick:re})),me&&c.a.createElement(_t,{isOpen:ue,anchor:me,message:e,album:n,messageListType:G,onClose:je,onCloseAnimationEnd:ge}))}));a(236);const Ga=h.b?1e3:350,qa=h.g?300:500,_a=Object(g.a)(e=>e(),200,!1);var Va=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,type:s})=>{const n=Object(o.f)(e,t);if(!n)return{};const c=Object(o.x)(e,t,a,s),r="scheduled"===s?Object(o.qb)(e,t):Object(o.m)(e,t),l=Object(o.Eb)(e,t,a);if(a!==i.MAIN_THREAD_ID&&!(r&&l&&r[l]))return{};const{isRestricted:d,restrictionReason:b,lastMessage:u}=n,h=Object(o.I)(e,t),O=a===i.MAIN_THREAD_ID&&!c&&!n.unreadCount&&!h&&u&&!u.groupedId;let j;if(Object(o.L)(e,t)){const a=Object(o.g)(e,t);j=a.fullInfo?a.fullInfo.botDescription||"NoMessages":"Updating bot info..."}return{isChatLoaded:!0,isRestricted:d,restrictionReason:b,isChannelChat:Object(m.jb)(n),isChatWithSelf:Object(o.P)(e,t),messageIds:c,messagesById:r,firstUnreadId:Object(o.H)(e,t,a),isViewportNewest:"thread"!==s||Object(o.X)(e,t,a),threadFirstMessageId:Object(o.G)(e,t,a),focusingId:h,isSelectModeActive:Object(o.S)(e),animationLevel:e.settings.byKey.animationLevel,...O&&{lastMessage:u},botDescription:j,threadTopMessageId:l,hasLinkedChat:n.fullInfo&&"linkedChatId"in n.fullInfo?Boolean(n.fullInfo.linkedChatId):void 0}},(e,t)=>Object(d.l)(t,["loadViewportMessages","markMessageListRead","markMessagesRead","setScrollOffset","openHistoryCalendar"]))(({chatId:e,threadId:t,type:a,hasTools:r,onFabToggle:i,onNotchToggle:b,isChatLoaded:u,isChannelChat:h,canPost:O,isChatWithSelf:j,messageIds:f,messagesById:p,firstUnreadId:I,isViewportNewest:v,threadFirstMessageId:y,isRestricted:C,restrictionReason:E,focusingId:w,isSelectModeActive:M,animationLevel:S,loadViewportMessages:k,markMessageListRead:N,markMessagesRead:P,setScrollOffset:T,lastMessage:A,botDescription:R,threadTopMessageId:L,hasLinkedChat:F,openHistoryCalendar:D})=>{const B=Object(c.q)(null),U=Object(c.q)("thread"===a&&Object(o.rb)(Object(s.e)(),e,t)||0),H=Object(c.q)(),G=Object(c.q)(),q=Object(c.q)(),_=Object(c.q)(),V=Object(c.q)(),$=Object(c.q)(),z=Object(c.q)(!1),W=Object(c.q)(!f),[K,Q]=Object(c.r)(),[Y,Z]=Object(c.r)(Boolean(w)),ee=Boolean(f);Object(je.a)(()=>{ee&&Object(g.d)(()=>{W.current=!1})},[ee]),Object(je.a)(()=>{V.current=I,_.current||(_.current=I)},[I]);const{observe:te,freeze:ae,unfreeze:se}=Object(ft.a)({rootRef:B,throttleMs:Ga,margin:qa}),{observe:ce,freeze:re,unfreeze:oe}=Object(ft.a)({rootRef:B},e=>{if("thread"!==a)return;let t=0;const s=[];e.forEach(e=>{const{isIntersecting:a,target:n}=e;if(!a)return;const{dataset:c}=n,r=Number(c.lastMessageId||c.messageId);r>t&&(t=r),c.hasUnreadMention&&s.push(r)}),V.current&&t>=V.current&&N({maxId:t}),s.length&&P({messageIds:s})});Object(je.a)(()=>{$.current=w,w?(ae(),re()):(oe(),se())},[w]);const{observe:ie}=Object(ft.a)({rootRef:B,throttleMs:Ga});Object(c.n)(()=>{w?Z(!0):setTimeout(()=>{Z(!1)},200)},[w]);const le=Object(c.p)(()=>{if(!f||!p)return;const e=!L||f[0]&&y!==f[0]?f:[L,...f];if(!e.length)return;const t=e.map(e=>p[e]);return gt(Object(d.k)(t,["date","id"]),_.current)},[f,p,y,L]),[de,be,ue]=Object(c.p)(()=>"thread"===a?[Object(g.a)(()=>k({direction:l.e.Backwards}),1e3,!0,!1),Object(g.a)(()=>k({direction:l.e.Forwards}),1e3,!0,!1),Object(g.a)(()=>k({direction:l.e.Around}),1e3,!0,!1)]:[],[k,f]),{isScrolled:me,updateStickyDates:he}=pt(),Oe=Object(c.m)(()=>{if(z.current)return void(z.current=!1);const s=B.current;$.current||he(s,r),_a(()=>{Object(g.b)(()=>{s.parentElement&&(U.current=s.scrollHeight-s.scrollTop,"thread"===a&&T({chatId:e,threadId:t,scrollOffset:U.current}))})})},[he,r,a,T,e,t]);Object(c.n)(()=>{if(!("ResizeObserver"in window))return;const e=new ResizeObserver(([e])=>{e.target.offsetParent&&Q(e.contentRect.height)});return e.observe(B.current),()=>{e.disconnect()}},[]);const{height:ge}=_e();Object(c.n)(()=>{B.current.dataset.normalHeight=String(B.current.offsetHeight)},[ge]),Object(c.n)(()=>{if(!ue||!u||C||w)return;const e=B.current;(!f||f.length<n.V/2&&e.firstElementChild.clientHeight<=e.offsetHeight)&&ue()},[u,f,ue,w,C]),Object(je.a)(()=>{if(!f||!q.current)return;const e=q.current.filter(e=>f.includes(Number(e.dataset.messageId))),t=e[1]||e[0];t&&(H.current=t.id,G.current=t.getBoundingClientRect().top)},[f,v,K,r]),Object(Ot.a)(([e,t,a])=>{const s=B.current;if(q.current=Array.from(s.querySelectorAll(".message-list-item")),!s.offsetParent)return;const c=v&&f&&f.length<n.V/2&&!s.parentElement.classList.contains("force-messages-scroll")&&s.firstElementChild.clientHeight<=2*s.offsetHeight;c&&(s.parentElement.classList.add("force-messages-scroll"),setTimeout(()=>{s.parentElement&&s.parentElement.classList.remove("force-messages-scroll")},1e3));const{scrollTop:o,scrollHeight:i,offsetHeight:l}=s,d=U.current,b=q.current[q.current.length-1],u=b?b.offsetHeight:0,m=v&&t&&d-(a||l)-u<=100;let h;const O=f&&e&&f[0]!==e[0],j=f&&e&&f[f.length-1]!==e[e.length-1],p=f&&$.current===f[f.length-1];if(m&&j&&!O&&!p&&(b&&Object(g.b)(()=>{Object(vt.a)(s,b,"end",20,void 0,void 0,void 0,!0)}),h=i-l,U.current=Math.max(i-h,l),!c))return;const I=void 0!==a&&a!==K,y=H.current&&s.querySelector("#"+H.current),C=!y&&_.current&&s.querySelector(".unread-divider");if(m&&I){if(Object(vt.b)())return;h=i-l}else if(y){h=o+(y.getBoundingClientRect().top-(G.current||0))}else h=C?C.offsetTop-(r?60:10):i-d;Object(It.a)(s,h),$.current||(z.current=!0,Object(g.b)(()=>{z.current=!1})),U.current=Math.max(i-h,l)},[f,v,K,r]),Object(c.n)(()=>{(!S||S>0)&&Object(X.b)(200+n.c)},[S,M]);const fe=Object(ne.a)(),pe=Boolean(e&&Object(m.lb)(e)),Ie=Boolean(!pe&&!h||j),ve=Object(J.a)("MessageList custom-scroll",!Ie&&"no-avatars",h&&"no-avatars",!O&&"no-composer","pinned"===a&&"type-pinned",M&&"select-mode-active",Y&&"has-focusing",me&&"scrolled");return c.a.createElement("div",{ref:B,className:ve,onScroll:Oe},C?c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,E?E.text:"This is a private "+(h?"channel":"chat"))):R?c.a.createElement("div",{className:"empty rich"},c.a.createElement("span",null,Object(tt.a)(fe(R),["br","emoji","links"]))):f&&!le?c.a.createElement("div",{className:"empty"},c.a.createElement("span",null,fe("NoMessages"))):f&&le||A?c.a.createElement(Ct,{containerRef:B,className:"messages-container",messageIds:f||[A.id],focusingId:w,loadMoreForwards:be,loadMoreBackwards:de,isViewportNewest:v,firstUnreadId:I,onFabToggle:i,onNotchToggle:b},function(e,t,a,s,r,o,i,l,b,u,h,O,j,g,f,p){const I=c.a.createElement("div",{className:Object(J.a)("unread-divider","local-action-message"),key:"unread-messages"},c.a.createElement("span",null,e("UnreadMessages"))),v=f?0:t.reduce((e,t)=>e+Object(d.h)(t.senderGroups).length,0);let y=0;const C=t.map((t,O,f)=>{const C=t.senderGroups.map((t,n,g)=>{if(1===t.length&&!jt(t[0])&&Object(m.db)(t[0])){const e=t[0],s=n===g.length-1&&O===f.length-1;return Object(d.e)([e.id===l.current&&I,c.a.createElement(Vt,{key:e.id,message:e,observeIntersection:a,appearanceOrder:v-++y,isLastInList:s})])}let p;return Object(d.h)(t.map((C,E)=>{const w=jt(C)?C.mainMessage:C,M=jt(C)?C:void 0,S=Object(m.tb)(w),k=jt(C),N=t[E+1];w.previousLocalId&&i.current==="message"+w.previousLocalId&&(i.current="message"+w.id);const P=!k&&w.groupedId?w.groupedId:void 0,T=N&&!jt(N)?N.groupedId:void 0,A={isFirstInGroup:0===E,isLastInGroup:E===t.length-1,isFirstInDocumentGroup:Boolean(P&&P!==p),isLastInDocumentGroup:Boolean(P&&P!==T),isLastInList:E===t.length-1&&n===g.length-1&&O===f.length-1};p=P;const x=Object(m.F)(w),R="scheduled"!==u?x:`${w.date}_${x}`;return Object(d.e)([w.id===l.current?I:void 0,c.a.createElement(Ha,{key:R,message:w,observeIntersectionForBottom:a,observeIntersectionForMedia:s,observeIntersectionForAnimatedStickers:r,album:M,withAvatar:A.isLastInGroup&&o&&!S&&!(w.id===h),withSenderName:A.isFirstInGroup&&o&&!S,threadId:b,messageListType:u,noComments:!1===j,appearanceOrder:v-++y,isFirstInGroup:A.isFirstInGroup,isLastInGroup:A.isLastInGroup,isFirstInDocumentGroup:A.isFirstInDocumentGroup,isLastInDocumentGroup:A.isLastInDocumentGroup,isLastInList:A.isLastInList}),w.id===h&&c.a.createElement("div",{className:"local-action-message",key:"discussion-started"},c.a.createElement("span",null,e("DiscussionStarted")))])}))});return c.a.createElement("div",{className:"message-date-group",key:t.datetime,teactFastList:!0},c.a.createElement("div",{className:Object(J.a)("sticky-date",!g&&"interactive"),key:"date-header",onClick:g?void 0:()=>p({selectedAt:t.datetime})},c.a.createElement("span",{dir:"auto"},g&&t.originalDate===n.lb&&e("MessageScheduledUntilOnline"),g&&t.originalDate!==n.lb&&e("MessageScheduledOn",Object(x.c)(e,t.datetime,void 0,!0)),!g&&Object(x.c)(e,t.datetime))),Object(d.h)(C))});return Object(d.h)(C)}(fe,le||gt([A]),ce,te,ie,Ie,H,_,t,a,L,0,Boolean(F),!!le&&"scheduled"===a,!le||!W.current,D)):c.a.createElement(Ee.a,{color:"white"}))}));a(237);var $a=Object(c.h)(Object(s.h)(e=>{const t=Object(o.y)(e);if(!t)return{};const{chatId:a,threadId:s,type:n}=t,c=Object(o.f)(e,a);return{messageListType:n,unreadCount:c&&s===i.MAIN_THREAD_ID&&"thread"===n?c.unreadCount:void 0}},(e,t)=>Object(d.l)(t,["focusLastMessage"]))(({isShown:e,canPost:t,messageListType:a,unreadCount:s,focusLastMessage:n})=>{const r=Object(ne.a)(),o=Object(c.q)(null),i=Object(c.m)(()=>{if(e)if("thread"===a)n();else{const e=o.current.parentElement.querySelector(".MessageList"),t=e.querySelectorAll(".message-list-item"),a=t[t.length-1];if(!a)return;Object(vt.a)(e,a,"end",20)}},[e,a,n]),l=Object(J.a)("ScrollDownButton",e&&"revealed",!t&&"no-composer");return c.a.createElement("div",{ref:o,className:l},c.a.createElement("div",{className:"ScrollDownButton-inner"},c.a.createElement(oe.a,{color:"secondary",round:!0,onClick:i,ariaLabel:r("AccDescrPageDown")},c.a.createElement("i",{className:"icon-arrow-down"})),Boolean(s)&&c.a.createElement("div",{className:"unread-count"},Object(Qe.b)(s))))})),za=a(129),Wa=a(138);async function Ka(e,t,a,s){const n=URL.createObjectURL(t),{type:c,size:r}=t;let o,i;if(c.startsWith("image/"))if(a){const a=await Object(Ge.g)(n),{width:r,height:i}=a;if(r>1280||i>1280||"image/jpeg"!==c){const c=await function(e){return new Promise(t=>{const a=document.createElement("canvas"),s=a.getContext("2d");let{width:n,height:c}=e;(n>1280||c>1280)&&(n>=c?(c*=1280/n,n=1280):(n*=1280/c,c=1280)),a.width=n,a.height=c,s.drawImage(e,0,0,e.width,e.height,0,0,n,c),a.toBlob(t,"image/jpeg",100)})}(a);return c?(URL.revokeObjectURL(n),Ka(e,c,!0,s)):Ka(e,t,!1,s)}o={width:r,height:i}}else i=n;else if(c.startsWith("video/")){if(r<10485760){const{videoWidth:e,videoHeight:t,duration:a}=await Object(Ge.h)(n);o={width:e,height:t,duration:a}}i=await Object(Ge.c)(n)}return{blobUrl:n,filename:e,mimeType:c,size:r,quick:o,previewBlobUrl:i,...s}}var Qa=a(181),Ya=a.p+"8ccc0b555efcec3616377aea078dda16.js";const Xa={encoderPath:Ya,reuseWorker:!0},Ja={type:"audio/ogg"};let Za,es,ts;async function as(){return Za||(Za=a.e(9).then(a.t.bind(null,316,7)),es=(await Za).default,ts=new es(Xa)),Za}async function ss(e){await async function(){await as(),await ts.start()}();const t=Date.now();let a;const s=[],n=[];ts.ondataavailable=e=>{s.push(e)};const c=function(e,t){const a=e.sourceNode,s=a.context.createAnalyser();s.fftSize=64,a.connect(s);const n=s.frequencyBinCount,c=new Uint8Array(n);let r=!1;return function e(){if(r)return;s.getByteFrequencyData(c);const a=c.reduce((e,t)=>e+t,0),o=a/n/255;t(o<.1?0:o),requestAnimationFrame(e)}(),()=>{r=!0}}(ts,t=>{n.push(255*t),e(t)});return{stop:()=>new Promise((e,r)=>{ts.onstop=()=>{e({blob:new Blob(s,Ja),duration:Math.round(((a||Date.now())-t)/1e3),waveform:n})},ts.onerror=r;const o=Math.max(0,t+1e3-Date.now());setTimeout(()=>{ts.stop(),c()},o)}),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout(()=>{ts.pause(),a=Date.now(),c()},e)}}}const ns=["image/png","image/jpeg","image/gif"];function cs(e){const{text:t,entities:a}=e||{};if(!t)return"";const s=Object(wt.b)(t,a,void 0,void 0,!0);return Array.isArray(s)?s.join(""):s}let rs,os;var is=a(64);var ls=a(182),ds=a(190);var bs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"DeleteMessageModal",!t);return a?c.a.createElement(a,e):void 0});function us(){return(us=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}let ms,hs=!0;var Os=Object(c.h)(({onActivate:e,...t})=>{const a=Object(c.q)(!1),s=Object(c.m)(()=>{if(a.current=!0,hs)return hs=!1,void e();ms&&(clearTimeout(ms),ms=void 0),ms=window.setTimeout(()=>{a.current&&e()},200)},[e]),n=Object(c.m)(()=>{a.current=!1},[]);return c.a.createElement(oe.a,us({},t,{onMouseEnter:h.l?void 0:s,onMouseLeave:h.l?void 0:n,onClick:h.l?e:void 0}))});var js=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"AttachMenu",!t);return a?c.a.createElement(a,e):void 0});var gs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"SymbolMenu",!t);return a?c.a.createElement(a,e):void 0});var fs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"MentionTooltip",!t);return a?c.a.createElement(a,e):void 0});var ps=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"CustomSendMenu",!t);return a?c.a.createElement(a,e):void 0});var Is=e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"StickerTooltip",!t);return a?c.a.createElement(a,e):void 0},vs=a(183);var ys=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"BotKeyboardMenu",!t);return a?c.a.createElement(a,e):void 0}),Cs=a(184),Es=a(119);a(239);var ws=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a,type:s}=Object(o.y)(e)||{};if(!t||!a||!s)return{};const{currentUserId:n,forwardMessages:{fromChatId:c,toChatId:r,messageIds:i}}=e,l=Object(o.mb)(e,t,a),d="scheduled"===s?Object(o.E)(e,t):Object(o.C)(e,t,a),b=e.settings.byKey.animationLevel>=1,u=r===t;let h,O;if(l?h=Object(o.k)(e,t,l):d?h=Object(o.D)(e,t,a,s):u&&1===i.length&&(h=Object(o.k)(e,c,i[0])),l&&h){const{forwardInfo:a}=h,s=t===n;a&&(a.isChannelPost||s)&&(O=Object(o.K)(e,h)),O||(O=Object(o.tb)(e,h))}else u&&(O=Object(m.lb)(c)?Object(o.Gb)(e,c):Object(o.f)(e,c));return{replyingToId:l,editingId:d,message:h,sender:O,shouldAnimate:b,forwardedMessagesCount:u?i.length:void 0}},(e,t)=>Object(d.l)(t,["setReplyingToId","setEditingId","focusMessage","exitForwardMode"]))(({replyingToId:e,editingId:t,message:a,sender:s,shouldAnimate:n,forwardedMessagesCount:r,setReplyingToId:o,setEditingId:i,focusMessage:l,exitForwardMode:d})=>{const b=Boolean((e||t)&&a||s&&r),u=Object(Es.a)([r],r?300:void 0),{shouldRender:m,transitionClassNames:h}=Object(Z.a)(u&&b,void 0,!n,void 0,!n),O=Object(c.m)(()=>{e?o({messageId:void 0}):t?i({messageId:void 0}):r&&d()},[e,t,r,o,i,d]);Object(c.n)(()=>b?Object(te.a)(O):void 0,[b,O]);const j=Object(c.m)(()=>{l({chatId:a.chatId,messageId:a.id})},[l,a]),g=Object(J.a)("ComposerEmbeddedMessage",h),f=r&&r>1?r+" forwarded messages":void 0;if(m)return c.a.createElement("div",{className:g},c.a.createElement("div",null,c.a.createElement(oe.a,{round:!0,color:"translucent",ariaLabel:"Cancel replying",onClick:O},c.a.createElement("i",{className:"icon-close"})),c.a.createElement($t,{className:"inside-input",message:a,sender:s,customText:f,title:t?"Edit Message":void 0,onClick:j})))}));var Ms=Object(c.h)(e=>{const{attachments:t}=e,a=Object(Ce.a)(ye.a.Extra,"AttachmentModal",!t.length);return a?c.a.createElement(a,e):void 0});var Ss=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"PollModal",!t);return a?c.a.createElement(a,e):void 0});var ks=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"DropArea",!t);return a?c.a.createElement(a,e):void 0});a(240);const Ns=new RegExp(n.gb,"i");var Ps=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a})=>{const s=Object(o.cb)(e,t,a);return{webPagePreview:e.webPagePreview,noWebPage:s}},(e,t)=>Object(d.l)(t,["loadWebPagePreview","clearWebPagePreview","toggleMessageWebPage"]))(({chatId:e,threadId:t,messageText:a,disabled:s,webPagePreview:n,noWebPage:r,loadWebPagePreview:o,clearWebPagePreview:l,toggleMessageWebPage:d})=>{const b=Object(c.p)(()=>{const{text:e,entities:t}=Object(Wa.a)(a),s=t&&t.find(({type:e})=>e===i.ApiMessageEntityTypes.TextUrl);if(s)return s.url;const n=e.match(Ns);return n?n[0]:void 0},[a]);Object(c.n)(()=>{b?o({text:b}):(l(),d({chatId:e,threadId:t}))},[e,d,l,b,o,t]),Object(je.a)(()=>{l(),d({chatId:e,threadId:t})},[e]);const u=Boolean(n&&a.length&&!r&&!s),{shouldRender:m,transitionClassNames:h}=Object(Z.a)(u),O=Object(Ke.a)(n);if(!m||!O)return;const{photo:j,...g}=O,f={content:{webPage:g}};return c.a.createElement("div",{className:Object(J.a)("WebPagePreview",h)},c.a.createElement("div",null,c.a.createElement(oe.a,{round:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:()=>{d({chatId:e,threadId:t,noWebPage:!0})}},c.a.createElement("i",{className:"icon-close"})),c.a.createElement(Ma,{message:f,inPreview:!0})))})),Ts=a(122);var As=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"CalendarModal",!t);return a?c.a.createElement(a,e):void 0});var xs=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"PaymentModal",!t);return a?c.a.createElement(a,e):void 0});var Rs,Ls=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"ReceiptModal",!t);return a?c.a.createElement(a,e):void 0});a(241);!function(e){e.Send="send",e.Record="record",e.Edit="edit"}(Rs||(Rs={}));var Fs=Object(c.h)(Object(s.h)((e,{chatId:t,threadId:a,messageListType:s})=>{const n=Object(o.f)(e,t),c=n&&Object(o.o)(e,n),r=n?Object(o.O)(e,n):void 0,l=Object(o.P)(e,t),d=r&&Object(o.bb)(e,t),b=Object(o.ob)(e,t),{language:u}=e.settings.byKey,h=Object(o.F)(e,u);return{editingMessage:Object(o.D)(e,t,a,s),connectionState:e.connectionState,draft:Object(o.B)(e,t,a),chat:n,isChatWithBot:r,isChatWithSelf:l,canScheduleUntilOnline:!l&&!r&&n&&c&&Object(m.lb)(t)&&c.status&&Boolean(c.status.wasOnline),isRightColumnShown:Object(o.W)(e),isSelectModeActive:Object(o.S)(e),withScheduledButton:a===i.MAIN_THREAD_ID&&"thread"===s&&Boolean(b&&b.length),shouldSchedule:"scheduled"===s,botKeyboardMessageId:d?d.id:void 0,isForwarding:t===e.forwardMessages.toChatId,canSuggestMembers:n&&Object(m.kb)(n),isPollModalOpen:e.isPollModalOpen,stickersForEmoji:e.stickers.forEmoji.stickers,groupChatMembers:n&&n.fullInfo&&n.fullInfo.members,currentUserId:e.currentUserId,usersById:e.users.byId,lastSyncTime:e.lastSyncTime,contentToBeScheduled:e.messages.contentToBeScheduled,isPaymentModalOpen:e.payment.isPaymentModalOpen,isReceiptModalOpen:Boolean(e.payment.receipt),shouldSuggestStickers:e.settings.byKey.shouldSuggestStickers,recentEmojis:e.recentEmojis,language:u,emojiKeywords:h?h.keywords:void 0}},(e,t)=>Object(d.l)(t,["sendMessage","editMessage","saveDraft","clearDraft","showError","setStickerSearchQuery","setGifSearchQuery","forwardMessages","openPollModal","closePollModal","closePaymentModal","clearReceipt","loadScheduledHistory","openChat","addRecentEmoji","loadEmojiKeywords"]))(({dropAreaState:e,shouldSchedule:t,canScheduleUntilOnline:a,onDropHide:r,editingMessage:o,chatId:l,threadId:d,messageListType:b,draft:u,chat:O,connectionState:j,isChatWithBot:f,isChatWithSelf:p,isRightColumnShown:I,isSelectModeActive:v,isForwarding:y,canSuggestMembers:C,isPollModalOpen:E,isPaymentModalOpen:w,isReceiptModalOpen:M,botKeyboardMessageId:S,withScheduledButton:k,stickersForEmoji:N,groupChatMembers:P,currentUserId:T,usersById:A,lastSyncTime:R,contentToBeScheduled:L,shouldSuggestStickers:F,language:D,emojiKeywords:B,recentEmojis:U,sendMessage:H,editMessage:G,saveDraft:q,clearDraft:_,showError:V,setStickerSearchQuery:$,setGifSearchQuery:z,forwardMessages:W,openPollModal:K,closePollModal:Q,loadScheduledHistory:Y,closePaymentModal:X,openChat:Z,clearReceipt:ee,addRecentEmoji:ae,loadEmojiKeywords:se})=>{const ce=Object(c.q)(null),[re,ie]=Object(c.r)(""),le=Object(c.q)(),de=Object(na.a)(e),[be,ue,he]=Object(ot.a)(),[Oe,je]=Object(c.r)(),ge=Object(c.q)(re);Object(c.n)(()=>{ge.current=re},[re]),Object(c.n)(()=>{le.current=void 0},[l]),Object(c.n)(()=>{l&&R&&d===i.MAIN_THREAD_ID&&Y()},[l,Y,R,d]),Object(c.o)(()=>{ce.current&&(ce.current.innerHTML='<svg width="9" height="20" xmlns="http://www.w3.org/2000/svg"><defs><filter x="-50%" y="-14.7%" width="200%" height="141.2%" filterUnits="objectBoundingBox" id="a"><feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0" in="shadowBlurOuter1"/></filter></defs><g fill="none" fill-rule="evenodd"><path d="M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z" fill="#000" filter="url(#a)"/><path d="M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z" fill="#FFF" class="corner"/></g></svg>')},[]),Object(c.n)(()=>{L&&(je(L),ue())},[L,ue]);const[fe,pe]=Object(c.r)([]),[Ie,ve,ye]=Object(ot.a)(),[Ce,Ee,we]=Object(ot.a)(),[Me,Se,ke]=Object(ot.a)(),[Ne,Pe,Te]=Object(ot.a)(),[Ae,xe]=Object(ot.a)(),[Re,Le,Fe]=Object(ot.a)(),{startRecordingVoice:De,stopRecordingVoice:Be,pauseRecordingVoice:He,activeVoiceRecording:Ge,currentRecordTime:qe,recordButtonRef:_e,startRecordTimeRef:Ve}=(()=>{const e=Object(c.q)(null),[t,a]=Object(c.r)(),s=Object(c.q)(),[n,r]=Object(c.r)();Object(c.n)(()=>{h.e&&as()},[]);const o=Object(c.m)(async()=>{try{const{stop:t,pause:n}=await ss(t=>{e.current&&(s.current&&Date.now()%4==0&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`),r(Date.now()))});s.current=Date.now(),r(Date.now()),a({stop:t,pause:n})}catch(e){console.error(e)}},[]),i=Object(c.m)(()=>{if(t){e.current&&(e.current.style.boxShadow="none");try{return t.pause()}catch(e){return void console.error(e)}}},[t]),l=Object(c.m)(()=>{if(t){a(void 0),s.current=void 0,r(void 0),e.current&&(e.current.style.boxShadow="none");try{return t.stop()}catch(e){return void console.error(e)}}},[t]);return Object(c.n)(()=>t?Object(te.a)(l):void 0,[t,l]),{startRecordingVoice:o,pauseRecordingVoice:i,stopRecordingVoice:l,activeVoiceRecording:t,currentRecordTime:n,recordButtonRef:e,startRecordTimeRef:s}})(),$e=o?Rs.Edit:!h.m||Ge||re&&!fe.length||y?Rs.Send:Rs.Record,ze=!t,{isMentionTooltipOpen:We,mentionFilter:Ke,closeMentionTooltip:Qe,insertMention:Ye,mentionFilteredMembers:Xe}=Object(ds.a)(C&&!fe.length,re,ie,void 0,P,T,A),{isContextMenuOpen:Je,handleContextMenu:Ze,handleContextMenuClose:et,handleContextMenuHide:at}=Object(Et.a)(_e,!($e===Rs.Send&&ze)),st=Object(c.p)(()=>Object(m.c)(O,f),[O,f]),nt=O&&Object(m.gb)(O),ct=Object(m.k)(O),{isStickerTooltipOpen:rt,closeStickerTooltip:it}=function(e,t,a){const{loadStickersForEmoji:n,clearStickersForEmoji:r}=Object(s.d)(),o=h.d&&1===Object(is.a)(t)||!h.d&&Boolean(t.match(/^<img.[^>]*?>$/g)),i=Boolean(a)&&o;return Object(c.n)(()=>{e&&o?n({emoji:t}):!i&&o||r()},[t,o,r,n,e]),{isStickerTooltipOpen:i,closeStickerTooltip:r}}(Boolean(F&&st.canSendStickers&&!fe.length),re,N),{isEmojiTooltipOpen:lt,closeEmojiTooltip:dt,filteredEmojis:bt,insertEmoji:ut}=Object(ls.a)(Boolean(F&&st.canSendStickers&&!fe.length),re,U,void 0,ie,B),mt=Object(c.m)((e,t=n.v)=>{const a=window.getSelection(),s=document.getElementById(t),c=Object(tt.a)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");if(a.rangeCount){const t=a.getRangeAt(0);if(Object(Qa.a)(t))return void(h.d?document.execCommand("insertText",!1,e):(!function(e){const t=window.getSelection();if(t&&t.getRangeAt&&t.rangeCount){const a=t.getRangeAt(0);a.deleteContents();const s=a.createContextualFragment(e),n=s.lastChild;a.insertNode(s),n&&(a.setStartAfter(n),a.setEndAfter(n),t.removeAllRanges(),t.addRange(a))}}(c),s.dispatchEvent(new Event("input",{bubbles:!0}))))}ie(`${ge.current}${c}`),h.g||requestAnimationFrame(()=>{Object(za.a)(s)})},[]),ht=Object(c.m)(()=>{const e=window.getSelection();if(e.rangeCount){const t=e.getRangeAt(0);if(Object(Qa.a)(t))return void document.execCommand("delete",!1)}ie(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,document.body.appendChild(t);let a=t.lastChild;if(a.lastChild)for(;a.lastChild;)a=a.lastChild;const s=a.textContent.length,n=document.createRange(),c=window.getSelection();n.setStart(a,s),n.setEnd(a,s),c.removeAllRanges(),c.addRange(n),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}(ge.current))},[]),Ot=Object(c.m)(()=>{ie(""),pe([]),it(),he(),je(void 0),Qe(),dt(),h.g?setTimeout(()=>ke(),350):ke()},[it,he,Qe,dt,ke]),jt=Object(na.a)(l);Object(c.n)(()=>{jt&&l!==jt&&(Be(),Ot())},[l,jt,Ot,Be]);const gt=((e,t,a,s,r,o)=>{Object(c.n)(()=>{a?(t(cs(a.content.text)),requestAnimationFrame(()=>{const e=document.getElementById(n.v);Object(za.a)(e,!0)})):t("")},[a,t]);return Object(c.m)(()=>{const{text:t,entities:n}=Object(Wa.a)(e.current);a&&(t||Object(m.cb)(a)?(o({messageId:a.id,text:t,entities:n}),s()):r())},[o,a,e,r,s])})(ge,ie,o,Ot,Pe,G);((e,t,a,s,r,o,i,l,d)=>{const b=Object(c.m)((e,t)=>{r.current.length&&!i?l({chatId:e,threadId:t,draft:Object(Wa.a)(r.current)}):d({chatId:e,threadId:t})},[d,i,r,l]),u=Object(c.p)(()=>Object(g.a)(e=>e(),n.u,!1),[t]),m=Object(na.a)(t),h=Object(na.a)(a);Object(c.n)(()=>(rs=t,os=a,()=>{rs=void 0,os=void 0,b(t,a)}),[t,a,b]),Object(c.n)(()=>{t===m&&a===h||e&&(o(cs(e)),requestAnimationFrame(()=>{const e=document.getElementById(n.v);Object(za.a)(e,!0)}))},[t,a,e,o,b,m,h]);const O=Object(na.a)(s);Object(c.n)(()=>{t&&a&&m===t&&h===a&&O!==s&&(s.length?u(()=>{rs===t&&os===a&&b(t,a)}):b(t,a))},[t,s,m,O,h,u,a,b]),Object(c.n)(()=>{function e(){t&&a&&b(t,a)}return window.addEventListener("blur",e),()=>{window.removeEventListener("blur",e)}},[t,a,b])})(u,l,d,re,ge,ie,o,q,_),((e,t,a)=>{Object(c.n)(()=>{async function s(s){if(!s.clipboardData)return;const c=document.activeElement;if(c&&"INPUT"===c.tagName&&![n.v,n.w].includes(c.id))return;const{items:r}=s.clipboardData,o=Array.from(r).find(e=>ns.includes(e.type)),i=o&&o.getAsFile(),l=s.clipboardData.getData("text").substring(0,4096);if(i||l){if(s.preventDefault(),i&&!a){const e=await Ka(i.name,i,!0);t(t=>[...t,e])}l&&e(l,c?c.id:void 0)}}return document.addEventListener("paste",s,!1),()=>{document.removeEventListener("paste",s,!1)}},[e,a,t])})(mt,pe,o);const ft=Object(c.m)(async(e,t)=>{pe(await Promise.all(e.map(e=>Ka(e.name,e,t))))},[]),pt=Object(c.m)(async(e,t)=>{pe([...fe,...await Promise.all(e.map(e=>Ka(e.name,e,t)))])},[fe]),It=Object(c.m)(()=>{pe([])},[]),vt=Object(c.m)(async(e=!1,t)=>{if("connectionStateReady"!==j)return;let a=fe;if(Ge){const e=await Be();if(e){const{blob:t,duration:s,waveform:n}=e;a=[await Ka("wonderful-voice-message.ogg",t,!1,{voice:{duration:s,waveform:n}})]}}const{text:s,entities:c}=Object(Wa.a)(ge.current);if(a.length||s||y)if(a.length&&s&&s.length>1024){const e=s.length-1024;V({error:{message:"CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":e,"{PLURAL_S}":e>1?"s":""}}})}else{if(a.length||s){if(ct&&!nt){const e=Math.floor(Date.now()/1e3),t=le.current&&Math.floor(e-le.current),a=ct.nextSendDate&&ct.nextSendDate>e;if(t&&t<ct.seconds||a){const s=a?ct.nextSendDate-e:ct.seconds-t;V({error:{message:`A wait of ${s} seconds is required before sending another message in this chat`,isSlowMode:!0}});return void document.getElementById(n.v).blur()}}H({text:s,entities:c,attachments:a,scheduledAt:t,isSilent:e})}y&&W(),le.current=Math.floor(Date.now()/1e3),_({chatId:l,localOnly:!0}),requestAnimationFrame(Ot)}},[Ge,fe,j,l,ct,y,nt,H,Be,Ot,_,V,W]),yt=Object(c.m)(e=>{e={...e,isPreloadedGlobally:!0},t?(je({sticker:e}),ue()):(H({sticker:e}),requestAnimationFrame(Ot))},[t,ue,H,Ot]),Ct=Object(c.m)(e=>{t?(je({gif:e}),ue()):(H({gif:e}),requestAnimationFrame(Ot))},[t,ue,H,Ot]),wt=Object(c.m)(e=>{t?(je({poll:e}),Q(),ue()):(H({poll:e}),Q())},[Q,ue,H,t]),Mt=Object(c.m)(()=>{t?(je({isSilent:!0}),ue()):vt(!0)},[vt,ue,t]),St=Object(c.m)(e=>{const{isSilent:t,...a}=Oe||{},s=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3);Oe&&0!==Object.keys(a).length?(H({...Oe,scheduledAt:s}),requestAnimationFrame(Ot)):vt(!!t,s),he()},[he,vt,Ot,Oe,H]),kt=Object(c.m)(()=>{St(new Date(1e3*n.lb))},[St]),Nt=Object(c.m)(()=>{he(),je(void 0)},[he]),Pt=Object(c.m)(e=>{"stickers"===e?($({query:""}),z({query:void 0})):(z({query:""}),$({query:void 0}))},[$,z]),Tt=Object(c.m)(()=>{const e=document.getElementById(n.v);h.g&&e===document.activeElement?(e.blur(),setTimeout(()=>{Se()},100)):Se()},[Se]),At=Object(c.m)(()=>{Z({id:l,threadId:d,type:"scheduled"})},[Z,l,d]);Object(c.n)(()=>{I&&h.g&&ke()},[I,ke]),Object(c.n)(()=>{v?Le():setTimeout(()=>{Fe()},200)},[v,Fe,Le]);const xt=Object(c.m)(()=>{switch($e){case Rs.Send:t?(Ge&&He(),ue()):(vt(),requestAnimationFrame(Ot));break;case Rs.Record:De();break;case Rs.Edit:gt()}},[$e,Ot,t,De,gt,Ge,ue,He,vt]),Rt=Object(ne.a)(),Lt=$e===Rs.Record&&!st.canAttachMedia,Ft=Object(na.a)(o,!0),Dt=o||Ft,Bt=new Date;Bt.setSeconds(0),Bt.setMilliseconds(0);const Ut=new Date;Ut.setFullYear(Ut.getFullYear()+1);let Ht="SendMessage";switch($e){case Rs.Edit:Ht="Save edited message";break;case Rs.Record:Ht=Lt?"Conversation.DefaultRestrictedMedia":"AccDescrVoiceMessage"}const Gt=Object(J.a)("Composer",!v&&"shown",Re&&"hover-disabled"),qt=Object(J.a)("mobile-symbol-menu-button",Ae?Me&&"menu-opened":Me&&"is-loading");return c.a.createElement("div",{className:Gt},st.canAttachMedia&&c.a.createElement(Ts.a,{containerId:"#middle-column-portals"},c.a.createElement(ks,{isOpen:e!==Ue.a.None,withQuick:[e,de].includes(Ue.a.QuickFile),onHide:r,onFileSelect:ft})),c.a.createElement(Ms,{attachments:fe,caption:fe.length?re:"",canSuggestMembers:C,groupChatMembers:P,currentUserId:T,usersById:A,recentEmojis:U,onCaptionUpdate:ie,language:D,addRecentEmoji:ae,loadEmojiKeywords:se,onSend:t?ue:vt,onFileAppend:pt,onClear:It}),c.a.createElement(Ss,{isOpen:Boolean(E),onClear:Q,onSend:wt}),c.a.createElement(xs,{isOpen:Boolean(w),onClose:X}),c.a.createElement(Ls,{isOpen:Boolean(M),onClose:ee}),Dt&&c.a.createElement(bs,{isOpen:Ne,isSchedule:"scheduled"===b,onClose:Te,message:Dt}),c.a.createElement(fs,{isOpen:We,filter:Ke,onClose:Qe,onInsertUserName:Ye,filteredChatMembers:Xe,usersById:A}),c.a.createElement("div",{id:"message-compose"},c.a.createElement("div",{className:"svg-appendix",ref:ce}),c.a.createElement(ws,null),c.a.createElement(Ps,{chatId:l,threadId:d,messageText:fe.length?"":re,disabled:!st.canAttachEmbedLinks}),c.a.createElement("div",{className:"message-input-wrapper"},h.g?c.a.createElement(oe.a,{className:qt,round:!0,color:"translucent",onClick:Me?ke:Tt,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"}),c.a.createElement("i",{className:"icon-keyboard"}),c.a.createElement(me.a,{color:"gray"})):c.a.createElement(Os,{className:""+(Me?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Se,ariaLabel:"Choose emoji, sticker or GIF"},c.a.createElement("i",{className:"icon-smile"})),c.a.createElement(Cs.a,{id:"message-input-text",html:fe.length?"":re,placeholder:Ge&&window.innerWidth<=600?"":Rt("Message"),shouldSetFocus:Me,shouldSupressFocus:h.g&&Me,shouldSupressTextFormatter:lt||We,onUpdate:ie,onSend:$e===Rs.Edit?gt:t?ue:vt,onSupressedFocus:ke}),k&&c.a.createElement(oe.a,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:At,ariaLabel:"Open scheduled messages"},c.a.createElement("i",{className:"icon-schedule"})),S&&!Ge&&!o&&c.a.createElement(Os,{className:""+(Ie?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:ve,ariaLabel:"Open bot command keyboard"},c.a.createElement("i",{className:"icon-bot-command"})),!Ge&&!o&&c.a.createElement(Os,{className:""+(Ce?"activated":""),round:!0,faded:!0,color:"translucent",onActivate:Ee,ariaLabel:"Add an attachment"},c.a.createElement("i",{className:"icon-attach"})),Ge&&qe&&c.a.createElement("span",{className:"recording-state"},Object(x.i)(qe-Ve.current)),c.a.createElement(Is,{isOpen:rt,onStickerSelect:yt}),c.a.createElement(vs.a,{isOpen:lt,emojis:bt,onClose:dt,onEmojiSelect:ut,addRecentEmoji:ae,loadEmojiKeywords:se,language:D}),c.a.createElement(js,{isOpen:Ce,allowedAttachmentOptions:st,onFileSelect:ft,onPollCreate:K,onClose:we}),S&&c.a.createElement(ys,{messageId:S,isOpen:Ie,onClose:ye}),c.a.createElement(gs,{isOpen:Me,allowedAttachmentOptions:st,onLoad:xe,onClose:ke,onEmojiSelect:mt,onStickerSelect:yt,onGifSelect:Ct,onRemoveSymbol:ht,onSearchOpen:Pt,addRecentEmoji:ae}))),Ge&&c.a.createElement(oe.a,{round:!0,color:"danger",className:"cancel",onClick:Be,ariaLabel:"Cancel voice recording"},c.a.createElement("i",{className:"icon-delete"})),c.a.createElement(oe.a,{ref:_e,round:!0,color:"secondary",className:`${$e} ${Ge?"recording":""}`,disabled:Lt,ariaLabel:Rt(Ht),onClick:xt,onContextMenu:$e===Rs.Send&&ze?Ze:void 0},c.a.createElement("i",{className:"icon-send"}),c.a.createElement("i",{className:"icon-microphone-alt"}),c.a.createElement("i",{className:"icon-check"})),ze&&c.a.createElement(ps,{isOpen:Je,onSilentSend:p?void 0:Mt,onScheduleSend:t?void 0:ue,onClose:et,onCloseAnimationEnd:at}),c.a.createElement(As,{isOpen:be,withTimePicker:!0,selectedAt:Bt.getTime(),maxAt:Object(x.k)(Ut),isFutureMode:!0,secondButtonLabel:a?"Send When Online":void 0,onClose:Nt,onSubmit:St,onSecondButtonClick:a?kt:void 0}))}));var Ds=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Ce.a)(ye.a.Extra,"MobileSearch",!t,!0);return a?c.a.createElement(a,e):void 0});var Bs=Object(c.h)(e=>{const{isActive:t}=e,a=Object(Ce.a)(ye.a.Extra,"MessageSelectToolbar",!t);return a?c.a.createElement(a,e):void 0});var Us=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"UnpinAllMessagesModal",!t);return a?c.a.createElement(a,e):void 0});a(242);const Hs=h.g?450+n.c:void 0;function Gs(e){return"file"===e.kind&&e.type&&n.l.includes(e.type)}var qs=Object(c.h)(Object(s.h)(e=>{const{theme:t}=e.settings.byKey,{isBlurred:a,background:s,backgroundColor:n,patternColor:c}=e.settings.themes[t]||{},r=Object(o.y)(e),{chats:{listIds:l}}=e,d={theme:t,customBackground:s,backgroundColor:n,patternColor:c,isRightColumnShown:Object(o.W)(e),isBackgroundBlurred:a,isMobileSearchActive:Boolean(h.g&&Object(o.A)(e)),isSelectModeActive:Object(o.S)(e),animationLevel:e.settings.byKey.animationLevel};if(!r||!l.active)return d;const{chatId:b,threadId:u,type:O}=r,j=Object(o.f)(e,b),g=Object(o.jb)(e,b),{chatId:f,messageId:p}=e.audioPlayer,I=j&&Object(m.e)(j,u),v=Object(o.L)(e,b),y="pinned"===O;return{...d,chatId:b,threadId:u,messageListType:O,isPrivate:Object(m.lb)(b),canPost:!y&&(!j||I)&&(!v||h.g),isPinnedMessageList:y,messageSendingRestrictionReason:j&&Object(m.K)(j),hasPinnedOrAudioMessage:u!==i.MAIN_THREAD_ID||Boolean(g&&g.length)||Boolean(f&&p),pinnedMessagesCount:g?g.length:0}},(e,t)=>Object(d.l)(t,["openChat","unpinAllMessages","loadUser"]))(({chatId:e,threadId:t,messageListType:a,isPrivate:s,isPinnedMessageList:r,canPost:o,messageSendingRestrictionReason:l,hasPinnedOrAudioMessage:d,pinnedMessagesCount:b,customBackground:u,theme:m,backgroundColor:O,patternColor:j,isRightColumnShown:g,isBackgroundBlurred:f,isMobileSearchActive:p,isSelectModeActive:I,animationLevel:v,openChat:y,unpinAllMessages:C,loadUser:E})=>{const{width:w}=_e(),[M,S]=Object(c.r)(Ue.a.None),[k,N]=Object(c.r)(),[P,T]=Object(c.r)(),[A,x]=Object(c.r)(!1),R=d&&(w<n.db||g&&w>n.ab&&w<n.kb||w>=n.Z&&w<n.jb),L=Object(Ve.a)(e,Hs),F=Object(Ve.a)(t,Hs),D=Object(Ve.a)(a,Hs),B=Object(Ve.a)(o,Hs),U=Object(Ve.a)(R,Hs),H=Object(Ve.a)(k,Hs);Object(c.n)(()=>e?Object(te.a)(()=>{y({id:void 0})}):void 0,[e,y]),Object(c.n)(()=>{S(Ue.a.None),N(void 0),T(void 0)},[e]),Object(c.n)(()=>{s&&E({userId:e})},[e,s,E]);const G=Object(c.m)(e=>{if(h.l)return;const{items:t}=e.dataTransfer||{},a=t&&Array.from(t).every(Gs);S(a?Ue.a.QuickFile:Ue.a.Document)},[]),q=Object(c.m)(()=>{S(Ue.a.None)},[]),_=Object(c.m)(()=>{x(!0)},[]),V=Object(c.m)(()=>{x(!1)},[]),$=Object(c.m)(()=>{C({chatId:e}),V(),y({id:e})},[C,y,V,e]),z=((e,t)=>{const[a,s]=Object(c.r)(t);return Object(c.n)(()=>{t&&(t.startsWith("#")?s(t):He.c(n.m,e,He.a.Blob).then(e=>{const t=URL.createObjectURL(e);Object(Ge.g)(t).then(()=>{s(`url(${t})`)})}))},[t,e]),t?a:void 0})(m,u),W=Object(J.a)(U&&"has-header-tools",u&&"custom-bg-image",O&&"custom-bg-color",u&&f&&"blurred",h.n?"mask-image-disabled":"mask-image-enabled"),K=Object(J.a)("messaging-disabled",!I&&"shown"),{composerHiddenScale:Q,toolbarHiddenScale:Y,composerTranslateX:X,toolbarTranslateX:Z,unpinHiddenScale:ee,toolbarForUnpinHiddenScale:se}=Object(c.p)(()=>$e(w,B),[B,w]),ce=Object(ne.a)(),re=Object(J.a)("middle-column-footer",!B&&"no-composer",B&&P&&!I&&"with-notch");return c.a.createElement("div",{id:"MiddleColumn",className:W,style:`\n --composer-hidden-scale: ${Q};\n --toolbar-hidden-scale: ${Y};\n --unpin-hidden-scale: ${ee};\n --toolbar-unpin-hidden-scale: ${se};\n --composer-translate-x: ${X}px;\n --toolbar-translate-x: ${Z}px;\n --pattern-color: ${j};\n --theme-background-color:\n ${O||("dark"===m?n.n:n.I)};\n `},c.a.createElement("div",{id:"middle-column-bg",style:z?"--custom-background: "+z:void 0}),c.a.createElement("div",{id:"middle-column-portals"}),L&&F&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"messages-layout",onDragEnter:B?G:void 0},c.a.createElement(ht,{chatId:L,threadId:F,messageListType:D}),c.a.createElement(ae.a,{name:v===n.e?"slide":"fade",activeKey:"thread"===D&&F===i.MAIN_THREAD_ID?1:2,shouldCleanup:!0},()=>c.a.createElement(c.a.Fragment,null,c.a.createElement(Va,{key:`${L}-${F}-${D}`,chatId:L,threadId:F,type:D,canPost:B,hasTools:U,onFabToggle:N,onNotchToggle:T}),c.a.createElement("div",{className:re},B&&c.a.createElement(Fs,{chatId:L,threadId:F,messageListType:D,dropAreaState:M,onDropHide:q}),r&&c.a.createElement("div",{className:"unpin-button-container",dir:ce.isRtl?"rtl":void 0},c.a.createElement(oe.a,{size:"tiny",fluid:!0,color:"secondary",className:"unpin-all-button",onClick:_},c.a.createElement("i",{className:"icon-unpin"}),c.a.createElement("span",null,ce("Chat.Pinned.UnpinAll",b,"i")))),!r&&!B&&l&&c.a.createElement("div",{className:K},c.a.createElement("div",{className:"messaging-disabled-inner"},c.a.createElement("span",null,l))),c.a.createElement(Bs,{messageListType:D,isActive:I,canPost:B})))),c.a.createElement($a,{isShown:H,canPost:B})),h.g&&c.a.createElement(Ds,{isActive:Boolean(p)})),e&&c.a.createElement(Us,{isOpen:A,chatId:e,pinnedMessagesCount:b,onClose:V,onUnpin:$}))}));a(243);const _s=Object(g.a)(e=>e(),200,!1);var Vs;!function(e){e[e.Profile=0]="Profile",e[e.MemberList=1]="MemberList",e[e.SharedMedia=2]="SharedMedia",e[e.Search=3]="Search",e[e.Management=4]="Management",e[e.ManageInitial=5]="ManageInitial",e[e.ManageChannelSubscribers=6]="ManageChannelSubscribers",e[e.ManageChatAdministrators=7]="ManageChatAdministrators",e[e.ManageChatPrivacyType=8]="ManageChatPrivacyType",e[e.ManageDiscussion=9]="ManageDiscussion",e[e.ManageGroupPermissions=10]="ManageGroupPermissions",e[e.ManageGroupRemovedUsers=11]="ManageGroupRemovedUsers",e[e.ManageGroupUserPermissionsCreate=12]="ManageGroupUserPermissionsCreate",e[e.ManageGroupUserPermissions=13]="ManageGroupUserPermissions",e[e.ManageGroupRecentActions=14]="ManageGroupRecentActions",e[e.ManageGroupAdminRights=15]="ManageGroupAdminRights",e[e.ManageGroupMembers=16]="ManageGroupMembers",e[e.StickerSearch=17]="StickerSearch",e[e.GifSearch=18]="GifSearch",e[e.PollResults=19]="PollResults"}(Vs||(Vs={}));var $s=Object(c.h)(Object(s.h)((e,{chatId:t,isProfile:a,isManagement:s})=>{const{query:n}=Object(o.A)(e)||{},{query:c}=Object(o.z)(e)||{},{query:r}=Object(o.s)(e)||{},i=t?Object(o.f)(e,t):void 0,l=i&&Object(m.jb)(i);return{canManage:Boolean(!s&&a&&i&&!Object(o.P)(e,i.id)&&(Object(m.lb)(i.id)||(Object(m.gb)(i)||i.isCreator)&&!i.isNotJoined)),isChannel:l,messageSearchQuery:n,stickerSearchQuery:c,gifSearchQuery:r}},(e,t)=>Object(d.l)(t,["setLocalTextSearchQuery","setStickerSearchQuery","setGifSearchQuery","searchTextMessagesLocal","toggleManagement","openHistoryCalendar"]))(({isColumnOpen:e,isProfile:t,isSearch:a,isManagement:s,isStickerSearch:n,isGifSearch:r,isPollResults:o,profileState:i,managementScreen:d,canManage:b,isChannel:u,onClose:m,messageSearchQuery:O,stickerSearchQuery:j,gifSearchQuery:g,setLocalTextSearchQuery:f,setStickerSearchQuery:p,setGifSearchQuery:I,searchTextMessagesLocal:v,toggleManagement:y,openHistoryCalendar:C})=>{var E;const w=Object(c.q)(null),M=Object(c.m)(e=>{f({query:e}),e.length&&_s(v)},[v,f]),S=Object(c.m)(e=>{p({query:e})},[p]),k=Object(c.m)(e=>{I({query:e})},[I]),[N,P]=Object(c.r)(!e);Object(c.n)(()=>{setTimeout(()=>{P(!e)},300)},[e]);const T=Object(ne.a)(),A=t?i===l.k.Profile?Vs.Profile:i===l.k.SharedMedia?Vs.SharedMedia:i===l.k.MemberList?Vs.MemberList:-1:a?Vs.Search:o?Vs.PollResults:n?Vs.StickerSearch:r?Vs.GifSearch:s?d===l.g.Initial?Vs.ManageInitial:d===l.g.ChatPrivacyType?Vs.ManageChatPrivacyType:d===l.g.Discussion?Vs.ManageDiscussion:d===l.g.ChannelSubscribers?Vs.ManageChannelSubscribers:d===l.g.GroupPermissions?Vs.ManageGroupPermissions:d===l.g.ChatAdministrators?Vs.ManageChatAdministrators:d===l.g.GroupRemovedUsers?Vs.ManageGroupRemovedUsers:d===l.g.GroupUserPermissionsCreate?Vs.ManageGroupUserPermissionsCreate:d===l.g.GroupUserPermissions?Vs.ManageGroupUserPermissions:d===l.g.GroupRecentActions?Vs.ManageGroupRecentActions:d===l.g.ChatAdminRights?Vs.ManageGroupAdminRights:d===l.g.GroupMembers?Vs.ManageGroupMembers:void 0:void 0,R=null!==(E=Object(Ke.a)(A,!0))&&void 0!==E?E:-1;function L(){if(-1!==R)switch(R){case Vs.PollResults:return c.a.createElement("h3",null,T("PollResults"));case Vs.Search:return c.a.createElement(c.a.Fragment,null,c.a.createElement(ie.a,{parentContainerClassName:"RightSearch",value:O,onChange:M}),c.a.createElement(oe.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>C({selectedAt:Object(x.k)(Date.now())}),ariaLabel:"Search messages by date"},c.a.createElement("i",{className:"icon-calendar"})));case Vs.ManageInitial:return c.a.createElement("h3",null,T("Edit"));case Vs.ManageChatPrivacyType:return c.a.createElement("h3",null,T(u?"ChannelTypeHeader":"GroupTypeHeader"));case Vs.ManageDiscussion:return c.a.createElement("h3",null,T("Discussion"));case Vs.ManageChatAdministrators:return c.a.createElement("h3",null,T("ChannelAdministrators"));case Vs.ManageGroupRecentActions:return c.a.createElement("h3",null,T("Group.Info.AdminLog"));case Vs.ManageGroupAdminRights:return c.a.createElement("h3",null,T("EditAdminRights"));case Vs.ManageGroupPermissions:return c.a.createElement("h3",null,T("ChannelPermissions"));case Vs.ManageGroupRemovedUsers:return c.a.createElement("h3",null,T("ChannelBlockedUsers"));case Vs.ManageGroupUserPermissionsCreate:return c.a.createElement("h3",null,T("ChannelAddException"));case Vs.ManageGroupUserPermissions:return c.a.createElement("h3",null,T("UserRestrictions"));case Vs.StickerSearch:return c.a.createElement(ie.a,{value:j,placeholder:T("SearchStickersHint"),onChange:S});case Vs.GifSearch:return c.a.createElement(ie.a,{value:g,placeholder:T("SearchGifsTitle"),onChange:k});case Vs.SharedMedia:return c.a.createElement("h3",null,T("SharedMedia"));case Vs.ManageChannelSubscribers:return c.a.createElement("h3",null,T("ChannelSubscribers"));case Vs.MemberList:case Vs.ManageGroupMembers:return c.a.createElement("h3",null,T("GroupMembers"));default:return c.a.createElement(c.a.Fragment,null,c.a.createElement("h3",null,"Profile"),c.a.createElement("section",{className:"tools"},b&&c.a.createElement(oe.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:T("Edit"),onClick:y},c.a.createElement("i",{className:"icon-edit"}))))}}const F=h.g||A===Vs.SharedMedia||A===Vs.MemberList||s,D=Object(J.a)("animated-close-icon",N&&"no-transition");return Object(c.n)(()=>{w.current.classList.toggle("state-back",F)},[F]),c.a.createElement("div",{className:"RightHeader"},c.a.createElement(oe.a,{className:"close-button",round:!0,color:"translucent",size:"smaller",onClick:m,ariaLabel:T(F?"Common.Back":"Common.Close")},c.a.createElement("div",{ref:w,className:D})),c.a.createElement(ae.a,{name:N?"none":"slide-fade",activeKey:R},L))})),zs=a(127);function Ws(e,t,a,s,r,o,i,l,d,b,u){const h="members"!==s&&r?r:s,O=Object(c.p)(()=>{if(o&&i)return Object(m.Eb)(o.map(({userId:e})=>e),i)},[o,i]),[j,g,f]=function(e,t,a,s){const[c,r]=Object(zs.a)(a?t:void 0,s,void 0,n.R),o=!c||!s||c[0]===s[0];return[c,r,!o]}(0,t,u,O),[p,I,v]=Ks("media",h,a,u,l,d),[y,C,E]=Ks("documents",h,a,u,l,d),[w,M,S]=Ks("links",h,a,u,l,d),[k,N,P]=Ks("audio",h,a,u,l,d);let T,A,x=!1;switch(h){case"members":T=j,A=g,x=f;break;case"media":T=p,A=I,x=v;break;case"documents":T=y,A=C,x=E;break;case"links":T=w,A=M,x=S;break;case"audio":T=k,A=N,x=P}return[h,T,A,x]}function Ks(e,t,a,s,r,o){const i=Object(c.q)();Object(je.a)(()=>{t===e&&r&&o&&(i.current=Object(m.w)(r,o,e).reverse())},[r,o,t,e]);const[l,d]=Object(zs.a)(s?a:void 0,i.current,void 0,"media"===e?n.ob:n.X);return[l,d,!(!l||!i.current||l[0]===i.current[0])]}var Qs=a(58);const Ys=Object(g.g)(e=>e(),250,!1);let Xs=!1;var Js=a(113),Zs=a(106);var en=a(133),tn=a(191);a(244);var an=Object(c.h)(({chat:e,user:t,photo:a,isFirstPhoto:s,isSavedMessages:n,lastSyncTime:r,onClick:o})=>{const l=Object(ne.a)(),d=t&&Object(m.pb)(t);function b(s="big",c){if(a&&!c)return`photo${a.id}?size=c`;let r;return n||d||(t?r=Object(m.f)(t,s):e&&(r=Object(m.f)(e,s))),r}const u=b(),h=Object(at.a)(u,!1,i.ApiMediaFormat.BlobUrl,r),O=Object(at.a)(!h&&s?b("normal",!0):void 0,!1,i.ApiMediaFormat.BlobUrl,r),j=Object(tn.a)(!h&&a&&a.thumbnail&&a.thumbnail.dataUri),g=h||O||j,f=Object(na.a)(g);let p="";if(n)p=c.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(d)p=c.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(g)p=c.a.createElement("img",{src:g,className:"avatar-media",alt:"",decoding:"async"});else if(!g&&t){const e=Object(m.Z)(t);p=e?Object(Qe.c)(e,2):void 0}else if(!g&&e){const t=Object(m.l)(l,e);p=t&&Object(Qe.c)(t,Object(m.lb)(e.id)?2:1)}else p=c.a.createElement("div",{className:"spinner-wrapper"},c.a.createElement(me.a,{color:"white"}));const I=Object(J.a)("ProfilePhoto","color-bg-"+Object(m.X)(t||e),n&&"saved-messages",d&&"deleted-account",!n&&!g&&"no-photo");return c.a.createElement("div",{className:I,onClick:g?o:void 0},f&&g&&f!==g&&c.a.createElement("img",{src:f,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof p?Object(tt.a)(p,["hq_emoji"]):p)});a(245);var sn=Object(c.h)(Object(s.h)((e,{userId:t,forceShowSelf:a})=>{const{lastSyncTime:s}=e,n=Object(o.Gb)(e,t),c=Object(o.f)(e,t),r=!a&&n&&n.isSelf,{animationLevel:i}=e.settings.byKey;return{lastSyncTime:s,user:n,chat:c,isSavedMessages:r,animationLevel:i}},(e,t)=>Object(d.l)(t,["loadFullUser","openMediaViewer"]))(({user:e,chat:t,isSavedMessages:a,lastSyncTime:s,animationLevel:n,loadFullUser:r,openMediaViewer:o})=>{const{id:d}=e||{},{id:b}=t||{},u=e?Object(m.Z)(e):t?t.title:"",O=(e?e.photos:t?t.photos:void 0)||[],j=n>=1?"slide":"none",[g,f]=Object(c.r)(0),p=a||O.length<=1||0===g,I=a||O.length<=1||g===O.length-1;Object(c.n)(()=>{g>O.length&&f(Math.max(0,O.length-1))},[g,O.length]);const v=Object(ne.a)();Object(c.n)(()=>{s&&d&&r({userId:d})},[d,r,s]),function(e,t,a){Object(c.n)(()=>{t.slice(a,a+4).forEach(e=>{bt.c(`photo${e.id}?size=c`)||bt.b(`photo${e.id}?size=c`,i.ApiMediaFormat.BlobUrl)})},[a,t])}(0,O,g);const y=Object(c.m)(()=>{o({avatarOwnerId:d||b,profilePhotoIndex:g,origin:l.h.ProfileAvatar})},[o,d,b,g]),C=Object(c.m)(()=>{p||f(g-1)},[g,p]),E=Object(c.m)(()=>{I||f(g+1)},[g,I]);if(Object(c.n)(()=>{const e=document.querySelector(".profile-slide-container > .active, .profile-slide-container > .to");if(e)return Object(Oe.b)(e,{excludedClosestSelector:".navigation",onSwipe:h.l?(e,t)=>{t===Oe.a.Right?C():t===Oe.a.Left&&E()}:void 0})},[E,C]),!e&&!t)return;function w(){const s=!a&&O&&O.length>0?O[g]:void 0;return c.a.createElement(an,{key:g,user:e,chat:t,photo:s,isSavedMessages:a,isFirstPhoto:p,onClick:y})}const M=e&&e.isVerified||t&&t.isVerified;return c.a.createElement("div",{className:"ProfileInfo",dir:v.isRtl?"rtl":void 0},c.a.createElement("div",{className:"photo-wrapper"},function(){if(!(a||!O||O.length<=1))return c.a.createElement("div",{className:"photo-dashes"},O.map((e,t)=>c.a.createElement("span",{className:"photo-dash "+(t===g?"current":"")})))}(),c.a.createElement(ae.a,{activeKey:g,name:j,className:"profile-slide-container"},w),!p&&c.a.createElement("button",{type:"button",className:"navigation prev","aria-label":v("AccDescrPrevious"),onClick:C}),!I&&c.a.createElement("button",{type:"button",className:"navigation next","aria-label":v("Next"),onClick:E})),c.a.createElement("div",{className:"info",dir:v.isRtl?"rtl":"auto"},a?c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},v("SavedMessages"))):c.a.createElement("div",{className:"title"},c.a.createElement("h3",{dir:"auto"},u&&Object(tt.a)(u)),M&&c.a.createElement(en.a,null)),!a&&(e?c.a.createElement("div",{className:"status "+(Object(m.xb)(e)?"online":"")},c.a.createElement("span",{className:"user-status",dir:"auto"},Object(m.ab)(v,e))):c.a.createElement("span",{className:"status",dir:"auto"},Object(m.jb)(t)?v("Subscribers",t.membersCount,"i"):v("Members",t.membersCount,"i")))))}));var nn=Object(c.h)(Object(s.h)((e,{chatOrUserId:t})=>{const{lastSyncTime:a}=e,s=t?Object(o.f)(e,t):void 0;return{lastSyncTime:a,chat:s,user:Object(m.lb)(t)?Object(o.Gb)(e,t):void 0,canInviteUsers:s&&(!Object(m.jb)(s)&&!Object(m.yb)(s,"inviteUsers")||Object(m.q)(s,"inviteUsers"))}},(e,t)=>Object(d.l)(t,["loadFullUser","updateChatMutedState","showNotification"]))(({lastSyncTime:e,user:t,chat:a,forceShowSelf:s,canInviteUsers:n,loadFullUser:r,showNotification:o,updateChatMutedState:i})=>{const{id:l,fullInfo:d,username:b,phoneNumber:u,isSelf:h}=t||{},{id:O,isMuted:j,username:g}=a||{},f=Object(ne.a)();Object(c.n)(()=>{e&&l&&r({userId:l})},[r,l,e]);const p=Object(c.m)(()=>{i({chatId:O,isMuted:!j})},[O,j,i]);if(!a||a.isRestricted||h&&!s)return;function I(e,t){Object(E.c)(e),o({message:t+" was copied"})}const v=u&&Object(Oa.c)(u),y=Object(m.h)(a),C=0===y.indexOf("http")?y:"http://"+y,w=b||g,M=d&&d.bio||Object(m.g)(a);return c.a.createElement("div",{className:"ChatExtra"},v&&!!v.length&&c.a.createElement(Zs.a,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(v,f("Phone"))},c.a.createElement("span",{className:"title",dir:"auto"},v),c.a.createElement("span",{className:"subtitle"},f("Phone"))),w&&c.a.createElement(Zs.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I("@"+w,f("Username"))},c.a.createElement("span",{className:"title",dir:"auto"},Object(tt.a)(w)),c.a.createElement("span",{className:"subtitle"},f("Username"))),M&&!!M.length&&c.a.createElement(Zs.a,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},c.a.createElement("span",{className:"title",dir:"auto"},Object(tt.a)(M,["br","links","emoji"])),c.a.createElement("span",{className:"subtitle"},f(l?"UserBio":"Info"))),n&&!w&&!!y.length&&c.a.createElement(Zs.a,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(y,f("SetUrlPlaceholder"))},c.a.createElement("div",{className:"title"},c.a.createElement(wa.a,{url:C,className:"title",text:y})),c.a.createElement("span",{className:"subtitle"},f("SetUrlPlaceholder"))),c.a.createElement(Zs.a,{icon:"unmute",ripple:!0,onClick:p},c.a.createElement("span",null,f("Notifications")),c.a.createElement(de,{id:"group-notifications",label:l?"Toggle User Notifications":"Toggle Chat Notifications",checked:!j,inactive:!0})))})),cn=a(165),rn=a(185),on=a(118);a(249);const ln=[{type:"media",title:"SharedMediaTab2"},{type:"documents",title:"SharedFilesTab2"},{type:"links",title:"SharedLinksTab2"},{type:"audio",title:"SharedMusicTab2"}];function dn(e){return[`.shared-media-transition > div:only-child > .${e}-list > .scroll-item`,`.shared-media-transition > div.active > .${e}-list > .scroll-item`].join(", ")}var bn=Object(c.h)(Object(s.h)((e,{chatId:t,userId:a})=>{const s=Object(o.f)(e,t),n=Object(o.m)(e,a||t),{currentType:c,resultsByType:r}=Object(o.v)(e)||{},{foundIds:i}=r&&c&&r[c]||{},{byId:l}=e.users,d=s&&Object(m.kb)(s),b=s&&Object(m.jb)(s),u=d||b&&Object(m.gb)(s),h=s&&s.fullInfo&&s.fullInfo.members,O=u&&s&&s.fullInfo&&!s.fullInfo.canViewMembers;let j;return a?j=a:Object(m.lb)(t)&&(j=t),{isChannel:b,resolvedUserId:j,chatMessages:n,foundIds:i,mediaSearchType:c,hasMembersTab:u,areMembersHidden:O,...u&&h&&{members:h,usersById:l},isRightColumnShown:Object(o.W)(e),isRestricted:s&&s.isRestricted,lastSyncTime:e.lastSyncTime}},(e,t)=>Object(d.l)(t,["setLocalMediaSearchType","loadMoreMembers","searchMediaMessagesLocal","openMediaViewer","openAudioPlayer","openUserInfo","focusMessage","loadProfilePhotos"]))(({chatId:e,profileState:t,onProfileStateChange:a,isChannel:s,resolvedUserId:r,chatMessages:o,foundIds:d,mediaSearchType:b,hasMembersTab:u,areMembersHidden:m,members:O,usersById:j,isRightColumnShown:g,isRestricted:f,lastSyncTime:p,setLocalMediaSearchType:I,loadMoreMembers:v,searchMediaMessagesLocal:y,openMediaViewer:C,openAudioPlayer:E,openUserInfo:w,focusMessage:M,loadProfilePhotos:S})=>{const k=Object(c.q)(null),N=Object(c.q)(null),P=Object(ne.a)(),[T,A]=Object(c.r)(0),x=Object(c.p)(()=>[...u?[{type:"members",title:s?"ChannelSubscribers":"GroupMembers"}]:[],...ln],[u,s]),R=x[T].type,[L,F,D,B]=Ws(0,v,y,R,b,O,j,o,d,0,p),U=x.findIndex(({type:e})=>e===L),{handleScroll:H}=function(e,t,a,s){Object(Qs.a)(([a])=>{if(a&&a!==t){const a=e.current,n=a.querySelector(".TabList");a.scrollTop<n.offsetTop&&(s("members"===t?l.k.MemberList:l.k.SharedMedia),Xs=!0,Object(vt.a)(a,n,"start",void 0,void 0,void 0,300),setTimeout(()=>{Xs=!1},350))}},[t,s]),Object(Qs.a)(([t])=>{if(a!==l.k.Profile||a===t)return;const n=e.current;if(!n)return;const c=n.querySelector(".TabList");!c||c.offsetTop>n.scrollTop||(Xs=!0,Object(vt.a)(n,n.firstElementChild,"start",void 0,2*n.offsetHeight),setTimeout(()=>{Xs=!1},350),s(a))},[a]);const n=Object(c.m)(()=>{const a=e.current;if(!a)return;const n=a.querySelector(".TabList");if(!n)return;let c=l.k.Profile;a.scrollTop>=n.offsetTop&&(c="members"===t?l.k.MemberList:l.k.SharedMedia),s(c)},[e,s,t]);return Object(c.n)(()=>{Xs||n()},[n,t]),{handleScroll:Object(c.m)(()=>{Xs||Ys(n)},[n])}}(k,R,t,a),{applyTransitionFix:G,releaseTransitionFix:q}=function(e,t=".Transition.shared-media-transition"){return Object(c.n)(()=>{function a(){const a=e.current,s=a.querySelector(t),n=a.querySelector(".TabList");s&&n&&(s.style.minHeight=a.offsetHeight-n.offsetHeight+"px")}return a(),window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[e,t]),{applyTransitionFix:Object(c.m)(()=>{const t=e.current;if("hidden"!==t.style.overflowY){const e=t.offsetWidth-t.clientWidth;t.style.overflowY="hidden",t.style.marginRight=e+"px"}},[e]),releaseTransitionFix:Object(c.m)(()=>{const t=e.current;t.style.overflowY="scroll",t.style.marginRight="0"},[e])}}(k),[_,V]=(()=>{const[e,t]=Object(c.r)(!1);return[e,Object(c.m)(()=>{t(e=>!e)},[])]})(),$=Object(c.m)(()=>{q(),V()},[q,V]);Object(c.n)(()=>{I({mediaType:R})},[I,R]);const z=r||e;Object(c.n)(()=>{p&&S({profileId:z})},[S,z,p]);const W=Object(c.m)(e=>{C({chatId:z,threadId:i.MAIN_THREAD_ID,messageId:e,origin:l.h.SharedMedia})},[z,C]),K=Object(c.m)(e=>{E({chatId:z,messageId:e})},[z,E]),Q=Object(c.m)(e=>{w({id:e})},[w]),Y=Object(c.m)(e=>{M({chatId:z,messageId:e})},[z,M]);let X;Object(c.n)(()=>{if(N.current&&h.l)return Object(Oe.b)(N.current,{onSwipe:(e,t)=>{t===Oe.a.Left?A(Math.min(T+1,x.length-1)):t===Oe.a.Right&&A(Math.max(0,T-1))}})},[T,x.length]);const J="members"===L||!u&&"media"===L;J?X=g?0:1e3:F||(X=n.pb);const Z=Object(Es.a)([e,L],X);function ee(){if(!F||!Z||!o){const e=J&&F&&!Z;return c.a.createElement("div",{className:"content empty-list"},!e&&c.a.createElement(me.a,null))}if(!F.length){let e;switch(L){case"members":e=m?"You have no access to group members list.":"No members found";break;case"documents":e=P("lng_media_file_empty_search");break;case"links":e=P("lng_media_link_empty_search");break;case"audio":e=P("lng_media_song_empty_search");break;default:e=P("SharedMedia.EmptyTitle")}return c.a.createElement("div",{className:"content empty-list"},c.a.createElement(on.a,{text:e}))}return c.a.createElement("div",{className:`content ${L}-list`,dir:P.isRtl&&"media"===L?"rtl":void 0,teactFastList:!0},"media"===L?F.map(e=>o[e]&&c.a.createElement(cn.a,{key:e,message:o[e],onClick:W})):"documents"===L?F.map(e=>o[e]&&c.a.createElement(zt.a,{key:e,message:o[e],withDate:!0,smaller:!0,className:"scroll-item",onDateClick:Y})):"links"===L?F.map(e=>o[e]&&c.a.createElement(rn.a,{key:e,message:o[e],onMessageClick:Y})):"audio"===L?F.map(e=>o[e]&&c.a.createElement(Wt.a,{key:e,renderingFor:"sharedMedia",message:o[e],date:o[e].date,lastSyncTime:p,className:"scroll-item",onPlay:K,onDateClick:Y})):"members"===L?F.map((e,t)=>c.a.createElement(Zs.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>Q(e)},c.a.createElement(Ye.a,{userId:e,forceShowSelf:!0}))):void 0)}return c.a.createElement(Js.a,{ref:k,className:"Profile custom-scroll",itemSelector:dn(L),items:Z?F:void 0,cacheBuster:_,sensitiveArea:n.fb,preloadBackwards:Z?"members"===L?n.R:n.ob:0,noScrollRestoreOnTop:!0,noFastList:!0,onLoadMore:D,onScroll:H},!B&&function(e,t){return c.a.createElement("div",{className:"profile-info"},c.a.createElement(sn,{userId:t||e,forceShowSelf:t!==e}),c.a.createElement(nn,{chatOrUserId:t||e,forceShowSelf:t!==e}))}(e,r),!f&&c.a.createElement("div",{className:"shared-media"},c.a.createElement(ae.a,{ref:N,name:P.isRtl?"slide-reversed":"slide",activeKey:U,renderCount:x.length,shouldRestoreHeight:!0,className:"shared-media-transition",onStart:G,onStop:$},ee),c.a.createElement(pe.a,{big:!0,activeTab:T,tabs:x,onSwitchTab:A})))}));var un=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"RightSearch");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});var mn=Object(c.h)(e=>{const t=Object(Ce.a)(ye.a.Extra,"Management");return t?c.a.createElement(t,e):c.a.createElement(Ee.a,null)});var hn=Object(c.h)(()=>{const e=Object(Ce.a)(ye.a.Extra,"StickerSearch");return e?c.a.createElement(e,null):c.a.createElement(Ee.a,null)});var On=Object(c.h)(()=>{const e=Object(Ce.a)(ye.a.Extra,"GifSearch");return e?c.a.createElement(e,null):c.a.createElement(Ee.a,null)});var jn=Object(c.h)(()=>{const e=Object(Ce.a)(ye.a.Extra,"PollResults");return e?c.a.createElement(e,null):c.a.createElement(Ee.a,null)});a(250);const gn=Object.keys(l.l).length/2,fn=Object.keys(l.g).length/2;function pn(){const e=document.querySelector(".RightHeader .SearchInput input");e&&e.blur()}var In=Object(c.h)(Object(s.h)(e=>{const{chatId:t,threadId:a}=Object(o.y)(e)||{},s=Object(o.d)(e);return{contentKey:Object(o.nb)(e),chatId:t,threadId:a,currentProfileUserId:e.users.selectedId,isChatSelected:Boolean(t&&s)}},(e,t)=>Object(d.l)(t,["openUserInfo","toggleChatInfo","toggleManagement","closeLocalTextSearch","setStickerSearchQuery","setGifSearchQuery","closePollResults"]))(({contentKey:e,chatId:t,threadId:a,currentProfileUserId:s,isChatSelected:r,toggleChatInfo:o,toggleManagement:i,openUserInfo:d,closeLocalTextSearch:b,setStickerSearchQuery:u,setGifSearchQuery:m,closePollResults:h})=>{var O;const{width:j}=_e(),[g,f]=Object(c.r)(l.k.Profile),[p,I]=Object(c.r)(l.g.Initial),[v,y]=Object(c.r)(),[C,E]=Object(c.r)(),w=g!==l.k.Profile,M=void 0!==e,S=e===l.l.ChatInfo||e===l.l.UserInfo,k=e===l.l.Search,N=e===l.l.Management,P=e===l.l.StickerSearch,T=e===l.l.GifSearch,A=e===l.l.PollResults,x=j<=n.ab,[R,L]=Object(c.r)(!M),F=null!==(O=Object(Ke.a)(e,!0,!r))&&void 0!==O?O:-1,D=Object(c.m)(()=>{switch(e){case l.l.ChatInfo:if(w){f(l.k.Profile);break}o();break;case l.l.UserInfo:if(w){f(l.k.Profile);break}d({id:void 0});break;case l.l.Management:switch(p){case l.g.Initial:i();break;case l.g.ChatPrivacyType:case l.g.Discussion:case l.g.GroupPermissions:case l.g.GroupType:case l.g.ChatAdministrators:case l.g.ChannelSubscribers:case l.g.GroupMembers:I(l.g.Initial);break;case l.g.GroupUserPermissionsCreate:case l.g.GroupRemovedUsers:case l.g.GroupUserPermissions:I(l.g.GroupPermissions),y(void 0),E(void 0);break;case l.g.ChatAdminRights:case l.g.GroupRecentActions:I(l.g.ChatAdministrators)}break;case l.l.Search:pn(),b();break;case l.l.StickerSearch:case l.l.GifSearch:pn(),u({query:void 0}),m({query:void 0});break;case l.l.PollResults:h()}},[e,w,o,d,h,p,i,b,u,m]),B=Object(c.m)((e,t)=>{y(e),E(t)},[]);function U(){if(-1!==F)switch(F){case l.l.ChatInfo:case l.l.UserInfo:return c.a.createElement(bn,{key:s||t,chatId:t,userId:s,profileState:g,onProfileStateChange:f});case l.l.Search:return c.a.createElement(un,{chatId:t,threadId:a});case l.l.Management:return c.a.createElement(mn,{chatId:t,currentScreen:p,isPromotedByCurrentUser:C,selectedChatMemberId:v,onScreenSelect:I,onChatMemberSelect:B});case l.l.StickerSearch:return c.a.createElement(hn,null);case l.l.GifSearch:return c.a.createElement(On,null);case l.l.PollResults:return c.a.createElement(jn,null)}}return Object(c.n)(()=>M?Object(te.a)(D):void 0,[M,D]),Object(c.n)(()=>{setTimeout(()=>{L(!M)},300)},[M]),Object(c.n)(()=>{M&&x&&D()},[x]),Object(Ot.a)(([a,s])=>{(a===l.l.ChatInfo&&e===l.l.UserInfo||a===l.l.UserInfo&&e===l.l.ChatInfo||s!==t)&&(f(l.k.Profile),I(l.g.Initial))},[e,t]),c.a.createElement("div",{id:"RightColumn-wrapper",className:r?void 0:"is-hidden"},x&&c.a.createElement("div",{className:"overlay-backdrop",onClick:D}),c.a.createElement("div",{id:"RightColumn"},c.a.createElement($s,{chatId:t,isColumnOpen:M,isProfile:S,isSearch:k,isManagement:N,isStickerSearch:P,isGifSearch:T,isPollResults:A,profileState:g,managementScreen:p,onClose:D}),c.a.createElement(ae.a,{name:R?"none":"zoom-fade",renderCount:gn+fn,activeKey:N?gn+p:F},U)))}));var vn=Object(c.h)(({isOpen:e})=>{const t=Object(Ce.a)(ye.a.Extra,"MediaViewer",!e);return t?c.a.createElement(t,null):void 0});var yn=Object(c.h)(({isOpen:e})=>{const t=Object(Ce.a)(ye.a.Extra,"Notifications",!e);return t?c.a.createElement(t,null):void 0});var Cn=Object(c.h)(({isOpen:e})=>{const t=Object(Ce.a)(ye.a.Extra,"Errors",!e);return t?c.a.createElement(t,null):void 0});var En=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"ForwardPicker",!t);return a?c.a.createElement(a,e):void 0});var wn=Object(c.h)(e=>{const{url:t}=e,a=Object(Ce.a)(ye.a.Extra,"SafeLinkModal",!t);return a?c.a.createElement(a,e):void 0});var Mn=Object(c.h)(e=>{const{isOpen:t}=e,a=Object(Ce.a)(ye.a.Extra,"HistoryCalendar",!t);return a?c.a.createElement(a,e):void 0});a(251);let Sn,kn,Nn=!1;function Pn(e){document.querySelectorAll('link[rel="icon"]').forEach(t=>{e?t.href.includes("favicon-unread")||(t.href=t.href.replace("favicon","favicon-unread")):t.href=t.href.replace("favicon-unread","favicon")})}var Tn=Object(c.h)(Object(s.h)(e=>{const{chatId:t,messageId:a}=e.audioPlayer,s=t&&a?Object(o.k)(e,t,a):void 0;return{animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime,isLeftColumnShown:e.isLeftColumnShown,isRightColumnShown:Object(o.W)(e),isMediaViewerOpen:Object(o.T)(e),isForwardModalOpen:Object(o.R)(e),hasNotifications:Boolean(e.notifications.length),hasErrors:Boolean(e.errors.length),audioMessage:s,safeLinkModalUrl:e.safeLinkModalUrl,isHistoryCalendarOpen:Boolean(e.historyCalendarSelectedAt)}},(e,t)=>Object(d.l)(t,["loadAnimatedEmojis"]))(({lastSyncTime:e,isLeftColumnShown:t,isRightColumnShown:a,isMediaViewerOpen:r,isForwardModalOpen:i,animationLevel:l,hasNotifications:d,hasErrors:b,audioMessage:u,safeLinkModalUrl:m,isHistoryCalendarOpen:h,loadAnimatedEmojis:O})=>{n.p&&!Nn&&(Nn=!0,console.log(">>> RENDER MAIN")),Object(c.n)(()=>{e&&O()},[e,O]);const{transitionClassNames:j}=Object(Z.a)(!t,void 0,!0),{transitionClassNames:g}=Object(Z.a)(a,void 0,!0),f=Object(J.a)(j.replace(/([\w-]+)/g,"middle-column-$1"),g.replace(/([\w-]+)/g,"right-column-$1"));function p(e){e.preventDefault(),e.stopPropagation()}return Object(c.n)(()=>{document.body.classList.toggle("is-middle-column-open",f.includes("middle-column-open")),document.body.classList.toggle("is-right-column-shown",f.includes("right-column-open"))},[f]),Object(c.n)(()=>{l>0&&(document.body.classList.add("animating-right-column"),Object(X.b)(350+n.c),Sn&&(clearTimeout(Sn),Sn=void 0),Sn=window.setTimeout(()=>{document.body.classList.remove("animating-right-column"),Sn=void 0},350+n.c))},[l,a]),Object(ee.a)(()=>{const e=Object(o.q)(Object(s.e)());let t=0;clearInterval(kn),kn=window.setInterval(()=>{if(document.title.includes(n.D))Pn(!1);else{if(t%2==0){const t=Object(o.q)(Object(s.e)())-e;t>0&&(document.title=`${t} notification${t>1?"s":""}`,Pn(!0))}else document.title=n.eb,Pn(!1);t++}},1e3)},()=>{clearInterval(kn),kn=void 0,document.title.includes(n.D)||(document.title=n.eb),Pn(!1)}),c.a.createElement("div",{id:"Main",className:f,onDrop:p,onDragOver:p},c.a.createElement(Be,null),c.a.createElement(qs,null),c.a.createElement(In,null),c.a.createElement(vn,{isOpen:r}),c.a.createElement(En,{isOpen:i}),c.a.createElement(yn,{isOpen:d}),c.a.createElement(Cn,{isOpen:b}),u&&c.a.createElement(mt,{key:u.id,message:u,noUi:!0}),c.a.createElement(wn,{url:m}),c.a.createElement(Mn,{isOpen:h}))}));n.p&&console.log(">>> FINISH LOAD MAIN BUNDLE"),Object(s.e)().connectionState||Object(s.d)().initApi()},197:function(e,t,a){},198:function(e,t,a){},199:function(e,t,a){},210:function(e,t,a){},211:function(e,t,a){},212:function(e,t,a){},215:function(e,t,a){},216:function(e,t,a){},217:function(e,t,a){},221:function(e,t,a){},222:function(e,t,a){},224:function(e,t,a){},227:function(e,t,a){},228:function(e,t,a){},229:function(e,t,a){},230:function(e,t,a){},231:function(e,t,a){},232:function(e,t,a){},233:function(e,t,a){},234:function(e,t,a){},235:function(e,t,a){},236:function(e,t,a){},237:function(e,t,a){},239:function(e,t,a){},240:function(e,t,a){},241:function(e,t,a){},242:function(e,t,a){},243:function(e,t,a){},244:function(e,t,a){},245:function(e,t,a){},249:function(e,t,a){},250:function(e,t,a){},251:function(e,t,a){}}]);
|
||
//# sourceMappingURL=4.b8e75792006db4edf3f2.js.map
|