mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 18:57:12 +01:00
1 line
92 KiB
JavaScript
1 line
92 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],Array(93).concat([function(e,t,n){"use strict";var a=n(0),r=n(10),c=n(29);t.a=()=>{const e=Object(c.a)();return Object(a.n)(()=>r.a(e),[e]),r.b}},function(e,t,n){"use strict";var a=n(0),r=n(7),c=n(8),s=n(131),i=n(162),o=n(33),l=n(47),u=n(32);n(194);t.a=e=>{const{ref:t,icon:n,className:d,style:m,children:h,disabled:b,ripple:f,narrow:p,inactive:g,contextActions:O,focus:v,destructive:j,onClick:E}=e;let y=Object(a.q)(null);t&&(y=t);const{isContextMenuOpen:N,contextMenuPosition:C,handleBeforeContextMenu:T,handleContextMenu:M,handleContextMenuClose:w,handleContextMenuHide:L}=Object(s.a)(y,!O),S=Object(a.m)(()=>y.current,[]),I=Object(a.m)(()=>y.current.closest(".custom-scroll"),[]),k=Object(a.m)(()=>y.current.querySelector(".ListItem-context-menu .bubble"),[]),{positionX:A,positionY:x,style:D}=Object(i.a)(C,S,I,k),_=Object(a.m)(e=>{!b&&E&&E(e)},[b,E]),R=Object(a.m)(e=>{g||r.k||(!O||2!==e.button&&E||T(e),0===e.button&&(E?_(e):M(e)))},[g,O,E,T,M,_]),P=Object(c.a)("ListItem no-selection",d,f&&"has-ripple",p&&"narrow",b&&"disabled",g&&"inactive",C&&"has-menu-open",v&&"focus",j&&"destructive");return a.a.createElement("div",{ref:y,className:P,style:m},a.a.createElement("div",{className:"ListItem-button",role:"button",tabIndex:0,onClick:!g&&r.k?_:void 0,onMouseDown:R,onContextMenu:!g&&O?M:void 0},n&&a.a.createElement("i",{className:"icon-"+n}),h,!b&&!g&&f&&a.a.createElement(o.a,null)),O&&void 0!==C&&a.a.createElement(l.a,{isOpen:N,positionX:A,positionY:x,style:D,className:"ListItem-context-menu",autoClose:!0,onClose:w,onCloseAnimationEnd:L},O.map(e=>a.a.createElement(u.a,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return o}));var a=n(0),r=n(9),c=n(43);function s({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:s,margin:i,threshold:o,isDisabled:l},u){const d=Object(a.q)(),m=Object(a.q)(),h=Object(a.q)(),b=Object(a.q)();m.current=u;const f=Object(a.m)(()=>{h.current=!0},[]),p=Object(a.m)(()=>{h.current=!1,b.current&&(b.current(),b.current=void 0)},[]);Object(c.a)(f,p),Object(a.n)(()=>{if(!l)return()=>{d.current&&(d.current.observer.disconnect(),d.current.callbacks.clear(),d.current=void 0)}},[l]);return{observe:Object(a.m)((a,c)=>{d.current||function(){const a=new Map,c=new Map,l=()=>{const e=Array.from(c.values());e.forEach(t=>{const n=a.get(t.target);n&&n(t,e)}),m.current&&m.current(e),c.clear()},u=t?r.g:n?r.a:void 0,f=u?u(l,t||n,!s):l,p=new IntersectionObserver(e=>{e.forEach(e=>{c.set(e.target,e)}),h.current?b.current=()=>{f()}:f()},{root:e.current,rootMargin:i?i+"px":void 0,threshold:o});d.current={observer:p,callbacks:a}}();const l=d.current;return l.observer.observe(a),c&&l.callbacks.set(a,c),()=>{c&&l.callbacks.delete(a),l.observer.unobserve(a)}},[l]),freeze:f,unfreeze:p}}function i(e,t,n){Object(a.n)(()=>t?t(e.current,n):void 0,[])}function o(e,t,n){const[r,c]=Object(a.r)(!t);return i(e,t,e=>{c(e.isIntersecting),n&&n(e)}),r}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(18),s=n(6),i=n(4),o=n(35),l=n(3),u=n(93),d=n(99),m=n(130),h=n(146);t.a=Object(a.h)(Object(r.h)((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a}=e,r=Object(s.Bb)(e,t);return{lastSyncTime:a,user:r,isSavedMessages:!n&&r&&r.isSelf,areMessagesLoaded:Boolean(Object(s.m)(e,t))}},(e,t)=>Object(l.l)(t,["loadFullUser","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withHandle:s,withFullInfo:l,withUpdatingStatus:b,noStatusOrTyping:f,user:p,isSavedMessages:g,areMessagesLoaded:O,lastSyncTime:v,loadFullUser:j,openMediaViewer:E})=>{const{id:y}=p||{},N=Object(i.Z)(p);Object(a.n)(()=>{l&&v&&y&&j({userId:y})},[y,j,v,l]);const C=Object(a.m)((e,n)=>{p&&n&&(e.stopPropagation(),E({avatarOwnerId:p.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[p,t,E]),T=Object(u.a)();if(p)return a.a.createElement("div",{className:"ChatInfo"},a.a.createElement(d.a,{key:p.id,size:t,user:p,isSavedMessages:g,onClick:r?C:void 0}),a.a.createElement("div",{className:"info"},g?a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,T("SavedMessages"))):a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,N&&Object(o.a)(N)),p&&p.isVerified&&a.a.createElement(m.a,null)),!g&&!f&&(n?a.a.createElement("span",{className:"status"},n):b&&!O?a.a.createElement("span",{className:"status"},T("Updating")):p?e?a.a.createElement(h.a,{typingStatus:e}):a.a.createElement("div",{className:"status "+(Object(i.xb)(p)?"online":"")},s&&p.username&&a.a.createElement("span",{className:"handle"},p.username),a.a.createElement("span",{className:"user-status"},Object(i.ab)(p,T))):void 0)))}))},function(e,t,n){"use strict";var a=n(0),r=n(5),c=n(48),s=n(29);t.a=(e,t=!1,n=r.ApiMediaFormat.BlobUrl,i,o)=>{const l=e?c.c(e):void 0,u=Object(s.a)();return Object(a.n)(()=>{if(!t&&e&&!l){const t=Date.now();c.b(e,n).then(()=>{const e=Date.now()-t;!o||e>=o?u():setTimeout(u,o-e)})}},[t,e,l,n,i,u,o]),l}},function(e,t,n){"use strict";var a=n(0),r=n(50);var c=n(8),s=n(43),i=n(27),o=n(52),l=n(93),u=n(31),d=n(114);n(139);t.a=e=>{const{title:t,className:n,isOpen:m,header:h,hasCloseButton:b,noBackdrop:f,children:p,onClose:g,onCloseAnimationEnd:O,onEnter:v}=e,{shouldRender:j,transitionClassNames:E}=Object(i.a)(m,O),y=Object(a.q)(null);Object(a.n)(()=>m?Object(r.a)({onEsc:g,onEnter:v}):void 0,[m,g,v]),Object(a.n)(()=>m&&y.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const a=n.findIndex(e=>e.isSameNode(document.activeElement));let r=0;a>=0&&(r=t.shiftKey?a>0?a-1:n.length-1:a<n.length-1?a+1:0),n[r].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(y.current):void 0,[m]),Object(o.a)(([e])=>(document.body.classList.toggle("has-open-dialog",m),(m||!m&&void 0!==e)&&Object(s.b)(200),()=>{document.body.classList.remove("has-open-dialog")}),[m]);const N=Object(l.a)();if(!j)return;const C=Object(c.a)("Modal",n,E,f&&"transparent-backdrop");return a.a.createElement(d.a,null,a.a.createElement("div",{ref:y,className:C,tabIndex:-1,role:"dialog"},a.a.createElement("div",{className:"modal-container"},a.a.createElement("div",{className:"modal-backdrop",onClick:g}),a.a.createElement("div",{className:"modal-dialog"},h||(t?a.a.createElement("div",{className:"modal-header"},b&&a.a.createElement(u.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:N("Close"),onClick:g},a.a.createElement("i",{className:"icon-close"})),a.a.createElement("div",{className:"modal-title"},t)):void 0),a.a.createElement("div",{className:"modal-content custom-scroll"},p)))))}},function(e,t,n){"use strict";var a=n(0),r=n(5),c=n(1),s=n(4),i=n(45),o=n(8),l=n(35),u=n(97),d=n(102),m=n(93);n(181);t.a=Object(a.h)(({className:e,size:t="large",chat:n,user:h,text:b,withOnlineStatus:f,isSavedMessages:p,lastSyncTime:g,onClick:O})=>{const v=h&&Object(s.pb)(h);let j;p||v||(h?j=Object(s.f)(h):n&&(j=Object(s.f)(n)));const E=Object(u.a)(j,!1,r.ApiMediaFormat.DataUri,g),{shouldRenderFullMedia:y,transitionClassNames:N}=Object(d.a)(E,"slow");Object(m.a)();let C="";if(p)C=a.a.createElement("i",{className:"icon-avatar-saved-messages"});else if(v)C=a.a.createElement("i",{className:"icon-avatar-deleted-account"});else if(y)C=a.a.createElement("img",{src:E,className:N+" avatar-media",alt:"",decoding:"async"});else if(h){const e=Object(s.Z)(h);C=e?Object(i.c)(e,2):void 0}else if(n){const e=Object(s.l)(n);C=e&&Object(i.c)(e,Object(s.lb)(n.id)?2:1)}else b&&(C=Object(i.c)(b,2));const T=!p&&h&&Object(s.xb)(h),M=Object(o.a)("Avatar size-"+t,e,"color-bg-"+Object(s.X)(h||n),p&&"saved-messages",v&&"deleted-account",f&&T&&"online",O&&"interactive",!p&&!y&&"no-photo"),w=Object(a.m)(e=>{O&&O(e,p||y)},[O,p,y]),L=(h||n)&&(h||n).id;return a.a.createElement("div",{className:M,onClick:w,"data-test-sender-id":c.x?L:void 0},"string"==typeof C?Object(l.a)(C,["jumbo"===t?"hq_emoji":"emoji"]):C)})},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(1),s=n(7),i=n(29),o=n(38),l=n(8),u=n(43);n(179);const d={slide:450,"mv-slide":400,"slide-fade":400,"zoom-fade":150,"scroll-slide":500,fade:150,"slide-layers":s.f?450:300,"push-slide":300,reveal:350},m=Symbol("CLEANED_UP");t.a=Object(r.h)(e=>{const{animationLevel:t}=e.settings.byKey;return{animationLevel:t}})(({ref:e,activeKey:t,name:n,direction:r="auto",renderCount:s,shouldRestoreHeight:h,shouldCleanup:b,id:f,className:p,onStart:g,onStop:O,children:v,animationLevel:j})=>{let E=Object(a.q)(null);e&&(E=e);const y=Object(a.q)({}),N=Object(o.a)(t),C=Object(a.q)(),T=Object(i.a)(),M=void 0!==N&&t!==N;!s&&M&&(y.current={[N]:y.current[N]}),y.current[t]=v,Object(a.o)(()=>{function e(){b&&(y.current={[N]:m},T())}const a=E.current,i=a.children;if(1===i.length&&!M)return void i[0].classList.add("active");const o=Array.from(a.childNodes);if(!M||!o.length)return;C.current&&(clearTimeout(C.current),C.current=void 0);const l=-1===r||"auto"===r&&N>t||"inverse"===r&&N<t;a.classList.remove("animating"),a.classList.toggle("backwards",l);const f=Object.keys(y.current).map(Number),p=s?N:f.indexOf(N),v=s?t:f.indexOf(t);if("none"===n||0===j)return o.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===v))}),void e();if(o.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("active"),e.classList.toggle("from",t===p),e.classList.toggle("through",t>p&&t<v||t<p&&t>v),e.classList.toggle("to",t===v))}),"scroll-slide"===n){const e=a.offsetWidth;a.scrollBy({left:v>p?e:-e,behavior:"smooth"})}j>0&&Object(u.b)(d[n]+c.c),requestAnimationFrame(()=>{a.classList.add("animating"),C.current=window.setTimeout(()=>{requestAnimationFrame(()=>{if(a.classList.remove("animating","backwards"),o.forEach((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle("active",t===v))}),"scroll-slide"===n&&(a.scrollLeft=t*a.offsetWidth),h){const e=a.querySelector(".active");e&&(e.style.height="auto",a.style.height=e.clientHeight+"px")}e(),O&&O()})},d[n]+c.c),g&&g()})},[t,N,M,r,n,g,O,s,h,b,j,T]),Object(a.o)(()=>{if(h){const e=E.current,t=e.querySelector(".active")||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=t.clientHeight+"px")}},[h,v]);const w=y.current,L=Object.keys(s?new Array(s).fill(void 0):w).map(Number).map(e=>{const n=w[e];return"function"==typeof n?a.a.createElement("div",{key:e},n(e===t,e===N)):void 0}),S=Object(l.a)("Transition",p,0===j&&"scroll-slide"===n?"slide":n);return a.a.createElement("div",{ref:E,id:f,className:S},L)})},function(e,t,n){"use strict";var a=n(18),r=n(0),c=n(9),s=n(144);t.a=({ref:e,className:t,onLoadMore:n,onScroll:i,items:o,itemSelector:l=".ListItem",preloadBackwards:u=20,sensitiveArea:d=800,isDisabled:m=!1,noFastList:h,cacheBuster:b,children:f})=>{let p=Object(r.q)(null);e&&(p=e);const g=Object(r.q)({}),[O,v]=Object(r.p)(()=>n?[Object(c.a)(()=>n({direction:a.e.Backwards}),1e3,!0,!1),Object(c.a)(()=>n({direction:a.e.Forwards}),1e3,!0,!1)]:[],[n,o]);Object(r.n)(()=>{if(O)if(!o||o.length<u)O();else{const{scrollHeight:e,clientHeight:t}=p.current;t&&e<=t&&O()}},[o,O,u]),Object(r.o)(()=>{const e=p.current,t=g.current;if(t.listItemElements=e.querySelectorAll(l),m)return;let n;if(t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:a}=e;n=a+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&e.offsetParent&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}Object(s.a)(e,n),t.isScrollTopJustUpdated=!0},[m,l,o,b]);const j=Object(r.m)(e=>{if(v&&O){const{listItemElements:e,isScrollTopJustUpdated:t,currentAnchor:n,currentAnchorTop:a}=g.current;if(t)return void(g.current.isScrollTopJustUpdated=!1);const r=e.length,c=p.current,{scrollTop:i,scrollHeight:o,offsetHeight:l}=c,u=i<=(r?e[0].offsetTop:0)+d,m=(r?e[r-1].offsetTop+e[r-1].offsetHeight:o)-(i+l)<=d;let h=!1;if(u){const t=e[0];if(t){const e=t.getBoundingClientRect().top,r=n&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r>a&&(g.current.currentAnchor=t,g.current.currentAnchorTop=e,h=!0,Object(s.a)(c),v())}}if(m){const t=e[r-1];if(t){const e=t.getBoundingClientRect().top,r=n&&n!==t?n.getBoundingClientRect().top:e;n&&void 0!==a&&r<a&&(g.current.currentAnchor=t,g.current.currentAnchorTop=e,h=!0,Object(s.a)(c),O())}}if(!h)if(n)g.current.currentAnchorTop=n.getBoundingClientRect().top;else{const t=e[0];t&&(g.current.currentAnchor=t,g.current.currentAnchorTop=t.getBoundingClientRect().top)}}i&&i(e)},[O,v,i,d]);return r.a.createElement("div",{ref:p,className:t,onScroll:j,teactFastList:!h},f)}},function(e,t,n){"use strict";var a=n(0),r=n(27);const c={fast:200,slow:350};t.a=(e,t="fast",n=!1)=>{const s=Boolean(e),i=!Object(a.q)(s).current&&!n,[o,l]=Object(a.r)(!s),{shouldRender:u,transitionClassNames:d}=Object(r.a)(s,void 0,!i,t);return Object(a.n)(()=>{u&&(i?setTimeout(()=>{l(!1)},c[t]):l(!1))},[i,u,t]),{shouldRenderThumb:o,shouldRenderFullMedia:u,transitionClassNames:d}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"j",(function(){return f})),n.d(t,"f",(function(){return p})),n.d(t,"h",(function(){return g})),n.d(t,"k",(function(){return O})),n.d(t,"i",(function(){return v})),n.d(t,"l",(function(){return j})),n.d(t,"g",(function(){return E})),n.d(t,"e",(function(){return y}));var a=n(4),r=n(49),c=n(7),s=n(1);const i="(max-height: 640px)",o=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=200,u={width:640,height:640},d={width:100,height:100};let m;function h(e,t,n){const a=t||n?1.625:0;return(function(e){const t=e?30:29;return c.f?(m||(m=Math.min(t,Math.floor(.69*window.innerWidth)/o)),m):t}(e)-a)*o}function b({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:c}){const s=t/e;return y(h(n,a,r),function(e,t){return e&&t&&t>=.75&&t<=1.25?20*o:27*o}(c,s),e,t)}function f(e,t){const n=window.matchMedia(i),{width:a,height:c}=r.a.get();let s=t&&n.matches?10:8.25;return e&&(s=n.matches?10:15),{width:a,height:c-s*o}}function p(e,t,n,r){const{width:c,height:s}=Object(a.S)(e)||d;return b({width:c,height:s,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:r})}function g(e,t,n){const{width:r,height:c}=Object(a.bb)(e)||d;return b({width:r,height:c,fromOwnMessage:t,isForwarded:n,isGif:e.isGif})}function O(){return{width:2*o,height:2*o}}function v(e){return e?{width:3*o,height:3*o}:{width:3.375*o,height:3.375*o}}function j(e){const{width:t}=e;let{height:n}=e;"1258816259753933"===e.id&&(n=t);const a=n&&t&&n/t,r=(c.f?s.ib:s.hb)*o,i=a?r*a:r;return a&&i>r?{width:Math.round(r/a),height:r}:{width:r,height:i}}function E({width:e,height:t},n,a=!1){const{width:r,height:c}=f(n,a);return y(r,c,e,t)}function y(e,t,n,a){const r=a/n,c=Math.min(n,e);return Math.round(c*r)>t?{width:Math.round(t/r),height:t}:{width:c,height:Math.round(c*r)}}},,function(e,t,n){"use strict";var a=n(0),r=n(7),c=n(9),s=n(8),i=n(43);let o,l;async function u(){return o||(o=n.e(7).then(n.bind(null,305)),l=(await o).default),o}setTimeout(u,5e3);t.a=Object(a.h)(({className:e,id:t,animationData:n,play:o,playSegment:d,speed:m,noLoop:h,size:b,quality:f,isLowPriority:p,onLoad:g})=>{const[O,v]=Object(a.r)(),j=Object(a.q)(null),E=Object(a.q)(!1),y=Object(a.q)(!1),N=Object(a.q)();N.current=o;const C=Object(a.q)();C.current=d,Object(a.n)(()=>{if(O||!n)return;const e=()=>{if(!j.current)return;const e=new l(t,j.current,n,{noLoop:h,size:b,quality:f,isLowPriority:p},g);m&&e.setSpeed(m),v(e)};l?e():u().then(()=>{Object(c.b)(()=>{j.current&&e()})})},[O,n,t,p,h,g,f,b,m]),Object(a.n)(()=>()=>{O&&O.destroy()},[O]);const T=Object(a.m)((e=!1)=>{O&&(N.current||C.current)&&(C.current?O.playSegment(C.current):e?O.goToAndPlay(0):O.play())},[O]),M=Object(a.m)(()=>{O&&O.pause()},[O]),w=Object(a.m)(()=>{y.current=!0,O&&(E.current||(E.current=O.isPlaying()),M())},[O,M]),L=Object(a.m)(()=>{E.current&&T(),E.current=!1,y.current=!1},[T]),S=Object(a.m)(()=>{Object(c.b)(L)},[L]);var I,k;Object(a.n)(()=>{O&&(o||d?y.current?E.current=!0:T(h):y.current?E.current=!1:M())},[O,o,d,h,T,M]),Object(i.a)(w,L),I=w,k=S,Object(a.n)(()=>(document.hasFocus()||I(),window.addEventListener("blur",I),window.addEventListener("focus",k),()=>{window.removeEventListener("focus",k),window.removeEventListener("blur",I)}),[I,k]);const A=Object(s.a)("AnimatedSticker",e,r.d&&o&&"is-playing"),x=b?`width: ${b}px; height: ${b}px;`:void 0;return a.a.createElement("div",{ref:j,className:A,style:x})})},function(e,t,n){"use strict";var a=n(38);t.a=(e,t)=>{const n=Object(a.a)(t);n&&!t.some((e,t)=>e!==n[t])||e(n||[])}},function(e,t,n){"use strict";var a=n(0),r=n(93),c=n(98),s=n(31);t.a=Object(a.h)(({isOpen:e,onClose:t,onCloseAnimationEnd:n,header:i,text:o,textParts:l,confirmLabel:u="Confirm",confirmHandler:d,confirmIsDestructive:m,isButtonsInOneRow:h})=>{const b=Object(r.a)();return a.a.createElement(c.a,{className:"confirm",header:i,isOpen:e,onClose:t,onCloseAnimationEnd:n,onEnter:d},o&&o.split("\\n").map(e=>a.a.createElement("p",null,e)),l,a.a.createElement("div",{className:h?"dialog-buttons mt-2":""},a.a.createElement(s.a,{className:"confirm-dialog-button",isText:!0,onClick:d,color:m?"danger":"primary"},u),a.a.createElement(s.a,{className:"confirm-dialog-button",isText:!0,onClick:t},b("Cancel"))))})},function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(27);n(233);t.a=Object(a.h)(({text:e="Nothing found."})=>{const{transitionClassNames:t}=Object(c.a)(!0);return a.a.createElement("div",{className:Object(r.a)("NothingFound",t)},e)})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(0),r=n(106),c=n(29);function s(e,t){const n=void 0===t,s=Object(a.q)(n),i=Object(a.q)(),o=Object(c.a)();return Object(r.a)(()=>{n||(s.current=!1,i.current&&(clearTimeout(i.current),i.current=void 0))},e),Object(a.n)(()=>{if(n||s.current)return;const e=()=>{s.current=!0,o()};t>0?i.current=window.setTimeout(e,t):e()},e),s.current}},function(e,t,n){"use strict";var a=n(0),r=n(8);n(188);t.a=({children:e,className:t,onClick:n})=>{const c=Object(a.m)(e=>{e.preventDefault(),n(e)},[n]);return a.a.createElement("a",{href:"#",className:Object(r.a)("Link",t),onClick:n?c:void 0},e)}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(18),s=n(4),i=n(6),o=n(35),l=n(3),u=n(93),d=n(99),m=n(130),h=n(146);t.a=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=Object(i.f)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?Object(i.n)(e,a):void 0,areMessagesLoaded:Boolean(Object(i.m)(e,t))}},(e,t)=>Object(l.l)(t,["loadFullChat","loadSuperGroupOnlines","openMediaViewer"]))(({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withHandle:r,withFullInfo:i,withUpdatingStatus:l,withChatType:b,chat:f,onlineCount:p,areMessagesLoaded:g,lastSyncTime:O,loadFullChat:v,loadSuperGroupOnlines:j,openMediaViewer:E})=>{const y=f&&Object(s.nb)(f),{id:N,isMin:C,isRestricted:T}=f||{};Object(a.n)(()=>{N&&!C&&i&&O&&(v({chatId:N}),y&&j({chatId:N}))},[N,C,O,i,v,y,j]);const M=Object(a.m)((e,n)=>{f&&n&&(e.stopPropagation(),E({avatarOwnerId:f.id,origin:"jumbo"===t?c.h.ProfileAvatar:c.h.MiddleHeaderAvatar}))},[f,t,E]),w=Object(u.a)();if(f)return a.a.createElement("div",{className:"ChatInfo"},a.a.createElement(d.a,{key:f.id,size:t,chat:f,onClick:n?M:void 0}),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,Object(o.a)(Object(s.l)(f))),f.isVerified&&a.a.createElement(m.a,null)),function(){if(l&&!g&&!T)return a.a.createElement("span",{className:"status"},w("Updating"));if(!f)return;if(e)return a.a.createElement(h.a,{typingStatus:e});if(b)return a.a.createElement("div",{className:"status"},w(Object(s.m)(f)));const t=r?f.username:void 0,n=function(e,t){const n=t(Object(s.m)(e)),{membersCount:a}=e;if(e.isRestricted)return"Channel"===n?"channel is inaccessible":"group is inaccessible";if(!a)return n;return t("Channel"===n?"Subscribers":"Members",a,"i")}(f,w),c=p?", "+w("OnlineCount",p,"i"):void 0;return a.a.createElement("div",{className:"status"},t&&a.a.createElement("span",{className:"handle"},t),a.a.createElement("span",{className:"group-status"},n),c&&a.a.createElement("span",{className:"online-status"},c))}()))}))},function(e,t,n){"use strict";var a=n(0),r=n(7),c=n(5),s=n(9),i=n(48),o=n(29);t.a=(e,t=!1,n=c.ApiMediaFormat.BlobUrl,l,u)=>{const d=e?i.c(e):void 0,m=n===c.ApiMediaFormat.Stream||r.h&&n===c.ApiMediaFormat.Progressive,h=Object(o.a)(),[b,f]=Object(a.r)(d&&!m?1:0),p=Object(a.q)(),g=Object(a.p)(()=>Object(s.g)(e=>{(!u||Date.now()-p.current>u)&&f(e)},500,!0),[u]);return Object(a.n)(()=>{!t&&e&&(d?m&&setTimeout(()=>{f(.75)},1500):(f(0),p.current&&i.a(g),p.current=Date.now(),i.b(e,n,g).then(()=>{const e=Date.now()-p.current;p.current=void 0,!u||e>=u?h():setTimeout(h,u-e)})))},[t,e,d,n,l,h,m,u,g]),Object(a.n)(()=>{t&&p.current&&(i.a(g),f(0))},[g,t]),{mediaData:d,downloadProgress:b}}},function(e,t,n){"use strict";var a=n(0),r=n(8);n(205);const c={s:22,m:25,l:28,xl:20};t.a=Object(a.h)(({progress:e=0,size:t="l",square:n,transparent:s,noCross:i,onClick:o})=>{const l=c[t],u=l-4,d=l-1,m=2*u*Math.PI,h=Object(a.q)(null);Object(a.n)(()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`<svg\n viewBox="0 0 ${2*d} ${2*d}"\n height="${2*d}"\n width="${2*d}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${m} ${m}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${u}\n cx=${d}\n cy=${d}\n />\n </svg>`},[h,m,d,u,e]);const b=Object(r.a)("ProgressSpinner size-"+t,s&&"transparent",n&&"square",i&&"no-cross");return a.a.createElement("div",{ref:h,className:b,onClick:o})})},function(e,t,n){"use strict";var a=n(0),r=n(57);t.a=({containerId:e,className:t,children:n})=>{const c=Object(a.q)(document.createElement("div"));return Object(a.o)(()=>{const n=document.querySelector(e||"#portals");if(!n)return;const a=c.current;return t&&a.classList.add(t),n.appendChild(a),()=>{r.a.render(void 0,a),n.removeChild(a)}},[t,e]),r.a.render(n,c.current)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(18),r=n(43),c=n(9),s=n(56);function i(e,t,n,i=0,o=1500,l,u){if(l===a.b.Static)return void t.scrollIntoView({block:n});const{offsetTop:d}=t;if(void 0===l){const t=d-e.scrollTop;t<-o?e.scrollTop+=t+o:t>o&&(e.scrollTop+=t-o)}else l===a.b.Up?e.scrollTop=d+o:l===a.b.Down&&(e.scrollTop=Math.max(0,d-o));Object(c.b)(()=>{Object(r.b)(600),function(e,t,n,a=0,r){const{offsetTop:c,offsetHeight:i}=t,{scrollTop:o,offsetHeight:l,scrollHeight:u}=e;let d;switch(n){case"start":d=c-a-o;break;case"end":d=c+i+a-(o+l);break;case"nearest":case"center":d=i<l?c+i/2-(o+l/2):c-a-o}if(d<0){const e=-o;d=Math.max(d,e)}else if(d>0){const e=u-(o+l);d=Math.min(d,e)}const m=e.scrollTop+d,h=r||250+Math.abs(d)/1500*350,b=Date.now();Object(s.b)(()=>{const t=Math.min((Date.now()-b)/h,1),n=d*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollTop=Math.round(m-n),t<1})}(e,t,n,i,u)})}},,function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(20);n(212);var s=Object(a.h)(({id:e,label:t,subLabel:n,value:s,name:i,checked:o,disabled:l,hidden:u,isLoading:d,onChange:m})=>{const h=Object(r.a)("Radio",l&&"disabled",u&&"hidden-widget",d&&"loading");return a.a.createElement("label",{className:h},a.a.createElement("input",{type:"radio",name:i,value:s,id:e,checked:o,onChange:m,disabled:l||u}),a.a.createElement("div",{className:"Radio-main"},a.a.createElement("span",{className:"label"},t),n&&a.a.createElement("span",{className:"subLabel"},n)),d&&a.a.createElement(c.a,null))});t.a=Object(a.h)(({id:e,name:t,options:n,selected:r,disabled:c,loadingOption:i,onChange:o})=>{const l=Object(a.m)(e=>{const{value:t}=e.currentTarget;o(t)},[o]);return a.a.createElement("div",{id:e,className:"radio-group"},n.map(e=>a.a.createElement(s,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:c,isLoading:i?i===e.value:void 0,onChange:l})))})},function(e,t,n){"use strict";var a=n(0),r=n(18),c=n(3),s=n(29),i=n(38);function o(e,t=0,n,a){const{length:c}=e,s=e.indexOf(t),i=n===r.e.Forwards?s:s+1||c,o=Math.max(0,i-a),l=i+a-1,u=e.slice(Math.max(0,o),l+1);let d,m;switch(n){case r.e.Forwards:d=i>0,m=o>=0;break;case r.e.Backwards:d=i<c,m=l<=c-1}return{newViewportIds:u,areSomeLocal:d,areAllLocal:m}}t.a=(e,t,n=!1,l=30,u=!1)=>{const d=Object(a.q)(),m=Object(a.q)((()=>{if(!t||d.current)return;const{newViewportIds:e}=o(t,t[0],r.e.Forwards,l);return e})()),h=Object(s.a)(),b=Object(i.a)(t),f=Object(i.a)(n);if(t&&!n&&(t!==b||n!==f)){const{offsetId:e=t[0],direction:n=r.e.Forwards}=d.current||{},{newViewportIds:a}=o(t,e,n,l);m.current&&Object(c.a)(m.current,a)||(m.current=a)}Object(a.n)(()=>{if(t&&!n&&e&&u){const t=m.current;e({offsetId:t[t.length-1]})}},[t,n,e,u]);const p=Object(a.m)(({direction:n})=>{const a=m.current,s=a?n===r.e.Backwards?a[a.length-1]:a[0]:void 0;if(!t)return void(e&&e({offsetId:s}));d.current={...d.current,direction:n,offsetId:s};const{newViewportIds:i,areSomeLocal:u,areAllLocal:b}=o(t,s,n,l);!u||a&&Object(c.a)(a,i)||(m.current=i,h()),!b&&e&&e({offsetId:s})},[t,l,e,h]);return n?[t]:[m.current,p]}},function(e,t,n){"use strict";var a=n(0),r=n(5),c=n(1),s=n(103),i=n(95),o=n(97),l=n(102),u=n(36),d=n(105);n(210);t.a=({sticker:e,isInline:t=!1,observeIntersection:n,lastSyncTime:m})=>{const h=Object(a.q)(null),[b,f]=Object(u.a)(),p="sticker"+e.id,g=Object(i.b)(h,n),O=Object(o.a)(p+"?size=m",!g,r.ApiMediaFormat.BlobUrl,m),{transitionClassNames:v}=Object(l.a)(O,"slow"),j=Object(o.a)(p,!g,r.ApiMediaFormat.Lottie,m),E=Boolean(j),[y,N]=Object(a.r)(String(Math.random())),C=Object(a.m)(()=>{N(String(Math.random()))},[]);let T;T=t?.5*Object(s.l)(e).width:c.nb;const M=`width: ${T}px; height: ${T}px;`;return a.a.createElement("div",{ref:h,className:"AnimatedEmoji media-inner",style:M,onClick:C},O&&!b&&a.a.createElement("img",{src:O,className:v,alt:""}),E&&a.a.createElement(d.a,{key:p,id:p,animationData:j,size:T,quality:1,play:g&&y,noLoop:!0,onLoad:f}))}},,function(e,t,n){"use strict";var a=n(0),r=n(9),c=n(148);t.a=(e=!1)=>{const[t,n]=Object(a.r)(!e),[s,i]=Object(a.r)(0),o=Object(a.p)(()=>Object(r.a)(n,200,!1,!0),[]),l=Object(a.m)(e=>{const t=e.currentTarget;Object(c.a)(t)||(t.buffered.length&&i(t.buffered.end(0)/t.duration),o(t.readyState>=3||t.currentTime>0))},[o]);return{isBuffered:t,bufferedProgress:s,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){o(e.readyState>=3)}}}},function(e,t,n){"use strict";function a(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),a=document.createRange();e.lastChild&&e.lastChild.nodeValue?(a.setStart(e.lastChild,e.lastChild.nodeValue.length),n.removeAllRanges(),n.addRange(a)):e.focus()}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(5),r=n(7);const c={B:a.ApiMessageEntityTypes.Bold,STRONG:a.ApiMessageEntityTypes.Bold,I:a.ApiMessageEntityTypes.Italic,EM:a.ApiMessageEntityTypes.Italic,U:a.ApiMessageEntityTypes.Underline,S:a.ApiMessageEntityTypes.Strike,STRIKE:a.ApiMessageEntityTypes.Strike,DEL:a.ApiMessageEntityTypes.Strike,CODE:a.ApiMessageEntityTypes.Code,PRE:a.ApiMessageEntityTypes.Pre,BLOCKQUOTE:a.ApiMessageEntityTypes.Blockquote};function s(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);r.c||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1"));return t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/ /g," "),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"<code>$1</code>"),t=t.replace(/[*]{2}([^*\n]+)[*]{2}/g,"<b>$1</b>"),t=t.replace(/[*]{1}([^*\n]+)[*]{1}/g,"<i>$1</i>"),t=t.replace(/[~]{2}([^~\n]+)[~]{2}/g,"<s>$1</s>"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"").slice(0,4096);let s=0,i=0;const o=[];function l(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(c[e.nodeName])return c[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.ApiMessageEntityTypes.MentionName?a.ApiMessageEntityTypes.MentionName:t.href.startsWith("mailto:")?a.ApiMessageEntityTypes.Email:t.href.startsWith("tel:")?a.ApiMessageEntityTypes.Phone:t.href!==t.textContent?a.ApiMessageEntityTypes.TextUrl:a.ApiMessageEntityTypes.Url}if("SPAN"===e.nodeName)return e.dataset.entityType;return}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const s=t.indexOf(e.textContent,n),i=s>=0?s:n,o=t.substring(0,i).length,{length:l}=t.substring(i,i+e.textContent.length);let u,d;r===a.ApiMessageEntityTypes.TextUrl&&(u=e.href);r===a.ApiMessageEntityTypes.MentionName&&(d=Number(e.dataset.userId));return{index:i,entity:{type:r,offset:o,length:l,...u&&{url:u},...d&&{userId:d}}}}(e,n,s);r?(s=t,o.push(r)):e.textContent&&(s+=e.textContent.length),e.hasChildNodes()&&i<=3&&(i+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach(e=>{i=1,l(e)}),{text:n,entities:o.length?o:void 0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var a=n(0),r=n(27),c=n(8),s=n(42),i=n(38),o=n(36);n(200);var l=Object(a.h)(({isQuick:e,onFileSelect:t})=>{const[n,r,s]=Object(o.a)(),i=Object(c.a)("DropTarget",n&&"hovered");return a.a.createElement("div",{className:i,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),s()}},a.a.createElement("div",{className:"target-content"},a.a.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.a.createElement("div",{className:"title"},"Drop files here to send them"),a.a.createElement("div",{className:"description"},e?"in a quick way":"without compression")))});n(201);let u;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(u||(u={}));t.b=Object(a.h)(({isOpen:e,withQuick:t,onHide:n,onFileSelect:o})=>{const u=Object(a.q)(null),d=Object(i.a)(t),{shouldRender:m,transitionClassNames:h}=Object(r.a)(e);Object(a.n)(()=>e?Object(s.a)(n):void 0,[e,n]);const b=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!1))},[o,n]),f=Object(a.m)(e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),o(Array.from(t.files),!0))},[o,n]),p=Object(a.m)(e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(u.current=window.setTimeout(()=>{n()},150))},[n]);if(!m)return;const g=Object(c.a)("DropArea",h);return a.a.createElement("div",{className:g,onDragLeave:p,onDragOver:()=>{u.current&&window.clearTimeout(u.current)},onDrop:n},a.a.createElement(l,{onFileSelect:b}),(t||d)&&a.a.createElement(l,{onFileSelect:f,isQuick:!0}))})},,function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(6),s=n(4),i=n(35),o=n(8),l=n(93),u=n(99);n(182);t.a=Object(a.h)(Object(r.h)((e,{chatOrUserId:t})=>{if(!t)return{};return{chat:t?Object(c.f)(e,t):void 0,user:Object(s.lb)(t)?Object(c.Bb)(e,t):void 0}})(({icon:e,title:t,isMinimized:n,canClose:r,onClick:c,clickArg:d,chat:m,user:h,className:b})=>{let f,p;if(Object(l.a)(),e&&t)f=a.a.createElement("div",{className:"item-icon"},a.a.createElement("i",{className:"icon-"+e})),p=t;else if(m||h){f=a.a.createElement(u.a,{chat:m,user:h,size:"small",isSavedMessages:h&&h.isSelf});const e=!m||h&&!h.isSelf?Object(s.Y)(h):Object(s.l)(m,h);p=e?Object(i.a)(e):void 0}const g=Object(o.a)("PickerSelectedItem",b,n&&"minimized",r&&"closeable");return a.a.createElement("div",{className:g,onClick:()=>c(d),title:n?p:void 0},f,!n&&a.a.createElement("div",{className:"item-name"},p),r&&a.a.createElement("div",{className:"item-remove"},a.a.createElement("i",{className:"icon-close"})))}))},function(e,t,n){"use strict";let a;n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(a||(a={}));function r(e,t){let n,r=!1;function c(e){t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector))||(n=e,"mousedown"===e.type?(document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)):"touchstart"===e.type&&(document.addEventListener("touchmove",i),document.addEventListener("touchend",s),document.addEventListener("touchcancel",s),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY))),document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e))}function s(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",s),document.removeEventListener("mousemove",i),document.removeEventListener("touchcancel",s),document.removeEventListener("touchend",s),document.removeEventListener("touchmove",i),n=void 0,r?t.onRelease&&t.onRelease(e):t.onClick&&t.onClick(e)),r=!1}function i(e){if(n){"touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY));const c=e.pageX-n.pageX,s=e.pageY-n.pageY;(Math.abs(c)>=15||Math.abs(s)>=15)&&(r=!0),t.onDrag&&t.onDrag(e,n,{dragOffsetX:c,dragOffsetY:s}),t.onSwipe&&function(e,t,n,r){const c=Math.abs(t),s=Math.abs(n);if(t&&n){if(Math.max(c,s)/Math.min(c,s)<2)return}c>=50?r(e,t<0?a.Left:a.Right):s>=50&&r(e,n<0?a.Up:a.Down)}(e,c,s,t.onSwipe)}}return e.addEventListener("mousedown",c),e.addEventListener("touchstart",c,{passive:!0}),()=>{e.removeEventListener("mousedown",c),e.removeEventListener("touchstart",c)}}},function(e,t,n){"use strict";var a=n(0);t.a=(e,t)=>{Object(a.n)(()=>{const t=e.current;if(t)return t.addEventListener("wheel",n,{passive:!0}),()=>{t.removeEventListener("wheel",n)};function n(e){e.deltaX||(t.scrollLeft+=e.deltaY/4)}},[e,t])}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(9);t.a=(e,t,n,s)=>{const{loadMessage:i}=Object(r.d)(),o=Object(a.p)(()=>{const n=Object(c.g)(i,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:s})}},[i,e,t,s]);Object(a.n)(()=>{t&&!n&&o()})}},function(e,t,n){"use strict";var a=n(0);n(189);t.a=()=>a.a.createElement("span",{className:"VerifiedIcon"})},function(e,t,n){"use strict";var a=n(0),r=n(7);let c=0;t.a=(e,t)=>{const[n,s]=Object(a.r)(!1),[i,o]=Object(a.r)(void 0),l=Object(a.m)(e=>{t||2!==e.button||document.body.classList.add("no-selection")},[t]),u=Object(a.m)(e=>{t||(e.preventDefault(),document.body.classList.remove("no-selection"),i||(document.body.classList.remove("no-selection"),0===c&&document.body.classList.add("has-context-menu"),c++,s(!0),o({x:e.clientX,y:e.clientY})))},[t,i]),d=Object(a.m)(()=>{s(!1)},[]),m=Object(a.m)(()=>{o(void 0),document.body.classList.remove("no-selection"),setTimeout(()=>{c--,0===c&&document.body.classList.remove("has-context-menu")},200)},[]);return Object(a.n)(()=>{if(t||!r.k)return;const n=e.current;if(!n)return;let a;const c=()=>{a&&(clearTimeout(a),a=void 0)},l=e=>{t||r.f&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(c(),a=window.setTimeout(()=>(e=>{c();const{clientX:t,clientY:a}=e.touches[0];i||(n.addEventListener("touchend",(function e(t){n.removeEventListener("touchend",e,!0),t.stopImmediatePropagation(),t.preventDefault(),t.stopPropagation()}),!0),document.body.classList.add("no-selection"),s(!0),o({x:t,y:a}))})(e),250))};return n.addEventListener("touchstart",l,{passive:!0}),n.addEventListener("touchcancel",c,!0),n.addEventListener("touchend",c,!0),n.addEventListener("touchmove",c,{passive:!0}),()=>{c(),n.removeEventListener("touchstart",l),n.removeEventListener("touchcancel",c,!0),n.removeEventListener("touchend",c,!0),n.removeEventListener("touchmove",c)}},[i,t,e]),{isContextMenuOpen:n,contextMenuPosition:i,handleBeforeContextMenu:l,handleContextMenu:u,handleContextMenuClose:d,handleContextMenuHide:m}}},function(e,t,n){"use strict";function a(e,t){return t-Math.floor(t/e)*e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";var a=n(1);t.a=e=>{e.play().catch(e=>{a.l&&console.warn(e)})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var a=n(0),r=n(2),c=n(5),s=n(4),i=n(35),o=n(68),l=n(53);function u(e,t,n){const a=e.content.text;if(!a||!a.text){const t=Object(s.N)(e);return t?[t]:void 0}const{text:r,entities:c}=a;return m(r,c,t,n)}function d(e){const t=new Set,n=[];return e.forEach((a,r)=>{if(t.has(r))return;const c=function e(t,n,a,r){const{offset:c,length:s}=t,i=new Set([n]);if(r.has(n))return;const o=a.filter((e,t)=>t>n&&e.offset>=c&&e.offset<c+s).map(t=>e(t,a.indexOf(t),a,r)).filter(Boolean);return o.forEach(e=>e.organizedIndexes.forEach(e=>i.add(e))),{entity:t,organizedIndexes:i,nestedEntities:o}}(a,r,e,t);c&&(c.organizedIndexes.forEach(e=>{t.add(e)}),n.push(c))}),n}function m(e,t,n,r,s){if(!t||!t.length)return h(e,n,r,s);const u=[];let m=!1;const g=d(t);function O(t,u,d,g){const v=[],{entity:j,nestedEntities:E}=d,{offset:y,length:N,type:C}=j;let T=e.substring(t,y);const M=T.length;T&&(m&&T.length>0&&"\n"===T[0]&&(T=T.substr(1),m=!1),T&&v.push(...h(T,n,r,s)));const w=t+M,L=w+N;let S=e.substring(y,y+N);const I=[];if(m&&S.length>0&&"\n"===S[0]&&(S=S.substr(1),m=!1),C===c.ApiMessageEntityTypes.Pre&&(m=!0),E.length){let e=w;E.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=O(e,L,t,n===E.length-1);I.push(...a),e=r})}const k=s?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):Object(i.a)(t,["emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case c.ApiMessageEntityTypes.Bold:return`<b>${r}</b>`;case c.ApiMessageEntityTypes.Italic:return`<i>${r}</i>`;case c.ApiMessageEntityTypes.Underline:return`<u>${r}</u>`;case c.ApiMessageEntityTypes.Code:return`<code class="text-entity-code">${r}</code>`;case c.ApiMessageEntityTypes.Pre:return`\`\`\`<br/>${r}<br/>\`\`\``;case c.ApiMessageEntityTypes.Strike:return`<del>${r}</del>`;case c.ApiMessageEntityTypes.MentionName:return`<a\n class="text-entity-link"\n data-entity-type="${c.ApiMessageEntityTypes.MentionName}"\n data-user-id="${e.userId}"\n contenteditable="false"\n >${r}</a>`;case c.ApiMessageEntityTypes.Url:case c.ApiMessageEntityTypes.TextUrl:return`<a\n class="text-entity-link"\n href=${b(a,e)}\n data-entity-type="${e.type}"\n >${r}</a>`;default:return r}}(j,S,I):function(e,t,n){const r="string"==typeof t&&t,s=n.length?n:t;if(!r)return h(s);switch(e.type){case c.ApiMessageEntityTypes.Bold:return a.a.createElement("strong",null,h(s));case c.ApiMessageEntityTypes.Blockquote:return a.a.createElement("blockquote",null,h(s));case c.ApiMessageEntityTypes.BotCommand:return a.a.createElement("a",{onClick:f,className:"text-entity-link"},h(s));case c.ApiMessageEntityTypes.Hashtag:case c.ApiMessageEntityTypes.Cashtag:return a.a.createElement("a",{onClick:p,className:"text-entity-link"},h(s));case c.ApiMessageEntityTypes.Code:return a.a.createElement("code",{className:"text-entity-code"},h(s));case c.ApiMessageEntityTypes.Email:return a.a.createElement("a",{href:"mailto:"+r,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link"},h(s));case c.ApiMessageEntityTypes.Italic:return a.a.createElement("em",null,h(s));case c.ApiMessageEntityTypes.MentionName:return a.a.createElement(o.a,{userId:e.userId},h(s));case c.ApiMessageEntityTypes.Mention:return a.a.createElement(o.a,{username:r},h(s));case c.ApiMessageEntityTypes.Phone:return a.a.createElement("a",{href:"tel:"+r,className:"text-entity-link"},h(s));case c.ApiMessageEntityTypes.Pre:return a.a.createElement("pre",{className:"text-entity-pre"},h(s));case c.ApiMessageEntityTypes.Strike:return a.a.createElement("del",null,h(s));case c.ApiMessageEntityTypes.TextUrl:case c.ApiMessageEntityTypes.Url:return a.a.createElement(l.a,{url:b(r,e),text:r},h(s));case c.ApiMessageEntityTypes.Underline:return a.a.createElement("ins",null,h(s));default:return h(s)}}(j,S,I);if(Array.isArray(k)?v.push(...k):v.push(k),g&&L<u){let t=e.substring(L,u);m&&t.length>0&&"\n"===t[0]&&(t=t.substring(1)),t&&v.push(...h(t,n,r,s))}return{renderResult:v,entityEndIndex:L}}let v=0;return g.forEach((t,n)=>{const{renderResult:a,entityEndIndex:r}=O(v,e.length,t,n===g.length-1);u.push(...a),v=r}),u}function h(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach(e=>{r.push(...h(e,t,n,a))}),r}if(a)return Object(i.a)(e,["emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?Object(i.a)(e,[r,"br","highlight"],{highlight:t}):Object(i.a)(e,[r,"br"])}function b(e,t){const{type:n,url:a}=t;return n===c.ApiMessageEntityTypes.TextUrl&&a?a:e}function f(e){Object(r.d)().sendBotCommand({command:e.currentTarget.innerText})}function p(e){Object(r.d)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),Object(r.d)().searchTextMessagesLocal()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),r=n(168),c=n(14),s=n(29);const i=new Map;function o(e,t=!1,n){const o=Object(a.q)(e?i.get(e):void 0),l=Object(a.q)(),u=Object(s.a)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),Object(a.n)(()=>{if(!e||o.current||t)return;const a=new Image;a.onload=()=>{const t=Object(c.f)(a);Object(r.a)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();o.current=n,u(),i.size>=1e3&&i.clear(),i.set(e,n)},n?l.current=window.setTimeout(()=>{a.src=e},n):a.src=e},[e,n,u,t]),o.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(0),r=n(9);function c(e,t){Object(a.n)(()=>{const t=e.current;return()=>{t&&Object(r.b)(()=>{t.pause(),t.src="",t.load()})}},t)}},,,function(e,t,n){},,,function(e,t,n){"use strict";var a=n(0),r=n(8),c=n(36),s=n(93),i=n(16),o=n(31);n(180);t.a=Object(a.h)(({ref:e,children:t,value:n,inputId:l,className:u,focused:d,isLoading:m,placeholder:h,disabled:b,canClose:f,onChange:p,onReset:g,onFocus:O,onBlur:v})=>{let j=Object(a.q)(null);e&&(j=e);const[E,y,N]=Object(c.a)(d);Object(a.n)(()=>{j.current&&(d?j.current.focus():j.current.blur())},[d,h]);const C=Object(s.a)();return a.a.createElement("div",{className:Object(r.a)("SearchInput",u,E&&"has-focus")},t,a.a.createElement("input",{ref:j,id:l,type:"text",placeholder:h||C("Search"),className:"form-control",value:n,disabled:b,onChange:function(e){const{currentTarget:t}=e;p(t.value)},onFocus:function(){y(),O&&O()},onBlur:function(){N(),v&&v()}}),a.a.createElement("i",{className:"icon-search"}),m&&a.a.createElement(i.a,null),!m&&(n||f)&&g&&a.a.createElement(o.a,{round:!0,size:"tiny",color:"translucent",onClick:g},a.a.createElement("span",{className:"icon-close"})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(9),r=n(56),c=n(7);function s(e,t){c.d?Object(a.b)(()=>{!function(e,t){const{scrollLeft:n,offsetWidth:a,scrollWidth:c}=e;let s=t-n;if(s<0){const e=-n;s=Math.max(s,e)}else if(s>0){const e=c-(n+a);s=Math.min(s,e)}const i=e.scrollLeft+s,o=Date.now();Object(r.a)(()=>{const t=Math.min((Date.now()-o)/450,1),n=s*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(i-n),t<1})}(e,t)}):e.scrollTo({left:t,behavior:"smooth"})}},function(e,t,n){"use strict";var a=n(7);t.a=(e,t)=>{a.d&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),a.d&&(e.style.overflow="")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));function a(e,t=30){return!e||e.length<=t?e:e.substr(0,t)+"..."}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(6),s=n(4),i=n(35);n(190);t.a=Object(a.h)(Object(r.h)((e,{typingStatus:t})=>{if(!t.userId)return{};return{typingUser:Object(c.Bb)(e,t.userId)}})(({typingStatus:e,typingUser:t})=>{const n=t&&!t.isSelf&&Object(s.Y)(t);return a.a.createElement("p",{className:"typing-status"},n&&a.a.createElement("span",{className:"sender-name"},Object(i.a)(n)),e.action,a.a.createElement("span",{className:"ellipsis"}))}))},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(6),s=n(4),i=n(3),o=n(93),l=n(99),u=n(98),d=n(31);n(193);t.a=Object(a.h)(Object(r.h)((e,{chat:t})=>{const n=Object(s.lb)(t.id),a=Object(c.N)(e,t.id),r=n&&!a,i=t&&Object(s.lb)(t.id)?Object(s.Y)(Object(c.Bb)(e,Object(s.T)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isChannel:Object(s.jb)(t),isBasicGroup:Object(s.ib)(t),isSuperGroup:Object(s.nb)(t),canDeleteForAll:r,chatTitle:Object(s.l)(t),contactFirstName:i}},(e,t)=>Object(i.l)(t,["leaveChannel","deleteHistory","deleteChannel"]))(({isOpen:e,chat:t,isChannel:n,isPrivateChat:r,isChatWithSelf:c,isBasicGroup:s,isSuperGroup:i,canDeleteForAll:m,chatTitle:h,contactFirstName:b,onClose:f,leaveChannel:p,deleteHistory:g,deleteChannel:O})=>{const v=Object(a.m)(()=>{g({chatId:t.id,maxId:t.lastMessage.id,shouldDeleteForAll:!0}),f()},[g,t.id,t.lastMessage,f]),j=Object(a.m)(()=>{r||s?g({chatId:t.id,maxId:t.lastMessage.id,shouldDeleteForAll:!1}):!n&&!i||t.isCreator?(n||i)&&t.isCreator&&O({chatId:t.id}):p({chatId:t.id}),f()},[r,s,n,i,t.isCreator,t.lastMessage,t.id,f,g,p,O]),E=Object(o.a)();return a.a.createElement(u.a,{isOpen:e,onClose:f,className:"DeleteChatModal",header:a.a.createElement("div",{className:"modal-header"},a.a.createElement(l.a,{size:"tiny",chat:t,isSavedMessages:c}),a.a.createElement("h3",{className:"modal-title"},n&&!t.isCreator?"Leave Channel?":n&&t.isCreator?"Delete and Leave Channel?":s||i?"Leave Group?":"Delete Chat?"))},n&&!t.isCreator?a.a.createElement("p",null,"Are you sure you want to leave channel ",a.a.createElement("strong",null,h),"?"):n&&t.isCreator?a.a.createElement("p",null,"Are you sure you want to delete and leave channel ",a.a.createElement("strong",null,h),"?"):s||i?a.a.createElement("p",null,"Are you sure you want to leave group ",a.a.createElement("strong",null,h),"?"):a.a.createElement("p",null,"Are you sure you want to delete chat with ",a.a.createElement("strong",null,b),"?"),m&&a.a.createElement(d.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:v},"Delete for ",b?"me and "+b:"Everyone"),a.a.createElement(d.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:j},n&&!t.isCreator?"Leave Channel":n&&t.isCreator?"Delete and Leave Channel":s||i?"Leave Group":"Delete"+(m?" just for me":"")),a.a.createElement(d.a,{className:"confirm-dialog-button",isText:!0,onClick:f},E("Cancel")))}))},function(e,t,n){"use strict";function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",()=>{const t=e.currentTime;e.addEventListener("progress",(function n(){e.buffered.length&&(e.dataset.patchForSafariInProgress="true",e.currentTime=e.duration-1,e.addEventListener("progress",()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&e.play()},{once:!0}),e.removeEventListener("progress",n))}))},{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var a=n(0),r=n(38);t.a=(e,t)=>{const n=Object(r.a)(t);return Object(a.o)(()=>{e(n||[])},t)}},function(e,t,n){"use strict";var a=n(0),r=n(54),c=n(4),s=n(95),i=n(112),o=n(97),l=n(166),u=n(167);t.a=Object(a.h)(({message:e,observeIntersection:t,smaller:n,uploadProgress:d,withDate:m,datetime:h,className:b,sender:f,isSelected:p,isSelectable:g,onCancelUpload:O,onDateClick:v})=>{const j=Object(a.q)(null),E=e.content.document,y=Object(r.b)(E)||"",{fileName:N,size:C,timestamp:T}=E,M=Object(s.b)(j,t),[w,L]=Object(a.r)(!1),{mediaData:S,downloadProgress:I}=Object(i.a)(Object(c.D)(e,"download"),!w),{isUploading:k,isTransferring:A,transferProgress:x}=Object(c.s)(e,d||I,w),D=Object(r.c)(E),_=D?Object(c.E)(e):void 0,R=D?E.previewBlobUrl:void 0,P=Object(o.a)(Object(c.D)(e,"pictogram"),!M),F=Object(a.m)(()=>{k?O&&O():L(e=>!e)},[k,O]),U=Object(a.m)(()=>{v(e.id,e.chatId)},[v,e.id,e.chatId]);return Object(a.n)(()=>{w&&S&&(Object(l.a)(S,N),L(!1))},[N,S,w]),a.a.createElement(u.a,{ref:j,name:N,extension:y,size:C,timestamp:m?h||T:void 0,thumbnailDataUri:_,previewData:R||P,smaller:n,isTransferring:A,isUploading:k,transferProgress:x,className:b,sender:f,isSelectable:g,isSelected:p,onClick:F,onDateClick:v?U:void 0})})},function(e,t,n){"use strict";var a=n(0),r=n(12),c=n(17);t.a=e=>{const{isOpen:t}=e,n=Object(c.a)(r.a.Extra,"StickerSetModal",!t);return n?a.a.createElement(n,e):void 0}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(8),s=n(42),i=n(27),o=n(69),l=n(36),u=n(93),d=n(31);n(225);const m={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"};t.a=Object(a.h)(({isOpen:e,anchorPosition:t,selectedRange:n,onClose:h})=>{const b=Object(a.q)(null),f=Object(a.q)(null),{shouldRender:p,transitionClassNames:g}=Object(i.a)(e),[O,v,j]=Object(l.a)(),[E,y]=Object(a.r)(""),[N,C]=Object(a.r)(!1),[T,M]=Object(a.r)(),[w,L]=Object(a.r)({});Object(a.n)(()=>e?Object(s.a)(h):void 0,[e,h]),Object(o.a)(e,b,h),Object(a.n)(()=>{O?f.current.focus():(y(""),C(!1))},[O]),Object(a.n)(()=>{p||(j(),L({}),M(void 0))},[j,p]),Object(a.n)(()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.q;){const e=m[a.tagName];e&&(t[e]=!0),a=a.parentElement}L(t)},[e,n,v]);const S=Object(a.m)(()=>{if(n)return n.toString()},[n]),I=Object(a.m)(()=>{if(n)return n.commonAncestorContainer.parentElement},[n]);function k(){const e=f.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void M(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),M(r)}function A(e){if(w[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(w).some(t=>t!==e&&!!w[t]))return"disabled"}else if(w.monospace||w.strikethrough)return"disabled"}const x=Object(a.m)(()=>{L(e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach(t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)}),{...e,bold:!e.bold}))},[]),D=Object(a.m)(()=>{document.execCommand("italic"),L(e=>({...e,italic:!e.italic}))},[]),_=Object(a.m)(()=>{document.execCommand("underline"),L(e=>({...e,underline:!e.underline}))},[]),R=Object(a.m)(()=>{if(w.strikethrough){const e=I();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L(e=>({...e,strikethrough:!1}))}const e=S();document.execCommand("insertHTML",!1,`<del>${e}</del>`),h()},[I,S,h,n,w.strikethrough]),P=Object(a.m)(()=>{if(w.monospace){const e=I();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L(e=>({...e,monospace:!1}))}const e=S();document.execCommand("insertHTML",!1,`<code class="text-entity-code">${e}</code>`),h()},[I,S,h,n,w.monospace]);function F(){const e=E.includes("://")?E:"http://"+E;if(N){const t=I();if(!t||"A"!==t.tagName)return;return t.href=e,void h()}const t=S();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link">${t}</a>`),h()}const U=Object(a.m)(e=>{const t={KeyK:v,KeyB:x,KeyU:_,KeyI:D,KeyM:P,KeyS:R}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())},[x,D,_,P,R,v]);Object(a.n)(()=>(e&&document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)),[e,U]);const B=Object(u.a)();if(!p)return;const q=Object(c.a)("TextFormatter",g,O&&"link-control-shown"),H=Object(c.a)("TextFormatter-link-url-confirm",!!E.length&&"shown"),$=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.a.createElement("div",{ref:b,className:q,style:$,onKeyDown:function(e){"Enter"===e.key&&O&&(F(),e.preventDefault())}},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(d.a,{color:"translucent",ariaLabel:"Bold text",className:A("bold"),onClick:x},a.a.createElement("i",{className:"icon-bold"})),a.a.createElement(d.a,{color:"translucent",ariaLabel:"Italic text",className:A("italic"),onClick:D},a.a.createElement("i",{className:"icon-italic"})),a.a.createElement(d.a,{color:"translucent",ariaLabel:"Underlined text",className:A("underline"),onClick:_},a.a.createElement("i",{className:"icon-underlined"})),a.a.createElement(d.a,{color:"translucent",ariaLabel:"Strikethrough text",className:A("strikethrough"),onClick:R},a.a.createElement("i",{className:"icon-strikethrough"})),a.a.createElement(d.a,{color:"translucent",ariaLabel:"Monospace text",className:A("monospace"),onClick:P},a.a.createElement("i",{className:"icon-monospace"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(d.a,{color:"translucent",ariaLabel:B("TextFormat.AddLinkTitle"),onClick:v},a.a.createElement("i",{className:"icon-link"}))),a.a.createElement("div",{className:"TextFormatter-link-control"},a.a.createElement("div",{className:"TextFormatter-buttons"},a.a.createElement(d.a,{color:"translucent",ariaLabel:B("Cancel"),onClick:j},a.a.createElement("i",{className:"icon-arrow-left"})),a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement("div",{className:Object(c.a)("TextFormatter-link-url-input-wrapper",T)},a.a.createElement("input",{ref:f,className:"TextFormatter-link-url-input",type:"text",value:E,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",onChange:function(e){y(e.target.value),k()},onScroll:k})),a.a.createElement("div",{className:H},a.a.createElement("div",{className:"TextFormatter-divider"}),a.a.createElement(d.a,{color:"translucent",ariaLabel:B("Save"),className:"color-primary",onClick:F},a.a.createElement("i",{className:"icon-check"}))))))})},function(e,t,n){"use strict";var a=n(0),r=n(28),c=n(4),s=n(97),i=n(102);n(231);t.a=Object(a.h)(({message:e,idPrefix:t="shared-media",onClick:n})=>{const o=Object(a.m)(()=>{n(e.id,e.chatId)},[e.id,e.chatId,n]),l=Object(c.E)(e),u=Object(s.a)(Object(c.D)(e,"pictogram")),{shouldRenderThumb:d,shouldRenderFullMedia:m,transitionClassNames:h}=Object(i.a)(u,"slow"),b=Object(c.O)(e);return a.a.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?o:void 0},d&&a.a.createElement("img",{src:l,alt:""}),m&&a.a.createElement("img",{src:u,className:h+" full-media",alt:""}),b&&a.a.createElement("span",{className:"video-duration"},b.isGif?"GIF":Object(r.e)(b.duration)))})},,function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(7),s=n(28),i=n(4);var o=n(8),l=n(35);var u=n(112),d=n(27),m=n(121),h=n(164),b=n(93),f=n(31),p=n(113),g=n(110);n(207);const O=c.f?20:25,v=c.f?50:75;function j(e,t,{handleStartSeek:n,handleSeek:r,handleStopSeek:c}){return a.a.createElement("div",{className:"seekline no-selection",onMouseDown:n,onMouseMove:r,onMouseUp:c},a.a.createElement("span",{className:"seekline-buffered-progress"},a.a.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.a.createElement("span",{className:"seekline-play-progress"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.a.createElement("span",{className:"seekline-thumb"},a.a.createElement("i",{style:`transform: translateX(${100*e}%)`})))}t.a=Object(a.h)(Object(r.h)(e=>({theme:e.settings.byKey.theme}))(({theme:e,message:t,senderTitle:n,uploadProgress:r,renderingFor:E,date:y,lastSyncTime:N,className:C,isSelectable:T,isSelected:M,onPlay:w,onReadMedia:L,onCancelUpload:S,onDateClick:I})=>{const{content:{audio:k,voice:A},isMediaUnread:x}=t,D=Boolean(A),_=Object(a.q)(!1),[R,P]=Object(a.r)(!1),F=N,{mediaData:U,downloadProgress:B}=Object(u.a)(Object(i.D)(t,"inline"),!F,Object(i.C)(t,"inline"));const{isBuffered:q,bufferedProgress:H,bufferingHandlers:$,checkBuffering:K}=Object(m.a)(),{isPlaying:Y,playProgress:V,playPause:z,setCurrentTime:W,duration:G}=Object(h.a)(Object(i.A)(t),Object(i.r)(t),U,$,K,R,(function(){P(!0),w(t.id,t.chatId)}),Object(i.sb)(t));Object(a.n)(()=>{P(Y)},[Y]);const{isUploading:X,isTransferring:Q,transferProgress:J}=Object(i.s)(t,r||B,R&&!q),{shouldRender:Z,transitionClassNames:ee}=Object(d.a)(Q),te=Object(a.m)(()=>{X?S&&S():(Y||w(t.id,t.chatId),P(!R),z())},[Y,X,t.id,t.chatId,S,w,z,R]);Object(a.n)(()=>{Y&&L&&x&&L()},[Y,x,L]);const ne=Object(a.m)(e=>{if(_.current){const t=e.currentTarget.closest(".seekline,.waveform");if(t){const{width:n,left:a}=t.getBoundingClientRect();W(G*((e.clientX-a)/n))}}},[G,W]),ae=Object(a.m)(e=>{_.current=!0,ne(e)},[ne]),re=Object(a.m)(()=>{_.current=!1},[]),ce=Object(a.m)(()=>{I(t.id,t.chatId)},[I,t.id,t.chatId]);Object(b.a)();const se={handleStartSeek:ae,handleSeek:ne,handleStopSeek:re},ie=Object(i.tb)(t),oe=Object(a.p)(()=>A&&function(e,t=0,n=!1,{handleStartSeek:r,handleSeek:c,handleStopSeek:s},i){const{waveform:o,duration:l}=e;if(!o)return;const u="dark"===i?"#494B75":"#CBCBCB",d="dark"===i?"#C69C85":"#B0DEA6",m="dark"===i?"#868DF5":"#54a3e6",h="dark"===i?"#FFFFFF":"#53ad53",b=Math.min(l/30,1),f=Math.round(O+(v-O)*b),p=function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),c=r[t]+(r[t+1]<<8);a[e]=c>>n&31}const c=Math.floor(5*(n-1)/8),s=Math.floor(5*(n-1)%8),i=r[c]+(r[c+1]<<8);return a[n-1]=i>>s&31,a}(new Uint8Array(o)),{data:g,peak:j}=function(e,t){let n=0;const a=new Array(t),r=e.length/t,c=e[0],s=e[e.length-1];for(let u=0;u<t;u++){var i,o,l;const t=Math.floor(u*r),d=((null!==(i=e[t-1])&&void 0!==i?i:c)+(null!==(o=e[t])&&void 0!==o?o:c)+(null!==(l=e[t+1])&&void 0!==l?l:s))/3;a[u]=d,n<d&&(n=d)}return{data:a,peak:n}}(p,f),{src:E,width:y,height:N}=function(e,t,{peak:n,fillStyle:a,progressFillStyle:r}){const c=4*e.length,s=document.createElement("canvas");s.width=2*c,s.height=46,s.style.width=c+"px",s.style.height="23px";const i=s.getContext("2d");return i.scale(2,2),e.forEach((c,s)=>{i.globalAlpha=s/e.length>=t?.5:1,i.fillStyle=t>s/e.length?r:a;const o=Math.max(2,c/Math.max(1,n)*23);!function(e,t,n,a,r,c){a<2*c&&(c=a/2);r<2*c&&(c=r/2);e.beginPath(),e.moveTo(t+c,n),e.arcTo(t+a,n,t+a,n-r,c),e.arcTo(t+a,n-r,t,n-r,c),e.arcTo(t,n-r,t,n,c),e.arcTo(t,n,t+a,n,c),e.closePath()}(i,4*s,23,2,o,1),i.fill()}),{src:s.toDataURL(),width:c,height:23}}(g,t,{peak:j,fillStyle:n?d:u,progressFillStyle:n?h:m});return a.a.createElement("img",{src:E,alt:"",width:y,height:N,className:"waveform",draggable:!1,onMouseDown:r,onMouseMove:c,onMouseUp:s})}(A,V,ie,se,e),[A,V,ie,se,e]),le=Object(o.a)("Audio media-inner",C,ie&&!E&&"own",E&&"bigger",M&&"audio-is-selected"),ue=["toggle-play"];Z?ue.push("loading"):Y?ue.push("pause"):Y||ue.push("play");const de=Y||V>0&&V<1,me=Object(o.a)("content",de&&"with-seekline");return a.a.createElement("div",{className:le},T&&a.a.createElement("div",{className:"message-select-control"},M&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement(f.a,{round:!0,ripple:!c.f,size:E?"smaller":"tiny",className:ue.join(" "),ariaLabel:Y?"Pause audio":"Play audio",onClick:te},a.a.createElement("i",{className:"icon-play"}),a.a.createElement("i",{className:"icon-pause"})),Z&&a.a.createElement("div",{className:Object(o.a)("media-loading",ee)},a.a.createElement(p.a,{progress:J,transparent:!0,size:E?"m":"s",onClick:te})),"searchResult"===E&&a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:me},a.a.createElement("div",{className:"content-row"},a.a.createElement("p",{className:"title"},Object(l.a)(function(){if(D)return n||"Voice";const{title:e,fileName:t}=k;return e||t}())),a.a.createElement("div",{className:"message-date"},y&&a.a.createElement(g.a,{className:"date",onClick:ce},Object(s.g)(1e3*y)))),de&&j(V,H,se),!de&&a.a.createElement("p",{className:"duration"},V>0?Object(s.e)(G*V)+" / ":void 0,function(){if(D)return Object(s.e)(A.duration);const{performer:e}=k;return a.a.createElement(a.a.Fragment,null,e&&Object(l.a)(e),e&&n&&a.a.createElement("span",null,"•"),n&&Object(l.a)(n))}()))),"searchResult"!==E&&k&&function(e,t,n,r,c,i,o){const{title:u,performer:d,duration:m,fileName:h}=e,b=t||n>0&&n<1;return a.a.createElement("div",{className:"content"},a.a.createElement("p",{className:"title"},Object(l.a)(u||h)),b&&j(n,r,c),!b&&a.a.createElement("div",{className:"meta"},a.a.createElement("span",{className:"performer"},Object(l.a)(d||"Unknown")),i&&a.a.createElement(a.a.Fragment,null," ","•"," ",a.a.createElement(g.a,{className:"date",onClick:o},Object(s.d)(1e3*i)))),a.a.createElement("p",{className:"duration"},n>0?Object(s.e)(m*n)+" / ":void 0,Object(s.e)(m)))}(k,Y,V,H,se,y,I?ce:void 0),"searchResult"!==E&&A&&function(e,t,n){return a.a.createElement("div",{className:"content"},t,a.a.createElement("p",{className:"voice-duration"},Object(s.e)(e.duration),n&&a.a.createElement("span",null,"•")))}(A,oe,x))}))},function(e,t,n){"use strict";var a=n(0),r=n(143),c=n(38),s=n(128),i=n(93),o=n(8);n(186);var l=Object(a.h)(({className:e,title:t,active:n,badgeCount:r,isBadgeActive:c,previousActiveTab:s,onClick:i,clickArg:l})=>{const u=Object(a.q)(null);return Object(a.o)(()=>{if(!n||void 0===s)return;const e=u.current,t=e.querySelector("i"),a=e.parentElement.children[s].querySelector("i");a.classList.remove("animate"),t.classList.remove("animate");const r=a.parentElement.offsetLeft-t.parentElement.offsetLeft,c=a.clientWidth/t.clientWidth;t.style.transform=`translate3d(${r}px, 0, 0) scale3d(${c}, 1, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.classList.add("animate"),t.style.transform="none"})})})},[n,s]),a.a.createElement("button",{type:"button",className:Object(o.a)("Tab",e,n&&"active"),onClick:()=>i(l),ref:u},a.a.createElement("span",null,t,!!r&&a.a.createElement("span",{className:Object(o.a)("badge",c&&"active")},r),a.a.createElement("i",null)))});n(187);t.a=Object(a.h)(({tabs:e,activeTab:t,onSwitchTab:n})=>{const o=Object(a.q)(null),u=Object(c.a)(t);Object(s.a)(o),Object(a.n)(()=>{const e=o.current;if(e.scrollWidth<=e.offsetWidth)return;const t=e.querySelector(".Tab.active");if(t){const n=t.offsetLeft-e.offsetWidth/2+t.offsetWidth/2;if(Math.abs(n-e.scrollLeft)<16)return;Object(r.a)(e,n)}},[t]);const d=Object(i.a)();return a.a.createElement("div",{className:"TabList no-selection no-scrollbar",ref:o},e.map((e,r)=>a.a.createElement(l,{key:e.title,title:d(e.title),active:r===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:n,clickArg:r})))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const a={CHAT_RESTRICTED:"You can't send messages in this chat, you were restricted",CHAT_WRITE_FORBIDDEN:"You can't write in this chat",CHAT_SEND_POLL_FORBIDDEN:"You can't create polls in this chat",CHAT_SEND_STICKERS_FORBIDDEN:"You can't send stickers in this chat",CHAT_SEND_GIFS_FORBIDDEN:"You can't send gifs in this chat",CHAT_SEND_MEDIA_FORBIDDEN:"You can't send media in this chat",CHAT_LINK_EXISTS:"The chat is public, you can't hide the history to new users",SLOWMODE_WAIT_X:"Slowmode is enabled in this chat: you must wait for the specified number of seconds before sending another message to the chat.",USER_BANNED_IN_CHANNEL:"You're banned from sending messages in supergroups / channels",USER_IS_BLOCKED:"You were blocked by this user",YOU_BLOCKED_USER:"You blocked this user",IMAGE_PROCESS_FAILED:"Failure while processing image",MEDIA_EMPTY:"The provided media object is invalid",MEDIA_INVALID:"Media invalid",PHOTO_EXT_INVALID:"The extension of the photo is invalid",PHOTO_INVALID_DIMENSIONS:"The photo dimensions are invalid",PHOTO_SAVE_FILE_INVALID:"Internal issues, try again later",MESSAGE_DELETE_FORBIDDEN:"You can't delete one of the messages you tried to delete, most likely because it is a service message.",MESSAGE_POLL_CLOSED:"Poll closed",MESSAGE_EDIT_TIME_EXPIRED:"You can't edit this message anymore.",CHAT_ADMIN_REQUIRED:"You must be an admin in this chat to do this",PINNED_DIALOGS_TOO_MUCH:"Sorry, you can only pin 5 chats to the top",DIALOG_FILTERS_TOO_MUCH:"Sorry, you can't have more than 10 folders",CHANNEL_PRIVATE:"This channel is private",MEDIA_CAPTION_TOO_LONG:"The provided caption is too long",ADDRESS_STREET_LINE1_INVALID:"The address you provided is not valid",ADDRESS_STREET_LINE2_INVALID:"The address you provided is not valid",ADDRESS_CITY_INVALID:"The city you provided is not valid",ADDRESS_COUNTRY_INVALID:"The country you provided is not valid",ADDRESS_POSTCODE_INVALID:"The postcode you provided is not valid",ADDRESS_STATE_INVALID:"The state you provided is not valid",REQ_INFO_NAME_INVALID:"The name you provided is not valid",REQ_INFO_PHONE_INVALID:"The phone you provided is not valid",REQ_INFO_EMAIL_INVALID:"The email you provided is not valid",LINK_NOT_MODIFIED:"This discussion is already linked to the channel",SERVICE_WORKER_DISABLED:"Service Worker is disabled. Please reload the page without holding <Shift> key.",CAPTION_TOO_LONG_PLEASE_REMOVE_CHARACTERS:"The provided caption is too long. Please remove {EXTRA_CHARS_COUNT} character{PLURAL_S}.",FRESH_RESET_AUTHORISATION_FORBIDDEN:"You can’t logout other sessions if less than 24 hours have passed since you logged on the current session",BOTS_TOO_MUCH:"There are too many bots in this chat/channel",BOT_GROUPS_BLOCKED:"This bot can't be added to groups",USERS_TOO_MUCH:"The maximum number of users has been exceeded",USER_CHANNELS_TOO_MUCH:"One of the users you tried to add is already in too many channels/supergroups",USER_KICKED:"This user was kicked from this supergroup/channel",USER_NOT_MUTUAL_CONTACT:"The provided user is not a mutual contact",USER_PRIVACY_RESTRICTED:"The user's privacy settings do not allow you to do this"};function r(e){const{message:t,isSlowMode:n,textParams:r}=e;if(n){const e=t.indexOf(" (caused by");return e>0?t.substring(0,e):t}let c=a[t];return c&&r&&(c=Object.keys(r).reduce((e,t)=>e.replace(t,r[t]),c)),c}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return i}));var a=n(1);const r=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const s=e=>{c.value=e,document.body.appendChild(c);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);c.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(c)},i=e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),a=new Image;a.onload=e=>{if(n&&e.currentTarget){const a=e.currentTarget;t.width=a.width,t.height=a.height,n.drawImage(a,0,0,a.width,a.height),t.toBlob(o,"image/png",1)}},a.src=e};async function o(e){if(e&&r)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){a.l&&console.error(e)}}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(4);t.a=({chat:e,privateChatUser:t,handleDelete:n,folderId:s,isPinned:i})=>{const{toggleChatPinned:o,updateChatMutedState:l,toggleChatArchived:u,toggleChatUnread:d}=Object(r.d)();return Object(a.p)(()=>{if(!e)return;const a=t&&t.isSelf,r=e.unreadCount||e.hasUnreadMark?{title:"Mark as Read",icon:"readchats",handler:()=>d({id:e.id})}:{title:"Mark as Unread",icon:"unread",handler:()=>d({id:e.id})},m=i?{title:"Unpin",icon:"unpin",handler:()=>o({id:e.id,folderId:s})}:{title:"Pin",icon:"pin",handler:()=>o({id:e.id,folderId:s})},h=e.isMuted?{title:"Unmute",icon:"unmute",handler:()=>l({chatId:e.id,isMuted:!1})}:{title:"Mute",icon:"mute",handler:()=>l({chatId:e.id,isMuted:!0})},b=Object(c.hb)(e)?{title:"Unarchive",icon:"unarchive",handler:()=>u({id:e.id})}:{title:"Archive",icon:"archive",handler:()=>u({id:e.id})};return[r,m,...a?[]:[h,b],{title:Object(c.lb)(e.id)?"Delete":Object(c.d)(e)?"Delete and Leave":"Leave",icon:"delete",destructive:!0,handler:n}]},[e,t,n,s,i,o,l,u,d])}},function(e,t,n){"use strict";var a=n(0),r=n(28),c=n(161);n(192);t.a=({message:e,outgoingStatus:t})=>a.a.createElement("div",{className:"LastMessageMeta"},t&&a.a.createElement(c.a,{status:t}),a.a.createElement("span",{className:"time"},Object(r.g)(1e3*e.date)))},function(e,t,n){"use strict";var a,r=n(0),c=n(100);n(191);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));t.a=({status:e})=>r.a.createElement("div",{className:"MessageOutgoingStatus"},r.a.createElement(c.a,{name:"reveal",activeKey:a[e]},()=>r.a.createElement("i",{className:"icon-message-"+e})))},function(e,t,n){"use strict";var a=n(0);t.a=(e,t,n,r,c=0,s=0)=>{const[i,o]=Object(a.r)("right"),[l,u]=Object(a.r)("bottom"),[d,m]=Object(a.r)("");return Object(a.n)(()=>{const a=t();if(!e||!a)return;let{x:i,y:l}=e;const d={width:0,left:0,height:0,top:0},h=r(),b=n(),f=a.getBoundingClientRect(),p=h?{width:h.offsetWidth,height:h.offsetHeight}:d,g=b?b.getBoundingClientRect():d;i+p.width+c<g.width+g.left?(o("left"),i+=3):i-p.width>0?(o("right"),i-=3):(o("left"),i=16),l+p.height<g.height+g.top?u("top"):(u("bottom"),l-p.height<g.top+s&&(l=g.top+s+p.height)),m(`left: ${i-f.left}px; top: ${l-f.top}px;`)},[e,c,s,r,n,t]),{positionX:i,positionY:l,style:d}}},function(e,t,n){"use strict";var a=n(0),r=n(27),c=n(38),s=n(8);t.a=({isOpen:e,isCustom:t,id:n,className:i,onClick:o,children:l})=>{const{shouldRender:u,transitionClassNames:d}=Object(r.a)(e,void 0,void 0,!t&&void 0),m=Object(c.a)(e),h=Object(c.a)(l),b=Object(a.q)();return m&&!e&&(b.current=h),u&&a.a.createElement("div",{id:n,className:Object(s.a)(i,d),onClick:o},e?l():b.current())}},function(e,t,n){"use strict";var a=n(0),r=n(165),c=n(52),s=n(148),i=n(106);t.a=(e,t,n,o,l,u=!1,d,m=!1)=>{const h=Object(a.q)(null),[b,f]=Object(a.r)(!1);let p=b;const[g,O]=Object(a.r)(0);Object(i.a)(()=>{h.current=Object(r.a)(e,(e,n)=>{switch(e){case"onPlay":f(!0);break;case"onPause":f(!1);break;case"onTimeUpdate":{const{proxy:e}=h.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;O(e.currentTime/n);break}}o&&o[e]&&o[e](n)},d);const{proxy:n}=h.current;b||n.paused||(f(!0),p=!0),l&&l(n)},[e]);const{play:v,pause:j,setCurrentTime:E,proxy:y,destroy:N}=h.current,C=y.duration&&Number.isFinite(y.duration)?y.duration:t;Object(a.n)(()=>{C&&!Object(s.a)(y)&&O(y.currentTime/C)},[C,g,y]),Object(a.n)(()=>()=>{N(m)},[N,m]),Object(c.a)(([e,t])=>{e===u&&n===t||y.src&&y.paused||u&&n&&!b&&v(n)},[u,n,b,v,y.src,y.paused]);const T=Object(a.m)(()=>{b?j():n&&v(n)},[n,j,v,b]);return{isPlaying:p,playProgress:g,playPause:T,setCurrentTime:E,audioProxy:y,duration:C}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return m}));var a=n(7),r=n(133),c=n(148),s=n(2),i=n(4);const o=new Map;let l,u=[];function d(){const e=l&&o.get(l);e&&e.audio.pause()}function m(e,t,n){o.has(e)||(o.set(e,function(e,t){const n=new Audio;function a(t){return a=>{o.has(e)&&(Object(c.a)(n)||o.get(e).handlers.forEach(e=>{e(t,a)}))}}return n.addEventListener("timeupdate",a("onTimeUpdate")),n.addEventListener("play",a("onPlay")),n.addEventListener("pause",a("onPause")),n.addEventListener("loadstart",a("onLoadStart")),n.addEventListener("loadeddata",a("onLoadedData")),n.addEventListener("playing",a("onPlaying")),n.addEventListener("ended",()=>{if(Object(c.a)(n))return;const t=u[u.indexOf(e)+1];if(!t)return;if(!o.has(t))return void Object(s.d)().openAudioPlayer(Object(i.zb)(t));const a=o.get(t);a.onForcePlay&&a.onForcePlay(),l=t,a.audio.src&&Object(r.a)(a.audio)}),{audio:n,proxy:new Proxy(n,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:t}}(e,n)),u.includes(e)||u.push(e));const{audio:d,proxy:m,handlers:h}=o.get(e);return h.push(t),{play(t){l&&l!==e&&o.get(l).audio.pause(),l=e,d.src||(d.src=t,d.preload="auto",t.includes("/progressive/")&&a.i&&Object(c.b)(d)),Object(r.a)(d)},pause(){l===e&&d.pause()},setCurrentTime(t){l===e&&(d.currentTime=t)},proxy:m,destroy(n=!1){const a=o.get(e);a&&(a.handlers=a.handlers.filter(e=>e!==t),a.handlers.length||(a.audio.pause(),o.delete(e),n&&(u=u.filter(t=>t!==e)),e===l&&(l=void 0)))}}}},function(e,t,n){"use strict";function a(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click()}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";var a=n(0),r=n(27),c=n(102),s=n(8),i=n(28),o=n(54),l=n(103),u=n(35),d=n(113),m=n(110);n(206);t.a=Object(a.h)(({ref:e,name:t,size:n,extension:h="",timestamp:b,sender:f,thumbnailDataUri:p,previewData:g,className:O,smaller:v,isTransferring:j,isUploading:E,isSelectable:y,isSelected:N,transferProgress:C,onClick:T,onDateClick:M})=>{let w=Object(a.q)(null);e&&(w=e);const{shouldRender:L,transitionClassNames:S}=Object(r.a)(j,void 0,!0),I=Object(o.a)(h),k=Object(o.e)(n),{shouldRenderThumb:A,shouldRenderFullMedia:x,transitionClassNames:D}=Object(c.a)(g,"slow"),{width:_,height:R}=Object(l.i)(v),P=Object(s.a)("File",O,v&&"smaller",T&&!E&&"interactive",N&&"file-is-selected");return a.a.createElement("div",{ref:w,className:P},y&&a.a.createElement("div",{className:"message-select-control"},N&&a.a.createElement("i",{className:"icon-select"})),a.a.createElement("div",{className:"file-icon-container",onClick:E?void 0:T},p||g?a.a.createElement("div",{className:"file-preview media-inner"},A&&a.a.createElement("img",{src:p,width:_,height:R,className:"thumbnail",alt:""}),x&&a.a.createElement("img",{src:g,className:"full-media "+D,width:_,height:R,alt:""})):a.a.createElement("div",{className:"file-icon "+I},h.length<=4&&a.a.createElement("span",{className:"file-ext"},h)),L&&a.a.createElement("div",{className:Object(s.a)("file-progress",I,S)},a.a.createElement(d.a,{progress:C,size:v?"s":"m",onClick:E?T:void 0})),T&&a.a.createElement("i",{className:Object(s.a)("icon-download",L&&"hidden")})),a.a.createElement("div",{className:"file-info"},a.a.createElement("div",{className:"file-title"},Object(u.a)(t)),a.a.createElement("div",{className:"file-subtitle"},a.a.createElement("span",null,j&&C?Math.round(100*C)+"%":k),f&&a.a.createElement("span",{className:"file-sender"},Object(u.a)(f)),!f&&b&&a.a.createElement(a.a.Fragment,null," ",a.a.createElement(m.a,{onClick:M},Object(i.d)(1e3*b))))),f&&b&&a.a.createElement(m.a,{onClick:M},Object(i.g)(1e3*b)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function c(e,t,n,c,s,i,o){if(Number.isNaN(i)||i<1)return;i|=0,Number.isNaN(o)&&(o=1),(o|=0)>3&&(o=3),o<1&&(o=1);const l=e.getImageData(t,n,c,s),u=l.data;let d,m,h,b,f,p,g,O,v,j,E,y,N=c-1,C=s-1,T=i+1,M=[],w=[],L=[],S=a[i],I=r[i],k=[],A=[];for(;o-- >0;){for(y=E=0,f=0;f<s;f++){for(d=u[y]*T,m=u[y+1]*T,h=u[y+2]*T,p=1;p<=i;p++)g=y+((p>N?N:p)<<2),d+=u[g++],m+=u[g++],h+=u[g++];for(b=0;b<c;b++)M[E]=d,w[E]=m,L[E]=h,0==f&&(k[b]=((g=b+T)<N?g:N)<<2,A[b]=(g=b-i)>0?g<<2:0),O=y+k[b],v=y+A[b],d+=u[O++]-u[v++],m+=u[O++]-u[v++],h+=u[O++]-u[v++],E++;y+=c<<2}for(b=0;b<c;b++){for(j=b,d=M[j]*T,m=w[j]*T,h=L[j]*T,p=1;p<=i;p++)j+=p>C?0:c,d+=M[j],m+=w[j],h+=L[j];for(E=b<<2,f=0;f<s;f++)u[E]=d*S>>>I,u[E+1]=m*S>>>I,u[E+2]=h*S>>>I,0==b&&(k[f]=((g=f+T)<C?g:C)*c,A[f]=(g=f-i)>0?g*c:0),O=b+k[f],v=b+A[f],d+=M[O]-M[v],m+=w[O]-w[v],h+=L[O]-L[v],E+=c<<2}}e.putImageData(l,t,n)}},function(e,t,n){"use strict";var a=n(0),r=n(1),c=n(27),s=n(8),i=n(42),o=n(114);n(213);t.a=Object(a.h)(({message:e,duration:t=3e3,onDismiss:n})=>{const[l,u]=Object(a.r)(!0),d=Object(a.q)(null),{transitionClassNames:m}=Object(c.a)(l),h=Object(a.m)(()=>{u(!1),setTimeout(n,150+r.c)},[n]);Object(a.n)(()=>l?Object(i.a)(h):void 0,[l,h]),Object(a.n)(()=>(d.current=window.setTimeout(h,t),()=>{d.current&&(clearTimeout(d.current),d.current=void 0)}),[t,h]);const b=Object(a.m)(()=>{d.current&&(clearTimeout(d.current),d.current=void 0)},[]),f=Object(a.m)(()=>{d.current=window.setTimeout(h,t)},[t,h]);return a.a.createElement(o.a,{className:"Notification-container",containerId:"#middle-column-portals"},a.a.createElement("div",{className:Object(s.a)("Notification",m),onClick:h,onMouseEnter:b,onMouseLeave:f},a.a.createElement("div",{className:"content"},e)))})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(1);function r(e){const{commonAncestorContainer:t}=e;let n=t,r=1;for(;n&&n.id!==a.q&&r<5;)n=n.parentElement,r++;return Boolean(n&&n.id===a.q)}},function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(1),s=n(6),i=n(9),o=n(122),l=n(8),u=n(3),d=n(7),m=n(50),h=n(149),b=n(36),f=n(58),p=n(170),g=n(152);const O=d.f?256:416;t.a=Object(a.h)(Object(r.h)(e=>{const{chatId:t,threadId:n}=Object(s.x)(e)||{},{messageSendKeyCombo:a}=e.settings.byKey;return{currentChatId:t,messageSendKeyCombo:a,replyingToId:t&&n?Object(s.hb)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}},(e,t)=>Object(u.l)(t,["editLastMessage"]))(({id:e,editableInputId:t,html:n,placeholder:r,shouldSetFocus:s,shouldSupressFocus:u,onUpdate:v,onSupressedFocus:j,onSend:E,currentChatId:y,replyingToId:N,noTabCapture:C,messageSendKeyCombo:T,editLastMessage:M})=>{const w=Object(a.q)(null),L=Object(a.q)(null),S=Object(a.q)(!1),[I,k,A]=Object(b.a)(),[x,D]=Object(a.r)(),[_,R]=Object(a.r)();Object(h.a)(([e])=>{n!==w.current.innerHTML&&(w.current.innerHTML=n),n!==L.current.innerHTML&&(L.current.innerHTML=n),void 0!==e&&e!==n&&function(){const e=w.current,t=L.current;e.style.height=Math.min(t.scrollHeight,O)+"px",e.classList.toggle("overflown",t.scrollHeight>O),document.body.classList.toggle("hide-mask-shadow",t.scrollHeight>100)}()},[n]);const P=Object(a.m)(()=>{w.current.closest(".from, .to")?setTimeout(P,350):Object(o.a)(w.current)},[]);function F(){if(d.d)return;const e=window.getSelection();if(!e||!e.rangeCount||S.current)return void A();const t=e.getRangeAt(0),n=t.toString().trim();if(!Object(p.a)(t)||!n||Object(f.a)(n)||!t.START_TO_END)return void A();const a=t.getBoundingClientRect(),r=w.current.getBoundingClientRect();let c=a.left+a.width/2-r.left;c<90?c=90:c>r.width-90&&(c=r.width-90),D({x:c,y:a.top-r.top}),R(t),k()}Object(a.n)(()=>{d.k||P()},[y,P,N,s]),Object(a.n)(()=>{if(C)return;const e=Object(i.a)(e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(P))},2e3,!0,!1);return Object(m.a)({onTab:e})},[P,C]),Object(a.n)(()=>{const e=w.current;function t(){e.blur()}return u&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}},[u]);const U=Object(l.a)("form-control custom-scroll",n.length>0&&"touched",u&&"focus-disabled");return a.a.createElement("div",{id:e,onClick:u?j:void 0},a.a.createElement("div",{ref:w,id:t||c.q,className:U,contentEditable:!0,onClick:P,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(v("<br>"===t?"":t),!(d.k||n&&n.length)){const e=window.getSelection();e&&(w.current.blur(),e.removeAllRanges(),Object(o.a)(w.current,!0))}},onKeyDown:function(e){"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||n.length?e.target.addEventListener("keyup",(function t(){F(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),M()):d.d||d.b||!("enter"===T&&!e.shiftKey||"ctrl-enter"===T&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),A(),E())},onMouseDown:function(e){2===e.button?!0!==S.current&&(S.current=!0,document.addEventListener("mousedown",(function e(){setTimeout(()=>{S.current=!1},100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout(()=>{S.current=!1},100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){F(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:function(e){d.b&&(e.preventDefault(),e.stopPropagation())},onTouchCancel:function(){d.b&&F()}}),a.a.createElement("div",{ref:L,className:Object(l.a)(U,"clone")}),a.a.createElement("span",{className:"placeholder-text"},r),a.a.createElement(g.a,{isOpen:I,anchorPosition:x,selectedRange:_,onClose:A}))}))},function(e,t,n){"use strict";var a=n(0),r=n(4),c=n(8),s=n(145),i=n(35),o=n(28),l=n(153),u=n(110);n(232);t.a=Object(a.h)(({message:e,senderTitle:t,onMessageClick:n})=>{let d=Object(r.P)(e);if(!d){const t=Object(r.n)(e);if(t){const{url:n,domain:a}=t,c=Object(r.M)(e);d={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?"mailto:"+n:"http://"+n,description:c!==n?c:void 0}}}const m=Object(a.m)(()=>{n(e.id,e.chatId)},[n,e.id,e.chatId]);if(!d)return;const{siteName:h,url:b,displayUrl:f,title:p,description:g,photo:O}=d,v=!t&&Object(s.a)(g,170),j=Object(c.a)("WebLink scroll-item",!O&&"without-photo");return a.a.createElement("div",{className:j,"data-initial":(h||f)[0]},O&&a.a.createElement(l.a,{message:e}),a.a.createElement("div",{className:"content"},a.a.createElement(u.a,{className:"site-title",onClick:m},Object(i.a)(p||h||f)),v&&a.a.createElement(u.a,{className:"site-description",onClick:m},Object(i.a)(v)),a.a.createElement("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"site-name"},b.replace("mailto:","")||f),t&&a.a.createElement("div",{className:"sender-name"},Object(i.a)(t))),t&&a.a.createElement("div",{className:"message-date"},a.a.createElement(u.a,{className:"date",onClick:m},Object(o.g)(1e3*e.date))))})},,,,function(e,t,n){"use strict";var a=n(0),r=n(2),c=n(5),s=n(1),i=n(7),o=n(38),l=n(3),u=n(4),d=n(6),m=n(118);let h;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(h||(h={}));var b=n(101),f=n(16),p=n(93),g=n(177),O=n(35),v=n(9),j=n(8),E=n(129),y=n(159),N=n(36),C=n(97),T=n(99),M=n(130),w=n(146),L=n(160),S=n(147),I=n(94),k=n(45),A=n(163);n(195);var x=({chat:e,isPinned:t})=>{const n=Boolean(e.unreadCount||e.hasUnreadMark||t),r=Object(j.a)("Badge",e.isMuted&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function c(){return e.unreadCount?e.unreadMentionsCount?a.a.createElement("div",{className:"Badge-wrapper"},a.a.createElement("div",{className:"Badge mention"},a.a.createElement("i",{className:"icon-mention"})),a.a.createElement("div",{className:r},Object(k.b)(e.unreadCount))):a.a.createElement("div",{className:r},Object(k.b)(e.unreadCount)):e.hasUnreadMark?a.a.createElement("div",{className:r}):t?a.a.createElement("div",{className:r},a.a.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.a.createElement(A.a,{isCustom:!0,className:"Badge-transition",isOpen:n},c)};n(196);var D,_=Object(a.h)(Object(r.h)((e,{chatId:t})=>{const n=Object(d.f)(e,t);if(!n||!n.lastMessage)return{};const{senderId:a,replyToMessageId:r,isOutgoing:s}=n.lastMessage,i=a?Object(d.Bb)(e,a):void 0,o=Object(u.t)(n.lastMessage),l=o&&r?Object(d.k)(e,n.id,r):void 0,{targetUserId:m,targetChatId:h}=o||{},b=Object(u.T)(n),{type:f}=Object(d.x)(e)||{};return{chat:n,lastMessageSender:i,...s&&{lastMessageOutgoingStatus:Object(d.ab)(e,n.lastMessage)},...b&&{privateChatUser:Object(d.Bb)(e,b)},...m&&{actionTargetUser:Object(d.Bb)(e,m)},actionTargetChatId:h,actionTargetMessage:l,draft:Object(d.A)(e,t,c.MAIN_THREAD_ID),messageListType:f,animationLevel:e.settings.byKey.animationLevel,lastSyncTime:e.lastSyncTime}},(e,t)=>Object(l.l)(t,["openChat","focusLastMessage"]))(({style:e,chatId:t,folderId:n,orderDiff:r,animationType:c,isSelected:o,isPinned:l,chat:d,privateChatUser:m,actionTargetUser:b,lastMessageSender:f,lastMessageOutgoingStatus:k,actionTargetMessage:A,actionTargetChatId:D,draft:_,messageListType:R,animationLevel:P,lastSyncTime:F,openChat:U,focusLastMessage:B})=>{const q=Object(a.q)(null),[H,$,K]=Object(N.a)(),{lastMessage:Y,typingStatus:V}=d||{},z=Y&&Object(u.db)(Y);Object(E.a)(t,z?Y.replyToMessageId:void 0,A);const W=Y&&!Object(u.L)(Y)?Object(u.E)(Y):void 0,G=Object(C.a)(Y?Object(u.D)(Y,"micro"):void 0);Object(a.o)(()=>{if(0===P)return;const e=q.current;if(c===h.Opacity)e.style.opacity="0",Object(v.b)(()=>{e.classList.add("animate-opacity"),e.style.opacity="1"});else{if(c!==h.Move)return;e.style.transform=`translate3d(0, ${100*-r}%, 0)`,Object(v.b)(()=>{e.classList.add("animate-transform"),e.style.transform=""})}setTimeout(()=>{Object(v.b)(()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""})},200+s.c)},[P,r,c]);const X=Object(a.m)(()=>{U({id:t}),o&&"thread"===R&&B()},[o,R,U,t,B]),Q=Object(y.a)({chat:d,privateChatUser:m,handleDelete:$,folderId:n,isPinned:l}),J=Object(p.a)();if(!d)return;const Z=Object(j.a)("Chat chat-item-clickable",Object(u.lb)(t)?"private":"group",o&&"selected");return a.a.createElement(I.a,{ref:q,className:Z,style:e,ripple:!i.f,contextActions:Q,onClick:X},a.a.createElement(T.a,{chat:d,user:m,withOnlineStatus:!0,isSavedMessages:m&&m.isSelf,lastSyncTime:F}),a.a.createElement("div",{className:"info"},a.a.createElement("div",{className:"title"},a.a.createElement("h3",null,Object(O.a)(Object(u.l)(d,m))),d.isVerified&&a.a.createElement(M.a,null),d.isMuted&&a.a.createElement("i",{className:"icon-muted-chat"}),d.lastMessage&&a.a.createElement(L.a,{message:d.lastMessage,outgoingStatus:k})),a.a.createElement("div",{className:"subtitle"},function(){if(V&&Y&&V.timestamp>1e3*Y.date)return a.a.createElement(w.a,{typingStatus:V});if(_&&_.text.length)return a.a.createElement("p",{className:"last-message"},a.a.createElement("span",{className:"draft"},J("Draft")),Object(O.a)(_.text));if(!Y)return;if(z){const e=d&&(Object(u.jb)(d)||Y.senderId===Y.chatId)?d:f;return a.a.createElement("p",{className:"last-message"},Object(O.a)(Object(g.a)(Y,e,b,A,D,{asPlain:!0})))}const e=Object(u.I)(t,f);return a.a.createElement("p",{className:"last-message"},e&&a.a.createElement("span",{className:"sender-name"},Object(O.a)(e)),function(e,t){if(!t)return Object(O.a)(Object(u.M)(e));return a.a.createElement("span",{className:"media-preview"},a.a.createElement("img",{src:t,alt:""}),Object(u.O)(e)&&a.a.createElement("i",{className:"icon-play"}),Object(O.a)(Object(u.M)(e,!0)))}(Y,G||W))}(),a.a.createElement(x,{chat:d,isPinned:l}))),a.a.createElement(S.a,{isOpen:H,onClose:K,chat:d}))}));!function(e){e.all="active",e.archived="archived"}(D||(D={}));t.a=Object(a.h)(Object(r.h)((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:s},users:{byId:i},lastSyncTime:o}=e,{chatId:l,threadId:u}=Object(d.x)(e)||{},m="folder"!==t?D[t]:void 0,h=n?Object(d.i)(e,n):void 0;return{chatsById:r,usersById:i,currentChatId:l,lastSyncTime:o,...m?{listIds:a[m],orderedPinnedIds:s[m]}:{chatFolder:h},isInDiscussionThread:u!==c.MAIN_THREAD_ID}},(e,t)=>Object(l.l)(t,["loadMoreChats","preloadTopChatMessages"]))(({folderType:e,folderId:t,noChatsText:n="Chat list is empty.",chatFolder:r,chatsById:c,usersById:d,listIds:p,currentChatId:g,orderedPinnedIds:O,lastSyncTime:v,isInDiscussionThread:j,loadMoreChats:E,preloadTopChatMessages:y})=>{const[N,C]=Object(a.p)(()=>"folder"===e&&r?Object(u.Bb)(c,d,r):[p,O],[e,c,d,r,p,O]),[T,M]=Object(a.p)(()=>{if(!N||"folder"===e&&!r)return[];const t=Object(u.Ab)(c,N,C,e),n=[...t.pinnedChats,...t.otherChats],a=n.map(({id:e})=>e);return[n.reduce((e,t,n)=>(e[t.id]=n,e),{}),a]},[N,C,e,r,c]),w=Object(o.a)(T),L=T&&w?Object(l.i)(T,(e,t)=>e-(void 0!==w[t]?w[t]:1/0)):{},S=Object(a.m)(()=>{E({listType:"archived"===e?"archived":"active"})},[E,e]),[I,k]=Object(m.a)(v?S:void 0,M,void 0,s.i,"all"===e&&!s.a),A=I&&Object(u.Ab)(c,I,C,e);Object(a.n)(()=>{v&&"all"===e&&y()},[v,e,y]);const x=function(e){const t=Object(a.m)(t=>e[t]<0,[e]),n=Object(a.m)(t=>e[t]>0,[e]),r=Object.keys(e).map(Number),c=r.filter(t).length,s=r.filter(n).length;return Object(a.m)(a=>{const r=e[a];return 0===r?h.None:r===1/0||r===-1/0||t(a)&&c<=s||n(a)&&s<c?h.Opacity:h.Move},[n,t,s,c,e])}(L);return a.a.createElement(b.a,{className:"chat-list custom-scroll",items:I,onLoadMore:k,preloadBackwards:s.i,noFastList:!0,isDisabled:!0},I&&I.length&&A?function(){const e=M.indexOf(I[0]),n=e+A.pinnedChats.length;return a.a.createElement("div",{className:"scroll-container",style:i.b?`height: ${M.length*s.g}px`:void 0,teactFastList:!0},A.pinnedChats.map(({id:n},r)=>a.a.createElement(_,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,isSelected:n===g&&!j,animationType:x(n),orderDiff:L[n],style:`top: ${(e+r)*s.g}px;`})),A.otherChats.map((e,r)=>a.a.createElement(_,{key:e.id,teactOrderKey:Object(u.j)(e),chatId:e.id,folderId:t,isSelected:e.id===g&&!j,animationType:x(e.id),orderDiff:L[e.id],style:`top: ${(n+r)*s.g}px;`})))}():I&&!I.length?a.a.createElement("div",{className:"no-results"},n):a.a.createElement(f.a,{key:"loading"}))}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var a=n(0),r=n(4),c=n(145),s=n(35),i=n(2),o=n(3),l=n(8),u=n(110);var d=Object(i.h)(void 0,(e,t)=>Object(o.l)(t,["openUserInfo"]))(({className:e,sender:t,openUserInfo:n,children:r})=>{const c=Object(a.m)(()=>{t&&n({id:t.id})},[t,n]);return t?a.a.createElement(u.a,{className:Object(l.a)("UserLink",e),onClick:c},r):r});var m=Object(i.h)(void 0,(e,t)=>Object(o.l)(t,["focusMessage"]))(({className:e,message:t,children:n,focusMessage:r})=>{const c=Object(a.m)(()=>{t&&r({chatId:t.chatId,messageId:t.id})},[r,t]);return t?a.a.createElement(u.a,{className:Object(l.a)("MessageLink",e),onClick:c},n):n});var h=Object(i.h)(void 0,(e,t)=>Object(o.l)(t,["openChat"]))(({className:e,chatId:t,openChat:n,children:r})=>{const c=Object(a.m)(()=>{t&&n({id:t})},[t,n]);return t?a.a.createElement(u.a,{className:Object(l.a)("ChatLink",e),onClick:c},r):r});function b(e,t,n,i,o,l={}){if(!e.content.action)return[];const{text:u}=e.content.action,d=[],b={...l,maxTextLength:16};let g,O=p(u,"%action_origin%",t?!l.isEmbedded&&(v=t,j=l.asPlain,Object(r.fb)(v)?function(e,t){const n=Object(c.a)(Object(r.l)(e));return t?n:a.a.createElement(h,{className:"action-link",chatId:e.id},e&&Object(s.a)(n))}(v,j):f(v,j))||" ":"User");var v,j;return g=O.pop(),d.push(...O),O=p(g,"%target_user%",n?f(n,l.asPlain):"User"),g=O.pop(),d.push(...O),O=p(g,"%message%",i?function(e,t={}){const n=Object(r.M)(e),{photo:i,video:o,document:l,sticker:u}=Object(r.v)(e),d=n&&!i&&!o&&!l&&!u;let h=Object(c.a)(n,t.maxTextLength);i?h="a photo":o?h=o.isGif?"a GIF":"a video":l?h="a document":u&&(h=`«${n}»`);if(t.asPlain)return d?`«${h}»`:h;if(d)return a.a.createElement("span",null,"«",a.a.createElement(m,{className:"action-link",message:e},Object(s.a)(h)),"»");return a.a.createElement(m,{className:"action-link",message:e},Object(s.a)(h))}(i,b):"a message"),g=O.pop(),d.push(...O),O=p(g,"%product%",i?function(e){return e.content&&e.content.invoice?e.content.invoice.title:"a product"}(i):"a product"),g=O.pop(),d.push(...O),O=p(g,"%target_chat%",o?function(e,t){if(t)return"another chat";return a.a.createElement(h,{className:"action-link",chatId:e},"another chat")}(o,l.asPlain):"another chat"),d.push(...O),l.asPlain?d.join("").trim():d}function f(e,t){const n=Object(c.a)(Object(r.Z)(e));return t?n:a.a.createElement(d,{className:"action-link",sender:e},e&&Object(s.a)(n))}function p(e,t,n){const a=e.indexOf(t);if(a<0||!n)return[e];const r=[];return r.push(e.substring(0,a)),r.push(n),r.push(e.substring(a+t.length)),r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var a=n(0),r=n(5),c=n(1),s=n(4),i=n(46);var o=n(7),l=n(122),u=n(36);const d=/[^@_\d\wа-яё]+/i;function m(e,t,n,m=c.q,h,b,f){const[p,g,O]=Object(u.a)(),[v,j]=Object(a.r)(""),[E,y]=Object(a.r)([]),N=Object(a.m)(e=>{if(h&&f)return h.filter(({userId:t})=>{const n=f[t];return!(t===b||!n)&&(!e||function(e,t){const n=t.username.toLowerCase(),a=Object(s.Z)(t),r=a&&a.toLowerCase(),c=e.toLowerCase();return n.startsWith(c)||r&&Object(i.a)(r,c)}(e,n))})},[h,b,f]);Object(a.n)(()=>{if(!e||!t.length)return void O();const n=function(e){const t=document.createElement("div");t.innerHTML=e;const n=t.innerText,a=n[n.length-1],r=n.split(d).pop();if(!n.length||d.test(a)||!r||!r.startsWith("@"))return;return r}(t);if(n){const e=n?n.substr(1):"",t=N(e);t&&t.length?(g(),j(e),y(t)):O()}else O()},[e,t,N,g,O]);const C=Object(a.m)((e,a=!1)=>{if(!e.username&&!Object(s.Y)(e))return;const c=e.username?"@"+e.username:`<a\n class="text-entity-link"\n data-entity-type="${r.ApiMessageEntityTypes.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n >${Object(s.Y)(e)}</a>`,i=t.lastIndexOf("@");if(-1!==i){n(`${t.substr(0,i)}${c} `);const e=document.getElementById(m);o.f||requestAnimationFrame(()=>{Object(l.a)(e,a)})}O()},[t,m,n,O]);return{isMentionMenuOpen:p,mentionFilter:v,closeMentionMenu:O,insertMention:C,mentionFilteredMembers:E}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},,,,function(e,t,n){},function(e,t,n){},function(e,t,n){},,,function(e,t,n){},,function(e,t,n){},function(e,t,n){},,,,,,,,,,,,function(e,t,n){},,,,,,function(e,t,n){},function(e,t,n){},function(e,t,n){}])]); |