mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-13 17:47:39 +01:00
2 lines
240 KiB
JavaScript
2 lines
240 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],Array(95).concat([function(e,t,a){"use strict";a.r(t),a.d(t,"MediaViewer",(function(){return de})),a.d(t,"ForwardPicker",(function(){return fe})),a.d(t,"Errors",(function(){return ye})),a.d(t,"Notifications",(function(){return Ne})),a.d(t,"SafeLinkModal",(function(){return we})),a.d(t,"CalendarModal",(function(){return Le})),a.d(t,"DeleteMessageModal",(function(){return Ae})),a.d(t,"PinMessageModal",(function(){return Te})),a.d(t,"UnpinAllMessagesModal",(function(){return De})),a.d(t,"MessageSelectToolbar",(function(){return Ue})),a.d(t,"LeftSearch",(function(){return yt})),a.d(t,"Settings",(function(){return sn})),a.d(t,"ContactList",(function(){return ln})),a.d(t,"NewChat",(function(){return hn})),a.d(t,"NewChatStep1",(function(){return dn})),a.d(t,"NewChatStep2",(function(){return mn})),a.d(t,"ArchivedChats",(function(){return gn})),a.d(t,"ContextMenuContainer",(function(){return Sn})),a.d(t,"StickerSetModal",(function(){return wn})),a.d(t,"HeaderMenuContainer",(function(){return Mn})),a.d(t,"MobileSearch",(function(){return An})),a.d(t,"AttachmentModal",(function(){return Vn})),a.d(t,"PollModal",(function(){return Wn})),a.d(t,"SymbolMenu",(function(){return Ec})),a.d(t,"AttachMenu",(function(){return Oc})),a.d(t,"MentionTooltip",(function(){return $n})),a.d(t,"StickerTooltip",(function(){return fc})),a.d(t,"BotKeyboardMenu",(function(){return jc})),a.d(t,"CustomSendMenu",(function(){return Cc})),a.d(t,"DropArea",(function(){return yc.b})),a.d(t,"TextFormatter",(function(){return kc.a})),a.d(t,"EmojiTooltip",(function(){return Ic})),a.d(t,"RightSearch",(function(){return wc})),a.d(t,"StickerSearch",(function(){return Lc})),a.d(t,"GifSearch",(function(){return Ac})),a.d(t,"PollResults",(function(){return Dc})),a.d(t,"Management",(function(){return Qc})),a.d(t,"PaymentModal",(function(){return js})),a.d(t,"ReceiptModal",(function(){return ks}));var n=a(0),c=a(2),s=a(5),r=a(19),l=a(1),o=a(7),i=a(109),d=a(6),m=a(4),u=a(3),h=a(126),b=a(44),g=a(171),p=a(35),v=a(101),E=a(114),O=a(185),f=a(41),j=a(45),C=a(140),y=a(52);function k(e,t,a,n){const{mediaEl:c}=P(t,n);if(!c)return;const{width:s}=y.a.get();let o,d=!1;if(n){const{photo:e,video:t,webPage:a}=Object(m.v)(n);d=Boolean(t),o=t?Object(m.ab)(t):Object(m.R)(e||a.photo)}else o=i.a;const{width:u,height:h}=Object(i.j)(e,d),{width:b,height:g}=Object(i.e)(u,h,o.width,o.height),p=(s-b)/2,v=function(e){const t=window.matchMedia(i.b);let a=4.125;e&&(a+=t.matches?.875:3.375);return a*i.c}(e)+(h-g)/2;let{top:E,left:O,width:f,height:j}=c.getBoundingClientRect();if([r.h.SharedMedia,r.h.Album,r.h.ScheduledAlbum,r.h.SearchResult].includes(t)){const e=function(e,t,a,n,c,s){if(e===t){const r=Math.max(c,s)*(e/t);n-=(r-c)/2,a-=(r-s)/2,c=r,s=r}else if(e>t){const a=c;n-=((c=s*(e/t))-a)/2}else if(t>e){const n=s;a-=((s=c*(t/e))-n)/2}return{top:a,left:n,width:c,height:s}}(b,g,E,O,f,j);E=e.top,O=e.left,f=e.width,j=e.height}const C=O+f/2-(p+b/2),k=E+j/2-(v+g/2),N=f/b,S=j/g,F=I(a||c);w(F,{top:v+"px",left:p+"px",width:b+"px",height:g+"px",transform:`translate3d(${C}px, ${k}px, 0) scale(${N}, ${S})`}),M(F,t),document.body.classList.add("ghost-animating"),requestAnimationFrame(()=>{document.body.appendChild(F),requestAnimationFrame(()=>{F.style.transform="",function(e){e.firstChild.style.objectFit="default",e.classList.remove("rounded-corners","circle")}(F),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(F)&&document.body.removeChild(F),document.body.classList.remove("ghost-animating")})},200+l.c)})})}function N(e,t,a){const{container:n,mediaEl:c}=P(e,a);if(!c)return;const s=document.getElementById("MediaViewer").querySelector(".active .media-viewer-content img, .active .media-viewer-content video");if(!s||!c)return;const{top:o,left:i,width:d,height:m}=s.getBoundingClientRect(),{top:u,left:h,width:b,height:g}=c.getBoundingClientRect();let p=u;if(!function(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:a}=y.a.get();return t.top<=a&&t.top+t.height>=0}(n)){const{height:e}=y.a.get();p=u<o?-g:e}const v=i+d/2-(h+b/2),E=o+m/2-(p+g/2);let O=d/b,f=m/g;const j=[r.h.Inline,r.h.ScheduledInline].includes(e)&&!S(n,c)||[r.h.Album,r.h.ScheduledAlbum].includes(e)&&!S(n,c);[r.h.SharedMedia,r.h.Album,r.h.ScheduledAlbum,r.h.SearchResult].includes(e)&&(O>f?O=f:f>O&&(f=O));const C=document.getElementsByClassName("ghost")[0],k=C||I(t||c,e===r.h.ProfileAvatar);C||w(k,{top:p+"px",left:h+"px",width:b+"px",height:g+"px",transform:`translate3d(${v}px, ${E}px, 0) scale(${O}, ${f})`}),requestAnimationFrame(()=>{if(C){const{top:e,left:t,width:a,height:n}=C.getBoundingClientRect();w(k,{transition:"none",top:p+"px",left:h+"px",transformOrigin:"top left",transform:`translate3d(${t-h}px, ${e-p}px, 0) scale(${a/b}, ${n/g})`,width:b+"px",height:g+"px"})}document.body.classList.add("ghost-animating"),C||document.body.appendChild(k),requestAnimationFrame(()=>{C&&(C.style.transition=""),k.style.transform="",j&&(k.style.opacity="0"),M(k,e),setTimeout(()=>{requestAnimationFrame(()=>{document.body.contains(k)&&document.body.removeChild(k),document.body.classList.remove("ghost-animating")})},200+l.c)})})}function I(e,t=!1){const a=document.createElement("div");a.classList.add("ghost");const n=new Image;if("string"==typeof e?n.src=e:e instanceof HTMLVideoElement?n.src=e.poster:n.src=e.src,a.appendChild(n),t){a.classList.add("ProfileInfo");const e=document.querySelector("#RightColumn .ProfileInfo .info");e&&a.appendChild(e.cloneNode(!0))}return a}function S(e,t){const a=document.querySelector(".active > .MessageList");let n=e.offsetTop+t.closest(".content-inner, .WebPage").offsetTop;return e.id.includes("album-media-")&&(n+=e.parentElement.offsetTop+e.closest(".Message").offsetTop),n>a.scrollTop&&n+t.offsetHeight<a.scrollTop+a.offsetHeight}function w(e,t){Object.assign(e.style,t)}function P(e,t){let a,n;switch(e){case r.h.Album:case r.h.ScheduledAlbum:a=".active > .MessageList #album-media-"+t.id,n=".full-media";break;case r.h.SharedMedia:a="#shared-media"+t.id,n="img";break;case r.h.SearchResult:a="#search-media"+t.id,n="img";break;case r.h.MiddleHeaderAvatar:a=".MiddleHeader .ChatInfo .Avatar",n="img.avatar-media";break;case r.h.ProfileAvatar:a="#RightColumn .ProfileInfo .active .ProfilePhoto",n="img.avatar-media";break;case r.h.ScheduledInline:case r.h.Inline:default:a=".active > .MessageList #message"+t.id,n=".message-content .full-media, .message-content .thumbnail"}const c=document.querySelector(a),s=c&&c.querySelectorAll(n);return{container:c,mediaEl:s&&s[s.length-1]}}function M(e,t){switch(t){case r.h.Album:case r.h.ScheduledAlbum:case r.h.Inline:case r.h.ScheduledInline:e.classList.add("rounded-corners");break;case r.h.SharedMedia:case r.h.ProfileAvatar:case r.h.SearchResult:e.firstChild.style.objectFit="cover";break;case r.h.MiddleHeaderAvatar:e.classList.add("circle")}}var F=a(98),L=a(20),A=a(168),T=a(104),D=a(29),B=a(33),x=a(22),R=a(105);a(246);var U=Object(c.h)((e,{chatId:t,messageId:a,isAvatar:n})=>{if(n&&t)return{sender:Object(m.kb)(t)?Object(d.Db)(e,t):Object(d.f)(e,t)};if(!a||!t)return{};const c=Object(d.k)(e,t,a);return{message:c,sender:c&&Object(d.qb)(e,c)}},(e,t)=>Object(u.l)(t,["closeMediaViewer","focusMessage"]))(({chatId:e,messageId:t,sender:a,isAvatar:c,message:s,closeMediaViewer:r,focusMessage:l})=>{const o=Object(n.m)(()=>{r(),l({chatId:e,messageId:t})},[e,l,t,r]),i=Object(F.a)();if(!a||!s&&!c)return;const d=a.id<0,u=Object(m.U)(a);return n.a.createElement("div",{className:"SenderInfo",onClick:o},d?n.a.createElement(R.a,{key:a.id,size:"medium",chat:a}):n.a.createElement(R.a,{key:a.id,size:"medium",user:a}),n.a.createElement("div",{className:"meta"},n.a.createElement("div",{className:"title"},u&&Object(x.a)(u)),n.a.createElement("div",{className:"date"},c?i("lng_mediaview_profile_photo"):Object(B.d)(1e3*s.date))))}),G=a(172),q=a(58),z=a(38),$=a(115);a(247);var H=({mediaData:e,isVideo:t,isZoomed:a,message:c,fileName:s,isAvatar:r,onCloseMediaViewer:l,onForward:i,onZoomToggle:d})=>{const[u,h]=Object(n.r)(!1),b=t&&c?Object(m.D)(c,"download"):void 0,{mediaData:g,downloadProgress:p}=Object(E.a)(b,!u);Object(n.n)(()=>{u&&g&&(Object(G.a)(g,s),h(!1))},[s,g,u]),Object(n.n)(()=>{h(!1)},[b]);const v=Object(n.m)(e=>{e.stopPropagation(),h(e=>!e)},[]),O=Object(F.a)(),f=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:t?"active":void 0,onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]);return o.g?n.a.createElement("div",{className:"MediaViewerActions-mobile"},n.a.createElement(q.a,{trigger:f,positionX:"right"},!r&&n.a.createElement(z.a,{icon:"forward",onClick:i},O("Forward")),t?n.a.createElement(z.a,{icon:u?"close":"download",onClick:v},u?Math.round(100*p)+"% Downloading...":"Download"):n.a.createElement(z.a,{icon:"download",href:e,download:s},O("AccActionDownload"))),u&&n.a.createElement($.a,{progress:p,size:"s",noCross:!0})):n.a.createElement("div",{className:"MediaViewerActions"},!r&&n.a.createElement(n.a.Fragment,null,n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:O("Forward"),onClick:i},n.a.createElement("i",{className:"icon-forward"}))),t?n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:O("AccActionDownload"),onClick:v},u?n.a.createElement($.a,{progress:p,size:"s",onClick:v}):n.a.createElement("i",{className:"icon-download"})):n.a.createElement(D.a,{href:e,download:s,round:!0,size:"smaller",color:"translucent-white",ariaLabel:O("AccActionDownload")},n.a.createElement("i",{className:"icon-download"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:a?"Zoom Out":"Zoom In",onClick:d},n.a.createElement("i",{className:a?"icon-zoom-out":"icon-zoom-in"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent-white",ariaLabel:O("Close"),onClick:l},n.a.createElement("i",{className:"icon-close"})))},V=a(9);a(248);var _=({text:e="",isHideable:t,onClick:a})=>{const[c,s]=Object(n.r)(!1);return Object(n.n)(()=>{const e=document.querySelector(".MediaViewerFooter .media-text"),t=()=>{const t=e?e.clientHeight:0;s(t>2*i.c)};t();const a=Object(V.g)(t,500,!0);return window.addEventListener("resize",a,!1),()=>{window.removeEventListener("resize",a,!1)}},[]),n.a.createElement("div",{className:"MediaViewerFooter "+(t?"hideable":""),onClick:function(t){e&&t.stopPropagation()}},e&&n.a.createElement("div",{className:"media-viewer-footer-content",onClick:a},n.a.createElement("p",{className:"media-text custom-scroll "+(c?"multiline":"")},e)))},W=a(32),Y=a(131);const K=function(){if(void 0!==document.fullscreenElement)return"fullscreenElement";if(void 0!==document.mozFullScreenElement)return"mozFullScreenElement";if(void 0!==document.webkitFullscreenElement)return"webkitFullscreenElement";return""}();var Q=a(141),Z=a(130);const X=["bytes","kB","MB","GB","TB","PB"];var J=e=>{const t=0===e?0:Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**Math.floor(t)).toFixed(1)} ${X[t]}`};a(249);const ee=e=>{e.stopPropagation()};var te=({bufferedProgress:e,currentTime:t,duration:a,fileSize:c,isForceVisible:s,isForceMobileVersion:r,isPlayed:l,isFullscreenSupported:i,isFullscreen:d,onChangeFullscreen:m,onPlayPause:u,onSeek:h})=>{const[b,g]=Object(n.r)(!0);Object(n.n)(()=>{s&&g(s)},[s]),Object(n.n)(()=>{let e;return s||(o.g?g(!1):e=window.setTimeout(()=>{g(!1)},800)),()=>{e&&window.clearTimeout(e)}},[s]),Object(n.n)(()=>((b||s)&&document.body.classList.add("video-controls-visible"),()=>{document.body.classList.remove("video-controls-visible")}),[s,b]);const p=Object(F.a)();var v,E;if(b||s)return n.a.createElement("div",{className:"VideoPlayerControls "+(r?"mobile":""),onClick:ee},function(e,t,a,c){const s=e/t*100,r=100*a;return n.a.createElement("div",{className:"player-seekline"},n.a.createElement("div",{className:"player-seekline-track"},n.a.createElement("div",{className:"player-seekline-buffered",style:`width: ${r||0}%`}),n.a.createElement("div",{className:"player-seekline-played",style:`width: ${s||0}%`}),n.a.createElement("input",{min:"0",max:"100",step:.01,type:"range",onInput:c,className:"player-seekline-input",value:s||0})))}(t,a,e,h),n.a.createElement(D.a,{ariaLabel:p("AccActionPlay"),size:"tiny",ripple:!o.g,color:"translucent-white",className:"play",onClick:u},n.a.createElement("i",{className:l?"icon-pause":"icon-play"})),function(e,t){return n.a.createElement("div",{className:"player-time"},`${Object(B.e)(e)} / ${Object(B.e)(t)}`)}(t,a),e<1&&(v=e,E=c,n.a.createElement("div",{className:"player-file-size"},`${J(E*v)} / ${J(E)}`)),i&&n.a.createElement(D.a,{ariaLabel:"Fullscreen",size:"tiny",color:"translucent-white",className:"fullscreen",onClick:m},n.a.createElement("i",{className:""+(d?"icon-smallscreen":"icon-fullscreen")})))};a(250);function ae(){return(ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}var ne=Object(n.h)(({url:e,isGif:t,posterData:a,posterSize:c,downloadProgress:s,fileSize:r,isMediaViewerOpen:l,noPlay:i,onClose:d})=>{const m=Object(n.q)(null),[u,h]=Object(n.r)(!o.l||!o.e),[b,g]=Object(n.r)(0),[p,v]=Object(n.r)(!0),[E,O,f]=function(e,t){const[a,c]=Object(n.r)(Boolean(K&&document[K]));return Object(n.o)(()=>{const a=()=>{c(Boolean(K&&document[K]))},n=()=>{c(!0)},s=()=>{c(!1),t(!1)},r=e.current;return document.addEventListener("fullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),r&&(r.addEventListener("webkitbeginfullscreen",n,!1),r.addEventListener("webkitendfullscreen",s,!1)),()=>{document.removeEventListener("fullscreenchange",a,!1),document.removeEventListener("webkitfullscreenchange",a,!1),document.removeEventListener("mozfullscreenchange",a,!1),r&&(r.removeEventListener("webkitbeginfullscreen",n,!1),r.removeEventListener("webkitendfullscreen",s,!1))}},[]),K||"iOS"===o.o?[a,()=>{e.current&&(K||"iOS"===o.o)&&(e.current.requestFullscreen?e.current.requestFullscreen():e.current.webkitRequestFullscreen?e.current.webkitRequestFullscreen():e.current.webkitEnterFullscreen?e.current.webkitEnterFullscreen():e.current.mozRequestFullScreen&&e.current.mozRequestFullScreen(),c(!0))},()=>{e.current&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),c(!1))}]:[!1]}(m,h),{isBuffered:j,bufferedProgress:C,bufferingHandlers:y}=Object(Y.a)(),{shouldRender:k,transitionClassNames:N}=Object(W.a)(!j,void 0,void 0,"slow");Object(n.n)(()=>{i||!l?m.current.pause():e&&!o.l&&Object(Z.a)(m.current)},[i,l,e]),Object(n.n)(()=>{m.current.currentTime===m.current.duration?(g(0),h(!1)):g(m.current.currentTime)},[b]);const I=Object(n.m)(e=>{e.stopPropagation(),u?(m.current.pause(),h(!1)):(m.current.play(),h(!0))},[u]);Object(Q.a)(m,[]);const S=Object(n.m)(()=>{v(!0)},[]),w=Object(n.m)(()=>{v(!1)},[]),P=Object(n.m)(e=>{g(e.currentTarget.currentTime)},[]),M=Object(n.m)(()=>{g(0),h(!1)},[]),F=Object(n.m)(()=>{E&&f?f():!E&&O&&O()},[f,E,O]),L=Object(n.m)(e=>{e.stopPropagation(),m.current.currentTime=Number(e.target.value)*m.current.duration/100},[]),A=Object(n.m)(e=>{e.stopPropagation(),v(!p)},[p]);Object(n.n)(()=>{const e=e=>{"Enter"!==e.key&&" "!==e.key||I(e)};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}},[I]);const T=c&&`width: ${c.width}px; height: ${c.height}px`,D=`background-image: url(${a})`;return n.a.createElement("div",{className:"VideoPlayer",onClick:!t&&o.g?A:void 0,onMouseOver:t?void 0:S,onMouseOut:t?void 0:w},n.a.createElement("div",{style:T},n.a.createElement("video",ae({ref:m,autoPlay:o.l,playsInline:!0,loop:t,muted:t,id:"media-viewer-video",style:D,onEnded:M},y,{onTimeUpdate:P}),e&&n.a.createElement("source",{src:e}))),k&&n.a.createElement("div",{className:["spinner-container",N].join(" ")},!j&&n.a.createElement("div",{className:"buffering"},"Buffering..."),n.a.createElement($.a,{size:"xl",progress:j?1:s,square:!0,onClick:d})),!t&&!k&&n.a.createElement(te,{isPlayed:u,bufferedProgress:C,currentTime:b,isFullscreenSupported:Boolean(O),isFullscreen:E,fileSize:r,duration:m.current?m.current.duration:0,isForceVisible:!u||p,isForceMobileVersion:c&&c.width<400,onSeek:L,onChangeFullscreen:F,onPlayPause:I}))}),ce=a(8);a(251);var se=Object(n.h)(({isShown:e,onChangeZoom:t})=>{const{transitionClassNames:a}=Object(W.a)(e),c=Object(f.a)(e),s=Object(n.q)(null),[r,l]=Object(n.r)(1),i=Object(n.q)(!1);Object(n.n)(()=>{e&&!c&&l(1.5)},[e,c]);const d=Object(n.m)(()=>{i.current=!0},[]),m=Object(n.m)(()=>{i.current=!1,1===r&&t(r,!i.current)},[t,r]);Object(n.n)(()=>{t(r,!i.current)},[r,t]);const u=Object(F.a)(),h=Object(ce.a)("ZoomControls",a);return n.a.createElement("div",{className:h},n.a.createElement(D.a,{disabled:1===r,size:"tiny",color:"translucent-white",ariaLabel:u("ZoomOut"),className:"zoom-out",ripple:!o.g,onClick:()=>{s.current&&l(Math.max(1,r-.5))}},n.a.createElement("i",{className:"icon-zoom-out"})),n.a.createElement(D.a,{disabled:3===r,size:"tiny",color:"translucent-white",ariaLabel:"Zoom In",className:"zoom-in",ripple:!o.g,onClick:()=>{s.current&&l(Math.min(3,r+.5))}},n.a.createElement("i",{className:"icon-zoom-in"})),n.a.createElement("div",{className:"seekline"},n.a.createElement("div",{className:"seekline-track"},n.a.createElement("div",{className:"seekline-played",style:`width: ${50*(r-1)}%`}),n.a.createElement("input",{ref:s,min:1,max:3,step:"0.5",value:r,type:"range",className:"seekline-input",onChange:e=>{l(Math.min(3,Math.max(Number(e.target.value),1)))},onMouseDown:d,onMouseUp:m}))))});a(252);const re=[1,0,0,1,0,0],le={1:1,1.5:1.5,2:2.2,2.5:3.3,3:5.5};var oe=Object(n.h)(({children:e,className:t,noWrap:a,canPan:c,zoomLevel:s,panDeltaX:r,panDeltaY:l,onPan:o})=>{const i=le[s]||s,[d,m]=Object(n.r)(!1),[h,b]=Object(n.r)({dx:r,dy:l,x:0,y:0}),[g,p]=Object(n.r)(re),v=Object(n.q)(null),E=Object(n.q)(null);Object(n.n)(()=>{const e=i||g[0],t=r||g[4],a=l||g[5],n=[...g];g[0]!==e&&(n[0]=e||n[0],n[3]=e||n[3]),g[4]!==t&&(n[4]=t),g[5]!==a&&(n[5]=a),Object(u.a)(g,n)||p(function(e,t,a){const n=a&&a.querySelector(".active img");if(!a||!n)return t;const c=a.getBoundingClientRect(),s=n.getBoundingClientRect(),r=s.width/e*t[0],l=s.height/e*t[3],o=(c.width-r)/2+t[4],i=(c.height-l)/2+t[5];return c.width&&c.width-150<o?t[4]-=o+c.width-150:r&&r+o<150&&(t[4]-=r+o-150),c.height&&c.height-150<i?t[5]-=i+c.height-150:l&&l+i<150&&(t[5]-=l+i-150),t}(g[0],n,v.current))},[r,l,i]),Object(n.n)(()=>{c||p(re)},[c]),Object(n.n)(()=>{E.current&&(E.current.style.transform=`matrix(${g.toString()})`)},[a,g]);return a?e:n.a.createElement("div",{ref:v,className:"pan-wrapper "+(t||""),onMouseDown:e=>{if(!c)return;e.stopPropagation(),e.preventDefault();const t={dx:g[4],dy:g[5],x:e.pageX,y:e.pageY};b(t),m(!0),v.current&&v.current.classList.add("move")},onMouseUp:()=>{m(!1),v.current&&v.current.classList.remove("move"),o&&o(g[4],g[5])},onMouseMove:e=>{if(d){const t=function(e,t){const a=[...g],n=h.x-e,c=h.y-t;return a[4]=h.dx-n,a[5]=h.dy-c,a}(e.pageX,e.pageY);p(t),E.current&&(E.current.style.transform=`matrix(${g.toString()})`)}}},n.a.createElement("div",{ref:E,className:"pan-container"},e))});a(253);function ie(e,t,a){return e?n.a.createElement("img",{src:e,alt:"",style:t?`width: ${t.width}px`:"",draggable:Boolean(a)}):n.a.createElement("div",{className:"spinner-wrapper",style:t?`width: ${t.width}px`:""},n.a.createElement(L.a,{color:"white"}))}var de=Object(n.h)(Object(c.h)(e=>{const{chatId:t,threadId:a,messageId:n,avatarOwnerId:c,profilePhotoIndex:s,origin:l}=e.mediaViewer,{animationLevel:o}=e.settings.byKey;if(l===r.h.SearchResult){if(!t||!n)return{animationLevel:o};const a=Object(d.k)(e,t,n);return a?{chatId:t,messageId:n,senderId:a.senderId,origin:l,message:a,animationLevel:o}:{animationLevel:o}}if(c){return{messageId:-1,senderId:c,avatarOwner:Object(d.Db)(e,c)||Object(d.f)(e,c),profilePhotoIndex:s||0,animationLevel:o,origin:l}}if(!(t&&a&&n))return{animationLevel:o};let i,m,u;if(i=l&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(l)?Object(d.mb)(e,t,n):Object(d.k)(e,t,n),!i)return{animationLevel:o};if(m=l&&[r.h.ScheduledAlbum,r.h.ScheduledInline].includes(l)?Object(d.nb)(e,t):Object(d.m)(e,t),l===r.h.Inline||l===r.h.Album)u=Object(d.db)(e,t,a)||Object(d.X)(e,t,a);else if(l===r.h.SharedMedia){const t=Object(d.v)(e),{foundIds:a}=t&&t.resultsByType&&t.resultsByType.media||{};u=a}return{chatId:t,threadId:a,messageId:n,senderId:i.senderId,origin:l,message:i,chatMessages:m,collectionIds:u,animationLevel:o}},(e,t)=>Object(u.l)(t,["openMediaViewer","closeMediaViewer","openForwardMenu","focusMessage"]))(({chatId:e,threadId:t,messageId:a,senderId:c,origin:d,avatarOwner:u,profilePhotoIndex:y,message:I,chatMessages:S,collectionIds:w,openMediaViewer:P,closeMediaViewer:M,openForwardMenu:L,focusMessage:B,animationLevel:x})=>{const R=Object(n.q)(null),G=Boolean(u||a),q=I?Object(m.Q)(I):void 0,z=I?Object(m.G)(I):void 0,$=I?Object(m.O)(I):void 0,V=Boolean(q),W=Boolean(z||q),Y=Boolean($),K=$?$.isGif:void 0,Q=d===r.h.SharedMedia,Z=d===r.h.SearchResult,X=x>=1?"mv-slide":"none",J=2===x?"slide-fade":"none",ee=2===x,te=u?`avatar${u.id}-${y}.jpg`:I&&Object(m.B)(I),ae=Object(f.a)(c),[ce,re]=Object(n.r)(!1),[le,de]=Object(n.r)(!1),[me,ue]=Object(n.r)(1),[he,be]=Object(n.r)({x:0,y:0}),ge=Object(n.p)(()=>V&&a?[a]:Object(m.i)(S||{},w||[],Q),[V,a,S,w,Q]),pe=a?ge.indexOf(a):-1,ve=0===pe||-1===pe,Ee=pe===ge.length-1||-1===pe;function Oe(e){if(u&&void 0!==y){const{photos:t}=u;return t&&t[y]?`photo${t[y].id}?size=c`:Object(m.f)(u,e?"big":"normal")}return I&&Object(m.D)(I,e?"viewerFull":"viewerPreview")}!G||ae&&ae===c&&R.current||(R.current=pe);const fe=Object(v.a)(I&&(Q||Z)&&Object(m.D)(I,"pictogram"),void 0,s.ApiMediaFormat.BlobUrl,void 0,ee&&350),je=Oe(),Ce=Object(v.a)(je,void 0,u&&je&&je.startsWith("profilePhoto")?s.ApiMediaFormat.DataUri:s.ApiMediaFormat.BlobUrl,void 0,ee&&350),{mediaData:ye,downloadProgress:ke}=Object(E.a)(Oe(!0),void 0,I&&Object(m.C)(I,"viewerFull"),void 0,ee&&350),Ne=z||$?(z||$).blobUrl:void 0;let Ie=!Y&&(Ne||ye)||Ce||fe;const Se=Object(O.a)(!Ie&&I&&Object(m.E)(I));Ie||d===r.h.SearchResult||(Ie=Se);const we=W?Object(m.R)(V?Object(m.Q)(I):Object(m.G)(I)):void 0,Pe=Y?Object(m.ab)(Object(m.O)(I)):void 0;Object(n.n)(()=>{o.g&&document.body.classList.toggle("is-media-viewer-open",G)},[G]);const Me=Object(p.a)();Object(n.n)(()=>{const e=window.matchMedia(i.b);return"function"==typeof e.addEventListener?e.addEventListener("change",Me):"function"==typeof e.addListener&&e.addListener(Me),()=>{"function"==typeof e.removeEventListener?e.removeEventListener("change",Me):"function"==typeof e.removeListener&&e.removeListener(Me)}},[Me]);const Fe=Object(f.a)(I),Le=Object(f.a)(d),Ae=Object(f.a)(u),Te=Object(f.a)(Ie);Object(n.n)(()=>{if(ee&&G&&!Fe&&!Ae){Object(j.b)(350+l.c);const e=I?Object(C.a)(I):void 0;k(Boolean(e),d,Ie,I)}ee&&!G&&(Fe||Ae)&&(Object(j.b)(350+l.c),N(Le,Te,Fe||void 0))},[ee,G,d,Le,I,Fe,Ae,Ie,Te]),Object(n.n)(()=>{let e;return le?re(!0):e=window.setTimeout(()=>{re(!1)},350),()=>{e&&window.clearTimeout(e)}},[le]);const De=()=>{de(!1),ue(1),be({x:0,y:0})},Be=Object(n.m)(()=>{de(!le),ue(le?1:1.5),le&&be({x:0,y:0})},[le]),xe=Object(n.m)((e,t=!1)=>{ue(e),1===e&&t&&De()},[]),Re=Object(n.m)(()=>{M(),De()},[M]),Ue=Object(n.m)(()=>{Re(),B({chatId:e,threadId:t,messageId:a})},[Re,e,t,B,a]),Ge=Object(n.m)(()=>{L({fromChatId:e,messageIds:[a]}),De()},[L,e,a]);Object(n.n)(()=>G?Object(b.a)(()=>{le?De():Re()}):void 0,[Re,G,le]),Object(n.n)(()=>{Y&&!K&&Object(g.b)()},[K,Y]);const qe=Object(n.m)((e,t)=>{let a=ge.indexOf(e);return(-1===t&&a>0||1===t&&a<ge.length-1)&&(a+=t),ge[a]},[ge]),ze=Object(n.m)(()=>{ve||P({chatId:e,threadId:t,messageId:a?qe(a,-1):void 0,origin:d})},[e,t,qe,ve,a,P,d]),$e=Object(n.m)(()=>{Ee||P({chatId:e,threadId:t,messageId:a?qe(a,1):void 0,origin:d})},[e,t,qe,Ee,a,P,d]);Object(n.n)(()=>{const e=e=>{switch(e.key){case"Left":case"ArrowLeft":ze();break;case"Right":case"ArrowRight":$e()}};return document.addEventListener("keydown",e,!1),()=>{document.removeEventListener("keydown",e,!1)}}),Object(n.n)(()=>{const e=document.querySelector(".slide-container > .active, .slide-container > .to");if(!e)return;const t=K&&!o.e;return Object(h.b)(e,{excludedClosestSelector:".backdrop, .navigation, .media-viewer-head, .media-viewer-footer"+(t?"":", .VideoPlayer"),onClick:()=>{le||Re()},onSwipe:o.l?(e,t)=>{t===h.a.Right?ze():t===h.a.Left?$e():Re()}:void 0})},[Re,K,le,$e,ze,ce]);const He=Object(n.m)((e,t)=>{be({x:e,y:t})},[]),Ve=Object(F.a)();function _e(t){if(u)return n.a.createElement("div",{key:e,className:"media-viewer-content"},ie(ye||Ce,Object(i.g)(i.a,!1),!o.g&&!le));if(I){const e=Object(C.a)(I),c=Boolean(e);return n.a.createElement("div",{key:a,className:"media-viewer-content "+(c?"has-footer":"")},W&&ie(Ne||ye||Ce||fe,I&&Object(i.g)(we,c),!o.g&&!le),Y&&n.a.createElement(ne,{key:a,url:Ne||ye,isGif:K,posterData:Ie,posterSize:I&&Object(i.g)(Pe,c,!0),downloadProgress:ke,fileSize:$.size,isMediaViewerOpen:G,noPlay:!t,onClose:Re}),e&&n.a.createElement(_,{text:e,onClick:Ue,isHideable:Y}))}}function We(){return n.a.createElement(U,{key:u?u.id:a,chatId:u?u.id:e,messageId:a,isAvatar:Boolean(u)})}return n.a.createElement(A.a,{id:"MediaViewer",className:le?"zoomed":"",isOpen:G},()=>n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"media-viewer-head"},o.g&&n.a.createElement(D.a,{className:"media-viewer-close",round:!0,size:"smaller",color:"translucent-white",ariaLabel:Ve("Close"),onClick:Re},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(T.a,{activeKey:R.current,name:J},We),n.a.createElement(H,{mediaData:ye||Ce,isVideo:Y,isZoomed:le,message:I,fileName:te,onCloseMediaViewer:Re,onForward:Ge,onZoomToggle:Be,isAvatar:Boolean(u)})),n.a.createElement(oe,{noWrap:!ce,canPan:le,panDeltaX:he.x,panDeltaY:he.y,zoomLevel:me,onPan:He},n.a.createElement(T.a,{className:"slide-container",activeKey:pe,name:X},_e)),!ve&&n.a.createElement("button",{type:"button",className:"navigation prev "+(Y&&!K&&"inline"),"aria-label":Ve("AccDescrPrevious"),onClick:ze}),!Ee&&n.a.createElement("button",{type:"button",className:"navigation next "+(Y&&!K&&"inline"),"aria-label":Ve("Next"),onClick:$e}),n.a.createElement(se,{isShown:le,onChangeZoom:xe})))})),me=a(48),ue=a(121),he=a(16),be=a(103),ge=a(42),pe=a(106),ve=a(99),Ee=a(102),Oe=a(117);a(254);var fe=Object(n.h)(Object(c.h)(e=>{const{chats:{byId:t,listIds:a},currentUserId:n}=e;return{chatsById:t,activeListIds:a.active,archivedListIds:a.archived,currentUserId:n}},(e,t)=>Object(u.l)(t,["setForwardChatId","exitForwardMode","loadMoreChats"]))(({chatsById:e,activeListIds:t,archivedListIds:a,currentUserId:c,isOpen:r,setForwardChatId:l,exitForwardMode:i,loadMoreChats:d})=>{const[u,h]=Object(n.r)(""),b=Object(n.q)(null);Object(n.n)(()=>{r?o.g||setTimeout(()=>{requestAnimationFrame(()=>{b.current&&b.current.focus()})},500):(b.current&&b.current.blur(),setTimeout(()=>{h("")},300))},[r]);const g=Object(n.p)(()=>{const n=[...t||[],...a||[]];return Object(m.Bb)([...n.filter(t=>{const a=e[t];return!a||!!Object(m.e)(a,s.MAIN_THREAD_ID)&&(!u||Object(me.a)(Object(m.l)(e[t],void 0,t===c),u))})],e,void 0,c?[c]:void 0)},[t,a,e,c,u]),[p,v]=Object(ue.a)(d,g,Boolean(u)),E=Object(n.m)(e=>{h(e.currentTarget.value)},[]),O=Object(F.a)(),f=n.a.createElement("div",{className:"modal-header"},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:O("Close"),onClick:i},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(ge.a,{ref:b,value:u,onChange:E,placeholder:O("ForwardTo")}));return n.a.createElement(be.a,{isOpen:r,onClose:i,className:"ForwardPicker",header:f},p&&p.length?n.a.createElement(pe.a,{className:"picker-list custom-scroll",items:p,onLoadMore:v,noScrollRestore:Boolean(u)},p.map(e=>n.a.createElement(ve.a,{key:e,className:"chat-item-clickable force-rounded-corners",onClick:()=>l({id:e})},Object(m.kb)(e)?n.a.createElement(Ee.a,{status:e===c?O("SavedMessagesInfo"):void 0,userId:e}):n.a.createElement(Oe.a,{chatId:e})))):p&&!p.length?n.a.createElement("p",{className:"no-results"},"Sorry, nothing found."):n.a.createElement(he.a,null))})),je=a(163);a(255);function Ce(e){return e.isSlowMode?"Slowmode enabled":"Something went wrong"}var ye=Object(n.h)(Object(c.h)(e=>Object(u.l)(e,["errors"]),(e,t)=>Object(u.l)(t,["dismissError"]))(({errors:e,dismissError:t})=>{const a=Object(F.a)();if(e.length)return n.a.createElement("div",{id:"Errors"},e.map(e=>n.a.createElement(be.a,{isOpen:!0,onClose:t,className:"error",title:Ce(e)},n.a.createElement("p",null,Object(je.a)(e)),n.a.createElement(D.a,{isText:!0,onClick:t},a("OK")))))})),ke=a(174);var Ne=Object(n.h)(Object(c.h)(e=>Object(u.l)(e,["notifications"]),(e,t)=>Object(u.l)(t,["dismissNotification"]))(({notifications:e,dismissNotification:t})=>{if(e.length)return n.a.createElement("div",{id:"Notifications"},e.map(({message:e})=>n.a.createElement(ke.a,{message:Object(x.a)(e,["emoji","br","links"]),onDismiss:t})))})),Ie=a(129),Se=a(111);var we=Object(n.h)(Object(c.h)(void 0,(e,t)=>Object(u.l)(t,["toggleSafeLinkModal"]))(({url:e,toggleSafeLinkModal:t})=>{const a=Object(F.a)(),c=Object(n.m)(()=>{window.open(e),t({url:void 0})},[t,e]),s=Object(n.m)(()=>{t({url:void 0})},[t]),r=Object(Ie.a)(e);return n.a.createElement(Se.a,{isOpen:Boolean(e),onClose:s,title:a("OpenUrlTitle"),textParts:Object(x.a)(a("OpenUrlAlert2",r),["links"]),confirmLabel:a("OpenUrlTitle"),confirmHandler:c})}));a(256);const Pe=["M","T","W","T","F","S","S"];function Me(e,t,a,n,c){const s=new Date(e,t,a,0,0,0,0),r=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0),l=c&&new Date(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0,0);return!!(l&&s>l)||!!(r&&s<r)}function Fe(e){return String(e).padStart(2,"0")}var Le=Object(n.h)(({selectedAt:e,maxAt:t,isFutureMode:a,isPastMode:c,isOpen:s,withTimePicker:r,submitButtonLabel:l,secondButtonLabel:i,onClose:d,onSubmit:m,onSecondButtonClick:u})=>{const h=new Date,b=Object(n.p)(()=>e?new Date(e):new Date,[e]),g=t?new Date(t):void 0,[p,v]=Object(n.r)(b),[E,O]=Object(n.r)(Fe(b.getHours())),[f,j]=Object(n.r)(Fe(b.getMinutes())),C=p.getFullYear(),y=p.getMonth(),k=p.getDate();Object(n.n)(()=>{s&&v(b)},[s,b]);const N=c&&C>=h.getFullYear()&&y>=h.getMonth()||g&&C>=g.getFullYear()&&y>=g.getMonth(),I=a&&C<=h.getFullYear()&&y<=h.getMonth(),S=Object(n.p)(()=>function(e,t){const a=[],n=new Date;n.setFullYear(e),n.setMonth(t),n.setDate(1);const c=n.getDay();for(let e=1;e<c;e++)a.push(0);for(;n.getMonth()===t;){const e=n.getDate();a.push(e),n.setDate(e+1)}return a}(C,y),[y,C]);const w=Object(n.m)(e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return O(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),23)),n=new Date(p.getTime());n.setHours(a),v(n);const c=Fe(a);O(c),e.target.value=c},[p]),P=Object(n.m)(e=>{const t=e.target.value.replace(/[^\d]+/g,"");if(!t.length)return j(""),void(e.target.value="");const a=Math.max(0,Math.min(Number(t),59)),n=new Date(p.getTime());n.setMinutes(a),v(n);const c=Fe(a);j(c),e.target.value=c},[p]);return n.a.createElement(be.a,{isOpen:s,onClose:d,className:"CalendarModal"},n.a.createElement("div",{className:"container"},n.a.createElement("div",{className:"month-selector"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:d},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h4",null,Object(B.f)(p,o.g)),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:I,onClick:I?void 0:function(){v(e=>{const t=new Date(e);return t.setMonth(t.getMonth()-1),t})}},n.a.createElement("i",{className:"icon-previous"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",disabled:N,onClick:N?void 0:function(){v(e=>{const t=new Date(e);return t.setMonth(t.getMonth()+1),t})}},n.a.createElement("i",{className:"icon-next"})))),n.a.createElement("div",{className:"calendar-wrapper"},n.a.createElement("div",{className:"calendar-grid"},Pe.map(e=>n.a.createElement("div",{className:"day-button faded weekday"},n.a.createElement("span",null,e))),S.map(e=>n.a.createElement("div",{role:"button",tabIndex:0,onClick:()=>{return t=e,void v(e=>{const a=new Date(e);return a.setDate(t),a});var t},className:Object(ce.a)("day-button",Me(C,y,e,a?h:void 0,c?h:g)?"disabled":""+(e?"clickable":""),e===k&&"selected")},!!e&&n.a.createElement("span",null,e))))),r&&n.a.createElement("div",{className:"timepicker"},n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:E,onChange:w}),":",n.a.createElement("input",{type:"text",className:"form-control",inputMode:"decimal",value:f,onChange:P})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{onClick:function(){m(p)}},r?function(e){const t=Object(B.c)(e,!0);return`Send ${"Today"===t?t:"on "+t} at ${Object(B.h)(e)}`}(p):l),i&&n.a.createElement(D.a,{onClick:u,isText:!0},i)))});var Ae=Object(n.h)(Object(c.h)((e,{message:t,isSchedule:a})=>{const{threadId:n}=Object(d.y)(e)||{},{canDeleteForAll:c}=n&&Object(d.b)(e,t,n)||{},s=Object(d.f)(e,t.chatId);return{canDeleteForAll:!a&&c,contactName:s&&Object(m.kb)(s.id)?Object(m.X)(Object(d.Db)(e,Object(m.T)(s))):void 0,willDeleteForCurrentUserOnly:s&&Object(m.hb)(s)&&!c,willDeleteForAll:s&&Object(m.mb)(s)}},(e,t)=>Object(u.l)(t,["deleteMessages","deleteScheduledMessages"]))(({isOpen:e,isSchedule:t,message:a,album:c,canDeleteForAll:s,contactName:r,willDeleteForCurrentUserOnly:l,willDeleteForAll:o,onClose:i,deleteMessages:d,deleteScheduledMessages:m})=>{const u=Object(n.m)(()=>{const e=c&&c.messages?c.messages.map(({id:e})=>e):[a.id];d({messageIds:e,shouldDeleteForAll:!0}),i()},[d,a.id,i,c]),h=Object(n.m)(()=>{const e=c&&c.messages?c.messages.map(({id:e})=>e):[a.id];t?m({messageIds:e}):d({messageIds:e,shouldDeleteForAll:!1}),i()},[c,a.id,t,i,m,d]),b=Object(F.a)();return n.a.createElement(be.a,{isOpen:e,onClose:i,onEnter:e&&!s?h:void 0,className:"delete",title:b("DeleteSingleMessagesTitle")},n.a.createElement("p",null,b("AreYouSureDeleteSingleMessage")),l&&n.a.createElement("p",null,b("lng_delete_for_me_chat_hint")),o&&n.a.createElement("p",null,b("lng_delete_for_everyone_hint")),s&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},r&&b("Conversation.DeleteMessagesFor",Object(x.a)(r)),!r&&b("Conversation.DeleteMessagesForEveryone")),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},b(s?"ChatList.DeleteForCurrentUser":"Delete")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},b("Cancel")))}));var Te=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(m.kb)(t),n=Object(d.O)(e,t),c=Object(d.f)(e,t),s=!!c&&Object(m.ib)(c),r=!!c&&Object(m.hb)(c),l=!!c&&Object(m.mb)(c);return{isPrivateChat:a,isChatWithSelf:n,isChannel:s,isGroup:r,isSuperGroup:l,canPinForAll:a&&!n||l||r,contactName:c&&Object(m.kb)(c.id)?Object(m.X)(Object(d.Db)(e,Object(m.T)(c))):void 0}},(e,t)=>Object(u.l)(t,["pinMessage"]))(({isOpen:e,messageId:t,chatId:a,isChannel:c,isGroup:s,isSuperGroup:r,canPinForAll:l,contactName:o,onClose:i,pinMessage:d})=>{const m=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1}),i()},[d,a,t,i]),u=Object(n.m)(()=>{d({chatId:a,messageId:t,isUnpin:!1,isOneSide:!0,isSilent:!0}),i()},[a,t,i,d]),h=Object(F.a)();return n.a.createElement(be.a,{isOpen:e,onClose:i,className:"pin",header:n.a.createElement("div",{className:"modal-header"},n.a.createElement("h3",{className:"modal-title"},h("PinMessageAlertTitle")))},c?n.a.createElement("p",null,h("PinMessageAlertChannel")):s||r?n.a.createElement("p",null,h("PinMessageAlert")):n.a.createElement("p",null,h("PinMessageAlertChat")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:u},h("DialogPin")),l&&n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:m},o?"Pin for me and "+o:"Pin and notify all memebers"),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:i},h("Cancel")))}));var De=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=t?Object(d.gb)(e,t):[];return{pinnedMessagesCount:a?a.length:0}})(({isOpen:e,pinnedMessagesCount:t,onClose:a,onUnpin:c})=>{const s=Object(F.a)();return n.a.createElement(be.a,{isOpen:e,onClose:a,className:"unpin-all",header:n.a.createElement("div",{className:"modal-header"},n.a.createElement("h3",{className:"modal-title"},s("UnpinAllMessages")))},n.a.createElement("p",null,"Do you want to unpin all ",t," messages in this chat?"),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:c},s("DialogUnpin")),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:a},s("Cancel")))})),Be=a(31),xe=a(51);var Re=Object(n.h)(Object(c.h)((e,{isSchedule:t})=>{const{messageIds:a}=e.selectedMessages||{},{canDeleteForAll:n}=Object(d.e)(e),c=Object(d.r)(e);return{selectedMessageIds:a,canDeleteForAll:!t&&n,contactName:c&&Object(m.kb)(c.id)?Object(m.X)(Object(d.Db)(e,Object(m.T)(c))):void 0,willDeleteForCurrentUserOnly:c&&Object(m.hb)(c)&&!n,willDeleteForAll:c&&Object(m.mb)(c)}},(e,t)=>Object(u.l)(t,["deleteMessages","deleteScheduledMessages","exitMessageSelectMode"]))(({isOpen:e,isSchedule:t,selectedMessageIds:a,canDeleteForAll:c,contactName:s,willDeleteForCurrentUserOnly:r,willDeleteForAll:l,onClose:o,deleteMessages:i,deleteScheduledMessages:d,exitMessageSelectMode:m})=>{const u=Object(n.m)(()=>{i({messageIds:a,shouldDeleteForAll:!0}),m(),o()},[i,m,a,o]),h=Object(n.m)(()=>{t?d({messageIds:a}):i({messageIds:a,shouldDeleteForAll:!1}),m(),o()},[t,m,o,d,a,i]),b=Object(F.a)();if(a)return n.a.createElement(be.a,{isOpen:e,onClose:o,onEnter:c?void 0:h,className:"delete",title:"Delete Messages?"},n.a.createElement("p",null,b("AreYouSureDeleteFewMessages")),r&&n.a.createElement("p",null,"This will delete them just for you, not for other participants in the chat."),l&&n.a.createElement("p",null,"This will delete them for everyone in this chat."),c&&n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u},"Delete for ",s?"me and ":"Everyone",s&&Object(x.a)(s)),n.a.createElement(D.a,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:h},"Delete",c?" just for me":""),n.a.createElement(D.a,{className:"confirm-dialog-button",isText:!0,onClick:o},b("Cancel")))}));a(257);var Ue=Object(n.h)(Object(c.h)(e=>{const{type:t}=Object(d.y)(e)||{},{canDelete:a}=Object(d.e)(e);return{isSchedule:"scheduled"===t,selectedMessagesCount:Object(d.pb)(e),canDeleteMessages:a}},(e,t)=>Object(u.l)(t,["exitMessageSelectMode","openForwardMenuForSelectedMessages"]))(({canPost:e,isActive:t,messageListType:a,isSchedule:c,selectedMessagesCount:s,canDeleteMessages:r,exitMessageSelectMode:l,openForwardMenuForSelectedMessages:o})=>{const[i,d,m]=Object(Be.a)();Object(n.n)(()=>t&&!i?Object(xe.a)({onBackspace:d,onDelete:d,onEsc:l}):void 0,[t,i,d,l]);const u=Object(f.a)(s||void 0,!0),h=t?s:u,b=Object(F.a)(),g=b("VoiceOver.Chat.MessagesSelected",h),p=Object(ce.a)("MessageSelectToolbar",e&&"with-composer",t&&"shown");return n.a.createElement("div",{className:p},n.a.createElement("div",{className:"MessageSelectToolbar-inner"},n.a.createElement(D.a,{color:"translucent",round:!0,onClick:l,ariaLabel:"Exit select mode"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("span",{className:"MessageSelectToolbar-count",title:g},g),!!s&&n.a.createElement("div",{className:"MessageSelectToolbar-actions"},"scheduled"!==a&&n.a.createElement(z.a,{icon:"forward",ariaLabel:"Forward Messages",onClick:o},n.a.createElement("span",{className:"item-text"},b("Forward"))),n.a.createElement(z.a,{destructive:!0,icon:"delete",onClick:d,disabled:!r,ariaLabel:b("EditAdminGroupDeleteMessages")},n.a.createElement("span",{className:"item-text"},b("Delete"))))),n.a.createElement(Re,{isOpen:i,isSchedule:c,onClose:m}))})),Ge=a(162),qe=a(47),ze=a(164),$e=a(151);var He=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),n=a&&Object(m.T)(a);return{chat:a,privateChatUser:n?Object(d.Db)(e,n):void 0,isPinned:Object(d.M)(e,t)}})(({chatId:e,chat:t,privateChatUser:a,isPinned:c,withUsername:s,onClick:r})=>{const[l,o,i]=Object(Be.a)(),d=Object(ze.a)({chat:t,privateChatUser:a,isPinned:c,handleDelete:o});if(t)return n.a.createElement(ve.a,{className:"chat-item-clickable search-result",onClick:()=>r(e),contextActions:d},Object(m.kb)(e)?n.a.createElement(Ee.a,{userId:e,withUsername:s,avatarSize:"large"}):n.a.createElement(Oe.a,{chatId:e,withUsername:s,avatarSize:"large"}),n.a.createElement($e.a,{isOpen:l,onClose:i,chat:t}))})),Ve=a(137);a(258);const _e=Object(V.g)(e=>e(),6e4,!0);var We=Object(n.h)(Object(c.h)(e=>{const{userIds:t}=e.topPeers,a=e.users.byId,{recentlyFoundChatIds:n}=e.globalSearch;return{topUserIds:t,usersById:a,recentlyFoundChatIds:n}},(e,t)=>Object(u.l)(t,["loadTopUsers","loadContactList","openChat","addRecentlyFoundChatId","clearRecentlyFoundChats"]))(({topUserIds:e,usersById:t,recentlyFoundChatIds:a,onReset:c,loadTopUsers:s,loadContactList:r,openChat:l,addRecentlyFoundChatId:o,clearRecentlyFoundChats:i})=>{const d=Object(n.q)(null);Object(n.n)(()=>{_e(()=>{s(),r()})},[s,r]),Object(Ve.a)(d,!e);const u=Object(n.m)(e=>{l({id:e}),c(),setTimeout(()=>{o({id:e})},250)},[l,o,c]),h=Object(F.a)();return n.a.createElement("div",{className:"RecentContacts custom-scroll"},e&&n.a.createElement("div",{className:"top-peers-section"},n.a.createElement("div",{ref:d,className:"top-peers no-selection"},e.map(e=>n.a.createElement("div",{className:"top-peer-item",onClick:()=>u(e)},n.a.createElement(R.a,{user:t[e]}),n.a.createElement("div",{className:"top-peer-name"},Object(x.a)(Object(m.X)(t[e])||" ")))))),a&&n.a.createElement("div",{className:"search-section pt-1"},n.a.createElement("h3",{className:"section-heading mt-0 recent-chats-header"},h("Recent"),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",ariaLabel:"Clear recent chats",onClick:i},n.a.createElement("i",{className:"icon-close"}))),a.map(e=>n.a.createElement(He,{chatId:e,onClick:u}))))})),Ye=a(127),Ke=a(24);a(259);var Qe=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t);if(!a)return{};const n=Object(m.T)(a);return{chat:a,...n&&{privateChatUser:Object(d.Db)(e,n)},lastSyncTime:e.lastSyncTime}},(e,t)=>Object(u.l)(t,["focusMessage"]))(({message:e,searchQuery:t,chatId:a,chat:c,privateChatUser:s,focusMessage:r,lastSyncTime:l})=>{const i=Object(m.E)(e),d=Object(v.a)(Object(m.D)(e,"micro")),u=Object(n.m)(()=>{r({chatId:a,messageId:e.id})},[a,r,e.id]),h=Object(F.a)();if(c)return n.a.createElement(ve.a,{className:"ChatMessage chat-item-clickable",ripple:!o.g,onClick:u},n.a.createElement(R.a,{chat:c,user:s,withOnlineStatus:!0,isSavedMessages:s&&s.isSelf,lastSyncTime:l}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"info-row"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",null,Object(x.a)(Object(m.l)(c,s))),c.isVerified&&n.a.createElement(Ye.a,null)),n.a.createElement("div",{className:"message-date"},n.a.createElement(Ke.a,{className:"date"},Object(B.g)(1e3*e.date)))),n.a.createElement("div",{className:"subtitle"},n.a.createElement("div",{className:"message"},function(e,t,a,c){if(!a)return Object(x.a)(Object(m.M)(e,t));return n.a.createElement("span",{className:"media-preview"},n.a.createElement("img",{src:a,alt:""}),Object(m.O)(t)&&n.a.createElement("i",{className:"icon-play"}),Object(x.a)(Object(m.M)(e,t,!0),["emoji","highlight"],{highlight:c}))}(h,e,d||i,t)))))}));a(260);var Ze=Object(n.h)(({searchDate:e,onSelect:t})=>{const a=Object(n.p)(()=>function(e){if(e.match(/^\d{2,4}-\d{2}-\d{2}$/g)){const t=new Date(e);return[{date:t,text:Object(B.a)(t)}]}const t=[],a=new Date,n=a.getFullYear(),c=a.getTime()>new Date(`${n}-${e}`).getTime()?n:n-1;for(let a=0;a<8;a++){const n=new Date(`${c-a}-${e}`);t.push({date:n,text:Object(B.a)(n)})}return t}(e),[e]);return n.a.createElement("section",{className:"DateSuggest custom-scroll custom-scroll-x"},a.map(({date:e,text:a})=>n.a.createElement("div",{onClick:()=>t(e),className:"date-item",key:a},n.a.createElement("i",{className:"icon-calendar"}),n.a.createElement("span",null,a))))}),Xe=a(112),Je=a(135),et=a(11);const tt=Object(V.g)(e=>e(),500,!0);var at=Object(n.h)(Object(c.h)(e=>{const{byId:t}=e.chats,{byId:a}=e.users,{userIds:n}=e.contactList||{};if(!n)return{chatsById:t,usersById:a};const{currentUserId:c,messages:s,lastSyncTime:r}=e,{fetchingStatus:l,globalResults:o,localResults:i,resultsByType:d}=e.globalSearch,{chatIds:m,userIds:u}=o||{},{chatIds:h,userIds:b}=i||{},{byChatId:g}=s,{foundIds:p}=d&&d.text||{};return{currentUserId:c,localContactIds:n,localChatIds:h,localUserIds:b,globalChatIds:m,globalUserIds:u,foundIds:p,globalMessagesByChatId:g,chatsById:t,usersById:a,fetchingStatus:l,lastSyncTime:r}},(e,t)=>Object(u.l)(t,["openChat","addRecentlyFoundChatId","searchMessagesGlobal","setGlobalSearchChatId"]))(({searchQuery:e,searchDate:t,dateSearchQuery:a,currentUserId:c,localContactIds:s,localChatIds:l,localUserIds:i,globalChatIds:d,globalUserIds:h,foundIds:b,globalMessagesByChatId:g,chatsById:p,usersById:v,fetchingStatus:E,lastSyncTime:O,onReset:f,onSearchDateSelect:j,openChat:C,addRecentlyFoundChatId:y,searchMessagesGlobal:k,setGlobalSearchChatId:N})=>{const[I,S]=Object(n.r)(!1),[w,P]=Object(n.r)(!1),M=Object(n.m)(({direction:t})=>{O&&t===r.e.Backwards&&tt(()=>{k({type:"text",query:e})})},[O,k,e]),L=Object(n.m)(e=>{C({id:e}),e!==c&&y({id:e}),o.g||f()},[c,C,y,f]),A=Object(n.m)(e=>{N({id:e})},[N]),T=Object(n.p)(()=>{if(!e||e.startsWith("@")&&e.length<2)return qe.a;const t=s?s.filter(t=>{const a=v[t];if(!a)return!1;const n=Object(m.Y)(a);return n&&Object(me.a)(n,e)||Object(me.a)(a.username,e)}):[];return[...c&&Object(me.a)(Object(et.b)("SavedMessages"),e)?[c]:[],...Object(m.Bb)(Object(u.o)([...t,...l||[],...i||[]]),p)]},[e,s,c,l,i,p,v]),D=Object(n.p)(()=>!e||e.length<4||!d||!h?qe.a:Object(m.Bb)(Object(u.o)([...d,...h]),p,!0),[p,d,h,e]),B=Object(n.p)(()=>(e||t)&&b&&0!==b.length?b.map(e=>{const[t,a]=e.split("_").map(Number);return g&&g[t]&&g[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):qe.a,[b,g,e,t]),x=Object(n.m)(()=>{S(!I)},[I]),R=Object(n.m)(()=>{P(!w)},[w]),U=Object(F.a)();const G=E&&!E.chats&&!E.messages&&!T.length&&!D.length&&!B.length;return e||t?n.a.createElement(pe.a,{className:"LeftSearch custom-scroll",items:B,onLoadMore:M,noScrollRestoreOnTop:!0,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(Ze,{searchDate:a,onSelect:j})),G&&n.a.createElement(Xe.a,{text:U("ChatList.Search.NoResults"),description:U("ChatList.Search.NoResultsDescription")}),!!T.length&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},T.map(e=>n.a.createElement(Je.a,{chatOrUserId:e,onClick:A,clickArg:e}))),!!T.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading"},T.length>3&&n.a.createElement(Ke.a,{onClick:x},U(I?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),U("DialogList.SearchSectionDialogs")),T.map((e,t)=>{if(I||!(t>=3))return n.a.createElement(He,{chatId:e,onClick:L})})),!!D.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading"},D.length>3&&n.a.createElement(Ke.a,{onClick:R},U(w?"ChatList.Search.ShowLess":"ChatList.Search.ShowMore")),U("DialogList.SearchSectionGlobal")),D.map((e,t)=>{if(w||!(t>=3))return n.a.createElement(He,{chatId:e,withUsername:!0,onClick:L})})),!!B.length&&n.a.createElement("div",{className:"search-section"},n.a.createElement("h3",{className:"section-heading"},U("SearchMessages")),B.map((function(t){const a=Object(m.M)(U,t),c=p[t.chatId];if(a&&c)return n.a.createElement(Qe,{chatId:t.chatId,message:t,searchQuery:e})})))):n.a.createElement(We,{onReset:f})}));const nt=Object(V.g)(e=>e(),500,!0);var ct=Object(n.h)(Object(c.h)(e=>{const{byId:t}=e.chats,{currentUserId:a,messages:{byChatId:n},lastSyncTime:c}=e,{fetchingStatus:s,resultsByType:r}=e.globalSearch,{foundIds:l}=r&&r.text||{};return{currentUserId:a,foundIds:l,globalMessagesByChatId:n,chatsById:t,fetchingStatus:s,lastSyncTime:c}},(e,t)=>Object(u.l)(t,["searchMessagesGlobal"]))(({searchQuery:e,currentUserId:t,dateSearchQuery:a,foundIds:c,globalMessagesByChatId:s,chatsById:l,fetchingStatus:o,lastSyncTime:i,searchMessagesGlobal:d,onSearchDateSelect:u})=>{const h=Object(F.a)(),b=Object(n.m)(({direction:a})=>{i&&a===r.e.Backwards&&nt(()=>{d({type:"text",query:e,chatId:t})})},[t,i,d,e]),g=Object(n.p)(()=>c&&0!==c.length?c.map(e=>{const[t,a]=e.split("_").map(Number);return s&&s[t]&&s[t].byId[a]}).filter(Boolean).sort((e,t)=>t.date-e.date):qe.a,[c,s]);const p=o&&!o.chats&&!o.messages&&!g.length;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(pe.a,{className:"search-content custom-scroll chat-list",items:g,onLoadMore:b,noFastList:!0},a&&n.a.createElement("div",{className:"chat-selection no-selection no-scrollbar"},n.a.createElement(Ze,{searchDate:a,onSelect:u})),p&&n.a.createElement(Xe.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),!!g.length&&g.map((function(t){const a=Object(m.M)(h,t),c=l[t.chatId];if(a&&c)return n.a.createElement(Qe,{chatId:t.chatId,message:t,searchQuery:e})}))))}));function st(e){return(t,a)=>{const{byId:n}=t.chats,{byId:c}=t.users,{fetchingStatus:s,resultsByType:r,chatId:l}=t.globalSearch,o="audio"!==e?e:a&&a.isVoice?"voice":"audio",{byChatId:i}=t.messages,{foundIds:d}=r&&r[o]||{};return{isLoading:void 0===d||!!s&&Boolean(s.chats||s.messages),chatsById:n,usersById:c,globalMessagesByChatId:i,foundIds:d,searchChatId:l,lastSyncTime:t.lastSyncTime}}}var rt=a(113),lt=a(159);const ot=Object(V.g)(e=>e(),500,!0);var it=Object(n.h)(Object(c.h)(st("media"),(e,t)=>Object(u.l)(t,["searchMessagesGlobal","openMediaViewer"]))(({searchQuery:e,searchChatId:t,isLoading:a,globalMessagesByChatId:c,foundIds:s,lastSyncTime:o,searchMessagesGlobal:i,openMediaViewer:d})=>{const m=Object(F.a)(),u=Object(n.m)(({direction:a})=>{o&&a===r.e.Backwards&&ot(()=>{i({type:"media",query:e,chatId:t})})},[o,i,e,t]),h=Object(n.p)(()=>s&&c?s.map(e=>{const[t,a]=e.split("_").map(Number);return c[t]&&c[t].byId[a]}).filter(Boolean):qe.a,[c,s]),b=Object(n.m)((e,t)=>{d({chatId:t,messageId:e,origin:r.h.SearchResult})},[d]);const g=Object(rt.a)([e],l.mb)&&!a,p=g&&s&&s.length>0&&!e,v=g&&s&&s.length>0&&e,E=Object(ce.a)("search-content custom-scroll",v&&"chat-list");return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(pe.a,{className:E,items:h,itemSelector:e?".ListItem":".Media",onLoadMore:u,noFastList:!0},!g&&n.a.createElement(he.a,null),g&&(!s||0===s.length)&&n.a.createElement(Xe.a,{text:m("ChatList.Search.NoResults"),description:m("ChatList.Search.NoResultsDescription")}),p&&n.a.createElement("div",{className:"media-list"},h.map(e=>n.a.createElement(lt.a,{key:e.id,idPrefix:"search-media",message:e,onClick:b}))),v&&h.map(e=>n.a.createElement(Qe,{key:e.id,chatId:e.chatId,message:e}))))}));function dt(e,t,a){const{senderId:n}=e;if(!n)return;const c=Object(m.kb)(n)?a[n]:t[n];let s=Object(m.U)(c);const r=t[e.chatId];return r&&(Object(m.kb)(n)&&c.isSelf?s="You → "+Object(m.l)(r):Object(m.jb)(r)&&(s+=" → "+Object(m.l)(r))),s}var mt=a(179);const ut=Object(V.g)(e=>e(),500,!0);var ht=Object(n.h)(Object(c.h)(st("links"),(e,t)=>Object(u.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:c,usersById:s,globalMessagesByChatId:o,foundIds:i,lastSyncTime:d,searchMessagesGlobal:m,focusMessage:u})=>{const h=Object(F.a)(),b=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&&ut(()=>{m({type:"links",query:e,chatId:t})})},[d,m,e,t]),g=Object(n.p)(()=>i&&o?i.map(e=>{const[t,a]=e.split("_").map(Number);return o[t]&&o[t].byId[a]}).filter(Boolean):qe.a,[o,i]),p=Object(n.m)((e,t)=>{u({chatId:t,messageId:e})},[u]);const v=Object(rt.a)([e],l.mb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(pe.a,{className:"search-content documents-list custom-scroll",items:g,onLoadMore:b,noFastList:!0},!v&&n.a.createElement(he.a,null),v&&(!i||0===i.length)&&n.a.createElement(Xe.a,{text:h("ChatList.Search.NoResults"),description:h("ChatList.Search.NoResultsDescription")}),v&&i&&i.length>0&&g.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(g[t-1].date);return n.a.createElement("div",{className:"ListItem",key:e.id},a&&n.a.createElement("p",{className:"section-heading"},Object(B.f)(new Date(1e3*e.date))),n.a.createElement(mt.a,{key:e.id,message:e,senderTitle:dt(e,c,s),onMessageClick:p}))})))})),bt=a(154);const gt=Object(V.g)(e=>e(),500,!0);var pt=Object(n.h)(Object(c.h)(st("documents"),(e,t)=>Object(u.l)(t,["searchMessagesGlobal","focusMessage"]))(({searchQuery:e,searchChatId:t,isLoading:a,chatsById:c,usersById:s,globalMessagesByChatId:o,foundIds:i,lastSyncTime:d,searchMessagesGlobal:u,focusMessage:h})=>{const b=Object(F.a)(),g=Object(n.m)(({direction:a})=>{d&&a===r.e.Backwards&>(()=>{u({type:"documents",query:e,chatId:t})})},[d,u,e,t]),p=Object(n.p)(()=>i&&o?i.map(e=>{const[t,a]=e.split("_").map(Number),n=o[t]&&o[t].byId[a];return n&&Object(m.y)(n)?n:void 0}).filter(Boolean):qe.a,[o,i]),v=Object(n.m)((e,t)=>{h({chatId:t,messageId:e})},[h]);const E=Object(rt.a)([e],l.mb)&&!a;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(pe.a,{className:"search-content documents-list custom-scroll",items:p,onLoadMore:g,noFastList:!0},!E&&n.a.createElement(he.a,null),E&&(!i||0===i.length)&&n.a.createElement(Xe.a,{text:b("ChatList.Search.NoResults"),description:b("ChatList.Search.NoResultsDescription")}),E&&i&&i.length>0&&p.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(p[t-1].date);return n.a.createElement("div",{className:"ListItem",key:e.id},a&&n.a.createElement("p",{className:"section-heading"},Object(B.f)(new Date(1e3*e.date))),n.a.createElement(bt.a,{message:e,withDate:!0,datetime:e.date,smaller:!0,sender:dt(e,c,s),className:"scroll-item",onDateClick:v}))})))})),vt=a(161);const Et=Object(V.g)(e=>e(),500,!0);var Ot=Object(n.h)(Object(c.h)(st("audio"),(e,t)=>Object(u.l)(t,["searchMessagesGlobal","focusMessage","openAudioPlayer"]))(({isVoice:e,searchQuery:t,searchChatId:a,isLoading:c,chatsById:s,usersById:o,globalMessagesByChatId:i,foundIds:d,lastSyncTime:m,searchMessagesGlobal:u,focusMessage:h,openAudioPlayer:b})=>{const g=Object(F.a)(),p=e?"voice":"audio",v=Object(n.m)(({direction:e})=>{m&&e===r.e.Backwards&&Et(()=>{u({type:p,query:t,chatId:a})})},[p,m,u,t,a]),E=Object(n.p)(()=>d&&i?d.map(e=>{const[t,a]=e.split("_").map(Number);return i[t]&&i[t].byId[a]}).filter(Boolean):qe.a,[i,d]),O=Object(n.m)((e,t)=>{h({chatId:t,messageId:e})},[h]),f=Object(n.m)((e,t)=>{b({chatId:t,messageId:e})},[b]);const j=Object(rt.a)([t],l.mb)&&!c;return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(pe.a,{className:"search-content documents-list custom-scroll",items:E,onLoadMore:v,noFastList:!0},!j&&n.a.createElement(he.a,null),j&&(!d||0===d.length)&&n.a.createElement(Xe.a,{text:g("ChatList.Search.NoResults"),description:g("ChatList.Search.NoResultsDescription")}),j&&d&&d.length>0&&E.map((e,t)=>{const a=0===t||Object(B.n)(e.date)!==Object(B.n)(E[t-1].date);return n.a.createElement("div",{className:"ListItem",key:e.id},a&&n.a.createElement("p",{className:"section-heading"},Object(B.f)(new Date(1e3*e.date))),n.a.createElement(vt.a,{key:e.id,message:e,renderingFor:"searchResult",senderTitle:dt(e,s,o),date:e.date,lastSyncTime:m,className:"scroll-item",onPlay:f,onDateClick:O}))})))}));a(261);const ft=[{type:r.c.ChatList,title:"SearchAllChatsShort"},{type:r.c.Media,title:"SharedMediaTab2"},{type:r.c.Links,title:"SharedLinksTab2"},{type:r.c.Files,title:"SharedFilesTab2"},{type:r.c.Music,title:"SharedMusicTab2"},{type:r.c.Voice,title:"SharedVoiceTab2"}],jt=[{type:r.c.ChatList,title:"All Messages"},...ft.slice(1)],Ct=Object.keys(r.c).length/2;var yt=Object(n.h)(Object(c.h)(e=>{const{currentContent:t,chatId:a}=e.globalSearch;return{currentContent:t,chatId:a}},(e,t)=>Object(u.l)(t,["setGlobalSearchContent","setGlobalSearchDate"]))(({searchQuery:e,searchDate:t,currentContent:a=r.c.ChatList,chatId:c,setGlobalSearchContent:s,setGlobalSearchDate:l,onReset:o})=>{const[i,d]=Object(n.r)(0),m=Object(n.p)(()=>Object(B.l)(e),[e]),u=Object(n.m)(e=>{const t=ft[e];s({content:t.type}),d(e)},[s]),h=Object(n.m)(e=>{l({date:e.getTime()/1e3})},[l]);return n.a.createElement("div",{className:"LeftSearch"},n.a.createElement(Ge.a,{activeTab:i,tabs:c?jt:ft,onSwitchTab:u}),n.a.createElement(T.a,{name:"slide",renderCount:Ct,activeKey:a},()=>{switch(a){case r.c.ChatList:return c?n.a.createElement(ct,{searchQuery:e,dateSearchQuery:m,onReset:o,onSearchDateSelect:h}):n.a.createElement(at,{searchQuery:e,searchDate:t,dateSearchQuery:m,onReset:o,onSearchDateSelect:h});case r.c.Media:return n.a.createElement(it,{searchQuery:e});case r.c.Links:return n.a.createElement(ht,{searchQuery:e});case r.c.Files:return n.a.createElement(pt,{searchQuery:e});case r.c.Music:return n.a.createElement(Ot,{key:"audio",searchQuery:e});case r.c.Voice:return n.a.createElement(Ot,{key:"voice",isVoice:!0,searchQuery:e});default:return}}))}));function kt(e,t){const a=Object(n.q)(e),[c,s]=Object(n.r)(t);return[c,Object(n.m)(e=>{s(t=>a.current(t,e))},[])]}const Nt=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],It=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],St=["includedChatIds","bots","channels","groups","contacts","nonContacts"],wt=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function Pt(e,t,a){let n=[],c=[];if("included"===t){const{includedChatIds:t,...s}=a?e.includeFilters||{}:Object(u.l)(e.folder,St);n=t||[],c=Object.keys(s).filter(e=>Boolean(s[e]))}else{const{excludedChatIds:t,...s}=a?e.excludeFilters||{}:Object(u.l)(e.folder,wt);n=t||[],c=Object.keys(s).filter(e=>Boolean(s[e]))}return{selectedChatIds:n,selectedChatTypes:c}}function Mt(e){if(e){const{includedChatIds:t,...a}=e;if(Object.values(a).filter(Boolean).length>1||t&&t.length)return"";if(a.bots)return"Bots";if(a.groups)return"Groups";if(a.channels)return"Channels";if(a.contacts)return"Contacts";if(a.nonContacts)return"Non-Contacts"}return""}const Ft={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},Lt=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:Object(u.l)(e.folder,St)};case"editExcludeFilters":return{...e,excludeFilters:Object(u.l)(e.folder,wt)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...Object(u.j)(e.folder,St),title:e.folder.title?e.folder.title:Mt(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...Object(u.j)(e.folder,wt),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:a,...n}=t.payload;return{mode:"edit",folderId:e,folder:n,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return Ft;default:return e}};const At={currentPassword:"",password:"",hint:"",email:""},Tt=(e,t)=>{switch(t.type){case"setCurrentPassword":return{...e,currentPassword:t.payload};case"setPassword":return{...e,password:t.payload};case"setHint":return{...e,hint:t.payload};case"setEmail":return{...e,email:t.payload};case"reset":return At;default:return e}};var Dt=Object(n.h)(Object(c.h)(void 0,(e,t)=>Object(u.l)(t,["signOut","deleteChatFolder"]))(({currentScreen:e,editedFolderId:t,onReset:a,onSaveFilter:c,signOut:s,deleteChatFolder:l})=>{const[i,d]=Object(n.r)(!1),[m,u]=Object(n.r)(!1),h=Object(n.m)(()=>{d(!0)},[]),b=Object(n.m)(()=>{d(!1)},[]),g=Object(n.m)(()=>{u(!0)},[]),p=Object(n.m)(()=>{u(!1)},[]),v=Object(n.m)(()=>{b(),s()},[b,s]),E=Object(n.m)(()=>{p(),l({id:t}),a()},[t,p,l,a]),O=Object(n.p)(()=>({onTrigger:e,isOpen:t})=>n.a.createElement(D.a,{round:!0,ripple:!o.g,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:"More actions"},n.a.createElement("i",{className:"icon-more"})),[]),f=Object(F.a)();return n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:a,ariaLabel:f("AccDescrGoBack")},n.a.createElement("i",{className:"icon-arrow-left"})),function(){switch(e){case r.m.EditProfile:return n.a.createElement("h3",null,f("lng_settings_information"));case r.m.General:return n.a.createElement("h3",null,f("General"));case r.m.Notifications:return n.a.createElement("h3",null,f("Notifications"));case r.m.Privacy:return n.a.createElement("h3",null,f("PrivacySettings"));case r.m.Language:return n.a.createElement("h3",null,f("Language"));case r.m.GeneralChatBackground:return n.a.createElement("h3",null,f("ChatBackground"));case r.m.GeneralChatBackgroundColor:return n.a.createElement("h3",null,f("SetColor"));case r.m.PrivacyPhoneNumber:return n.a.createElement("h3",null,f("PrivacyPhone"));case r.m.PrivacyLastSeen:return n.a.createElement("h3",null,f("PrivacyLastSeen"));case r.m.PrivacyProfilePhoto:return n.a.createElement("h3",null,f("Privacy.ProfilePhoto"));case r.m.PrivacyForwarding:return n.a.createElement("h3",null,f("PrivacyForwards"));case r.m.PrivacyGroupChats:return n.a.createElement("h3",null,f("AutodownloadGroupChats"));case r.m.PrivacyPhoneNumberAllowedContacts:case r.m.PrivacyLastSeenAllowedContacts:case r.m.PrivacyProfilePhotoAllowedContacts:case r.m.PrivacyForwardingAllowedContacts:case r.m.PrivacyGroupChatsAllowedContacts:return n.a.createElement("h3",null,f("AlwaysShareWith"));case r.m.PrivacyPhoneNumberDeniedContacts:case r.m.PrivacyLastSeenDeniedContacts:case r.m.PrivacyProfilePhotoDeniedContacts:case r.m.PrivacyForwardingDeniedContacts:case r.m.PrivacyGroupChatsDeniedContacts:return n.a.createElement("h3",null,f("NeverShareWith"));case r.m.PrivacyActiveSessions:return n.a.createElement("h3",null,f("SessionsTitle"));case r.m.PrivacyBlockedUsers:return n.a.createElement("h3",null,f("BlockedUsers"));case r.m.TwoFaDisabled:case r.m.TwoFaEnabled:return n.a.createElement("h3",null,f("TwoStepVerification"));case r.m.TwoFaNewPassword:case r.m.TwoFaChangePasswordNew:case r.m.TwoFaChangePasswordConfirm:return n.a.createElement("h3",null,f("EnterPassword"));case r.m.TwoFaNewPasswordConfirm:return n.a.createElement("h3",null,f("PleaseReEnterPassword"));case r.m.TwoFaNewPasswordHint:case r.m.TwoFaChangePasswordHint:return n.a.createElement("h3",null,f("PasswordHint"));case r.m.TwoFaNewPasswordEmail:case r.m.TwoFaRecoveryEmail:return n.a.createElement("h3",null,f("RecoveryEmailTitle"));case r.m.TwoFaNewPasswordEmailCode:case r.m.TwoFaRecoveryEmailCode:return n.a.createElement("h3",null,"Recovery Email Code");case r.m.TwoFaCongratulations:return n.a.createElement("h3",null,f("TwoStepVerificationPasswordSet"));case r.m.TwoFaChangePasswordCurrent:case r.m.TwoFaTurnOff:case r.m.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement("h3",null,f("PleaseEnterCurrentPassword"));case r.m.Folders:return n.a.createElement("h3",null,f("Filters"));case r.m.FoldersCreateFolder:return n.a.createElement("h3",null,f("FilterNew"));case r.m.FoldersEditFolder:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,f("FilterEdit")),t&&n.a.createElement(q.a,{className:"settings-more-menu",trigger:O,positionX:"right"},n.a.createElement(z.a,{icon:"delete",destructive:!0,onClick:g},"Delete Folder")));case r.m.FoldersIncludedChats:case r.m.FoldersExcludedChats:return n.a.createElement("div",{className:"settings-main-header"},e===r.m.FoldersIncludedChats?n.a.createElement("h3",null,f("FilterInclude")):n.a.createElement("h3",null,f("FilterExclude")),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",className:"color-primary",onClick:c,ariaLabel:f("AutoDeleteConfirm")},n.a.createElement("i",{className:"icon-check"})));default:return n.a.createElement("div",{className:"settings-main-header"},n.a.createElement("h3",null,f("SETTINGS")),n.a.createElement(q.a,{className:"settings-more-menu",trigger:O,positionX:"right"},n.a.createElement(z.a,{icon:"logout",onClick:h},f("LogOutTitle"))))}}(),n.a.createElement(Se.a,{isOpen:i,onClose:b,text:"Are you sure you want to log out?",confirmLabel:"Log Out",confirmHandler:v,confirmIsDestructive:!0}),n.a.createElement(Se.a,{isOpen:m,onClose:p,text:"Are you sure you want to delete this folder?",confirmLabel:"Delete",confirmHandler:E,confirmIsDestructive:!0}))})),Bt=a(18);var xt=Object(n.h)(Object(c.h)(e=>{const{currentUserId:t}=e;return{currentUser:t?Object(d.Db)(e,t):void 0}})(({onScreenSelect:e,currentUser:t})=>{const a=Object(F.a)();return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-main-menu"},t&&n.a.createElement("div",{className:"settings-current-user"},n.a.createElement(R.a,{user:t,size:"jumbo"}),n.a.createElement("p",{className:"name"},Object(m.Y)(t)),n.a.createElement("p",{className:"phone"},Object(Bt.c)(t.phoneNumber))),n.a.createElement(ve.a,{icon:"edit",onClick:()=>e(r.m.EditProfile)},a("lng_settings_information")),n.a.createElement(ve.a,{icon:"folder",onClick:()=>e(r.m.Folders)},a("Filters")),n.a.createElement(ve.a,{icon:"settings",onClick:()=>e(r.m.General)},a("GeneralSettings")),n.a.createElement(ve.a,{icon:"unmute",onClick:()=>e(r.m.Notifications)},a("Notifications")),n.a.createElement(ve.a,{icon:"lock",onClick:()=>e(r.m.Privacy)},a("PrivacySettings")),n.a.createElement(ve.a,{icon:"language",onClick:()=>e(r.m.Language)},a("Language"))))})),Rt=a(124);a(262);var Ut=({isShown:e,className:t,color:a="primary",ariaLabel:c,disabled:s,onClick:r,children:l})=>{const o=Object(ce.a)("FloatingActionButton",e&&"revealed",t);return n.a.createElement(D.a,{className:o,color:a,round:!0,disabled:s,onClick:e&&!s?r:void 0,ariaLabel:c,tabIndex:-1},l)};const Gt=/https:\/\/t\.me\/?/i,qt=/^([a-zA-Z0-9_]+)$/,zt=Object(V.a)(e=>e(),250,!1);var $t=Object(n.h)(({currentUsername:e,asLink:t,isLoading:a,isUsernameAvailable:c,checkUsername:s,onChange:r})=>{const[l,o]=Object(n.r)(e||""),i=Object(F.a)(),d=t?"SetUrl":"Username",m=i(t?"SetUrlPlaceholder":"Username"),[u,h]=Object(n.p)(()=>l.length?l.length<5?[void 0,m+" is too short"]:l.length>32?[void 0,m+" is too long"]:qt.test(l)?void 0===c?[]:[c?i(d+"Available","Username"):void 0,!1===c?i(d+"InUse"):void 0]:[void 0,m+" contains invalid characters"]:[],[l,c,i,d,m]);Object(n.n)(()=>{o(e||"")},[t,e]);const b=Object(n.m)(e=>{const a=e.target.value.trim().replace(Gt,"");o(a),e.target.value=`${t?"https://t.me/":""}${a}`;const n=function(e){return e.length>=5&&e.length<=32&&qt.test(e)}(a);n&&zt(()=>{s({username:a})}),r&&r(!!n&&a)},[t,s,r]);return n.a.createElement(ge.a,{value:`${t?"https://t.me/":""}${l}`,onChange:b,label:m,error:h,success:u,readOnly:a})});const Ht=Object(V.g)(e=>e(),6e4,!0);var Vt=Object(n.h)(Object(c.h)(e=>{const{currentUserId:t}=e,{progress:a,isUsernameAvailable:n}=e.profileEdit||{},c=t?Object(d.Db)(e,t):void 0;if(!c)return{progress:a,isUsernameAvailable:n};const{firstName:s,lastName:r,username:l,fullInfo:o}=c,{bio:i}=o||{};return{currentAvatarHash:Object(m.f)(c),currentFirstName:s,currentLastName:r,currentBio:i,currentUsername:l,progress:a,isUsernameAvailable:n}},(e,t)=>Object(u.l)(t,["loadCurrentUser","updateProfile","checkUsername"]))(({currentAvatarHash:e,currentFirstName:t,currentLastName:a,currentBio:c,currentUsername:l,progress:o,isUsernameAvailable:i,loadCurrentUser:d,updateProfile:m,checkUsername:u})=>{const[h,b]=Object(n.r)(!1),[g,p]=Object(n.r)(!1),[E,O]=Object(n.r)(),[f,j]=Object(n.r)(),[C,y]=Object(n.r)(t||""),[k,N]=Object(n.r)(a||""),[I,S]=Object(n.r)(c||""),[w,P]=Object(n.r)(l||""),M=Object(v.a)(e,!1,s.ApiMediaFormat.BlobUrl),A=o===r.j.InProgress,T=!1===w,D=Object(n.p)(()=>!T&&(Boolean(f)||g||!0===i),[f,g,T,i]);Object(n.n)(()=>{Ht(()=>{d()})},[d]),Object(n.n)(()=>{j(void 0)},[M]),Object(n.n)(()=>{y(t||""),N(a||""),S(c||"")},[t,a,c]),Object(n.n)(()=>{P(l||"")},[l]),Object(n.n)(()=>{o===r.j.Complete&&(p(!1),b(!1),O(void 0))},[o]);const B=Object(n.m)(e=>{j(e)},[]),R=Object(n.m)(e=>{y(e.target.value),p(!0)},[]),U=Object(n.m)(e=>{N(e.target.value),p(!0)},[]),G=Object(n.m)(e=>{S(e.target.value),p(!0)},[]),q=Object(n.m)(e=>{P(e),b(!0)},[]),z=Object(n.m)(()=>{const e=C.trim(),t=k.trim(),a=I.trim();e.length?a.length>70?O("Bio can' be longer than 70 characters"):m({photo:f,...g&&{firstName:e,lastName:t,bio:a},...h&&{username:w}}):O("Please provide your first name")},[f,C,k,I,g,w,h,m]),$=Object(F.a)();return n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-edit-profile"},n.a.createElement(Rt.a,{currentAvatarBlobUrl:M,onChange:B,title:"Edit your profile photo",disabled:A}),n.a.createElement(ge.a,{value:C,onChange:R,label:$("FirstName"),disabled:A,error:"Please provide your first name"===E?E:void 0}),n.a.createElement(ge.a,{value:k,onChange:U,label:$("LastName"),disabled:A}),n.a.createElement(ge.a,{value:I,onChange:G,label:$("UserBio"),disabled:A,error:"Bio can' be longer than 70 characters"===E?E:void 0}),n.a.createElement("p",{className:"settings-item-description"},Object(x.a)($("lng_settings_about_bio"),["br","simple_markdown"]))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},$("Username")),n.a.createElement($t,{currentUsername:w||"",isLoading:A,isUsernameAvailable:i,checkUsername:u,onChange:q}),n.a.createElement("p",{className:"settings-item-description"},Object(x.a)($("UsernameHelp"),["br","simple_markdown"])),w&&n.a.createElement("p",{className:"settings-item-description"},$("lng_username_link"),n.a.createElement("br",null),n.a.createElement("span",{className:"username-link"},"https://t.me/",w)))),n.a.createElement(Ut,{isShown:D,onClick:z,disabled:A,ariaLabel:"Save changes"},A?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),_t=a(119),Wt=a(110);const Yt=Object(V.g)(e=>e(),6e4,!0);var Kt=Object(n.h)(Object(c.h)(e=>{const{chats:{byId:t},users:{byId:a}}=e,{orderedIds:n,byId:c,recommended:s}=e.chatFolders;return{chatsById:t,usersById:a,orderedFolderIds:n,foldersById:c,recommendedChatFolders:s}},(e,t)=>Object(u.l)(t,["loadRecommendedChatFolders","addChatFolder","showError"]))(({onCreateFolder:e,onEditFolder:t,chatsById:a,usersById:c,orderedFolderIds:s,foldersById:r,recommendedChatFolders:o,loadRecommendedChatFolders:i,addChatFolder:d,showError:u})=>{const[h,b]=Object(n.r)(),[g,p]=Object(n.r)(!1),v=Object(n.m)(()=>p(!0),[]);Object(n.n)(()=>{h||Object(_t.a)("FoldersAll").then(b)},[h]),Object(n.n)(()=>{Yt(()=>{i()})},[i]);const E=Object(n.m)(()=>{Object.keys(r).length>=10?u({error:{message:"DIALOG_FILTERS_TOO_MUCH"}}):e()},[r,u,e]),O=Object(F.a)(),f=Object(n.p)(()=>{if(!s)return;const e=Object.keys(a).map(Number);return s.map(t=>{const n=r[t];return{id:n.id,title:n.title,subtitle:Object(m.o)(a,c,n,e,O)}})},[s,a,r,c,O]),j=Object(n.m)(e=>{Object.keys(r).length>=10?u({error:{message:"DIALOG_FILTERS_TOO_MUCH"}}):d({folder:e})},[r,d,u]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},h&&n.a.createElement(Wt.a,{id:"settingsFoldersMain",size:l.qb,animationData:h,play:g,noLoop:!0,onLoad:v})),n.a.createElement("p",{className:"settings-item-description mb-3"},O("CreateNewFilterInfo")),n.a.createElement(D.a,{className:"with-icon mb-2",color:"primary",size:"smaller",pill:!0,fluid:!0,onClick:E},n.a.createElement("i",{className:"icon-add"}),O("CreateNewFilter"))),n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3"},O("Filters")),f&&f.length?f.map(e=>n.a.createElement(ve.a,{className:"mb-2",narrow:!0,multiline:!0,onClick:()=>t(r[e.id])},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.subtitle))):f&&!f.length?n.a.createElement("p",{className:"settings-item-description my-4"},"You have no folders yet."):n.a.createElement(he.a,null)),o&&!!o.length&&n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3"},O("FilterRecommended")),o.map(e=>n.a.createElement(ve.a,{className:"mb-2",narrow:!0,onClick:()=>j(e)},n.a.createElement("div",{className:"settings-folders-recommended-item"},n.a.createElement("div",{className:"multiline-item"},n.a.createElement("span",{className:"title"},e.title),n.a.createElement("span",{className:"subtitle"},e.description)),n.a.createElement(D.a,{className:"px-3",color:"primary",size:"tiny",pill:!0,fluid:!0},O("Add")))))))}));a(263);var Qt=({count:e,itemName:t,itemPluralName:a,isLoading:c,onClick:s})=>n.a.createElement(D.a,{className:"ShowMoreButton",color:"translucent",size:"smaller",isText:!0,isLoading:c,onClick:s},n.a.createElement("i",{className:"icon-down"}),"Show ",e," more ",e>1?a||t+"s":t);const Zt="Please provide a title for this folder.",Xt="Please select at least one chat for this folder.";var Jt=Object(n.h)(Object(c.h)(e=>{const{listIds:t}=e.chats;return{loadedActiveChatIds:t.active,loadedArchivedChatIds:t.archived}},(e,t)=>Object(u.l)(t,["editChatFolder","addChatFolder","loadMoreChats"]))(({state:e,dispatch:t,onAddIncludedChats:a,onAddExcludedChats:c,onReset:s,loadedActiveChatIds:r,loadedArchivedChatIds:o,editChatFolder:i,addChatFolder:d,loadMoreChats:h})=>{const[b,g]=Object(n.r)(),[p,v]=Object(n.r)(!1),E=Object(n.m)(()=>v(!0),[]),[O,f]=Object(n.r)(!1),[j,C]=Object(n.r)(!1),{selectedChatIds:y,selectedChatTypes:k}=Pt(e,"included"),{selectedChatIds:N,selectedChatTypes:I}=Pt(e,"excluded");Object(n.n)(()=>{b||Object(_t.a)("FoldersNew").then(g)},[b]),Object(n.n)(()=>{f(!1),C(!1)},[e.folderId]);const[S,w]=Object(n.p)(()=>{const e=new Set([...r||[],...o||[]]),t=Object(u.f)(y,e),a=Object(u.f)(N,e);return[O?t:t.slice(0,5-k.length),j?a:a.slice(0,5-I.length)]},[N,y,k,I,j,O,r,o]);Object(n.n)(()=>{(S.length<y.length||w.length<N.length)&&h({listType:"active"})},[h,N.length,y.length,w.length,S.length]);const P=Object(F.a)();function M(e){const t="included"===e?k:I,a="included"===e?S:w,c="included"===e?O:j,s=("included"===e?y:N).length-t.length-a.length,r="included"===e?()=>f(!0):()=>C(!0);return n.a.createElement(n.a.Fragment,null,t.map(t=>function(e,t){const a="included"===t?Nt.find(({key:t})=>t===e):It.find(({key:t})=>t===e);if(a)return n.a.createElement(ve.a,{key:a.key,className:"settings-folders-list-item mb-1",icon:a.icon,narrow:!0,inactive:!0},P(a.title))}(t,e)),a.map(e=>n.a.createElement(ve.a,{className:"settings-folders-list-item mb-1",narrow:!0,inactive:!0},Object(m.kb)(e)?n.a.createElement(Ee.a,{avatarSize:"small",userId:e}):n.a.createElement(Oe.a,{avatarSize:"small",chatId:e}))),!c&&s>0&&n.a.createElement(Qt,{count:s,itemName:"chat",onClick:r}))}return n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement("div",{className:"settings-content-icon"},b&&n.a.createElement(Wt.a,{id:"settingsFoldersEdit",size:l.qb,animationData:b,play:p&&String(e.folderId),noLoop:!0,onLoad:E})),"create"===e.mode&&n.a.createElement("p",{className:"settings-item-description mb-3"},P("FilterIncludeInfo")),n.a.createElement(ge.a,{className:"mb-0",label:P("FilterNameHint"),value:e.folder.title,onChange:function(e){const{currentTarget:a}=e;t({type:"setTitle",payload:a.value.trim()})},error:e.error&&e.error===Zt?Zt:void 0})),n.a.createElement("div",{className:"settings-item no-border pt-3"},e.error&&e.error===Xt&&n.a.createElement("p",{className:"settings-item-description color-danger mb-2"},e.error),n.a.createElement("h4",{className:"settings-item-header mb-3"},P("FilterInclude")),n.a.createElement(ve.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:a},P("FilterAddChats")),M("included")),n.a.createElement("div",{className:"settings-item no-border pt-3"},n.a.createElement("h4",{className:"settings-item-header mb-3"},P("FilterExclude")),n.a.createElement(ve.a,{className:"settings-folders-list-item color-primary mb-0",icon:"add",onClick:c},P("FilterAddChats")),M("excluded"))),n.a.createElement(Ut,{isShown:!!e.isTouched,disabled:e.isLoading,onClick:function(){const{title:a}=e.folder;a?y.length||Object.keys(k).length?(t({type:"setIsLoading",payload:!0}),"edit"===e.mode?i({id:e.folderId,folderUpdate:e.folder}):d({folder:e.folder}),setTimeout(()=>{s()},500)):t({type:"setError",payload:Xt}):t({type:"setError",payload:Zt})},ariaLabel:"edit"===e.mode?"Save changes":"Create folder"},e.isLoading?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))})),ea=a(43);a(180),a(264);var ta=Object(n.h)(({mode:e,chatIds:t,selectedIds:a,selectedChatTypes:c,filterValue:s,onSelectedIdsChange:r,onSelectedChatTypesChange:l,onFilterChange:o,onLoadMore:i})=>{const d=Object(n.q)(null),u="included"===e?Nt:It,h=a.length+c.length>10,b=a.length>=100;Object(n.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{d.current.focus()})},500)},[]);const g=Object(n.m)(e=>{const t=[...a];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),r(t)},[a,r]),p=Object(n.m)(e=>{const t=[...c];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),l(t)},[c,l]),v=Object(n.m)(e=>{const{value:t}=e.currentTarget;o(t)},[o]),E=Object(F.a)();const[O,f]=Object(ue.a)(i,t,Boolean(s));return n.a.createElement("div",{className:"Picker SettingsFoldersChatsPicker"},n.a.createElement("div",{className:"picker-header custom-scroll"},c.map((function(e){const t=u.find(({key:t})=>e===t);if(t)return n.a.createElement(Je.a,{icon:t.icon,title:E(t.title),isMinimized:h,canClose:!0,onClick:p,clickArg:t.key})})),a.map((e,t)=>n.a.createElement(Je.a,{chatOrUserId:e,isMinimized:h&&t<a.length-5,canClose:!0,onClick:g,clickArg:e})),b?n.a.createElement("p",{className:"max-items-reached"},"Sorry, you can't add more than 100 chats."):n.a.createElement(ge.a,{ref:d,value:s,onChange:v,placeholder:E("Search")})),n.a.createElement(pe.a,{className:"picker-list custom-scroll",itemSelector:".chat-item",items:O,onLoadMore:f},(!O||!O.length||O.includes(t[0]))&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h4",{key:"header1",className:"settings-item-header"},E("FilterChatTypes")),u.map((function(e){return n.a.createElement(ve.a,{key:e.key,className:"chat-item-clickable picker-list-item chat-type-item",onClick:()=>p(e.key),ripple:!0},n.a.createElement("i",{className:"icon-"+e.icon}),n.a.createElement("h3",{className:"chat-type"},E(e.title)),n.a.createElement(ea.a,{label:"",checked:c.includes(e.key),round:!0}))})),n.a.createElement("div",{key:"divider",className:"picker-list-divider"}),n.a.createElement("h4",{key:"header2",className:"settings-item-header"},E("FilterChats"))),O&&O.length?O.map((function(e){const t=a.includes(e);return n.a.createElement(ve.a,{key:e,className:"chat-item-clickable picker-list-item chat-item",onClick:()=>g(e),ripple:!0,disabled:!t&&b},Object(m.kb)(e)?n.a.createElement(Ee.a,{userId:e}):n.a.createElement(Oe.a,{chatId:e,withChatType:!0}),n.a.createElement(ea.a,{label:"",checked:t,round:!0}))})):O&&!O.length?n.a.createElement("p",{className:"no-results",key:"no-results"},"Sorry, nothing found."):n.a.createElement(he.a,{key:"loading"})))});var aa=Object(n.h)(Object(c.h)(e=>{const{chats:{byId:t,listIds:a,orderedPinnedIds:n}}=e;return{chatsById:t,listIds:a.active,orderedPinnedIds:n.active,archivedPinnedIds:n.archived,archivedListIds:a.archived}},(e,t)=>Object(u.l)(t,["loadMoreChats"]))(({mode:e,state:t,dispatch:a,chatsById:c,listIds:s,orderedPinnedIds:r,archivedListIds:l,archivedPinnedIds:o,loadMoreChats:i})=>{const{chatFilter:d}=t,{selectedChatIds:u,selectedChatTypes:h}=Pt(t,e,!0),b=Object(n.p)(()=>{const e=s?Object(m.zb)(c,s,r,"all"):void 0,t=l?Object(m.zb)(c,l,o,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[c,s,r,l,o]),g=Object(n.p)(()=>{if(b)return b.filter(e=>!d||Object(me.a)(Object(m.l)(e),d)||u.includes(e.id)).map(({id:e})=>e)},[b,d,u]),p=Object(n.m)(e=>{a({type:"setChatFilter",payload:e})},[a]),v=Object(n.m)(n=>{a("included"===e?{type:"setIncludeFilters",payload:{...t.includeFilters,includedChatIds:n}}:{type:"setExcludeFilters",payload:{...t.excludeFilters,excludedChatIds:n}})},[e,t,a]),E=Object(n.m)(t=>{const n={};t.forEach(e=>{n[e]=!0}),a("included"===e?{type:"setIncludeFilters",payload:{includedChatIds:u,...n}}:{type:"setExcludeFilters",payload:{excludedChatIds:u,...n}})},[e,u,a]);return g?n.a.createElement(ta,{mode:e,chatIds:g,selectedIds:u,selectedChatTypes:h,filterValue:d,onSelectedIdsChange:v,onSelectedChatTypesChange:E,onFilterChange:p,onLoadMore:i}):n.a.createElement(he.a,null)}));a(265);var na=Object(n.h)(({currentScreen:e,state:t,dispatch:a,onScreenSelect:c,onReset:s})=>{const l=Object(n.m)(()=>{e!==r.m.FoldersCreateFolder&&e!==r.m.FoldersEditFolder||setTimeout(()=>{a({type:"reset"})},200),e!==r.m.FoldersIncludedChats&&e!==r.m.FoldersExcludedChats?s():"create"===t.mode?c(r.m.FoldersCreateFolder):c(r.m.FoldersEditFolder)},[t.mode,a,e,s,c]),o=Object(n.m)(()=>{a({type:"reset"}),c(r.m.FoldersCreateFolder)},[c,a]),i=Object(n.m)(e=>{a({type:"editFolder",payload:e}),c(r.m.FoldersEditFolder)},[a,c]),d=Object(n.m)(()=>{a({type:"editIncludeFilters"}),c(r.m.FoldersIncludedChats)},[a,c]),m=Object(n.m)(()=>{a({type:"editExcludeFilters"}),c(r.m.FoldersExcludedChats)},[a,c]);switch(e){case r.m.Folders:return n.a.createElement(Kt,{onCreateFolder:o,onEditFolder:i});case r.m.FoldersCreateFolder:case r.m.FoldersEditFolder:return n.a.createElement(Jt,{state:t,dispatch:a,onAddIncludedChats:d,onAddExcludedChats:m,onReset:l});case r.m.FoldersIncludedChats:return n.a.createElement(aa,{mode:"included",state:t,dispatch:a});case r.m.FoldersExcludedChats:return n.a.createElement(aa,{mode:"excluded",state:t,dispatch:a});default:return}}),ca=a(100);a(266);var sa=Object(n.h)(({options:e,range:t,label:a,value:c,disabled:s,onChange:r})=>{const l=Object(n.m)(e=>{r(Number(e.currentTarget.value))},[r]),o=Object(ce.a)("RangeSlider",s&&"disabled"),i=Object(n.p)(()=>{if(e)return c/(e.length-1)*100;if(t){const e=(t.max-t.min)/(t.step||1);return(c-t.min)/e*100}return 0},[c,e,t]),[d,m,u]=Object(n.p)(()=>e?[0,e.length-1,1]:t?[t.min,t.max,t.step||1]:[0,0,0],[t,e]);return n.a.createElement("div",{className:o},a&&n.a.createElement("div",{className:"slider-top-row"},n.a.createElement("span",{className:"label"},a),t&&n.a.createElement("span",{className:"value"},c)),n.a.createElement("div",{className:"slider-main"},n.a.createElement("div",{className:"slider-fill-track",style:`width: ${i}%`}),n.a.createElement("input",{min:d,max:m,value:c,step:u,type:"range",onChange:l}),e&&n.a.createElement("div",{className:"slider-options"},e.map((e,t)=>n.a.createElement("div",{className:Object(ce.a)("slider-option no-selection",t===c&&"active"),onClick:()=>r(t)},e)))))}),ra=a(120),la=a(108),oa=a(46);var ia=Object(n.h)(({size:e=l.wb,stickerSet:t,observeIntersection:a})=>{const c=Object(n.q)(null),r=Object(ca.b)(c,a),o="stickerSet"+t.id,i=Object(v.a)(o,!r,s.ApiMediaFormat.Lottie),{shouldRenderFullMedia:d,transitionClassNames:m}=Object(la.a)(i,"slow");return n.a.createElement("div",{ref:c,className:"sticker-set-cover"},!d&&Object(oa.c)(t.title,2),d&&i&&n.a.createElement(Wt.a,{id:o,size:e,animationData:i,className:m}))});var da=Object(n.h)(({stickerSet:e,observeIntersection:t})=>{const a=Object(n.q)(null),c=Object(ca.b)(a,t),s=Object(v.a)(e.hasThumbnail&&"stickerSet"+e.id,!c),{shouldRenderFullMedia:r,transitionClassNames:l}=Object(la.a)(s,"slow");return n.a.createElement("div",{ref:a,className:"sticker-set-cover"},!r&&Object(oa.c)(e.title,2),r&&n.a.createElement("img",{src:s,className:l,alt:""}))});a(267);var ma=Object(n.h)(({sticker:e,size:t,observeIntersection:a,noAnimate:c,title:r,className:l,onClick:o,clickArg:i,onUnfaveClick:d})=>{const m=Object(n.q)(null),u="sticker"+e.id,h="sticker-button-"+e.id,b=Object(ca.b)(m,a),g=e.thumbnail?e.thumbnail.dataUri:void 0,p=Object(v.a)(u+"?size=m",!b,s.ApiMediaFormat.BlobUrl),E=b&&!c,O=Object(v.a)(e.isAnimated&&u,!E,s.ApiMediaFormat.Lottie),[f,j,C]=Object(Be.a)(Boolean(O)),y=f&&E,{shouldRenderThumb:k,shouldRenderFullMedia:N,transitionClassNames:I}=Object(la.a)(p||y,"slow");Object(n.n)(()=>{E||C()},[C,E]);const S=Object(ce.a)("StickerButton",e.isAnimated&&"animated",h,l),w=k&&g?`background-image: url('${g}');`:"";return n.a.createElement("div",{ref:m,className:S,title:r||e&&e.emoji,style:w,"data-sticker-id":e.id,onClick:function(){o&&o(i)}},N&&!y&&n.a.createElement("img",{src:p,className:I}),E&&O&&n.a.createElement(Wt.a,{id:u,animationData:O,play:!0,size:t,isLowPriority:!0,onLoad:j}),d&&n.a.createElement(D.a,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),d(e)}},n.a.createElement("i",{className:"icon-close"})))});a(268);var ua=Object(n.h)(({stickerSet:e,observeIntersection:t,onClick:a})=>{const c=Object(F.a)();if(!e||!e.stickers)return;const s=e.stickers&&e.stickers[0];return e.hasThumbnail||!s?n.a.createElement(ve.a,{narrow:!0,className:"SettingsStickerSet",inactive:!s,onClick:()=>s&&a(s)},n.a.createElement(D.a,{ariaLabel:e.title,color:"translucent"},e.isAnimated?n.a.createElement(ia,{size:l.rb,stickerSet:e,observeIntersection:t}):n.a.createElement(da,{stickerSet:e,observeIntersection:t})),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},c("StickerPack.StickerCount",e.count,"i")))):n.a.createElement(ve.a,{narrow:!0,className:"SettingsStickerSet",onClick:()=>a(s)},n.a.createElement(ma,{sticker:s,size:l.rb,title:e.title,observeIntersection:t}),n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("div",{className:"title"},e.title),n.a.createElement("div",{className:"subtitle"},c("StickerPack.StickerCount",e.count,"i"))))}),ha=a(155);const ba=["Solid and Steady","Nice and Fast","Lots of Stuff"];var ga=Object(n.h)(Object(c.h)(e=>({...Object(u.l)(e.settings.byKey,["messageTextSize","animationLevel","messageSendKeyCombo","shouldAutoDownloadMediaFromContacts","shouldAutoDownloadMediaInPrivateChats","shouldAutoDownloadMediaInGroups","shouldAutoDownloadMediaInChannels","shouldAutoPlayGifs","shouldAutoPlayVideos","shouldSuggestStickers","shouldLoopStickers"]),stickerSetIds:e.stickers.added.setIds,stickerSetsById:e.stickers.setsById}),(e,t)=>Object(u.l)(t,["setSettingOption","loadStickerSets","loadAddedStickers"]))(({onScreenSelect:e,stickerSetIds:t,stickerSetsById:a,messageTextSize:c,animationLevel:s,messageSendKeyCombo:l,shouldAutoDownloadMediaFromContacts:i,shouldAutoDownloadMediaInPrivateChats:d,shouldAutoDownloadMediaInGroups:m,shouldAutoDownloadMediaInChannels:u,shouldAutoPlayGifs:h,shouldAutoPlayVideos:b,shouldSuggestStickers:g,shouldLoopStickers:p,setSettingOption:v,loadStickerSets:E,loadAddedStickers:O})=>{const f=Object(n.q)(null),{observe:j}=Object(ca.a)({rootRef:f}),[C,y,k]=Object(Be.a)(),[N,I]=Object(n.r)(),S=Object(F.a)(),w=o.l?void 0:[{value:"enter",label:S("lng_settings_send_enter"),subLabel:"New line by Shift + Enter"},{value:"ctrl-enter",label:S(o.f?"lng_settings_send_cmdenter":"lng_settings_send_ctrlenter"),subLabel:"New line by Enter"}];Object(n.n)(()=>{E()},[E]),Object(n.n)(()=>{t&&t.length&&O()},[t,O]);const P=Object(n.m)(e=>{ba.forEach((t,a)=>{document.body.classList.toggle("animation-level-"+a,e===a)}),v({animationLevel:e})},[v]),M=Object(n.m)(e=>{document.documentElement.style.setProperty("--message-text-size",e+"px"),v({messageTextSize:e})},[v]),L=Object(n.m)(e=>{I(e),y()},[y]),A=t&&t.map(e=>!!(a&&a[e]&&a[e].installedDate)&&a[e]).filter(Boolean);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("h4",{className:"settings-item-header"},S("SETTINGS")),n.a.createElement(sa,{label:S("TextSize"),range:{min:12,max:20},value:c,onChange:M}),n.a.createElement(ve.a,{icon:"photo",onClick:()=>e(r.m.GeneralChatBackground)},S("ChatBackground"))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},"Animation Level"),n.a.createElement("p",{className:"settings-item-description"},"Choose the desired animations amount."),n.a.createElement(sa,{options:ba,value:s,onChange:P})),w&&n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},S("Keyboard")),n.a.createElement(ra.a,{name:"keyboard-send-settings",options:w,onChange:e=>v({messageSendKeyCombo:e}),selected:l})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},S("AutoDownloadMedia")),n.a.createElement(ea.a,{label:S("Contacts"),checked:i,onCheck:e=>v({shouldAutoDownloadMediaFromContacts:e})}),n.a.createElement(ea.a,{label:S("AutodownloadPrivateChats"),checked:d,onCheck:e=>v({shouldAutoDownloadMediaInPrivateChats:e})}),n.a.createElement(ea.a,{label:S("AutodownloadGroupChats"),checked:m,onCheck:e=>v({shouldAutoDownloadMediaInGroups:e})}),n.a.createElement(ea.a,{label:S("FilterChannels"),checked:u,onCheck:e=>v({shouldAutoDownloadMediaInChannels:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},S("AutoplayMedia")),n.a.createElement(ea.a,{label:S("GifsTab2"),checked:h,onCheck:e=>v({shouldAutoPlayGifs:e})}),n.a.createElement(ea.a,{label:S("VideosTitle"),checked:b,onCheck:e=>v({shouldAutoPlayVideos:e})})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},S("AccDescrStickers")),n.a.createElement(ea.a,{label:S("SuggestStickers"),checked:g,onCheck:e=>v({shouldSuggestStickers:e})}),n.a.createElement(ea.a,{label:S("LoopAnimatedStickers"),checked:p,onCheck:e=>v({shouldLoopStickers:e})}),n.a.createElement("div",{className:"mt-4",ref:f},A&&A.map(e=>n.a.createElement(ua,{key:e.id,stickerSet:e,observeIntersection:j,onClick:L}))),N&&n.a.createElement(ha.a,{isOpen:C,fromSticker:N,onClose:k})))}));let pa;function va(e="*",t,a=!1){pa||(pa=document.createElement("input"),pa.setAttribute("type","file")),pa.setAttribute("accept",e),a?pa.removeAttribute("multiple"):pa.setAttribute("multiple","multiple"),pa.onchange=null,pa.value="",pa.onchange=t,pa.click()}var Ea=a(14);function Oa(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function fa(e){const t=e[0].toString(16),a=e[1].toString(16),n=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==a.length?"0"+a:a)+(1==n.length?"0"+n:n)}function ja([e,t,a]){e/=255,t/=255,a/=255;let n,c,s=Math.max(e,t,a),r=Math.min(e,t,a),l=s,o=s-r;if(c=0==s?0:o/s,s==r)n=0;else{switch(s){case e:n=(t-a)/o+(t<a?6:0);break;case t:n=(a-e)/o+2;break;case a:n=(e-t)/o+4}n/=6}return[n,c,l]}function Ca([e,t,a]){let n,c,s,r=Math.floor(6*e),l=6*e-r,o=a*(1-t),i=a*(1-l*t),d=a*(1-(1-l)*t);switch(r%6){case 0:n=a,c=d,s=o;break;case 1:n=i,c=a,s=o;break;case 2:n=o,c=a,s=d;break;case 3:n=o,c=i,s=a;break;case 4:n=d,c=o,s=a;break;case 5:n=a,c=o,s=i}return[Math.round(255*n),Math.round(255*c),Math.round(255*s)]}function ya(e){let[t,a,n]=ja(e);return a=Math.min(1,a+.05+.1*(1-a)),n=n>.5?Math.max(0,.65*n):Math.max(0,Math.min(1,1-.65*n)),`hsla(${360*t}, ${100*a}%, ${100*n}%, .4)`}var ka=a(13),Na=a(156);a(269);var Ia=Object(n.h)(({wallpaper:e,isSelected:t,onClick:a})=>{const{slug:c,document:s}=e,o="wallpaper"+s.id,i=s.previewBlobUrl,d=Object(v.a)(o+"?size=m"),m=Object(Na.a)(s.thumbnail&&s.thumbnail.dataUri,Boolean(d),!0),{shouldRenderThumb:u,shouldRenderFullMedia:h,transitionClassNames:b}=Object(la.a)(d||i,"slow"),[g,p]=Object(n.r)(!1),{mediaData:O,downloadProgress:j}=Object(E.a)(o,!g),C=!1===Object(f.a)(g),{shouldRender:y,transitionClassNames:k}=Object(W.a)(g&&!O||c===r.n,void 0,C,"slow"),N=Object(n.m)(()=>{(async()=>{const e=await Object(Ea.e)(O);await ka.d(l.l,l.l,e),a(c)})()},[O,a,c]);Object(n.n)(()=>{O&&N()},[O,N]);const I=Object(n.m)(()=>{O?N():p(e=>!e)},[O,N]),S=Object(ce.a)("WallpaperTile",t&&"selected");return n.a.createElement("div",{className:S,onClick:I},n.a.createElement("div",{className:"media-inner"},u&&n.a.createElement("canvas",{ref:m,className:"thumbnail"}),h&&n.a.createElement("img",{src:d||i,className:"full-media "+b,alt:""}),y&&n.a.createElement("div",{className:Object(ce.a)("spinner-container",k)},n.a.createElement($.a,{progress:j,onClick:I}))))});a(270);const Sa=Object(V.g)(e=>e(),6e4,!0);var wa=Object(n.h)(Object(c.h)(e=>{const{isBackgroundBlurred:t,customBackground:a}=e.settings.byKey,{loadedWallpapers:n}=e.settings;return{customBackground:a,isBackgroundBlurred:t,loadedWallpapers:n}},(e,t)=>Object(u.l)(t,["setSettingOption","loadWallpapers","uploadWallpaper"]))(({onScreenSelect:e,customBackground:t,isBackgroundBlurred:a,loadedWallpapers:c,setSettingOption:s,loadWallpapers:o,uploadWallpaper:i})=>{Object(n.n)(()=>{Sa(()=>{o()})},[o]);const d=Object(n.m)(e=>{const{files:t}=e.target;t&&t.length>0&&i(t[0])},[i]),m=Object(n.m)(()=>{va("image/jpeg",d,!0)},[d]),u=Object(n.m)(()=>{e(r.m.GeneralChatBackgroundColor)},[e]),h=Object(n.m)(()=>{s({customBackground:void 0,patternColor:l.s})},[s]),b=Object(n.m)(e=>{s({customBackground:e});const t=c&&c.find(t=>t.slug===e);t&&t.document.thumbnail&&async function(e){const t=[0,0,0];let a,n,c,s,r=-4,l=[0,0,0],o=0;const i=document.createElement("canvas"),d=i.getContext&&i.getContext("2d");if(!d)return t;const m=await Object(Ea.g)(e);c=m.naturalHeight||m.offsetHeight||m.height,n=m.naturalWidth||m.offsetWidth||m.width,i.height=c,i.width=n,d.drawImage(m,0,0);try{a=d.getImageData(0,0,n,c)}catch(e){return t}for(s=a.data.length;(r+=20)<s;)++o,l[0]+=a.data[r],l[1]+=a.data[r+1],l[2]+=a.data[r+2];return l[0]=Math.floor(l[0]/o),l[1]=Math.floor(l[1]/o),l[2]=Math.floor(l[2]/o),l}(t.document.thumbnail.dataUri).then(e=>{s({patternColor:ya(e)})})},[c,s]),g=Object(n.m)(e=>{s({isBackgroundBlurred:e.target.checked})},[s]),p=Object(F.a)(),v=c&&c[0]&&c[0].slug===r.n;return n.a.createElement("div",{className:"SettingsGeneralBackground settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(ve.a,{icon:"camera-add",className:"mb-0",disabled:v,onClick:m},p("UploadImage")),n.a.createElement(ve.a,{icon:"colorize",className:"mb-0",onClick:u},p("SetColor")),n.a.createElement(ve.a,{icon:"favorite",onClick:h},p("ThemeResetToDefaults")),n.a.createElement(ea.a,{label:p("BackgroundBlurred"),checked:Boolean(a),onChange:g})),c?n.a.createElement("div",{className:"settings-wallpapers"},c.map(e=>n.a.createElement(Ia,{wallpaper:e,isSelected:t===e.slug,onClick:b}))):n.a.createElement(he.a,null))}));a(271);const Pa=ja(Oa("e6ebee")),Ma=["#e6ebee","#b2cee1","#008dd0","#c6e7cb","#c4e1a6","#60b16e","#ccd0af","#a6a997","#7a7072","#fdd7af","#fdb76e","#dd8851"];function Fa(e,t){return{colorPosition:[Math.round(e[1]*(t.colorRect.width-1)),Math.round((1-e[2])*(t.colorRect.height-1))],huePosition:Math.round(e[0]*(t.hueRect.width-1))}}function La({colorPosition:e,huePosition:t},a){return[t/(a.hueRect.width-1),e[0]/(a.colorRect.width-1),1-e[1]/(a.colorRect.height-1)]}var Aa=Object(n.h)(Object(c.h)(e=>({customBackground:e.settings.byKey.customBackground}),(e,t)=>Object(u.l)(t,["setSettingOption"]))(({customBackground:e,setSettingOption:t})=>{const a=Object(n.q)(null),c=Object(n.q)(null),s=Object(n.q)(null),r=Object(n.q)(!0),[l,o]=Object(n.r)(function(e){return e&&e.startsWith("#")?ja(Oa(e.replace("#",""))):Pa}(e)),i=Object(n.q)(l);Object(n.n)(()=>{i.current=l},[l]);const[d,m,b]=Object(Be.a)(),[g,p]=Object(n.r)(""),[v,E]=Object(n.r)(""),O=Object(n.q)(),f=Object(n.q)();Object(n.n)(()=>{const e={offsetLeft:c.current.offsetLeft,...Object(u.l)(c.current.getBoundingClientRect(),["top","width","height"])},t={offsetLeft:s.current.offsetLeft,...Object(u.l)(s.current.getBoundingClientRect(),["width"])};function n(t){const n=[Math.min(Math.max(0,t.pageX-e.offsetLeft),e.width-1),Math.min(Math.max(0,t.pageY-e.top+a.current.scrollTop),e.height-1)],{huePosition:c}=Fa(i.current,O.current);o(La({colorPosition:n,huePosition:c},O.current)),m()}function r(e){const{colorPosition:a}=Fa(i.current,O.current),n=Math.min(Math.max(0,e.pageX-t.offsetLeft),t.width-1);o(La({colorPosition:a,huePosition:n},O.current)),m()}O.current={colorRect:e,hueRect:t},Object(h.b)(c.current,{onCapture:n,onDrag:n,onRelease:b,onClick:b,withCursor:!0}),Object(h.b)(s.current,{onCapture:r,onDrag:r,onRelease:b,onClick:b,withCursor:!0})},[m,b]);const{colorPosition:j=[0,0],huePosition:C=0}=O.current?Fa(l,O.current):{},y=fa(Ca(l)),k=l[0],N=fa(Ca([k,1,1]));Object(n.n)(()=>{const e=Ca(l),a="#"+fa(e);p(e.join(", ")),E(a),r.current||t({customBackground:a,patternColor:ya(e)}),r.current=!1},[l,t]),Object(n.n)(()=>{!function(e,t,a,n){let c,s,r;a.current&&n.current?(c=n.current.colorRect.width,s=n.current.colorRect.height,r=a.current):(c=e.offsetWidth,s=e.offsetHeight,r=e.getContext("2d"),e.width=c,e.height=s,a.current=r);const l=r.createImageData(c,s),o=l.data,i=Ca([t,1,1]);let d=0;for(let e=0;e<s;e++){const t=1-e/(s-1),a=[255*t,255*t,255*t],n=[i[0]*t,i[1]*t,i[2]*t];for(let e=0;e<c;e++){const t=e/(c-1);o[d++]=a[0]+(n[0]-a[0])*t,o[d++]=a[1]+(n[1]-a[1])*t,o[d++]=a[2]+(n[2]-a[2])*t,o[d++]=255}}r.putImageData(l,0,0)}(c.current.firstChild,k,f,O)},[k]),Object(n.n)(()=>{!function(e){const t=e.offsetWidth;e.width=t,e.height=1;const a=e.getContext("2d"),n=a.createImageData(t,1),c=n.data;let s=0;for(let e=0;e<t;e++){const a=Ca([e/(t-1),1,1]);c[s++]=a[0],c[s++]=a[1],c[s++]=a[2],c[s++]=255}a.putImageData(n,0,0)}(s.current.firstChild)},[]);const I=Object(n.m)(e=>{const t=e.currentTarget.value.replace(/[^\d, ]/g,"").slice(0,13);if(t.match(/^\d{1,3},\s?\d{1,3},\s?\d{1,3}$/)){const e=t.split(",").map(e=>Number(e.trim()));o(ja(e))}e.currentTarget.value=t},[]),S=Object(n.m)(e=>{const t=e.currentTarget.value.replace(/[^0-9a-fA-F]/g,"").slice(0,6);t.match(/^#?[0-9a-fA-F]{6}$/)&&o(ja(Oa(t.replace("#","")))),e.currentTarget.value=t},[]),w=Object(n.m)(e=>{o(ja(Oa(e.currentTarget.dataset.color.replace("#",""))))},[]),P=Object(ce.a)("SettingsGeneralBackgroundColor settings-content custom-scroll",d&&"is-dragging");return n.a.createElement("div",{ref:a,className:P},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement("div",{ref:c,className:"color-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translate(${j[0]}px, ${j[1]}px); background-color: #${y};`})),n.a.createElement("div",{ref:s,className:"hue-picker"},n.a.createElement("canvas",null),n.a.createElement("div",{className:"handle",style:`transform: translateX(${C}px); background-color: #${N};`})),n.a.createElement("div",{className:"tools"},n.a.createElement(ge.a,{value:v,label:"HEX",onChange:S}),n.a.createElement(ge.a,{value:g,label:"RGB",onChange:I}))),n.a.createElement("div",{className:"predefined-colors"},Ma.map(e=>n.a.createElement("div",{className:e==="#"+y?"active":void 0,"data-color":e,style:`background-color: ${e};`,onClick:w}))))}));var Ta=Object(n.h)(Object(c.h)(e=>({hasPrivateChatsNotifications:Boolean(e.settings.byKey.hasPrivateChatsNotifications),hasPrivateChatsMessagePreview:Boolean(e.settings.byKey.hasPrivateChatsMessagePreview),hasGroupNotifications:Boolean(e.settings.byKey.hasGroupNotifications),hasGroupMessagePreview:Boolean(e.settings.byKey.hasGroupMessagePreview),hasBroadcastNotifications:Boolean(e.settings.byKey.hasBroadcastNotifications),hasBroadcastMessagePreview:Boolean(e.settings.byKey.hasBroadcastMessagePreview),hasContactJoinedNotifications:Boolean(e.settings.byKey.hasContactJoinedNotifications)}),(e,t)=>Object(u.l)(t,["loadNotificationsSettings","updateContactSignUpNotification","updateNotificationSettings"]))(({hasPrivateChatsNotifications:e,hasPrivateChatsMessagePreview:t,hasGroupNotifications:a,hasGroupMessagePreview:c,hasBroadcastNotifications:s,hasBroadcastMessagePreview:r,hasContactJoinedNotifications:l,loadNotificationsSettings:o,updateContactSignUpNotification:i,updateNotificationSettings:d})=>{Object(n.n)(()=>{o()},[o]);const m=Object(n.m)((n,l,o)=>{const i="contact"===l?!e:!("group"===l?a:s),m="contact"===l?t:"group"===l?c:r;d({peerType:l,..."silent"===o&&{isSilent:!n.target.checked,isShowPreviews:m},..."showPreviews"===o&&{isShowPreviews:n.target.checked,isSilent:i}})},[r,s,c,a,t,e,d]),u=Object(n.m)(e=>{i({isSilent:!e.target.checked})},[i]),h=Object(F.a)();return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},h("AutodownloadPrivateChats")),n.a.createElement(ea.a,{label:h("NotificationsForPrivateChats"),subLabel:h(e?"NotificationsEnabled":"NotificationsDisabled"),checked:e,onChange:e=>{m(e,"contact","silent")}}),n.a.createElement(ea.a,{label:h("MessagePreview"),subLabel:h(t?"PreviewEnabled":"PreviewDisabled"),checked:t,onChange:e=>{m(e,"contact","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},h("FilterGroups")),n.a.createElement(ea.a,{label:h("NotificationsForGroups"),subLabel:h(a?"NotificationsEnabled":"NotificationsDisabled"),checked:a,onChange:e=>{m(e,"group","silent")}}),n.a.createElement(ea.a,{label:h("MessagePreview"),subLabel:h(c?"PreviewEnabled":"PreviewDisabled"),checked:c,onChange:e=>{m(e,"group","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},h("FilterChannels")),n.a.createElement(ea.a,{label:h("NotificationsForChannels"),subLabel:h(s?"NotificationsEnabled":"NotificationsDisabled"),checked:s,onChange:e=>{m(e,"broadcast","silent")}}),n.a.createElement(ea.a,{label:h("MessagePreview"),subLabel:h(r?"PreviewEnabled":"PreviewDisabled"),checked:r,onChange:e=>{m(e,"broadcast","showPreviews")}})),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},h("PhoneOther")),n.a.createElement(ea.a,{label:h("ContactJoined"),checked:l,onChange:u})))}));var Da=Object(n.h)(Object(c.h)(e=>{const{settings:{byKey:{hasPassword:t},privacy:a},blocked:n,activeSessions:c}=e;return{hasPassword:t,blockedCount:n.totalCount,sessionsCount:c.length,visibilityPrivacyPhoneNumber:a.phoneNumber&&a.phoneNumber.visibility,visibilityPrivacyLastSeen:a.lastSeen&&a.lastSeen.visibility,visibilityPrivacyProfilePhoto:a.profilePhoto&&a.profilePhoto.visibility,visibilityPrivacyForwarding:a.forwards&&a.forwards.visibility,visibilityPrivacyGroupChats:a.chatInvite&&a.chatInvite.visibility}},(e,t)=>Object(u.l)(t,["loadBlockedContacts","loadAuthorizations","loadPrivacySettings"]))(({onScreenSelect:e,hasPassword:t,blockedCount:a,sessionsCount:c,visibilityPrivacyPhoneNumber:s,visibilityPrivacyLastSeen:l,visibilityPrivacyProfilePhoto:o,visibilityPrivacyForwarding:i,visibilityPrivacyGroupChats:d,loadPrivacySettings:m,loadBlockedContacts:u,loadAuthorizations:h})=>{Object(n.n)(()=>{u(),h(),m()},[u,h,m]);const b=Object(F.a)();function g(e){switch(e){case"everybody":return b("P2PEverybody");case"contacts":return b("P2PContacts");case"nobody":return b("P2PNobody")}}return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item pt-3"},n.a.createElement(ve.a,{icon:"delete-user",narrow:!0,onClick:()=>e(r.m.PrivacyBlockedUsers)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("BlockedUsers")),a>0&&n.a.createElement("span",{className:"subtitle"},b("Users",a)))),n.a.createElement(ve.a,{icon:"lock",narrow:!0,onClick:()=>e(t?r.m.TwoFaEnabled:r.m.TwoFaDisabled)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("TwoStepVerification")),n.a.createElement("span",{className:"subtitle"},b(t?"PasswordOn":"PasswordOff")))),n.a.createElement(ve.a,{icon:"active-sessions",narrow:!0,onClick:()=>e(r.m.PrivacyActiveSessions)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("SessionsTitle")),c>0&&n.a.createElement("span",{className:"subtitle"},1===c?"1 session":c+" sessions")))),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4"},b("PrivacyTitle")),n.a.createElement(ve.a,{narrow:!0,onClick:()=>e(r.m.PrivacyPhoneNumber)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("PrivacyPhoneTitle")),n.a.createElement("span",{className:"subtitle"},g(s)))),n.a.createElement(ve.a,{narrow:!0,onClick:()=>e(r.m.PrivacyLastSeen)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("LastSeenTitle")),n.a.createElement("span",{className:"subtitle"},g(l)))),n.a.createElement(ve.a,{narrow:!0,onClick:()=>e(r.m.PrivacyProfilePhoto)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("PrivacyProfilePhotoTitle")),n.a.createElement("span",{className:"subtitle"},g(o)))),n.a.createElement(ve.a,{narrow:!0,onClick:()=>e(r.m.PrivacyForwarding)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("PrivacyForwardsTitle")),n.a.createElement("span",{className:"subtitle"},g(i)))),n.a.createElement(ve.a,{narrow:!0,onClick:()=>e(r.m.PrivacyGroupChats)},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},b("WhoCanAddMe")),n.a.createElement("span",{className:"subtitle"},g(d))))))}));var Ba=Object(n.h)(Object(c.h)(e=>({languages:e.settings.byKey.languages,language:e.settings.byKey.language}),(e,t)=>Object(u.l)(t,["loadLanguages","setSettingOption"]))(({languages:e,language:t,loadLanguages:a,setSettingOption:c})=>{const[s,r]=Object(n.r)(t),[l,o,i]=Object(Be.a)();Object(n.n)(()=>{a()},[a]);const d=Object(n.m)(e=>{r(e),o(),Object(et.c)(e,()=>{i(),c({language:e})})},[o,i,c]),m=Object(n.p)(()=>e?function(e){const t=(window.navigator.language||"en").toLowerCase(),a=t.substr(0,2);return e.map(({langCode:e,nativeName:t,name:a})=>({value:e,label:t,subLabel:a})).sort(e=>!t||e.value!==t&&e.value!==a?0:-1)}(e):void 0,[e]);return n.a.createElement("div",{className:"settings-content settings-item settings-language custom-scroll"},m?n.a.createElement(ra.a,{name:"keyboard-send-settings",options:m,selected:s,loadingOption:l?s:void 0,onChange:d}):n.a.createElement(he.a,null))}));function xa(e){switch(e){case r.m.PrivacyPhoneNumber:case r.m.PrivacyPhoneNumberAllowedContacts:case r.m.PrivacyPhoneNumberDeniedContacts:return"phoneNumber";case r.m.PrivacyLastSeen:case r.m.PrivacyLastSeenAllowedContacts:case r.m.PrivacyLastSeenDeniedContacts:return"lastSeen";case r.m.PrivacyProfilePhoto:case r.m.PrivacyProfilePhotoAllowedContacts:case r.m.PrivacyProfilePhotoDeniedContacts:return"profilePhoto";case r.m.PrivacyForwarding:case r.m.PrivacyForwardingAllowedContacts:case r.m.PrivacyForwardingDeniedContacts:return"forwards";case r.m.PrivacyGroupChats:case r.m.PrivacyGroupChatsAllowedContacts:case r.m.PrivacyGroupChatsDeniedContacts:return"chatInvite"}}var Ra=Object(n.h)(Object(c.h)((e,{screen:t})=>{let a;const{chats:{byId:n},settings:{privacy:c}}=e;switch(t){case r.m.PrivacyPhoneNumber:a=c.phoneNumber;break;case r.m.PrivacyLastSeen:a=c.lastSeen;break;case r.m.PrivacyProfilePhoto:a=c.profilePhoto;break;case r.m.PrivacyForwarding:a=c.forwards;break;case r.m.PrivacyGroupChats:a=c.chatInvite}return a?{...a,chatsById:n}:{}},(e,t)=>Object(u.l)(t,["setPrivacyVisibility"]))(({screen:e,onScreenSelect:t,visibility:a,allowUserIds:c,allowChatIds:s,blockUserIds:l,blockChatIds:o,chatsById:i,setPrivacyVisibility:d})=>{const m=Object(F.a)(),u=Object(n.p)(()=>{switch(e){case r.m.PrivacyProfilePhoto:case r.m.PrivacyGroupChats:return[{value:"everybody",label:m("P2PEverybody")},{value:"contacts",label:m("P2PContacts")}];default:return[{value:"everybody",label:m("P2PEverybody")},{value:"contacts",label:m("P2PContacts")},{value:"nobody",label:m("P2PNobody")}]}},[m,e]),h={shouldShowDenied:"nobody"!==a,shouldShowAllowed:"everybody"!==a},b=xa(e),g=Object(n.p)(()=>{switch(e){case r.m.PrivacyPhoneNumber:return m("PrivacyPhoneTitle");case r.m.PrivacyLastSeen:return m("LastSeenTitle");case r.m.PrivacyProfilePhoto:return m("PrivacyProfilePhotoTitle");case r.m.PrivacyForwarding:return m("PrivacyForwardsTitle");case r.m.PrivacyGroupChats:return m("WhoCanAddMe");default:return}},[m,e]),p=Object(n.p)(()=>{switch(e){case r.m.PrivacyLastSeen:return m("CustomHelp");default:return}},[m,e]),v=(()=>{switch(e){case r.m.PrivacyPhoneNumber:return r.m.PrivacyPhoneNumberAllowedContacts;case r.m.PrivacyLastSeen:return r.m.PrivacyLastSeenAllowedContacts;case r.m.PrivacyProfilePhoto:return r.m.PrivacyProfilePhotoAllowedContacts;case r.m.PrivacyForwarding:return r.m.PrivacyForwardingAllowedContacts;default:return r.m.PrivacyGroupChatsAllowedContacts}})(),E=(()=>{switch(e){case r.m.PrivacyPhoneNumber:return r.m.PrivacyPhoneNumberDeniedContacts;case r.m.PrivacyLastSeen:return r.m.PrivacyLastSeenDeniedContacts;case r.m.PrivacyProfilePhoto:return r.m.PrivacyProfilePhotoDeniedContacts;case r.m.PrivacyForwarding:return r.m.PrivacyForwardingDeniedContacts;default:return r.m.PrivacyGroupChatsDeniedContacts}})(),O=Object(n.p)(()=>c&&s&&i?s.reduce((e,t)=>e+(i[t]?i[t].membersCount:0),c.length):0,[s,c,i]),f=Object(n.p)(()=>l&&o&&i?o.reduce((e,t)=>e+(i[t]?i[t].membersCount:0),l.length):0,[o,l,i]),j=Object(n.m)(e=>{d({privacyKey:b,visibility:e})},[b,d]);return n.a.createElement("div",{className:"settings-content custom-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header"},g),n.a.createElement(ra.a,{name:"visibility-"+b,options:u,onChange:j,selected:a}),p&&n.a.createElement("p",{className:"settings-item-description-larger"},p)),n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4"},m("PrivacyExceptions")),h.shouldShowAllowed&&n.a.createElement(ve.a,{narrow:!0,icon:"add-user",onClick:()=>{t(v)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},O>0&&n.a.createElement("span",{className:"date"},"+",O),n.a.createElement("span",{className:"title"},m("AlwaysShareWith")),n.a.createElement("span",{className:"subtitle"},m("EditAdminAddUsers")))),h.shouldShowDenied&&n.a.createElement(ve.a,{narrow:!0,icon:"delete-user",onClick:()=>{t(E)}},n.a.createElement("div",{className:"multiline-menu-item full-size"},f>0&&n.a.createElement("span",{className:"date"},"−",f),n.a.createElement("span",{className:"title"},m("NeverShareWith")),n.a.createElement("span",{className:"subtitle"},m("EditAdminAddUsers"))))))}));function Ua(e){return[e.region,e.country].filter(Boolean).join(", ")}function Ga(e){return`${e.deviceModel}${e.deviceModel?", ":""} ${e.platform} ${e.systemVersion}`}var qa=Object(n.h)(Object(c.h)(e=>({activeSessions:e.activeSessions}),(e,t)=>Object(u.l)(t,["loadAuthorizations","terminateAuthorization","terminateAllAuthorizations"]))(({activeSessions:e,loadAuthorizations:t,terminateAuthorization:a,terminateAllAuthorizations:c})=>{const[s,r,l]=Object(Be.a)();Object(n.n)(()=>{t()},[t]);const o=Object(n.m)(e=>{a({hash:e})},[a]),i=Object(n.m)(()=>{l(),c()},[l,c]),d=Object(n.p)(()=>e.find(e=>e.isCurrent),[e]),m=Object(n.p)(()=>e.filter(e=>!e.isCurrent),[e]),u=Object(F.a)();function h(e){return n.a.createElement(ve.a,{key:e.hash,ripple:!0,narrow:!0,contextActions:[{title:"Terminate",icon:"stop",handler:()=>{o(e.hash)}}]},n.a.createElement("div",{className:"multiline-menu-item full-size"},n.a.createElement("span",{className:"date"},Object(B.g)(1e3*e.dateActive)),n.a.createElement("span",{className:"title"},e.appName),n.a.createElement("span",{className:"subtitle black tight"},Ga(e)),n.a.createElement("span",{className:"subtitle"},e.ip," - ",Ua(e))))}return n.a.createElement("div",{className:"settings-content custom-scroll"},d&&(g=d,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4"},u("AuthSessions.CurrentSession")),n.a.createElement(ve.a,{narrow:!0,inactive:!0},n.a.createElement("div",{className:"multiline-menu-item"},n.a.createElement("span",{className:"title"},g.appName),n.a.createElement("span",{className:"subtitle black tight"},Ga(g)),n.a.createElement("span",{className:"subtitle"},g.ip," - ",Ua(g)))),n.a.createElement(ve.a,{className:"destructive mb-0",icon:"stop",ripple:!0,narrow:!0,onClick:r},u("TerminateAllSessions")))),m&&(b=m,n.a.createElement("div",{className:"settings-item"},n.a.createElement("h4",{className:"settings-item-header mb-4"},"Other Sessions"),b.map(h))),m&&n.a.createElement(Se.a,{isOpen:s,onClose:l,text:"Are you sure you want to terminate all other sessions?",confirmLabel:"Terminate All Other Sessions",confirmHandler:i,confirmIsDestructive:!0}),";");var b,g}));var za=Object(n.h)(Object(c.h)(e=>{const{chats:{byId:t},users:{byId:a},blocked:{ids:n}}=e;return{chatsByIds:t,usersByIds:a,blockedIds:n}},(e,t)=>Object(u.l)(t,["unblockContact"]))(({chatsByIds:e,usersByIds:t,blockedIds:a,unblockContact:c})=>{const s=Object(n.m)(e=>{c({contactId:e})},[c]),r=Object(F.a)();return n.a.createElement("div",{className:"settings-fab-wrapper"},n.a.createElement("div",{className:"settings-content infinite-scroll"},n.a.createElement("div",{className:"settings-item"},n.a.createElement("p",{className:"settings-item-description-larger mt-0 mb-2"},r("BlockedUsersInfo"))),n.a.createElement("div",{className:"chat-list custom-scroll"},a&&a.length?n.a.createElement("div",{className:"scroll-container"},a.map((a,c)=>function(a,c,r){const o=Object(m.kb)(a),i=o?t[a]:void 0,d=o?void 0:e[a],u=Object(ce.a)("Chat chat-item-clickable blocked-list-item",o?"private":"group");return n.a.createElement(ve.a,{key:a,className:u,ripple:!0,narrow:!0,contextActions:[{title:"Unblock",icon:"unlock",handler:()=>{s(a)}}],style:`top: ${(r+c)*l.h}px;`},n.a.createElement(R.a,{size:"medium",user:i,chat:d}),n.a.createElement("div",{className:"contact-info"},n.a.createElement("h3",null,Object(x.a)((o?Object(m.Y)(i):Object(m.l)(d))||"")),i&&i.phoneNumber&&n.a.createElement("div",{className:"contact-phone"},Object(Bt.c)(i.phoneNumber)),i&&!i.phoneNumber&&i.username&&n.a.createElement("div",{className:"contact-username"},"@",i.username)))}(a,c,0))):a&&!a.length?n.a.createElement("div",{className:"no-results"},"List is empty"):n.a.createElement(he.a,{key:"loading"}))),n.a.createElement(Ut,{isShown:!0,onClick:()=>{},className:"not-implemented",ariaLabel:"Add a blocked user"},n.a.createElement("i",{className:"icon-add"})))})),$a=a(122);var Ha=Object(n.h)(Object(c.h)(e=>({animatedEmoji:Object(d.c)(e,"🔐")}))(({animatedEmoji:e,onScreenSelect:t})=>{const a=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement($a.a,{sticker:e}),n.a.createElement("p",{className:"settings-item-description mb-3"},Object(x.a)(a("EnabledPasswordText"),["br"]))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(ve.a,{icon:"edit",onClick:()=>t(r.m.TwoFaChangePasswordCurrent)},a("ChangePassword")),n.a.createElement(ve.a,{icon:"password-off",onClick:()=>t(r.m.TwoFaTurnOff)},a("TurnPasswordOff")),n.a.createElement(ve.a,{icon:"email",onClick:()=>t(r.m.TwoFaRecoveryEmailCurrentPassword)},a("SetRecoveryEmail"))))})),Va=a(142),_a=a(143);var Wa=Object(n.h)(({error:e,isLoading:t,expectedPassword:a,placeholder:c="Current Password",hint:s,submitLabel:r,clearError:l,onSubmit:o})=>{const[i,d]=Object(n.r)(""),[m,u]=Object(n.r)(!1),h=Object(n.m)(e=>{a&&e!==a?d("Passwords Should Be Equal"):o(e)},[o,a]),b=Object(n.m)(()=>{l&&l(),d("")},[l]),g=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement(Va.a,{isBig:!0,isPasswordVisible:m})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(_a.a,{error:i||e,hint:s,placeholder:c,submitLabel:r||g("Next"),clearError:b,isLoading:t,isPasswordVisible:m,onChangePasswordVisibility:u,onSubmit:h})))});var Ya=Object(n.h)(Object(c.h)(e=>({animatedEmoji:Object(d.c)(e,"🔐")}))(({animatedEmoji:e,onStart:t})=>{const a=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement($a.a,{sticker:e}),n.a.createElement("p",{className:"settings-item-description mb-3"},a("SetAdditionalPasswordInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:t},a("EditAdminTransferSetPassword"))))}));const Ka=o.g?550:400;var Qa=Object(n.h)(Object(c.h)((e,{icon:t})=>({animatedEmoji:Object(d.c)(e,"email"===t?"💌":"💡")}))(({animatedEmoji:e,type:t="text",isLoading:a,error:c,placeholder:s,shouldConfirm:r,clearError:l,onSubmit:i})=>{const d=Object(n.q)(null),[m,u]=Object(n.r)(""),[h,b,g]=Object(Be.a)(!1);Object(n.n)(()=>{o.l||setTimeout(()=>{d.current.focus()},Ka)},[]);const p=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement($a.a,{sticker:e})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement("form",{action:"",onSubmit:e=>{e.preventDefault(),d.current&&i(m)}},n.a.createElement(ge.a,{ref:d,value:m,inputMode:t,label:s,error:c,onChange:e=>{c&&l&&l(),u(e.target.value)}}),m?n.a.createElement(D.a,{type:"submit",isLoading:a,ripple:!0},p("Continue")):n.a.createElement(D.a,{isText:!0,isLoading:a,ripple:!0,onClick:r?b:()=>{i()}},p("YourEmailSkip"))),r&&n.a.createElement(be.a,{className:"narrow",isOpen:h,title:p("YourEmailSkipWarning"),onClose:g},Object(x.a)(p("YourEmailSkipWarningText"),["br","simple_markdown"]),n.a.createElement("div",{className:"dialog-buttons"},n.a.createElement(D.a,{color:"danger",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:()=>{g(),i()}},p("YourEmailSkip")),n.a.createElement(D.a,{color:"primary",ripple:!0,isText:!0,className:"confirm-dialog-button",onClick:g},p("Cancel"))))))}));var Za=Object(n.h)(Object(c.h)(e=>({animatedEmoji:Object(d.c)(e,"🥳")}))(({animatedEmoji:e,onScreenSelect:t})=>{const a=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement($a.a,{sticker:e}),n.a.createElement("p",{className:"settings-item-description mb-3"},a("TwoStepVerificationPasswordSetInfo"))),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(D.a,{onClick:()=>{t(r.m.Privacy)}},a("TwoStepVerificationPasswordReturnSettings"))))}));const Xa=o.g?550:400;var Ja=Object(n.h)(Object(c.h)(e=>({animatedEmoji:Object(d.c)(e,"💌"),codeLength:e.twoFaSettings.waitingEmailCodeLength}))(({animatedEmoji:e,codeLength:t,isLoading:a,error:c,clearError:s,onSubmit:r})=>{const l=Object(n.q)(null),[i,d]=Object(n.r)("");Object(n.n)(()=>{o.l||setTimeout(()=>{l.current.focus()},Xa)},[]);const m=Object(F.a)();return n.a.createElement("div",{className:"settings-content two-fa custom-scroll"},n.a.createElement("div",{className:"settings-content-header"},n.a.createElement($a.a,{sticker:e})),n.a.createElement("div",{className:"settings-item pt-0 no-border"},n.a.createElement(ge.a,{value:i,ref:l,inputMode:"decimal",label:m("YourEmailCode"),error:c,onChange:e=>{c&&s&&s();const a=e.target.value.slice(0,t);a.length===t&&r(a),d(a),e.target.value=a}}),a&&n.a.createElement(he.a,null)))}));var en=Object(n.h)(Object(c.h)(e=>({...e.twoFaSettings}),(e,t)=>Object(u.l)(t,["updatePassword","updateRecoveryEmail","clearPassword","provideTwoFaEmailCode","checkPassword","clearTwoFaError"]))(({currentScreen:e,state:t,hint:a,isLoading:c,error:s,waitingEmailCodeLength:l,dispatch:o,onScreenSelect:i,updatePassword:d,checkPassword:m,clearTwoFaError:u,updateRecoveryEmail:h,provideTwoFaEmailCode:b,clearPassword:g})=>{Object(n.n)(()=>{l&&(e===r.m.TwoFaNewPasswordEmail?i(r.m.TwoFaNewPasswordEmailCode):e===r.m.TwoFaRecoveryEmail&&i(r.m.TwoFaRecoveryEmailCode))},[e,i,l]);const p=Object(n.m)(()=>{o({type:"reset"}),i(r.m.TwoFaNewPassword)},[o,i]),v=Object(n.m)(e=>{o({type:"setPassword",payload:e}),i(r.m.TwoFaNewPasswordConfirm)},[o,i]),E=Object(n.m)(()=>{i(r.m.TwoFaNewPasswordHint)},[i]),O=Object(n.m)(e=>{o({type:"setHint",payload:e}),i(r.m.TwoFaNewPasswordEmail)},[o,i]),f=Object(n.m)(e=>{o({type:"setEmail",payload:e}),d({...t,email:e,onSuccess:()=>{i(r.m.TwoFaCongratulations)}})},[o,i,t,d]),j=Object(n.m)(e=>{o({type:"setCurrentPassword",payload:e}),m({currentPassword:e,onSuccess:()=>{i(r.m.TwoFaChangePasswordNew)}})},[m,o,i]),C=Object(n.m)(e=>{o({type:"setPassword",payload:e}),i(r.m.TwoFaChangePasswordConfirm)},[o,i]),y=Object(n.m)(()=>{i(r.m.TwoFaChangePasswordHint)},[i]),k=Object(n.m)(e=>{o({type:"setHint",payload:e}),d({...t,hint:e,onSuccess:()=>{i(r.m.TwoFaCongratulations)}})},[o,i,t,d]),N=Object(n.m)(e=>{g({currentPassword:e,onSuccess:()=>{i(r.m.Privacy)}})},[g,i]),I=Object(n.m)(e=>{o({type:"setCurrentPassword",payload:e}),m({currentPassword:e,onSuccess:()=>{i(r.m.TwoFaRecoveryEmail)}})},[m,o,i]),S=Object(n.m)(e=>{o({type:"setEmail",payload:e}),h({...t,email:e,onSuccess:()=>{i(r.m.TwoFaCongratulations)}})},[o,i,t,h]),w=Object(n.m)(e=>{b({code:e})},[b]),P=Object(F.a)();switch(e){case r.m.TwoFaDisabled:return n.a.createElement(Ya,{onStart:p});case r.m.TwoFaNewPassword:return n.a.createElement(Wa,{placeholder:P("EnterPassword"),submitLabel:P("Continue"),onSubmit:v});case r.m.TwoFaNewPasswordConfirm:return n.a.createElement(Wa,{expectedPassword:t.password,placeholder:P("PleaseReEnterPassword"),submitLabel:P("Continue"),onSubmit:E});case r.m.TwoFaNewPasswordHint:return n.a.createElement(Qa,{icon:"hint",placeholder:P("PasswordHintPlaceholder"),onSubmit:O});case r.m.TwoFaNewPasswordEmail:return n.a.createElement(Qa,{icon:"email",type:"email",isLoading:c,error:s,clearError:u,placeholder:P("RecoveryEmailTitle"),shouldConfirm:!0,onSubmit:f});case r.m.TwoFaNewPasswordEmailCode:return n.a.createElement(Ja,{isLoading:c,error:s,clearError:u,onSubmit:w});case r.m.TwoFaCongratulations:return n.a.createElement(Za,{onScreenSelect:i});case r.m.TwoFaEnabled:return n.a.createElement(Ha,{onScreenSelect:i});case r.m.TwoFaChangePasswordCurrent:return n.a.createElement(Wa,{isLoading:c,error:s,clearError:u,hint:a,onSubmit:j});case r.m.TwoFaChangePasswordNew:return n.a.createElement(Wa,{placeholder:P("PleaseEnterNewFirstPassword"),onSubmit:C});case r.m.TwoFaChangePasswordConfirm:return n.a.createElement(Wa,{expectedPassword:t.password,placeholder:P("PleaseReEnterPassword"),onSubmit:y});case r.m.TwoFaChangePasswordHint:return n.a.createElement(Qa,{isLoading:c,error:s,clearError:u,icon:"hint",placeholder:P("PasswordHintPlaceholder"),onSubmit:k});case r.m.TwoFaTurnOff:return n.a.createElement(Wa,{isLoading:c,error:s,clearError:u,hint:a,onSubmit:N});case r.m.TwoFaRecoveryEmailCurrentPassword:return n.a.createElement(Wa,{isLoading:c,error:s,clearError:u,hint:a,onSubmit:I});case r.m.TwoFaRecoveryEmail:return n.a.createElement(Qa,{icon:"email",type:"email",placeholder:P("RecoveryEmailTitle"),onSubmit:S});case r.m.TwoFaRecoveryEmailCode:return n.a.createElement(Ja,{isLoading:c,error:s,clearError:u,onSubmit:w});default:return}}));var tn=Object(n.h)(({itemIds:e,selectedIds:t,filterValue:a,filterPlaceholder:c,notFoundText:s,searchInputId:r,isLoading:l,onSelectedIdsChange:o,onFilterChange:i,onLoadMore:d})=>{const u=Object(n.q)(null),h=t.length>10;Object(n.n)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{u.current.focus()})},500)},[]);const b=Object(n.m)(e=>{const a=[...t];a.includes(e)?a.splice(a.indexOf(e),1):a.push(e),o(a),i("")},[t,o,i]),g=Object(n.m)(e=>{const{value:t}=e.currentTarget;i(t)},[i]),[p,v]=Object(ue.a)(d,e,Boolean(a)),E=Object(F.a)();return n.a.createElement("div",{className:"Picker"},n.a.createElement("div",{className:"picker-header custom-scroll"},t.map((e,a)=>n.a.createElement(Je.a,{chatOrUserId:e,isMinimized:h&&a<t.length-5,canClose:!0,onClick:b,clickArg:e})),n.a.createElement(ge.a,{id:r,ref:u,value:a,onChange:g,placeholder:c||E("SelectChat")})),p&&p.length?n.a.createElement(pe.a,{className:"picker-list custom-scroll",items:p,onLoadMore:v},p.map(e=>n.a.createElement(ve.a,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>b(e),ripple:!0},n.a.createElement(ea.a,{label:"",checked:t.includes(e)}),Object(m.kb)(e)?n.a.createElement(Ee.a,{userId:e}):n.a.createElement(Oe.a,{chatId:e})))):l||!p||p.length?n.a.createElement(he.a,null):n.a.createElement("p",{className:"no-results"},s||"Sorry, nothing found."))});function an(e,t){const{privacy:a}=e.settings;switch(t){case r.m.PrivacyPhoneNumberAllowedContacts:case r.m.PrivacyPhoneNumberDeniedContacts:return a.phoneNumber;case r.m.PrivacyLastSeenAllowedContacts:case r.m.PrivacyLastSeenDeniedContacts:return a.lastSeen;case r.m.PrivacyProfilePhotoAllowedContacts:case r.m.PrivacyProfilePhotoDeniedContacts:return a.profilePhoto;case r.m.PrivacyForwardingAllowedContacts:case r.m.PrivacyForwardingDeniedContacts:return a.forwards;case r.m.PrivacyGroupChatsDeniedContacts:case r.m.PrivacyGroupChatsAllowedContacts:return a.chatInvite}}var nn=Object(n.h)(Object(c.h)((e,{screen:t})=>{const{chats:{byId:a,listIds:n,orderedPinnedIds:c},currentUserId:s}=e;return{currentUserId:s,chatsById:a,listIds:n.active,orderedPinnedIds:c.active,archivedPinnedIds:c.archived,archivedListIds:n.archived,settings:an(e,t)}},(e,t)=>Object(u.l)(t,["setPrivacySettings"]))(({currentUserId:e,isAllowList:t,screen:a,settings:c,chatsById:s,listIds:l,orderedPinnedIds:o,archivedListIds:i,archivedPinnedIds:d,setPrivacySettings:u,onScreenSelect:h})=>{const b=Object(n.p)(()=>c?t?[...c.allowUserIds,...c.allowChatIds]:[...c.blockUserIds,...c.blockChatIds]:[],[t,c]),[g,p]=Object(n.r)(""),[v,E]=Object(n.r)(!1),[O,f]=Object(n.r)(b),j=Object(n.p)(()=>{const e=l?Object(m.zb)(s,l,o,"all"):void 0,t=i?Object(m.zb)(s,i,d,"archived"):void 0;if(e||t)return[...e?[...e.pinnedChats,...e.otherChats]:[],...t?t.otherChats:[]]},[s,l,o,i,d]),C=Object(n.p)(()=>{if(j)return j.filter(t=>(Object(m.kb)(t.id)&&t.id!==e||Object(m.jb)(t))&&(!g||Object(me.a)(Object(m.l)(t),g)||b.includes(t.id))).map(({id:e})=>e)},[j,e,g,b]),y=Object(n.m)(e=>{f(e),E(!0)},[]),k=Object(n.m)(()=>{u({privacyKey:xa(a),isAllowList:Boolean(t),contactsIds:O}),h(r.m.Privacy)},[t,O,h,a,u]),N=Object(F.a)();return n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(tn,{itemIds:C||[],selectedIds:O,filterValue:g,filterPlaceholder:N(t?"AlwaysShareWithPlaceholder":"NeverShareWithPlaceholder"),searchInputId:"new-group-picker-search",onSelectedIdsChange:y,onFilterChange:p}),n.a.createElement(Ut,{isShown:v,onClick:k,ariaLabel:N(t?"AlwaysShareWithTitle":"NeverShareWithTitle")},n.a.createElement("i",{className:"icon-arrow-right"})))}));a(272);const cn=Object.keys(r.m).length/2;var sn=Object(n.h)(({currentScreen:e,onScreenSelect:t,onReset:a})=>{const[c,s]=kt(Lt,Ft),[l,i]=kt(Tt,At),d=Object(n.m)(()=>{e!==r.m.FoldersCreateFolder&&e!==r.m.FoldersEditFolder||setTimeout(()=>{s({type:"reset"})},200),e!==r.m.FoldersIncludedChats&&e!==r.m.FoldersExcludedChats?a():"create"===c.mode?t(r.m.FoldersCreateFolder):t(r.m.FoldersEditFolder)},[c.mode,s,e,a,t]),m=Object(n.m)(()=>{s({type:"saveFilters"}),d()},[s,d]);function u(){return n.a.createElement(n.a.Fragment,null,n.a.createElement(Dt,{currentScreen:e,onReset:d,onSaveFilter:m,editedFolderId:c.folderId}),function(){switch(e){case r.m.Main:return n.a.createElement(xt,{onScreenSelect:t});case r.m.EditProfile:return n.a.createElement(Vt,null);case r.m.General:return n.a.createElement(ga,{onScreenSelect:t});case r.m.Notifications:return n.a.createElement(Ta,null);case r.m.Privacy:return n.a.createElement(Da,{onScreenSelect:t});case r.m.Language:return n.a.createElement(Ba,null);case r.m.GeneralChatBackground:return n.a.createElement(wa,{onScreenSelect:t});case r.m.GeneralChatBackgroundColor:return n.a.createElement(Aa,{onScreenSelect:t});case r.m.PrivacyActiveSessions:return n.a.createElement(qa,null);case r.m.PrivacyBlockedUsers:return n.a.createElement(za,null);case r.m.PrivacyPhoneNumber:case r.m.PrivacyLastSeen:case r.m.PrivacyProfilePhoto:case r.m.PrivacyForwarding:case r.m.PrivacyGroupChats:return n.a.createElement(Ra,{screen:e,onScreenSelect:t});case r.m.PrivacyPhoneNumberAllowedContacts:case r.m.PrivacyLastSeenAllowedContacts:case r.m.PrivacyProfilePhotoAllowedContacts:case r.m.PrivacyForwardingAllowedContacts:case r.m.PrivacyGroupChatsAllowedContacts:return n.a.createElement(nn,{isAllowList:!0,screen:e,onScreenSelect:t});case r.m.PrivacyPhoneNumberDeniedContacts:case r.m.PrivacyLastSeenDeniedContacts:case r.m.PrivacyProfilePhotoDeniedContacts:case r.m.PrivacyForwardingDeniedContacts:case r.m.PrivacyGroupChatsDeniedContacts:return n.a.createElement(nn,{screen:e,onScreenSelect:t});case r.m.Folders:case r.m.FoldersCreateFolder:case r.m.FoldersEditFolder:case r.m.FoldersIncludedChats:case r.m.FoldersExcludedChats:return n.a.createElement(na,{currentScreen:e,state:c,dispatch:s,onScreenSelect:t,onReset:d});case r.m.TwoFaDisabled:case r.m.TwoFaNewPassword:case r.m.TwoFaNewPasswordConfirm:case r.m.TwoFaNewPasswordHint:case r.m.TwoFaNewPasswordEmail:case r.m.TwoFaNewPasswordEmailCode:case r.m.TwoFaCongratulations:case r.m.TwoFaEnabled:case r.m.TwoFaChangePasswordCurrent:case r.m.TwoFaChangePasswordNew:case r.m.TwoFaChangePasswordConfirm:case r.m.TwoFaChangePasswordHint:case r.m.TwoFaTurnOff:case r.m.TwoFaRecoveryEmailCurrentPassword:case r.m.TwoFaRecoveryEmail:case r.m.TwoFaRecoveryEmailCode:return n.a.createElement(en,{currentScreen:e,state:l,dispatch:i,onScreenSelect:t});default:return}}())}return n.a.createElement(T.a,{id:"Settings",name:o.g?"slide-layers":"push-slide",activeKey:e,renderCount:cn},u)});const rn=Object(V.g)(e=>e(),6e4,!0);var ln=Object(n.h)(Object(c.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users;return{usersById:a,contactIds:t}},(e,t)=>Object(u.l)(t,["loadContactList","openChat"]))(({filter:e,usersById:t,contactIds:a,loadContactList:c,openChat:s})=>{Object(n.n)(()=>{rn(()=>{c()})});const r=Object(n.m)(e=>{s({id:e})},[s]),l=Object(n.p)(()=>{if(!a)return;const n=e?a.filter(a=>{const n=t[a];if(!n)return!1;const c=Object(m.Y)(n);return c&&Object(me.a)(c,e)}):a;return Object(m.Cb)(n,t)},[e,t,a]),[i,d]=Object(ue.a)(void 0,l,Boolean(e));return n.a.createElement(pe.a,{items:i,onLoadMore:d,className:"chat-list custom-scroll"},i&&i.length?i.map(e=>n.a.createElement(ve.a,{key:e,className:"chat-item-clickable",onClick:()=>r(e),ripple:!o.g},n.a.createElement(Ee.a,{userId:e,forceShowSelf:!0,avatarSize:"large"}))):i&&!i.length?n.a.createElement("p",{className:"no-results",key:"no-results"},e.length?"No contacts matched your search.":"Contact list is empty."):n.a.createElement(he.a,{key:"loading"}))}));const on=Object(V.g)(e=>e(),6e4,!0);var dn=Object(n.h)(Object(c.h)(e=>{const{userIds:t}=e.contactList||{},{byId:a}=e.users,{byId:n}=e.chats,{currentUserId:c}=e,{query:s,fetchingStatus:r,globalResults:l,localResults:o}=e.globalSearch,{userIds:i}=l||{},{userIds:d}=o||{};return{currentUserId:c,usersById:a,chatsById:n,localContactIds:t,searchQuery:s,isSearching:r&&r.chats,globalUserIds:i,localUserIds:d}},(e,t)=>Object(u.l)(t,["loadContactList","setGlobalSearchQuery"]))(({isChannel:e,selectedMemberIds:t,onSelectedMemberIdsChange:a,onNextStep:c,onReset:s,currentUserId:r,usersById:l,chatsById:o,localContactIds:i,searchQuery:d,isSearching:h,localUserIds:b,globalUserIds:g,loadContactList:p,setGlobalSearchQuery:v})=>{Object(n.n)(()=>{on(()=>{p()})});const E=Object(n.m)(e=>{v({query:e})},[v]),O=Object(n.p)(()=>{const e=i?Object(m.Bb)(i.filter(e=>e!==r),o):[];if(!d)return e;const a=e.filter(e=>{const t=l[e];if(!t)return!1;const a=Object(m.Y)(t);return a&&Object(me.a)(a,d)});return Object(m.Bb)(Object(u.o)([...a,...b||[],...g||[]]),o,!1,t)},[i,d,b,g,l,o,t,r]),f=Object(n.m)(()=>{t.length&&(v({query:""}),c())},[t,v,c]),j=Object(F.a)();return n.a.createElement("div",{className:"NewChat step-1"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:s,ariaLabel:"Return to Chat List"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,j("GroupAddMembers"))),n.a.createElement("div",{className:"NewChat-inner step-1"},n.a.createElement(tn,{itemIds:O,selectedIds:t,filterValue:d,filterPlaceholder:j("SendMessageTo"),searchInputId:"new-group-picker-search",isLoading:h,onSelectedIdsChange:a,onFilterChange:E}),n.a.createElement(Ut,{isShown:Boolean(t.length),onClick:f,ariaLabel:e?"Continue To Channel Info":"Continue To Group Info"},n.a.createElement("i",{className:"icon-arrow-right"}))))}));var mn=Object(n.h)(Object(c.h)(e=>{const{progress:t,error:a}=e.chatCreation||{};return{creationProgress:t,creationError:a}},(e,t)=>Object(u.l)(t,["createGroupChat","createChannel"]))(({isChannel:e,memberIds:t,onReset:a,creationProgress:c,creationError:s,createGroupChat:l,createChannel:o})=>{const i=Object(F.a)(),[d,m]=Object(n.r)(""),[u,h]=Object(n.r)(""),[b,g]=Object(n.r)(),[p,v]=Object(n.r)(),E=c===r.a.InProgress,O=Object(n.m)(e=>{const{value:t}=e.currentTarget,a=t.replace(/^\s+/,"");m(a),a!==t&&(e.currentTarget.value=a)},[]),f=Object(n.m)(e=>{h(e.currentTarget.value)},[]),j=Object(n.m)(()=>{d.length?t.length>199?v("Sorry, creating supergroups is not yet supported"):l({title:d,photo:b,memberIds:t}):v("Chat title can't be empty")},[d,t,l,b,"Chat title can't be empty","Sorry, creating supergroups is not yet supported"]),C=Object(n.m)(()=>{d.length?o({title:d,about:u,photo:b,memberIds:t}):v("Channel title can't be empty")},[d,o,u,b,t,"Channel title can't be empty"]);Object(n.n)(()=>{c===r.a.Complete&&a(!0)},[c,a]);const y=s||("Chat title can't be empty"!==p&&"Channel title can't be empty"!==p?p:void 0);return n.a.createElement("div",{className:"NewChat"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:()=>a(),ariaLabel:"Return to member selection"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,i(e?"NewChannel":"NewGroup"))),n.a.createElement("div",{className:"NewChat-inner step-2"},n.a.createElement(Rt.a,{onChange:g,title:i("AddPhoto")}),n.a.createElement(ge.a,{value:d,onChange:O,label:i(e?"EnterChannelName":"GroupName"),error:"Chat title can't be empty"===p||"Channel title can't be empty"===p?p:void 0}),e&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ge.a,{value:u,onChange:f,label:i("DescriptionOptionalPlaceholder")}),n.a.createElement("p",{className:"note"},i("DescriptionInfo"))),y&&n.a.createElement("p",{className:"error"},y),n.a.createElement("h3",{className:"chat-members-heading"},i("GroupInfo.ParticipantCount",t.length,"i")),n.a.createElement("div",{className:"chat-members-list custom-scroll"},t.map(e=>n.a.createElement(ve.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(Ee.a,{userId:e}))))),n.a.createElement(Ut,{isShown:0!==d.length,onClick:e?C:j,disabled:E,ariaLabel:e?i("ChannelIntro.CreateChannel"):"Create Group"},E?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-arrow-right"})))}));a(273);const un=Object.keys(r.d).length/2;var hn=Object(n.h)(({isChannel:e=!1,content:t,onContentChange:a,onReset:c})=>{const[s,l]=Object(n.r)([]),i=Object(n.m)(()=>{a(e?r.d.NewChannelStep2:r.d.NewGroupStep2)},[e,a]);return n.a.createElement(T.a,{id:"NewChat",name:o.g?"slide-layers":"push-slide",renderCount:un,activeKey:t},()=>{switch(t){case r.d.NewChannelStep1:case r.d.NewGroupStep1:return n.a.createElement(dn,{isChannel:e,selectedMemberIds:s,onSelectedMemberIdsChange:l,onNextStep:i,onReset:c});case r.d.NewChannelStep2:case r.d.NewGroupStep2:return n.a.createElement(mn,{isChannel:e,memberIds:s,onReset:c});default:return}})}),bn=a(183);a(274);var gn=Object(n.h)(({onReset:e})=>{const t=Object(F.a)();return n.a.createElement("div",{className:"ArchivedChats"},n.a.createElement("div",{className:"left-header"},n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:e,ariaLabel:"Return to chat list"},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement("h3",null,t("ArchivedChats"))),n.a.createElement(bn.a,{folderType:"archived",noChatsText:"Archive is empty."}))});const pn={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},vn=e=>{e.preventDefault()};function En(e){pn[e.key]&&vn(e)}function On(){document.addEventListener("wheel",vn,{passive:!1}),window.ontouchmove=vn,document.onkeydown=En}function fn(){document.removeEventListener("wheel",vn),window.ontouchmove=null,document.onkeydown=null}var jn=a(50),Cn=a(147);function yn(e,t){return e?"lng_context_copy_selected":t?"lng_context_copy_text":"Copy"}var kn=a(167),Nn=a(49);a(275);var In=({isOpen:e,message:t,anchor:a,canSendNow:c,canReschedule:r,canReply:l,canEdit:o,canPin:i,canUnpin:d,canDelete:u,canForward:h,canFaveSticker:b,canUnfaveSticker:g,canCopy:p,canCopyLink:v,canSelect:E,onReply:O,onEdit:f,onPin:C,onUnpin:y,onForward:k,onDelete:N,onFaveSticker:I,onUnfaveSticker:S,onSelect:w,onSend:P,onReschedule:M,onClose:L,onCloseAnimationEnd:A,onCopyLink:T})=>{Object(n.n)(()=>{Object(j.b)(200)},[e]);const D=function(e,t,a){const n=[],c=Object(m.N)(e),r=Object(m.G)(e),l=Object(m.D)(e,"inline"),o=r&&l&&Cn.a,i=window.getSelection();if(o&&n.push({label:"lng_context_copy_image",handler:()=>{jn.b(l,s.ApiMediaFormat.BlobUrl).then(Cn.b),t&&t()}}),c){const e=Boolean(i&&i.anchorNode&&i.anchorNode.parentNode&&i.anchorNode.parentNode.closest(".Message .content-inner")&&""!==i.toString().replace(/(?:\r\n|\r|\n)/g,""));n.push({label:yn(e,o),handler:()=>{const a=e&&i?i.toString():c;Object(Cn.c)(a),t&&t()}})}return a&&n.push({label:"lng_context_copy_message_link",handler:()=>{a(),t&&t()}}),n}(t,L,v?T:void 0),B=Object(n.m)(()=>document.querySelector(`.active > .MessageList div[data-message-id="${t.id}"]`),[t.id]),x=Object(n.m)(()=>document.querySelector(".active > .MessageList"),[]),R=Object(n.m)(()=>document.querySelector(".MessageContextMenu .bubble"),[]),{positionX:U,positionY:G,style:q}=Object(kn.a)(a,B,x,R,10,document.querySelector(".MiddleHeader").offsetHeight),$=Object(F.a)();return n.a.createElement(Nn.a,{isOpen:e,positionX:U,positionY:G,style:q,className:"MessageContextMenu fluid",onClose:L,onCloseAnimationEnd:A},c&&n.a.createElement(z.a,{icon:"send-outline",onClick:P},$("MessageScheduleSend")),r&&n.a.createElement(z.a,{icon:"schedule",onClick:M},$("MessageScheduleEditTime")),l&&n.a.createElement(z.a,{icon:"reply",onClick:O},$("Reply")),o&&n.a.createElement(z.a,{icon:"edit",onClick:f},$("Edit")),b&&n.a.createElement(z.a,{icon:"favorite",onClick:I},$("AddToFavorites")),g&&n.a.createElement(z.a,{icon:"favorite",onClick:S},$("Stickers.RemoveFromFavorites")),p&&D.map(e=>n.a.createElement(z.a,{key:e.label,icon:"copy",onClick:e.handler},$(e.label))),i&&n.a.createElement(z.a,{icon:"pin",onClick:C},$("DialogPin")),d&&n.a.createElement(z.a,{icon:"unpin",onClick:y},$("DialogUnpin")),h&&n.a.createElement(z.a,{icon:"forward",onClick:k},$("Forward")),E&&n.a.createElement(z.a,{icon:"select",onClick:w},$("Common.Select")),u&&n.a.createElement(z.a,{destructive:!0,icon:"delete",onClick:N},$("Delete")))};var Sn=Object(n.h)(Object(c.h)((e,{message:t,messageListType:a})=>{const{threadId:n}=Object(d.y)(e)||{},{noOptions:c,canReply:s,canPin:r,canUnpin:l,canDelete:o,canEdit:i,canForward:m,canFaveSticker:u,canUnfaveSticker:h,canCopy:b,canCopyLink:g,canSelect:p}=n&&Object(d.b)(e,t,n)||{},v="pinned"===a,E="scheduled"===a;return{noOptions:c,canSendNow:E,canReschedule:E,canReply:!v&&!E&&s,canPin:!E&&r,canUnpin:!E&&l,canDelete:o,canEdit:!v&&i,canForward:!E&&m,canFaveSticker:!E&&u,canUnfaveSticker:!E&&h,canCopy:b,canCopyLink:!E&&g,canSelect:p}},(e,t)=>Object(u.l)(t,["setReplyingToId","setEditingId","pinMessage","openForwardMenu","faveSticker","unfaveSticker","toggleMessageSelection","sendScheduledMessages","rescheduleMessage","loadMessageLink"]))(({isOpen:e,messageListType:t,message:a,album:c,anchor:s,onClose:r,onCloseAnimationEnd:l,noOptions:o,canSendNow:i,canReschedule:d,canReply:m,canPin:u,canUnpin:h,canDelete:b,canEdit:g,canForward:p,canFaveSticker:v,canUnfaveSticker:E,canCopy:O,canCopyLink:f,canSelect:j,setReplyingToId:C,setEditingId:y,pinMessage:k,openForwardMenu:N,faveSticker:I,unfaveSticker:S,toggleMessageSelection:w,sendScheduledMessages:P,rescheduleMessage:M,loadMessageLink:F})=>{const{transitionClassNames:L}=Object(W.a)(e,l,void 0,!1),[A,T]=Object(n.r)(!0),[D,x]=Object(n.r)(!1),[R,U]=Object(n.r)(!1),[G,q,z]=Object(Be.a)(),$=Object(n.m)(()=>{T(!1),x(!0)},[]),H=Object(n.m)(()=>{T(!1),r()},[r]),V=Object(n.m)(()=>{x(!1),r()},[r]),_=Object(n.m)(()=>{U(!1),r()},[r]),Y=Object(n.m)(()=>{z(),r()},[z,r]),K=Object(n.m)(()=>{C({messageId:a.id}),H()},[C,a.id,H]),Q=Object(n.m)(()=>{y({messageId:a.id}),H()},[y,a.id,H]),Z=Object(n.m)(()=>{T(!1),U(!0)},[]),X=Object(n.m)(()=>{k({messageId:a.id,isUnpin:!0}),H()},[k,a.id,H]),J=Object(n.m)(()=>{if(H(),c&&c.messages){const e=c.messages.map(({id:e})=>e);N({fromChatId:a.chatId,messageIds:e})}else N({fromChatId:a.chatId,messageIds:[a.id]})},[N,a,H,c]),ee=Object(n.m)(()=>{H(),I({sticker:a.content.sticker})},[H,a.content.sticker,I]),te=Object(n.m)(()=>{H(),S({sticker:a.content.sticker})},[H,a.content.sticker,S]),ae=Object(n.m)(()=>{const e=c&&c.messages?{messageId:a.id,childMessageIds:c.messages.map(({id:e})=>e),withShift:!1}:{messageId:a.id,withShift:!1};w(e),H()},[H,a.id,w,c]),ne=Object(n.m)(()=>{P({chatId:a.chatId,id:a.id}),H()},[H,a.chatId,a.id,P]),ce=Object(n.m)(()=>{T(!1),q()},[q]),se=Object(n.m)(e=>{M({chatId:a.chatId,messageId:a.id,scheduledAt:Math.round(e.getTime()/1e3)})},[a.chatId,a.id,M]),re=Object(n.m)(()=>{F({messageId:a.id,chatId:a.chatId}),H()},[H,F,a.chatId,a.id]);if(Object(n.n)(()=>(On(),fn),[]),o)return void H();const le=new Date;return le.setFullYear(le.getFullYear()+1),n.a.createElement("div",{className:["ContextMenuContainer",L].join(" ")},n.a.createElement(In,{message:a,isOpen:A,anchor:s,canSendNow:i,canReschedule:d,canReply:m,canDelete:b,canPin:u,canUnpin:h,canEdit:g,canForward:p,canFaveSticker:v,canUnfaveSticker:E,canCopy:O,canCopyLink:f,canSelect:j,onReply:K,onEdit:Q,onPin:Z,onUnpin:X,onForward:J,onDelete:$,onFaveSticker:ee,onUnfaveSticker:te,onSelect:ae,onSend:ne,onReschedule:ce,onClose:H,onCopyLink:re}),n.a.createElement(Ae,{isOpen:D,isSchedule:"scheduled"===t,onClose:V,album:c,message:a}),n.a.createElement(Te,{isOpen:R,messageId:a.id,chatId:a.chatId,onClose:_}),n.a.createElement(Le,{isOpen:G,withTimePicker:!0,selectedAt:1e3*a.date,maxAt:Object(B.k)(le),isFutureMode:!0,onClose:Y,onSubmit:se}))}));a(276);var wn=Object(n.h)(Object(c.h)((e,{fromSticker:t})=>({stickerSet:Object(d.ub)(e,t.stickerSetId)}),(e,t)=>Object(u.l)(t,["loadStickers","toggleStickerSet","sendMessage"]))(({isOpen:e,fromSticker:t,stickerSet:a,onClose:c,loadStickers:s,toggleStickerSet:r,sendMessage:o})=>{const i=Object(n.q)(null),d=Object(F.a)(),{observe:m}=Object(ca.a)({rootRef:i,throttleMs:200,isDisabled:!e});Object(n.n)(()=>{if(e){const{stickerSetId:e,stickerSetAccessHash:a}=t;s({stickerSetId:e,stickerSetAccessHash:a})}},[e,t,s]);const u=Object(n.m)(e=>{e={...e,isPreloadedGlobally:!0},o({sticker:e}),c()},[c,o]),h=Object(n.m)(()=>{r({stickerSetId:t.stickerSetId}),c()},[t.stickerSetId,c,r]);return n.a.createElement(be.a,{className:"StickerSetModal",isOpen:e,onClose:c,hasCloseButton:!0,title:a?a.title:"Sticker Set"},a&&a.stickers?n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{ref:i,className:"stickers custom-scroll"},a.stickers.map(e=>n.a.createElement(ma,{sticker:e,size:l.ub,observeIntersection:m,onClick:u,clickArg:e}))),n.a.createElement("div",{className:"button-wrapper"},n.a.createElement(D.a,{size:"smaller",fluid:!0,color:a.installedDate?"danger":"primary",onClick:h},d(a.installedDate?"StickerPack.RemoveStickerCount":"StickerPack.AddStickerCount",a.count,"i")))):n.a.createElement(he.a,null))})),Pn=a(116);a(277);var Mn=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t);return!a||a.isRestricted?{}:{chat:a,isMuted:a.isMuted,isPrivate:Object(m.kb)(a.id),canDeleteChat:Object(m.d)(a)}},(e,t)=>Object(u.l)(t,["updateChatMutedState","enterMessageSelectMode"]))(({chatId:e,isOpen:t,anchor:a,isChannel:c,canSubscribe:s,canSearch:r,canMute:l,canSelect:i,canLeave:d,chat:m,isPrivate:u,isMuted:h,canDeleteChat:b,onSubscribeChannel:g,onSearchClick:p,onClose:v,onCloseAnimationEnd:E,updateChatMutedState:O,enterMessageSelectMode:f})=>{const[j,C]=Object(n.r)(!0),[y,k]=Object(n.r)(!1),{x:N,y:I}=a;Object(W.a)(t,E,void 0,!1);const S=Object(n.m)(()=>{C(!1),k(!0)},[]),w=Object(n.m)(()=>{C(!1),v()},[v]),P=Object(n.m)(()=>{k(!1),v()},[v]),M=Object(n.m)(()=>{O({chatId:e,isMuted:!h}),w()},[e,w,h,O]),L=Object(n.m)(()=>{g(),w()},[w,g]),A=Object(n.m)(()=>{p(),w()},[w,p]),T=Object(n.m)(()=>{f(),w()},[w,f]);Object(n.n)(()=>(On(),fn),[]);const D=Object(F.a)();return n.a.createElement(Pn.a,null,n.a.createElement("div",{className:"HeaderMenuContainer"},n.a.createElement(Nn.a,{isOpen:j,positionX:"right",style:`left: ${N}px;top: ${I}px;`,onClose:w},o.g&&s&&n.a.createElement(z.a,{icon:c?"channel":"group",onClick:L},D(c?"Subscribe":"Join Group")),o.g&&r&&n.a.createElement(z.a,{icon:"search",onClick:A},D("Search")),l&&n.a.createElement(z.a,{icon:h?"unmute":"mute",onClick:M},D(h?"ChatsUnmute":"ChatsMute")),i&&n.a.createElement(z.a,{icon:"select",onClick:T},D("ReportSelectMessages")),d&&n.a.createElement(z.a,{destructive:!0,icon:"delete",onClick:S},D(u?"Delete":b?"GroupInfo.DeleteAndExit":c?"LeaveChannel":"Group.LeaveGroup"))),m&&n.a.createElement($e.a,{isOpen:y,onClose:P,chat:m})))})),Fn=a(148);a(278);const Ln=Object(V.a)(e=>e(),200,!1);var An=Object(n.h)(Object(c.h)(e=>{const t=Object(d.r)(e);if(!t)return{};const{query:a,results:n}=Object(d.A)(e)||{},{totalCount:c,foundIds:s}=n||{};return{chat:t,query:a,totalCount:c,foundIds:s}},(e,t)=>Object(u.l)(t,["setLocalTextSearchQuery","searchTextMessagesLocal","focusMessage","closeLocalTextSearch","searchMessagesByDate"]))(({isActive:e,chat:t,query:a,totalCount:c,foundIds:s,setLocalTextSearchQuery:r,searchTextMessagesLocal:l,focusMessage:o,closeLocalTextSearch:i,searchMessagesByDate:d})=>{const m=Object(n.q)(null),[u,h]=Object(n.r)(0),[b,g,p]=Object(Be.a)();Object(n.n)(()=>{const{visualViewport:e}=window;if(!e)return;const t=document.getElementById("Main"),a=()=>{const{activeElement:a}=document;if(a&&a===m.current){const{pageTop:a,height:n}=e;t.style.transform=`translateY(${a}px)`,t.style.height=n+"px",document.documentElement.scrollTop=a}else t.style.transform="",t.style.height=""};return e.addEventListener("resize",a),()=>{e.removeEventListener("resize",a)}},[]),Object(n.n)(()=>{t&&s&&s.length?(o({chatId:t.id,messageId:s[s.length-1]}),h(0)):h(-1)},[t,o,s]),Object(n.n)(()=>{Array.from(document.querySelectorAll("input")).forEach(t=>{t.disabled=Boolean(e&&t!==m.current)}),Array.from(document.querySelectorAll("div[contenteditable]")).forEach(t=>{t.contentEditable=e?"false":"true"})},[e]),Object(n.n)(()=>{e||m.current.blur()},[e]),Object(n.o)(()=>{document.querySelector("#MobileSearch input").blur()},[b]);const v=Object(n.m)(e=>{r({query:e}),e.length&&Ln(l)},[l,r]),E=Object(n.m)(e=>{d({timestamp:e.valueOf()/1e3}),p()},[p,d]),O=Object(n.m)(()=>{if(t&&s){const e=u+1;o({chatId:t.id,messageId:s[s.length-1-e]}),h(e)}},[t,u,o,s]),f=Object(n.m)(()=>{if(t&&s){const e=u-1;o({chatId:t.id,messageId:s[s.length-1-e]}),h(e)}},[t,u,o,s]),j=Object(F.a)();return n.a.createElement("div",{id:"MobileSearch",className:e?"active":""},n.a.createElement("div",{className:"header"},n.a.createElement(D.a,{size:"smaller",round:!0,color:"translucent",onClick:i},n.a.createElement("i",{className:"icon-arrow-left"})),n.a.createElement(Fn.a,{ref:m,value:a,onChange:v})),n.a.createElement("div",{className:"footer"},n.a.createElement("div",{className:"counter"},a?s&&s.length?`${u+1} of ${c}`:s&&!s.length?"No results":"":n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:g,ariaLabel:"Search messages by date"},n.a.createElement("i",{className:"icon-calendar"}))),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:O,disabled:!s||!s.length||u===s.length-1},n.a.createElement("i",{className:"icon-up"})),n.a.createElement(D.a,{round:!0,size:"smaller",color:"translucent",onClick:f,disabled:!s||!s.length||0===u},n.a.createElement("i",{className:"icon-down"}))),n.a.createElement(Le,{isOpen:b,isPastMode:!0,submitButtonLabel:j("JumpToDate"),onClose:p,onSubmit:E}))})),Tn=a(55),Dn=a(184),Bn=a(176),xn=a(173),Rn=a(178);function Un(e,t,a=0,n=!1,c=!1,s=!1){const r=e[s?"scrollLeft":"scrollTop"],l=r+e[s?"offsetWidth":"offsetHeight"],o="string"==typeof t?e.querySelectorAll(t):t,{length:i}=o,d=[];let m=!1;for(let e=0;e<i;e++){const t=o[e],i=t[s?"offsetLeft":"offsetTop"],u=i+t[s?"offsetWidth":"offsetHeight"];if(c?u>=r-a&&u<=l+a:i<=l+a&&u>=r-a)d.push(e),m=!0;else if(m&&!n)break}return{allElements:o,visibleIndexes:d}}var Gn=function(e,t,a=!1){const n=e[a?"scrollLeft":"scrollTop"],c=n+e[a?"offsetWidth":"offsetHeight"],s=t[a?"offsetLeft":"offsetTop"],r=s+t[a?"offsetWidth":"offsetHeight"];return s>n&&r<c},qn=a(118),zn=a(128);a(279);var $n=Object(n.h)(({isOpen:e,filter:t,onClose:a,onInsertUserName:c,usersById:s,filteredChatMembers:r})=>{const l=Object(n.q)(null),{shouldRender:o,transitionClassNames:i}=Object(W.a)(e,void 0,void 0,!1),d=Object(n.m)(e=>{if(!r)return-1;const t=r.length;return Object(zn.a)(t,e)},[r]),[m,u]=Object(n.r)(-1),h=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>d(t+e))},[u,d]),b=Object(n.m)((e,t=!1)=>{const a=s&&s[e];a&&c(a,t)},[s,c]),g=Object(n.m)(e=>{if(r&&r.length&&m>-1){const t=r[m];t&&(e.preventDefault(),b(t.userId,!0))}},[r,m,b]);Object(n.n)(()=>e?Object(xe.a)({onEsc:a,onUp:e=>h(-1,e),onDown:e=>h(1,e),onEnter:g,onTab:g}):void 0,[e,a,h,g]),Object(n.n)(()=>{r&&!r.length&&a()},[r,a]),Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{!function(e,t){const a=t.current;if(!a||e<0)return;const{visibleIndexes:n,allElements:c}=Un(a,".chat-item-clickable",8,!0,!0);if(!c.length||!c[e])return;const s=n[0];if(!n.includes(e)||e===s&&!Gn(a,c[s])){const t=e>n[n.length-1]?"start":"end";Object(qn.a)(a,c[e],t,10)}}(m,l)},[m]);const p=Object(f.a)(r&&r.length?r:void 0,o),v=r&&!r.length?p:r;if(!o||v&&!v.length)return;const E=Object(ce.a)("MentionTooltip composer-tooltip custom-scroll",i);return n.a.createElement("div",{className:E,ref:l},v&&v.map(({userId:e},t)=>n.a.createElement(ve.a,{key:e,className:"chat-item-clickable scroll-item",onClick:()=>b(e),focus:m===t},n.a.createElement(Ee.a,{userId:e,avatarSize:"small",withUsername:!0}))))}),Hn=a(177);a(280);var Vn=Object(n.h)(({attachments:e,caption:t,canSuggestMembers:a,groupChatMembers:c,currentUserId:s,usersById:r,recentEmojis:o,onCaptionUpdate:i,addRecentEmoji:d,onSend:m,onClear:u})=>{const h=Object(f.a)(e),g=e.length?e:h,p=Boolean(e.length),{isMentionTooltipOpen:v,mentionFilter:E,closeMentionTooltip:O,insertMention:j,mentionFilteredMembers:C}=Object(Dn.a)(a&&p,t,i,l.v,c,s,r),{isEmojiTooltipOpen:y,closeEmojiTooltip:k,filteredEmojis:N,insertEmoji:I}=Object(Bn.a)(p,t,o,l.v,i);Object(n.n)(()=>p?Object(b.a)(u):void 0,[p,u]);const S=Object(n.m)(()=>{p&&m()},[p,m]),w=Object(F.a)();if(!g)return;const P=g.every(e=>e.mimeType.startsWith("image/")),M=g.every(e=>e.mimeType.startsWith("video/"));let L="";L=P?1===g.length?"Send Photo":`Send ${g.length} Photos`:M?1===g.length?"Send Video":`Send ${g.length} Videos`:1===g.length?"Send File":`Send ${g.length} Files`;const A=g.every(e=>e.quick);return n.a.createElement(be.a,{isOpen:p,onClose:u,header:function(){if(g)return n.a.createElement("div",{className:"modal-header-condensed"},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel attachments",onClick:u},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},L),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:S},w("Send")))}(),className:"AttachmentModal"},A?n.a.createElement("div",{className:"media-wrapper custom-scroll"},g.map(e=>e.mimeType.startsWith("image/")?n.a.createElement("img",{src:e.blobUrl,alt:""}):n.a.createElement("video",{src:e.blobUrl,autoPlay:!0,muted:!0,loop:!0}))):n.a.createElement("div",{className:"document-wrapper custom-scroll"},g.map(e=>n.a.createElement(xn.a,{name:e.filename,extension:Object(Tn.d)(e.filename,e.mimeType),previewData:e.previewBlobUrl,size:e.size,smaller:!0}))),n.a.createElement("div",{className:"attachment-caption-wrapper"},n.a.createElement($n,{isOpen:v,onClose:O,filter:E,onInsertUserName:j,filteredChatMembers:C,usersById:r}),n.a.createElement(Hn.a,{isOpen:y,emojis:N,onClose:k,onEmojiSelect:I,addRecentEmoji:d}),n.a.createElement(Rn.a,{id:"caption-input-text",html:t,editableInputId:l.v,placeholder:w("Caption"),onUpdate:i,onSend:m,shouldSetFocus:p})))}),_n=a(132);a(281);var Wn=Object(n.h)(({isOpen:e,onSend:t,onClear:a})=>{const c=Object(n.q)(null),s=Object(n.q)(null),r=Object(n.q)(null),[l,o]=Object(n.r)(""),[i,d]=Object(n.r)([""]),[m,u]=Object(n.r)(!0),[h,g]=Object(n.r)(!1),[p,v]=Object(n.r)(!1),[E,O]=Object(n.r)(),[f,j]=Object(n.r)(),[C,y]=Object(n.r)(!1),k=Object(n.m)(t=>{e&&t.current&&t.current.focus()},[e]);Object(n.n)(()=>e?Object(b.a)(a):void 0,[e,a]),Object(n.n)(()=>{e||(o(""),d([""]),u(!0),g(!1),v(!1),O(""),j(""),y(!1))},[e]),Object(n.n)(()=>k(c),[k,e]),Object(n.o)(()=>{const e=r.current;e&&E!==e.innerHTML&&(e.innerHTML=E)},[E]);const N=Object(n.m)((e=[])=>{d([...e,""]),requestAnimationFrame(()=>{const e=s.current;e&&(e.classList.toggle("overflown",e.scrollHeight>320),e.scrollTo({top:e.scrollHeight,behavior:"smooth"}))})},[]),I=Object(n.m)(()=>{if(y(!1),!e)return;const a=l.trim().substring(0,255),n=i.map(e=>e.trim().substring(0,100)).filter(e=>e.length);if(!a||n.length<2)return o(a),n.length?n.length<2?N(n):d(n):N(),void y(!0);if(p&&(!f||!n[Number(f)]))return void y(!0);const c={summary:{question:a,answers:n.map((e,t)=>({text:e.trim(),option:String(t),...String(t)===f&&{correct:!0}})),...!m&&{isPublic:!0},...h&&{multipleChoice:!0},...p&&{quiz:!0}}};if(p){const{text:e,entities:t}=E&&Object(_n.a)(E.substring(0,200))||{};c.quiz={correctAnswers:[f],...e&&{solution:e},...t&&{solutionEntities:t}}}t(c)},[e,l,i,p,f,m,h,t,N,E]),S=Object(n.m)((e,t)=>{const a=[...i];a[e]=t,a[a.length-1].trim().length&&a.length<10?N(a):d(a)},[i,N]),w=Object(n.m)(e=>{const t=[...i];t.splice(e,1),d(t),requestAnimationFrame(()=>{s.current&&s.current.classList.toggle("overflown",s.current.scrollHeight>320)})},[i]),P=Object(n.m)(e=>{j(e)},[j]),M=Object(n.m)(e=>{u(e.target.checked)},[]),L=Object(n.m)(e=>{g(e.target.checked)},[]),A=Object(n.m)(e=>{v(e.target.checked)},[]),T=Object(n.m)(e=>{13===e.keyCode&&I()},[I]),B=Object(n.m)(()=>{if(C&&!l.trim().length)return"Please enter the question"},[C,l]),x=Object(n.m)(e=>{const t=i.map(e=>e.trim()).filter(e=>e.length);if(C&&t.length<2&&!i[e].trim().length)return"Please enter at least two options"},[C,i]),R=Object(F.a)();function U(){return i.map((e,t)=>n.a.createElement("div",{className:"option-wrapper"},n.a.createElement(ge.a,{label:t!==i.length-1||10===i.length?"Option "+(t+1):"Add an Option",error:x(t),value:e,onChange:e=>S(t,e.currentTarget.value),onKeyPress:T}),t!==i.length-1&&n.a.createElement(D.a,{className:"option-remove-button",round:!0,color:"translucent",size:"smaller",ariaLabel:"Remove option",onClick:()=>w(t)},n.a.createElement("i",{className:"icon-close"}))))}return n.a.createElement(be.a,{isOpen:e,onClose:a,header:n.a.createElement("div",{className:"modal-header-condensed"},n.a.createElement(D.a,{round:!0,color:"translucent",size:"smaller",ariaLabel:"Cancel poll creation",onClick:a},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("div",{className:"modal-title"},R("NewPoll")),n.a.createElement(D.a,{color:"primary",size:"smaller",className:"modal-action-button",onClick:I},R("Create"))),className:"PollModal"},n.a.createElement(ge.a,{ref:c,label:R("AskAQuestion"),value:l,error:B(),onChange:e=>o(e.currentTarget.value),onKeyPress:T}),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"options-list custom-scroll",ref:s},n.a.createElement("h3",{className:"options-header"},"Options"),C&&function(){const e=i.map(e=>e.trim()).filter(e=>e.length);return p&&(!f||!e[Number(f)])&&n.a.createElement("p",{className:"error"},"Please choose the correct answer")}(),p?n.a.createElement(ra.a,{name:"correctOption",options:U().map((e,t)=>({value:String(t),label:e,hidden:t===i.length-1})),onChange:P}):U()),n.a.createElement("div",{className:"options-divider"}),n.a.createElement("div",{className:"quiz-mode"},n.a.createElement(ea.a,{label:R("PollAnonymous"),checked:m,onChange:M}),n.a.createElement(ea.a,{label:R("PollMultiple"),checked:h,disabled:p,onChange:L}),n.a.createElement(ea.a,{label:R("PollQuiz"),checked:p,disabled:h,onChange:A}),p&&n.a.createElement(n.a.Fragment,null,n.a.createElement("h3",{className:"options-header"},"Solution"),n.a.createElement("div",{ref:r,className:"form-control",contentEditable:!0,onChange:e=>O(e.currentTarget.innerHTML)}),n.a.createElement("div",{className:"note"},"Users will see this comment after choosing a wrong answer, good for educational purposes."))))});let Yn;function Kn(e,t,a=250){const c=Object(n.q)(!1);Object(n.n)(()=>{Yn&&(clearTimeout(Yn),Yn=void 0),e&&!o.l&&(Yn=window.setTimeout(()=>{c.current||t()},2*a))},[e,a,t]);return[Object(n.m)(()=>{c.current=!0},[]),Object(n.m)(()=>{c.current=!1,Yn&&(clearTimeout(Yn),Yn=void 0),Yn=window.setTimeout(()=>{c.current||t()},a)},[a,t])]}var Qn=a(60),Zn=a(136);a(282);var Xn=Object(n.h)(({emoji:e,focus:t,onClick:a})=>{const c=Object(n.m)(()=>{a(e.native,e.id)},[e,a]);return n.a.createElement("div",{className:"EmojiButton "+(t?"focus":""),onClick:c,title:`:${e.names[0]}:`},o.d?e.native:n.a.createElement("img",{src:`/img-apple-64/${e.image}.png`,alt:"",loading:"lazy"}))});var Jn=Object(n.h)(({category:e,index:t,allEmojis:a,observeIntersection:c,shouldRender:s,onEmojiSelect:r})=>{const l=Object(n.q)(null);Object(ca.c)(l,c);const{transitionClassNames:i}=Object(W.a)(s,void 0,void 0,"slow"),d=Object(F.a)(),m=o.g?Math.floor((y.a.get().width-8)/44):9,u=44*Math.ceil(e.emojis.length/m);return n.a.createElement("div",{ref:l,key:e.id,id:"emoji-category-"+t,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name"},d("recent"===e.id?"RecentStickers":"Emoji"+t)),n.a.createElement("div",{className:Object(ce.a)("symbol-set-container",i),style:`height: ${u}px;`},s&&e.emojis.map(e=>{const t=a[e],c="id"in t?t:t[1];return n.a.createElement(Xn,{key:c.id,emoji:c,onClick:r})})))});a(283);const ec={recent:"icon-recent",people:"icon-smile",nature:"icon-animals",foods:"icon-eats",activity:"icon-sport",places:"icon-car",objects:"icon-lamp",symbols:"icon-language",flags:"icon-flag"},tc=[];let ac,nc,cc;var sc=Object(n.h)(Object(c.h)(e=>Object(u.l)(e,["recentEmojis"]))(({className:e,onEmojiSelect:t,recentEmojis:c})=>{const s=Object(n.q)(null),r=Object(n.q)(null),[i,d]=Object(n.r)(),[m,u]=Object(n.r)(),[h,b]=Object(n.r)(0),{observe:g}=Object(ca.a)({rootRef:s,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("emoji-category-"))return;const a=Number(t.replace("emoji-category-",""));tc[a]=e.isIntersecting});const t=tc.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&b(t[Math.floor(t.length/2)].index)});Object(Ve.a)(r,!o.g),Object(n.n)(()=>{if(!i)return;const e=r.current;if(!e)return;const t=42*h-e.offsetWidth/2+21;Object(Zn.a)(e,t)},[i,h]);const p=Object(F.a)(),v=Object(n.p)(()=>{if(!i)return qe.a;const e=[...i];return c&&c.length&&e.unshift({id:"recent",name:p("RecentStickers"),emojis:c}),e},[i,p,c]);Object(n.n)(()=>{setTimeout(()=>{const e=()=>{d(cc.categories),u(cc.emojis)};cc?e():async function(){ac||(ac=a.e(1).then(a.t.bind(null,309,3)),nc=(await ac).default,cc=Object(Qn.b)(nc));return ac}().then(e)},200)},[]);const E=Object(n.m)(e=>{b(e);const t=document.getElementById("emoji-category-"+e);Object(qn.a)(s.current,t,"start",50,800)},[]),O=Object(n.m)((e,a)=>{t(e,a)},[t]),f=Object(rt.a)([],l.R);const j=Object(ce.a)("EmojiPicker",e);return m&&f?n.a.createElement("div",{className:j},n.a.createElement("div",{ref:r,className:"EmojiPicker-header"},v.map((function(e,t){const a=ec[e.id];return a&&n.a.createElement(D.a,{className:"symbol-set-button "+(t===h?"activated":""),round:!0,faded:!0,color:"translucent",onClick:()=>E(t),ariaLabel:e.name},n.a.createElement("i",{className:a}))}))),n.a.createElement("div",{ref:s,className:"EmojiPicker-main no-selection no-scrollbar"},v.map((e,t)=>n.a.createElement(Jn,{category:e,index:t,allEmojis:m,observeIntersection:g,shouldRender:h>=t-1&&h<=t+1,onEmojiSelect:O})))):n.a.createElement("div",{className:j},n.a.createElement(he.a,null))}));const rc=o.g?8:16;var lc=Object(n.h)(({stickerSet:e,loadAndPlay:t,index:a,observeIntersection:c,shouldRender:s,onStickerSelect:r,onStickerUnfave:i})=>{const d=Object(n.q)(null);Object(ca.c)(d,c);const{transitionClassNames:m}=Object(W.a)(s,void 0,void 0,"slow"),u=o.g?Math.floor((y.a.get().width-8)/(l.vb+rc)):5,h=Math.ceil(e.count/u)*(l.vb+rc);return n.a.createElement("div",{ref:d,key:e.id,id:"sticker-set-"+a,className:"symbol-set"},n.a.createElement("p",{className:"symbol-set-name"},e.title),n.a.createElement("div",{className:Object(ce.a)("symbol-set-container",m),style:`height: ${h}px;`},s&&e.stickers&&e.stickers.map(a=>n.a.createElement(ma,{key:a.id,sticker:a,size:l.vb,observeIntersection:c,noAnimate:!t,onClick:r,clickArg:a,onUnfaveClick:"favorite"===e.id?i:void 0}))))});a(284);const oc=[];var ic=Object(n.h)(Object(c.h)(e=>{const{setsById:t,added:a,recent:n,favorite:c}=e.stickers;return{recentStickers:n.stickers,favoriteStickers:c.stickers,stickerSetsById:t,addedSetIds:a.setIds,shouldPlay:e.settings.byKey.shouldLoopStickers}},(e,t)=>Object(u.l)(t,["loadStickerSets","loadRecentStickers","loadFavoriteStickers","loadAddedStickers","addRecentSticker","unfaveSticker"]))(({className:e,loadAndPlay:t,canSendStickers:a,recentStickers:c,favoriteStickers:s,addedSetIds:r,stickerSetsById:o,shouldPlay:i,onStickerSelect:d,loadStickerSets:m,loadRecentStickers:u,loadFavoriteStickers:h,loadAddedStickers:b,addRecentSticker:g,unfaveSticker:p})=>{const v=Object(n.q)(null),E=Object(n.q)(null),[O,f]=Object(n.r)(0),{observe:j}=Object(ca.a)({rootRef:v,throttleMs:200},e=>{e.forEach(e=>{const{id:t}=e.target;if(!t||!t.startsWith("sticker-set-"))return;const a=Number(t.replace("sticker-set-",""));oc[a]=e.isIntersecting});const t=oc.map((e,t)=>({index:t,isIntersecting:e})).filter(({isIntersecting:e})=>e);t.length&&f(t[Math.floor(t.length/2)].index)}),{observe:C}=Object(ca.a)({rootRef:E}),y=Object(F.a)(),k=Boolean(r),N=Object(n.p)(()=>r?[{id:"recent",title:y("RecentStickers"),stickers:c,count:c.length},{id:"favorite",title:y("FavoriteStickers"),stickers:s,count:s.length},...r.map(e=>o[e]).filter(Boolean)]:qe.a,[r,y,c,s,o]),I=Object(n.p)(()=>k&&0===N.filter(e=>e.stickers&&e.stickers.length).length,[N,k]);Object(n.n)(()=>{t&&(m(),u(),h())},[t,h,u,m]),Object(n.n)(()=>{r&&r.length&&b()},[r,b]),Object(Ve.a)(E),Object(n.n)(()=>{if(!k)return;const e=E.current;if(!e)return;const t=52*O-(e.offsetWidth/2-26);Object(Zn.a)(e,t)},[k,O]);const S=Object(n.m)(e=>{f(e);const t=document.getElementById("sticker-set-"+e);Object(qn.a)(v.current,t,"start",void 0,500)},[]),w=Object(n.m)(e=>{d(e),g({sticker:e})},[g,d]),P=Object(n.m)(e=>{p({sticker:e})},[p]),M=Object(rt.a)([],l.mb);const L=Object(ce.a)("StickerPicker",e);return k&&M&&!I&&a?n.a.createElement("div",{className:L},n.a.createElement("div",{ref:E,className:"StickerPicker-header no-selection no-scrollbar"},N.map((function(e,t){const a=e.stickers&&e.stickers[0],c=Object(ce.a)("symbol-set-button sticker-set-button",t===O&&"activated");return"recent"===e.id||"favorite"===e.id||e.hasThumbnail||!a?n.a.createElement(D.a,{key:e.id,className:c,ariaLabel:e.title,round:!0,faded:"recent"===e.id||"favorite"===e.id,color:"translucent",onClick:()=>S(t)},"recent"===e.id?n.a.createElement("i",{className:"icon-recent"}):"favorite"===e.id?n.a.createElement("i",{className:"icon-favorite"}):e.isAnimated?n.a.createElement(ia,{stickerSet:e,observeIntersection:C}):n.a.createElement(da,{stickerSet:e,observeIntersection:C})):n.a.createElement(ma,{key:e.id,sticker:a,size:l.wb,title:e.title,className:c,observeIntersection:C,onClick:S,clickArg:t})}))),n.a.createElement("div",{ref:v,className:"StickerPicker-main no-scrollbar"},N.map((e,a)=>n.a.createElement(lc,{key:e.id,stickerSet:e,loadAndPlay:Boolean(i&&t),index:a,observeIntersection:j,shouldRender:O>=a-1&&O<=a+1,onStickerSelect:w,onStickerUnfave:P})))):n.a.createElement("div",{className:L},a?I?n.a.createElement("div",{className:"picker-disabled"},"You have no saved Stickers."):n.a.createElement(he.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending stickers is not allowed in this chat."))}));a(285);function dc(){return(dc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}var mc=Object(n.h)(({gif:e,observeIntersection:t,isDisabled:a,onClick:c})=>{const r=Object(n.q)(null),l=Object(n.q)(null),o=e.thumbnail&&!!e.thumbnail.dataUri,i="gif"+e.id,d=Object(ca.b)(r,t)&&!a,m=Object(v.a)(i+"?size=m",!d,s.ApiMediaFormat.BlobUrl),u=Object(Na.a)(e.thumbnail&&e.thumbnail.dataUri,Boolean(m)),h=Object(v.a)(i,!d,s.ApiMediaFormat.BlobUrl),b=Boolean(d&&h),{transitionClassNames:g}=Object(la.a)(o||m||h,"slow"),{isBuffered:p,bufferingHandlers:E}=Object(Y.a)(!0),O=d&&!p;Object(Q.a)(l,[b]);const f=Object(n.m)(()=>c({...e,blobUrl:h}),[c,e,h]),j=Object(ce.a)("GifButton",e.width&&e.height&&e.width<e.height?"vertical":"horizontal",g,i);return n.a.createElement("div",{ref:r,className:j,onClick:f},o&&n.a.createElement("canvas",{ref:u,className:"thumbnail"}),!o&&m&&n.a.createElement("img",{src:m,alt:"",className:"thumbnail"}),(b||m)&&n.a.createElement("video",dc({ref:l,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"none"},E),n.a.createElement("source",{src:h})),O&&n.a.createElement(L.a,{color:m||o?"white":"black"}))});a(286);var uc=Object(n.h)(Object(c.h)(e=>({savedGifs:e.gifs.saved.gifs}),(e,t)=>Object(u.l)(t,["loadSavedGifs"]))(({className:e,loadAndPlay:t,canSendGifs:a,savedGifs:c,onGifSelect:s,loadSavedGifs:r})=>{const o=Object(n.q)(null),{observe:i}=Object(ca.a)({rootRef:o,debounceMs:300});Object(n.n)(()=>{t&&r()},[t,r]);const d=Object(rt.a)([],l.mb);return n.a.createElement("div",{ref:o,className:Object(ce.a)("GifPicker no-scrollbar",e)},a?d&&c&&c.length?c.map(e=>n.a.createElement(mc,{key:e.id,gif:e,observeIntersection:i,isDisabled:!t,onClick:s})):d&&c?n.a.createElement("div",{className:"picker-disabled"},"No saved GIFs."):n.a.createElement(he.a,null):n.a.createElement("div",{className:"picker-disabled"},"Sending GIFs is not allowed in this chat."))}));let hc;!function(e){e[e.Emoji=0]="Emoji",e[e.Stickers=1]="Stickers",e[e.GIFs=2]="GIFs"}(hc||(hc={}));const bc=Object.values(hc).filter(e=>"string"==typeof e),gc={[hc.Emoji]:"icon-smile",[hc.Stickers]:"icon-stickers",[hc.GIFs]:"icon-gifs"};var pc=Object(n.h)(({activeTab:e,onSwitchTab:t,onRemoveSymbol:a,onSearchOpen:c})=>{function s(a){return n.a.createElement(D.a,{className:"symbol-tab-button "+(e===a?"activated":""),onClick:()=>t(a),ariaLabel:bc[a],round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:gc[a]}))}const r=Object(n.m)(()=>{c(e===hc.Stickers?"stickers":"gifs")},[e,c]);return n.a.createElement("div",{className:"SymbolMenu-footer",onClick:function(e){e.stopPropagation()}},e!==hc.Emoji&&n.a.createElement(D.a,{className:"symbol-search-button",ariaLabel:e===hc.Stickers?"Search Stickers":"Search GIFs",round:!0,faded:!0,color:"translucent",onClick:r},n.a.createElement("i",{className:"icon-search"})),s(hc.Emoji),s(hc.Stickers),s(hc.GIFs),e===hc.Emoji&&n.a.createElement(D.a,{className:"symbol-delete-button",onClick:a,ariaLabel:"Remove Symbol",round:!0,faded:!0,color:"translucent"},n.a.createElement("i",{className:"icon-delete-left"})))});a(287);let vc=!1;var Ec=Object(n.h)(({isOpen:e,allowedAttachmentOptions:t,onLoad:a,onClose:c,onEmojiSelect:s,onStickerSelect:r,onGifSelect:l,onRemoveSymbol:i,onSearchOpen:d,addRecentEmoji:m})=>{const[u,h]=Object(n.r)(0),[b,g]=Object(n.r)([]),[p,v]=Kn(e,c),{shouldRender:E,transitionClassNames:O}=Object(W.a)(e,c,!1,!1);!vc&&e&&(vc=!0),Object(n.n)(()=>{a()},[a]),Object(n.o)(()=>{if(o.g)return e&&(document.body.classList.add("enable-symbol-menu-transforms"),document.body.classList.add("is-symbol-menu-open")),()=>{e&&Object(V.b)(()=>{document.body.classList.remove("is-symbol-menu-open"),setTimeout(()=>{document.body.classList.remove("enable-symbol-menu-transforms")},350)})}},[e]);const f=Object(n.q)(b);f.current=b,Object(n.n)(()=>{f.current.length&&(f.current.forEach(e=>{m({emoji:e})}),g([]))},[e,u,m]);const j=Object(n.m)((e,t)=>{g(e=>[...e,t]),s(e)},[s]),C=Object(n.m)(e=>{c(),d(e)},[c,d]),y=Object(F.a)(),{canSendStickers:k,canSendGifs:N}=t;function I(t,a){switch(u){case hc.Emoji:return n.a.createElement(sc,{className:"picker-tab",onEmojiSelect:j});case hc.Stickers:return n.a.createElement(ic,{className:"picker-tab",loadAndPlay:!!k&&(e&&(t||a)),canSendStickers:k,onStickerSelect:r});case hc.GIFs:return n.a.createElement(uc,{className:"picker-tab",loadAndPlay:!!N&&(e&&(t||a)),canSendGifs:N,onGifSelect:l})}}const S=n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"SymbolMenu-main",onClick:function(e){e.stopPropagation()}},vc&&n.a.createElement(T.a,{name:"slide",activeKey:u,renderCount:bc.length},I)),o.g&&n.a.createElement(D.a,{round:!0,faded:!0,color:"translucent",ariaLabel:y("Close"),className:"symbol-close-button",size:"tiny",onClick:c},n.a.createElement("i",{className:"icon-close"})),n.a.createElement(pc,{activeTab:u,onSwitchTab:h,onRemoveSymbol:i,onSearchOpen:C}));if(o.g){if(!E)return;const e=Object(ce.a)("SymbolMenu mobile-menu",O);return n.a.createElement(Pn.a,null,n.a.createElement("div",{className:e},S))}return n.a.createElement(Nn.a,{isOpen:e,positionX:"left",positionY:"bottom",onClose:c,className:"SymbolMenu",onCloseAnimationEnd:c,onMouseEnter:o.l?void 0:p,onMouseLeave:o.l?void 0:v,noCloseOnBackdrop:!o.l},S)});a(288);var Oc=Object(n.h)(({isOpen:e,allowedAttachmentOptions:t,onFileSelect:a,onPollCreate:c,onClose:s})=>{const[r,i]=Kn(e,s),d=Object(n.m)((e,t)=>{const{files:n}=e.target;n&&n.length>0&&a(Array.from(n),t)},[a]),m=Object(n.m)(()=>{va(l.k,e=>d(e,!0))},[d]),u=Object(n.m)(()=>{va("*",e=>d(e,!1))},[d]),h=Object(F.a)(),{canAttachMedia:b,canAttachPolls:g}=t;return n.a.createElement(Nn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:s,className:"AttachMenu fluid",onCloseAnimationEnd:s,onMouseEnter:o.l?void 0:r,onMouseLeave:o.l?void 0:i,noCloseOnBackdrop:!o.l},!b&&n.a.createElement(z.a,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),b&&n.a.createElement(n.a.Fragment,null,n.a.createElement(z.a,{icon:"photo",onClick:m},h("AttachmentMenu.PhotoOrVideo")),n.a.createElement(z.a,{icon:"document",onClick:u},"Document")),g&&n.a.createElement(z.a,{icon:"poll",onClick:c},h("Poll")))});a(289);var fc=Object(n.h)(Object(c.h)(e=>{const{stickers:t}=e.stickers.forEmoji;return{stickers:t}},(e,t)=>Object(u.l)(t,["clearStickersForEmoji"]))(({isOpen:e,onStickerSelect:t,stickers:a,clearStickersForEmoji:c})=>{const s=Object(n.q)(null),{shouldRender:r,transitionClassNames:i}=Object(W.a)(e,void 0,void 0,!1),d=Object(f.a)(a,!0),m=a||d,{observe:u}=Object(ca.a)({rootRef:s,throttleMs:200});Object(n.n)(()=>e?Object(b.a)(c):void 0,[e,c]);const h=Object(ce.a)("StickerTooltip composer-tooltip custom-scroll",i,!(m&&m.length)&&"hidden");return n.a.createElement("div",{ref:s,className:h,onMouseEnter:o.l?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:o.l?void 0:()=>{document.body.classList.remove("no-select")}},r&&m?m.map(e=>n.a.createElement(ma,{key:e.id,sticker:e,size:l.vb,observeIntersection:u,onClick:t,clickArg:e})):r?n.a.createElement(he.a,null):void 0)}));a(290);var jc=Object(n.h)(Object(c.h)((e,{messageId:t})=>{const{chatId:a}=Object(d.y)(e)||{};return a?{message:Object(d.k)(e,a,t)}:{}},(e,t)=>Object(u.l)(t,["clickInlineButton"]))(({isOpen:e,message:t,onClose:a,clickInlineButton:c})=>{const[s,r]=Kn(e,a);if(t&&t.keyboardButtons)return n.a.createElement(Nn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",onClose:a,className:"KeyboardMenu",onCloseAnimationEnd:a,onMouseEnter:o.l?void 0:s,onMouseLeave:o.l?void 0:r,noCloseOnBackdrop:!o.l},n.a.createElement("div",{className:"content"},t.keyboardButtons.map(e=>n.a.createElement("div",{className:"row"},e.map(e=>n.a.createElement(D.a,{ripple:!0,disabled:"NOT_SUPPORTED"===e.type,onClick:()=>c({button:e})},e.text))))))}));a(291);var Cc=Object(n.h)(({isOpen:e,onSilentSend:t,onScheduleSend:a,onClose:c,onCloseAnimationEnd:s})=>{const[r,l]=Kn(e,c),i=Object(F.a)();return n.a.createElement(Nn.a,{isOpen:e,autoClose:!0,positionX:"right",positionY:"bottom",className:"CustomSendMenu",onClose:c,onCloseAnimationEnd:s,onMouseEnter:o.l?void 0:r,onMouseLeave:o.l?void 0:l,noCloseOnBackdrop:!o.l},t&&n.a.createElement(z.a,{icon:"mute",onClick:t},i("SendWithoutSound")),a&&n.a.createElement(z.a,{icon:"schedule",onClick:a},i("ScheduleMessage")))}),yc=a(133),kc=a(158),Nc=a(169);a(292);var Ic=Object(n.h)(({isOpen:e,emojis:t,onClose:a,onEmojiSelect:c,addRecentEmoji:s})=>{const r=Object(n.q)(null),{shouldRender:l,transitionClassNames:i}=Object(W.a)(e,void 0,void 0,!1),d=Object(Nc.a)(t.length?t:void 0,350)||[],[m,u]=Object(n.r)(-1);Object(n.n)(()=>{u(0)},[t]),Object(n.n)(()=>{!function(e,t){const a=t.current;if(!a)return;const{visibleIndexes:n,allElements:c}=Un(a,".EmojiButton",8,!0,!0,!0);if(!c.length||!c[e])return;const s=n[0];if(!n.includes(e)||e===s&&!Gn(a,c[s],!0)){const t="start"===(e>n[n.length-1]?"start":"end")?44*e:0;Object(Zn.a)(a,t)}}(m,r)},[m]);const h=Object(n.m)(e=>{if(!t.length)return-1;const a=t.length;return Object(zn.a)(a,e)},[t]),b=Object(n.m)((e,t)=>{t.preventDefault(),u(t=>h(t+e))},[u,h]),g=Object(n.m)(e=>{if(t.length&&m>-1){const a=t[m];a&&(e.preventDefault(),c(a.native),s({emoji:a.id}))}},[s,t,c,m]);Object(n.n)(()=>e?Object(xe.a)({onEsc:a,onLeft:e=>b(-1,e),onRight:e=>b(1,e),onEnter:g}):void 0,[b,g,e,a]);const p=Object(ce.a)("EmojiTooltip composer-tooltip custom-scroll-x",i);return n.a.createElement("div",{ref:r,className:p,onMouseEnter:o.l?void 0:()=>{document.body.classList.add("no-select")},onMouseLeave:o.l?void 0:()=>{document.body.classList.remove("no-select")}},l&&d?d.map((e,t)=>n.a.createElement(Xn,{key:e.id,emoji:e,focus:m===t,onClick:c})):l?n.a.createElement(he.a,null):void 0)}),Sc=a(165);a(293);var wc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),n=a&&Object(d.m)(e,a.id);if(!a||!n)return{};const{query:c,results:s}=Object(d.A)(e)||{},{totalCount:r,foundIds:l}=s||{};return{chat:a,messagesById:n,query:c,totalCount:r,foundIds:l}},(e,t)=>Object(u.l)(t,["searchTextMessagesLocal","focusMessage"]))(({chatId:e,threadId:t,chat:a,messagesById:s,query:r,totalCount:l,foundIds:o,searchTextMessagesLocal:i,focusMessage:h})=>{const b=Object(F.a)(),g=Object(n.p)(()=>{if(!(r&&o&&o.length&&s))return qe.a;const n=o.map(n=>{const r=s[n];if(!r)return;const l=r.senderId?Object(d.Db)(Object(c.e)(),r.senderId):void 0;let o;if(a&&Object(m.ib)(a))o=a;else if(r.forwardInfo){const{isChannelPost:e,fromChatId:t}=r.forwardInfo;o=e&&t?Object(d.f)(Object(c.e)(),t):void 0}else o=r.senderId?Object(d.f)(Object(c.e)(),r.senderId):void 0;return{message:r,senderUser:l,senderChat:o,onClick:()=>h({chatId:e,threadId:t,messageId:n})}}).filter(Boolean);return Object(u.k)(n,({message:e})=>e.date,"desc")},[e,t,h,o,a,s,r]);return n.a.createElement(pe.a,{className:"RightSearch custom-scroll",items:g,preloadBackwards:0,onLoadMore:i,noFastList:!0},n.a.createElement("p",{className:"helper-text"},r?1===l?"1 message found":(g.length&&(l||g.length)||"No")+" messages found":"Search messages"),g.map(({message:e,senderUser:t,senderChat:a,onClick:c})=>{const s=a?Object(m.l)(a):Object(m.Y)(t),l=Object(m.M)(b,e);return n.a.createElement(ve.a,{className:"chat-item-clickable search-result-message m-0",onClick:c},n.a.createElement(R.a,{chat:a,user:t}),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},n.a.createElement("h3",null,s&&Object(x.a)(s)),n.a.createElement(Sc.a,{message:e})),n.a.createElement("div",{className:"subtitle"},Object(x.a)(l,["emoji","highlight"],{highlight:r}))))}))})),Pc=a(107);var Mc=Object(n.h)(Object(c.h)((e,{stickerSetId:t})=>({set:Object(d.ub)(e,t),shouldPlay:Object(d.tb)(e)}),(e,t)=>Object(u.l)(t,["loadStickers","toggleStickerSet"]))(({stickerSetId:e,observeIntersection:t,set:a,shouldPlay:c,loadStickers:s,toggleStickerSet:r,isSomeModalOpen:o,onModalToggle:i})=>{const d=Object(F.a)(),m=a&&Boolean(a.installedDate),u=Boolean(a&&a.stickers),[h,b,g]=Object(Be.a)();Object(Pc.a)(()=>{i(h)},[h,i]);const p=Object(n.p)(()=>{if(!a)return[];const e=(a.covers||[]).map(({id:e})=>e),t=a.stickers?a.stickers.filter(({id:t})=>!e.includes(t)):[];return[...a.covers||[],...t].slice(0,5)},[a]);Object(n.n)(()=>{!u&&p.length<5&&s({stickerSetId:e})},[u,p.length,s,e]);const v=Object(n.m)(()=>{r({stickerSetId:e})},[r,e]);if(!a)return;const E=p.length>0;return n.a.createElement("div",{key:a.id,className:"sticker-set"},n.a.createElement("div",{className:"sticker-set-header"},n.a.createElement("div",{className:"title-wrapper"},n.a.createElement("h3",{className:"title"},a.title),n.a.createElement("p",{className:"count"},d("Stickers",a.count,"i"))),n.a.createElement(D.a,{className:m?"is-added":void 0,color:"primary",size:"tiny",pill:!0,fluid:!0,onClick:v},d(m?"Stickers.Installed":"Stickers.Install"))),n.a.createElement("div",{className:"sticker-set-main"},!E&&n.a.createElement(L.a,null),E&&p.map(e=>n.a.createElement(ma,{sticker:e,size:l.xb,observeIntersection:t,noAnimate:!c||h||o,onClick:b}))),E&&n.a.createElement(ha.a,{isOpen:h,fromSticker:p[0],onClose:g}))}));a(294);const Fc=Object(V.g)(e=>e(),6e4,!0);var Lc=Object(n.h)(Object(c.h)(e=>{const t=Object(d.z)(e),{query:a,resultIds:n}=t||{},{featured:c}=e.stickers;return{query:a,featuredIds:c.setIds,resultIds:n}},(e,t)=>Object(u.l)(t,["loadFeaturedStickers"]))(({query:e,featuredIds:t,resultIds:a,loadFeaturedStickers:c})=>{const s=Object(n.q)(null),[r,l]=Object(n.r)(!1),{observe:o}=Object(ca.a)({rootRef:s,throttleMs:200});return Object(n.n)(()=>{Fc(()=>{c()})}),n.a.createElement("div",{ref:s,className:"StickerSearch custom-scroll"},function(){if(void 0!==e)return!e&&t?t.map(e=>n.a.createElement(Mc,{key:e,stickerSetId:e,observeIntersection:o,isSomeModalOpen:r,onModalToggle:l})):a?a.length?a.map(e=>n.a.createElement(Mc,{key:e,stickerSetId:e,observeIntersection:o,isSomeModalOpen:r,onModalToggle:l})):n.a.createElement("p",{className:"helper-text"},"Nothing found."):n.a.createElement(he.a,null)}())}));a(295);var Ac=Object(n.h)(Object(c.h)(e=>{const t=Object(d.s)(e),{query:a,results:n}=t||{},{chatId:c}=Object(d.y)(e)||{},s=c?Object(d.f)(e,c):void 0;return{query:a,results:n,chat:s,isChatWithBot:s?Object(d.N)(e,s):void 0}},(e,t)=>Object(u.l)(t,["searchMoreGifs","sendMessage","setGifSearchQuery"]))(({query:e,results:t,chat:a,isChatWithBot:c,searchMoreGifs:s,sendMessage:r,setGifSearchQuery:l})=>{const i=Object(n.q)(null),{observe:d}=Object(ca.a)({rootRef:i,debounceMs:300}),{canSendGifs:u}=Object(m.c)(a,c),h=Object(n.m)(e=>{u&&r({gif:e}),o.l&&l({query:void 0})},[u,r,l]),b=Object(F.a)();const g=Boolean(void 0!==e&&t&&t.length);return n.a.createElement("div",{className:"GifSearch"},n.a.createElement(pe.a,{ref:i,className:Object(ce.a)("gif-container custom-scroll",g&&"grid"),items:t,itemSelector:".GifButton",preloadBackwards:96,noFastList:!0,onLoadMore:s},function(){if(void 0!==e)return t?t.length?t.map(e=>n.a.createElement(mc,{key:e.id,gif:e,observeIntersection:d,onClick:h})):n.a.createElement("p",{className:"helper-text"},b("NoGIFsFound")):n.a.createElement(he.a,null)}()))}));a(296);var Tc=Object(n.h)(Object(c.h)((e,{answer:t})=>{const{voters:a,offsets:n}=e.pollResults;return{voters:a&&a[t.option],offset:n&&n[t.option]||""}},(e,t)=>Object(u.l)(t,["loadPollOptionResults","openChat","closePollResults"]))(({chat:e,message:t,answer:a,answerVote:c,totalVoters:s,voters:r,offset:l,loadPollOptionResults:o,openChat:i,closePollResults:d})=>{const m=Object(f.a)(c.votersCount),[u,h]=Object(n.r)(!0),b=Boolean(r),{option:g,text:p}=a;Object(n.n)(()=>{b&&m===c.votersCount||o({chat:e,messageId:t.id,option:g,offset:l,limit:4,shouldResetVoters:!0})},[c.votersCount,b]);const v=Object(n.m)(()=>{h(!0),o({chat:e,messageId:t.id,option:g,offset:l,limit:50})},[e,o,t.id,l,g]);Object(n.n)(()=>{h(!1)},[r]);const E=Object(n.m)(e=>{i({id:e}),d()},[d,i]);return n.a.createElement("div",{className:"PollAnswerResults"},n.a.createElement("div",{className:"poll-voters"},r?r.map(e=>n.a.createElement(ve.a,{key:e,className:"chat-item-clickable",onClick:()=>E(e)},n.a.createElement(Ee.a,{avatarSize:"tiny",userId:e,forceShowSelf:!0,noStatusOrTyping:!0}))):n.a.createElement(he.a,null),r&&function(){const e=c.votersCount-r.length;return c.votersCount>4&&e>0&&n.a.createElement(Qt,{count:e,itemName:"voter",isLoading:u,onClick:v})}()),n.a.createElement("div",{className:"answer-head"},n.a.createElement("span",{className:"answer-title"},p),n.a.createElement("span",{className:"answer-percent"},(O=c.votersCount,(j=s)>0?(O/j*100).toFixed():0),"%")));var O,j}));a(297);var Dc=Object(n.h)(Object(c.h)(e=>{const{pollResults:{chatId:t,messageId:a},lastSyncTime:n}=e;if(!t||!a)return{};return{chat:Object(d.f)(e,t),message:Object(d.k)(e,t,a),lastSyncTime:n}})(({chat:e,message:t,lastSyncTime:a})=>{if(!t||!e)return n.a.createElement(he.a,null);const{summary:c,results:s}=Object(m.H)(t);if(!s.results)return;const r=Object(u.c)(s.results,"option");return n.a.createElement("div",{className:"PollResults"},n.a.createElement("h3",{className:"poll-question"},c.question),n.a.createElement("div",{className:"poll-results-list custom-scroll"},a&&c.answers.map(a=>n.a.createElement(Tc,{key:`${t.id}-${a.option}`,chat:e,message:t,answer:a,answerVote:r[a.option],totalVoters:s.totalVoters})),!a&&n.a.createElement(he.a,null)))}));a(160);var Bc=Object(n.h)(Object(c.h)((e,{userId:t})=>{const a=Object(d.Db)(e,t),n=Object(d.f)(e,t),{progress:c}=e.management;return{user:a,chat:n,progress:c}},(e,t)=>Object(u.l)(t,["updateContact","deleteUser","closeManagement","openChat","deleteHistory"]))(({userId:e,user:t,chat:a,progress:c,updateContact:s,deleteUser:l,deleteHistory:o,closeManagement:i,openChat:d})=>{const[m,u,h]=Object(Be.a)(),[b,g]=Object(n.r)(!1),[p,v]=Object(n.r)(),E=Object(F.a)(),O=t&&t.firstName||"",f=t&&t.lastName||"",j=a?a.isMuted:void 0,[C,y]=Object(n.r)(O),[k,N]=Object(n.r)(f),[I,S]=Object(n.r)(!j);Object(n.n)(()=>{S(!j)},[j]),Object(n.n)(()=>{g(!1),h()},[h,e]),Object(n.n)(()=>{y(O),N(f)},[O,f,t]),Object(n.n)(()=>{c===r.f.Complete&&(g(!1),v(void 0),h())},[h,c]);const w=Object(n.m)(e=>{y(e.target.value),g(!0)},[]),P=Object(n.m)(e=>{N(e.target.value),g(!0)},[]),M=Object(n.m)(e=>{S(e.target.checked),g(!0)},[]),A=Object(n.m)(()=>{const t=C.trim(),a=k.trim();t.length||v("Please provide first name"),s({userId:e,isMuted:!I,firstName:t,lastName:a})},[C,k,s,e,I]),T=Object(n.m)(()=>{a.lastMessage&&o({chatId:a.id,maxId:a.lastMessage.id,shouldDeleteForAll:!1}),l({userId:e}),h(),i(),d({id:void 0})},[a.id,a.lastMessage,h,i,o,l,d,e]);if(!t)return;const D=c===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Ee.a,{userId:t.id,avatarSize:"jumbo",status:"original name",withFullInfo:!0}),n.a.createElement(ge.a,{id:"user-first-name",label:E("UserInfo.FirstNamePlaceholder"),onChange:w,value:C,error:"Please provide first name"===p?p:void 0}),n.a.createElement(ge.a,{id:"user-last-name",label:E("UserInfo.LastNamePlaceholder"),onChange:P,value:k}),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(ea.a,{checked:I,label:E("Notifications"),subLabel:E(I?"UserInfo.NotificationsEnabled":"UserInfo.NotificationsDisabled"),onChange:M}))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:u},E("DeleteContact")))),n.a.createElement(Ut,{isShown:b,onClick:A,disabled:D,ariaLabel:E("Save")},D?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Se.a,{isOpen:m,onClose:h,text:E("AreYouSureDeleteContact"),confirmLabel:E("DeleteContact"),confirmHandler:T,confirmIsDestructive:!0}))}));var xc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{progress:n}=e.management,c=Boolean(a.fullInfo&&a.fullInfo.linkedChatId);return{chat:a,progress:n,isBasicGroup:Object(m.hb)(a),hasLinkedChannel:c,canChangeInfo:Object(m.q)(a,"changeInfo"),canBanUsers:Object(m.q)(a,"banUsers")}},(e,t)=>Object(u.l)(t,["togglePreHistoryHidden","updateChat","closeManagement","deleteHistory","leaveChannel","deleteChannel","openChat"]))(({chatId:e,chat:t,progress:a,isBasicGroup:c,hasLinkedChannel:l,canChangeInfo:o,canBanUsers:i,onScreenSelect:d,togglePreHistoryHidden:u,updateChat:h,deleteHistory:b,leaveChannel:g,deleteChannel:p,closeManagement:E,openChat:O})=>{const[f,j,C]=Object(Be.a)(),y=t.title,k=t.fullInfo&&t.fullInfo.about||"",[N,I]=Object(n.r)(!1),[S,w]=Object(n.r)(y),[P,M]=Object(n.r)(k),[A,T]=Object(n.r)(),[D,B]=Object(n.r)(),R=Object(m.f)(t),U=Object(v.a)(R,!1,s.ApiMediaFormat.BlobUrl),G=Object(F.a)();Object(n.n)(()=>{a===r.f.Complete&&(I(!1),B(void 0))},[a]);const q=Object(n.m)(()=>{d(r.g.ChatPrivacyType)},[d]),z=Object(n.m)(()=>{d(r.g.Discussion)},[d]),$=Object(n.m)(()=>{d(r.g.GroupPermissions)},[d]),H=Object(n.m)(()=>{d(r.g.ChatAdministrators)},[d]),V=Object(n.m)(e=>{T(e),I(!0)},[]),_=Object(n.m)(e=>{w(e.target.value),I(!0)},[]),W=Object(n.m)(e=>{M(e.target.value),I(!0)},[]),Y=Object(n.m)(()=>{const t=S.trim(),a=P.trim();t.length?h({chatId:e,title:t,about:a,photo:A}):B("Group title can't be empty")},[P,e,A,S,h]),K=Object(n.m)(()=>{d(r.g.GroupMembers)},[d]),Q=Object(n.m)(()=>{if(!t.fullInfo)return;const{isPreHistoryHidden:e}=t.fullInfo;u({chatId:t.id,isEnabled:!e})},[t,u]),Z=Object(n.p)(()=>{if(!t.defaultBannedRights)return 0;let e=["sendMessages","sendMedia","embedLinks","sendPolls","changeInfo","inviteUsers","pinMessages"].filter(e=>!t.defaultBannedRights[e]).length;const{sendStickers:a,sendGifs:n}=t.defaultBannedRights;return a||n||(e+=1),e},[t]),X=t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,J=Object(n.m)(()=>{c?b({chatId:t.id,maxId:t.lastMessage.id,shouldDeleteForAll:!1}):t.isCreator?p({chatId:t.id}):g({chatId:t.id}),C(),E(),O({id:void 0})},[c,t.isCreator,t.id,t.lastMessage,C,E,b,g,p,O]);if(t.isRestricted)return;const ee=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Rt.a,{currentAvatarBlobUrl:U,onChange:V,disabled:!o}),n.a.createElement(ge.a,{id:"group-title",label:G("GroupName"),onChange:_,value:S,error:"Group title can't be empty"===D?D:void 0,disabled:!o}),n.a.createElement(ge.a,{id:"group-about",className:"mb-2",label:G("DescriptionPlaceholder"),onChange:W,value:P,disabled:!o}),t.isCreator&&n.a.createElement(ve.a,{icon:"lock",multiline:!0,ripple:!0,onClick:q},n.a.createElement("span",{className:"title"},G("GroupType")),n.a.createElement("span",{className:"subtitle"},t.username?G("TypePublic"):G("TypePrivate"))),l&&n.a.createElement(ve.a,{icon:"message",multiline:!0,ripple:!0,onClick:z},n.a.createElement("span",{className:"title"},G("LinkedChannel")),n.a.createElement("span",{className:"subtitle"},G("DiscussionUnlink"))),n.a.createElement(ve.a,{icon:"permissions",multiline:!0,ripple:!0,onClick:$,disabled:!i},n.a.createElement("span",{className:"title"},G("ChannelPermissions")),n.a.createElement("span",{className:"subtitle"},Z,"/",8)),n.a.createElement(ve.a,{icon:"admin",multiline:!0,ripple:!0,onClick:H},n.a.createElement("span",{className:"title"},G("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},Object(oa.a)(X)))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"group",multiline:!0,ripple:!0,onClick:K},n.a.createElement("span",{className:"title"},G("GroupMembers")),n.a.createElement("span",{className:"subtitle"},Object(oa.a)(t.membersCount))),t.fullInfo&&n.a.createElement("div",{className:"ListItem narrow no-selection"},n.a.createElement(ea.a,{checked:!t.fullInfo.isPreHistoryHidden,label:G("ChatHistory"),onChange:Q,disabled:!i}))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:j},G("DeleteMega")))),n.a.createElement(Ut,{isShown:N,onClick:Y,disabled:ee,ariaLabel:G("Save")},ee?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Se.a,{isOpen:f,onClose:C,textParts:Object(x.a)(c||!t.isCreator?G("AreYouSureDeleteAndExit"):G("AreYouSureDeleteThisChatWithGroup",t.title),["br","simple_markdown"]),confirmLabel:c||!t.isCreator?G("DeleteMega"):G("DeleteGroupForAll"),confirmHandler:J,confirmIsDestructive:!0}))}));var Rc=Object(n.h)(Object(c.h)((e,{chatId:t})=>({chat:Object(d.f)(e,t),currentUserId:e.currentUserId}),(e,t)=>Object(u.l)(t,["updateChatDefaultBannedRights"]))(({onScreenSelect:e,onChatMemberSelect:t,chat:a,currentUserId:c,updateChatDefaultBannedRights:s})=>{const[l,o]=Object(n.r)({}),[i,d]=Object(n.r)(!1),[m,u]=Object(n.r)(!1),h=Object(F.a)(),b=Object(n.m)(()=>{e(r.g.GroupRemovedUsers)},[e]),g=Object(n.m)(()=>{e(r.g.GroupUserPermissionsCreate)},[e]),p=Object(n.m)(a=>{t(a.userId,a.promotedByUserId===c),e(r.g.GroupUserPermissions)},[c,t,e]);Object(n.n)(()=>{o(a&&a.defaultBannedRights||{}),d(!1),setTimeout(()=>{u(!1)},250)},[a]);const v=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}o(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),d(!0)},[]),E=Object(n.m)(()=>{a&&(u(!0),s({chatId:a.id,bannedRights:l}))},[a,l,s]),O=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.kickedMembers?a.fullInfo.kickedMembers.length:0,[a]),f=Object(n.p)(()=>a&&a.fullInfo&&a.fullInfo.members?a.fullInfo.members.filter(({bannedRights:e})=>!!e):[],[a]),j=Object(n.m)(e=>{const{bannedRights:t}=e;if(!t||!a)return;const{defaultBannedRights:n}=a;return Object.keys(t).reduce((e,a)=>{if(!t[a]||n&&n[a]||"sendInline"===a||"viewMessages"===a||"sendGames"===a)return e;const c=function(e){switch(e){case"sendMessages":return"UserRestrictionsNoSend";case"sendMedia":return"UserRestrictionsNoSendMedia";case"sendStickers":return"UserRestrictionsNoSendStickers";case"embedLinks":return"UserRestrictionsNoEmbedLinks";case"sendPolls":return"UserRestrictionsNoSendPolls";case"changeInfo":return"UserRestrictionsNoChangeInfo";case"inviteUsers":return"UserRestrictionsInviteUsers";case"pinMessages":return"UserRestrictionsPinMessages";default:return}}(a);if(!c)return e;const s=h(c);return`${e}${e.length?", "+s:s}`},"")},[a,h]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading"},h("ChannelPermissionsHeader")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendMessages",checked:!l.sendMessages,label:h("UserRestrictionsSend"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendMedia",checked:!l.sendMedia,label:h("UserRestrictionsSendMedia"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendStickers",checked:!l.sendStickers&&!l.sendGifs,label:h("UserRestrictionsSendStickers"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendPolls",checked:!l.sendPolls,label:h("UserRestrictionsSendPolls"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"embedLinks",checked:!l.embedLinks,label:h("UserRestrictionsEmbedLinks"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"inviteUsers",checked:!l.inviteUsers,label:h("UserRestrictionsInviteUsers"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"pinMessages",checked:!l.pinMessages,label:h("UserRestrictionsPinMessages"),blocking:!0,onChange:v})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!l.changeInfo,label:h("UserRestrictionsChangeInfo"),blocking:!0,onChange:v}))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"delete-user",multiline:!0,ripple:!0,narrow:!0,onClick:b},n.a.createElement("span",{className:"title"},h("ChannelBlockedUsers")),n.a.createElement("span",{className:"subtitle"},O))),n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading"},h("PrivacyExceptions")),n.a.createElement(ve.a,{icon:"add-user",ripple:!0,onClick:g},h("ChannelAddException")),f.map(e=>n.a.createElement(ve.a,{key:e.userId,className:"chat-item-clickable exceptions-member",ripple:!0,onClick:()=>p(e)},n.a.createElement(Ee.a,{userId:e.userId,status:j(e)}))))),n.a.createElement(Ut,{isShown:i,onClick:E,ariaLabel:h("Save"),disabled:m},m?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var Uc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{byId:n}=e.users;return{chat:a,usersById:n}},(e,t)=>Object(u.l)(t,["updateChatMemberBannedRights"]))(({chat:e,usersById:t,updateChatMemberBannedRights:a})=>{const c=Object(F.a)(),s=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.kickedMembers?e.fullInfo.kickedMembers:[],[e]),r=Object(n.m)(e=>{if(!e.kickedByUserId)return;const a=t[e.kickedByUserId];return a?c("UserRemovedBy",Object(m.Y)(a)):void 0},[c,t]),l=Object(n.m)(t=>{if(e)return[{title:c("Unblock"),icon:"delete",destructive:!0,handler:()=>a({chatId:e.id,userId:t.userId,bannedRights:{}})}]},[c,e,a]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("p",{className:"text-muted"},c("NoBlockedGroup2")),s.map(e=>n.a.createElement(ve.a,{key:e.userId,className:"chat-item-clickable",ripple:!0,contextActions:l(e)},n.a.createElement(Ee.a,{userId:e.userId,status:r(e)}))))))}));var Gc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{progress:n}=e.management;return{chat:a,progress:n,isSignaturesShown:Boolean(a&&a.isSignaturesShown),canChangeInfo:Object(m.q)(a,"changeInfo")}},(e,t)=>Object(u.l)(t,["toggleSignatures","updateChat","closeManagement","leaveChannel","deleteChannel","openChat"]))(({chatId:e,chat:t,progress:a,isSignaturesShown:c,canChangeInfo:l,onScreenSelect:o,updateChat:i,toggleSignatures:d,closeManagement:u,leaveChannel:h,deleteChannel:b,openChat:g})=>{const p=t&&t.title||"",E=t&&t.fullInfo&&t.fullInfo.about||"",O=t&&t.fullInfo&&t.fullInfo.linkedChatId,[f,j,C]=Object(Be.a)(),[y,k]=Object(n.r)(!1),[N,I]=Object(n.r)(p),[S,w]=Object(n.r)(E),[P,M]=Object(n.r)(),[A,T]=Object(n.r)(),D=t&&Object(m.f)(t),B=Object(v.a)(D,!1,s.ApiMediaFormat.BlobUrl),x=Object(F.a)();Object(n.n)(()=>{a===r.f.Complete&&(k(!1),T(void 0))},[a]);const R=t&&t.fullInfo&&t.fullInfo.adminMembers&&t.fullInfo.adminMembers.length||0,U=Object(n.m)(()=>{o(r.g.ChatPrivacyType)},[o]),G=Object(n.m)(()=>{o(r.g.Discussion)},[o]),q=Object(n.m)(()=>{o(r.g.ChatAdministrators)},[o]),z=Object(n.m)(e=>{M(e),k(!0)},[]),$=Object(n.m)(e=>{I(e.target.value),k(!0)},[]),H=Object(n.m)(e=>{w(e.target.value),k(!0)},[]),V=Object(n.m)(()=>{const t=N.trim(),a=S.trim();t.length?i({chatId:e,title:t,about:a,photo:P}):T("Channel title can't be empty")},[S,e,P,N,i]),_=Object(n.m)(()=>{d({chatId:e,isEnabled:!c})},[e,c,d]),W=Object(n.m)(()=>{o(r.g.ChannelSubscribers)},[o]),Y=Object(n.m)(()=>{t.isCreator?b({chatId:t.id}):h({chatId:t.id}),C(),u(),g({id:void 0})},[t.isCreator,t.id,C,u,h,b,g]);if(t.isRestricted)return;const K=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(Rt.a,{currentAvatarBlobUrl:B,onChange:z,disabled:!l}),n.a.createElement(ge.a,{id:"channel-title",label:x("EnterChannelName"),onChange:$,value:N,error:"Channel title can't be empty"===A?A:void 0,disabled:!l}),n.a.createElement(ge.a,{id:"channel-about",className:"mb-2",label:x("DescriptionPlaceholder"),onChange:H,value:S,disabled:!l}),t.isCreator&&n.a.createElement(ve.a,{icon:"lock",ripple:!0,multiline:!0,onClick:U},n.a.createElement("span",{className:"title"},x("ChannelType")),n.a.createElement("span",{className:"subtitle"},t.username?x("TypePublic"):x("TypePrivate"))),n.a.createElement(ve.a,{icon:"message",multiline:!0,ripple:!0,onClick:G,disabled:!l},n.a.createElement("span",{className:"title"},x("Discussion")),n.a.createElement("span",{className:"subtitle"},x(O?"DiscussionUnlink":"Add"))),n.a.createElement(ve.a,{icon:"admin",multiline:!0,ripple:!0,onClick:q},n.a.createElement("span",{className:"title"},x("ChannelAdministrators")),n.a.createElement("span",{className:"subtitle"},R)),n.a.createElement("div",{className:"ListItem no-selection narrow"},n.a.createElement(ea.a,{checked:c,label:x("ChannelSignMessages"),onChange:_}))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"group",multiline:!0,ripple:!0,onClick:W},n.a.createElement("span",{className:"title"},x("ChannelSubscribers")),n.a.createElement("span",{className:"subtitle"},x("Subscribers",t.membersCount,"i")))),n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:j},t.isCreator?x("ChannelDelete"):x("LeaveChannel")))),n.a.createElement(Ut,{isShown:y,onClick:V,disabled:K,ariaLabel:x("Save")},K?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Se.a,{isOpen:f,onClose:C,text:t.isCreator?x("ChannelDeleteAlert"):x("ChannelLeaveAlert"),confirmLabel:t.isCreator?x("ChannelDelete"):x("LeaveChannel"),confirmHandler:Y,confirmIsDestructive:!0}))})),qc=a(53);var zc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{isUsernameAvailable:n}=Object(d.Y)(e,t);return{chat:a,isChannel:Object(m.ib)(a),progress:e.management.progress,isUsernameAvailable:n}},(e,t)=>Object(u.l)(t,["checkPublicLink","updatePublicLink","updatePrivateLink"]))(({chat:e,isChannel:t,progress:a,isUsernameAvailable:c,checkPublicLink:s,updatePublicLink:l,updatePrivateLink:o})=>{const i=Boolean(e.username),d=e.fullInfo&&e.fullInfo.inviteLink,[m,u]=Object(n.r)(i?"public":"private"),[h,b]=Object(n.r)(),[g,p,v]=Object(Be.a)(),E="public"===m&&h&&c||"private"===m&&i;Object(n.n)(()=>{m&&!d&&o()},[m,d,o]);const O=Object(n.m)(e=>{u(e)},[]),f=Object(n.m)(()=>{l({username:"public"===m?h:""})},[m,l,h]),j=Object(n.m)(()=>{v(),o()},[v,o]),C=Object(F.a)(),y=t?"Channel":"Mega",k=t?"Channel":"Group",N=[{value:"private",label:C(y+"Private"),subLabel:C(y+"PrivateInfo")},{value:"public",label:C(y+"Public"),subLabel:C(y+"PublicInfo")}],I=a===r.f.InProgress;return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("h3",{className:"section-heading"},C(k+"Type")),n.a.createElement(ra.a,{selected:m,name:"channel-type",options:N,onChange:O})),"private"===m?n.a.createElement("div",{className:"section"},d?n.a.createElement(n.a.Fragment,null,n.a.createElement(qc.a,{url:d,className:"group-link",text:d}),n.a.createElement("p",{className:"section-info"},C(y+"PrivateLinkHelp")),n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:p},C("RevokeLink")),n.a.createElement(Se.a,{isOpen:g,onClose:v,text:C("RevokeAlert"),confirmLabel:C("RevokeButton"),confirmHandler:j,confirmIsDestructive:!0})):n.a.createElement(he.a,null)):n.a.createElement("div",{className:"section no-border"},n.a.createElement($t,{asLink:!0,currentUsername:e.username,isLoading:I,isUsernameAvailable:c,checkUsername:s,onChange:b}),n.a.createElement("p",{className:"section-info"},C(k+".Username.CreatePublicLinkHelp")))),n.a.createElement(Ut,{isShown:E,disabled:I,ariaLabel:C("Save"),onClick:f},I?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})))}));var $c=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{forDiscussionIds:n,byId:c}=e.chats;return{chat:a,chatsByIds:c,forDiscussionIds:n,linkedChat:a&&a.fullInfo&&a.fullInfo.linkedChatId?Object(d.f)(e,a.fullInfo.linkedChatId):void 0,isChannel:a&&Object(m.ib)(a)}},(e,t)=>Object(u.l)(t,["loadGroupsForDiscussion","linkDiscussionGroup","unlinkDiscussionGroup"]))(({chat:e,chatId:t,chatsByIds:a,linkedChat:c,forDiscussionIds:s,isChannel:o,onScreenSelect:i,loadGroupsForDiscussion:d,linkDiscussionGroup:m,unlinkDiscussionGroup:u})=>{const[h,b]=Object(n.r)(),[g,p]=Object(n.r)(),[v,E]=Object(n.r)(!1),O=Object(n.m)(()=>E(!0),[]),[f,j,C]=Object(Be.a)(),[y,k,N]=Object(Be.a)(),I=Object(F.a)(),S=c&&c.id;Object(n.n)(()=>{d()},[d]),Object(n.n)(()=>{g||Object(_t.a)("DiscussionGroups").then(p)},[g]);const w=Object(n.m)(()=>{C(),u({channelId:o?t:S}),o||i(r.g.Initial)},[C,u,o,t,S,i]),P=Object(n.m)(()=>{N(),m({channelId:t,chatId:h})},[N,m,t,h]);function M(){const e=a[h];if(e)return n.a.createElement("div",{className:"modal-header"},n.a.createElement(R.a,{size:"tiny",chat:e}),n.a.createElement("div",{className:"modal-title"},I("Channel.DiscussionGroup.LinkGroup")))}function L(){const t=a[h];if(t)return t.hasPrivateLink?Object(x.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?`,["br","simple_markdown"]):Object(x.a)(`Do you want to make **${t.title}** the discussion board for **${e.title}**?\n\nAnyone from the channel will be able to see messages in this group.`,["br","simple_markdown"])}return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement("div",{className:"section-icon"},g&&n.a.createElement(Wt.a,{id:"discussionGroupsDucks",size:l.pb,animationData:g,play:v,noLoop:!0,onLoad:O})),c&&n.a.createElement("div",null,n.a.createElement(ve.a,{className:"chat-item-clickable",inactive:!0},n.a.createElement(Oe.a,{chatId:c.id})),n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:j},I(o?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel")),n.a.createElement(Se.a,{isOpen:f,onClose:C,header:n.a.createElement("div",{className:"modal-header"},n.a.createElement(R.a,{size:"tiny",chat:c}),n.a.createElement("div",{className:"modal-title"},I(o?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"))),textParts:Object(x.a)(I(o?"DiscussionUnlinkChannelAlert":"DiscussionUnlinkGroupAlert",c.title),["br","simple_markdown"]),confirmLabel:I(o?"DiscussionUnlinkGroup":"DiscussionUnlinkChannel"),confirmHandler:w,confirmIsDestructive:!0})),!c&&n.a.createElement("div",null,n.a.createElement("p",{className:"section-help"},I("DiscussionChannelHelp")),n.a.createElement("div",{teactFastList:!0},n.a.createElement(ve.a,{key:"create-group",icon:"group",ripple:!0,teactOrderKey:0,className:"not-implemented"},I("DiscussionCreateGroup")),s?s.map((e,t)=>n.a.createElement(ve.a,{key:e,teactOrderKey:t+1,className:"chat-item-clickable scroll-item",onClick:()=>{b(e),k()}},n.a.createElement(Oe.a,{chatId:e}))):n.a.createElement(Xe.a,{key:"nothing-found",teactOrderKey:0,text:"No discussion groups found"})),n.a.createElement("p",{className:"mt-4 mb-0 section-help"},I("DiscussionChannelHelp2")),n.a.createElement(Se.a,{isOpen:y,onClose:N,header:M(),textParts:L(),confirmLabel:I("DiscussionLinkGroup"),confirmHandler:P,isButtonsInOneRow:!0})))))}));var Hc=Object(n.h)(Object(c.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(d.f)(e,t);return{chat:n,isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(u.l)(t,["updateChatMemberBannedRights"]))(({chat:e,selectedChatMemberId:t,onScreenSelect:a,updateChatMemberBannedRights:c,isFormFullyDisabled:s})=>{const[l,o]=Object(n.r)({}),[i,d]=Object(n.r)(!1),[m,u]=Object(n.r)(!1),[h,b,g]=Object(Be.a)(),p=Object(F.a)(),v=Object(n.p)(()=>{if(e&&e.fullInfo&&e.fullInfo.members)return e.fullInfo.members.find(({userId:e})=>e===t)},[e,t]);Object(n.n)(()=>{e&&e.fullInfo&&t&&!v&&a(r.g.GroupPermissions)},[e,a,v,t]),Object(n.n)(()=>{o(v&&v.bannedRights||e&&e.defaultBannedRights||{}),d(!1),u(!1)},[e,v]);const E=Object(n.m)(e=>{const{name:t}=e.target;function a(e){return!e||void 0}o(e=>({...e,[t]:a(e[t]),..."sendStickers"===t&&{sendGifs:a(e[t])}})),d(!0)},[]),O=Object(n.m)(()=>{e&&t&&(u(!0),c({chatId:e.id,userId:t,bannedRights:l}))},[e,t,l,c]),f=Object(n.m)(()=>{e&&t&&c({chatId:e.id,userId:t,bannedRights:{viewMessages:!0}})},[e,t,c]),j=Object(n.m)(t=>!!s||!(!e||!e.defaultBannedRights)&&e.defaultBannedRights[t],[e,s]);if(v)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(Ee.a,{userId:v.userId})),n.a.createElement("h3",{className:"section-heading mt-4"},p("UserRestrictionsCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendMessages",checked:!l.sendMessages,label:p("UserRestrictionsSend"),blocking:!0,disabled:j("sendMessages"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendMedia",checked:!l.sendMedia,label:p("UserRestrictionsSendMedia"),blocking:!0,disabled:j("sendMedia"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendStickers",checked:!l.sendStickers&&!l.sendGifs,label:p("UserRestrictionsSendStickers"),blocking:!0,disabled:j("sendStickers"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"sendPolls",checked:!l.sendPolls,label:p("UserRestrictionsSendPolls"),blocking:!0,disabled:j("sendPolls"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"embedLinks",checked:!l.embedLinks,label:p("UserRestrictionsEmbedLinks"),blocking:!0,disabled:j("embedLinks"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"inviteUsers",checked:!l.inviteUsers,label:p("UserRestrictionsInviteUsers"),blocking:!0,disabled:j("inviteUsers"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"pinMessages",checked:!l.pinMessages,label:p("UserRestrictionsPinMessages"),blocking:!0,disabled:j("pinMessages"),onChange:E})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!l.changeInfo,label:p("UserRestrictionsChangeInfo"),blocking:!0,disabled:j("changeInfo"),onChange:E}))),!s&&n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"delete-user",ripple:!0,destructive:!0,onClick:b},p("UserRestrictionsBlock")))),n.a.createElement(Ut,{isShown:i,onClick:O,ariaLabel:p("Save"),disabled:m},m?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Se.a,{isOpen:h,onClose:g,text:"Are you sure you want to ban and remove this user from the group?",confirmLabel:"Remove",confirmHandler:f,confirmIsDestructive:!0}))}));var Vc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{byId:n}=e.users;return{chat:a,currentUserId:e.currentUserId,isChannel:Object(m.ib)(a),usersById:n}})(({chat:e,isChannel:t,currentUserId:a,usersById:c,onScreenSelect:s,onChatMemberSelect:l})=>{const o=Object(F.a)();const i=Object(n.p)(()=>e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),d=Object(n.m)(e=>{l(e.userId,e.promotedByUserId===a),s(r.g.ChatAdminRights)},[a,l,s]),u=Object(n.m)(e=>{if(e.isOwner)return o("ChannelCreator");const t=e.promotedByUserId?c[e.promotedByUserId]:void 0;return t?o("EditAdminPromotedBy",Object(m.Y)(t)):o("ChannelAdmin")},[o,c]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{icon:"recent",multiline:!0,ripple:!0,onClick:function(){s(r.g.GroupRecentActions)}},n.a.createElement("span",{className:"title"},o("EventLog")),n.a.createElement("span",{className:"subtitle"},o(t?"EventLogInfoDetailChannel":"EventLogInfoDetail")))),n.a.createElement("div",{className:"section"},n.a.createElement("p",{className:"text-muted"},t?"You can add administrators to help you manage your channel.":"You can add administrators to help you manage your group."),i.map(e=>n.a.createElement(ve.a,{key:e.userId,className:"chat-item-clickable",ripple:!0,onClick:()=>d(e)},n.a.createElement(Ee.a,{userId:e.userId,status:u(e),forceShowSelf:!0}))))))}));var _c=Object(n.h)(Object(c.h)((e,{chatId:t})=>({chat:Object(d.f)(e,t)}))(({chat:e})=>{const t=Object(F.a)(),a=Object(n.p)(()=>e&&e.fullInfo&&e.fullInfo.adminMembers?e.fullInfo.adminMembers.sort((e,t)=>e.isOwner?-1:t.isOwner?1:0):[],[e]),c=Object(n.m)(e=>e.isOwner?t("ChannelCreator"):t("ChannelAdmin"),[t]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section not-implemented"},n.a.createElement("h3",{className:"section-heading"},"Actions"),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogAllEvents"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterNewAdmins"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterNewMembers"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterChannelInfo"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterDeletedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterEditedMessages"),onChange:void 0})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogFilterLeavingMembers"),onChange:void 0}))),n.a.createElement("div",{className:"section not-implemented"},n.a.createElement("h3",{className:"section-heading"},t("Channel.Management.Title")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!0,label:t("EventLogAllAdmins"),onChange:void 0})),a.map(e=>n.a.createElement(ve.a,{key:e.userId,className:"chat-item-clickable picker-list-item",onClick:void 0,ripple:!0},n.a.createElement(ea.a,{label:"",checked:!0}),n.a.createElement(Ee.a,{userId:e.userId,status:c(e),forceShowSelf:!0}))))))}));var Wc=Object(n.h)(Object(c.h)((e,{chatId:t,isPromotedByCurrentUser:a})=>{const n=Object(d.f)(e,t),{byId:c}=e.users,{currentUserId:s}=e;return{chat:n,usersById:c,currentUserId:s,isChannel:Object(m.ib)(n),isFormFullyDisabled:!(n.isCreator||a)}},(e,t)=>Object(u.l)(t,["updateChatAdmin"]))(({selectedChatMemberId:e,onScreenSelect:t,chat:a,usersById:c,currentUserId:s,isChannel:l,isFormFullyDisabled:o,updateChatAdmin:i})=>{const[d,u]=Object(n.r)({}),[h,b]=Object(n.r)(!1),[g,p]=Object(n.r)(!1),[v,E,O]=Object(Be.a)(),[f,j]=Object(n.r)(""),C=Object(F.a)(),y=Object(n.p)(()=>{if(a.fullInfo&&a.fullInfo.adminMembers)return a.fullInfo.adminMembers.find(({userId:t})=>t===e)},[a,e]);Object(n.n)(()=>{a&&a.fullInfo&&e&&!y&&t(r.g.ChatAdministrators)},[a,t,y,e]),Object(n.n)(()=>{u(y&&y.adminRights||{}),j((y&&y.customTitle||"").substr(0,16)),b(!1),p(!1)},[y]);const k=Object(n.m)(e=>{const{name:t}=e.target;u(e=>{return{...e,[t]:(a=e[t],!a||void 0)};var a}),b(!0)},[]),N=Object(n.m)(()=>{e&&(p(!0),i({chatId:a.id,userId:e,adminRights:d,customTitle:f}))},[a,e,d,f,i]),I=Object(n.m)(()=>{e&&(i({chatId:a.id,userId:e,adminRights:{}}),O())},[a.id,O,e,i]),S=Object(n.m)(e=>!Object(m.hb)(a)&&(!(!o&&a.adminRights)||!a.adminRights[e]),[a,o]),w=Object(n.p)(()=>{if(!y)return;if(y.isOwner)return C("ChannelCreator");const e=y.promotedByUserId?c[y.promotedByUserId]:void 0;return e?C("EditAdminPromotedBy",Object(m.Y)(e)):C("ChannelAdmin")},[y,c,C]),P=Object(n.m)(e=>{const{value:t}=e.target;j(t),b(!0)},[]);if(y)return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section"},n.a.createElement(ve.a,{inactive:!0,className:"chat-item-clickable"},n.a.createElement(Ee.a,{userId:y.userId,status:w,forceShowSelf:!0})),n.a.createElement("h3",{className:"section-heading mt-4"},C("EditAdminWhatCanDo")),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"changeInfo",checked:!!d.changeInfo,label:C(l?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo"),blocking:!0,disabled:S("changeInfo"),onChange:k})),l&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"postMessages",checked:!!d.postMessages,label:C("EditAdminPostMessages"),blocking:!0,disabled:S("postMessages"),onChange:k})),l&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"editMessages",checked:!!d.editMessages,label:C("EditAdminEditMessages"),blocking:!0,disabled:S("editMessages"),onChange:k})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"deleteMessages",checked:!!d.deleteMessages,label:C(l?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages"),blocking:!0,disabled:S("deleteMessages"),onChange:k})),!l&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"banUsers",checked:!!d.banUsers,label:C("EditAdminBanUsers"),blocking:!0,disabled:S("banUsers"),onChange:k})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"inviteUsers",checked:!!d.inviteUsers,label:C("EditAdminAddUsers"),blocking:!0,disabled:S("inviteUsers"),onChange:k})),!l&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"pinMessages",checked:!!d.pinMessages,label:C("EditAdminPinMessages"),blocking:!0,disabled:S("pinMessages"),onChange:k})),n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"addAdmins",checked:!!d.addAdmins,label:C("EditAdminAddAdmins"),blocking:!0,disabled:S("addAdmins"),onChange:k})),!l&&n.a.createElement("div",{className:"ListItem no-selection"},n.a.createElement(ea.a,{name:"anonymous",checked:!!d.anonymous,label:C("EditAdminSendAnonymously"),blocking:!0,disabled:S("anonymous"),onChange:k})),o&&n.a.createElement("p",{className:"section-info mb-4"},C("Channel.EditAdmin.CannotEdit")),!l&&n.a.createElement(ge.a,{id:"admin-title",label:C("EditAdminRank"),onChange:P,value:f,disabled:o,maxLength:16}),s!==e&&!o&&n.a.createElement(ve.a,{icon:"delete",ripple:!0,destructive:!0,onClick:E},C("EditAdminRemoveAdmin")))),n.a.createElement(Ut,{isShown:h,onClick:N,ariaLabel:C("Save"),disabled:g},g?n.a.createElement(L.a,{color:"white"}):n.a.createElement("i",{className:"icon-check"})),n.a.createElement(Se.a,{isOpen:v,onClose:O,text:"Are you sure you want to dismiss this admin?",confirmLabel:"Dismiss",confirmHandler:I,confirmIsDestructive:!0}))}));var Yc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(m.ib)(a)}},(e,t)=>Object(u.l)(t,["openUserInfo"]))(({members:e,usersById:t,isChannel:a,openUserInfo:c})=>{const s=Object(n.p)(()=>{if(e&&t)return Object(m.Cb)(e.map(({userId:e})=>e),t)},[e,t]),r=Object(n.m)(e=>{c({id:e})},[c]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},s?s.map((e,t)=>n.a.createElement(ve.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>r(e)},n.a.createElement(Ee.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(Xe.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var Kc=Object(n.h)(Object(c.h)((e,{chatId:t})=>{const a=Object(d.f)(e,t),{byId:n}=e.users;return{members:a&&a.fullInfo&&a.fullInfo.members,usersById:n,isChannel:a&&Object(m.ib)(a)}})(({usersById:e,members:t,isChannel:a,onScreenSelect:c,onChatMemberSelect:s})=>{const l=Object(n.p)(()=>{if(t&&e)return Object(m.Cb)(t.filter(e=>!e.isOwner).map(({userId:e})=>e),e)},[t,e]),o=Object(n.m)(e=>{s(e),c(r.g.GroupUserPermissions)},[s,c]);return n.a.createElement("div",{className:"Management"},n.a.createElement("div",{className:"custom-scroll"},n.a.createElement("div",{className:"section",teactFastList:!0},l?l.map((e,t)=>n.a.createElement(ve.a,{key:e,teactOrderKey:t,className:"chat-item-clickable scroll-item",onClick:()=>o(e)},n.a.createElement(Ee.a,{userId:e,forceShowSelf:!0}))):n.a.createElement(Xe.a,{teactOrderKey:0,key:"nothing-found",text:a?"No subscribers found":"No members found"}))))}));var Qc=Object(n.h)(Object(c.h)(e=>({managementType:Object(d.u)(e)}))(({chatId:e,currentScreen:t,selectedChatMemberId:a,isPromotedByCurrentUser:c,onScreenSelect:s,onChatMemberSelect:l,managementType:o})=>{switch(t){case r.g.Initial:switch(o){case"user":return n.a.createElement(Bc,{key:e,userId:e});case"group":return n.a.createElement(xc,{key:e,chatId:e,onScreenSelect:s});case"channel":return n.a.createElement(Gc,{key:e,chatId:e,onScreenSelect:s})}break;case r.g.ChatPrivacyType:return n.a.createElement(zc,{chatId:e});case r.g.Discussion:return n.a.createElement($c,{chatId:e,onScreenSelect:s});case r.g.GroupPermissions:return n.a.createElement(Rc,{chatId:e,onScreenSelect:s,onChatMemberSelect:l});case r.g.GroupRemovedUsers:return n.a.createElement(Uc,{chatId:e});case r.g.GroupUserPermissionsCreate:return n.a.createElement(Kc,{chatId:e,onChatMemberSelect:l,onScreenSelect:s});case r.g.GroupUserPermissions:return n.a.createElement(Hc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:c,onScreenSelect:s});case r.g.ChatAdministrators:return n.a.createElement(Vc,{chatId:e,onScreenSelect:s,onChatMemberSelect:l});case r.g.GroupRecentActions:return n.a.createElement(_c,{chatId:e});case r.g.ChatAdminRights:return n.a.createElement(Wc,{chatId:e,selectedChatMemberId:a,isPromotedByCurrentUser:c,onScreenSelect:s});case r.g.ChannelSubscribers:case r.g.GroupMembers:return n.a.createElement(Yc,{chatId:e})}}));const Zc={USD:"$",EUR:"€",GBP:"£",JPY:"¥",RUB:"₽",UAH:"₴",INR:"₹",AED:"د.إ"};function Xc(e){return e&&Zc[e]||""}const Jc=/^4[0-9]{12}(?:[0-9]{1,3})?$/,es=/^5[1-5][0-9]{11,14}$/,ts=/^2[2-7][0-9]{11,14}$/;let as;!function(e){e[e.Default=0]="Default",e[e.Visa=1]="Visa",e[e.Mastercard=2]="Mastercard"}(as||(as={}));const ns={[as.Default]:"",[as.Visa]:"visa",[as.Mastercard]:"mastercard"};function cs(e){return e=e.replace(/\s/g,""),Jc.test(e)?as.Visa:es.test(e)||ts.test(e)?as.Mastercard:as.Default}var ss=a(56);const rs={streetLine1:"",streetLine2:"",city:"",state:"",countryIso2:"",postCode:"",fullName:"",email:"",phone:"",shipping:"",cardNumber:"",cardholder:"",expiry:"",cvv:"",billingCountry:"",billingZip:"",saveInfo:!0,saveCredentials:!1,formErrors:{}},ls=(e,t)=>{switch(t.type){case"changeAddress1":return{...e,streetLine1:t.payload,formErrors:{...e.formErrors,streetLine1:void 0}};case"changeAddress2":return{...e,streetLine2:t.payload,formErrors:{...e.formErrors,streetLine2:void 0}};case"changeCity":return{...e,city:t.payload,formErrors:{...e.formErrors,city:void 0}};case"changeState":return{...e,state:t.payload,formErrors:{...e.formErrors,state:void 0}};case"changeCountry":return{...e,countryIso2:t.payload,billingCountry:os(t.payload),formErrors:{...e.formErrors,countryIso2:void 0}};case"changePostCode":return{...e,postCode:t.payload,formErrors:{...e.formErrors,postCode:void 0}};case"changeFullName":return{...e,fullName:t.payload,formErrors:{...e.formErrors,fullName:void 0}};case"changeEmail":return{...e,email:t.payload,formErrors:{...e.formErrors,email:void 0}};case"changePhone":return{...e,phone:t.payload,formErrors:{...e.formErrors,phone:void 0}};case"changeShipping":return{...e,shipping:t.payload};case"changeCardNumber":return{...e,cardNumber:t.payload,formErrors:{...e.formErrors,cardNumber:void 0}};case"changeCardholder":return{...e,cardholder:t.payload,formErrors:{...e.formErrors,cardholder:void 0}};case"changeExpiryDate":return{...e,expiry:t.payload,formErrors:{...e.formErrors,expiry:void 0}};case"changeCvvCode":return{...e,cvv:t.payload,formErrors:{...e.formErrors,cvv:void 0}};case"changeBillingCountry":return{...e,billingCountry:t.payload,formErrors:{...e.formErrors,billingCountry:void 0}};case"changeBillingZip":return{...e,billingZip:t.payload,formErrors:{...e.formErrors,billingZip:void 0}};case"changeSaveInfo":return{...e,saveInfo:t.payload};case"changeSaveCredentials":return{...e,saveCredentials:t.payload};case"updateUserInfo":return t.payload.countryIso2?{...e,...t.payload,billingCountry:os(t.payload.countryIso2)}:{...e,...t.payload};case"setFormErrors":return{...e,formErrors:{...e.formErrors,...t.payload}};default:return e}};function os(e){const t=Bt.a.find(({id:t})=>t===e);return t?t.name:""}function is(e,t=400){Object(n.n)(()=>{o.l||setTimeout(()=>{Object(V.b)(()=>{e.current&&e.current.focus()})},t)},[e,t])}var ds=Object(n.h)(e=>{const{id:t,value:a,label:c,hasArrow:s,error:r,ref:l,placeholder:o,onChange:i,children:d}=e,m=r||c,u=Object(ce.a)("input-group",a&&"touched",r&&"error",m&&"with-label",s&&"with-arrow","input-group");return n.a.createElement("div",{className:u},n.a.createElement("select",{className:"form-control",id:t,value:a||"",onChange:i,placeholder:o||c,ref:l},d),m&&t&&n.a.createElement("label",{htmlFor:t},m))});a(298);var ms=Object(n.h)(({state:e,needEmail:t,needPhone:a,needName:c,needAddress:s,dispatch:r})=>{const l=Object(n.q)(null),o=Object(n.q)(null),i=Object(n.q)(null);Object(n.n)(()=>{i.current&&i.current.value!==e.countryIso2&&(i.current.value=e.countryIso2)},[e.countryIso2]);const d=Object(F.a)();is(l);const m=Object(n.m)(e=>{r({type:"changeAddress1",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeAddress2",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeCity",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeState",payload:e.target.value})},[r]),g=Object(n.m)(e=>{r({type:"changeCountry",payload:e.target.value})},[r]),p=Object(n.m)(e=>{r({type:"changePostCode",payload:e.target.value})},[r]),v=Object(n.m)(e=>{r({type:"changeFullName",payload:e.target.value})},[r]),E=Object(n.m)(e=>{r({type:"changeEmail",payload:e.target.value})},[r]),O=Object(n.m)(e=>{let{value:t}=e.target;t="+"+t.replace(/\D/g,""),o.current&&(o.current.value=t),r({type:"changePhone",payload:t})},[r]),f=Object(n.m)(e=>{r({type:"changeSaveInfo",payload:e.target.value})},[r]),{formErrors:j}=e;return n.a.createElement("div",{className:"ShippingInfo"},n.a.createElement("form",null,s?n.a.createElement("div",null,n.a.createElement("h5",null,d("PaymentShippingAddress")),n.a.createElement(ge.a,{ref:l,label:"Address1 (Street)",onChange:m,value:e.streetLine1,inputMode:"text",error:j.streetLine1}),n.a.createElement(ge.a,{label:"Address2 (Street)",onChange:u,value:e.streetLine2,inputMode:"text",error:j.streetLine2}),n.a.createElement(ge.a,{label:"City",onChange:h,value:e.city,inputMode:"text",error:j.city}),n.a.createElement(ge.a,{label:"State",onChange:b,value:e.state,inputMode:"text",error:j.state}),n.a.createElement(ds,{label:"Country",placeholder:"Country",onChange:g,value:e.countryIso2,hasArrow:Boolean(!0),id:"shipping-country",error:j.countryIso2,ref:i},Bt.a.map(({name:e,id:t})=>n.a.createElement("option",{value:t,className:"county-item"},e))),n.a.createElement(ge.a,{label:"Post Code",onChange:p,value:e.postCode,inputMode:"text",error:j.postCode})):void 0,c||t||a?n.a.createElement("h5",null,d("PaymentShippingReceiver")):void 0,c&&n.a.createElement(ge.a,{label:"Full name",onChange:v,value:e.fullName,inputMode:"text",error:j.fullName}),t&&n.a.createElement(ge.a,{label:"Email",onChange:E,value:e.email,inputMode:"email",error:j.email}),a&&n.a.createElement(ge.a,{label:"Phone number",onChange:O,value:e.phone,inputMode:"tel",error:j.phone,ref:o}),n.a.createElement(ea.a,{label:d("PaymentShippingSave"),subLabel:d("PaymentShippingSaveInfo"),checked:Boolean(e.saveInfo),onChange:f})))});a(299);var us=Object(n.h)(({state:e,shippingOptions:t,currency:a,dispatch:c})=>{Object(n.n)(()=>{t&&!e.shipping&&c({type:"changeShipping",payload:t[0].id})},[t,e.shipping,c]);const s=Object(n.m)(e=>{c({type:"changeShipping",payload:e})},[c]),r=Object(n.p)(()=>t.map(({id:e,title:t,amount:n})=>({label:t,subLabel:`${a} ${String(n/100)}`,value:e})),[t,a]);return n.a.createElement("div",{className:"Shipping"},n.a.createElement("form",null,n.a.createElement("p",null,"Select shipping method"),n.a.createElement(ra.a,{name:"shipping-options",options:r,onChange:s,selected:e.shipping})))});a(300);function hs(e,t,a,c=!1){return n.a.createElement("div",{className:"price-info-item "+(c?"price-info-item-main":"")},n.a.createElement("div",{className:"title"},e),n.a.createElement("div",{className:"value"},`${a||""} ${(t/100).toFixed(2)}`))}function bs(e,t,a){return n.a.createElement("div",{className:"checkout-info-item"},n.a.createElement("i",{className:e}," "),n.a.createElement("div",{className:"info"},n.a.createElement("div",{className:"title"},t),n.a.createElement("p",{className:"data"},a)))}var gs=Object(n.h)(({invoiceContent:e,prices:t,shippingPrices:a,checkoutInfo:c,currency:s,totalPrice:r})=>{const{photoUrl:l,title:o,text:i}=e||{},{paymentMethod:d,paymentProvider:m,shippingAddress:u,name:h,phone:b,shippingMethod:g}=c||{};return n.a.createElement("div",{className:"Checkout"},n.a.createElement("div",{className:"description has-image"},l&&n.a.createElement("img",{src:l,alt:""}),n.a.createElement("div",{className:"text"},n.a.createElement("h5",null,o),n.a.createElement("p",null,i))),n.a.createElement("div",{className:"price-info"},t&&t.map(e=>hs(e.label,e.amount,s,!1)),a&&a.map(e=>hs(e.label,e.amount,s,!1)),void 0!==r&&hs("Total",r,s,!0)),n.a.createElement("div",{className:"invoice-info"},d&&bs("icon-card",d,"Payment method"),m&&bs("stripe-provider",m,"Payment provider"),u&&bs("icon-location",u,"Shipping address"),h&&bs("icon-user",h,"Name"),b&&bs("icon-phone",b,"Phone number"),g&&bs("icon-truck",g,"Shipping method")))});var ps=Object(n.h)(({value:e,error:t,onChange:a})=>{const c=Object(n.q)(null),s=Object(n.m)(t=>{if("Backspace"===t.key&&"/"===e.charAt(e.length-1)){const t=e.slice(0,e.length-1);c.current&&(c.current.value=t)}},[e]),r=Object(n.m)(e=>{a(function(e){const t=(e=e.replace(/[^\d]/g,"").slice(0,4)).match(/.{1,2}/g);return t&&t[0]&&Number(t[0])>12&&(t[0]="12"),t&&t[0]&&2===t[0].length&&!t[1]&&(t[1]=""),t?t.join("/"):""}(e.target.value))},[a]);return n.a.createElement(ge.a,{label:"Expiry date",ref:c,onChange:r,onKeyDown:s,value:e,error:t,inputMode:"numeric",maxLength:5})}),vs=(a(301),a.p+"mastercard.4216118edafe23cc2dec7b8807ba4622.svg"),Es=a.p+"visa.e5a7c336e1deb4b92a636e2e053878c4.svg";var Os=Object(n.h)(({value:e,error:t,onChange:a})=>{const c=Object(n.q)(null);is(c);const[s,r]=Object(n.r)(as.Default);Object(n.n)(()=>{const t=cs(e);r(t)},[]);const l=Object(n.m)(e=>{const t=function(e){const t=(e=e.replace(/[^\d]/g,"")).match(/.{1,4}/g);return t?t.join(" "):""}(e.target.value),n=cs(e.target.value);r(n),a(t),c.current&&(c.current.value=t)},[a,c]),o=function(e){switch(e){case as.Mastercard:return n.a.createElement("img",{src:vs,alt:""});case as.Visa:return n.a.createElement("img",{src:Es,alt:""});default:return}}(s);return n.a.createElement("div",{className:"CardInput"},n.a.createElement("span",{className:"left-addon"},o),n.a.createElement(ge.a,{ref:c,label:"Card number",onChange:l,value:e,inputMode:"numeric",className:s?"has-left-addon":"",error:t,maxLength:23}))});a(302);var fs=Object(n.h)(({state:e,canSaveCredentials:t,needCardholderName:a,needCountry:c,needZip:s,dispatch:r})=>{const l=Object(n.q)(null);Object(n.n)(()=>{l.current&&l.current.value!==e.billingCountry&&(l.current.value=e.billingCountry)},[e.billingCountry]);const o=Object(n.m)(e=>{r({type:"changeCardNumber",payload:e})},[r]),i=Object(n.m)(e=>{r({type:"changeCardholder",payload:e.target.value.toUpperCase()})},[r]),d=Object(n.m)(e=>{r({type:"changeExpiryDate",payload:e})},[r]),m=Object(n.m)(e=>{r({type:"changeCvvCode",payload:e.target.value})},[r]),u=Object(n.m)(e=>{r({type:"changeBillingCountry",payload:e.target.value})},[r]),h=Object(n.m)(e=>{r({type:"changeBillingZip",payload:e.target.value})},[r]),b=Object(n.m)(e=>{r({type:"changeSaveCredentials",payload:e.target.value})},[r]),g=Object(F.a)(),{formErrors:p={}}=e;return n.a.createElement("div",{className:"PaymentInfo"},n.a.createElement("form",null,n.a.createElement("h5",null,g("PaymentCardTitle")),n.a.createElement(Os,{onChange:o,value:e.cardNumber,error:p.cardNumber}),a&&n.a.createElement(ge.a,{label:"Name on card",onChange:i,value:e.cardholder,inputMode:"text",error:p.cardholder}),n.a.createElement("section",{className:"inline-inputs"},n.a.createElement(ps,{value:e.expiry,onChange:d,error:p.expiry}),n.a.createElement(ge.a,{label:"CVV code",onChange:m,value:e.cvv,inputMode:"numeric",maxLength:3,error:p.cvv})),c||s?n.a.createElement("h5",null,g("PaymentBillingAddress")):void 0,c&&n.a.createElement(ds,{label:"Country",placeholder:"Country",onChange:u,value:e.billingCountry,hasArrow:Boolean(!0),id:"billing-country",error:p.billingCountry,ref:l},Bt.a.map(({name:e})=>n.a.createElement("option",{value:e,className:"county-item"},e))),s&&n.a.createElement(ge.a,{label:"Post Code",onChange:h,value:e.billingZip,inputMode:"text",error:p.billingZip}),t&&n.a.createElement(ea.a,{label:g("PaymentCardSavePaymentInformation"),checked:e.saveCredentials,onChange:b})))});a(181);var js=Object(n.h)(Object(c.h)(e=>{const{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:c,invoice:s,invoiceContent:r,nativeProvider:l,nativeParams:o,passwordMissing:i,error:d}=e.payment,m=Boolean(s&&(!l||"stripe"!==l)),{needCardholderName:u,needCountry:h,needZip:b}=o||{},{nameRequested:g,phoneRequested:p,emailRequested:v,shippingAddressRequested:E,flexible:O,phoneToProvider:f,emailToProvider:j,currency:C,prices:y}=s||{};return{step:t,shippingOptions:a,savedInfo:n,canSaveCredentials:c,nativeProvider:l,passwordMissing:i,nameRequested:g,shippingAddressRequested:E,phoneRequested:p,emailRequested:v,flexible:O,phoneToProvider:f,emailToProvider:j,currency:C,prices:y,isProviderError:m,invoiceContent:r,needCardholderName:u,needCountry:h,needZip:b,error:d,globalErrors:e.errors}},(e,t)=>Object(u.l)(t,["validateRequestedInfo","sendPaymentForm","setPaymentStep","sendCredentialsInfo","clearPaymentError"]))(({isOpen:e,onClose:t,step:a,shippingOptions:c,savedInfo:s,canSaveCredentials:l,nameRequested:o,shippingAddressRequested:i,phoneRequested:d,emailRequested:m,phoneToProvider:u,emailToProvider:h,currency:b,passwordMissing:g,isProviderError:p,invoiceContent:v,nativeProvider:E,prices:O,needCardholderName:f,needCountry:j,needZip:C,error:y,globalErrors:k,validateRequestedInfo:N,sendPaymentForm:I,setPaymentStep:S,sendCredentialsInfo:w,clearPaymentError:P})=>{const[M,A]=kt(ls,rs),B=Xc(b),[x,R]=Object(n.r)(!1),U=Object(F.a)();Object(n.n)(()=>{(a||y||k)&&R(!1)},[a,y,k]),Object(n.n)(()=>{if(y&&y.field)A({type:"setFormErrors",payload:{[y.field]:y.fieldError}});else if(k&&k.length){const e=Object(ss.a)(k);A({type:"setFormErrors",payload:{...e}})}},[y,k,A]),Object(n.n)(()=>{if(s){const{name:e,phone:t,email:a,shippingAddress:n}=s;A({type:"updateUserInfo",payload:{fullName:e,phone:t&&"+"!==t.charAt(0)?"+"+t:t,email:a,...n||{}}})}},[s,A]);const G=Object(n.m)(()=>{P()},[P]),q=Object(n.p)(()=>a!==r.i.Checkout?0:function(e=[],t,a){const n=t?ys(t,a):[];let c=0;const s=e.concat(n||[]);return c=s.reduce((e,t)=>e+t.amount,c),c}(O,c,M.shipping),[a,M.shipping,O,c]),z=Object(n.p)(()=>{if(a===r.i.Checkout)return function(e,t,a){const n=`${function(e){const t=cs(e);return ns[t]||""}(e.cardNumber)} *${e.cardNumber.slice(-4)}`,c=e.streetLine1?`${e.streetLine1}, ${e.city}, ${e.countryIso2}`:void 0,{phone:s,fullName:r}=e,l=t?Cs(t,e.shipping):void 0,o=l?l.title:void 0;return{paymentMethod:n,paymentProvider:a,shippingAddress:c,name:r,phone:s,shippingMethod:o}}(M,c,E||"")},[a,M,c,E]);const $=Object(n.m)(()=>{const{saveInfo:e}=M,t=function(e){const{streetLine1:t,streetLine2:a,city:n,state:c,countryIso2:s,postCode:r,fullName:l,phone:o,email:i}=e;return{name:l,phone:o,email:i,shippingAddress:{streetLine1:t,streetLine2:a,city:n,state:c,countryIso2:s,postCode:r}}}(M);N({requestInfo:t,saveInfo:e})},[N,M]),H=Object(n.m)(()=>{const e=function(e){const{cardNumber:t,cardholder:a,expiry:n,cvv:c,billingCountry:s,billingZip:r}=e,[l,o]=n.split("/");return{data:{cardNumber:t,cardholder:a,expiryMonth:l,expiryYear:o,cvv:c,country:s,zip:r}}}(M);w({credentials:e})},[w,M]),V=Object(n.m)(()=>{I({shippingOptionId:M.shipping,saveCredentials:M.saveCredentials})},[I,M]),_=Object(n.m)(e=>{S({step:e})},[S]),W=Object(n.m)(()=>{switch(R(!0),a){case r.i.ShippingInfo:return $();case r.i.Shipping:return _(r.i.PaymentInfo);case r.i.PaymentInfo:return H();case r.i.Checkout:return V();default:return()=>{}}},[a,$,_,H,V]),Y=Object(n.p)(()=>{switch(a){case r.i.ShippingInfo:return U("PaymentShippingInfo");case r.i.Shipping:return U("PaymentShippingMethod");case r.i.PaymentInfo:return U("PaymentCardInfo");case r.i.Checkout:return U("PaymentCheckout");default:return""}},[a,U]),K=Object(n.p)(()=>{switch(a){case r.i.Checkout:return`Pay ${B}${(q/100).toFixed(2)}`;default:return"Next Step"}},[a,q,B]);return p?n.a.createElement(be.a,{className:"error",isOpen:e,onClose:t},"Sorry, Telegram T doesn't support payments with this provider yet. Please use one of our mobile apps to do this.",n.a.createElement(D.a,{isText:!0,onClick:t},"OK")):n.a.createElement(be.a,{className:"PaymentModal",isOpen:e,onClose:t},n.a.createElement("div",{className:"header"},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null,Y)),void 0!==a?n.a.createElement(T.a,{name:"slide",activeKey:a},()=>n.a.createElement("div",{className:"content custom-scroll"},function(e){switch(e){case r.i.ShippingInfo:return n.a.createElement(ms,{state:M,dispatch:A,needAddress:Boolean(i),needEmail:Boolean(m||h),needPhone:Boolean(d||u),needName:Boolean(o)});case r.i.Shipping:return n.a.createElement(us,{state:M,dispatch:A,shippingOptions:c||[],currency:B});case r.i.PaymentInfo:return n.a.createElement(fs,{state:M,dispatch:A,canSaveCredentials:Boolean(!g&&l),needCardholderName:f,needCountry:j,needZip:C});case r.i.Checkout:return n.a.createElement(gs,{prices:O,shippingPrices:M.shipping&&c?ys(c,M.shipping):void 0,totalPrice:q,invoiceContent:v,checkoutInfo:z,currency:B});default:return}}(a))):n.a.createElement("div",{className:"empty-content"},n.a.createElement(L.a,{color:"gray"})),n.a.createElement("div",{className:"footer"},n.a.createElement(D.a,{type:"submit",onClick:W,disabled:x,isLoading:x},K)),y&&!y.field&&function(){if(y)return n.a.createElement(be.a,{className:"error",isOpen:Boolean(y),onClose:G},n.a.createElement("h4",null,y.description||"Error"),y.description||"Error",n.a.createElement(D.a,{isText:!0,onClick:P},"OK"))}())}));function Cs(e,t){return e.find(({id:e})=>e===t)}function ys(e,t){const a=Cs(e,t);return a?a.prices:void 0}var ks=Object(n.h)(Object(c.h)(e=>{const{receipt:t}=e.payment,{currency:a,prices:n,info:c,totalAmount:s,credentialsTitle:r,shippingPrices:l,shippingMethod:o,photoUrl:i,text:d,title:m}=t||{};return{currency:a,prices:n,info:c,totalAmount:s,credentialsTitle:r,shippingPrices:l,shippingMethod:o,photoUrl:i,text:d,title:m}})(({isOpen:e,onClose:t,prices:a,shippingPrices:c,totalAmount:s,currency:r,info:l,photoUrl:o,text:i,title:d,credentialsTitle:m,shippingMethod:u})=>{const h=Object(F.a)(),b=Xc(r),g=Object(n.p)(()=>function(e,t,a){if(!t)return{paymentMethod:e};const{shippingAddress:n}=t,c=n&&n.streetLine1?`${n.streetLine1}, ${n.city}, ${n.countryIso2}`:void 0,{phone:s,name:r}=t;return{paymentMethod:e,paymentProvider:"Stripe",shippingAddress:c,name:r,phone:s,shippingMethod:a}}(m,l,u),[l,u,m]);return n.a.createElement(be.a,{className:"PaymentModal PaymentModal-receipt",isOpen:e,onClose:t},n.a.createElement("div",null,n.a.createElement("div",{className:"header"},n.a.createElement(D.a,{className:"close-button",color:"translucent",round:!0,size:"smaller",onClick:t,ariaLabel:"Close"},n.a.createElement("i",{className:"icon-close"})),n.a.createElement("h3",null," ",h("PaymentReceipt")," ")),n.a.createElement("div",{className:"receipt-content custom-scroll"},n.a.createElement(gs,{prices:a,shippingPrices:c,totalPrice:s,invoiceContent:{photoUrl:o,text:i,title:d},checkoutInfo:g,currency:b}))))}))},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(5),c=a(50);const s={MonkeyIdle:a.p+"TwoFactorSetupMonkeyIdle.dea4a492c144df84ddab778dc8a3f0cd.tgs",MonkeyTracking:a.p+"TwoFactorSetupMonkeyTracking.eb5a7a6f166fb7589c12e6248561fb58.tgs",MonkeyClose:a.p+"TwoFactorSetupMonkeyClose.604c4c833d322b7e6c3ea19bef058241.tgs",MonkeyPeek:a.p+"TwoFactorSetupMonkeyPeek.1905436b042520363d7e59f5d7f903ab.tgs",FoldersAll:a.p+"FoldersAll.3f9f9e243d19f0fbf9aaaff11cbd4572.tgs",FoldersNew:a.p+"FoldersNew.9a40d71c0c8be70f5bd14ff2d7bc1593.tgs",DiscussionGroups:a.p+"DiscussionGroupsDucks.9ea453d1be9d1b0ee77a992f8e587485.tgs"};function r(e){const t=s[e].replace(window.location.origin,"");return c.b("file"+t,n.ApiMediaFormat.Lottie)}},,,,,function(e,t,a){"use strict";var n=a(0),c=a(8),s=a(1),r=a(14),l=a(98),o=a(29),i=a(103),d=a(16);a(145);const m={type:"blob",quality:.8,format:"jpeg",circle:!1};let u,h,b;var g=Object(n.h)(({file:e,onChange:t,onClose:c})=>{const[g,p]=Object(n.r)(!1);Object(n.n)(()=>{e&&(g?async function(e){try{const t=document.getElementById("avatar-crop");if(!t)return;const{offsetWidth:a,offsetHeight:n}=t;b=new u(t,{enableZoom:!0,boundary:{width:a,height:n},viewport:{width:a-16,height:n-16,type:"circle"}});const c=await Object(r.a)(e);await b.bind({url:c})}catch(e){s.o&&console.error(e)}}(e):async function(){return h||(h=Promise.all([a.e(6),a.e(8)]).then(a.bind(null,310)),u=(await h).default),h}().then(()=>p(!0)))},[e,g]);const v=Object(l.a)();return n.a.createElement(i.a,{isOpen:Boolean(e),onClose:c,title:"Drag to reposition",className:"CropModal",hasCloseButton:!0},g?n.a.createElement("div",{id:"avatar-crop"}):n.a.createElement(d.a,null),n.a.createElement(o.a,{className:"confirm-button",round:!0,color:"primary",onClick:async function(){if(!b)return;const e=await b.result(m),a="string"==typeof e?e:Object(r.b)(e,"avatar.jpg");t(a)},ariaLabel:v("CropImage")},n.a.createElement("i",{className:"icon-check"})))});a(146);t.a=Object(n.h)(({title:e="Change your profile picture",disabled:t,currentAvatarBlobUrl:a,onChange:s})=>{const[r,l]=Object(n.r)(),[o,i]=Object(n.r)(a);Object(n.n)(()=>{i(a)},[a]);const d=Object(c.a)(o&&"filled",t&&"disabled");return n.a.createElement("div",{className:"AvatarEditable"},n.a.createElement("label",{className:d,role:"button",tabIndex:0,title:e},n.a.createElement("input",{type:"file",onChange:function(e){const t=e.target;t&&t.files&&t.files[0]&&(l(t.files[0]),t.value="")},accept:"image/png, image/jpeg"}),n.a.createElement("i",{className:"icon-camera-add"}),o&&n.a.createElement("img",{src:o,alt:"Avatar"})),n.a.createElement(g,{file:r,onClose:function(){l(void 0)},onChange:function(e){l(void 0),s(e),o&&URL.revokeObjectURL(o),i(URL.createObjectURL(e))}}))})},,,,,,,,,,function(e,t,a){},,,,,,,,function(e,t,a){"use strict";var n=a(0),c=a(1),s=a(7),r=a(119),l=a(110);a(134);const o=[0,50],i=[0,20],d=[20,0],m=s.g?c.ob:c.nb;t.a=Object(n.h)(({isPasswordVisible:e,isBig:t})=>{const[a,s]=Object(n.r)(),[u,h]=Object(n.r)(),[b,g]=Object(n.r)(!1),[p,v]=Object(n.r)(!1);Object(n.n)(()=>{a?setTimeout(()=>v(!0),2e3):Object(r.a)("MonkeyClose").then(s)},[a]),Object(n.n)(()=>{u||Object(r.a)("MonkeyPeek").then(h)},[u]);const E=Object(n.m)(()=>g(!0),[]);return n.a.createElement("div",{id:"monkey",className:t?"big":""},!b&&n.a.createElement("div",{className:"monkey-preview"}),a&&n.a.createElement(l.a,{id:"closeMonkey",size:t?c.yb:m,className:p?"hidden":"shown",animationData:a,playSegment:o,noLoop:!0,onLoad:E}),u&&n.a.createElement(l.a,{id:"peekMonkey",size:t?c.yb:m,className:p?"shown":"hidden",animationData:u,playSegment:e?i:d,noLoop:!0}))})},function(e,t,a){"use strict";var n=a(0),c=a(1),s=a(7),r=a(8),l=a(29);const o=s.g?550:400;t.a=Object(n.h)(({isLoading:e=!1,isPasswordVisible:t,error:a,hint:i,placeholder:d="Password",submitLabel:m="Next",clearError:u,onChangePasswordVisibility:h,onInputChange:b,onSubmit:g})=>{const p=Object(n.q)(null),[v,E]=Object(n.r)(""),[O,f]=Object(n.r)(!1);return Object(n.n)(()=>{s.l||setTimeout(()=>{p.current.focus()},o)},[]),Object(n.n)(()=>{a&&requestAnimationFrame(()=>{p.current.focus(),p.current.select()})},[a]),n.a.createElement("form",{action:"",onSubmit:function(t){t.preventDefault(),e||O&&g(v)},autoComplete:"off"},n.a.createElement("div",{className:Object(r.a)("input-group password-input",v&&"touched",a&&"error")},n.a.createElement("input",{ref:p,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:v||"",autoComplete:"current-password",onChange:function(e){a&&u();const{target:t}=e;E(t.value),f(t.value.length>=c.W),b&&b(t.value)}}),n.a.createElement("label",null,a||i||d),n.a.createElement("div",{className:"toggle-password",onClick:function(){h(!t)},role:"button",tabIndex:0,title:"Toggle password visibility"},n.a.createElement("i",{className:t?"icon-eye":"icon-eye-closed"}))),O&&n.a.createElement(l.a,{type:"submit",ripple:!0,isLoading:e},m))})},,function(e,t,a){},function(e,t,a){},,,,,,,,,,,,,,function(e,t,a){},,,,,,,,,,,,,,,,,,,,function(e,t,a){},function(e,t,a){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){}])]);
|
||
//# sourceMappingURL=3.91a1da61c17d38fb3b13.js.map
|