dappros/ethora

View on GitHub
client-web/build-prod/static/js/986.cc803151.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[986],{59715:function(e,n,t){t.d(n,{A:function(){return c}});t(72791);var i=t(17205),r=t(60788),o=t(77248),s=t(8440),a=t(39571),l=t(40464),d=t(80184);function c(e){var n=e.open,t=e.onClose,c=e.onDeletePress,u=e.loading,m=e.title,f=e.description,h=e.deleteButtonTitle,p=e.cancelButtonTitle;return(0,d.jsxs)(r.Z,{open:n,onClose:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,d.jsx)(l.Z,{id:"alert-dialog-title",children:m}),(0,d.jsx)(s.Z,{children:(0,d.jsx)(a.Z,{id:"alert-dialog-description",children:f})}),(0,d.jsxs)(o.Z,{children:[(0,d.jsx)(i.Z,{disabled:u,onClick:t,children:p||"Cancel"}),(0,d.jsx)(i.Z,{disabled:u,onClick:c,autoFocus:!0,color:"error",children:h||"Delete"})]})]})}},23895:function(e,n,t){t.d(n,{c:function(){return d}});var i=t(74165),r=t(15861),o=t(8343),s=t(11210),a=t(73763),l=function(e){return e?e.replace(/([A-Z])/g,"_$1").toLowerCase():"invalid string passed"},d=function(){var e=(0,r.Z)((0,i.Z)().mark((function e(n,t,r,d,c){var u,m,f,h,p;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=[n,t].sort().join("."),m=u.toLowerCase()+a.Ts,f=[r,d].sort().join(" and "),h=s.K.getState().userChatRooms,p=!1,0===h.filter((function(e){return e.jid===m})).length&&(p=!0,o.Z.createNewRoom(u.toLowerCase()),o.Z.setOwner(u.toLowerCase()),o.Z.roomConfig(u.toLowerCase(),{roomName:f}),o.Z.subsribe(m),o.Z.presenceInRoom(m),setTimeout((function(){o.Z.sendInvite(l(n),m.toLowerCase(),l(t))}),1e3)),e.abrupt("return",{roomJid:m,roomName:f,isNewRoom:p});case 7:case"end":return e.stop()}}),e)})));return function(n,t,i,r,o){return e.apply(this,arguments)}}()},96986:function(e,n,t){t.r(n),t.d(n,{default:function(){return De}});var i,r=t(72791),o=t(20803),s=t(74165),a=t(1413),l=t(15861),d=t(70885),c=t(8343),u=t(11210),m=t(47409),f=t(91482),h=t(16263),p=t(45586),x=t(78703),g=t(31128),v=t(95178),j=t(64880),y=t(17205),Z=t(81872),w=t(48928),C=t(58487),b=t(30199),k=t(13811),S=t(4565),N=t(52898),M=t(57050),I=t(52791),A=t(73763),R=t(80184),D=function(e){var n=e.message,t=e.position,i=e.onMessageButtonClick,o=e.toggleTransferDialog,s=e.onMediaMessageClick,a=e.onThreadClick,l=e.isThread,u=n.data.senderFirstName,m=n.data.senderLastName,x=n.data.senderJID.split("/")[0],D=(0,r.useMemo)((function(){var e,n;return null===(e=c.Z.client)||void 0===e||null===(n=e.jid)||void 0===n?void 0:n.toString().split("/")[0]}),[])===x,T=(0,j.k6)(),L=(0,r.useState)(),z=(0,d.Z)(L,2),K=z[0],J=z[1],E=r.useState(null),U=(0,d.Z)(E,2),F=U[0],P=U[1],W=Boolean(F),_=(0,r.useState)("incoming"),B=(0,d.Z)(_,2),V=B[0],O=B[1],Y=function(){P(null),o(!0,n)},H=function(){s(!0,n)},$=function(){var e,t,i,r,o,s,a,l,d;return(0,R.jsxs)(y.Z,{variant:"text",style:{flexDirection:"row",display:"flex",textTransform:"none",textAlign:"left"},children:[(0,R.jsx)(Z.Z,{style:{borderWidth:"3px",borderRadius:"5px",marginRight:"5px"},variant:"middle",orientation:"vertical",flexItem:!0}),(0,R.jsxs)("div",{children:[(0,R.jsxs)("strong",{style:{cursor:"pointer"},children:[(null===(e=n.data.mainMessage)||void 0===e?void 0:e.userName)||"N/A",(0,R.jsx)("br",{})]}),(null===(t=n.data.mainMessage)||void 0===t?void 0:t.imageLocation)&&A.NX[n.data.mainMessage.mimeType]&&(0,R.jsx)(w.Z,{sx:{maxWidth:200},children:(0,R.jsx)(C.Z,{onClick:H,children:(0,R.jsx)(b.Z,{style:{height:150,objectFit:"cover",objectPosition:"left"},component:"img",height:"150",image:n.data.mainMessage.imageLocation,alt:null===(i=n.data.mainMessage)||void 0===i?void 0:i.originalName})})}),(null===(r=n.data.mainMessage)||void 0===r?void 0:r.imageLocation)&&A.p2[null===(o=n.data.mainMessage)||void 0===o?void 0:o.mimeType]&&(0,R.jsxs)("video",{controls:!0,width:"200px",children:[(0,R.jsx)("source",{src:n.data.mainMessage.imageLocation,type:n.data.mainMessage.mimeType,title:n.data.mainMessage.originalName}),"Sorry, your browser doesn't support videos."]}),(null===(s=n.data.mainMessage)||void 0===s?void 0:s.imageLocation)&&A.KS[null===(a=n.data.mainMessage)||void 0===a?void 0:a.mimeType]&&(0,R.jsxs)("audio",{controls:!0,children:[(0,R.jsx)("source",{src:n.data.mainMessage.imageLocation,type:n.data.mainMessage.mimeType}),"Your browser does not support the audio element."]}),(0,R.jsx)("span",{dangerouslySetInnerHTML:{__html:null===(l=n.data)||void 0===l||null===(d=l.mainMessage)||void 0===d?void 0:d.text.replace(/\b(https?\:\/\/\S+)/gm,'<a href="$1">$1</a>')}})]})]})};return(0,r.useEffect)((function(){n.data.quickReplies&&J(JSON.parse(n.data.quickReplies)),O(D?"outgoing":"incoming")}),[]),(0,R.jsxs)("div",{is:"Message",children:[!!t.separator&&(0,R.jsx)(g.it,{children:t.separator}),(0,R.jsxs)(g.v0,{onContextMenu:n.data.isReply||l?function(){}:function(e){e.preventDefault(),Y()},style:{marginBottom:"last"===t.type||"single"===t.type?15:null},model:{sender:u+" "+m,direction:V,position:t.position},avatarPosition:D?"tr":"tl",avatarSpacer:"first"!==t.type&&"single"!==t.type,children:[("first"===t.type||"single"===t.type)&&(0,R.jsx)("img",{style:{borderRadius:"50%",boxSizing:"border-box",width:"42px",height:"42px",cursor:"pointer"},onClick:function(){return T.push("/profile/"+n.data.senderWalletAddress)},is:"Avatar",src:n.data.photoURL?n.data.photoURL:+u+" "+m,onError:function(e){var n=e.currentTarget;n.onerror=null,n.src="https://icotar.com/initials/"+u+" "+m},alt:u}),(0,R.jsxs)(g.v0.CustomContent,{children:[n.data.isReply&&!l&&(0,R.jsx)($,{}),("first"===t.type||"single"===t.type)&&(0,R.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,R.jsxs)("strong",{style:{cursor:"pointer"},onClick:function(){return T.push("/profile/"+n.data.senderWalletAddress)},children:[u," ",m,(0,R.jsx)("br",{})]}),!l&&!n.data.isReply&&(0,R.jsx)(k.Z,{"aria-label":"more",id:"long-button","aria-controls":W?"long-menu":void 0,"aria-expanded":W?"true":void 0,"aria-haspopup":"true",onClick:Y,children:(0,R.jsx)(N.Z,{})})]}),n.data.isMediafile&&!!A.NX[n.data.mimetype]&&(0,R.jsx)(w.Z,{sx:{maxWidth:200},children:(0,R.jsx)(C.Z,{onClick:H,children:(0,R.jsx)(b.Z,{style:{height:150,objectFit:"cover",objectPosition:"left"},component:"img",height:"150",image:n.data.location,alt:n.data.originalName})})}),n.data.isMediafile&&!!A.p2[n.data.mimetype]&&(0,R.jsxs)("video",{controls:!0,width:"200px",children:[(0,R.jsx)("source",{src:n.data.location,type:n.data.mimetype,title:n.data.originalName}),"Sorry, your browser doesn't support videos."]}),n.data.isMediafile&&!!A.KS[n.data.mimetype]&&(0,R.jsxs)("audio",{controls:!0,children:[(0,R.jsx)("source",{src:n.data.location,type:n.data.mimetype}),"Your browser does not support the audio element."]}),!n.data.isMediafile&&(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{dangerouslySetInnerHTML:{__html:n.body.replace(/\b(https?\:\/\/\S+)/gm,'<a href="$1">$1</a>')}}),(0,R.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:5,minWidth:200,color:"incoming"===V?"rgb(110, 169, 215)":"#c6e3fa",flexDirection:"incoming"===V?"row":"row-reverse"},children:[(0,R.jsx)("div",{style:{fontSize:12},children:(0,v.Z)(new Date,new Date(n.date))>5?(0,f.Z)(new Date(n.date),"h:mm a"):(0,h.Z)((0,p.Z)(new Date(n.date),0),new Date,{addSuffix:!0})}),n.coinsInMessage>0&&(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)("div",{style:{fontSize:12},children:null===n||void 0===n?void 0:n.coinsInMessage}),(0,R.jsx)("img",{src:M,style:{width:25,height:25},alt:"coin"})]}),n.data.isEdited&&(0,R.jsx)("div",{style:{display:"flex",alignItems:"flex-end",marginLeft:3,marginRight:3},children:(0,R.jsx)(S.Z,{fontSize:12,children:"edited"})})]})]})]}),(0,R.jsx)(g.v0.Footer,{children:n.numberOfReplies>0&&"incoming"===V&&!l&&(0,R.jsx)(y.Z,{onClick:function(){a()},variant:"text",children:(0,R.jsxs)(S.Z,{fontSize:"12px",textTransform:"none",children:[n.numberOfReplies," ",1===n.numberOfReplies?"Reply":"Replies"," (tap to review)"]})})})]}),!!K&&(0,R.jsx)(I.Z,{sx:{"& button":{m:.5}},children:(0,R.jsx)("div",{style:{display:"flex",flexDirection:"column",width:"max-content",marginLeft:"45px"},children:K.map((function(e,n){return(0,R.jsx)(y.Z,{variant:"outlined",size:"small",onClick:function(){return i(e)},children:e.name},n)}))})})]})},T=function(e){var n=e.message;e.userJid;return(0,R.jsx)("div",{style:{textAlign:"center",color:"#6ea9d7",fontSize:".8em",boxSizing:"border-box",fontFamily:"Helvetica Neue,Segoe UI,Helvetica,Arial,sans-serif"},children:n.body},n.key)},L=t(50228),z=t(32232),K=t(94162),J=t(18267),E=t(4942),U="/chat/",F=function(e){var n=e.room,t=e.name,i=e.chatId,r=e.setDirection,o=(0,j.k6)();return n?(0,R.jsx)(L.Z,{justifyContent:"center",alignItems:"center",style:{padding:"10px 0",maxWidth:170},children:(0,R.jsx)(y.Z,{onClick:function(){r(),o.push(U+n.roomJid+A.Ts)},children:t})}):(0,R.jsx)(L.Z,{justifyContent:"center",alignItems:"center",style:{padding:"10px 0"},children:(0,R.jsx)(y.Z,{disabled:!i,onClick:function(){r(),o.push(U+"none")},children:"Empty"})})},P=t(74142),W=t(91803),_=t(96580),B=function(e){var n=e.room,t=e.direction,i=e.previousRoom,r=(0,j.k6)();return null!==n&&void 0!==n&&n.name?(0,R.jsxs)(L.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,R.jsx)(S.Z,{sx:{fontWeight:"bold",fontSize:18},children:n.name}),(0,R.jsx)(S.Z,{children:n.description})]}):(0,R.jsxs)(L.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,R.jsxs)(L.Z,{sx:{alignItems:"center",display:"flex"},children:[(0,R.jsxs)(S.Z,{children:["This space is empty. You can build your own room here for"," ",(0,R.jsx)("b",{children:"120 "})]}),(0,R.jsx)("img",{src:M,style:{width:20,height:20},alt:"coin"})]}),(0,R.jsx)(y.Z,{onClick:function(){r.push("/newchat",{metaDirection:t,metaRoom:i})},children:"Create Meta Room"})]})},V=t(84094),O="north",Y="west",H="south",$="east",q={north:"n",west:"w",south:"s",east:"e"},X=(i={},(0,E.Z)(i,Y,$),(0,E.Z)(i,$,Y),(0,E.Z)(i,H,O),(0,E.Z)(i,O,H),i),G={name:"",description:"",ownerNavLinks:{west:null,east:null,north:null,south:null},ownerId:"",contractAddress:"",createdAt:new Date,_id:"",roomJid:"",updatedAt:new Date,userNavLinks:{west:null,east:null,north:null,south:null}},Q={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",p:2,outline:"none"},ee=function(e){var n=e.chatId,t=e.open,i=e.onClose,o=(0,r.useState)(""),a=(0,d.Z)(o,2),f=a[0],h=a[1],p=(0,r.useState)(!1),x=(0,d.Z)(p,2),g=x[0],v=x[1],j=(0,r.useState)(),y=(0,d.Z)(j,2),Z=y[0],w=y[1],C=(0,r.useState)(G),b=(0,d.Z)(C,2),S=b[0],N=b[1],M=(0,u.K)((function(e){return e.user})),I=(0,P.Z)(),D=function(){var e=(0,l.Z)((0,s.Z)().mark((function e(){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,(0,m.Vy)().get("/room/getRoom/"+n);case 4:t=e.sent,N(t.data.result),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),N(G),console.log(e.t0);case 12:v(!1);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){n||N(G),n&&D()}),[n]);var T=function(e,n,t){var i=M.firstName+" "+M.lastName+" has joined <-",r=M.firstName+" "+M.lastName+" has left ->",o={senderFirstName:M.firstName,senderLastName:M.lastName,senderWalletAddress:M.walletAddress,isSystemMessage:!0,tokenAmount:0,receiverMessageId:"",mucname:e,photoURL:M.profileImage,roomJid:n,isReply:!1,mainMessage:void 0};c.Z.sendMessageStanza(n,t?r:i,o)},z=function(){var e=(0,l.Z)((0,s.Z)().mark((function e(){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,m.Vy)().post("/room/join/"+n,{});case 3:t=e.sent,console.log(t.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();if((0,r.useEffect)((function(){null!==Z&&void 0!==Z&&Z.name&&T(Z.name,Z.roomJid+A.Ts,!0)}),[Z]),(0,r.useEffect)((function(){S.name&&(T(S.name,S.roomJid+A.Ts,!1),z())}),[S]),!S.roomJid&&!f)return null;var K=function(e){var t,i,r,o,s=function(e){return X[e]}(f);return function(){var e,n,t,i,r,o,s,a;return!(null!==S&&void 0!==S&&null!==(e=S.ownerNavLinks)&&void 0!==e&&e.south)&&!(null!==S&&void 0!==S&&null!==(n=S.ownerNavLinks)&&void 0!==n&&n.east)&&!(null!==S&&void 0!==S&&null!==(t=S.ownerNavLinks)&&void 0!==t&&t.west)&&!(null!==S&&void 0!==S&&null!==(i=S.ownerNavLinks)&&void 0!==i&&i.north)&&!(null!==S&&void 0!==S&&null!==(r=S.userNavLinks)&&void 0!==r&&r.south)&&!(null!==S&&void 0!==S&&null!==(o=S.userNavLinks)&&void 0!==o&&o.east)&&!(null!==S&&void 0!==S&&null!==(s=S.userNavLinks)&&void 0!==s&&s.west)&&!(null!==S&&void 0!==S&&null!==(a=S.userNavLinks)&&void 0!==a&&a.north)}()&&e===s?(0,R.jsx)(F,{name:s+":"+(null===Z||void 0===Z?void 0:Z.name),chatId:n,room:Z,setDirection:function(){h(s),w(Z)}}):(0,R.jsx)(F,{name:q[e]+":"+((null===(t=S.ownerNavLinks[e])||void 0===t?void 0:t.name)||(null===(i=S.userNavLinks[e])||void 0===i?void 0:i.name)),chatId:n,room:(null===S||void 0===S||null===(r=S.ownerNavLinks)||void 0===r?void 0:r[e])||(null===S||void 0===S||null===(o=S.userNavLinks)||void 0===o?void 0:o[e]),setDirection:function(){h(e),w(S)}})};return(0,R.jsx)(W.Z,{open:t,onClose:i,children:(0,R.jsx)(L.Z,{sx:Q,children:g?(0,R.jsx)(_.Z,{size:50}):(0,R.jsxs)(L.Z,{children:[(0,R.jsx)(L.Z,{sx:{bgcolor:"white",mb:"10px",borderRadius:"10px",p:2},children:(0,R.jsx)(B,{room:S,direction:f,previousRoom:Z})}),(0,R.jsxs)(L.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",bgcolor:"white",borderRadius:"10px",p:2},children:[K(O),(0,R.jsxs)(L.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",alignItems:"center",justifyContent:"center"},children:[(0,R.jsx)(L.Z,{sx:{display:"flex"},children:K(Y)}),(0,R.jsx)(L.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,R.jsx)(k.Z,{sx:{color:I.palette.primary.main},children:(0,R.jsx)(V.Z,{fontSize:"large"})})}),(0,R.jsx)(L.Z,{sx:{display:"flex"},children:K($)})]}),K(H)]})]})})})},ne=t(61102),te=t(14250),ie=t(68438),re=t(45473),oe=t(29823),se=function(e){var n=e.onPaste,t=e.placeholder,i=e.onChange,o=e.onSend,s=e.sendFile,a=r.useRef(null);return(0,R.jsxs)("div",{children:[(0,R.jsx)(g.Ru,{onPaste:n,placeholder:t,onChange:i,onSend:o,onAttachClick:function(){return a.current.click()}}),(0,R.jsx)("input",{type:"file",name:"file",id:"file",onChange:function(e){return s(e.target.files[0],!0)},ref:a,style:{display:"none"}})]})},ae=t(24177),le=t(59425),de=function(e){var n,t,i=e.roomData,o=e.handleSetThreadView,s=e.isThreadView,a=e.profile,l=e.currentPickedRoom,m=e.currentRoom,f=(e.onYReachStart,e.sendFile),h=e.toggleMediaModal,p=e.toggleTransferDialog,v=e.handleShowInChannel,y=e.showInChannel,w=(0,u.K)((function(e){return e.currentThreadViewMessage})),C=(0,r.useState)(""),b=(0,d.Z)(C,2),N=b[0],M=b[1],I=(0,u.K)((function(e){return e.user})),A=(0,u.K)((function(e){return e.userChatRooms})),z=(0,u.K)((function(e){return e.historyMessages})),K=(0,j.UO)().roomJID,J=z.filter((function(e){var n,t;return e.roomJID.includes(K)&&e.data.isReply&&(null===(n=e.data)||void 0===n||null===(t=n.mainMessage)||void 0===t?void 0:t.id)===w.id})),E=(0,u.K)((function(e){return e.currentUntrackedChatRoom})),U=(0,u.K)((function(e){return e.loaderArchive})),F=(0,j.k6)(),P=function(e){if(N.trim().length>0){null!==a&&void 0!==a&&a.profileImage&&(null===a||void 0===a?void 0:a.profileImage);var n=x.sanitize(N),t=(0,ae.Vt)(n);if(t.trim().length>0){var r={senderFirstName:I.firstName,senderLastName:I.lastName,senderWalletAddress:I.walletAddress,isSystemMessage:!1,tokenAmount:0,receiverMessageId:w.data.receiverMessageId,mucname:i.name,photoURL:I.profileImage,roomJid:i.jid,isReply:!0,mainMessage:(0,le.a)(w),showInChannel:y,push:!0};c.Z.sendMessageStanza(m,t,r)}}};return(0,R.jsxs)(g.uU,{style:{borderLeftWidth:"2px"},children:[!!i&&(0,R.jsxs)("div",{is:"ConversationHeader",children:[(0,R.jsxs)(g.BU,{style:{height:"70px"},children:[(0,R.jsx)(g.BU.Content,{datatype:"dad",userName:(0,R.jsxs)("div",{children:[(0,R.jsx)(S.Z,{fontWeight:"bold",children:"Thread"}),(0,R.jsx)(S.Z,{children:i.name})]}),onClick:function(){F.push("/chatDetails/"+E)}}),(0,R.jsx)(g.BU.Actions,{children:(0,R.jsx)(k.Z,{sx:{color:"black"},onClick:function(){return o(!1)},children:(0,R.jsx)(oe.Z,{})})})]}),(0,R.jsx)(L.Z,{width:"100%",padding:2,children:(0,R.jsx)("span",{children:(0,R.jsx)("div",{children:(0,R.jsx)(D,{onMediaMessageClick:h,toggleTransferDialog:p,isThread:s,is:"Message",position:{position:"single",type:"single"},message:w,onMessageButtonClick:P},w.id)})})}),(0,R.jsx)(Z.Z,{children:w.numberOfReplies})]}),(0,R.jsxs)(g.rN,{style:{backgroundImage:null!==l&&void 0!==l&&l.room_background?"url(".concat(l.room_background,")"):"white",backgroundRepeat:"no-repeat",backgroundSize:"100% 100%"},disableOnYReachWhenNoScroll:!0,typingIndicator:!(null===(n=A.filter((function(e){return e.jid===m}))[0])||void 0===n||!n.composing)&&(0,R.jsx)(g.c2,{style:{opacity:".6"},content:null===(t=A.filter((function(e){return e.jid===m}))[0])||void 0===t?void 0:t.composing}),children:[J.map((function(e,n,t){var i,r;return"false"===e.data.isSystemMessage?(0,R.jsx)(D,{onMediaMessageClick:h,toggleTransferDialog:p,isThread:!0,is:"Message",position:(0,ae.bt)(t,e,n),message:e,onMessageButtonClick:P},e.id):(0,R.jsx)(T,{is:"Message",message:e,userJid:null===(i=c.Z.client)||void 0===i||null===(r=i.jid)||void 0===r?void 0:r.toString()},e.id)})),J.length<=0||!m&&(0,R.jsx)(g.rN.Content,{style:{display:"flex",flexDirection:"column",justifyContent:"center",height:"100%",textAlign:"center",fontSize:"1.2em"},children:U?"Loading...":(0,R.jsx)("span",{children:!m&&"To get started, please select a chat room."})}),!U&&m&&J.length<=0&&(0,R.jsx)(g.rN.Content,{style:{display:"flex",flexDirection:"column",justifyContent:"center",height:"100%",textAlign:"center",fontSize:"1.2em"},children:"Message list is empty"})]}),!(null===i||void 0===i||!i.name)&&(0,R.jsxs)("div",{is:"MessageInput",children:[(0,R.jsx)(Z.Z,{}),(0,R.jsxs)(L.Z,{borderColor:"#D3D3D3",height:"30px",alignItems:"center",flexDirection:"row",display:"flex",width:"100%",children:[(0,R.jsx)(re.Z,{checked:y,onChange:v,inputProps:{"aria-label":"controlled"}}),(0,R.jsx)(S.Z,{children:"Also send to room"})]}),(0,R.jsx)(se,{onChange:function(e){M(e),c.Z.isComposing(I.walletAddress,i.jid,I.firstName+" "+I.lastName)},onPaste:function(e){var n=Array.from(e.clipboardData.items).find((function(e){return/^image\//.test(e.type)}));if(n){var t=n.getAsFile();f(t,!1)}},onSend:P,placeholder:"Type message here",sendFile:f})]})]})},ce=t(59911),ue=t(60788),me=t(8440),fe=t(21686),he=t(64558),pe=t(23895),xe=t(52775),ge=t(82637),ve=t(41286),je=t(28741),ye=[1,3,5,"x"],Ze="dialog",we="clarification",Ce="transfer";function be(e){var n,t=e.open,i=e.onClose,o=(e.loading,e.message),a=e.onPrivateRoomClick,f=e.onThreadClick,h=e.onEditClick,p=e.onDeleteClick,x=(0,u.K)((function(e){return e.user})),g=(0,r.useState)(1),v=(0,d.Z)(g,2),j=v[0],w=v[1],C=(0,r.useState)(Ze),b=(0,d.Z)(C,2),k=b[0],N=b[1],I=(0,u.K)((function(e){return e.balance})),D=(0,u.K)((function(e){return e.setNewUserChatRoom})),T=(0,xe.D)().showSnackbar,L=null===o||void 0===o||null===(n=o.data)||void 0===n?void 0:n.senderJID.split("/")[0],z=(0,r.useMemo)((function(){return(0,je.I)(x.walletAddress)+A.yK}),[])===L,K=I.filter((function(e){return!e.tokenType&&e.contractAddress.length>10})),J=function(){f(),i()},E=function(){h(!0,o),i()},U=function(){p(!0,o),i()},F=function(e){"clarify"!==e?("block"===e&&(c.Z.blacklistUser(o.data.senderJID),c.Z.getBlackList(),u.K.getState().removeAllInMessageHistory(o.data.senderJID)),i()):N(we)},P=function(){var e=(0,l.Z)((0,s.Z)().mark((function e(n){var t,r,a,l,d,u,f;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Number(n||j),e.prev=1,e.next=4,(0,m.tZ)("DPT",K[0].tokenName,t,o.data.senderWalletAddress);case 4:r=e.sent,a=K[0].tokenName===ie.zl?ie.w5:K[0].tokenName,l=x.firstName+" "+x.lastName,d=o.data.senderFirstName+" "+o.data.senderLastName,u="".concat(l," -> ").concat(j," ").concat(a," -> ").concat(d),f=r.data.transaction._id,c.Z.sendSystemMessage(o.roomJID,x.firstName,x.lastName,x.walletAddress,u,t,o.id,f),i(),e.next=19;break;case 14:e.prev=14,e.t0=e.catch(1),console.log(e.t0),T("error","An error occurred during the coin transfer."),i();case 19:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(n){return e.apply(this,arguments)}}(),W=function(){(0,pe.c)(x.walletAddress,o.data.senderWalletAddress,x.firstName,o.data.senderFirstName,o.data.senderJID).then((function(e){if(e.isNewRoom){var n={jid:e.roomJid,name:e.roomName,room_background:"none",room_thumbnail:"none",users_cnt:"2",unreadMessages:0,composing:"",toUpdate:!0,description:""};D(n),a(e.roomJid)}else a(e.roomJid)})).catch((function(e){console.log("openPrivateRoom Error: ",e)})),i()};return(0,R.jsx)(ue.Z,{open:t,onClose:i,maxWidth:"xl",children:(0,R.jsx)(me.Z,{children:function(){if(!o)return null;switch(k){case we:return(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:["Are you sure you want to block the user?",(0,R.jsx)(y.Z,{onClick:function(){return F("block")},variant:"outlined",size:"small",children:"To block list"})]});case Ze:return(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[!z&&(0,R.jsxs)("div",{children:["Reward"," ",(0,R.jsx)("strong",{children:o.data.senderFirstName+" "+o.data.senderLastName})," ","with coins"]}),!z&&(0,R.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 0px 10px 0px"},children:ye.map((function(e){return(0,R.jsxs)("div",{style:{textAlign:"center",cursor:"pointer"},onClick:function(){"number"===typeof e?P(e):N(Ce)},children:[(0,R.jsx)("img",{src:M,style:{width:25,height:25},alt:"coin"}),(0,R.jsx)(S.Z,{sx:{fontWeight:"bold"},children:e})]},e)}))}),!z&&(0,R.jsx)(Z.Z,{style:{margin:"10px"}}),!z&&(0,R.jsx)(y.Z,{onClick:W,variant:"outlined",startIcon:(0,R.jsx)(fe.Z,{}),children:"Direct message"}),(0,R.jsx)(y.Z,{style:{margin:"10px 0px 0px 0px"},onClick:J,variant:"outlined",startIcon:(0,R.jsx)(ge.Z,{}),children:"Reply"}),z&&(0,R.jsx)(y.Z,{style:{margin:"10px 0px 0px 0px"},onClick:E,variant:"outlined",startIcon:(0,R.jsx)(ve.Z,{}),children:"Edit"}),z&&(0,R.jsx)(y.Z,{style:{margin:"10px 0px 0px 0px"},onClick:U,variant:"outlined",startIcon:(0,R.jsx)(ve.Z,{}),children:"Delete"}),!z&&(0,R.jsx)(Z.Z,{style:{margin:"10px"}}),!z&&(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,R.jsx)(y.Z,{onClick:function(){return F("clarify")},variant:"contained",startIcon:(0,R.jsx)(he.Z,{}),children:"Block this user"}),(0,R.jsx)(S.Z,{style:{textAlign:"center"},variant:"caption",display:"block",gutterBottom:!0,children:"Stop seeing this user."})]})]});case Ce:return(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,R.jsx)(ce.Z,{id:"standard-basic",type:"number",label:"Enter transfer amount",variant:"standard",onChange:function(e){return w(Number(e.target.value))}}),(0,R.jsx)(y.Z,{style:{marginTop:10},onClick:function(){return P()},variant:"outlined",size:"small",children:"Send coins"})]});default:return null}}()})})}var ke={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:"10px"},Se=function(e){var n=e.open,t=e.onClose,i=e.mimetype,r=e.url;return(0,R.jsx)(W.Z,{open:n,onClose:t,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,R.jsxs)(L.Z,{sx:ke,children:[(0,R.jsx)(k.Z,{onClick:t,sx:{position:"absolute",top:0,right:0,color:"black"},children:(0,R.jsx)(oe.Z,{})}),function(){switch(i){case"image/jpeg":case"image/png":case"image/jpg":return(0,R.jsx)("img",{src:r,alt:"image1",style:{maxWidth:"100%",maxHeight:"90vh"}});default:return null}}()]})})},Ne=t(95958);function Me(e){var n=e.profile,t=e.currentRoom,i=e.roomData,o=(0,u.K)((function(e){return e.user})),a=(0,r.useState)(!1),f=(0,d.Z)(a,2),h=f[0],p=f[1],x=(0,Ne.I)(),g=(0,xe.D)().showSnackbar;return(0,R.jsxs)(L.Z,{children:[(0,R.jsx)(L.Z,{style:{display:h?"none":"block"},children:(0,R.jsx)(Ne.h,{recorderControls:x,onRecordingComplete:function(e){p(!0);var r=new FormData;r.append("files",e),(0,m.cT)(r).then((function(e){var r="";null!==n&&void 0!==n&&n.profileImage&&(r=null===n||void 0===n?void 0:n.profileImage),e.data.results.map(function(){var e=(0,l.Z)((0,s.Z)().mark((function e(n){var a;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={firstName:o.firstName,lastName:o.lastName,walletAddress:o.walletAddress,chatName:i.name,userAvatar:r,createdAt:n.createdAt,expiresAt:n.expiresAt,fileName:n.filename,isVisible:n.isVisible,location:n.location,locationPreview:n.locationPreview,mimetype:n.mimetype,originalName:n.originalname,ownerKey:n.ownerKey,size:n.size,duration:null===n||void 0===n?void 0:n.duration,updatedAt:n.updatedAt,userId:n.userId,waveForm:"",attachmentId:n._id,wrappable:!0},c.Z.sendMediaMessageStanza(t,a);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())})).catch((function(e){console.log(e),g("error","An error occurred while loading your audio.")})),p(!1)}})}),h&&(0,R.jsx)(_.Z,{color:"secondary",size:"20px"})]})}var Ie=t(59715),Ae="none"+A.Ts;function Re(){var e,n,t,i,o,v,y=(0,u.K)((function(e){return e.historyMessages})),w=(0,u.K)((function(e){return e.user})),C=(0,u.K)((function(e){return e.userChatRooms})),b=(0,u.K)((function(e){return e.currentThreadViewMessage})),N=(0,u.K)((function(e){return e.setCurrentThreadViewMessage})),M=(0,u.K)((function(e){return e.loaderArchive})),I=(0,u.K)((function(e){return e.currentUntrackedChatRoom})),E=(0,j.UO)().roomJID,U=(0,r.useState)(),F=(0,d.Z)(U,2),P=F[0],W=F[1],_=(0,r.useState)(""),B=(0,d.Z)(_,2),V=B[0],O=B[1],Y=(0,r.useState)(!0),H=(0,d.Z)(Y,2),$=H[0],q=H[1],X=(0,r.useState)(!1),G=(0,d.Z)(X,2),Q=G[0],re=G[1],se=r.useState(!1),ce=(0,d.Z)(se,2),ue=ce[0],me=ce[1],fe=r.useState(!1),he=(0,d.Z)(fe,2),pe=he[0],ge=he[1],je=r.useState(),ye=(0,d.Z)(je,2),Ze=ye[0],we=ye[1],Ce=r.useState(!1),ke=(0,d.Z)(Ce,2),Ne=ke[0],Re=ke[1],De=r.useState(),Te=(0,d.Z)(De,2),Le=Te[0],ze=Te[1],Ke=function(e){return N(e)},Je=function(){Re(!1),ze(null)},Ee=(0,r.useState)(""),Ue=(0,d.Z)(Ee,2),Fe=Ue[0],Pe=Ue[1],We=(0,r.useMemo)((function(){return C.find((function(e){return e.jid===Fe}))}),[C,Fe]),_e=y.filter((function(e){return e.data.roomJid===E+A.Ts&&(e.data.showInChannel||!e.data.isReply)})),Be=(0,r.useState)({jid:"",name:"",room_background:"",room_thumbnail:"",users_cnt:""}),Ve=(0,d.Z)(Be,2),Oe=Ve[0],Ye=Ve[1],He=(0,r.useState)({open:!1,message:null}),$e=(0,d.Z)(He,2),qe=$e[0],Xe=$e[1],Ge=(0,r.useState)({open:!1,message:null}),Qe=(0,d.Z)(Ge,2),en=Qe[0],nn=Qe[1],tn=(0,r.useState)(!1),rn=(0,d.Z)(tn,2),on=rn[0],sn=rn[1],an=(0,r.useState)(!1),ln=(0,d.Z)(an,2),dn=ln[0],cn=ln[1],un=(0,r.useState)(!0),mn=(0,d.Z)(un,2),fn=mn[0],hn=mn[1],pn=(0,u.K)((function(e){return e.activeRoomFilter})),xn=(0,u.K)((function(e){return e.setActiveRoomFilter})),gn=pn===ie.hx.meta,vn=(0,j.k6)(),jn=(0,r.useRef)(null),yn=(0,xe.D)().showSnackbar,Zn=(0,r.useCallback)((function(e){Rn(e[0],!1)}),[Oe]),wn=(0,J.uI)({onDrop:Zn,noClick:!0,maxFiles:1}).getRootProps,Cn=function(){var e=y.filter((function(e){return e.roomJID===Fe}));if(!M){var n=e[0].id;c.Z.getPaginatedArchive(Fe,String(n),10)}};(0,r.useEffect)((function(){E&&(Nn(E),q(!0))}),[E]),(0,r.useEffect)((function(){(0,m.k2)(w.walletAddress).then((function(e){W(e.data.result)}))}),[]);var bn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Xe({open:e,message:n})},kn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;nn({open:e,message:n})},Sn=function(e){vn.push("/chat/"+e.split("@")[0]),Nn(e)},Nn=function(e){Pe(e);var n=C.filter((function(n){return n.jid===e}))[0];Ye(n),u.K.getState().clearCounterChatRoom(e),u.K.getState().setCurrentUntrackedChatRoom(e);var t=y.filter((function(n){return n.roomJID===e}));if(hn(!0),!M&&t.length<=10&&t.length>0){var i=t[0].id;c.Z.getPaginatedArchive(e,String(i),50)}},Mn=function(e){var n=y.filter((function(n){return n.roomJID===e})).slice(-1);return M&&n.length<=0?"Loading...":n.length>0?n[0].body:"No messages yet"},In=function(e){var n=y.filter((function(n){return n.roomJID===e})).slice(-1);return n.length<=0?"":(0,f.Z)(new Date(n[0].date),"H:mm")},An=function(e){if(V.trim().length>0){var n="";null!==P&&void 0!==P&&P.profileImage&&(n=null===P||void 0===P?void 0:P.profileImage);var t=x.sanitize(V),i=(0,ae.Vt)(t);if(i.trim().length>0)if(pe){var r={senderFirstName:w.firstName,senderLastName:w.lastName,senderWalletAddress:w.walletAddress,isSystemMessage:!1,tokenAmount:0,receiverMessageId:Ze.data.receiverMessageId,mucname:Oe.name,photoURL:n,roomJid:E,isReply:!1,mainMessage:void 0,push:!0};c.Z.sendReplaceMessageStanza(I,i,Ze.id.toString(),r),ge(!1)}else c.Z.sendMessage(Fe,w.firstName,w.lastName,n,w.walletAddress,"object"===typeof e?e.value:i,"object"===typeof e?e.notDisplayedValue:null)}},Rn=function(){var e=(0,l.Z)((0,s.Z)().mark((function e(n,t){var i,r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=new FormData).append("files",n),cn(!0),e.prev=3,e.next=6,(0,m.cT)(i);case 6:r=e.sent,o="",null!==P&&void 0!==P&&P.profileImage&&(o=null===P||void 0===P?void 0:P.profileImage),r.data.results.map(function(){var e=(0,l.Z)((0,s.Z)().mark((function e(n){var i,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i={firstName:w.firstName,lastName:w.lastName,walletAddress:w.walletAddress,chatName:Oe.name,userAvatar:o,createdAt:n.createdAt,expiresAt:n.expiresAt,fileName:n.filename,isVisible:n.isVisible,location:n.location,locationPreview:n.locationPreview,mimetype:n.mimetype,originalName:n.originalname,ownerKey:n.ownerKey,size:n.size,duration:null===n||void 0===n?void 0:n.duration,updatedAt:n.updatedAt,userId:n.userId,waveForm:"",attachmentId:n._id,wrappable:!0,roomJid:Fe},r={isReply:t,mainMessage:t?(0,le.a)(b):void 0,showInChannel:ue},c.Z.sendMediaMessageStanza(Fe,(0,a.Z)((0,a.Z)({},i),r));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(3),yn("error","Cannot upload file");case 15:jn.current&&(jn.current.value=""),cn(!1);case 17:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(n,t){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){var e=setTimeout((function(){c.Z.pausedComposing(w.walletAddress,Oe.jid)}),1e3);return function(){return clearTimeout(e)}}),[V]);var Dn=function(){u.K.getState().setCurrentUntrackedChatRoom("")},Tn=function(){Fe&&(u.K.getState().setCurrentUntrackedChatRoom(Fe),u.K.getState().clearCounterChatRoom(Fe))};(0,r.useEffect)((function(){return I&&(E&&"none"!==E&&""!==E&&I.split("@")[0]!==E||(I.split("@")[1]?Sn(I):Sn(I+A.Ts))),I.split("@")[0]!==E&&"none"!==E&&""!==E&&(u.K.getState().setCurrentUntrackedChatRoom(E),Sn(E)),window.addEventListener("blur",Dn),window.addEventListener("focus",Tn),function(){window.removeEventListener("blur",Dn),window.removeEventListener("focus",Tn)}}),[Fe]),(0,r.useEffect)((function(){var e=y.filter((function(e){return e.roomJID===Fe}));if(!M&&e.length>0&&e.length<=51&&Fe&&fn){var n=e[0];e.length>=10&&e.length<15&&n.data.isSystemMessage?(hn(!1),c.Z.getPaginatedArchive(Fe,String(n.id),5)):1===e.length&&(hn(!1),c.Z.getPaginatedArchive(Fe,String(n.id),50))}0===e.length&&fn&&"online"===c.Z.client.status&&c.Z.getRoomArchiveStanza(Fe,50)}),[y]);var Ln,zn,Kn=function(e,n){ge(e),function(e){we(e)}(n)};return(0,R.jsxs)(L.Z,{style:{paddingBlock:"20px",height:"100%"},children:[(0,R.jsxs)(g.tz,{responsive:!0,children:[(0,R.jsxs)(g.YE,{position:"left",scrollable:!1,children:[(0,R.jsx)(g.ol,{placeholder:"Search..."}),(0,R.jsx)(g.p7,{loading:M,children:(Ln=C,zn=pn,zn===ie.hx.official||zn===ie.hx.favourite?Ln.filter((function(e){return e.group===ie.hx.official||e.group===ie.hx.favourite})):Ln.filter((function(e){return e.group!==ie.hx.official&&e.group!==ie.hx.favourite}))).map((function(e){return(0,R.jsx)(g.ri,{active:e.jid===Fe,unreadCnt:e.unreadMessages,onClick:function(){Sn(e.jid),re(!1)},name:e.name,info:Mn(e.jid),lastActivityTime:In(e.jid),children:(0,R.jsx)(g.qE,{src:"none"!==e.room_thumbnail?e.room_thumbnail:"https://icotar.com/initials/"+e.name})},e.jid)}))})]}),(0,R.jsxs)("div",(0,a.Z)((0,a.Z)({},wn()),{},{style:{width:"100%",height:"100%",flexDirection:"row",display:"flex"},children:[(0,R.jsxs)(g.uU,{children:[!!Oe&&(0,R.jsxs)(g.BU,{style:{height:"70px"},children:[(0,R.jsx)(g.BU.Back,{}),_e.length>0&&(0,R.jsx)(g.BU.Content,{userName:Oe.name,onClick:function(){vn.push("/chatDetails/"+I)},info:y.filter((function(e){return e.roomJID===Fe})).length>0&&"Active "+(0,h.Z)((0,p.Z)(new Date(_e.slice(-1)[0].date),0),new Date,{addSuffix:!0})}),(0,R.jsxs)(g.BU.Actions,{children:[(0,R.jsx)(Me,{profile:P,currentRoom:Fe,roomData:Oe}),(0,R.jsx)(k.Z,{sx:{color:"black"},onClick:function(){return sn(!0)},children:(0,R.jsx)(ne.Z,{})})]})]}),(0,R.jsxs)(g.rN,{style:{backgroundImage:null!==We&&void 0!==We&&We.room_background?"url(".concat(We.room_background,")"):"white",backgroundRepeat:"no-repeat",backgroundSize:"100% 100%"},loadingMore:M||dn,onYReachStart:Cn,disableOnYReachWhenNoScroll:!0,typingIndicator:!(null===(e=C.filter((function(e){return e.jid===Fe}))[0])||void 0===e||!e.composing)&&(0,R.jsx)(g.c2,{style:{opacity:".6"},content:null===(n=C.filter((function(e){return e.jid===Fe}))[0])||void 0===n?void 0:n.composing}),children:[_e.map((function(e,n,t){var i,r,o=(0,ae.bt)(t,e,n);return"false"===e.data.isSystemMessage?(0,R.jsx)(D,{onThreadClick:function(){return function(e){re(!0),Ke(e)}(e)},is:"Message",position:o,message:e,onMessageButtonClick:An,toggleTransferDialog:bn,onMediaMessageClick:kn},e.id):(0,R.jsx)(T,{is:"Message",message:e,userJid:null===(i=c.Z.client)||void 0===i||null===(r=i.jid)||void 0===r?void 0:r.toString()},e.id)})),_e.length<=0||!Fe||Fe===Ae&&(0,R.jsx)(g.rN.Content,{style:{display:"flex",flexDirection:"column",justifyContent:"center",height:"100%",textAlign:"center",fontSize:"1.2em"},children:M?"Loading...":(0,R.jsx)("span",{children:Fe&&Fe!==Ae?null:"Choose a chat room or create one to start a conversation."})}),!M&&Fe&&Fe!==Ae&&_e.length<=0&&(0,R.jsx)(g.rN.Content,{style:{display:"flex",flexDirection:"column",justifyContent:"center",height:"100%",textAlign:"center",fontSize:"1.2em"},children:"Message list is empty"})]}),!(null===Oe||void 0===Oe||!Oe.name)&&(0,R.jsxs)("div",{is:"MessageInput",children:[pe&&(0,R.jsx)(Z.Z,{}),(0,R.jsx)(z.Z,{direction:"up",in:pe,mountOnEnter:!0,unmountOnExit:!0,children:(0,R.jsxs)(K.Z,{display:"flex",height:"50px",width:"100%",direction:"row",children:[(0,R.jsx)("div",{style:{display:"flex",flex:"0.05",justifyContent:"center",alignItems:"center"},children:(0,R.jsx)(ve.Z,{color:"info"})}),(0,R.jsxs)("div",{style:{display:"flex",flex:"0.90",flexDirection:"column"},children:[(0,R.jsx)(S.Z,{color:"#1976d2",fontWeight:"bold",children:"Edit Message"}),(0,R.jsx)(S.Z,{children:null===Ze||void 0===Ze?void 0:Ze.body})]}),(0,R.jsx)("div",{style:{display:"flex",flex:"0.05",justifyContent:"center",alignItems:"center"},children:(0,R.jsx)(k.Z,{onClick:function(){return Kn(!1,void 0)},"aria-label":"close",children:(0,R.jsx)(oe.Z,{})})})]})}),(0,R.jsx)(g.Ru,{onPaste:function(e){var n=Array.from(e.clipboardData.items).find((function(e){return/^image\//.test(e.type)}));if(n){var t=n.getAsFile();Rn(t,!1)}},placeholder:"Type message here",onChange:function(e){O(e),c.Z.isComposing(w.walletAddress,Oe.jid,w.firstName+" "+w.lastName)},onSend:An,onAttachClick:function(){return jn.current.click()}}),(0,R.jsx)("input",{type:"file",name:"file",id:"file",onChange:function(e){return Rn(e.target.files[0],!1)},ref:jn,style:{display:"none"}})]})]}),Q&&(0,R.jsx)(de,{chooseRoom:Sn,currentPickedRoom:We,currentRoom:Fe,handleSetThreadView:function(e){return re(e)},handleShowInChannel:function(e){return me(e.target.checked)},isThreadView:Q,onYReachStart:Cn,profile:P,roomData:Oe,sendFile:Rn,showInChannel:ue,toggleMediaModal:kn,toggleTransferDialog:bn})]}))]}),(0,R.jsx)(be,{open:qe.open,onClose:function(){return bn(!1)},loading:!1,onPrivateRoomClick:Sn,message:qe.message,onThreadClick:function(){re(!0),Ke(qe.message)},onEditClick:Kn,onDeleteClick:function(e,n){Re(e),function(e){ze(e)}(n)}}),(0,R.jsx)(Se,{open:en.open,onClose:function(){return kn(!1)},mimetype:null===(t=en.message)||void 0===t||null===(i=t.data)||void 0===i?void 0:i.mimetype,url:null===(o=en.message)||void 0===o||null===(v=o.data)||void 0===v?void 0:v.location}),(0,R.jsx)(Ie.A,{open:Ne,onClose:Je,onDeletePress:function(){u.K.getState().deleteMessage(Le.id),c.Z.deleteMessageStanza(I,Le.id.toString()),Je()},description:"Are you sure you want to delete this message.",title:"Delete message"}),(0,R.jsx)(te.z,{open:on,link:(0,ae.C$)({roomAddress:null===We||void 0===We?void 0:We.jid}),onClose:function(){sn(!1)},title:"Share Chatroom"}),(0,R.jsx)(ee,{open:$||gn,chatId:Fe.split("@")[0],onClose:function(){q(!1),gn&&xn("")}})]})}function De(){return(0,R.jsx)(o.Z,{maxWidth:"xl",style:{height:"calc(100vh - 68px)"},children:(0,R.jsx)(Re,{})})}},14250:function(e,n,t){t.d(n,{z:function(){return m}});t(72791);var i=t(60788),r=t(40464),o=t(17205),s=t(13811),a=t(52791),l=t(80925),d=t(24177),c=t(29823),u=t(80184),m=function(e){var n=e.title,t=e.open,m=e.link,f=e.onClose;return(0,u.jsxs)(i.Z,{maxWidth:!1,open:t,onClose:f,children:[!!n&&(0,u.jsx)(r.Z,{sx:{padding:"0 24px",paddingTop:"20px"},children:n}),(0,u.jsxs)(a.Z,{sx:{padding:"20px"},children:[(0,u.jsx)(l.Z,{size:256,style:{height:"50vh",maxWidth:"100%",width:"100%"},value:m,viewBox:"0 0 256 256"}),(0,u.jsxs)(a.Z,{sx:{boxShadow:"0px 0px 10px -5px rgba(0,0,0,0.75)",borderRadius:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",pl:"10px",my:"10px"},children:[(0,u.jsx)("span",{children:(0,d.aS)(m,50)}),(0,u.jsx)(o.Z,{variant:"contained",sx:{borderRadius:"10px",marginLeft:"5px"},onClick:function(){return navigator.clipboard.writeText(m)},children:"Copy"})]}),(0,u.jsx)(s.Z,{onClick:f,sx:{color:"black",position:"absolute",top:10,right:10,fontSize:"30px"},children:(0,u.jsx)(c.Z,{fontSize:"inherit"})})]})]})}}}]);
//# sourceMappingURL=986.cc803151.chunk.js.map