diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php
index c6f9cd525..585625c18 100755
--- a/app/Http/Controllers/IndexController.php
+++ b/app/Http/Controllers/IndexController.php
@@ -338,6 +338,30 @@ class IndexController extends InvokeController
return abort(404);
}
+ /**
+ * 搜索表情
+ * @return array
+ */
+ public function emo__search()
+ {
+ $key = Request::input('key');
+ if (empty($key)) {
+ return Base::retError("key empty");
+ }
+ return Cache::remember("emo__search:" . md5($key), now()->addDay(), function () use ($key) {
+ $res = Ihttp::ihttp_get("http://www.adoutu.com/search?keyword=" . urlencode($key));
+ if (Base::isError($res)) {
+ return $res;
+ }
+ $content = Base::getMiddle($res['data'], '', '');
+ preg_match_all("/ \s*<\/p>)+|( \s*<\/p>)+$/gi,"")).replace(/^( \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(i.text))&&r.push("transparent"),r},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,i=[];return"text"===e&&(/^ \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?i.push("three-emoji"):/^\s* \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?i.push("two-emoji"):/^\s* \s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&i.push("an-emoji")),i}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var i=e,o=n;return(e>220||n>220)&&(e>n?(i=220,o=n*(220/e)):(i=e*(220/n),o=220)),{width:i+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function p(t){for(var e=1;e \s*<\/p>)+|( \s*<\/p>)+$/gi,"")).replace(/^( \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(i.text))&&r.push("transparent"),r},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,i=[];return"text"===e&&(/^ \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?i.push("three-emoji"):/^\s* \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?i.push("two-emoji"):/^\s* \s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&i.push("an-emoji")),i}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var i=e,o=n;return(e>220||n>220)&&(e>n?(i=220,o=n*(220/e)):(i=e*(220/n),o=220)),{width:i+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function p(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>o});var i="ontouchend"in document;const o={bind:function(t,e){var n=500,o=e.value;if($A.isJson(e.value)&&(n=e.value.delay||500,o=e.value.callback),"function"!=typeof o)throw"callback must be a function";if(!i)return t.__longpressContextmenu__=function(e){e.preventDefault(),e.stopPropagation(),o(e,t)},void t.addEventListener("contextmenu",t.__longpressContextmenu__);var r=null,s=!1;t.__longpressStart__=function(e){"click"===e.type&&0!==e.button||(s=!1,null===r&&(r=setTimeout((function(){s=!0,o(e.touches[0],t)}),n)))},t.__longpressCancel__=function(t){null!==r&&(clearTimeout(r),r=null)},t.__longpressClick__=function(e){s&&(e.preventDefault(),e.stopPropagation()),t.__longpressCancel__(e)},t.addEventListener("touchstart",t.__longpressStart__),t.addEventListener("click",t.__longpressClick__),t.addEventListener("touchmove",t.__longpressCancel__),t.addEventListener("touchend",t.__longpressCancel__),t.addEventListener("touchcancel",t.__longpressCancel__)},unbind:function(t){if(!i)return t.removeEventListener("contextmenu",t.__longpressContextmenu__),void delete t.__longpressContextmenu__;t.removeEventListener("touchstart",t.__longpressStart__),t.removeEventListener("click",t.__longpressClick__),t.removeEventListener("touchmove",t.__longpressCancel__),t.removeEventListener("touchend",t.__longpressCancel__),t.removeEventListener("touchcancel",t.__longpressCancel__),delete t.__longpressStart__,delete t.__longpressClick__,delete t.__longpressCancel__}}},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){var e,n,r=l(t),s=r[0],a=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),c=0,d=a>0?s-4:s;for(n=0;n
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var i=t.quill.getText(n.index);/^\n\n$/.test(i)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,i,o,r,s){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=i,i>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.emojiQuickItems=[],window.emoticonData.some((function(n){var i=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(i&&(e.emojiQuickItems.push({data:n,item:i}),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),i=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};i>-1?this.$store.state.dialogInputCache.splice(i,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&($.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,i){e.recordRec.close(),!0!==t&&(i<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(i)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showEmoji=!1,this.showMore=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){var e=t.data,n=t.item,i=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(i,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'')),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":$.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
]*?>$/.test(n.text)?i.push("an-emoticon"):/^\s*
]*?>/g,""))>2e3,a={id:r,dialog_id:this.dialogData.id,reply_id:this.replyId,reply_data:this.replyItem,type:s?"loading":"text",userid:this.userId,msg:{text:s?"":e}};this.tempMsgs.push(a),this.msgType="",this.replyActiveId=0,this.onActive(),this.$nextTick(this.onToBottom),this.$store.dispatch("call",{url:"dialog/msg/sendtext",data:{dialog_id:a.dialog_id,reply_id:a.reply_id,text:e},method:"post"}).then((function(t){var e=t.data;n.tempMsgs=n.tempMsgs.filter((function(t){return t.id!=r})),n.sendSuccess(e)})).catch((function(t){n.$set(a,"error",!0),n.$set(a,"errorData",{type:"text",content:t.msg,msg:e})}))}i&&requestAnimationFrame((function(t){return n.msgText=""}))}else this.inputFocus()},sendRecord:function(t){var e=this,n=$A.randNum(1e9,9999999999),i={id:n,dialog_id:this.dialogData.id,reply_id:this.replyId,reply_data:this.replyItem,type:"loading",userid:this.userId,msg:t};this.tempMsgs.push(i),this.msgType="",this.replyActiveId=0,this.onActive(),this.$nextTick(this.onToBottom),this.$store.dispatch("call",{url:"dialog/msg/sendrecord",data:Object.assign(t,{dialog_id:this.dialogId,reply_id:this.replyId}),method:"post"}).then((function(t){var i=t.data;e.tempMsgs=e.tempMsgs.filter((function(t){return t.id!=n})),e.sendSuccess(i)})).catch((function(n){e.$set(i,"error",!0),e.$set(i,"errorData",{type:"record",content:n.msg,msg:t})}))},sendFileMsg:function(t){var e=this,n=$A.isArray(t)?t:[t];n.length>0&&(this.pasteFile=[],this.pasteItem=[],n.some((function(t){var n={type:$A.getMiddle(t.type,null,"/"),name:t.name,size:t.size,result:null};if("image"===n.type){var i=new FileReader;i.readAsDataURL(t),i.onload=function(i){var o=i.target;n.result=o.result,e.pasteFile.push(t),e.pasteItem.push(n),e.pasteShow=!0}}else e.pasteFile.push(t),e.pasteItem.push(n),e.pasteShow=!0})))},msgFilter:function(t){if(this.msgType)if("tag"===this.msgType){if(!t.tag)return!1}else if("link"===this.msgType){if(!t.link)return!1}else if(this.msgType!==t.mtype)return!1;return!this.msgId||t.reply_id==this.msgId},onSearchMsgId:function(){this.dialogSearchMsgId>0&&this.openId===this.dialogId&&(this.onPositionId(this.dialogSearchMsgId),this.$store.state.dialogSearchMsgId=0)},onPositionId:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return new Promise((function(o,r){if(0===t)return $A.modalError("查看失败:参数错误"),void r();if(e.loadMsg||""!==e.msgType){if(e.msgType="",0===i)e.$store.dispatch("showSpinner",600);else if(i>20)return e.$store.dispatch("hiddenSpinner"),$A.modalError("查看失败:请求超时"),void r();return i++,void setTimeout((function(s){e.onPositionId(t,n,i).then(o).catch(r)}),Math.min(800,200*i))}i>0&&e.$store.dispatch("hiddenSpinner");var s=e.allMsgs.findIndex((function(e){return e.id===t})),a=e.prevId>0?0:-1;s>a?setTimeout((function(t){e.onToIndex(s),o()}),200):(n>0&&e.$store.dispatch("setLoad",{key:"msg-".concat(n),delay:600}),e.preventToBottom=!0,e.$store.dispatch("getDialogMsgs",{dialog_id:e.dialogId,msg_id:e.msgId,msg_type:e.msgType,position_id:t,spinner:2e3}).finally((function(i){var r=e.allMsgs.findIndex((function(e){return e.id===t}));r>-1&&(e.onToIndex(r),o()),n>0&&e.$store.dispatch("cancelLoad","msg-".concat(n)),e.preventToBottom=!1})))}))},onViewTodo:function(t){var e=this;if(!this.operateVisible){this.todoViewId=t.id,this.todoViewMid=t.msg_id,this.todoViewShow=!0;var n=this.allMsgs.findIndex((function(t){return t.id===e.todoViewMid}));-1===n&&this.$store.dispatch("call",{url:"dialog/msg/one",data:{msg_id:this.todoViewMid}}).then((function(t){var n=t.data;e.todoViewData=n}))}},onCloseTodo:function(){this.todoViewLoad=!1,this.todoViewShow=!1,this.todoViewData={},this.todoViewMid=0,this.todoViewId=0},onPosTodo:function(){var t=this;this.todoViewMid&&(this.todoViewPosLoad=!0,this.onPositionId(this.todoViewMid).then(this.onCloseTodo).finally((function(e){t.todoViewPosLoad=!1})))},onDoneTodo:function(){var t=this;this.todoViewId&&!this.todoViewLoad&&(this.todoViewLoad=!0,this.$store.dispatch("call",{url:"dialog/msg/done",data:{id:this.todoViewId}}).then((function(e){var n=e.data;t.$store.dispatch("saveDialogTodo",{id:t.todoViewId,done_at:$A.formatDate("Y-m-d H:i:s")}),t.$store.dispatch("saveDialog",{id:t.dialogId,todo_num:t.todoList.length}),n.add&&t.sendSuccess(n.add),0===t.todoList.length&&t.$store.dispatch("getDialogTodo",t.dialogId),t.onCloseTodo()})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.todoViewLoad=!1})))},itemClassAdd:function(t){return t===this.replyActiveIndex?"common-shake":""},inputFocus:function(){var t=this;this.$nextTick((function(e){t.$refs.input&&t.$refs.input.focus()}))},onRecordState:function(t){this.recordState=t},chatPasteDrag:function(t,e){this.dialogDrag=!1;var n="drag"===e?t.dataTransfer.files:t.clipboardData.files,i=Array.prototype.slice.call(n);i.length>0&&(t.preventDefault(),this.sendFileMsg(i))},chatDragOver:function(t,e){var n=this,i=this.__dialogDrag=$A.randomString(8);if(t){if("move"===e.dataTransfer.effectAllowed)return;this.dialogDrag=!0}else setTimeout((function(){i===n.__dialogDrag&&(n.dialogDrag=t)}),150)},onTouchStart:function(t){this.wrapperStart=Object.assign(this.scrollInfo(),{clientY:t.touches[0].clientY,exclud:!this.$refs.scroller.$el.contains(t.target)})},onTouchMove:function(t){if(this.windowSmall&&this.windowScrollY>0){if(this.wrapperStart.exclud)return void t.preventDefault();this.wrapperStart.clientY>t.touches[0].clientY?0===this.wrapperStart.tail&&t.preventDefault():0===this.wrapperStart.offset&&t.preventDefault()}},pasteSend:function(){var t=this;this.pasteFile.some((function(e){t.$refs.chatUpload.upload(e)}))},chatFile:function(t,e){switch(t){case"progress":var n={id:e.tempId,dialog_id:this.dialogData.id,reply_id:this.replyId,type:"loading",userid:this.userId,msg:{}};this.tempMsgs.push(n),this.msgType="",this.replyActiveId=0,this.onActive(),this.$nextTick(this.onToBottom);break;case"error":this.tempMsgs=this.tempMsgs.filter((function(t){return t.id!=e.tempId}));break;case"success":this.tempMsgs=this.tempMsgs.filter((function(t){return t.id!=e.tempId})),this.sendSuccess(e.data)}},sendSuccess:function(t){$A.isArray(t)?t.some(this.sendSuccess):(this.$store.dispatch("saveDialogMsg",t),this.replyActiveUpdate||(this.$store.dispatch("increaseTaskMsgNum",this.dialogId),this.$store.dispatch("increaseMsgReplyNum",t.reply_id),this.$store.dispatch("updateDialogLastMsg",t)),this.onCancelReply(),this.onActive())},onEventFocus:function(){this.$emit("on-focus")},onEventBlur:function(){this.$emit("on-blur")},onEventMore:function(t){switch(t){case"call":this.onCallTel();break;case"image":case"file":this.$refs.chatUpload.handleClick()}},onCallTel:function(){var t=this;this.$store.dispatch("call",{url:"dialog/tel",data:{dialog_id:this.dialogId},spinner:600}).then((function(e){var n=e.data;n.tel&&$A.eeuiAppSendMessage({action:"callTel",tel:n.tel}),n.add&&(t.$store.dispatch("saveDialogMsg",n.add),t.$store.dispatch("updateDialogLastMsg",n.add),t.onActive())})).catch((function(t){var e=t.msg;$A.modalError(e)}))},onEventEmojiVisibleChange:function(t){t&&this.windowSmall&&this.onToBottom()},onHeightChange:function(t){var e=t.newVal-t.oldVal;if(0!==e){var n=this.scrollInfo(),i=n.offset;n.tail>0&&this.onToOffset(i+e)}},onActive:function(){this.$emit("on-active")},onToBottom:function(){this.msgNew=0;var t=this.$refs.scroller;t&&(t.scrollToBottom(),requestAnimationFrame((function(e){return t.scrollToBottom()})))},onToIndex:function(t){var e=this,n=this.$refs.scroller;n&&(n.stopToBottom(),n.scrollToIndex(t,-100),requestAnimationFrame((function(e){return n.scrollToIndex(t,-100)}))),requestAnimationFrame((function(n){return e.replyActiveIndex=t}))},onToOffset:function(t){var e=this.$refs.scroller;e&&(e.stopToBottom(),e.scrollToOffset(t),setTimeout((function(n){return e.scrollToOffset(t)}),10))},scrollInfo:function(){var t=this.$refs.scroller;return t?t.scrollInfo():{offset:0,scale:0,tail:0}},openProject:function(){this.dialogData.group_info&&(this.windowSmall&&this.$store.dispatch("openDialog",0),this.goForward({name:"manage-project",params:{projectId:this.dialogData.group_info.id}}))},openTask:function(){this.dialogData.group_info&&(this.taskId>0&&this.$store.dispatch("openDialog",0),this.$store.dispatch("openTask",this.dialogData.group_info.id))},onPrevPage:function(){var t=this;0!==this.prevId&&this.$store.dispatch("getDialogMsgs",{dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,prev_id:this.prevId,save_before:function(e){return t.scrollDisabled=!0}}).then((function(e){var n=e.data.list.map((function(t){return t.id}));t.$nextTick((function(){var e=t.$refs.scroller,i=n.reduce((function(t,n){return{size:("object"===j(t)?t.size:e.getSize(t))+e.getSize(n)}})),o=e.getOffset()+i.size;0===t.prevId&&(o-=36),t.onToOffset(o),t.scrollDisabled=!1}))})).catch((function(){}))},openCreateGroup:function(){this.createGroupData={userids:this.dialogData.dialog_user?[this.userId,this.dialogData.dialog_user.userid]:[this.userId],uncancelable:[this.userId]},this.createGroupShow=!0},onCreateGroup:function(){var t=this;this.createGroupLoad++,this.$store.dispatch("call",{url:"dialog/group/add",data:this.createGroupData}).then((function(e){var n=e.data,i=e.msg;$A.messageSuccess(i),t.createGroupShow=!1,t.createGroupData={},t.$store.dispatch("saveDialog",n),t.$store.dispatch("openDialog",n.id)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(e){t.createGroupLoad--}))},onForward:function(t){var e=this;if("open"===t)this.forwardData={dialogids:[],userids:[],msg_id:this.operateItem.id},this.forwardShow=!0;else if("submit"===t){if(0===$A.arrayLength(this.forwardData.dialogids)&&0===$A.arrayLength(this.forwardData.userids))return void $A.messageWarning("请选择转发对话或成员");this.forwardLoad=!0,this.$store.dispatch("call",{url:"dialog/msg/forward",data:this.forwardData}).then((function(t){var n=t.data,i=t.msg;e.forwardShow=!1,e.$store.dispatch("saveDialogMsg",n.msgs),e.$store.dispatch("updateDialogLastMsg",n.msgs),$A.messageSuccess(i)})).catch((function(t){var e=t.msg;$A.modalError(e)})).finally((function(t){e.forwardLoad=!1}))}},onScroll:function(t){var e=this;this.operateVisible=!1;var n=this.scrollInfo().tail;this.scrollTail=n,this.scrollTail<=10&&(this.msgNew=0),this.scrollAction=t.target.scrollTop,this.scrollDirection=this.scrollTmp<=this.scrollAction?"down":"up",setTimeout((function(t){return e.scrollTmp=e.scrollAction}),0)},onRange:function(t){var e=this;if(!this.preventMoreLoad)for(var n="down"===this.scrollDirection?"next_id":"prev_id",i=t.start;i<=t.end;i++){var o=this.allMsgs[i][n];if(o){var r=this.allMsgs[i+("next_id"===n?1:-1)];r&&r.id!=o&&(this.preventMoreLoad=!0,this.$store.dispatch("getDialogMsgs",M({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType},n,o)).finally((function(t){e.preventMoreLoad=!1})))}}},onBack:function(){var t=this;if(!this.beforeBack)return this.handleBack();var e=this.beforeBack();e&&e.then?e.then((function(){t.handleBack()})):this.handleBack()},handleBack:function(){var t=this.$store.state.routeHistoryLast,e=t.name,n=t.params;e===this.$route.name&&/\d+/.test(n.dialogId)?this.goForward({name:this.$route.name}):this.goBack()},onMsgType:function(t){switch(t){case"project":this.openProject();break;case"task":this.openTask();break;default:this.loadMsg?$A.messageWarning("正在加载,请稍后再试..."):this.msgType=t}},onLongpress:function(t){var e=this,n=t.event,i=t.el,o=t.msgData;this.operateVisible=this.operateItem.id===o.id,this.operateItem=$A.isJson(o)?o:{},this.operateCopys=[],"IMG"===n.target.nodeName&&this.$Electron?this.operateCopys.push({type:"image",icon:"",label:"复制图片",value:$A.rightDelete(n.target.currentSrc,"_thumb.jpg")}):"A"===n.target.nodeName&&this.operateCopys.push({type:"link",icon:"",label:"复制链接",value:n.target.href}),"text"===o.type&&("IMG"===n.target.nodeName&&this.operateCopys.push({type:"imagedown",icon:"",label:"下载图片",value:$A.rightDelete(n.target.currentSrc,"_thumb.jpg")}),o.msg.text.replace(/<[^>]+>/g,"").length>0&&this.operateCopys.push({type:"text",icon:"",label:this.operateCopys.length>0?"复制文本":"复制",value:""})),this.$nextTick((function(){var t=i.getBoundingClientRect(),o=e.$el.getBoundingClientRect();e.operateStyles={left:"".concat(n.clientX-o.left,"px"),top:"".concat(t.top+e.windowScrollY,"px"),height:t.height+"px"},e.operateVisible=!0}))},onOperate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.operateVisible=!1,this.$nextTick((function(i){switch(t){case"reply":e.onReply();break;case"update":e.onUpdate();break;case"copy":e.onCopy(n);break;case"forward":e.onForward("open");break;case"withdraw":e.onWithdraw();break;case"view":e.onViewFile();break;case"down":e.onDownFile();break;case"tag":e.onTag();break;case"newTask":var o=$A.formatMsgBasic(e.operateItem.msg.text);o=o.replace(/
]*?src=(["'])(.*?)(_thumb\.jpg)*\1[^>]*?>/g,'
'),l.Store.set("addTask",{owner:[e.userId],content:o});break;case"todo":e.onTodo();break;case"pos":e.onPositionId(e.operateItem.id);break;case"emoji":e.onEmoji(n)}}))},onReply:function(){var t=this.scrollInfo().tail;this.replyActiveId=this.operateItem.id,this.replyActiveUpdate=!1,this.inputFocus(),t<=10&&requestAnimationFrame(this.onToBottom)},onUpdate:function(){if(this.onReply(),"text"===this.operateItem.type){this.replyActiveUpdate=!0;var t=this.operateItem.msg.text;t.indexOf("mention")>-1&&(t=t.replace(/([@#])(.*?)<\/span>/g,'$3$4')),this.msgText=$A.formatMsgBasic(t)}},onCopy:function(t){var e=this;if($A.isJson(t)){var n=t.type,i=t.value;switch(n){case"image":this.$Electron&&this.getBase64Image(i).then((function(t){e.$Electron.sendMessage("copyBase64Image",{base64:t})}));break;case"imagedown":this.$store.dispatch("downUrl",{url:i,token:!1});break;case"link":this.$copyText(i).then((function(t){return $A.messageSuccess("复制成功")})).catch((function(t){return $A.messageError("复制失败")}));break;case"text":var o=$A(this.$refs.scroller.$el).find('[data-id="'.concat(this.operateItem.id,'"]')).find(".dialog-content");if(o.length>0){var r=o[0].innerText.replace(/\n\n/g,"\n");this.$copyText(r).then((function(t){return $A.messageSuccess("复制成功")})).catch((function(t){return $A.messageError("复制失败")}))}else $A.messageWarning("不可复制的内容")}}},onCancelReply:function(){this.replyActiveUpdate&&(this.replyActiveUpdate=!1,this.msgText=""),this.replyActiveId=0},onWithdraw:function(){var t=this;$A.modalConfirm({content:"确定撤回此信息吗?",okText:"撤回",loading:!0,onOk:function(){return new Promise((function(e,n){t.$store.dispatch("call",{url:"dialog/msg/withdraw",data:{msg_id:t.operateItem.id}}).then((function(){e("消息已撤回"),t.$store.dispatch("forgetDialogMsg",t.operateItem.id)})).catch((function(t){var e=t.msg;n(e)}))}))}})},onViewReply:function(t){this.operateVisible||this.onPositionId(t.reply_id,t.msg_id)},onViewText:function(t){var e=t.target;if(!this.operateVisible)switch(e.nodeName){case"IMG":e.classList.contains("browse")?this.onViewPicture(e.currentSrc):(this.$store.state.previewImageIndex=0,this.$store.state.previewImageList=$A.getTextImagesInfo(e.outerHTML));break;case"SPAN":e.classList.contains("mention")&&e.classList.contains("task")&&this.$store.dispatch("openTask",$A.runNum(e.getAttribute("data-id")))}},onViewFile:function(t){if(!this.operateVisible){$A.isJson(t)||(t=this.operateItem);var e=t.msg;if(["jpg","jpeg","gif","png"].includes(e.ext))this.onViewPicture(e.path);else{var n="/single/file/msg/".concat(t.id);this.$Electron?this.$Electron.sendMessage("windowRouter",{name:"file-msg-".concat(t.id),path:n,userAgent:"/hideenOfficeTitle/",force:!1,config:{title:"".concat(e.name," (").concat($A.bytesToSize(e.size),")"),titleFixed:!0,parent:null,width:Math.min(window.screen.availWidth,1440),height:Math.min(window.screen.availHeight,900)},webPreferences:{nodeIntegrationInSubFrames:"drawio"===e.ext}}):this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:"".concat(e.name," (").concat($A.bytesToSize(e.size),")"),url:"web.js",params:{titleFixed:!0,url:$A.rightDelete(window.location.href,window.location.hash)+"#".concat(n)}}):window.open($A.apiUrl("..".concat(n)))}}},onViewPicture:function(t){var e=this.allMsgs.filter((function(t){return"file"===t.type?["jpg","jpeg","gif","png"].includes(t.msg.ext):"text"===t.type&&t.msg.text.match(/
]*?>/)})),n=[];e.some((function(t){var e=t.type,i=t.msg;"file"===e?n.push({src:i.path,width:i.width,height:i.height}):"text"===e&&n.push.apply(n,I($A.getTextImagesInfo(i.text)))}));var i=n.findIndex((function(e){return e.src===t}));i>-1?(this.$store.state.previewImageIndex=i,this.$store.state.previewImageList=n):(this.$store.state.previewImageIndex=0,this.$store.state.previewImageList=[t])},onDownFile:function(t){var e=this;this.operateVisible||($A.isJson(t)||(t=this.operateItem),$A.modalConfirm({title:"下载文件",content:"".concat(t.msg.name," (").concat($A.bytesToSize(t.msg.size),")"),okText:"立即下载",onOk:function(){e.$store.dispatch("downUrl",$A.apiUrl("dialog/msg/download?msg_id=".concat(t.id)))}}))},onReplyList:function(t){this.operateVisible||(this.replyListId=t.msg_id,this.replyListShow=!0)},onError:function(t){var e=this;if(!0===t.error){var n=t.errorData,i=n.type,o=n.content,r=n.msg,s={icon:"error",title:"发送失败",content:o,cancelText:"取消发送",onCancel:function(n){e.tempMsgs=e.tempMsgs.filter((function(e){return e.id!=t.id}))}};if("text"===i)s.okText="再次编辑",s.onOk=function(){e.tempMsgs=e.tempMsgs.filter((function(e){return e.id!=t.id})),e.msgText=r,e.inputFocus()};else{if("record"!==i)return;s.okText="重新发送",s.onOk=function(){e.tempMsgs=e.tempMsgs.filter((function(e){return e.id!=t.id})),e.sendRecord(r)}}$A.modalConfirm(s)}},onEmoji:function(t){var e=this;$A.isJson(t)||(t={msg_id:this.operateItem.id,symbol:t}),this.$store.dispatch("setLoad",{key:"msg-".concat(t.msg_id),delay:600}),this.$store.dispatch("call",{url:"dialog/msg/emoji",data:t}).then((function(t){var n=t.data;e.dialogMsgs.findIndex((function(t){return t.id==n.id}))>-1?e.$store.dispatch("saveDialogMsg",n):e.todoViewData.id===n.id&&(e.todoViewData=Object.assign(e.todoViewData,n))})).catch((function(t){var e=t.msg;$A.messageError(e)})).finally((function(n){e.$store.dispatch("cancelLoad","msg-".concat(t.msg_id))}))},onShowEmojiUser:function(t){this.operateVisible||(this.respondData=t,this.respondShow=!0)},onTag:function(){var t=this;if(!this.operateVisible){var e={msg_id:this.operateItem.id};this.$store.dispatch("setLoad",{key:"msg-".concat(e.msg_id),delay:600}),this.$store.dispatch("call",{url:"dialog/msg/tag",data:e}).then((function(e){var n=e.data;t.tagOrTodoSuccess(n)})).catch((function(t){var e=t.msg;$A.messageError(e)})).finally((function(n){t.$store.dispatch("cancelLoad","msg-".concat(e.msg_id))}))}},onTodo:function(t){var e=this;if(!this.operateVisible)if("submit"===t){if("user"===this.todoSettingData.type&&0===$A.arrayLength(this.todoSettingData.userids))return void $A.messageWarning("选择指定成员");this.todoSettingLoad++,this.onTodoSubmit(this.todoSettingData).then((function(t){$A.messageSuccess(t),e.todoSettingShow=!1})).catch($A.messageError).finally((function(t){e.todoSettingLoad--}))}else this.todoSettingData={type:"all",userids:[],msg_id:this.operateItem.id},this.operateItem.todo?$A.modalConfirm({content:"你确定取消待办吗?",cancelText:"取消",okText:"确定",loading:!0,onOk:function(){return e.onTodoSubmit(e.todoSettingData)}}):this.todoSettingShow=!0},onTodoSubmit:function(t){var e=this;return new Promise((function(n,i){e.$store.dispatch("setLoad",{key:"msg-".concat(t.msg_id),delay:600}),e.$store.dispatch("call",{url:"dialog/msg/todo",data:t}).then((function(t){var i=t.data,o=t.msg;n(o),e.tagOrTodoSuccess(i),e.onActive()})).catch((function(t){var e=t.msg;i(e)})).finally((function(n){e.$store.dispatch("cancelLoad","msg-".concat(t.msg_id))}))}))},tagOrTodoSuccess:function(t){this.$store.dispatch("saveDialogMsg",t.update),t.add&&(this.$store.dispatch("saveDialogMsg",t.add),this.$store.dispatch("updateDialogLastMsg",t.add))},getBase64Image:function(t){return new Promise((function(e){var n=document.createElement("CANVAS"),i=n.getContext("2d"),o=new Image;o.crossOrigin="Anonymous",o.onload=function(){n.height=o.height,n.width=o.width,i.drawImage(o,0,0);var r="png";$A.rightExists(t,"jpg")||$A.rightExists(t,"jpeg")?r="jpeg":$A.rightExists(t,"git")&&(r="git"),e(n.toDataURL("image/".concat(r))),n=null},o.src=t}))}}};const q=(0,s.Z)($,(function(){var t=this,e=t._self._c;return t.isReady?e("div",{staticClass:"dialog-wrapper",class:t.wrapperClass,on:{drop:function(e){return e.preventDefault(),t.chatPasteDrag(e,"drag")},dragover:function(e){return e.preventDefault(),t.chatDragOver(!0,e)},dragleave:function(e){return e.preventDefault(),t.chatDragOver(!1,e)},touchstart:t.onTouchStart,touchmove:t.onTouchMove}},[e("div",{staticClass:"dialog-nav",style:t.navStyle},[t._t("head",(function(){return[e("div",{staticClass:"nav-wrapper",class:{completed:t.$A.dialogCompleted(t.dialogData)}},[e("div",{staticClass:"dialog-back",on:{click:t.onBack}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),t.msgUnreadOnly?e("div",{staticClass:"back-num"},[t._v(t._s(t.msgUnreadOnly))]):t._e()]),t._v(" "),e("div",{staticClass:"dialog-block"},[e("div",{staticClass:"dialog-avatar"},["group"==t.dialogData.type?["department"==t.dialogData.group_type?e("i",{staticClass:"taskfont icon-avatar department"},[t._v("")]):"project"==t.dialogData.group_type?e("i",{staticClass:"taskfont icon-avatar project"},[t._v("")]):"task"==t.dialogData.group_type?e("i",{staticClass:"taskfont icon-avatar task"},[t._v("")]):e("Icon",{staticClass:"icon-avatar",attrs:{type:"ios-people"}})]:t.dialogData.dialog_user?e("div",{staticClass:"user-avatar"},[e("UserAvatar",{attrs:{online:t.dialogData.online_state,userid:t.dialogData.dialog_user.userid,size:42},on:{"update:online":function(e){return t.$set(t.dialogData,"online_state",e)}}},["user"===t.dialogData.type&&!0!==t.dialogData.online_state?e("p",{attrs:{slot:"end"},slot:"end"},[t._v("\n "+t._s(t.$L(t.dialogData.online_state))+"\n ")]):t._e()])],1):e("Icon",{staticClass:"icon-avatar",attrs:{type:"md-person"}})],2),t._v(" "),e("div",{staticClass:"dialog-title"},[e("div",{staticClass:"main-title"},[t._l(t.$A.dialogTags(t.dialogData),(function(n){return"success"!=n.color?[e("Tag",{attrs:{color:n.color,fade:!1}},[t._v(t._s(t.$L(n.text)))])]:t._e()})),t._v(" "),e("h2",[t._v(t._s(t.dialogData.name))]),t._v(" "),t.peopleNum>0?e("em",[t._v("("+t._s(t.peopleNum)+")")]):t._e(),t._v(" "),"all"==t.dialogData.group_type?e("Tag",{staticClass:"after",attrs:{fade:!1}},[t._v(t._s(t.$L("全员")))]):"department"==t.dialogData.group_type?e("Tag",{staticClass:"after",attrs:{fade:!1}},[t._v(t._s(t.$L("部门")))]):t._e()],2),t._v(" "),e("ul",{staticClass:"title-desc"},["user"===t.dialogData.type?e("li",{class:[!0===t.dialogData.online_state?"online":"offline"]},[t._v("\n "+t._s(t.$L(!0===t.dialogData.online_state?"在线":t.dialogData.online_state))+"\n ")]):t._e()]),t._v(" "),t.tagShow?e("ul",{staticClass:"title-tags scrollbar-hidden"},t._l(t.msgTags,(function(n){var o;return e("li",{key:n.type,class:(o={},i(o,n.type||"msg",!0),i(o,"active",t.msgType===n.type),o),on:{click:function(e){return t.onMsgType(n.type)}}},[e("i",{staticClass:"no-dark-content"}),t._v(" "),e("span",[t._v(t._s(t.$L(n.label)))])])})),0):t._e()])]),t._v(" "),"group"===t.dialogData.type?[e("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,openDelay:600,content:t.$L("群设置")}},[e("i",{staticClass:"taskfont dialog-create",on:{click:function(e){t.groupInfoShow=!0}}},[t._v("")])])]:"user"!==t.dialogData.type||t.isMyDialog?t._e():e("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall,content:t.$L("创建群组")}},[e("i",{staticClass:"taskfont dialog-create",on:{click:t.openCreateGroup}},[t._v("")])])],2)]}))],2),t._v(" "),e("VirtualList",{ref:"scroller",staticClass:"dialog-scroller scrollbar-overlay",class:t.scrollerClass,attrs:{"data-key":"id","data-sources":t.allMsgs,"data-component":t.msgItem,"item-class-add":t.itemClassAdd,"extra-props":{dialogData:t.dialogData,operateVisible:t.operateVisible,operateItem:t.operateItem,isMyDialog:t.isMyDialog,msgId:t.msgId},"estimate-size":"group"==t.dialogData.type?105:77,keeps:50,disabled:t.scrollDisabled},on:{scroll:t.onScroll,range:t.onRange,totop:t.onPrevPage,"on-longpress":t.onLongpress,"on-view-reply":t.onViewReply,"on-view-text":t.onViewText,"on-view-file":t.onViewFile,"on-down-file":t.onDownFile,"on-reply-list":t.onReplyList,"on-error":t.onError,"on-emoji":t.onEmoji,"on-show-emoji-user":t.onShowEmojiUser}},[e("template",{slot:"header"},[0===t.allMsgs.length&&t.loadMsg||t.prevId>0?e("div",{staticClass:"dialog-item loading"},[e("Loading",{attrs:{type:"pure"}})],1):0===t.allMsgs.length?e("div",{staticClass:"dialog-item nothing"},[t._v(t._s(t.$L("暂无消息")))]):t._e()])],2),t._v(" "),e("div",{staticClass:"dialog-footer",class:t.footerClass,on:{click:t.onActive}},[e("div",{staticClass:"dialog-newmsg",on:{click:t.onToBottom}},[t._v(t._s(t.$L("有".concat(t.msgNew,"条新消息"))))]),t._v(" "),e("div",{staticClass:"dialog-goto",on:{click:t.onToBottom}},[e("i",{staticClass:"taskfont"},[t._v("")])]),t._v(" "),e("DialogUpload",{ref:"chatUpload",staticClass:"chat-upload",attrs:{"dialog-id":t.dialogId,"reply-id":t.replyId},on:{"on-progress":function(e){return t.chatFile("progress",e)},"on-success":function(e){return t.chatFile("success",e)},"on-error":function(e){return t.chatFile("error",e)}}}),t._v(" "),t.todoShow?e("div",{staticClass:"chat-todo"},[e("div",{staticClass:"todo-label"},[t._v(t._s(t.$L("待办"))+":")]),t._v(" "),e("ul",{staticClass:"scrollbar-hidden"},t._l(t.todoList,(function(n){return e("li",{on:{click:function(e){return e.stopPropagation(),t.onViewTodo(n)}}},[e("div",{staticClass:"todo-desc no-dark-content"},[t._v(t._s(t.$A.getMsgSimpleDesc(n.msg_data)))])])})),0)]):t._e(),t._v(" "),t.isMute?e("div",{staticClass:"chat-mute"},[t._v("\n "+t._s(t.$L("禁言发言"))+"\n ")]):e("ChatInput",{ref:"input",attrs:{"dialog-id":t.dialogId,"reply-id":t.replyActiveId,"emoji-bottom":t.windowSmall,maxlength:2e5,placeholder:t.$L("输入消息...")},on:{"on-focus":t.onEventFocus,"on-blur":t.onEventBlur,"on-more":t.onEventMore,"on-file":t.sendFileMsg,"on-send":t.sendMsg,"on-record":t.sendRecord,"on-record-state":t.onRecordState,"on-emoji-visible-change":t.onEventEmojiVisibleChange,"on-height-change":t.onHeightChange,"on-cancel-reply":t.onCancelReply},model:{value:t.msgText,callback:function(e){t.msgText=e},expression:"msgText"}})],1),t._v(" "),e("div",{staticClass:"operate-position",style:t.operateStyles},[e("Dropdown",{attrs:{trigger:"custom",placement:"top",visible:t.operateVisible,transferClassName:"dialog-wrapper-operate",transfer:""},on:{"on-clickoutside":function(e){t.operateVisible=!1}}},[e("div",{style:{userSelect:t.operateVisible?"none":"auto",height:t.operateStyles.height}}),t._v(" "),e("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[e("DropdownItem",{attrs:{name:"action"}},[e("ul",{staticClass:"operate-action"},[0===t.msgId?e("li",{on:{click:function(e){return t.onOperate("reply")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("回复")))])]):t._e(),t._v(" "),t.operateItem.userid==t.userId&&"text"===t.operateItem.type?e("li",{on:{click:function(e){return t.onOperate("update")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("编辑")))])]):t._e(),t._v(" "),t._l(t.operateCopys,(function(n){return e("li",{on:{click:function(e){return t.onOperate("copy",n)}}},[e("i",{staticClass:"taskfont",domProps:{innerHTML:t._s(n.icon)}}),t._v(" "),e("span",[t._v(t._s(t.$L(n.label)))])])})),t._v(" "),e("li",{on:{click:function(e){return t.onOperate("forward")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("转发")))])]),t._v(" "),t.operateItem.userid==t.userId?e("li",{on:{click:function(e){return t.onOperate("withdraw")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("撤回")))])]):t._e(),t._v(" "),"file"===t.operateItem.type?[e("li",{on:{click:function(e){return t.onOperate("view")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("查看")))])]),t._v(" "),e("li",{on:{click:function(e){return t.onOperate("down")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("下载")))])])]:t._e(),t._v(" "),e("li",{on:{click:function(e){return t.onOperate("tag")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L(t.operateItem.tag?"取消标注":"标注")))])]),t._v(" "),"text"===t.operateItem.type?e("li",{on:{click:function(e){return t.onOperate("newTask")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("新任务")))])]):t._e(),t._v(" "),e("li",{on:{click:function(e){return t.onOperate("todo")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L(t.operateItem.todo?"取消待办":"设待办")))])]),t._v(" "),""!==t.msgType?e("li",{on:{click:function(e){return t.onOperate("pos")}}},[e("i",{staticClass:"taskfont"},[t._v("")]),t._v(" "),e("span",[t._v(t._s(t.$L("完整对话")))])]):t._e()],2)]),t._v(" "),e("DropdownItem",{staticClass:"dropdown-emoji",attrs:{name:"emoji"}},[e("ul",{staticClass:"operate-emoji scrollbar-hidden"},t._l(t.operateEmojis,(function(n,i){return e("li",{key:i,staticClass:"no-dark-content",domProps:{innerHTML:t._s(n)},on:{click:function(e){return t.onOperate("emoji",n)}}})})),0)])],1)],1)],1),t._v(" "),t.dialogDrag?e("div",{staticClass:"drag-over",on:{click:function(e){t.dialogDrag=!1}}},[e("div",{staticClass:"drag-text"},[t._v(t._s(t.$L("拖动到这里发送")))])]):t._e(),t._v(" "),e("Modal",{attrs:{title:t.$L(t.pasteTitle),"cancel-text":t.$L("取消"),"ok-text":t.$L("发送"),"enter-ok":!0},on:{"on-ok":t.pasteSend},model:{value:t.pasteShow,callback:function(e){t.pasteShow=e},expression:"pasteShow"}},[e("ul",{staticClass:"dialog-wrapper-paste",class:t.pasteWrapperClass},t._l(t.pasteItem,(function(n){return e("li",["image"==n.type?e("img",{attrs:{src:n.result}}):e("div",[t._v(t._s(t.$L("文件"))+": "+t._s(n.name)+" ("+t._s(t.$A.bytesToSize(n.size))+")")])])})),0)]),t._v(" "),e("Modal",{attrs:{title:t.$L("创建群组"),"mask-closable":!1},model:{value:t.createGroupShow,callback:function(e){t.createGroupShow=e},expression:"createGroupShow"}},[e("Form",{attrs:{model:t.createGroupData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{prop:"userids",label:t.$L("群成员")}},[e("UserInput",{attrs:{uncancelable:t.createGroupData.uncancelable,"multiple-max":100,placeholder:t.$L("选择项目成员")},model:{value:t.createGroupData.userids,callback:function(e){t.$set(t.createGroupData,"userids",e)},expression:"createGroupData.userids"}})],1),t._v(" "),e("FormItem",{attrs:{prop:"chat_name",label:t.$L("群名称")}},[e("Input",{attrs:{placeholder:t.$L("输入群名称(选填)")},model:{value:t.createGroupData.chat_name,callback:function(e){t.$set(t.createGroupData,"chat_name",e)},expression:"createGroupData.chat_name"}})],1)],1),t._v(" "),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(e){t.createGroupShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),e("Button",{attrs:{type:"primary",loading:t.createGroupLoad>0},on:{click:t.onCreateGroup}},[t._v(t._s(t.$L("创建")))])],1)],1),t._v(" "),e("Modal",{attrs:{title:t.$L("转发"),"mask-closable":!1},model:{value:t.forwardShow,callback:function(e){t.forwardShow=e},expression:"forwardShow"}},[e("Form",{ref:"forwardForm",attrs:{model:t.forwardData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{prop:"dialogids",label:t.$L("最近聊天")}},[e("Select",{staticClass:"dialog-wrapper-dialogids",attrs:{placeholder:t.$L("选择转发最近聊天"),"multiple-max":20,multiple:"",filterable:"","transfer-class-name":"dialog-wrapper-forward"},model:{value:t.forwardData.dialogids,callback:function(e){t.$set(t.forwardData,"dialogids",e)},expression:"forwardData.dialogids"}},[e("div",{staticClass:"forward-drop-prepend",attrs:{slot:"drop-prepend"},slot:"drop-prepend"},[t._v(t._s(t.$L("最多只能选择20个")))]),t._v(" "),t._l(t.dialogList,(function(n,i){return e("Option",{key:i,attrs:{value:n.id,"key-value":n.name,label:n.name}},[e("div",{staticClass:"forward-option"},[e("div",{staticClass:"forward-avatar"},["group"==n.type?["department"==n.group_type?e("i",{staticClass:"taskfont icon-avatar department"},[t._v("")]):"project"==n.group_type?e("i",{staticClass:"taskfont icon-avatar project"},[t._v("")]):"task"==n.group_type?e("i",{staticClass:"taskfont icon-avatar task"},[t._v("")]):e("Icon",{staticClass:"icon-avatar",attrs:{type:"ios-people"}})]:n.dialog_user?e("div",{staticClass:"user-avatar"},[e("UserAvatar",{attrs:{userid:n.dialog_user.userid,size:26}})],1):e("Icon",{staticClass:"icon-avatar",attrs:{type:"md-person"}})],2),t._v(" "),e("div",{staticClass:"forward-name"},[t._v(t._s(n.name))])])])}))],2)],1),t._v(" "),e("FormItem",{attrs:{prop:"userids",label:t.$L("指定成员")}},[e("UserInput",{attrs:{"multiple-max":20,placeholder:"(".concat(t.$L("或"),") ").concat(t.$L("选择转发指定成员"))},model:{value:t.forwardData.userids,callback:function(e){t.$set(t.forwardData,"userids",e)},expression:"forwardData.userids"}})],1)],1),t._v(" "),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(e){t.forwardShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),e("Button",{attrs:{type:"primary",loading:t.forwardLoad},on:{click:function(e){return t.onForward("submit")}}},[t._v(t._s(t.$L("转发")))])],1)],1),t._v(" "),e("Modal",{attrs:{title:t.$L("设置待办"),"mask-closable":!1},model:{value:t.todoSettingShow,callback:function(e){t.todoSettingShow=e},expression:"todoSettingShow"}},[e("Form",{ref:"todoSettingForm",attrs:{model:t.todoSettingData,"label-width":"auto"},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{prop:"type",label:t.$L("当前会话")}},[e("RadioGroup",{model:{value:t.todoSettingData.type,callback:function(e){t.$set(t.todoSettingData,"type",e)},expression:"todoSettingData.type"}},[e("Radio",{attrs:{label:"all"}},[t._v(t._s(t.$L("所有成员")))]),t._v(" "),e("Radio",{attrs:{label:"user"}},[t._v(t._s(t.$L("指定成员")))])],1)],1),t._v(" "),"user"===t.todoSettingData.type?e("FormItem",{attrs:{prop:"userids"}},[e("UserInput",{attrs:{"dialog-id":t.dialogId,placeholder:t.$L("选择指定成员")},model:{value:t.todoSettingData.userids,callback:function(e){t.$set(t.todoSettingData,"userids",e)},expression:"todoSettingData.userids"}})],1):t._e()],1),t._v(" "),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(e){t.todoSettingShow=!1}}},[t._v(t._s(t.$L("取消")))]),t._v(" "),e("Button",{attrs:{type:"primary",loading:t.todoSettingLoad>0},on:{click:function(e){return t.onTodo("submit")}}},[t._v(t._s(t.$L("确定")))])],1)],1),t._v(" "),e("DrawerOverlay",{attrs:{placement:"right",size:400},model:{value:t.groupInfoShow,callback:function(e){t.groupInfoShow=e},expression:"groupInfoShow"}},[t.groupInfoShow?e("DialogGroupInfo",{attrs:{dialogId:t.dialogId},on:{"on-close":function(e){t.groupInfoShow=!1}}}):t._e()],1),t._v(" "),e("DrawerOverlay",{attrs:{placement:"right","class-name":"dialog-wrapper-drawer-list",size:500},model:{value:t.replyListShow,callback:function(e){t.replyListShow=e},expression:"replyListShow"}},[t.replyListShow?e("DialogWrapper",{staticClass:"drawer-list",attrs:{dialogId:t.dialogId,msgId:t.replyListId}},[e("div",{staticClass:"drawer-title",attrs:{slot:"head"},slot:"head"},[t._v(t._s(t.$L("回复消息")))])]):t._e()],1),t._v(" "),e("DrawerOverlay",{attrs:{placement:"right",size:400},model:{value:t.respondShow,callback:function(e){t.respondShow=e},expression:"respondShow"}},[t.respondShow?e("DialogRespond",{attrs:{"respond-data":t.respondData},on:{"on-close":function(e){t.respondShow=!1}}}):t._e()],1),t._v(" "),e("DrawerOverlay",{attrs:{placement:"right","class-name":"dialog-wrapper-drawer-list",size:500},model:{value:t.todoViewShow,callback:function(e){t.todoViewShow=e},expression:"todoViewShow"}},[e("div",{staticClass:"dialog-wrapper drawer-list"},[e("div",{staticClass:"dialog-nav"},[e("div",{staticClass:"drawer-title"},[t._v(t._s(t.$L("待办消息")))])]),t._v(" "),e("div",{staticClass:"dialog-scroller scrollbar-overlay"},[t.todoViewMsg?e("DialogItem",{attrs:{source:t.todoViewMsg,simpleView:""},on:{"on-view-text":t.onViewText,"on-view-file":t.onViewFile,"on-down-file":t.onDownFile,"on-emoji":t.onEmoji}}):t._e(),t._v(" "),e("Button",{staticClass:"original-button",attrs:{icon:"md-exit",type:"text",loading:t.todoViewPosLoad},on:{click:t.onPosTodo}},[t._v(t._s(t.$L("回到原文")))])],1),t._v(" "),e("div",{staticClass:"todo-button"},[e("Button",{attrs:{type:"primary",size:"large",icon:"md-checkbox-outline",loading:t.todoViewLoad,long:""},on:{click:t.onDoneTodo}},[t._v(t._s(t.$L("完成")))])],1)])])],1):t._e()}),[],!1,null,null,null).exports},15226:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>h});var i=n(20629),o=n(14934);const r={name:"ScrollerY",props:{static:{type:Boolean,default:!1},autoBottom:{type:Boolean,default:!1},autoRecovery:{type:Boolean,default:!0},autoRecoveryAnimate:{type:Boolean,default:!1}},data:function(){return{scrollY:0,scrollDiff:0,autoInterval:null}},mounted:function(){this.openInterval(),this.$nextTick(this.initScroll)},activated:function(){this.openInterval(),this.recoveryScroll()},destroyed:function(){this.closeInterval()},deactivated:function(){this.closeInterval()},methods:{initScroll:function(){var t=this;this.autoToBottom();var e="function"==typeof this.$listeners["on-scroll"],n=$A(this.$refs.scrollerView);n.scroll((function(){var i=Math.round(n.innerHeight()),o=n.scrollTop(),r=t.$refs.scrollerView.scrollHeight;if(t.scrollY=o,e){var s="static",a="static";t.scrollDiff-o>50?(t.scrollDiff=o,s="down"):t.scrollDiff-o<-100&&(t.scrollDiff=o,s="up"),t.scrollDiff-o>1?(t.scrollDiff=o,a="down"):t.scrollDiff-o<-1&&(t.scrollDiff=o,a="up"),t.$emit("on-scroll",{scale:o/(r-i),scrollY:o,scrollE:r-i-o,direction:s,directionreal:a})}}))},recoveryScroll:function(){var t=this;this.autoRecovery&&(this.scrollY>0||this.autoBottom)&&this.$nextTick((function(){t.autoBottom?t.autoToBottom():t.scrollTo(t.scrollY,t.autoRecoveryAnimate)}))},openInterval:function(){this.autoToBottom(),this.autoInterval&&clearInterval(this.autoInterval),this.autoInterval=setInterval(this.autoToBottom,300)},closeInterval:function(){clearInterval(this.autoInterval),this.autoInterval=null},scrollTo:function(t,e){!1===e?$A(this.$refs.scrollerView).stop().scrollTop(t):$A(this.$refs.scrollerView).stop().animate({scrollTop:t})},autoToBottom:function(){this.autoBottom&&$A.scrollToView(this.$refs.bottom,{behavior:"instant",inline:"end"})},scrollInfo:function(){var t=$A(this.$refs.scrollerView),e=Math.round(t.innerHeight()),n=t.scrollTop(),i=this.$refs.scrollerView.scrollHeight;return this.scrollY=n,{scale:n/(i-e),scrollY:n,scrollE:i-e-n}},querySelector:function(t){return this.$refs.scrollerView&&this.$refs.scrollerView.querySelector(t)}}};var s=n(51900);const a=(0,s.Z)(r,(function(){var t=this,e=t._self._c;return e("div",{ref:"scrollerView",staticClass:"app-scroller-y",class:[t.static?"static":""]},[t._t("default"),t._v(" "),e("div",{ref:"bottom",staticClass:"app-scroller-bottom"})],2)}),[],!1,null,null,null).exports;var l=n(8251);function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function c(t){for(var e=1;e
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var i=t.quill.getText(n.index);/^\n\n$/.test(i)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,i,o,r,s){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=i,i>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.emojiSearchKey="",this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.searchEmoji(t),e.emojiQuickItems=[],window.emoticonData.some((function(n){var i=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(i&&(e.emojiQuickItems.push({data:n,item:i}),e.emojiQuickItems.length>=2))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},searchEmoji:function(t){var e=this;this.emojiSearchKey=t,this.emojiSearchTimer&&clearTimeout(this.emojiSearchTimer),this.emojiSearchTimer=setTimeout((function(n){e.emojiSearchKey===t&&e.$store.dispatch("call",{url:"../emo/search",data:{key:t}}).then((function(n){var i=n.data;if(e.emojiSearchKey===t){var o=3;e.windowWidth>1e3?o=5:e.windowWidth>900&&(o=4);var r,s=e.getRandomArrayElements(i.map((function(t){return{data:{},item:{type:"online",name:e.$L("动画表情"),src:e.asciiConvertNative(t)}}})),o-e.emojiQuickItems.length);if(s.length>0)(r=e.emojiQuickItems).push.apply(r,q(s)),e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}}))}),800)},asciiConvertNative:function(t){for(var e=t.split("\\u"),n=e[0],i=1;i'));else{var i=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(i,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'
'))}this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":$.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
]*?>$/.test(n.text)?i.push("an-emoticon"):/^\s*
').append(o),l.setStartAfter(u[0].firstChild.firstChild),l.setEndAfter(o)):(u.empty().append(_o).append(o).append(_o),l.setStart(u[0].firstChild,1),l.setEnd(u[0].lastChild,0)),u.css({top:r.getPos(e,t.getBody()).y}),u[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(l),l}(o,a.targetClone,i),c=Ne.fromDom(o);return V(qs(Ne.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Pe(c,t)||rr(t,u)})),r.getAttrib(o,u)||o.setAttribute(u,"1"),e=o,w(),l},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=fc(n,i,t),a=o.getNode(!e);if(zl(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(zl(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var u=t.startContainer,c=t.startOffset,f=t.endOffset;if(3===u.nodeType&&0===c&&Hx(u.parentNode)&&(u=u.parentNode,c=r.nodeIndex(u),u=u.parentNode),1!==u.nodeType)return null;if(f===c+1&&u===t.endContainer){var d=u.childNodes[c];if(l(d))return v(d)}return null},_=function(){e&&e.removeAttribute(u),Qr(Ne.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!ty(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&_b(t,e.clientX,e.clientY)&&I_(t,n,!1).each(f)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Hx(o)&&(e.preventDefault(),t.focus()),zx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var u=function(e,n){var i,a,s=r.getParent(e,o),u=r.getParent(n,o);return!y(s)&&(!(e===u||!r.isChildOf(s,u)||!1!==Hx(Vx(t,s)))||!r.isChildOf(u,s)&&(i=s,a=u,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Du.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=Oc(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Hx(r)?(e.preventDefault(),L_(t,r).each(b)):l(n)&&L_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==_b(t,e.clientX,e.clientY)){var a=Vx(t,o);if(a)Hx(a)?(e.preventDefault(),L_(t,a).each(b)):(_(),zx(a)&&e.shiftKey||rd(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(l(o))L_(t,o).each(b);else if(!1===zl(o)){_(),w();var s=nk(i,e.clientX,e.clientY);if(s&&!u(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);f(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){sd.modifierPressed(t)||Hx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Ce.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Ux(t),function(t){var e=Ns((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=P_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=nd(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&L_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(jo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Kx=function(t){var e,n,r=Ae.each,o=sd.BACKSPACE,i=sd.DELETE,a=t.dom,s=t.selection,u=t.parser,l=Ce.gecko,c=Ce.ie,f=Ce.webkit,d="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,u=n.keyCode;if(!m(n)&&(u===i||u===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Ao(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},C=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),yl(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Ce.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},A=function(){Ce.mac&&t.on("keydown",(function(e){!sd.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},T=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},N=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},D=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=fd(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},L=k;return ty(t)?(f&&(y(),_(),N(),v(),Ce.iOS&&(O(),E(),T())),l&&(b(),C(),S(),A())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===sd.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),Ce.windowsPhone||t.on("keyup focusin mouseup",(function(t){sd.modifierPressed(t)||s.normalize()}),!0),f&&(y(),_(),ol(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ol(t))})),N(),w(),u.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(O(),E(),T()):v()),Ce.ie>=11&&(E(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),D()),l&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),C(),x(),S(),A(),w())),{refreshContentEditable:L,isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Yx=ys.DOM,Zx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gx=function(t){return vt(t,(function(t){return!1===v(t)}))},Xx=function(t){var e=t.settings;return Gx({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Qx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Zx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Jx=function(t){var e=t.dom.getRoot();t.inline||Vf(t)&&t.selection.getStart(!0)!==e||Mc(e).each((function(e){var n=e.getNode(),r=Rn(n)?Mc(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=Ne.fromDom(t.getBody()),r=(ih(t)?M.from(e):M.none()).map(ah).filter(oh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},tS=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Jx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},eS=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},nS=function(t){var e=eS(t),n=vl(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";Ae.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return eS(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ne.fromDom(t.getBody()),r=un(sn(n)),o=Ne.fromTag("style");Jn(o,"type","text/css"),pn(o,Ne.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},rS=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Yx.setAttrib(r,"spellcheck","false")),t.quirks=Kx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Es.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){Ae.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},oS=function(t){!0!==t.removed&&(!function(t){ty(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),tS(t))},iS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Yx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Yx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Fb(t),t.schema=Di(Xx(t)),t.dom=ys(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hl(t),referrerPolicy:pl(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Dy(Qx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new jh("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Ry(function(t){var e=t.settings;return Nt(Nt(Nt({},Qx(t)),Xx(t)),Gx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=hy(t.dom,t.getWin(),t.serializer,t),t.annotator=td(t),t.formatter=Yb(t),t.undoManager=Gb(t),t._nodeChangeDispatcher=new Ax(t),t._selectionOverrides=Wx(t),Bk(t),Tx(t),ty(t)||Dx(t);var a=function(t){return ty(t)?Cs(null):Ex(t)}(t);Mk(t,a),function(t){ol(t)&&t.on("NodeChange",A(zk,t))}(t),e_(t);var s=ey(t);rS(t),s.fold((function(){nS(t).then((function(){return oS(t)}))}),(function(e){t.setProgressState(!0),nS(t).then((function(){e().then((function(e){t.setProgressState(!1),oS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),oS(t)}))}))}))},aS=ys.DOM,sS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.emojiQuickItems=[],window.emoticonData.some((function(n){var r=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(r&&(e.emojiQuickItems.push({data:n,item:r}),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),r=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};r>-1?this.$store.state.dialogInputCache.splice(r,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(M.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,r){e.recordRec.close(),!0!==t&&(r<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(r)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showEmoji=!1,this.showMore=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){var e=t.data,n=t.item,r=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(r,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'')),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":M.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||u.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||u.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e
').append(o),l.setStartAfter(u[0].firstChild.firstChild),l.setEndAfter(o)):(u.empty().append(_o).append(o).append(_o),l.setStart(u[0].firstChild,1),l.setEnd(u[0].lastChild,0)),u.css({top:r.getPos(e,t.getBody()).y}),u[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(l),l}(o,a.targetClone,i),c=Ne.fromDom(o);return V(qs(Ne.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Pe(c,t)||rr(t,u)})),r.getAttrib(o,u)||o.setAttribute(u,"1"),e=o,w(),l},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=fc(n,i,t),a=o.getNode(!e);if(zl(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(zl(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var u=t.startContainer,c=t.startOffset,f=t.endOffset;if(3===u.nodeType&&0===c&&Hx(u.parentNode)&&(u=u.parentNode,c=r.nodeIndex(u),u=u.parentNode),1!==u.nodeType)return null;if(f===c+1&&u===t.endContainer){var d=u.childNodes[c];if(l(d))return v(d)}return null},_=function(){e&&e.removeAttribute(u),Qr(Ne.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!ty(t)&&function(){t.on("mouseup",(function(e){var n=d();n.collapsed&&_b(t,e.clientX,e.clientY)&&I_(t,n,!1).each(f)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Hx(o)&&(e.preventDefault(),t.focus()),zx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var u=function(e,n){var i,a,s=r.getParent(e,o),u=r.getParent(n,o);return!y(s)&&(!(e===u||!r.isChildOf(s,u)||!1!==Hx(Vx(t,s)))||!r.isChildOf(u,s)&&(i=s,a=u,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Du.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=Ec(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Hx(r)?(e.preventDefault(),L_(t,r).each(b)):l(n)&&L_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==_b(t,e.clientX,e.clientY)){var a=Vx(t,o);if(a)Hx(a)?(e.preventDefault(),L_(t,a).each(b)):(_(),zx(a)&&e.shiftKey||rd(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(l(o))L_(t,o).each(b);else if(!1===zl(o)){_(),w();var s=nk(i,e.clientX,e.clientY);if(s&&!u(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);f(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){sd.modifierPressed(t)||Hx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Ce.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Ux(t),function(t){var e=Ns((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=P_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=nd(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&L_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(jo(t),f(d()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Kx=function(t){var e,n,r=Ae.each,o=sd.BACKSPACE,i=sd.DELETE,a=t.dom,s=t.selection,u=t.parser,l=Ce.gecko,c=Ce.ie,f=Ce.webkit,d="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,u=n.keyCode;if(!m(n)&&(u===i||u===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Ao(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},C=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),yl(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},E=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},O=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Ce.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},A=function(){Ce.mac&&t.on("keydown",(function(e){!sd.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},T=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},N=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},D=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=d+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(d)>=0?(e=e.substr(d.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=fd(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},L=k;return ty(t)?(f&&(y(),_(),N(),v(),Ce.iOS&&(E(),O(),T())),l&&(b(),C(),S(),A())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===sd.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,u=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==u;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),Ce.windowsPhone||t.on("keyup focusin mouseup",(function(t){sd.modifierPressed(t)||s.normalize()}),!0),f&&(y(),_(),ol(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ol(t))})),N(),w(),u.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(E(),O(),T()):v()),Ce.ie>=11&&(O(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),D()),l&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),C(),x(),S(),A(),w())),{refreshContentEditable:L,isHidden:function(){if(!l||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Yx=ys.DOM,Zx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gx=function(t){return vt(t,(function(t){return!1===v(t)}))},Xx=function(t){var e=t.settings;return Gx({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Qx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Zx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Jx=function(t){var e=t.dom.getRoot();t.inline||Vf(t)&&t.selection.getStart(!0)!==e||Mc(e).each((function(e){var n=e.getNode(),r=Rn(n)?Mc(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=Ne.fromDom(t.getBody()),r=(ih(t)?M.from(e):M.none()).map(ah).filter(oh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},tS=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Jx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},eS=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},nS=function(t){var e=eS(t),n=vl(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";Ae.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return eS(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ne.fromDom(t.getBody()),r=un(sn(n)),o=Ne.fromTag("style");Jn(o,"type","text/css"),pn(o,Ne.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},rS=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Yx.setAttrib(r,"spellcheck","false")),t.quirks=Kx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Os.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){Ae.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},oS=function(t){!0!==t.removed&&(!function(t){ty(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),tS(t))},iS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Yx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Yx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Fb(t),t.schema=Di(Xx(t)),t.dom=ys(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hl(t),referrerPolicy:pl(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Dy(Qx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new jh("br",1)).shortEnded=!0)}})),e}(t),t.serializer=Ry(function(t){var e=t.settings;return Nt(Nt(Nt({},Qx(t)),Xx(t)),Gx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=hy(t.dom,t.getWin(),t.serializer,t),t.annotator=td(t),t.formatter=Yb(t),t.undoManager=Gb(t),t._nodeChangeDispatcher=new Ax(t),t._selectionOverrides=Wx(t),Bk(t),Tx(t),ty(t)||Dx(t);var a=function(t){return ty(t)?Cs(null):Ox(t)}(t);Mk(t,a),function(t){ol(t)&&t.on("NodeChange",A(zk,t))}(t),e_(t);var s=ey(t);rS(t),s.fold((function(){nS(t).then((function(){return oS(t)}))}),(function(e){t.setProgressState(!0),nS(t).then((function(){e().then((function(e){t.setProgressState(!1),oS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),oS(t)}))}))}))},aS=ys.DOM,sS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^ \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s* \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s* \s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||u.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||u.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.emojiSearchKey="",this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.searchEmoji(t),e.emojiQuickItems=[],window.emoticonData.some((function(n){var r=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(r&&(e.emojiQuickItems.push({data:n,item:r}),e.emojiQuickItems.length>=2))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},searchEmoji:function(t){var e=this;this.emojiSearchKey=t,this.emojiSearchTimer&&clearTimeout(this.emojiSearchTimer),this.emojiSearchTimer=setTimeout((function(n){e.emojiSearchKey===t&&e.$store.dispatch("call",{url:"../emo/search",data:{key:t}}).then((function(n){var r=n.data;if(e.emojiSearchKey===t){var o=3;e.windowWidth>1e3?o=5:e.windowWidth>900&&(o=4);var i,a=e.getRandomArrayElements(r.map((function(t){return{data:{},item:{type:"online",name:e.$L("动画表情"),src:e.asciiConvertNative(t)}}})),o-e.emojiQuickItems.length);if(a.length>0)(i=e.emojiQuickItems).push.apply(i,$(a)),e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}}))}),800)},asciiConvertNative:function(t){for(var e=t.split("\\u"),n=e[0],r=1;r'));else{var r=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(r,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'
'))}this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":M.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
').append(o),u.setStartAfter(l[0].firstChild.firstChild),u.setEndAfter(o)):(l.empty().append(_o).append(o).append(_o),u.setStart(l[0].firstChild,1),u.setEnd(l[0].lastChild,0)),l.css({top:r.getPos(e,t.getBody()).y}),l[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(u),u}(o,a.targetClone,i),c=Ae.fromDom(o);return V(qs(Ae.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){$e(c,t)||rr(t,l)})),r.getAttrib(o,l)||o.setAttribute(l,"1"),e=o,w(),u},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=dc(n,i,t),a=o.getNode(!e);if(zu(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(zu(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var l=t.startContainer,c=t.startOffset,d=t.endOffset;if(3===l.nodeType&&0===c&&Hx(l.parentNode)&&(l=l.parentNode,c=r.nodeIndex(l),l=l.parentNode),1!==l.nodeType)return null;if(d===c+1&&l===t.endContainer){var f=l.childNodes[c];if(u(f))return v(f)}return null},_=function(){e&&e.removeAttribute(l),Qr(Ae.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!ty(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&_b(t,e.clientX,e.clientY)&&I_(t,n,!1).each(d)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Hx(o)&&(e.preventDefault(),t.focus()),zx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var l=function(e,n){var i,a,s=r.getParent(e,o),l=r.getParent(n,o);return!y(s)&&(!(e===l||!r.isChildOf(s,l)||!1!==Hx(Vx(t,s)))||!r.isChildOf(l,s)&&(i=s,a=l,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Ll.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=Oc(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Hx(r)?(e.preventDefault(),N_(t,r).each(b)):u(n)&&N_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==_b(t,e.clientX,e.clientY)){var a=Vx(t,o);if(a)Hx(a)?(e.preventDefault(),N_(t,a).each(b)):(_(),zx(a)&&e.shiftKey||nf(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(u(o))N_(t,o).each(b);else if(!1===zu(o)){_(),w();var s=nk(i,e.clientX,e.clientY);if(s&&!l(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);d(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){sf.modifierPressed(t)||Hx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Ce.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Fx(t),function(t){var e=As((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=$_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=ef(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&N_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Po(t),d(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Kx=function(t){var e,n,r=De.each,o=sf.BACKSPACE,i=sf.DELETE,a=t.dom,s=t.selection,l=t.parser,u=Ce.gecko,c=Ce.ie,d=Ce.webkit,f="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,l=n.keyCode;if(!m(n)&&(l===i||l===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Do(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},C=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),yu(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Ce.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},D=function(){Ce.mac&&t.on("keydown",(function(e){!sf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},T=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},L=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=f+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(f)>=0?(e=e.substr(f.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=df(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},N=k;return ty(t)?(d&&(y(),_(),A(),v(),Ce.iOS&&(O(),E(),T())),u&&(b(),C(),S(),D())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===sf.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,l=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==l;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),Ce.windowsPhone||t.on("keyup focusin mouseup",(function(t){sf.modifierPressed(t)||s.normalize()}),!0),d&&(y(),_(),ou(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ou(t))})),A(),w(),l.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(O(),E(),T()):v()),Ce.ie>=11&&(E(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),L()),u&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),C(),x(),S(),D(),w())),{refreshContentEditable:N,isHidden:function(){if(!u||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Yx=ys.DOM,Zx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gx=function(t){return vt(t,(function(t){return!1===v(t)}))},Xx=function(t){var e=t.settings;return Gx({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Qx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Zx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Jx=function(t){var e=t.dom.getRoot();t.inline||Hd(t)&&t.selection.getStart(!0)!==e||Mc(e).each((function(e){var n=e.getNode(),r=jn(n)?Mc(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=Ae.fromDom(t.getBody()),r=(ih(t)?M.from(e):M.none()).map(ah).filter(oh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},tS=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Jx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},eS=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},nS=function(t){var e=eS(t),n=vu(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";De.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return eS(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ae.fromDom(t.getBody()),r=ln(sn(n)),o=Ae.fromTag("style");Jn(o,"type","text/css"),pn(o,Ae.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},rS=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Yx.setAttrib(r,"spellcheck","false")),t.quirks=Kx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Es.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){De.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},oS=function(t){!0!==t.removed&&(!function(t){ty(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),tS(t))},iS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Yx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Yx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Ub(t),t.schema=Li(Xx(t)),t.dom=ys(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hu(t),referrerPolicy:pu(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Ly(Qx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Ph("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jy(function(t){var e=t.settings;return At(At(At({},Qx(t)),Xx(t)),Gx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=hy(t.dom,t.getWin(),t.serializer,t),t.annotator=Jd(t),t.formatter=Yb(t),t.undoManager=Gb(t),t._nodeChangeDispatcher=new Dx(t),t._selectionOverrides=Wx(t),Bk(t),Tx(t),ty(t)||Lx(t);var a=function(t){return ty(t)?Cs(null):Ex(t)}(t);Mk(t,a),function(t){ou(t)&&t.on("NodeChange",D(zk,t))}(t),e_(t);var s=ey(t);rS(t),s.fold((function(){nS(t).then((function(){return oS(t)}))}),(function(e){t.setProgressState(!0),nS(t).then((function(){e().then((function(e){t.setProgressState(!1),oS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),oS(t)}))}))}))},aS=ys.DOM,sS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.emojiQuickItems=[],window.emoticonData.some((function(n){var r=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(r&&(e.emojiQuickItems.push({data:n,item:r}),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),r=this.dialogInputCache.findIndex((function(t){return t.key==n})),o={key:n,cache:t};r>-1?this.$store.state.dialogInputCache.splice(r,1,o):this.$store.state.dialogInputCache.push(o),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(M.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,r){e.recordRec.close(),!0!==t&&(r<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(r)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showEmoji=!1,this.showMore=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){var e=t.data,n=t.item,r=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(r,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'')),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":M.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e
').append(o),u.setStartAfter(l[0].firstChild.firstChild),u.setEndAfter(o)):(l.empty().append(_o).append(o).append(_o),u.setStart(l[0].firstChild,1),u.setEnd(l[0].lastChild,0)),l.css({top:r.getPos(e,t.getBody()).y}),l[0].focus();var c=n.getSel();return c.removeAllRanges(),c.addRange(u),u}(o,a.targetClone,i),c=Ae.fromDom(o);return V(qs(Ae.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){$e(c,t)||rr(t,l)})),r.getAttrib(o,l)||o.setAttribute(l,"1"),e=o,w(),u},b=function(t,e){if(!t)return null;if(t.collapsed){if(!m(t)){var n=e?1:-1,o=dc(n,i,t),a=o.getNode(!e);if(zu(a))return h(n,a,!!e&&!o.isAtEnd(),!1);var s=o.getNode(e);if(zu(s))return h(n,s,!e&&!o.isAtEnd(),!1)}return null}var l=t.startContainer,c=t.startOffset,d=t.endOffset;if(3===l.nodeType&&0===c&&Hx(l.parentNode)&&(l=l.parentNode,c=r.nodeIndex(l),l=l.parentNode),1!==l.nodeType)return null;if(d===c+1&&l===t.endContainer){var f=l.childNodes[c];if(u(f))return v(f)}return null},_=function(){e&&e.removeAttribute(l),Qr(Ae.fromDom(t.getBody()),"#"+s).each(vn),e=null},w=function(){a.hide()};return Ce.ceFalse&&!ty(t)&&function(){t.on("mouseup",(function(e){var n=f();n.collapsed&&_b(t,e.clientX,e.clientY)&&I_(t,n,!1).each(d)})),t.on("click",(function(e){var o=Vx(t,e.target);o&&(Hx(o)&&(e.preventDefault(),t.focus()),zx(o)&&r.isChildOf(o,n.getNode())&&_())})),t.on("blur NewBlock",_),t.on("ResizeWindow FullscreenStateChanged",a.reposition);var l=function(e,n){var i,a,s=r.getParent(e,o),l=r.getParent(n,o);return!y(s)&&(!(e===l||!r.isChildOf(s,l)||!1!==Hx(Vx(t,s)))||!r.isChildOf(l,s)&&(i=s,a=l,!(r.getParent(i,o)===r.getParent(a,o)))&&function(t){var e=t.firstChild;if(y(e))return!1;var n=Ll.before(e);if(zn(n.getNode())&&1===t.childNodes.length)return!c(n);var r=Oc(t).next(n);return r&&!c(r)}(s))};t.on("tap",(function(e){var n=e.target,r=Vx(t,n);Hx(r)?(e.preventDefault(),N_(t,r).each(b)):u(n)&&N_(t,n).each(b)}),!0),t.on("mousedown",(function(e){var o=e.target;if((o===i||"HTML"===o.nodeName||r.isChildOf(o,i))&&!1!==_b(t,e.clientX,e.clientY)){var a=Vx(t,o);if(a)Hx(a)?(e.preventDefault(),N_(t,a).each(b)):(_(),zx(a)&&e.shiftKey||nf(e.clientX,e.clientY,n.getRng())||(w(),n.placeCaretAt(e.clientX,e.clientY)));else if(u(o))N_(t,o).each(b);else if(!1===zu(o)){_(),w();var s=nk(i,e.clientX,e.clientY);if(s&&!l(o,s.node)){e.preventDefault();var c=h(1,s.node,s.before,!1);d(c),t.getBody().focus()}}}})),t.on("keypress",(function(t){sf.modifierPressed(t)||Hx(n.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var n=t.range;if(e){if(!e.parentNode)return void(e=null);(n=n.cloneRange()).selectNode(e),t.range=n}})),t.on("SetSelectionRange",(function(t){t.range=g(t.range);var e=b(t.range,t.forward);e&&(t.range=e)})),t.on("AfterSetSelectionRange",(function(t){var e,n=t.range,o=n.startContainer.parentNode;m(n)||"mcepastebin"===o.id||w(),e=o,r.hasClass(e,"mce-offscreen-selection")||_()})),t.on("copy",(function(t){var e,n=t.clipboardData;if(!t.isDefaultPrevented()&&t.clipboardData&&!Ce.ie){var o=(e=r.get(s))?e.getElementsByTagName("*")[0]:e;o&&(t.preventDefault(),n.clearData(),n.setData("text/html",o.outerHTML),n.setData("text/plain",o.outerText||o.innerText))}})),Fx(t),function(t){var e=As((function(){if(!t.removed&&t.getBody().contains(document.activeElement)){var e=t.selection.getRng();if(e.collapsed){var n=$_(t,e,!1);t.selection.setRng(n)}}}),0);t.on("focus",(function(){e.throttle()})),t.on("blur",(function(){e.cancel()}))}(t),function(t){t.on("init",(function(){t.on("focusin",(function(e){var n=e.target;if(Yn(n)){var r=ef(t.getBody(),n),o=Wn(r)?r:n;t.selection.getNode()!==o&&N_(t,o).each((function(e){return t.selection.setRng(e)}))}}))}))}(t)}(),{showCaret:h,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Po(t),d(f()),n.scrollIntoView(t))},hideFakeCaret:w,destroy:function(){a.destroy(),e=null}}},Kx=function(t){var e,n,r=De.each,o=sf.BACKSPACE,i=sf.DELETE,a=t.dom,s=t.selection,l=t.parser,u=Ce.gecko,c=Ce.ie,d=Ce.webkit,f="data:text/mce-internal,",h=c?"Text":"URL",p=function(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(t){}},m=function(t){return t.isDefaultPrevented()},g=function(){var e=function(t){var e=a.create("body"),n=t.cloneContents();return e.appendChild(n),s.serializer.serialize(e,{format:"html"})};t.on("keydown",(function(n){var r,s,l=n.keyCode;if(!m(n)&&(l===i||l===o)){if(r=t.selection.isCollapsed(),s=t.getBody(),r&&!a.isEmpty(s))return;if(!r&&!function(n){var r=e(n),o=a.createRng();return o.selectNode(t.getBody()),r===e(o)}(t.selection.getRng()))return;n.preventDefault(),t.setContent(""),s.firstChild&&a.isBlock(s.firstChild)?t.selection.setCursorLocation(s.firstChild,0):t.selection.setCursorLocation(s,0),t.nodeChanged()}}))},v=function(){t.shortcuts.add("meta+a",null,"SelectAll")},y=function(){t.inline||a.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;if(e.target===t.getDoc().documentElement)if(n=s.getRng(),t.getBody().focus(),"mousedown"===e.type){if(Do(n.startContainer))return;s.placeCaretAt(e.clientX,e.clientY)}else s.setRng(n)}))},b=function(){Range.prototype.getClientRects||t.on("mousedown",(function(e){if(!m(e)&&"HTML"===e.target.nodeName){var n=t.getBody();n.blur(),oo.setEditorTimeout(t,(function(){n.focus()}))}}))},_=function(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==a.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&a.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),s.select(n))}))},w=function(){t.on("keydown",(function(t){if(!m(t)&&t.keyCode===o&&s.isCollapsed()&&0===s.getRng().startOffset){var e=s.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))},C=function(){(function(t){return t.getParam("readonly")})(t)||t.on("BeforeExecCommand mousedown",(function(){p("StyleWithCSS",!1),p("enableInlineTableEditing",!1),yu(t)||p("enableObjectResizing",!1)}))},x=function(){t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||r(a.select("a"),(function(t){var e=t.parentNode,n=a.getRoot();if(e.lastChild===t){for(;e&&!a.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}a.add(e,"br",{"data-mce-bogus":1})}}))}))},S=function(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},O=function(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))},E=function(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;if("HTML"===e.target.nodeName){if(Ce.ie>11)return void t.getBody().focus();n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()}})))},D=function(){Ce.mac&&t.on("keydown",(function(e){!sf.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))},T=function(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},A=function(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))},L=function(){t.on("dragstart",(function(e){!function(e){var n,r;e.dataTransfer&&(t.selection.isCollapsed()&&"IMG"===e.target.tagName&&s.select(e.target),(n=t.selection.getContent()).length>0&&(r=f+escape(t.id)+","+escape(n),e.dataTransfer.setData(h,r)))}(e)})),t.on("drop",(function(e){if(!m(e)){var n=function(t){var e;return t.dataTransfer&&(e=t.dataTransfer.getData(h))&&e.indexOf(f)>=0?(e=e.substr(f.length).split(","),{id:unescape(e[0]),html:unescape(e[1])}):null}(e);if(n&&n.id!==t.id){e.preventDefault();var r=df(e.x,e.y,t.getDoc());s.setRng(r),o=n.html,i=!0,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:o,internal:i}):t.execCommand("mceInsertContent",!1,o)}}var o,i}))},N=k;return ty(t)?(d&&(y(),_(),A(),v(),Ce.iOS&&(O(),E(),T())),u&&(b(),C(),S(),D())):(t.on("keydown",(function(e){var n,r;if(!m(e)&&e.keyCode===sf.BACKSPACE){var o=(n=s.getRng()).startContainer,i=n.startOffset,l=a.getRoot();if(r=o,n.collapsed&&0===i){for(;r&&r.parentNode&&r.parentNode.firstChild===r&&r.parentNode!==l;)r=r.parentNode;"BLOCKQUOTE"===r.tagName&&(t.formatter.toggle("blockquote",null,r),(n=a.createRng()).setStart(o,0),n.setEnd(o,0),s.setRng(n))}}})),g(),Ce.windowsPhone||t.on("keyup focusin mouseup",(function(t){sf.modifierPressed(t)||s.normalize()}),!0),d&&(y(),_(),ou(t)&&t.on("init",(function(){p("DefaultParagraphSeparator",ou(t))})),A(),w(),l.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),Ce.iOS?(O(),E(),T()):v()),Ce.ie>=11&&(E(),w()),Ce.ie&&(v(),p("AutoUrlDetect",!1),L()),u&&(t.on("keydown",(function(e){if(!m(e)&&e.keyCode===o){if(!t.getBody().getElementsByTagName("hr").length)return;if(s.isCollapsed()&&0===s.getRng().startOffset){var n=s.getNode(),r=n.previousSibling;if("HR"===n.nodeName)return a.remove(n),void e.preventDefault();r&&r.nodeName&&"hr"===r.nodeName.toLowerCase()&&(a.remove(r),e.preventDefault())}}})),b(),e=function(){var e=a.getAttribs(s.getStart().cloneNode(!1));return function(){var n=s.getStart();n!==t.getBody()&&(a.setAttrib(n,"style",null),r(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}},n=function(){return!s.isCollapsed()&&a.getParent(s.getStart(),a.isBlock)!==a.getParent(s.getEnd(),a.isBlock)},t.on("keypress",(function(r){var o;if(!m(r)&&(8===r.keyCode||46===r.keyCode)&&n())return o=e(),t.getDoc().execCommand("delete",!1,null),o(),r.preventDefault(),!1})),a.bind(t.getDoc(),"cut",(function(r){var o;!m(r)&&n()&&(o=e(),oo.setEditorTimeout(t,(function(){o()})))})),C(),x(),S(),D(),w())),{refreshContentEditable:N,isHidden:function(){if(!u||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}}},Yx=ys.DOM,Zx=function(t){return t.inline?t.getElement().nodeName.toLowerCase():void 0},Gx=function(t){return vt(t,(function(t){return!1===v(t)}))},Xx=function(t){var e=t.settings;return Gx({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})},Qx=function(t){var e=t.settings,n=t.editorUpload.blobCache;return Gx({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:Zx(t),validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})},Jx=function(t){var e=t.dom.getRoot();t.inline||Hd(t)&&t.selection.getStart(!0)!==e||Mc(e).each((function(e){var n=e.getNode(),r=jn(n)?Mc(n).getOr(e):e;Ce.browser.isIE()?function(t,e){var n=Ae.fromDom(t.getBody()),r=(ih(t)?M.from(e):M.none()).map(ah).filter(oh(n));t.bookmark=r.isSome()?r:t.bookmark}(t,r.toRange()):t.selection.setRng(r.toRange())}))},tS=function(t){t.bindPendingEventDelegates(),t.initialized=!0,function(t){t.fire("Init")}(t),t.focus(!0),Jx(t),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),function(t){t.settings.auto_focus&&oo.setEditorTimeout(t,(function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()}),100)}(t)},eS=function(t){return t.inline?t.ui.styleSheetLoader:t.dom.styleSheetLoader},nS=function(t){var e=eS(t),n=vu(t),r=t.contentCSS,o=function(){e.unloadAll(r),t.inline||t.ui.styleSheetLoader.unloadAll(n)},i=function(){t.removed?o():t.on("remove",o)};if(t.contentStyles.length>0){var a="";De.each(t.contentStyles,(function(t){a+=t+"\r\n"})),t.dom.addStyle(a)}var s=to.all(function(t,e,n){var r=[new to((function(n,r){return eS(t).loadAll(e,n,r)}))];return t.inline?r:r.concat([new to((function(e,r){return t.ui.styleSheetLoader.loadAll(n,e,r)}))])}(t,r,n)).then(i).catch(i);return t.settings.content_style&&function(t,e){var n=Ae.fromDom(t.getBody()),r=ln(sn(n)),o=Ae.fromTag("style");Jn(o,"type","text/css"),pn(o,Ae.fromText(e)),pn(r,o),t.on("remove",(function(){vn(o)}))}(t,t.settings.content_style),s},rS=function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();!function(t){t.fire("PreInit")}(t),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Yx.setAttrib(r,"spellcheck","false")),t.quirks=Kx(t),function(t){t.fire("PostRender")}(t);var o=function(t){return t.getParam("directionality",Es.isRtl()?"rtl":void 0)}(t);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){De.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))},oS=function(t){!0!==t.removed&&(!function(t){ty(t)||t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"})}(t),tS(t))},iS=function(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Yx.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i=t.getBody();i.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Yx.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable=t.getParam("content_editable_state",!0)),i.disabled=!1,t.editorUpload=Ub(t),t.schema=Li(Xx(t)),t.dom=ys(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:hu(t),referrerPolicy:pu(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=function(t){var e=Ly(Qx(t),t.schema);return e.addAttributeFilter("src,href,style,tabindex",(function(e,n){for(var r,o,i=e.length,a=t.dom,s="data-mce-"+n;i--;)if((o=(r=e[i]).attr(n))&&!r.attr(s)){if(0===o.indexOf("data:")||0===o.indexOf("blob:"))continue;"style"===n?((o=a.serializeStyle(a.parseStyle(o),r.name)).length||(o=null),r.attr(s,o),r.attr(n,o)):"tabindex"===n?(r.attr(s,o),r.attr(n,null)):r.attr(s,t.convertURL(o,n,r.name))}})),e.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),t.settings.preserve_cdata&&e.addNodeFilter("#cdata",(function(e){for(var n=e.length;n--;){var r=e[n];r.type=8,r.name="#comment",r.value="[CDATA["+t.dom.encode(r.value)+"]]"}})),e.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(e){for(var n=e.length,r=t.schema.getNonEmptyElements();n--;){var o=e[n];o.isEmpty(r)&&0===o.getAll("br").length&&(o.append(new Ph("br",1)).shortEnded=!0)}})),e}(t),t.serializer=jy(function(t){var e=t.settings;return At(At(At({},Qx(t)),Xx(t)),Gx({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope,element_format:e.element_format,entities:e.entities,entity_encoding:e.entity_encoding,indent:e.indent,indent_after:e.indent_after,indent_before:e.indent_before}))}(t),t),t.selection=hy(t.dom,t.getWin(),t.serializer,t),t.annotator=Jd(t),t.formatter=Yb(t),t.undoManager=Gb(t),t._nodeChangeDispatcher=new Dx(t),t._selectionOverrides=Wx(t),Bk(t),Tx(t),ty(t)||Lx(t);var a=function(t){return ty(t)?Cs(null):Ex(t)}(t);Mk(t,a),function(t){ou(t)&&t.on("NodeChange",D(zk,t))}(t),e_(t);var s=ey(t);rS(t),s.fold((function(){nS(t).then((function(){return oS(t)}))}),(function(e){t.setProgressState(!0),nS(t).then((function(){e().then((function(e){t.setProgressState(!1),oS(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),oS(t)}))}))}))},aS=ys.DOM,sS=function(t){var e=function(t){return t.getParam("doctype","")}(t)+"";(function(t){return t.getParam("document_base_url","")})(t)!==t.documentBaseUrl&&(e+='
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(r.text))&&i.push("transparent"),i},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,r=[];return"text"===e&&(/^ \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?r.push("three-emoji"):/^\s* \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?r.push("two-emoji"):/^\s* \s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&r.push("an-emoji")),r}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var r=e,o=n;return(e>220||n>220)&&(e>n?(r=220,o=n*(220/e)):(r=e*(220/n),o=220)),{width:r+"px",height:o+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var r=t.quill.getText(n.index);/^\n\n$/.test(r)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,r,o,i,a){t.recordWave.input(e[e.length-1],n,o),t.recordDuration=r,r>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.emojiSearchKey="",this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.searchEmoji(t),e.emojiQuickItems=[],window.emoticonData.some((function(n){var r=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(r&&(e.emojiQuickItems.push({data:n,item:r}),e.emojiQuickItems.length>=2))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},searchEmoji:function(t){var e=this;this.emojiSearchKey=t,this.emojiSearchTimer&&clearTimeout(this.emojiSearchTimer),this.emojiSearchTimer=setTimeout((function(n){e.emojiSearchKey===t&&e.$store.dispatch("call",{url:"../emo/search",data:{key:t}}).then((function(n){var r=n.data;if(e.emojiSearchKey===t){var o=3;e.windowWidth>1e3?o=5:e.windowWidth>900&&(o=4);var i,a=e.getRandomArrayElements(r.map((function(t){return{data:{},item:{type:"online",name:e.$L("动画表情"),src:e.asciiConvertNative(t)}}})),o-e.emojiQuickItems.length);if(a.length>0)(i=e.emojiQuickItems).push.apply(i,R(a)),e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()}))}}))}),800)},asciiConvertNative:function(t){for(var e=t.split("\\u"),n=e[0],r=1;r'));else{var r=$A.apiUrl("../images/emoticon"),o={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(r,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'
'))}this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":M.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
]*?>$/.test(n.text)?r.push("an-emoticon"):/^\s*
\s*<\/p>)+|(
\s*<\/p>)+$/gi,"")).replace(/^(
<\/p>)+|(
<\/p>)+$/gi,""),t.updateEmojiQuick(n),t._content=n,t.$emit("input",t._content),t.$nextTick((function(e){var n=t.quill.getSelection();if(n){var o=t.quill.getText(n.index);/^\n\n$/.test(o)&&t.quill.deleteText(n.index,1)}}))})),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(function(t,e){return e.ops=e.ops.map((function(t){var e={attributes:{},insert:t.insert};return t.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some((function(n){t.attributes[n]&&(e.attributes[n]=t.attributes[n])})),e})),e})),this.$emit("on-ready",this.quill),this.disabledRecord||$A.loadScriptS(["js/recorder/recorder.mp3.min.js","js/recorder/lib.fft.js","js/recorder/frequency.histogram.view.js"],(function(e){null===e&&"function"==typeof window.Recorder&&(t.recordRec=window.Recorder({type:"mp3",bitRate:32,sampleRate:16e3,onProcess:function(e,n,o,i,r,a){t.recordWave.input(e[e.length-1],n,i),t.recordDuration=o,o>=18e4&&t.stopRecord(!1)}}),window.Recorder.Support()&&(t.recordReady=!0,t.$nextTick((function(e){t.recordWave=window.Recorder.FrequencyHistogramView({elem:t.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1})}))))}))},updateEmojiQuick:function(t){var e=this;this.isFocus&&t?(this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout((function(n){(t=(t=t.replace(/ /g," ")).replace(/<[^>]+>/g,""))&&-1===t.indexOf(" ")&&t.length>=1&&t.length<=8&&$A.isArray(window.emoticonData)&&(e.emojiQuickItems=[],window.emoticonData.some((function(n){var o=n.list.find((function(e){var n=e.name;return $A.strExists(n,t)}));if(o&&(e.emojiQuickItems.push({data:n,item:o}),e.emojiQuickItems.length>=3))return!0})),e.emojiQuickItems.length>0)?e.$nextTick((function(t){e.emojiQuickShow=!0,e.$refs.emojiQuickRef.updatePopper()})):e.emojiQuickShow=!1}),100)):this.emojiQuickShow=!1},setText:function(t){this.quill&&this.quill.setText(t)},setContent:function(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},getInputCache:function(){var t=this.dialogId||"t_".concat(this.taskId),e=this.dialogInputCache.find((function(e){return e.key==t}));return e?e.cache:""},setInputCache:function(t){var e=this,n=this.dialogId||"t_".concat(this.taskId),o=this.dialogInputCache.findIndex((function(t){return t.key==n})),i={key:n,cache:t};o>-1?this.$store.state.dialogInputCache.splice(o,1,i):this.$store.state.dialogInputCache.push(i),this.__setInputCache&&clearTimeout(this.__setInputCache),this.__setInputCache=setTimeout((function(t){$A.setStorage("cacheDialogInput",e.$store.state.dialogInputCache)}),600)},onClickEditor:function(){this.updateEmojiQuick(this.value)},focus:function(){var t=this;this.$nextTick((function(){t.quill&&(t.quill.setSelection(t.quill.getLength()),t.quill.focus())}))},blur:function(){var t=this;this.$nextTick((function(){t.quill&&t.quill.blur()}))},clickSend:function(t,e){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart="touchstart"===e.type?e.touches[0]:e,this.startRecord())return;break;case"move":var n="touchmove"===e.type?e.touches[0]:e;this.touchLimitX=(this.touchStart.clientX-n.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-n.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY))return;if(this.touchLimitY||this.touchLimitX)return;this.onSend()}},onSend:function(){this.rangeIndex=0,this.$emit("on-send")},startRecord:function(){var t=this;return"recorder"===this.sendClass&&(M.Store.set("audioSubscribe",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick((function(e){t.recordRec.open((function(e){"ready"===t.recordState?(t.recordState="ing",t.recordBlob=null,setTimeout((function(e){t.recordRec.start()}),300)):t.recordRec.close()}),(function(e){t.recordState="stop",$A.messageError(e||"打开录音失败")}))})),!0)},stopRecord:function(t){var e=this;switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((function(n,o){e.recordRec.close(),!0!==t&&(o<600?$A.messageWarning("说话时间太短"):(e.recordBlob=n,e.uploadRecord(o)))}),(function(t){e.recordRec.close(),$A.messageError(t||"录音失败")})),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover:function(){this.showEmoji=!1,this.showMore=!1},onClickCover:function(){var t=this;this.hidePopover(),this.$nextTick((function(e){var n;null===(n=t.quill)||void 0===n||n.focus()}))},uploadRecord:function(t){var e=this;if(null!==this.recordBlob){var n=new FileReader;n.onloadend=function(){e.$emit("on-record",{type:e.recordBlob.type,base64:n.result,duration:t})},n.readAsDataURL(this.recordBlob)}},onEmojiQuick:function(t){var e=t.data,n=t.item,o=$A.apiUrl("../images/emoticon"),i={asset:"images/emoticon/".concat(e.path,"/").concat(n.path),name:n.name,src:"".concat(o,"/").concat(e.path,"/").concat(n.path)};this.$emit("input",""),this.$emit("on-send",'')),this.emojiQuickShow=!1,this.focus()},onSelectEmoji:function(t){if(this.quill)if("emoji"===t.type){var e=document.createElement("span");e.innerHTML=t.html,this.quill.insertText(this.rangeIndex,e.innerHTML),this.rangeIndex+=e.innerHTML.length,e=null,this.windowLarge&&(this.showEmoji=!1,this.quill.setSelection(this.rangeIndex))}else"emoticon"===t.type&&(this.$emit("on-send",'
')),this.windowLarge&&(this.showEmoji=!1))},onCancelReply:function(){this.$emit("on-cancel-reply")},onToolbar:function(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":M.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"call":case"image":case"file":this.$emit("on-more",t)}},onMoreVisibleChange:function(t){this.showMore=t},openMenu:function(t){if(this.quill)if(0===this.value.length||this.value.endsWith("
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(o.text))&&r.push("transparent"),r},contentClass:function(){var t=this.msgData,e=t.type,n=t.msg,o=[];return"text"===e&&(/^]*?>$/.test(n.text)?o.push("an-emoticon"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(n.text)?o.push("three-emoji"):/^\s*
\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(n.text)?o.push("two-emoji"):/^\s*
\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(n.text)&&o.push("an-emoji")),o}}),watch:{operateAction:function(t){var e=this;this.operateEnter=!1,t&&setTimeout((function(t){return e.operateEnter=!0}),500)}},methods:{handleLongpress:function(t,e){this.$emit("on-longpress",{event:t,el:e,msgData:this.msgData})},openTodo:function(){var t=this;this.todoLoad>0||(this.todoShow?this.todoShow=!1:(this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.todoList=n})).catch((function(){t.todoList=[]})).finally((function(e){setTimeout((function(){t.todoLoad--,t.todoShow=!0}),100)}))))},openReadPercentage:function(){var t=this;this.percentageLoad>0||(this.percentageShow?this.percentageShow=!1:(this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then((function(e){var n=e.data;t.percentageList=n})).catch((function(){t.percentageList=[]})).finally((function(e){setTimeout((function(){t.percentageLoad--,t.percentageShow=!0}),100)}))))},recordStyle:function(t){var e=t.duration;return{width:50+Math.min(180,Math.floor(e/150))+"px"}},recordDuration:function(t){var e=Math.floor(t/6e4),n=Math.floor(t/1e3)%60;return e>0?"".concat(e,":").concat(n,"″"):"".concat(Math.max(1,n),"″")},imageStyle:function(t){var e=t.width,n=t.height;if(e&&n){var o=e,i=n;return(e>220||n>220)&&(e>n?(o=220,i=n*(220/e)):(o=e*(220/n),i=220)),{width:o+"px",height:i+"px"}}return{}},playRecord:function(){this.operateVisible||l.Store.set("audioSubscribe",{id:this.msgData.id,src:this.msgData.msg.path})},openMeeting:function(){this.operateVisible||l.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply:function(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText:function(t){this.$emit("on-view-text",t)},viewFile:function(){this.$emit("on-view-file",this.msgData)},downFile:function(){this.$emit("on-down-file",this.msgData)},replyList:function(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError:function(){this.$emit("on-error",this.msgData)},onEmoji:function(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser:function(t){this.$emit("on-show-emoji-user",t)}}};function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function p(t){for(var e=1;e
n&&h
".concat(this.$L("总数量"),": ").concat(t.task_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_complete,"
"),e+=''.concat(this.$L("我的任务"),"
"),e+="".concat(this.$L("总数量"),": ").concat(t.task_my_num,"
"),e+="".concat(this.$L("已完成"),": ").concat(t.task_my_complete,"
"),$A.modalInfo({language:!1,title:"".concat(t.name," ").concat(this.$L("项目进度")),content:e})}},handleLongpress:function(t,e){var n=this,o=$A.getAttr(e,"data-id"),i=this.projectLists.find((function(t){return t.id==o}));i&&(this.operateVisible=!1,this.operateItem=$A.isJson(i)?i:{},this.$nextTick((function(){var o=e.getBoundingClientRect(),i=n.$el.getBoundingClientRect();n.operateStyles={left:"".concat(t.clientX-i.left,"px"),top:"".concat(o.top+n.windowScrollY,"px"),height:o.height+"px"},n.operateVisible=!0})))},handleTopClick:function(){var t=this;this.$store.dispatch("call",{url:"project/top",data:{project_id:this.operateItem.id}}).then((function(e){var n=e.data;t.$store.dispatch("saveProject",n)})).catch((function(t){var e=t.msg;$A.modalError(e)}))}}};function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function it(t){for(var e=1;e