dappros/ethora

View on GitHub
client-web/build/static/js/986.6df302da.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[986],{23895:function(e,n,t){t.d(n,{c:function(){return d}});var i=t(74165),r=t(15861),o=t(85554),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.ZP.createNewRoom(u.toLowerCase()),o.ZP.setOwner(u.toLowerCase()),o.ZP.roomConfig(u.toLowerCase(),{roomName:f}),o.ZP.subsribe(m),o.ZP.presenceInRoom(m),setTimeout((function(){o.ZP.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 Te}});var i,r=t(72791),o=t(20803),s=t(74165),a=t(1413),l=t(15861),d=t(70885),c=t(85554),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),I=t(57050),M=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.ZP.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)(),P=(0,d.Z)(L,2),z=P[0],K=P[1],J=r.useState(null),E=(0,d.Z)(J,2),F=E[0],U=E[1],W=Boolean(F),_=(0,r.useState)("incoming"),B=(0,d.Z)(_,2),V=B[0],O=B[1],Y=function(){U(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&&K(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:I,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)"]})})})]}),!!z&&(0,R.jsx)(M.Z,{sx:{"& button":{m:.5}},children:(0,R.jsx)("div",{style:{display:"flex",flexDirection:"column",width:"max-content",marginLeft:"45px"},children:z.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(74142),P=t(52797),z=t(50228),K=t(32232),J=t(94162),E=t(60788),F=t(40464),U=t(8440),W=t(39571),_=t(96580),B=t(77248),V=t(18267),O=t(4942),Y="/chat/",H=function(e){var n=e.room,t=e.name,i=e.chatId,r=e.setDirection,o=(0,j.k6)();return n?(0,R.jsx)(z.Z,{justifyContent:"center",alignItems:"center",style:{padding:"10px 0",maxWidth:170},children:(0,R.jsx)(y.Z,{onClick:function(){r(),o.push(Y+n.roomJid+A.Ts)},children:t})}):(0,R.jsx)(z.Z,{justifyContent:"center",alignItems:"center",style:{padding:"10px 0"},children:(0,R.jsx)(y.Z,{disabled:!i,onClick:function(){r(),o.push(Y+"none")},children:"Empty"})})},$=t(91803),q=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)(z.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)(z.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,R.jsxs)(z.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:I,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"})]})},X=t(84094),G="north",Q="west",ee="south",ne="east",te={north:"n",west:"w",south:"s",east:"e"},ie=(i={},(0,O.Z)(i,Q,ne),(0,O.Z)(i,ne,Q),(0,O.Z)(i,ee,G),(0,O.Z)(i,G,ee),i),re={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}},oe={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",p:2,outline:"none"},se=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)(re),b=(0,d.Z)(C,2),S=b[0],N=b[1],I=(0,u.K)((function(e){return e.user})),M=(0,L.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(re),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(re),n&&D()}),[n]);var T=function(e,n,t){(0,c.$I)(I.walletAddress);var i=I.firstName+" "+I.lastName+" has joined <-",r=I.firstName+" "+I.lastName+" has left ->",o={senderFirstName:I.firstName,senderLastName:I.lastName,senderWalletAddress:I.walletAddress,isSystemMessage:!0,tokenAmount:0,receiverMessageId:"",mucname:e,photoURL:I.profileImage,roomJid:n,isReply:!1,mainMessage:void 0};c.ZP.sendMessageStanza(n,t?r:i,o)},P=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),P())}),[S]),!S.roomJid&&!f)return null;var K=function(e){var t,i,r,o,s=function(e){return ie[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)(H,{name:s+":"+(null===Z||void 0===Z?void 0:Z.name),chatId:n,room:Z,setDirection:function(){h(s),w(Z)}}):(0,R.jsx)(H,{name:te[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)($.Z,{open:t,onClose:i,children:(0,R.jsx)(z.Z,{sx:oe,children:g?(0,R.jsx)(_.Z,{size:50}):(0,R.jsxs)(z.Z,{children:[(0,R.jsx)(z.Z,{sx:{bgcolor:"white",mb:"10px",borderRadius:"10px",p:2},children:(0,R.jsx)(q,{room:S,direction:f,previousRoom:Z})}),(0,R.jsxs)(z.Z,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",bgcolor:"white",borderRadius:"10px",p:2},children:[K(G),(0,R.jsxs)(z.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",alignItems:"center",justifyContent:"center"},children:[(0,R.jsx)(z.Z,{sx:{display:"flex"},children:K(Q)}),(0,R.jsx)(z.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,R.jsx)(k.Z,{sx:{color:M.palette.primary.main},children:(0,R.jsx)(X.Z,{fontSize:"large"})})}),(0,R.jsx)(z.Z,{sx:{display:"flex"},children:K(ne)})]}),K(ee)]})]})})})},ae=t(61102),le=t(14250),de=t(68438),ce=t(45473),ue=t(29823),me=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"}})]})},fe=t(24177),he=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],I=b[1],M=(0,u.K)((function(e){return e.user})),A=(0,u.K)((function(e){return e.userChatRooms})),L=(0,u.K)((function(e){return e.historyMessages})),P=(0,j.UO)().roomJID,K=L.filter((function(e){var n,t;return e.roomJID.includes(P)&&e.data.isReply&&(null===(n=e.data)||void 0===n||null===(t=n.mainMessage)||void 0===t?void 0:t.id)===w.id})),J=(0,u.K)((function(e){return e.currentUntrackedChatRoom})),E=(0,u.K)((function(e){return e.loaderArchive})),F=(0,j.k6)(),U=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,fe.Vt)(n);if(t.trim().length>0){var r={senderFirstName:M.firstName,senderLastName:M.lastName,senderWalletAddress:M.walletAddress,isSystemMessage:!1,tokenAmount:0,receiverMessageId:w.data.receiverMessageId,mucname:i.name,photoURL:M.profileImage,roomJid:i.jid,isReply:!0,mainMessage:(0,c.aq)(w),showInChannel:y,push:!0};c.ZP.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/"+J)}}),(0,R.jsx)(g.BU.Actions,{children:(0,R.jsx)(k.Z,{sx:{color:"black"},onClick:function(){return o(!1)},children:(0,R.jsx)(ue.Z,{})})})]}),(0,R.jsx)(z.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:U},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:[K.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,fe.bt)(t,e,n),message:e,onMessageButtonClick:U},e.id):(0,R.jsx)(T,{is:"Message",message:e,userJid:null===(i=c.ZP.client)||void 0===i||null===(r=i.jid)||void 0===r?void 0:r.toString()},e.id)})),K.length<=0||!m&&(0,R.jsx)(g.rN.Content,{style:{display:"flex",flexDirection:"column",justifyContent:"center",height:"100%",textAlign:"center",fontSize:"1.2em"},children:E?"Loading...":(0,R.jsx)("span",{children:!m&&"To get started, please select a chat room."})}),!E&&m&&K.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)(z.Z,{borderColor:"#D3D3D3",height:"30px",alignItems:"center",flexDirection:"row",display:"flex",width:"100%",children:[(0,R.jsx)(ce.Z,{checked:y,onChange:v,inputProps:{"aria-label":"controlled"}}),(0,R.jsx)(S.Z,{children:"Also send to room"})]}),(0,R.jsx)(me,{onChange:function(e){I(e),c.ZP.isComposing(M.walletAddress,i.jid,M.firstName+" "+M.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:U,placeholder:"Type message here",sendFile:f})]})]})},pe=t(59911),xe=t(21686),ge=t(64558),ve=t(23895),je=t(52775),ye=t(82637),Ze=t(41286),we=[1,3,5,"x"],Ce="dialog",be="clarification",ke="transfer";function Se(e){var n,t=e.open,i=e.onClose,o=(e.loading,e.message),a=e.onPrivateRoomClick,f=e.onThreadClick,h=e.onEditClick,p=(0,u.K)((function(e){return e.user})),x=(0,r.useState)(1),g=(0,d.Z)(x,2),v=g[0],j=g[1],w=(0,r.useState)(Ce),C=(0,d.Z)(w,2),b=C[0],k=C[1],N=(0,u.K)((function(e){return e.balance})),M=(0,u.K)((function(e){return e.setNewUserChatRoom})),D=(0,je.D)().showSnackbar,T=null===o||void 0===o||null===(n=o.data)||void 0===n?void 0:n.senderJID.split("/")[0],L=(0,r.useMemo)((function(){return(0,c.$I)(p.walletAddress)+A.yK}),[])===T,P=N.filter((function(e){return!e.tokenType&&e.contractAddress.length>10})),z=function(){f(),i()},K=function(){h(!0,o),i()},J=function(e){"clarify"!==e?("block"===e&&(c.ZP.blacklistUser(o.data.senderJID),c.ZP.getBlackList(),u.K.getState().removeAllInMessageHistory(o.data.senderJID)),i()):k(be)},F=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||v),e.prev=1,e.next=4,(0,m.tZ)("DPT",P[0].tokenName,t,o.data.senderWalletAddress);case 4:r=e.sent,a=P[0].tokenName===de.zl?de.w5:P[0].tokenName,l=p.firstName+" "+p.lastName,d=o.data.senderFirstName+" "+o.data.senderLastName,u="".concat(l," -> ").concat(v," ").concat(a," -> ").concat(d),f=r.data.transaction._id,c.ZP.sendSystemMessage(o.roomJID,p.firstName,p.lastName,p.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),D("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,ve.c)(p.walletAddress,o.data.senderWalletAddress,p.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:""};M(n),a(e.roomJid)}else a(e.roomJid)})).catch((function(e){console.log("openPrivateRoom Error: ",e)})),i()};return(0,R.jsx)(E.Z,{open:t,onClose:i,maxWidth:"xl",children:(0,R.jsx)(U.Z,{children:function(){if(!o)return null;switch(b){case be: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 J("block")},variant:"outlined",size:"small",children:"To block list"})]});case Ce:return(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[!L&&(0,R.jsxs)("div",{children:["Reward"," ",(0,R.jsx)("strong",{children:o.data.senderFirstName+" "+o.data.senderLastName})," ","with coins"]}),!L&&(0,R.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 0px 10px 0px"},children:we.map((function(e){return(0,R.jsxs)("div",{style:{textAlign:"center",cursor:"pointer"},onClick:function(){"number"===typeof e?F(e):k(ke)},children:[(0,R.jsx)("img",{src:I,style:{width:25,height:25},alt:"coin"}),(0,R.jsx)(S.Z,{sx:{fontWeight:"bold"},children:e})]},e)}))}),!L&&(0,R.jsx)(Z.Z,{style:{margin:"10px"}}),!L&&(0,R.jsx)(y.Z,{onClick:W,variant:"outlined",startIcon:(0,R.jsx)(xe.Z,{}),children:"Direct message"}),(0,R.jsx)(y.Z,{style:{margin:"10px 0px 0px 0px"},onClick:z,variant:"outlined",startIcon:(0,R.jsx)(ye.Z,{}),children:"Reply"}),L&&(0,R.jsx)(y.Z,{style:{margin:"10px 0px 0px 0px"},onClick:K,variant:"outlined",startIcon:(0,R.jsx)(Ze.Z,{}),children:"Edit"}),!L&&(0,R.jsx)(Z.Z,{style:{margin:"10px"}}),!L&&(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,R.jsx)(y.Z,{onClick:function(){return J("clarify")},variant:"contained",startIcon:(0,R.jsx)(ge.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 ke:return(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,R.jsx)(pe.Z,{id:"standard-basic",type:"number",label:"Enter transfer amount",variant:"standard",onChange:function(e){return j(Number(e.target.value))}}),(0,R.jsx)(y.Z,{style:{marginTop:10},onClick:function(){return F()},variant:"outlined",size:"small",children:"Send coins"})]});default:return null}}()})})}var Ne={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",boxShadow:24,p:4,borderRadius:"10px"},Ie=function(e){var n=e.open,t=e.onClose,i=e.mimetype,r=e.url;return(0,R.jsx)($.Z,{open:n,onClose:t,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,R.jsxs)(z.Z,{sx:Ne,children:[(0,R.jsx)(k.Z,{onClick:t,sx:{position:"absolute",top:0,right:0,color:"black"},children:(0,R.jsx)(ue.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}}()]})})},Me=t(95958);function Ae(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,Me.I)(),g=(0,je.D)().showSnackbar;return(0,R.jsxs)(z.Z,{children:[(0,R.jsx)(z.Z,{style:{display:h?"none":"block"},children:(0,R.jsx)(Me.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.ZP.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 Re="none"+A.Ts;function De(){var e,n,t,i,o,v,w=(0,u.K)((function(e){return e.historyMessages})),C=(0,u.K)((function(e){return e.user})),b=(0,u.K)((function(e){return e.userChatRooms})),N=(0,u.K)((function(e){return e.currentThreadViewMessage})),I=(0,u.K)((function(e){return e.setCurrentThreadViewMessage})),M=(0,u.K)((function(e){return e.loaderArchive})),O=(0,u.K)((function(e){return e.currentUntrackedChatRoom})),Y=(0,j.UO)().roomJID,H=(0,r.useState)(),$=(0,d.Z)(H,2),q=$[0],X=$[1],G=(0,r.useState)(""),Q=(0,d.Z)(G,2),ee=Q[0],ne=Q[1],te=(0,r.useState)(!0),ie=(0,d.Z)(te,2),re=ie[0],oe=ie[1],ce=(0,r.useState)(!1),me=(0,d.Z)(ce,2),pe=me[0],xe=me[1],ge=r.useState(!1),ve=(0,d.Z)(ge,2),je=ve[0],ye=ve[1],we=r.useState(!1),Ce=(0,d.Z)(we,2),be=Ce[0],ke=Ce[1],Ne=r.useState(),Me=(0,d.Z)(Ne,2),De=Me[0],Te=Me[1],Le=function(e){return I(e)},Pe=(0,r.useState)(""),ze=(0,d.Z)(Pe,2),Ke=ze[0],Je=ze[1],Ee=(0,r.useMemo)((function(){return b.find((function(e){return e.jid===Ke}))}),[b,Ke]),Fe=w.filter((function(e){return e.data.roomJid===Y+A.Ts&&(e.data.showInChannel||!e.data.isReply)})),Ue=(0,r.useState)({jid:"",name:"",room_background:"",room_thumbnail:"",users_cnt:""}),We=(0,d.Z)(Ue,2),_e=We[0],Be=We[1],Ve=(0,r.useState)({open:!1,message:null}),Oe=(0,d.Z)(Ve,2),Ye=Oe[0],He=Oe[1],$e=(0,r.useState)({open:!1,message:null}),qe=(0,d.Z)($e,2),Xe=qe[0],Ge=qe[1],Qe=(0,r.useState)(!1),en=(0,d.Z)(Qe,2),nn=en[0],tn=en[1],rn=(0,r.useState)({headline:"",description:"",open:!1}),on=(0,d.Z)(rn,2),sn=on[0],an=on[1],ln=(0,r.useState)(!0),dn=(0,d.Z)(ln,2),cn=dn[0],un=dn[1],mn=(0,u.K)((function(e){return e.activeRoomFilter})),fn=(0,u.K)((function(e){return e.setActiveRoomFilter})),hn=mn===de.hx.meta,pn=(0,j.k6)(),xn=(0,r.useRef)(null),gn=(0,L.Z)(),vn=(0,P.Z)(gn.breakpoints.down("md")),jn=(0,r.useCallback)((function(e){Mn(e[0],!1)}),[_e]),yn=(0,V.uI)({onDrop:jn,noClick:!0,maxFiles:1}).getRootProps,Zn=function(){var e=w.filter((function(e){return e.roomJID===Ke}));if(!M){var n=e[0].id;c.ZP.getPaginatedArchive(Ke,String(n),10)}};(0,r.useEffect)((function(){Y&&(kn(Y),oe(!0))}),[Y]),(0,r.useEffect)((function(){(0,m.k2)(C.walletAddress).then((function(e){X(e.data.result)}))}),[]);var wn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;He({open:e,message:n})},Cn=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Ge({open:e,message:n})},bn=function(e){pn.push("/chat/"+e.split("@")[0]),kn(e)},kn=function(e){Je(e);var n=b.filter((function(n){return n.jid===e}))[0];Be(n),u.K.getState().clearCounterChatRoom(e),u.K.getState().setCurrentUntrackedChatRoom(e);var t=w.filter((function(n){return n.roomJID===e}));if(un(!0),!M&&t.length<=10&&t.length>0){var i=t[0].id;c.ZP.getPaginatedArchive(e,String(i),50)}},Sn=function(e){var n=w.filter((function(n){return n.roomJID===e})).slice(-1);return M&&n.length<=0?"Loading...":n.length>0?n[0].body:"No messages yet"},Nn=function(e){var n=w.filter((function(n){return n.roomJID===e})).slice(-1);return n.length<=0?"":(0,f.Z)(new Date(n[0].date),"H:mm")},In=function(e){if(ee.trim().length>0){var n="";null!==q&&void 0!==q&&q.profileImage&&(n=null===q||void 0===q?void 0:q.profileImage);var t=x.sanitize(ee),i=(0,fe.Vt)(t);if(i.trim().length>0)if(be){var r={senderFirstName:C.firstName,senderLastName:C.lastName,senderWalletAddress:C.walletAddress,isSystemMessage:!1,tokenAmount:0,receiverMessageId:De.data.receiverMessageId,mucname:_e.name,photoURL:n,roomJid:Y,isReply:!1,mainMessage:void 0,push:!0};c.ZP.sendReplaceMessageStanza(O,i,De.id.toString(),r),ke(!1)}else c.ZP.sendMessage(Ke,C.firstName,C.lastName,n,C.walletAddress,"object"===typeof e?e.value:i,"object"===typeof e?e.notDisplayedValue:null)}},Mn=function(e,n){an({headline:"File is loading, please wait...",description:"",open:!0});var t=new FormData;t.append("files",e),(0,m.cT)(t).then((function(e){var t="";null!==q&&void 0!==q&&q.profileImage&&(t=null===q||void 0===q?void 0:q.profileImage),e.data.results.map(function(){var e=(0,l.Z)((0,s.Z)().mark((function e(i){var r,o;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={firstName:C.firstName,lastName:C.lastName,walletAddress:C.walletAddress,chatName:_e.name,userAvatar:t,createdAt:i.createdAt,expiresAt:i.expiresAt,fileName:i.filename,isVisible:i.isVisible,location:i.location,locationPreview:i.locationPreview,mimetype:i.mimetype,originalName:i.originalname,ownerKey:i.ownerKey,size:i.size,duration:null===i||void 0===i?void 0:i.duration,updatedAt:i.updatedAt,userId:i.userId,waveForm:"",attachmentId:i._id,wrappable:!0},o={isReply:n,mainMessage:(0,c.aq)(N),showInChannel:je},r=(0,a.Z)((0,a.Z)({},r),o),c.ZP.sendMediaMessageStanza(Ke,r),an({open:!1,description:"",headline:""});case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())})).catch((function(e){console.log(e),an({headline:"Error",description:"An error occurred while uploading the file",open:!0})})),xn.current&&(xn.current.value="")};(0,r.useEffect)((function(){var e=setTimeout((function(){c.ZP.pausedComposing(C.walletAddress,_e.jid)}),1e3);return function(){return clearTimeout(e)}}),[ee]);var An=function(){u.K.getState().setCurrentUntrackedChatRoom("")},Rn=function(){Ke&&(u.K.getState().setCurrentUntrackedChatRoom(Ke),u.K.getState().clearCounterChatRoom(Ke))};(0,r.useEffect)((function(){return O&&(Y&&"none"!==Y&&""!==Y&&O.split("@")[0]!==Y||(O.split("@")[1]?bn(O):bn(O+A.Ts))),O.split("@")[0]!==Y&&"none"!==Y&&""!==Y&&(u.K.getState().setCurrentUntrackedChatRoom(Y),bn(Y)),window.addEventListener("blur",An),window.addEventListener("focus",Rn),function(){window.removeEventListener("blur",An),window.removeEventListener("focus",Rn)}}),[Ke]),(0,r.useEffect)((function(){var e=w.filter((function(e){return e.roomJID===Ke}));if(!M&&e.length>0&&e.length<=51&&Ke&&cn){var n=e[0];e.length>=10&&e.length<15&&n.data.isSystemMessage?(un(!1),c.ZP.getPaginatedArchive(Ke,String(n.id),5)):1===e.length&&(un(!1),c.ZP.getPaginatedArchive(Ke,String(n.id),50))}0===e.length&&cn&&c.ZP.getRoomArchiveStanza(Ke,50)}),[w]);var Dn,Tn,Ln=function(e,n){ke(e),function(e){Te(e)}(n)};return(0,R.jsxs)(z.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:(Dn=b,Tn=mn,Tn===de.hx.official||Tn===de.hx.favourite?Dn.filter((function(e){return e.group===de.hx.official||e.group===de.hx.favourite})):Dn.filter((function(e){return e.group!==de.hx.official&&e.group!==de.hx.favourite}))).map((function(e){return(0,R.jsx)(g.ri,{active:e.jid===Ke,unreadCnt:e.unreadMessages,onClick:function(){bn(e.jid),xe(!1)},name:e.name,info:Sn(e.jid),lastActivityTime:Nn(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)({},yn()),{},{style:{width:"100%",height:"100%",flexDirection:"row",display:"flex"},children:[(0,R.jsxs)(g.uU,{children:[!!_e&&(0,R.jsxs)(g.BU,{style:{height:"70px"},children:[(0,R.jsx)(g.BU.Back,{}),Fe.length>0&&(0,R.jsx)(g.BU.Content,{userName:_e.name,onClick:function(){pn.push("/chatDetails/"+O)},info:w.filter((function(e){return e.roomJID===Ke})).length>0&&"Active "+(0,h.Z)((0,p.Z)(new Date(Fe.slice(-1)[0].date),0),new Date,{addSuffix:!0})}),(0,R.jsxs)(g.BU.Actions,{children:[(0,R.jsx)(Ae,{profile:q,currentRoom:Ke,roomData:_e}),(0,R.jsx)(k.Z,{sx:{color:"black"},onClick:function(){return tn(!0)},children:(0,R.jsx)(ae.Z,{})})]})]}),(0,R.jsxs)(g.rN,{style:{backgroundImage:null!==Ee&&void 0!==Ee&&Ee.room_background?"url(".concat(Ee.room_background,")"):"white",backgroundRepeat:"no-repeat",backgroundSize:"100% 100%"},loadingMore:M,onYReachStart:Zn,disableOnYReachWhenNoScroll:!0,typingIndicator:!(null===(e=b.filter((function(e){return e.jid===Ke}))[0])||void 0===e||!e.composing)&&(0,R.jsx)(g.c2,{style:{opacity:".6"},content:null===(n=b.filter((function(e){return e.jid===Ke}))[0])||void 0===n?void 0:n.composing}),children:[Fe.map((function(e,n,t){var i,r,o=(0,fe.bt)(t,e,n);return"false"===e.data.isSystemMessage?(0,R.jsx)(D,{onThreadClick:function(){return function(e){xe(!0),Le(e)}(e)},is:"Message",position:o,message:e,onMessageButtonClick:In,toggleTransferDialog:wn,onMediaMessageClick:Cn},e.id):(0,R.jsx)(T,{is:"Message",message:e,userJid:null===(i=c.ZP.client)||void 0===i||null===(r=i.jid)||void 0===r?void 0:r.toString()},e.id)})),Fe.length<=0||!Ke||Ke===Re&&(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:Ke&&Ke!==Re?null:"Choose a chat room or create one to start a conversation."})}),!M&&Ke&&Ke!==Re&&Fe.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===_e||void 0===_e||!_e.name)&&(0,R.jsxs)("div",{is:"MessageInput",children:[be&&(0,R.jsx)(Z.Z,{}),(0,R.jsx)(K.Z,{direction:"up",in:be,mountOnEnter:!0,unmountOnExit:!0,children:(0,R.jsxs)(J.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)(Ze.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===De||void 0===De?void 0:De.body})]}),(0,R.jsx)("div",{style:{display:"flex",flex:"0.05",justifyContent:"center",alignItems:"center"},children:(0,R.jsx)(k.Z,{onClick:function(){return Ln(!1,void 0)},"aria-label":"close",children:(0,R.jsx)(ue.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();Mn(t,!1)}},placeholder:"Type message here",onChange:function(e){ne(e),c.ZP.isComposing(C.walletAddress,_e.jid,C.firstName+" "+C.lastName)},onSend:In,onAttachClick:function(){return xn.current.click()}}),(0,R.jsx)("input",{type:"file",name:"file",id:"file",onChange:function(e){return Mn(e.target.files[0],!1)},ref:xn,style:{display:"none"}})]})]}),pe&&(0,R.jsx)(he,{chooseRoom:bn,currentPickedRoom:Ee,currentRoom:Ke,handleSetThreadView:function(e){return xe(e)},handleShowInChannel:function(e){return ye(e.target.checked)},isThreadView:pe,onYReachStart:Zn,profile:q,roomData:_e,sendFile:Mn,showInChannel:je,toggleMediaModal:Cn,toggleTransferDialog:wn})]}))]}),(0,R.jsx)(Se,{open:Ye.open,onClose:function(){return wn(!1)},loading:!1,onPrivateRoomClick:bn,message:Ye.message,onThreadClick:function(){xe(!0),Le(Ye.message)},onEditClick:Ln}),(0,R.jsx)(Ie,{open:Xe.open,onClose:function(){return Cn(!1)},mimetype:null===(t=Xe.message)||void 0===t||null===(i=t.data)||void 0===i?void 0:i.mimetype,url:null===(o=Xe.message)||void 0===o||null===(v=o.data)||void 0===v?void 0:v.location}),(0,R.jsxs)(E.Z,{fullScreen:vn,open:sn.open,onClose:function(){return an({open:!1,description:"",headline:""})},"aria-labelledby":"responsive-dialog-title",children:[(0,R.jsx)(F.Z,{id:"responsive-dialog-title",children:sn.headline}),(0,R.jsx)(U.Z,{children:sn.description?(0,R.jsx)(W.Z,{children:sn.description}):(0,R.jsx)(z.Z,{sx:{display:"flex",justifyContent:"center"},children:(0,R.jsx)(_.Z,{})})}),(0,R.jsx)(B.Z,{children:(0,R.jsx)(y.Z,{onClick:function(){return an({open:!1,description:"",headline:""})},autoFocus:!0,children:"Close"})})]}),(0,R.jsx)(le.z,{open:nn,link:(0,fe.C$)({roomAddress:null===Ee||void 0===Ee?void 0:Ee.jid}),onClose:function(){tn(!1)},title:"Share Chatroom"}),(0,R.jsx)(se,{open:re||hn,chatId:Ke.split("@")[0],onClose:function(){oe(!1),hn&&fn("")}})]})}function Te(){return(0,R.jsx)(o.Z,{maxWidth:"xl",style:{height:"calc(100vh - 68px)"},children:(0,R.jsx)(De,{})})}},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.6df302da.chunk.js.map