1"use strict";(self.webpackChunkmy_public_inbox_spa=self.webpackChunkmy_public_inbox_spa||[]).push([[5164],{94598(e,s,t){t.d(s,{A:()=>B});var a=t(9950),i=t(67818),n=t(7009),o=t(66699),r=t(18216),l=t(82053),d=t(95505),c=t(97878),p=t(39287),h=t(79708),m=t(94894),u=t(25333),x=t(31548),g=t(13151),f=t(66355),A=t.n(f),b=t(30817),j=t(75708),y=t(25214),v=t(39666),C=t(97795),D=t(44414);class w extends a.Component{constructor(e){super(e);const{t:s}=this.props;this.state={processing:!1,progress:0,showDeleteDialog:!1}}download(e){const{t:s,quickMode:t}=this.props,a=e;if(this.setState({processing:!0,progress:0}),a.urlAttachment)return b.i.downloadFileFromUri(a.urlAttachment,e.filename||"attachment"),j.A.show("info",s("MailDashboard.Attachments.DownloadInfo",{filename:e.filename})),void this.setState({processing:!1,progress:100});if(t&&!0===t){const{link:t}=this.props.params;n.A.quickResponseApi.download(t||null,new m.WNj({fileId:e.fileId})).then(t=>{t&&t.downloadUri?(b.i.downloadFileFromUri(t.downloadUri,t.originalFileName),j.A.show("info",s("MailDashboard.Attachments.DownloadInfo",{filename:e.filename}))):j.A.show("error",s("MailDashboard.Attachments.DownloadFailedInfo",{filename:t.originalFileName||"Unknown file"}))}).catch(t=>{j.A.show("error",s("VideoHellos.MyRequests.DownloadFailedInfo",{filename:e.filename}))}).finally(()=>this.setState({processing:!1,progress:100}))}else n.A.customAttachmentsApi.download(new m.WNj({fileId:e.fileId}),s=>{this.setState({progress:Math.round(100*s.loaded/e.fileSize)})}).then(t=>{t?C.M.handleResponse(t.malwareStatus,e.filename||"Unknown file",()=>{t.downloadUri?(b.i.downloadFileFromUri(t.downloadUri,t.originalFileName),j.A.show("info",s("MailDashboard.Attachments.DownloadInfo",{filename:e.filename}))):j.A.show("error",s("MailDashboard.Attachments.DownloadFailedInfo",{filename:t.originalFileName||"Unknown file"}))}):j.A.show("error",s("MailDashboard.Attachments.DownloadFailedInfo",{filename:"Unknown file"}))}).catch(t=>{j.A.show("error",s("VideoHellos.MyRequests.DownloadFailedInfo",{filename:e.filename}))}).finally(()=>this.setState({processing:!1,progress:100}))}render(){const{t:e,classes:s,file:t,canDelete:a,onDelete:n}=this.props,{processing:o,progress:d,showDeleteDialog:c}=this.state;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(r.A,{variant:"outlined",className:s.file,color:"primary",onClick:e=>{e.stopPropagation(),e.preventDefault(),this.download(t)},children:[(0,D.jsx)(u.A,{onClick:e=>{e.stopPropagation(),e.preventDefault(),this.download(t)},size:"small",disabled:o,className:s.middle,children:(0,D.jsx)(x.A,{fontSize:"small",color:"primary"})}),(0,D.jsxs)("span",{className:s.compactBlock,children:[(0,D.jsx)(l.A,{variant:"body2",color:"textSecondary",noWrap:!0,component:"span",className:s.filename,title:t.filename,children:(0,D.jsxs)("span",{className:s.middle,children:[" ",t.filename," \xa0"]})}),(0,D.jsxs)(l.A,{variant:"body2",color:"textSecondary",component:"span",className:s.middle,children:["(",A()(t.fileSize),")\xa0"]}),o&&(0,D.jsx)("div",{className:s.processingBlock,children:(0,D.jsx)(M,{variant:"determinate",className:s.middle,value:d})})]}),a&&(0,D.jsx)(u.A,{onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showDeleteDialog:!0})},size:"small",disabled:o,className:s.middle,children:(0,D.jsx)(g.A,{htmlColor:"#999",fontSize:"small"})})]}),(0,D.jsx)(y.A,{isOpen:c,title:e("MailDashboard.Attachments.DialogDeleteTitle"),acceptButtonText:e("MailDashboard.Attachments.DialogDeleteButton"),onClose:e=>{!0===e&&n&&n(t),this.setState({showDeleteDialog:!1})},children:(0,D.jsxs)("div",{style:{textAlign:"center"},children:[(0,D.jsx)(l.A,{variant:"body1",color:"textSecondary",children:(0,D.jsx)(i.x6,{i18nKey:"MailDashboard.Attachments.DeleteAttachmentInfo",values:{filename:t.filename}})}),(0,D.jsx)(l.A,{variant:"body1",color:"textPrimary",children:e("Common.AreYouSure","\xbfEst\xe1s seguro?")})]})})]})}}const M=(0,p.A)(e=>({root:{height:2,borderRadius:0},colorPrimary:{backgroundColor:"#EEEEEE"},bar:{borderRadius:0,backgroundColor:"#b11258"}}))(o.A),S=((0,d.A)((0,c.A)({})),(0,v.y)((0,i.CI)()((0,p.A)({processingBlock:{position:"absolute",bottom:"1",width:"100%"},compactBlock:{display:"inline-block",position:"relative"},middle:{verticalAlign:"middle !important"},file:{verticalAlign:"bottom",display:"inline-block",border:"1px solid #aaa",borderRadius:"4px",padding:"0.025em 0.25em",margin:"0em 0.5em 0.65em 0em",overflow:"hidden"},filename:{display:"inline-block",verticalAlign:"middle !important",maxWidth:"200px",padding:"0 0.25em"}})(w))));var N=t(97978),k=t(89379),F=t(80045),R=t(19910);const P=["draftId","onclose"],I=(0,i.CI)()((0,p.A)(()=>({}))(e=>{const{draftId:s,onclose:t}=e,i=(0,F.A)(e,P),o=(0,a.useCallback)(async e=>n.A.attachmentsApi.delete(e.fileId),[]),r=(0,a.useCallback)(async(e,s)=>n.A.attachmentsApi.upload(e,s),[]),l=(0,a.useCallback)((e,s)=>{t(e,s,null)},[t]);return(0,D.jsx)(R.A,(0,k.A)((0,k.A)({contextId:s,uploadApi:r,deleteApi:o,showCostLogic:!1},i),{},{onClose:l}))}));var T=t(18145);class E extends a.Component{constructor(e){super(e);const{t:s}=this.props;this.state={progress:0,fileInfos:[],dropZoneOpen:!1}}componentDidMount(){const{mailId:e,draftId:s,onAttachmentChange:t,freeOfCharge:a,temposPerAttachment:i}=this.props,o=this.getLocalSmtpAttachments(this.props.attachments);var r;e||s?(s?n.A.attachmentsApi.get(null,s):n.A.attachmentsApi.get(e,null)).then(e=>{!a&&i&&(null===e||void 0===e||e.map((e,s)=>{e.cost=i}));const s=this.limitAttachments([...null!==e&&void 0!==e?e:[],...o]);this.setState({fileInfos:s},()=>{t&&t(this.state.fileInfos)})}):this.setState({fileInfos:this.limitAttachments(null!==(r=this.props.attachments)&&void 0!==r?r:[])})}componentDidUpdate(e){if(e.attachments!==this.props.attachments){const e=this.getLocalSmtpAttachments(this.props.attachments);if(this.props.draftId||this.props.mailId){const s=this.state.fileInfos.filter(e=>!e.urlAttachment);this.setState({fileInfos:this.limitAttachments([...s,...e])})}else{var s;this.setState({fileInfos:this.limitAttachments(null!==(s=this.props.attachments)&&void 0!==s?s:[])})}}}componentWillUnmount(){}getLocalSmtpAttachments(e){return(null!==e&&void 0!==e?e:[]).filter(e=>!!e.urlAttachment)}isSmtpLocalAttachment(e){return!!e.urlAttachment}limitAttachments(e){var s;const{t:t}=this.props,a=null!==(s=this.props.maxFiles)&&void 0!==s?s:6;return e.length<=a?e:(j.A.show("warning",t("MailDashboard.Attachments.MaxExceededWarning","Se han cargado solo los primeros {{max}} adjuntos permitidos.",{max:a})),e.slice(0,a))}handleOnDelete(e){const{onAttachmentChange:s,t:t}=this.props;if(this.isSmtpLocalAttachment(e)){const t=this.state.fileInfos.filter(s=>s.fileId!=e.fileId);return void this.setState({fileInfos:t},()=>{s&&s(this.state.fileInfos)})}n.A.attachmentsApi.delete(e.fileId).then(a=>{if(a&&!0===a.deleted){var i,n,o,r=null===(i=this.state.fileInfos)||void 0===i?void 0:i.slice();r=null===(n=r)||void 0===n?void 0:n.filter(s=>s.fileId!=e.fileId),j.A.show("success",t("MailDashboard.Attachments.FileDeletedMessage",{filename:e.filename})),this.setState({fileInfos:null!==(o=r)&&void 0!==o?o:[]},()=>{s&&s(this.state.fileInfos)})}}).catch(e=>j.A.show("error",t("MailDashboard.Attachments.CantDelete")))}render(){var e;const{t:s,classes:t,draftId:a,mailId:i,maxFiles:o,onAttachmentChange:d,freeOfCharge:c,temposPerAttachment:p}=this.props,{progress:m,fileInfos:u,dropZoneOpen:x}=this.state,g=null!==o&&void 0!==o?o:6;return(0,D.jsx)("div",{className:"mail-attachments-view",children:(0,D.jsxs)("div",{className:"mg20",children:[a&&(0,D.jsxs)(D.Fragment,{children:[x&&(0,D.jsx)(I,{open:x,draftId:a,maxFiles:g-u.length,maxUploadMB:10,onclose:(e,s)=>{this.setState({dropZoneOpen:!1}),s&&n.A.attachmentsApi.get(null,a).then(e=>
1{!c&&p&&(null===e||void 0===e||e.forEach(e=>{e.cost=p})),this.setState({fileInfos:this.limitAttachments(null!==e&&void 0!==e?e:[])},()=>{d&&d(this.state.fileInfos)})})}}),(0,D.jsx)("label",{htmlFor:"btn-upload",children:(0,D.jsxs)(r.A,{className:t.btnmini,variant:"outlined",onClick:()=>this.setState({dropZoneOpen:!0}),color:"primary",size:"small",component:"span",children:[(0,D.jsx)(h.A,{})," ",s("MailDashboard.Attachments.AddButton")]})})]}),u&&u.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{className:t.middle,children:u&&u.map((e,s)=>(0,D.jsx)(S,{file:e,quickMode:this.props.quickMode,canDelete:"undefined"!==typeof a||this.isSmtpLocalAttachment(e),onDelete:e=>this.handleOnDelete(e)},"".concat(e.filename,"-").concat(s)))}),a&&!c&&p&&!(null!==(e=N.A.user)&&void 0!==e&&e.isVirtualAccount)&&(0,D.jsxs)(l.A,{component:"span",variant:"body1",color:"textSecondary",className:t.totalLabel,children:["Total:"," ",(0,D.jsx)(T.A,{value:p*u.length,color:"primary",forceStrong:!0})]})]})]})})}}(0,p.A)(e=>({root:{height:4,borderRadius:2},colorPrimary:{backgroundColor:"#EEEEEE"},bar:{borderRadius:2,backgroundColor:"#ff702c"}}))(o.A),(0,d.A)((0,c.A)({}));const B=(0,i.CI)()((0,p.A)({middle:{verticalAlign:"middle !important"},totalLabel:{display:"inline-block",padding:"0.3em 0em 0.3em 0em",margin:"0em 0.5em 0.5em 0em"},btnmini:{"& .MuiButton-label":{fontSize:"12pt"},margin:"0em 0.5em 0.5em 0em"}})(E))},76089(e,s,t){t.d(s,{A:()=>z});var a,i=t(9950),n=t(82053),o=t(18216),r=t(93511),l=t(60899),d=t(93038),c=t(25277),p=t(25333),h=t(33738),m=t(39287),u=t(85437),x=t(67891),g=t(26592),f=t(38609),A=t(62313),b=t(79708),j=t(96319),y=t(71261),v=t(72666),C=t(94143),D=t(4983),w=t(49985),M=t(78188),S=t(51214),N=t(35256),k=t(94894),F=t(56529),R=t(39063),P=t(48232),I=t(32120),T=(t(81211),t(267)),E=t(67818),B=t(25214),L=t(35884),U=t.n(L),O=t(44414);let K=(0,P.PA)(a=class extends i.Component{constructor(e){super(e),this.state={messageBodyOpen:this.props.expanded,openDialogCantAnswer:!1,openDialogCreateChat:!1,openDialogCloseThread:!1,openDialogAlreadyAnswered:!1}}renderMailButtons(){var e;const{mail:s,currentUser:t,onMailMessageAction:a,quickMode:i,classes:r,t:l}=this.props,d=null!==(e=null===t||void 0===t?void 0:t.isExpert)&&void 0!==e&&e;if(!0===s.refundByRecipent||"undefined"!==typeof s.threadClosed&&null!==s.threadClosed){const e=s.threadClosedReason;let t="MailDashboard.ThreadClosedGeneric",i="Este hilo de mensajes se ha cerrado. Pero puedes volver a enviarle un nuevo mensaje.";return e===k.uJx.Inactivity||"Inactivity"===e?(t="MailDashboard.ThreadClosedInactive",i="Este hilo de mensajes se ha cerrado por superar el l\xedmite de tiempo de inactividad. Pero puedes volver a enviarle un nuevo mensaje."):e===k.uJx.AlreadyAnswered||"AlreadyAnswered"===e?(t="MailDashboard.ThreadClosedAlreadyAnswered",i="Este hilo de mensajes se ha cerrado porque ya se ha contestado por otros medios. Pero puedes volver a enviarle un nuevo mensaje."):e===k.uJx.NoReplyNeeded||"NoReplyNeeded"===e?(t="MailDashboard.ThreadClosedNoReplyNeeded",i="Este hilo de mensajes se ha cerrado porque no necesita respuesta. Pero puedes volver a enviarle un nuevo mensaje."):(e===k.uJx.CantAnswer||"CantAnswer"===e||!0===s.refundByRecipent&&null==s.threadClosed)&&(t="MailDashboard.ThreadClosedCantAnswer",i="Este hilo de mensajes se ha cerrado porque el perfil con el que has contactado considera que no puede darte una respuesta acorde a tu solicitud. Pero puedes volver a enviarle un nuevo mensaje."),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(n.A,{component:"p",variant:"body1",color:"primary",children:l(t,i)}),(0,O.jsx)(R.A,{type:"line",className:"text-with-icon no-default-margin ".concat(r.btnMargins),onPress:e=>{e.stopPropagation(),null===a||void 0===a||a(T.Nk.sendNewMessage,s)},children:(0,O.jsx)("span",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.SendNewMessage",children:"Enviar nuevo mensaje"})})})]})}if(!0!==this.props.hideResponseButton){const e=!i&&d&&s.recipient.id===t.id&&!s.userAsBeta&&!s.sender.isVirtualAccount&&!s.yetRepliedAt&&!s.refundToSender&&!s.sender.avoidReply&&!s.sender.isExpert,n=d&&s.recipient.id===t.id&&!s.userAsBeta&&("undefined"==typeof s.yetRepliedAt||null==s.yetRepliedAt)&&"undefined"!==typeof s.inReplyOfId&&null!==s.inReplyOfId&&("undefined"==typeof s.threadClosed||null==s.threadClosed),c=d&&s.recipient.id===t.id&&!s.userAsBeta&&("undefined"==typeof s.yetRepliedAt||null==s.yetRepliedAt)&&("undefined"==typeof s.threadClosed||null==s.threadClosed),p=d&&s.recipient.id===t.id&&!s.userAsBeta&&!s.sender.isVirtualAccount&&!s.yetRepliedAt&&!s.refundToSender&&!s.sender.avoidReply;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(R.A,{type:"line",className:"text-with-icon no-default-margin ".concat(r.btnMargins),onPress:e=>{e.stopPropagation(),null===a||void 0===a||a(T.Nk.reply,s)},children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C.A,{})," ",(0,O.jsx)("span",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.EmailReplyButton",children:"Responder"})})]})}),!1===this.props.inInverseMode&&e&&(0,O.jsx)(o.A,{color:"secondary",variant:"outlined",className:"text-with-icon ".concat(r.specialButton," ").concat(r.btnMargins),onClick:e=>{this.setState({openDialogCreateChat:!0})},children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(A.A,{}),(0,O.jsx)("span",{children:l("MailDashboard.CreateChatButton","Crear conversaci\xf3n")}
1)]})}),!1===this.props.inInverseMode&&n&&(0,O.jsxs)(o.A,{color:"secondary",variant:"outlined",className:"text-with-icon ".concat(r.specialButton," ").concat(r.btnMargins),onClick:e=>{e.stopPropagation(),this.setState({openDialogCloseThread:!0})},children:[(0,O.jsx)(j.A,{})," ",(0,O.jsx)("span",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CloseThread",children:"Cerrar hilo"})})]}),!1===this.props.inInverseMode&&c&&(0,O.jsx)(o.A,{color:"secondary",variant:"outlined",className:"text-with-icon ".concat(r.specialButton," ").concat(r.btnMargins),onClick:e=>{e.stopPropagation(),this.setState({openDialogAlreadyAnswered:!0})},children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(y.A,{})," ",(0,O.jsx)("span",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.AlreadyAnswered",children:"Ya respondido por otros medios"})})]})}),!1===this.props.inInverseMode&&p&&(0,O.jsx)(o.A,{color:"secondary",variant:"outlined",className:"text-with-icon ".concat(r.specialButton," ").concat(r.btnMargins),onClick:e=>{e.stopPropagation(),this.setState({openDialogCantAnswer:!0})},children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C.A,{})," ",(0,O.jsx)("span",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CantAnswer",children:"No tengo respuesta"})})]})})]})}return null}render(){var e,s;const{classes:t,t:a,onMailMessageAction:i,quickMode:o}=this.props,{openDialogCantAnswer:m,openDialogCreateChat:A}=this.state,j=this.props.mail,y=this.props.currentUser,k=!j.readAt&&j.recipient.id==y.id,R=!!y&&y.isExpert,P=!0===j.refundByRecipent||"undefined"!==typeof j.threadClosed&&null!==j.threadClosed,L="undefined"!==typeof j.alreadyAnswered&&null!==j.alreadyAnswered||"undefined"!==typeof j.yetRepliedAt&&null!==j.yetRepliedAt&&!0!==j.refundByRecipent;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(r.Ay,{button:!0,alignItems:"flex-start",onClick:()=>{k&&i&&i(T.Nk.markRead,j),this.setState({messageBodyOpen:!this.state.messageBodyOpen})},children:(0,O.jsx)("div",{className:"mail-message-view ".concat(k?"unread":""),children:(0,O.jsxs)(l.Ay,{container:!0,alignItems:"center",children:[(0,O.jsx)(l.Ay,{item:!0,xs:12,sm:4,md:4,lg:3,style:{overflowX:"hidden"},children:j.sender.id===y.id?(0,O.jsx)(v.A,{user:j.recipient,date:j.createdAt,showExpandedDate:2===I.Ay.currentFolder,prefix:a("MailDashboard.EmailToLabel","Para: "),isTopUser:null===(e=j.recipient)||void 0===e?void 0:e.isTop}):(0,O.jsx)(v.A,{user:j.sender,date:j.createdAt,showExpandedDate:2===I.Ay.currentFolder,prefix:a("MailDashboard.EmailFromLabel","De: "),isTopUser:null===(s=j.sender)||void 0===s?void 0:s.isTop})}),(0,O.jsxs)(l.Ay,{item:!0,xs:12,sm:8,md:7,lg:8,children:[j.sender.id!==y.id&&!1===this.props.quickMode?(0,O.jsx)("div",{className:"message-star "+t.onlyDesktop,children:(0,O.jsx)(d.A,{icon:(0,O.jsx)(u.A,{}),checkedIcon:(0,O.jsx)(x.A,{}),checked:!!j.starredAt,onClick:e=>{e.stopPropagation(),j.starredAt?(I.Ay.unstar(j),i&&i(T.Nk.unstar,j)):(I.Ay.star(j),i&&i(T.Nk.star,j))}})}):(0,O.jsx)(O.Fragment,{}),(0,O.jsxs)("div",{className:"message-subject-resume-container "+t.paddingSubjectOnMobile,children:[(0,O.jsxs)("div",{className:"message-subject "+t.variableWidth,children:[k&&(0,O.jsx)("div",{className:"unread-dot"}),P&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(N.A,{fontSize:"small",color:"secondary",className:t.middle,titleAccess:a("MailDashboard.ThreadClosed","Este hilo de mensajes est\xe1 cerrado.")}),"\xa0"]}),!0===j.userAsBeta&&!0===R&&!1===j.sender.isVirtualAccount&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c.A,{className:t.middle,icon:(0,O.jsx)(M.A,{}),label:y.nickname,title:"".concat(a("MailDashboard.OwnChain","Este mensaje pertenece a una cadena que has iniciado t\xfa.")),color:"primary",size:"small"}),"\xa0"]}),y&&!1===j.sender.isVirtualAccount&&!0===R&&!1===j.userAsBeta&&j.recipient.id===y.id?L?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c.A,{className:t.middle,label:j.temposCost>0?"+".concat(j.temposCost,"T"):"Gratis",variant:"outlined",title:"".concat(a("MailDashboard.YouAnswerAt","Has respondido el")," ").concat("undefined"!=typeof j.yetRepliedAt?j.yetRepliedAt.toLocaleDateString():j.alreadyAnswered.toLocaleDateString()," \xb7 ").concat("undefined"!=typeof j.yetRepliedAt?j.yetRepliedAt.toLocaleTimeString():j.alreadyAnswered.toLocaleTimeString()," ")+"".concat(j.temposCost>0?"".concat(a("MailDashboard.YouObtained"," y has obtenido ")," +").concat(j.temposCost,"T"):a("MailDashboard.YouN
1otObtained","y no has obtenido tempos.")),color:"secondary",size:"small",icon:(0,O.jsx)(D.A,{})}),"\xa0"]}):!P&&j.deadLineAt?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c.A,{className:t.middle,label:j.temposCost>0?new Date<j.deadLineAt?"+".concat(j.temposCost,"T"):"Fuera de plazo":"Gratis",title:"".concat(a("MailDashboard.NotAnswerAt","Sin responder, hazlo antes del")," ").concat(j.deadLineAt.toLocaleString()," ")+"".concat(j.temposCost>0?"".concat(a("MailDashboard.YouWillGain","y recibir\xe1s")," +").concat(j.temposCost,"T"):a("MailDashboard.YouWillNotGain","y no recibir\xe1s Tempos"),"}"),color:"secondary",size:"small",icon:(0,O.jsx)(C.A,{}),clickable:!0,onClick:e=>{e.stopPropagation(),this.props.onMailMessageAction&&this.props.onMailMessageAction(T.Nk.reply,j)}}),"\xa0"]}):(0,O.jsx)(O.Fragment,{}):(0,O.jsx)(O.Fragment,{}),y&&!0===y.isExpert&&!1===j.userAsBeta&&j.sender.id===y.id&&j.readByRecipientAt?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c.A,{label:a("Common.Viewed","Visto"),variant:"outlined",className:t.middle,title:a("MailDashboard.ViewedByDestinatary","Visto por el destinatario el ")+" ".concat(j.readByRecipientAt.toLocaleDateString()," \xb7 ").concat(j.readByRecipientAt.toLocaleTimeString()),color:"secondary",size:"small",icon:(0,O.jsx)(w.A,{})}),"\xa0"]}):(0,O.jsx)(O.Fragment,{}),y&&!0===y.isExpert&&!1===j.userAsBeta&&j.sender.id===y.id&&j.isNextResponseFree?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(c.A,{label:a("MailDashboard.FreeResponseLabel","Respuesta gratis"),variant:"outlined",className:t.middle,title:a("MailDashboard.FreeResponseText","Siguiente respuesta gratis, activada el ")+" ".concat(j.isNextResponseFree.toLocaleDateString()," \xb7 ").concat(j.isNextResponseFree.toLocaleTimeString()),color:"secondary",size:"small",icon:(0,O.jsx)(C.A,{rotate:180})}),"\xa0"]}):(0,O.jsx)(O.Fragment,{}),j.hasAttachments>0&&(0,O.jsx)(b.A,{fontSize:"small",color:"secondary",className:t.middle}),(0,O.jsx)("span",{className:t.middle,children:j.subject})]}),j.showSmtpOpportunityBanner&&(0,O.jsxs)("span",{className:"smtp-opportunity-label",children:[(0,O.jsx)(S.A,{className:"smtp-opportunity-icon",fontSize:"inherit","aria-hidden":"true"}),(0,O.jsx)("span",{children:a("MailDashboard.SmtpOpportunity","Oportunidad para ti")})]}),(0,O.jsx)("div",{className:"message-resume "+t.onlyWidther,children:U().fromString(j.body?j.body.substring(0,150):"")})]})]}),!1===this.props.quickMode&&(0,O.jsx)(l.Ay,{item:!0,xs:1,className:"command-row "+t.onlyDesktop,children:(0,O.jsx)(p.A,{onClick:e=>{e.stopPropagation(),j.deletedAt?(I.Ay.undelete(j),i&&i(T.Nk.undelete,j)):(I.Ay.delete(j),i&&i(T.Nk.delete,j))},size:"large",children:j.deletedAt?(0,O.jsx)(f.A,{}):(0,O.jsx)(g.A,{})})})]})})}),(0,O.jsx)(h.A,{timeout:"auto",mountOnEnter:!0,unmountOnExit:!0,in:this.state.messageBodyOpen,className:"mail-message-component-view",children:(0,O.jsx)(l.Ay,{container:!0,justifyContent:"flex-end",children:(0,O.jsxs)(l.Ay,{item:!0,xs:12,sm:12,className:"message-list-items-container",children:[!1===j.sender.avoidReply?(0,O.jsxs)("div",{className:"mail-message-command-send",children:["undefined"!==typeof j.isNextResponseFree&&(0,O.jsxs)(O.Fragment,{children:[j.recipient.id===y.id&&(0,O.jsx)("p",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.EmailReplyFreeForRecipientText",children:"El remitente ha habilitado la respuesta sin coste para usted."})}),j.sender.id===y.id&&(0,O.jsx)("p",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.EmailReplyFreeForSenderText",children:"Has habilitado la respuesta sin coste para el remitente."})})]}),this.renderMailButtons()]}):null,(0,O.jsx)(F.A,{mail:j,currentUser:y,onMailMessageAction:i,quickMode:this.props.quickMode,attachments:this.props.attachments,miniProfile:this.props.miniProfile,inInverseMode:this.props.inInverseMode}),!1===j.sender.avoidReply?(0,O.jsxs)("div",{className:"mail-message-command-send",children:["undefined"!==typeof j.isNextResponseFree&&(0,O.jsxs)(O.Fragment,{children:[j.recipient.id===y.id&&(0,O.jsx)("p",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.EmailReplyFreeForRecipientText",children:"El remitente ha habilitado la respuesta sin coste para usted."})}),j.sender.id===y.id&&(0,O.jsx)("p",{children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.EmailReplyFreeForSenderText",children:"Has habilitado la respuesta sin coste para el remitente."})})]}),(0,O.jsx)("div",{className:!0===j.refundByRecipent||"undefined"!==typeof j.threadClosed&&null!==j.threadClosed?t.closedBannerMobileOnly:void 0,children:this.renderMailButtons()})]}):(0,O.jsx)(O.Fragment,{})]})})}),(0,O.jsxs)(B.A,{title:a("MailDashboard.ChatDialogTitle","\xbfResponder con una conversaci\xf3n?"),isOpen:A,cancelButtonText:a("MailDashboard.ChatDialogCancelButton","Cancelar"),acceptButtonText:a("MailDashboard.ChatDialogAcceptButton","Responder con una conversaci\xf3n"),onClose:e=>{!0===e&&i&&i(T.Nk.createChat,j),this.setState({openDialogCreateChat:!1})},children:[(0,O.jsx)(n.A,{component:"p",variant:"body1",color:"textSecondary",children:a("MailDashboard.ChatDialogBody","Vas a responder a este mensaje creando una conversaci\xf3n, al remitente se le enviar\xe1 una respuesta con un enlace a la misma. Si hay tempos retenidos, se ingresar\xe1n en tu saldo.")}),(0,O.jsx)(n.A,{component:"p",variant:"body1",color:"textSecondary",children:a("MailDashboard.ChatDialogBodyNote","Recuerda que puedes tener hasta {{maxChatRooms}} conversaciones abiertas.",{maxChatRooms:null===y||void 0===y?void 0:y.CreationLimitChatRoom})})]}),(0,O.jsxs)(B.A,{title:a("MailDashboard.CloseThreadPopupTitle","Cerrar hilo de mensajes"),isOpen:this.state.openDialogCloseThread,acceptButtonText:a("MailDashboard.CloseThreadConfirmButton","Confirmar \xabcerrar hilo\xbb"),onClose:e=>{!0===e&&i&&i(T.Nk.closeThread,j),this.setState({openDialogCloseThread:!1})},children:[(0,O.jsx)("span",{className:"paragraph",style:{textAlign:"left"},children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CloseThreadDialogBody",children:"\xbfEst\xe1s seguro de cerrar este hilo? No podr\xe1s enviar ni recibir m\xe1s mensajes en este hilo."})}),(0,O.jsx)("span",{className:"paragraph",children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CantAnswerAreSure",children:"\xbfEst\xe1 seguro de continuar?"})})]}),(0,O.jsxs)(B.A,{title:a("MailDashboard.AlreadyAnsweredPopupTitle","Ya contestado por otros medios"),isOpen:this.state.openDialogAlreadyAnswered,acceptButtonText:a("MailDashboard.AlreadyAnsweredConfirmButton","Confirmar \xabYa contestado\xbb"),onClose:e=>{!0===e&&i&&i(T.Nk.alreadyAnswered,j),this.setState({openDialogAlreadyAnswered:!1})},children:[(0,O.jsx)("span",{className:"paragraph",style:{textAlign:"left"},children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.AlreadyAnsweredDialogBody",children:"Si marcas contestado por otros medios este mensaje, cobrar\xe1s los Tempos retenidos si los hubiese y no podr\xe1s enviar ni recibir m\xe1s mensajes en este hilo."})}),(0,O.jsx)("span",{className:"paragraph",children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CantAnswerAreSure",children:"\xbfEst\xe1 seguro de continuar?"})})]}),(0,O.jsxs)(B.A,{title:a("MailDashboard.CantAnswerPopupTitle","Env\xedar \xabNo puedo responder\xbb"),isOpen:this.state.openDialogCantAnswer,acceptButtonText:a("MailDashboard.CantAnswerConfirmButton","Confirmar \xabNo puedo responder\xbb"),onClose:e=>{!0===e&&i&&i(T.Nk.cantAnswer,j),this.setState({openDialogCantAnswer:!1})},children:[(0,O.jsx)("span",{className:"paragraph",style:{textAlign:"left"},children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CantAnswerDialogBody",children:"Confirmando \xabNo puedo contestar\xbb se enviar\xe1 un mensaje de disculpa al usuario en tu nombre y se le devolver\xe1n los Tempos en el caso de que hubieran sido retenidos."})}),(0,O.jsx)("span",{className:"paragraph",children:(0,O.jsx)(E.x6,{i18nKey:"MailDashboard.CantAnswerAreSure",children:"\xbfEst\xe1s seguro de continuar?"})})]})]})}})||a;const z=(0,E.CI)()((0,m.A)(e=>
1({onlyDesktop:{display:"none",opacity:0,[e.breakpoints.up("md")]:{display:"inline-block",opacity:1}},specialButton:{padding:"4px 16px",borderRadius:"24px"},paddingSubjectOnMobile:{paddingLeft:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(0)}},variableWidth:{maxWidth:"100%",[e.breakpoints.only("xs")]:{}},btnMargins:{margin:e.spacing(1)},middle:{verticalAlign:"middle"},onlyWidther:{display:"none",[e.breakpoints.only("sm")]:{maxWidth:"225px",display:"block"},[e.breakpoints.only("md")]:{maxWidth:"355px",display:"block"},[e.breakpoints.up("md")]:{display:"block",maxWidth:"100%"}},onlyMobile:{display:"inline-block",[e.breakpoints.up("md")]:{display:"none"}},closedBannerMobileOnly:{[e.breakpoints.up("md")]:{display:"none"}}}))(K))},56529(e,s,t){t.d(s,{A:()=>te});var a,i=t(9950),n=t(60899),o=t(36080),r=t(33738),l=t(16497),d=t(37324),c=t(18216),p=t(83563),h=t(74745),m=t(82053),u=t(82570),x=t(27038),g=t.n(x),f=t(18726),A=t(13246),b=(t(93204),t(7009)),j=t(38892),y=t(28783),v=t(66146),C=t(36971),D=t(83418),w=t(67818),M=t(72058),S=t(74635),N=t(48232),k=t(97978),F=t(75708),R=t(39063),P=t(25214),I=t(267),T=t(90728),E=t(44414);let B=(0,N.PA)(a=class extends i.Component{constructor(e){super(e),this._isMounted=!1,this.openFriendDialog=()=>{this.setState({friendDialogOpen:!0})},this.handleFriendDialogClose=e=>{if(!e)return void this.setState({friendDialogOpen:!1});const s=this.getProfileUserId();if(!s||this.state.friendActionLoading)return void this.setState({friendDialogOpen:!1});const{t:t}=this.props,a=this.state.isFriend,i=this.state.userMiniProfile;this.setState({friendActionLoading:!0});(a?b.A.usersApi.removeFriend(s):b.A.usersApi.addFriend(s)).then(e=>{if(this._isMounted)if(null!==e&&void 0!==e&&e.success){this.setState({isFriend:!a,friendDialogOpen:!1,friendActionLoading:!1});const e="".concat((null===i||void 0===i?void 0:i.name)||""," ").concat((null===i||void 0===i?void 0:i.surname)||"").trim()||(null===i||void 0===i?void 0:i.nickName)||"";F.A.show("success",a?t("PublicProfile.FriendRemoved","Has quitado a {{name}} de tu lista de amigos.",{name:e}):t("PublicProfile.FriendAdded","Has a\xf1adido a {{name}} a tu lista de amigos.",{name:e}))}else this.setState({friendDialogOpen:!1,friendActionLoading:!1}),F.A.show("error",(null===e||void 0===e?void 0:e.errorMessage)||t("PublicProfile.FriendActionError","No se ha podido completar la acci\xf3n sobre la lista de amigos."))}).catch(e=>{T.A.error(e),this._isMounted&&(this.setState({friendDialogOpen:!1,friendActionLoading:!1}),F.A.show("error",t("PublicProfile.FriendActionError","No se ha podido completar la acci\xf3n sobre la lista de amigos.")))})},this.state={userMiniProfile:null,isFriend:!1,friendDialogOpen:!1,friendActionLoading:!1}}componentDidMount(){this._isMounted=!0,this.props.userId?b.A.usersApi.userMiniProfile(this.props.userId).then(e=>{this._isMounted&&this.setState({userMiniProfile:e},()=>this.refreshFriendStatus())}):this.props.userMiniProfile&&this.setState({userMiniProfile:this.props.userMiniProfile},()=>this.refreshFriendStatus())}componentDidUpdate(e){this.props.userId&&this.props.userId!==e.userId&&b.A.usersApi.userMiniProfile(this.props.userId).then(e=>{this._isMounted&&this.setState({userMiniProfile:e,isFriend:!1,friendDialogOpen:!1,friendActionLoading:!1},()=>this.refreshFriendStatus())})}componentWillUnmount(){this._isMounted=!1}getProfileUserId(){return this.props.userId}canManageFriends(e){const s=this.getProfileUserId();return!(!(k.A.isRegistered&&k.A.isExpert&&e.isExpert&&s&&k.A.user&&k.A.user.id!==s)||(0,I._Z)(s))}refreshFriendStatus(){const e=this.getProfileUserId(),s=this.state.userMiniProfile;s&&this.canManageFriends(s)&&e?b.A.usersApi.isFriend(e).then(e=>{this._isMounted&&this.setState({isFriend:!(null===e||void 0===e||!e.isFriend)})}).catch(e=>{T.A.error(e)}):this.setState({isFriend:!1})}render(){const{t:e}=this.props,s=this.state.userMiniProfile,t=S.Ay.language,a=!!s&&this.canManageFriends(s),i=s&&("".concat(s.name||""," ").concat(s.surname||"").trim()||s.nickName)||"";return(0,E.jsxs)("div",{className:"mail-mini-profile",children:[s?(0,E.jsxs)(n.Ay,{container:!0,children:[(0,E.jsx)(n.Ay,{item:!0,xs:12,sm:6,md:4,lg:3,className:"mail-mini-profile-col-avatar",children:(0,E.jsx)("div",{className:"avatar-container",children:(0,E.jsx)(C.A,{userImage:this.state.userMiniProfile&&this.state.userMiniProfile.avatarUrl?this.state.userMiniProfile.avatarUrl:"",userLastname:s.surname,userName:s.name,isExpert:s.isExpert,isTop:s.isTop,isDataCampus:s.isDataCampus,type:"bigger"})})}),(0,E.jsx)(n.Ay,{item:!0,xs:12,sm:6,md:3,lg:3,className:"mail-mini-profile-col-summary",children:(0,E.jsxs)("div",{className:"first-block",children:[(0,E.jsx)("strong",{children:"".concat(s.name," ").concat(s.surname)})," (",s.nickName,")",(0,E.jsx)("br",{}),(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.ProfileCreatedLabel",children:"Creado/a:"}),(0,E.jsxs)("strong",{children:[" ",(0,E.jsx)(g(),{fromNow:!0,date:s.createdOn})]}),(0,E.jsx)("br",{}),(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.ProfileBornLabel",children:"Nacido/a:"}),(0,E.jsxs)("strong",{children:[" ",(0,E.jsx)(g(),{fromNow:!0,date:s.birthDate})]}),(0,E.jsx)("br",{}),(0,E.jsx)(w.x6,{i18nKey:"Common.CountryAndCity",children:"Ciudad y Pa\xeds"}),":"," ",(0,E.jsxs)("strong",{children:[s.city,", ",s.country]})," ",(0,E.jsx)("br",{}),!0===s.isExpert?(0,E.jsxs)("strong",{children:[" ",(0,E.jsx)(w.x6,{i18nKey:"Common.PublicProfileLabel",children:"Perfil P\xfablico"})]}):(0,E.jsxs)("strong",{children:[" ",(0,E.jsx)(w.x6,{i18nKey:"Common.RegularProfileLabel",children:"Usuario normal"})]}),(0,E.jsx)("br",{}),(0,E.jsx)(D.A,{linkmusicUser:s.linkmusicUser,personalWebSiteUrl:s.personalWebSiteUrl,twitterUser:s.twitterUser,instagramUser:s.instagramUser,threadsUser:s.threadsUser,ilargiUrl:s.ilargiUrl,amazonUser:s.amazonUser,facebookUser:s.facebookUser,youtubeUser:s.youtubeUser,linkedinUser:s.linkedinUser,wikipediaUser:s.wikipediaUser,twitchUser:s.twitchUser,spotifyUser:s.spotifyUser,tikTokUser:s.tikTokUser,mastodonUser:s.mastodonUser}),s.customWebSiteUrl&&s.customWebSiteUrl.toLowerCase().includes("tamovip")&&(0,E.jsx)("a",{href:"".concat(s.customWebSiteUrl),target:"_blank",children:(0,E.jsx)(M.t,{src:M.B.tamoVip,className:"logo-tamo"})}),a?(0,E.jsx)("div",{className:"friend-action",children:(0,E.jsxs)(R.A,{onPress:this.openFriendDialog,type:"line",className:"text-with-icon soft friend-action-button",disabled:this.state.friendActionLoading,children:[this.state.isFriend?(0,E.jsx)(v.A,{fontSize:"small"}):(0,E.jsx)(y.A,{fontSize:"small"})," ",(0,E.jsx)("span",{children:this.state.isFriend?e("PublicProfile.RemoveFriend","Quitar de amigos"):e("PublicProfile.AddFriend","A\xf1adir a amigos")})]})}):(0,E.jsx)(E.Fragment,{})]})}),(0,E.jsxs)(n.Ay,{item:!0,xs:12,sm:12,md:5,lg:6,className:"mail-mini-profile-col-about",children:[(0,E.jsx)("span",{children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.ProfileAboutLabel",children:"Sobre \xe9l/ella:"})}),(0,E.jsx)("div",{className:"html-embedded",children:(0,E.jsx)(j.VK,{content:"en"===t&&s.aboutMeEn?s.aboutMeEn:s.aboutMe,allowElements:!0})}),s.categories&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("span",{children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.TagsLabel",children:"Tags:"})}),(0,E.jsx)("ul",{className:"mini-profile-categories",children:s.categories&&s.categories.map((e,s)=>(0,E.jsx)("li",{children:e},"cat-".concat(s)))})]})]})]}):(0,E.jsx)(E.Fragment,{}),(0,E.jsx)(P.A,{isOpen:this.state.friendDialogOpen,onClose:this.handleFriendDialogClose,title:this.state.isFriend?e("PublicProfile.RemoveFriendTitle","Quitar a {{name}} de tu lista de amigos",{name:i}):e("PublicProfile.AddFriendTitle","A\xf1adir a {{name}} a tu lista de amigos",{name:i}),acceptButtonText:this.state.isFriend?e("PublicProfile.RemoveFriendConfirm","Quitar de amigos"):e("PublicProfile.AddFriendConfirm","A\xf1adir a amigos"),isAcceptButtonDisabled:this.state.friendActionLoading,isCancelButtonDisabled:this.state.friendActionLoading,dialogSx:{"& .MuiDialogActions-root":{flexWrap:"nowrap",gap:"8px"},"& .MuiDialogActions-root .MuiButton-root":{whiteSpace:"nowrap",flexShrink:0,minHeight:"36px",height:"auto",lineHeight:"1.25"}},children:(0,E.jsx)("div",{style:{paddingTop:"1.25rem"},children:this.state.isFriend?(0,E.jsx)("p",{children:e("PublicProfile.RemoveFriendMessage","Si quitas a {{name}} de tu lista de amigos, los mensajes que te env\xede volver\xe1n a tener coste en Tempos.",{name:i})}):(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("p",{children:e("PublicProfile.AddFriendMessage","Si a\xf1ades a {{name}} a tu lista de amigos, los mensajes que te env\xede no tendr\xe1n coste en Tempos. Esto
1implica que no recibir\xe1s Tempos por responderles.",{name:i})})})})})]})}})||a;const L=(0,w.CI)()(B);var U=t(32120),O=t(89379),K=t(96557),z=t(22780),W=t(39287),q=t(93339);class H extends i.Component{constructor(e){super(e),this.state={tip:void 0}}refreshTip(){const{tipId:e}=this.props;b.A.tipsApi.getReceivedTip(e).then(e=>{e.tipReceived&&this.setState({tip:e.tipReceived})})}componentDidMount(){this.refreshTip()}setReaction(e,s){const{t:t}=this.props;b.A.tipsApi.setReaction(e,s).then(e=>{if(e.result)if(e.result.success){var a=(0,O.A)({},this.state.tip);a.reaction=null==s?void 0:s,this.setState({tip:a}),F.A.show("success",t("Tips.ReactionSavedMessage","Reacci\xf3n guardada"))}else F.A.show("error",e.result.errorMessage);else F.A.show("error",t("Tips.UnableToReactMessage","No se ha podido reaccionar al Agradecimiento"))}).catch(()=>{F.A.show("error",t("Tips.UnableToReactMessage","No se ha podido reaccionar al Agradecimiento"))})}setPublic(e,s){const{t:t}=this.props;b.A.tipsApi.setIsPublic(e,s).then(e=>{if(e.result)if(e.result.success){var a=(0,O.A)({},this.state.tip);a.isPublic=s,this.setState({tip:a}),F.A.show("success",s?t("Tips.PublicTrueSavedMessage","El agradecimiento es ahora p\xfablico"):t("Tips.PublicFalseSavedMessage","El agradecimiento ya no es p\xfablico"))}else F.A.show("error",e.result.errorMessage);else F.A.show("error",t("Tips.UnableToPublicMessage","No ha sido posible cambiar el estado del agradecimiento"))}).catch(()=>{F.A.show("error",t("Tips.UnableToPublicMessage","No ha sido posible cambiar el estado del agradecimiento"))})}render(){const{tip:e}=this.state,{t:s,classes:t}=this.props;return(0,E.jsx)(i.Fragment,{children:e&&(0,E.jsxs)(n.Ay,{container:!0,alignItems:"center",justifyContent:"flex-end",spacing:1,children:[(0,E.jsx)(n.Ay,{item:!0,style:{paddingRight:"1em"},children:(0,E.jsxs)(m.A,{variant:"body2",color:"textSecondary",component:"span",children:[(0,E.jsx)("strong",{children:s("Tips.Actions.LabelReceived","Acciones r\xe1pidas al agradecimiento:")})," "]})}),(0,E.jsx)(n.Ay,{item:!0,style:{paddingBottom:"10px",paddingRight:"2em"},children:(0,E.jsx)(q.A,{onSelectEmoji:s=>this.setReaction(e.id,s),onClearEmoji:()=>this.setReaction(e.id,null),selectedEmoji:e.reaction?e.reaction:null})}),(0,E.jsx)(n.Ay,{item:!0,children:(0,E.jsx)(K.A,{style:{verticalAlign:"middle"},children:(0,E.jsx)(l.A,{labelPlacement:"end",control:(0,E.jsx)(d.A,{size:"small",checked:e.isPublic,color:"primary",onChange:()=>this.setPublic(e.id,!e.isPublic)}),label:(0,E.jsx)(m.A,{variant:"body2",color:"textSecondary",children:s("Tips.ReceivedPanel.PublishOnProfileLabel","Publicarlo en tu perfil")})})})})]},"received-tip-".concat(e.id))})}}const _=(0,w.CI)()((0,W.A)(e=>(0,z.A)({root:{"& > *":{borderBottom:"unset"}},middle:{display:"inline",verticalAlign:"middle"}}))(H));class V extends i.Component{constructor(e){super(e),this.state={tip:void 0}}refreshTip(){const{tipId:e}=this.props;b.A.tipsApi.getSentTip(e).then(e=>{e.tipSent&&this.setState({tip:e.tipSent})})}componentDidMount(){this.refreshTip()}render(){const{tip:e}=this.state,{t:s,classes:t}=this.props;return(0,E.jsx)(i.Fragment,{children:e&&(0,E.jsxs)(n.Ay,{container:!0,alignItems:"center",justifyContent:"flex-end",spacing:1,children:[(0,E.jsx)(n.Ay,{item:!0,style:{paddingRight:"1em"},children:(0,E.jsxs)(m.A,{variant:"body2",color:"textSecondary",component:"span",children:[(0,E.jsx)("strong",{children:s("Tips.Actions.LabelSent","Estado del agradecimiento:")})," "]})}),(0,E.jsx)(n.Ay,{item:!0,style:{paddingBottom:"4px",paddingRight:"2em"},children:null==e.reaction?(0,E.jsx)(m.A,{variant:"body2",color:"textSecondary",children:s("Tips.SelectEmoji.NoReaction","Sin reacci\xf3n")}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(m.A,{variant:"body2",color:"textSecondary",component:"span",style:{verticalAlign:"middle"},children:["".concat(e.recipientName," ").concat(e.recipientSurname)," ",s("Tips.SelectEmoji.ReactedLabelOther","ha reaccionado con")," "]}),(0,E.jsx)("span",{style:{fontSize:"2em",verticalAlign:"middle"},children:e.reaction})]})})]},"sent-tip-".concat(e.id))})}}const Y=(0,w.CI)()((0,W.A)(e=>(0,z.A)({root:{"& > *":{borderBottom:"unset"}},middle:{display:"inline",verticalAlign:"middle"}}))(V));class G extends i.Component{constructor(e){super(e);const s=this.props.mail.metaProperties;this.state={metaProperties:s?JSON.parse(s):void 0}}render(){const{mail:e,currentUser:s}=this.props,{metaProperties:t}=this.state;return(0,E.jsx)(E.Fragment,{children:t&&t.actions&&(0,E.jsx)(n.Ay,{container:!0,children:t.actions.map((s,t)=>(0,E.jsx)(n.Ay,{item:!0,xs:12,children:{"Tip.Received":(0,E.jsx)(_,{tipId:s.params[0].tipId}),"Tip.Sent":(0,E.jsx)(Y,{tipId:s.params[0].tipId})}[s.actionKey]},"action-".concat(e.id,"-").concat(t)))})})}}const Z=(0,w.CI)()(G);var Q=t(79708),J=t(51214),X=t(18145),$=t(94598),ee=t(85787);class se extends i.Component{constructor(e){super(e),this.submitSmtpOpportunityFeedback=e=>{const{mail:s}=this.props;s&&null==s.smtpOpportunityFeedback&&!this.state.smtpFeedbackSubmitting&&(this.setState({smtpFeedbackSubmitting:!0}),U.Ay.setSmtpOpportunityFeedback(s,e).finally(()=>{this.setState({smtpFeedbackSubmitting:!1})}
1))},this.state={expandedSenderProfile:!1,smtpFeedbackSubmitting:!1}}componentDidMount(){const e=this.props.mail;e&&!1===e.isBodyFullLoaded&&U.Ay.loadBody(e)}render(){var e,s,t;const{t:a,miniProfile:i,onMailMessageAction:x,quickMode:b,isTopUser:v}=this.props,C=this.props.mail,D=this.props.currentUser;return(0,E.jsxs)(n.Ay,{container:!0,className:"mail-body-view",children:[(0,E.jsx)(n.Ay,{item:!0,xs:12,children:(0,E.jsxs)("div",{className:"mail-body-header",children:[(0,E.jsxs)("div",{className:"header-common-block",children:[(0,E.jsx)("span",{className:"mail-label",children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.MailFromLabel",children:"De: "})}),"".concat(C.sender.name," ").concat(C.sender.lastName," (").concat(C.sender.nickname,")"),"\xa0",!1===C.sender.isVirtualAccount&&D&&!0===D.isExpert&&!b?(0,E.jsxs)(o.A,{className:"action-link",onClick:e=>{e.preventDefault(),this.setState({expandedSenderProfile:!this.state.expandedSenderProfile})},children:[(0,E.jsx)(u.A,{className:"action-button"})," ",(0,E.jsx)("span",{className:"action-text",children:a("Common.Detail","Detalle")}),!0===this.state.expandedSenderProfile?(0,E.jsx)(A.A,{className:"action-button"}):(0,E.jsx)(f.A,{className:"action-button"})," "]}):(0,E.jsx)(E.Fragment,{}),(0,E.jsx)("br",{}),(0,E.jsx)(r.A,{timeout:"auto",mountOnEnter:!0,unmountOnExit:!0,in:this.state.expandedSenderProfile,className:"mail-body-header-profile-info",children:1==this.props.quickMode?(0,E.jsx)(L,{userId:C.sender.id,userMiniProfile:this.props.miniProfile}):(0,E.jsx)(L,{userId:C.sender.id})}),(0,E.jsx)("span",{className:"mail-label",children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.MailSentLabel",children:"Enviado: "})}),"".concat(C.sentAt.toLocaleDateString(S.Ay.language)," \xb7 \n ").concat(C.sentAt.toLocaleTimeString(S.Ay.language)),"\xa0(",(0,E.jsx)(g(),{fromNow:!0,date:C.sentAt}),")",(0,E.jsx)("br",{}),(0,E.jsx)("span",{className:"mail-label",children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.MailToLabel",children:"Para: "})}),"".concat(C.recipient.name," ").concat(C.recipient.lastName," (").concat(C.recipient.nickname,")"),(0,E.jsx)("br",{}),(0,E.jsx)("span",{className:"mail-label",children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.MailSubjectLabel",children:"Asunto: "})})," ",C.subject,(0,E.jsx)("br",{})]}),("undefined"==typeof C.threadClosed||null==C.threadClosed)&&(!1===C.sender.isVirtualAccount&&D&&!0===D.isExpert&&!1===C.userAsBeta&&C.recipient.id===D.id?C.yetRepliedAt?C.refundByRecipent?(0,E.jsxs)("span",{className:"mail-label extra-alpha",children:[a("MailDashboard.CantAnswerInfo","Has enviado una respuesta autom\xe1tica \xabNo puedo contestar\xbb y se han devuelto los Tempos.")," "]}):(0,E.jsxs)("span",{className:"mail-label extra-alpha",children:[(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.ReplyMessageText",children:["Has respondido"," ",(0,E.jsx)(g(),{fromNow:!0,date:C.yetRepliedAt}),(0,E.jsx)("span",{className:"secondary",children:" (".concat(C.yetRepliedAt.toLocaleDateString(S.Ay.language)," \xb7 \n ").concat(C.yetRepliedAt.toLocaleTimeString(S.Ay.language),")")})]}),"\xa0",C.temposCost>0?(0,E.jsx)("span",{children:(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.ReplyIncomeMessageText",children:["y has obtenido"," ",(0,E.jsx)(X.A,{color:"primary",value:C.temposCost,showInEuros:!0})]})}):(0,E.jsx)("span",{children:(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.ReplyNonIncomeMessageText",children:[" ","sin obtener tempos."]})})]}):C.deadLineAt?(0,E.jsxs)("span",{className:"mail-label extra-alpha",children:[(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.NotYetRepliedMessage",values:{deadline:C.deadLineAt.toLocaleString(S.Ay.language)},defaults:"A\xfan no has respondido, responde antes del {{deadline}}."}),C.temposCost>0?(0,E.jsx)("span",{children:(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.NotYetRepliedIncomeMessage",children:["Recibir\xe1s",(0,E.jsx)(X.A,{color:"primary",value:C.temposCost,showInEuros:!0}),"si lo haces en plazo."]})}):(0,E.jsx)("span",{children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.NotYetRepliedNoIncomeMessage",children:"No recibir\xe1s tempos por este mensaje."})})]}):(0,E.jsx)("span",{className:"mail-label extra-alpha",children:(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.NotYetRepliedPlainMessage",children:["A\xfan no has respondido."," "]})}):(0,E.jsx)(E.Fragment,{})),D&&!0===D.isExpert&&(!1===C.userAsBeta||D.isVirtualAccount)&&C.sender.id===D.id?(0,E.jsxs)(E.Fragment,{children:[!1!==C.sender.avoidReply||D.isVirtualAccount?(0,E.jsx)(E.Fragment,{}):(0,E.jsxs)(E.Fragment,{children:["undefined"!==typeof C.isNextResponseFree?(0,E.jsx)(E.Fragment,{children:C.recipient.id===D.id&&(0,E.jsx)("span",{className:"mail-label extra-alpha",children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.FreeResponse",children:"El remitente ha habilitado la respuesta sin coste para usted."})})}):(0,E.jsx)(E.Fragment,{}),C.sender.id===D.id&&(C.alreadyAnswered?(0,E.jsx)("span",{className:"mail-label extra-alpha",children:a("MailDashboard.AlreadyAnswered","Has enviado una respuesta autom\xe1tica \xabNo puedo contestar\xbb y se han devuelto los Tempos.")}):C.refundByRecipent?(0,E.jsx)("span",{className:"mail-label extra-alpha",children:a("MailDashboard.CantAnswerInfo","Has enviado una respuesta autom\xe1tica \xabNo puedo contestar\xbb y se han devuelto los Tempos.")}):(0,E.jsx)("span",{className:"mail-label extra-alpha",children:(0,E.jsx)(l.A,{className:"mail-option",control:(0,E.jsx)(d.A,{size:"small",checked:!!C.isNextResponseFree,onChange:e=>{e.stopPropagation(),C.isNextResponseFree?(U.Ay.nextResponseNotFree(C),x&&x(I.Nk.nextReplyNotFree,C)):(U.Ay.nextResponseFree(C),x&&x(I.Nk.nextReplyFree,C))}}),label:a("MailDashboard.FreeResponseForDestinatary","Respuesta gratuita para el destinatario")})}))]}),C.readByRecipientAt?(0,E.jsxs)("span",{className:"mail-label extra-alpha",children:[(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.ReadByRecipientMessage",children:["Le\xeddo por el destinatario"," "]}),"\xa0"," ","".concat(C.readByRecipientAt.toLocaleDateString())+" \xb7 ".concat(C.readByRecipientAt.toLocaleTimeString()," ")]}):(0,E.jsx)("span",{className:"mail-label extra-alpha",children:(0,E.jsxs)(w.x6,{i18nKey:"MailDashboard.NotYetReadMessage",children:["El destinatario a\xfan no ha le\xeddo tu respuesta."," "]})})]}):(0,E.jsx)(E.Fragment,{})]})}),C.showSmtpOpportunityBanner&&(0,E.jsx)(n.Ay,{item:!0,xs:12,className:"smtp-origin-warning-wrap",children:(0,E.jsxs)("div",{className:"smtp-origin-warning",children:[(0,E.jsx)(J.A,{className:"smtp-origin-warning-icon","aria-hidden":"true"}),(0,E.jsxs)("div",{className:"smtp-origin-warning-content",children:[(0,E.jsx)("span",{children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.SmtpOriginWarning",components:{strong:(0,E.jsx)("strong",{})},defaults:"MyPublicInbox ha recibido este correo y lo considera una oportunidad para ti. No est\xe1s obligado a responderle, y <strong>no recibir\xe1s Tempos</strong> por ello, pero creemos que puede ser de tu inter\xe9s."})}),null==C.smtpOpportunityFeedback?(0,E.jsxs)("div",{className:"smtp-opportunity-feedback",children:[(0,E.jsx)("span",{className:"smtp-opportunity-feedback-question",children:a("MailDashboard.SmtpOpportunityFeedbackQuestion","\xbfEste mensaje te parece relevante?")}),(0,E.jsxs)("div",{className:"smtp-opportunity-feedback-actions",children:[(0,E.jsx)(c.A,{size:"small",variant:"outlined",color:"inherit",className:"smtp-opportunity-feedback-button",disabled:this.state.smtpFeedbackSubmitting,onClick:()=>this.submitSmtpOpportunityFeedback(!0),children:a("MailDashboard.SmtpOpportunityFeedbackYes","S\xed")}),(0,E.jsx)(c.A,{size:"small",variant:"outlined",color:"inherit",className:"smtp-opportunity-feedback-button",disabled:this.state.smtpFeedbackSubmitting,onClick:()=>this.submitSmtpOpportunityFeedback(!1),children:a("MailDashboard.SmtpOpportunityFeedbackNo","No")})]})]}):(0,E.jsx)("span",{className:"smtp-origin-warning-thanks",children:a("MailDashboard.SmtpOpportunityFeedbackThanks","Gracias por tu opini\xf3n.")})]})]})}),C.showFriendNoCostBanner&&!C.showSmtpOpportunityBanner&&(0,E.jsx)(n.Ay,{item:!0,xs:12,className:"smtp-origin-warning-wrap",children:(0,E.jsxs)("div",{className:"smtp-origin-warning friend-no-cost-warning",children:[(0,E.jsx)(y.A,{className:"smtp-origin-warning-icon friend-no-cost-warning-icon","aria-hidden":"true"}),(0,E.jsx)("div",{className:"smtp-origin-warning-content",children:(0,E.jsx)("span",{children:(0,E.jsx)(w.x6,{i18nKey:"MailDashboard.FriendNoCostBanner",values:{name:"".concat((null===(e=C.sender)||void 0===e?void 0:e.name)||""," ").concat((null===(s=C.sender)||void 0===s?void 0:s.lastName)||"").trim()||(null===(t=C.sender)||void 0===t?void 0:t.nickname)||""},components:{strong:(0,E.jsx)("strong",{})},defaults:"Has recibido este correo de <strong>{{name}}</strong> sin coste en Tempos porque esta persona te tiene en su lista de amigos. No recibir\xe1s Tempos por responderle. Los adjuntos, si los hubiera, s\xed pueden tener coste."})})})]})}),(0,E.jsx)(n.Ay,{item:!0,xs:12,children:(0,E.jsxs)(p.A,{className:"html-embedded email-response mail-body",children:[(0,E.jsx)(j.BW,{content:C.body,allowElements:!0}),C.hasAttachments>0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(h.A,{style:{marginTop:"2em"}}),(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[(0,E.jsx)("img",{src:ee.A,className:"special-badge"}),(0,E.jsx)(m.A,{variant:"body1",color:"textSecondary",component:"p",children:a("MalwareDownload.ProtectedByMicrosoftDefender","Archivos protegidos por Microsoft Defender for Cloud")})]}),(0,E.jsx)("table",{children:(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:(0,E.jsx)(Q.A,{fontSize:"large",htmlColor:"#aaa",style:{paddingBottom:"6px"}})}),(0,E.jsx)("td",{children:this.props.quickMode?(0,E.jsx)($.A,{quickMode:!0,attachments:this.props.attachments,temposPerAttachment:0}):(0,E.jsx)($.A,{mailId:C.id,temposPerAttachment:0})})]})})]})]})}),C.metaProperties&&!b&&(0,E.jsx)(n.Ay,{item:!0,xs:12,children:(0,E.jsx)(Z,{mail:C,currentUser:D})})]})}}const te=(0,w.CI)()(se)},72666(e,s,t){t.d(s,{A:()=>h});var a=t(9950),i=t(36971),n=t(82585),o=t(27038),r=t.n(o),l=(t(93204),t(74635)),d=t(67818),c=t(44414);class p extends a.Component{constructor(e){super(e)}render(){const e=this.props.user,s=this.props.date;return(0,c.jsxs)("div",{className:"mail-user-avatar",children:[this.props.override&&!0===this.props.override?(0,c.jsx)(i.A,{userImage:this.props.overrideAvatar,userName:this.props.overrideFirstLine,userLastname:this.props.overrideFirstLine,type:"mini"}):(0,c.jsx)(i.A,{userImage:e&&e.avatarUrl?e.avatarUrl:"",userLastname:e?e.lastName:"",userName:e?e.name:"",isExpert:!!e&&e.isExpert,isTop:!0===this.props.isTopUser,isDataCampus:!!e&&e.isDataCampus,type:"mini"}),(0,c.jsxs)("div",{className:"user-data",children:[(0,c.jsx)("div",{className:"user-date-date",children:s?!0===n.QN.l?this.props.showExpandedDate?"".concat(s.toLocaleDateString(l.Ay.language)," \xb7 ").concat(s.toLocaleTimeString(l.Ay.language)):(0,c.jsx)(r(),{fromNow:!0,date:s}):"".concat(s.toLocaleDateString(l.Ay.language)," \xb7 ").concat(s.toLocaleTimeString(l.Ay.language)):(0,c.jsx)("span",{children:"\xa0"})}),this.props.override&&!0===this.props.override?(0,c.jsx)("div",{className:"user-data-owner",children:(0,c.jsx)("strong",{children:this.props.overrideFirstLine})}):(0,c.jsxs)("div",{className:"user-data-owner",children:[this.props.prefix," ",(0,c.jsxs)("strong",{children:[e?e.name:""," ",e?e.lastName:""]})]}),(0,c.jsx)("div",{className:"user-data-subline",children:(0,c.jsx)("em",{children:this.props.subLine?this.props.subLine:""})}),this.props.promo&&(0,c.jsx)("div",{className:"user-data-promo",children:this.props.promo})]})]})}}const h=(0,d.CI)()(p)},19910(e,s,t){t.d(s,{A:()=>F});
1var a=t(9950),i=t(67818),n=t(96583),o=t(28170),r=t(16491),l=t(82053),d=t(60899),c=t(79739),p=t(18216),h=t(39287),m=t(10939),u=t(18145),x=t(66699),g=t(95505),f=t(97878),A=t(72179),b=t(41265),j=t(90221),y=t(66355),v=t.n(y),C=t(44414);class D extends a.Component{render(){const{t:e,classes:s,file:t,centerHeader:a}=this.props;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:s.file,children:[(0,C.jsxs)("div",{className:a?"".concat(s.topRow," ").concat(s.topRowCentered):s.topRow,children:[(0,C.jsxs)("span",{className:s.statusIcon,children:["undefined"===typeof t.uploadStatus&&(0,C.jsx)(j.A,{fontSize:"small",color:"secondary"}),"success"===t.uploadStatus&&(0,C.jsx)(b.A,{fontSize:"small",color:"primary"}),"error"===t.uploadStatus&&(0,C.jsx)(A.A,{fontSize:"small",color:"error"})]}),(0,C.jsx)(l.A,{variant:"body2",className:a?"".concat(s.filename," ").concat(s.filenameCentered):s.filename,color:t.uploadStatus?"error"===t.uploadStatus?"error":"primary":"textSecondary",component:"span",title:t.name,children:t.name})]}),(0,C.jsx)("div",{className:s.metaRow,children:(0,C.jsxs)(l.A,{variant:"body2",color:"textSecondary",component:"span",children:["(",v()(t.size),")"]})}),t.processing&&(0,C.jsx)("div",{className:s.processingBlock,children:(0,C.jsx)(w,{variant:"indeterminate"})})]}),"error"===t.uploadStatus&&t.uploadErrorMessage&&(0,C.jsxs)("div",{style:{fontSize:"8pt",paddingLeft:"1em",fontWeight:"bolder",color:"#F06666",textTransform:"uppercase"},children:[e("MailDashboard.Attachments.UploadGenericErrorPrefix")," :"," ",t.uploadErrorMessage]})]})}}const w=(0,h.A)(()=>({root:{height:2,borderRadius:0},colorPrimary:{backgroundColor:"#EEEEEE"},bar:{borderRadius:0,backgroundColor:"#b11258"}}))(x.A),M=((0,g.A)((0,f.A)({})),(0,i.CI)()((0,h.A)({processingBlock:{position:"absolute",left:0,right:0,bottom:0,width:"100%"},file:{position:"relative",display:"block",border:"1px solid #aaa",borderRadius:"4px",padding:"0.5em 0.5em 0.75em 0.5em",margin:"0.5em 0.25em 0 0.25em",overflow:"hidden",width:"100%"},topRow:{display:"flex",alignItems:"flex-start",gap:2,width:"100%",flexWrap:"nowrap"},topRowCentered:{justifyContent:"center",width:"100%",margin:"0 auto"},statusIcon:{lineHeight:1,marginTop:1,flex:"0 0 auto"},filename:{flex:1,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word",lineHeight:1.25,minHeight:"2.5em",maxWidth:"100%"},filenameCentered:{flex:"0 0 auto",textAlign:"center",maxWidth:"calc(100% - 18px)"},metaRow:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:6,minHeight:24,width:"100%"}})(D)));var S=t(75708);const N=a.memo(e=>{const{onDragStateChange:s,onFilesDrop:t,onDrag:i,onDragIn:n,onDragOut:o,onDrop:r}=e,[l,d]=a.useState(!1),c=a.useRef(null),p=a.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null===n||void 0===n||n(),e.dataTransfer.items&&e.dataTransfer.items.length>0&&d(!0)},[n]),h=a.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null===o||void 0===o||o(),d(!1)},[o]),m=a.useCallback(e=>{e.preventDefault(),e.stopPropagation(),null===i||void 0===i||i(),l||d(!0)},[l,i]),u=a.useCallback(e=>{if(e.preventDefault(),e.stopPropagation(),d(!1),null===r||void 0===r||r(),e.dataTransfer.files&&e.dataTransfer.files.length>0){const s=(e=>{const s=[];for(let t=0;t<e.length;t++)s.push(e.item(t));return s})(e.dataTransfer.files);null===t||void 0===t||t(s),e.dataTransfer.clearData()}},[r,t]);return a.useEffect(()=>{null===s||void 0===s||s(l)},[l]),a.useEffect(()=>{const e=null===c||void 0===c?void 0:c.current;return e&&(e.addEventListener("dragenter",p),e.addEventListener("dragleave",h),e.addEventListener("dragover",m),e.addEventListener("drop",u)),()=>{null===e||void 0===e||e.removeEventListener("dragenter",p),null===e||void 0===e||e.removeEventListener("dragleave",h),null===e||void 0===e||e.removeEventListener("dragover",m),null===e||void 0===e||e.removeEventListener("drop",u)}},[]),(0,C.jsx)("div",{ref:c,children:e.children})});N.displayName="DropZone";class k extends a.Component{constructor(){super(...arguments),this.state={isDropActive:!1,files:[]}
1,this.containerRef=(0,a.createRef)(),this.isDialogCancelled=!1,this.upload=e=>{const{contextId:s,uploadApi:t,deleteApi:a,t:i}=this.props;s&&(e.processing=!0,this.updateFileInState(e),t(s,{fileName:e.name,data:e}).then(s=>{switch(s.status){case 0:e.fileId=s.fileId,e.uploaded=!0,e.uploadStatus="success",this.isDialogCancelled&&e.fileId>0&&a(e).catch(()=>S.A.show("error",i("MailDashboard.Attachments.CantDelete")));break;case-100:e.uploadStatus="error",e.uploadErrorMessage=i("MailDashboard.Attachments.UploadErrorPermission");break;case-200:e.uploadStatus="error",e.uploadErrorMessage=i("MailDashboard.Attachments.UploadErrorQuota");break;default:e.uploadStatus="error",e.uploadErrorMessage=i("MailDashboard.Attachments.CantUpload")}this.updateFileInState(e)}).catch(()=>{e.uploadStatus="error",e.uploadErrorMessage=i("MailDashboard.Attachments.CantUpload")}).finally(()=>{e.processing=!1,this.updateFileInState(e)}))},this.handleFileSelection=e=>{const{maxFiles:s,maxUploadMB:t,t:a}=this.props,i=Math.max(0,s-this.state.files.length),n=e.slice(0,i),o=n.map(this.toFileStatus.bind(this));o.forEach(e=>{e.size>1024*t*1024&&(e.uploadStatus="error",e.uploadErrorMessage=a("MailDashboard.Attachments.MoreThanMB",{maxUpload:t}))});e.length-n.length>0&&S.A.show("warning",a("MailDashboard.Attachments.MoreThanXFiles",{max:s})),this.setState(e=>({files:[...o,...e.files]}),()=>{this.state.files.filter(e=>"undefined"===typeof e.uploadStatus&&!e.processing).forEach(e=>this.upload(e))})},this.handleDelete=e=>{const{deleteApi:s,t:t}=this.props;if(!e.uploaded)return this.revokePreview(e),void this.setState(s=>({files:s.files.filter(s=>s.name!==e.name||s.size!==e.size)}));e.fileId>0?s(e).then(s=>{s&&!0===s.deleted?(this.revokePreview(e),this.setState(s=>({files:s.files.filter(s=>s.fileId!==e.fileId)}))):S.A.show("error",t("MailDashboard.Attachments.CantDelete"))}).catch(()=>S.A.show("error",t("MailDashboard.Attachments.CantDelete"))):S.A.show("error",t("MailDashboard.Attachments.CantDelete"))},this.handleCancel=()=>{const{onClose:e}=this.props,s=this.state.files.slice();this.isDialogCancelled=!0,this.cleanupCancelledUploads(s),s.forEac
1h(this.revokePreview),this.setState({files:[]},()=>e(s,!1))},this.handlePaste=e=>{const s=this.filesFromClipboard(e);var t;s.length&&(null===(t=e.preventDefault)||void 0===t||t.call(e),this.handleFileSelection(s))},this.handleKeyPress=e=>{const{open:s,onClose:t}=this.props,{files:a}=this.state;if(!s||0===a.length)return;const i=!this.props.isConsolidating&&!a.some(e=>e.processing||"error"===e.uploadStatus);"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.altKey||!i||(e.preventDefault(),t(a,!0))}}componentDidUpdate(e){!e.open&&this.props.open&&(this.isDialogCancelled=!1),e.open&&!this.props.open&&this.state.files.length>0&&this.setState({files:[]})}componentDidMount(){document.addEventListener("keydown",this.handleKeyPress)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyPress),this.state.files.forEach(this.revokePreview)}toFileStatus(e){var s;const t=e;return t.fileId=0,t.processing=!1,t.uploaded=!1,t.uploadStatus=void 0,t.uploadErrorMessage=void 0,this.props.open&&null!==(s=e.type)&&void 0!==s&&s.startsWith("image/")&&(t.previewUrl=URL.createObjectURL(e)),t}revokePreview(e){e.previewUrl&&(URL.revokeObjectURL(e.previewUrl),e.previewUrl=void 0)}updateFileInState(e){this.setState(s=>{const t=s.files.slice(),a=t.findIndex(s=>s.name===e.name&&s.size===e.size);return-1!==a&&(t[a]=e),{files:t}})}mapFileListToArray(e){const s=[];for(let t=0;t<e.length;t++)s.push(e.item(t));return s}filesFromClipboard(e){const s="clipboardData"in e?e.clipboardData:window.clipboardData;if(!s)return[];const t=[];if(s.items&&s.items.length)for(let i=0;i<s.items.length;i++){const e=s.items[i];if("file"===e.kind){const s=e.getAsFile();s&&t.push(s)}}else if(s.files&&s.files.length)for(let i=0;i<s.files.length;i++)t.push(s.files[i]);const a=new Set;return t.filter(e=>{const s="".concat(e.name,"__").concat(e.size,"__").concat(e.type);return!a.has(s)&&(a.add(s),!0)})}cleanupCancelledUploads(e){const{deleteApi:s,t:t}=this.props,a=e.filter(e=>e.uploaded&&e.fileId>0);0!==a.length&&Promise.allSettled(a.map(e=>s(e))).then(e=>{e.some(e=>"rejected"===e.status||"fulfilled"===e.status&&!e.value.deleted)&&S.A.show("error",t("MailDashboard.Attachments.CantDelete"))})}render(){const{open:e,maxFiles:s,maxUploadMB:t,freeOfCharge:a,isConsolidating:h,onClose:x,classes:g,dialogClassName:f,showCostLogic:A=!1,t:b}=this.props,{files:j,isDropActive:y}=this.state,v=(()=>{const e=j.length;return 1===e?g.previewGridSingle:2===e?g.previewGridDouble:g.previewGrid})(),D=h||0===j.length||j.some(e=>e.processing||"error"===e.uploadStatus);return(0,C.jsxs)(n.A,{open:e,onClose:this.handleCancel,fullWidth:!0,maxWidth:"md",className:"".concat(g.dialog," ").concat(f||""),disableEscapeKeyDown:!1,children:[(0,C.jsx)(o.A,{style:{padding:0},onPaste:this.handlePaste,children:(0,C.jsx)("div",{className:g.dropZoneContainer,ref:this.containerRef,children:(0,C.jsx)(N,{onDragStateChange:e=>this.setState({isDropActive:e}),onFilesDrop:this.handleFileSelection,children:(0,C.jsx)(r.A,{className:g.dropZone,tabIndex:0,children:0===j.length?(0,C.jsxs)("div",{className:g.innerContainer,children:[(0,C.jsx)(l.A,{variant:"h5",color:"textSecondary",children:b("MailDashboard.Attachments.DialogDropFiles")}),(0,C.jsx)(m.A,{htmlColor:"#eee",className:g.bigIcon}),(0,C.jsxs)(l.A,{variant:"body2",color:"textSecondary",children:[A&&!a?(0,C.jsxs)(i.x6,{i18nKey:"ChatRooms.Attachments.DialogDropFilesParagraph",values:{maxFiles:s},children:["Cada archivo tiene un coste de",(0,C.jsx)(u.A,{value:100,color:"primary",forceStrong:!0})]}):A&&(0,C.jsx)(i.x6,{i18nKey:"ChatRooms.Attachments.DialogDropFilesParagraphNoCost",children:"La subida de archivos es gratuita"}),(0,C.jsx)("br",{}),(0,C.jsx)(i.x6,{i18nKey:"MailDashboard.Attachments.DialogDropFilesParagraphAlways",values:{maxFiles:s,maxUploadMB:t},components:{strong:(0,C.jsx)("strong",{})}})]})]}):(0,C.jsxs)("div",{className:g.innerContainer,children:[(0,C.jsx)("div",{className:v,children:j.map((e,s)=>{const t=s===j.length-1;return(0,C.jsxs)("div",{className:g.fileCard,children:[(0,C.jsxs)("div",{className:g.previewContainer,children:[e.previewUrl?(0,C.jsx)("img",{src:e.previewUrl,alt:e.name,className:g.previewImg,loading:"lazy",style:{gridArea:"1 / 1 / 2 / 2"}}):(0,C.jsx)("div",{className:g.previewPlaceholder,style:{gridArea:"1 / 1 / 2 / 2"},children:"PREVIEW"}),(0,C.jsx)("button",{type:"button",className:g.previewDelete,onClick:()=>this.handleDelete(e),disabled:e.processing,"aria-label":"Eliminar archivo",title:"Eliminar",style:{gridArea:"1 / 1 / 2 / 2"},children:"\u2715"})]}),(0,C.jsx)("div",{className:g.fileInfo,children:(0,C.jsx)(M,{file:e,onDelete:()=>this.handleDelete(e),centerHeader:t})}),A&&!a&&(0,C.jsx)("div",{className:g.fileCostContainer,children:(0,C.jsx)(u.A,{value:100,forceStrong:!0,color:"primary"})})]},"f-".concat(e.name,"-").concat(s))})}),A&&!a&&(0,C.jsx)(d.Ay,{container:!0,alignItems:"flex-end",justifyContent:"center",children:(0,C.jsxs)(l.A,{className:g.paddingTop,variant:"h5",component:"h5",children:["Total:"," ",(0,C.jsx)(u.A,{value:100*j.length,color:"primary",forceStrong:!0})]})})]})})})})}),(0,C.jsxs)(c.A,{className:g.actions,children:[(0,C.jsxs)("span",{className:g.chooseWrapper,children:[(0,C.jsx)("input",{id:"btn-upload-w",name:"btn-upload-w",type:"file",multiple:!0,style:{display:"none"},onChange:e=>{if(e.stopPropagation(),e.preventDefault(),e.target.files&&e.target.files.length>0){const s=this.mapFileListToArray(e.target.files);this.handleFileSelection(s),e.target.value=""}}}),(0,C.jsx)("label",{htmlFor:"btn-upload-w",children:(0,C.jsx)(p.A,{variant:"outlined",component:"span",className:g.button,size:"small",color:"primary",children:b("MailDashboard.Attachments.ChooseFileButton")})})]}),(0,C.jsx)(p.A,{onClick:this.handleCancel,color:"secondary",variant:"outlined",children:b("Common.CancelButton")}),j.length>0&&(0,C.jsx)(p.A,{onClick:()=>x(j,!0),className:g.inverseButton,color:"primary",variant:"contained",disabled:D,style:{whiteSpace:"normal",display:"flex",alignItems:"center",flexDirection:"column",gap:6},children:(0,C.jsxs)("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:6},children:[b("ChatRooms.Attachments.AllAttachmentkOkButton"),A&&!a&&(0,C.jsx)(u.A,{value:100*j.length,forceStrong:!0,color:"secondary"})]})})]})]})}}const F=(0,i.CI)()((0,h.A)(e=>({middle:{verticalAlign:"middle"},paddingTop:{marginTop:e.spacing(2)},dropZoneContainer:{marginTop:"1em",minHeight:400,width:"100%",border:"4px dashed #eee",borderRadius:8},dropZone:{minHeight:400,display:"flex",alignItems:"center",width:"100%",overflow:"auto"},bigIcon:{fontSize:100},innerContainer:{textAlign:"center",width:"100%",padding:"1em",overflow:"hidden"},previewGridSingle:{display:"flex",justifyContent:"center",alignItems:"start",width:"100%","& > div":{maxWidth:400,width:"100%"}},previewGridDouble:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:16,justifyContent:"center",[e.breakpoints.down("sm")]:{gridTemplateColumns:"1fr"}},previewGrid:{display:"grid",gap:16,gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",maxWidth:"100%",[e.breakpoints.up("md")]:{gridTemplateColumns:"repeat(3, 1fr)"},[e.breakpoints.down("md")]:{gridTemplateColumns:"repeat(2, 1fr)"},[e.breakpoints.down("sm")]:{gridTemplateColumns:"1fr"}},fileCard:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"#fff",display:"flex",flexDirection:"column",boxShadow:"0 1px 2px rgba(0,0,0,0.04)",transition:"box-shadow 120ms ease","&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.08)"}},previewContainer:{width:"100%",aspectRatio:"16 / 9",borderRadius:8,overflow:"hidden",background:"#fafafa",marginBottom:12,display:"grid",[e.breakpoints.down("sm")]:{aspectRatio:"4 / 3"}},previewDelete:{placeSelf:"start end",width:28,height:28,borderRadius:9999,border:"none",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.92)",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",cursor:"pointer",transition:"transform .12s ease",margin:6,"&:hover":{transform:"scale(1.05)"},"&:disabled":{opacity:.6,cursor:"not-allowed"}},previewImg:{width:"100%",height:"100%",objectFit:"contain"},previewPlaceholder:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#999",fontSize:12,fontWeight:500},fileInfo:{flex:"0 0 auto",width:"100%",marginBottom:8,minHeight:72},fileCostContainer:{display:"flex",justifyContent:"center",alignItems:"center",paddingTop:8,borderTop:"1px solid #f3f4f6"},dialog:{"& .MuiDialog-paper":{border:"6px solid #ff702c",borderRadius:32,padding:"8px 16px",overflow:"visible"}
1,"& .MuiDialogTitle-root":{borderBottom:"2px solid #ff702c"}},inverseButton:{color:"white"},button:{margin:e.spacing(1)},actions:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:12,padding:e.spacing(2),[e.breakpoints.down("sm")]:{display:"grid",gridAutoFlow:"row",gridTemplateColumns:"1fr",gap:12,padding:e.spacing(2),"& > *":{width:"100%"},"& button":{minHeight:44},"& label > .MuiButton-root":{width:"100%"}},"& .MuiButton-fullWidth":{[e.breakpoints.up("sm")]:{width:"auto"}}},chooseWrapper:{display:"inline-block",[e.breakpoints.down("sm")]:{display:"block",width:"100%"}}}))(k))},93339(e,s,t){t.d(s,{A:()=>m});var a=t(9950),i=t(82053),n=t(72362),o=t(67818),r=t(14227),l=t.n(r),d=t(85068),c=t(7762),p=t(44414);class h extends a.Component{constructor(e){super(e),this.state={open:!1,anchorEl:null}}render(){const{open:e,anchorEl:s}=this.state,{t:t,selectedEmoji:a,onSelectEmoji:o,onClearEmoji:r}=this.props;return(0,p.jsxs)("span",{className:"mpi-select-emoji",children:[(0,p.jsx)("span",{className:"clickable",onClick:s=>this.setState({open:!e,anchorEl:s.currentTarget}),children:a?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(i.A,{variant:"body2",color:"textSecondary",component:"span",style:{verticalAlign:"middle"},children:[t("Tips.SelectEmoji.ReactedLabelMe","Has reaccionado con")," "]}),(0,p.jsx)("span",{style:{verticalAlign:"middle"},children:a})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d.A,{style:{verticalAlign:"middle"},fontSize:"large"}),(0,p.jsxs)(i.A,{variant:"body2",color:"textSecondary",component:"span",style:{verticalAlign:"middle"},children:[t("Tips.SelectEmoji.ReactLabel","\xa1Reacciona!")," "]})]})}),(0,p.jsx)("span",{className:"delete",children:a&&(0,p.jsx)(c.A,{fontSize:"small",style:{verticalAlign:"middle",marginBottom:"0.25em",curs
1or:"pointer"},onClick:()=>{r&&r()}})}),(0,p.jsx)(n.Ay,{open:e,anchorEl:s,onClose:()=>{this.setState({anchorEl:null,open:!1})},children:(0,p.jsx)("div",{className:"customEmojiPicker",children:(0,p.jsx)(l(),{native:!0,onEmojiClick:(e,s)=>{this.setState({open:!1}),o&&o(s.emoji)},disableSearchBar:!0,disableAutoFocus:!0,disableSkinTonePicker:!0,groupVisibility:{flags:!1,travel_places:!1,recently_used:!0,symbols:!1,activities:!1,objects:!1,animals_nature:!1,food_drink:!1}})})})]})}}const m=(0,o.CI)()(h)},30692(e,s,t){t.d(s,{A:()=>l});var a=t(9950),i=t(72058);const n=t.p+"static/media/tempo-border-icon.a6a026af59c893c82d5295d310ac040c.svg";var o=t(44414);class r extends a.Component{constructor(e){super(e)}render(){return(0,o.jsxs)("div",{className:"tempos-button-component ".concat(this.props.size),children:[(0,o.jsx)(i.t,{src:n}),(0,o.jsx)("div",{className:"tempos-button-component-inner",children:(0,o.jsx)("div",{className:"tempos-button-value",children:this.props.tempos})})]})}}const l=r},81211(){}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.