"use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[602],{14085:function(e,t,n){n.d(t,{Z:function(){return Ie}});var a=n(6041),i=n(26274),r=function(){var e=this,t=e._self._c;return e.showResponse[e.messageId]?t("div",{key:e.data.mailHead.msgId,ref:"mailDraftRoot",class:[{"hide-divider":e.hideDivider,"is-freezed":e.draftIsFreezed}],attrs:{id:e.data.mailHead.msgId}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.draftOpenInCompose,expression:"draftOpenInCompose"}],class:["pop-in",e.recentOnTop&&"draft-on-top"]},[t("span",{staticClass:"pop-in-action tab-focus",attrs:{role:"button",tabindex:"0"},on:{click:e.handlePopIn,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handlePopIn.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.handlePopIn.apply(null,arguments)}]}},[e._v(" "+e._s(e.$t("operation.popIn"))+" ")]),t("span",{staticClass:"pop-in-text"},[e._v(e._s(e.$t("operation.popInDescription")))])]),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.draftOpenInCompose,expression:"!draftOpenInCompose"},{name:"loading",rawName:"v-loading",value:e.isSending,expression:"isSending"}],class:["response-reply","zoom-modal"],attrs:{id:"reply-container-"+e.msgId,"element-loading-spinner":"zm-icon-loading"},on:{focusin:e.handleFocusIn}},[t("StickyLayout",{ref:"stickyLayout",attrs:{getScrollContainer:e.getScrollContainer,minContentHeight:144},scopedSlots:e._u([{key:"header",fn:function(){return[t("div",{staticClass:"title-bar"},[t("zm-dropdown",{attrs:{trigger:"click",placement:"bottom-start"},on:{command:e.handleReplyMenu}},[t("zm-button",{staticClass:"response-menu-button",attrs:{disabled:e.isSending,"zm-ta":"response-menu-button-"+(e.isReplyAll?"reply-all":e.isForward?"forward":"reply")}},[t("div",[e._v(" "+e._s(e.isReplyAll?e.$t("operation.replyAll"):e.isForward?e.$t("operation.forward"):e.$t("operation.reply"))+" "),t("SvgIcon",{attrs:{iconClass:"chevron-small-down"}})],1)]),t("zm-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("zm-dropdown-item",{staticClass:"response-menu-item clearfix",attrs:{command:"Reply","zm-ta":"response-menu-button-item-reply"}},[e._v(" "+e._s(e.$t("operation.reply"))+" ")]),e.canReplyAll?t("zm-dropdown-item",{staticClass:"response-menu-item clearfix",attrs:{command:"Reply All","zm-ta":"response-menu-button-item-reply-all"}},[e._v(" "+e._s(e.$t("operation.replyAll"))+" ")]):e._e(),t("zm-dropdown-item",{staticClass:"response-menu-item clearfix",attrs:{command:"Forward","zm-ta":"response-menu-button-item-forward"}},[e._v(" "+e._s(e.$t("operation.forward"))+" ")]),t("div",{staticClass:"response-menu-divider"}),e.showSubject?e._e():t("zm-dropdown-item",{staticClass:"response-menu-item clearfix",attrs:{command:"Edit Subject","zm-ta":"response-menu-button-item-edit-subject"}},[e._v(" "+e._s(e.$t("operation.editSubject"))+" ")]),t("zm-dropdown-item",{staticClass:"response-menu-item clearfix",attrs:{command:"Pop Out","zm-ta":"response-menu-button-item-pop-out"}},[e._v(" "+e._s(e.$t("operation.popOut"))+" ")])],1)],1),t("zm-tooltip",{attrs:{content:e.$t("operation.popOut"),enterable:!1}},[t("zm-button",{staticClass:"pop-out-button",attrs:{"zm-ta":"compose-pop-out-button",disabled:e.isSending},on:{click:e.handlePopOut}},[t("SvgIcon",{attrs:{iconClass:"pop-window"}})],1)],1)],1),t("div",{class:["recipients",{disabled:e.draftIsFreezed}]},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.isComposeFromFieldVisible,expression:"isComposeFromFieldVisible"}],staticClass:"recipients-line",attrs:{disabled:e.isSending}},[t("span",{staticClass:"recipients-line-label"},[e._v(e._s(e.$t("editor.from")))]),e.hasSendAsList?t("FromSelector",{attrs:{fromUserMail:e.fromUserMail,replyTo:e.replyTo},on:{"update:fromUserMail":function(t){e.fromUserMail=t},"update:from-user-mail":function(t){e.fromUserMail=t},"update:replyTo":function(t){e.replyTo=t},"update:reply-to":function(t){e.replyTo=t}}}):e._e(),e.hasAliasList?t("AliasSelector",{attrs:{disabled:e.isAliasSelectorDisabled},on:{select:e.onSelectAlias}}):e._e()],1),t("div",{ref:"contactSelectors"},[t("div",{staticClass:"recipients-line"},[t("span",{staticClass:"recipients-line-label"},[e._v(e._s(e.$t("filter.to")))]),t("contacts-selector",{ref:"toContactRef",attrs:{type:"to",disabled:e.draftIsFreezed,value:e.to,sender:e.from,disableAllActions:e.isDraftLocked,readOnlyMode:e.isSending},on:{change:function(t){e.to=t,e.composePrepared=t},typeMapChange:function(t){e.toContactToTypeMap=t},resetShowActions:e.resetShowActions}}),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.showCc,expression:"!showCc"}],staticClass:"additional-recipients-toggle tab-focus",attrs:{tabindex:"0",role:"button","aria-label":e.$t("accessibility.addCc"),"aria-disabled":e.isSending.toString()},on:{click:function(t){return t.stopPropagation(),e.handleCc.apply(null,arguments)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleCc.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.handleCc.apply(null,arguments)}]}},[e._v(" "+e._s(e.$t("editor.cc"))+" ")]),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.showBcc,expression:"!showBcc"}],staticClass:"additional-recipients-toggle tab-focus",attrs:{tabindex:"0",role:"button","aria-label":e.$t("accessibility.addBcc"),"aria-disabled":e.isSending.toString()},on:{click:function(t){return t.stopPropagation(),e.handleBcc.apply(null,arguments)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleBcc.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:e.handleBcc.apply(null,arguments)}]}},[e._v(" "+e._s(e.$t("editor.bcc"))+" ")])],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showCc,expression:"showCc"}],ref:"ccField",staticClass:"recipients-line"},[t("span",{staticClass:"recipients-line-label"},[e._v(e._s(e.$t("editor.cc")))]),t("contacts-selector",{ref:"ccContactRef",attrs:{type:"cc",value:e.cc,disabled:e.draftIsFreezed,disableAllActions:e.isDraftLocked||e.draftIsFreezed,readOnlyMode:e.isSending},on:{change:function(t){e.cc=t,e.composePrepared=t},typeMapChange:function(t){e.ccContactToTypeMap=t},resetShowActions:e.resetShowActions}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showBcc,expression:"showBcc"}],ref:"bccField",staticClass:"recipients-line"},[t("span",{staticClass:"recipients-line-label"},[e._v(e._s(e.$t("editor.bcc")))]),t("contacts-selector",{ref:"bccContactRef",attrs:{type:"bcc",disabled:e.draftIsFreezed,value:e.bcc,disableAllActions:e.isDraftLocked||e.draftIsFreezed,readOnlyMode:e.isSending},on:{change:function(t){e.bcc=t,e.composePrepared=t},typeMapChange:function(t){e.bccContactToTypeMap=t},resetShowActions:e.resetShowActions}})],1)]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showSubject,expression:"showSubject"}],staticClass:"recipients-line"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.subject,expression:"subject"}],ref:"subjectRef",staticClass:"subject-field",attrs:{type:"text",placeholder:e.$t("editor.subject")},domProps:{value:e.subject},on:{input:function(t){t.target.composing||(e.subject=t.target.value)}}})])])]},proxy:!0},{key:"footer",fn:function(){var n;return[t("div",{staticClass:"footer"},[e.isQuarantined?e._e():[e.bannerVisibility.offline?t("offline-mode-compose-banner"):e._e(),e.bannerVisibility.externalUser?t("external-user-warning-banner",{on:{dismiss:function(t){e.externalBannerDismissed=!0}}}):e._e(),e.bannerVisibility.recipientLimit?t("recipient-length-limit-banner"):e._e(),e.bannerVisibility.groupUser?t("group-email-banner",{on:{dismiss:function(t){e.groupBannerDismissed=!0}}}):e._e(),e.bannerVisibility.expiration?t("expiration-banner",{attrs:{expirationSeconds:e.expirationSeconds,addExternalNote:e.hasInternalRecipients},on:{edit:e.openEncryptionModal,dismiss:e.handleCloseExpirationBanner}}):e._e(),e.bannerVisibility.scheduledSend?t("scheduled-send-banner",{ref:"scheduledSend",attrs:{scheduledTime:e.scheduledTime,isEdit:!0},on:{handleCustomTimeVisible:e.handleCustomTimeVisible,handleEditScheduledSend:e.handleEditScheduledSend,handleScheduledSend:e.handleScheduledSend,setScheduledTime:e.setScheduledTime}}):e._e(),e.isDelegated?t("delegate-banner",{attrs:{showDelegateBanner:e.isDelegated}}):e._e(),e.bannerVisibility.ooo?t("OOOStatusBanner",{attrs:{recipientsStatus:e.recipientsStatus},on:{hide:e.forceHide}}):e._e()],e.availableAttachmentList.length>0&&e.renderAttach?t("AttachmentsList",{attrs:{attachments:e.availableAttachmentList,showDelete:!0,fromPopOut:!0},on:{deleteItem:e.handleDeleteItem}}):e._e(),e.$refs.editor?t("editor-toolbar",{directives:[{name:"show",rawName:"v-show",value:e.showFixedEditTool,expression:"showFixedEditTool"}],attrs:{"zm-ta":"new-compose-editor-toolbar",isFlowStyle:!1,isFloatStyle:!0,formatState:e.$refs.editor.formatState,selectedFontSize:e.$refs.editor.selectedFontSize},on:{commandAction:e.$refs.editor.handleToolbarAction,showLinkEdit:e.$refs.editor.showLinkEditDialog,changeToFixedToolbar:e.$refs.editor.changeToFixedToolbar,handleFontSizeChange:e.$refs.editor.handleFontSizeChange}}):e._e(),e.isDraftLocked||e.draftIsFreezed?t("toolbar",{attrs:{disabledActions:"all",msgId:e.msgId}}):t("toolbar",{attrs:{showEditTool:e.showFixedEditTool,isSending:e.isSending,hasDraftContent:!!e.plainDraftContent,hiddenActions:(n={},(0,i.Z)(n,e.ToolbarActions.INSERT_INLINE_IMAGE,!0),(0,i.Z)(n,e.ToolbarActions.SET_ENCRYPTION,!e.showEncryptionButton),n),disabledActions:(0,i.Z)({},e.ToolbarActions.DELAYED_SEND,"Uploading"===e.attachmentsStatus||e.hasRecipientsLengthExceedLimit),isEditScheduledSend:e.isEditScheduledSend,scheduledTime:e.scheduledTime,msgId:e.msgId,isPromptEditorVisible:e.isPromptEditorVisible,respondType:e.respondType,selectedSignatureId:e.selectedSignatureId,encryptionActive:e.encryptionActive,getEditorRef:function(){return e.$refs.editor},customTimeVisible:e.customTimeVisible},on:{toggleEditTool:function(t){e.showFixedEditTool=!e.showFixedEditTool},handleScheduledSend:e.handleScheduledSend,handleEditScheduledSend:e.handleEditScheduledSend,handleCustomTimeVisible:e.handleCustomTimeVisible,setScheduledTime:e.setScheduledTime,send:e.handleDelayedSend,selectSignature:e.handleSelectSignature,setExternalExpiration:e.setExpirationTime,delete:e.handleDraftDelete,replyEmailFromPrompt:e.onReplyEmailFromPrompt,setEncryption:e.handleSetEncryption}})],2)]},proxy:!0}],null,!1,3600369647)},[e.isDraftLocked?t("div",{ref:"editor",staticClass:"response-compose"},[t("locked-draft-content",{attrs:{draftDetail:e.currentResponseDraft,labelId:e.currentLabelId},on:{updateDraftContent:e.handleUpdateDraftContent}})],1):t("observer-component",{class:["response-compose",{"is-freezed":e.draftIsFreezed}],attrs:{"aria-label":e.$t("accessibility.messageBody")},scopedSlots:e._u([{key:"default",fn:function(n){var a,i=n.isRender;return[e.isQuarantined?t("div",{staticClass:"quarantined-overlay"},[e._v(" "+e._s(e.$t("compliance.lockedQuarantinedDraft"))+" ")]):e._e(),t("drop-zone",{attrs:{disabled:e.draftIsFreezed,onDragEnter:e.debouncedPositionUploader,onDragOver:e.handleDragZoneDragOver,onLeaveWindow:e.onLeaveWindow,filesOnly:""}},[i||e.isShowEditor?t("editor",{ref:"editor",attrs:{disabled:e.draftIsFreezed,inlineImages:e.inlineImages,to2Contacts:e.to2Contacts,useToolbar:!e.showFixedEditTool,getVisibleAreaRect:null===(a=e.$refs.stickyLayout)||void 0===a?void 0:a.getVisibleContentAreaRect,"zm-ta":"new-compose-editor"},on:{editorMounted:e.editorMounted,input:e.handleEditorContentUpdate,immediateUpdate:e.handleImmediateUpdate,onDragEnter:e.debouncedPositionUploader,showFileSelector:e.showFileSelector,pasteFiles:e.uploadFiles,imageInserted:e.removeInsertedImage,addContact:e.handleAddContact,removeContact:e.handleRemoveContact,changeToFixedToolbar:function(t){e.showFixedEditTool=!0}}}):e._e()],1)]}}],null,!1,3295036409)})],1)],1),t("EncryptionDialog",{attrs:{showE2EEDescription:e.hybridModeActive,visible:e.showEncryptionModal,defaultExpiration:e.expirationSeconds},on:{onCancel:e.closeEncryptionModal,onOk:e.setExpirationTime,onRemove:function(t){return e.removeExpirationTime(!0)}}}),t("prompt-editor",{attrs:{visible:e.isPromptEditorVisible,"preset-draft":e.plainDraftContent,recipients:[].concat((0,a.Z)(e.to),(0,a.Z)(e.cc)),conversations:e.conversations,respondType:e.respondType},on:{closePromptEditor:function(t){e.isPromptEditorVisible=!1},onInsertContent:e.insertNewCompose,onHasGeneratedContent:e.onHasGeneratedContent}})],1):e._e()},o=[],s=n(68571),l=n(70021),d=n(56706),c=n(34948),u=(n(6886),n(77950),n(6710),n(43430),n(37348)),m=n.n(u),h=n(37761),p=n.n(h),f=n(29648),g=n(79337),v=n(71951),b=n(53806),y=n(63012),I=n(53744),w=n(96713),S=n(75739),C=n(19030),k=n(64908),T=n(12546),x=function(){var e=this,t=e._self._c;return t("div",{ref:"observer"},[e._t("default",null,{isRender:e.isRender})],2)},D=[],M=200,E={name:"ObserverComponent",data:function(){return{timeStart:0,isRender:!1}},mounted:function(){var e=this;this.$observer=new IntersectionObserver((function(t){var n=(0,s.Z)(t,1),a=n[0];a.isIntersecting?(e.timeStart=Date.now(),e.timeCounter()):e.timeStart=0}),{threshold:[0,.2],rootMargin:"0px 0px 0px 0px"}),this.$nextTick((function(){e.$observer.observe(e.$refs.observer)}))},beforeDestroy:function(){var e;null===(e=this.$observer)||void 0===e||e.disconnect(),this.$observer=null},methods:{timeCounter:function(){var e=this;requestAnimationFrame((function(){if(e.timeStart){var t,n=Date.now()-e.timeStart;if(n>M)return null===(t=e.$observer)||void 0===t||t.disconnect(),void(e.isRender=!0);e.timeCounter()}}))}}},R=E,L=n(93483),A=(0,L.Z)(R,x,D,!1,null,null,null),$=A.exports,H=n(70607),B=n(87693),O=n(69899),_=n(17891),Z=n(36463),P=n(19052),F=n(7790),N=n(61514),z=n(81020),U=n(54700),V=n(60659),j=n(94256),W=n(41331),G=n(66235),q=n(84912),K=n(77291),Q=n(94e3),Y=function(){var e=this,t=e._self._c;return t("div",{ref:"stickyLayout",staticClass:"sticky-layout"},[t("div",{ref:"scrollIntoViewRegion",style:{pointerEvents:"none",width:"".concat(e.stickyLayoutWidth,"px"),top:"0px",position:"absolute",height:"".concat(e.headerHeight+e.minContentHeight+e.footerHeight,"px")}}),t("div",{ref:"header",staticClass:"sticky-layout-header",style:{width:"".concat(e.stickyLayoutWidth,"px"),top:"".concat(e.headerTop,"px"),position:e.headerPosition}},[e._t("header")],2),t("div",{directives:[{name:"show",rawName:"v-show",value:"relative"!==e.headerPosition,expression:"headerPosition !== 'relative'"}],ref:"headerBuffer",style:{height:"".concat(e.headerHeight,"px")}}),t("div",{ref:"content"},[e._t("default")],2),t("div",{ref:"footer",staticClass:"sticky-layout-footer",style:{width:"".concat(e.stickyLayoutWidth,"px"),bottom:"".concat(e.footerBottom,"px"),position:e.footerPosition}},[e._t("footer")],2),t("div",{directives:[{name:"show",rawName:"v-show",value:"relative"!==e.footerPosition,expression:"footerPosition !== 'relative'"}],ref:"footerBuffer",style:{height:"".concat(e.footerHeight,"px")}})])},J=[],X=n(33223),ee={name:"StickyLayout",props:{getScrollContainer:{type:Function,default:function(){}},minContentHeight:{type:Number,default:100}},data:function(){return{scrollContainer:null,headerResizeObserver:null,footerResizeObserver:null,stickyLayoutResizeObserver:null,headerHeight:0,footerHeight:0,headerPosition:"relative",footerPosition:"relative",headerTop:0,footerBottom:0,stickyLayoutWidth:0}},mounted:function(){var e=this;this.headerResizeObserver=new X.Z((function(t){e.headerHeight=t[0].borderBoxSize[0].blockSize,e.updateHeaderAndFooterPosition()})),this.headerResizeObserver.observe(this.$refs.header),this.footerResizeObserver=new X.Z((function(t){e.footerHeight=t[0].borderBoxSize[0].blockSize,e.updateHeaderAndFooterPosition()})),this.footerResizeObserver.observe(this.$refs.footer),this.stickyLayoutResizeObserver=new X.Z((function(){e.updateHeaderAndFooterPosition(),e.updateStickyLayoutWidth()})),this.stickyLayoutResizeObserver.observe(this.$refs.stickyLayout),this.scrollContainer=this.getScrollContainer(),this.scrollContainer&&(this.scrollContainerResizeObserver=new X.Z((function(){e.updateHeaderAndFooterPosition()})),this.scrollContainerResizeObserver.observe(this.scrollContainer),this.scrollContainer.addEventListener("scroll",this.handleParentScroll)),this.headerHeight=this.$refs.header.getBoundingClientRect().height,this.footerHeight=this.$refs.footer.getBoundingClientRect().height,this.updateStickyLayoutWidth(),this.updateHeaderAndFooterPosition()},beforeDestroy:function(){var e,t,n,a,i;null===(e=this.headerResizeObserver)||void 0===e||e.disconnect(),null===(t=this.footerResizeObserver)||void 0===t||t.disconnect(),null===(n=this.stickyLayoutResizeObserver)||void 0===n||n.disconnect(),null===(a=this.scrollContainerResizeObserver)||void 0===a||a.disconnect(),null===(i=this.scrollContainer)||void 0===i||i.removeEventListener("scroll",this.handleParentScroll)},methods:{scrollIntoView:function(e){var t=e.block,n=e.behavior,a=e.ignoreIfFullyInView;a&&!this.notInFullView||this.$refs.scrollIntoViewRegion.scrollIntoView({block:t,behavior:n})},handleParentScroll:function(){this.updateHeaderAndFooterPosition()},updateStickyLayoutWidth:function(){this.stickyLayoutWidth=this.$refs.stickyLayout.getBoundingClientRect().width},updateHeaderAndFooterPosition:function(){if(this.scrollContainer){var e=this.scrollContainer.getBoundingClientRect(),t=this.$refs.stickyLayout.getBoundingClientRect(),n=t.top-e.top,a=t.bottom-e.top,i=e.bottom-t.top,r=e.bottom-t.bottom,o=this.headerHeight+this.minContentHeight+this.footerHeight;if(n>=0)this.headerPosition="relative",this.headerTop=0;else{var s=a-o;s>=0?(this.headerPosition="fixed",this.headerTop=e.top):(this.headerPosition="absolute",this.headerTop=s-n)}if(r>=0)this.footerPosition="relative",this.footerBottom=0;else{var l=i-o;l>=0?(this.footerPosition="fixed",this.footerBottom=window.innerHeight-e.bottom):(this.footerPosition="absolute",this.footerBottom=l-r)}this.notInFullView=ithis.outgoingRecipientsLimitPerMessage},isShowEditor:function(){return this.isReplyClicked||this.isFirstDraft||this.isForward},isAliasSelectorDisabled:function(){return this.mailEncryptionMode!==fe.PLAINTEXT},bannerVisibility:function(){return{offline:this.isOfflineByDisconnection,externalUser:this.hasExternalRecipients&&!this.externalBannerDismissed&&!this.showExpirationBanner&&this.externalWarningConfiguration.warningBannerSendEnabled,recipientLimit:this.hasRecipientsLengthExceedLimit,groupUser:this.hasGroupRecipients&&!this.groupBannerDismissed,expiration:this.showExpirationBanner,scheduledSend:this.showScheduledSendBanner,ooo:this.showOOO}}}),watch:{bannerVisibility:function(e,t){if(this.windowContainsFocus())for(var n in t)if(!1===t[n]&&!0===e[n])return void setTimeout(this.scrollIntoView)},availableAttachmentList:function(e,t){this.windowContainsFocus()&&e.length!==t.length&&setTimeout(this.scrollIntoView)},draftOpenInCompose:function(e){var t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var a;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t.creatingOrUpdating=!1,console.error("draftOpenInCompose changed",e),e){n.next=15;break}return n.next=5,t.getUpdatedDraftDetails();case 5:if(a=n.sent,!a){n.next=12;break}return n.next=9,t.initResponse(!0,a,!0);case 9:t.scrollIntoView(),n.next=15;break;case 12:t.resetInfo(),t.$emit("onReplyTo",""),t.setResponseStatus({msgId:t.messageId,showResponse:!1});case 15:case"end":return n.stop()}}),n)})))()},cc:function(e,t){p().isEqual(e,t)||(this.showCc=!0)},bcc:function(e,t){p().isEqual(e,t)||(this.showBcc=!0)},hasExternalOrGroupRecipients:function(e){e||this.removeExpirationTime()},activeKeyBinding:function(e){var t=e.action,n=e.event;if(this.windowContainsFocus())switch(t){case"editor-send":n.preventDefault(),"Uploading"==this.attachmentsStatus||this.hasRecipientsLengthExceedLimit||this.draftIsFreezed||!this.showResponse[this.messageId]||this.handleDelayedSend();break;case"editor-add-cc":n.preventDefault(),this.handleCc();break;case"editor-add-bcc":n.preventDefault(),this.handleBcc();break;default:break}},showFixedEditTool:function(e){this.windowContainsFocus()&&e&&setTimeout(this.scrollIntoView)}},created:function(){var e=this;this.draftCreatedAtLabelId=this.currentLabelId,this.updateMailHead=(0,d.Z)((0,l.Z)().mark((function t(){var n;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,y.Inbox.getMailHead({labelId:e.draftCreatedAtLabelId,mailId:e.currentInboxItem.mailId});case 3:n=t.sent,n&&e.$store.commit("batchAddMailHeads",{labelId:e.draftCreatedAtLabelId,mailHeads:[n.mailHead]}),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](0),console.log(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])}))),this.debouncedComposeChange=p().debounce((function(){e.doCreateOrUpdate()}),I.Z.composeChangedFrequency,{leading:!0,trailing:!0}),this.monitorComposeChange=function(){e.showResponse[e.messageId]&&e.composePrepared&&e.$needUpdate&&(e.isComposeDirty=!0,e.debouncedComposeChange())},y.Setting.getPersistentSetting({key:pe.EDIT_TOOL}).then((function(t){var n=t.errorCode,a=t.data;if(0===n)try{var i=JSON.parse((null===a||void 0===a?void 0:a.value)||"{}"),r=i.hideToolbarByDefault,o=void 0===r||r,s=i.fontSize,l=void 0===s?"medium":s;e.hideToolbarByDefault=o,e.defaultFontSize=l}catch(d){console.error(d)}}))},mounted:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.selectedSignatureId=e.defaultReplyComposeSignatureId,e.initResponse();case 2:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){this.$needUpdate&&(console.log("debouncedComposeChange flush"),this.debouncedComposeChange.flush())},methods:(0,c.Z)((0,c.Z)((0,c.Z)({isElementInViewport:function(e){if(!e)return!1;var t=e.getBoundingClientRect();return t.top>=0&&t.top<=window.innerHeight},checkAndAdjustPosition:function(){void 0!==this.$refs.mailDraftRoot&&this.isElementInViewport(this.$refs.mailDraftRoot)},triggerImageSelector:function(){this.$refs.editor.handleToolbarAction({commandType:K.d.INSERT_IMAGE})},windowContainsFocus:function(){return this.$el.contains(document.activeElement)}},(0,f.OI)(["setPrintingMailFlag","setCurrentInboxItem","updateMsgReplyStatus","setInstantDraftList","changeRecipientInfo"])),(0,f.nv)({setSendingStatus:"compose/setSendingStatus",setResponseStatus:"compose/setResponseStatus",removeReplyLater:"mail/removeReplyLater",insertSignatureContent:"signature/insertSignatureContent",getDefaultSignatureContent:"signature/getDefaultSignatureContent",getSignatureIdFromDraftContent:"signature/getSignatureIdFromDraftContent"})),{},{updatePlainDraftContent:function(){this.plainDraftContent=(0,q.C8)((0,B.mM)(this.getEditorContent()))},scrollIntoView:function(){var e,t;this.draftOpenInCompose?null===(e=this.$el)||void 0===e||e.scrollIntoView({behavior:"instant",block:"end"}):null===(t=this.$refs.stickyLayout)||void 0===t||t.scrollIntoView({behavior:"instant",block:"end",ignoreIfFullyInView:!0})},handleUpdateDraftContent:function(e){var t=this;this.cacheDraftDetail=this.cacheDraftDetail.map((function(t){return e.mailHead.msgId===t.mailHead.msgId?e:t})),this.composePrepared=!1,this.$nextTick((function(){t.initResponse(!1),t.$nextTick((function(){t.composePrepared=!0}))})),this.$emit("refreshTheadHead",e.mailHead.mailId)},autoDownloadDraft:function(e){var t=this;(0,S.Ve)({msgId:this.isOutlookStandaloneDraft?this.data.mailHead.msgId:this.getReplyDraft.mailHead.msgId,downloadDir:"",aid:e.aid,size:e.size}).then((function(e){console.log("download draft attachment item dat=",e),0===e.returnCode&&t.$emit("showDetail",t.currentInboxItem,{override:!0,reload:!0})}))["catch"]((function(e){console.log("download draft attachment item error",e)}))},resetInfo:function(){var e;this.cc=[],this.bcc=[],this.to=[],this.toContactToTypeMap={},this.ccContactToTypeMap={},this.bccContactToTypeMap={},this.subject=this.data.mailHead&&this.data.mailHead.subject,this.attachments=[],null===(e=this.$refs.replyHeader)||void 0===e||e.handleSelect(null),this.fromUserMail=null,this.replyTo=null,this.msgId="",this.composePrepared=!1,this.isComposeDirty=!1,this.encryptionOn=!1,this.expirationSeconds=null,this.showExpirationBanner=!1,this.showScheduledSendBanner=!1,this.customTimeVisible=!1,this.isEditScheduledSend=!1,this.scheduledTime=null,this.hasExternalRecipient=!1,this.externalBannerDismissed=!1,this.hasGroupEmail=!1,this.groupBannerDismissed=!1,this.isPromptEditorVisible=!1,this.plainDraftContent="",this.isEditorMounted=!1,this.editorMountedCallback=[],this.setEditorContent(""),this.setEditorEllipsisContent("");var t=this.getEditorComponent();t&&(t.popoverVisible=!1)},createMailSendInfo:function(){var e,t,n=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=(0,B.mM)(this.getEditorContent()),r=b.Utils.getMailSnippet(i)||"";return{subject:this.subject,content:i,snippet:r||"",fromUserMail:this.fromUserMail,replyTo:this.replyTo,inReplyTo:(null===(e=this.cacheItem)||void 0===e?void 0:e.mailHead.msgId)||"",forwardMsgZid:this.isForward?null===(t=this.cacheItem)||void 0===t?void 0:t.mailHead.msgId:"",msgId:a,mailEncryptionMode:this.mailEncryptionMode,passwordExpireSeconds:this.expirationSeconds,scheduledSendTime:this.scheduledTime?this.convertTime(this.scheduledTime):null,toUserEmail:this.to.map((function(e){var t;return{emailAddr:e,displayName:(null===(t=n.recipientInfo.get(e))||void 0===t?void 0:t.displayName)||e.split("@")[0]}})),ccUserEmail:this.cc.map((function(e){var t;return{emailAddr:e,displayName:(null===(t=n.recipientInfo.get(e))||void 0===t?void 0:t.displayName)||e.split("@")[0]}})),bccUserEmail:this.bcc.map((function(e){var t;return{emailAddr:e,displayName:(null===(t=n.recipientInfo.get(e))||void 0===t?void 0:t.displayName)||e.split("@")[0]}})),atListUserEmail:[],attachments:this.attachments}},createDraft:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,a;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,n=e.createMailSendInfo(),t.next=4,y.Draft.createDraft({mailSendInfo:n});case 4:return a=t.sent,0===a.errorCode&&(e.msgId=a.data.CreateDraft.msgId),t.abrupt("return",a);case 9:t.prev=9,t.t0=t["catch"](0),console.error("create draft failed!",t.t0),e.$msg(e.$t("detail.createDraftFailed"));case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))()},forceRerender:function(){var e=this;this.renderAttach=!1,this.$nextTick((function(){e.renderAttach=!0}))},handleReply:function(){var e=arguments,t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var a,i,r,o,s,c,u,h,f,g,v,y,I,w,S,C,k,x,D,M,E,R,L,A,$,H,O;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(c=e.length>0&&void 0!==e[0]?e[0]:{},t.allowReply){n.next=4;break}return t.$undoNotice({iconClass:"crossmark",title:t.$t("detail.canNotReply")}),n.abrupt("return");case 4:if(u=t.showResponse[t.messageId]&&t.isForward,!u&&t.showResponse[t.messageId]||(t.cacheItem=p().cloneDeep(t.data)),t.monitorOnReply=!0,h=t.showResponse[t.messageId],t.isForward=!1,t.setResponseStatus({msgId:t.messageId,showResponse:!0}),t.isReplyClicked=!0,t.isReplyAll=c.isReplyAll,f=b.Business.getReplyRecipients({myEmail:t.myEmailAddresses,isReplyAll:t.isReplyAll,from:t.cacheItem.from,to:t.cacheItem.to||[],cc:t.cacheItem.cc||[],bcc:t.cacheItem.bcc||[],replyTo:t.cacheItem.replyTo||[]}),g=f.to,v=void 0===g?[]:g,y=f.cc,I=void 0===y?[]:y,w=f.bcc,S=void 0===w?[]:w,C=function(e){return e.map((function(e){return e.emailAddr}))},t.to=C(v),t.cc=C(I),t.bcc=C(S),t.subject="Re: "+(0,B.TP)((null===(a=t.cacheItem.mailHead)||void 0===a?void 0:a.subject)||""),k="",x="",t.encryptionOn=t.defaultComposeEncryptionState,h&&!u){n.next=40;break}return u?(t.attachments=t.attachments.filter((function(e){return!e.isFromForwardMessage})),t.forceRerender()):t.attachments=[],n.t0='
'),n.next=26,t.getSignatureContent();case 26:n.t1=n.sent,x=n.t0+n.t1,D=b.Hooks.useReplyHeader(T.ZP,{timeZone:t.userTimeZone,locale:t.language}),M=D.getReplyHeader,E=(0,B.mM)(t.cacheItem.content),k='\n
\n
\n '.concat(M({from:t.cacheItem.from,originalDate:t.cacheItem.mailHead.date}),"\n
\n
\n ").concat(E,"\n
\n
\n "),R=me.getInlineImageSrcMap(t.cacheItem),L=(0,V.Z)(k,{inlineImageSrcMap:R}),A=L.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!t.allowMailExternalImg}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate(),L.destroy(),L=null,k=A,$=(0,V.Z)(x,{inlineImageSrcMap:R}),H=$.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!t.allowMailExternalImg}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate(),x=H;case 40:O=function(){var e=t.getEditorContent(),n=m()("
");if(n.html(e),h&&u){var a,i=n.find("div").closest("div"),r=i;i.each((function(e,t){if(["gmail_quote"].includes(t.classList.value))return!1;0!==e&&r.eq(0).append(t)})),r.eq(0).find(".gmail_quote").remove(),r.eq(0).find(".gmail_signature").remove(),r.eq(0).find(".mail_break").remove();var o=(null===(a=r.eq(0)[0])||void 0===a?void 0:a.outerHTML)||r.eq(0).html();t.setEditorContent(o),t.setEditorEllipsisContent(k)}else h||(t.setEditorContent(x),t.setEditorEllipsisContent(k));setTimeout((0,d.Z)((0,l.Z)().mark((function e(){var n;return(0,l.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.hideCcBccIfEmpty(),t.showSubject=!1,t.composePrepared=!0,!t.msgId){e.next=6;break}return e.next=6,t.updateDraft();case 6:null===(n=t.getEditorInstance())||void 0===n||n.focus(),t.scrollIntoView();case 8:case"end":return e.stop()}}),e)}))),0)},t.isEditorMounted?O():t.editorMountedCallback.push(O),t.$emit("onReplyTo",(null===(i=t.cacheItem)||void 0===i||null===(r=i.mailHead)||void 0===r?void 0:r.msgId)||""),t.monitorOnReply=!1,t.$metric.report("detail_reply",{msgId:null===(o=t.cacheItem)||void 0===o||null===(s=o.mailHead)||void 0===s?void 0:s.msgId});case 45:case"end":return n.stop()}}),n)})))()},handleReplyAll:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,a;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.handleReply({isReplyAll:!0}),e.$metric.report("detail_reply_all",{msgId:null===(n=e.cacheItem)||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.msgId});case 2:case"end":return t.stop()}}),t)})))()},handlePopOut:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.setAIContent(!1),e.isComposeDirty=!0,t.next=4,e.doCreateOrUpdate();case 4:return console.log("[signature] before compose pop out",e.selectedSignatureId),t.next=7,e.$composeFromDraftMsgId(e.msgId,{fromPopOut:!0,isReply:e.isReplyDraft});case 7:case"end":return t.stop()}}),t)})))()},handlePopIn:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:n=e.instantDraftList.filter((function(t){var n,a;return![t.mailId,null===(n=t.composeItem)||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.msgId].filter((function(e){return e})).includes(e.msgId)})),e.setInstantDraftList(n);case 2:case"end":return t.stop()}}),t)})))()},getUpdatedDraftDetails:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,a;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,y.Mail.getMailDetail({msgIds:[e.msgId]});case 2:if(n=t.sent,!n){t.next=7;break}if(a=n[0].mailHead.isDraft,!a){t.next=7;break}return t.abrupt("return",n[0]);case 7:case"end":return t.stop()}}),t)})))()},getSignatureContent:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getDefaultSignatureContent({type:Q.Vl.REPLY_FORWARD_COMPOSE});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))()},handleForward:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,i,r,o,s,c,u,h,f,g,v,y,I,w,S;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.debug("handle forward"),e.allowReply){t.next=4;break}return e.$undoNotice({iconClass:"crossmark",title:e.$t("detail.canNotForward")}),t.abrupt("return");case 4:if(o=e.showResponse[e.messageId]&&!e.isForward,!o&&e.showResponse[e.messageId]||(e.data.attachments.map((function(e){return e.isFromForwardMessage=!0,e})),e.cacheItem=p().cloneDeep(e.data),e.attachments=[].concat((0,a.Z)(e.data.attachments),(0,a.Z)(e.attachments)),e.forceRerender()),e.isInForwardProcess=!0,e.monitorOnReply=!0,s=e.showResponse[e.messageId],e.setResponseStatus({msgId:e.messageId,showResponse:!0}),e.isReplyClicked=!1,e.isReplyAll=!1,e.isForward=!0,e.to=[],e.cc=[],e.bcc=[],c=(0,B.mM)(e.cacheItem.content),e.subject="Fwd: "+(0,B.TP)((null===(n=e.data.mailHead)||void 0===n?void 0:n.subject)||""),e.encryptionOn=e.defaultComposeEncryptionState,u="",s&&!o){t.next=35;break}return t.t0='
'),t.next=24,e.getSignatureContent();case 24:t.t1=t.sent,f=t.t0+t.t1,g=b.Hooks.useReplyHeader(T.ZP,{timeZone:e.userTimeZone,locale:e.language}),v=g.getForwardHeader,u="\n ".concat(o?"":"\n ".concat(f,"\n "),'\n
\n
\n ').concat(v({from:e.cacheItem.from,to:e.cacheItem.to,cc:e.cacheItem.cc,subject:(null===(h=e.data.mailHead)||void 0===h?void 0:h.subject)||"",date:e.data.mailHead.date}),"\n
\n
\n ").concat(c,"\n
\n "),console.log("forwarding mail new content ===> ",u),y=me.getInlineImageSrcMap(e.cacheItem),I=(0,V.Z)(u,{inlineImageSrcMap:y}),w=I.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!e.allowMailExternalImg}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate(),I.destroy(),I=null,u=w;case 35:S=function(){var t=e.getEditorContent(!0),n=m()("
");if(n.html(t),s&&o){var a,i=n.find("div"),r=i;i.each((function(e,t){if(["gmail_quote"].includes(t.classList.value))return!1;0!==e&&r.eq(0).append(t)}));var c=(null===(a=r.eq(0).append(u)[0])||void 0===a?void 0:a.outerHTML)||r.eq(0).append(u).html();e.setEditorContent(c),e.setEditorEllipsisContent()}else s||(e.setEditorContent(u),e.setEditorEllipsisContent());setTimeout((0,d.Z)((0,l.Z)().mark((function t(){var n;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.hideCcBccIfEmpty(),e.showSubject=!1,e.composePrepared=!0,!e.msgId){t.next=6;break}return t.next=6,e.updateDraft();case 6:null===(n=e.$refs.toContactRef)||void 0===n||n.focus(),e.scrollIntoView();case 8:case"end":return t.stop()}}),t)}))),0)},e.isEditorMounted?S():e.editorMountedCallback.push(S),e.$emit("onReplyTo",(null===(i=e.cacheItem)||void 0===i||null===(r=i.mailHead)||void 0===r?void 0:r.msgId)||""),e.monitorOnReply=!1;case 39:case"end":return t.stop()}}),t)})))()},handleReplyMenu:function(e){var t=this;switch(e){case"Reply":if(this.isReplyClicked&&!this.isReplyAll&&!this.isForward)break;this.handleReply(),this.subject=this.data.mailHead&&this.data.mailHead.subject;break;case"Reply All":if(this.isReplyClicked&&this.isReplyAll&&!this.isForward)break;this.handleReply({isReplyAll:!0}),this.subject=this.data.mailHead&&this.data.mailHead.subject;break;case"Forward":if(this.isForward)break;this.handleForward();break;case"Edit Subject":this.showSubject=!0,this.$nextTick((function(){var e,n;null===(e=t.$refs.subjectRef)||void 0===e||e.focus(),null===(n=t.$refs.subjectRef)||void 0===n||n.select()}));break;case"Pop Out":this.handlePopOut();break;default:break}},updateDraft:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,a,i;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.isDraftLocked&&!e.draftIsFreezed&&e.isEditorMounted){t.next=2;break}return t.abrupt("return");case 2:return n=e.createMailSendInfo(e.msgId),t.next=5,y.Draft.updateDraft({mailSendInfo:n});case 5:return a=t.sent,e.updateMailHead(),i=e.isConversationView?e.cacheItem.mailHead.mailId:a.data.UpdateDraft.msgId,i&&(e.$store.dispatch("getAllMailHead",{labelId:ge.DRAFT,mailIds:[i]}),e.isConversationView&&!e.isOutlook&&e.$store.dispatch("getAllMailHead",{labelId:ge.INBOX,mailIds:[i]})),t.abrupt("return",a);case 10:case"end":return t.stop()}}),t)})))()},doCreateOrUpdate:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.$needUpdate=!1,!e.draftOpenInCompose){t.next=3;break}return t.abrupt("return");case 3:if(e.isComposeDirty){t.next=5;break}return t.abrupt("return");case 5:if(!e.draftIsFreezed&&!e.isDeleting){t.next=7;break}return t.abrupt("return");case 7:if(!e.creatingOrUpdating){t.next=9;break}return t.abrupt("return");case 9:if(e.creatingOrUpdating=!0,!e.isOutlookStandaloneDraft){t.next=20;break}if(e.msgId){t.next=16;break}return t.next=14,e.createDraft();case 14:t.next=18;break;case 16:return t.next=18,e.updateDraft();case 18:t.next=28;break;case 20:if(console.debug("doCreateOrUpdate"),!e.msgId){t.next=26;break}return t.next=24,e.updateDraft();case 24:t.next=28;break;case 26:return t.next=28,e.createDraft();case 28:e.creatingOrUpdating=!1;case 29:case"end":return t.stop()}}),t)})))()},handleDraftDelete:function(){var e=arguments,t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var a,i;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=e.length>0&&void 0!==e[0]&&e[0],t.setResponseStatus({msgId:t.messageId,showResponse:!1}),t.isDeleting=!0,t.monitorOnReply=!0,t.debouncedComposeChange.cancel(),console.log("this.msgId ===> ",t.msgId),n.prev=6,!t.msgId){n.next=14;break}return n.next=10,y.Inbox.discardDraft({fromLabelId:ge.DRAFT,groupMsgsIds:[{groupId:t.data.mailHead.threadId,msgIds:[t.msgId]}]});case 10:i=n.sent,i?(t.$undoNotice({title:t.$t("detail.draftDeleted")}),t.updateMsgReplyStatus({msgId:t.msgId,isReplyAvailable:!0}),t.resetInfo(),t.$emit("draftDeleted")):a||t.$undoNotice({title:t.$t("detail.draftDeleteFailed")}),n.next=15;break;case 14:t.isOutlookStandaloneDraft||t.resetInfo();case 15:n.next=21;break;case 17:n.prev=17,n.t0=n["catch"](6),console.log(n.t0),t.$undoNotice({title:t.$t("detail.draftDeleteFailed")});case 21:t.$emit("onReplyTo",""),t.isDeleting=!1,t.monitorOnReply=!1,t.showSubject=!1,t.subject=t.data.mailHead&&t.data.mailHead.subject,t.cacheItem=t.data,t.attachments=[];case 28:case"end":return n.stop()}}),n,null,[[6,17]])})))()},handleFocusIn:function(e){var t=e.target,n=[this.$refs.toContactRef,this.$refs.ccContactRef,this.$refs.bccContactRef],a=n.some((function(e){return null===e||void 0===e?void 0:e.$el.contains(t)}));a?this.expandRecipients():this.$refs.contactSelectors.contains(t)||(this.hideCcBccIfEmpty(),this.collapseRecipients())},hideCcBccIfEmpty:function(){this.showBcc=Boolean(this.bcc.length),this.showCc=Boolean(this.cc.length)},handleDelayedSend:function(){var e=this;return(0,d.Z)((0,l.Z)().mark((function t(){var n,i,r,o;return(0,l.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.draftIsFreezed){t.next=2;break}return t.abrupt("return");case 2:if(0!==e.to.length||0!==e.bcc.length||0!==e.cc.length){t.next=5;break}return e.$msg(e.$t("compose.toIsEmpty")),t.abrupt("return");case 5:if(n=e.validateEmails([].concat((0,a.Z)(e.to),(0,a.Z)(e.bcc),(0,a.Z)(e.cc))),!(n.length>0)){t.next=9;break}return e.$msg(e.$t("compose.emailIsInvalid")),t.abrupt("return");case 9:if(i=e.$refs.editor.isShowToolbar,r=e.$refs.editor.selectedFontSize,e.hideToolbarByDefault=!i,e.defaultFontSize=r,y.Setting.setPersistentSetting({key:pe.EDIT_TOOL,value:JSON.stringify({hideToolbarByDefault:!i,fontSize:r})}),!e.isOutlook||e.msgId){t.next=17;break}return t.next=17,e.createDraft();case 17:o=e.createMailSendInfo(e.msgId),o.attachments=o.attachments.map((function(t){return t.msgId=e.msgId,t})),e.getSubjectChanged()&&(o.inReplyTo="",o.forwardMsgZid="",o.oldMsgId=e.msgId,o.msgId=""),e.debouncedComposeChange.flush(),e.setSendingStatus({msgId:e.msgId,isSending:!0}),e.$emit("onSending"),(0,w.Y)({el:e.$root,mailSendInfo:o,undoDuration:e.undoDuration,onSendSuccessfully:function(){(e.isReplyDraft||e.isReplyAll)&&e.removeReplyLater(e.cacheItem.mailHead.mailId),e.setSendingStatus({msgId:e.msgId,isSending:!1}),e.setResponseStatus({msgId:e.messageId,showResponse:!1}),e.$metric.report("send_mail",{event_context:e.metricContext,msgId:e.msgId}),e.resetInfo(),e.$emit("onReplyTo","")},onCancel:function(){console.debug("onCancel"),e.setSendingStatus({msgId:e.msgId,isSending:!1}),e.$emit("onCancelSend")},onSendFailed:function(t){e.setSendingStatus({msgId:e.msgId,isSending:!1}),e.$metric.report("send_mail",{event_context:e.metricContext,msgId:e.msgId,error:e.$metric.apiError("mailui_senddraft",t)})},onSendError:function(t){e.setSendingStatus({msgId:e.msgId,isSending:!1}),e.$metric.report("send_mail",{event_context:e.metricContext,msgId:e.msgId,error:e.$metric.jsError("mailui_senddraft",t)})}},e.typeOfEmail);case 24:case"end":return t.stop()}}),t)})))()},handleEditorContentUpdate:function(){this.$needUpdate=!0,this.updatePlainDraftContent(),this.monitorComposeChange&&!this.monitorOnReply&&this.monitorComposeChange()},handleSelectSignature:function(e){var t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var a,i,r;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(console.debug("[signature] handle select signature in mail draft",e),t.selectedSignatureId=e,r=null===(a=t.$refs.editor)||void 0===a||null===(i=a.getEditorRootDom)||void 0===i?void 0:i.call(a),r){n.next=5;break}return n.abrupt("return");case 5:t.insertSignatureContent({editorRoot:r,signatureId:e});case 6:case"end":return n.stop()}}),n)})))()},hasRecipientsOfType:function(e){for(var t=[this.toContactToTypeMap,this.ccContactToTypeMap,this.bccContactToTypeMap],n=0,a=t;n0&&void 0!==arguments[0]&&arguments[0],t=this.getEditorComponent();return t?t.getContent(e):""},setEditorContent:function(e){var t=this,n=this.getEditorComponent();n&&(n.setContent(e||"

"),this.$nextTick((0,d.Z)((0,l.Z)().mark((function e(){var n,a,i,r;return(0,l.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=null===(n=t.$refs.editor)||void 0===n||null===(a=n.getEditorRootDom)||void 0===a?void 0:a.call(n),e.next=3,t.getSignatureIdFromDraftContent({editorRoot:i});case 3:r=e.sent,console.debug("[signature] get signature id in mail draft",r),t.selectedSignatureId=r;case 6:case"end":return e.stop()}}),e)})))))},setEditorEllipsisContent:function(e){var t=this.getEditorComponent();t&&t.setEllipsisContent(e)},getCachedReplyDraft:function(){if(!this.isOutlookStandaloneDraft&&!this.cacheItem.mailHead.isDraft){var e=this.cacheItem.mailHead.msgId||"",t=this.cacheDraftDetail.filter((function(t){return!!t.mailHead.isDraft&&t.mailHead.draftReplyToMsgId===e}));t.sort((function(e,t){return t.mailHead.date-e.mailHead.date}));var n=(0,s.Z)(t,1);this.getReplyDraft=n[0]}},initResponse:function(){var e=arguments,t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var i,r,o,s,c,u,h,p,f;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=!(e.length>0&&void 0!==e[0])||e[0],r=e.length>1&&void 0!==e[1]?e[1]:null,o=e.length>2&&void 0!==e[2]&&e[2],!t.isQuarantined){n.next=5;break}return n.abrupt("return");case 5:if(t.getCachedReplyDraft(),t.setResponseStatus({msgId:t.messageId,showResponse:!1}),s=r||(t.isOutlookStandaloneDraft?t.data:t.getReplyDraft),!s){n.next=39;break}if(t.msgId=s.mailHead.msgId,t.subject=s.mailHead.subject,t.getSubjectChanged()&&(t.showSubject=!0),s.from&&(t.replyTo=s.replyTo,t.fromUserMail=s.from),c=s.mailHead.mDraftType,t.isForward="Forward"===c,["to","cc","bcc"].forEach((function(e){null===s||void 0===s||s[e].forEach((function(e){e.emailAddr.includes(v.aE)||t.$store.commit("changeRecipientInfo",{id:e.emailAddr,displayName:e.displayName})})),t[e]=(null===s||void 0===s?void 0:s[e].map((function(e){return e.emailAddr})))||[]})),t.attachments=(0,a.Z)(s.attachments)||[],!t.isZmail){n.next=29;break}n.t0=s.sendMailEncryptOption["Mode"],n.next=n.t0===fe.PASSWORD_PROTECT?21:n.t0===fe.EXTERNAL_DISALLOWED?23:25;break;case 21:return t.setExpirationTime(s.sendMailEncryptOption.passwordExpireSeconds),n.abrupt("break",26);case 23:return t.encryptionOn=!0,n.abrupt("break",26);case 25:t.encryptionOn=t.defaultComposeEncryptionState;case 26:u=g.ou.now().toISO(),h=g.ou.fromSeconds(s.mailHead.date).toISO(),h&&u0){console.log(s.content);var n=me.getInlineImageSrcMap(s),a=(0,V.Z)(s.content,{inlineImageSrcMap:n});if(s.content=a.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!t.allowMailExternalImg}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate(),a.destroy(),a=null,o){t.setEditorContent(s.content);var i=t.getEditorContent(!0),r=m()("
");r.html(i);var l=r.clone(),d=r.clone();l.find(".gmail_quote:first").prevAll(":not(.gmail_quote)").remove(),r.find(".gmail_quote").remove(),"Forward"===s.mailHead.mDraftType?(t.setEditorContent(d.html()),t.setEditorEllipsisContent("")):(t.setEditorContent(r.html()),t.setEditorEllipsisContent(l.html()))}else{var c=m()("
");c.html(s.content);var u=c.find(".gmail_original").filter((function(e,t){return!m()(t).parents(".gmail_quote").length})),h=c.find(".gmail_quote").filter((function(e,t){return!m()(t).parents(".gmail_quote").length}));u.length?"Forward"===s.mailHead.mDraftType?(t.setEditorContent(c.html()),t.setEditorEllipsisContent("")):(t.setEditorContent(u.html()),t.setEditorEllipsisContent(m()("
").append(h.clone()).html())):(t.setEditorContent(s.content),t.setEditorEllipsisContent(""))}t.isOutlookStandaloneDraft||t.$emit("renderResponsiveIframe")}t.isLast&&t.$emit("onReplyTo",t.cacheItem.mailHead.msgId)},t.isEditorMounted?f():t.editorMountedCallback.push(f),t.setResponseStatus({msgId:t.messageId,showResponse:!0}),t.composePrepared=!!t.isOutlookStandaloneDraft||i,n.next=40;break;case 39:t.isLast&&t.$emit("onReplyTo","");case 40:t.updateImmediately=(0,d.Z)((0,l.Z)().mark((function e(){return(0,l.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.showResponse[t.messageId]||!t.composePrepared){e.next=4;break}t.isComposeDirty=!0,e.next=5;break;case 4:return e.abrupt("return");case 5:if(!t.monitorOnReply){e.next=7;break}return e.abrupt("return");case 7:if(t.msgId){e.next=12;break}return e.next=10,t.createDraft();case 10:e.next=15;break;case 12:if(!t.msgId){e.next=15;break}return e.next=15,t.updateDraft();case 15:case"end":return e.stop()}}),e)}))),t.$watch("to",t.handleEditorContentUpdate),t.$watch("cc",t.handleEditorContentUpdate),t.$watch("bcc",t.handleEditorContentUpdate),t.$watch("subject",t.handleEditorContentUpdate),t.$watch("attachments",t.updateImmediately),t.$watch("expirationSeconds",t.handleEditorContentUpdate),t.$watch("encryptionOn",t.handleEditorContentUpdate),t.$watch("scheduledTime",t.handleEditorContentUpdate),t.$watch("fromUserMail",t.handleEditorContentUpdate);case 50:case"end":return n.stop()}}),n)})))()},editorMounted:function(){var e=this;console.debug("editorMounted =>",this.isFirstDraft),this.isFirstDraft&&setTimeout(this.scrollIntoView),this.isEditorMounted=!0,this.editorMountedCallback.forEach((function(e){return e()})),setTimeout((function(){e.isInForwardProcess=!1}))},resetShowActions:function(){var e,t,n;null===(e=this.$refs.toContactRef)||void 0===e||e.hideAllActions(),null===(t=this.$refs.ccContactRef)||void 0===t||t.hideAllActions(),null===(n=this.$refs.bccContactRef)||void 0===n||n.hideAllActions()},convertTime:function(e){return Math.floor(e.toSeconds())},handleCc:function(){var e=this;this.isDraftLocked||this.draftIsFreezed||(this.showCc=!0,this.$nextTick((function(){return e.$refs.ccContactRef.focus()})))},handleBcc:function(){var e=this;this.isDraftLocked||this.draftIsFreezed||(this.showBcc=!0,this.$nextTick((function(){return e.$refs.bccContactRef.focus()})))},onReplyEmailFromPrompt:function(){this.updatePlainDraftContent(),this.isPromptEditorVisible=!0,setTimeout(this.scrollIntoView)},insertNewCompose:function(){var e=arguments,t=this;return(0,d.Z)((0,l.Z)().mark((function n(){var a,i,r,o,s,d;return(0,l.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(i=e.length>0&&void 0!==e[0]?e[0]:"",r=e.length>1&&void 0!==e[1]?e[1]:"",t.isPromptEditorVisible=!1,i){n.next=5;break}return n.abrupt("return");case 5:return n.next=7,t.getSignatureContent();case 7:o=n.sent,s=o?"
".concat(i,"
").concat(o,"
"):i,d=(0,B.mM)(s,{WHOLE_DOCUMENT:!0}),t.setEditorContent(d),t.handleEditorContentUpdate(),t.subject?(t.showSmartSubject=!0,t.smartSubject=r):t.subject=r,null===(a=t.getEditorInstance())||void 0===a||a.focus();case 14:case"end":return n.stop()}}),n)})))()},onHasGeneratedContent:function(e){e&&!this.hasGeneratedContent&&(this.hasGeneratedContent=!0),this.setAIContent(e)},onSelectAlias:function(e){console.debug("[alias] select in reply/forward compose",e,this.fromUserMail,this.replyTo),this.fromUserMail=e,this.replyTo=e.emailAddr,this.doCreateOrUpdate()},getSubjectChanged:function(){return(0,B.TP)(this.data.mailHead.subject)!==(0,B.TP)(this.subject)}})},be=ve,ye=(0,L.Z)(be,r,o,!1,null,"7a6994f1",null),Ie=ye.exports},38757:function(e,t,n){n.d(t,{Z:function(){return u}});var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"nav-btns"},[t("shortcut-reminder",{attrs:{preTooltip:e.$t("common.newer"),shortcutKey:"newer-conversation"}},[t("zm-button",{ref:"navNewerBtn",attrs:{ghost:"",disabled:e.disableNewer,"aria-label":e.$t("common.newer"),"aria-expanded":void 0,"zm-ta":"detail-previous-mail"},on:{click:function(t){!e.disableNewer&&e.$emit("newer")}}},[t("svg-icon",{attrs:{iconClass:e.isVertical?"chevron-up":"chevron-left"}})],1)],1),t("shortcut-reminder",{attrs:{preTooltip:e.$t("common.older"),shortcutKey:"older-conversation"}},[t("zm-button",{ref:"navOlderBtn",attrs:{ghost:"",disabled:e.disableOlder,"aria-label":e.$t("common.older"),"aria-expanded":void 0,"zm-ta":"detail-next-mail"},on:{click:function(t){!e.disableOlder&&e.$emit("older")}}},[t("svg-icon",{attrs:{iconClass:e.isVertical?"chevron-down":"chevron-right"}})],1)],1)],1)},i=[],r=n(97626),o=n(91007),s={name:"NavigationBtns",components:{SvgIcon:r.Z,ShortcutReminder:o.Z},props:{disableNewer:{type:Boolean,default:!1},disableOlder:{type:Boolean,default:!1},orientation:{type:String,default:"horizontal"},loading:{type:Boolean,default:!0}},emits:["newer","older"],computed:{isVertical:function(e){var t=e.orientation;return"vertical"===t}},watch:{disableNewer:function(e){var t,n;e&&(null===(t=this.$refs.navNewerBtn)||void 0===t||null===(n=t.$el)||void 0===n||n.dispatchEvent(new CustomEvent("mouseleave")))},disableOlder:function(e){var t,n;e&&(null===(t=this.$refs.navOlderBtn)||void 0===t||null===(n=t.$el)||void 0===n||n.dispatchEvent(new CustomEvent("mouseleave")))}}},l=s,d=n(93483),c=(0,d.Z)(l,a,i,!1,null,"07b48d7c",null),u=c.exports},47257:function(e,t,n){n.d(t,{Z:function(){return Ne}});var a=function(){var e,t,n,a,i,r,o,s,l,d,c,u,m,h,p,f,g,v,b,y,I,w,S,C,k,T,x,D,M,E,R,L,A,$,H,B,O,_,Z,P,F,N,z,U,V,j,W,G=this,q=G._self._c;return q("div",{ref:"responseItemRef",class:["response-item",{clickable:!G.contentVisible,"bottom-divider":!G.hideDivider,"top-divider":G.topDivider}],attrs:{id:G.data.mailHead.msgId}},[q("div",{staticClass:"content-rows",style:{flexDirection:G.recentOnTop?"column-reverse":"column"}},[G.isSnoozedMessage?q("message-bar",{attrs:{type:"info",iconClass:"snooze-fill",customClass:"snooze-message",title:G.snoozeTitle,disallowDismiss:!0}},[q("p",{staticClass:"unsnooze-action",attrs:{slot:"actions"},on:{click:G.unsnooze},slot:"actions"},[G._v(" "+G._s(G.$t("operation.unSnooze"))+" ")])]):G._e(),q("div",{staticClass:"message-row"},[q("div",{ref:"responseItemHeader",class:["header","tab-focus",{clickable:G.contentVisible&&!G.isLast,expanded:G.contentVisible}],attrs:{tabindex:G.isLast?"-1":"0",role:"button"},on:{click:function(e){return G.changeShowDetail()},keydown:[function(e){return!e.type.indexOf("key")&&G._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])||e.target!==e.currentTarget?null:(e.stopPropagation(),G.changeShowDetail())},function(e){return!e.type.indexOf("key")&&G._k(e.keyCode,"enter",13,e.key,"Enter")||e.target!==e.currentTarget?null:(e.stopPropagation(),G.changeShowDetail())}]}},[G.hideAvatar?G._e():q("ContactTooltip",{attrs:{email:G.emailAddr,name:G.cacheItem.from.displayName}},[q("avatar",{ref:"avatarRef",staticClass:"avatar",attrs:{email:G.emailAddr,name:G.cacheItem.from.displayName,tabindex:"-1"}})],1),q("div",{staticClass:"header-right"},[q("div",{ref:"headerTopRef",staticClass:"header-right-top"},[G.showSubjectInHeader?q("div",{staticClass:"sender-info"},[q("span",[G._v(G._s(G.subject))])]):q("div",{staticClass:"sender-info"},[q("ContactTooltip",{ref:"emailPopover",attrs:{visible:G.emailPopoverVisible,email:G.emailAddr,name:G.cacheItem.from.displayName}},[q("span",{staticClass:"email-address pointer tab-focus",attrs:{tabindex:"0","aria-label":G.cacheItem.from.displayName,"zm-ta":"copy-sender-email-address"},on:{focus:function(e){G.emailPopoverVisible=!0},blur:function(e){G.emailPopoverVisible=!1}}},[q("span",{staticClass:"email-address display-name"},[G._v(G._s(G.cacheItem.from.displayName))]),q("span",{staticClass:"email-address pointer tab-focus",attrs:{tabindex:"0","zm-ta":"copy-sender-email-address"}},[G._v(" <"+G._s(G.emailAddr)+"> ")])])])],1),G.cacheItem.via?q("span",{staticClass:"via-info"},[G._v("  "+G._s(G.$t("detail.via",[G.cacheItem.via]))+" ")]):G._e(),G.hideActions||G.isQuarantinedMsg?G._e():q("response-reply-bar",{attrs:{type:"icon",msgId:null===(e=G.data)||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.msgId,contentVisible:G.contentVisible,decryptionStatus:G.cacheItem.decryptionStatus,isUserScheduled:null===(n=G.cacheItem)||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.isUserScheduled,from:G.cacheItem.from,to:G.cacheItem.to,cc:G.cacheItem.cc},on:{trigger:G.handleReplyActionTrigger}}),q("div",{staticClass:"expander"}),G.isOutlook&&G.labelInfo?q("div",{staticClass:"folder"},[q("zm-tooltip",{attrs:{content:G.labelInfo.displayName,placement:"bottom",enterable:!1,tabindex:"-1"}},[q("svg-label",{attrs:{labelClass:G.labelInfo.icon,"aria-hidden":"true"}})],1)],1):G._e(),q("div",{staticClass:"message-controls"},[G.isZmail?q("div",{staticClass:"control"},[q("EncryptionIndicator",{attrs:{type:G.cacheItem.mailEncryptionType}})],1):G._e(),q("div",{staticClass:"control"},[q("span",[G._v(" "+G._s(G.formatTime)+" ")])]),G.hasMessageActions?q("div",{staticClass:"divide"}):G._e(),G.hasMessageActions&&G.enableShareToChat?q("div",{directives:[{name:"metric",rawName:"v-metric:detail_send_copy_to_chat",value:{msgId:null===(i=G.cacheItem)||void 0===i||null===(r=i.mailHead)||void 0===r?void 0:r.msgId},expression:"{ msgId: cacheItem?.mailHead?.msgId }",arg:"detail_send_copy_to_chat"}],staticClass:"control"},[q("zm-tooltip",{attrs:{content:G.$t("operation.sendCopyToChat")}},[q("HeaderAction",{attrs:{hideLabel:!0,iconClass:"share-outline",label:G.$t("operation.sendCopyToChat")},on:{click:function(e){return e.stopPropagation(),G.shareMessageToChat.apply(null,arguments)}}})],1)],1):G._e(),q("div",{staticClass:"control"},[G.hasMessageActions?q("response-item-dropdown",{attrs:{item:G.data,inOutbox:G.inOutbox,inGroup:G.inGroup,canSpam:G.canSpam,canDelete:G.canDelete,canReplyAll:G.canReplyAll(G.cacheItem),isGmail:G.isGmail,isSelf:G.isSelf,isDecrypted:G.isDecrypted,isFromSpammedUser:G.isFromSpammedUser,isFromBlockedUser:G.isFromBlockedUser,isZmail:G.isZmail,isOutlook:G.isOutlook,currentLabelId:G.currentLabelId,isOnlyOneMail:1===G.selectMailDetail.length,messagesInvalidToSpam:G.messagesInvalidToSpam,mailBoxApprovable:G.mailboxApprovable,hasSubscription:["By Mail","By Url"].includes(G.cacheItem.unSubscribeType)&&!G.unsubscribeSuccess},on:{handleCommand:G.handleCommand}}):G._e()],1)])],1),G.contentVisible?q("to-cc-bcc",{attrs:{to:G.cacheItem.to,cc:G.cacheItem.cc,bcc:G.cacheItem.bcc}}):q("span",{ref:"snippetText",staticClass:"plainText snippet"},[G._v(" "+G._s(G.filterMailSnippet(G.cacheItem.mailHead.snippet))+" ")])],1)],1),G.contentVisible&&!G.isDecrypted?q("div",{staticClass:"htmlClass"},[!G.mountDecryptFailed||G.isRetrying?q("zm-skeleton",{attrs:{animated:""}}):q("decrypt-failed-mail",{attrs:{isMobile:!1,hasBackupKey:G.isCorpUser&&!G.isEscrowAdmin,originalCode:G.originalCode,devicesWithAccess:G.devicesWithAccess},on:{tryAgain:G.handleRetry,navigateToBackupPage:G.handleNavigateToBackupPage}})],1):G._e(),q("div",{directives:[{name:"show",rawName:"v-show",value:G.contentVisible&&G.isDecrypted,expression:"contentVisible && isDecrypted"}],staticClass:"content"},[q("revoked-device-indicator",{attrs:{isMobile:!1,isEncryptedZmail:G.isEncryptedZmail,msgId:G.cacheItem.mailHead.msgId}}),q("div",{ref:"responseItemDetailRef",staticClass:"response-detail-wrapper"},[q("div",{directives:[{name:"show",rawName:"v-show",value:G.isLoadingLargeHtmlBody,expression:"isLoadingLargeHtmlBody"},{name:"loading",rawName:"v-loading",value:!0,expression:"true"}],staticClass:"response-detail-loading",attrs:{"element-loading-spinner":"zm-icon-loading","element-loading-text":G.$t("detail.loadingEmail")}}),q("div",{directives:[{name:"show",rawName:"v-show",value:!G.isAutoDownloadHtmlBodySuccess,expression:"!isAutoDownloadHtmlBodySuccess"}],staticClass:"response-detail-retry"},[q("zm-button",{attrs:{"zm-ta":"thread-item-body-retry-download-html-body"+(null===(o=G.data)||void 0===o||null===(s=o.mailHead)||void 0===s?void 0:s.msgId)},on:{click:G.handleRetryDownloadHtmlBody}},[G._v(G._s(G.$t("common.retry")))])],1),q("MessageBar",{directives:[{name:"show",rawName:"v-show",value:G.isZmail&&G.isFromSpammedUser,expression:"isZmail && isFromSpammedUser"}],attrs:{title:G.isGmail?G.$t("detail.markAsSpam",[G.emailAddr]):G.$t("detail.reportAsSpam",[G.emailAddr]),"zm-ta":"thread-item-body-spam-action-"+(null===(l=G.data)||void 0===l||null===(d=l.mailHead)||void 0===d?void 0:d.msgId),actions:[{msgId:null===(c=G.data)||void 0===c||null===(u=c.mailHead)||void 0===u?void 0:u.msgId,text:G.$t("operation.notSpam"),handler:G.isGmail?G.markAsSpam.bind(this,G.cacheItem):G.reportNotSpam.bind(this,G.cacheItem)}],iconClass:"alert-filled"}}),q("MessageBar",{directives:[{name:"show",rawName:"v-show",value:G.isZmail&&G.isFromPhishingUser,expression:"isZmail && isFromPhishingUser"}],attrs:{title:G.$t("detail.reportAsPhishing",[G.emailAddr]),"zm-ta":"thread-item-body-spam-action-"+(null===(m=G.data)||void 0===m||null===(h=m.mailHead)||void 0===h?void 0:h.msgId),actions:[{msgId:null===(p=G.data)||void 0===p||null===(f=p.mailHead)||void 0===f?void 0:f.msgId,text:G.$t("operation.notPhishing"),handler:G.isGmail?G.markAsSpam.bind(this,G.cacheItem):G.reportNotSpam.bind(this,G.cacheItem)}],iconClass:"alert-filled"}}),G.isZmail&&G.isFromBlockedUser?q("MessageBar",{attrs:{title:G.$t("detail.youBlockedEmailAddr",[G.emailAddr]),"zm-ta":"thread-item-body-unblock-action-"+(null===(g=G.data)||void 0===g||null===(v=g.mailHead)||void 0===v?void 0:v.msgId),actions:[{msgId:null===(b=G.data)||void 0===b||null===(y=b.mailHead)||void 0===y?void 0:y.msgId,text:G.$t("operation.unblock"),handler:G.isGmail?function(){}:G.unblock.bind(this,G.data)}],iconClass:"alert-filled"}}):G._e(),G.showUnBlockHeader?q("MessageBar",{attrs:{title:G.$t("detail.youHaveUnBlockedEmailAddr",[G.emailAddr]),"zm-ta":"thread-item-body-report-block-"+(null===(I=G.data)||void 0===I||null===(w=I.mailHead)||void 0===w?void 0:w.msgId),actions:[{msgId:null===(S=G.data)||void 0===S||null===(C=S.mailHead)||void 0===C?void 0:C.msgId,text:G.$t("operation.block"),handler:G.isGmail?function(){}:G.openReportBlockedDialog.bind(this,G.data)},{msgId:null===(k=G.data)||void 0===k||null===(T=k.mailHead)||void 0===T?void 0:T.msgId,text:G.$t("operation.moveToInbox"),handler:G.isGmail?function(){}:G.moveToInbox.bind(this,G.currentInboxItem)}],iconClass:"alert-filled"}}):G._e(),G.unsubscribeSuccess||"Already Unsubscribed"===G.cacheItem.unSubscribeType?q("MessageBar",{attrs:{title:G.$t("subscription.unsubscribed",[G.cacheItem.from.emailAddr]),actions:[{msgId:null===(x=G.data)||void 0===x||null===(D=x.mailHead)||void 0===D?void 0:D.msgId,text:G.$t("operation.moveToSpam"),handler:G.markAsSpam.bind(this,G.cacheItem)}],iconClass:"checkmark"}}):G._e(),G.canceledEvent?G._e():q("calendar-card",{ref:"calendarCard",attrs:{msgId:G.cacheItem.mailHead.msgId,calendarId:G.cacheItem.mailHead.calId,calendarType:G.cacheItem.mailHead.calendarType,from:G.cacheItem.from}}),G.translateBarVisible?q("translate-bar",{ref:"translateBar",attrs:{translating:G.isTranslating},on:{closeTranslation:G.closeTranslation,translate:G.translate,viewOriginalMail:G.viewOriginalMail,viewTranslatedMail:G.viewTranslatedMail}}):G._e(),G.canShowAttachmentList&&!G.isAttachmentPlacementBelow?q("AttachmentsList",{attrs:{mailHead:G.cacheItem.mailHead,formatTime:G.formatTime,attachments:G.attachmentList,showDownload:!0}}):G._e(),G.isQuarantinedMsg?q("div",{staticClass:"message-quarantined-container"},[q("svg-icon",{attrs:{iconClass:"envelope"}}),q("h3",[G._v(G._s(G.$t("compliance.emailQuarantined")))]),q("span",{staticClass:"wording"},[q("p",[G._v(" "+G._s(G.$t("compliance.noticeTitle"))+" ")]),q("p",[G._v(G._s(G.$t("compliance.contactAdmin")))])])],1):q("response-content",{directives:[{name:"show",rawName:"v-show",value:!G.isLoadingLargeHtmlBody&&G.isAutoDownloadHtmlBodySuccess,expression:"!isLoadingLargeHtmlBody && isAutoDownloadHtmlBodySuccess"}],ref:"responsiveIframe",attrs:{id:"mail-content-"+G.cacheItem.mailHead.msgId,msgId:G.cacheItem.mailHead.msgId,redecrypted:G.retrySuccess,contentVisible:G.contentVisible,htmlContent:G.cacheItem.content,inlineImageSrcMap:G.inlineImageSrcMap,injectBaseStyleDirectly:G.injectBaseStyleDirectly,disableCollapse:G.cacheItem.mailHead.msgId===G.firstMsgIdInThread||G.isMailContentTooLong,hasBlockedMailExternalResource:G.hasBlockedMailExternalResource},on:{resized:function(e){return G.handleIframeResize(!0)},handleBlockedMailExternalResource:G.handleBlockedMailExternalResource}}),q("div",{staticClass:"mail-info-bottom"},[G.cacheItem.sender?q("div",{staticClass:"delegate-info"},[q("div",[G._v("--")]),q("div",[q("span",[G._v(" "+G._s(G.$t("detail.sentBy",[(null===(M=G.sentByInfo)||void 0===M?void 0:M.displayName)||G.$t("common.unknown")]))+" ")]),G.sentByInfo.address?q("span",{staticClass:"delegate-address"},[G._v("<"+G._s(G.sentByInfo.address)+">")]):G._e()])]):G._e()]),G.canShowAttachmentList&&G.isAttachmentPlacementBelow?q("AttachmentsList",{attrs:{mailHead:G.cacheItem.mailHead,formatTime:G.formatTime,attachments:G.attachmentList,showDownload:!0}}):G._e(),G.isZmail&&"OUTBOX"!==G.currentLabelId&&G.checkScheduledLabel?q("scheduled-send-banner",{ref:"scheduledSend",attrs:{isEdit:!1,scheduledTime:G.cacheItem.mailHead.date,cacheItem:G.cacheItem},on:{goBack:G.goBack}}):G._e(),G.hideActions||G.isQuarantinedMsg?G._e():q("response-reply-bar",{directives:[{name:"show",rawName:"v-show",value:G.contentVisible,expression:"contentVisible"}],ref:"replyBtnsRef",attrs:{msgId:null===(E=G.data)||void 0===E||null===(R=E.mailHead)||void 0===R?void 0:R.msgId,contentVisible:G.contentVisible,decryptionStatus:G.cacheItem.decryptionStatus,isUserScheduled:null===(L=G.cacheItem)||void 0===L||null===(A=L.mailHead)||void 0===A?void 0:A.isUserScheduled,from:G.cacheItem.from,to:G.cacheItem.to,cc:G.cacheItem.cc,enableZoomTAFlag:G.isLast},on:{trigger:G.handleReplyActionTrigger}}),G.isReadyForTranslation?q("TranslatePopover",{attrs:{wrapRef:G.$refs.responseItemDetailRef,iframeRef:null===($=G.$refs)||void 0===$||null===(H=$.responsiveIframe)||void 0===H?void 0:H.$refs.iframeRef,"mail-id":G.cacheItem.mailHead.mailId,msgId:G.cacheItem.mailHead.msgId},on:{translate:G.translate}}):G._e()],1)],1)]),q("div",{staticClass:"draft-row"},[q("mail-draft",{ref:"responseReplyEditor",attrs:{isQuarantined:G.isQuarantinedMsg,data:G.data,draftDetail:G.draftDetail,isLast:G.isLast,isFirstDraft:G.isFirstMailWithDraft,hideDivider:G.hideDivider},on:{renderResponsiveIframe:G.renderResponsiveIframe,showDetail:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&Q()}))})),W=(0,l.debounce)(ee,200,{leading:!0,trailing:!0});function G(){W&&W.cancel(),W=null}function q(){V&&V.disconnect(),V=null}function K(){j&&j.disconnect(),j=null}function Q(){return Y.apply(this,arguments)}function Y(){return Y=(0,o.Z)((0,r.Z)().mark((function e(){var t,n;return(0,r.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!v.value){e.next=2;break}return e.abrupt("return");case 2:return window.removeEventListener("resize",W),G(),v.value=!1,a("handleBlockedMailExternalResource",!1),t=(0,x.Z)(i.htmlContent,{scaleRatio:P.value,plugins:[new s],inlineImageSrcMap:i.inlineImageSrcMap}),n=t.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!u.value,callback:function(e){a("handleBlockedMailExternalResource",e)}}).process({needFold:!i.disableCollapse,injectStyle:!0,injectScript:!0,isDark:$.value}).generate(),z(t.getPluginOutput("ImagePlaceholderPlugin")),e.next=11,(0,I.nextTick)();case 11:window.addEventListener("resize",W),g.value=(0,S.Z)(),h.value.srcdoc=n;case 14:case"end":return e.stop()}}),e)}))),Y.apply(this,arguments)}function J(){return X.apply(this,arguments)}function X(){return X=(0,o.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return f.value=!1,v.value=!1,e.next=4,(0,I.nextTick)();case 4:f.value=!0,Q();case 6:case"end":return e.stop()}}),e)}))),X.apply(this,arguments)}function ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;setTimeout((function(){var e,t=d(h.value);console.debug("Calc newHeight",t);var n=!u.value&&i.hasBlockedMailExternalResource?52:0;null!==(e=h.value)&&void 0!==e&&e.style&&(h.value.style.height="".concat(t+m,"px"),p.value.style.height="".concat(t*P.value+m+n,"px"))}),e)}function te(){console.warn("iframe DOMContentLoad"),ee()}function ne(){var e,t;if(console.warn("iframe loaded",!(null===(e=h.value)||void 0===e||!e.srcdoc)),null!==(t=h.value)&&void 0!==t&&t.srcdoc&&!v.value){var n,i;if(F(),console.debug("render: iframe contentful loaded"),U(),B(),null!==(n=h.value.contentWindow.document)&&void 0!==n&&n.body)h.value.contentWindow.document.body.style.setProperty("height","auto","important");else null===(i=h.value.contentWindow.document.documentElement)||void 0===i||i.style.setProperty("height","auto","important");V.observe(h.value.contentWindow.document.body),v.value=!0,a("resized"),window.requestAnimationFrame((function(){var e;(null===(e=h.value)||void 0===e?void 0:e.contentWindow.document)&&(0,T.$T)(h.value.contentWindow.document)})),_()}ee()}function ae(){c.commit("setCurrentMessageIframeId",i.msgId)}return(0,I.onMounted)((function(){j.observe(h.value)})),(0,I.onBeforeUnmount)((function(){E(),G(),q(),K()})),n({render:Q,forceRerender:J}),{__sfc:!0,ImagePlaceholderPlugin:s,getIframeHeight:d,store:c,allowMailExternalImg:u,SAFE_MARGIN_HEIGHT:m,props:i,emit:a,iframeRef:h,iframeWrapRef:p,iframeVisible:f,iframeName:g,loaded:v,eventHandlers:b,removeAllIframeListeners:E,isDarkMode:$,addDarkModeFilter:B,highlight:_,scaleRatio:P,scaleIframeContent:F,setImagePlaceholderData:z,replaceAllImages:U,resizeObserver:V,intersectionObserver:j,debouncedResizer:W,removeDebouncedResizer:G,removeResizeObserver:q,removeIntersectionObserver:K,render:Q,forceRerender:J,calcHeight:ee,handleIframeDOMContentLoad:te,handleIframeLoad:ne,handleIframeMouseover:ae}}},O=B,_=n(93483),Z=(0,_.Z)(O,b,y,!1,null,"472a66c0",null),P=Z.exports,F=n(14085),N=n(69899),z=n(32893),U=function(){var e,t,n,a,i,r,o,s,l,d,c=this,u=c._self._c;return u("zm-dropdown",{directives:[{name:"show",rawName:"v-show",value:!c.inOutbox&&!c.inGroup,expression:"!inOutbox && !inGroup"}],attrs:{trigger:"click"},on:{command:c.handleCommand}},[u("zm-button",{staticClass:"more-btn",attrs:{ghost:"","zm-ta":"thread-item-header-more-"+(null===(e=c.item)||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.msgId),"aria-label":c.$t("accessibility.moreMenu")}},[u("svg-icon",{attrs:{iconClass:"more-horizontal"}})],1),u("zm-dropdown-menu",{staticClass:"mail-detail-actions",attrs:{slot:"dropdown"},slot:"dropdown"},[c.isDecrypted?u("zm-dropdown-item",{attrs:{command:"handleReply","zm-ta":"thread-item-header-more-reply"}},[c._v(" "+c._s(c.$t("operation.reply"))+" ")]):c._e(),c.isDecrypted&&c.canReplyAll?u("zm-dropdown-item",{attrs:{command:"handleReplyAll","zm-ta":"thread-item-header-more-reply-all"}},[c._v(" "+c._s(c.$t("operation.replyAll"))+" ")]):c._e(),c.isDecrypted?u("zm-dropdown-item",{attrs:{command:"handleForward","zm-ta":"thread-item-header-more-forward"}},[c._v(" "+c._s(c.$t("operation.forward"))+" ")]):c._e(),u("zm-dropdown-item",{directives:[{name:"metric",rawName:"v-metric:mark_as_unread",value:{msgId:null===(n=c.item)||void 0===n||null===(a=n.mailHead)||void 0===a?void 0:a.msgId},expression:"{ msgId: item?.mailHead?.msgId }",arg:"mark_as_unread"}],attrs:{command:"markUnreadFromHere","zm-ta":"thread-item-header-more-"+(c.isOnlyOneMail?"mark-as-unread":"mark-unread-from-here")}},[u("span",{staticClass:"action"},[c._v(" "+c._s(c.isOnlyOneMail?c.$t("operation.markAsUnread"):c.$t("operation.markUnreadFromHere"))+" ")])]),!c.isSelf&&c.canSpam&&c.isGmail&&!c.isOutlook?u("zm-dropdown-item",{directives:[{name:"metric",rawName:"v-metric:detail_spam",value:{msgId:null===(i=c.item)||void 0===i||null===(r=i.mailHead)||void 0===r?void 0:r.msgId},expression:"{ msgId: item?.mailHead?.msgId }",arg:"detail_spam"}],attrs:{command:"markAsSpam","zm-ta":"thread-item-header-more-"+(c.currentLabelId===c.SystemDefinedMailLabelIds.SPAM?"remove-from-spam":"move-to-spam")}},[u("span",{staticClass:"action"},[c._v(" "+c._s(c.currentLabelId===c.SystemDefinedMailLabelIds.SPAM?c.$t("operation.notSpam"):c.$t("operation.moveToSpam"))+" ")])]):c._e(),c.isSelf||!c.canSpam||!c.isZmail||c.isFromSpammedUser||c.messagesInvalidToSpam?c._e():u("zm-dropdown-item",{directives:[{name:"metric",rawName:"v-metric:detail_spam",value:{msgId:null===(o=c.item)||void 0===o||null===(s=o.mailHead)||void 0===s?void 0:s.msgId},expression:"{ msgId: item?.mailHead?.msgId }",arg:"detail_spam"}],attrs:{command:"openReportSpamDialog","zm-ta":"thread-item-header-more-"+(c.currentLabelId===c.SystemDefinedMailLabelIds.SPAM?"report-not-spam":"report-spam")}},[u("span",{staticClass:"action"},[c._v(" "+c._s(c.currentLabelId===c.SystemDefinedMailLabelIds.SPAM?c.$t("operation.reportNotSpam"):c.$t("operation.reportSpamStatus"))+" ")])]),c.isSelf||!c.canSpam||c.isGmail||c.isOutlook||c.messagesInvalidToSpam?c._e():u("zm-dropdown-item",{attrs:{command:"openReportPhishingDialog","zm-ta":"thread-item-header-more-report-phishing"}},[c._v(" "+c._s(c.$t("operation.reportPhishing"))+" ")]),c.canDelete&&!c.isOutlook?u("zm-dropdown-item",{attrs:{command:"deleteMsg","zm-ta":"thread-item-header-more-delete-this-message"}},[c._v(" "+c._s(c.$t("operation.deleteMsg"))+" ")]):c._e(),u("zm-dropdown-item",{directives:[{name:"metric",rawName:"v-metric:detail_print",value:{msgId:null===(l=c.item)||void 0===l||null===(d=l.mailHead)||void 0===d?void 0:d.msgId},expression:"{ msgId: item?.mailHead?.msgId }",arg:"detail_print"}],attrs:{command:"print","zm-ta":"thread-item-header-more-print"}},[c._v(" "+c._s(c.$t("operation.printMessage"))+" ")]),u("zm-dropdown-item",{attrs:{command:"showOriginal"}},[c._v(" "+c._s(c.$t("operation.showOriginal"))+" ")]),c.isStickerEnabled?u("zm-dropdown-item",{attrs:{command:"addStickyNote","zm-ta":"thread-item-header-more-add-sticky-note",divided:""}},[c._v(" "+c._s(c.$t("sticker.addStickyNote"))+" "),u("svg-icon",{staticClass:"dropdown-item-beta-icon",attrs:{"aria-hidden":"true",iconClass:"beta"}})],1):c._e(),c.isCalendarEnabled?u("zm-dropdown-item",{attrs:{command:"scheduleMeeting","zm-ta":"thread-item-header-more-schedule-meeting"}},[c._v(" "+c._s(c.$t("operation.scheduleMeeting"))+" ")]):c._e(),c.isOutlook?c._e():u("zm-dropdown-item",{attrs:{command:"openCreateFilter",divided:"","zm-ta":"thread-item-header-more-filter-messages-like-this"}},[c._v(" "+c._s(c.$t("operation.createFilterFromMessage"))+" ")]),c.hasSubscription?u("zm-dropdown-item",{directives:[{name:"metric",rawName:"v-metric:detail_unsubscribe",arg:"detail_unsubscribe"}],attrs:{command:"showUnsubscribe","zm-ta":"thread-item-header-unsubscribe"}},[c._v(" "+c._s(c.$t("subscription.unsubscribe"))+" ")]):c._e(),c.isFromBlockedUser||c.isSelf||!c.isZmail?c._e():u("zm-dropdown-item",{attrs:{command:"openReportBlockedDialog","zm-ta":"thread-item-header-more-block"}},[c._v(" "+c._s(c.$t("operation.blockItem",[c.item.from.displayName]))+" ")]),c.isZmail&&c.mailBoxApprovable?u("zm-dropdown-item",{attrs:{command:"approveMailbox","zm-ta":"thread-item-header-more-approve"}},[c._v(" "+c._s(c.$t("operation.approve",[c.item.from.displayName]))+" ")]):c._e(),c.isZmail?c._e():u("zm-dropdown-item",{attrs:{command:"translateMail"}},[c._v(" "+c._s(c.$t("operation.translateMessage"))+" ")])],1)],1)},V=[],j=n(97626),W=C.Enums.SystemDefinedMailLabelIds,G={name:"ResponseItemDropdown",components:{SvgIcon:j.Z},props:{item:{type:Object,default:function(){}},inOutbox:{type:Boolean},inGroup:{type:Boolean},isDecrypted:{type:Boolean},isFromBlockedUser:{type:Boolean},isFromSpammedUser:{type:Boolean},canSpam:{type:Boolean},canDelete:{type:Boolean},canReplyAll:{type:Boolean},isGmail:{type:Boolean},isZmail:{type:Boolean},isOutlook:{type:Boolean},isSelf:{type:Boolean},currentLabelId:{type:String},isOnlyOneMail:{type:Boolean},messagesInvalidToSpam:{type:Boolean,default:!1},mailBoxApprovable:{type:Boolean,default:!1},hasSubscription:{type:Boolean,default:!1}},data:function(){return{SystemDefinedMailLabelIds:W}},computed:(0,s.Z)((0,s.Z)({},(0,c.rn)({isCalendarEnabled:function(e){return e.userProfile.isCalendarEnabled||!1}})),(0,c.Se)("features",["isStickerEnabled"])),methods:{handleCommand:function(e){this.$emit("handleCommand",e)}}},q=G,K=(0,_.Z)(q,U,V,!1,null,"098e4c7d",null),Q=K.exports,Y=function(){var e=this,t=e._self._c;return e.isEncryptedZmail?t("zm-tooltip",{attrs:{content:e.iconLabel}},[["E2E Encrypted","Server Encrypted"].includes(e.type)?t("svg-icon",{staticClass:"response-item-encryption-indicator",attrs:{tabindex:"-1",iconClass:e.iconClass}}):e._e()],1):e._e()},J=[],X={name:"EncryptionIndicator",components:{SvgIcon:j.Z},props:{type:{type:String,default:""}},computed:(0,s.Z)((0,s.Z)({},(0,c.Se)(["isEncryptedZmail"])),{},{iconClass:function(){return"E2E Encrypted"===this.type?"shield-lock":"shield-warning"},iconLabel:function(){return this.$t("E2E Encrypted"===this.type?"encryption.e2eEncrypted":"encryption.serverEncrypted")}})},ee=X,te=(0,_.Z)(ee,Y,J,!1,null,"20995fb6",null),ne=te.exports,ae=n(98663),ie=n(94e3),re=n(94256),oe=n(38017),se=(n(45794),n(21515),C.Utils.getAllHtmlText);function le(){return de.apply(this,arguments)}function de(){return de=(0,o.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{threadId:"",msgId:"",labelId:"",dom:null,targetLang:"zh-cn",onFinish:function(){}},console.log("translateMail translationOption = ",t),e.abrupt("return",new Promise((function(e,n){var a=20,i=t.threadId,r=t.msgId,o=t.labelId,s=t.dom,d=t.targetLang,c=t.onFinish;if(s){var u=s.cloneNode(!0),h=se(u);if(null===h||void 0===h||!h.length)return console.warn("No found text content in mail"),c&&c(),void e(u);var p=new Map,f={},g=[];h.forEach((function(e,t){g.push({index:t,src:e}),f[t]=e})),k.Z.commit("mail/addTranslatingThreadId",i);var v=0;g=(0,l.chunk)(g,a),g.forEach((function(t){try{m.Mail.translateMessages({threadId:i,msgId:r,labelId:o,srcLanguage:"",desLanguage:d,data:t}).then((function(n){var a,i,r,o,s;if(console.log("translate data ",t,"translateResponse",n),0===(null===n||void 0===n?void 0:n.errorCode)&&null!==n&&void 0!==n&&null!==(a=n.data)&&void 0!==a&&null!==(i=a.translateMessage)&&void 0!==i&&i.success&&null!==n&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(o=r.translateMessage)&&void 0!==o&&null!==(s=o.data)&&void 0!==s&&s.length){var l=n.data.translateMessage.data;l.forEach((function(e){if(0===e.code){var t=f[e.index],n=e.des;n?p.set(t,n):console.warn("can't find translation result for ",t)}else console.warn("translate error",e)})),p.size&&(ce(u,p),e(u))}}))["finally"]((function(){v++,v===g.length&&(console.log("all dom translated translatedDom => ",u),c&&c(),k.Z.commit("mail/removeTranslatingThreadId",i))}))}catch(n){console.error("translateMessages error",t)}}))}else n(new Error("cant get translated mail"))})));case 3:case"end":return e.stop()}}),e)}))),de.apply(this,arguments)}function ce(e,t){function n(e){if(e.nodeType===Node.TEXT_NODE){if(e.textContent&&e.textContent.trim()){var a=t.get(e.textContent)||t.get(e.textContent.trim());a&&(e.textContent=a)}}else if(e.nodeType===Node.ELEMENT_NODE)for(var i=0;i=e},injectBaseStyleDirectly:function(e){var t=e.isMailContentTooLong;return!t},allowReply:function(){if(this.inOutbox)return!1;var e=this.cacheItem.mailHead.isReplyAvailable;return!this.inOutbox&&e},canceledEvent:function(){var e,t,n;return null===(e=this.cacheItem)||void 0===e||null===(t=e.mailHead)||void 0===t||null===(n=t.subject)||void 0===n?void 0:n.includes("Canceled event")},firstMsgIdInThread:function(){var e,t;return null===(e=[].concat(this.selectMailDetail).sort((function(e,t){return e.mailHead.date-t.mailHead.date}))[0])||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.msgId},isSelf:function(){return this.userEmail.toLowerCase()===this.data.from.emailAddr.toLowerCase()},canSpam:function(){return"OUTBOX"!==this.currentLabelId&&"DRAFT"!==this.currentLabelId&&"SPAM"!==this.currentLabelId},canDelete:function(){return!(this.currentLabelId===Ae.TRASH)},attachmentList:function(){return this.cacheItem.attachments.filter((function(e){return"HtmlBody"===e.attachType?"Finish"!==e.downloadStatus:!e.isInlineAttachment}))},unsubscribeActions:function(){return[{id:"cancel",className:"cancel-unsubscribe",handler:this.resetUnsubscribe,text:this.$t("operation.cancel"),zmTa:"subscription-cancel"},{id:"unsubscribe",className:"unsubscribe",handler:this.unsubscribe,text:this.$t("subscription.unsubscribe"),type:"primary",zmTa:"subscription-unsubscribe"}]},reportSpamActions:function(){return[{id:"cancel",className:"cancel-report-spam",handler:this.cancelReportSpam,text:this.$t("operation.cancel")},{id:"reportSpam",className:"report-spam",handler:this.reportSpam,text:this.$t("detail.reportSpam"),type:"primary"}]},blockUserActions:function(){return[{id:"cancel",className:"cancel-report-spam",handler:this.cancelBlock,text:this.$t("operation.cancel")},{id:"blockUser",className:"report-spam",handler:this.reportBlock,text:this.$t("common.block"),type:"primary"}]},reportPhishingActions:function(){return[{id:"cancelPhishing",className:"cancel-report-spam",handler:this.cancelReportPhishing,text:this.$t("operation.cancel")},{id:"reportPhishing",className:"report-spam",handler:this.reportPhishing,text:this.$t("common.report"),type:"primary"}]},isFromBlockedUser:function(){return this.spamType===p.NW.BLOCK},isFromSpammedUser:function(){return this.spamType===p.NW.JUNK},isFromPhishingUser:function(){return this.spamType===p.NW.PHISHING},sentByInfo:function(e){var t=e.cacheItem,n=Be((null===t||void 0===t?void 0:t.sender)||"");return n},checkScheduledLabel:function(){var e,t;return null===(e=this.cacheItem)||void 0===e||null===(t=e.mailHead)||void 0===t?void 0:t.isUserScheduled},searchTermObj:function(){return(0,E.gE)(this.searchString)},inlineImageSrcMap:function(){return Re.getInlineImageSrcMap(this.cacheItem)},inDisableLabel:function(){var e;return null===(e=this.currentInboxItem)||void 0===e?void 0:e.mailHead.showLabelIds.some((function(e){return[C.Enums.SystemDefinedMailLabelIds.ESCROW,C.Enums.SystemDefinedMailLabelIds.GROUP_APPROVAL,C.Enums.SystemDefinedMailLabelIds.QUARANTINED].includes(e)}))},labelInfo:function(e){var t=e.data,n=e.allLabelsTree,a=e.isOutlook,i=null===t||void 0===t?void 0:t.office365MailFolderId;if(i&&i!==this.currentLabelId){var r=n.find((function(e){return e.id===i}));if(r)return{icon:Le.getLabelIconName(a),displayName:r.displayName}}},formatTime:function(){var e=(0,ie.xb)(this.cacheItem),t=1e3*e,n=(0,E.Gt)(t,(new Date).getTime(),!0),a=p.ZA[n]||"ccc', 'MMM d y";return u.ou.fromMillis(t).setZone(this.userTimeZone).toFormat(a)},hasMessageActions:function(e){var t=e.hideActions,n=e.checkScheduledLabel,a=e.inEscrow,i=e.inOutbox,r=e.contentVisible,o=e.inDisableLabel,s=e.isQuarantinedMsg,l=e.threadOperationPermission;return!t&&!n&&!a&&!i&&r&&!o&&!s&&l},isQuarantinedMsg:function(e){var t=e.data;if(t){var n=t.mailHead;return!(null===n||void 0===n||!n.allLabelIds)&&(null===n||void 0===n?void 0:n.allLabelIds.includes(C.Enums.SystemDefinedMailLabelIds.QUARANTINED))}return!1},canShowAttachmentList:function(){var e=!this.isLoadingLargeHtmlBody&&this.isAutoDownloadHtmlBodySuccess,t=this.attachmentList.length>0;return t&&!this.isQuarantinedMsg&&e},isSnoozedMessage:function(e){var t=e.data;return!(!t.mailHead.snoozeNotifyTime||!t.mailHead.allLabelIds.includes(Ae.SNOOZED))},snoozeTitle:function(e){var t=e.isSnoozedMessage,n=e.data;if(t){var a=1e3*n.mailHead.snoozeNotifyTime,i=u.ou.now(),r=i.startOf("week"),o=i.endOf("week"),s=r.toMillis(),l=o.toMillis(),d=a>=s&&a<=l,c=d?u.ou.fromMillis(a).toFormat("EEE, t"):u.ou.fromMillis(a).toFormat("FF");return this.$t("detail.snoozeUntil",[c])}return""}}),watch:{isLast:{handler:function(e,t){!e||t||this.contentVisible||(this.contentVisible=!0)},immediate:!1},showItemDetail:{handler:function(e){this.contentVisible=e},immediate:!0},cc:function(e,t){d().isEqual(e,t)||(this.showCc=!0)},bcc:function(e,t){d().isEqual(e,t)||(this.showBcc=!0)},contentVisible:{handler:function(e){var t,n,a=this;e?(this.initAutoDownloadHtmlBody(),null===(t=this.addToExpandedMsgIds)||void 0===t||t.call(this,this.cacheItem.mailHead.msgId)):((this.inSearching||this.detailSearchEnabled)&&setTimeout((function(){(0,E.gQ)(a.$refs.snippetText,{textToHighlight:a.searchTermObj["default"],subtextToHighlight:a.detailSearchPattern})}),200),null===(n=this.removeFromExpandedMsgIds)||void 0===n||n.call(this,this.cacheItem.mailHead.msgId))},immediate:!0},data:function(){var e,t;this.data!==this.cacheItem&&(this.cacheItem=this.data,this.cacheDraftDetail=this.draftDetail,this.initAutoDownloadHtmlBody(),null===(e=this.$refs)||void 0===e||null===(t=e.responsiveIframe)||void 0===t||t.forceRerender());this.refreshSPAMStatus()}},created:function(){var e=this;this.updateMailHead=(0,o.Z)((0,r.Z)().mark((function t(){var n,a;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,n=e.currentLabelId,t.next=4,m.Inbox.getMailHead({labelId:n,mailId:e.currentInboxItem.mailId});case 4:a=t.sent,a&&e.$store.commit("batchAddMailHeads",{labelId:n,mailHeads:[a]}),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),console.log(t.t0);case 11:case"end":return t.stop()}}),t,null,[[0,8]])}))),this.initAutoDownloadHtmlBody(),this.targetLang=this.defaultTranslationLang},mounted:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.isLast&&(e.contentVisible=!0),e.contentVisible&&(e.refreshSPAMStatus(),n=e.$watch("spamType",(function(){e.showUnBlockHeader=e.isZmail&&!e.isFromBlockedUser&&e.currentLabelId===Ae.BLOCKED}),{immediate:!0}),e.$once("hook:beforeDestroy",(function(){n(),n=null}))),a=2,i=0;case 4:if(!(e.isZmail&&i")},title:this.$t("operation.approveThisEmailAddress"),width:"475px",rejectAction:{id:"cancel",className:"cancel-report-spam tab-focus",text:this.$t("operation.cancel")},approveAction:{id:"blockUser",className:"report-spam tab-focus",text:this.$t("operation.approve"),type:"primary"}}).then((function(){e.doApproveMailbox()}))["catch"]((function(){console.warn("approve rejected")}))},doApproveMailbox:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,s,l;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.emailAddr,n){t.next=3;break}return t.abrupt("return");case 3:return t.prev=3,t.next=6,h.t.listSpammedUsers();case 6:return i=t.sent,s=(null===(a=i.find((function(e){var t=e.email;return t===n})))||void 0===a?void 0:a.status)||p.NW.NOT_ALLOWLIST,t.next=10,h.t.reportSpam({sender:n.replace(/'/g,"&apos"),type:p.NW.ALLOWLIST});case 10:e.spamType=p.NW.ALLOWLIST,l=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(){return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,h.t.reportSpam({sender:n.replace(/'/g,"&apos"),type:s});case 3:e.refreshSPAMStatus(),t.next=10;break;case 6:t.prev=6,t.t0=t["catch"](0),e.$msg({type:"Error",content:e.$t("detail.undoFailed")}),e.refreshSPAMStatus();case 10:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(){return t.apply(this,arguments)}}(),e.$undoNotice({iconClass:"checkmark",title:e.$t("operation.emailAddressApproved"),action:e.$t("operation.undo"),actionCallback:l}),t.next=20;break;case 15:t.prev=15,t.t0=t["catch"](3),console.log(t.t0),e.refreshSPAMStatus(),e.$msg({type:"Error",content:e.$t("operation.approveFailedContent",[e.selectedUserEmail.displayName])});case 20:case"end":return t.stop()}}),t,null,[[3,15]])})))()},subscribeNotification:function(){var e=this;this.$Bus.$on("ZMailUINotif_OnCalendarEventUpdate",this.handleCalendarEventUpdate=function(t){var n,a,i,r;(null===(n=t.result)||void 0===n?void 0:n.msgId)===(null===(a=e.cacheItem)||void 0===a||null===(i=a.mailHead)||void 0===i?void 0:i.msgId)&&(null===(r=e.$refs.calendarCard)||void 0===r||r.processCalendarEventData(t.result.calendarEventDetail))})},refreshMailHead:function(e){var t=this,n=this.selectMailLabel.id;m.Inbox.getMailHead({labelId:n,mailId:e}).then((function(a){a&&C.Utils.isDecrypted(a.mailHead.decryptionStatus)&&(t.$store.commit("batchAddMailHeads",{labelId:n,mailHeads:[a.mailHead]}),t.setCurrentInboxItem(t.getMailHeadByMailId(n,e)))}))},unsubscribeNotification:function(){this.$Bus.$off("ZMailUINotif_OnCalendarEventUpdate",this.handleCalendarEventUpdate)},initAutoDownloadHtmlBody:function(){if(this.contentVisible){var e=this.attachmentList.find((function(e){return"HtmlBody"===e.attachType&&"Finish"!==e.downloadStatus}));e?(this.isLoadingLargeHtmlBody=!0,this.autoDownloadHtmlBody(e)):this.isLoadingLargeHtmlBody=!1}},handleAutoDownloadHtmlBody:function(e){if(this.isAutoDownloadHtmlBodySuccess=e,!e)return this.isLoadingLargeHtmlBody=!1,void this.$msg({type:"Error",content:this.$t("detail.loadingEmailFailedAndRetry")});this.$emit("showDetail",this.currentInboxItem,{override:!0,reload:!0})},handleRetryDownloadHtmlBody:function(){var e=this.attachmentList.find((function(e){return"HtmlBody"===e.attachType&&"Finish"!==e.downloadStatus}));e?(this.isLoadingLargeHtmlBody=!0,this.isAutoDownloadHtmlBodySuccess=!0,this.autoDownloadHtmlBody(e)):this.$msg({type:"Error",content:this.$t("detail.loadingEmailFailedAndRetry")})},autoDownloadHtmlBody:function(e){var t=this;(0,f.Ve)({msgId:this.cacheItem.mailHead.msgId,downloadDir:"",aid:e.aid,size:e.size}).then((function(e){console.log("download response item attachmentitem dat=",e),t.handleAutoDownloadHtmlBody(0===e.returnCode)}))["catch"]((function(e){console.log("download response item attachmentitem error",e),t.handleAutoDownloadHtmlBody(!1)}))},formatDate:function(e){return u.ou.fromSeconds(e).setZone(this.userTimeZone).toFormat("MMM d y h:mm a")},filterMailSnippet:function(e){return e?(0,E.mM)(e):C.Utils.getMailSnippet(this.cacheItem.content)},handleBlockedMailExternalResource:function(e){this.hasBlockedMailExternalResource=e},handlePrintOverride:function(e){this.printOverride=e},handleHitPrint:function(e){this.hitPrint=e},handleHitSTC:function(e){this.hitSendToChat=e},handleSTCOverride:function(e){this.sendCopyToChatOverride=e},cleanHtml:function(){var e=this,t=JSON.parse(JSON.stringify(this.cacheItem)),n=(0,x.Z)(this.cacheItem.content,{scaleRatio:this.scaleRatio,inlineImageSrcMap:this.inlineImageSrcMap}),a=n.sanitize({filterDarkModeStyles:!0,filterThirdPartyLinks:!this.allowMailExternalImg,callback:function(t){e.hasBlockedMailExternalResource=t}}).process({needFold:!1,injectStyle:!1,injectScript:!1,lazyLoad:!1}).generate();return n.destroy(),n=null,t.content=a,t},print:function(){var e=this;if(console.log("trigger print -------------------"),!this.isPrinting){console.log("do print ------------------- "),this.setPrintingMailFlag(!0);var t=this.cleanHtml();if(this.hasBlockedMailExternalResource&&this.printOverride)return this.setPrintingMailFlag(!1),void(this.hitPrint=!0);console.log("print cacheItemClone",t,"translatedSubject",this.translatedSubject);var n=this.translatedDom?this.translatedDom.innerHTML:"",a=this.translatedSubject||"";this.targetLang&&(n&&(t.content=n),a&&(t.mailHead.subject=a),console.log("update translated cacheItemClone",t)),(0,T.KX)([t],this.userTimeZone).then((function(t){var n=(0,E.mM)(t,{WHOLE_DOCUMENT:!0});(0,T.F5)(n,(function(t){t&&e.$msg(t),e.setPrintingMailFlag(!1)}),(function(){return e.isPrinting})),e.printOverride=!0}))}},package:function(){var e=new z.Z;e.doPackage(this.cacheItem)},cancelReportSpam:function(){this.spamingItem=null,this.showReportSpamDialog=!1},deleteMsg:function(e){var t=this;return(0,o.Z)((0,r.Z)().mark((function n(){var a,i,o,s,l;return(0,r.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=[],a.push(e.mailHead.msgId),t.selectMailDetail.forEach((function(t){t.mailHead.isDraft&&t.mailHead.draftReplyToMsgId===e.mailHead.msgId&&a.push(e.mailHead.msgId)})),i=[{groupId:e.mailId,msgIds:a}],n.next=6,m.Inbox.trashMail({fromLabelId:t.currentLabelId,toLabelId:Ae.TRASH,groupMsgsIds:i,isTrashMessageUnderThread:!0});case 6:o=n.sent,0===o.errorCode?(t.$undoNotice({title:t.$tc("operation.undoResultMsg",i.length,[i.length])}),s=t.currentMailHeads[e.mailId],console.warn("thisMailHeader",s),1===(null===s||void 0===s?void 0:s.mailHead.msgIds.length)?t.$emit("goBack"):(console.warn("selectMailDetail",t.selectMailDetail),l=t.selectMailDetail.findIndex((function(t){return t.mailHead.msgId===e.mailHead.msgId})),t.selectMailDetail.splice(l,1),t.$emit("resetInstantDraftsMsgIdByThreadIds",[e.mailHead.mailId]))):t.$msg(t.$t("operation.moveToTrashFailed"));case 8:case"end":return n.stop()}}),n)})))()},openReportSpamDialog:function(e){this.showReportSpamDialog=!0,this.spamingItem=e;var t=e.from,n=t.displayName,a=t.emailAddr;this.hasBold={key:"detail.spamInfo",email:"".concat(n," <").concat(a,">")}},openReportBlockedDialog:function(e){this.showReportBlockedDialog=!0,this.blockingItem=e;var t=e.from,n=t.displayName,a=t.emailAddr;this.hasBold={key:"detail.blockInfo",email:"".concat(n," <").concat(a,">")}},markUnreadFromHere:function(){var e=this,t=(0,s.Z)((0,s.Z)({},this.currentInboxItem),{},{msgIds:this.selectMailDetail.filter((function(t){var n=t.mailHead.date>=e.data.mailHead.date,a=!t.mailHead.isDraft;return n&&a})).map((function(e){return e.mailHead.msgId}))});this.markMails({mails:[t],fromLabelId:t.labelId,markType:He.UNREAD,isMarkMessageUnderThread:!0}),this.isSplitView||this.goBack()},moveToInbox:function(e){var t=this;return(0,o.Z)((0,r.Z)().mark((function n(){return(0,r.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,t.moveMails({mails:[e],fromLabelId:e.labelId,toLabelId:Ae.INBOX});case 2:case"end":return n.stop()}}),n)})))()},markAsSpam:function(e){var t=this;return(0,o.Z)((0,r.Z)().mark((function n(){var a,i,o;return(0,r.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.mailHead,i=t.getReportSpamInfoByMSGId(a.msgId),o=[{mailId:i.mailId,msgIds:i.msgIds}],i.labelId===Ae.SPAM?t.notSpamMails({mails:o,fromLabelId:i.labelId}):t.spamMails({mails:o,fromLabelId:i.labelId});case 4:case"end":return n.stop()}}),n)})))()},reportNotSpam:function(e){var t=this;return(0,o.Z)((0,r.Z)().mark((function n(){var a,i,o;return(0,r.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:a=e.from,i=e.mailHead,o=t.getReportSpamInfoByMSGId(i.msgId),t.reportNotSpamMail({mail:o,from:a}),t.goBack();case 4:case"end":return n.stop()}}),n)})))()},reportSpam:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,o;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.showReportSpamDialog=!1,e.spamingItem){t.next=3;break}return t.abrupt("return");case 3:n=e.spamingItem,a=n.from,i=n.mailHead,o=e.getReportSpamInfoByMSGId(i.msgId),e.reportSpamMail({mail:o,from:a}),e.spamingItem=null;case 7:case"end":return t.stop()}}),t)})))()},cancelReport:function(){this.blockingItem=null,this.showReportBlockedDialog=!1},reportBlock:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,s,l,d;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.debug({emailAddr:e.emailAddr}),e.blockingItem){t.next=4;break}return e.showReportBlockedDialog=!1,t.abrupt("return");case 4:return n=e.blockingItem,a=n.from,i=n.mailHead,s=i.mailId,l=i.msgId,t.prev=6,e.spamType=p.NW.BLOCK,e.showReportBlockedDialog=!1,t.next=11,h.t.reportSpam({threadId:s,msgIds:[l],sender:a.emailAddr.replace(/'/g,"&apos"),type:p.NW.BLOCK});case 11:d=function(){var t=(0,o.Z)((0,r.Z)().mark((function t(){return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:try{e.spamType=p.NW.NORMAL,h.t.reportSpam({threadId:s,msgIds:[l],sender:a.emailAddr.replace(/'/g,"&apos"),type:p.NW.NORMAL})}catch(n){e.spamType=p.NW.BLOCK,e.$msg({type:"Error",content:e.$t("detail.undoFailed")})}case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),e.$undoNotice({iconClass:"checkmark",title:e.$t("detail.emailAddressBlocked"),action:"Undo",actionCallback:d}),t.next=20;break;case 15:t.prev=15,t.t0=t["catch"](6),e.spamType=p.NW.NORMAL,console.error(t.t0),e.$msg({type:"Error",content:e.$t("detail.blockFailed",[a.displayName])});case 20:case"end":return t.stop()}}),t,null,[[6,15]])})))()},unblock:function(e){var t=this;return(0,o.Z)((0,r.Z)().mark((function n(){var a;return(0,r.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=e.from.emailAddr,console.log({item:e,emailAddr:a}),n.prev=2,t.spamType=p.NW.NORMAL,n.next=6,h.t.reportSpam({sender:a.replace(/'/g,"&apos"),type:p.NW.NOT_BLOCK});case 6:n.next=12;break;case 8:n.prev=8,n.t0=n["catch"](2),t.spamType=p.NW.BLOCK,t.$msg({type:"Error",content:t.$t("detail.unblockEmailFailed")});case 12:case"end":return n.stop()}}),n,null,[[2,8]])})))()},scheduleMeeting:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,oe.lp)(e.cacheItem);case 2:case"end":return t.stop()}}),t)})))()},cancelReportPhishing:function(){this.phishingItem=null,this.showReportPhishingDialog=!1},openReportPhishingDialog:function(e){this.showReportPhishingDialog=!0,this.phishingItem=e},reportPhishing:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,o;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.phishingItem){t.next=3;break}return e.showReportPhishingDialog=!1,t.abrupt("return");case 3:n=e.phishingItem,a=n.from,i=n.mailHead,o=e.getReportSpamInfoByMSGId(i.msgId),e.reportPhishingMail({mail:o,from:a}),e.phishingItem=null,e.showReportPhishingDialog=!1;case 8:case"end":return t.stop()}}),t)})))()},canReplyAll:function(e){if(!this.allowReply||!this.contentVisible)return!1;if(e){var t=e.from,n=e.to,a=e.cc;return C.Utils.canReplyAll({from:t,to:n,cc:a,userEmail:this.myEmailAddresses})}return!1},unsubscribe:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,o,s;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e.cacheItem.unSubscribeUrl.length||"By Url"!==e.cacheItem.unSubscribeType){t.next=6;break}n=e.$refs.externalLinkAnchor,n.click(),e.resetUnsubscribe(),t.next=31;break;case 6:if("By Mail"!==e.cacheItem.unSubscribeType){t.next=29;break}return t.prev=7,a=e.cacheItem.mailHead.msgId,t.next=11,window.zoomSdk.postJsMessage({functionName:"mailui_SendUnsubscribeMail",params:{msgId:a}});case 11:if(i=t.sent,0!==i.returnCode){t.next=18;break}e.resetUnsubscribe(),e.unsubscribeSuccess=!0,e.$metric.report("detail_unsubscribe_confirm",{msgId:a}),t.next=19;break;case 18:throw new Error(null===i||void 0===i||null===(o=i.result)||void 0===o||null===(s=o.error)||void 0===s?void 0:s.message);case 19:return t.abrupt("return",i);case 22:t.prev=22,t.t0=t["catch"](7),e.resetUnsubscribe(),console.error(t.t0),e.$undoNotice({iconClass:"crossmark",title:e.$t("notification.failedToSendMsg")});case 27:t.next=31;break;case 29:e.resetUnsubscribe(),e.$undoNotice({iconClass:"crossmark",title:e.$t("subscription.unsubscribeFailed")});case 31:case"end":return t.stop()}}),t,null,[[7,22]])})))()},resetUnsubscribe:function(){var e=this;this.showUnsubscribeDialog=!1,setTimeout((function(){e.externalLink="",e.unsubscribeInfo={}}),300)},showUnsubscribe:function(){this.externalLink=this.cacheItem.unSubscribeUrl.length?this.cacheItem.unSubscribeUrl:"",this.unsubscribeInfo={externalLink:this.externalLink,email:this.cacheItem.from.emailAddr},this.showUnsubscribeDialog=!0},refreshSPAMStatus:function(){var e=this;if(this.isZmail){this.spamType=p.NW.NORMAL;var t=this.emailAddr;"string"===typeof t&&h.t.getSpamStatus(t).then((function(t){e.spamType=t}))["catch"]((function(t){e.spamType=p.NW.NORMAL}))}},changeShowDetail:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(!this.contentVisible||!this.isLast){var t,n=window.getSelection();if("Range"!==n.type)this.contentVisible="undefined"!==typeof e?!!e:!this.contentVisible,null===(t=this.$refs.responsiveIframe)||void 0===t||t.render(),this.contentVisible&&this.isZmail&&this.refreshSPAMStatus()}},addStickyNote:function(){console.debug("[sticky note] add on message");var e=this.$refs.headerTopRef;if(e){var t=e.getBoundingClientRect();console.debug("[sticky note] header top rect",t),this.$emit("addStickyNote",{x:t.left+t.width-400,y:t.top+t.height,msgId:this.cacheItem.mailHead.msgId,clip:ae.$5+(this.cacheItem.mailHead.snippet||this.$t("common.noSnippet"))})}},handleCommand:function(e){var t=this,n={handleReply:$e.REPLY,handleReplyAll:$e.REPLY_ALL,handleForward:$e.FORWARD};"openCreateFilter"===e?(this.$emit("openCreateFilter",this.cacheItem),this.$Bus.$emit("showCreateFilter",{from:this.cacheItem.mailHead.from.emailAddr,mailIds:[this.cacheItem.mailHead.mailId]})):Object.keys(n).includes(e)?setTimeout((function(){t.handleReplyActionTrigger(n[e])}),0):"translateMail"===e?this.handleTranslateMail():this[e](this.cacheItem)},handleTranslateMail:function(){var e=this;console.log("translateMail",this.cacheItem),this.translateBarVisible=!0,this.originalIframeBodyDom||(this.originalIframeBodyDom=this.$refs.responsiveIframe.$refs.iframeRef.contentDocument.body.cloneNode(!0)),this.isTranslating||(console.log("defaultTranslationLang",this.defaultTranslationLang),this.isTranslating=!0,this.$emit("translateSubject",{targetLang:this.defaultTranslationLang,forceTranslate:!0}),le({threadId:this.cacheItem.mailHead.threadId,msgId:this.cacheItem.mailHead.msgId,dom:this.originalIframeBodyDom,targetLang:this.defaultTranslationLang,labelId:this.originalThreadLabelId,onFinish:function(){e.isTranslating=!1}}).then((function(t){t?(e.$refs.responsiveIframe.$refs.iframeRef.contentDocument.body.innerHTML="",e.$refs.responsiveIframe.$refs.iframeRef.contentDocument.body.replaceChildren(t),e.translatedDom=t,e.$emit("onMailTranslationUpdate",{msgId:e.cacheItem.mailHead.msgId,translatedDom:t})):console.log("translateMail failed, cant get translatedDom",t)}))["catch"]((function(t){console.log("error",t),e.isTranslating=!1,e.translatedDom=null})))},translate:function(e){var t;console.log("translate mail to",e),this.targetLang=e,this.handleTranslateMail(),null===(t=this.$refs.translateBar)||void 0===t||t.updateLang(e)},viewOriginalMail:function(){console.log("viewOriginalMail"),this.$emit("translateSubject",{targetLang:""}),this.$refs.responsiveIframe.$refs.iframeRef.contentDocument.body.innerHTML=this.originalIframeBodyDom.innerHTML,this.$emit("onMailTranslationUpdate",{msgId:this.cacheItem.mailHead.msgId,translatedDom:this.originalIframeBodyDom})},viewTranslatedMail:function(){console.log("viewTranslatedMail"),this.$emit("translateSubject",{targetLang:this.defaultTranslationLang}),this.translatedDom&&(this.$refs.responsiveIframe.$refs.iframeRef.contentDocument.body.innerHTML=this.translatedDom.innerHTML),this.$emit("onMailTranslationUpdate",{msgId:this.cacheItem.mailHead.msgId,translatedDom:this.translatedDom})},closeTranslation:function(){this.viewOriginalMail(),this.translateBarVisible=!1,this.translatedDom=null,this.originalIframeBodyDom=null,this.$emit("onMailTranslationUpdate",{msgId:this.cacheItem.mailHead.msgId,translatedDom:this.translatedDom})},handleMark:function(e,t){var n=this;return(0,o.Z)((0,r.Z)().mark((function t(){var a,i;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.mailHead.isUnread?"Read":"UnRead",t.next=3,m.Inbox.markMail({mailMarkType:a,fromLabelId:n.selectMailLabel.id,groupMsgsIds:[{groupId:e.mailHead.mailId,msgIds:[e.mailHead.msgId]}]});case 3:i=t.sent,0===i.errorCode&&n.$store.commit("changeMailHead",{mailId:e.mailHead.mailId,type:"isUnread",status:"UnRead"===a,labelId:n.selectMailLabel.id});case 5:case"end":return t.stop()}}),t)})))()},handleRetry:function(){var e=this;return(0,o.Z)((0,r.Z)().mark((function t(){var n,a,i,o,s,l,d;return(0,r.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return window.zoomLog.info("[JS log][detail page mailui_retrydecryptmails] cacheItem:"+JSON.stringify({decryptionStatus:e.cacheItem.decryptionStatus,mailEncryptionType:e.cacheItem.mailEncryptionType,msgId:null===(n=e.cacheItem.mailHead)||void 0===n?void 0:n.msgId})+"\nprops.data:"+JSON.stringify({decryptionStatus:e.data.decryptionStatus,mailEncryptionType:e.data.mailEncryptionType,msgId:null===(a=e.data.mailHead)||void 0===a?void 0:a.msgId})),e.isRetrying=!0,t.next=4,Promise.race([window.zoomSdk.postJsMessage({functionName:"mailui_retrydecryptmails",params:{msgIds:[e.cacheItem.mailHead.msgId]}}),new Promise((function(e){setTimeout((function(){e({returnCode:-1,originalCode:-1})}),1e4)}))]);case 4:if(i=t.sent,0!==i.returnCode){t.next=24;break}return o=i.result.DecryptMail,s=e.isConversationView?o.threadId:o.msgId,t.next=10,m.Inbox.getMailDetails({mailIds:[s],labelId:e.selectMailLabel.id});case 10:if(l=t.sent,d=(null===l||void 0===l?void 0:l.mailDetails)||[],d.length){t.next=15;break}return console.error("get mail details error"),t.abrupt("return");case 15:d.sort((function(e,t){return e.mailHead.date-t.mailHead.date})),e.$store.commit("setSelectMailDetail",{detail:d,isLastPage:null===l||void 0===l?void 0:l.isLastPage}),e.cacheItem=d.find((function(t){return t.mailHead.msgId===e.data.mailHead.msgId})),console.log("this.$store.state.selectMailLabel ===> ",e.selectMailLabel),e.retrySuccess=!0,e.refreshMailHead(s),e.cacheItem.mailHead.isUnread&&e.handleMark(e.cacheItem,"Read"),t.next=26;break;case 24:e.originalCode=i.originalCode,e.devicesWithAccess=i.devicesWithAccess;case 26:e.isRetrying=!1;case 27:case"end":return t.stop()}}),t)})))()},handleNavigateToBackupPage:function(){this.isZmail&&!(0,E.IJ)()&&m.Setting.showInputBackupKeyWindow()},showOriginal:function(e){console.log("responseItem showOriginal",e),this.$emit("showOriginal",e)},renderResponsiveIframe:function(){var e;this.isFirstMailWithDraft&&(null===(e=this.$refs.responsiveIframe)||void 0===e||e.render())},handleIframeResize:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.selectMailDetail[this.selectMailDetail.length-1],a=this.isLast&&!this.hideActions&&(null===n||void 0===n?void 0:n.goToReplyLatestMsg);a&&setTimeout((function(){return e.$refs.replyBtnsRef.scrollIntoView()}),500),this.isFirstMailWithDraft&&(!t&&this.checkScrolled()||setTimeout((function(){var t,n;null===(t=e.$refs)||void 0===t||null===(n=t.responseReplyEditor)||void 0===n||n.scrollIntoView()}),300))},goBack:function(){this.$emit("goBack")},cancelBlock:function(){this.showReportBlockedDialog=!1},convertTime:function(e){return Math.floor(e.toSeconds())},handleReplyActionTrigger:function(e){var t,n,a;if(e)switch(e){case $e.REPLY:null===(t=this.$refs)||void 0===t||t.responseReplyEditor.handleReply();break;case $e.REPLY_ALL:null===(n=this.$refs)||void 0===n||n.responseReplyEditor.handleReplyAll();break;case $e.FORWARD:null===(a=this.$refs)||void 0===a||a.responseReplyEditor.handleForward();break;default:break}},shareMessageToChat:function(){this.enableShareToChat&&(0,oe.tb)(this.cacheItem)},handleDraftDeleted:function(){var e=this;setTimeout((function(){var t,n;null===(t=e.$refs)||void 0===t||null===(n=t.responseItemRef)||void 0===n||n.scrollIntoView({behavior:"smooth",block:"start"})}),600)},unsnooze:function(){this.unsnoozeMessages({labelId:this.currentLabelId||Ae.SNOOZED,msgIds:[this.data.mailHead.msgId]}),this.goBack()}})},Pe=Ze,Fe=(0,_.Z)(Pe,a,i,!1,null,"2fe83129",null),Ne=Fe.exports},83375:function(e,t,n){n.d(t,{$T:function(){return w},F5:function(){return I},KX:function(){return f}});var a=n(70021),i=n(56706),r=(n(6886),n(77950),n(17368),n(45794),n(24471),n(37348)),o=n.n(r),s=n(70487),l=n(32153),d=n(79337),c=n(87693),u=n(53806);function m(e,t){var n=e.contentWindow.getComputedStyle(t);return parseInt(n.getPropertyValue("margin-top"),10)+parseInt(n.getPropertyValue("margin-bottom"),10)}function h(e){var t=null===e||void 0===e?void 0:e.contentWindow.document.body,n=m(e,t);return t.offsetHeight+n}function p(e){console.debug("preloadImages",e);var t=[];function n(e){var n=e.attachId,a=t.findIndex((function(e){return e.indexOf(n)}));a>=0&&t.splice(a,1)}function a(e){return new Promise((function(n){var a=new Image;a.onload=function(){console.debug("load image success"),n(!0)},a.onerror=function(a){console.error("image load error",a),0===e.indexOf("zmdf")&&t.push(e),n(!1)},console.debug("start preload image",e),a.src=e}))}return(0,c.eE)()?Promise.all(e.map((function(e){return a(e)}))):new Promise((function(i){s["default"].prototype.$Bus.$on(u.Enums.Notification.OnZmdfImageLoaded,n),Promise.all(e.map((function(e){return a(e)}))).then((function(){if(t.length>0){console.debug("wait for zmdf loaded");var e=20,n=setInterval((function(){console.debug("load tryHandler",e),e<=0||t.length<=0?(clearInterval(n),i(!0)):e--}),1e3)}else i(!0)}))})).then((function(){s["default"].prototype.$Bus.$off(u.Enums.Notification.OnZmdfImageLoaded,n)}))}function f(e,t){return g.apply(this,arguments)}function g(){return g=(0,i.Z)((0,a.Z)().mark((function e(t,n){var i,r,o,s,c,u;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=null,r=null,o=null,s=function(e){return d.ou.fromSeconds(e).setZone(n)},t.filter((function(e){return!e.mailHead.isDraft})).forEach((function(e,t){var n=e.to.map((function(e){return"".concat(e.displayName," (").concat(e.emailAddr,")")})).join(","),a="".concat(n),d="".concat(e.from.displayName," (").concat(e.from.emailAddr,")"),c="".concat(e.mailHead.subject),u=''.concat(s(e.mailHead.date),""),m=l.ZP.load(e.content);0===t?(i=l.ZP.load(e.content),r=i("head"),o=i("body"),o.html("".concat(c,"

").concat(d).concat(u,"
To: ").concat(a,"

")+m("body").html())):(r.append("
"),r.append(m("head").html()),o.append("".concat(c,"

").concat(d).concat(u,"
To: ").concat(a,"

")+m("body").html()))})),!i){e.next=14;break}if(console.log("iframes content ------ ",i.html()),c=i("img"),u=[],c.each((function(e){var t=c.eq(e),n=t.attr("src");n&&u.push(n)})),!u.length){e.next=13;break}return e.next=13,p(u);case 13:return e.abrupt("return",i.html());case 14:return e.abrupt("return","");case 15:case"end":return e.stop()}}),e)}))),g.apply(this,arguments)}function v(e){var t=e.filter((function(e){return e.src&&e.src!==window.location.href})).map((function(e){return b(e)}));return Promise.all(t)}function b(e){return new Promise((function(t){var n=5;function a(){return(0,c.eE)()?!e||"undefined"===typeof e.naturalWidth||0===e.naturalWidth||!e.complete:!e||("undefined"===typeof e.naturalWidth||0===e.naturalWidth)&&e.complete&&!/time=\d+$/gim.test(e.src)||"undefined"===typeof e.naturalWidth||0===e.naturalWidth||!e.complete}var i=function e(){a()&&n>0?setTimeout((function(){n--,e()}),500):t()};i()}))}function y(e,t){var n=h(e);o()(e).css({height:"".concat(n,"px")});var a=function(){console.log("after print and windows focus",e.parentNode),o()(e).remove()},i=function(){console.log("before print set windows focus handler"),o()(window).off("focus",a),o()(window).one("focus",a)};e.contentWindow.addEventListener("beforeprint",(function(){console.log("beforeprint"),(0,c.eE)()&&i()})),e.contentWindow.addEventListener("afterprint",(function(){console.log("afterprint"),(0,c.eE)()||i(),setTimeout((function(){t&&t()}),400)}));try{e.contentWindow.print()}catch(r){}}function I(e,t,n){var a=document.createElement("iframe");document.body.appendChild(a),o()(a).css({width:"650px",position:"fixed",top:"-9999px",left:"-9999px"});var i=null,r=20,s=function(e){o()(a).off("load",i),o()(a).remove(),t&&t(e)},l=setInterval((function(){r--,r<0?(clearInterval(l),s("Print mail failed.")):r>=0&&n&&!n()&&(clearInterval(l),s("Print mail cancelled."))}),1e3);o()(a).on("load",i=function(){console.log("iframe load -------- "),clearInterval(l);var e=a.contentDocument.getElementsByTagName("img");e.length>0?v(Array.from(e)).then((function(){console.log("loadIframeImages finish"),y(a,t)})):y(a,t)}),setTimeout((function(){console.log("iframe src set success -------- "),a.srcdoc=e}),100)}function w(e){try{var t=Array.from(e.getElementsByTagName("a")),n="^(https|http|ftp|rtsp|mms|mailto|tel|callto|zoomphonecall|zmdf|zoomus):|data:image/|#",a=new RegExp(n);if(t.length<1)return;t.filter((function(e){return e.hasAttribute("href")&&e.href.trim()})).forEach((function(e){a.test(e.getAttribute("href"))?e.setAttribute("title",e.href):e.removeAttribute("href")})),t=[]}catch(i){console.error("error occur during addTitleForLink: ",i)}}}}]);