| 1234567891011 |
- (self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[42],{36289:function(t,e,i){"use strict";i.d(e,{Z:function(){return c}});var n=function(){var t=this,e=t._self._c;return e("zm-alert",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"compose-banner tab-focus",attrs:{closable:t.closable,tabindex:"0"},on:{close:function(e){return t.$emit("close")}}},[e("div",{staticClass:"alert-body"},[t._t("icon",(function(){return[t.iconClass?e("svg-icon",{staticClass:"alert-icon",attrs:{"aria-hidden":!0,iconClass:t.iconClass}}):t._e()]})),e("div",{staticClass:"alert-body-content"},[t._t("default",(function(){return[e("div",[e("span",[t._v(t._s(t.content))]),e("div",{staticClass:"action",on:{click:function(e){return t.$emit("action")}}},[t._v(t._s(t.actionText))])])]})),t.$slots["actions"]?e("div",{staticClass:"alert-body-actions"},[t._t("actions")],2):t._e()],2)],2)])},a=[],o={name:"ComposeBanner",props:{visible:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},iconClass:{type:String,default:""},content:{type:String,default:""},actionText:{type:String,default:""}}},s=o,r=i(93483),l=(0,r.Z)(s,n,a,!1,null,"4138b978",null),c=l.exports},41331:function(t,e,i){"use strict";i.d(e,{Z:function(){return m}});var n=function(){var t=this,e=t._self._c;return t.showDelegateBanner?e("div",{staticClass:"delegate-banner-container tab-focus",attrs:{tabindex:"0"}},[t._v(" "+t._s(t.$t("delegate.delegateSend",[t.getName(t.userEmail)]))+" ")]):t._e()},a=[],o=i(34948),s=(i(77950),i(37761)),r=i.n(s),l=i(29648),c={name:"DelegatedBanner",props:{showDelegateBanner:{type:Boolean,default:!0}},computed:(0,o.Z)({},(0,l.rn)({userEmail:function(t){return t.userProfile.userEmail}})),methods:{getName:function(t){return null===t||void 0===t?void 0:t.split("@")[0].split(".").map(r().capitalize).join(" ")}}},d=c,u=i(93483),h=(0,u.Z)(d,n,a,!1,null,"3ce296fd",null),m=h.exports},19052:function(t,e,i){"use strict";i.d(e,{Z:function(){return h}});var n=function(){var t=this,e=t._self._c;return t.isZmail?e("ComposeBanner",{attrs:{iconClass:t.isDarkMode?"external-sender-dark":"external-sender-light",content:t.externalWarningConfiguration.warningBannerContentSend},on:{close:function(e){return t.$emit("dismiss")}}}):t._e()},a=[],o=i(34948),s=i(29648),r=i(36289),l={name:"ExternalUserWarningBanner",components:{ComposeBanner:r.Z},computed:(0,o.Z)({},(0,s.Se)(["externalWarningConfiguration","isZmail","isDarkMode"]))},c=l,d=i(93483),u=(0,d.Z)(c,n,a,!1,null,null,null),h=u.exports},61514:function(t,e,i){"use strict";i.d(e,{Z:function(){return h}});var n=function(){var t=this,e=t._self._c;return t.isEncryptedZmail?e("ComposeBanner",{attrs:{iconClass:"group",content:t.$t("group.banner")},on:{close:function(e){return t.$emit("dismiss")}}}):t._e()},a=[],o=i(34948),s=i(29648),r=i(36289),l={name:"GroupEmailBanner",components:{ComposeBanner:r.Z},computed:(0,o.Z)({},(0,s.Se)(["isEncryptedZmail"]))},c=l,d=i(93483),u=(0,d.Z)(c,n,a,!1,null,null,null),h=u.exports},81020:function(t,e,i){"use strict";i.d(e,{Z:function(){return c}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"OOO-user-alert-container"},[e("zm-alert",{class:["alert"],attrs:{center:""},on:{close:t.handleRemove}},[e("div",{staticClass:"alert-body"},[e("div",{staticClass:"alert-body-content",attrs:{"aria-label":"".concat(t.OOOPeopleStr).concat(t.OOOText)}},[e("span",{staticClass:"ooo-prople"},[e("span",[t._v(" "+t._s(t.OOOPeopleStr)+" "+t._s(t.OOOText)+" ")])])])])])],1)},a=[],o={name:"OOOStatusBanner",props:{recipientsStatus:{type:Array,default:[]}},computed:{OOORecipients:function(){return this.recipientsStatus.filter((function(t){var e=t.isOOO;return e})).map((function(t){var e=t.displayName;return e}))},OOOPeopleStr:function(){if(this.OOORecipients.length<1)return"";if(1===this.OOORecipients.length)return this.OOORecipients[0];var t=this.OOORecipients.slice(0,-1).join(", "),e=this.OOORecipients.slice(-1);if(this.OOORecipients.length<5)return[t,e].join(" ".concat(this.$t("editor.and")," "));var i=this.OOORecipients.length-3;return[this.OOORecipients.slice(0,3).join(", "),"".concat(i," ").concat(this.$t("editor.others"))].join(" ".concat(this.$t("editor.and")," "))},OOOText:function(){return 1===this.OOORecipients.length?this.$t("editor.isInOOO"):this.$t("editor.areInOOO")}},methods:{handleRemove:function(){this.$emit("hide")}}},s=o,r=i(93483),l=(0,r.Z)(s,n,a,!1,null,"2a5b8327",null),c=l.exports},7790:function(t,e,i){"use strict";i.d(e,{Z:function(){return d}});var n=function(){var t=this,e=t._self._c;return t.displayBanner?e("ComposeBanner",{attrs:{iconClass:"triangle-alert-filled-colored",content:t.$t("common.recipientExceedLimit")},on:{close:function(e){t.displayBanner=!1}}}):t._e()},a=[],o=i(36289),s={name:"RecipientLengthLimitBanner",components:{ComposeBanner:o.Z},data:function(){return{displayBanner:!0}}},r=s,l=i(93483),c=(0,l.Z)(r,n,a,!1,null,null,null),d=c.exports},69899:function(t,e,i){"use strict";i.d(e,{Z:function(){return g}});var n=function(){var t,e,i=this,n=i._self._c;return n("ComposeBanner",{attrs:{iconClass:"compose_scheduled_send",content:i.$t("time.emailSetToSendOn",[i.formatDateTime]),"zm-ta":"thread-item-footer-schedule-send-remove-"+(null===(t=i.cacheItem)||void 0===t||null===(e=t.mailHead)||void 0===e?void 0:e.msgId)},on:{close:i.handleRemove},scopedSlots:i._u([{key:"actions",fn:function(){var t,e,a,o;return[i.isEdit?n("zm-button",{attrs:{size:"mini",type:"link","zm-ta":"thread-item-footer-schedule-send-edit-"+(null===(t=i.cacheItem)||void 0===t||null===(e=t.mailHead)||void 0===e?void 0:e.msgId)},on:{click:i.handleEdit}},[i._v(" "+i._s(i.$t("operation.edit"))+" ")]):n("zm-button",{attrs:{size:"mini",type:"link","zm-ta":"thread-item-footer-schedule-send-send-"+(null===(a=i.cacheItem)||void 0===a||null===(o=a.mailHead)||void 0===o?void 0:o.msgId)},on:{click:i.cancelScheduledSend}},[i._v(" "+i._s(i.$t("operation.cancel"))+" ")])]},proxy:!0}])})},a=[],o=i(70021),s=i(56706),r=i(34948),l=i(79337),c=i(95740),d=i(29648),u=i(32682),h=i(36289),m={name:"ScheduledSendBanner",components:{ComposeBanner:h.Z},props:{scheduledTime:{type:[Object,Number]},isEdit:{type:Boolean,default:!1},cacheItem:{type:Object,default:function(){}}},computed:{formatDateTime:function(){if(this.scheduledTime){var t,e=(0,r.Z)({},l.ou.DATETIME_MED);return this.isEdit?null===(t=this.scheduledTime)||void 0===t?void 0:t.toLocaleString(e):l.ou.fromSeconds(this.scheduledTime).toLocaleString(e)}}},methods:(0,r.Z)((0,r.Z)({},(0,d.OI)(["addInstantDraftList"])),{},{handleEdit:function(){this.$emit("handleCustomTimeVisible",!0),this.$emit("handleEditScheduledSend",!0),this.$metric.report("edit_schedule")},handleRemove:function(){this.$emit("handleCustomTimeVisible",!1),this.$emit("handleScheduledSend",!1),this.$metric.report("remove_schedule")},cancelScheduledSend:function(){var t=this;return(0,s.Z)((0,o.Z)().mark((function e(){var i,n;return(0,o.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.l.cancelSendingMail(t.cacheItem.mailHead.msgId);case 3:if(i=e.sent,0!==i.returnCode){e.next=11;break}return n={key:(0,u.Z)(),composeItem:(0,r.Z)({},t.cacheItem),isDraft:!0},t.$store.commit("addInstantDraftList",n),t.$compose({composeItem:n.composeItem}),t.$undoNotice({iconClass:"checkmark",title:t.$t("operation.cancelledScheduledSendAndRevertedToDraft")}),t.goBack(),e.abrupt("return");case 11:e.next=16;break;case 13:e.prev=13,e.t0=e["catch"](0),t.$undoNotice({iconClass:"crossmark",title:t.$t("notification.failedToCancel")});case 16:case"end":return e.stop()}}),e,null,[[0,13]])})))()},goBack:function(){this.$emit("goBack")}})},f=m,p=i(93483),v=(0,p.Z)(f,n,a,!1,null,null,null),g=v.exports},36463:function(t,e,i){"use strict";i.d(e,{Z:function(){return m}});var n=function(){var t=this,e=t._self._c;return e("zm-dropdown",{staticClass:"dropdown",attrs:{placement:"bottom-start"},on:{command:t.handleDropdownCommand}},[e("zm-button",{staticClass:"dropdown-btn",attrs:{ghost:"","zm-ta":"compose-alias-selector",disabled:t.disabled,"aria-label":"".concat(t.$t("editor.from")," ").concat(t.selectedAddress)}},[e("span",{staticClass:"current-selection-text"},[t._v(" "+t._s(t.selectedAddress)+" ")]),e("zm-tooltip",{attrs:{placement:"top",disabled:!t.disabled,content:t.$t("compose.aliasDisabled")}},[e("SvgIcon",{attrs:{iconClass:t.disabled?"question":"chevron-small-down"}})],1)],1),e("zm-dropdown-menu",{staticClass:"alias-selector-menu"},t._l(t.aliasItems,(function(i){return e("zm-dropdown-item",{key:i.emailAddress,attrs:{command:i,"zm-ta":"compose-alias-selector-item-".concat(t.aliasItems.emailAddress),"aria-checked":i.emailAddress===t.selectedAddress,role:"menuitemradio"}},[e("zm-tooltip",{attrs:{content:i.emailAddress,popperClass:"alias-item-content-popper",placement:"right"}},[e("div",{staticClass:"alias-item-content"},[e("span",{staticClass:"alias-label"},[t._v(" "+t._s(t.getAliasOptionLabel(i))+" ")]),e("svg-icon",{directives:[{name:"show",rawName:"v-show",value:i.emailAddress===t.selectedAddress,expression:"aliasItem.emailAddress === selectedAddress"}],staticClass:"checkmark",attrs:{iconClass:"check"}})],1)])],1)})),1)],1)},a=[],o=i(6041),s=i(34948),r=i(29648),l=i(85061),c={name:"AliasSelector",props:{disabled:{type:Boolean,default:!1}},data:function(){return{selectedAddress:""}},computed:(0,s.Z)((0,s.Z)((0,s.Z)({},(0,r.rn)({userEmail:function(t){return t.userProfile.userEmail||""},aliasList:function(t){return t.alias.aliasList}})),(0,r.Se)("alias",["defaultAlias"])),{},{aliasItems:function(){return[{emailAddress:this.userEmail}].concat((0,o.Z)(this.aliasList))}}),watch:{disabled:function(t){t&&this.handleDropdownCommand(this.aliasItems[0])}},mounted:function(){var t=this,e=this.defaultAlias;this.selectedAddress=(null===e||void 0===e?void 0:e.emailAddress)||this.userEmail,e&&this.$nextTick((function(){t.$emit("select",{displayName:e.displayName||(0,l.No)(e.emailAddress),emailAddr:e.emailAddress})}))},methods:{handleDropdownCommand:function(t){this.selectedAddress=t.emailAddress,this.$emit("select",{displayName:t.displayName||(0,l.No)(t.emailAddress),emailAddr:t.emailAddress})},getAliasOptionLabel:function(t){var e=t.displayName||(0,l.No)(t.emailAddress);return"".concat(e," <").concat(t.emailAddress,">")}}},d=c,u=i(93483),h=(0,u.Z)(d,n,a,!1,null,"16b8e612",null),m=h.exports},17891:function(t,e,i){"use strict";i.d(e,{Z:function(){return u}});var n=function(){var t,e,i,n,a=this,o=a._self._c;return o("zm-dropdown",{staticClass:"dropdown",attrs:{placement:"bottom-start"},on:{command:a.handleDropdownCommand}},[o("zm-button",{staticClass:"dropdown-btn",attrs:{ghost:"","aria-label":"".concat(a.$t("editor.from")," ").concat(null===(t=a.fromUserMail)||void 0===t?void 0:t.displayName," <").concat(null===(e=a.fromUserMail)||void 0===e?void 0:e.emailAddr,">")}},[a.fromUserMail?o("span",{staticClass:"current-selection-text"},[a._v(" "+a._s("".concat(null===(i=a.fromUserMail)||void 0===i?void 0:i.displayName," <").concat(null===(n=a.fromUserMail)||void 0===n?void 0:n.emailAddr,">"))+" ")]):a._e(),o("SvgIcon",{attrs:{iconClass:"chevron-small-down"}})],1),o("zm-dropdown-menu",a._l(a.sendAsList,(function(t){var e,i,n=t.displayName,s=t.sendAsEmail;return o("zm-dropdown-item",{key:s,attrs:{command:s,"aria-checked":s===(null===(e=a.fromUserMail)||void 0===e?void 0:e.emailAddr),role:"menuitemradio"}},[o("span",[a._v(" "+a._s("".concat(n," <").concat(s,">"))+" ")]),o("svg-icon",{directives:[{name:"show",rawName:"v-show",value:s===(null===(i=a.fromUserMail)||void 0===i?void 0:i.emailAddr),expression:"sendAsEmail === fromUserMail?.emailAddr"}],staticClass:"checkmark",attrs:{iconClass:"check"}})],1)})),1)],1)},a=[],o=i(34948),s=i(29648),r={name:"FromSelector",props:{fromUserMail:{type:Object,default:null},replyTo:{type:String|Array,default:""}},computed:(0,o.Z)({},(0,s.rn)(["sendAsList"])),watch:{sendAsList:function(){this.validateSelection()||this.setDefault()},value:function(){this.validateSelection()||this.setDefault()}},mounted:function(){this.setDefault()},methods:{handleDropdownCommand:function(t){var e=this.sendAsList.find((function(e){var i=e.sendAsEmail;return i===t}));e&&this.applySendAsInstance(e)},applySendAsInstance:function(t){this.$emit("update:replyTo",t.replyToAddress),this.$emit("update:fromUserMail",{displayName:t.displayName,emailAddr:t.sendAsEmail})},validateSelection:function(){var t=this;return this.sendAsList.some((function(e){var i,n=e.sendAsEmail;return n==(null===(i=t.fromUserMail)||void 0===i?void 0:i.emailAddr)}))},setDefault:function(){var t=this.sendAsList.find((function(t){var e=t.isDefault;return e}))||this.sendAsList[0];t&&this.applySendAsInstance(t)}}},l=r,c=i(93483),d=(0,c.Z)(l,n,a,!1,null,"058f74d3",null),u=d.exports},66235:function(t,e,i){"use strict";i.d(e,{Z:function(){return C}});var n=function(){var t=this,e=t._self._c;return e("zm-dialog",{staticClass:"prompt-editor-dialog",attrs:{visible:t.visible,modal:"","modal-append-to-body":"","append-to-body":"","show-close":"","close-on-press-escape":"","aria-label":t.headerText,"aria-busy":t.isGenerating.toString()},on:{open:t.init,opened:t.handleOpened,close:t.handleClose}},[e("div",{staticClass:"zm-dialog__title",attrs:{slot:"title"},slot:"title"},[e("svg-icon",{attrs:{iconClass:"ai-fill"}}),e("span",[t._v(t._s(t.headerText))])],1),t.isGenerating||!t.contextTip&&!t.showPreview?t._e():e("div",{staticClass:"ctx-and-preview-wrap"},[t.contextTip?e("i18n",{class:["ctx","tab-focus"],attrs:{path:"GPT.context",tag:"div",tabindex:"0"},scopedSlots:t._u([{key:"0",fn:function(){return[e("span",{staticClass:"ctx-content"},[t._v(t._s(t.contextTip))])]},proxy:!0}],null,!1,2822516548)}):t._e(),t.showPreview?e("div",{ref:"previewRef",class:["preview-editor","tab-focus"],attrs:{tabindex:"0"}},[e("zm-input",{staticClass:"input-editor preview",attrs:{type:"textarea",autosize:{minRows:0,maxRows:14},role:"presentation",readonly:!0,tabindex:"-1"},model:{value:t.newCompose,callback:function(e){t.newCompose=e},expression:"newCompose"}})],1):t._e()],1),t.hasGenerated&&t.showPreview?e("div",{staticClass:"preview-editor-actions"},[e("div",[t.enableFeedback?e("div",{staticClass:"feedbacks"},[e("span",{staticClass:"like"},[e("svg-icon",{attrs:{iconClass:"upvote"}})],1),e("span",{staticClass:"dislike"},[e("svg-icon",{attrs:{iconClass:"downvote"}})],1)]):t._e()]),e("div",{staticClass:"re-generate-actions"},[e("zm-button",{staticClass:"regenerate-btn refine-btn",on:{click:function(e){return e.stopPropagation(),t.regenerate.apply(null,arguments)}}},[t._v(t._s(t.$t("GPT.tryAnother")))]),e("zm-button",{attrs:{type:"primary"},on:{click:t.insertCompose}},[t._v(t._s(t.hasPresetDraft?t.$t("GPT.replace"):t.$t("compose.insert")))])],1)]):t._e(),t.isGenerating?e("div",{staticClass:"generating-placeholder"},[e("span",[t._v(t._s(t.$t("compose.ZIQIsWriting")))]),e("zm-button",{ref:"stopBtn",staticClass:"stop",on:{click:t.stopGenerating}},[t._v(" "+t._s(t.$t("GPT.stop"))+" ")])],1):e("div",{staticClass:"prompt-editor"},[e("div",{staticClass:"input-editor-wrap"},[e("zm-input",{ref:"inputRef",staticClass:"input-editor",attrs:{tabindex:"0",autocomplete:"on",autofocus:"",autosize:{minRows:4,maxRows:7},type:"textarea",placeholder:t.fullPlaceholderString,label:t.headerText},model:{value:t.prompt,callback:function(e){t.prompt=e},expression:"prompt"}}),e("div",{directives:[{name:"show",rawName:"v-show",value:0===t.prompt.length,expression:"prompt.length === 0"}],ref:"inputEditorPlaceholder",staticClass:"input-editor-placeholder"},[e("i18n",{attrs:{path:"compose.promptPlaceholder"}},[e("template",{slot:"0"},[t.placeholder.showRefineActions?e("span",{staticClass:"refine-actions"},[e("zm-button",{attrs:{type:"primary",ghost:""},on:{click:function(){return t.refineAction("longer")}}},[t._v(" "+t._s(t.$t("GPT.makeLonger"))+", ")]),e("zm-button",{attrs:{type:"primary",ghost:""},on:{click:function(){return t.refineAction("shorter")}}},[t._v(" "+t._s(t.$t("GPT.makeShorter"))+", ")]),e("zm-popover",{ref:"changeTonePopover",attrs:{title:t.$t("GPT.changeTone"),"popper-class":"tone-panel force-light",trigger:"click","visible-arrow":!1},on:{show:function(e){t.focusToneIdx=-1}}},[e("zm-button",{attrs:{slot:"reference",type:"primary",ghost:""},slot:"reference"},[t._v(" "+t._s(t.$t("GPT.changeTone"))+" ")]),e("div",{staticClass:"tones",attrs:{"aria-label":t.$t("GPT.changeTone"),"aria-activedescendant":"tone-menu-item-".concat(t.focusToneIdx),role:"menu",tabindex:"0"},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"tab",9,e.key,"Tab")?null:t.closeChangeTonePopover.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:t.focusOnPrevTone.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:t.focusOnPrevTone.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:t.focusOnNextTone.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:t.focusOnNextTone.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.changeToFocusedTone.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.changeToFocusedTone.apply(null,arguments)}]}},t._l(t.tones,(function(i,n){return e("div",{key:i.value,class:["tone",{"mb-2":n<4,focused:t.focusToneIdx===n}],attrs:{id:"tone-menu-item-".concat(n),role:"menuitem"},on:{click:function(e){return t.changeTone(i.value)}}},[e("span",{staticClass:"emoji"},[t._v(t._s(i.emoji))]),e("label",[t._v(t._s(t.$t(i.label)))])])})),0)],1)],1):t._e()])],2),t.placeholder.example?e("br"):t._e(),t.placeholder.example?e("span",[t._v(" "+t._s(t.placeholder.example)+" ")]):t._e()],1)],1),e("div",{staticClass:"prompt-editor-actions"},[e("zm-button",{staticClass:"generate-btn",attrs:{tabindex:"0",type:"primary",disabled:t.disableGenerate},on:{click:function(){return t.generateNewEmail()}}},[t._v(t._s(t.$t("compose.generate")))])],1)]),e("confirm-dialog",{attrs:{visible:t.discardDialogVisible,title:t.$t("GPT.discardContent"),content:t.$t("GPT.discardContentDesc"),actions:t.discardActions,width:"400px"}})],1)},a=[],o=i(70021),s=i(56706),r=i(34948),l=(i(45794),i(77950),i(17368),i(24471),i(29648)),c=i(53806),d=i(63012),u=i(32682),h=i(91787),m=c.Utils.getContactName,f=c.Utils.isValidEmailAddress,p=c.Business.ErrorHelper,v={Formal:"Formal",Informal:"Informal",Friendly:"Friendly",Persuasive:"Persuasive",Humorous:"Humorous",Sarcastic:"Sarcastic",Serious:"Serious",Playful:"Playful"},g={name:"PromptEditor",components:{ConfirmDialog:h["default"]},props:{visible:{type:Boolean,default:!1},recipients:{type:Array,default:function(){return[]}},subject:{type:String,default:function(){return""}},conversations:{type:Array,default:function(){return[]}},presetDraft:{type:String,default:""},respondType:{type:String,default:c.Enums.RESPOND_TYPE.NEW}},data:function(){var t=this;return{prompt:"",activePrompt:"",newCompose:this.presetDraft.trim()||"",isGenerating:!1,hasGenerated:!1,isInserting:!1,draft:this.presetDraft.trim(),enableFeedback:!1,focusToneIdx:-1,tones:[{emoji:"🎩",value:v.Formal,label:"GPT.formalTone"},{emoji:"🧢",value:v.Informal,label:"GPT.informalTone"},{emoji:"👋",value:v.Friendly,label:"GPT.friendlyTone"},{emoji:"🧑⚖️",value:v.Persuasive,label:"GPT.persuasiveTone"},{emoji:"🤣",value:v.Humorous,label:"GPT.humorousTone"},{emoji:"😜",value:v.Sarcastic,label:"GPT.sarcasticTone"},{emoji:"😐",value:v.Serious,label:"GPT.seriousTone"},{emoji:"😉",value:v.Playful,label:"GPT.playfulTone"}],discardDialogVisible:!1,discardActions:[{id:"back2edit",text:this.$t("GPT.back2Edit"),handler:function(){t.discardDialogVisible=!1,t.focusOnEditor()}},{id:"discard",text:this.$t("GPT.discard"),type:"danger",handler:function(){t.discardDialogVisible=!1,t.$emit("closePromptEditor")}}],activeReqId:""}},computed:(0,r.Z)((0,r.Z)({},(0,l.rn)({userEmail:function(t){return t.userProfile.userEmail||""}})),{},{userName:function(){return c.Utils.getContactName(this.userEmail)},disableGenerate:function(){return this.isGenerating||""===this.prompt.trim()},generateText:function(){return this.isGenerating?this.$t("compose.generating"):this.hasGenerated&&this.newCompose?this.$t("compose.insert"):this.$t("compose.generate")},showPreview:function(){return this.hasGenerated&&!this.isGenerating||!this.isGenerating&&this.draft},hasContext:function(){return(this.conversations.length>0||this.draft)&&this.contextTip.length>0},contextTip:function(){return this.conversations.length>0&&this.hasPresetDraft?this.$t("GPT.emailCtx"):this.conversations.length>0?this.$t("GPT.emailCtxReply"):this.hasPresetDraft?this.$t("GPT.emailCtxDraft"):""},hasPresetDraft:function(){return!!this.presetDraft.trim()},headerText:function(){return this.hasContext&&this.hasPresetDraft?this.$t("compose.refineWithGPT"):this.$t("compose.composeWithGPT")},showActions:function(){return this.hasGenerated&&this.showPreview},placeholder:function(){return{showRefineActions:!!this.draft,example:this.draft?"":this.hasContext?this.$t("compose.composeWithContextPlaceholderExamples"):this.$t("compose.composePlaceholderExamples")}},fullPlaceholderString:function(t){var e=t.placeholder;return"".concat(this.$t("compose.promptPlaceholder",e.showRefineActions?["".concat(this.$t("GPT.makeLonger"),", ").concat(this.$t("GPT.makeLonger"),", ").concat(this.$t("GPT.changeTone"))]:[])," ").concat(e.example)}}),watch:{showPreview:function(t){t?this.$emit("onHasGeneratedContent",!0):this.$emit("onHasGeneratedContent",!1)},isGenerating:function(t){t?(this.focusOnStopBtn(),this.ariaAnnounce(this.$t("compose.ZIQIsWriting"))):setTimeout(this.updateChangeTonePopoverAria)}},methods:(0,r.Z)((0,r.Z)({},(0,l.OI)(["ariaAnnounce"])),{},{handleOpened:function(){var t=this;this.$nextTick((function(){t.focusOnEditor(),setTimeout(t.updateChangeTonePopoverAria)}))},focusOnEditor:function(){var t=this;this.$nextTick((function(){var e;return null===(e=t.$refs.inputRef)||void 0===e?void 0:e.focus()}))},focusOnPreview:function(){var t=this;this.$nextTick((function(){var e;return null===(e=t.$refs.previewRef)||void 0===e?void 0:e.focus()}))},focusOnStopBtn:function(){var t=this;this.$nextTick((function(){var e;return null===(e=t.$refs.stopBtn)||void 0===e?void 0:e.$el.focus()}))},beautifyText:function(t){var e="font-size:14px;line-height: 20";return"<div style=".concat(e,">").concat(t,"</div>")},normalizeSuggestionContent:function(t){var e=5,i="",n="";if(t){i=t.split("\n\n");var a=i[0];"Email:"===a&&i.shift();var o=new RegExp(/(?:Subject: *)(.*)/g),s=o.exec(i[0]);n=(null===s||void 0===s?void 0:s[1])||"",n&&i.shift(),e=2*i.length,i=i.map((function(t){return"<br>".concat(t,"</br>")})).concat(["<br/>"]).join("")}return{lines:e,content:i,subject:n}},insertCompose:function(){if(this.newCompose){this.isInserting=!0;var t=this.normalizeSuggestionContent(this.newCompose),e=t.content,i=t.subject;this.$emit("onInsertContent",this.beautifyText(e),i)}this.$emit("closePromptEditor")},sendRequest:function(t){return(0,s.Z)((0,o.Z)().mark((function e(){var i,n,a,s,r,l,c;return(0,o.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=t.prompt,n=t.recipientEmails,a=t.recipientNames,s=t.senderName,r=t.draft,l=t.conversations,c=t.respondType,e.next=3,d.Mail.generateNewComposeByPrompt({prompt:i,senderName:s,draft:r,recipientEmails:n,recipientNames:a,conversations:l,respondType:c});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))()},requestNewCompose:function(){var t=arguments,e=this;return(0,s.Z)((0,o.Z)().mark((function i(){var n,a,s,r,l,c,d,h,v,g,w;return(0,o.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=t.length>0&&void 0!==t[0]?t[0]:"",a=n||e.prompt,e.isGenerating=!0,s=e.recipients.map((function(t){return t.emailAddr||t})).filter(f),r=s.map((function(t){return m(t)})),l=(0,u.Z)(),e.activeReqId=l,i.prev=7,i.next=10,e.sendRequest({prompt:a,senderName:e.userName,draft:e.draft,recipientEmails:s,recipientNames:r,conversations:e.conversations,respondType:e.respondType});case 10:c=i.sent,e.activeReqId===l&&(d=c.errorCode,h=c.data,d?(v=p.beautifyError(d),g=v.msg,e.$undoNotice({iconClass:"crossmark",title:e.$t(g)}),e.$emit("onHasGeneratedContent",!1)):(e.hasGenerated=!0,e.activePrompt=a,e.prompt="",w=h.SmartComposeNewMail.composeResult,e.newCompose=w,e.draft=w,e.$emit("onHasGeneratedContent",!0))),i.next=17;break;case 14:i.prev=14,i.t0=i["catch"](7),console.warn("Unknown error from requesting smart compose",i.t0);case 17:return i.prev=17,e.activeReqId===l&&(e.activeReqId="",e.isGenerating=!1,e.focusOnPreview()),i.finish(17);case 20:case"end":return i.stop()}}),i,null,[[7,14,17,20]])})))()},generateNewEmail:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.requestNewCompose(t)},handleClose:function(){this.hasGenerated&&!this.isInserting?this.discardDialogVisible=!0:this.$emit("closePromptEditor")},regenerate:function(){this.requestNewCompose(this.activePrompt)},stopGenerating:function(){this.isGenerating=!1,this.activeReqId="",this.focusOnEditor()},refineAction:function(t){switch(this.draft=this.newCompose,t){case"longer":this.prompt="Make it longer";break;case"shorter":this.prompt="Make it shorter";break}this.focusOnEditor()},updateChangeTonePopoverAria:function(){var t=this.$refs.changeTonePopover;if(t){var e,i,n;t.$refs.popper.role="menu";var a=null===(e=t.$slots)||void 0===e||null===(i=e.reference)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.elm;null===a||void 0===a||a.removeAttribute("aria-describedby")}},closeChangeTonePopover:function(){var t;null===(t=this.$refs.changeTonePopover)||void 0===t||t.doClose()},changeTone:function(t){var e=!!v[t];e&&(this.prompt="Change tone to ".concat(t)),this.closeChangeTonePopover(),this.focusOnEditor()},changeToFocusedTone:function(){var t=this.tones[this.focusToneIdx];t&&this.changeTone(t.value)},focusOnPrevTone:function(){this.focusToneIdx-=1,this.focusToneIdx<0&&(this.focusToneIdx=this.tones.length-1)},focusOnNextTone:function(){this.focusToneIdx+=1,this.focusToneIdx>=this.tones.length&&(this.focusToneIdx=0)},init:function(){this.prompt="",this.activePrompt="",this.newCompose=this.presetDraft.trim()||"",this.isGenerating=!1,this.hasGenerated=!1,this.isInserting=!1,this.draft=this.presetDraft.trim(),this.discardDialogVisible=!1,this.activeReqId=""}})},w=g,b=i(93483),y=(0,b.Z)(w,n,a,!1,null,"6f5df97f",null),C=y.exports},54700:function(t,e,i){"use strict";i.d(e,{Z:function(){return d}});var n=function(){var t=this,e=t._self._c;return t.showBanner?e("ComposeBanner",{staticClass:"offline-mode-banner",attrs:{iconClass:"offline-warning",content:t.$t("offlineMode.composeBannerContent")},on:{close:t.handleClose}}):t._e()},a=[],o=i(36289),s={name:"OfflineModeComposeBanner",components:{ComposeBanner:o.Z},props:{},data:function(){return{showBanner:!0}},methods:{handleClose:function(){this.showBanner=!1}}},r=s,l=i(93483),c=(0,l.Z)(r,n,a,!1,null,"505814e6",null),d=c.exports},94256:function(t,e,i){"use strict";i.d(e,{Z:function(){return st}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"attachments-wrap"},[t.showDownloadAllAttachmentBtn?e("div",{staticClass:"download-all-attachments"},[e("svg-icon",{staticClass:"attachment-icon",attrs:{iconClass:"clip"}}),e("span",{staticClass:"attachment-length"},[e("span",[t._v(t._s(t.attachments.length)+" ")]),e("span",[t._v(t._s(t.$t("operation.attachments")))]),e("span",{staticClass:"all-attachment-size"},[t._v(t._s(t.allAttachmentsSize))])]),e("span",{staticClass:"attachment-text tab-focus",attrs:{tabindex:"0","aria-label":t.$t("operation.downloadAllAttachments"),role:"button"},on:{click:t.downloadAllAttachments,keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.downloadAllAttachments.apply(null,arguments)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.downloadAllAttachments.apply(null,arguments)}]}},[t._v(" "+t._s(t.$t("operation.downloadAllAttachments"))+" ")])],1):t._e(),e("div",{class:[{"attachments-list-in-compose":t.showDelete},"attachments-list","tab-focus"],attrs:{tabindex:"0","aria-label":t.$t("accessibility.attachmentsArea")},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))}]}},t._l(t.attachments,(function(i,n){return e("div",{key:i.aid,staticClass:"attachment-item-wrap",on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnPrev(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnNext(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnPrev(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnNext(n)}.apply(null,arguments))}]}},[e("AttachmentItem",{ref:"".concat(n),refInFor:!0,attrs:{"zm-ta":"new-compose-delete-attachment-".concat(n),mailHead:t.mailHead,attachmentItem:i,showDelete:t.showDelete,showDownload:t.showDownload,fromPopOut:t.fromPopOut},on:{handleDelete:t.handleDelete,handleOpenOrPreview:t.handleOpenOrPreview}})],1)})),0),e("document-preview",t._b({ref:"documentPreview",attrs:{visible:t.documentPreviewVisible,attachments:t.attachments,attachmentItem:t.currentAttachment,fileType:t.fileType},on:{closeDocumentPreview:t.closeDocumentPreview}},"document-preview",t.$props,!1))],1)},a=[],o=i(34948),s=i(29648),r=i(53806),l=i(50641),c=function(){var t=this,e=t._self._c;return e("div",{ref:"attachmentItem",class:["attachment-item","tab-focus",{"check-more":t.isCheckMore}],attrs:{tabindex:"-1",role:"button","aria-label":t.ariaLabelStatus+t.ariaLabel},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleDownloadOrPreview.apply(null,arguments)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.handleDownloadOrPreview.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:t.handleDownloadOrPreview.apply(null,arguments)}]}},[e("div",{staticClass:"thumbnail"},[t.thumbnailLoaded||t.checkPopout?e("div",{staticClass:"thumbnail-image"},[e("img",{style:{height:"".concat(t.thumbnailDisplaySize.height,"px"),width:"".concat(t.thumbnailDisplaySize.width,"px"),transform:"translate(calc(-50% + 50px), 0)"},attrs:{src:t.attachmentItem.thumbnailZmdfPath}})]):e("img",{attrs:{src:t.getIcon(t.attachmentItem.fileName,t.prefersColorScheme),alt:""}}),!t.thumbnailLoaded&&t.showDownload&&"Downloading"!==t.downloadStatus?e("div",{staticClass:"show-on-hover"},["Finish"!==t.downloadStatus||t.canPreview?e("div",{staticClass:"thumbnail-mask"}):t._e(),e("div",{staticClass:"thumbnail-overlay"},[t.canPreview?e("svg-icon",{staticClass:"large-icon",attrs:{iconClass:"attachment-preview-"+t.prefersColorScheme}}):t._e(),"Finish"===t.downloadStatus||t.canPreview?t._e():e("svg-icon",{staticClass:"large-icon",attrs:{iconClass:"attachment-download-large-"+t.prefersColorScheme}})],1)]):t._e(),t.showDownload&&"Finish"===t.downloadStatus&&t.isVideoMediaFile()?e("div",{staticClass:"show-on-hover"},[e("div",{staticClass:"thumbnail-mask dark"}),e("div",{staticClass:"thumbnail-overlay"},[e("svg-icon",{attrs:{iconClass:"attachment-media-play"}})],1)]):t._e(),"Downloading"!==t.downloadStatus||t.fromPopOut?t._e():e("div",[e("div",{staticClass:"thumbnail-mask"}),e("div",{staticClass:"thumbnail-overlay"},[e("div",{staticClass:"progress-bar-wrap"},[e("zm-progress",{staticClass:"progress-bar",attrs:{percentage:t.percentage,"stroke-width":4,"show-text":!1}}),e("svg-icon",{staticClass:"cancel-action",attrs:{iconClass:"close"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleCancel.apply(null,arguments)}}})],1)])])]),e("div",{class:["text-content"]},[e("zm-tooltip",{attrs:{placement:"bottom",content:t.attachmentItem.fileName,tabindex:"-1"}},[e("div",{staticClass:"title"},[t._v(" "+t._s(t.shortFileName)+" ")])]),e("div",{staticClass:"info"},["Finish"===t.downloadStatus?e("SvgIcon",{staticClass:"status-icon",attrs:{iconClass:"checkmark"}}):"Error"===t.downloadStatus?e("SvgIcon",{staticClass:"status-icon",attrs:{iconClass:"attachment-error-alert"}}):t._e(),"Error"===t.downloadStatus?e("span",{staticClass:"error-text"},[t._v(t._s(t.$t("common.error")))]):e("span",[t._v(t._s(t.formatSize(t.attachmentItem.size)))])],1)],1),t.showDownload&&"Downloading"!==t.downloadStatus?e("div",{staticClass:"right-icon-wrap show-on-hover"},["Finish"===t.downloadStatus?e("zm-dropdown",{attrs:{trigger:"click",placement:"bottom-start"},on:{"visible-change":t.visibleChange,command:function(e){return t.handleMore(e)}}},[e("zm-button",{staticClass:"more-button",attrs:{"aria-label":t.$t("accessibility.moreOptionsFor",[t.ariaLabel]),type:"icon",icon:"zm-icon-more"}}),e("zm-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("zm-dropdown-item",{attrs:{command:"openFile"}},[t._v(" "+t._s(t.$t("operation.openFile"))+" ")]),e("zm-dropdown-item",{attrs:{command:"showInFolder"}},[t._v(" "+t._s(t.$t("operation.showInFolder")))])],1)],1):t._e(),t.canShowDownLoadRight?e("zm-button",{staticClass:"more-button",attrs:{"aria-label":"".concat(t.$t("operation.download"),", ").concat(t.ariaLabel),type:"icon",icon:"zm-icon-download-alt-thin"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleDownload(t.attachmentItem)}},nativeOn:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),e.preventDefault(),t.handleDownload(t.attachmentItem))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.stopPropagation(),e.preventDefault(),t.handleDownload(t.attachmentItem))}]}}):t._e()],1):t._e(),t.showDelete?e("zm-button",{staticClass:"delete-action tab-focus show-on-hover",attrs:{tabindex:"0","aria-label":"".concat(t.$t("operation.delete")," ").concat(t.attachmentItem.fileName)},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleDelete(t.attachmentItem)}}},[e("svg-icon",{staticClass:"attachment-delete-icon",attrs:{iconClass:"delete"}})],1):t._e(),e("confirm-dialog",{attrs:{visible:t.showExecutableDownloadAlert,content:t.$t("detail.executableDownloadWarningContent",[t.attachmentItem.fileName]),actions:t.downloadExecutableActions,title:t.$t("detail.executableDownloadWarningTitle"),width:"600px"}})],1)},d=[],u=i(80943),h=i(97626),m=i(87693),f=i(70021),p=i(56706),v=(i(6710),i(77950),i(70487)),g=i(12546),w=i(44509),b=i(75739),y=i(23309);w.G.$on(r.Enums.Notification.OnAttachmentDownloadAllProgress,(function(t){var e,i=t.result,n=i.finished,a=i.pending,o="".concat(C.$t("common.downloading"),"(").concat(n,"/").concat(a,")");null===C||void 0===C||null===(e=C.$loadingNoticeInstance)||void 0===e||e.updateVtitle(o)}));var C={$msg:v["default"].prototype.$msg,$undoNotice:v["default"].prototype.$undoNotice,$loadingNoticeInstance:null,$t:function(t){return g.ZP.t(t)},_success_notice:function(t){this.$undoNotice({iconClass:"checkmark",title:this.$t("common.downloadedSuccessfully"),action:this.$t("common.view"),actionCallback:function(){(0,b.ZB)(t)}})},_failed_notice:function(t){this.$undoNotice({title:t,iconClass:"crossmark"})},_loading_notice:function(){this.$loadingNoticeInstance=this.$undoNotice({iconClass:"loading",duration:0,showClose:!1,isTitleChange:!0})},handleOpen:function(t){var e=this;return(0,p.Z)((0,f.Z)().mark((function i(){var n,a;return(0,f.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,n=t.filePath,i.next=4,(0,b.Vy)(n);case 4:a=i.sent,window.zoomLog.info("mailui_isfileexist success "+JSON.stringify(a)),a.IsFileExist?a.IsFileExist.isExist?(0,b.ZB)(a.IsFileExist.path):e.handleDownload(t,!1):e.$msg(e.$t("common.callIsFileExistFailed")),i.next=12;break;case 9:i.prev=9,i.t0=i["catch"](0),window.zoomLog.error("mailui_isfileexist failed "+i.t0.message);case 12:case"end":return i.stop()}}),i,null,[[0,9]])})))()},initAttachmentName:function(t){var e=/[a-zA-Z0-9]/g,i="attachments.zip";if(t){var n=t.match(e);i=n?n.join("").toLowerCase().slice(0,48)+".zip":"attachments.zip"}return i},handleDownloadAll:function(t,e){var i=this,n=this.initAttachmentName(t.subject);(0,b.b9)(n).then((function(n){if(0===n.errorCode){var a=n.data.GetSelectedFolderPaths.filePath;if(!a)return;y.Z.commit("setSelectMail",{msgId:t.msgId}),i._loading_notice();var o="".concat(i.$t("common.downloading"),"(0/").concat(e.length,")");i.$loadingNoticeInstance.updateVtitle(o),(0,b.FH)({msgId:t.msgId,downloadPath:a,attachmentList:e}).then((function(t){var e;if(i.$loadingNoticeInstance=null,0===t.errorCode&&null!==(e=t.data)&&void 0!==e&&e.localPath){var n,a=null===(n=t.data)||void 0===n?void 0:n.localPath;i._success_notice(a)}else{var o,s=i.$t("common.downloadFailed"),r=329,l=429;t.errorCode===r&&(null===(o=t.error)||void 0===o?void 0:o.originalCode)==l&&(s=i.$t("common.downloadFailed-329")),i._failed_notice(s)}}))["catch"]((function(t){i._failed_notice(i.$t("common.downloadFailed")),console.log("ResponseItem: download exception err=",t)}))}}))},handleDownload:function(t,e){var i=arguments,n=this;return(0,p.Z)((0,f.Z)().mark((function a(){var o,s;return(0,f.Z)().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return o=i.length>2&&void 0!==i[2]&&i[2],console.log("ResponseItem:handleDownload data=",t),a.next=4,(0,b.Vy)(t.filePath);case 4:if(s=a.sent,!s.IsFileExist.isExist){a.next=10;break}return n.openFile(s.IsFileExist.path),t.downloadStatus="Finish",y.Z.commit("updAttmtStatus",{msgId:t.msgId,status:{downloadStatus:"Finish",ratio:100,filePath:t.filePath}}),a.abrupt("return");case 10:(0,b.b9)(t.fileName).then((function(i){if(console.log(i),0===i.errorCode){var a=i.data.GetSelectedFolderPaths.filePath;if(!a)return;y.Z.commit("setSelectMail",{msgId:t.msgId}),t.downloadStatus="Downloading",y.Z.commit("updAttmtStatus",{msgId:t.msgId,aid:t.aid,status:{ratio:0}}),(0,b.Ve)({msgId:e.msgId,downloadDir:i.data.GetSelectedFolderPaths.filePath,aid:t.aid,size:t.size}).then((function(e){console.log("download attachmentitem dat=",e);var i=e.result.DownloadMailAttachments.BriefInfo;0===e.returnCode?(n._success_notice(i.localPath),t.filePath=i.localPath,t.downloadStatus="Finish",y.Z.commit("updAttmtStatus",{msgId:t.msgId,aid:i.attachmentId,status:{downloadStatus:"Finish",ratio:100,filePath:i.localPath}}),o&&n.openFile(i.localPath)):(n._failed_notice(),t.downloadStatus="Error",y.Z.commit("updAttmtStatus",{msgId:t.msgId,aid:i.attachmentId,status:{downloadStatus:"Error",ratio:0,filePath:""}}),console.log("ResponseItem: download failed retCode=",e.returnCode))}))["catch"]((function(e){var i;"None"!==(null===(i=y.Z.getters.attachmentDetail(t.msgId,t.aid))||void 0===i?void 0:i.downloadStatus)&&(t.downloadStatus="Error",y.Z.commit("updAttmtStatus",{msgId:t.msgId,aid:t.aid,status:{downloadStatus:"Error",ratio:0,filePath:""}}),console.log("ResponseItem: download exception err=",e))}))}else t.downloadStatus="Error",n.$msg(n.$t("common.failedToGetSelectedFolderPath"))}))["catch"]((function(e){t.downloadStatus="Error",console.log("mailui_getselectedfolderpaths",e)}));case 11:case"end":return a.stop()}}),a)})))()},handleCancelDownload:function(t,e){t.downloadStatus="None",(0,b.LP)({msgId:e.msgId,aid:t.aid})},openFileInFolder:function(t){(0,b.si)(t)}},x=["image","pdf"],k={components:{ConfirmDialog:u.QH,SvgIcon:h.Z},props:{attachmentItem:{type:Object,required:!0},showDownload:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!1},fromPopOut:{type:Boolean,default:!1},mailHead:{type:Object,default:function(){}}},data:function(){return{showExecutableDownloadAlert:!1,thumbnailLoaded:!1,thumbnailNaturalSize:{height:0,width:0},downloadExecutableActions:[{id:"cancel",className:"cancel-download-executable",handler:this.cancelDownloadExecutable,text:this.$t("operation.cancel")},{id:"downloadExecutable",className:"download-executable",handler:this.handleDownloadExecutable,text:this.$t("operation.download"),type:"primary"}],isCheckMore:!1}},computed:(0,o.Z)((0,o.Z)((0,o.Z)({},(0,s.rn)(["prefersColorScheme"])),(0,s.rn)("auth",["isMailBetaFeatureEnabled"])),{},{percentage:function(){var t,e;return null!==(t=null===(e=this.$store.getters.attachmentDetail(this.attachmentItem.msgId,this.attachmentItem.aid))||void 0===e?void 0:e.ratio)&&void 0!==t?t:0},downloadStatus:function(){return this.attachmentItem.downloadStatus},thumbnailDisplaySize:function(){return this.thumbnailLoaded?this.thumbnailNaturalSize.height/this.thumbnailNaturalSize.width>.6?{width:100,height:100*this.thumbnailNaturalSize.height/this.thumbnailNaturalSize.width}:{width:60*this.thumbnailNaturalSize.width/this.thumbnailNaturalSize.height,height:60}:{width:0,height:0}},ariaLabelStatus:function(){var t=this.$t("operation.download");return this.canPreview?t=this.$t("operation.preview"):"Finish"===this.downloadStatus&&(t=this.$t("operation.open")),t+", "},ariaLabel:function(){var t=this.attachmentItem.fileName,e="Error"===this.downloadStatus?this.$t("common.error"):(0,l.sS)(this.attachmentItem.size);return"".concat(t,", ").concat(e).concat("Finish"===this.downloadStatus?" ,"+this.$t("operation.downloaded"):"")},shortFileName:function(){return r.Utils.getShorterFileName(this.attachmentItem.fileName,{wrapStyle:{width:"100px"}})},fileExtension:function(){return this.fileSeparatorIndex>0?this.attachmentItem.fileName.substring(this.fileSeparatorIndex+1):""},fileSeparatorIndex:function(){return this.attachmentItem.fileName.lastIndexOf(".")},fileName:function(){return this.fileSeparatorIndex>0?this.attachmentItem.fileName.substring(0,this.fileSeparatorIndex):this.attachmentItem.fileName},fileType:function(){return(0,l.JB)(this.attachmentItem.fileName)},canPreview:function(){var t=6291456,e=x.includes(this.fileType);return!(!this.showDownload||!e)&&!("pdf"===this.fileType&&this.attachmentItem.size>t)},canShowDownLoadRight:function(){var t=this.isVideoMediaFile(this.attachmentItem.fileName)&&this.thumbnailLoaded;return"Finish"!==this.downloadStatus&&(this.canPreview||t)},checkPopout:function(){return this.fromPopOut&&this.attachmentItem.thumbnailZmdfPath}}),mounted:function(){var t=this;this.attachmentItem.thumbnailZmdfPath&&this.preloadZmdfImage(this.attachmentItem.thumbnailZmdfPath)["catch"]((function(){(0,m.eE)()||t.$Bus.$on(r.Enums.Notification.OnZmdfImageLoaded,t.onZmdfImageLoaded)})),this.$once("hook:beforeDestroy",(function(){(0,m.eE)()||t.$Bus.$off(r.Enums.Notification.OnZmdfImageLoaded,t.onZmdfImageLoaded)}))},methods:{preloadZmdfImage:function(t){var e=this;return console.log("preloadZmdfImage",t),new Promise((function(i,n){var a=new Image;a.onload=function(){console.log("loadingImage",a.naturalWidth),e.thumbnailLoaded=!0,e.thumbnailNaturalSize={width:a.naturalWidth,height:a.naturalHeight},i(!0)},a.onerror=function(t){console.error("image preload error",t),n(t)},a.src=encodeURI(t)}))},onZmdfImageLoaded:function(t){var e=t.msgId,i=t.attachId;this.attachmentItem.msgId===e&&this.attachmentItem.aid===i&&this.preloadZmdfImage(this.attachmentItem.thumbnailZmdfPath)},visibleChange:function(t){var e=this;this.isCheckMore=t,this.$nextTick((function(){var t;null===(t=e.$refs.attachmentItem)||void 0===t||t.focus()}))},downloadAttachment:function(){C.handleDownload(this.attachmentItem,this.mailHead)},handleDownload:function(){this.isExecutableFile()?this.showExecutableDownloadAlert=!0:this.downloadAttachment()},handleCancel:function(){C.handleCancelDownload(this.attachmentItem,this.mailHead)},handleMore:function(t){switch(t){case"openFile":this.handleOpen();break;case"showInFolder":this.showInFolder();break;default:break}},handleOpen:function(){"Finish"===this.downloadStatus?this.$emit("handleOpenOrPreview",{attachment:this.attachmentItem,fileType:"",canPreview:!1}):"None"!==this.downloadStatus&&"Error"!==this.downloadStatus||this.handleDownload()},showInFolder:function(){C.openFileInFolder(this.attachmentItem.filePath)},handleDownloadExecutable:function(){this.showExecutableDownloadAlert=!1,this.downloadAttachment()},cancelDownloadExecutable:function(){this.showExecutableDownloadAlert=!1},handleDownloadOrPreview:function(){"Downloading"!==this.downloadStatus&&(this.canPreview?this.handlePreview():this.handleOpen())},handlePreview:function(){this.$emit("handleOpenOrPreview",{attachment:this.attachmentItem,fileType:this.fileType,canPreview:this.canPreview})},handleDelete:function(t){this.$emit("handleDelete",t)},isVideoMediaFile:function(){return(0,l.U8)(this.fileExtension)},isExecutableFile:function(){return(0,l.Xj)(this.fileExtension)},getIcon:function(t,e){return(0,l.LP)(t,e)},formatSize:function(t){return(0,l.sS)(t)}}},I=k,S=i(93483),P=(0,S.Z)(I,c,d,!1,null,"1b211668",null),A=P.exports,_=function(){var t=this,e=t._self._c;return t.visible?e("zm-dialog",{staticClass:"document-preview-dialog",attrs:{visible:t.visible,title:t.$t("operation.preview"),"append-to-body":"",fullscreen:"","show-close":""},on:{close:t.closeDocumentPreview}},[e("div",{staticClass:"document-preview-wrap"},[e("div",{staticClass:"header"},[e("avatar",{ref:"avatarRef",staticClass:"avatar",attrs:{email:t.mailHead.from.emailAddr,name:t.mailHead.from.displayName,tabindex:"-1"}}),e("div",{staticClass:"divide"}),e("div",{staticClass:"info"},[e("img",{attrs:{src:t.getIcon(),alt:""}}),e("div",{staticClass:"description"},[e("div",{staticClass:"file-name"},[t._v(" "+t._s(t.currentAttachment.fileName)+" ")]),e("div",{staticClass:"user-info"},[t._v(t._s(t.mailHead.from.displayName)+", "+t._s(t.formatTime))])])]),t.imageVisble?e("div",{staticClass:"tool-wrap"},[e("zm-button",{attrs:{type:"text pd-5",size:"small","aria-label":t.$t("operation.rotateImage")},on:{click:t.rotateImg}},[e("svg-icon",{attrs:{iconClass:"rotato-image-"+t.prefersColorScheme}})],1)],1):t._e()],1),e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"content",attrs:{"element-loading-spinner":"zm-icon-loading"}},[t.loadingError?e("empty-page",{on:{refresh:t.refresh}}):t._e(),t.pdfVisble?e("preview-pdf",{attrs:{source:t.source},on:{closeLoading:t.closeLoading}}):t._e(),t.imageVisble?e("preview-image",{ref:"previewImg",attrs:{source:t.source,currentIndex:t.currentImgIndex,allImgLength:t.allImgAttachmentList.length},on:{closeLoading:t.closeLoading,previewPrevious:t.previewPrevious,previewNext:t.previewNext}}):t._e()],1)])]):t._e()},T=[],D=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pdf-preview-wrap"},[e("div",{staticClass:"pdf-preview-content",attrs:{id:"pdfPreviewContent"}},[e("VuePdfEmbed",{ref:"pdf",attrs:{source:t.pdfSource},on:{rendered:t.handleDocumentRender,"rendering-failed":t.renderedFailed}})],1)])},E=[],O=(i(6886),(0,m.wE)((function(){return i.e(500).then(i.t.bind(i,92500,23))}))),Z={components:{VuePdfEmbed:O},props:{source:{type:String,default:""}},data:function(){return{timer:null,canvasWidth:0,canvasHeiht:0}},computed:{pdfSource:function(){return{url:this.source?"data:application/pdf;base64,".concat(this.source):""}}},mounted:function(){var t=this;window.onresize=function(){t.renderCanvas()}},destroyed:function(){window.onresize=null,this.timer&&clearTimeout(this.timer)},methods:{renderCanvas:function(){var t=this;this.timer=setTimeout((function(){var e=document.getElementById("pdfPreviewContent"),i=null===e||void 0===e?void 0:e.querySelectorAll("canvas");i.forEach((function(i){i.style.cssText="width:"+e.clientWidth+"px; height:"+t.canvasHeiht*(e.clientWidth/t.canvasWidth)+"px;"}))}),100)},initCanvasScale:function(){var t=document.getElementById("pdfPreviewContent"),e=null===t||void 0===t?void 0:t.querySelector("canvas");this.canvasWidth=e.clientWidth,this.canvasHeiht=e.clientHeight},closeLoading:function(t){this.$emit("closeLoading",t)},handleDocumentRender:function(){this.closeLoading(!1),this.initCanvasScale()},renderedFailed:function(t){this.closeLoading(!0)}}},z=Z,N=(0,S.Z)(z,D,E,!1,null,"f452afd2",null),$=N.exports,L=function(){var t=this,e=t._self._c;return e("div",{staticClass:"image-preview-wrap"},[e("div",{staticClass:"previous-image"},[t.currentIndex>0?e("zm-button",{attrs:{"aria-label":t.$t("operation.previousAttachment"),ghost:"","aria-expanded":void 0},on:{click:t.previewPrevious}},[e("svg-icon",{attrs:{iconClass:"chevron-left"}})],1):t._e()],1),t._m(0),e("div",{staticClass:"next-image"},[t.currentIndex+1<t.allImgLength?e("zm-button",{attrs:{ghost:"","aria-label":t.$t("operation.nextAttachment"),"aria-expanded":void 0},on:{click:t.previewNext}},[e("svg-icon",{attrs:{iconClass:"chevron-right"}})],1):t._e()],1),e("div",{staticClass:"toolbar-wrap"},[e("div",{staticClass:"scale-minus",on:{click:function(e){return t.zoomTo("minus")}}},[e("svg-icon",{attrs:{iconClass:"minus"}})],1),e("div",{staticClass:"scale-progress"},[e("zm-slider",{attrs:{label:t.$t("accessibility.zoom"),step:10,min:0,max:200},on:{change:t.ratioChange},model:{value:t.ratio,callback:function(e){t.ratio=e},expression:"ratio"}})],1),e("div",{staticClass:"scale-plus",on:{click:function(e){return t.zoomTo("plus")}}},[e("svg-icon",{attrs:{iconClass:"plus"}})],1)])])},F=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"image-preview-content"},[e("div",{staticClass:"img-wrap"},[e("img",{attrs:{id:"preImageWrap",src:"",alt:""}})])])}],M=i(12824),R=i.n(M),B={props:{source:{type:String,default:""},currentIndex:{type:Number,default:0},allImgLength:{type:Number,default:0}},data:function(){return{viewer:null,ratio:0}},computed:(0,o.Z)((0,o.Z)({},(0,s.rn)(["prefersColorScheme"])),{},{imgSource:function(){return"data:image/gif;base64,".concat(this.source)},currentRatio:function(){var t,e;return null!==(t=this.viewer)&&void 0!==t&&null!==(e=t.imageData)&&void 0!==e&&e.ratio?100*this.viewer.imageData.ratio:0}}),watch:{source:{handler:function(t){t&&(this.viewer&&this.viewer.destroy(),this.loadImage())}},currentRatio:{handler:function(t){this.ratio=Math.floor(t)}}},destroyed:function(){var t;null===(t=this.viewer)||void 0===t||t.destroy(),this.viewer=null},methods:{loadViewer:function(){this.viewer=new(R())(document.getElementById("preImageWrap"),{inline:!0,button:!1,navbar:!1,toolbar:!1,zoomRatio:.3,maxZoomRatio:2,minZoomRatio:0,title:!1})},loadImage:function(){var t=this,e=document.getElementById("preImageWrap");e.src=this.imgSource,e.onload=function(){t.closeLoading(!1),t.loadViewer()},e.onerror=function(e){console.log("img err"),t.source&&t.closeLoading(!0)}},closeLoading:function(t){this.$emit("closeLoading",t)},previewPrevious:function(){this.$emit("previewPrevious")},previewNext:function(){this.$emit("previewNext")},rotateImg:function(){this.viewer.rotate(90)},ratioChange:function(t){this.viewer.zoomTo(t/100)},zoomTo:function(t){"plus"===t?this.ratio+=10:this.ratio-=10,this.viewer.zoomTo(this.ratio/100)}}},G=B,j=(0,S.Z)(G,L,F,!1,null,"a1420b44",null),U=j.exports,W=function(){var t=this,e=t._self._c;return e("div",{staticClass:"document-preview-empty-wrap"},[t._m(0),e("div",[e("p",{staticClass:"text primary-text"},[t._v(t._s(t.$t("operation.previewEmptyPrimary")))]),e("p",{staticClass:"text secondary-text"},[t._v(t._s(t.$t("operation.previewEmptySecondary")))])]),e("div",[e("zm-button",{on:{click:t.refresh}},[t._v(t._s(t.$t("operation.refresh")))])],1)])},H=[function(){var t=this,e=t._self._c;return e("div",[e("img",{staticClass:"empty-image",attrs:{src:i(44791)}})])}],q={methods:{refresh:function(){this.$emit("refresh")}}},V=q,Y=(0,S.Z)(V,W,H,!1,null,"2a20e742",null),X=Y.exports,J=i(90479),K=i(63012),Q={components:{previewPdf:$,previewImage:U,emptyPage:X,Avatar:J.Z},props:{mailHead:{type:Object,default:function(){}},formatTime:{type:String,default:""},visible:{type:Boolean,default:!1},attachments:{type:Array,default:function(){return[]}},attachmentItem:{type:Object,default:function(){}},fileType:{type:String,default:""}},data:function(){return{loading:!1,loadingError:!0,source:"",currentImgIndex:0}},computed:(0,o.Z)((0,o.Z)({},(0,s.rn)(["prefersColorScheme"])),{},{pdfVisble:function(){return!this.loadingError&&"pdf"===this.fileType},imageVisble:function(){return!this.loadingError&&"image"===this.fileType},allImgAttachmentList:function(){return this.attachments.filter((function(t){return"image"===(0,l.JB)(t.fileName)}))},currentAttachment:function(){return"image"===this.fileType?this.allImgAttachmentList[this.currentImgIndex]:this.attachmentItem}}),watch:{visible:function(t){t?this.initData():(this.source="",this.loadingError=!1,this.currentImgIndex=0,w.G.$off(r.Enums.Notification.OnAttachmentPreviewData))}},destroyed:function(){w.G.$off(r.Enums.Notification.OnAttachmentPreviewData)},methods:{initData:function(){var t=this;"image"===this.fileType&&(this.currentImgIndex=this.allImgAttachmentList.findIndex((function(e){return e.aid===t.attachmentItem.aid}))),this.getAttachmentsByBase64(),this.onAttachmentPreviewData()},getAttachmentsByBase64:function(){var t=this;this.loading=!0,this.loadingError=!1,K.Attachment.downloadMailAttachmentForPreview({msgId:this.currentAttachment.msgId,aid:this.currentAttachment.aid}).then((function(e){1===e.errorCode&&(t.closeLoading(),t.loadingError=!0,console.debug("preview documents failed"))}))},onAttachmentPreviewData:function(){var t=this,e="";w.G.$on(r.Enums.Notification.OnAttachmentPreviewData,(function(i){var n=i.result.AttachmentPreviewData,a=n.attachId,o=n.attachData,s=n.currentIndex,r=n.totalIndex;a===t.currentAttachment.aid&&(e+=o,s===r-1&&(t.source=e,e=""))}))},getIcon:function(){return(0,l.LP)(this.currentAttachment.fileName,this.prefersColorScheme)},closeDocumentPreview:function(){this.$emit("closeDocumentPreview",this.currentAttachment)},closeLoading:function(t){this.loading=!1,this.loadingError=t},refresh:function(){var t=this;this.loadingError=!1,this.source="",this.$nextTick((function(){t.getAttachmentsByBase64()}))},previewPrevious:function(){this.currentImgIndex--,this.refresh()},previewNext:function(){this.currentImgIndex++,this.refresh()},rotateImg:function(){this.loading||this.$refs.previewImg.rotateImg()}}},tt=Q,et=(0,S.Z)(tt,_,T,!1,null,"1453d52b",null),it=et.exports,nt={name:"AttachmentsList",components:{AttachmentItem:A,documentPreview:it},props:{attachments:{type:Array,default:[]},showDownload:{type:Boolean,default:!1},mailHead:{type:Object,default:function(){}},formatTime:{type:String,default:""},showDelete:{type:Boolean,default:!1},fromPopOut:{type:Boolean,default:!1}},data:function(){return{documentPreviewVisible:!1,currentAttachment:{},fileType:""}},computed:(0,o.Z)((0,o.Z)({},(0,s.rn)(["selectMailLabel"])),{},{showDownloadAllAttachmentBtn:function(){var t=this.selectMailLabel.id===r.Enums.SystemDefinedMailLabelIds.OUTBOX;return!this.fromPopOut&&this.showDownload&&!t&&this.attachments.length>1},allAttachmentsSize:function(){return(0,l.sS)(this.attachments.reduce((function(t,e){var i=e.size;return t+i}),0))}}),methods:{downloadAllAttachments:function(){C.handleDownloadAll(this.mailHead,this.attachments)},handleDelete:function(t){this.$emit("deleteItem",t)},handleOpenOrPreview:function(t){var e=t.attachment,i=t.fileType,n=t.canPreview;n?(this.documentPreviewVisible=!0,this.fileType=i,this.currentAttachment=e):C.handleOpen(e)},closeDocumentPreview:function(t){this.documentPreviewVisible=!1,"Finish"!==t.downloadStatus&&C.handleCancelDownload(t,this.mailHead)},focusOnFirst:function(){this.focusOn(0)},focusOnPrev:function(t){var e=t-1;e<0&&(e=this.attachments.length-1),this.focusOn(e)},focusOnNext:function(t){var e=t+1;e>=this.attachments.length&&(e=0),this.focusOn(e)},focusOn:function(t){var e=this.$refs["".concat(t)][0].$el;e.scrollIntoView(),this.$nextTick((function(){e.focus()}))}}},at=nt,ot=(0,S.Z)(at,n,a,!1,null,"f0912824",null),st=ot.exports},75739:function(t,e,i){"use strict";i.d(e,{FH:function(){return p},LP:function(){return v},Ve:function(){return f},Vy:function(){return b},ZB:function(){return g},b9:function(){return C},si:function(){return k}});var n=i(70021),a=i(56706),o=(i(6886),i(21515),i(6710),i(71372),i(70487)),s=i(12546),r=i(44509),l=i(87693),c=i(63012),d=i(23309),u=6e4,h="download_all",m={};function f(t){var e=t.msgId,i=t.downloadDir,n=t.aid,a=t.size,o=(0,l.Fy)(),s=o.reject,r=o.promise,c=Math.ceil(a/1024/1024)*u,d=setTimeout((function(){return s(new Error("download time out"))}),c);m["".concat(e,"_").concat(n)]={reject:s,id:d,timeout:c};var h=Promise.race([window.zoomSdk.postJsMessage({functionName:"mailui_downloadmailattachments",params:{msgId:e,downloadDir:i,aids:[n]},noDelete:!0}),r]);return h["finally"]((function(){delete m["".concat(e,"_").concat(n)]}))}function p(t){var e=t.msgId,i=t.downloadPath,n=t.attachmentList,a=(0,l.Fy)(),o=a.reject,s=a.promise,r=n.reduce((function(t,e){return t+(e.size||0)}),0),d=Math.ceil(r/1024/1024)*u,f=setTimeout((function(){return o(new Error("download time out"))}),d);m["".concat(e,"_").concat(h)]={reject:o,id:f,timeout:d};var p=Promise.race([c.Attachment.downloadMailAllAttachments({msgId:e,downloadPath:i,aids:n.map((function(t){return t.aid}))}),s]);return p["finally"]((function(){delete m["".concat(e,"_").concat(h)]}))}function v(t){var e=t.msgId,i=t.aid,n=m["".concat(e,"_").concat(i)];return clearTimeout(null===n||void 0===n?void 0:n.id),window.zoomSdk.postJsMessage({functionName:"mailui_canceldownloadmailattachments",params:{msgId:e,aids:[i]}})}function g(t){return w.apply(this,arguments)}function w(){return w=(0,a.Z)((0,n.Z)().mark((function t(e){var i,a;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c.Attachment.openFile({path:e});case 2:i=t.sent,a=i.errorCode,a&&(o["default"].prototype.$msg(s.ZP.t("detail.openFileFail")),window.zoomLog.error("mailui_openfile failed "));case 5:case"end":return t.stop()}}),t)}))),w.apply(this,arguments)}function b(t){return y.apply(this,arguments)}function y(){return y=(0,a.Z)((0,n.Z)().mark((function t(e){var i;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i={},t.prev=1,t.next=4,c.Attachment.isFileExist({path:e});case 4:i=t.sent,window.zoomLog.info("mailui_isfileexist success "+JSON.stringify(i)),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](1),window.zoomLog.error("mailui_isfileexist failed "+t.t0.message);case 11:return t.abrupt("return",i);case 12:case"end":return t.stop()}}),t,null,[[1,8]])}))),y.apply(this,arguments)}function C(t){return x.apply(this,arguments)}function x(){return x=(0,a.Z)((0,n.Z)().mark((function t(e){var i;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c.Attachment.getSelectedFolderPaths({fileName:e});case 2:return i=t.sent,t.abrupt("return",i);case 4:case"end":return t.stop()}}),t)}))),x.apply(this,arguments)}function k(t){return I.apply(this,arguments)}function I(){return I=(0,a.Z)((0,n.Z)().mark((function t(e){var i;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,c.Attachment.openFileInFolder({path:e});case 2:i=t.sent,0!==i.returnCode&&console.log("open file in folder failed.",e);case 4:case"end":return t.stop()}}),t)}))),I.apply(this,arguments)}r.G.$on("ZMailUINotif_OnAttachmentDownloadProgress",(function(t){var e=d.Z.state.selectMail.msgId,i=t.result.DownloadAttachmentProgress.BriefInfo.attachmentId,n=m["".concat(e,"_").concat(i)]||m["".concat(e,"_").concat(h)];if(n){var a=n.id,o=n.reject,s=n.timeout;clearTimeout(a),n.id=setTimeout((function(){return o(new Error("download time out"))}),s)}}))},96713:function(t,e,i){"use strict";i.d(e,{Y:function(){return T}});var n=i(70021),a=i(34948),o=i(56706),s=(i(77950),i(71372),i(10100)),r={gmail:s.EMAIL_PROVIDER.GMAIL,zmail:s.EMAIL_PROVIDER.ZMAIL,office365:s.EMAIL_PROVIDER.OFFICE365},l=i(6041),c=i(14567),d=i(16812),u=i(89519),h=i(32784),m=i(76208),f=i(56534),p=(i(6886),i(95740)),v=i(26274),g=new WeakMap,w=function(){function t(e){(0,c.Z)(this,t),(0,f.Z)(this,g,{writable:!0,value:void 0}),(0,v.Z)(this,"mailSendInfo",void 0),(0,v.Z)(this,"undoDuration",void 0),(0,v.Z)(this,"onSendSuccessfully",void 0),(0,v.Z)(this,"onSendFailed",void 0),(0,v.Z)(this,"onSendError",void 0),(0,v.Z)(this,"onCancel",void 0),(0,v.Z)(this,"noDelete",!1),(0,v.Z)(this,"noticeInstanceId",null),Object.assign(this,e)}return(0,d.Z)(t,[{key:"exec",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:throw new Error("do not call exec from base MailSender");case 1:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}()},{key:"notice",value:function(t){return this.el.$undoNotice(t)}},{key:"clearNotice",value:function(){this.el.$clearUndoNotice()}},{key:"dismissNotice",value:function(){this.el.$clearUndoNotice(this.noticeInstanceId)}},{key:"updateNotice",value:function(t){var e=t.iconClass,i=t.title,n=t.action,a=void 0===n?"":n,o=t.actionCallback,s=t.duration,r=void 0===s?3e3:s;console.log("updateNotice: ",this.noticeInstanceId),0!==r?this.notice({id:this.noticeInstanceId,title:i,duration:r,iconClass:e,action:a,actionCallback:o}):this.notice({id:this.noticeInstanceId,title:i,iconClass:e,action:a,actionCallback:o})}}]),t}(),b=i(53806),y=i(12546),C=i(23309),x=i(44509),k=b.Enums.MailErrorCode,I=new WeakMap,S=function(t){(0,h.Z)(i,t);var e=(0,m.Z)(i);function i(){var t;(0,c.Z)(this,i);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return t=e.call.apply(e,[this].concat(a)),(0,f.Z)((0,u.Z)(t),I,{writable:!0,value:void 0}),t}return(0,d.Z)(i,[{key:"exec",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e=this;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){e.doSendMail()}),1e3*this.undoDuration),this.registerCancelSendHandler(),this.noticeInstanceId=this.notice({iconClass:"loading",title:y.ZP.t("notification.sending"),duration:0,hideAfterAction:!1,rowStyle:!0,action:y.ZP.t("operation.undo"),actionCallback:function(){var t;clearTimeout(e.timer),null===(t=e.onCancel)||void 0===t||t.call(e),e.dismissNotice()}});case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"doSendMail",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e,i,a,o,s,r,c,d,u,h,m,f,v,g;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,this.updateNotice({iconClass:"loading",title:y.ZP.t("notification.sending"),duration:0}),i=null===(e=this.mailSendInfo.fromUserMail)||void 0===e?void 0:e.emailAddr,!i){t.next=13;break}return t.next=6,C.Z.dispatch("fetchSendAsList");case 6:if(a=C.Z.state.sendAsList,!a.length){t.next=13;break}if(o=a.some((function(t){var e=t.sendAsEmail;return e===i})),o){t.next=13;break}return this.updateNotice({iconClass:"crossmark",title:y.ZP.t("notification.couldntSendFromSelectedAddress")}),null===(s=this.onCancel)||void 0===s||s.call(this),t.abrupt("return");case 13:return console.log("------------------------mailui_senddraft begin------------------------"),console.log("calling mailui_senddraft with params: ",this.mailSendInfo),t.next=17,p.l.sendDraftMail(this.mailSendInfo,this.noDelete);case 17:if(r=t.sent,console.log("------------------------mailui_senddraft end------------------------"),console.log("mailui_senddraft return: ",r),c=0===r.errorCode&&C.Z.state.isOffline,0!==r.errorCode){t.next=26;break}return c?(this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.msgSavedInOutbox")}),C.Z.commit("pushMsgIdsSentInOffline",this.mailSendInfo.msgId),null===(d=this.onSendSuccessfully)||void 0===d||d.call(this,r)):(this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.msgSent")}),null===(u=this.onSendSuccessfully)||void 0===u||u.call(this,r)),t.abrupt("return");case 26:null===(h=this.onSendFailed)||void 0===h||h.call(this,r);case 27:m=r.errorCode,f="",f=m===k.Check_Attachment_Download_Failed?y.ZP.t("common.fwdFailByAttachmentErr"):m===k.Check_Draft_Size_Failed?y.ZP.t("editor.totalSizeLimit",["".concat(b.Utils.convertByte2MB(C.Z.state.userProfile.totalSizeLimit),"MB")]):m===k.Attachment_Size_Limit?y.ZP.t("editor.attachmentsSizeLimit",["".concat(b.Utils.convertByte2MB(C.Z.state.userProfile.singleAttachmentMaxSize),"MB")]):m===k.Attachment_Count_Limit?y.ZP.t("editor.attachmentsCountLimit",[C.Z.state.userProfile.singleAttachmentMaxCount]):y.ZP.t("common.failedToSendMessage"),this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(f,null===r||void 0===r?void 0:r.error)}),t.next=37;break;case 33:t.prev=33,t.t0=t["catch"](0),this.updateNotice({iconClass:"crossmark",title:y.ZP.t("notification.failedToSendMsg")}),null===(v=this.onSendError)||void 0===v||v.call(this,t.t0);case 37:return t.prev=37,x.G.$off("mailSignOut"),g=[].concat((0,l.Z)(this.mailSendInfo.toUserEmail),(0,l.Z)(this.mailSendInfo.ccUserEmail),(0,l.Z)(this.mailSendInfo.bccUserEmail)),C.Z.commit("mail/updateRecipientsLFUCache",g),t.finish(37);case 42:case"end":return t.stop()}}),t,this,[[0,33,37,42]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"registerCancelSendHandler",value:function(){var t=this;x.G.$once("mailSignOut",(function(){var e;console.warn("send mail canceled!"),clearTimeout(t.timer),null===(e=t.onCancel)||void 0===e||e.call(t),t.dismissNotice()}))}}]),i}(w),P=i(63012),A=3e3,_=function(t){(0,h.Z)(i,t);var e=(0,m.Z)(i);function i(){var t;(0,c.Z)(this,i);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return t=e.call.apply(e,[this].concat(a)),(0,v.Z)((0,u.Z)(t),"timer",void 0),t}return(0,d.Z)(i,[{key:"exec",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e=this;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.timer&&clearTimeout(this.timer),P.Draft.updateDraft({mailSendInfo:(0,a.Z)((0,a.Z)({},this.mailSendInfo),{},{lastUpdateForSend:!0,sendUndoSeconds:this.undoDuration||3})}),this.timer=setTimeout((function(){e.doSendMail()}),1e3*this.undoDuration||3e3),this.registerCancelSendHandler(),this.noticeInstanceId=this.notice({iconClass:"loading",title:y.ZP.t("operation.sending"),duration:0,hideAfterAction:!1,rowStyle:!0,action:y.ZP.t("operation.undo"),actionCallback:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var i;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:clearTimeout(e.timer),null===(i=e.onCancel)||void 0===i||i.call(e),e.dismissNotice();case 3:case"end":return t.stop()}}),t)})));function i(){return t.apply(this,arguments)}return i}()});case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"doSendMail",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e,i,a,o,s,r,c,d,u,h;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.updateNotice({iconClass:"loading",title:y.ZP.t("notification.sending"),duration:0}),t.next=4,p.l.sendDraftMail(this.mailSendInfo);case 4:if(i=t.sent,a=0===i.errorCode&&this.mailSendInfo.scheduledSendTime,o=0===i.errorCode&&C.Z.state.isOffline,s=0===i.errorCode&&!this.mailSendInfo.scheduledSendTime&&!o,!a){t.next=14;break}return this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.msgScheduleToSend")}),null===(r=this.onSendSuccessfully)||void 0===r||r.call(this,i),t.abrupt("return");case 14:if(!s){t.next=20;break}return null===(c=this.onSendSuccessfully)||void 0===c||c.call(this),this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.msgSent"),duration:A}),t.abrupt("return");case 20:if(!o){t.next=25;break}return this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.msgSavedInOutbox")}),C.Z.commit("pushMsgIdsSentInOffline",this.mailSendInfo.msgId),null===(d=this.onSendSuccessfully)||void 0===d||d.call(this,i),t.abrupt("return");case 25:this.handleZmailSendError(i),null===(e=this.onSendFailed)||void 0===e||e.call(this,i),t.next=33;break;case 29:t.prev=29,t.t0=t["catch"](0),this.updateNotice({iconClass:"crossmark",title:y.ZP.t("notification.failedToSendMsg")}),null===(u=this.onSendError)||void 0===u||u.call(this,t.t0);case 33:return t.prev=33,x.G.$off("mailSignOut"),h=[].concat((0,l.Z)(this.mailSendInfo.toUserEmail),(0,l.Z)(this.mailSendInfo.ccUserEmail),(0,l.Z)(this.mailSendInfo.bccUserEmail)),C.Z.commit("mail/updateRecipientsLFUCache",h),t.finish(33);case 38:case"end":return t.stop()}}),t,this,[[0,29,33,38]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"cancel",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e,i,a;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.notice({iconClass:"loading",title:y.ZP.t("notification.cancelling")}),t.next=4,p.l.cancelSendingMail(this.mailSendInfo.msgId);case 4:if(e=t.sent,i=e.returnCode,0!==i){t.next=9;break}return this.notice({iconClass:"checkmark",title:y.ZP.t("notification.sendingCancelled")}),t.abrupt("return");case 9:this.notice({iconClass:"crossmark",title:y.ZP.t("notification.failedToCancel")}),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](0),this.notice({iconClass:"crossmark",title:y.ZP.t("notification.failedToCancel")});case 15:return t.prev=15,null===(a=this.onCancel)||void 0===a||a.call(this),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[0,12,15,18]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"undo",value:function(){var t=(0,o.Z)((0,n.Z)().mark((function t(){var e,i,a;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.updateNotice({iconClass:"loading",title:y.ZP.t("notification.undoing")}),t.next=4,p.l.cancelSendingMail(this.mailSendInfo.msgId);case 4:if(e=t.sent,i=e.returnCode,0!==i){t.next=9;break}return this.updateNotice({iconClass:"checkmark",title:y.ZP.t("notification.sendingUndone")}),t.abrupt("return");case 9:this.updateNotice({iconClass:"crossmark",title:y.ZP.t("notification.failedToUndo")}),t.next=15;break;case 12:t.prev=12,t.t0=t["catch"](0),this.updateNotice({iconClass:"crossmark",title:y.ZP.t("notification.failedToUndo")});case 15:return t.prev=15,null===(a=this.onCancel)||void 0===a||a.call(this),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[0,12,15,18]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"handleZmailSendError",value:function(t){var e;console.log("handleZmailSendError",t);var i=null===t||void 0===t||null===(e=t.error)||void 0===e?void 0:e.returnCode;switch(console.log("handleZmailSendError returnCode",i),i){case s.MailErrorCode.Attachment_Not_Exist:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode("Forwarding failed due to attachment error",null===t||void 0===t?void 0:t.error)});break;case s.MailErrorCode.Check_FingerPrint_Failed:this.dismissNotice();break;case s.MailErrorCode.Check_Draft_Size_Failed:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("editor.totalSizeLimit",["".concat(b.Utils.convertByte2MB(C.Z.state.userProfile.totalSizeLimit),"MB")]),null===t||void 0===t?void 0:t.error)});break;case s.MailErrorCode.Attachment_Size_Limit:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("editor.attachmentsSizeLimit",["".concat(b.Utils.convertByte2MB(C.Z.state.userProfile.singleAttachmentMaxSize),"MB")]),null===t||void 0===t?void 0:t.error)});break;case s.MailErrorCode.Attachment_Count_Limit:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("editor.attachmentsCountLimit",[C.Z.state.userProfile.singleAttachmentMaxCount]),null===t||void 0===t?void 0:t.error)});break;case s.MailErrorCode.Emails_Sent_Limit:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("common.emailSentExceedLimit"),null===t||void 0===t?void 0:t.error)});break;case s.MailErrorCode.Recipients_Limit:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("common.recipientExceedLimit"),null===t||void 0===t?void 0:t.error)});break;default:this.updateNotice({iconClass:"crossmark",title:b.Utils.getErrMsgWithCode(y.ZP.t("notification.failedToSendMsg"),null===t||void 0===t?void 0:t.error)})}}},{key:"registerCancelSendHandler",value:function(){var t=this;x.G.$once("mailSignOut",(function(){var e;console.warn("send mail canceled!"),clearTimeout(t.timer),null===(e=t.onCancel)||void 0===e||e.call(t),t.dismissNotice()}))}}]),i}(w);function T(t){return D.apply(this,arguments)}function D(){return D=(0,o.Z)((0,n.Z)().mark((function t(e){var i,o,s=arguments;return(0,n.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=s.length>1&&void 0!==s[1]?s[1]:r.gmail,o=null,t.t0=i,t.next=t.t0===r.gmail?5:t.t0===r.zmail?7:t.t0===r.office365?9:11;break;case 5:return o=new S(e),t.abrupt("break",12);case 7:return o=new _(e),t.abrupt("break",12);case 9:return o=new S((0,a.Z)((0,a.Z)({},e),{},{noDelete:!0})),t.abrupt("break",12);case 11:throw new Error("not found sender for mail type ".concat(i));case 12:return t.next=14,o.exec();case 14:case"end":return t.stop()}}),t)}))),D.apply(this,arguments)}},1679:function(t,e,i){"use strict";var n=i(34948),a=(i(6886),i(29648)),o=i(53806);e["Z"]={data:function(){return{isInForwardProcess:!1,toContactInfo:new Map}},computed:(0,n.Z)((0,n.Z)({},(0,a.rn)({recipientInfo:function(t){return t.recipientInfo}})),{},{to2Contacts:function(){var t=this;return this.to.map((function(e){var i=t.recipientInfo.get(e);if(i)return i;var n=t.toContactInfo.get(e);if(n)return n;var a=o.Utils.getContactName(e);return t.toContactInfo.set(e,{id:e,displayName:a}),t.toContactInfo.get(e)}))}}),methods:{handleAddContact:function(t){this.isInForwardProcess||-1===this.cc.indexOf(t.value)&&-1===this.bcc.indexOf(t.value)&&-1===this.to.indexOf(t.value)&&this.to.push(t.value)},handleRemoveContact:function(t){if(!this.isInForwardProcess&&-1===this.cc.indexOf(t.value)&&-1===this.bcc.indexOf(t.value)){var e=this.to.indexOf(t.value);-1!==e&&this.to.splice(e,1)}}}}},53744:function(t,e){"use strict";e["Z"]={composeChangedFrequency:5e3}},12824:function(t,e,i){var n,a,o=i(76716)["default"];i(4173),i(634),i(6886),i(77950),i(85940),i(45794),i(43430),i(4173),i(634),i(6886),i(71372),i(77950),i(85940),i(45794),i(43430),
- /*!
- * Viewer.js v1.11.6
- * https://fengyuanchen.github.io/viewerjs
- *
- * Copyright 2015-present Chen Fengyuan
- * Released under the MIT license
- *
- * Date: 2023-09-17T03:16:38.052Z
- */
- function(s,r){"object"===o(e)?t.exports=r():(n=r,a="function"===typeof n?n.call(e,i,e,t):n,void 0===a||(t.exports=a))}(0,(function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function s(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e,i){return e=c(e),e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if("object"!==o(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function c(t){var e=l(t,"string");return"symbol"===o(e)?e:String(e)}var d={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},u='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',h="undefined"!==typeof window&&"undefined"!==typeof window.document,m=h?window:{},f=!(!h||!m.document.documentElement)&&"ontouchstart"in m.document.documentElement,p=!!h&&"PointerEvent"in m,v="viewer",g="move",w="switch",b="zoom",y="".concat(v,"-active"),C="".concat(v,"-close"),x="".concat(v,"-fade"),k="".concat(v,"-fixed"),I="".concat(v,"-fullscreen"),S="".concat(v,"-fullscreen-exit"),P="".concat(v,"-hide"),A="".concat(v,"-hide-md-down"),_="".concat(v,"-hide-sm-down"),T="".concat(v,"-hide-xs-down"),D="".concat(v,"-in"),E="".concat(v,"-invisible"),O="".concat(v,"-loading"),Z="".concat(v,"-move"),z="".concat(v,"-open"),N="".concat(v,"-show"),$="".concat(v,"-transition"),L="click",F="dblclick",M="dragstart",R="focusin",B="keydown",G="load",j="error",U=f?"touchend touchcancel":"mouseup",W=f?"touchmove":"mousemove",H=f?"touchstart":"mousedown",q=p?"pointerdown":H,V=p?"pointermove":W,Y=p?"pointerup pointercancel":U,X="resize",J="transitionend",K="wheel",Q="ready",tt="show",et="shown",it="hide",nt="hidden",at="view",ot="viewed",st="move",rt="moved",lt="rotate",ct="rotated",dt="scale",ut="scaled",ht="zoom",mt="zoomed",ft="play",pt="stop",vt="".concat(v,"Action"),gt=/\s\s*/,wt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function bt(t){return"string"===typeof t}var yt=Number.isNaN||m.isNaN;function Ct(t){return"number"===typeof t&&!yt(t)}function xt(t){return"undefined"===typeof t}function kt(t){return"object"===i(t)&&null!==t}var It=Object.prototype.hasOwnProperty;function St(t){if(!kt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&It.call(i,"isPrototypeOf")}catch(n){return!1}}function Pt(t){return"function"===typeof t}function At(t,e){if(t&&Pt(e))if(Array.isArray(t)||Ct(t.length)){var i,n=t.length;for(i=0;i<n;i+=1)if(!1===e.call(t,t[i],i,t))break}else kt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}));return t}var _t=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return kt(t)&&i.length>0&&i.forEach((function(e){kt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},Tt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Dt(t,e){var i=t.style;At(e,(function(t,e){Tt.test(e)&&Ct(t)&&(t+="px"),i[e]=t}))}function Et(t){return bt(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):t}function Ot(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)}function Zt(t,e){if(t&&e)if(Ct(t.length))At(t,(function(t){Zt(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function zt(t,e){t&&e&&(Ct(t.length)?At(t,(function(t){zt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Nt(t,e,i){e&&(Ct(t.length)?At(t,(function(t){Nt(t,e,i)})):i?Zt(t,e):zt(t,e))}var $t=/([a-z\d])([A-Z])/g;function Lt(t){return t.replace($t,"$1-$2").toLowerCase()}function Ft(t,e){return kt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Lt(e)))}function Mt(t,e,i){kt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Lt(e)),i)}var Rt=function(){var t=!1;if(h){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});m.addEventListener("test",i,n),m.removeEventListener("test",i,n)}return t}();function Bt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i;e.trim().split(gt).forEach((function(e){if(!Rt){var o=t.listeners;o&&o[e]&&o[e][i]&&(a=o[e][i],delete o[e][i],0===Object.keys(o[e]).length&&delete o[e],0===Object.keys(o).length&&delete t.listeners)}t.removeEventListener(e,a,n)}))}function Gt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i;e.trim().split(gt).forEach((function(e){if(n.once&&!Rt){var o=t.listeners,s=void 0===o?{}:o;a=function(){delete s[e][i],t.removeEventListener(e,a,n);for(var o=arguments.length,r=new Array(o),l=0;l<o;l++)r[l]=arguments[l];i.apply(t,r)},s[e]||(s[e]={}),s[e][i]&&t.removeEventListener(e,s[e][i],n),s[e][i]=a,t.listeners=s}t.addEventListener(e,a,n)}))}function jt(t,i,n,a){var o;return Pt(Event)&&Pt(CustomEvent)?o=new CustomEvent(i,e({bubbles:!0,cancelable:!0,detail:n},a)):(o=document.createEvent("CustomEvent"),o.initCustomEvent(i,!0,!0,n)),t.dispatchEvent(o)}function Ut(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}function Wt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,a=t.translateX,o=t.translateY,s=[];Ct(a)&&0!==a&&s.push("translateX(".concat(a,"px)")),Ct(o)&&0!==o&&s.push("translateY(".concat(o,"px)")),Ct(e)&&0!==e&&s.push("rotate(".concat(e,"deg)")),Ct(i)&&1!==i&&s.push("scaleX(".concat(i,")")),Ct(n)&&1!==n&&s.push("scaleY(".concat(n,")"));var r=s.length?s.join(" "):"none";return{WebkitTransform:r,msTransform:r,transform:r}}function Ht(t){return bt(t)?decodeURIComponent(t.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var qt=m.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(m.navigator.userAgent);function Vt(t,e,i){var n=document.createElement("img");if(t.naturalWidth&&!qt)return i(t.naturalWidth,t.naturalHeight),n;var a=document.body||document.documentElement;return n.onload=function(){i(n.width,n.height),qt||a.removeChild(n)},At(e.inheritedAttributes,(function(e){var i=t.getAttribute(e);null!==i&&n.setAttribute(e,i)})),n.src=t.src,qt||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(n)),n}function Yt(t){switch(t){case 2:return T;case 3:return _;case 4:return A;default:return""}}function Xt(t){var i=e({},t),n=[];return At(t,(function(t,e){delete i[e],At(i,(function(e){var i=Math.abs(t.startX-e.startX),a=Math.abs(t.startY-e.startY),o=Math.abs(t.endX-e.endX),s=Math.abs(t.endY-e.endY),r=Math.sqrt(i*i+a*a),l=Math.sqrt(o*o+s*s),c=(l-r)/r;n.push(c)}))})),n.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),n[0]}function Jt(t,i){var n=t.pageX,a=t.pageY,o={endX:n,endY:a};return i?o:e({timeStamp:Date.now(),startX:n,startY:a},o)}function Kt(t){var e=0,i=0,n=0;return At(t,(function(t){var a=t.startX,o=t.startY;e+=a,i+=o,n+=1})),e/=n,i/=n,{pageX:e,pageY:i}}var Qt={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,e=t.body||t.documentElement;this.body=e,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=e.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(e).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,e=this.options,i=this.parent;e.inline&&(t={width:Math.max(i.offsetWidth,e.minWidth),height:Math.max(i.offsetHeight,e.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=_t({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&Dt(this.viewer,this.viewerData)},initList:function(){var t=this,e=this.element,i=this.options,n=this.list,a=[];n.innerHTML="",At(this.images,(function(e,o){var s=e.src,r=e.alt||Ht(s),l=t.getImageURL(e);if(s||l){var c=document.createElement("li"),d=document.createElement("img");At(i.inheritedAttributes,(function(t){var i=e.getAttribute(t);null!==i&&d.setAttribute(t,i)})),i.navbar&&(d.src=s||l),d.alt=r,d.setAttribute("data-original-url",l||s),c.setAttribute("data-index",o),c.setAttribute("data-viewer-action","view"),c.setAttribute("role","button"),i.keyboard&&c.setAttribute("tabindex",0),c.appendChild(d),n.appendChild(c),a.push(c)}})),this.items=a,At(a,(function(e){var n,a,o=e.firstElementChild;Mt(o,"filled",!0),i.loading&&Zt(e,O),Gt(o,G,n=function(n){Bt(o,j,a),i.loading&&zt(e,O),t.loadImage(n)},{once:!0}),Gt(o,j,a=function(){Bt(o,G,n),i.loading&&zt(e,O)},{once:!0})})),i.transition&&Gt(e,ot,(function(){Zt(n,$)}),{once:!0})},renderList:function(){var t=this.index,e=this.items[t];if(e){var i=e.nextElementSibling,n=parseInt(window.getComputedStyle(i||e).marginLeft,10),a=e.offsetWidth,o=a+n;Dt(this.list,_t({width:o*this.length-n},Wt({translateX:(this.viewerData.width-a)/2-o*t})))}},resetList:function(){var t=this.list;t.innerHTML="",zt(t,$),Dt(t,Wt({translateX:0}))},initImage:function(t){var e,i=this,n=this.options,a=this.image,o=this.viewerData,s=this.footer.offsetHeight,r=o.width,l=Math.max(o.height-s,s),c=this.imageData||{};this.imageInitializing={abort:function(){e.onload=null}},e=Vt(a,n,(function(e,a){var o=e/a,s=Math.max(0,Math.min(1,n.initialCoverage)),d=r,u=l;i.imageInitializing=!1,l*o>r?u=r/o:d=l*o,s=Ct(s)?s:.9,d=Math.min(d*s,e),u=Math.min(u*s,a);var h=(r-d)/2,m=(l-u)/2,f={left:h,top:m,x:h,y:m,width:d,height:u,oldRatio:1,ratio:d/e,aspectRatio:o,naturalWidth:e,naturalHeight:a},p=_t({},f);n.rotatable&&(f.rotate=c.rotate||0,p.rotate=0),n.scalable&&(f.scaleX=c.scaleX||1,f.scaleY=c.scaleY||1,p.scaleX=1,p.scaleY=1),i.imageData=f,i.initialImageData=p,t&&t()}))},renderImage:function(t){var e=this,i=this.image,n=this.imageData;if(Dt(i,_t({width:n.width,height:n.height,marginLeft:n.x,marginTop:n.y},Wt(n))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&Ot(i,$)){var a=function(){e.imageRendering=!1,t()};this.imageRendering={abort:function(){Bt(i,J,a)}},Gt(i,J,a,{once:!0})}else t()},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},te={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Gt(e,L,this.onClick=this.click.bind(this)),Gt(e,M,this.onDragStart=this.dragstart.bind(this)),Gt(i,q,this.onPointerDown=this.pointerdown.bind(this)),Gt(n,V,this.onPointerMove=this.pointermove.bind(this)),Gt(n,Y,this.onPointerUp=this.pointerup.bind(this)),Gt(n,B,this.onKeyDown=this.keydown.bind(this)),Gt(window,X,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&Gt(e,K,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&Gt(i,F,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Bt(e,L,this.onClick),Bt(e,M,this.onDragStart),Bt(i,q,this.onPointerDown),Bt(n,V,this.onPointerMove),Bt(n,Y,this.onPointerUp),Bt(n,B,this.onKeyDown),Bt(window,X,this.onResize),t.zoomable&&t.zoomOnWheel&&Bt(e,K,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&Bt(i,F,this.onDblclick)}},ee={click:function(t){var e=this.options,i=this.imageData,n=t.target,a=Ft(n,vt);switch(a||"img"!==n.localName||"li"!==n.parentElement.localName||(n=n.parentElement,a=Ft(n,vt)),f&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),a){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Ft(n,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-i.scaleX||-1);break;case"flip-vertical":this.scaleY(-i.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(f&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var e=this.element,i=this.options,n=this.image,a=this.index,o=this.viewerData;zt(n,E),i.loading&&zt(this.canvas,O),n.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage((function(){Nt(n,Z,i.movable),Nt(n,$,i.transition),t.renderImage((function(){t.viewed=!0,t.viewing=!1,Pt(i.viewed)&&Gt(e,ot,i.viewed,{once:!0}),jt(e,ot,{originalImage:t.images[a],index:a,image:n},{cancelable:!1})}))}))},loadImage:function(t){var e=t.target,i=e.parentNode,n=i.offsetWidth||30,a=i.offsetHeight||50,o=!!Ft(e,"filled");Vt(e,this.options,(function(t,i){var s=t/i,r=n,l=a;a*s>n?o?r=a*s:l=n/s:o?l=n/s:r=a*s,Dt(e,_t({width:r,height:l},Wt({translateX:(n-r)/2,translateY:(a-l)/2})))}))},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;switch(i){case 13:this.viewer.contains(t.target)&&this.click(t);break}if(this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle());break}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,a=t.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(Ct(n)&&1!==n||Ct(a)&&0!==a||t.ctrlKey))){t.preventDefault(),t.changedTouches?At(t.changedTouches,(function(t){i[t.identifier]=Jt(t)})):i[t.pointerId||0]=Jt(t);var o=!!e.movable&&g;e.zoomOnTouch&&e.zoomable&&Object.keys(i).length>1?o=b:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(o=w),!e.transition||o!==g&&o!==b||zt(this.image,$),this.action=o}},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?At(t.changedTouches,(function(t){_t(e[t.identifier]||{},Jt(t,!0))})):_t(e[t.pointerId||0]||{},Jt(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,a=this.action,o=this.pointers;t.changedTouches?At(t.changedTouches,(function(t){e=o[t.identifier],delete o[t.identifier]})):(e=o[t.pointerId||0],delete o[t.pointerId||0]),a&&(t.preventDefault(),!n.transition||a!==g&&a!==b||Zt(this.image,$),this.action=!1,f&&a!==b&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout((function(){jt(i.image,F,{originalEvent:t})}),50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout((function(){i.imageClicked=!1}),500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout((function(){jt(i.canvas,L,{originalEvent:t})}),50)))))},resize:function(){var t=this;if(this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage()})),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();At(this.player.getElementsByTagName("img"),(function(e){Gt(e,G,t.loadImage.bind(t),{once:!0}),jt(e,G)}))}},wheel:function(t){var e=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50);var i=Number(this.options.zoomRatio)||.1,n=1;t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,!0,null,t)}}},ie={show:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.element,i=this.options;if(i.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(Pt(i.show)&&Gt(e,tt,i.show,{once:!0}),!1===jt(e,tt)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(zt(n,P),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("aria-hidden"),i.transition&&!t){var a=this.shown.bind(this);this.transitioning={abort:function(){Bt(n,J,a),zt(n,D)}},Zt(n,$),n.initialOffsetWidth=n.offsetWidth,Gt(n,J,a,{once:!0}),Zt(n,D)}else Zt(n,D),this.shown();return this},hide:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.element,n=this.options;if(n.inline||this.hiding||!this.isShown&&!this.showing)return this;if(Pt(n.hide)&&Gt(i,it,n.hide,{once:!0}),!1===jt(i,it))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var a=this.viewer,o=this.image,s=function(){zt(a,D),t.hidden()};if(n.transition&&!e){var r=function e(i){i&&i.target===a&&(Bt(a,J,e),t.hidden())},l=function(){Ot(a,$)?(Gt(a,J,r),zt(a,D)):s()};this.transitioning={abort:function(){t.viewed&&Ot(o,$)?Bt(o,J,l):Ot(a,$)&&Bt(a,J,r)}},this.viewed&&Ot(o,$)?(Gt(o,J,l,{once:!0}),this.zoomTo(0,!1,null,null,!0)):l()}else s();return this},view:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(e=Number(e)||0,this.hiding||this.played||e<0||e>=this.length||this.viewed&&e===this.index)return this;if(!this.isShown)return this.index=e,this.show();this.viewing&&this.viewing.abort();var i=this.element,n=this.options,a=this.title,o=this.canvas,s=this.items[e],r=s.querySelector("img"),l=Ft(r,"originalUrl"),c=r.getAttribute("alt"),d=document.createElement("img");if(At(n.inheritedAttributes,(function(t){var e=r.getAttribute(t);null!==e&&d.setAttribute(t,e)})),d.src=l,d.alt=c,Pt(n.view)&&Gt(i,at,n.view,{once:!0}),!1===jt(i,at,{originalImage:this.images[e],index:e,image:d})||!this.isShown||this.hiding||this.played)return this;var u=this.items[this.index];u&&(zt(u,y),u.removeAttribute("aria-selected")),Zt(s,y),s.setAttribute("aria-selected",!0),n.focus&&s.focus(),this.image=d,this.viewed=!1,this.index=e,this.imageData={},Zt(d,E),n.loading&&Zt(o,O),o.innerHTML="",o.appendChild(d),this.renderList(),a.innerHTML="";var h,m,f=function(){var e=t.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;a.innerHTML=Et(Pt(i)?i.call(t,d,e):"".concat(c," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")"))};return Gt(i,ot,f,{once:!0}),this.viewing={abort:function(){Bt(i,ot,f),d.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(d.src="",Bt(d,G,h),t.timeout&&clearTimeout(t.timeout))}},d.complete?this.load():(Gt(d,G,h=function(){Bt(d,j,m),t.load()},{once:!0}),Gt(d,j,m=function(){Bt(d,G,h),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),zt(d,E),n.loading&&zt(t.canvas,O)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){zt(d,E),t.timeout=!1}),1e3)),this},prev:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.index-1;return e<0&&(e=t?this.length-1:0),this.view(e),this},next:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.length-1,i=this.index+1;return i>e&&(i=t?0:e),this.view(i),this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(xt(t)?t:i.x+Number(t),xt(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this.element,o=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.movable){var r=s.x,l=s.y,c=!1;if(Ct(t)?c=!0:t=r,Ct(i)?c=!0:i=l,c){if(Pt(o.move)&&Gt(a,st,o.move,{once:!0}),!1===jt(a,st,{x:t,y:i,oldX:r,oldY:l,originalEvent:n}))return this;s.x=t,s.y=i,s.left=t,s.top=i,this.moving=!0,this.renderImage((function(){e.moving=!1,Pt(o.moved)&&Gt(a,rt,o.moved,{once:!0}),jt(a,rt,{x:t,y:i,oldX:r,oldY:l,originalEvent:n},{cancelable:!1})}))}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var e=this,i=this.element,n=this.options,a=this.imageData;if(t=Number(t),Ct(t)&&this.viewed&&!this.played&&n.rotatable){var o=a.rotate;if(Pt(n.rotate)&&Gt(i,lt,n.rotate,{once:!0}),!1===jt(i,lt,{degree:t,oldDegree:o}))return this;a.rotate=t,this.rotating=!0,this.renderImage((function(){e.rotating=!1,Pt(n.rotated)&&Gt(i,ct,n.rotated,{once:!0}),jt(i,ct,{degree:t,oldDegree:o},{cancelable:!1})}))}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.element,a=this.options,o=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&a.scalable){var s=o.scaleX,r=o.scaleY,l=!1;if(Ct(t)?l=!0:t=s,Ct(i)?l=!0:i=r,l){if(Pt(a.scale)&&Gt(n,dt,a.scale,{once:!0}),!1===jt(n,dt,{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r}))return this;o.scaleX=t,o.scaleY=i,this.scaling=!0,this.renderImage((function(){e.scaling=!1,Pt(a.scaled)&&Gt(n,ut,a.scaled,{once:!0}),jt(n,ut,{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r},{cancelable:!1})}))}}return this},zoom:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=this.imageData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(a.width*t/a.naturalWidth,e,i,n),this},zoomTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=this.element,r=this.options,l=this.pointers,c=this.imageData,d=c.x,u=c.y,h=c.width,m=c.height,f=c.naturalWidth,p=c.naturalHeight;if(t=Math.max(0,t),Ct(t)&&this.viewed&&!this.played&&(o||r.zoomable)){if(!o){var v=Math.max(.01,r.minZoomRatio),g=Math.min(100,r.maxZoomRatio);t=Math.min(Math.max(t,v),g)}if(a)switch(a.type){case"wheel":r.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":t>.99&&t<1.01&&(t=1);break}var w=f*t,b=p*t,y=w-h,C=b-m,x=c.ratio;if(Pt(r.zoom)&&Gt(s,ht,r.zoom,{once:!0}),!1===jt(s,ht,{ratio:t,oldRatio:x,originalEvent:a}))return this;if(this.zooming=!0,a){var k=Ut(this.viewer),I=l&&Object.keys(l).length>0?Kt(l):{pageX:a.pageX,pageY:a.pageY};c.x-=y*((I.pageX-k.left-d)/h),c.y-=C*((I.pageY-k.top-u)/m)}else St(n)&&Ct(n.x)&&Ct(n.y)?(c.x-=y*((n.x-d)/h),c.y-=C*((n.y-u)/m)):(c.x-=y/2,c.y-=C/2);c.left=c.x,c.top=c.y,c.width=w,c.height=b,c.oldRatio=x,c.ratio=t,this.renderImage((function(){e.zooming=!1,Pt(r.zoomed)&&Gt(s,mt,r.zoomed,{once:!0}),jt(s,mt,{ratio:t,oldRatio:x,originalEvent:a},{cancelable:!1})})),i&&this.tooltip()}return this},play:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var i=this.element,n=this.options;if(Pt(n.play)&&Gt(i,ft,n.play,{once:!0}),!1===jt(i,ft))return this;var a=this.player,o=this.loadImage.bind(this),s=[],r=0,l=0;if(this.played=!0,this.onLoadWhenPlay=o,e&&this.requestFullscreen(e),Zt(a,N),At(this.items,(function(t,e){var i=t.querySelector("img"),c=document.createElement("img");c.src=Ft(i,"originalUrl"),c.alt=i.getAttribute("alt"),c.referrerPolicy=i.referrerPolicy,r+=1,Zt(c,x),Nt(c,$,n.transition),Ot(t,y)&&(Zt(c,D),l=e),s.push(c),Gt(c,G,o,{once:!0}),a.appendChild(c)})),Ct(n.interval)&&n.interval>0){var c=function e(){clearTimeout(t.playing.timeout),zt(s[l],D),l-=1,l=l>=0?l:r-1,Zt(s[l],D),t.playing.timeout=setTimeout(e,n.interval)},d=function e(){clearTimeout(t.playing.timeout),zt(s[l],D),l+=1,l=l<r?l:0,Zt(s[l],D),t.playing.timeout=setTimeout(e,n.interval)};r>1&&(this.playing={prev:c,next:d,timeout:setTimeout(d,n.interval)})}return this},stop:function(){var t=this;if(!this.played)return this;var e=this.element,i=this.options;if(Pt(i.stop)&&Gt(e,pt,i.stop,{once:!0}),!1===jt(e,pt))return this;var n=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,At(n.getElementsByTagName("img"),(function(e){Bt(e,G,t.onLoadWhenPlay)})),zt(n,N),n.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,a=this.list;return!this.isShown||this.played||this.fulled||!e.inline||(this.fulled=!0,this.open(),Zt(this.button,S),e.transition&&(zt(a,$),this.viewed&&zt(n,$)),Zt(i,k),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),Dt(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=_t({},this.containerData),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Zt(n,$),Zt(a,$)}),0)}))}))),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,a=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline?(this.fulled=!1,this.close(),zt(this.button,S),e.transition&&(zt(a,$),this.viewed&&zt(n,$)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),zt(i,k),Dt(i,{zIndex:e.zIndexInline}),this.viewerData=_t({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Zt(n,$),Zt(a,$)}),0)}))})),this):this},tooltip:function(){var t=this,e=this.options,i=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&e.tooltip?(i.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):e.transition?(this.fading&&jt(i,J),Zt(i,N),Zt(i,x),Zt(i,$),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,Zt(i,D)):(Zt(i,N),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout((function(){e.transition?(Gt(i,J,(function(){zt(i,N),zt(i,x),zt(i,$),i.setAttribute("aria-hidden",!0),t.fading=!1}),{once:!0}),zt(i,D),t.fading=!0):(zt(i,N),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1}),1e3),this):this},toggle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=_t({},this.initialImageData),this.renderImage()),this},update:function(){var t=this,e=this.element,i=this.options,n=this.isImg;if(n&&!e.parentNode)return this.destroy();var a=[];if(At(n?[e]:e.querySelectorAll("img"),(function(e){Pt(i.filter)?i.filter.call(t,e)&&a.push(e):t.getImageURL(e)&&a.push(e)})),!a.length)return this;if(this.images=a,this.length=a.length,this.ready){var o=[];if(At(this.items,(function(t,e){var i=t.querySelector("img"),n=a[e];n&&i&&n.src===i.src&&n.alt===i.alt||o.push(e)})),Dt(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var s=o.indexOf(this.index);if(s>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-s,this.length-1),0));else{var r=this.items[this.index];Zt(r,y),r.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,e=this.options;return t[v]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),e.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):e.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),e.inline||Bt(t,L,this.onStart),t[v]=void 0,this):this}},ne={getImageURL:function(t){var e=this.options.url;return e=bt(e)?t.getAttribute(e):Pt(e)?e.call(this,t):"",e},enforceFocus:function(){var t=this;this.clearEnforceFocus(),Gt(document,R,this.onFocusin=function(e){var i=t.viewer,n=e.target;if(n!==document&&n!==i&&!i.contains(n)){while(n){if(null!==n.getAttribute("tabindex")||"true"===n.getAttribute("aria-modal"))return;n=n.parentElement}i.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Bt(document,R,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;Zt(t,z),this.scrollbarWidth>0&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;zt(t,z),this.scrollbarWidth>0&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),Pt(e.shown)&&Gt(t,et,e.shown,{once:!0}),!1!==jt(t,et)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer;e.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),Zt(i,P),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(Pt(e.hidden)&&Gt(t,nt,e.hidden,{once:!0}),jt(t,nt,null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.element.ownerDocument;if(this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)){var i=e.documentElement;i.requestFullscreen?St(t)?i.requestFullscreen(t):i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen()}},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var e=this.options,i=this.pointers,n=i[Object.keys(i)[0]];if(n){var a=n.endX-n.startX,o=n.endY-n.startY;switch(this.action){case g:0===a&&0===o||(this.pointerMoved=!0,this.move(a,o,t));break;case b:this.zoom(Xt(i),!1,null,t);break;case w:this.action="switched";var s=Math.abs(a);s>1&&s>Math.abs(o)&&(this.pointers={},a>1?this.prev(e.loop):a<-1&&this.next(e.loop));break}At(i,(function(t){t.startX=t.endX,t.startY=t.endY}))}},isSwitchable:function(){var t=this.imageData,e=this.viewerData;return this.length>1&&t.x>=0&&t.y>=0&&t.width<=e.width&&t.height<=e.height}},ae=m.Viewer,oe=function(t){return function(){return t+=1,t}}(-1),se=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n(this,t),!e||1!==e.nodeType)throw new Error("The first argument is required and must be an element.");this.element=e,this.options=_t({},d,St(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=oe(),this.init()}return s(t,[{key:"init",value:function(){var t=this,e=this.element,i=this.options;if(!e[v]){e[v]=this,i.focus&&!i.keyboard&&(i.focus=!1);var n="img"===e.localName,a=[];if(At(n?[e]:e.querySelectorAll("img"),(function(e){Pt(i.filter)?i.filter.call(t,e)&&a.push(e):t.getImageURL(e)&&a.push(e)})),this.isImg=n,this.length=a.length,this.images=a,this.initBody(),xt(document.createElement(v).style.transition)&&(i.transition=!1),i.inline){var o=0,s=function(){var e;(o+=1,o===t.length)&&(t.initializing=!1,t.delaying={abort:function(){clearTimeout(e)}},e=setTimeout((function(){t.delaying=!1,t.build()}),0))};this.initializing={abort:function(){At(a,(function(t){t.complete||(Bt(t,G,s),Bt(t,j,s))}))}},At(a,(function(t){var e,i;t.complete?s():(Gt(t,G,e=function(){Bt(t,j,i),s()},{once:!0}),Gt(t,j,i=function(){Bt(t,G,e),s()},{once:!0}))}))}else Gt(e,L,this.onStart=function(e){var n=e.target;"img"!==n.localName||Pt(i.filter)&&!i.filter.call(t,n)||t.view(t.images.indexOf(n))})}}},{key:"build",value:function(){if(!this.ready){var t=this.element,e=this.options,i=t.parentNode,n=document.createElement("div");n.innerHTML=u;var a=n.querySelector(".".concat(v,"-container")),o=a.querySelector(".".concat(v,"-title")),s=a.querySelector(".".concat(v,"-toolbar")),r=a.querySelector(".".concat(v,"-navbar")),l=a.querySelector(".".concat(v,"-button")),c=a.querySelector(".".concat(v,"-canvas"));if(this.parent=i,this.viewer=a,this.title=o,this.toolbar=s,this.navbar=r,this.button=l,this.canvas=c,this.footer=a.querySelector(".".concat(v,"-footer")),this.tooltipBox=a.querySelector(".".concat(v,"-tooltip")),this.player=a.querySelector(".".concat(v,"-player")),this.list=a.querySelector(".".concat(v,"-list")),a.id="".concat(v).concat(this.id),o.id="".concat(v,"Title").concat(this.id),Zt(o,e.title?Yt(Array.isArray(e.title)?e.title[0]:e.title):P),Zt(r,e.navbar?Yt(e.navbar):P),Nt(l,P,!e.button),e.keyboard&&l.setAttribute("tabindex",0),e.backdrop&&(Zt(a,"".concat(v,"-backdrop")),e.inline||"static"===e.backdrop||Mt(c,vt,"hide")),bt(e.className)&&e.className&&e.className.split(gt).forEach((function(t){Zt(a,t)})),e.toolbar){var d=document.createElement("ul"),h=St(e.toolbar),m=wt.slice(0,3),f=wt.slice(7,9),p=wt.slice(9);h||Zt(s,Yt(e.toolbar)),At(h?e.toolbar:wt,(function(t,i){var n=h&&St(t),a=h?Lt(i):t,o=n&&!xt(t.show)?t.show:t;if(o&&(e.zoomable||-1===m.indexOf(a))&&(e.rotatable||-1===f.indexOf(a))&&(e.scalable||-1===p.indexOf(a))){var s=n&&!xt(t.size)?t.size:t,r=n&&!xt(t.click)?t.click:t,l=document.createElement("li");e.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),Zt(l,"".concat(v,"-").concat(a)),Pt(r)||Mt(l,vt,a),Ct(o)&&Zt(l,Yt(o)),-1!==["small","large"].indexOf(s)?Zt(l,"".concat(v,"-").concat(s)):"play"===a&&Zt(l,"".concat(v,"-large")),Pt(r)&&Gt(l,L,r),d.appendChild(l)}})),s.appendChild(d)}else Zt(s,P);if(!e.rotatable){var g=s.querySelectorAll('li[class*="rotate"]');Zt(g,E),At(g,(function(t){s.appendChild(t)}))}if(e.inline)Zt(l,I),Dt(a,{zIndex:e.zIndexInline}),"static"===window.getComputedStyle(i).position&&Dt(i,{position:"relative"}),i.insertBefore(a,t.nextSibling);else{Zt(l,C),Zt(a,k),Zt(a,x),Zt(a,P),Dt(a,{zIndex:e.zIndex});var w=e.container;bt(w)&&(w=t.ownerDocument.querySelector(w)),w||(w=this.body),w.appendChild(a)}e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Pt(e.ready)&&Gt(t,Q,e.ready,{once:!0}),!1!==jt(t,Q)?this.ready&&e.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=ae,t}},{key:"setDefaults",value:function(t){_t(d,St(t)&&t)}}]),t}();return _t(se.prototype,Qt,te,ee,ie,ne),se}))},44791:function(t,e,i){"use strict";t.exports=i.p+"static/img/road-repair.aab593a3.svg"}}]);
|