12 |
- (this["webpackJsonpreact-21-22"]=this["webpackJsonpreact-21-22"]||[]).push([[2],{493:function(e,t){},495:function(e,t){},591:function(e,t,n){"use strict";n.r(t);var o=n(141),a=n(7),c=n(607),r=n(574),i=n(21),s=n(0),l=n(22),d=n(14),b=n(147),j=n(608),f=n(596),u=n(618),p=n(314),m=n.n(p),h=n(313),x=n.n(h),g=n(152),O=n.n(g),v=n(272),y=n.n(v),C=n(27),w=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(-2),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),S=Object(r.a)({container:{position:"absolute",maxWidth:"100%",top:"92vh",right:20,zIndex:10,cursor:"pointer"}}),k=function(e){var t=e.setPopup,n=S(),c=Object(i.b)(),r=Object(s.useState)(null),l=Object(o.a)(r,2),d=l[0],b=l[1],f=Boolean(d),p=function(){t(!1),b(null)};return Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(j.a,{onClick:function(e){return b(e.currentTarget)},sx:{bgcolor:"rgb(41, 139, 231)",width:56,height:56},children:d?Object(a.jsx)(O.a,{}):Object(a.jsx)(x.a,{})}),Object(a.jsxs)(w,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:d,open:f,onClose:p,children:[Object(a.jsxs)(u.a,{onClick:function(){p(),c(Object(C.a)("contact"))},children:[Object(a.jsx)(y.a,{}),"New Contact"]}),Object(a.jsxs)(u.a,{onClick:function(){p(),c(Object(C.a)("contacts"))},children:[Object(a.jsx)(m.a,{}),"Contacts"]})]})]})},N=n(38),I=n(621),T=n(597),z=n(622),R=n(616),M=n(584),A=n(578),D=n(51),E=Object(r.a)({stackItem:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",padding:5,borderRadius:5,cursor:"pointer","&:hover":{background:"#eeeded"}},titleName:{color:"#575757",fontSize:16,paddingTop:5}}),L=function(e){var t=e.handleListItemClick,n=e.chat,o=E(),c=n.name,r=n.lastName,i=n.color,s=n.avatarUrl,l=n.companionId;return Object(a.jsxs)("div",{onClick:function(){return t(l)},className:o.stackItem,children:[Object(a.jsx)(j.a,{alt:c,src:s?"".concat(D.m,"/").concat(s):void 0,sx:{background:i,width:54,height:54},children:"".concat(Object(D.e)(c)).concat(Object(D.e)(r))}),Object(a.jsx)(A.a,{variant:"h6",className:o.titleName,children:"".concat(Object(D.e)(c)).concat(Object(D.q)(c,8,1))})]})},W=n(580),B=n(582),P=n(581),Y=Object(r.a)({listItemInnerText:{display:"flex",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},listItem_iconAvatar:{marginRight:10},listItem_iconRight:{marginRight:10},listItem_icon_time:{fontSize:12,marginLeft:5,paddingBottom:25,color:"#1b1b1b"}}),F=function(e){var t=e.chat,n=e.handleListItemClick,o=Y(),c=t.name,r=t.lastName,i=t.avatarUrl,s=t.color,l=t.companionId,d=t.lastMessage,b=t.lastMessageCreatedAt,f=t.createdAt;return Object(a.jsxs)(W.a,{onClick:function(){return n(l)},children:[Object(a.jsx)(P.a,{className:o.listItem_iconAvatar,children:Object(a.jsx)(j.a,{alt:c,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:s,width:54,height:54},children:!i&&"".concat(Object(D.e)(c)).concat(Object(D.e)(r))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(c)).concat(Object(D.q)(c,15,1)," \n ").concat(Object(D.e)(r)).concat(Object(D.q)(r,15,1)),secondary:"".concat(d?Object(D.q)(d,35):"".concat(Object(D.e)(c)).concat(Object(D.q)(c,8,1)," joined Telegram"))}),Object(a.jsx)(P.a,{className:o.listItem_iconRight,children:Object(a.jsx)(A.a,{className:o.listItem_icon_time,variant:"h6",color:"initial",children:Object(D.s)(b||f)})})]})},U=n(598),q=n(626),_=function(e){var t=e.name;return Object(a.jsx)(M.a,{sx:{width:"100%"},spacing:2,children:Object(a.jsxs)(U.a,{severity:"info",children:[Object(a.jsx)(q.a,{children:"Warning"}),Object(a.jsx)("strong",{style:{wordBreak:"break-word"},children:t})]})})},H=Object(r.a)({stack:{display:"flex",justifyContent:"space-around",paddingTop:20},container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),V=function(e){var t=e.value,n=e.date,o=e.filteredAndSortedChats,c=e.handleListItemClick,r=H();return Object(a.jsxs)(a.Fragment,{children:[!t&&!n&&o.length>0&&Object(a.jsx)(M.a,{direction:"row",className:r.stack,children:o.slice(0,6).map((function(e){return Object(a.jsx)(L,{handleListItemClick:c,chat:e},e.companionId)}))}),(t||n)&&o.length>0&&Object(a.jsx)(R.a,{className:r.container,component:"nav","aria-label":"main mailbox folders",children:o.map((function(e){return Object(a.jsx)(F,{handleListItemClick:c,chat:e},e.companionId)}))}),(t||n)&&0===o.length&&Object(a.jsx)(_,{name:"Can not find Chat by request: ".concat(t)}),!t&&!n&&0===o.length&&Object(a.jsx)(_,{name:"You do not have any Chats yet!"})]})},$=n(605),G=n(612),K=n(184),J=n.n(K),Q=n(585),X=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),Z=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=X();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(R.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:s,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(D.e)(s)).concat(Object(D.e)(d))})}),Object(a.jsx)(B.a,{primary:n,secondary:Object(D.s)(t)}),Object(a.jsx)(J.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(_,{name:"Can not find Files by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(_,{name:"You do not have Files yet!"})]})},ee=n(627),te=n(629),ne=n(244),oe=n.n(ne),ae=n(218),ce=n.n(ae),re=n(219),ie=n.n(re),se=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},img:{cursor:"pointer","&:hover":{scale:.98}}}),le=function(e){var t=e.message,n=e.fullType,c=e.updatedAt,r=e.handleScrollToTheMessage,i=e.id,l=e.companionId,d=e.name,b=e.lastName,f=e.color,u=se(),p=Object(s.useState)(!1),m=Object(o.a)(p,2),h=m[0],x=m[1],g=Object(s.useState)(1),v=Object(o.a)(g,2),y=v[0],C=v[1],w=Object(s.useRef)(null),S=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(x(!1),C(1))},k="".concat(D.m,"/").concat(t);return h?Object(a.jsxs)("div",{onClick:function(e){S(e),r(i,l)},id:"overlay",className:u.overlay,children:[Object(a.jsxs)("div",{className:u.topBar,children:[Object(a.jsxs)("div",{className:u.wrapperCredentials,children:[Object(a.jsx)(P.a,{children:Object(a.jsx)(j.a,{alt:d,src:k||void 0,sx:{background:f,width:44,height:44},children:!k&&"".concat(Object(D.e)(d)).concat(Object(D.e)(b))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(d)).concat(Object(D.q)(d,15,1),"\n ").concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(D.s)(c),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:u.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){y>=.5&&(w.current.style.transform="scale(".concat(y-.25,",").concat(y-.25,")"),w.current.style.transformOrigin="".concat(50/y-.25,"px ").concat(50/y-.25,"px"),C(y-.25))},className:u.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){y<5&&(w.current.style.transform="scale(".concat(y+.25,",").concat(y+.25,")"),w.current.style.transformOrigin="".concat(50/y+.25,"px ").concat(50/y+.25,"px"),C(y+.25))},className:u.magnifying,fontSize:"large"}),Object(a.jsx)(oe.a,{onClick:function(){return Object(D.h)(k,n)},className:u.downloadIcon,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:S,className:u.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:w,className:u.wrapperImage,children:Object(a.jsx)("img",{className:u.innerImage,width:"100%",height:"auto",alt:"imageItem",src:k})})]}):Object(a.jsx)(te.a,{children:Object(a.jsx)("img",{onClick:function(){return!h&&x(!0)},className:u.img,src:"".concat(k,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(k,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},de=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),be=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=de();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(ee.a,{className:r.container,cols:3,rowHeight:164,children:t.map((function(e){var t=e.message,n=e.createdAt,o=e.fullType,r=e.updatedAt,i=e._id,s=e.companionId,l=e.name,d=e.lastName,b=e.color;return Object(a.jsx)(le,{message:t,fullType:o,updatedAt:r,handleScrollToTheMessage:c,id:i,companionId:s,name:l,lastName:d,color:b},n)}))}),(n||o)&&0===t.length&&Object(a.jsx)(_,{name:"Can not find Media by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(_,{name:"You do not have Media yet!"})]})},je=n(159),fe=n.n(je),ue=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),pe=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=ue();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(R.a,{className:r.container,children:t.map((function(e){var t=e.message,n=e.createdAt,o=e.lastName,i=e.name,s=e.color,l=e.avatarUrl,d=e._id,b=e.companionId;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return c(d,b)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:i,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:s,width:40,height:40},children:"".concat(Object(D.e)(i)).concat(Object(D.e)(o))})}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(D.s)(n),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(a.jsx)(fe.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},n)}))}),(n||o)&&0===t.length&&Object(a.jsx)(_,{name:"Can not find Text by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(_,{name:"You do not have Text yet!"})]})},me=n(189),he=n.n(me),xe=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),ge=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=xe();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(R.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:s,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(D.e)(s)).concat(Object(D.e)(d))})}),Object(a.jsx)(B.a,{primary:n,secondary:Object(D.s)(t)}),Object(a.jsx)(he.a,{className:r.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(_,{name:"Can not find Audio by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(_,{name:"You do not have Audio yet!"})]})},Oe=n(190),ve=n.n(Oe),ye=Object(r.a)({container:{width:"100%",maxHeight:"88vh",overflowY:"scroll",position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"-100%"},"100%":{left:"0%"}}}),Ce=function(e){var t=e.filteredAndSortedMessages,n=e.value,o=e.date,c=e.handleScrollToTheMessage,r=ye();return Object(a.jsxs)(a.Fragment,{children:[t.length>0&&Object(a.jsx)(R.a,{className:r.container,children:t.map((function(e){var t=e.createdAt,n=e.fullType,o=e._id,i=e.companionId,s=e.name,l=e.avatarUrl,d=e.lastName,b=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return c(o,i)},alignItems:"flex-start",className:r.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:s,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:b,width:40,height:40},children:"".concat(Object(D.e)(s)).concat(Object(D.e)(d))})}),Object(a.jsx)(B.a,{primary:n,secondary:Object(D.s)(t)}),Object(a.jsx)(ve.a,{className:r.folderIcon,fontSize:"large"})]},t),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}),(n||o)&&0===t.length&&Object(a.jsx)(_,{name:"Can not find Video by request: ".concat(n)}),!n&&!o&&0===t.length&&Object(a.jsx)(_,{name:"You do not have Video yet!"})]})},we=n(1),Se=n.n(we),ke=n(4),Ne=n(45),Ie=n(17),Te=n(47),ze=function(){return function(){var e=Object(ke.a)(Se.a.mark((function e(t){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Ie.f)();case 3:(n=e.sent)&&t(Object(Te.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(Te.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},Re=n(26),Me=Object(Re.a)([function(e){return e.chats}],(function(e){return e})),Ae=Object(Re.a)([function(e){return e.allMessages.messages}],(function(e){return e})),De=function(e){return e.control.leftIsOpen},Ee=function(e){return e.control.rightIsOpen},Le=function(e){return e.control.scrollChat},We=function(e){return e.control.openPinned},Be=function(e){return e.control},Pe=n(33),Ye=function(e){return function(){var t=Object(ke.a)(Se.a.mark((function t(n){var o;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Ie.G)(e);case 3:(o=t.sent)&&n(Object(Pe.c)(o)),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},Fe=function(e){return function(){var t=Object(ke.a)(Se.a.mark((function t(n){var o;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Ie.e)(e);case 3:(o=t.sent)&&n(Object(Pe.a)(o)),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()},Ue=Object(Re.a)([function(e){return e.pinnedMessages}],(function(e){return e})),qe=Object(r.a)({container:{height:"5vh",display:"flex",alignContent:"end",alignItems:"end",width:"100%",borderBottom:"solid 2px #dddddd"}}),_e=Object(b.a)((function(e){return Object(a.jsx)(T.a,Object(d.a)(Object(d.a)({},e),{},{TabIndicatorProps:{children:Object(a.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))({"& .MuiTabs-flexContainer":{display:"flex",width:"100%",padding:"0px 10px",justifyContent:"space-between"},"& .MuiTabs-indicator":{height:0,backgroundColor:"transparent",borderBottom:"3px solid #1976d2",borderLeft:"3px solid transparent",borderRight:"3px solid transparent"}}),He=Object(b.a)((function(e){return Object(a.jsx)(I.a,Object(d.a)({disableRipple:!0},e))}))({fontSize:"1rem",fontWeight:550,textTransform:"none",minWidth:"auto"}),Ve=function(e){var t=e.value,n=e.setValue,c=e.sort,r=e.date,l=e.setDate,d=e.setDisabled,b=e.chatDivRef,j=qe(),f=Object(i.b)(),u=Object(i.c)(Me),p=u.chats,m=u.total,h=Object(i.c)(Ae),x=Object(i.c)(Ue),g=Object(i.c)(Be),O=g.leftIsOpen,v=g.rightIsOpen,y=g.openPinned,w=Object(s.useState)(0),S=Object(o.a)(w,2),k=S[0],I=S[1],T=function(e,t){var n=e.current.childNodes[0].childNodes,o=Object(N.a)(n).find((function(e){return e.id===t}));o&&((o=Object(N.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))},R=function(e,t){y&&!x.some((function(n){return n._id===e&&n.companionId===t}))&&f(Object(C.b)(!1)),b.current&&b.current.id===t?T(b,e):b.current&&b.current.id!==t?(v&&f(Object(C.c)("")),f(Ye(t)),setTimeout((function(){b.current&&T(b,e)}),3e3)):b.current||(v&&f(Object(C.c)("")),f(Ye(t)),setTimeout((function(){b.current&&T(b,e)}),3e3))};Object(s.useEffect)((function(){l("")}),[l]),Object(s.useEffect)((function(){f(0===k?Object(C.a)("searchChats"):Object(C.a)("searchAllMessages"))}),[k,f]),Object(s.useEffect)((function(){0===k&&d("0"===m)}),[k,m,d]),Object(s.useEffect)((function(){var e=function(){"searchChats"===O?f(ze()):"searchAllMessages"===O&&f(function(){var e=Object(ke.a)(Se.a.mark((function e(t){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Ie.d)();case 3:(n=e.sent)&&t(Object(Ne.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(Ne.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[O,f]);var M=Object(s.useMemo)((function(){return Object(D.r)(p,c).filter((function(e){var n=e.name+" "+e.lastName;return r?n.toLowerCase().includes(t.toLowerCase())&&Object(D.t)(r)===Object(D.t)(e.lastMessageCreatedAt?e.lastMessageCreatedAt:e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())}))}),[p,r,t,c]),A=Object(s.useMemo)((function(){var e=h.filter((function(e){return D.c[0===k?0:k-1].includes(e.type)}));return k>0&&d(!(e.length>0)),Object(D.d)(Object(D.i)("createdAt",e,c),r,t)}),[h,r,k,c,t,d]);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(z.a,{className:j.container,children:Object(a.jsxs)(_e,{sx:{width:"100%"},onChange:function(e,o){I(o),t&&n(""),r&&l("")},value:k,"aria-label":"wrapped label tabs example",children:[Object(a.jsx)(He,{label:"Chats"}),Object(a.jsx)(He,{label:"Files"}),Object(a.jsx)(He,{label:"Media"}),Object(a.jsx)(He,{label:"Text"}),Object(a.jsx)(He,{label:"Audio"}),Object(a.jsx)(He,{label:"Video"})]})}),0===k&&Object(a.jsx)(V,{value:t,date:r,filteredAndSortedChats:M,handleListItemClick:function(e){v&&f(Object(C.c)("")),y&&f(Object(C.b)(!1)),f(Ye(e))}}),1===k&&Object(a.jsx)(Z,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:R}),2===k&&Object(a.jsx)(be,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:R}),3===k&&Object(a.jsx)(pe,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:R}),4===k&&Object(a.jsx)(ge,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:R}),5===k&&Object(a.jsx)(Ce,{filteredAndSortedMessages:A,value:t,date:r,handleScrollToTheMessage:R})]})},$e=n(620),Ge=n(417),Ke=n.n(Ge),Je=n(248),Qe=n.n(Je),Xe=n(603),Ze=n(221),et=n.n(Ze),tt=n(624),nt=n(623),ot=n(277),at=n.n(ot),ct=n(592),rt=Object(r.a)({container:{position:"absolute"}}),it=function(e){var t=e.date,n=e.disabled,o=e.changeDate,c=e.handleOnOpen,r=rt();return Object(a.jsx)(ct.a,{className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,disabled:n,value:t||new Date,onOpen:c,onChange:o})},st=n(39),lt=Object(b.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),dt=Object(b.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),bt=Object(b.a)(Xe.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),jt=Object(r.a)({toolBar:{display:"flex",alignContent:"center",alignItems:"center",color:"#b1aeae",height:"7vh",padding:0,margin:0},activeSearch:{outline:"2px solid #2184f7",color:"#2184f7"},iconBtn:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),ft={inputProps:{"aria-label":"Switch demo"}},ut=function(e){var t=e.handleClick,n=e.handleOpenIsSearch,o=e.handleSearch,c=e.leftIsOpen,r=e.value,s=e.sort,l=e.setDate,b=e.date,j=e.disabled,f=Object(i.b)(),u=jt();return Object(a.jsxs)(nt.a,{className:u.toolBar,children:[Object(a.jsx)($e.a,{onClick:t,children:c?Object(a.jsx)(et.a,{className:u.iconArrow}):Object(a.jsx)(Ke.a,{className:u.iconBtn})}),Object(a.jsxs)("div",{onFocus:n,style:{display:"flex",width:"100%"},children:[Object(a.jsxs)(lt,{id:"search",className:r?u.activeSearch:void 0,children:[Object(a.jsx)(dt,{id:"search",children:Object(a.jsx)(Qe.a,{id:"search"})}),Object(a.jsx)(bt,{id:"search",value:r,onChange:o,placeholder:j?"Disabled":"Search",inputProps:{"aria-label":"search"},disabled:j})]}),Object(a.jsxs)($e.a,{"aria-label":"delete",size:"medium",disabled:j,children:[Object(a.jsx)(it,{date:b,disabled:j,changeDate:l,handleOnOpen:function(){return l("")}}),Object(a.jsx)(at.a,{fontSize:"medium",style:{color:b?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({id:"sort",onClick:function(){Object(Ie.M)({sort:!s}),setTimeout((function(){f(Object(st.b)())}),1e3)},checked:s},ft),{},{disabled:j}))]})]})},pt=n(324),mt=n.n(pt),ht=n(323),xt=n.n(ht),gt=n(166),Ot=n.n(gt),vt=n(599),yt=n(194),Ct=n.n(yt),wt=n(186),St=n.n(wt),kt=n(171),Nt=n.n(kt),It=n(609),Tt=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),zt=function(e){var t=e.setModal,n=e.chat,o=Tt(),c=Object(i.b)(),r=n.name,s=n.lastName,l=n.avatarUrl,d=n.color,b=n.companionId;return Object(a.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(Ie.p)(b),t(!1),c(Object(Pe.b)()),c(Object(C.c)("")))},className:o.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:o.modalDelete,children:[Object(a.jsxs)("div",{className:o.titleWrapper,children:[Object(a.jsx)(j.a,{alt:r,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(D.e)(r)).concat(Object(D.e)(s))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(D.e)(r)).concat(Object(D.q)(r,15,1)," \n ").concat(Object(D.e)(s)).concat(Object(D.q)(s,15,1)),"?")}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},Rt=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),Mt=Object(b.a)(vt.a)((function(e){var t=e.theme;return{"& .MuiBadge-badge":{backgroundColor:"#44b700",color:"#44b700",boxShadow:"0 0 0 2px ".concat(t.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}})),At=Object(r.a)({listItemInnerText:{display:"flex",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},listItemInnerText__icon:{marginLeft:5},listItem_iconAvatar:{marginRight:10},listItem_iconRight:{marginRight:10,display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",flexDirection:"column"},listItem_iconTimeChecked:{display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",alignContent:"center",marginBottom:2},listItem_iconRightBtn:{cursor:"pointer",background:"#0ac40a",borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,marginLeft:10,"&:hover":{outline:"solid 3px #3ee415"}},listItem_iconRightBtnMute:{cursor:"pointer",background:"#a7aaa7",borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,marginLeft:10,"&:hover":{outline:"solid 3px #cccbcb"}},pinnedIcon:{transform:"rotate(45deg)"},listIconsRightContainer:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center"},listItem_icon_time:{fontSize:12,marginLeft:5},listItem_typing:{animation:"ripple 4s infinite ease-in-out"},listItem_dots:{fontWeight:"bold",display:"inline-block",fontFamily:"monospace",clipPath:"inset(0 3ch 0 0)",animation:"$run 2s steps(5) infinite"},"@keyframes run":{to:{clipPath:"inset(0 -1ch 0 0)"}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),Dt=function(e){var t=e.chat,n=e.handleListItemClick,c=e.handleNewMsgs,r=e.id,i=e.pinned,l=e.selectedCompanionId,d=At(),b=Object(s.useState)(null),f=Object(o.a)(b,2),p=f[0],m=f[1],h=Object(s.useState)(!1),x=Object(o.a)(h,2),g=x[0],v=x[1],y=Object(s.useState)(!1),C=Object(o.a)(y,2),w=C[0],S=C[1],k=Boolean(p),N=t.name,I=t.lastName,T=t.avatarUrl,z=t.color,R=t.companionId,M=t.mute,E=t.seen,L=t.total,Y=t.watched,F=t.typing,U=t.online,q=t.lastMessage,_=t.lastMessageCreatedAt,H=t.createdAt,V=t.seenCompanion,$=R===l,G=function(e){"mute"===e&&Object(Ie.k)(R),"delete"===e&&S(!0),m(null),v(!1)};return Object(a.jsxs)(a.Fragment,{children:[w&&Object(a.jsx)(zt,{setModal:S,chat:t}),Object(a.jsxs)(W.a,{sx:{backgroundColor:$?"#26afee":g?"rgba(0, 0, 0, 0.1)":"transparent","&:hover":{backgroundColor:$?"#26afee":"rgba(0, 0, 0, 0.1)"}},onClick:function(){return n(R)},onContextMenu:function(e){return function(e){e.preventDefault(),m(e.currentTarget),v(!0)}(e)},children:[Object(a.jsx)(P.a,{className:d.listItem_iconAvatar,children:Object(a.jsx)(Mt,{overlap:"circular",variant:"true"===U?"dot":"standard",anchorOrigin:{vertical:"bottom",horizontal:"right"},children:Object(a.jsx)(j.a,{alt:N,src:T?"".concat(D.m,"/").concat(T):void 0,sx:{background:z,width:54,height:54},children:!T&&"".concat(Object(D.e)(N)).concat(Object(D.e)(I))})})}),Object(a.jsx)(B.a,{primaryTypographyProps:{color:$?"#ffffff":"#000000"},primary:Object(a.jsxs)("div",{className:d.listItemInnerText,children:[Object(a.jsx)("span",{children:"".concat(Object(D.e)(N)).concat(Object(D.q)(N,15,1)," \n ").concat(Object(D.e)(I)).concat(Object(D.q)(I,15,1))}),M&&Object(a.jsx)(xt.a,{style:{color:$?"#ffffff":"#959595"},className:d.listItemInnerText__icon,fontSize:"small"})]}),secondary:F?Object(a.jsxs)("span",{style:{color:$?"#ffffff":"#4d4d4d"},className:d.listItem_typing,children:["typing",Object(a.jsx)("span",{style:{color:$?"#ffffff":"#1b1b1b"},className:d.listItem_dots,children:"..."})]}):q?Object(D.q)(q,28):"".concat(Object(D.e)(N)).concat(Object(D.q)(N,15,1)," joined Telegram"),secondaryTypographyProps:{color:$?"#ffffff":"#000000"}}),Object(a.jsxs)(P.a,{className:d.listItem_iconRight,children:[Object(a.jsxs)("div",{className:d.listItem_iconTimeChecked,children:[Y&&Object(a.jsx)(Ct.a,{style:{color:$?"#ffffff":"#18bd03"},fontSize:"small"}),!Y&&V<L&&Object(a.jsx)(St.a,{style:{color:$?"#ffffff":"#18bd03"},fontSize:"small"}),Object(a.jsx)(A.a,{className:d.listItem_icon_time,style:{color:$?"#ffffff":"#1b1b1b"},variant:"h6",color:"initial",children:Object(D.s)(_||H)})]}),Object(a.jsxs)("div",{className:d.listIconsRightContainer,children:[i&&Object(a.jsx)(Nt.a,{className:d.pinnedIcon,fontSize:"small",style:{color:$?"#ffffff":"#959595"}}),q&&L>E&&Object(a.jsx)("button",{onClick:function(e){return c(e,R)},style:{outline:$?"none":void 0,color:$&&!M?"#26afee":$?"#ffffff":void 0,backgroundColor:$&&!M?"#ffffff":$?"#a7aaa7":void 0},className:M?d.listItem_iconRightBtnMute:d.listItem_iconRightBtn,children:L-E})]})]})]}),Object(a.jsxs)(Rt,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:p,open:k,onClose:G,children:[Object(a.jsxs)(u.a,{onClick:function(){return G("mute")},children:[M?Object(a.jsx)(mt.a,{}):Object(a.jsx)(xt.a,{}),M?"Unmute chat":"Mute chat"]}),Object(a.jsxs)(u.a,{onClick:function(){return function(e,t){Object(Ie.m)(e,!t),G(void 0)}(r,i)},children:[i?Object(a.jsx)(O.a,{className:d.iconClose}):Object(a.jsx)(Nt.a,{}),i?"Unpin chat":"Pin chat"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return G("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},Et=n(52),Lt=n(25),Wt=Object(r.a)({list:{width:"100%",maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Bt=function(e){var t=e.sort,n=e.setDisabled,o=Wt(),c=Object(i.b)(),r=Object(s.useRef)(null),l=Object(i.c)(Lt.d),d=Object(i.c)(Me),b=d.total,j=d.chats,f=Object(i.c)(Et.b),u=function(e){c(Object(C.c)("")),c(Object(C.b)(!1)),c(Fe(e)),f.companionId!==e&&setTimeout((function(){return c(Object(C.d)(!0))}),500)},p=function(e,t){e.stopPropagation(),c(Object(C.c)("")),c(Object(C.b)(!1)),c(Fe(t)),setTimeout((function(){return c(Object(C.d)(!0))}),500)},m=Object(s.useCallback)((function(e){c(Fe(e)),c(Object(C.b)(!1)),c(Object(C.c)("")),setTimeout((function(){return c(Object(C.d)(!0))}),500)}),[c]),h=Object(s.useMemo)((function(){var e=[],n=Object(D.r)(j,t).filter((function(t){return!0===t.pinned?void e.push(t):t}));return[].concat(e,Object(N.a)(n))}),[j,t]);return Object(s.useEffect)((function(){var e=function(){return c(ze())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[c]),Object(s.useEffect)((function(){r.current&&r.current.forEach((function(e,t){var n=e.total-e.seen,o=h[t];void 0!==o&&(o.total-o.seen>n&&!o.mute&&(!l&&Object(D.l)("".concat(D.n,"/telegramReceive.mp3")),Object(D.j)(o.name,(function(){return m(o.companionId)}))))})),r.current=h}),[f,h,m,c,l]),Object(s.useEffect)((function(){n("0"===b)}),[b,n]),"0"!==b?Object(a.jsx)(R.a,{className:o.list,component:"nav","aria-label":"main mailbox folders",children:h.map((function(e){return Object(a.jsx)(Dt,{chat:e,handleListItemClick:u,handleNewMsgs:p,id:e._id,pinned:e.pinned,selectedCompanionId:f.companionId},e.number)}))}):Object(a.jsx)(_,{name:"You do not have Chats yet!"})},Pt=n(614),Yt=n(615),Ft=n(418),Ut=n.n(Ft),qt=n(419),_t=n.n(qt),Ht=n(325),Vt=n.n(Ht),$t=n(420),Gt=n.n($t),Kt=n(421),Jt=n.n(Kt),Qt=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100},container:{position:"absolute",width:270,maxWidth:"100%",top:60,left:15,zIndex:10,visibility:"visible"},list:{background:"#fdfdfd"},listItemLast:{textAlign:"center"},listIcon:{marginRight:15},listIconText:{marginRight:15,paddingLeft:6}}),Xt={inputProps:{"aria-label":"Switch demo"}},Zt=function(e){var t=e.nightMode,n=e.silentMode,o=Qt(),c=Object(i.b)();return Object(s.useEffect)((function(){var e=function(){return c(Object(st.b)())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[c]),Object(a.jsx)("div",{className:o.overlay,id:"overlay",children:Object(a.jsx)(Pt.a,{className:o.container,children:Object(a.jsxs)(Yt.a,{className:o.list,children:[Object(a.jsxs)(u.a,{onClick:function(){return c(Object(C.a)("contact"))},children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(y.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"New Contact"})]}),Object(a.jsxs)(u.a,{onClick:function(){return c(Object(C.a)("contacts"))},children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(m.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Contacts"})]}),Object(a.jsxs)(u.a,{onClick:function(){return c(Object(C.a)("settings"))},children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(Ut.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Settings"})]}),Object(a.jsxs)(u.a,{style:{cursor:"default"},children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(_t.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Night Mode"}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({onClick:function(){return Object(Ie.M)({nightMode:!t})},checked:t},Xt),{},{style:{cursor:"pointer"}}))]}),Object(a.jsxs)(u.a,{style:{cursor:"default"},children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(Vt.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Silent Mode"}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({onClick:function(){return Object(Ie.M)({silentMode:!n})},checked:n},Xt),{},{style:{cursor:"pointer"}}))]}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://www.makeuseof.com/tag/useful-telegram-features/",children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(Gt.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Telegram Features"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://bugs.telegram.org/?tag_ids=41&sort=time",children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{className:o.listIcon,children:Object(a.jsx)(Jt.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{children:"Report bug"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://www.msn.com/en-in/money/tech/telegram-webk-and-webz-web-apps-launched-whats-the-difference/ar-BB1fOwLR",children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{className:o.listIconText,children:"K"}),Object(a.jsx)(B.a,{children:"Switch to K Version"})]})}),Object(a.jsx)("a",{style:{textDecoration:"none",color:"inherit"},target:"blank",href:"https://desktop.telegram.org/changelog",children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{className:o.listIconText,children:"W"}),Object(a.jsx)(B.a,{children:"Switch to Old Version"})]})}),Object(a.jsx)(Q.a,{}),Object(a.jsx)(u.a,{style:{cursor:"default"},children:Object(a.jsx)(B.a,{secondary:"Telegram WebZ 1.32.3",className:o.listItemLast})})]})})})},en=n(170),tn=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"8px 8px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),nn=Object(r.a)({listItem_iconAvatar:{marginRight:10},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},pinnedIcon:{marginLeft:"auto",transform:"rotate(45deg)",color:"#959595"}}),on=function(e){var t=e.contact,n=e.handleListItemClick,c=e.rightIsOpen,r=e.id,l=e.pinned,d=nn(),b=Object(i.b)(),f=Object(s.useState)(null),p=Object(o.a)(f,2),m=p[0],h=p[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),v=g[0],y=g[1],w=Object(s.useState)(!1),S=Object(o.a)(w,2),k=S[0],N=S[1],I=Boolean(m),T=t.name,z=t.lastName,R=t.avatarUrl,M=t.color,A=t.companionId,E=t.createdAt,L=t.number,Y=t._id,F=function(e){"copy"===e&&Object(D.a)("Number"),"delete"===e&&N(!0),h(null),y(!1)};return Object(a.jsxs)("div",{children:[Object(a.jsxs)(W.a,{selected:v,onClick:function(){return n(A)},onContextMenu:function(e){return function(e){e.preventDefault(),h(e.currentTarget),y(!0)}(e)},children:[Object(a.jsx)(P.a,{className:d.listItem_iconAvatar,children:Object(a.jsx)(j.a,{alt:T,src:R?"".concat(D.m,"/").concat(R):void 0,sx:{background:M,width:54,height:54},children:!R&&"".concat(Object(D.e)(T)).concat(Object(D.e)(z))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(T)).concat(Object(D.q)(T,15,1),"\n ").concat(Object(D.e)(z)).concat(Object(D.q)(z,15,1)),secondary:"Registered since ".concat(Object(D.s)(E))}),l&&Object(a.jsx)(Nt.a,{className:d.pinnedIcon,fontSize:"small"})]}),Object(a.jsxs)(tn,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:m,open:I,onClose:F,children:[Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return F("copy")},text:L,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy number"]})}),Object(a.jsxs)(u.a,{onClick:function(){return function(e,t){Object(Ie.n)(e,!t),F(void 0)}(r,l)},children:[l?Object(a.jsx)(O.a,{className:d.iconClose}):Object(a.jsx)(Nt.a,{}),l?"Unpin contact":"Pin contact"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return F("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete contact"]})]}),k&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return N(!1);"delete"===t&&("edit"===c&&b(Object(C.c)("credentials")),Object(Ie.q)(Y),N(!1))},className:d.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:d.modalDelete,children:[Object(a.jsxs)("div",{className:d.titleWrapper,children:[Object(a.jsx)(j.a,{alt:T,src:R?"".concat(D.m,"/").concat(R):void 0,sx:{background:M,width:38,height:38,marginRight:2},children:"".concat(Object(D.e)(T)).concat(Object(D.e)(z))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(D.e)(T)).concat(Object(D.q)(T,15,1),"\n ").concat(Object(D.e)(z)).concat(Object(D.q)(z,15,1)),"?")}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},an=Object(Re.a)([function(e){return e.contacts.contacts}],(function(e){return e})),cn=Object(Re.a)([function(e){return e.contacts}],(function(e){return e})),rn=n(46),sn=function(){return function(){var e=Object(ke.a)(Se.a.mark((function e(t){var n;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(Ie.g)();case 3:(n=e.sent)&&t(Object(rn.b)(n)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(Object(rn.a)());case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},ln=function(e){return function(){var t=Object(ke.a)(Se.a.mark((function t(n){return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(Ie.a)(e);case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()},dn=Object(r.a)({list:{width:"100%",maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),bn=function(e){var t=e.value,n=e.handleClick,o=e.sort,c=e.date,r=e.setDisabled,l=dn(),d=Object(i.b)(),b=Object(i.c)(cn),j=b.total,f=b.contacts,u=Object(i.c)(Ee),p=function(e){n(),d(Object(C.c)("")),d(Object(C.b)(!1)),d(Ye(e))};Object(s.useEffect)((function(){d(Object(C.a)("contacts"))}),[d]),Object(s.useEffect)((function(){r("0"===j)}),[j,r]),Object(s.useEffect)((function(){var e=function(){return d(sn())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[d]);var m=Object(s.useMemo)((function(){var e=[],n=Object(D.i)("name",f,o).filter((function(e){var n=e.name+" "+e.lastName;return c?n.toLowerCase().includes(t.toLowerCase())&&Object(D.t)(c)===Object(D.t)(e.createdAt)?e:void 0:n.toLowerCase().includes(t.toLowerCase())})).filter((function(t){return!0===t.pinned?void e.push(t):t}));return[].concat(e,Object(N.a)(n))}),[f,c,t,o]);return"0"!==j?Object(a.jsx)(R.a,{className:l.list,component:"nav","aria-label":"main mailbox folders",children:m.length>0?m.map((function(e){return Object(a.jsx)(on,{contact:e,handleListItemClick:p,rightIsOpen:u,id:e._id,pinned:e.pinned},e.number)})):Object(a.jsx)(_,{name:"Can not find Contact by request : ".concat(t)})}):Object(a.jsx)(_,{name:"You do not have Contact yet!"})},jn=n(593),fn=n(587),un=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),pn=function(e){var t=e.handleClick,n=un();return Object(a.jsx)(nt.a,{className:n.toolBar,children:Object(a.jsx)($e.a,{onClick:t,children:Object(a.jsx)(et.a,{className:n.iconArrow})})})},mn=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:350,margin:"0 auto",paddingBottom:24},title:{marginBottom:20,textAlign:"center"},buttonNext:{marginTop:20,height:50,color:"#f8f8f8",backgroundColor:"#1d74c5"},textField:{marginBottom:20}}),hn=function(e){var t=e.handleClick,n=mn(),c=Object(i.b)(),r=Object(s.useState)(""),l=Object(o.a)(r,2),d=l[0],b=l[1],j=function(){var e=Object(ke.a)(Se.a.mark((function e(){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(ln(d)),c(Object(C.a)("contacts"));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(){return!(d.length<13||d.length>13)&&(d.slice(0,1),!0)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(pn,{handleClick:t}),Object(a.jsxs)("div",{onKeyDown:function(e){"Enter"===e.code&&f()&&j()},className:n.container,children:[Object(a.jsx)(A.a,{className:n.title,variant:"h5",color:"initial",children:"Add new contact"}),Object(a.jsx)(jn.a,{id:"number",name:"NUMBER",label:"Write down a number,+ is requirement",value:d,fullWidth:!0,variant:"outlined",onChange:function(e){var t=e.target.value.split(" ").join("").trim();b(t)},className:n.textField,required:!0}),f()&&Object(a.jsx)(fn.a,{onClick:j,className:n.buttonNext,color:"primary",variant:"contained",fullWidth:!0,children:" ADD"})]})]})},xn=n(187),gn=n.n(xn),On=n(425),vn=n.n(On),yn=n(326),Cn=n.n(yn),wn=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(5),minWidth:180,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),Sn=function(){var e=Object(i.b)(),t=Object(s.useState)(null),n=Object(o.a)(t,2),c=n[0],r=n[1],l=Boolean(c),d=function(t){"logout"===t&&e(Object(st.d)()),r(null)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)($e.a,{onClick:function(e){return r(e.currentTarget)},"aria-label":"delete",style:{marginLeft:5},size:"medium",children:Object(a.jsx)(Cn.a,{fontSize:"medium"})}),Object(a.jsx)(wn,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:c,open:l,onClose:d,children:Object(a.jsxs)(u.a,{style:{fontWeight:500},onClick:function(){return d("logout")},children:[Object(a.jsx)(vn.a,{}),"Log Out"]})})]})},kn=Object(r.a)({container:{width:"100%",height:"7vh",padding:10,display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Nn=function(e){var t=e.handleClick,n=kn(),o=Object(i.b)();return Object(a.jsxs)(M.a,{className:n.container,direction:"row",spacing:21,children:[Object(a.jsx)($e.a,{onClick:t,"aria-label":"delete",size:"medium",children:Object(a.jsx)(et.a,{className:n.iconArrow,fontSize:"medium"})}),Object(a.jsx)(A.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Settings"}),Object(a.jsx)($e.a,{onClick:function(){return o(Object(C.a)("edit"))},style:{marginLeft:"auto"},"aria-label":"delete",size:"medium",children:Object(a.jsx)(gn.a,{fontSize:"medium"})}),Object(a.jsx)(Sn,{})]})},In=n(327),Tn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AQMAAACyIsh+AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFAAAAp3o92gAAAAF0Uk5TAEDm2GYAAAAeSURBVHic7cEBAQAAAIIg/69uSEABAAAAAAAAAL8GIDoAASo5tcIAAAAASUVORK5CYII=",zn=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),Rn=function(e){var t=e.setModal,n=e.index,o=e.setIndex,c=zn();return Object(a.jsx)("div",{onClick:function(e){var a=e.target.id;if("overlay"===a||"cancel"===a)return t(!1);"delete"===a&&(Object(Ie.t)(n),o(n-1),t(!1))},className:c.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:c.modalDelete,children:[Object(a.jsx)("div",{className:c.titleWrapper,children:Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete image"})}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the Image?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE IMAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},Mn=Object(r.a)({container:{width:"100%",backgroundColor:"#ffffff",position:"relative"},nameTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:8,fontSize:18,zIndex:10,top:"6%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},timeTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"1%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},countryTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"13%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},credentialsTitle:{position:"absolute",color:"#ffffff",fontSize:100,top:"30%",left:"38%"},credentialsLowTitle:{position:"absolute",color:"#ffffff",fontSize:25,top:"90%",left:"9%"},iconDeleteWrapper:{position:"absolute",top:"1%",right:"9%"},iconDelete:{"&:hover":{opacity:1,color:"#fa0000",animation:"$shake 0.5s"}},"@keyframes shake":{"0%":{transform:"translate(0.5px, 0.5px) rotate(0deg)"},"10%":{transform:"translate(-0.5px, -1px) rotate(-1deg)"},"20%":{transform:"translate(-1.5px, 0px) rotate(1deg)"},"30%":{transform:"translate(1.5px, 1px) rotate(0deg)"},"40%":{transform:"translate(0.5px, -0.5px) rotate(1deg)"},"50%":{transform:"translate(-0.5px, 1px) rotate(-1deg)"},"60%":{transform:"translate(-1.5px, 0.5px) rotate(0deg)"},"70%":{transform:"translate(1.5px, 0.5px) rotate(-1deg)"},"80%":{transform:"translate(-0.5px, -0.5px) rotate(1deg)"},"90%":{transform:"translate(0.5px, 1px) rotate(0deg)"},"100%":{transform:"translate(0.5px, -1px) rotate(-1deg)"}}}),An=function(){var e=Mn(),t=Object(i.c)(Lt.a),n=t.name,c=t.lastName,r=t.avatarsArr,l=t.online,d=t.createdAt,b=t.color,f=t.country,u=Object(s.useState)(!1),p=Object(o.a)(u,2),m=p[0],h=p[1],x=Object(s.useState)(0),g=Object(o.a)(x,2),O=g[0],v=g[1],y=0!==r.length;return Object(a.jsxs)("div",{className:e.container,children:[m&&Object(a.jsx)(Rn,{setModal:h,index:O,setIndex:v}),Object(a.jsx)(In.Carousel,{onChange:function(e){return v(e)},selectedItem:O,children:y?r.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"pic",src:"".concat(D.m,"/").concat(t)}),Object(a.jsx)("p",{className:"legend",children:Object(D.s)(n)})]},t)})):[Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"transparentPic",src:Tn,style:{background:"linear-gradient(to bottom, ".concat(b,", ").concat(b," 80%, #5d5d5d 100%)")}}),Object(a.jsx)("p",{className:"legend",children:Object(D.s)(d)})]})]}),Object(a.jsx)("span",{className:e.nameTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.q)(n,15,1),"\n ").concat(Object(D.e)(c)).concat(Object(D.q)(c,15,1))}),Object(a.jsx)("span",{className:e.timeTitle,children:"true"===l?"online":"last seen ".concat(Object(D.s)(l))}),Object(a.jsx)("span",{className:e.countryTitle,children:f}),!y&&Object(a.jsx)("span",{className:e.credentialsTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.e)(c))}),!y&&Object(a.jsx)("span",{className:e.credentialsLowTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.e)(c))}),r.length>0&&Object(a.jsx)("div",{className:e.iconDeleteWrapper,children:Object(a.jsx)(j.a,{className:e.iconDelete,onClick:function(){return h(!0)},sx:{width:36,height:36,backgroundColor:"rgb(0,0,0)",color:"#ffffff",opacity:.5,cursor:"pointer"},children:Object(a.jsx)(Ot.a,{fontSize:"medium"})})})]})},Dn=n(249),En=n.n(Dn),Ln=Object(r.a)({container:{width:"100%",backgroundColor:"#ffffff"}}),Wn=function(){var e=Ln(),t=Object(i.c)(Lt.c);return Object(a.jsx)(Pt.a,{className:e.container,children:Object(a.jsx)(Yt.a,{children:Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return Object(D.a)("Number")},text:t,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{style:{marginRight:15},children:Object(a.jsx)(En.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{primary:t,secondary:"Copy number"})]})})})})},Bn=function(e){var t=e.handleClick,n=Object(i.b)();return Object(s.useEffect)((function(){var e=function(){return n(Object(st.b)())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[n]),Object(a.jsxs)("div",{style:{backgroundColor:"#f3f2f2",height:"100%",width:"100%"},children:[Object(a.jsx)(Nn,{handleClick:t}),Object(a.jsx)(An,{}),Object(a.jsx)(Wn,{})]})},Pn=Object(r.a)({container:{paddingLeft:10,height:"7vh",width:"100%",display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Yn=function(){var e=Pn(),t=Object(i.b)();return Object(a.jsxs)(M.a,{className:e.container,direction:"row",spacing:21,children:[Object(a.jsx)($e.a,{onClick:function(){return t(Object(C.a)("settings"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(et.a,{className:e.iconArrow,fontSize:"medium"})}),Object(a.jsx)(A.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit profile"})]})},Fn=n(333),Un=n.n(Fn),qn=n(280),_n=n.n(qn),Hn=n(281),Vn=n.n(Hn),$n=n(293),Gn=n(279),Kn=n.n(Gn),Jn=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:"100%",padding:20,paddingTop:0,position:"relative",backgroundColor:"#ffffff"},imgWrapper:{marginBottom:30,width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",alignContent:"center",flexDirection:"row",justifyContent:"center"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",flexDirection:"column"},capturedPicture:{borderRadius:10,border:"solid 2px rgb(62, 149, 231)"},capturePhoto:{color:"#ffffff",cursor:"pointer","&:hover":{color:"#48ff00",animation:"$rotating 2s linear infinite"}},"@keyframes rotating":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}),Qn=function(e){var t=Jn(),n=e.user,o=e.name,c=e.setName,r=e.lastName,i=e.setLastName,l=e.openBtn,b=e.setOpenBtn,f=e.file,u=e.setFile,p=e.camera,m=e.setCamera,h=e.selfie,x=e.setSelfie,g=n.avatarUrl,O=n.color,v=n.silentMode,y=Object($n.a)({noDrag:!0,accept:"image/*"}),C=y.getRootProps,w=y.getInputProps,S=y.acceptedFiles,k=function(e){!l&&b(!0);var t=Object(D.f)(e.target.value);switch(e.target.name){case"name":c(t);break;case"lastName":i(t)}};return Object(s.useEffect)((function(){S.slice(-1)[0]&&(u(S.slice(-1)[0]),x(!1),b(!0))}),[u,x,b,S]),Object(a.jsxs)("div",{className:t.container,children:[Object(a.jsxs)("div",{className:t.imgWrapper,children:[Object(a.jsxs)("div",Object(d.a)(Object(d.a)({},C()),{},{children:[Object(a.jsx)(Un.a,{fontSize:"large",sx:{color:f?"rgb(62, 149, 231)":"#6b6b6b","&:hover":{color:"rgb(41, 139, 231)"},cursor:"pointer"}}),Object(a.jsx)("input",Object(d.a)({},w()))]})),Object(a.jsx)(G.a,{style:{margin:"0px 20px"},children:Object(a.jsx)(j.a,{alt:o,src:g?"".concat(D.m,"/").concat(g):void 0,sx:{background:O,width:120,height:120,fontSize:30},children:"".concat(Object(D.e)(o)).concat(Object(D.e)(r))})}),Object(a.jsx)(_n.a,{onClick:function(){m(!0),f&&u(null)},fontSize:"large",sx:{color:h?"rgb(62, 149, 231)":"#6b6b6b","&:hover":{color:"rgb(41, 139, 231)"},cursor:"pointer"}})]}),p&&Object(a.jsx)("div",{onClick:function(e){"overlay"===e.target.id&&m(!1)},id:"overlay",className:t.overlay,children:Object(a.jsx)(Kn.a,{audio:!1,screenshotFormat:"image/jpeg",width:"40%",videoConstraints:{width:1280,height:720,facingMode:"user"},style:{marginBottom:30},children:function(e){var n=e.getScreenshot;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Vn.a,{onClick:function(){x(n()),b(!0),!v&&Object(D.k)("".concat(D.n,"/cameraCapture.mp3"))},className:t.capturePhoto,fontSize:"large",style:{marginBottom:30}}),Object(a.jsx)("img",{className:t.capturedPicture,width:"300",height:"174",style:{visibility:h?"visible":"hidden"},src:h,alt:"chosen pic"})]})}})}),Object(a.jsx)(jn.a,{id:"name",name:"name",label:"Name",value:o,fullWidth:!0,variant:"outlined",onChange:k,style:{marginBottom:30}}),Object(a.jsx)(jn.a,{id:"lastName",name:"lastName",label:"LastName",value:r,fullWidth:!0,variant:"outlined",onChange:k})]})},Xn=Object(r.a)({container:{position:"absolute",content:"",top:"92vh",right:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),Zn=function(e){var t=e.handleSubmit,n=Xn();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)(j.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(a.jsx)(St.a,{fontSize:"medium"})})})},eo=Object(r.a)({container:{width:"100%",height:"100%",backgroundColor:"#f3f2f2",position:"relative"}}),to=function(){var e=eo(),t=Object(i.b)(),n=Object(i.c)(Lt.a),c=Object(s.useState)(""),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Object(s.useState)(""),j=Object(o.a)(b,2),f=j[0],u=j[1],p=Object(s.useState)(!1),m=Object(o.a)(p,2),h=m[0],x=m[1],g=Object(s.useState)(!1),O=Object(o.a)(g,2),v=O[0],y=O[1],C=Object(s.useState)(null),w=Object(o.a)(C,2),S=w[0],k=w[1],N=Object(s.useState)(null),I=Object(o.a)(N,2),T=I[0],z=I[1],R=n.name,M=n.lastName,A=function(){var e=Object(ke.a)(Se.a.mark((function e(){var t;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l===R&&f===M){e.next=3;break}return e.next=3,Object(Ie.K)({name:l,lastName:f,originalName:l,originalLastName:f});case 3:if(S&&fetch(S).then((function(e){return e.blob()})).then((function(e){var t=new File([e],"selfie",{type:"image/jpeg"}),n=new FormData;n.append("avatar",t),Object(Ie.N)(n)})),!T){e.next=9;break}return(t=new FormData).append("avatar",T),e.next=9,Object(Ie.N)(t);case 9:T&&z(null),S&&k(null),h&&x(!1);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(s.useEffect)((function(){var e=function(){return!h&&t(Object(st.b)())};e();var n=setInterval(e,D.p);return function(){return clearInterval(n)}}),[h,t]),Object(s.useEffect)((function(){R&&d(R),M&&u(M)}),[R,M]),Object(a.jsxs)("div",{className:e.container,children:[h&&Object(a.jsx)(Zn,{handleSubmit:A}),Object(a.jsx)(Yn,{}),Object(a.jsx)(Qn,{user:n,name:l,setName:d,lastName:f,setLastName:u,openBtn:h,setOpenBtn:x,file:T,setFile:z,camera:v,setCamera:y,selfie:S,setSelfie:k})]})},no=function(e){var t=e.chatDivRef,n=Object(i.b)(),r=Object(i.c)(Lt.a),d=r.sort,b=r.nightMode,j=r.silentMode,f=Object(i.c)(De),u=Object(s.useState)(!1),p=Object(o.a)(u,2),m=p[0],h=p[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1],y=Object(s.useState)(!0),w=Object(o.a)(y,2),S=w[0],N=w[1],I=Object(s.useState)(""),T=Object(o.a)(I,2),z=T[0],R=T[1],M=Object(s.useState)(""),A=Object(o.a)(M,2),D=A[0],E=A[1],L=Object(s.useRef)(null),W=function(){n(Object(C.a)("")),h(!0)};return Object(s.useEffect)((function(){R(""),E(""),h(!1),v(!1)}),[f]),Object(s.useEffect)((function(){var e=function(e){"overlay"===e.target.id&&(h(!1),v(!1))};if(!L.current){var t=document.getElementById("modal-root");t&&(t.addEventListener("click",e),L.current=t)}return function(){L.current&&(L.current.removeEventListener("click",e),L.current=null)}}),[]),Object(a.jsxs)(c.a,{item:!0,lg:3,style:{position:"relative",backgroundColor:"#ffffff"},onMouseEnter:function(){return!O&&v(!0)},onMouseLeave:function(){return O&&v(!1)},children:[""===f||"contacts"===f||"searchChats"===f||"searchAllMessages"===f?Object(a.jsx)(ut,{handleClick:W,handleOpenIsSearch:function(e){var t=e.target.id;""===f&&"sort"===t||""===f&&n(Object(C.a)("searchChats"))},sort:d,handleSearch:function(e){return R(e.target.value)},leftIsOpen:f,value:z,setDate:E,date:D,disabled:S}):null,"searchChats"===f||"searchAllMessages"===f?Object(a.jsx)(Ve,{value:z,setValue:R,sort:d,date:D,setDate:E,setDisabled:N,chatDivRef:t}):null,""===f&&Object(a.jsx)(Bt,{sort:d,setDisabled:N}),""===f&&O&&Object(a.jsx)(k,{setPopup:v}),m&&L.current&&Object(l.createPortal)(Object(a.jsx)(Zt,{nightMode:b,silentMode:j}),L.current),"contacts"===f&&Object(a.jsx)(bn,{handleClick:W,value:z,sort:d,date:D,setDisabled:N}),"contact"===f&&Object(a.jsx)(hn,{handleClick:W}),"settings"===f&&Object(a.jsx)(Bn,{handleClick:W}),"edit"===f&&Object(a.jsx)(to,{})]})},oo=n(625),ao=function(){var e=Object(i.b)(),t=Object(i.c)(Et.a),n=t.name,o=t.lastName,c=t.avatarUrl,r=t.color,s=t.online;return Object(a.jsxs)(W.a,{onClick:function(){return e(Object(C.c)("credentials"))},children:[Object(a.jsx)(P.a,{children:Object(a.jsx)(j.a,{alt:n,src:c?"".concat(D.m,"/").concat(c):void 0,sx:{background:r,width:44,height:44},children:!c&&"".concat(Object(D.e)(n)).concat(Object(D.e)(o))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(n)).concat(Object(D.q)(n,15,1),"\n ").concat(Object(D.e)(o)).concat(Object(D.q)(o,15,1)),secondaryTypographyProps:{color:"#0379af"},secondary:"true"===s?"online":"last seen ".concat(Object(D.s)(s))})]})},co=n(174),ro=n.n(co),io=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(-2),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"14px 14px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(4)}}}}})),so=function(e){var t=e.setModalDelete,n=e.setIsSomeSelected,c=Object(s.useState)(null),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Boolean(l),j=Object(i.c)(Et.a),f=j.companionId,p=j.mute,m=function(e){"mute"===e&&Object(Ie.k)(f),"deleteModal"===e&&t(!0),d(null)};return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)($e.a,{onClick:function(e){e.stopPropagation(),d(e.currentTarget)},"aria-label":"delete",size:"medium",children:Object(a.jsx)(Cn.a,{fontSize:"medium"})}),Object(a.jsxs)(io,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:l,open:b,onClose:m,children:[Object(a.jsxs)(u.a,{onClick:function(){return m("mute")},children:[p?Object(a.jsx)(mt.a,{}):Object(a.jsx)(xt.a,{}),p?"Unmute":"Mute"]}),Object(a.jsxs)(u.a,{onClick:function(){n(!0),m(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select message"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return m("deleteModal")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete chat"]})]})]})},lo=Object(r.a)({modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),bo=function(e){var t=e.setModalDelete,n=lo(),o=Object(i.b)(),c=Object(i.c)(Et.a),r=c.name,s=c.lastName,l=c.avatarUrl,d=c.color,b=c.companionId;return Object(a.jsx)("div",{onClick:function(e){var n=e.target.id;if("overlay"===n||"cancel"===n)return t(!1);"delete"===n&&(Object(Ie.p)(b),t(!1),o(Object(Pe.b)()),o(Object(C.c)("")))},className:n.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:n.modalDelete,children:[Object(a.jsxs)("div",{className:n.titleWrapper,children:[Object(a.jsx)(j.a,{alt:r,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(D.e)(r)).concat(Object(D.e)(s))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete chat"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete the\n chat with ".concat("".concat(Object(D.e)(r)).concat(Object(D.q)(r,15,1)," \n ").concat(Object(D.e)(s)).concat(Object(D.q)(s,15,1)),"?")}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CHAT"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})},jo=Object(r.a)({container:{marginLeft:20,display:"flex",alignContent:"center",alignItems:"center"}}),fo=function(e){var t=e.setIsSomeSelected,n=e.handleStartCall,c=jo(),r=Object(i.b)(),l=Object(s.useState)(!1),d=Object(o.a)(l,2),b=d[0],j=d[1];return Object(a.jsxs)(M.a,{className:c.container,direction:"row",children:[Object(a.jsx)($e.a,{onClick:function(e){e.stopPropagation(),r(Object(C.c)("search"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(Qe.a,{fontSize:"medium"})}),Object(a.jsx)($e.a,{onClick:n,"aria-label":"delete",size:"medium",children:Object(a.jsx)(En.a,{fontSize:"medium"})}),Object(a.jsx)(so,{setModalDelete:j,setIsSomeSelected:t}),b&&Object(a.jsx)(bo,{setModalDelete:j})]})},uo=n(433),po=n.n(uo),mo=n(199),ho=n.n(mo),xo=Object(r.a)({container:{marginLeft:20,display:"flex",alignContent:"center",alignItems:"center",position:"relative"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},listWrapper:{background:"#fdfdfd",padding:0},listWrapperDashes:{position:"absolute",top:0,width:2,height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-around",flexWrap:"nowrap",listStyle:"none"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},modalUnpin:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},folderIcon:{color:"#54b0fc"}}),go=function(e){var t=e.chatDivRef,n=e.handleOpenPinned,c=xo(),r=Object(i.c)(Ue),l=Object(s.useState)(null),d=Object(o.a)(l,2),b=d[0],j=d[1],f=Object(s.useState)(0),p=Object(o.a)(f,2),m=p[0],h=p[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),v=g[0],y=g[1],C=100/r.length,w=C-C/100*20;return Object(s.useEffect)((function(){j(r[m])}),[r,m]),b?Object(a.jsxs)(M.a,{className:c.container,direction:"row",children:[Object(a.jsx)("ul",{className:c.listWrapperDashes,children:r.map((function(e){var t=e._id;return Object(a.jsx)("li",{style:{backgroundColor:b._id===t?"#00aeff":"#addbf0",height:"".concat(w,"%")}},t)}))}),Object(a.jsx)("ul",{className:c.listWrapper,children:Object(a.jsxs)(u.a,{onClick:function(){var e,n=t.current.childNodes[0].childNodes;r.length-1===m?(h(0),e=Object(N.a)(n).find((function(e){return e.id===r[0]._id}))):(h((function(e){return e+1})),e=Object(N.a)(n).find((function(e){return e.id===r[m+1]._id}))),e&&((e=Object(N.a)(e.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",e.style.boxShadow="0px 0px 6px 0px #ffffff",e.scrollIntoView({behavior:"smooth"}),setTimeout((function(){e.style.backgroundColor="unset",e.style.boxShadow="unset"}),2e3))},children:[Object(a.jsx)(B.a,{style:{margin:"0px 10px 0px 20px"},primary:"Pinned Message ".concat(m+1," of ").concat(r.length),primaryTypographyProps:{color:"#0379af",fontSize:16},secondary:"Type : ".concat(b.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===b.type&&Object(a.jsx)(fe.a,{className:c.folderIcon,fontSize:"large"}),"audio"===b.type&&Object(a.jsx)(he.a,{className:c.folderIcon,fontSize:"large"}),"video"===b.type&&Object(a.jsx)(ve.a,{className:c.folderIcon,fontSize:"large"}),"image"===b.type&&Object(a.jsx)(ho.a,{className:c.folderIcon,fontSize:"large"}),"pdf"===b.type&&Object(a.jsx)(J.a,{className:c.folderIcon,fontSize:"large"}),"docx"===b.type&&Object(a.jsx)(J.a,{className:c.folderIcon,fontSize:"large"})]})}),Object(a.jsx)($e.a,{onClick:function(){return y(!0)},"aria-label":"delete",size:"medium",children:Object(a.jsx)(O.a,{className:c.iconClose,fontSize:"medium"})}),Object(a.jsx)($e.a,{onClick:n,"aria-label":"delete",size:"medium",children:Object(a.jsx)(po.a,{fontSize:"medium"})}),v&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return y(!1);if("unpin"===t&&b){if(Object(Ie.o)(b._id,!b.pinned),y(!1),m-1>=0)return h((function(e){return e-1}));h(0)}},className:c.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:c.modalUnpin,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Telegram"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Would you like to unpin this message?"}),Object(a.jsx)(It.a,{id:"unpin",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"UNPIN"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]}):null},Oo=Object(r.a)({toolBar:{color:"#6e6d6d",display:"flex",justifyContent:"space-between",backgroundColor:"#ffffff",height:"7vh"},toolBarPinned:{color:"#6e6d6d",display:"flex",alignItems:"center",alignContent:"center",backgroundColor:"#ffffff",height:"7vh",cursor:"pointer"},pinnedBack:{display:"flex",width:"100%",alignContent:"center",alignItems:"center",flexWrap:"nowrap"},credentials:{background:"#fdfdfd",width:"100%",height:"100%",margin:"0 auto"},toolBarRight:{display:"flex"},buttonDelete:{color:"#f8f8f8",backgroundColor:"#1d74c5"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),vo=function(e){var t=e.chatDivRef,n=e.selectedArr,c=e.isSomeSelected,r=e.setIsSomeSelected,l=e.handleClearSelect,d=e.openPinned,b=e.pinnedMessagesMemo,j=e.handleStartCall,f=Oo(),u=Object(i.b)(),p=Object(i.c)(Et.b).companionId,m=Object(s.useState)(!1),h=Object(o.a)(m,2),x=h[0],g=h[1];return Object(a.jsxs)(a.Fragment,{children:[!c&&d&&b.length>0&&Object(a.jsx)(oo.a,{position:"static",children:Object(a.jsxs)(nt.a,{className:f.toolBarPinned,children:[Object(a.jsxs)("div",{onClick:function(e){e.stopPropagation(),u(Object(C.c)("credentials"))},className:f.pinnedBack,children:[Object(a.jsx)($e.a,{onClick:function(e){e.stopPropagation(),u(Object(C.b)(!1))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(et.a,{className:f.iconArrow,fontSize:"medium"})}),Object(a.jsx)(A.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"".concat(b.length," pinned messages")})]}),Object(a.jsx)(fo,{setIsSomeSelected:r,handleStartCall:j})]})}),!d&&!c&&Object(a.jsx)(oo.a,{position:"static",children:Object(a.jsxs)(nt.a,{className:f.toolBar,children:[Object(a.jsx)(ao,{}),Object(a.jsxs)("div",{className:f.toolBarRight,children:[Object(a.jsx)(go,{chatDivRef:t,handleOpenPinned:function(){return u(Object(C.b)(!0))}}),Object(a.jsx)(fo,{setIsSomeSelected:r,handleStartCall:j})]})]})}),c&&Object(a.jsxs)(oo.a,{position:"static",children:[Object(a.jsxs)(nt.a,{className:f.toolBar,children:[Object(a.jsx)(It.a,{color:"primary",onClick:function(){return g(!0)},variant:"contained",className:f.buttonDelete,style:{visibility:0===n.length?"hidden":"visible",fontWeight:500},children:"DELETE ".concat(n.length)}),Object(a.jsx)(It.a,{onClick:l,style:{color:"#1d74c5",fontWeight:500},children:"CANCEL"})]}),x&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t)return g(!1);"cancel"===t&&(l(),g(!1)),"delete"===t&&(Object(Ie.s)(p,n),l(),g(!1))},className:f.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:f.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete messages"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete messages?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGES"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},yo=n(434),Co=n.n(yo),wo=Object(r.a)({avatarArrowWrapper:{position:"absolute",right:20,top:"70vh",width:56},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"}},listSeenIcon:{position:"absolute",top:-8,left:16,borderRadius:"50%",color:"#ffffff",border:"none",height:24,width:24,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",fontSize:12,zIndex:10,cursor:"pointer"}}),So=function(e){var t=e.isArrow,n=e.handleScrollTo,o=e.isNew,c=e.openPinned,r=wo();return Object(a.jsxs)("div",{className:r.avatarArrowWrapper,style:{display:t?"block":"none"},children:[Object(a.jsx)("button",{onClick:n,style:{display:o.new&&!c?"block":"none",background:o.mute?"#a7aaa7":"#0ac40a"},className:r.listSeenIcon,children:o.new}),Object(a.jsx)(j.a,{onClick:n,className:r.avatarArrow,sx:{backgroundColor:"#ffffff",width:56,height:56,color:"#6b6b6b"},children:Object(a.jsx)(Co.a,{fontSize:"medium"})})]})},ko=n(439),No=n.n(ko),Io=n(440),To=n.n(Io),zo=n(334),Ro=n.n(zo),Mo=n(438),Ao=n.n(Mo),Do=n(443),Eo=n.n(Do),Lo=n(441),Wo=n.n(Lo),Bo=n(442),Po=n.n(Bo),Yo=n(435),Fo=n.n(Yo),Uo=n(628),qo=n(436),_o=Object(r.a)({container:{width:"100%",position:"relative"},dropZone:{width:"100%",display:"flex",position:"relative",height:20,zIndex:10}}),Ho=function(e){var t=e.children,n=e.setFile,o=e.setValue,c=e.accept,r=e.setType,i=e.prevType,l=_o(),b=Object($n.a)({noDrag:!0,accept:c,onFileDialogCancel:function(){return r(i)}}),j=b.getRootProps,f=b.getInputProps,u=b.acceptedFiles;return Object(s.useEffect)((function(){u.slice(-1)[0]&&(o(""),n(u.slice(-1)[0]))}),[n,o,u]),Object(a.jsxs)("div",{className:l.container,children:[t,Object(a.jsx)("div",Object(d.a)(Object(d.a)({},j({className:l.dropZone})),{},{children:Object(a.jsx)("input",Object(d.a)({placeholder:"Photo or Video"},f()))}))]})},Vo=Object(r.a)({list:{background:"#fdfdfd"},listIcon:{position:"absolute",left:0},listText:{position:"absolute",left:40}}),$o=function(e){var t=e.setIsOpenMenu,n=e.setFile,o=e.setValue,c=e.setType,r=e.type,i=Vo(),l=function(e){var t=Object(s.useRef)();return Object(s.useEffect)((function(){t.current=e})),t.current}(r),d=function(e){t(!1),c(e)};return Object(a.jsxs)(Yt.a,{className:i.list,children:[Object(a.jsx)(u.a,{onClick:function(){return d("content")},children:Object(a.jsxs)(Ho,{setFile:n,setValue:o,setType:c,prevType:l,accept:"image/*,video/*,audio/*",children:[Object(a.jsx)(P.a,{className:i.listIcon,children:Object(a.jsx)(J.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{className:i.listText,children:"Upload Image/Audio/Video"})]})}),Object(a.jsx)(u.a,{onClick:function(){return d("application")},children:Object(a.jsxs)(Ho,{setFile:n,setValue:o,setType:c,prevType:l,accept:"application/pdf,\r application/vnd.openxmlformats-officedocument.wordprocessingml.document",children:[Object(a.jsx)(P.a,{className:i.listIcon,children:Object(a.jsx)(J.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{className:i.listText,children:"Upload File"})]})})]})},Go=n(172),Ko=n.n(Go),Jo=Object(r.a)({replyTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},replyIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},replyListWrapper:{width:"100%"},replyColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10},folderIcon:{color:"#54b0fc"}}),Qo=function(e){var t=e.isReply,n=e.handleCloseReply,o=e.handleScrollToTheMessage,c=Jo();return Object(a.jsxs)("div",{className:c.replyTop,children:[Object(a.jsx)(Ko.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)"}}),Object(a.jsx)("div",{className:c.replyColumn}),Object(a.jsx)("ul",{className:c.replyListWrapper,children:Object(a.jsxs)(u.a,{onClick:function(){return o(t._id)},children:[Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(t.name)).concat(Object(D.q)(t.name,15,1)," \n ").concat(Object(D.e)(t.lastName)).concat(Object(D.q)(t.lastName,15,1)),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"Type : ".concat(t.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===t.type&&Object(a.jsx)(fe.a,{className:c.folderIcon,fontSize:"large"}),"audio"===t.type&&Object(a.jsx)(he.a,{className:c.folderIcon,fontSize:"large"}),"video"===t.type&&Object(a.jsx)(ve.a,{className:c.folderIcon,fontSize:"large"}),"image"===t.type&&Object(a.jsx)(ho.a,{className:c.folderIcon,fontSize:"large"}),"pdf"===t.type&&Object(a.jsx)(J.a,{className:c.folderIcon,fontSize:"large"}),"docx"===t.type&&Object(a.jsx)(J.a,{className:c.folderIcon,fontSize:"large"})]})}),Object(a.jsx)(O.a,{onClick:n,className:c.replyIconClose})]})},Xo=Object(r.a)({forwardTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},forwardIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},forwardListWrapper:{width:"100%"},forwardColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10},folderIcon:{color:"#54b0fc"}}),Zo=function(e){var t=e.companionId,n=e.isForward,o=e.handleCloseForward,c=e.handleScrollToTheMessage,r=e.setIsForward,s=Xo(),l=Object(i.b)();return Object(a.jsxs)("div",{className:s.forwardTop,children:[Object(a.jsx)(Ko.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)",transform:"rotateY(180deg)"}}),Object(a.jsx)("div",{className:s.forwardColumn}),Object(a.jsx)("ul",{className:s.forwardListWrapper,children:Object(a.jsxs)(u.a,{onClick:function(){if(t===n.companionId)return c(n._id);r(void 0),l(Object(C.c)("")),l(Object(C.b)(!1)),l(Fe(n.companionId)),setTimeout((function(){return c(n._id)}),2e3)},children:[Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(n.name)).concat(Object(D.q)(n.name,15,1)," \n ").concat(Object(D.e)(n.lastName)).concat(Object(D.q)(n.lastName,15,1)),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"Type : ".concat(n.type.toUpperCase()),secondaryTypographyProps:{fontSize:16}}),"text"===n.type&&Object(a.jsx)(fe.a,{className:s.folderIcon,fontSize:"large"}),"audio"===n.type&&Object(a.jsx)(he.a,{className:s.folderIcon,fontSize:"large"}),"video"===n.type&&Object(a.jsx)(ve.a,{className:s.folderIcon,fontSize:"large"}),"image"===n.type&&Object(a.jsx)(ho.a,{className:s.folderIcon,fontSize:"large"}),"pdf"===n.type&&Object(a.jsx)(J.a,{className:s.folderIcon,fontSize:"large"}),"docx"===n.type&&Object(a.jsx)(J.a,{className:s.folderIcon,fontSize:"large"})]})}),Object(a.jsx)(O.a,{onClick:o,className:s.forwardIconClose})]})},ea=Object(r.a)({editTop:{position:"absolute",left:0,top:"-7vh",height:"6vh",width:"100%",borderRadius:8,display:"flex",flexWrap:"nowrap",alignContent:"center",alignItems:"center",color:"#6b6b6b",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff",padding:"0px 5px",zIndex:2},editListWrapper:{width:"100%",wordBreak:"break-word",overflowY:"auto",height:"6vh"},editIconClose:{cursor:"pointer",marginLeft:5,marginRight:5,"&:hover":{color:"#f02a2a",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},editColumn:{height:"80%",width:2,backgroundColor:"rgb(41, 139, 231)",marginRight:10}}),ta=function(e){var t=e.isEdit,n=e.handleCloseEdit,o=e.handleScrollToTheMessage,c=ea();return Object(a.jsxs)("div",{className:c.editTop,children:[Object(a.jsx)(gn.a,{style:{margin:"0px 7px",color:"rgb(41, 139, 231)"}}),Object(a.jsx)("div",{className:c.editColumn}),Object(a.jsx)("ul",{className:c.editListWrapper,children:Object(a.jsx)("li",{onClick:function(){return o(t._id)},children:Object(a.jsx)(B.a,{primary:"Edit ".concat("text"===t.type?"Message and Caption":"only Caption"),primaryTypographyProps:{color:"rgb(41, 139, 231)",fontSize:16},secondary:"text"===t.type?"Message: ".concat(t.message," , Caption: ").concat(t.caption):"Caption: ".concat(t.caption),secondaryTypographyProps:{fontSize:16}})})}),Object(a.jsx)(O.a,{onClick:n,className:c.editIconClose})]})},na=Object(r.a)({container:{width:"35vw",height:"6vh",position:"fixed",bottom:"2vh",borderRadius:8,padding:10,display:"flex",flexWrap:"nowrap",alignContent:"start",alignItems:"start",color:"#6b6b6b",border:"solid 2px #ffffff",backgroundColor:"#ffffff"},containerActive:{width:"35vw",height:"6vh",position:"fixed",bottom:"2vh",borderRadius:8,padding:10,display:"flex",flexWrap:"nowrap",alignContent:"start",alignItems:"start",border:"solid 2px rgb(41, 139, 231)",backgroundColor:"#ffffff"},textarea:{width:"100%",height:"100%",outline:"none",border:"none",padding:"0px 10px",marginLeft:8,marginRight:8,overflowY:"auto",resize:"none","&::placeholder":{color:"inherit",fontWeight:600,fontSize:20}},attachIcon:{transform:"rotate(30deg)"},borderTop:{position:"absolute",left:0,top:-21,width:"100%",height:1,background:"#ffffff"},filesMenu:{background:"#fdfdfd",position:"absolute",width:"15vw",maxWidth:"100%",left:"61%",bottom:"9vh",zIndex:10,visibility:"visible",borderRadius:10,padding:"4px 6px"},emoji:{position:"absolute",zIndex:10,visibility:"visible"},captionTextField:{zIndex:10,visibility:"visible",width:"35vw",backgroundColor:"#ffffff",borderRadius:4,height:"6vh",overflowY:"auto"},iconCancel:{position:"absolute",left:-72,bottom:-1,display:"flex",backgroundColor:"#ffffff",color:"rgb(243, 69, 69)",border:"solid 4px rgb(243, 69, 69)",borderRadius:"50%","&:hover":{backgroundColor:"rgb(243, 69, 69)",color:"#ffffff"}},avatarCamera:{position:"absolute",left:-72,bottom:-1,display:"flex",borderRadius:"50%",zIndex:10,border:"solid 14px #ffffff","&:hover":{backgroundColor:"rgb(41, 139, 231)",border:"solid 14px rgb(41, 139, 231)",color:"#ffffff"}},avatarRight:{position:"absolute",right:-72,bottom:-1,display:"flex",borderRadius:"50%",zIndex:10,border:"solid 14px #ffffff","&:hover":{backgroundColor:"rgb(41, 139, 231)",border:"solid 14px rgb(41, 139, 231)",color:"#ffffff"}},pauseLeft:{position:"absolute",left:-72,bottom:-1,zIndex:10},pauseRight:{position:"absolute",right:-72,bottom:-1,zIndex:10},avatarPause:{backgroundColor:"#ffffff",cursor:"pointer",animation:"$shake 1s",animationIterationCount:"infinite","&:hover":{backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100},ringContainerLeft:{position:"absolute",left:-25,top:-25,zIndex:10},ringContainerRight:{position:"absolute",right:-25,top:-25,zIndex:10},circle:{width:15,height:15,backgroundColor:"rgb(255, 4, 4)",borderRadius:"50%",position:"relative"},ringRing:{border:"3px solid rgb(255, 4, 4)",borderRadius:"50%",height:25,width:25,position:"absolute",right:-5,top:-5,animation:"$pulsate 1s ease-out",animationIterationCount:"infinite",opacity:0},"@keyframes pulsate":{"0%":{transform:"scale(0.1, 0.1)",opacity:0},"50%":{opacity:1},"100%":{transform:"scale(1.2, 1.2)",opacity:0}},"@keyframes shake":{"0%":{transform:"translate(0.5px, 0.5px) rotate(0deg)"},"10%":{transform:"translate(-0.5px, -1px) rotate(-1deg)"},"20%":{transform:"translate(-1.5px, 0px) rotate(1deg)"},"30%":{transform:"translate(1.5px, 1px) rotate(0deg)"},"40%":{transform:"translate(0.5px, -0.5px) rotate(1deg)"},"50%":{transform:"translate(-0.5px, 1px) rotate(-1deg)"},"60%":{transform:"translate(-1.5px, 0.5px) rotate(0deg)"},"70%":{transform:"translate(1.5px, 0.5px) rotate(-1deg)"},"80%":{transform:"translate(-0.5px, -0.5px) rotate(1deg)"},"90%":{transform:"translate(0.5px, 1px) rotate(0deg)"},"100%":{transform:"translate(0.5px, -1px) rotate(-1deg)"}},overlayCamera:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",flexDirection:"column"},capturedPicture:{borderRadius:10,border:"solid 2px rgb(62, 149, 231)"},capturePhoto:{color:"#ffffff",cursor:"pointer","&:hover":{color:"#48ff00",animation:"$rotating 2s linear infinite"}},"@keyframes rotating":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}),oa=function(e){var t=e.isArrow,n=e.silentMode,c=e.isReply,r=e.setIsReply,l=e.isForward,d=e.setIsForward,b=e.isEdit,f=e.setIsEdit,u=e.modalForward,p=e.handleScrollToTheMessage,m=na(),h=Object(i.c)(Et.a).companionId,x=Object(i.c)(Ee),g=Object(s.useState)(""),v=Object(o.a)(g,2),y=v[0],C=v[1],w=Object(s.useState)(!1),S=Object(o.a)(w,2),k=S[0],N=S[1],I=Object(s.useState)(""),T=Object(o.a)(I,2),z=T[0],R=T[1],M=Object(s.useState)(!1),A=Object(o.a)(M,2),E=A[0],L=A[1],W=Object(s.useState)(!1),B=Object(o.a)(W,2),P=B[0],Y=B[1],F=Object(s.useState)(!1),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Object(s.useState)(!1),V=Object(o.a)(H,2),$=V[0],G=V[1],K=Object(s.useState)(!1),J=Object(o.a)(K,2),Q=J[0],X=J[1],Z=Object(s.useState)(!1),ee=Object(o.a)(Z,2),te=ee[0],ne=ee[1],oe=Object(s.useState)(!1),ae=Object(o.a)(oe,2),ce=ae[0],re=ae[1],ie=Object(s.useState)(""),se=Object(o.a)(ie,2),le=se[0],de=se[1],be=Object(s.useState)(null),je=Object(o.a)(be,2),fe=je[0],ue=je[1],pe=Object(s.useState)(null),me=Object(o.a)(pe,2),he=me[0],xe=me[1],ge=Object(qo.useReactMediaRecorder)({audio:!0,blobPropertyBag:{type:"audio/mp3"}}),Oe=ge.startRecording,ve=ge.stopRecording,ye=ge.mediaBlobUrl,Ce=ge.clearBlobUrl,we=Object(qo.useReactMediaRecorder)({video:!0,blobPropertyBag:{type:"video/mp4"}}),Ne=we.startRecording,Te=we.stopRecording,ze=we.mediaBlobUrl,Re=we.clearBlobUrl,Me=function(e,t,n){"input"===n&&(C((function(e){return e+t.emoji})),_(!1)),"caption"===n&&(R((function(e){return e+t.emoji})),G(!1))},Ae=function(){N(!1),X(!1),ne(!1),C(""),R(""),de(""),Ce(),Re(),Y(!1),_(!1),L(!1),G(!1),ue(null),xe(null)},De=function(){var e=Object(ke.a)(Se.a.mark((function e(){var t,o,a,i,s,j;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!y||c||l||b||Object(Ie.y)(h,y,z.trim()),y&&c&&!l&&!b&&(Object(Ie.B)(c._id,y,z.trim()),r(void 0)),y&&l&&!b&&!c&&(Object(Ie.A)(l._id,l.companionIdForwardToAndFrom,y,z.trim()),d(void 0)),!b||l||c||(Object(Ie.z)(b._id,y,z.trim()),f(void 0)),ye&&"recording"===le&&((t=new XMLHttpRequest).open("GET",ye,!0),t.responseType="blob",t.onload=function(){if(200===t.status){var e=t.response,n=new File([e],"audio.mp3",{type:"audio/mpeg"}),o=new FormData;o.append("audio",n),Object(Ie.v)(h,o,z.trim()),Ce()}},t.send()),ze&&"filming"===le&&((o=new XMLHttpRequest).open("GET",ze,!0),o.responseType="blob",o.onload=function(){if(200===o.status){var e=o.response,t=new File([e],"video.mp4",{type:"video/mp4"}),n=new FormData;n.append("video",t),Object(Ie.C)(h,n,z.trim()),Re()}},o.send()),k&&le&&"base64"!==le&&(k.type.includes("image")&&"content"===le&&((a=new FormData).append("image",k),Object(Ie.x)(h,a,z.trim())),k.type.includes("audio")&&"content"===le&&((i=new FormData).append("audio",k),Object(Ie.v)(h,i,z.trim())),k.type.includes("video")&&"content"===le&&((s=new FormData).append("video",k),Object(Ie.C)(h,s,z.trim())),k.type.includes("application")&&"application"===le&&((j=new FormData).append("file",k),Object(Ie.w)(h,j,z.trim()))),"string"===typeof k&&"base64"===le&&fetch(k).then((function(e){return e.blob()})).then((function(e){var t=new File([e],"selfie",{type:"image/jpeg"}),n=new FormData;n.append("image",t),Object(Ie.x)(h,n,z.trim())})),Ae(),!n&&Object(D.k)("".concat(D.n,"/send.mp3"));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=Object(ke.a)(Se.a.mark((function e(){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Ie.H)(h,!0);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),We=function(){var e=Object(ke.a)(Se.a.mark((function e(){return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Ie.H)(h,!1);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){if(Q)return ue("stopped"),void ve();Oe(),ue("recording"),de("recording"),X(!0)},Pe=function(){if(te)return xe("stopped"),void Te();Ne(),xe("recording"),de("filming"),ne(!0)},Ye=Object(s.useCallback)((function(){ve(),Te(),Ce(),Re(),ue(null),xe(null),X(!1),ne(!1),N(!1),C(""),R(""),de(""),Y(!1),_(!1),L(!1),G(!1)}),[Re,Ce,Te,ve]);return Object(s.useEffect)((function(){Ye()}),[c,l,b,h]),Object(s.useEffect)((function(){r(void 0),f(void 0)}),[h,r,f]),Object(s.useEffect)((function(){b&&("text"===b.type&&C(b.message?b.message:""),R(b.caption?b.caption:""))}),[b,h]),Object(s.useEffect)((function(){var e=null===l||void 0===l?void 0:l.companionIdForwardToAndFrom;e&&e!==h&&d(void 0)}),[h]),Object(a.jsxs)("div",{className:y&&b&&"text"===b.type||b&&"text"!==b.type||y&&!b||k||"stopped"===fe||"stopped"===he?m.containerActive:m.container,children:[t&&Object(a.jsx)("div",{className:m.borderTop}),c&&Object(a.jsx)(Qo,{isReply:c,handleCloseReply:function(){r(void 0),Ae()},handleScrollToTheMessage:p}),b&&Object(a.jsx)(ta,{isEdit:b,handleCloseEdit:function(){f(void 0),Ae()},handleScrollToTheMessage:p}),l&&!u&&Object(a.jsx)(Zo,{companionId:h,isForward:l,handleCloseForward:function(){d(void 0),Ae()},handleScrollToTheMessage:p,setIsForward:d}),te&&"stopped"!==he&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:m.pauseLeft,children:Object(a.jsx)(j.a,{onClick:Pe,className:m.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(a.jsx)(Ao.a,{fontSize:"large"})})}),Object(a.jsxs)("div",{className:m.ringContainerLeft,children:[Object(a.jsx)("div",{className:m.ringRing}),Object(a.jsx)("div",{className:m.circle})]})]}),Q&&"stopped"!==fe&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("div",{className:m.pauseRight,children:Object(a.jsx)(j.a,{onClick:Be,className:m.avatarPause,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},children:Object(a.jsx)(Ao.a,{fontSize:"large"})})}),Object(a.jsxs)("div",{className:m.ringContainerRight,children:[Object(a.jsx)("div",{className:m.ringRing}),Object(a.jsx)("div",{className:m.circle})]})]}),Object(a.jsx)(O.a,{onClick:Ae,fontSize:"small",className:m.iconCancel,sx:{width:56,height:56,display:k||y&&!c&&!l&&!b||"stopped"===fe&&le||"stopped"===he&&le?"inline-block":"none"}}),Object(a.jsx)(Ro.a,{onClick:Pe,className:m.avatarCamera,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:null!==fe||"stopped"===he||k||y||te||c||l||b?"none":"block"}}),Object(a.jsx)(No.a,{onClick:De,className:m.avatarRight,sx:{backgroundColor:"#ffffff",color:"rgb(41, 139, 231)",width:56,height:56},style:{display:y&&b&&"text"===b.type||b&&"text"!==b.type||y&&!b||k||"stopped"===fe||"stopped"===he?"block":"none"}}),Object(a.jsx)(To.a,{onClick:Be,className:m.avatarRight,sx:{backgroundColor:"#ffffff",color:"#6b6b6b",width:56,height:56},style:{display:y||k||"stopped"===fe||null!==he||Q||c||l||b?"none":"block"}}),Object(a.jsx)(Wo.a,{onClick:function(){return!q&&_(!0)},fontSize:"medium",sx:{color:q?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:k||fe||he||b&&"text"!==b.type?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"},marginRight:1}}),Object(a.jsx)(Po.a,{onClick:function(){return!E&&L(!0)},fontSize:"medium",sx:{color:E||z?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:y||k||"stopped"===fe||"stopped"===he||b&&"text"!==b.type?"auto":"none","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&q&&_(!1)},className:m.overlay,id:"overlay",style:{display:q?"block":"none"},children:Object(a.jsx)("div",{className:m.emoji,style:{left:x?"32.5vw":"45vw",bottom:"9vh"},children:Object(a.jsx)(Fo.a,{onEmojiClick:function(e,t){return Me(0,t,"input")}})})}),Object(a.jsxs)("div",{onClick:function(e){if("overlay"===e.target.id){if($)return G(!1);E&&L(!1)}},className:m.overlay,id:"overlay",style:{display:E?"block":"none"},children:[$&&Object(a.jsx)("div",{className:m.emoji,style:{left:x?"32.5vw":"45vw",bottom:c||l||b?"23vh":"16vh"},children:Object(a.jsx)(Fo.a,{onEmojiClick:function(e,t){return Me(0,t,"caption")}})}),Object(a.jsx)(jn.a,{multiline:!0,className:m.captionTextField,onChange:function(e){return R(e.target.value)},style:{left:x?"32.5vw":"45vw",top:c||l||b?"78.5vh":"85vh"},placeholder:"Caption",value:z,id:"caption",name:"caption",variant:"outlined",InputProps:{startAdornment:Object(a.jsx)(Uo.a,{position:"start",sx:{marginRight:4},children:Object(a.jsx)(Wo.a,{onClick:function(){return!q&&G(!0)},sx:{color:$?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer","&:hover":{color:"rgb(41, 139, 231)"},position:"fixed",top:c||l||b?"80vh":"86.5vh"}})})}})]}),Object(a.jsx)("textarea",{disabled:!!(k||"recording"===le||"filming"===le||b&&"text"!==b.type),value:y,onBlur:We,onFocus:Le,onChange:function(e){return C(e.target.value)},className:m.textarea,placeholder:k?"The File is ready to send":null===fe&&null===he?"Message":"".concat("stopped"===fe||"stopped"===he?"recording"===le||"filming"===le?"Recorded":"Message":"Recording in progress..."),rows:1,style:{color:y||k||"recording"===le||"filming"===le?"rgb(41, 139, 231)":"#6b6b6b"}}),Object(a.jsx)(_n.a,{onClick:function(){return re(!0)},fontSize:"medium",sx:{color:ce||"base64"===le?"rgb(62, 149, 231)":"#6b6b6b",marginRight:1,cursor:"pointer",pointerEvents:"content"===le||"application"===le||y||null!==fe||null!==he||c||l||b?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)(Eo.a,{onClick:function(){return!P&&Y(!0)},className:m.attachIcon,fontSize:"medium",sx:{color:P||"content"===le||"application"===le?"rgb(41, 139, 231)":"#6b6b6b",cursor:"pointer",pointerEvents:"base64"===le||y||null!==fe||null!==he||c||l||b?"none":"auto","&:hover":{color:"rgb(41, 139, 231)"}}}),Object(a.jsx)("div",{onClick:function(e){return"overlay"===e.target.id&&P&&Y(!1)},className:m.overlay,id:"overlay",style:{display:P?"block":"none"},children:Object(a.jsx)("div",{className:m.filesMenu,style:{left:x?"52.5vw":"65vw"},children:Object(a.jsx)($o,{setFile:N,setValue:C,setIsOpenMenu:Y,setType:de,type:le})})}),ce&&Object(a.jsx)("div",{onClick:function(e){"overlay"===e.target.id&&re(!1)},id:"overlay",className:m.overlayCamera,children:Object(a.jsx)(Kn.a,{audio:!1,screenshotFormat:"image/jpeg",width:"40%",videoConstraints:{width:1280,height:720,facingMode:"user"},style:{marginBottom:30},children:function(e){var t=e.getScreenshot;return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(Vn.a,{onClick:function(){return function(e){N(e()),de("base64"),!n&&Object(D.k)("".concat(D.n,"/cameraCapture.mp3"))}(t)},className:m.capturePhoto,fontSize:"large",style:{marginBottom:30}}),Object(a.jsx)("img",{className:m.capturedPicture,width:"300",height:"174",style:{visibility:k?"visible":"hidden"},src:k,alt:"chosen pic"})]})}})})]})},aa=Object(r.a)({unpinBar:{backgroundColor:"#ffffff",color:"#2b97fd",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",width:"100%",height:"7vh",position:"fixed",cursor:"pointer",bottom:"0vh",fontSize:18,"&:hover":{color:"#0084ff"}}}),ca=function(e){var t=e.pinnedMessagesMemo,n=e.handleUnpinAll,o=aa();return Object(a.jsx)("div",{onClick:n,className:o.unpinBar,children:"UNPIN ALL ".concat(t.length," MESSAGES")})},ra=n(619),ia=n(602),sa=n(200),la=n.n(sa),da=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),ba=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:"100%",cursor:"pointer",padding:"0px 10px","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},deletedInformation:{display:"flex",justifyContent:"start",alignItems:"center",alignContent:"center"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#535353",marginRight:5},column:{position:"absolute",content:"",width:2,left:0,top:"10%",height:"80%",backgroundColor:"#535353"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),ja={inputProps:{"aria-label":"Checkbox demo"}},fa=function(e){var t=e.tongue,n=e.watched,c=e.edited,r=e.companionIdForwardToAndFrom,i=e.avatarUrl,l=e.color,b=e.message,f=e.name,p=e.lastName,m=e.forwardReplyName,h=e.forwardReplyLastName,x=e.caption,g=e.createdAt,v=e.emoji,y=e.emojiCompanion,C=e.pinned,w=e.isSomeSelected,S=e.isSelected,k=e.handleSelected,N=e._id,I=e.nightMode,T=e.handleReply,z=e.handleForward,R=(e.handleEdit,e.handleOpenTheChat),M=ba(),A=Object(s.useState)(null),E=Object(o.a)(A,2),L=E[0],W=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),F=Y[0],U=Y[1],q=Object(s.useState)(!1),_=Object(o.a)(q,2),H=_[0],V=_[1],$=Boolean(L),G=S(N),K=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&V(!0),W(null),U(!1)};return Object(a.jsx)("div",{className:M.container,style:{marginBottom:t?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),W(e.currentTarget),U(!0)}(e)},className:M.wrapper,style:{backgroundColor:F?"#babdbc":"#ffffff",pointerEvents:w?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1)," \n ").concat(Object(D.e)(p)).concat(Object(D.q)(p,15,1))}),Object(a.jsxs)("div",{className:M.wrapperInner,onClick:function(){return R(r)},children:[Object(a.jsx)("div",{className:M.column}),Object(a.jsx)(ra.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"".concat(r?"Forwarded from":"Replied to"," ").concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1),"\n ").concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1))}),Object(a.jsxs)("div",{className:M.deletedInformation,children:[Object(a.jsx)(Ot.a,{className:M.folderIcon,fontSize:"large"}),Object(a.jsx)(ra.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"The Message was Deleted"})]})]}),Object(a.jsx)(B.a,{primary:b,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:x,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:M.informationWrapper,children:[Object(a.jsx)("div",{className:M.time,style:{color:"#959595"},children:"".concat(c?"edited ":"").concat(Object(D.u)(g))}),n&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),t&&Object(a.jsx)("div",{className:M.avatarIcon,children:Object(a.jsx)(j.a,{alt:f,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(f)).concat(Object(D.e)(p))})}),t&&Object(a.jsx)("span",{className:M.tongueOne,style:{borderBottom:"15px solid ".concat(F?"#babdbc":"#ffffff")}}),t&&Object(a.jsx)("span",{className:M.tongueTwo,style:{borderBottom:"17px solid ".concat(F?"#babdbc":"#ffffff")}}),y&&Object(a.jsx)("div",{className:M.emojiCompanionTitle,children:D.b[Number(y)]}),v&&Object(a.jsx)("div",{className:M.emojiTitle,children:D.b[Number(v)]}),w&&Object(a.jsx)("div",{className:M.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ja),{},{checked:G,sx:{color:I?"#ffffff":"#00ff48","&.Mui-checked":{color:I?"#ffffff":"#00ff48"}},onClick:function(){return k(N)}}))}),Object(a.jsxs)(da,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:L,open:$,onClose:K,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===v?Object(Ie.L)(N,""):Object(Ie.L)(N,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:v===String(t)?M.emojiActive:M.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){T(N),K(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){z(N),K(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return K("copy")},text:"".concat(b," ").concat(x),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(N,!C),K(void 0)},children:[C?Object(a.jsx)(O.a,{className:M.iconClose}):Object(a.jsx)(Nt.a,{}),C?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){k(N),K(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return K("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),H&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return V(!1);"delete"===t&&(Object(Ie.r)(N),V(!1))},className:M.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:M.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},ua=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),pa=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),ma={inputProps:{"aria-label":"Checkbox demo"}},ha=function(e){var t=e.message,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.caption,h=e.emoji,x=e.emojiCompanion,g=e.pinned,v=e.isSomeSelected,y=e.isSelected,C=e.handleSelected,w=e._id,S=e.nightMode,k=e.handleReply,N=e.handleForward,I=pa(),T=Object(s.useState)(null),z=Object(o.a)(T,2),R=z[0],M=z[1],A=Object(s.useState)(!1),E=Object(o.a)(A,2),L=E[0],W=E[1],P=Object(s.useState)(!1),Y=Object(o.a)(P,2),F=Y[0],U=Y[1],q=Boolean(R),_=y(w),H=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&U(!0),M(null),W(!1)};return Object(a.jsx)("div",{className:I.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),M(e.currentTarget),W(!0)}(e)},className:I.wrapper,style:{backgroundColor:L?"#babdbc":"#ffffff",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsxs)("div",{className:I.wrapperInner,children:[Object(a.jsx)(B.a,{primary:t,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:m,secondaryTypographyProps:{color:"#000000"}})]}),Object(a.jsxs)("div",{className:I.informationWrapper,children:[Object(a.jsx)("div",{className:I.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:I.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:I.tongueOne,style:{borderBottom:"15px solid ".concat(L?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:I.tongueTwo,style:{borderBottom:"17px solid ".concat(L?"#babdbc":"#ffffff")}}),x&&Object(a.jsx)("div",{className:I.emojiCompanionTitle,children:D.b[Number(x)]}),h&&Object(a.jsx)("div",{className:I.emojiTitle,children:D.b[Number(h)]}),v&&Object(a.jsx)("div",{className:I.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ma),{},{checked:_,sx:{color:S?"#ffffff":"#00ff48","&.Mui-checked":{color:S?"#ffffff":"#00ff48"}},onClick:function(){return C(w)}}))}),Object(a.jsxs)(ua,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:R,open:q,onClose:H,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===h?Object(Ie.L)(w,""):Object(Ie.L)(w,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:h===String(t)?I.emojiActive:I.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){k(w),H(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){N(w),H(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return H("copy")},text:"".concat(t||""," ").concat(m||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(w,!g),H(void 0)},children:[g?Object(a.jsx)(O.a,{className:I.iconClose}):Object(a.jsx)(Nt.a,{}),g?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){C(w),H(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return H("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),F&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return U(!1);"delete"===t&&(Object(Ie.r)(w),U(!1))},className:I.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:I.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},xa=n(181),ga=n.n(xa),Oa=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),va=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},copyIcon:{color:"#b56ff7",cursor:"pointer",marginRight:7,"&:hover":{color:"#9c3bf8"}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},folderIcon:{color:"#26afee"},replyListItem:{display:"flex",width:"100%",flexWrap:"nowrap",alignContent:"center",alignItems:"center"},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#26afee"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),ya={inputProps:{"aria-label":"Checkbox demo"}},Ca=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.replyMessage,f=e.message,p=e.name,m=e.lastName,h=e.replyName,x=e.replyLastName,g=e.replyCaption,v=e.createdAt,y=e.caption,C=e.emoji,w=e.emojiCompanion,S=e.pinned,k=e.isSomeSelected,N=e.isSelected,I=e.handleSelected,T=e._id,z=e.nightMode,R=e.handleReply,M=e.handleForward,A=e.fullType,E=e.handleScrollToTheMessage,L=e.oldId,W=va(),P=Object(s.useState)(null),Y=Object(o.a)(P,2),F=Y[0],U=Y[1],q=Object(s.useState)(!1),_=Object(o.a)(q,2),H=_[0],V=_[1],$=Object(s.useState)(!1),G=Object(o.a)($,2),K=G[0],X=G[1],Z=Boolean(F),ee=N(T),te=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&X(!0),U(null),V(!1)};return Object(a.jsx)("div",{className:W.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),U(e.currentTarget),V(!0)}(e)},className:W.wrapper,style:{backgroundColor:H?"#babdbc":"#ffffff",pointerEvents:k?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(D.e)(p)).concat(Object(D.q)(p,15,1)," \n ").concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1))}),Object(a.jsxs)("div",{className:W.wrapperInner,children:[null===A&&Object(a.jsx)(fe.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("audio")&&Object(a.jsx)(he.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("video")&&Object(a.jsx)(ve.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("image")&&Object(a.jsx)(ho.a,{className:W.folderIcon,fontSize:"large"}),A&&A.includes("application")&&Object(a.jsx)(J.a,{className:W.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:W.column}),Object(a.jsxs)("div",{className:W.wrapperInnerMessage,onClick:function(){return E(L)},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"Replied to ".concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1),"\n ").concat(Object(D.e)(x)).concat(Object(D.q)(x,15,1))}),Object(a.jsx)(B.a,{primary:null===A?b:A,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(B.a,{secondary:g,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(B.a,{primary:f,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:y,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:W.informationWrapper,children:[Object(a.jsx)("div",{className:W.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(v))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:W.avatarIcon,children:Object(a.jsx)(j.a,{alt:p,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(p)).concat(Object(D.e)(m))})}),n&&Object(a.jsx)("span",{className:W.tongueOne,style:{borderBottom:"15px solid ".concat(H?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:W.tongueTwo,style:{borderBottom:"17px solid ".concat(H?"#babdbc":"#ffffff")}}),w&&Object(a.jsx)("div",{className:W.emojiCompanionTitle,children:D.b[Number(w)]}),C&&Object(a.jsx)("div",{className:W.emojiTitle,children:D.b[Number(C)]}),k&&Object(a.jsx)("div",{className:W.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ya),{},{checked:ee,sx:{color:z?"#ffffff":"#00ff48","&.Mui-checked":{color:z?"#ffffff":"#00ff48"}},onClick:function(){return I(T)}}))}),Object(a.jsxs)(Oa,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:F,open:Z,onClose:te,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===C?Object(Ie.L)(T,""):Object(Ie.L)(T,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:C===String(t)?W.emojiActive:W.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){R(T),te(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){M(T),te(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),A&&Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,A)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return te("copy")},text:"".concat(b&&null===A?b:A," ").concat(g||""," ").concat(f||""," ").concat(y||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(T,!S),te(void 0)},children:[S?Object(a.jsx)(O.a,{className:W.iconClose}):Object(a.jsx)(Nt.a,{}),S?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){I(T),te(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return te("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),K&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return X(!1);"delete"===t&&(Object(Ie.r)(T),X(!1))},className:W.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:W.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},wa=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Sa=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#26afee"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#26afee"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),ka={inputProps:{"aria-label":"Checkbox demo"}},Na=function(e){var t=e.url,n=e.companionIdForwardToAndFrom,c=e.oldId,r=e.tongue,i=e.watched,l=e.edited,b=e.avatarUrl,f=e.color,p=e.message,m=e.name,h=e.lastName,x=e.forwardName,g=e.forwardLastName,v=e.forwardMessage,y=e.forwardCaption,C=e.createdAt,w=e.caption,S=e.emoji,k=e.emojiCompanion,N=e.pinned,I=e.isSomeSelected,T=e.isSelected,z=e.handleSelected,R=e._id,M=e.nightMode,A=e.handleReply,E=e.handleForward,L=e.handleScrollToTheChat,W=e.fullType,P=Sa(),Y=Object(s.useState)(null),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Object(s.useState)(!1),H=Object(o.a)(_,2),V=H[0],$=H[1],G=Object(s.useState)(!1),K=Object(o.a)(G,2),X=K[0],Z=K[1],ee=Boolean(U),te=T(R),ne=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&Z(!0),q(null),$(!1)};return Object(a.jsx)("div",{className:P.container,style:{marginBottom:r?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),q(e.currentTarget),$(!0)}(e)},className:P.wrapper,style:{backgroundColor:V?"#babdbc":"#ffffff",pointerEvents:I?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"".concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1)," \n ").concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1))}),Object(a.jsxs)("div",{className:P.wrapperInner,children:[null===W&&Object(a.jsx)(fe.a,{className:P.folderIcon,fontSize:"large"}),W&&W.includes("audio")&&Object(a.jsx)(he.a,{className:P.folderIcon,fontSize:"large"}),W&&W.includes("video")&&Object(a.jsx)(ve.a,{className:P.folderIcon,fontSize:"large"}),W&&W.includes("image")&&Object(a.jsx)(ho.a,{className:P.folderIcon,fontSize:"large"}),W&&W.includes("application")&&Object(a.jsx)(J.a,{className:P.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:P.column}),Object(a.jsxs)("div",{className:P.wrapperInnerMessage,onClick:function(){return L(n,c)},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"Forwarded from ".concat(Object(D.e)(x)).concat(Object(D.q)(x,15,1),"\n ").concat(Object(D.e)(g)).concat(Object(D.q)(g,15,1))}),Object(a.jsx)(B.a,{primary:null===W?v:W,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(B.a,{secondary:y,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(B.a,{primary:p,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:w,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:P.informationWrapper,children:[Object(a.jsx)("div",{className:P.time,style:{color:"#959595"},children:"".concat(l?"edited ":"").concat(Object(D.u)(C))}),i&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),r&&Object(a.jsx)("div",{className:P.avatarIcon,children:Object(a.jsx)(j.a,{alt:m,src:b?"".concat(D.m,"/").concat(b):void 0,sx:{background:f,width:40,height:40},children:!b&&"".concat(Object(D.e)(m)).concat(Object(D.e)(h))})}),r&&Object(a.jsx)("span",{className:P.tongueOne,style:{borderBottom:"15px solid ".concat(V?"#babdbc":"#ffffff")}}),r&&Object(a.jsx)("span",{className:P.tongueTwo,style:{borderBottom:"17px solid ".concat(V?"#babdbc":"#ffffff")}}),k&&Object(a.jsx)("div",{className:P.emojiCompanionTitle,children:D.b[Number(k)]}),S&&Object(a.jsx)("div",{className:P.emojiTitle,children:D.b[Number(S)]}),I&&Object(a.jsx)("div",{className:P.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ka),{},{checked:te,sx:{color:M?"#ffffff":"#00ff48","&.Mui-checked":{color:M?"#ffffff":"#00ff48"}},onClick:function(){return z(R)}}))}),Object(a.jsxs)(wa,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:U,open:ee,onClose:ne,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===S?Object(Ie.L)(R,""):Object(Ie.L)(R,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:S===String(t)?P.emojiActive:P.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){A(R),ne(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){E(R),ne(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),W&&Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,W)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return ne("copy")},text:"".concat(v&&null===W?v:W," ").concat(y||""," ").concat(p||""," ").concat(w||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(R,!N),ne(void 0)},children:[N?Object(a.jsx)(O.a,{className:P.iconClose}):Object(a.jsx)(Nt.a,{}),N?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){z(R),ne(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return ne("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),X&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Z(!1);"delete"===t&&(Object(Ie.r)(R),Z(!1))},className:P.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:P.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Ia=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ta=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,borderRadius:7,padding:5},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},image:{borderRadius:7,width:"100%",maxHeight:"auto",cursor:"pointer"},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),za={inputProps:{"aria-label":"Checkbox demo"}},Ra=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.createdAt,f=e.fullType,p=e.caption,m=e.emoji,h=e.emojiCompanion,x=e.pinned,g=e.isSomeSelected,v=e.isSelected,y=e.handleSelected,C=e._id,w=e.name,S=e.lastName,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ta(),z=Object(s.useState)(!1),R=Object(o.a)(z,2),M=R[0],A=R[1],E=Object(s.useState)(null),L=Object(o.a)(E,2),W=L[0],Y=L[1],F=Object(s.useState)(!1),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Object(s.useState)(1),V=Object(o.a)(H,2),$=V[0],G=V[1],K=Object(s.useRef)(null),J=Object(s.useState)(!1),X=Object(o.a)(J,2),Z=X[0],ee=X[1],te=Boolean(W),ne=v(C),ae=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(A(!1),K.current.style.transform="scale(1)",G(1))},re=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&ee(!0),Y(null),_(!1)};return M?Object(a.jsxs)("div",{onClick:ae,id:"overlay",className:T.overlay,children:[Object(a.jsxs)("div",{className:T.topBar,children:[Object(a.jsxs)("div",{className:T.wrapperCredentials,children:[Object(a.jsx)(P.a,{children:Object(a.jsx)(j.a,{alt:w,src:t||void 0,sx:{background:l,width:44,height:44},children:!t&&"".concat(Object(D.e)(w)).concat(Object(D.e)(S))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(w)).concat(Object(D.q)(w,15,1),"\n ").concat(Object(D.e)(S)).concat(Object(D.q)(S,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(D.s)(b),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:T.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){$>=.5&&(K.current.style.transform="scale(".concat($-.25,",").concat($-.25,")"),K.current.style.transformOrigin="".concat(50/$-.25,"px ").concat(50/$-.25,"px"),G($-.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){$<5&&(K.current.style.transform="scale(".concat($+.25,",").concat($+.25,")"),K.current.style.transformOrigin="".concat(50/$+.25,"px ").concat(50/$+.25,"px"),G($+.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(oe.a,{onClick:function(){return Object(D.h)(t,f)},className:T.downloadIcon,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:ae,className:T.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:K,className:T.wrapperImage,children:Object(a.jsx)("img",{className:T.innerImage,width:"100%",height:"auto",alt:"imageItem",src:t})})]}):Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),Y(e.currentTarget),_(!0)}(e)},className:T.wrapper,style:{backgroundColor:q?"#babdbc":"#ffffff",pointerEvents:g?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(w)).concat(Object(D.q)(w,15,1)," \n ").concat(Object(D.e)(S)).concat(Object(D.q)(S,15,1))}),Object(a.jsx)("img",{onClick:function(){return!M&&A(!0)},className:T.image,alt:"message pic",src:t,style:{backgroundColor:t?"":l},width:"300",height:"400"}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:p,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(b))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(j.a,{alt:w,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(w)).concat(Object(D.e)(S))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(q?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(q?"#babdbc":"#ffffff")}}),h&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:D.b[Number(h)]}),m&&Object(a.jsx)("div",{className:T.emojiTitle,children:D.b[Number(m)]}),g&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},za),{},{checked:ne,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return y(C)}}))}),Object(a.jsxs)(Ia,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:te,onClose:re,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===m?Object(Ie.L)(C,""):Object(Ie.L)(C,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:m===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(C),re(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(C),re(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,f)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),p&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return re("copy")},text:p,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(C,!x),re(void 0)},children:[x?Object(a.jsx)(O.a,{className:T.iconClose}):Object(a.jsx)(Nt.a,{}),x?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){y(C),re(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return re("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),Z&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return ee(!1);"delete"===t&&(Object(Ie.r)(C),ee(!1))},className:T.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Ma=n(335),Aa=n.n(Ma),Da=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ea=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",padding:5,width:350,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},player:{borderRadius:7,width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:10},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),La={inputProps:{"aria-label":"Checkbox demo"}},Wa=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,v=e.pinned,y=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ea(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],E=Object(s.useState)(!1),L=Object(o.a)(E,2),W=L[0],P=L[1],Y=Object(s.useState)(!1),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Boolean(M),H=C(S),V=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&q(!0),A(null),P(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),P(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#babdbc":"#ffffff",pointerEvents:y?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsx)(Aa.a,{className:T.player,src:t,controls:!0}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:D.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:D.b[Number(x)]}),y&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},La),{},{checked:H,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(Da,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:_,onClose:V,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===x?Object(Ie.L)(S,""):Object(Ie.L)(S,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(S),V(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(S),V(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return V("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(S,!v),V(void 0)},children:[v?Object(a.jsx)(O.a,{className:T.iconClose}):Object(a.jsx)(Nt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){w(S),V(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return q(!1);"delete"===t&&(Object(Ie.r)(S),q(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Ba=n(336).Player,Pa=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ya=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},bntDownload:{backgroundColor:"inherit",color:"#54b0fc",width:30,height:30,marginLeft:5,"&:hover":{backgroundColor:"#54b0fc",color:"#ffffff"}},player:{backgroundColor:"#ffffff",width:"100%"},playerActive:{backgroundColor:"#babdbc",width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),Fa={inputProps:{"aria-label":"Checkbox demo"}},Ua=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,v=e.pinned,y=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ya(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],E=Object(s.useState)(!1),L=Object(o.a)(E,2),W=L[0],P=L[1],Y=Object(s.useState)(!1),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Boolean(M),H=C(S),V=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&q(!0),A(null),P(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),P(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#babdbc":"#ffffff",pointerEvents:y?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsx)(Ba,{className:W?T.playerActive:T.player,playsInline:!0,src:t}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:D.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:D.b[Number(x)]}),y&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},Fa),{},{checked:H,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(Pa,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:_,onClose:V,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===x?Object(Ie.L)(S,""):Object(Ie.L)(S,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(S),V(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(S),V(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return V("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(S,!v),V(void 0)},children:[v?Object(a.jsx)(O.a,{className:T.iconClose}):Object(a.jsx)(Nt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){w(S),V(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return q(!1);"delete"===t&&(Object(Ie.r)(S),q(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},qa=n(365),_a=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ha=Object(r.a)({container:{display:"flex",alignItems:"flex-start",alignContent:"flex-start",flexDirection:"column",borderRadius:7,padding:"4px 0px 4px 22px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:300,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600,color:"#414141"},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"auto",zIndex:100,overflow:"auto"},wrapperIcons:{position:"absolute",top:14,right:40,display:"flex",alignContent:"center",alignItems:"center",padding:"2px 10px",borderRadius:10,backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:150},magnifying:{cursor:"pointer",color:"#e9e7e7",padding:0,marginRight:10,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",right:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",right:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",left:-64,top:-10,pointerEvents:"auto"},folderIcon:{marginRight:7,color:"#54b0fc",cursor:"pointer","&:hover":{color:"#016cc3"}},avatarIcon:{position:"absolute",left:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"15px solid transparent",borderRight:"15px solid transparent",bottom:"0px",left:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderLeft:"16px solid transparent",borderRight:"16px solid transparent",bottom:"0px",left:"-17px"}}),Va={inputProps:{"aria-label":"Checkbox demo"}},$a=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.type,h=e.caption,x=e.emoji,g=e.emojiCompanion,v=e.pinned,y=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=Ha(),z=Object(s.useState)(!1),R=Object(o.a)(z,2),M=R[0],A=R[1],E=Object(s.useState)(null),L=Object(o.a)(E,2),W=L[0],P=L[1],Y=Object(s.useState)(!1),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Object(s.useState)(1),H=Object(o.a)(_,2),V=H[0],$=H[1],G=Object(s.useState)(!1),K=Object(o.a)(G,2),J=K[0],X=K[1],Z=Object(s.useRef)(null),ee=Boolean(W),te=C(S),ne=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(A(!1),$(1))},oe=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&X(!0),P(null),q(!1)};return Object(a.jsxs)("div",{className:T.container,style:{marginBottom:n?12:0},children:[M&&Object(a.jsxs)("div",{className:T.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){V>=.5&&(Z.current.style.transform="scale(".concat(V-.25,",").concat(V-.25,")"),Z.current.style.transformOrigin="".concat(50/V-.25,"px ").concat(50/V-.25,"px"),$(V-.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){V<5&&(Z.current.style.transform="scale(".concat(V+.25,",").concat(V+.25,")"),Z.current.style.transformOrigin="".concat(50/V+.25,"px ").concat(50/V+.25,"px"),$(V+.25))},className:T.magnifying,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:ne,className:T.iconCloseOverlay,fontSize:"large"})]}),M&&Object(a.jsx)("div",{className:T.overlay,id:"overlay",onClick:ne,children:Object(a.jsx)("div",{ref:Z,children:Object(a.jsx)(qa,{allowFullScreen:!0,fileType:m,filePath:t,onError:ne})})}),Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),P(e.currentTarget),q(!0)}(e)},className:T.wrapper,style:{backgroundColor:U?"#babdbc":"#ffffff",pointerEvents:y?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),!M&&Object(a.jsx)(It.a,{fullWidth:!0,onClick:function(){return!M&&A(!0)},variant:"contained",color:"warning",style:{fontWeight:500,fontSize:18},children:"Read File"}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#959595"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c&&Object(a.jsx)(la.a,{style:{color:"#959595",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(U?"#babdbc":"#ffffff")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(U?"#babdbc":"#ffffff")}}),g&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:D.b[Number(g)]}),x&&Object(a.jsx)("div",{className:T.emojiTitle,children:D.b[Number(x)]}),y&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},Va),{},{checked:te,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(_a,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:ee,onClose:oe,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===x?Object(Ie.L)(S,""):Object(Ie.L)(S,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(S),oe(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(S),oe(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(e){e.stopPropagation(),Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return oe("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(S,!v),oe(void 0)},children:[v?Object(a.jsx)(O.a,{className:T.iconClose}):Object(a.jsx)(Nt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){w(S),oe(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return oe("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),J&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return X(!1);"delete"===t&&(Object(Ie.r)(S),X(!1))},className:T.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},Ga=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Ka=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:"100%",cursor:"pointer",padding:"0px 10px","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},deletedInformation:{display:"flex",justifyContent:"start",alignItems:"center",alignContent:"center"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#535353",marginRight:5},column:{position:"absolute",content:"",width:2,left:0,top:"10%",height:"80%",backgroundColor:"#535353"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),Ja={inputProps:{"aria-label":"Checkbox demo"}},Qa=function(e){var t=e.tongue,n=e.watched,c=e.edited,r=e.avatarUrl,i=e.companionIdForwardToAndFrom,l=e.color,b=e.message,f=e.name,p=e.lastName,m=e.forwardReplyName,h=e.forwardReplyLastName,x=e.caption,g=e.createdAt,v=e.emoji,y=e.emojiCompanion,C=e.pinned,w=e.isSomeSelected,S=e.isSelected,k=e.handleSelected,N=e._id,I=e.nightMode,T=e.handleReply,z=e.handleForward,R=e.handleEdit,M=e.handleOpenTheChat,A=Ka(),E=Object(s.useState)(null),L=Object(o.a)(E,2),W=L[0],P=L[1],Y=Object(s.useState)(!1),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Object(s.useState)(!1),H=Object(o.a)(_,2),V=H[0],$=H[1],G=Boolean(W),K=S(N),J=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&$(!0),P(null),q(!1)};return Object(a.jsx)("div",{className:A.container,style:{marginBottom:t?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),P(e.currentTarget),q(!0)}(e)},className:A.wrapper,style:{backgroundColor:U?"#ced8d7":"#deffa9",pointerEvents:w?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1)," \n ").concat(Object(D.e)(p)).concat(Object(D.q)(p,15,1))}),Object(a.jsxs)("div",{className:A.wrapperInner,onClick:function(){return M(i)},children:[Object(a.jsx)("div",{className:A.column}),Object(a.jsx)(ra.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"".concat(i?"Forwarded from":"Replied to"," ").concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1),"\n ").concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1))}),Object(a.jsxs)("div",{className:A.deletedInformation,children:[Object(a.jsx)(Ot.a,{className:A.folderIcon,fontSize:"large"}),Object(a.jsx)(ra.a,{style:{color:"#535353"},variant:"h6",align:"right",children:"The Message was Deleted"})]})]}),Object(a.jsx)(B.a,{primary:b,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:x,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:A.informationWrapper,children:[Object(a.jsx)("div",{className:A.time,style:{color:"#18bd03"},children:"".concat(c?"edited ":"").concat(Object(D.u)(g))}),n?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),t&&Object(a.jsx)("div",{className:A.avatarIcon,children:Object(a.jsx)(j.a,{alt:f,src:r?"".concat(D.m,"/").concat(r):void 0,sx:{background:l,width:40,height:40},children:!r&&"".concat(Object(D.e)(f)).concat(Object(D.e)(p))})}),t&&Object(a.jsx)("span",{className:A.tongueOne,style:{borderBottom:"15px solid ".concat(U?"#ced8d7":"#deffa9")}}),t&&Object(a.jsx)("span",{className:A.tongueTwo,style:{borderBottom:"17px solid ".concat(U?"#ced8d7":"#deffa9")}}),y&&Object(a.jsx)("div",{className:A.emojiCompanionTitle,children:D.b[Number(y)]}),v&&Object(a.jsx)("div",{className:A.emojiTitle,children:D.b[Number(v)]}),w&&Object(a.jsx)("div",{className:A.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},Ja),{},{checked:K,sx:{color:I?"#ffffff":"#00ff48","&.Mui-checked":{color:I?"#ffffff":"#00ff48"}},onClick:function(){return k(N)}}))}),Object(a.jsxs)(Ga,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:W,open:G,onClose:J,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===v?Object(Ie.L)(N,""):Object(Ie.L)(N,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:v===String(t)?A.emojiActive:A.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){T(N),J(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){z(N),J(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){R(N),J(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return J("copy")},text:"".concat(b," ").concat(x),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(N,!C),J(void 0)},children:[C?Object(a.jsx)(O.a,{className:A.iconClose}):Object(a.jsx)(Nt.a,{}),C?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){k(N),J(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return J("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),V&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return $(!1);"delete"===t&&(Object(Ie.r)(N),$(!1))},className:A.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:A.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Xa=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Za=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column"},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),ec={inputProps:{"aria-label":"Checkbox demo"}},tc=function(e){var t=e.message,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.caption,h=e.emoji,x=e.emojiCompanion,g=e.pinned,v=e.isSomeSelected,y=e.isSelected,C=e.handleSelected,w=e._id,S=e.nightMode,k=e.handleReply,N=e.handleForward,I=e.handleEdit,T=Za(),z=Object(s.useState)(null),R=Object(o.a)(z,2),M=R[0],A=R[1],E=Object(s.useState)(!1),L=Object(o.a)(E,2),W=L[0],P=L[1],Y=Object(s.useState)(!1),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Boolean(M),H=y(w),V=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&q(!0),A(null),P(!1)};return Object(a.jsx)("div",{className:T.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),A(e.currentTarget),P(!0)}(e)},className:T.wrapper,style:{backgroundColor:W?"#ced8d7":"#deffa9",pointerEvents:v?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsxs)("div",{className:T.wrapperInner,children:[Object(a.jsx)(B.a,{primary:t,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:m,secondaryTypographyProps:{color:"#000000"}})]}),Object(a.jsxs)("div",{className:T.informationWrapper,children:[Object(a.jsx)("div",{className:T.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:T.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:T.tongueOne,style:{borderBottom:"15px solid ".concat(W?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:T.tongueTwo,style:{borderBottom:"17px solid ".concat(W?"#ced8d7":"#deffa9")}}),x&&Object(a.jsx)("div",{className:T.emojiCompanionTitle,children:D.b[Number(x)]}),h&&Object(a.jsx)("div",{className:T.emojiTitle,children:D.b[Number(h)]}),v&&Object(a.jsx)("div",{className:T.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ec),{},{checked:H,sx:{color:S?"#ffffff":"#00ff48","&.Mui-checked":{color:S?"#ffffff":"#00ff48"}},onClick:function(){return C(w)}}))}),Object(a.jsxs)(Xa,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:M,open:_,onClose:V,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===h?Object(Ie.L)(w,""):Object(Ie.L)(w,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:h===String(t)?T.emojiActive:T.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){k(w),V(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){N(w),V(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){I(w),V(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return V("copy")},text:"".concat(t||""," ").concat(m||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(w,!g),V(void 0)},children:[g?Object(a.jsx)(O.a,{className:T.iconClose}):Object(a.jsx)(Nt.a,{}),g?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){C(w),V(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return V("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),U&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return q(!1);"delete"===t&&(Object(Ie.r)(w),q(!1))},className:T.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:T.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},nc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),oc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},folderIcon:{color:"#00b333"},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#00b333"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),ac={inputProps:{"aria-label":"Checkbox demo"}},cc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.replyMessage,f=e.message,p=e.name,m=e.lastName,h=e.replyName,x=e.replyLastName,g=e.replyCaption,v=e.createdAt,y=e.caption,C=e.emoji,w=e.emojiCompanion,S=e.pinned,k=e.isSomeSelected,N=e.isSelected,I=e.handleSelected,T=e._id,z=e.nightMode,R=e.handleReply,M=e.handleForward,A=e.handleEdit,E=e.fullType,L=e.handleScrollToTheMessage,W=e.oldId,P=oc(),Y=Object(s.useState)(null),F=Object(o.a)(Y,2),U=F[0],q=F[1],_=Object(s.useState)(!1),H=Object(o.a)(_,2),V=H[0],$=H[1],G=Object(s.useState)(!1),K=Object(o.a)(G,2),X=K[0],Z=K[1],ee=Boolean(U),te=N(T),ne=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&Z(!0),q(null),$(!1)};return Object(a.jsx)("div",{className:P.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),q(e.currentTarget),$(!0)}(e)},className:P.wrapper,style:{backgroundColor:V?"#ced8d7":"#deffa9",pointerEvents:k?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(D.e)(p)).concat(Object(D.q)(p,15,1)," \n ").concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1))}),Object(a.jsxs)("div",{className:P.wrapperInner,children:[null===E&&Object(a.jsx)(fe.a,{className:P.folderIcon,fontSize:"large"}),E&&E.includes("audio")&&Object(a.jsx)(he.a,{className:P.folderIcon,fontSize:"large"}),E&&E.includes("video")&&Object(a.jsx)(ve.a,{className:P.folderIcon,fontSize:"large"}),E&&E.includes("image")&&Object(a.jsx)(ho.a,{className:P.folderIcon,fontSize:"large"}),E&&E.includes("application")&&Object(a.jsx)(J.a,{className:P.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:P.column}),Object(a.jsxs)("div",{className:P.wrapperInnerMessage,onClick:function(){return L(W)},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"Replied to ".concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1),"\n ").concat(Object(D.e)(x)).concat(Object(D.q)(x,15,1))}),Object(a.jsx)(B.a,{primary:null===E?b:E,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(B.a,{secondary:g,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(B.a,{primary:f,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:y,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:P.informationWrapper,children:[Object(a.jsx)("div",{className:P.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(v))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:P.avatarIcon,children:Object(a.jsx)(j.a,{alt:p,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(p)).concat(Object(D.e)(m))})}),n&&Object(a.jsx)("span",{className:P.tongueOne,style:{borderBottom:"15px solid ".concat(V?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:P.tongueTwo,style:{borderBottom:"17px solid ".concat(V?"#ced8d7":"#deffa9")}}),w&&Object(a.jsx)("div",{className:P.emojiCompanionTitle,children:D.b[Number(w)]}),C&&Object(a.jsx)("div",{className:P.emojiTitle,children:D.b[Number(C)]}),k&&Object(a.jsx)("div",{className:P.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},ac),{},{checked:te,sx:{color:z?"#ffffff":"#00ff48","&.Mui-checked":{color:z?"#ffffff":"#00ff48"}},onClick:function(){return I(T)}}))}),Object(a.jsxs)(nc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:U,open:ee,onClose:ne,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===C?Object(Ie.L)(T,""):Object(Ie.L)(T,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:C===String(t)?P.emojiActive:P.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){R(T),ne(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){M(T),ne(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),E&&Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,E)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),Object(a.jsxs)(u.a,{onClick:function(){A(T),ne(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return ne("copy")},text:"".concat(b&&null===E?b:E," ").concat(g||""," ").concat(f||""," ").concat(y||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(T,!S),ne(void 0)},children:[S?Object(a.jsx)(O.a,{className:P.iconClose}):Object(a.jsx)(Nt.a,{}),S?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){I(T),ne(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return ne("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),X&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Z(!1);"delete"===t&&(Object(Ie.r)(T),Z(!1))},className:P.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:P.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},rc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),ic=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:200,padding:5,borderRadius:7,wordBreak:"break-word",textAlign:"left",font:"400 .9em 'Open Sans', sans-serif"},wrapperInner:{position:"relative",display:"flex",alignItems:"center",alignContent:"center",width:"100%",cursor:"pointer","&:hover":{backgroundColor:"rgba(104, 105, 104, 0.2)"}},wrapperInnerMessage:{display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",marginLeft:20},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},folderIcon:{color:"#00b333"},column:{position:"absolute",content:"",width:2,left:43,top:"10%",height:"80%",backgroundColor:"#00b333"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),sc={inputProps:{"aria-label":"Checkbox demo"}},lc=function(e){var t=e.url,n=e.oldId,c=e.companionIdForwardToAndFrom,r=e.tongue,i=e.watched,l=e.edited,b=e.avatarUrl,f=e.color,p=e.message,m=e.name,h=e.lastName,x=e.forwardName,g=e.forwardLastName,v=e.forwardMessage,y=e.forwardCaption,C=e.caption,w=e.createdAt,S=e.emoji,k=e.emojiCompanion,N=e.pinned,I=e.isSomeSelected,T=e.isSelected,z=e.handleSelected,R=e._id,M=e.nightMode,A=e.handleReply,E=e.handleForward,L=e.handleEdit,W=e.handleScrollToTheChat,P=e.fullType,Y=ic(),F=Object(s.useState)(null),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Object(s.useState)(!1),V=Object(o.a)(H,2),$=V[0],G=V[1],K=Object(s.useState)(!1),X=Object(o.a)(K,2),Z=X[0],ee=X[1],te=Boolean(q),ne=T(R),oe=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&ee(!0),_(null),G(!1)};return Object(a.jsx)("div",{className:Y.container,style:{marginBottom:r?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),_(e.currentTarget),G(!0)}(e)},className:Y.wrapper,style:{backgroundColor:$?"#ced8d7":"#deffa9",pointerEvents:I?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee"},variant:"h6",align:"right",children:"".concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1)," \n ").concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1))}),Object(a.jsxs)("div",{className:Y.wrapperInner,children:[null===P&&Object(a.jsx)(fe.a,{className:Y.folderIcon,fontSize:"large"}),P&&P.includes("audio")&&Object(a.jsx)(he.a,{className:Y.folderIcon,fontSize:"large"}),P&&P.includes("video")&&Object(a.jsx)(ve.a,{className:Y.folderIcon,fontSize:"large"}),P&&P.includes("image")&&Object(a.jsx)(ho.a,{className:Y.folderIcon,fontSize:"large"}),P&&P.includes("application")&&Object(a.jsx)(J.a,{className:Y.folderIcon,fontSize:"large"}),Object(a.jsx)("div",{className:Y.column}),Object(a.jsxs)("div",{className:Y.wrapperInnerMessage,onClick:function(){return W(c,n)},children:[Object(a.jsx)(ra.a,{style:{color:"#00b333"},variant:"h6",align:"right",children:"Forwarded from ".concat(Object(D.e)(x)).concat(Object(D.q)(x,15,1),"\n ").concat(Object(D.e)(g)).concat(Object(D.q)(g,15,1))}),Object(a.jsx)(B.a,{primary:null===P?v:P,primaryTypographyProps:{color:"#535353"}}),Object(a.jsx)(B.a,{secondary:y,secondaryTypographyProps:{color:"#535353"}})]})]}),Object(a.jsx)(B.a,{primary:p,primaryTypographyProps:{color:"#000000"}}),Object(a.jsx)(B.a,{secondary:C,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:Y.informationWrapper,children:[Object(a.jsx)("div",{className:Y.time,style:{color:"#18bd03"},children:"".concat(l?"edited ":"").concat(Object(D.u)(w))}),i?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),r&&Object(a.jsx)("div",{className:Y.avatarIcon,children:Object(a.jsx)(j.a,{alt:m,src:b?"".concat(D.m,"/").concat(b):void 0,sx:{background:f,width:40,height:40},children:!b&&"".concat(Object(D.e)(m)).concat(Object(D.e)(h))})}),r&&Object(a.jsx)("span",{className:Y.tongueOne,style:{borderBottom:"15px solid ".concat($?"#ced8d7":"#deffa9")}}),r&&Object(a.jsx)("span",{className:Y.tongueTwo,style:{borderBottom:"17px solid ".concat($?"#ced8d7":"#deffa9")}}),k&&Object(a.jsx)("div",{className:Y.emojiCompanionTitle,children:D.b[Number(k)]}),S&&Object(a.jsx)("div",{className:Y.emojiTitle,children:D.b[Number(S)]}),I&&Object(a.jsx)("div",{className:Y.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},sc),{},{checked:ne,sx:{color:M?"#ffffff":"#00ff48","&.Mui-checked":{color:M?"#ffffff":"#00ff48"}},onClick:function(){return z(R)}}))}),Object(a.jsxs)(rc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:q,open:te,onClose:oe,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===S?Object(Ie.L)(R,""):Object(Ie.L)(R,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:S===String(t)?Y.emojiActive:Y.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){A(R),oe(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){E(R),oe(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),P&&Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,P)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),Object(a.jsxs)(u.a,{onClick:function(){L(R),oe(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return oe("copy")},text:"".concat(v&&null===P?v:P," ").concat(y||""," ").concat(p||""," ").concat(C||""),children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(R,!N),oe(void 0)},children:[N?Object(a.jsx)(O.a,{className:Y.iconClose}):Object(a.jsx)(Nt.a,{}),N?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){z(R),oe(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return oe("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),Z&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return ee(!1);"delete"===t&&(Object(Ie.r)(R),ee(!1))},className:Y.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:Y.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},dc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),bc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,borderRadius:7,padding:5},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},image:{borderRadius:7,width:"100%",maxHeight:"auto",cursor:"pointer"},overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflow:"auto",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),jc={inputProps:{"aria-label":"Checkbox demo"}},fc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.createdAt,f=e.fullType,p=e.caption,m=e.emoji,h=e.emojiCompanion,x=e.pinned,g=e.isSomeSelected,v=e.isSelected,y=e.handleSelected,C=e._id,w=e.name,S=e.lastName,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=bc(),R=Object(s.useState)(!1),M=Object(o.a)(R,2),A=M[0],E=M[1],L=Object(s.useState)(null),W=Object(o.a)(L,2),Y=W[0],F=W[1],U=Object(s.useState)(!1),q=Object(o.a)(U,2),_=q[0],H=q[1],V=Object(s.useState)(!1),$=Object(o.a)(V,2),G=$[0],K=$[1],J=Object(s.useState)(1),X=Object(o.a)(J,2),Z=X[0],ee=X[1],te=Object(s.useRef)(null),ne=Boolean(Y),ae=v(C),re=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(E(!1),te.current.style.transform="scale(1)",ee(1))},se=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&K(!0),F(null),H(!1)};return A?Object(a.jsxs)("div",{onClick:re,id:"overlay",className:z.overlay,children:[Object(a.jsxs)("div",{className:z.topBar,children:[Object(a.jsxs)("div",{className:z.wrapperCredentials,children:[Object(a.jsx)(P.a,{children:Object(a.jsx)(j.a,{alt:w,src:t||void 0,sx:{background:l,width:44,height:44},children:!t&&"".concat(Object(D.e)(w)).concat(Object(D.e)(S))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(w)).concat(Object(D.q)(w,15,1),"\n ").concat(Object(D.e)(S)).concat(Object(D.q)(S,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(D.s)(b),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:z.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){Z>=.5&&(te.current.style.transform="scale(".concat(Z-.25,",").concat(Z-.25,")"),te.current.style.transformOrigin="".concat(50/Z-.25,"px ").concat(50/Z-.25,"px"),ee(Z-.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){Z<5&&(te.current.style.transform="scale(".concat(Z+.25,",").concat(Z+.25,")"),te.current.style.transformOrigin="".concat(50/Z+.25,"px ").concat(50/Z+.25,"px"),ee(Z+.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(oe.a,{onClick:function(){return Object(D.h)(t,f)},className:z.downloadIcon,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:re,className:z.iconCloseOverlay,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:te,className:z.wrapperImage,children:Object(a.jsx)("img",{className:z.innerImage,width:"100%",height:"auto",alt:"imageItem",src:t})})]}):Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),F(e.currentTarget),H(!0)}(e)},className:z.wrapper,style:{backgroundColor:_?"#ced8d7":"#deffa9",pointerEvents:g?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(w)).concat(Object(D.q)(w,15,1)," \n ").concat(Object(D.e)(S)).concat(Object(D.q)(S,15,1))}),Object(a.jsx)("img",{onClick:function(){return!A&&E(!0)},className:z.image,alt:"message pic",src:t,style:{backgroundColor:t?"":l},width:"300",height:"400"}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:p,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(b))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(j.a,{alt:w,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(w)).concat(Object(D.e)(S))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(_?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(_?"#ced8d7":"#deffa9")}}),h&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:D.b[Number(h)]}),m&&Object(a.jsx)("div",{className:z.emojiTitle,children:D.b[Number(m)]}),g&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},jc),{},{checked:ae,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return y(C)}}))}),Object(a.jsxs)(dc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:Y,open:ne,onClose:se,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===m?Object(Ie.L)(C,""):Object(Ie.L)(C,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:m===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(C),se(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(C),se(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){T(C),se(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,f)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),p&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return se("copy")},text:p,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(C,!x),se(void 0)},children:[x?Object(a.jsx)(O.a,{className:z.iconClose}):Object(a.jsx)(Nt.a,{}),x?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){y(C),se(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return se("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),G&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return K(!1);"delete"===t&&(Object(Ie.r)(C),K(!1))},className:z.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},uc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),pc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",padding:5,width:350,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},player:{borderRadius:7,width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),mc={inputProps:{"aria-label":"Checkbox demo"}},hc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.fullType,h=e.caption,x=e._id,g=e.emoji,v=e.emojiCompanion,y=e.pinned,C=e.isSomeSelected,w=e.isSelected,S=e.handleSelected,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=pc(),R=Object(s.useState)(null),M=Object(o.a)(R,2),A=M[0],E=M[1],L=Object(s.useState)(!1),W=Object(o.a)(L,2),P=W[0],Y=W[1],F=Object(s.useState)(!1),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Boolean(A),V=w(x),$=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&_(!0),E(null),Y(!1)};return Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),E(e.currentTarget),Y(!0)}(e)},className:z.wrapper,style:{backgroundColor:P?"#ced8d7":"#deffa9",pointerEvents:C?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsx)(Aa.a,{className:z.player,src:t,controls:!0}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(P?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(P?"#ced8d7":"#deffa9")}}),v&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:D.b[Number(v)]}),g&&Object(a.jsx)("div",{className:z.emojiTitle,children:D.b[Number(g)]}),C&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},mc),{},{checked:V,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return S(x)}}))}),Object(a.jsxs)(uc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:A,open:H,onClose:$,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===g?Object(Ie.L)(x,""):Object(Ie.L)(x,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:g===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(x),$(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(x),$(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){T(x),$(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return $("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(x,!y),$(void 0)},children:[y?Object(a.jsx)(O.a,{className:z.iconClose}):Object(a.jsx)(Nt.a,{}),y?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){S(x),$(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return $("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),q&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return _(!1);"delete"===t&&(Object(Ie.r)(x),_(!1))},className:z.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},xc=n(336).Player,gc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Oc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,position:"relative",padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",width:400,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},player:{backgroundColor:"#deffa9",width:"100%"},playerActive:{backgroundColor:"#ced8d7",width:"100%"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),vc={inputProps:{"aria-label":"Checkbox demo"}},yc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.fullType,h=e.caption,x=e.emoji,g=e.emojiCompanion,v=e.pinned,y=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=Oc(),R=Object(s.useState)(null),M=Object(o.a)(R,2),A=M[0],E=M[1],L=Object(s.useState)(!1),W=Object(o.a)(L,2),P=W[0],Y=W[1],F=Object(s.useState)(!1),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Boolean(A),V=C(S),$=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&_(!0),E(null),Y(!1)};return Object(a.jsx)("div",{className:z.container,style:{marginBottom:n?12:0},children:Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),E(e.currentTarget),Y(!0)}(e)},className:z.wrapper,style:{backgroundColor:P?"#ced8d7":"#deffa9",pointerEvents:y?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),Object(a.jsx)(xc,{className:P?z.playerActive:z.player,playsInline:!0,src:t}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(P?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(P?"#ced8d7":"#deffa9")}}),g&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:D.b[Number(g)]}),x&&Object(a.jsx)("div",{className:z.emojiTitle,children:D.b[Number(x)]}),y&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},vc),{},{checked:V,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(gc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:A,open:H,onClose:$,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===x?Object(Ie.L)(S,""):Object(Ie.L)(S,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(S),$(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(S),$(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){T(S),$(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsxs)(u.a,{onClick:function(){return Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return $("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(S,!v),$(void 0)},children:[v?Object(a.jsx)(O.a,{className:z.iconClose}):Object(a.jsx)(Nt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){w(S),$(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return $("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),q&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return _(!1);"delete"===t&&(Object(Ie.r)(S),_(!1))},className:z.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})})},Cc=n(365),wc=Object(b.a)((function(e){return Object(a.jsx)(f.a,Object(d.a)({elevation:0,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}},e))}))((function(e){var t=e.theme;return{"& .MuiPaper-root":{borderRadius:10,marginTop:t.spacing(0),minWidth:220,color:"light"===t.palette.mode?"rgb(55, 65, 81)":t.palette.grey[500],boxShadow:"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px","& .MuiMenu-list":{padding:"4px 4px"},"& .MuiMenuItem-root":{marginBottom:t.spacing(1),"& .MuiSvgIcon-root":{fontSize:21,color:t.palette.text.secondary,marginRight:t.spacing(2)}}}}})),Sc=Object(r.a)({container:{display:"flex",alignItems:"flex-end",alignContent:"flex-end",flexDirection:"column",borderRadius:7,padding:"4px 22px 4px 0px"},wrapper:{position:"relative",display:"flex",alignItems:"start",alignContent:"start",flexDirection:"column",maxWidth:450,minWidth:300,padding:5,borderRadius:7},informationWrapper:{display:"flex",alignItems:"center",alignContent:"center",justifyContent:"flex-end",width:"100%",paddingRight:3},time:{fontSize:".65em",fontWeight:600},overlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(104, 105, 104, 0.6)",border:"solid 2px #0084ff",cursor:"auto",zIndex:100,overflow:"auto"},wrapperIcons:{position:"absolute",top:14,right:30,display:"flex",alignContent:"center",alignItems:"center",padding:"2px 10px",borderRadius:10,backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:150},magnifying:{cursor:"pointer",color:"#e9e7e7",padding:0,marginRight:10,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},iconCloseOverlay:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlayDelete:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},emojiTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"0.2rem",left:-40},emojiCompanionTitle:{position:"absolute",fontSize:"1.7em",fontWeight:600,bottom:"2.2rem",left:-40},emoji:{cursor:"pointer",fontSize:"1.7rem",transition:"all 0.3s","&:hover":{transform:"scale(1.5)"}},emojiActive:{cursor:"pointer",fontSize:"1.2rem",animation:"$emoji 0.6s ease-out",animationDirection:"forwards",animationIterationCount:1},"@keyframes emoji":{"5%":{transform:"translateY(1rem)"},"10%":{transform:"translateY(0) scale(1)",opacity:1},"50%":{transform:"translateY(-4rem) scale(1.5) rotateY(90deg)"},"80%":{opacity:0},"100%":{transform:"translateY(-8rem) scale(2) rotateY(180deg)",opacity:0}},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}},checkboxSelect:{position:"absolute",right:-64,top:-10,pointerEvents:"auto"},avatarIcon:{position:"absolute",right:-54,bottom:0},tongueOne:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"15px solid transparent",borderLeft:"15px solid transparent",bottom:"0px",right:"-15px"},tongueTwo:{content:"''",position:"absolute",width:"0",height:"0",borderRight:"16px solid transparent",borderLeft:"16px solid transparent",bottom:"0px",right:"-17px"}}),kc={inputProps:{"aria-label":"Checkbox demo"}},Nc=function(e){var t=e.url,n=e.tongue,c=e.watched,r=e.edited,i=e.avatarUrl,l=e.color,b=e.name,f=e.lastName,p=e.createdAt,m=e.type,h=e.caption,x=e.emoji,g=e.emojiCompanion,v=e.pinned,y=e.isSomeSelected,C=e.isSelected,w=e.handleSelected,S=e._id,k=e.nightMode,N=e.handleReply,I=e.handleForward,T=e.handleEdit,z=Sc(),R=Object(s.useState)(!1),M=Object(o.a)(R,2),A=M[0],E=M[1],L=Object(s.useState)(null),W=Object(o.a)(L,2),P=W[0],Y=W[1],F=Object(s.useState)(!1),U=Object(o.a)(F,2),q=U[0],_=U[1],H=Object(s.useState)(1),V=Object(o.a)(H,2),$=V[0],G=V[1],K=Object(s.useState)(!1),J=Object(o.a)(K,2),X=J[0],Z=J[1],ee=Boolean(P),te=C(S),ne=Object(s.useRef)(null),oe=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(E(!1),G(1))},ae=function(e){"copy"===e&&Object(D.a)("Text"),"delete"===e&&Z(!0),Y(null),_(!1)};return Object(a.jsxs)("div",{className:z.container,style:{marginBottom:n?12:0},children:[A&&Object(a.jsxs)("div",{className:z.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){$>=.5&&(ne.current.style.transform="scale(".concat($-.25,",").concat($-.25,")"),ne.current.style.transformOrigin="".concat(50/$-.25,"px ").concat(50/$-.25,"px"),G($-.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){$<5&&(ne.current.style.transform="scale(".concat($+.25,",").concat($+.25,")"),ne.current.style.transformOrigin="".concat(50/$+.25,"px ").concat(50/$+.25,"px"),G($+.25))},className:z.magnifying,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:oe,className:z.iconCloseOverlay,fontSize:"large"})]}),A&&Object(a.jsx)("div",{className:z.overlay,id:"overlay",onClick:oe,children:Object(a.jsx)("div",{ref:ne,children:Object(a.jsx)(Cc,{allowFullScreen:!0,fileType:m,filePath:t,onError:oe})})}),Object(a.jsxs)("div",{onContextMenu:function(e){return function(e){e.preventDefault(),Y(e.currentTarget),_(!0)}(e)},className:z.wrapper,style:{backgroundColor:q?"#ced8d7":"#deffa9",pointerEvents:y?"none":"auto"},children:[Object(a.jsx)(ra.a,{style:{color:"#26afee",marginBottom:10},variant:"h6",align:"right",children:"".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1)," \n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1))}),!A&&Object(a.jsx)(It.a,{fullWidth:!0,onClick:function(){return!A&&E(!0)},variant:"contained",color:"warning",style:{fontWeight:500,fontSize:18},children:"Read File"}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word"},secondary:h,secondaryTypographyProps:{color:"#000000"}}),Object(a.jsxs)("div",{className:z.informationWrapper,children:[Object(a.jsx)("div",{className:z.time,style:{color:"#18bd03"},children:"".concat(r?"edited ":"").concat(Object(D.u)(p))}),c?Object(a.jsx)(Ct.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"}):Object(a.jsx)(St.a,{style:{color:"#18bd03",marginLeft:5},fontSize:"small"})]}),n&&Object(a.jsx)("div",{className:z.avatarIcon,children:Object(a.jsx)(j.a,{alt:b,src:i?"".concat(D.m,"/").concat(i):void 0,sx:{background:l,width:40,height:40},children:!i&&"".concat(Object(D.e)(b)).concat(Object(D.e)(f))})}),n&&Object(a.jsx)("span",{className:z.tongueOne,style:{borderBottom:"15px solid ".concat(q?"#ced8d7":"#deffa9")}}),n&&Object(a.jsx)("span",{className:z.tongueTwo,style:{borderBottom:"17px solid ".concat(q?"#ced8d7":"#deffa9")}}),g&&Object(a.jsx)("div",{className:z.emojiCompanionTitle,children:D.b[Number(g)]}),x&&Object(a.jsx)("div",{className:z.emojiTitle,children:D.b[Number(x)]}),y&&Object(a.jsx)("div",{className:z.checkboxSelect,children:Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({},kc),{},{checked:te,sx:{color:k?"#ffffff":"#00ff48","&.Mui-checked":{color:k?"#ffffff":"#00ff48"}},onClick:function(){return w(S)}}))}),Object(a.jsxs)(wc,{id:"demo-positioned-menu","aria-labelledby":"demo-positioned-button",anchorEl:P,open:ee,onClose:ae,children:[Object(a.jsx)(u.a,{onClick:function(e){var t=e.target.id;t===x?Object(Ie.L)(S,""):Object(Ie.L)(S,t)},style:{cursor:"none"},children:D.b.map((function(e,t){return Object(a.jsx)("div",{className:x===String(t)?z.emojiActive:z.emoji,id:String(t),children:e},e)}))}),Object(a.jsx)(Q.a,{}),Object(a.jsxs)(u.a,{onClick:function(){N(S),ae(void 0)},children:[Object(a.jsx)(Ko.a,{}),"Reply"]}),Object(a.jsxs)(u.a,{onClick:function(){I(S),ae(void 0)},children:[Object(a.jsx)(Ko.a,{style:{transform:"rotateY(180deg)"}}),"Forward"]}),Object(a.jsxs)(u.a,{onClick:function(){T(S),ae(void 0)},children:[Object(a.jsx)(gn.a,{}),"Edit"]}),Object(a.jsxs)(u.a,{onClick:function(e){e.stopPropagation(),Object(D.h)(t,m)},children:[Object(a.jsx)(ga.a,{}),"Download"]}),h&&Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return ae("copy")},text:h,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(fe.a,{}),"Copy Text"]})}),Object(a.jsxs)(u.a,{onClick:function(){Object(Ie.o)(S,!v),ae(void 0)},children:[v?Object(a.jsx)(O.a,{className:z.iconClose}):Object(a.jsx)(Nt.a,{}),v?"Unpin":"Pin"]}),Object(a.jsxs)(u.a,{onClick:function(){w(S),ae(void 0)},children:[Object(a.jsx)(ro.a,{}),"Select"]}),Object(a.jsxs)(u.a,{style:{color:"#f02a2a"},onClick:function(){return ae("delete")},children:[Object(a.jsx)(Ot.a,{style:{color:"#f02a2a"}}),"Delete"]})]}),X&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return Z(!1);"delete"===t&&(Object(Ie.r)(S),Z(!1))},className:z.overlayDelete,id:"overlay",children:Object(a.jsxs)("div",{className:z.modalDelete,children:[Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete message"}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete message?"}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE MESSAGE"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})]})},Ic=Object(r.a)({container:{display:"flex",justifyContent:"center",marginBottom:12},wrapper:{textAlign:"center",padding:"1px 10px 3px 10px",backgroundColor:"rgba(104, 105, 104, 0.8)",color:"#ffffff",borderRadius:7,fontSize:".85em",fontWeight:600}}),Tc=function(e){var t=e.message,n=Ic();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)("span",{className:n.wrapper,children:t})})},zc=Object(r.a)({container:{position:"absolute"}}),Rc=function(e){var t=e.date,n=e.disabled,o=e.changeDate,c=e.handleOnOpen,r=zc();return Object(a.jsx)(ct.a,{className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,disabled:n,value:t||new Date,onOpen:c,onChange:o})},Mc=Object(b.a)("div")((function(){return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0px 5px"}})),Ac=Object(b.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),Dc=Object(b.a)(Xe.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),Ec=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh",width:"100%",display:"flex",flexWrap:"nowrap",alignItems:"center",alignContent:"center",padding:"0px 5px"},searchBarActive:{outline:"2px solid #2184f7",color:"#2184f7"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),Lc={inputProps:{"aria-label":"Switch demo"}},Wc=function(e){var t=e.handleSearch,n=e.value,o=e.total,c=e.sort,r=e.setDate,s=e.date,l=Ec(),b=Object(i.b)(),j="0"===o;return Object(a.jsxs)("div",{className:l.toolBar,children:[Object(a.jsx)($e.a,{"aria-label":"delete",size:"medium",children:Object(a.jsx)(O.a,{id:"cancel",className:l.iconClose,fontSize:"medium"})}),Object(a.jsxs)(Mc,{className:!n||j?void 0:l.searchBarActive,children:[Object(a.jsx)(Ac,{children:Object(a.jsx)(Qe.a,{})}),Object(a.jsx)(Dc,{disabled:j,onChange:t,placeholder:j?"Disabled":"Search",value:n,inputProps:{"aria-label":"search"}})]}),Object(a.jsxs)($e.a,{"aria-label":"delete",size:"medium",disabled:j,children:[Object(a.jsx)(Rc,{date:s,disabled:j,changeDate:r,handleOnOpen:function(){return r("")}}),Object(a.jsx)(at.a,{fontSize:"medium",style:{color:s?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({onClick:function(){Object(Ie.M)({sort:!c}),setTimeout((function(){b(Object(st.b)())}),1e3)},checked:c},Lc),{},{disabled:j}))]})},Bc=Object(b.a)(vt.a)((function(e){var t=e.theme;return{"& .MuiBadge-badge":{backgroundColor:"#44b700",color:"#44b700",boxShadow:"0 0 0 2px ".concat(t.palette.background.paper),"&::after":{position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}})),Pc=Object(r.a)({listItem_iconAvatar:{marginRight:10}}),Yc=function(e){var t=e.name,n=e.lastName,o=e.avatarUrl,c=e.color,r=e.online,i=e.companionId,s=e.handleForwardTo,l=Pc();return Object(a.jsx)("div",{children:Object(a.jsxs)(W.a,{onClick:function(){return s(i)},children:[Object(a.jsx)(P.a,{className:l.listItem_iconAvatar,children:Object(a.jsx)(Bc,{overlap:"circular",variant:"true"===r?"dot":"standard",anchorOrigin:{vertical:"bottom",horizontal:"right"},children:Object(a.jsx)(j.a,{alt:t,src:o?"".concat(D.m,"/").concat(o):void 0,sx:{background:c,width:54,height:54},children:!o&&"".concat(Object(D.e)(t)).concat(Object(D.e)(n))})})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(t)).concat(Object(D.q)(t,15,1),"\n ").concat(Object(D.e)(n)).concat(Object(D.q)(n,15,1)),secondaryTypographyProps:{color:"#0379af"},secondary:"true"===r?"online":"last seen ".concat(Object(D.s)(r))})]})})},Fc=Object(r.a)({list:{width:"100%",maxHeight:"63vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Uc=function(e){var t=e.value,n=e.date,o=e.filteredAndSorted,c=e.handleForwardTo,r=Fc();return Object(a.jsx)(a.Fragment,{children:Object(a.jsxs)(R.a,{className:r.list,component:"nav","aria-label":"main mailbox folders",children:[o.map((function(e){var t=e.name,n=e.lastName,o=e.avatarUrl,r=e.color,i=e.online,s=e.companionId,l=e.number;return Object(a.jsx)(Yc,{name:t,lastName:n,avatarUrl:o,color:r,online:i,companionId:s,handleForwardTo:c},l)})),(t||n)&&0===o.length&&Object(a.jsx)(_,{name:"Can not find Chat by request: ".concat(t)}),!t&&!n&&0===o.length&&Object(a.jsx)(_,{name:"You do not have any Chats yet!"})]})})},qc=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},container:{backgroundColor:"white",width:"22vw",position:"absolute",top:"15vh",height:"70vh",left:"39vw",display:"flex",flexWrap:"wrap",alignItems:"start",alignContent:"start",borderRadius:10}}),_c=function(e){var t=e.setModalForward,n=e.setIsForward,c=e.companionId,r=qc(),l=Object(i.b)(),b=Object(i.c)(Lt.e),j=Object(i.c)(Me),f=j.total,u=j.chats,p=Object(s.useState)(""),m=Object(o.a)(p,2),h=m[0],x=m[1],g=Object(s.useState)(""),O=Object(o.a)(g,2),v=O[0],y=O[1],w=Object(s.useMemo)((function(){return Object(D.r)(u,b).filter((function(e){var t=e.name+" "+e.lastName;return v?t.toLowerCase().includes(h.toLowerCase())&&Object(D.t)(v)===Object(D.t)(e.lastMessageCreatedAt?e.lastMessageCreatedAt:e.createdAt)?e:void 0:t.toLowerCase().includes(h.toLowerCase())}))}),[u,v,h,b]);return Object(a.jsx)("div",{onClick:function(e){var o=e.target.id;"overlay"!==o&&"cancel"!==o||(t(!1),n(void 0))},className:r.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:r.container,children:[Object(a.jsx)(Wc,{handleSearch:function(e){return x(e.target.value)},value:h,total:f,sort:b,date:v,setDate:y}),Object(a.jsx)(Uc,{value:h,date:v,filteredAndSorted:w,handleForwardTo:function(e){t(!1),l(Object(C.c)("")),l(Object(C.b)(!1)),l(Fe(e)),n((function(t){return t?Object(d.a)(Object(d.a)({},t),{},{companionIdForwardToAndFrom:e}):t})),c!==e&&setTimeout((function(){return l(Object(C.d)(!0))}),500)}})]})})},Hc=function(e){return e.messages.messages},Vc=Object(Re.a)([Hc],(function(e){return e})),$c=n(43),Gc=n(44),Kc=function(e){return function(){var t=Object(ke.a)(Se.a.mark((function t(n){var o;return Se.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{(o=Object(D.i)("updatedAt",e.filter((function(e){return!0===e.pinned})),!0))&&n(Object(Gc.b)(o))}catch(a){n(Object(Gc.a)())}case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Jc=function(e,t){return function(){var n=Object(ke.a)(Se.a.mark((function n(o){var a;return Se.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(Ie.h)(e);case 3:(a=n.sent)&&(o(Object($c.b)(a)),o(Kc(a.messages))),t&&t(),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),o(Object($c.a)());case 11:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(e){return n.apply(this,arguments)}}()},Qc=n(463),Xc=Object(r.a)({container:{height:"93vh",width:"100%",display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",position:"relative"},messagesScroll:{paddingTop:30,overflowY:"scroll",maxHeight:"83vh",width:"100%",display:"flex",justifyContent:"center","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},messagesEmpty:{overflowY:"hidden",width:"100%",display:"flex",justifyContent:"center",paddingTop:30},messagesBody:{width:"60%"}}),Zc=function(e){var t,n,c,r=e.chatDivRef,l=e.selectedArr,d=e.setSelectedArr,b=e.isSomeSelected,j=e.setIsSomeSelected,f=e.openPinned,u=e.pinnedMessagesMemo,p=e.handleUnpinAll,m=Xc(),h=Object(i.b)(),x=Object(i.c)(Vc),g=Object(i.c)(Lt.a),O=g.number,v=g.nightMode,y=g.silentMode,w=Object(i.c)(Et.a),S=w.companionId,k=w.total,I=w.seen,T=w.mute,z=w.seenCompanion,R=w.number,M=Object(i.c)(Le),A=Object(s.useState)(!1),E=Object(o.a)(A,2),L=E[0],W=E[1],B=Object(s.useState)({new:0,mute:!1}),P=Object(o.a)(B,2),Y=P[0],F=P[1],U=Object(s.useState)(void 0),q=Object(o.a)(U,2),H=q[0],V=q[1],$=Object(s.useState)(void 0),G=Object(o.a)($,2),K=G[0],J=G[1],Q=Object(s.useState)(void 0),X=Object(o.a)(Q,2),Z=X[0],ee=X[1],te=Object(s.useState)(!1),ne=Object(o.a)(te,2),oe=ne[0],ae=ne[1],ce=function(e){return Math.round(new Date(e).getTime()/1e3)},re=function(e){return l.some((function(t){return t===e}))},ie=function(e){!b&&j(!0),l.some((function(t){return t===e}))?d(l.filter((function(t){return t!==e}))):d([].concat(Object(N.a)(l),[e]))},se=function(e){f&&h(Object(C.b)(!1)),Z&&ee(void 0),V(ue.find((function(t){return t._id===e})))},le=function(e){f&&h(Object(C.b)(!1)),H&&V(void 0),Z&&ee(void 0),J(ue.find((function(t){return t._id===e}))),ae(!0)},de=function(e){f&&h(Object(C.b)(!1)),H&&V(void 0),ee(ue.find((function(t){return t._id===e})))},be=Object(s.useCallback)((function(){r.current&&r.current.scrollTo({top:r.current.scrollHeight,behavior:"smooth"})}),[r]),je=Object(s.useCallback)((function(e){var t=e.target,n=t.scrollHeight,o=t.scrollTop,a=t.clientHeight,c=n-Math.floor(o);k!==I&&c-a<10&&!f&&Object(Ie.u)(S),W(c!==a)}),[k,I,S,f]),fe=Qc(je,300),ue=Object(s.useMemo)((function(){return f?u:x}),[x,u,f]),pe=function(e){var t=r.current.childNodes[0].childNodes,n=Object(N.a)(t).find((function(t){return t.id===e}));n&&((n=Object(N.a)(n.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",n.style.boxShadow="0px 0px 6px 0px #ffffff",n.scrollIntoView({behavior:"smooth"}),setTimeout((function(){n.style.backgroundColor="unset",n.style.boxShadow="unset"}),2e3))},me=function(e,t){if(S===e)return pe(t);h(Object(C.c)("")),h(Object(C.b)(!1)),h(Ye(e)),setTimeout((function(){return pe(t)}),2e3)},he=function(e){e&&S!==e&&(h(Object(C.c)("")),h(Object(C.b)(!1)),h(Ye(e)))};return Object(s.useEffect)((function(){M&&(h(Jc(S,be)),h(Object(C.d)(!1)))}),[h,be,M,S]),Object(s.useEffect)((function(){var e=function(){h(Fe(S)),h(Jc(S,null))};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[h,S]),Object(s.useEffect)((function(){F({new:k-I,mute:T})}),[k,I,T]),Object(s.useEffect)((function(){if(r.current&&f){var e=r.current;e.scrollHeight===e.clientHeight&&L&&W(!1)}}),[r,f,u.length,L]),Object(s.useEffect)((function(){var e=setInterval((function(){if(r.current&&!f){var e=r.current,t=e.scrollHeight,n=e.clientHeight;k!==I&&t===n&&Object(Ie.u)(S)}}),D.p);return function(){return clearInterval(e)}}),[k,I,r,S,f]),Object(a.jsxs)("div",{className:m.container,children:[Object(a.jsx)(So,{isArrow:L,isNew:Y,handleScrollTo:be,openPinned:f}),K&&oe&&Object(a.jsx)(_c,{setModalForward:ae,setIsForward:J,companionId:S}),Object(a.jsx)("div",{id:S,ref:r,onScroll:fe,className:x.length>0?m.messagesScroll:m.messagesEmpty,children:Object(a.jsx)("div",{className:m.messagesBody,children:x.length>0?ue.map((function(e,o){var r,i,s=e.replyMessage,l=e.message,d=e.name,j=e.lastName,f=e.avatarUrl,u=e.color,p=e.pinned,m=e.createdAt,h=e.number,x=e.type,g=e.fullType,y=e.replyName,C=e.replyLastName,w=e.replyCaption,S=e.caption,k=e.emoji,N=e.emojiCompanion,T=e._id,M=e.oldId,A=e.forwardName,E=e.forwardLastName,L=e.companionIdForwardToAndFrom,W=e.forwardMessage,B=e.forwardCaption,P=e.edited,Y=e.deleted,F=!(z-(o+1)<0),U=!1,q=ue[o+1];!c&&R===h&&I-(o+1)<0&&(r=!0,c=!0),t?Object(D.t)(t)!==Object(D.t)(m)&&(t=m,i=!0):(i=!0,t=m),!n&&q&&q.number===h?(U=!(ce(q.createdAt)-ce(m)<600),n=h):!n&&q&&q.number!==h?(U=!0,n=null):n&&q&&n===h&&q.number===h?(U=!(ce(q.createdAt)-ce(m)<600),n=h):n&&q&&n===h&&q.number!==h||n&&!q&&n===h?(U=!0,n=null):n&&!q&&n!==h&&(U=!1,n=h),ue.length-1===o&&(U=!0),q&&Object(D.t)(q.createdAt)!==Object(D.t)(m)&&(U=!0);var _="".concat(D.m,"/").concat(l),H="".concat(D.m,"/").concat(W),V="".concat(D.m,"/").concat(s);if(h!==O){if("text"===x&&!M&&!L&&!Y)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(ha,{message:l,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,createdAt:m,name:d,lastName:j,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if("text"===x&&Y)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(fa,{tongue:U,watched:F,edited:P,companionIdForwardToAndFrom:L,avatarUrl:f,color:u,name:d,lastName:j,forwardReplyName:L?A:y,forwardReplyLastName:L?E:C,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,handleOpenTheChat:he})]},m);if("text"===x&&L)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Na,{url:H,companionIdForwardToAndFrom:L,oldId:M,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,name:d,lastName:j,forwardName:A,forwardLastName:E,forwardMessage:W,forwardCaption:B,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,fullType:g,handleScrollToTheChat:me})]},m);if("text"===x&&M)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Ca,{url:V,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,replyMessage:s,message:l,createdAt:m,name:d,lastName:j,replyName:y,replyLastName:C,replyCaption:w,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,fullType:g,handleScrollToTheMessage:pe,oldId:M})]},m);if("image"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Ra,{url:_,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,name:d,lastName:j,nightMode:v,handleReply:se,handleForward:le})]},m);if("audio"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Wa,{url:_,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if("video"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Ua,{url:_,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m);if(x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)($a,{url:_,tongue:U,watched:!c,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,type:x,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le})]},m)}else{if("text"===x&&!M&&!L&&!Y)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(tc,{message:l,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,createdAt:m,name:d,lastName:j,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("text"===x&&Y)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Qa,{tongue:U,watched:F,edited:P,companionIdForwardToAndFrom:L,avatarUrl:f,color:u,name:d,lastName:j,forwardReplyName:L?A:y,forwardReplyLastName:L?E:C,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,handleOpenTheChat:he})]},m);if("text"===x&&L)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(lc,{url:H,oldId:M,companionIdForwardToAndFrom:L,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,name:d,lastName:j,forwardName:A,forwardLastName:E,forwardMessage:W,forwardCaption:B,message:l,createdAt:m,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,fullType:g,handleScrollToTheChat:me})]},m);if("text"===x&&M)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(cc,{url:V,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,replyMessage:s,message:l,createdAt:m,name:d,lastName:j,replyName:y,replyLastName:C,replyCaption:w,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de,fullType:g,handleScrollToTheMessage:pe,oldId:M})]},m);if("image"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(fc,{url:_,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,name:d,lastName:j,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("audio"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(hc,{url:_,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if("video"===x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(yc,{url:_,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,fullType:g,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m);if(x)return Object(a.jsxs)("div",{id:T,style:{borderRadius:7},children:[i&&Object(a.jsx)(Tc,{message:Object(D.t)(m)}),r&&Object(a.jsx)(Tc,{message:"Unread Messages"}),Object(a.jsx)(Nc,{url:_,tongue:U,watched:F,edited:P,avatarUrl:f,color:u,name:d,lastName:j,createdAt:m,type:x,caption:S,emoji:k,emojiCompanion:N,pinned:p,isSomeSelected:b,isSelected:re,handleSelected:ie,_id:T,nightMode:v,handleReply:se,handleForward:le,handleEdit:de})]},m)}})):Object(a.jsx)(_,{name:"You do not have messages yet!"})})}),!f&&!b&&Object(a.jsx)(oa,{isArrow:L,silentMode:y,isReply:H,setIsReply:V,isForward:K,setIsForward:J,isEdit:Z,setIsEdit:ee,modalForward:oe,handleScrollToTheMessage:pe}),f&&!b&&Object(a.jsx)(ca,{pinnedMessagesMemo:u,handleUnpinAll:p})]})},er=function(e){var t=e.rightIsOpen,n=e.chatDivRef,r=e.companionId,l=e.backgroundImage,d=e.handleStartCall,b=Object(i.b)(),j=Object(i.c)(Ue),f=Object(i.c)(We),u=Object(s.useState)([]),p=Object(o.a)(u,2),m=p[0],h=p[1],x=Object(s.useState)(!1),g=Object(o.a)(x,2),O=g[0],v=g[1];return Object(s.useEffect)((function(){0===j.length&&f&&b(Object(C.b)(!1))}),[f,j,b]),Object(s.useEffect)((function(){v(!1),h([])}),[r]),Object(a.jsxs)(c.a,{item:!0,lg:t?8:12,children:[Object(a.jsx)(c.a,{item:!0,lg:12,children:Object(a.jsx)(vo,{chatDivRef:n,selectedArr:m,isSomeSelected:O,handleClearSelect:function(){m.length>0&&h([]),O&&v(!1)},setIsSomeSelected:v,openPinned:f,pinnedMessagesMemo:j,handleStartCall:d})}),Object(a.jsx)(c.a,{item:!0,lg:12,style:{backgroundImage:l},children:Object(a.jsx)(Zc,{chatDivRef:n,selectedArr:m,setSelectedArr:h,isSomeSelected:O,setIsSomeSelected:v,openPinned:f,pinnedMessagesMemo:j,handleUnpinAll:function(){f&&b(Object(C.b)(!1)),Object(Ie.I)(j.map((function(e){return e._id})))}})})]})},tr=Object(r.a)({container:{position:"absolute"}}),nr=function(e){var t=e.disabled,n=e.date,o=e.changeDate,c=e.handleOnOpen,r=tr();return Object(a.jsx)(ct.a,{disabled:t,className:r.container,inputVariant:"outlined",orientation:"portrait",variant:"dialog",openTo:"date",autoOk:!0,value:n||new Date,onOpen:c,onChange:o})},or=Object(b.a)("div")((function(e){e.theme;return{position:"relative",borderRadius:"20px",backgroundColor:"#f1f0f0",width:"100%",margin:"0 5% 0 5%"}})),ar=Object(b.a)("div")((function(e){return{padding:e.theme.spacing(0,2),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),cr=Object(b.a)(Xe.a)((function(e){var t=e.theme;return{color:"inherit","& .MuiInputBase-input":{fontWeight:500,borderRadius:"20px",padding:t.spacing(1,1,1,0),paddingLeft:"calc(1em + ".concat(t.spacing(4),")"),transition:t.transitions.create("width"),width:"100%"}}})),rr=Object(r.a)({toolBar:{color:"#b1aeae",height:"7vh"},searchBarActive:{outline:"2px solid #2184f7",color:"#2184f7"}}),ir={inputProps:{"aria-label":"Switch demo"}},sr=function(e){var t=e.handleSearch,n=e.value,o=e.setDate,c=e.date,r=Object(i.b)(),s=rr(),l=Object(i.c)(Et.a),b=l.sort,j=l.companionId,f=!(Object(i.c)(Hc).length>0);return Object(a.jsxs)(nt.a,{className:s.toolBar,children:[Object(a.jsx)($e.a,{onClick:function(){return r(Object(C.c)(""))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(O.a,{fontSize:"medium"})}),Object(a.jsxs)(or,{className:!n||f?void 0:s.searchBarActive,children:[Object(a.jsx)(ar,{children:Object(a.jsx)(Qe.a,{})}),Object(a.jsx)(cr,{disabled:f,onChange:t,placeholder:f?"Disabled":"Search",value:n,inputProps:{"aria-label":"search"}})]}),Object(a.jsxs)($e.a,{"aria-label":"delete",size:"medium",disabled:f,children:[Object(a.jsx)(nr,{disabled:f,date:c,changeDate:o,handleOnOpen:function(){return o("")}}),Object(a.jsx)(at.a,{fontSize:"medium",style:{color:c?"#2184f7":"#b1aeae"}})]}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({onClick:function(){return Object(Ie.F)(j)},checked:b},ir),{},{disabled:f}))]})},lr=Object(r.a)({container:{height:"100%",backgroundColor:"#ffffff"},list:{maxHeight:"93vh",overflowY:"scroll","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"}}),dr=function(e){var t=e.chatDivRef,n=lr(),c=Object(i.c)(Et.a).sort,r=Object(i.c)(We),l=Object(i.c)(Vc),d=Object(i.c)(Ue),b=Object(s.useState)(""),f=Object(o.a)(b,2),u=f[0],p=f[1],m=Object(s.useState)(""),h=Object(o.a)(m,2),x=h[0],g=h[1],O=Object(s.useMemo)((function(){return Object(D.i)("createdAt",r?d:l,c).filter((function(e){return x?e.message.toLowerCase().includes(u.toLowerCase())&&Object(D.t)(x)===Object(D.t)(e.createdAt)?e:void 0:e.message.toLowerCase().includes(u.toLowerCase())}))}),[l,x,c,u,r,d]);return Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(sr,{handleSearch:function(e){return p(e.target.value)},value:u,setDate:g,date:x}),Object(a.jsx)("div",{className:l.length>0?n.list:void 0,children:l.length>0?O.length>0?Object(a.jsx)(R.a,{sx:{width:"100%"},children:O.map((function(e){var o=e.name,c=e.lastName,r=e.avatarUrl,i=e.color,s=e.message,l=e.createdAt,d=e._id,b=e.fullType,f=e.type;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return function(e){var n=t.current.childNodes[0].childNodes,o=Object(N.a)(n).find((function(t){return t.id===e}));o&&((o=Object(N.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))}(d)},alignItems:"flex-start",className:n.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:o,src:r?"".concat(D.m,"/").concat(r):void 0,sx:{background:i,width:40,height:40,marginRight:2},children:!r&&"".concat(Object(D.e)(o)).concat(Object(D.e)(c))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(o)).concat(Object(D.q)(o,15,1)," \n ").concat(Object(D.e)(c)).concat(Object(D.q)(c,15,1)),secondary:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ra.a,{sx:{display:"block",wordBreak:"break-word"},component:"span",variant:"body2",color:"text.primary",children:"text"===f?s:b}),Object(D.s)(l)]})}),"text"===f&&Object(a.jsx)(fe.a,{className:n.folderIcon,fontSize:"large"}),"text"!==f&&b.includes("audio")&&Object(a.jsx)(he.a,{className:n.folderIcon,fontSize:"large"}),"text"!==f&&b.includes("video")&&Object(a.jsx)(ve.a,{className:n.folderIcon,fontSize:"large"}),"text"!==f&&b.includes("image")&&Object(a.jsx)(ho.a,{className:n.folderIcon,fontSize:"large"}),"text"!==f&&b.includes("application")&&Object(a.jsx)(J.a,{className:n.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},l)}))}):Object(a.jsx)(_,{name:"Can not find message by request: ".concat(u)}):Object(a.jsx)(_,{name:"You do not have messages yet!"})})]})},br=Object(r.a)({container:{display:"flex",alignContent:"center",alignItems:"center",height:"7vh"},iconClose:{"&:hover":{transform:"rotate(180deg)",transition:"all 250ms ease-out "}}}),jr=function(){var e=Object(i.b)(),t=br(),n=Object(i.c)(an),c=Object(i.c)(Et.a).number,r=Object(s.useState)(!1),l=Object(o.a)(r,2),d=l[0],b=l[1];return Object(s.useEffect)((function(){var e=n.find((function(e){return e.number===c}));b(!!e)}),[n,c]),Object(a.jsxs)(M.a,{className:t.container,direction:"row",children:[Object(a.jsx)($e.a,{onClick:function(){return e(Object(C.c)(""))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(O.a,{className:t.iconClose,fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",color:"initial",style:{marginLeft:20,color:"#474747"},children:"Profile"}),Object(a.jsx)($e.a,{style:{marginLeft:"auto",marginRight:"3%"},"aria-label":"delete",size:"medium",children:d?Object(a.jsx)(gn.a,{onClick:function(){return e(Object(C.c)("edit"))},fontSize:"medium"}):Object(a.jsx)(y.a,{onClick:function(){return e(ln(c))},fontSize:"medium"})})]})},fr=Object(r.a)({container:{position:"relative"},timeTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"1%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},nameTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:8,fontSize:18,zIndex:10,top:"6%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},countryTitle:{position:"absolute",color:"#ffffff",backgroundColor:"rgb(0,0,0)",borderRadius:10,padding:4,fontSize:15,top:"13%",left:"50%",marginLeft:"-45%",opacity:.7,transition:"opacity .35s ease-in-out"},credentialsTitle:{position:"absolute",color:"#ffffff",fontSize:100,top:"30%",left:"38%"},credentialsLowTitle:{position:"absolute",color:"#ffffff",fontSize:25,top:"90%",left:"9%"}}),ur=function(){var e=fr(),t=Object(i.c)(Et.a),n=t.name,o=t.lastName,c=t.online,r=t.avatarsArr,s=t.createdAt,l=t.color,d=t.country,b=0!==r.length;return Object(a.jsxs)("div",{className:e.container,children:[Object(a.jsx)(In.Carousel,{children:b?r.map((function(e){var t=e.avatarUrl,n=e.updatedAt;return Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"pic",src:"".concat(D.m,"/").concat(t)}),Object(a.jsx)("p",{className:"legend",children:Object(D.s)(n)})]})})):[Object(a.jsxs)("div",{children:[Object(a.jsx)("img",{alt:"transparentPic",src:Tn,style:{background:"linear-gradient(to bottom, ".concat(l,", ").concat(l," 80%, #5d5d5d 100%)")}}),Object(a.jsx)("p",{className:"legend",children:Object(D.s)(s)})]})]}),Object(a.jsx)("span",{className:e.timeTitle,children:"true"===c?"online":"last seen ".concat(Object(D.s)(c))}),Object(a.jsx)("span",{className:e.nameTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.q)(n,15,1),"\n ").concat(Object(D.e)(o)).concat(Object(D.q)(o,15,1))}),Object(a.jsx)("span",{className:e.countryTitle,children:d}),!b&&Object(a.jsx)("span",{className:e.credentialsTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.e)(o))}),!b&&Object(a.jsx)("span",{className:e.credentialsLowTitle,children:"".concat(Object(D.e)(n)).concat(Object(D.e)(o))})]})},pr=n(465),mr=n.n(pr),hr=n(464),xr=n.n(hr),gr=Object(r.a)({listIcon:{marginRight:15}}),Or={inputProps:{"aria-label":"Switch demo"}},vr=function(e){var t=e.disabled,n=gr(),o=Object(i.c)(Et.a),c=o.number,r=o.mute,s=o.sort,l=o.companionId,b=o.originalName,j=o.originalLastName,f="".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1),"\n ").concat(Object(D.e)(j)).concat(Object(D.q)(j,15,1));return Object(a.jsx)(Pt.a,{children:Object(a.jsxs)(Yt.a,{children:[Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return Object(D.a)("Number")},text:c,children:Object(a.jsxs)(u.a,{children:[Object(a.jsx)(P.a,{className:n.listIcon,children:Object(a.jsx)(En.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{primary:c,secondary:"Copy number"})]})}),Object(a.jsx)(Q.a,{variant:"inset"}),Object(a.jsx)(en.CopyToClipboard,{onCopy:function(){return Object(D.a)("Username")},text:f,children:Object(a.jsxs)(u.a,{style:{cursor:"pointer"},children:[Object(a.jsx)(P.a,{className:n.listIcon,children:Object(a.jsx)(xr.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{primary:f,secondary:"Username"})]})}),Object(a.jsx)(Q.a,{variant:"inset"}),Object(a.jsxs)(u.a,{style:{cursor:"default"},children:[Object(a.jsx)(P.a,{className:n.listIcon,children:Object(a.jsx)(Vt.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{primary:"Notification"}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({style:{cursor:"pointer"},onClick:function(){return Object(Ie.k)(l)}},Or),{},{checked:!r}))]}),Object(a.jsx)(Q.a,{variant:"inset"}),Object(a.jsxs)(u.a,{disabled:t,style:{cursor:"default"},children:[Object(a.jsx)(P.a,{className:n.listIcon,children:Object(a.jsx)(mr.a,{fontSize:"medium"})}),Object(a.jsx)(B.a,{primary:"Sort by Date"}),Object(a.jsx)(tt.a,Object(d.a)(Object(d.a)({style:{cursor:"pointer"},onClick:function(){return Object(Ie.F)(l)}},Or),{},{checked:s}))]})]})})},yr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Cr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=yr();return t.length>0?Object(a.jsx)(R.a,{className:c.container,children:t.map((function(e){e.message;var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:i,src:s?"".concat(D.m,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(D.e)(i)).concat(Object(D.e)(l))})}),Object(a.jsx)(B.a,{primary:o,secondary:Object(D.s)(t)}),Object(a.jsx)(he.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(_,{name:"You do not have ".concat(o&&"Pinned"," Audio yet!")})},wr=Object(r.a)({overlay:{position:"fixed",top:0,left:0,width:"100vw",minHeight:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",boxSizing:"border-box",display:"flex",justifyContent:"center",alignContent:"center",alignItems:"center",overflow:"auto"},topBar:{position:"fixed",top:0,left:0,height:"7vh",width:"100vw",display:"flex",alignContent:"center",alignItems:"center",justifyContent:"space-between",backgroundColor:"rgba(65, 65, 65, 0.9)",zIndex:10,padding:"0px 20px"},wrapperCredentials:{display:"flex",alignContent:"center",alignItems:"center"},wrapperIcons:{display:"flex",alignContent:"center",alignItems:"center"},magnifying:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"scale(1.1)"}},downloadIcon:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,borderRadius:"50%","&:hover":{backgroundColor:"#ffffff",color:"#b8b7b7"}},iconClose:{marginLeft:5,cursor:"pointer",color:"#e9e7e7",padding:0,"&:hover":{color:"#ffffff",transform:"rotate(180deg)",transition:"all 250ms ease-out "}},wrapperImage:{borderRadius:5,maxWidth:500,maxHeight:750,display:"flex",overflow:"auto"},innerImage:{objectFit:"cover"},img:{cursor:"pointer","&:hover":{scale:.98}}}),Sr=function(e){var t=e.message,n=e.fullType,c=e.updatedAt,r=e.handleScrollToTheMessage,i=e.id,l=e.name,d=e.lastName,b=e.avatarUrl,f=e.color,u=wr(),p="".concat(D.m,"/").concat(t),m=Object(s.useState)(!1),h=Object(o.a)(m,2),x=h[0],g=h[1],v=Object(s.useState)(1),y=Object(o.a)(v,2),C=y[0],w=y[1],S=Object(s.useRef)(null),k=function(e){var t=e.target.id;"overlay"!==t&&"close"!==t||(g(!1),w(1))};return x?Object(a.jsxs)("div",{id:"overlay",onClick:function(e){k(e),r(i)},className:u.overlay,children:[Object(a.jsxs)("div",{className:u.topBar,children:[Object(a.jsxs)("div",{className:u.wrapperCredentials,children:[Object(a.jsx)(P.a,{children:Object(a.jsx)(j.a,{alt:l,src:b?"".concat(D.m,"/").concat(b):void 0,sx:{background:f,width:44,height:44},children:!b&&"".concat(Object(D.e)(l)).concat(Object(D.e)(d))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(l)).concat(Object(D.q)(l,15,1),"\n ").concat(Object(D.e)(d)).concat(Object(D.q)(d,15,1)),primaryTypographyProps:{color:"#ffffff"},secondary:Object(D.s)(c),secondaryTypographyProps:{color:"#ffffff"}})]}),Object(a.jsxs)("div",{className:u.wrapperIcons,children:[Object(a.jsx)(ce.a,{onClick:function(){C>=.5&&(S.current.style.transform="scale(".concat(C-.25,",").concat(C-.25,")"),S.current.style.transformOrigin="".concat(50/C-.25,"px ").concat(50/C-.25,"px"),w(C-.25))},className:u.magnifying,fontSize:"large"}),Object(a.jsx)(ie.a,{onClick:function(){C<5&&(S.current.style.transform="scale(".concat(C+.25,",").concat(C+.25,")"),S.current.style.transformOrigin="".concat(50/C+.25,"px ").concat(50/C+.25,"px"),w(C+.25))},className:u.magnifying,fontSize:"large"}),Object(a.jsx)(oe.a,{onClick:function(){return Object(D.h)(p,n)},className:u.downloadIcon,fontSize:"large"}),Object(a.jsx)(O.a,{id:"close",onClick:k,className:u.iconClose,fontSize:"large"})]})]}),Object(a.jsx)("div",{ref:S,className:u.wrapperImage,children:Object(a.jsx)("img",{className:u.innerImage,width:"100%",height:"auto",alt:"imageItem",src:p})})]}):Object(a.jsx)(te.a,{children:Object(a.jsx)("img",{onClick:function(){return!x&&g(!0)},className:u.img,src:"".concat(p,"?w=164&h=164&fit=crop&auto=format"),srcSet:"".concat(p,"?w=164&h=164&fit=crop&auto=format&dpr=2 2x"),alt:"imageItem",loading:"lazy"})})},kr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Nr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=kr();return t.length>0?Object(a.jsx)(ee.a,{className:c.container,sx:{width:"100%",height:"auto",overflow:"hidden"},cols:3,rowHeight:164,children:t.map((function(e){var t=e.message,o=e.createdAt,c=e.fullType,r=e.updatedAt,i=e._id,s=e.name,l=e.lastName,d=e.avatarUrl,b=e.color;return Object(a.jsx)(Sr,{message:t,fullType:c,updatedAt:r,handleScrollToTheMessage:n,id:i,name:s,lastName:l,avatarUrl:d,color:b},o)}))}):Object(a.jsx)(_,{name:"You do not have ".concat(o&&"Pinned"," Media yet!")})},Ir=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Tr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=Ir();return t.length>0?Object(a.jsx)(R.a,{className:c.container,children:t.map((function(e){var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:i,src:s?"".concat(D.m,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(D.e)(i)).concat(Object(D.e)(l))})}),Object(a.jsx)(B.a,{primary:o,secondary:Object(D.s)(t)}),Object(a.jsx)(J.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(_,{name:"You do not have ".concat(o&&"Pinned"," Files yet!")})},zr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},folderIcon:{margin:"auto 0px",color:"#54b0fc"},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Rr=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=zr();return t.length>0?Object(a.jsx)(R.a,{className:c.container,children:t.map((function(e){var t=e.message,o=e.createdAt,r=e.lastName,i=e.name,s=e.color,l=e.avatarUrl,d=e._id;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return n(d)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:i,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:s,width:38,height:38},children:"".concat(Object(D.e)(i)).concat(Object(D.e)(r))})}),Object(a.jsx)(B.a,{style:{wordBreak:"break-word",marginRight:2},primary:t,secondary:Object(D.s)(o),secondaryTypographyProps:{color:"#020202",paddingTop:.5}}),Object(a.jsx)(fe.a,{className:c.folderIcon,fontSize:"large"})]}),Object(a.jsx)(Q.a,{variant:"inset"})]},o)}))}):Object(a.jsx)(_,{name:"You do not have ".concat(o&&"Pinned"," Text yet!")})},Mr=Object(r.a)({container:{position:"absolute",animationDuration:"0.2s",animationDirection:"normal",animation:"$moveElement"},folderIcon:{margin:"auto 0px",color:"#54b0fc"},listItem:{cursor:"pointer","&:hover":{backgroundColor:"#f0f0f0"}},"@keyframes moveElement":{"0%":{left:"100%"},"100%":{left:"0%"}}}),Ar=function(e){var t=e.filteredAndSorted,n=e.handleScrollToTheMessage,o=e.openPinned,c=Mr();return t.length>0?Object(a.jsx)(R.a,{className:c.container,children:t.map((function(e){e.message;var t=e.createdAt,o=e.fullType,r=e._id,i=e.name,s=e.avatarUrl,l=e.lastName,d=e.color;return Object(a.jsxs)("div",{children:[Object(a.jsxs)($.a,{onClick:function(){return n(r)},alignItems:"flex-start",className:c.listItem,children:[Object(a.jsx)(G.a,{children:Object(a.jsx)(j.a,{alt:i,src:s?"".concat(D.m,"/").concat(s):void 0,sx:{background:d,width:40,height:40,marginRight:2},children:!s&&"".concat(Object(D.e)(i)).concat(Object(D.e)(l))})}),Object(a.jsx)(B.a,{primary:o,secondary:Object(D.s)(t)}),Object(a.jsx)(ve.a,{className:c.folderIcon,fontSize:"large"})]},t),Object(a.jsx)(Q.a,{variant:"inset"})]},t)}))}):Object(a.jsx)(_,{name:"You do not have ".concat(o&&"Pinned"," Video yet!")})},Dr=Object(r.a)({container:{height:"7vh",display:"flex",alignContent:"end",alignItems:"end",width:"100%",borderBottom:"solid 2px #dddddd"}}),Er=Object(b.a)((function(e){return Object(a.jsx)(T.a,Object(d.a)(Object(d.a)({},e),{},{TabIndicatorProps:{children:Object(a.jsx)("span",{className:"MuiTabs-indicatorSpan"})}}))}))({"& .MuiTabs-flexContainer":{display:"flex",width:"100%",padding:"0px 10px",justifyContent:"space-between"},"& .MuiTabs-indicator":{height:0,backgroundColor:"transparent",borderBottom:"3px solid #1976d2",borderLeft:"3px solid transparent",borderRight:"3px solid transparent"}}),Lr=Object(b.a)((function(e){return Object(a.jsx)(I.a,Object(d.a)({disableRipple:!0},e))}))((function(){return{fontSize:"1rem",fontWeight:550,textTransform:"none",minWidth:"auto"}})),Wr=function(e){var t=e.setDisabled,n=e.chatDivRef,c=Dr(),r=Object(i.c)(Et.a).sort,l=Object(i.c)(We),d=Object(i.c)(Vc),b=Object(i.c)(Ue),j=Object(s.useState)(0),f=Object(o.a)(j,2),u=f[0],p=f[1],m=function(e){var t=n.current.childNodes[0].childNodes,o=Object(N.a)(t).find((function(t){return t.id===e}));o&&((o=Object(N.a)(o.childNodes).slice(-1)[0]).style.backgroundColor="rgba(70, 70, 70, 0.4)",o.style.boxShadow="0px 0px 6px 0px #ffffff",o.scrollIntoView({behavior:"smooth"}),setTimeout((function(){o.style.backgroundColor="unset",o.style.boxShadow="unset"}),2e3))},h=Object(s.useMemo)((function(){return Object(D.i)("createdAt",l?b:d,r).filter((function(e){return D.c[u].includes(e.type)}))}),[u,d,l,b,r]);return Object(s.useEffect)((function(){t(!(h.length>0))}),[h,t]),Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(z.a,{className:c.container,children:Object(a.jsxs)(Er,{sx:{width:"100%"},onChange:function(e,t){return p(t)},value:u,"aria-label":"wrapped label tabs example",children:[Object(a.jsx)(Lr,{label:"Files"}),Object(a.jsx)(Lr,{label:"Media"}),Object(a.jsx)(Lr,{label:"Text"}),Object(a.jsx)(Lr,{label:"Audio"}),Object(a.jsx)(Lr,{label:"Video"})]})}),0===u&&Object(a.jsx)(Tr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),1===u&&Object(a.jsx)(Nr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),2===u&&Object(a.jsx)(Rr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),3===u&&Object(a.jsx)(Cr,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l}),4===u&&Object(a.jsx)(Ar,{filteredAndSorted:h,handleScrollToTheMessage:m,openPinned:l})]})},Br=Object(r.a)({container:{backgroundColor:"#ffffff",height:"100%",width:"100%",position:"relative"},scrollContainer:{overflowY:"scroll",maxHeight:"93vh",width:"100%","&::-webkit-scrollbar":{width:"0.4em"},"&::-webkit-scrollbar-track":{boxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)",backgroundColor:"#eceeec"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#ccc8c8"},"&::-webkit-scrollbar-thumb:focus":{backgroundColor:"#959595"},"&::-webkit-scrollbar-thumb:active":{backgroundColor:"#959595"}}}),Pr=function(e){var t=e.chatDivRef,n=Br(),c=Object(i.b)(),r=Object(i.c)(De),l=Object(s.useState)(!1),d=Object(o.a)(l,2),b=d[0],j=d[1];return Object(s.useEffect)((function(){var e=function(){return"contacts"!==r&&c(sn())};e();var t=setInterval(e,D.p);return function(){return clearInterval(t)}}),[r,c]),Object(a.jsxs)("div",{className:n.container,children:[Object(a.jsx)(jr,{}),Object(a.jsxs)("div",{className:n.scrollContainer,children:[Object(a.jsx)(ur,{}),Object(a.jsx)(vr,{disabled:b}),Object(a.jsx)(Wr,{setDisabled:j,chatDivRef:t})]})]})},Yr=Object(r.a)({container:{height:"7vh",width:"100%",display:"flex",alignContent:"center",alignItems:"center",backgroundColor:"#ffffff"},iconArrow:{"&:hover":{transform:"rotate(360deg)",transition:"all 250ms ease-out "}}}),Fr=function(){var e=Object(i.b)(),t=Yr();return Object(a.jsxs)(M.a,{className:t.container,direction:"row",spacing:21,children:[Object(a.jsx)($e.a,{onClick:function(){return e(Object(C.c)("credentials"))},"aria-label":"delete",size:"medium",children:Object(a.jsx)(et.a,{className:t.iconArrow,fontSize:"medium"})}),Object(a.jsx)(A.a,{style:{marginLeft:20,color:"#474747"},variant:"h6",color:"initial",children:"Edit chat"})]})},Ur=Object(r.a)({container:{display:"flex",alignItems:"center",alignContent:"center",flexDirection:"column",width:"100%",margin:"0 auto",padding:20,marginBottom:15,position:"relative",backgroundColor:"#ffffff"},textField:{marginBottom:20},notifications:{width:"100%",display:"flex",justifyContent:"flex-start",alignContent:"start",alignItems:"start",marginBottom:"auto"},avatarArrow:{cursor:"pointer",alignSelf:"flex-end","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),qr={inputProps:{"aria-label":"Checkbox demo"}},_r=function(e){var t=Ur(),n=e.chat,o=e.name,c=e.setName,r=e.lastName,i=e.setLastName,s=e.mute,l=e.setMute,b=e.openBtn,f=e.setOpenBtn,u=n.avatarUrl,p=n.color,m=n.originalName,h=n.originalLastName,x=function(e){!b&&f(!0);var t=Object(D.f)(e.target.value);switch(e.target.name){case"name":c(t);break;case"lastName":i(t)}};return Object(a.jsxs)("div",{className:t.container,children:[Object(a.jsx)(G.a,{style:{marginBottom:10},children:Object(a.jsx)(j.a,{alt:o,src:u?"".concat(D.m,"/").concat(u):void 0,sx:{background:p,width:120,height:120,marginRight:2,fontSize:30},children:"".concat(Object(D.e)(o)).concat(Object(D.e)(r))})}),Object(a.jsx)(A.a,{style:{color:"#080808",fontSize:22,fontWeight:500},children:"".concat(Object(D.e)(m)).concat(Object(D.q)(m,15,1)," \n ").concat(Object(D.e)(h)).concat(Object(D.q)(h,15,1))}),Object(a.jsx)(A.a,{style:{fontSize:17,marginBottom:20},children:"original name"}),Object(a.jsx)(jn.a,{id:"name",name:"name",label:"Name",value:o,fullWidth:!0,variant:"outlined",onChange:x,className:t.textField}),Object(a.jsx)(jn.a,{id:"lastName",name:"lastName",label:"LastName",value:r,fullWidth:!0,variant:"outlined",onChange:x,className:t.textField}),Object(a.jsxs)("div",{className:t.notifications,children:[Object(a.jsx)(ia.a,Object(d.a)(Object(d.a)({onChange:function(){l(!s),!b&&f(!0)}},qr),{},{checked:!s,style:{marginRight:20}})),Object(a.jsx)(B.a,{primary:"Notifications",primaryTypographyProps:{color:"#0e0d0d"},secondary:s?"Enabled":"Disabled"})]})]})},Hr=Object(r.a)({container:{width:"100%",padding:"20px 10px 20px 10px",backgroundColor:"#ffffff"},modalDelete:{background:"#ffffff",position:"absolute",content:"",width:"20%",height:"auto",left:"40%",bottom:"48.5%",borderRadius:10,padding:10,display:"flex",flexDirection:"column"},overlay:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:100,backgroundColor:"rgba(104, 105, 104, 0.6)",overflowY:"hidden"},titleWrapper:{display:"flex",justifyContent:"flex-start",alignContent:"center",alignItems:"center"}}),Vr=function(e){var t=e.isContact,n=Hr(),c=Object(i.b)(),r=t._id,l=t.avatarUrl,d=t.color,b=t.name,f=t.lastName,p=Object(s.useState)(!1),m=Object(o.a)(p,2),h=m[0],x=m[1];return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)("ul",{className:n.container,children:Object(a.jsxs)(u.a,{onClick:function(){return x(!0)},style:{fontSize:19,color:"#f02a2a"},children:[Object(a.jsx)(Ot.a,{fontSize:"medium",style:{marginRight:27}}),"Delete contact"]})}),h&&Object(a.jsx)("div",{onClick:function(e){var t=e.target.id;if("overlay"===t||"cancel"===t)return x(!1);"delete"===t&&(c(Object(C.c)("credentials")),Object(Ie.q)(r),x(!1))},className:n.overlay,id:"overlay",children:Object(a.jsxs)("div",{className:n.modalDelete,children:[Object(a.jsxs)("div",{className:n.titleWrapper,children:[Object(a.jsx)(j.a,{alt:b,src:l?"".concat(D.m,"/").concat(l):void 0,sx:{background:d,width:38,height:38,marginRight:2},children:"".concat(Object(D.e)(b)).concat(Object(D.e)(f))}),Object(a.jsx)("h3",{style:{color:"#2c2c2c"},children:"Delete contact"})]}),Object(a.jsx)("p",{style:{color:"#050505"},children:"Are you sure you want to delete contact\n ".concat("".concat(Object(D.e)(b)).concat(Object(D.q)(b,15,1),"\n ").concat(Object(D.e)(f)).concat(Object(D.q)(f,15,1)),"?")}),Object(a.jsx)(It.a,{id:"delete",variant:"text",color:"error",style:{fontWeight:500,fontSize:22},children:"DELETE CONTACT"}),Object(a.jsx)(It.a,{id:"cancel",variant:"text",style:{fontWeight:500,fontSize:22},children:"CANCEL"})]})})]})},$r=Object(r.a)({container:{position:"absolute",top:"92vh",left:20},avatarArrow:{cursor:"pointer","&:hover":{backgroundColor:"rgb(62, 149, 231)"}}}),Gr=function(e){var t=e.handleSubmit,n=$r();return Object(a.jsx)("div",{className:n.container,children:Object(a.jsx)(j.a,{onClick:t,className:n.avatarArrow,sx:{width:56,height:56,backgroundColor:"rgb(41, 139, 231)",color:"#ffffff"},children:Object(a.jsx)(St.a,{fontSize:"medium"})})})},Kr=Object(r.a)({editBar:{backgroundColor:"#f3f2f2",height:"100%",position:"relative"}}),Jr=function(){var e=Kr(),t=Object(i.c)(an),n=Object(i.c)(Et.a),c=Object(s.useState)(!1),r=Object(o.a)(c,2),l=r[0],d=r[1],b=Object(s.useState)(""),j=Object(o.a)(b,2),f=j[0],u=j[1],p=Object(s.useState)(""),m=Object(o.a)(p,2),h=m[0],x=m[1],g=Object(s.useState)(!0),O=Object(o.a)(g,2),v=O[0],y=O[1],C=Object(s.useState)(!1),w=Object(o.a)(C,2),S=w[0],k=w[1],N=n.name,I=n.lastName,T=n.mute,z=n.companionId,R=n._id;return Object(s.useEffect)((function(){var e=t.find((function(e){return e.number===n.number}));e&&d(e)}),[t,n.number]),Object(s.useEffect)((function(){u(N),x(I),y(!T)}),[N,I,T]),Object(a.jsxs)("div",{className:e.editBar,children:[S&&Object(a.jsx)(Gr,{handleSubmit:function(){v!==!T&&Object(Ie.k)(z),f===N&&h===I||Object(Ie.J)(l._id,R,f,h,z),S&&k(!1)}}),Object(a.jsx)(Fr,{}),Object(a.jsx)(_r,{chat:n,name:f,setName:u,lastName:h,setLastName:x,mute:v,setMute:y,openBtn:S,setOpenBtn:k}),Object(a.jsx)(Vr,{isContact:l})]})},Qr=function(e){var t=e.rightIsOpen,n=e.chatDivRef;return Object(a.jsxs)(c.a,{item:!0,lg:t?4:0,children:["credentials"===t&&Object(a.jsx)(Pr,{chatDivRef:n}),"search"===t&&Object(a.jsx)(dr,{chatDivRef:n}),"edit"===t&&Object(a.jsx)(Jr,{})]})},Xr=n(512),Zr=n(513),ei=n(504),ti=n.n(ei),ni=n(505),oi=n.n(ni),ai=n(507),ci=n.n(ai),ri=n(510),ii=n.n(ri),si=n(509),li=n.n(si),di=n(508),bi=n.n(di),ji=n(506),fi=n.n(ji),ui=n(471),pi=Object(Xr.a)(D.o),mi=Object(r.a)({container:{position:"absolute",left:0,top:0,width:"100vw",height:"100vh",overflow:"hidden",zIndex:100,display:"flex",justifyContent:"center",alignItems:"center",alignContent:"center",backgroundColor:"rgba(104, 105, 104, 0.6)"},modalCall:{background:"rgb(36, 36, 36)",position:"relative",display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"center",justifyItems:"center",borderRadius:7},rightIcons:{display:"flex",justifyContent:"end",alignContent:"center",alignItems:"center",width:"100%",position:"absolute",left:0,top:0,zIndex:1},rightIconWrapper:{color:"#ffffff",cursor:"pointer",padding:"3px 10px 3px 10px"},rightIconWrapperClose:{color:"#ffffff",cursor:"pointer",padding:"3px 10px 3px 10px",backgroundColor:"rgb(36, 36, 36)",borderTopRightRadius:7,"&:hover":{backgroundColor:"#f02a2a"}},bottomWrapper:{display:"flex",justifyContent:"center",padding:5,position:"absolute",left:0,bottom:0,width:"100%"},bottomItem:{display:"flex",flexDirection:"column",justifyContent:"center",alignContent:"center",alignItems:"center",cursor:"pointer",width:80},bottomIcon:{cursor:"pointer"},bottomIconEndAccept:{cursor:"pointer","&:hover":{animation:"$shake 1s",animationIterationCount:"infinite"}},ringPulsate:{backgroundColor:"rgb(80, 80, 80)",borderRadius:"50%",height:60,width:60,position:"absolute",left:10,top:-8,animation:"$pulsate 1.5s ease-out",animationIterationCount:"infinite",opacity:0},titleIconBottom:{color:"#ffffff",fontSize:13,paddingTop:7},myVideo:{cursor:"pointer",position:"absolute",top:0,left:0,zIndex:150},"@keyframes pulsate":{"0%":{transform:"scale(1, 1)",opacity:0},"50%":{opacity:1},"100%":{transform:"scale(1.2, 1.2)",opacity:0}},"@keyframes shake":{"0%":{transform:"rotate(0deg)"},"11%":{transform:"rotate(10deg)"},"22%":{transform:"rotate(20deg)"},"33%":{transform:"rotate(30deg)"},"44%":{transform:"rotate(20deg)"},"55%":{transform:"rotate(10deg)"},"66%":{transform:"rotate(0deg)"},"77%":{transform:"rotate(-10deg)"},"88%":{transform:"rotate(-20deg)"},"100%":{transform:"rotate(-30deg)"}}}),hi=function(e){var t=e.callStatus,n=e.setCallStatus,c=mi(),r=Object(i.c)(Lt.a)._id,l=Object(i.c)(Et.a),d=l.socketId,b=l.companionId,f=Object(s.useRef)(null),u=Object(s.useRef)(null),p=Object(s.useRef)(null),m=Object(s.useRef)(null),h=Object(s.useRef)(null),x=Object(s.useState)(""),g=Object(o.a)(x,2),v=g[0],y=g[1],C=Object(s.useState)(!1),w=Object(o.a)(C,2),S=w[0],k=w[1],N=Object(s.useState)(!1),I=Object(o.a)(N,2),T=I[0],z=I[1],R=Object(s.useState)(""),M=Object(o.a)(R,2),E=M[0],L=M[1],W=Object(s.useState)(null),P=Object(o.a)(W,2),Y=P[0],F=P[1],q=Object(s.useState)(null),_=Object(o.a)(q,2),H=_[0],V=_[1],$=Object(s.useState)(null),K=Object(o.a)($,2),J=K[0],Q=K[1],X=Object(s.useState)(""),Z=Object(o.a)(X,2),ee=Z[0],te=Z[1],ne=Object(s.useState)(""),oe=Object(o.a)(ne,2),ae=oe[0],ce=oe[1],re=Object(s.useState)(""),ie=Object(o.a)(re,2),se=ie[0],le=ie[1],de=Object(s.useState)(""),be=Object(o.a)(de,2),je=be[0],fe=be[1],ue=Object(s.useState)(""),pe=Object(o.a)(ue,2),me=pe[0],he=pe[1],xe=Object(s.useState)(0),ge=Object(o.a)(xe,2),Oe=ge[0],ve=ge[1],ye=Object(s.useState)(""),Ce=Object(o.a)(ye,2),we=Ce[0],Ne=Ce[1],Te=Object(s.useState)(!1),ze=Object(o.a)(Te,2),Re=ze[0],Me=ze[1],Ae=Object(s.useState)(""),De=Object(o.a)(Ae,2),Ee=De[0],Le=De[1],We=Object(s.useState)(null),Be=Object(o.a)(We,2),Pe=Be[0],Ye=Be[1],Fe=Object(s.useCallback)((function(){"is calling you"===t&&pi.emit("answerCall",{signal:"declined",to:E}),f.current&&f.current.destroy(),u.current&&clearInterval(u.current),p.current.srcObject=null,m.current.srcObject=null,h.current.srcObject=null,Pe&&(Pe.pause(),Ye(null)),Y&&Y.getTracks().forEach((function(e){return e.stop()})),V(null),k(!1),z(!1),L(""),F(null),Q(null),te(""),ce(""),le(""),fe(""),he(""),ve(0),Ne(""),Me(!1),Le(""),n("")}),[n,t,E,Pe,Y]),Ue=function(){return n("hanging up...")},qe=function(){var e=Object(ke.a)(Se.a.mark((function e(){var t,o,a,c,r,i;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!Y){e.next=15;break}return t=navigator.mediaDevices,e.next=5,t.getDisplayMedia({video:!0,audio:!0});case 5:o=e.sent,V(o),a=o.getVideoTracks()[0],c=Y.getVideoTracks()[0],r=f.current._pc.getSenders(),i=function(e){return r.forEach((function(t){return"video"===t.track.kind&&t.replaceTrack(e)}))},a.onended=function(){V(null),i(c)},i(a),e.next=17;break;case 15:Le("You can not enable Share before stream started"),setTimeout((function(){return Le("")}),1e3);case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),n("permission not allowed");case 22:case"end":return e.stop()}}),e,null,[[0,19]])})));return function(){return e.apply(this,arguments)}}(),_e=Object(s.useCallback)(Object(ke.a)(Se.a.mark((function e(){var t,o,a;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n("waiting..."),e.next=4,navigator.mediaDevices.getUserMedia({video:!0,audio:!0});case 4:t=e.sent,F(t),p.current.srcObject=t,o=new ui({initiator:!0,trickle:!1,stream:t}),(a=Object(D.k)("".concat(D.n,"/calling.mp3"))).loop=!0,Ye(a),u.current=setInterval((function(){return ve((function(e){return e+1}))}),1e3),o.on("signal",(function(e){n("ringing..."),pi.emit("callTo",{to:d,signalData:e,from:v,userId:r,companionId:b,peer:o})})),o.on("stream",(function(e){m.current.srcObject=e,h.current.srcObject=e})),o.on("connect",(function(){n("connection"),Le(""),a.pause(),clearInterval(u.current),setTimeout((function(){return n("conversation")}),1e3)})),o.on("close",(function(){return n("hanging up...")})),o.on("error",(function(){return n("connection lost")})),pi.on("acceptedCall",(function(e){var t=e.signal;"declined"===t?n("request declined"):"busy"===t?n("line busy"):o.signal(t)})),f.current=o,e.next=24;break;case 21:e.prev=21,e.t0=e.catch(0),n("permission not allowed");case 24:case"end":return e.stop()}}),e,null,[[0,21]])}))),[d,b,r,v,p,n]),He=Object(s.useCallback)(Object(ke.a)(Se.a.mark((function e(){var t,o;return Se.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n("waiting..."),Pe.pause(),e.next=5,navigator.mediaDevices.getUserMedia({video:!0,audio:!0});case 5:t=e.sent,F(t),p.current.srcObject=t,(o=new ui({initiator:!1,trickle:!1,stream:t})).on("signal",(function(e){pi.emit("answerCall",{signal:e,to:E})})),o.on("stream",(function(e){m.current.srcObject=e,h.current.srcObject=e})),o.on("connect",(function(){n("connection"),Le(""),setTimeout((function(){return n("conversation")}),1e3)})),o.on("close",(function(){return n("hanging up...")})),o.on("error",(function(){return n("connection lost")})),o.signal(J),f.current=o,e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),n("permission not allowed");case 21:case"end":return e.stop()}}),e,null,[[0,18]])}))),[E,J,n,Pe]);return Object(s.useEffect)((function(){pi.on("me",(function(e){y(e),Object(Ie.E)(e)}))}),[]),Object(s.useEffect)((function(){pi.on("incomeCall",(function(e){var t=e.name,o=e.lastName,a=e.avatarUrl,c=e.color,r=e.number,i=e.from,s=e.signal;if(null===f.current){n("is calling you"),te(t),ce(o),le(a),fe(c),he(r),L(i),Q(s);var l=Object(D.k)("".concat(D.n,"/ringing.mp3"));l.loop=!0,Ye(l)}else E!==i&&pi.emit("answerCall",{signal:"busy",to:E})}))}),[n,E]),Object(s.useEffect)((function(){60===Oe&&n("have not got response")}),[Oe,n]),Object(s.useEffect)((function(){"requesting..."===t&&_e()}),[t,_e]),Object(s.useEffect)((function(){"hanging up..."!==t&&"connection lost"!==t&&"request declined"!==t&&"have not got response"!==t&&"permission not allowed"!==t&&"line busy"!==t||Fe()}),[t,Fe,n]),Object(s.useEffect)((function(){""===t&&(te(l.name),ce(l.lastName),le(l.avatarUrl),fe(l.color),he(l.number))}),[t,l]),Object(a.jsxs)("div",{className:c.container,style:{top:t?0:"-100%"},children:[Object(a.jsx)("video",{className:c.myVideo,style:{width:!Y||S?0:250,height:!Y||S?0:"auto"},ref:p,playsInline:!0,autoPlay:!0,muted:!0,controls:!1}),Object(a.jsx)(Zr.a,{target:p.current,draggable:!0,throttleDrag:0,hideDefaultLines:!0,renderDirections:[],rotationPosition:"none",origin:!1,onDrag:function(e){var t=e.target,n=e.transform;return t.style.transform=n}}),Object(a.jsxs)("div",{className:c.modalCall,style:{width:Re?"100vw":"34vw",height:Re?"100vh":"auto"},children:[Object(a.jsxs)("div",{className:c.rightIcons,children:[Object(a.jsx)("div",{className:c.rightIconWrapper,onClick:function(){return Me(!1)},style:{backgroundColor:Re?"rgb(36, 36, 36)":"rgb(70, 70, 70)"},children:Object(a.jsx)(ti.a,{fontSize:"small"})}),Object(a.jsx)("div",{className:c.rightIconWrapper,onClick:function(){return Me(!0)},style:{backgroundColor:Re?"rgb(70, 70, 70)":"rgb(36, 36, 36)"},children:Object(a.jsx)(oi.a,{fontSize:"small"})}),Object(a.jsx)("div",{className:c.rightIconWrapperClose,onClick:Ue,children:Object(a.jsx)(O.a,{fontSize:"small"})})]}),Object(a.jsxs)("div",{style:{width:"100%",position:"relative"},children:[Ee&&Object(a.jsx)(U.a,{variant:"filled",severity:"info",sx:{backgroundColor:"rgb(70, 70, 70)"},style:{width:Re?"auto":"100%",position:"absolute",left:0,bottom:-48},children:Ee}),!Re&&Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(G.a,{style:{margin:"25px 0px 5px 0px"},children:Object(a.jsx)(j.a,{alt:ee,src:se?"".concat(D.m,"/").concat(se):void 0,sx:{background:je,width:120,height:120,marginRight:2,fontSize:30,zIndex:0,margin:"0 auto"},children:"".concat(Object(D.e)(ee)).concat(Object(D.e)(ae))})}),Object(a.jsx)(B.a,{primary:"".concat(Object(D.e)(ee)).concat(Object(D.q)(ee,15,1),"\n ").concat(Object(D.e)(ae)).concat(Object(D.q)(ae,15,1)),primaryTypographyProps:{color:"#dfdfdf",fontSize:20,fontWeight:500,textAlign:"center"}}),Object(a.jsx)(B.a,{primary:me,primaryTypographyProps:{color:"#ffffff",fontSize:15,fontWeight:500,textAlign:"center"}}),Object(a.jsx)(B.a,{secondary:t,secondaryTypographyProps:{color:"#dfdfdf",textAlign:"center"}}),Object(a.jsx)(B.a,{secondary:we,secondaryTypographyProps:{color:"#dfdfdf",textAlign:"center"}})]})]}),Object(a.jsx)("video",{ref:m,playsInline:!0,muted:!0,autoPlay:!0,controls:!1,style:{width:"100%",height:Re?"100vh":"auto",objectFit:"cover",backgroundColor:"rgb(36, 36, 36)"},onTimeUpdate:function(e){return Ne(Object(D.g)(e.target.currentTime))}}),Object(a.jsx)("audio",{ref:h,autoPlay:!0}),Object(a.jsxs)("div",{className:c.bottomWrapper,children:[!H&&Object(a.jsxs)("div",{className:c.bottomItem,onClick:qe,children:[Object(a.jsx)(j.a,{className:c.bottomIcon,sx:{backgroundColor:"#ffffff",color:"rgb(36, 36, 36)",width:44,height:44,zIndex:0},children:Object(a.jsx)(fi.a,{fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",className:c.titleIconBottom,children:"StartShare"})]}),Object(a.jsxs)("div",{className:c.bottomItem,onClick:function(){Y&&Y.getVideoTracks()[0]?(k(!S),Y.getVideoTracks()[0].enabled=!Y.getVideoTracks()[0].enabled):(Le("You can not ".concat(S?"enable":"disable"," Video before stream started")),setTimeout((function(){return Le("")}),1e3))},children:[Object(a.jsx)(j.a,{className:c.bottomIcon,sx:{backgroundColor:S?"#ffffff":"rgb(88, 88, 88)",color:S?"rgb(36, 36, 36)":"#ffffff",width:44,height:44,zIndex:0},children:S?Object(a.jsx)(ci.a,{fontSize:"medium"}):Object(a.jsx)(Ro.a,{fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",className:c.titleIconBottom,children:S?"Start Video":"Stop Video"})]}),Object(a.jsxs)("div",{className:c.bottomItem,children:[Object(a.jsx)(j.a,{className:c.bottomIconEndAccept,onClick:Ue,sx:{backgroundColor:"#f02a2a",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(bi.a,{fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",className:c.titleIconBottom,children:"is calling you"===t?"Decline":"End Call"})]}),"is calling you"===t&&Object(a.jsxs)("div",{className:c.bottomItem,style:{position:"relative"},children:[Object(a.jsx)("div",{className:c.ringPulsate}),Object(a.jsx)(j.a,{className:c.bottomIconEndAccept,onClick:He,sx:{backgroundColor:"#21f519",color:"#ffffff",width:44,height:44,zIndex:0},children:Object(a.jsx)(En.a,{fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",className:c.titleIconBottom,children:"Accept"})]}),Object(a.jsxs)("div",{className:c.bottomItem,children:[Object(a.jsx)(j.a,{className:c.bottomIcon,onClick:function(){Y&&Y.getAudioTracks()[0]?(z(!T),Y.getAudioTracks()[0].enabled=!Y.getAudioTracks()[0].enabled):(Le("You can not ".concat(T?"enable":"disable"," Audio before stream started")),setTimeout((function(){return Le("")}),1e3))},sx:{backgroundColor:T?"#ffffff":"rgb(88, 88, 88)",color:T?"rgb(36, 36, 36)":"#ffffff",width:44,height:44,zIndex:0},children:T?Object(a.jsx)(li.a,{fontSize:"medium"}):Object(a.jsx)(ii.a,{fontSize:"medium"})}),Object(a.jsx)(A.a,{variant:"h6",className:c.titleIconBottom,children:T?"Unmute":"Mute"})]})]})]})]})},xi=n.p+"static/media/wallpaper.8f0d1af7.jpg",gi=n.p+"static/media/wallpaperNight.63a4f24a.jpg",Oi=Object(r.a)({container:{minHeight:"100vh",maxHeight:"100vh"},centralAndRight:{display:"flex"}});t.default=function(){var e=Oi(),t=Object(i.c)(Ee),n=Object(i.c)(Lt.b),r=Object(i.c)(Et.b).companionId,l=Object(s.useRef)(null),d=Object(s.useState)(""),b=Object(o.a)(d,2),j=b[0],f=b[1],u="url(".concat(n?gi:xi,")");return Object(a.jsxs)(c.a,{className:e.container,container:!0,spacing:0,children:[Object(a.jsx)(hi,{callStatus:j,setCallStatus:f}),Object(a.jsx)(no,{chatDivRef:l}),r?Object(a.jsxs)(c.a,{item:!0,lg:9,className:e.centralAndRight,children:[Object(a.jsx)(er,{rightIsOpen:t,chatDivRef:l,companionId:r,backgroundImage:u,handleStartCall:function(){return f("requesting...")}}),Object(a.jsx)(Qr,{rightIsOpen:t,chatDivRef:l})]}):Object(a.jsx)(c.a,{item:!0,lg:9,style:{backgroundImage:u}})]})}}}]);
- //# sourceMappingURL=HomePage.374e02d8.chunk.js.map
|