mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
50 lines
370 KiB
JavaScript
Vendored
50 lines
370 KiB
JavaScript
Vendored
import{n as pt,m as bt,c as Ft,d as Tt,e as Ut,g as Xt,f as Jt,r as te,V as ee,i as ie}from"./app.d2c43e87.js";import{l as zt,D as ne}from"./DialogSelect.90d45d43.js";import{U as Ht}from"./UserInput.c6ac5ef1.js";import{D as re}from"./index.aef61572.js";import{I as oe}from"./ImgUpload.59f141c3.js";var ae=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"common-circle",style:t.style,attrs:{"data-id":t.percent}},[e("svg",{attrs:{viewBox:"0 0 28 28"}},[e("g",{attrs:{fill:"none","fill-rule":"evenodd"}},[e("path",{staticClass:"common-circle-path",attrs:{d:"M-500-100h997V48h-997z"}}),e("g",{attrs:{"fill-rule":"nonzero"}},[e("path",{staticClass:"common-circle-g-path-ring",attrs:{"stroke-width":"3",d:"M14 25.5c6.351 0 11.5-5.149 11.5-11.5S20.351 2.5 14 2.5 2.5 7.649 2.5 14 7.649 25.5 14 25.5z"}}),e("path",{staticClass:"common-circle-g-path-core",attrs:{d:t.arc(t.args)}})])])])])},se=[];const le={name:"WCircle",props:{percent:{type:Number,default:0},size:{type:Number,default:120}},computed:{style(){let{size:t}=this;return this.isNumeric(t)&&(t+="px"),{width:t,height:t}},args(){const{percent:t}=this;let o=Math.min(360,360/100*t);return o==360?o=0:o==0&&(o=360),{x:14,y:14,r:14,start:360,end:o}}},methods:{isNumeric(t){return t!==""&&!isNaN(parseFloat(t))&&isFinite(t)},point(t,o,e,i){return[(t+Math.sin(i)*e).toFixed(2),(o-Math.cos(i)*e).toFixed(2)]},full(t,o,e,i){return i<=0?`M ${t-e} ${o} A ${e} ${e} 0 1 1 ${t+e} ${o} A ${e} ${e} 1 1 1 ${t-e} ${o} Z`:`M ${t-e} ${o} A ${e} ${e} 0 1 1 ${t+e} ${o} A ${e} ${e} 1 1 1 ${t-e} ${o} M ${t-i} ${o} A ${i} ${i} 0 1 1 ${t+i} ${o} A ${i} ${i} 1 1 1 ${t-i} ${o} Z`},part(t,o,e,i,a,O){const[S,w]=[a/360*2*Math.PI,O/360*2*Math.PI],b=[this.point(t,o,i,S),this.point(t,o,e,S),this.point(t,o,e,w),this.point(t,o,i,w)],_=w-S>Math.PI?"1":"0";return`M ${b[0][0]} ${b[0][1]} L ${b[1][0]} ${b[1][1]} A ${e} ${e} 0 ${_} 1 ${b[2][0]} ${b[2][1]} L ${b[3][0]} ${b[3][1]} A ${i} ${i} 0 ${_} 0 ${b[0][0]} ${b[0][1]} Z`},arc(t){const{x:o=0,y:e=0}=t;let{R:i=0,r:a=0,start:O,end:S}=t;return[i,a]=[Math.max(i,a),Math.min(i,a)],i<=0?"":O!==+O||S!==+S?this.full(o,e,i,a):Math.abs(O-S)<1e-6?"":Math.abs(O-S)%360<1e-6?this.full(o,e,i,a):([O,S]=[O%360,S%360],O>S&&(S+=360),this.part(o,e,i,a,O,S))}}},xt={};var ue=pt(le,ae,se,!1,ce,null,null,null);function ce(t){for(let o in xt)this[o]=xt[o]}var fe=function(){return ue.exports}(),he=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"dialog-view",class:t.viewClass,attrs:{"data-id":t.msgData.id}},[t.dialogType==="group"?e("div",{staticClass:"dialog-username"},[e("UserAvatar",{attrs:{userid:t.msgData.userid,"show-icon":!1,"show-name":!0,"click-open-dialog":""}})],1):t._e(),e("div",{directives:[{name:"longpress",rawName:"v-longpress",value:{callback:t.handleLongpress,delay:300},expression:"{callback: handleLongpress, delay: 300}"}],staticClass:"dialog-head",class:t.headClass},[!t.hideReply&&t.msgData.reply_data?e("div",{staticClass:"dialog-reply no-dark-content",on:{click:t.viewReply}},[e("UserAvatar",{attrs:{userid:t.msgData.reply_data.userid,"show-icon":!1,"show-name":!0,"tooltip-disabled":!0}}),e("div",{staticClass:"reply-desc"},[t._v(t._s(t.$A.getMsgSimpleDesc(t.msgData.reply_data)))])],1):t._e(),e("div",{staticClass:"dialog-content",class:t.contentClass},[t.msgData.type==="text"?e("div",{staticClass:"content-text no-dark-content"},[e("pre",{domProps:{innerHTML:t._s(t.$A.formatTextMsg(t.msgData.msg.text,t.userId))},on:{click:t.viewText}})]):t.msgData.type==="file"?e("div",{class:`content-file ${t.msgData.msg.type}`},[e("div",{staticClass:"dialog-file"},[t.msgData.msg.type==="img"?e("img",{staticClass:"file-img",style:t.imageStyle(t.msgData.msg),attrs:{src:t.msgData.msg.thumb},on:{click:t.viewFile}}):e("div",{staticClass:"file-box",on:{click:t.downFile}},[e("img",{staticClass:"file-thumb",attrs:{src:t.msgData.msg.thumb}}),e("div",{staticClass:"file-info"},[e("div",{staticClass:"file-name"},[t._v(t._s(t.msgData.msg.name))]),e("div",{staticClass:"file-size"},[t._v(t._s(t.$A.bytesToSize(t.msgData.msg.size)))])])])])]):t.msgData.type==="record"?e("div",{staticClass:"content-record no-dark-content"},[e("div",{staticClass:"dialog-record",class:{playing:t.audioPlaying===t.msgData.msg.path},style:t.recordStyle(t.msgData.msg),on:{click:t.playRecord}},[e("div",{staticClass:"record-time"},[t._v(t._s(t.recordDuration(t.msgData.msg.duration)))]),e("div",{staticClass:"record-icon taskfont"})])]):t.msgData.type==="meeting"?e("div",{staticClass:"content-meeting no-dark-content"},[e("ul",{staticClass:"dialog-meeting"},[e("li",[e("em",[t._v(t._s(t.$L("\u4F1A\u8BAE\u4E3B\u9898")))]),t._v(" "+t._s(t.msgData.msg.name)+" ")]),e("li",[e("em",[t._v(t._s(t.$L("\u4F1A\u8BAE\u521B\u5EFA\u4EBA")))]),e("UserAvatar",{attrs:{userid:t.msgData.msg.userid,"show-icon":!1,"show-name":!0,"tooltip-disabled":""}})],1),e("li",[e("em",[t._v(t._s(t.$L("\u9891\u9053ID")))]),t._v(" "+t._s(t.msgData.msg.meetingid.replace(/^(.{3})(.{3})(.*)$/,"$1 $2 $3"))+" ")]),e("li",{staticClass:"meeting-operation",on:{click:t.openMeeting}},[t._v(" "+t._s(t.$L("\u70B9\u51FB\u52A0\u5165\u4F1A\u8BAE"))+" "),e("i",{staticClass:"taskfont"},[t._v("\uE68B")])])])]):t.msgData.type==="loading"?e("div",{staticClass:"content-loading"},[t.msgData.error===!0?e("Icon",{attrs:{type:"ios-alert-outline"}}):e("Loading")],1):e("div",{staticClass:"content-unknown"},[t._v(t._s(t.$L("\u672A\u77E5\u7684\u6D88\u606F\u7C7B\u578B")))])]),t.$A.arrayLength(t.msgData.emoji)>0?e("ul",{staticClass:"dialog-emoji"},t._l(t.msgData.emoji,function(i,a){return e("li",{key:a,class:{hasme:i.userids.includes(t.userId)}},[e("div",{staticClass:"emoji-symbol no-dark-content",on:{click:function(O){return t.onEmoji(i.symbol)}}},[t._v(t._s(i.symbol))]),e("div",{staticClass:"emoji-users",on:{click:function(O){return t.onShowEmojiUser(i)}}},[e("ul",[t._l(i.userids,function(O,S){return[S<t.emojiUsersNum?e("li",{class:{bold:O==t.userId}},[e("UserAvatar",{attrs:{userid:O,"tooltip-disabled":"","show-name":"","show-icon":!1}})],1):S==t.emojiUsersNum?e("li",[t._v("+"+t._s(i.userids.length-t.emojiUsersNum)+"\u4F4D")]):t._e()]})],2)])])}),0):t._e()]),e("div",{staticClass:"dialog-foot"},[!t.hideReply&&t.msgData.reply_num>0?e("div",{staticClass:"reply",on:{click:t.replyList}},[e("i",{staticClass:"taskfont"},[t._v("\uE6EB")]),t._v(" "+t._s(t.msgData.reply_num)+"\u6761\u56DE\u590D ")]):t._e(),t.msgData.tag?e("div",{staticClass:"tag"},[e("i",{staticClass:"taskfont"},[t._v("\uE61E")])]):t._e(),t.msgData.todo?e("div",{staticClass:"todo",on:{click:t.openTodo}},[e("EPopover",{ref:"todo",attrs:{"popper-class":"dialog-wrapper-read-poptip",placement:t.isRightMsg?"bottom-end":"bottom-start"},model:{value:t.todoShow,callback:function(i){t.todoShow=i},expression:"todoShow"}},[e("div",{staticClass:"read-poptip-content"},[e("ul",{staticClass:"read scrollbar-overlay"},[e("li",{staticClass:"read-title"},[e("em",[t._v(t._s(t.todoDoneList.length))]),t._v(t._s(t.$L("\u5B8C\u6210")))]),t._l(t.todoDoneList,function(i){return e("li",[e("UserAvatar",{attrs:{userid:i.userid,size:26,showName:"",tooltipDisabled:""}})],1)})],2),e("ul",{staticClass:"unread scrollbar-overlay"},[e("li",{staticClass:"read-title"},[e("em",[t._v(t._s(t.todoUndoneList.length))]),t._v(t._s(t.$L("\u5F85\u529E")))]),t._l(t.todoUndoneList,function(i){return e("li",[e("UserAvatar",{attrs:{userid:i.userid,size:26,showName:"",tooltipDisabled:""}})],1)})],2)]),e("div",{staticClass:"popover-reference",attrs:{slot:"reference"},slot:"reference"})]),t.todoLoad>0?e("Loading"):e("i",{staticClass:"taskfont"},[t._v("\uE7B7")])],1):t._e(),t.msgData.modify?e("div",{staticClass:"modify"},[e("i",{staticClass:"taskfont"},[t._v("\uE779")])]):t._e(),t.msgData.error===!0?e("div",{staticClass:"error",on:{click:t.onError}},[e("Icon",{attrs:{type:"ios-alert"}})],1):t.isLoading?e("Loading"):[t.timeShow?e("div",{staticClass:"time",on:{click:function(i){t.timeShow=!1}}},[t._v(t._s(t.msgData.created_at))]):e("div",{staticClass:"time",attrs:{title:t.msgData.created_at},on:{click:function(i){t.timeShow=!0}}},[t._v(t._s(t.$A.formatTime(t.msgData.created_at)))]),t.hidePercentage?t._e():[t.msgData.send>1||t.dialogType==="group"?e("div",{staticClass:"percent",on:{click:t.openReadPercentage}},[e("EPopover",{ref:"percent",attrs:{"popper-class":"dialog-wrapper-read-poptip",placement:t.isRightMsg?"bottom-end":"bottom-start"},model:{value:t.percentageShow,callback:function(i){t.percentageShow=i},expression:"percentageShow"}},[e("div",{staticClass:"read-poptip-content"},[e("ul",{staticClass:"read scrollbar-overlay"},[e("li",{staticClass:"read-title"},[e("em",[t._v(t._s(t.readList.length))]),t._v(t._s(t.$L("\u5DF2\u8BFB")))]),t._l(t.readList,function(i){return e("li",[e("UserAvatar",{attrs:{userid:i.userid,size:26,showName:"",tooltipDisabled:""}})],1)})],2),e("ul",{staticClass:"unread scrollbar-overlay"},[e("li",{staticClass:"read-title"},[e("em",[t._v(t._s(t.unreadList.length))]),t._v(t._s(t.$L("\u672A\u8BFB")))]),t._l(t.unreadList,function(i){return e("li",[e("UserAvatar",{attrs:{userid:i.userid,size:26,showName:"",tooltipDisabled:""}})],1)})],2)]),e("div",{staticClass:"popover-reference",attrs:{slot:"reference"},slot:"reference"})]),t.percentageLoad>0?e("Loading"):e("WCircle",{attrs:{percent:t.msgData.percentage,size:14}})],1):t.msgData.percentage===100?e("Icon",{staticClass:"done",attrs:{type:"md-done-all"}}):e("Icon",{staticClass:"done",attrs:{type:"md-checkmark"}})]]],2)])},de=[];const pe={name:"DialogView",components:{WCircle:fe},directives:{longpress:zt},props:{msgData:{type:Object,default:()=>({})},dialogType:{type:String,default:""},hidePercentage:{type:Boolean,default:!1},hideReply:{type:Boolean,default:!1},operateVisible:{type:Boolean,default:!1},operateAction:{type:Boolean,default:!1},isRightMsg:{type:Boolean,default:!1}},data(){return{timeShow:!1,operateEnter:!1,percentageLoad:0,percentageShow:!1,percentageList:[],todoLoad:0,todoShow:!1,todoList:[],emojiUsersNum:5}},mounted(){this.emojiUsersNum=Math.min(6,Math.max(2,Math.floor((this.windowWidth-180)/52)))},beforeDestroy(){this.$store.dispatch("audioStop",this.msgData.msg.path)},computed:{...bt(["loads","audioPlaying"]),...Ft(["isLoad"]),isLoading(){return this.msgData.created_at?this.isLoad(`msg-${this.msgData.id}`):!0},viewClass(){const{msgData:t,operateAction:o,operateEnter:e}=this,i=[];return t.type&&i.push(t.type),t.reply_data&&i.push("reply-view"),o&&(i.push("operate-action"),e&&i.push("operate-enter")),i},readList(){return this.percentageList.filter(({read_at:t})=>t)},unreadList(){return this.percentageList.filter(({read_at:t})=>!t)},todoDoneList(){return this.todoList.filter(({done_at:t})=>t)},todoUndoneList(){return this.todoList.filter(({done_at:t})=>!t)},headClass(){const{reply_id:t,type:o,msg:e,emoji:i}=this.msgData,a=[];return t===0&&$A.arrayLength(i)===0&&o==="text"&&(/^<img\s+class="emoticon"[^>]*?>$/.test(e.text)||/^\s*<p>\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(e.text))&&a.push("transparent"),a},contentClass(){const{type:t,msg:o}=this.msgData,e=[];return t==="text"&&(/^<img\s+class="emoticon"[^>]*?>$/.test(o.text)?e.push("an-emoticon"):/^\s*<p>\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){3}\s*<\/p>\s*$/.test(o.text)?e.push("three-emoji"):/^\s*<p>\s*([\uD800-\uDBFF][\uDC00-\uDFFF]){2}\s*<\/p>\s*$/.test(o.text)?e.push("two-emoji"):/^\s*<p>\s*[\uD800-\uDBFF][\uDC00-\uDFFF]\s*<\/p>\s*$/.test(o.text)&&e.push("an-emoji")),e}},watch:{operateAction(t){this.operateEnter=!1,t&&setTimeout(o=>this.operateEnter=!0,500)}},methods:{handleLongpress(t,o){this.$emit("on-longpress",{event:t,el:o,msgData:this.msgData})},openTodo(){if(!(this.todoLoad>0)){if(this.todoShow){this.todoShow=!1;return}this.todoLoad++,this.$store.dispatch("call",{url:"dialog/msg/todolist",data:{msg_id:this.msgData.id}}).then(({data:t})=>{this.todoList=t}).catch(()=>{this.todoList=[]}).finally(t=>{setTimeout(()=>{this.todoLoad--,this.todoShow=!0},100)})}},openReadPercentage(){if(!(this.percentageLoad>0)){if(this.percentageShow){this.percentageShow=!1;return}this.percentageLoad++,this.$store.dispatch("call",{url:"dialog/msg/readlist",data:{msg_id:this.msgData.id}}).then(({data:t})=>{this.percentageList=t}).catch(()=>{this.percentageList=[]}).finally(t=>{setTimeout(()=>{this.percentageLoad--,this.percentageShow=!0},100)})}},recordStyle(t){const{duration:o}=t;return{width:50+Math.min(180,Math.floor(o/150))+"px"}},recordDuration(t){const o=Math.floor(t/6e4),e=Math.floor(t/1e3)%60;return o>0?`${o}:${e}\u2033`:`${Math.max(1,e)}\u2033`},imageStyle(t){const{width:o,height:e}=t;if(o&&e){let i=220,a=220,O=o,S=e;return(o>i||e>a)&&(o>e?(O=i,S=e*(i/o)):(O=o*(a/e),S=a)),{width:O+"px",height:S+"px"}}return{}},playRecord(){this.operateVisible||this.$store.dispatch("audioPlay",this.msgData.msg.path)},openMeeting(){this.operateVisible||Tt.Store.set("addMeeting",{type:"join",name:this.msgData.msg.name,meetingid:this.msgData.msg.meetingid,meetingdisabled:!0})},viewReply(){this.$emit("on-view-reply",{msg_id:this.msgData.id,reply_id:this.msgData.reply_id})},viewText(t){this.$emit("on-view-text",t)},viewFile(){this.$emit("on-view-file",this.msgData)},downFile(){this.$emit("on-down-file",this.msgData)},replyList(){this.$emit("on-reply-list",{msg_id:this.msgData.id})},onError(){this.$emit("on-error",this.msgData)},onEmoji(t){this.$emit("on-emoji",{msg_id:this.msgData.id,symbol:t})},onShowEmojiUser(t){this.$emit("on-show-emoji-user",t)}}},At={};var me=pt(pe,he,de,!1,ve,null,null,null);function ve(t){for(let o in At)this[o]=At[o]}var ge=function(){return me.exports}(),ye=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{class:t.classArray},[t.source.type==="tag"?e("div",{staticClass:"dialog-tag",on:{click:t.onViewTag}},[e("div",{staticClass:"tag-user"},[e("UserAvatar",{attrs:{userid:t.source.userid,tooltipDisabled:t.source.userid==t.userId,"show-name":!0,"show-icon":!1}})],1),t._v(" "+t._s(t.$L(t.source.msg.action==="remove"?"\u53D6\u6D88\u6807\u6CE8":"\u6807\u6CE8\u4E86"))+' "'+t._s(t.$A.getMsgSimpleDesc(t.source.msg.data))+'" ')]):t.source.type==="todo"?e("div",{staticClass:"dialog-todo",on:{click:t.onViewTodo}},[e("div",{staticClass:"todo-user"},[e("UserAvatar",{attrs:{userid:t.source.userid,tooltipDisabled:t.source.userid==t.userId,"show-name":!0,"show-icon":!1}})],1),t._v(" "+t._s(t.$L(t.source.msg.action==="remove"?"\u53D6\u6D88\u5F85\u529E":t.source.msg.action==="done"?"\u5B8C\u6210":"\u8BBE\u5F85\u529E"))+' "'+t._s(t.$A.getMsgSimpleDesc(t.source.msg.data))+'" '),t.formatTodoUser(t.source.msg.data).length>0?e("div",{staticClass:"todo-users"},[e("span",[t._v(t._s(t.$L("\u7ED9")))]),t._l(t.formatTodoUser(t.source.msg.data),function(i,a){return[a<3?e("div",{staticClass:"todo-user"},[e("UserAvatar",{attrs:{userid:i,tooltipDisabled:i==t.userId,"show-name":!0,"show-icon":!1}})],1):a==3?e("div",{staticClass:"todo-user"},[t._v("+"+t._s(t.formatTodoUser(t.source.msg.data).length-3))]):t._e()]})],2):t._e()]):t.source.type==="notice"?e("div",{staticClass:"dialog-notice"},[t._v(" "+t._s(t.source.msg.notice)+" ")]):[e("div",{staticClass:"dialog-avatar"},[e("UserAvatar",{directives:[{name:"longpress",rawName:"v-longpress",value:{callback:t.onMention,delay:300},expression:"{callback: onMention, delay: 300}"}],attrs:{userid:t.source.userid,size:30,"tooltip-disabled":""},on:{"open-dialog":t.onOpenDialog}})],1),e("DialogView",{attrs:{"msg-data":t.source,"dialog-type":t.dialogData.type,"hide-percentage":t.hidePercentage,"hide-reply":t.hideReply,"operate-visible":t.operateVisible,"operate-action":t.operateVisible&&t.source.id===t.operateItem.id,"is-right-msg":t.isRightMsg},on:{"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}})]],2)},be=[];const _e={name:"DialogItem",components:{DialogView:ge},directives:{longpress:zt},props:{source:{type:Object,default(){return{}}},dialogData:{type:Object,default(){return{}}},operateVisible:{type:Boolean,default:!1},operateItem:{type:Object,default(){return{}}},simpleView:{type:Boolean,default:!1},isMyDialog:{type:Boolean,default:!1},msgId:{type:Number,default:0}},data(){return{subscribe:null}},computed:{...bt(["userId"]),isRightMsg(){return this.source.userid==this.userId},isReply(){return this.simpleView||this.msgId===this.source.id},hidePercentage(){return this.simpleView||this.isMyDialog||this.isReply},hideReply(){return this.simpleView||this.msgId>0},classArray(){return{"dialog-item":!0,"reply-item":this.isReply,self:this.isRightMsg}}},watch:{source:{handler(){this.msgRead()},immediate:!0},windowActive(t){t&&this.msgRead()}},methods:{msgRead(){!this.windowActive||this.$store.dispatch("dialogMsgRead",this.source)},formatTodoUser(t){if($A.isJson(t)){const{userids:o}=t;if(o)return o.split(",")}return[]},onViewTag(){this.onViewReply({msg_id:this.source.id,reply_id:this.source.msg.data.id})},onViewTodo(){this.onViewReply({msg_id:this.source.id,reply_id:this.source.msg.data.id})},onOpenDialog(t){this.dialogData.type=="group"&&this.$store.dispatch("openDialogUserid",t).then(o=>{this.goForward({name:"manage-messenger"})}).catch(({msg:o})=>{$A.modalError(o)})},onMention(){this.dispatch("on-mention",this.source)},onLongpress(t){this.dispatch("on-longpress",t)},onViewReply(t){this.dispatch("on-view-reply",t)},onViewText(t){this.dispatch("on-view-text",t)},onViewFile(t){this.dispatch("on-view-file",t)},onDownFile(t){this.dispatch("on-down-file",t)},onReplyList(t){this.dispatch("on-reply-list",t)},onError(t){this.dispatch("on-error",t)},onEmoji(t){this.dispatch("on-emoji",t)},onShowEmojiUser(t){this.dispatch("on-show-emoji-user",t)},dispatch(t,o){if(this.isReply){this.$emit(t,o);return}let e=this.$parent,i=e.$options.name;for(;e&&(!i||i!=="virtual-list");)e=e.$parent,e&&(i=e.$options.name);e&&e.$emit(t,o)}}},Lt={};var we=pt(_e,ye,be,!1,ke,null,null,null);function ke(t){for(let o in Lt)this[o]=Lt[o]}var Dt=function(){return we.exports}(),Oe=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("Upload",{ref:"upload",attrs:{name:"files",action:t.actionUrl,headers:t.headers,data:t.params,multiple:"",format:t.uploadFormat,"show-upload-list":!1,"max-size":t.maxSize,"on-progress":t.handleProgress,"on-success":t.handleSuccess,"on-format-error":t.handleFormatError,"on-exceeded-size":t.handleMaxSize}})},Ee=[];const Se={name:"DialogUpload",props:{dialogId:{type:Number,default:0},maxSize:{type:Number,default:1024e3}},data(){return{uploadFormat:[],actionUrl:$A.apiUrl("dialog/msg/sendfile")}},computed:{...bt(["cacheDialogs"]),headers(){return{fd:$A.getSessionStorageString("userWsFd"),token:this.userToken}},params(){return{dialog_id:this.dialogId,reply_id:this.dialogData.extra_quote_id||0}},dialogData(){return this.cacheDialogs.find(({id:t})=>t==this.dialogId)||{}}},methods:{handleProgress(t,o){o.tempId===void 0&&(this.$parent.$options.name==="DialogWrapper"?o.tempId=this.$parent.getTempId():o.tempId=$A.randNum(1e9,9999999999),this.$emit("on-progress",o))},handleSuccess(t,o){t.ret===1?(o.data=t.data,this.$emit("on-success",o),t.data.task_id&&this.$store.dispatch("getTaskFiles",t.data.task_id)):($A.modalWarning({title:"\u53D1\u9001\u5931\u8D25",content:"\u6587\u4EF6 "+o.name+" \u53D1\u9001\u5931\u8D25\uFF0C"+t.msg}),this.$emit("on-error",o),this.$refs.upload.fileList.pop())},handleFormatError(t){$A.modalWarning({title:"\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E",content:"\u6587\u4EF6 "+t.name+" \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u4EC5\u652F\u6301\u53D1\u9001\uFF1A"+this.uploadFormat.join(",")})},handleMaxSize(t){$A.modalWarning({title:"\u8D85\u51FA\u6587\u4EF6\u5927\u5C0F\u9650\u5236",content:"\u6587\u4EF6 "+t.name+" \u592A\u5927\uFF0C\u4E0D\u80FD\u53D1\u9001\u8D85\u8FC7"+$A.bytesToSize(this.maxSize*1024)+"\u3002"})},handleClick(){this.$refs.upload.handleClick()},upload(t){this.$refs.upload.upload(t)}}},Ct={};var Te=pt(Se,Oe,Ee,!1,xe,null,null,null);function xe(t){for(let o in Ct)this[o]=Ct[o]}var Ae=function(){return Te.exports}(),Le=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"dialog-group-info"},[e("div",{staticClass:"group-info-title"},[t._v(t._s(t.$L("\u7FA4\u540D")))]),e("div",{staticClass:"group-info-value"},[e("QuickEdit",{attrs:{value:t.dialogData.name,disabled:t.dialogData.owner_id!=t.userId},on:{"on-update":t.updateName}},[t._v(t._s(t.dialogData.name))])],1),e("div",{staticClass:"group-info-title"},[t._v(t._s(t.$L("\u7FA4\u7C7B\u578B")))]),e("div",{staticClass:"group-info-value"},[t._v(t._s(t.$L(t.groupType)))]),e("div",{staticClass:"group-info-search"},[e("Input",{attrs:{prefix:"ios-search",placeholder:t.$L("\u641C\u7D22\u6210\u5458"),clearable:""},model:{value:t.searchKey,callback:function(i){t.searchKey=i},expression:"searchKey"}})],1),e("div",{staticClass:"group-info-user"},[e("ul",[t._l(t.userList,function(i,a){return e("li",{key:a,on:{click:function(O){return t.openUser(i.userid)}}},[e("UserAvatar",{attrs:{userid:i.userid,size:32,showName:"",tooltipDisabled:""}}),i.userid===t.dialogData.owner_id?e("div",{staticClass:"user-tag"},[t._v(t._s(t.$L("\u7FA4\u4E3B")))]):t.operableExit(i)?e("div",{staticClass:"user-exit",on:{click:function(O){return O.stopPropagation(),t.onExit(i)}}},[e("Icon",{attrs:{type:"md-exit"}})],1):t._e()],1)}),t.userList.length===0?e("li",{staticClass:"no"},[t.loadIng>0?e("Loading"):e("span",[t._v(t._s(t.$L("\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684\u6570\u636E")))])],1):t._e()],2)]),t.operableAdd?e("div",{staticClass:"group-info-button"},[t.dialogData.owner_id==t.userId||t.dialogData.owner_id==0?e("Button",{attrs:{type:"primary",icon:"md-add"},on:{click:t.openAdd}},[t._v(t._s(t.$L("\u6DFB\u52A0\u6210\u5458")))]):t._e()],1):t._e(),e("Modal",{attrs:{title:t.$L("\u6DFB\u52A0\u7FA4\u6210\u5458"),"mask-closable":!1},model:{value:t.addShow,callback:function(i){t.addShow=i},expression:"addShow"}},[e("Form",{attrs:{model:t.addData,"label-width":"auto"},nativeOn:{submit:function(i){i.preventDefault()}}},[e("FormItem",{attrs:{prop:"userids",label:t.$L("\u65B0\u589E\u6210\u5458")}},[e("UserInput",{attrs:{disabledChoice:t.addData.disabledChoice,"multiple-max":100,"show-bot":"",placeholder:t.$L("\u9009\u62E9\u6210\u5458")},model:{value:t.addData.userids,callback:function(i){t.$set(t.addData,"userids",i)},expression:"addData.userids"}}),t.dialogData.group_type==="department"?e("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("\u6B64\u64CD\u4F5C\u4EC5\u52A0\u5165\u7FA4\u6210\u5458\u5E76\u4E0D\u4F1A\u52A0\u5165\u90E8\u95E8")))]):t.dialogData.group_type==="project"?e("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("\u6B64\u64CD\u4F5C\u4EC5\u52A0\u5165\u7FA4\u6210\u5458\u5E76\u4E0D\u4F1A\u52A0\u5165\u9879\u76EE")))]):t.dialogData.group_type==="task"?e("div",{staticClass:"form-tip"},[t._v(t._s(t.$L("\u6B64\u64CD\u4F5C\u4EC5\u52A0\u5165\u7FA4\u6210\u5458\u5E76\u4E0D\u4F1A\u52A0\u5165\u4EFB\u52A1\u8D1F\u8D23\u4EBA")))]):t._e()],1)],1),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.addShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.addLoad>0},on:{click:t.onAdd}},[t._v(t._s(t.$L("\u786E\u5B9A\u6DFB\u52A0")))])],1)],1)],1)},De=[];const Ce={name:"DialogGroupInfo",components:{UserInput:Ht},props:{dialogId:{type:Number,default:0}},data(){return{searchKey:"",loadIng:0,dialogUser:[],addShow:!1,addData:{},addLoad:0,openIng:!1}},computed:{...bt(["cacheDialogs","cacheUserBasic","userIsAdmin"]),dialogData(){return this.cacheDialogs.find(({id:t})=>t==this.dialogId)||{}},groupType(){const{group_type:t}=this.dialogData;return t==="department"?"\u90E8\u95E8\u7FA4\u7EC4":t==="project"?"\u9879\u76EE\u7FA4\u7EC4":t==="task"?"\u4EFB\u52A1\u7FA4\u7EC4":t==="user"?"\u4E2A\u4EBA\u7FA4\u7EC4":t==="all"?"\u5168\u5458\u7FA4\u7EC4":"\u672A\u77E5"},userList(){const{dialogUser:t,searchKey:o,cacheUserBasic:e,dialogData:i}=this;return t.map(O=>{const S=e.find(w=>w.userid==O.userid);return S&&(O.nickname=S.nickname,O.email=S.email),O}).filter(O=>!(o&&O.nickname&&!$A.strExists(O.nickname,o)&&!$A.strExists(O.email,o))).sort((O,S)=>O.userid===i.owner_id||S.userid===i.owner_id?(O.userid===i.owner_id?0:1)-(S.userid===i.owner_id?0:1):$A.Date(O.created_at)-$A.Date(S.created_at))}},watch:{dialogId:{handler(){this.getDialogUser()},immediate:!0}},methods:{updateName(t,o){if(!t){o();return}this.$store.dispatch("call",{url:"dialog/group/edit",data:{dialog_id:this.dialogId,chat_name:t}}).then(({data:e})=>{this.$store.dispatch("saveDialog",e),o()}).catch(({msg:e})=>{$A.modalError(e),o()})},getDialogUser(){this.dialogId<=0||(this.loadIng++,this.$store.dispatch("call",{url:"dialog/user",data:{dialog_id:this.dialogId}}).then(({data:t})=>{this.dialogUser=t,this.$store.dispatch("saveDialog",{id:this.dialogId,people:t.length})}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.loadIng--}))},operableAdd(){const{owner_id:t,group_type:o}=this.dialogData;return o=="all"?this.userIsAdmin:[0,this.userId].includes(t)},openAdd(){this.addData={dialog_id:this.dialogId,userids:[],disabledChoice:this.dialogUser.map(t=>t.userid)},this.addShow=!0},onAdd(){this.addLoad++,this.$store.dispatch("call",{url:"dialog/group/adduser",data:this.addData}).then(({msg:t})=>{$A.messageSuccess(t),this.addShow=!1,this.addData={},this.getDialogUser()}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.addLoad--})},operableExit(t){const{owner_id:o,group_type:e}=this.dialogData;return e=="all"?this.userIsAdmin:o==this.userId||t.inviter==this.userId},onExit(t){let o="\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u7FA4\u7EC4\u5417\uFF1F",e=[];$A.isJson(t)&&t.userid!=this.userId&&(o=`\u4F60\u786E\u5B9A\u8981\u5C06\u3010${t.nickname}\u3011\u79FB\u51FA\u7FA4\u7EC4\u5417\uFF1F`,e=[t.userid]),$A.modalConfirm({content:o,loading:!0,onOk:()=>new Promise((i,a)=>{this.$store.dispatch("call",{url:"dialog/group/deluser",data:{dialog_id:this.dialogId,userids:e}}).then(({msg:O})=>{i(O),e.length>0?this.getDialogUser():(this.$store.dispatch("forgetDialog",this.dialogId),this.goForward({name:"manage-messenger"}))}).catch(({msg:O})=>{a(O)})})})},openUser(t){this.openIng||(this.openIng=!0,this.$store.dispatch("openDialogUserid",t).then(o=>{this.$emit("on-close")}).catch(({msg:o})=>{$A.modalError(o)}).finally(o=>{this.openIng=!1}))}}},It={};var Ie=pt(Ce,Le,De,!1,$e,null,null,null);function $e(t){for(let o in It)this[o]=It[o]}var Ne=function(){return Ie.exports}(),Me=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"dialog-respond"},[e("div",{staticClass:"respond-title"},[e("em",[t._v(t._s(t.respondData.symbol))]),t._v(t._s(t.$L("\u56DE\u5E94\u8BE6\u60C5"))+" ("+t._s(t.respondData.userids.length)+")")]),e("div",{staticClass:"respond-user"},[e("ul",t._l(t.respondData.userids,function(i,a){return e("li",{key:a,on:{click:function(O){return t.openUser(i)}}},[e("UserAvatar",{attrs:{userid:i,size:32,showName:"",tooltipDisabled:""}})],1)}),0)])])},Pe=[];const je={name:"DialogRespond",props:{respondData:{type:Object,default:()=>({})}},data(){return{openIng:!1}},methods:{openUser(t){this.openIng||(this.openIng=!0,this.$store.dispatch("openDialogUserid",t).then(o=>{this.$emit("on-close")}).catch(({msg:o})=>{$A.modalError(o)}).finally(o=>{this.openIng=!1}))}}},$t={};var Re=pt(je,Me,Pe,!1,qe,null,null,null);function qe(t){for(let o in $t)this[o]=$t[o]}var Be=function(){return Re.exports}(),Vt={exports:{}};/*!
|
|
* Quill Editor v1.3.7
|
|
* https://quilljs.com/
|
|
* Copyright (c) 2014, Jason Chen
|
|
* Copyright (c) 2013, salesforce.com
|
|
*/(function(t,o){(function(i,a){t.exports=a()})(typeof self!="undefined"?self:Ut,function(){return function(e){var i={};function a(O){if(i[O])return i[O].exports;var S=i[O]={i:O,l:!1,exports:{}};return e[O].call(S.exports,S,S.exports,a),S.l=!0,S.exports}return a.m=e,a.c=i,a.d=function(O,S,w){a.o(O,S)||Object.defineProperty(O,S,{configurable:!1,enumerable:!0,get:w})},a.n=function(O){var S=O&&O.__esModule?function(){return O.default}:function(){return O};return a.d(S,"a",S),S},a.o=function(O,S){return Object.prototype.hasOwnProperty.call(O,S)},a.p="",a(a.s=109)}([function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(17),S=a(18),w=a(19),b=a(45),_=a(46),m=a(47),c=a(48),n=a(49),r=a(12),d=a(32),f=a(33),h=a(31),l=a(1),u={Scope:l.Scope,create:l.create,find:l.find,query:l.query,register:l.register,Container:O.default,Format:S.default,Leaf:w.default,Embed:c.default,Scroll:b.default,Block:m.default,Inline:_.default,Text:n.default,Attributor:{Attribute:r.default,Class:d.default,Style:f.default,Store:h.default}};i.default=u},function(e,i,a){var O=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var p in u)u.hasOwnProperty(p)&&(l[p]=u[p])};return function(l,u){h(l,u);function p(){this.constructor=l}l.prototype=u===null?Object.create(u):(p.prototype=u.prototype,new p)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=function(h){O(l,h);function l(u){var p=this;return u="[Parchment] "+u,p=h.call(this,u)||this,p.message=u,p.name=p.constructor.name,p}return l}(Error);i.ParchmentError=S;var w={},b={},_={},m={};i.DATA_KEY="__blot";var c;(function(h){h[h.TYPE=3]="TYPE",h[h.LEVEL=12]="LEVEL",h[h.ATTRIBUTE=13]="ATTRIBUTE",h[h.BLOT=14]="BLOT",h[h.INLINE=7]="INLINE",h[h.BLOCK=11]="BLOCK",h[h.BLOCK_BLOT=10]="BLOCK_BLOT",h[h.INLINE_BLOT=6]="INLINE_BLOT",h[h.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",h[h.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",h[h.ANY=15]="ANY"})(c=i.Scope||(i.Scope={}));function n(h,l){var u=d(h);if(u==null)throw new S("Unable to create "+h+" blot");var p=u,s=h instanceof Node||h.nodeType===Node.TEXT_NODE?h:p.create(l);return new p(s,l)}i.create=n;function r(h,l){return l===void 0&&(l=!1),h==null?null:h[i.DATA_KEY]!=null?h[i.DATA_KEY].blot:l?r(h.parentNode,l):null}i.find=r;function d(h,l){l===void 0&&(l=c.ANY);var u;if(typeof h=="string")u=m[h]||w[h];else if(h instanceof Text||h.nodeType===Node.TEXT_NODE)u=m.text;else if(typeof h=="number")h&c.LEVEL&c.BLOCK?u=m.block:h&c.LEVEL&c.INLINE&&(u=m.inline);else if(h instanceof HTMLElement){var p=(h.getAttribute("class")||"").split(/\s+/);for(var s in p)if(u=b[p[s]],u)break;u=u||_[h.tagName]}return u==null?null:l&c.LEVEL&u.scope&&l&c.TYPE&u.scope?u:null}i.query=d;function f(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];if(h.length>1)return h.map(function(s){return f(s)});var u=h[0];if(typeof u.blotName!="string"&&typeof u.attrName!="string")throw new S("Invalid definition");if(u.blotName==="abstract")throw new S("Cannot register abstract class");if(m[u.blotName||u.attrName]=u,typeof u.keyName=="string")w[u.keyName]=u;else if(u.className!=null&&(b[u.className]=u),u.tagName!=null){Array.isArray(u.tagName)?u.tagName=u.tagName.map(function(s){return s.toUpperCase()}):u.tagName=u.tagName.toUpperCase();var p=Array.isArray(u.tagName)?u.tagName:[u.tagName];p.forEach(function(s){(_[s]==null||u.className==null)&&(_[s]=u)})}return u}i.register=f},function(e,i,a){var O=a(51),S=a(11),w=a(3),b=a(20),_=String.fromCharCode(0),m=function(c){Array.isArray(c)?this.ops=c:c!=null&&Array.isArray(c.ops)?this.ops=c.ops:this.ops=[]};m.prototype.insert=function(c,n){var r={};return c.length===0?this:(r.insert=c,n!=null&&typeof n=="object"&&Object.keys(n).length>0&&(r.attributes=n),this.push(r))},m.prototype.delete=function(c){return c<=0?this:this.push({delete:c})},m.prototype.retain=function(c,n){if(c<=0)return this;var r={retain:c};return n!=null&&typeof n=="object"&&Object.keys(n).length>0&&(r.attributes=n),this.push(r)},m.prototype.push=function(c){var n=this.ops.length,r=this.ops[n-1];if(c=w(!0,{},c),typeof r=="object"){if(typeof c.delete=="number"&&typeof r.delete=="number")return this.ops[n-1]={delete:r.delete+c.delete},this;if(typeof r.delete=="number"&&c.insert!=null&&(n-=1,r=this.ops[n-1],typeof r!="object"))return this.ops.unshift(c),this;if(S(c.attributes,r.attributes)){if(typeof c.insert=="string"&&typeof r.insert=="string")return this.ops[n-1]={insert:r.insert+c.insert},typeof c.attributes=="object"&&(this.ops[n-1].attributes=c.attributes),this;if(typeof c.retain=="number"&&typeof r.retain=="number")return this.ops[n-1]={retain:r.retain+c.retain},typeof c.attributes=="object"&&(this.ops[n-1].attributes=c.attributes),this}}return n===this.ops.length?this.ops.push(c):this.ops.splice(n,0,c),this},m.prototype.chop=function(){var c=this.ops[this.ops.length-1];return c&&c.retain&&!c.attributes&&this.ops.pop(),this},m.prototype.filter=function(c){return this.ops.filter(c)},m.prototype.forEach=function(c){this.ops.forEach(c)},m.prototype.map=function(c){return this.ops.map(c)},m.prototype.partition=function(c){var n=[],r=[];return this.forEach(function(d){var f=c(d)?n:r;f.push(d)}),[n,r]},m.prototype.reduce=function(c,n){return this.ops.reduce(c,n)},m.prototype.changeLength=function(){return this.reduce(function(c,n){return n.insert?c+b.length(n):n.delete?c-n.delete:c},0)},m.prototype.length=function(){return this.reduce(function(c,n){return c+b.length(n)},0)},m.prototype.slice=function(c,n){c=c||0,typeof n!="number"&&(n=1/0);for(var r=[],d=b.iterator(this.ops),f=0;f<n&&d.hasNext();){var h;f<c?h=d.next(c-f):(h=d.next(n-f),r.push(h)),f+=b.length(h)}return new m(r)},m.prototype.compose=function(c){var n=b.iterator(this.ops),r=b.iterator(c.ops),d=[],f=r.peek();if(f!=null&&typeof f.retain=="number"&&f.attributes==null){for(var h=f.retain;n.peekType()==="insert"&&n.peekLength()<=h;)h-=n.peekLength(),d.push(n.next());f.retain-h>0&&r.next(f.retain-h)}for(var l=new m(d);n.hasNext()||r.hasNext();)if(r.peekType()==="insert")l.push(r.next());else if(n.peekType()==="delete")l.push(n.next());else{var u=Math.min(n.peekLength(),r.peekLength()),p=n.next(u),s=r.next(u);if(typeof s.retain=="number"){var g={};typeof p.retain=="number"?g.retain=u:g.insert=p.insert;var D=b.attributes.compose(p.attributes,s.attributes,typeof p.retain=="number");if(D&&(g.attributes=D),l.push(g),!r.hasNext()&&S(l.ops[l.ops.length-1],g)){var x=new m(n.rest());return l.concat(x).chop()}}else typeof s.delete=="number"&&typeof p.retain=="number"&&l.push(s)}return l.chop()},m.prototype.concat=function(c){var n=new m(this.ops.slice());return c.ops.length>0&&(n.push(c.ops[0]),n.ops=n.ops.concat(c.ops.slice(1))),n},m.prototype.diff=function(c,n){if(this.ops===c.ops)return new m;var r=[this,c].map(function(u){return u.map(function(p){if(p.insert!=null)return typeof p.insert=="string"?p.insert:_;var s=u===c?"on":"with";throw new Error("diff() called "+s+" non-document")}).join("")}),d=new m,f=O(r[0],r[1],n),h=b.iterator(this.ops),l=b.iterator(c.ops);return f.forEach(function(u){for(var p=u[1].length;p>0;){var s=0;switch(u[0]){case O.INSERT:s=Math.min(l.peekLength(),p),d.push(l.next(s));break;case O.DELETE:s=Math.min(p,h.peekLength()),h.next(s),d.delete(s);break;case O.EQUAL:s=Math.min(h.peekLength(),l.peekLength(),p);var g=h.next(s),D=l.next(s);S(g.insert,D.insert)?d.retain(s,b.attributes.diff(g.attributes,D.attributes)):d.push(D).delete(s);break}p-=s}}),d.chop()},m.prototype.eachLine=function(c,n){n=n||`
|
|
`;for(var r=b.iterator(this.ops),d=new m,f=0;r.hasNext();){if(r.peekType()!=="insert")return;var h=r.peek(),l=b.length(h)-r.peekLength(),u=typeof h.insert=="string"?h.insert.indexOf(n,l)-l:-1;if(u<0)d.push(r.next());else if(u>0)d.push(r.next(u));else{if(c(d,r.next(1).attributes||{},f)===!1)return;f+=1,d=new m}}d.length()>0&&c(d,{},f)},m.prototype.transform=function(c,n){if(n=!!n,typeof c=="number")return this.transformPosition(c,n);for(var r=b.iterator(this.ops),d=b.iterator(c.ops),f=new m;r.hasNext()||d.hasNext();)if(r.peekType()==="insert"&&(n||d.peekType()!=="insert"))f.retain(b.length(r.next()));else if(d.peekType()==="insert")f.push(d.next());else{var h=Math.min(r.peekLength(),d.peekLength()),l=r.next(h),u=d.next(h);if(l.delete)continue;u.delete?f.push(u):f.retain(h,b.attributes.transform(l.attributes,u.attributes,n))}return f.chop()},m.prototype.transformPosition=function(c,n){n=!!n;for(var r=b.iterator(this.ops),d=0;r.hasNext()&&d<=c;){var f=r.peekLength(),h=r.peekType();if(r.next(),h==="delete"){c-=Math.min(f,c-d);continue}else h==="insert"&&(d<c||!n)&&(c+=f);d+=f}return c},e.exports=m},function(e,i){var a=Object.prototype.hasOwnProperty,O=Object.prototype.toString,S=Object.defineProperty,w=Object.getOwnPropertyDescriptor,b=function(r){return typeof Array.isArray=="function"?Array.isArray(r):O.call(r)==="[object Array]"},_=function(r){if(!r||O.call(r)!=="[object Object]")return!1;var d=a.call(r,"constructor"),f=r.constructor&&r.constructor.prototype&&a.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!d&&!f)return!1;var h;for(h in r);return typeof h=="undefined"||a.call(r,h)},m=function(r,d){S&&d.name==="__proto__"?S(r,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):r[d.name]=d.newValue},c=function(r,d){if(d==="__proto__")if(a.call(r,d)){if(w)return w(r,d).value}else return;return r[d]};e.exports=function n(){var r,d,f,h,l,u,p=arguments[0],s=1,g=arguments.length,D=!1;for(typeof p=="boolean"&&(D=p,p=arguments[1]||{},s=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});s<g;++s)if(r=arguments[s],r!=null)for(d in r)f=c(p,d),h=c(r,d),p!==h&&(D&&h&&(_(h)||(l=b(h)))?(l?(l=!1,u=f&&b(f)?f:[]):u=f&&_(f)?f:{},m(p,{name:d,newValue:n(D,u,h)})):typeof h!="undefined"&&m(p,{name:d,newValue:h}));return p}},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BlockEmbed=i.bubbleFormats=void 0;var O=function(){function E(v,y){for(var k=0;k<y.length;k++){var C=y[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(v,C.key,C)}}return function(v,y,k){return y&&E(v.prototype,y),k&&E(v,k),v}}(),S=function E(v,y,k){v===null&&(v=Function.prototype);var C=Object.getOwnPropertyDescriptor(v,y);if(C===void 0){var j=Object.getPrototypeOf(v);return j===null?void 0:E(j,y,k)}else{if("value"in C)return C.value;var B=C.get;return B===void 0?void 0:B.call(k)}},w=a(3),b=p(w),_=a(2),m=p(_),c=a(0),n=p(c),r=a(16),d=p(r),f=a(6),h=p(f),l=a(7),u=p(l);function p(E){return E&&E.__esModule?E:{default:E}}function s(E,v){if(!(E instanceof v))throw new TypeError("Cannot call a class as a function")}function g(E,v){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:E}function D(E,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);E.prototype=Object.create(v&&v.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(E,v):E.__proto__=v)}var x=1,A=function(E){D(v,E);function v(){return s(this,v),g(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return O(v,[{key:"attach",value:function(){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"attach",this).call(this),this.attributes=new n.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new m.default().insert(this.value(),(0,b.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(k,C){var j=n.default.query(k,n.default.Scope.BLOCK_ATTRIBUTE);j!=null&&this.attributes.attribute(j,C)}},{key:"formatAt",value:function(k,C,j,B){this.format(j,B)}},{key:"insertAt",value:function(k,C,j){if(typeof C=="string"&&C.endsWith(`
|
|
`)){var B=n.default.create(I.blotName);this.parent.insertBefore(B,k===0?this:this.next),B.insertAt(0,C.slice(0,-1))}else S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,k,C,j)}}]),v}(n.default.Embed);A.scope=n.default.Scope.BLOCK_BLOT;var I=function(E){D(v,E);function v(y){s(this,v);var k=g(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,y));return k.cache={},k}return O(v,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(n.default.Leaf).reduce(function(k,C){return C.length()===0?k:k.insert(C.value(),T(C))},new m.default).insert(`
|
|
`,T(this))),this.cache.delta}},{key:"deleteAt",value:function(k,C){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"deleteAt",this).call(this,k,C),this.cache={}}},{key:"formatAt",value:function(k,C,j,B){C<=0||(n.default.query(j,n.default.Scope.BLOCK)?k+C===this.length()&&this.format(j,B):S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"formatAt",this).call(this,k,Math.min(C,this.length()-k-1),j,B),this.cache={})}},{key:"insertAt",value:function(k,C,j){if(j!=null)return S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,k,C,j);if(C.length!==0){var B=C.split(`
|
|
`),W=B.shift();W.length>0&&(k<this.length()-1||this.children.tail==null?S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertAt",this).call(this,Math.min(k,this.length()-1),W):this.children.tail.insertAt(this.children.tail.length(),W),this.cache={});var q=this;B.reduce(function(M,L){return q=q.split(M,!0),q.insertAt(0,L),L.length},k+W.length)}}},{key:"insertBefore",value:function(k,C){var j=this.children.head;S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"insertBefore",this).call(this,k,C),j instanceof d.default&&j.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"length",this).call(this)+x),this.cache.length}},{key:"moveChildren",value:function(k,C){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"moveChildren",this).call(this,k,C),this.cache={}}},{key:"optimize",value:function(k){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"optimize",this).call(this,k),this.cache={}}},{key:"path",value:function(k){return S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"path",this).call(this,k,!0)}},{key:"removeChild",value:function(k){S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"removeChild",this).call(this,k),this.cache={}}},{key:"split",value:function(k){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(C&&(k===0||k>=this.length()-x)){var j=this.clone();return k===0?(this.parent.insertBefore(j,this),this):(this.parent.insertBefore(j,this.next),j)}else{var B=S(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"split",this).call(this,k,C);return this.cache={},B}}}]),v}(n.default.Block);I.blotName="block",I.tagName="P",I.defaultChild="break",I.allowedChildren=[h.default,n.default.Embed,u.default];function T(E){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E==null||(typeof E.formats=="function"&&(v=(0,b.default)(v,E.formats())),E.parent==null||E.parent.blotName=="scroll"||E.parent.statics.scope!==E.statics.scope)?v:T(E.parent,v)}i.bubbleFormats=T,i.BlockEmbed=A,i.default=I},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.overload=i.expandConfig=void 0;var O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},S=function(){function q(M,L){var N=[],P=!0,U=!1,F=void 0;try{for(var $=M[Symbol.iterator](),R;!(P=(R=$.next()).done)&&(N.push(R.value),!(L&&N.length===L));P=!0);}catch(z){U=!0,F=z}finally{try{!P&&$.return&&$.return()}finally{if(U)throw F}}return N}return function(M,L){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return q(M,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function q(M,L){for(var N=0;N<L.length;N++){var P=L[N];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(M,P.key,P)}}return function(M,L,N){return L&&q(M.prototype,L),N&&q(M,N),M}}();a(50);var b=a(2),_=T(b),m=a(14),c=T(m),n=a(8),r=T(n),d=a(9),f=T(d),h=a(0),l=T(h),u=a(15),p=T(u),s=a(3),g=T(s),D=a(10),x=T(D),A=a(34),I=T(A);function T(q){return q&&q.__esModule?q:{default:q}}function E(q,M,L){return M in q?Object.defineProperty(q,M,{value:L,enumerable:!0,configurable:!0,writable:!0}):q[M]=L,q}function v(q,M){if(!(q instanceof M))throw new TypeError("Cannot call a class as a function")}var y=(0,x.default)("quill"),k=function(){w(q,null,[{key:"debug",value:function(L){L===!0&&(L="log"),x.default.level(L)}},{key:"find",value:function(L){return L.__quill||l.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&y.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,N){var P=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var F=L.attrName||L.blotName;typeof F=="string"?this.register("formats/"+F,L,N):Object.keys(L).forEach(function($){P.register($,L[$],N)})}else this.imports[L]!=null&&!U&&y.warn("Overwriting "+L+" with",N),this.imports[L]=N,(L.startsWith("blots/")||L.startsWith("formats/"))&&N.blotName!=="abstract"?l.default.register(N):L.startsWith("modules")&&typeof N.register=="function"&&N.register()}}]);function q(M){var L=this,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(v(this,q),this.options=C(M,N),this.container=this.options.container,this.container==null)return y.error("Invalid Quill container",M);this.options.debug&&q.debug(this.options.debug);var P=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new r.default,this.scroll=l.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new c.default(this.scroll),this.selection=new p.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(r.default.events.EDITOR_CHANGE,function(F){F===r.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(r.default.events.SCROLL_UPDATE,function(F,$){var R=L.selection.lastRange,z=R&&R.length===0?R.index:void 0;j.call(L,function(){return L.editor.update(null,$,z)},F)});var U=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+P+"<p><br></p></div>");this.setContents(U),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return w(q,[{key:"addContainer",value:function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var P=L;L=document.createElement("div"),L.classList.add(P)}return this.container.insertBefore(L,N),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,N,P){var U=this,F=B(L,N,P),$=S(F,4);return L=$[0],N=$[1],P=$[3],j.call(this,function(){return U.editor.deleteText(L,N)},P,L,-1*N)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,N){var P=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.default.sources.API;return j.call(this,function(){var F=P.getSelection(!0),$=new _.default;if(F==null)return $;if(l.default.query(L,l.default.Scope.BLOCK))$=P.editor.formatLine(F.index,F.length,E({},L,N));else{if(F.length===0)return P.selection.format(L,N),$;$=P.editor.formatText(F.index,F.length,E({},L,N))}return P.setSelection(F,r.default.sources.SILENT),$},U)}},{key:"formatLine",value:function(L,N,P,U,F){var $=this,R=void 0,z=B(L,N,P,U,F),H=S(z,4);return L=H[0],N=H[1],R=H[2],F=H[3],j.call(this,function(){return $.editor.formatLine(L,N,R)},F,L,0)}},{key:"formatText",value:function(L,N,P,U,F){var $=this,R=void 0,z=B(L,N,P,U,F),H=S(z,4);return L=H[0],N=H[1],R=H[2],F=H[3],j.call(this,function(){return $.editor.formatText(L,N,R)},F,L,0)}},{key:"getBounds",value:function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=void 0;typeof L=="number"?P=this.selection.getBounds(L,N):P=this.selection.getBounds(L.index,L.length);var U=this.container.getBoundingClientRect();return{bottom:P.bottom-U.top,height:P.height,left:P.left-U.left,right:P.right-U.left,top:P.top-U.top,width:P.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,P=B(L,N),U=S(P,2);return L=U[0],N=U[1],this.editor.getContents(L,N)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,N):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,N)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,P=B(L,N),U=S(P,2);return L=U[0],N=U[1],this.editor.getText(L,N)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,N,P){var U=this,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:q.sources.API;return j.call(this,function(){return U.editor.insertEmbed(L,N,P)},F,L)}},{key:"insertText",value:function(L,N,P,U,F){var $=this,R=void 0,z=B(L,0,P,U,F),H=S(z,4);return L=H[0],R=H[2],F=H[3],j.call(this,function(){return $.editor.insertText(L,N,R)},F,L,N.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(L,N,P){this.clipboard.dangerouslyPasteHTML(L,N,P)}},{key:"removeFormat",value:function(L,N,P){var U=this,F=B(L,N,P),$=S(F,4);return L=$[0],N=$[1],P=$[3],j.call(this,function(){return U.editor.removeFormat(L,N)},P,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var N=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.default.sources.API;return j.call(this,function(){L=new _.default(L);var U=N.getLength(),F=N.editor.deleteText(0,U),$=N.editor.applyDelta(L),R=$.ops[$.ops.length-1];R!=null&&typeof R.insert=="string"&&R.insert[R.insert.length-1]===`
|
|
`&&(N.editor.deleteText(N.getLength()-1,1),$.delete(1));var z=F.compose($);return z},P)}},{key:"setSelection",value:function(L,N,P){if(L==null)this.selection.setRange(null,N||q.sources.API);else{var U=B(L,N,P),F=S(U,4);L=F[0],N=F[1],P=F[3],this.selection.setRange(new u.Range(L,N),P),P!==r.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.default.sources.API,P=new _.default().insert(L);return this.setContents(P,N)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.default.sources.USER,N=this.scroll.update(L);return this.selection.update(L),N}},{key:"updateContents",value:function(L){var N=this,P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.default.sources.API;return j.call(this,function(){return L=new _.default(L),N.editor.applyDelta(L,P)},P,!0)}}]),q}();k.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},k.events=r.default.events,k.sources=r.default.sources,k.version="1.3.7",k.imports={delta:_.default,parchment:l.default,"core/module":f.default,"core/theme":I.default};function C(q,M){if(M=(0,g.default)(!0,{container:q,modules:{clipboard:!0,keyboard:!0,history:!0}},M),!M.theme||M.theme===k.DEFAULTS.theme)M.theme=I.default;else if(M.theme=k.import("themes/"+M.theme),M.theme==null)throw new Error("Invalid theme "+M.theme+". Did you register it?");var L=(0,g.default)(!0,{},M.theme.DEFAULTS);[L,M].forEach(function(U){U.modules=U.modules||{},Object.keys(U.modules).forEach(function(F){U.modules[F]===!0&&(U.modules[F]={})})});var N=Object.keys(L.modules).concat(Object.keys(M.modules)),P=N.reduce(function(U,F){var $=k.import("modules/"+F);return $==null?y.error("Cannot load "+F+" module. Are you sure you registered it?"):U[F]=$.DEFAULTS||{},U},{});return M.modules!=null&&M.modules.toolbar&&M.modules.toolbar.constructor!==Object&&(M.modules.toolbar={container:M.modules.toolbar}),M=(0,g.default)(!0,{},k.DEFAULTS,{modules:P},L,M),["bounds","container","scrollingContainer"].forEach(function(U){typeof M[U]=="string"&&(M[U]=document.querySelector(M[U]))}),M.modules=Object.keys(M.modules).reduce(function(U,F){return M.modules[F]&&(U[F]=M.modules[F]),U},{}),M}function j(q,M,L,N){if(this.options.strict&&!this.isEnabled()&&M===r.default.sources.USER)return new _.default;var P=L==null?null:this.getSelection(),U=this.editor.delta,F=q();if(P!=null&&(L===!0&&(L=P.index),N==null?P=W(P,F,M):N!==0&&(P=W(P,L,N,M)),this.setSelection(P,r.default.sources.SILENT)),F.length()>0){var $,R=[r.default.events.TEXT_CHANGE,F,U,M];if(($=this.emitter).emit.apply($,[r.default.events.EDITOR_CHANGE].concat(R)),M!==r.default.sources.SILENT){var z;(z=this.emitter).emit.apply(z,R)}}return F}function B(q,M,L,N,P){var U={};return typeof q.index=="number"&&typeof q.length=="number"?typeof M!="number"?(P=N,N=L,L=M,M=q.length,q=q.index):(M=q.length,q=q.index):typeof M!="number"&&(P=N,N=L,L=M,M=0),(typeof L=="undefined"?"undefined":O(L))==="object"?(U=L,P=N):typeof L=="string"&&(N!=null?U[L]=N:P=L),P=P||r.default.sources.API,[q,M,U,P]}function W(q,M,L,N){if(q==null)return null;var P=void 0,U=void 0;if(M instanceof _.default){var F=[q.index,q.index+q.length].map(function(H){return M.transformPosition(H,N!==r.default.sources.USER)}),$=S(F,2);P=$[0],U=$[1]}else{var R=[q.index,q.index+q.length].map(function(H){return H<M||H===M&&N===r.default.sources.USER?H:L>=0?H+L:Math.max(M,H+L)}),z=S(R,2);P=z[0],U=z[1]}return new u.Range(P,U-P)}i.expandConfig=C,i.overload=B,i.default=k},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function h(l,u){for(var p=0;p<u.length;p++){var s=u[p];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,u,p){return u&&h(l.prototype,u),p&&h(l,p),l}}(),S=function h(l,u,p){l===null&&(l=Function.prototype);var s=Object.getOwnPropertyDescriptor(l,u);if(s===void 0){var g=Object.getPrototypeOf(l);return g===null?void 0:h(g,u,p)}else{if("value"in s)return s.value;var D=s.get;return D===void 0?void 0:D.call(p)}},w=a(7),b=c(w),_=a(0),m=c(_);function c(h){return h&&h.__esModule?h:{default:h}}function n(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function r(h,l){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:h}function d(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(h,l):h.__proto__=l)}var f=function(h){d(l,h);function l(){return n(this,l),r(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return O(l,[{key:"formatAt",value:function(p,s,g,D){if(l.compare(this.statics.blotName,g)<0&&m.default.query(g,m.default.Scope.BLOT)){var x=this.isolate(p,s);D&&x.wrap(g,D)}else S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"formatAt",this).call(this,p,s,g,D)}},{key:"optimize",value:function(p){if(S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"optimize",this).call(this,p),this.parent instanceof l&&l.compare(this.statics.blotName,this.parent.statics.blotName)>0){var s=this.parent.isolate(this.offset(),this.length());this.moveChildren(s),s.wrap(this)}}}],[{key:"compare",value:function(p,s){var g=l.order.indexOf(p),D=l.order.indexOf(s);return g>=0||D>=0?g-D:p===s?0:p<s?-1:1}}]),l}(m.default.Inline);f.allowedChildren=[f,m.default.Embed,b.default],f.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],i.default=f},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(0),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}function b(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function _(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function m(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var c=function(n){m(r,n);function r(){return b(this,r),_(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return r}(S.default.Text);i.default=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function u(p,s){for(var g=0;g<s.length;g++){var D=s[g];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(p,D.key,D)}}return function(p,s,g){return s&&u(p.prototype,s),g&&u(p,g),p}}(),S=function u(p,s,g){p===null&&(p=Function.prototype);var D=Object.getOwnPropertyDescriptor(p,s);if(D===void 0){var x=Object.getPrototypeOf(p);return x===null?void 0:u(x,s,g)}else{if("value"in D)return D.value;var A=D.get;return A===void 0?void 0:A.call(g)}},w=a(54),b=c(w),_=a(10),m=c(_);function c(u){return u&&u.__esModule?u:{default:u}}function n(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function r(u,p){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:u}function d(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(u,p):u.__proto__=p)}var f=(0,m.default)("quill:events"),h=["selectionchange","mousedown","mouseup","click"];h.forEach(function(u){document.addEventListener(u,function(){for(var p=arguments.length,s=Array(p),g=0;g<p;g++)s[g]=arguments[g];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(D){if(D.__quill&&D.__quill.emitter){var x;(x=D.__quill.emitter).handleDOM.apply(x,s)}})})});var l=function(u){d(p,u);function p(){n(this,p);var s=r(this,(p.__proto__||Object.getPrototypeOf(p)).call(this));return s.listeners={},s.on("error",f.error),s}return O(p,[{key:"emit",value:function(){f.log.apply(f,arguments),S(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(g){for(var D=arguments.length,x=Array(D>1?D-1:0),A=1;A<D;A++)x[A-1]=arguments[A];(this.listeners[g.type]||[]).forEach(function(I){var T=I.node,E=I.handler;(g.target===T||T.contains(g.target))&&E.apply(void 0,[g].concat(x))})}},{key:"listenDOM",value:function(g,D,x){this.listeners[g]||(this.listeners[g]=[]),this.listeners[g].push({node:D,handler:x})}}]),p}(b.default);l.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},l.sources={API:"api",SILENT:"silent",USER:"user"},i.default=l},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});function O(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}var S=function w(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};O(this,w),this.quill=b,this.options=_};S.DEFAULTS={},i.default=S},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=["error","warn","log","info"],S="warn";function w(_){if(O.indexOf(_)<=O.indexOf(S)){for(var m,c=arguments.length,n=Array(c>1?c-1:0),r=1;r<c;r++)n[r-1]=arguments[r];(m=console)[_].apply(m,n)}}function b(_){return O.reduce(function(m,c){return m[c]=w.bind(console,c,_),m},{})}w.level=b.level=function(_){S=_},i.default=b},function(e,i,a){var O=Array.prototype.slice,S=a(52),w=a(53),b=e.exports=function(n,r,d){return d||(d={}),n===r?!0:n instanceof Date&&r instanceof Date?n.getTime()===r.getTime():!n||!r||typeof n!="object"&&typeof r!="object"?d.strict?n===r:n==r:c(n,r,d)};function _(n){return n==null}function m(n){return!(!n||typeof n!="object"||typeof n.length!="number"||typeof n.copy!="function"||typeof n.slice!="function"||n.length>0&&typeof n[0]!="number")}function c(n,r,d){var f,h;if(_(n)||_(r)||n.prototype!==r.prototype)return!1;if(w(n))return w(r)?(n=O.call(n),r=O.call(r),b(n,r,d)):!1;if(m(n)){if(!m(r)||n.length!==r.length)return!1;for(f=0;f<n.length;f++)if(n[f]!==r[f])return!1;return!0}try{var l=S(n),u=S(r)}catch{return!1}if(l.length!=u.length)return!1;for(l.sort(),u.sort(),f=l.length-1;f>=0;f--)if(l[f]!=u[f])return!1;for(f=l.length-1;f>=0;f--)if(h=l[f],!b(n[h],r[h],d))return!1;return typeof n==typeof r}},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(1),S=function(){function w(b,_,m){m===void 0&&(m={}),this.attrName=b,this.keyName=_;var c=O.Scope.TYPE&O.Scope.ATTRIBUTE;m.scope!=null?this.scope=m.scope&O.Scope.LEVEL|c:this.scope=O.Scope.ATTRIBUTE,m.whitelist!=null&&(this.whitelist=m.whitelist)}return w.keys=function(b){return[].map.call(b.attributes,function(_){return _.name})},w.prototype.add=function(b,_){return this.canAdd(b,_)?(b.setAttribute(this.keyName,_),!0):!1},w.prototype.canAdd=function(b,_){var m=O.query(b,O.Scope.BLOT&(this.scope|O.Scope.TYPE));return m==null?!1:this.whitelist==null?!0:typeof _=="string"?this.whitelist.indexOf(_.replace(/["']/g,""))>-1:this.whitelist.indexOf(_)>-1},w.prototype.remove=function(b){b.removeAttribute(this.keyName)},w.prototype.value=function(b){var _=b.getAttribute(this.keyName);return this.canAdd(b,_)&&_?_:""},w}();i.default=S},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.Code=void 0;var O=function(){function A(I,T){var E=[],v=!0,y=!1,k=void 0;try{for(var C=I[Symbol.iterator](),j;!(v=(j=C.next()).done)&&(E.push(j.value),!(T&&E.length===T));v=!0);}catch(B){y=!0,k=B}finally{try{!v&&C.return&&C.return()}finally{if(y)throw k}}return E}return function(I,T){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return A(I,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(){function A(I,T){for(var E=0;E<T.length;E++){var v=T[E];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(I,v.key,v)}}return function(I,T,E){return T&&A(I.prototype,T),E&&A(I,E),I}}(),w=function A(I,T,E){I===null&&(I=Function.prototype);var v=Object.getOwnPropertyDescriptor(I,T);if(v===void 0){var y=Object.getPrototypeOf(I);return y===null?void 0:A(y,T,E)}else{if("value"in v)return v.value;var k=v.get;return k===void 0?void 0:k.call(E)}},b=a(2),_=u(b),m=a(0),c=u(m),n=a(4),r=u(n),d=a(6),f=u(d),h=a(7),l=u(h);function u(A){return A&&A.__esModule?A:{default:A}}function p(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function s(A,I){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:A}function g(A,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);A.prototype=Object.create(I&&I.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(A,I):A.__proto__=I)}var D=function(A){g(I,A);function I(){return p(this,I),s(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return I}(f.default);D.blotName="code",D.tagName="CODE";var x=function(A){g(I,A);function I(){return p(this,I),s(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}return S(I,[{key:"delta",value:function(){var E=this,v=this.domNode.textContent;return v.endsWith(`
|
|
`)&&(v=v.slice(0,-1)),v.split(`
|
|
`).reduce(function(y,k){return y.insert(k).insert(`
|
|
`,E.formats())},new _.default)}},{key:"format",value:function(E,v){if(!(E===this.statics.blotName&&v)){var y=this.descendant(l.default,this.length()-1),k=O(y,1),C=k[0];C!=null&&C.deleteAt(C.length()-1,1),w(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"format",this).call(this,E,v)}}},{key:"formatAt",value:function(E,v,y,k){if(v!==0&&!(c.default.query(y,c.default.Scope.BLOCK)==null||y===this.statics.blotName&&k===this.statics.formats(this.domNode))){var C=this.newlineIndex(E);if(!(C<0||C>=E+v)){var j=this.newlineIndex(E,!0)+1,B=C-j+1,W=this.isolate(j,B),q=W.next;W.format(y,k),q instanceof I&&q.formatAt(0,E-j+v-B,y,k)}}}},{key:"insertAt",value:function(E,v,y){if(y==null){var k=this.descendant(l.default,E),C=O(k,2),j=C[0],B=C[1];j.insertAt(B,v)}}},{key:"length",value:function(){var E=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
`)?E:E+1}},{key:"newlineIndex",value:function(E){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(v)return this.domNode.textContent.slice(0,E).lastIndexOf(`
|
|
`);var y=this.domNode.textContent.slice(E).indexOf(`
|
|
`);return y>-1?E+y:-1}},{key:"optimize",value:function(E){this.domNode.textContent.endsWith(`
|
|
`)||this.appendChild(c.default.create("text",`
|
|
`)),w(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"optimize",this).call(this,E);var v=this.next;v!=null&&v.prev===this&&v.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===v.statics.formats(v.domNode)&&(v.optimize(E),v.moveChildren(this),v.remove())}},{key:"replace",value:function(E){w(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"replace",this).call(this,E),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(v){var y=c.default.find(v);y==null?v.parentNode.removeChild(v):y instanceof c.default.Embed?y.remove():y.unwrap()})}}],[{key:"create",value:function(E){var v=w(I.__proto__||Object.getPrototypeOf(I),"create",this).call(this,E);return v.setAttribute("spellcheck",!1),v}},{key:"formats",value:function(){return!0}}]),I}(r.default);x.blotName="code-block",x.tagName="PRE",x.TAB=" ",i.Code=D,i.default=x},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},S=function(){function q(M,L){var N=[],P=!0,U=!1,F=void 0;try{for(var $=M[Symbol.iterator](),R;!(P=(R=$.next()).done)&&(N.push(R.value),!(L&&N.length===L));P=!0);}catch(z){U=!0,F=z}finally{try{!P&&$.return&&$.return()}finally{if(U)throw F}}return N}return function(M,L){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return q(M,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function q(M,L){for(var N=0;N<L.length;N++){var P=L[N];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(M,P.key,P)}}return function(M,L,N){return L&&q(M.prototype,L),N&&q(M,N),M}}(),b=a(2),_=v(b),m=a(20),c=v(m),n=a(0),r=v(n),d=a(13),f=v(d),h=a(24),l=v(h),u=a(4),p=v(u),s=a(16),g=v(s),D=a(21),x=v(D),A=a(11),I=v(A),T=a(3),E=v(T);function v(q){return q&&q.__esModule?q:{default:q}}function y(q,M,L){return M in q?Object.defineProperty(q,M,{value:L,enumerable:!0,configurable:!0,writable:!0}):q[M]=L,q}function k(q,M){if(!(q instanceof M))throw new TypeError("Cannot call a class as a function")}var C=/^[ -~]*$/,j=function(){function q(M){k(this,q),this.scroll=M,this.delta=this.getDelta()}return w(q,[{key:"applyDelta",value:function(L){var N=this,P=!1;this.scroll.update();var U=this.scroll.length();return this.scroll.batchStart(),L=W(L),L.reduce(function(F,$){var R=$.retain||$.delete||$.insert.length||1,z=$.attributes||{};if($.insert!=null){if(typeof $.insert=="string"){var H=$.insert;H.endsWith(`
|
|
`)&&P&&(P=!1,H=H.slice(0,-1)),F>=U&&!H.endsWith(`
|
|
`)&&(P=!0),N.scroll.insertAt(F,H);var G=N.scroll.line(F),X=S(G,2),J=X[0],tt=X[1],nt=(0,E.default)({},(0,u.bubbleFormats)(J));if(J instanceof p.default){var ot=J.descendant(r.default.Leaf,tt),ut=S(ot,1),lt=ut[0];nt=(0,E.default)(nt,(0,u.bubbleFormats)(lt))}z=c.default.attributes.diff(nt,z)||{}}else if(O($.insert)==="object"){var V=Object.keys($.insert)[0];if(V==null)return F;N.scroll.insertAt(F,V,$.insert[V])}U+=R}return Object.keys(z).forEach(function(K){N.scroll.formatAt(F,R,K,z[K])}),F+R},0),L.reduce(function(F,$){return typeof $.delete=="number"?(N.scroll.deleteAt(F,$.delete),F):F+($.retain||$.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,N){return this.scroll.deleteAt(L,N),this.update(new _.default().retain(L).delete(N))}},{key:"formatLine",value:function(L,N){var P=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(U).forEach(function(F){if(!(P.scroll.whitelist!=null&&!P.scroll.whitelist[F])){var $=P.scroll.lines(L,Math.max(N,1)),R=N;$.forEach(function(z){var H=z.length();if(!(z instanceof f.default))z.format(F,U[F]);else{var G=L-z.offset(P.scroll),X=z.newlineIndex(G+R)-G+1;z.formatAt(G,X,F,U[F])}R-=H})}}),this.scroll.optimize(),this.update(new _.default().retain(L).retain(N,(0,x.default)(U)))}},{key:"formatText",value:function(L,N){var P=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(U).forEach(function(F){P.scroll.formatAt(L,N,F,U[F])}),this.update(new _.default().retain(L).retain(N,(0,x.default)(U)))}},{key:"getContents",value:function(L,N){return this.delta.slice(L,L+N)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,N){return L.concat(N.delta())},new _.default)}},{key:"getFormat",value:function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=[],U=[];N===0?this.scroll.path(L).forEach(function($){var R=S($,1),z=R[0];z instanceof p.default?P.push(z):z instanceof r.default.Leaf&&U.push(z)}):(P=this.scroll.lines(L,N),U=this.scroll.descendants(r.default.Leaf,L,N));var F=[P,U].map(function($){if($.length===0)return{};for(var R=(0,u.bubbleFormats)($.shift());Object.keys(R).length>0;){var z=$.shift();if(z==null)return R;R=B((0,u.bubbleFormats)(z),R)}return R});return E.default.apply(E.default,F)}},{key:"getText",value:function(L,N){return this.getContents(L,N).filter(function(P){return typeof P.insert=="string"}).map(function(P){return P.insert}).join("")}},{key:"insertEmbed",value:function(L,N,P){return this.scroll.insertAt(L,N,P),this.update(new _.default().retain(L).insert(y({},N,P)))}},{key:"insertText",value:function(L,N){var P=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return N=N.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),this.scroll.insertAt(L,N),Object.keys(U).forEach(function(F){P.scroll.formatAt(L,N.length,F,U[F])}),this.update(new _.default().retain(L).insert(N,(0,x.default)(U)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==p.default.blotName||L.children.length>1?!1:L.children.head instanceof g.default}},{key:"removeFormat",value:function(L,N){var P=this.getText(L,N),U=this.scroll.line(L+N),F=S(U,2),$=F[0],R=F[1],z=0,H=new _.default;$!=null&&($ instanceof f.default?z=$.newlineIndex(R)-R+1:z=$.length()-R,H=$.delta().slice(R,R+z-1).insert(`
|
|
`));var G=this.getContents(L,N+z),X=G.diff(new _.default().insert(P).concat(H)),J=new _.default().retain(L).concat(X);return this.applyDelta(J)}},{key:"update",value:function(L){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,U=this.delta;if(N.length===1&&N[0].type==="characterData"&&N[0].target.data.match(C)&&r.default.find(N[0].target)){var F=r.default.find(N[0].target),$=(0,u.bubbleFormats)(F),R=F.offset(this.scroll),z=N[0].oldValue.replace(l.default.CONTENTS,""),H=new _.default().insert(z),G=new _.default().insert(F.value()),X=new _.default().retain(R).concat(H.diff(G,P));L=X.reduce(function(J,tt){return tt.insert?J.insert(tt.insert,$):J.push(tt)},new _.default),this.delta=U.compose(L)}else this.delta=this.getDelta(),(!L||!(0,I.default)(U.compose(L),this.delta))&&(L=U.diff(this.delta,P));return L}}]),q}();function B(q,M){return Object.keys(M).reduce(function(L,N){return q[N]==null||(M[N]===q[N]?L[N]=M[N]:Array.isArray(M[N])?M[N].indexOf(q[N])<0&&(L[N]=M[N].concat([q[N]])):L[N]=[M[N],q[N]]),L},{})}function W(q){return q.reduce(function(M,L){if(L.insert===1){var N=(0,x.default)(L.attributes);return delete N.image,M.insert({image:L.attributes.image},N)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,x.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var P=L.insert.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`);return M.insert(P,L.attributes)}return M.push(L)},new _.default)}i.default=j},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.Range=void 0;var O=function(){function A(I,T){var E=[],v=!0,y=!1,k=void 0;try{for(var C=I[Symbol.iterator](),j;!(v=(j=C.next()).done)&&(E.push(j.value),!(T&&E.length===T));v=!0);}catch(B){y=!0,k=B}finally{try{!v&&C.return&&C.return()}finally{if(y)throw k}}return E}return function(I,T){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return A(I,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(){function A(I,T){for(var E=0;E<T.length;E++){var v=T[E];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(I,v.key,v)}}return function(I,T,E){return T&&A(I.prototype,T),E&&A(I,E),I}}(),w=a(0),b=l(w),_=a(21),m=l(_),c=a(11),n=l(c),r=a(8),d=l(r),f=a(10),h=l(f);function l(A){return A&&A.__esModule?A:{default:A}}function u(A){if(Array.isArray(A)){for(var I=0,T=Array(A.length);I<A.length;I++)T[I]=A[I];return T}else return Array.from(A)}function p(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}var s=(0,h.default)("quill:selection"),g=function A(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;p(this,A),this.index=I,this.length=T},D=function(){function A(I,T){var E=this;p(this,A),this.emitter=T,this.scroll=I,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=b.default.create("cursor",this),this.lastRange=this.savedRange=new g(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){E.mouseDown||setTimeout(E.update.bind(E,d.default.sources.USER),1)}),this.emitter.on(d.default.events.EDITOR_CHANGE,function(v,y){v===d.default.events.TEXT_CHANGE&&y.length()>0&&E.update(d.default.sources.SILENT)}),this.emitter.on(d.default.events.SCROLL_BEFORE_UPDATE,function(){if(!!E.hasFocus()){var v=E.getNativeRange();v!=null&&v.start.node!==E.cursor.textNode&&E.emitter.once(d.default.events.SCROLL_UPDATE,function(){try{E.setNativeRange(v.start.node,v.start.offset,v.end.node,v.end.offset)}catch{}})}}),this.emitter.on(d.default.events.SCROLL_OPTIMIZE,function(v,y){if(y.range){var k=y.range,C=k.startNode,j=k.startOffset,B=k.endNode,W=k.endOffset;E.setNativeRange(C,j,B,W)}}),this.update(d.default.sources.SILENT)}return S(A,[{key:"handleComposition",value:function(){var T=this;this.root.addEventListener("compositionstart",function(){T.composing=!0}),this.root.addEventListener("compositionend",function(){if(T.composing=!1,T.cursor.parent){var E=T.cursor.restore();if(!E)return;setTimeout(function(){T.setNativeRange(E.startNode,E.startOffset,E.endNode,E.endOffset)},1)}})}},{key:"handleDragging",value:function(){var T=this;this.emitter.listenDOM("mousedown",document.body,function(){T.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){T.mouseDown=!1,T.update(d.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(T,E){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var v=this.getNativeRange();if(!(v==null||!v.native.collapsed||b.default.query(T,b.default.Scope.BLOCK))){if(v.start.node!==this.cursor.textNode){var y=b.default.find(v.start.node,!1);if(y==null)return;if(y instanceof b.default.Leaf){var k=y.split(v.start.offset);y.parent.insertBefore(this.cursor,k)}else y.insertBefore(this.cursor,v.start.node);this.cursor.attach()}this.cursor.format(T,E),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=this.scroll.length();T=Math.min(T,v-1),E=Math.min(T+E,v-1)-T;var y=void 0,k=this.scroll.leaf(T),C=O(k,2),j=C[0],B=C[1];if(j==null)return null;var W=j.position(B,!0),q=O(W,2);y=q[0],B=q[1];var M=document.createRange();if(E>0){M.setStart(y,B);var L=this.scroll.leaf(T+E),N=O(L,2);if(j=N[0],B=N[1],j==null)return null;var P=j.position(B,!0),U=O(P,2);return y=U[0],B=U[1],M.setEnd(y,B),M.getBoundingClientRect()}else{var F="left",$=void 0;return y instanceof Text?(B<y.data.length?(M.setStart(y,B),M.setEnd(y,B+1)):(M.setStart(y,B-1),M.setEnd(y,B),F="right"),$=M.getBoundingClientRect()):($=j.domNode.getBoundingClientRect(),B>0&&(F="right")),{bottom:$.top+$.height,height:$.height,left:$[F],right:$[F],top:$.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var E=T.getRangeAt(0);if(E==null)return null;var v=this.normalizeNative(E);return s.info("getNativeRange",v),v}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var E=this.normalizedToRange(T);return[E,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var E=this,v=[[T.start.node,T.start.offset]];T.native.collapsed||v.push([T.end.node,T.end.offset]);var y=v.map(function(j){var B=O(j,2),W=B[0],q=B[1],M=b.default.find(W,!0),L=M.offset(E.scroll);return q===0?L:M instanceof b.default.Container?L+M.length():L+M.index(W,q)}),k=Math.min(Math.max.apply(Math,u(y)),this.scroll.length()-1),C=Math.min.apply(Math,[k].concat(u(y)));return new g(C,k-C)}},{key:"normalizeNative",value:function(T){if(!x(this.root,T.startContainer)||!T.collapsed&&!x(this.root,T.endContainer))return null;var E={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[E.start,E.end].forEach(function(v){for(var y=v.node,k=v.offset;!(y instanceof Text)&&y.childNodes.length>0;)if(y.childNodes.length>k)y=y.childNodes[k],k=0;else if(y.childNodes.length===k)y=y.lastChild,k=y instanceof Text?y.data.length:y.childNodes.length+1;else break;v.node=y,v.offset=k}),E}},{key:"rangeToNative",value:function(T){var E=this,v=T.collapsed?[T.index]:[T.index,T.index+T.length],y=[],k=this.scroll.length();return v.forEach(function(C,j){C=Math.min(k-1,C);var B=void 0,W=E.scroll.leaf(C),q=O(W,2),M=q[0],L=q[1],N=M.position(L,j!==0),P=O(N,2);B=P[0],L=P[1],y.push(B,L)}),y.length<2&&(y=y.concat(y)),y}},{key:"scrollIntoView",value:function(T){var E=this.lastRange;if(E!=null){var v=this.getBounds(E.index,E.length);if(v!=null){var y=this.scroll.length()-1,k=this.scroll.line(Math.min(E.index,y)),C=O(k,1),j=C[0],B=j;if(E.length>0){var W=this.scroll.line(Math.min(E.index+E.length,y)),q=O(W,1);B=q[0]}if(!(j==null||B==null)){var M=T.getBoundingClientRect();v.top<M.top?T.scrollTop-=M.top-v.top:v.bottom>M.bottom&&(T.scrollTop+=v.bottom-M.bottom)}}}}},{key:"setNativeRange",value:function(T,E){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:E,k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(s.info("setNativeRange",T,E,v,y),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||v.parentNode==null))){var C=document.getSelection();if(C!=null)if(T!=null){this.hasFocus()||this.root.focus();var j=(this.getNativeRange()||{}).native;if(j==null||k||T!==j.startContainer||E!==j.startOffset||v!==j.endContainer||y!==j.endOffset){T.tagName=="BR"&&(E=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),v.tagName=="BR"&&(y=[].indexOf.call(v.parentNode.childNodes,v),v=v.parentNode);var B=document.createRange();B.setStart(T,E),B.setEnd(v,y),C.removeAllRanges(),C.addRange(B)}}else C.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.default.sources.API;if(typeof E=="string"&&(v=E,E=!1),s.info("setRange",T),T!=null){var y=this.rangeToNative(T);this.setNativeRange.apply(this,u(y).concat([E]))}else this.setNativeRange(null);this.update(v)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:d.default.sources.USER,E=this.lastRange,v=this.getRange(),y=O(v,2),k=y[0],C=y[1];if(this.lastRange=k,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,n.default)(E,this.lastRange)){var j;!this.composing&&C!=null&&C.native.collapsed&&C.start.node!==this.cursor.textNode&&this.cursor.restore();var B=[d.default.events.SELECTION_CHANGE,(0,m.default)(this.lastRange),(0,m.default)(E),T];if((j=this.emitter).emit.apply(j,[d.default.events.EDITOR_CHANGE].concat(B)),T!==d.default.sources.SILENT){var W;(W=this.emitter).emit.apply(W,B)}}}}]),A}();function x(A,I){try{I.parentNode}catch{return!1}return I instanceof Text&&(I=I.parentNode),A.contains(I)}i.Range=g,i.default=D},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function d(f,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,h,l){return h&&d(f.prototype,h),l&&d(f,l),f}}(),S=function d(f,h,l){f===null&&(f=Function.prototype);var u=Object.getOwnPropertyDescriptor(f,h);if(u===void 0){var p=Object.getPrototypeOf(f);return p===null?void 0:d(p,h,l)}else{if("value"in u)return u.value;var s=u.get;return s===void 0?void 0:s.call(l)}},w=a(0),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(){return m(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return O(f,[{key:"insertInto",value:function(l,u){l.children.length===0?S(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"insertInto",this).call(this,l,u):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),f}(b.default.Embed);r.blotName="break",r.tagName="BR",i.default=r},function(e,i,a){var O=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var d in r)r.hasOwnProperty(d)&&(n[d]=r[d])};return function(n,r){c(n,r);function d(){this.constructor=n}n.prototype=r===null?Object.create(r):(d.prototype=r.prototype,new d)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(44),w=a(30),b=a(1),_=function(c){O(n,c);function n(r){var d=c.call(this,r)||this;return d.build(),d}return n.prototype.appendChild=function(r){this.insertBefore(r)},n.prototype.attach=function(){c.prototype.attach.call(this),this.children.forEach(function(r){r.attach()})},n.prototype.build=function(){var r=this;this.children=new S.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(d){try{var f=m(d);r.insertBefore(f,r.children.head||void 0)}catch(h){if(h instanceof b.ParchmentError)return;throw h}})},n.prototype.deleteAt=function(r,d){if(r===0&&d===this.length())return this.remove();this.children.forEachAt(r,d,function(f,h,l){f.deleteAt(h,l)})},n.prototype.descendant=function(r,d){var f=this.children.find(d),h=f[0],l=f[1];return r.blotName==null&&r(h)||r.blotName!=null&&h instanceof r?[h,l]:h instanceof n?h.descendant(r,l):[null,-1]},n.prototype.descendants=function(r,d,f){d===void 0&&(d=0),f===void 0&&(f=Number.MAX_VALUE);var h=[],l=f;return this.children.forEachAt(d,f,function(u,p,s){(r.blotName==null&&r(u)||r.blotName!=null&&u instanceof r)&&h.push(u),u instanceof n&&(h=h.concat(u.descendants(r,p,l))),l-=s}),h},n.prototype.detach=function(){this.children.forEach(function(r){r.detach()}),c.prototype.detach.call(this)},n.prototype.formatAt=function(r,d,f,h){this.children.forEachAt(r,d,function(l,u,p){l.formatAt(u,p,f,h)})},n.prototype.insertAt=function(r,d,f){var h=this.children.find(r),l=h[0],u=h[1];if(l)l.insertAt(u,d,f);else{var p=f==null?b.create("text",d):b.create(d,f);this.appendChild(p)}},n.prototype.insertBefore=function(r,d){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(f){return r instanceof f}))throw new b.ParchmentError("Cannot insert "+r.statics.blotName+" into "+this.statics.blotName);r.insertInto(this,d)},n.prototype.length=function(){return this.children.reduce(function(r,d){return r+d.length()},0)},n.prototype.moveChildren=function(r,d){this.children.forEach(function(f){r.insertBefore(f,d)})},n.prototype.optimize=function(r){if(c.prototype.optimize.call(this,r),this.children.length===0)if(this.statics.defaultChild!=null){var d=b.create(this.statics.defaultChild);this.appendChild(d),d.optimize(r)}else this.remove()},n.prototype.path=function(r,d){d===void 0&&(d=!1);var f=this.children.find(r,d),h=f[0],l=f[1],u=[[this,r]];return h instanceof n?u.concat(h.path(l,d)):(h!=null&&u.push([h,l]),u)},n.prototype.removeChild=function(r){this.children.remove(r)},n.prototype.replace=function(r){r instanceof n&&r.moveChildren(this),c.prototype.replace.call(this,r)},n.prototype.split=function(r,d){if(d===void 0&&(d=!1),!d){if(r===0)return this;if(r===this.length())return this.next}var f=this.clone();return this.parent.insertBefore(f,this.next),this.children.forEachAt(r,this.length(),function(h,l,u){h=h.split(l,d),f.appendChild(h)}),f},n.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},n.prototype.update=function(r,d){var f=this,h=[],l=[];r.forEach(function(u){u.target===f.domNode&&u.type==="childList"&&(h.push.apply(h,u.addedNodes),l.push.apply(l,u.removedNodes))}),l.forEach(function(u){if(!(u.parentNode!=null&&u.tagName!=="IFRAME"&&document.body.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var p=b.find(u);p!=null&&(p.domNode.parentNode==null||p.domNode.parentNode===f.domNode)&&p.detach()}}),h.filter(function(u){return u.parentNode==f.domNode}).sort(function(u,p){return u===p?0:u.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(u){var p=null;u.nextSibling!=null&&(p=b.find(u.nextSibling));var s=m(u);(s.next!=p||s.next==null)&&(s.parent!=null&&s.parent.removeChild(f),f.insertBefore(s,p||void 0))})},n}(w.default);function m(c){var n=b.find(c);if(n==null)try{n=b.create(c)}catch{n=b.create(b.Scope.INLINE),[].slice.call(c.childNodes).forEach(function(d){n.domNode.appendChild(d)}),c.parentNode&&c.parentNode.replaceChild(n.domNode,c),n.attach()}return n}i.default=_},function(e,i,a){var O=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var d in r)r.hasOwnProperty(d)&&(n[d]=r[d])};return function(n,r){c(n,r);function d(){this.constructor=n}n.prototype=r===null?Object.create(r):(d.prototype=r.prototype,new d)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(12),w=a(31),b=a(17),_=a(1),m=function(c){O(n,c);function n(r){var d=c.call(this,r)||this;return d.attributes=new w.default(d.domNode),d}return n.formats=function(r){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return r.tagName.toLowerCase()},n.prototype.format=function(r,d){var f=_.query(r);f instanceof S.default?this.attributes.attribute(f,d):d&&f!=null&&(r!==this.statics.blotName||this.formats()[r]!==d)&&this.replaceWith(r,d)},n.prototype.formats=function(){var r=this.attributes.values(),d=this.statics.formats(this.domNode);return d!=null&&(r[this.statics.blotName]=d),r},n.prototype.replaceWith=function(r,d){var f=c.prototype.replaceWith.call(this,r,d);return this.attributes.copy(f),f},n.prototype.update=function(r,d){var f=this;c.prototype.update.call(this,r,d),r.some(function(h){return h.target===f.domNode&&h.type==="attributes"})&&this.attributes.build()},n.prototype.wrap=function(r,d){var f=c.prototype.wrap.call(this,r,d);return f instanceof n&&f.statics.scope===this.statics.scope&&this.attributes.move(f),f},n}(b.default);i.default=m},function(e,i,a){var O=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,c){m.__proto__=c}||function(m,c){for(var n in c)c.hasOwnProperty(n)&&(m[n]=c[n])};return function(m,c){_(m,c);function n(){this.constructor=m}m.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(30),w=a(1),b=function(_){O(m,_);function m(){return _!==null&&_.apply(this,arguments)||this}return m.value=function(c){return!0},m.prototype.index=function(c,n){return this.domNode===c||this.domNode.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1},m.prototype.position=function(c,n){var r=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return c>0&&(r+=1),[this.parent.domNode,r]},m.prototype.value=function(){var c;return c={},c[this.statics.blotName]=this.statics.value(this.domNode)||!0,c},m.scope=w.Scope.INLINE_BLOT,m}(S.default);i.default=b},function(e,i,a){var O=a(11),S=a(3),w={attributes:{compose:function(_,m,c){typeof _!="object"&&(_={}),typeof m!="object"&&(m={});var n=S(!0,{},m);c||(n=Object.keys(n).reduce(function(d,f){return n[f]!=null&&(d[f]=n[f]),d},{}));for(var r in _)_[r]!==void 0&&m[r]===void 0&&(n[r]=_[r]);return Object.keys(n).length>0?n:void 0},diff:function(_,m){typeof _!="object"&&(_={}),typeof m!="object"&&(m={});var c=Object.keys(_).concat(Object.keys(m)).reduce(function(n,r){return O(_[r],m[r])||(n[r]=m[r]===void 0?null:m[r]),n},{});return Object.keys(c).length>0?c:void 0},transform:function(_,m,c){if(typeof _!="object")return m;if(typeof m=="object"){if(!c)return m;var n=Object.keys(m).reduce(function(r,d){return _[d]===void 0&&(r[d]=m[d]),r},{});return Object.keys(n).length>0?n:void 0}}},iterator:function(_){return new b(_)},length:function(_){return typeof _.delete=="number"?_.delete:typeof _.retain=="number"?_.retain:typeof _.insert=="string"?_.insert.length:1}};function b(_){this.ops=_,this.index=0,this.offset=0}b.prototype.hasNext=function(){return this.peekLength()<1/0},b.prototype.next=function(_){_||(_=1/0);var m=this.ops[this.index];if(m){var c=this.offset,n=w.length(m);if(_>=n-c?(_=n-c,this.index+=1,this.offset=0):this.offset+=_,typeof m.delete=="number")return{delete:_};var r={};return m.attributes&&(r.attributes=m.attributes),typeof m.retain=="number"?r.retain=_:typeof m.insert=="string"?r.insert=m.insert.substr(c,_):r.insert=m.insert,r}else return{retain:1/0}},b.prototype.peek=function(){return this.ops[this.index]},b.prototype.peekLength=function(){return this.ops[this.index]?w.length(this.ops[this.index])-this.offset:1/0},b.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},b.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var _=this.offset,m=this.index,c=this.next(),n=this.ops.slice(this.index);return this.offset=_,this.index=m,[c].concat(n)}else return[]},e.exports=w},function(e,i){var a=function(){function O(f,h){return h!=null&&f instanceof h}var S;try{S=Map}catch{S=function(){}}var w;try{w=Set}catch{w=function(){}}var b;try{b=Promise}catch{b=function(){}}function _(f,h,l,u,p){typeof h=="object"&&(l=h.depth,u=h.prototype,p=h.includeNonEnumerable,h=h.circular);var s=[],g=[],D=typeof Buffer!="undefined";typeof h=="undefined"&&(h=!0),typeof l=="undefined"&&(l=1/0);function x(A,I){if(A===null)return null;if(I===0)return A;var T,E;if(typeof A!="object")return A;if(O(A,S))T=new S;else if(O(A,w))T=new w;else if(O(A,b))T=new b(function(M,L){A.then(function(N){M(x(N,I-1))},function(N){L(x(N,I-1))})});else if(_.__isArray(A))T=[];else if(_.__isRegExp(A))T=new RegExp(A.source,d(A)),A.lastIndex&&(T.lastIndex=A.lastIndex);else if(_.__isDate(A))T=new Date(A.getTime());else{if(D&&Buffer.isBuffer(A))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(A.length):T=new Buffer(A.length),A.copy(T),T;O(A,Error)?T=Object.create(A):typeof u=="undefined"?(E=Object.getPrototypeOf(A),T=Object.create(E)):(T=Object.create(u),E=u)}if(h){var v=s.indexOf(A);if(v!=-1)return g[v];s.push(A),g.push(T)}O(A,S)&&A.forEach(function(M,L){var N=x(L,I-1),P=x(M,I-1);T.set(N,P)}),O(A,w)&&A.forEach(function(M){var L=x(M,I-1);T.add(L)});for(var y in A){var k;E&&(k=Object.getOwnPropertyDescriptor(E,y)),!(k&&k.set==null)&&(T[y]=x(A[y],I-1))}if(Object.getOwnPropertySymbols)for(var C=Object.getOwnPropertySymbols(A),y=0;y<C.length;y++){var j=C[y],B=Object.getOwnPropertyDescriptor(A,j);B&&!B.enumerable&&!p||(T[j]=x(A[j],I-1),B.enumerable||Object.defineProperty(T,j,{enumerable:!1}))}if(p)for(var W=Object.getOwnPropertyNames(A),y=0;y<W.length;y++){var q=W[y],B=Object.getOwnPropertyDescriptor(A,q);B&&B.enumerable||(T[q]=x(A[q],I-1),Object.defineProperty(T,q,{enumerable:!1}))}return T}return x(f,l)}_.clonePrototype=function(h){if(h===null)return null;var l=function(){};return l.prototype=h,new l};function m(f){return Object.prototype.toString.call(f)}_.__objToStr=m;function c(f){return typeof f=="object"&&m(f)==="[object Date]"}_.__isDate=c;function n(f){return typeof f=="object"&&m(f)==="[object Array]"}_.__isArray=n;function r(f){return typeof f=="object"&&m(f)==="[object RegExp]"}_.__isRegExp=r;function d(f){var h="";return f.global&&(h+="g"),f.ignoreCase&&(h+="i"),f.multiline&&(h+="m"),h}return _.__getRegExpFlags=d,_}();typeof e=="object"&&e.exports&&(e.exports=a)},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function T(E,v){var y=[],k=!0,C=!1,j=void 0;try{for(var B=E[Symbol.iterator](),W;!(k=(W=B.next()).done)&&(y.push(W.value),!(v&&y.length===v));k=!0);}catch(q){C=!0,j=q}finally{try{!k&&B.return&&B.return()}finally{if(C)throw j}}return y}return function(E,v){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return T(E,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(){function T(E,v){for(var y=0;y<v.length;y++){var k=v[y];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,v,y){return v&&T(E.prototype,v),y&&T(E,y),E}}(),w=function T(E,v,y){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,v);if(k===void 0){var C=Object.getPrototypeOf(E);return C===null?void 0:T(C,v,y)}else{if("value"in k)return k.value;var j=k.get;return j===void 0?void 0:j.call(y)}},b=a(0),_=s(b),m=a(8),c=s(m),n=a(4),r=s(n),d=a(16),f=s(d),h=a(13),l=s(h),u=a(25),p=s(u);function s(T){return T&&T.__esModule?T:{default:T}}function g(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function D(T,E){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:T}function x(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);T.prototype=Object.create(E&&E.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(T,E):T.__proto__=E)}function A(T){return T instanceof r.default||T instanceof n.BlockEmbed}var I=function(T){x(E,T);function E(v,y){g(this,E);var k=D(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,v));return k.emitter=y.emitter,Array.isArray(y.whitelist)&&(k.whitelist=y.whitelist.reduce(function(C,j){return C[j]=!0,C},{})),k.domNode.addEventListener("DOMNodeInserted",function(){}),k.optimize(),k.enable(),k}return S(E,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(y,k){var C=this.line(y),j=O(C,2),B=j[0],W=j[1],q=this.line(y+k),M=O(q,1),L=M[0];if(w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"deleteAt",this).call(this,y,k),L!=null&&B!==L&&W>0){if(B instanceof n.BlockEmbed||L instanceof n.BlockEmbed){this.optimize();return}if(B instanceof l.default){var N=B.newlineIndex(B.length(),!0);if(N>-1&&(B=B.split(N+1),B===L)){this.optimize();return}}else if(L instanceof l.default){var P=L.newlineIndex(0);P>-1&&L.split(P+1)}var U=L.children.head instanceof f.default?null:L.children.head;B.moveChildren(L,U),B.remove()}this.optimize()}},{key:"enable",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",y)}},{key:"formatAt",value:function(y,k,C,j){this.whitelist!=null&&!this.whitelist[C]||(w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,y,k,C,j),this.optimize())}},{key:"insertAt",value:function(y,k,C){if(!(C!=null&&this.whitelist!=null&&!this.whitelist[k])){if(y>=this.length())if(C==null||_.default.query(k,_.default.Scope.BLOCK)==null){var j=_.default.create(this.statics.defaultChild);this.appendChild(j),C==null&&k.endsWith(`
|
|
`)&&(k=k.slice(0,-1)),j.insertAt(0,k,C)}else{var B=_.default.create(k,C);this.appendChild(B)}else w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,y,k,C);this.optimize()}}},{key:"insertBefore",value:function(y,k){if(y.statics.scope===_.default.Scope.INLINE_BLOT){var C=_.default.create(this.statics.defaultChild);C.appendChild(y),y=C}w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertBefore",this).call(this,y,k)}},{key:"leaf",value:function(y){return this.path(y).pop()||[null,-1]}},{key:"line",value:function(y){return y===this.length()?this.line(y-1):this.descendant(A,y)}},{key:"lines",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,C=function j(B,W,q){var M=[],L=q;return B.children.forEachAt(W,q,function(N,P,U){A(N)?M.push(N):N instanceof _.default.Container&&(M=M.concat(j(N,P,L))),L-=U}),M};return C(this,y,k)}},{key:"optimize",value:function(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,y,k),y.length>0&&this.emitter.emit(c.default.events.SCROLL_OPTIMIZE,y,k))}},{key:"path",value:function(y){return w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"path",this).call(this,y).slice(1)}},{key:"update",value:function(y){if(this.batch!==!0){var k=c.default.sources.USER;typeof y=="string"&&(k=y),Array.isArray(y)||(y=this.observer.takeRecords()),y.length>0&&this.emitter.emit(c.default.events.SCROLL_BEFORE_UPDATE,k,y),w(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"update",this).call(this,y.concat([])),y.length>0&&this.emitter.emit(c.default.events.SCROLL_UPDATE,k,y)}}}]),E}(_.default.Scroll);I.blotName="scroll",I.className="ql-editor",I.tagName="DIV",I.defaultChild="block",I.allowedChildren=[r.default,n.BlockEmbed,p.default],i.default=I},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.SHORTKEY=i.default=void 0;var O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},S=function(){function $(R,z){var H=[],G=!0,X=!1,J=void 0;try{for(var tt=R[Symbol.iterator](),nt;!(G=(nt=tt.next()).done)&&(H.push(nt.value),!(z&&H.length===z));G=!0);}catch(ot){X=!0,J=ot}finally{try{!G&&tt.return&&tt.return()}finally{if(X)throw J}}return H}return function(R,z){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return $(R,z);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function $(R,z){for(var H=0;H<z.length;H++){var G=z[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(R,G.key,G)}}return function(R,z,H){return z&&$(R.prototype,z),H&&$(R,H),R}}(),b=a(21),_=T(b),m=a(11),c=T(m),n=a(3),r=T(n),d=a(2),f=T(d),h=a(20),l=T(h),u=a(0),p=T(u),s=a(5),g=T(s),D=a(10),x=T(D),A=a(9),I=T(A);function T($){return $&&$.__esModule?$:{default:$}}function E($,R,z){return R in $?Object.defineProperty($,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):$[R]=z,$}function v($,R){if(!($ instanceof R))throw new TypeError("Cannot call a class as a function")}function y($,R){if(!$)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:$}function k($,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);$.prototype=Object.create(R&&R.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf($,R):$.__proto__=R)}var C=(0,x.default)("quill:keyboard"),j=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",B=function($){k(R,$),w(R,null,[{key:"match",value:function(H,G){return G=F(G),["altKey","ctrlKey","metaKey","shiftKey"].some(function(X){return!!G[X]!==H[X]&&G[X]!==null})?!1:G.key===(H.which||H.keyCode)}}]);function R(z,H){v(this,R);var G=y(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,z,H));return G.bindings={},Object.keys(G.options.bindings).forEach(function(X){X==="list autofill"&&z.scroll.whitelist!=null&&!z.scroll.whitelist.list||G.options.bindings[X]&&G.addBinding(G.options.bindings[X])}),G.addBinding({key:R.keys.ENTER,shiftKey:null},N),G.addBinding({key:R.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(G.addBinding({key:R.keys.BACKSPACE},{collapsed:!0},q),G.addBinding({key:R.keys.DELETE},{collapsed:!0},M)):(G.addBinding({key:R.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},q),G.addBinding({key:R.keys.DELETE},{collapsed:!0,suffix:/^.?$/},M)),G.addBinding({key:R.keys.BACKSPACE},{collapsed:!1},L),G.addBinding({key:R.keys.DELETE},{collapsed:!1},L),G.addBinding({key:R.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},q),G.listen(),G}return w(R,[{key:"addBinding",value:function(H){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},J=F(H);if(J==null||J.key==null)return C.warn("Attempted to add invalid keyboard binding",J);typeof G=="function"&&(G={handler:G}),typeof X=="function"&&(X={handler:X}),J=(0,r.default)(J,G,X),this.bindings[J.key]=this.bindings[J.key]||[],this.bindings[J.key].push(J)}},{key:"listen",value:function(){var H=this;this.quill.root.addEventListener("keydown",function(G){if(!G.defaultPrevented){var X=G.which||G.keyCode,J=(H.bindings[X]||[]).filter(function(st){return R.match(G,st)});if(J.length!==0){var tt=H.quill.getSelection();if(!(tt==null||!H.quill.hasFocus())){var nt=H.quill.getLine(tt.index),ot=S(nt,2),ut=ot[0],lt=ot[1],V=H.quill.getLeaf(tt.index),K=S(V,2),Y=K[0],Z=K[1],Q=tt.length===0?[Y,Z]:H.quill.getLeaf(tt.index+tt.length),et=S(Q,2),it=et[0],rt=et[1],ct=Y instanceof p.default.Text?Y.value().slice(0,Z):"",ft=it instanceof p.default.Text?it.value().slice(rt):"",at={collapsed:tt.length===0,empty:tt.length===0&&ut.length()<=1,format:H.quill.getFormat(tt),offset:lt,prefix:ct,suffix:ft},Zt=J.some(function(st){if(st.collapsed!=null&&st.collapsed!==at.collapsed||st.empty!=null&&st.empty!==at.empty||st.offset!=null&&st.offset!==at.offset)return!1;if(Array.isArray(st.format)){if(st.format.every(function(mt){return at.format[mt]==null}))return!1}else if(O(st.format)==="object"&&!Object.keys(st.format).every(function(mt){return st.format[mt]===!0?at.format[mt]!=null:st.format[mt]===!1?at.format[mt]==null:(0,c.default)(st.format[mt],at.format[mt])}))return!1;return st.prefix!=null&&!st.prefix.test(at.prefix)||st.suffix!=null&&!st.suffix.test(at.suffix)?!1:st.handler.call(H,tt,at)!==!0});Zt&&G.preventDefault()}}}})}}]),R}(I.default);B.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},B.DEFAULTS={bindings:{bold:U("bold"),italic:U("italic"),underline:U("underline"),indent:{key:B.keys.TAB,format:["blockquote","indent","list"],handler:function(R,z){if(z.collapsed&&z.offset!==0)return!0;this.quill.format("indent","+1",g.default.sources.USER)}},outdent:{key:B.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(R,z){if(z.collapsed&&z.offset!==0)return!0;this.quill.format("indent","-1",g.default.sources.USER)}},"outdent backspace":{key:B.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(R,z){z.format.indent!=null?this.quill.format("indent","-1",g.default.sources.USER):z.format.list!=null&&this.quill.format("list",!1,g.default.sources.USER)}},"indent code-block":P(!0),"outdent code-block":P(!1),"remove tab":{key:B.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(R){this.quill.deleteText(R.index-1,1,g.default.sources.USER)}},tab:{key:B.keys.TAB,handler:function(R){this.quill.history.cutoff();var z=new f.default().retain(R.index).delete(R.length).insert(" ");this.quill.updateContents(z,g.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(R.index+1,g.default.sources.SILENT)}},"list empty enter":{key:B.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(R,z){this.quill.format("list",!1,g.default.sources.USER),z.format.indent&&this.quill.format("indent",!1,g.default.sources.USER)}},"checklist enter":{key:B.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(R){var z=this.quill.getLine(R.index),H=S(z,2),G=H[0],X=H[1],J=(0,r.default)({},G.formats(),{list:"checked"}),tt=new f.default().retain(R.index).insert(`
|
|
`,J).retain(G.length()-X-1).retain(1,{list:"unchecked"});this.quill.updateContents(tt,g.default.sources.USER),this.quill.setSelection(R.index+1,g.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:B.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(R,z){var H=this.quill.getLine(R.index),G=S(H,2),X=G[0],J=G[1],tt=new f.default().retain(R.index).insert(`
|
|
`,z.format).retain(X.length()-J-1).retain(1,{header:null});this.quill.updateContents(tt,g.default.sources.USER),this.quill.setSelection(R.index+1,g.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(R,z){var H=z.prefix.length,G=this.quill.getLine(R.index),X=S(G,2),J=X[0],tt=X[1];if(tt>H)return!0;var nt=void 0;switch(z.prefix.trim()){case"[]":case"[ ]":nt="unchecked";break;case"[x]":nt="checked";break;case"-":case"*":nt="bullet";break;default:nt="ordered"}this.quill.insertText(R.index," ",g.default.sources.USER),this.quill.history.cutoff();var ot=new f.default().retain(R.index-tt).delete(H+1).retain(J.length()-2-tt).retain(1,{list:nt});this.quill.updateContents(ot,g.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(R.index-H,g.default.sources.SILENT)}},"code exit":{key:B.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(R){var z=this.quill.getLine(R.index),H=S(z,2),G=H[0],X=H[1],J=new f.default().retain(R.index+G.length()-X-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(J,g.default.sources.USER)}},"embed left":W(B.keys.LEFT,!1),"embed left shift":W(B.keys.LEFT,!0),"embed right":W(B.keys.RIGHT,!1),"embed right shift":W(B.keys.RIGHT,!0)}};function W($,R){var z,H=$===B.keys.LEFT?"prefix":"suffix";return z={key:$,shiftKey:R,altKey:null},E(z,H,/^$/),E(z,"handler",function(X){var J=X.index;$===B.keys.RIGHT&&(J+=X.length+1);var tt=this.quill.getLeaf(J),nt=S(tt,1),ot=nt[0];return ot instanceof p.default.Embed?($===B.keys.LEFT?R?this.quill.setSelection(X.index-1,X.length+1,g.default.sources.USER):this.quill.setSelection(X.index-1,g.default.sources.USER):R?this.quill.setSelection(X.index,X.length+1,g.default.sources.USER):this.quill.setSelection(X.index+X.length+1,g.default.sources.USER),!1):!0}),z}function q($,R){if(!($.index===0||this.quill.getLength()<=1)){var z=this.quill.getLine($.index),H=S(z,1),G=H[0],X={};if(R.offset===0){var J=this.quill.getLine($.index-1),tt=S(J,1),nt=tt[0];if(nt!=null&&nt.length()>1){var ot=G.formats(),ut=this.quill.getFormat($.index-1,1);X=l.default.attributes.diff(ot,ut)||{}}}var lt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(R.prefix)?2:1;this.quill.deleteText($.index-lt,lt,g.default.sources.USER),Object.keys(X).length>0&&this.quill.formatLine($.index-lt,lt,X,g.default.sources.USER),this.quill.focus()}}function M($,R){var z=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(R.suffix)?2:1;if(!($.index>=this.quill.getLength()-z)){var H={},G=0,X=this.quill.getLine($.index),J=S(X,1),tt=J[0];if(R.offset>=tt.length()-1){var nt=this.quill.getLine($.index+1),ot=S(nt,1),ut=ot[0];if(ut){var lt=tt.formats(),V=this.quill.getFormat($.index,1);H=l.default.attributes.diff(lt,V)||{},G=ut.length()}}this.quill.deleteText($.index,z,g.default.sources.USER),Object.keys(H).length>0&&this.quill.formatLine($.index+G-1,z,H,g.default.sources.USER)}}function L($){var R=this.quill.getLines($),z={};if(R.length>1){var H=R[0].formats(),G=R[R.length-1].formats();z=l.default.attributes.diff(G,H)||{}}this.quill.deleteText($,g.default.sources.USER),Object.keys(z).length>0&&this.quill.formatLine($.index,1,z,g.default.sources.USER),this.quill.setSelection($.index,g.default.sources.SILENT),this.quill.focus()}function N($,R){var z=this;$.length>0&&this.quill.scroll.deleteAt($.index,$.length);var H=Object.keys(R.format).reduce(function(G,X){return p.default.query(X,p.default.Scope.BLOCK)&&!Array.isArray(R.format[X])&&(G[X]=R.format[X]),G},{});this.quill.insertText($.index,`
|
|
`,H,g.default.sources.USER),this.quill.setSelection($.index+1,g.default.sources.SILENT),this.quill.focus(),Object.keys(R.format).forEach(function(G){H[G]==null&&(Array.isArray(R.format[G])||G!=="link"&&z.quill.format(G,R.format[G],g.default.sources.USER))})}function P($){return{key:B.keys.TAB,shiftKey:!$,format:{"code-block":!0},handler:function(z){var H=p.default.query("code-block"),G=z.index,X=z.length,J=this.quill.scroll.descendant(H,G),tt=S(J,2),nt=tt[0],ot=tt[1];if(nt!=null){var ut=this.quill.getIndex(nt),lt=nt.newlineIndex(ot,!0)+1,V=nt.newlineIndex(ut+ot+X),K=nt.domNode.textContent.slice(lt,V).split(`
|
|
`);ot=0,K.forEach(function(Y,Z){$?(nt.insertAt(lt+ot,H.TAB),ot+=H.TAB.length,Z===0?G+=H.TAB.length:X+=H.TAB.length):Y.startsWith(H.TAB)&&(nt.deleteAt(lt+ot,H.TAB.length),ot-=H.TAB.length,Z===0?G-=H.TAB.length:X-=H.TAB.length),ot+=Y.length+1}),this.quill.update(g.default.sources.USER),this.quill.setSelection(G,X,g.default.sources.SILENT)}}}}function U($){return{key:$[0].toUpperCase(),shortKey:!0,handler:function(z,H){this.quill.format($,!H.format[$],g.default.sources.USER)}}}function F($){if(typeof $=="string"||typeof $=="number")return F({key:$});if((typeof $=="undefined"?"undefined":O($))==="object"&&($=(0,_.default)($,!1)),typeof $.key=="string")if(B.keys[$.key.toUpperCase()]!=null)$.key=B.keys[$.key.toUpperCase()];else if($.key.length===1)$.key=$.key.toUpperCase().charCodeAt(0);else return null;return $.shortKey&&($[j]=$.shortKey,delete $.shortKey),$}i.default=B,i.SHORTKEY=j},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function l(u,p){var s=[],g=!0,D=!1,x=void 0;try{for(var A=u[Symbol.iterator](),I;!(g=(I=A.next()).done)&&(s.push(I.value),!(p&&s.length===p));g=!0);}catch(T){D=!0,x=T}finally{try{!g&&A.return&&A.return()}finally{if(D)throw x}}return s}return function(u,p){if(Array.isArray(u))return u;if(Symbol.iterator in Object(u))return l(u,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function l(u,p,s){u===null&&(u=Function.prototype);var g=Object.getOwnPropertyDescriptor(u,p);if(g===void 0){var D=Object.getPrototypeOf(u);return D===null?void 0:l(D,p,s)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(s)}},w=function(){function l(u,p){for(var s=0;s<p.length;s++){var g=p[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}return function(u,p,s){return p&&l(u.prototype,p),s&&l(u,s),u}}(),b=a(0),_=n(b),m=a(7),c=n(m);function n(l){return l&&l.__esModule?l:{default:l}}function r(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function d(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function f(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var h=function(l){f(u,l),w(u,null,[{key:"value",value:function(){}}]);function u(p,s){r(this,u);var g=d(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,p));return g.selection=s,g.textNode=document.createTextNode(u.CONTENTS),g.domNode.appendChild(g.textNode),g._length=0,g}return w(u,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(s,g){if(this._length!==0)return S(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"format",this).call(this,s,g);for(var D=this,x=0;D!=null&&D.statics.scope!==_.default.Scope.BLOCK_BLOT;)x+=D.offset(D.parent),D=D.parent;D!=null&&(this._length=u.CONTENTS.length,D.optimize(),D.formatAt(x,u.CONTENTS.length,s,g),this._length=0)}},{key:"index",value:function(s,g){return s===this.textNode?0:S(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"index",this).call(this,s,g)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){S(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var s=this.textNode,g=this.selection.getNativeRange(),D=void 0,x=void 0,A=void 0;if(g!=null&&g.start.node===s&&g.end.node===s){var I=[s,g.start.offset,g.end.offset];D=I[0],x=I[1],A=I[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==u.CONTENTS){var T=this.textNode.data.split(u.CONTENTS).join("");this.next instanceof c.default?(D=this.next.domNode,this.next.insertAt(0,T),this.textNode.data=u.CONTENTS):(this.textNode.data=T,this.parent.insertBefore(_.default.create(this.textNode),this),this.textNode=document.createTextNode(u.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),x!=null){var E=[x,A].map(function(y){return Math.max(0,Math.min(D.data.length,y-1))}),v=O(E,2);return x=v[0],A=v[1],{startNode:D,startOffset:x,endNode:D,endOffset:A}}}}},{key:"update",value:function(s,g){var D=this;if(s.some(function(A){return A.type==="characterData"&&A.target===D.textNode})){var x=this.restore();x&&(g.range=x)}}},{key:"value",value:function(){return""}}]),u}(_.default.Embed);h.blotName="cursor",h.className="ql-cursor",h.tagName="span",h.CONTENTS="\uFEFF",i.default=h},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(0),S=_(O),w=a(4),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(){return m(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(S.default.Container);r.allowedChildren=[b.default,w.BlockEmbed,r],i.default=r},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.ColorStyle=i.ColorClass=i.ColorAttributor=void 0;var O=function(){function h(l,u){for(var p=0;p<u.length;p++){var s=u[p];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,u,p){return u&&h(l.prototype,u),p&&h(l,p),l}}(),S=function h(l,u,p){l===null&&(l=Function.prototype);var s=Object.getOwnPropertyDescriptor(l,u);if(s===void 0){var g=Object.getPrototypeOf(l);return g===null?void 0:h(g,u,p)}else{if("value"in s)return s.value;var D=s.get;return D===void 0?void 0:D.call(p)}},w=a(0),b=_(w);function _(h){return h&&h.__esModule?h:{default:h}}function m(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function c(h,l){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:h}function n(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(h,l):h.__proto__=l)}var r=function(h){n(l,h);function l(){return m(this,l),c(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return O(l,[{key:"value",value:function(p){var s=S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this).call(this,p);return s.startsWith("rgb(")?(s=s.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+s.split(",").map(function(g){return("00"+parseInt(g).toString(16)).slice(-2)}).join("")):s}}]),l}(b.default.Attributor.Style),d=new b.default.Attributor.Class("color","ql-color",{scope:b.default.Scope.INLINE}),f=new r("color","color",{scope:b.default.Scope.INLINE});i.ColorAttributor=r,i.ColorClass=d,i.ColorStyle=f},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.sanitize=i.default=void 0;var O=function(){function f(h,l){for(var u=0;u<l.length;u++){var p=l[u];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,l,u){return l&&f(h.prototype,l),u&&f(h,u),h}}(),S=function f(h,l,u){h===null&&(h=Function.prototype);var p=Object.getOwnPropertyDescriptor(h,l);if(p===void 0){var s=Object.getPrototypeOf(h);return s===null?void 0:f(s,l,u)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(u)}},w=a(6),b=_(w);function _(f){return f&&f.__esModule?f:{default:f}}function m(f,h){if(!(f instanceof h))throw new TypeError("Cannot call a class as a function")}function c(f,h){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:f}function n(f,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);f.prototype=Object.create(h&&h.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(f,h):f.__proto__=h)}var r=function(f){n(h,f);function h(){return m(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return O(h,[{key:"format",value:function(u,p){if(u!==this.statics.blotName||!p)return S(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"format",this).call(this,u,p);p=this.constructor.sanitize(p),this.domNode.setAttribute("href",p)}}],[{key:"create",value:function(u){var p=S(h.__proto__||Object.getPrototypeOf(h),"create",this).call(this,u);return u=this.sanitize(u),p.setAttribute("href",u),p.setAttribute("rel","noopener noreferrer"),p.setAttribute("target","_blank"),p}},{key:"formats",value:function(u){return u.getAttribute("href")}},{key:"sanitize",value:function(u){return d(u,this.PROTOCOL_WHITELIST)?u:this.SANITIZED_URL}}]),h}(b.default);r.blotName="link",r.tagName="A",r.SANITIZED_URL="about:blank",r.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function d(f,h){var l=document.createElement("a");l.href=f;var u=l.href.slice(0,l.href.indexOf(":"));return h.indexOf(u)>-1}i.default=r,i.sanitize=d},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},S=function(){function h(l,u){for(var p=0;p<u.length;p++){var s=u[p];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,u,p){return u&&h(l.prototype,u),p&&h(l,p),l}}(),w=a(23),b=c(w),_=a(107),m=c(_);function c(h){return h&&h.__esModule?h:{default:h}}function n(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}var r=0;function d(h,l){h.setAttribute(l,h.getAttribute(l)!=="true")}var f=function(){function h(l){var u=this;n(this,h),this.select=l,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){u.togglePicker()}),this.label.addEventListener("keydown",function(p){switch(p.keyCode){case b.default.keys.ENTER:u.togglePicker();break;case b.default.keys.ESCAPE:u.escape(),p.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return S(h,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),d(this.label,"aria-expanded"),d(this.options,"aria-hidden")}},{key:"buildItem",value:function(u){var p=this,s=document.createElement("span");return s.tabIndex="0",s.setAttribute("role","button"),s.classList.add("ql-picker-item"),u.hasAttribute("value")&&s.setAttribute("data-value",u.getAttribute("value")),u.textContent&&s.setAttribute("data-label",u.textContent),s.addEventListener("click",function(){p.selectItem(s,!0)}),s.addEventListener("keydown",function(g){switch(g.keyCode){case b.default.keys.ENTER:p.selectItem(s,!0),g.preventDefault();break;case b.default.keys.ESCAPE:p.escape(),g.preventDefault();break}}),s}},{key:"buildLabel",value:function(){var u=document.createElement("span");return u.classList.add("ql-picker-label"),u.innerHTML=m.default,u.tabIndex="0",u.setAttribute("role","button"),u.setAttribute("aria-expanded","false"),this.container.appendChild(u),u}},{key:"buildOptions",value:function(){var u=this,p=document.createElement("span");p.classList.add("ql-picker-options"),p.setAttribute("aria-hidden","true"),p.tabIndex="-1",p.id="ql-picker-options-"+r,r+=1,this.label.setAttribute("aria-controls",p.id),this.options=p,[].slice.call(this.select.options).forEach(function(s){var g=u.buildItem(s);p.appendChild(g),s.selected===!0&&u.selectItem(g)}),this.container.appendChild(p)}},{key:"buildPicker",value:function(){var u=this;[].slice.call(this.select.attributes).forEach(function(p){u.container.setAttribute(p.name,p.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var u=this;this.close(),setTimeout(function(){return u.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=this.container.querySelector(".ql-selected");if(u!==s&&(s!=null&&s.classList.remove("ql-selected"),u!=null&&(u.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(u.parentNode.children,u),u.hasAttribute("data-value")?this.label.setAttribute("data-value",u.getAttribute("data-value")):this.label.removeAttribute("data-value"),u.hasAttribute("data-label")?this.label.setAttribute("data-label",u.getAttribute("data-label")):this.label.removeAttribute("data-label"),p))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event=="undefined"?"undefined":O(Event))==="object"){var g=document.createEvent("Event");g.initEvent("change",!0,!0),this.select.dispatchEvent(g)}this.close()}}},{key:"update",value:function(){var u=void 0;if(this.select.selectedIndex>-1){var p=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];u=this.select.options[this.select.selectedIndex],this.selectItem(p)}else this.selectItem(null);var s=u!=null&&u!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",s)}}]),h}();i.default=f},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(0),S=C(O),w=a(5),b=C(w),_=a(4),m=C(_),c=a(16),n=C(c),r=a(25),d=C(r),f=a(24),h=C(f),l=a(35),u=C(l),p=a(6),s=C(p),g=a(22),D=C(g),x=a(7),A=C(x),I=a(55),T=C(I),E=a(42),v=C(E),y=a(23),k=C(y);function C(j){return j&&j.__esModule?j:{default:j}}b.default.register({"blots/block":m.default,"blots/block/embed":_.BlockEmbed,"blots/break":n.default,"blots/container":d.default,"blots/cursor":h.default,"blots/embed":u.default,"blots/inline":s.default,"blots/scroll":D.default,"blots/text":A.default,"modules/clipboard":T.default,"modules/history":v.default,"modules/keyboard":k.default}),S.default.register(m.default,n.default,h.default,s.default,D.default,A.default),i.default=b.default},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(1),S=function(){function w(b){this.domNode=b,this.domNode[O.DATA_KEY]={blot:this}}return Object.defineProperty(w.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),w.create=function(b){if(this.tagName==null)throw new O.ParchmentError("Blot definition missing tagName");var _;return Array.isArray(this.tagName)?(typeof b=="string"&&(b=b.toUpperCase(),parseInt(b).toString()===b&&(b=parseInt(b))),typeof b=="number"?_=document.createElement(this.tagName[b-1]):this.tagName.indexOf(b)>-1?_=document.createElement(b):_=document.createElement(this.tagName[0])):_=document.createElement(this.tagName),this.className&&_.classList.add(this.className),_},w.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},w.prototype.clone=function(){var b=this.domNode.cloneNode(!1);return O.create(b)},w.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[O.DATA_KEY]},w.prototype.deleteAt=function(b,_){var m=this.isolate(b,_);m.remove()},w.prototype.formatAt=function(b,_,m,c){var n=this.isolate(b,_);if(O.query(m,O.Scope.BLOT)!=null&&c)n.wrap(m,c);else if(O.query(m,O.Scope.ATTRIBUTE)!=null){var r=O.create(this.statics.scope);n.wrap(r),r.format(m,c)}},w.prototype.insertAt=function(b,_,m){var c=m==null?O.create("text",_):O.create(_,m),n=this.split(b);this.parent.insertBefore(c,n)},w.prototype.insertInto=function(b,_){_===void 0&&(_=null),this.parent!=null&&this.parent.children.remove(this);var m=null;b.children.insertBefore(this,_),_!=null&&(m=_.domNode),(this.domNode.parentNode!=b.domNode||this.domNode.nextSibling!=m)&&b.domNode.insertBefore(this.domNode,m),this.parent=b,this.attach()},w.prototype.isolate=function(b,_){var m=this.split(b);return m.split(_),m},w.prototype.length=function(){return 1},w.prototype.offset=function(b){return b===void 0&&(b=this.parent),this.parent==null||this==b?0:this.parent.children.offset(this)+this.parent.offset(b)},w.prototype.optimize=function(b){this.domNode[O.DATA_KEY]!=null&&delete this.domNode[O.DATA_KEY].mutations},w.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},w.prototype.replace=function(b){b.parent!=null&&(b.parent.insertBefore(this,b.next),b.remove())},w.prototype.replaceWith=function(b,_){var m=typeof b=="string"?O.create(b,_):b;return m.replace(this),m},w.prototype.split=function(b,_){return b===0?this:this.next},w.prototype.update=function(b,_){},w.prototype.wrap=function(b,_){var m=typeof b=="string"?O.create(b,_):b;return this.parent!=null&&this.parent.insertBefore(m,this.next),m.appendChild(this),m},w.blotName="abstract",w}();i.default=S},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(12),S=a(32),w=a(33),b=a(1),_=function(){function m(c){this.attributes={},this.domNode=c,this.build()}return m.prototype.attribute=function(c,n){n?c.add(this.domNode,n)&&(c.value(this.domNode)!=null?this.attributes[c.attrName]=c:delete this.attributes[c.attrName]):(c.remove(this.domNode),delete this.attributes[c.attrName])},m.prototype.build=function(){var c=this;this.attributes={};var n=O.default.keys(this.domNode),r=S.default.keys(this.domNode),d=w.default.keys(this.domNode);n.concat(r).concat(d).forEach(function(f){var h=b.query(f,b.Scope.ATTRIBUTE);h instanceof O.default&&(c.attributes[h.attrName]=h)})},m.prototype.copy=function(c){var n=this;Object.keys(this.attributes).forEach(function(r){var d=n.attributes[r].value(n.domNode);c.format(r,d)})},m.prototype.move=function(c){var n=this;this.copy(c),Object.keys(this.attributes).forEach(function(r){n.attributes[r].remove(n.domNode)}),this.attributes={}},m.prototype.values=function(){var c=this;return Object.keys(this.attributes).reduce(function(n,r){return n[r]=c.attributes[r].value(c.domNode),n},{})},m}();i.default=_},function(e,i,a){var O=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,c){m.__proto__=c}||function(m,c){for(var n in c)c.hasOwnProperty(n)&&(m[n]=c[n])};return function(m,c){_(m,c);function n(){this.constructor=m}m.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(12);function w(_,m){var c=_.getAttribute("class")||"";return c.split(/\s+/).filter(function(n){return n.indexOf(m+"-")===0})}var b=function(_){O(m,_);function m(){return _!==null&&_.apply(this,arguments)||this}return m.keys=function(c){return(c.getAttribute("class")||"").split(/\s+/).map(function(n){return n.split("-").slice(0,-1).join("-")})},m.prototype.add=function(c,n){return this.canAdd(c,n)?(this.remove(c),c.classList.add(this.keyName+"-"+n),!0):!1},m.prototype.remove=function(c){var n=w(c,this.keyName);n.forEach(function(r){c.classList.remove(r)}),c.classList.length===0&&c.removeAttribute("class")},m.prototype.value=function(c){var n=w(c,this.keyName)[0]||"",r=n.slice(this.keyName.length+1);return this.canAdd(c,r)?r:""},m}(S.default);i.default=b},function(e,i,a){var O=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,c){m.__proto__=c}||function(m,c){for(var n in c)c.hasOwnProperty(n)&&(m[n]=c[n])};return function(m,c){_(m,c);function n(){this.constructor=m}m.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(12);function w(_){var m=_.split("-"),c=m.slice(1).map(function(n){return n[0].toUpperCase()+n.slice(1)}).join("");return m[0]+c}var b=function(_){O(m,_);function m(){return _!==null&&_.apply(this,arguments)||this}return m.keys=function(c){return(c.getAttribute("style")||"").split(";").map(function(n){var r=n.split(":");return r[0].trim()})},m.prototype.add=function(c,n){return this.canAdd(c,n)?(c.style[w(this.keyName)]=n,!0):!1},m.prototype.remove=function(c){c.style[w(this.keyName)]="",c.getAttribute("style")||c.removeAttribute("style")},m.prototype.value=function(c){var n=c.style[w(this.keyName)];return this.canAdd(c,n)?n:""},m}(S.default);i.default=b},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function b(_,m){for(var c=0;c<m.length;c++){var n=m[c];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(_,n.key,n)}}return function(_,m,c){return m&&b(_.prototype,m),c&&b(_,c),_}}();function S(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}var w=function(){function b(_,m){S(this,b),this.quill=_,this.options=m,this.modules={}}return O(b,[{key:"init",value:function(){var m=this;Object.keys(this.options.modules).forEach(function(c){m.modules[c]==null&&m.addModule(c)})}},{key:"addModule",value:function(m){var c=this.quill.constructor.import("modules/"+m);return this.modules[m]=new c(this.quill,this.options.modules[m]||{}),this.modules[m]}}]),b}();w.DEFAULTS={modules:{}},w.themes={default:w},i.default=w},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function l(u,p){for(var s=0;s<p.length;s++){var g=p[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}return function(u,p,s){return p&&l(u.prototype,p),s&&l(u,s),u}}(),S=function l(u,p,s){u===null&&(u=Function.prototype);var g=Object.getOwnPropertyDescriptor(u,p);if(g===void 0){var D=Object.getPrototypeOf(u);return D===null?void 0:l(D,p,s)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(s)}},w=a(0),b=c(w),_=a(7),m=c(_);function c(l){return l&&l.__esModule?l:{default:l}}function n(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function r(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function d(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var f="\uFEFF",h=function(l){d(u,l);function u(p){n(this,u);var s=r(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,p));return s.contentNode=document.createElement("span"),s.contentNode.setAttribute("contenteditable",!1),[].slice.call(s.domNode.childNodes).forEach(function(g){s.contentNode.appendChild(g)}),s.leftGuard=document.createTextNode(f),s.rightGuard=document.createTextNode(f),s.domNode.appendChild(s.leftGuard),s.domNode.appendChild(s.contentNode),s.domNode.appendChild(s.rightGuard),s}return O(u,[{key:"index",value:function(s,g){return s===this.leftGuard?0:s===this.rightGuard?1:S(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"index",this).call(this,s,g)}},{key:"restore",value:function(s){var g=void 0,D=void 0,x=s.data.split(f).join("");if(s===this.leftGuard)if(this.prev instanceof m.default){var A=this.prev.length();this.prev.insertAt(A,x),g={startNode:this.prev.domNode,startOffset:A+x.length}}else D=document.createTextNode(x),this.parent.insertBefore(b.default.create(D),this),g={startNode:D,startOffset:x.length};else s===this.rightGuard&&(this.next instanceof m.default?(this.next.insertAt(0,x),g={startNode:this.next.domNode,startOffset:x.length}):(D=document.createTextNode(x),this.parent.insertBefore(b.default.create(D),this.next),g={startNode:D,startOffset:x.length}));return s.data=f,g}},{key:"update",value:function(s,g){var D=this;s.forEach(function(x){if(x.type==="characterData"&&(x.target===D.leftGuard||x.target===D.rightGuard)){var A=D.restore(x.target);A&&(g.range=A)}})}}]),u}(b.default.Embed);i.default=h},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.AlignStyle=i.AlignClass=i.AlignAttribute=void 0;var O=a(0),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}var b={scope:S.default.Scope.BLOCK,whitelist:["right","center","justify"]},_=new S.default.Attributor.Attribute("align","align",b),m=new S.default.Attributor.Class("align","ql-align",b),c=new S.default.Attributor.Style("align","text-align",b);i.AlignAttribute=_,i.AlignClass=m,i.AlignStyle=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.BackgroundStyle=i.BackgroundClass=void 0;var O=a(0),S=b(O),w=a(26);function b(c){return c&&c.__esModule?c:{default:c}}var _=new S.default.Attributor.Class("background","ql-bg",{scope:S.default.Scope.INLINE}),m=new w.ColorAttributor("background","background-color",{scope:S.default.Scope.INLINE});i.BackgroundClass=_,i.BackgroundStyle=m},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.DirectionStyle=i.DirectionClass=i.DirectionAttribute=void 0;var O=a(0),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}var b={scope:S.default.Scope.BLOCK,whitelist:["rtl"]},_=new S.default.Attributor.Attribute("direction","dir",b),m=new S.default.Attributor.Class("direction","ql-direction",b),c=new S.default.Attributor.Style("direction","direction",b);i.DirectionAttribute=_,i.DirectionClass=m,i.DirectionStyle=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.FontClass=i.FontStyle=void 0;var O=function(){function l(u,p){for(var s=0;s<p.length;s++){var g=p[s];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(u,g.key,g)}}return function(u,p,s){return p&&l(u.prototype,p),s&&l(u,s),u}}(),S=function l(u,p,s){u===null&&(u=Function.prototype);var g=Object.getOwnPropertyDescriptor(u,p);if(g===void 0){var D=Object.getPrototypeOf(u);return D===null?void 0:l(D,p,s)}else{if("value"in g)return g.value;var x=g.get;return x===void 0?void 0:x.call(s)}},w=a(0),b=_(w);function _(l){return l&&l.__esModule?l:{default:l}}function m(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function c(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function n(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var r={scope:b.default.Scope.INLINE,whitelist:["serif","monospace"]},d=new b.default.Attributor.Class("font","ql-font",r),f=function(l){n(u,l);function u(){return m(this,u),c(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return O(u,[{key:"value",value:function(s){return S(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"value",this).call(this,s).replace(/["']/g,"")}}]),u}(b.default.Attributor.Style),h=new f("font","font-family",r);i.FontStyle=h,i.FontClass=d},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.SizeStyle=i.SizeClass=void 0;var O=a(0),S=w(O);function w(m){return m&&m.__esModule?m:{default:m}}var b=new S.default.Attributor.Class("size","ql-size",{scope:S.default.Scope.INLINE,whitelist:["small","large","huge"]}),_=new S.default.Attributor.Style("size","font-size",{scope:S.default.Scope.INLINE,whitelist:["10px","18px","32px"]});i.SizeClass=b,i.SizeStyle=_},function(e,i,a){e.exports={align:{"":a(76),center:a(77),right:a(78),justify:a(79)},background:a(80),blockquote:a(81),bold:a(82),clean:a(83),code:a(58),"code-block":a(58),color:a(84),direction:{"":a(85),rtl:a(86)},float:{center:a(87),full:a(88),left:a(89),right:a(90)},formula:a(91),header:{1:a(92),2:a(93)},italic:a(94),image:a(95),indent:{"+1":a(96),"-1":a(97)},link:a(98),list:{ordered:a(99),bullet:a(100),check:a(101)},script:{sub:a(102),super:a(103)},strike:a(104),underline:a(105),video:a(106)}},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.getLastChangeIndex=i.default=void 0;var O=function(){function p(s,g){for(var D=0;D<g.length;D++){var x=g[D];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}return function(s,g,D){return g&&p(s.prototype,g),D&&p(s,D),s}}(),S=a(0),w=n(S),b=a(5),_=n(b),m=a(9),c=n(m);function n(p){return p&&p.__esModule?p:{default:p}}function r(p,s){if(!(p instanceof s))throw new TypeError("Cannot call a class as a function")}function d(p,s){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:p}function f(p,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);p.prototype=Object.create(s&&s.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(p,s):p.__proto__=s)}var h=function(p){f(s,p);function s(g,D){r(this,s);var x=d(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,g,D));return x.lastRecorded=0,x.ignoreChange=!1,x.clear(),x.quill.on(_.default.events.EDITOR_CHANGE,function(A,I,T,E){A!==_.default.events.TEXT_CHANGE||x.ignoreChange||(!x.options.userOnly||E===_.default.sources.USER?x.record(I,T):x.transform(I))}),x.quill.keyboard.addBinding({key:"Z",shortKey:!0},x.undo.bind(x)),x.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},x.redo.bind(x)),/Win/i.test(navigator.platform)&&x.quill.keyboard.addBinding({key:"Y",shortKey:!0},x.redo.bind(x)),x}return O(s,[{key:"change",value:function(D,x){if(this.stack[D].length!==0){var A=this.stack[D].pop();this.stack[x].push(A),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(A[D],_.default.sources.USER),this.ignoreChange=!1;var I=u(A[D]);this.quill.setSelection(I)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(D,x){if(D.ops.length!==0){this.stack.redo=[];var A=this.quill.getContents().diff(x),I=Date.now();if(this.lastRecorded+this.options.delay>I&&this.stack.undo.length>0){var T=this.stack.undo.pop();A=A.compose(T.undo),D=T.redo.compose(D)}else this.lastRecorded=I;this.stack.undo.push({redo:D,undo:A}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(D){this.stack.undo.forEach(function(x){x.undo=D.transform(x.undo,!0),x.redo=D.transform(x.redo,!0)}),this.stack.redo.forEach(function(x){x.undo=D.transform(x.undo,!0),x.redo=D.transform(x.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),s}(c.default);h.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function l(p){var s=p.ops[p.ops.length-1];return s==null?!1:s.insert!=null?typeof s.insert=="string"&&s.insert.endsWith(`
|
|
`):s.attributes!=null?Object.keys(s.attributes).some(function(g){return w.default.query(g,w.default.Scope.BLOCK)!=null}):!1}function u(p){var s=p.reduce(function(D,x){return D+=x.delete||0,D},0),g=p.length()-s;return l(p)&&(g-=1),g}i.default=h,i.getLastChangeIndex=u},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BaseTooltip=void 0;var O=function(){function N(P,U){for(var F=0;F<U.length;F++){var $=U[F];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(P,$.key,$)}}return function(P,U,F){return U&&N(P.prototype,U),F&&N(P,F),P}}(),S=function N(P,U,F){P===null&&(P=Function.prototype);var $=Object.getOwnPropertyDescriptor(P,U);if($===void 0){var R=Object.getPrototypeOf(P);return R===null?void 0:N(R,U,F)}else{if("value"in $)return $.value;var z=$.get;return z===void 0?void 0:z.call(F)}},w=a(3),b=I(w),_=a(2),m=I(_),c=a(8),n=I(c),r=a(23),d=I(r),f=a(34),h=I(f),l=a(59),u=I(l),p=a(60),s=I(p),g=a(28),D=I(g),x=a(61),A=I(x);function I(N){return N&&N.__esModule?N:{default:N}}function T(N,P){if(!(N instanceof P))throw new TypeError("Cannot call a class as a function")}function E(N,P){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:N}function v(N,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);N.prototype=Object.create(P&&P.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(N,P):N.__proto__=P)}var y=[!1,"center","right","justify"],k=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],C=[!1,"serif","monospace"],j=["1","2","3",!1],B=["small",!1,"large","huge"],W=function(N){v(P,N);function P(U,F){T(this,P);var $=E(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,U,F)),R=function z(H){if(!document.body.contains(U.root))return document.body.removeEventListener("click",z);$.tooltip!=null&&!$.tooltip.root.contains(H.target)&&document.activeElement!==$.tooltip.textbox&&!$.quill.hasFocus()&&$.tooltip.hide(),$.pickers!=null&&$.pickers.forEach(function(G){G.container.contains(H.target)||G.close()})};return U.emitter.listenDOM("click",document.body,R),$}return O(P,[{key:"addModule",value:function(F){var $=S(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"addModule",this).call(this,F);return F==="toolbar"&&this.extendToolbar($),$}},{key:"buildButtons",value:function(F,$){F.forEach(function(R){var z=R.getAttribute("class")||"";z.split(/\s+/).forEach(function(H){if(!!H.startsWith("ql-")&&(H=H.slice(3),$[H]!=null))if(H==="direction")R.innerHTML=$[H][""]+$[H].rtl;else if(typeof $[H]=="string")R.innerHTML=$[H];else{var G=R.value||"";G!=null&&$[H][G]&&(R.innerHTML=$[H][G])}})})}},{key:"buildPickers",value:function(F,$){var R=this;this.pickers=F.map(function(H){if(H.classList.contains("ql-align"))return H.querySelector("option")==null&&L(H,y),new s.default(H,$.align);if(H.classList.contains("ql-background")||H.classList.contains("ql-color")){var G=H.classList.contains("ql-background")?"background":"color";return H.querySelector("option")==null&&L(H,k,G==="background"?"#ffffff":"#000000"),new u.default(H,$[G])}else return H.querySelector("option")==null&&(H.classList.contains("ql-font")?L(H,C):H.classList.contains("ql-header")?L(H,j):H.classList.contains("ql-size")&&L(H,B)),new D.default(H)});var z=function(){R.pickers.forEach(function(G){G.update()})};this.quill.on(n.default.events.EDITOR_CHANGE,z)}}]),P}(h.default);W.DEFAULTS=(0,b.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var P=this,U=this.container.querySelector("input.ql-image[type=file]");U==null&&(U=document.createElement("input"),U.setAttribute("type","file"),U.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),U.classList.add("ql-image"),U.addEventListener("change",function(){if(U.files!=null&&U.files[0]!=null){var F=new FileReader;F.onload=function($){var R=P.quill.getSelection(!0);P.quill.updateContents(new m.default().retain(R.index).delete(R.length).insert({image:$.target.result}),n.default.sources.USER),P.quill.setSelection(R.index+1,n.default.sources.SILENT),U.value=""},F.readAsDataURL(U.files[0])}}),this.container.appendChild(U)),U.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var q=function(N){v(P,N);function P(U,F){T(this,P);var $=E(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,U,F));return $.textbox=$.root.querySelector('input[type="text"]'),$.listen(),$}return O(P,[{key:"listen",value:function(){var F=this;this.textbox.addEventListener("keydown",function($){d.default.match($,"enter")?(F.save(),$.preventDefault()):d.default.match($,"escape")&&(F.cancel(),$.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),$!=null?this.textbox.value=$:F!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+F)||""),this.root.setAttribute("data-mode",F)}},{key:"restoreFocus",value:function(){var F=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=F}},{key:"save",value:function(){var F=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var $=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",F,n.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",F,n.default.sources.USER)),this.quill.root.scrollTop=$;break}case"video":F=M(F);case"formula":{if(!F)break;var R=this.quill.getSelection(!0);if(R!=null){var z=R.index+R.length;this.quill.insertEmbed(z,this.root.getAttribute("data-mode"),F,n.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(z+1," ",n.default.sources.USER),this.quill.setSelection(z+2,n.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),P}(A.default);function M(N){var P=N.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||N.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return P?(P[1]||"https")+"://www.youtube.com/embed/"+P[2]+"?showinfo=0":(P=N.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(P[1]||"https")+"://player.vimeo.com/video/"+P[2]+"/":N}function L(N,P){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;P.forEach(function(F){var $=document.createElement("option");F===U?$.setAttribute("selected","selected"):$.setAttribute("value",F),N.appendChild($)})}i.BaseTooltip=q,i.default=W},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function S(){this.head=this.tail=null,this.length=0}return S.prototype.append=function(){for(var w=[],b=0;b<arguments.length;b++)w[b]=arguments[b];this.insertBefore(w[0],null),w.length>1&&this.append.apply(this,w.slice(1))},S.prototype.contains=function(w){for(var b,_=this.iterator();b=_();)if(b===w)return!0;return!1},S.prototype.insertBefore=function(w,b){!w||(w.next=b,b!=null?(w.prev=b.prev,b.prev!=null&&(b.prev.next=w),b.prev=w,b===this.head&&(this.head=w)):this.tail!=null?(this.tail.next=w,w.prev=this.tail,this.tail=w):(w.prev=null,this.head=this.tail=w),this.length+=1)},S.prototype.offset=function(w){for(var b=0,_=this.head;_!=null;){if(_===w)return b;b+=_.length(),_=_.next}return-1},S.prototype.remove=function(w){!this.contains(w)||(w.prev!=null&&(w.prev.next=w.next),w.next!=null&&(w.next.prev=w.prev),w===this.head&&(this.head=w.next),w===this.tail&&(this.tail=w.prev),this.length-=1)},S.prototype.iterator=function(w){return w===void 0&&(w=this.head),function(){var b=w;return w!=null&&(w=w.next),b}},S.prototype.find=function(w,b){b===void 0&&(b=!1);for(var _,m=this.iterator();_=m();){var c=_.length();if(w<c||b&&w===c&&(_.next==null||_.next.length()!==0))return[_,w];w-=c}return[null,0]},S.prototype.forEach=function(w){for(var b,_=this.iterator();b=_();)w(b)},S.prototype.forEachAt=function(w,b,_){if(!(b<=0))for(var m=this.find(w),c=m[0],n=m[1],r,d=w-n,f=this.iterator(c);(r=f())&&d<w+b;){var h=r.length();w>d?_(r,w-d,Math.min(b,d+h-w)):_(r,0,Math.min(h,w+b-d)),d+=h}},S.prototype.map=function(w){return this.reduce(function(b,_){return b.push(w(_)),b},[])},S.prototype.reduce=function(w,b){for(var _,m=this.iterator();_=m();)b=w(b,_);return b},S}();i.default=O},function(e,i,a){var O=this&&this.__extends||function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var d in r)r.hasOwnProperty(d)&&(n[d]=r[d])};return function(n,r){c(n,r);function d(){this.constructor=n}n.prototype=r===null?Object.create(r):(d.prototype=r.prototype,new d)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(17),w=a(1),b={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},_=100,m=function(c){O(n,c);function n(r){var d=c.call(this,r)||this;return d.scroll=d,d.observer=new MutationObserver(function(f){d.update(f)}),d.observer.observe(d.domNode,b),d.attach(),d}return n.prototype.detach=function(){c.prototype.detach.call(this),this.observer.disconnect()},n.prototype.deleteAt=function(r,d){this.update(),r===0&&d===this.length()?this.children.forEach(function(f){f.remove()}):c.prototype.deleteAt.call(this,r,d)},n.prototype.formatAt=function(r,d,f,h){this.update(),c.prototype.formatAt.call(this,r,d,f,h)},n.prototype.insertAt=function(r,d,f){this.update(),c.prototype.insertAt.call(this,r,d,f)},n.prototype.optimize=function(r,d){var f=this;r===void 0&&(r=[]),d===void 0&&(d={}),c.prototype.optimize.call(this,d);for(var h=[].slice.call(this.observer.takeRecords());h.length>0;)r.push(h.pop());for(var l=function(g,D){D===void 0&&(D=!0),!(g==null||g===f)&&g.domNode.parentNode!=null&&(g.domNode[w.DATA_KEY].mutations==null&&(g.domNode[w.DATA_KEY].mutations=[]),D&&l(g.parent))},u=function(g){g.domNode[w.DATA_KEY]==null||g.domNode[w.DATA_KEY].mutations==null||(g instanceof S.default&&g.children.forEach(u),g.optimize(d))},p=r,s=0;p.length>0;s+=1){if(s>=_)throw new Error("[Parchment] Maximum optimize iterations reached");for(p.forEach(function(g){var D=w.find(g.target,!0);D!=null&&(D.domNode===g.target&&(g.type==="childList"?(l(w.find(g.previousSibling,!1)),[].forEach.call(g.addedNodes,function(x){var A=w.find(x,!1);l(A,!1),A instanceof S.default&&A.children.forEach(function(I){l(I,!1)})})):g.type==="attributes"&&l(D.prev)),l(D))}),this.children.forEach(u),p=[].slice.call(this.observer.takeRecords()),h=p.slice();h.length>0;)r.push(h.pop())}},n.prototype.update=function(r,d){var f=this;d===void 0&&(d={}),r=r||this.observer.takeRecords(),r.map(function(h){var l=w.find(h.target,!0);return l==null?null:l.domNode[w.DATA_KEY].mutations==null?(l.domNode[w.DATA_KEY].mutations=[h],l):(l.domNode[w.DATA_KEY].mutations.push(h),null)}).forEach(function(h){h==null||h===f||h.domNode[w.DATA_KEY]==null||h.update(h.domNode[w.DATA_KEY].mutations||[],d)}),this.domNode[w.DATA_KEY].mutations!=null&&c.prototype.update.call(this,this.domNode[w.DATA_KEY].mutations,d),this.optimize(r,d)},n.blotName="scroll",n.defaultChild="block",n.scope=w.Scope.BLOCK_BLOT,n.tagName="DIV",n}(S.default);i.default=m},function(e,i,a){var O=this&&this.__extends||function(){var m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,n){c.__proto__=n}||function(c,n){for(var r in n)n.hasOwnProperty(r)&&(c[r]=n[r])};return function(c,n){m(c,n);function r(){this.constructor=c}c.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(18),w=a(1);function b(m,c){if(Object.keys(m).length!==Object.keys(c).length)return!1;for(var n in m)if(m[n]!==c[n])return!1;return!0}var _=function(m){O(c,m);function c(){return m!==null&&m.apply(this,arguments)||this}return c.formats=function(n){if(n.tagName!==c.tagName)return m.formats.call(this,n)},c.prototype.format=function(n,r){var d=this;n===this.statics.blotName&&!r?(this.children.forEach(function(f){f instanceof S.default||(f=f.wrap(c.blotName,!0)),d.attributes.copy(f)}),this.unwrap()):m.prototype.format.call(this,n,r)},c.prototype.formatAt=function(n,r,d,f){if(this.formats()[d]!=null||w.query(d,w.Scope.ATTRIBUTE)){var h=this.isolate(n,r);h.format(d,f)}else m.prototype.formatAt.call(this,n,r,d,f)},c.prototype.optimize=function(n){m.prototype.optimize.call(this,n);var r=this.formats();if(Object.keys(r).length===0)return this.unwrap();var d=this.next;d instanceof c&&d.prev===this&&b(r,d.formats())&&(d.moveChildren(this),d.remove())},c.blotName="inline",c.scope=w.Scope.INLINE_BLOT,c.tagName="SPAN",c}(S.default);i.default=_},function(e,i,a){var O=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,c){m.__proto__=c}||function(m,c){for(var n in c)c.hasOwnProperty(n)&&(m[n]=c[n])};return function(m,c){_(m,c);function n(){this.constructor=m}m.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(18),w=a(1),b=function(_){O(m,_);function m(){return _!==null&&_.apply(this,arguments)||this}return m.formats=function(c){var n=w.query(m.blotName).tagName;if(c.tagName!==n)return _.formats.call(this,c)},m.prototype.format=function(c,n){w.query(c,w.Scope.BLOCK)!=null&&(c===this.statics.blotName&&!n?this.replaceWith(m.blotName):_.prototype.format.call(this,c,n))},m.prototype.formatAt=function(c,n,r,d){w.query(r,w.Scope.BLOCK)!=null?this.format(r,d):_.prototype.formatAt.call(this,c,n,r,d)},m.prototype.insertAt=function(c,n,r){if(r==null||w.query(n,w.Scope.INLINE)!=null)_.prototype.insertAt.call(this,c,n,r);else{var d=this.split(c),f=w.create(n,r);d.parent.insertBefore(f,d)}},m.prototype.update=function(c,n){navigator.userAgent.match(/Trident/)?this.build():_.prototype.update.call(this,c,n)},m.blotName="block",m.scope=w.Scope.BLOCK_BLOT,m.tagName="P",m}(S.default);i.default=b},function(e,i,a){var O=this&&this.__extends||function(){var b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,m){_.__proto__=m}||function(_,m){for(var c in m)m.hasOwnProperty(c)&&(_[c]=m[c])};return function(_,m){b(_,m);function c(){this.constructor=_}_.prototype=m===null?Object.create(m):(c.prototype=m.prototype,new c)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(19),w=function(b){O(_,b);function _(){return b!==null&&b.apply(this,arguments)||this}return _.formats=function(m){},_.prototype.format=function(m,c){b.prototype.formatAt.call(this,0,this.length(),m,c)},_.prototype.formatAt=function(m,c,n,r){m===0&&c===this.length()?this.format(n,r):b.prototype.formatAt.call(this,m,c,n,r)},_.prototype.formats=function(){return this.statics.formats(this.domNode)},_}(S.default);i.default=w},function(e,i,a){var O=this&&this.__extends||function(){var _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,c){m.__proto__=c}||function(m,c){for(var n in c)c.hasOwnProperty(n)&&(m[n]=c[n])};return function(m,c){_(m,c);function n(){this.constructor=m}m.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)}}();Object.defineProperty(i,"__esModule",{value:!0});var S=a(19),w=a(1),b=function(_){O(m,_);function m(c){var n=_.call(this,c)||this;return n.text=n.statics.value(n.domNode),n}return m.create=function(c){return document.createTextNode(c)},m.value=function(c){var n=c.data;return n.normalize&&(n=n.normalize()),n},m.prototype.deleteAt=function(c,n){this.domNode.data=this.text=this.text.slice(0,c)+this.text.slice(c+n)},m.prototype.index=function(c,n){return this.domNode===c?n:-1},m.prototype.insertAt=function(c,n,r){r==null?(this.text=this.text.slice(0,c)+n+this.text.slice(c),this.domNode.data=this.text):_.prototype.insertAt.call(this,c,n,r)},m.prototype.length=function(){return this.text.length},m.prototype.optimize=function(c){_.prototype.optimize.call(this,c),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof m&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},m.prototype.position=function(c,n){return[this.domNode,c]},m.prototype.split=function(c,n){if(n===void 0&&(n=!1),!n){if(c===0)return this;if(c===this.length())return this.next}var r=w.create(this.domNode.splitText(c));return this.parent.insertBefore(r,this.next),this.text=this.statics.value(this.domNode),r},m.prototype.update=function(c,n){var r=this;c.some(function(d){return d.type==="characterData"&&d.target===r.domNode})&&(this.text=this.statics.value(this.domNode))},m.prototype.value=function(){return this.text},m.blotName="text",m.scope=w.Scope.INLINE_BLOT,m}(S.default);i.default=b},function(e,i,a){var O=document.createElement("div");if(O.classList.toggle("test-class",!1),O.classList.contains("test-class")){var S=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(w,b){return arguments.length>1&&!this.contains(w)==!b?b:S.call(this,w)}}String.prototype.startsWith||(String.prototype.startsWith=function(w,b){return b=b||0,this.substr(b,w.length)===w}),String.prototype.endsWith||(String.prototype.endsWith=function(w,b){var _=this.toString();(typeof b!="number"||!isFinite(b)||Math.floor(b)!==b||b>_.length)&&(b=_.length),b-=w.length;var m=_.indexOf(w,b);return m!==-1&&m===b}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(b){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof b!="function")throw new TypeError("predicate must be a function");for(var _=Object(this),m=_.length>>>0,c=arguments[1],n,r=0;r<m;r++)if(n=_[r],b.call(c,n,r,_))return n}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(e,i){var a=-1,O=1,S=0;function w(s,g,D){if(s==g)return s?[[S,s]]:[];(D<0||s.length<D)&&(D=null);var x=c(s,g),A=s.substring(0,x);s=s.substring(x),g=g.substring(x),x=n(s,g);var I=s.substring(s.length-x);s=s.substring(0,s.length-x),g=g.substring(0,g.length-x);var T=b(s,g);return A&&T.unshift([S,A]),I&&T.push([S,I]),d(T),D!=null&&(T=l(T,D)),T=u(T),T}function b(s,g){var D;if(!s)return[[O,g]];if(!g)return[[a,s]];var x=s.length>g.length?s:g,A=s.length>g.length?g:s,I=x.indexOf(A);if(I!=-1)return D=[[O,x.substring(0,I)],[S,A],[O,x.substring(I+A.length)]],s.length>g.length&&(D[0][0]=D[2][0]=a),D;if(A.length==1)return[[a,s],[O,g]];var T=r(s,g);if(T){var E=T[0],v=T[1],y=T[2],k=T[3],C=T[4],j=w(E,y),B=w(v,k);return j.concat([[S,C]],B)}return _(s,g)}function _(s,g){for(var D=s.length,x=g.length,A=Math.ceil((D+x)/2),I=A,T=2*A,E=new Array(T),v=new Array(T),y=0;y<T;y++)E[y]=-1,v[y]=-1;E[I+1]=0,v[I+1]=0;for(var k=D-x,C=k%2!=0,j=0,B=0,W=0,q=0,M=0;M<A;M++){for(var L=-M+j;L<=M-B;L+=2){var N=I+L,P;L==-M||L!=M&&E[N-1]<E[N+1]?P=E[N+1]:P=E[N-1]+1;for(var U=P-L;P<D&&U<x&&s.charAt(P)==g.charAt(U);)P++,U++;if(E[N]=P,P>D)B+=2;else if(U>x)j+=2;else if(C){var F=I+k-L;if(F>=0&&F<T&&v[F]!=-1){var $=D-v[F];if(P>=$)return m(s,g,P,U)}}}for(var R=-M+W;R<=M-q;R+=2){var F=I+R,$;R==-M||R!=M&&v[F-1]<v[F+1]?$=v[F+1]:$=v[F-1]+1;for(var z=$-R;$<D&&z<x&&s.charAt(D-$-1)==g.charAt(x-z-1);)$++,z++;if(v[F]=$,$>D)q+=2;else if(z>x)W+=2;else if(!C){var N=I+k-R;if(N>=0&&N<T&&E[N]!=-1){var P=E[N],U=I+P-N;if($=D-$,P>=$)return m(s,g,P,U)}}}}return[[a,s],[O,g]]}function m(s,g,D,x){var A=s.substring(0,D),I=g.substring(0,x),T=s.substring(D),E=g.substring(x),v=w(A,I),y=w(T,E);return v.concat(y)}function c(s,g){if(!s||!g||s.charAt(0)!=g.charAt(0))return 0;for(var D=0,x=Math.min(s.length,g.length),A=x,I=0;D<A;)s.substring(I,A)==g.substring(I,A)?(D=A,I=D):x=A,A=Math.floor((x-D)/2+D);return A}function n(s,g){if(!s||!g||s.charAt(s.length-1)!=g.charAt(g.length-1))return 0;for(var D=0,x=Math.min(s.length,g.length),A=x,I=0;D<A;)s.substring(s.length-A,s.length-I)==g.substring(g.length-A,g.length-I)?(D=A,I=D):x=A,A=Math.floor((x-D)/2+D);return A}function r(s,g){var D=s.length>g.length?s:g,x=s.length>g.length?g:s;if(D.length<4||x.length*2<D.length)return null;function A(B,W,q){for(var M=B.substring(q,q+Math.floor(B.length/4)),L=-1,N="",P,U,F,$;(L=W.indexOf(M,L+1))!=-1;){var R=c(B.substring(q),W.substring(L)),z=n(B.substring(0,q),W.substring(0,L));N.length<z+R&&(N=W.substring(L-z,L)+W.substring(L,L+R),P=B.substring(0,q-z),U=B.substring(q+R),F=W.substring(0,L-z),$=W.substring(L+R))}return N.length*2>=B.length?[P,U,F,$,N]:null}var I=A(D,x,Math.ceil(D.length/4)),T=A(D,x,Math.ceil(D.length/2)),E;if(!I&&!T)return null;T?I?E=I[4].length>T[4].length?I:T:E=T:E=I;var v,y,k,C;s.length>g.length?(v=E[0],y=E[1],k=E[2],C=E[3]):(k=E[0],C=E[1],v=E[2],y=E[3]);var j=E[4];return[v,y,k,C,j]}function d(s){s.push([S,""]);for(var g=0,D=0,x=0,A="",I="",T;g<s.length;)switch(s[g][0]){case O:x++,I+=s[g][1],g++;break;case a:D++,A+=s[g][1],g++;break;case S:D+x>1?(D!==0&&x!==0&&(T=c(I,A),T!==0&&(g-D-x>0&&s[g-D-x-1][0]==S?s[g-D-x-1][1]+=I.substring(0,T):(s.splice(0,0,[S,I.substring(0,T)]),g++),I=I.substring(T),A=A.substring(T)),T=n(I,A),T!==0&&(s[g][1]=I.substring(I.length-T)+s[g][1],I=I.substring(0,I.length-T),A=A.substring(0,A.length-T))),D===0?s.splice(g-x,D+x,[O,I]):x===0?s.splice(g-D,D+x,[a,A]):s.splice(g-D-x,D+x,[a,A],[O,I]),g=g-D-x+(D?1:0)+(x?1:0)+1):g!==0&&s[g-1][0]==S?(s[g-1][1]+=s[g][1],s.splice(g,1)):g++,x=0,D=0,A="",I="";break}s[s.length-1][1]===""&&s.pop();var E=!1;for(g=1;g<s.length-1;)s[g-1][0]==S&&s[g+1][0]==S&&(s[g][1].substring(s[g][1].length-s[g-1][1].length)==s[g-1][1]?(s[g][1]=s[g-1][1]+s[g][1].substring(0,s[g][1].length-s[g-1][1].length),s[g+1][1]=s[g-1][1]+s[g+1][1],s.splice(g-1,1),E=!0):s[g][1].substring(0,s[g+1][1].length)==s[g+1][1]&&(s[g-1][1]+=s[g+1][1],s[g][1]=s[g][1].substring(s[g+1][1].length)+s[g+1][1],s.splice(g+1,1),E=!0)),g++;E&&d(s)}var f=w;f.INSERT=O,f.DELETE=a,f.EQUAL=S,e.exports=f;function h(s,g){if(g===0)return[S,s];for(var D=0,x=0;x<s.length;x++){var A=s[x];if(A[0]===a||A[0]===S){var I=D+A[1].length;if(g===I)return[x+1,s];if(g<I){s=s.slice();var T=g-D,E=[A[0],A[1].slice(0,T)],v=[A[0],A[1].slice(T)];return s.splice(x,1,E,v),[x+1,s]}else D=I}}throw new Error("cursor_pos is out of bounds!")}function l(s,g){var D=h(s,g),x=D[1],A=D[0],I=x[A],T=x[A+1];if(I==null)return s;if(I[0]!==S)return s;if(T!=null&&I[1]+T[1]===T[1]+I[1])return x.splice(A,2,T,I),p(x,A,2);if(T!=null&&T[1].indexOf(I[1])===0){x.splice(A,2,[T[0],I[1]],[0,I[1]]);var E=T[1].slice(I[1].length);return E.length>0&&x.splice(A+2,0,[T[0],E]),p(x,A,3)}else return s}function u(s){for(var g=!1,D=function(T){return T.charCodeAt(0)>=56320&&T.charCodeAt(0)<=57343},x=function(T){return T.charCodeAt(T.length-1)>=55296&&T.charCodeAt(T.length-1)<=56319},A=2;A<s.length;A+=1)s[A-2][0]===S&&x(s[A-2][1])&&s[A-1][0]===a&&D(s[A-1][1])&&s[A][0]===O&&D(s[A][1])&&(g=!0,s[A-1][1]=s[A-2][1].slice(-1)+s[A-1][1],s[A][1]=s[A-2][1].slice(-1)+s[A][1],s[A-2][1]=s[A-2][1].slice(0,-1));if(!g)return s;for(var I=[],A=0;A<s.length;A+=1)s[A][1].length>0&&I.push(s[A]);return I}function p(s,g,D){for(var x=g+D-1;x>=0&&x>=g-1;x--)if(x+1<s.length){var A=s[x],I=s[x+1];A[0]===I[1]&&s.splice(x,2,[A[0],A[1]+I[1]])}return s}},function(e,i){i=e.exports=typeof Object.keys=="function"?Object.keys:a,i.shim=a;function a(O){var S=[];for(var w in O)S.push(w);return S}},function(e,i){var a=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";i=e.exports=a?O:S,i.supported=O;function O(w){return Object.prototype.toString.call(w)=="[object Arguments]"}i.unsupported=S;function S(w){return w&&typeof w=="object"&&typeof w.length=="number"&&Object.prototype.hasOwnProperty.call(w,"callee")&&!Object.prototype.propertyIsEnumerable.call(w,"callee")||!1}},function(e,i){var a=Object.prototype.hasOwnProperty,O="~";function S(){}Object.create&&(S.prototype=Object.create(null),new S().__proto__||(O=!1));function w(_,m,c){this.fn=_,this.context=m,this.once=c||!1}function b(){this._events=new S,this._eventsCount=0}b.prototype.eventNames=function(){var m=[],c,n;if(this._eventsCount===0)return m;for(n in c=this._events)a.call(c,n)&&m.push(O?n.slice(1):n);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(c)):m},b.prototype.listeners=function(m,c){var n=O?O+m:m,r=this._events[n];if(c)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var d=0,f=r.length,h=new Array(f);d<f;d++)h[d]=r[d].fn;return h},b.prototype.emit=function(m,c,n,r,d,f){var h=O?O+m:m;if(!this._events[h])return!1;var l=this._events[h],u=arguments.length,p,s;if(l.fn){switch(l.once&&this.removeListener(m,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,c),!0;case 3:return l.fn.call(l.context,c,n),!0;case 4:return l.fn.call(l.context,c,n,r),!0;case 5:return l.fn.call(l.context,c,n,r,d),!0;case 6:return l.fn.call(l.context,c,n,r,d,f),!0}for(s=1,p=new Array(u-1);s<u;s++)p[s-1]=arguments[s];l.fn.apply(l.context,p)}else{var g=l.length,D;for(s=0;s<g;s++)switch(l[s].once&&this.removeListener(m,l[s].fn,void 0,!0),u){case 1:l[s].fn.call(l[s].context);break;case 2:l[s].fn.call(l[s].context,c);break;case 3:l[s].fn.call(l[s].context,c,n);break;case 4:l[s].fn.call(l[s].context,c,n,r);break;default:if(!p)for(D=1,p=new Array(u-1);D<u;D++)p[D-1]=arguments[D];l[s].fn.apply(l[s].context,p)}}return!0},b.prototype.on=function(m,c,n){var r=new w(c,n||this),d=O?O+m:m;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],r]:this._events[d].push(r):(this._events[d]=r,this._eventsCount++),this},b.prototype.once=function(m,c,n){var r=new w(c,n||this,!0),d=O?O+m:m;return this._events[d]?this._events[d].fn?this._events[d]=[this._events[d],r]:this._events[d].push(r):(this._events[d]=r,this._eventsCount++),this},b.prototype.removeListener=function(m,c,n,r){var d=O?O+m:m;if(!this._events[d])return this;if(!c)return--this._eventsCount===0?this._events=new S:delete this._events[d],this;var f=this._events[d];if(f.fn)f.fn===c&&(!r||f.once)&&(!n||f.context===n)&&(--this._eventsCount===0?this._events=new S:delete this._events[d]);else{for(var h=0,l=[],u=f.length;h<u;h++)(f[h].fn!==c||r&&!f[h].once||n&&f[h].context!==n)&&l.push(f[h]);l.length?this._events[d]=l.length===1?l[0]:l:--this._eventsCount===0?this._events=new S:delete this._events[d]}return this},b.prototype.removeAllListeners=function(m){var c;return m?(c=O?O+m:m,this._events[c]&&(--this._eventsCount===0?this._events=new S:delete this._events[c])):(this._events=new S,this._eventsCount=0),this},b.prototype.off=b.prototype.removeListener,b.prototype.addListener=b.prototype.on,b.prototype.setMaxListeners=function(){return this},b.prefixed=O,b.EventEmitter=b,typeof e!="undefined"&&(e.exports=b)},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.matchText=i.matchSpacing=i.matchNewline=i.matchBlot=i.matchAttributor=i.default=void 0;var O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},S=function(){function V(K,Y){var Z=[],Q=!0,et=!1,it=void 0;try{for(var rt=K[Symbol.iterator](),ct;!(Q=(ct=rt.next()).done)&&(Z.push(ct.value),!(Y&&Z.length===Y));Q=!0);}catch(ft){et=!0,it=ft}finally{try{!Q&&rt.return&&rt.return()}finally{if(et)throw it}}return Z}return function(K,Y){if(Array.isArray(K))return K;if(Symbol.iterator in Object(K))return V(K,Y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),w=function(){function V(K,Y){for(var Z=0;Z<Y.length;Z++){var Q=Y[Z];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(K,Q.key,Q)}}return function(K,Y,Z){return Y&&V(K.prototype,Y),Z&&V(K,Z),K}}(),b=a(3),_=v(b),m=a(2),c=v(m),n=a(0),r=v(n),d=a(5),f=v(d),h=a(10),l=v(h),u=a(9),p=v(u),s=a(36),g=a(37),D=a(13),x=v(D),A=a(26),I=a(38),T=a(39),E=a(40);function v(V){return V&&V.__esModule?V:{default:V}}function y(V,K,Y){return K in V?Object.defineProperty(V,K,{value:Y,enumerable:!0,configurable:!0,writable:!0}):V[K]=Y,V}function k(V,K){if(!(V instanceof K))throw new TypeError("Cannot call a class as a function")}function C(V,K){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return K&&(typeof K=="object"||typeof K=="function")?K:V}function j(V,K){if(typeof K!="function"&&K!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof K);V.prototype=Object.create(K&&K.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),K&&(Object.setPrototypeOf?Object.setPrototypeOf(V,K):V.__proto__=K)}var B=(0,l.default)("quill:clipboard"),W="__ql-matcher",q=[[Node.TEXT_NODE,lt],[Node.TEXT_NODE,nt],["br",X],[Node.ELEMENT_NODE,nt],[Node.ELEMENT_NODE,G],[Node.ELEMENT_NODE,ot],[Node.ELEMENT_NODE,H],[Node.ELEMENT_NODE,ut],["li",tt],["b",z.bind(z,"bold")],["i",z.bind(z,"italic")],["style",J]],M=[s.AlignAttribute,I.DirectionAttribute].reduce(function(V,K){return V[K.keyName]=K,V},{}),L=[s.AlignStyle,g.BackgroundStyle,A.ColorStyle,I.DirectionStyle,T.FontStyle,E.SizeStyle].reduce(function(V,K){return V[K.keyName]=K,V},{}),N=function(V){j(K,V);function K(Y,Z){k(this,K);var Q=C(this,(K.__proto__||Object.getPrototypeOf(K)).call(this,Y,Z));return Q.quill.root.addEventListener("paste",Q.onPaste.bind(Q)),Q.container=Q.quill.addContainer("ql-clipboard"),Q.container.setAttribute("contenteditable",!0),Q.container.setAttribute("tabindex",-1),Q.matchers=[],q.concat(Q.options.matchers).forEach(function(et){var it=S(et,2),rt=it[0],ct=it[1];!Z.matchVisual&&ct===ot||Q.addMatcher(rt,ct)}),Q}return w(K,[{key:"addMatcher",value:function(Z,Q){this.matchers.push([Z,Q])}},{key:"convert",value:function(Z){if(typeof Z=="string")return this.container.innerHTML=Z.replace(/\>\r?\n +\</g,"><"),this.convert();var Q=this.quill.getFormat(this.quill.selection.savedRange.index);if(Q[x.default.blotName]){var et=this.container.innerText;return this.container.innerHTML="",new c.default().insert(et,y({},x.default.blotName,Q[x.default.blotName]))}var it=this.prepareMatching(),rt=S(it,2),ct=rt[0],ft=rt[1],at=R(this.container,ct,ft);return F(at,`
|
|
`)&&at.ops[at.ops.length-1].attributes==null&&(at=at.compose(new c.default().retain(at.length()-1).delete(1))),B.log("convert",this.container.innerHTML,at),this.container.innerHTML="",at}},{key:"dangerouslyPasteHTML",value:function(Z,Q){var et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;if(typeof Z=="string")this.quill.setContents(this.convert(Z),Q),this.quill.setSelection(0,f.default.sources.SILENT);else{var it=this.convert(Q);this.quill.updateContents(new c.default().retain(Z).concat(it),et),this.quill.setSelection(Z+it.length(),f.default.sources.SILENT)}}},{key:"onPaste",value:function(Z){var Q=this;if(!(Z.defaultPrevented||!this.quill.isEnabled())){var et=this.quill.getSelection(),it=new c.default().retain(et.index),rt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(f.default.sources.SILENT),setTimeout(function(){it=it.concat(Q.convert()).delete(et.length),Q.quill.updateContents(it,f.default.sources.USER),Q.quill.setSelection(it.length()-et.length,f.default.sources.SILENT),Q.quill.scrollingContainer.scrollTop=rt,Q.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Z=this,Q=[],et=[];return this.matchers.forEach(function(it){var rt=S(it,2),ct=rt[0],ft=rt[1];switch(ct){case Node.TEXT_NODE:et.push(ft);break;case Node.ELEMENT_NODE:Q.push(ft);break;default:[].forEach.call(Z.container.querySelectorAll(ct),function(at){at[W]=at[W]||[],at[W].push(ft)});break}}),[Q,et]}}]),K}(p.default);N.DEFAULTS={matchers:[],matchVisual:!0};function P(V,K,Y){return(typeof K=="undefined"?"undefined":O(K))==="object"?Object.keys(K).reduce(function(Z,Q){return P(Z,Q,K[Q])},V):V.reduce(function(Z,Q){return Q.attributes&&Q.attributes[K]?Z.push(Q):Z.insert(Q.insert,(0,_.default)({},y({},K,Y),Q.attributes))},new c.default)}function U(V){if(V.nodeType!==Node.ELEMENT_NODE)return{};var K="__ql-computed-style";return V[K]||(V[K]=window.getComputedStyle(V))}function F(V,K){for(var Y="",Z=V.ops.length-1;Z>=0&&Y.length<K.length;--Z){var Q=V.ops[Z];if(typeof Q.insert!="string")break;Y=Q.insert+Y}return Y.slice(-1*K.length)===K}function $(V){if(V.childNodes.length===0)return!1;var K=U(V);return["block","list-item"].indexOf(K.display)>-1}function R(V,K,Y){return V.nodeType===V.TEXT_NODE?Y.reduce(function(Z,Q){return Q(V,Z)},new c.default):V.nodeType===V.ELEMENT_NODE?[].reduce.call(V.childNodes||[],function(Z,Q){var et=R(Q,K,Y);return Q.nodeType===V.ELEMENT_NODE&&(et=K.reduce(function(it,rt){return rt(Q,it)},et),et=(Q[W]||[]).reduce(function(it,rt){return rt(Q,it)},et)),Z.concat(et)},new c.default):new c.default}function z(V,K,Y){return P(Y,V,!0)}function H(V,K){var Y=r.default.Attributor.Attribute.keys(V),Z=r.default.Attributor.Class.keys(V),Q=r.default.Attributor.Style.keys(V),et={};return Y.concat(Z).concat(Q).forEach(function(it){var rt=r.default.query(it,r.default.Scope.ATTRIBUTE);rt!=null&&(et[rt.attrName]=rt.value(V),et[rt.attrName])||(rt=M[it],rt!=null&&(rt.attrName===it||rt.keyName===it)&&(et[rt.attrName]=rt.value(V)||void 0),rt=L[it],rt!=null&&(rt.attrName===it||rt.keyName===it)&&(rt=L[it],et[rt.attrName]=rt.value(V)||void 0))}),Object.keys(et).length>0&&(K=P(K,et)),K}function G(V,K){var Y=r.default.query(V);if(Y==null)return K;if(Y.prototype instanceof r.default.Embed){var Z={},Q=Y.value(V);Q!=null&&(Z[Y.blotName]=Q,K=new c.default().insert(Z,Y.formats(V)))}else typeof Y.formats=="function"&&(K=P(K,Y.blotName,Y.formats(V)));return K}function X(V,K){return F(K,`
|
|
`)||K.insert(`
|
|
`),K}function J(){return new c.default}function tt(V,K){var Y=r.default.query(V);if(Y==null||Y.blotName!=="list-item"||!F(K,`
|
|
`))return K;for(var Z=-1,Q=V.parentNode;!Q.classList.contains("ql-clipboard");)(r.default.query(Q)||{}).blotName==="list"&&(Z+=1),Q=Q.parentNode;return Z<=0?K:K.compose(new c.default().retain(K.length()-1).retain(1,{indent:Z}))}function nt(V,K){return F(K,`
|
|
`)||($(V)||K.length()>0&&V.nextSibling&&$(V.nextSibling))&&K.insert(`
|
|
`),K}function ot(V,K){if($(V)&&V.nextElementSibling!=null&&!F(K,`
|
|
|
|
`)){var Y=V.offsetHeight+parseFloat(U(V).marginTop)+parseFloat(U(V).marginBottom);V.nextElementSibling.offsetTop>V.offsetTop+Y*1.5&&K.insert(`
|
|
`)}return K}function ut(V,K){var Y={},Z=V.style||{};return Z.fontStyle&&U(V).fontStyle==="italic"&&(Y.italic=!0),Z.fontWeight&&(U(V).fontWeight.startsWith("bold")||parseInt(U(V).fontWeight)>=700)&&(Y.bold=!0),Object.keys(Y).length>0&&(K=P(K,Y)),parseFloat(Z.textIndent||0)>0&&(K=new c.default().insert(" ").concat(K)),K}function lt(V,K){var Y=V.data;if(V.parentNode.tagName==="O:P")return K.insert(Y.trim());if(Y.trim().length===0&&V.parentNode.classList.contains("ql-clipboard"))return K;if(!U(V.parentNode).whiteSpace.startsWith("pre")){var Z=function(et,it){return it=it.replace(/[^\u00a0]/g,""),it.length<1&&et?" ":it};Y=Y.replace(/\r\n/g," ").replace(/\n/g," "),Y=Y.replace(/\s\s+/g,Z.bind(Z,!0)),(V.previousSibling==null&&$(V.parentNode)||V.previousSibling!=null&&$(V.previousSibling))&&(Y=Y.replace(/^\s+/,Z.bind(Z,!1))),(V.nextSibling==null&&$(V.parentNode)||V.nextSibling!=null&&$(V.nextSibling))&&(Y=Y.replace(/\s+$/,Z.bind(Z,!1)))}return K.insert(Y)}i.default=N,i.matchAttributor=H,i.matchBlot=G,i.matchNewline=nt,i.matchSpacing=ot,i.matchText=lt},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function d(f,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,h,l){return h&&d(f.prototype,h),l&&d(f,l),f}}(),S=function d(f,h,l){f===null&&(f=Function.prototype);var u=Object.getOwnPropertyDescriptor(f,h);if(u===void 0){var p=Object.getPrototypeOf(f);return p===null?void 0:d(p,h,l)}else{if("value"in u)return u.value;var s=u.get;return s===void 0?void 0:s.call(l)}},w=a(6),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(){return m(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return O(f,[{key:"optimize",value:function(l){S(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"optimize",this).call(this,l),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return S(f.__proto__||Object.getPrototypeOf(f),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),f}(b.default);r.blotName="bold",r.tagName=["STRONG","B"],i.default=r},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.addControls=i.default=void 0;var O=function(){function E(v,y){var k=[],C=!0,j=!1,B=void 0;try{for(var W=v[Symbol.iterator](),q;!(C=(q=W.next()).done)&&(k.push(q.value),!(y&&k.length===y));C=!0);}catch(M){j=!0,B=M}finally{try{!C&&W.return&&W.return()}finally{if(j)throw B}}return k}return function(v,y){if(Array.isArray(v))return v;if(Symbol.iterator in Object(v))return E(v,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(){function E(v,y){for(var k=0;k<y.length;k++){var C=y[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(v,C.key,C)}}return function(v,y,k){return y&&E(v.prototype,y),k&&E(v,k),v}}(),w=a(2),b=l(w),_=a(0),m=l(_),c=a(5),n=l(c),r=a(10),d=l(r),f=a(9),h=l(f);function l(E){return E&&E.__esModule?E:{default:E}}function u(E,v,y){return v in E?Object.defineProperty(E,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):E[v]=y,E}function p(E,v){if(!(E instanceof v))throw new TypeError("Cannot call a class as a function")}function s(E,v){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:E}function g(E,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);E.prototype=Object.create(v&&v.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(E,v):E.__proto__=v)}var D=(0,d.default)("quill:toolbar"),x=function(E){g(v,E);function v(y,k){p(this,v);var C=s(this,(v.__proto__||Object.getPrototypeOf(v)).call(this,y,k));if(Array.isArray(C.options.container)){var j=document.createElement("div");I(j,C.options.container),y.container.parentNode.insertBefore(j,y.container),C.container=j}else typeof C.options.container=="string"?C.container=document.querySelector(C.options.container):C.container=C.options.container;if(!(C.container instanceof HTMLElement)){var B;return B=D.error("Container required for toolbar",C.options),s(C,B)}return C.container.classList.add("ql-toolbar"),C.controls=[],C.handlers={},Object.keys(C.options.handlers).forEach(function(W){C.addHandler(W,C.options.handlers[W])}),[].forEach.call(C.container.querySelectorAll("button, select"),function(W){C.attach(W)}),C.quill.on(n.default.events.EDITOR_CHANGE,function(W,q){W===n.default.events.SELECTION_CHANGE&&C.update(q)}),C.quill.on(n.default.events.SCROLL_OPTIMIZE,function(){var W=C.quill.selection.getRange(),q=O(W,1),M=q[0];C.update(M)}),C}return S(v,[{key:"addHandler",value:function(k,C){this.handlers[k]=C}},{key:"attach",value:function(k){var C=this,j=[].find.call(k.classList,function(W){return W.indexOf("ql-")===0});if(!!j){if(j=j.slice(3),k.tagName==="BUTTON"&&k.setAttribute("type","button"),this.handlers[j]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[j]==null){D.warn("ignoring attaching to disabled format",j,k);return}if(m.default.query(j)==null){D.warn("ignoring attaching to nonexistent format",j,k);return}}var B=k.tagName==="SELECT"?"change":"click";k.addEventListener(B,function(W){var q=void 0;if(k.tagName==="SELECT"){if(k.selectedIndex<0)return;var M=k.options[k.selectedIndex];M.hasAttribute("selected")?q=!1:q=M.value||!1}else k.classList.contains("ql-active")?q=!1:q=k.value||!k.hasAttribute("value"),W.preventDefault();C.quill.focus();var L=C.quill.selection.getRange(),N=O(L,1),P=N[0];if(C.handlers[j]!=null)C.handlers[j].call(C,q);else if(m.default.query(j).prototype instanceof m.default.Embed){if(q=prompt("Enter "+j),!q)return;C.quill.updateContents(new b.default().retain(P.index).delete(P.length).insert(u({},j,q)),n.default.sources.USER)}else C.quill.format(j,q,n.default.sources.USER);C.update(P)}),this.controls.push([j,k])}}},{key:"update",value:function(k){var C=k==null?{}:this.quill.getFormat(k);this.controls.forEach(function(j){var B=O(j,2),W=B[0],q=B[1];if(q.tagName==="SELECT"){var M=void 0;if(k==null)M=null;else if(C[W]==null)M=q.querySelector("option[selected]");else if(!Array.isArray(C[W])){var L=C[W];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),M=q.querySelector('option[value="'+L+'"]')}M==null?(q.value="",q.selectedIndex=-1):M.selected=!0}else if(k==null)q.classList.remove("ql-active");else if(q.hasAttribute("value")){var N=C[W]===q.getAttribute("value")||C[W]!=null&&C[W].toString()===q.getAttribute("value")||C[W]==null&&!q.getAttribute("value");q.classList.toggle("ql-active",N)}else q.classList.toggle("ql-active",C[W]!=null)})}}]),v}(h.default);x.DEFAULTS={};function A(E,v,y){var k=document.createElement("button");k.setAttribute("type","button"),k.classList.add("ql-"+v),y!=null&&(k.value=y),E.appendChild(k)}function I(E,v){Array.isArray(v[0])||(v=[v]),v.forEach(function(y){var k=document.createElement("span");k.classList.add("ql-formats"),y.forEach(function(C){if(typeof C=="string")A(k,C);else{var j=Object.keys(C)[0],B=C[j];Array.isArray(B)?T(k,j,B):A(k,j,B)}}),E.appendChild(k)})}function T(E,v,y){var k=document.createElement("select");k.classList.add("ql-"+v),y.forEach(function(C){var j=document.createElement("option");C!==!1?j.setAttribute("value",C):j.setAttribute("selected","selected"),k.appendChild(j)}),E.appendChild(k)}x.DEFAULTS={container:null,handlers:{clean:function(){var v=this,y=this.quill.getSelection();if(y!=null)if(y.length==0){var k=this.quill.getFormat();Object.keys(k).forEach(function(C){m.default.query(C,m.default.Scope.INLINE)!=null&&v.quill.format(C,!1)})}else this.quill.removeFormat(y,n.default.sources.USER)},direction:function(v){var y=this.quill.getFormat().align;v==="rtl"&&y==null?this.quill.format("align","right",n.default.sources.USER):!v&&y==="right"&&this.quill.format("align",!1,n.default.sources.USER),this.quill.format("direction",v,n.default.sources.USER)},indent:function(v){var y=this.quill.getSelection(),k=this.quill.getFormat(y),C=parseInt(k.indent||0);if(v==="+1"||v==="-1"){var j=v==="+1"?1:-1;k.direction==="rtl"&&(j*=-1),this.quill.format("indent",C+j,n.default.sources.USER)}},link:function(v){v===!0&&(v=prompt("Enter link URL:")),this.quill.format("link",v,n.default.sources.USER)},list:function(v){var y=this.quill.getSelection(),k=this.quill.getFormat(y);v==="check"?k.list==="checked"||k.list==="unchecked"?this.quill.format("list",!1,n.default.sources.USER):this.quill.format("list","unchecked",n.default.sources.USER):this.quill.format("list",v,n.default.sources.USER)}}},i.default=x,i.addControls=I},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function d(f,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,h,l){return h&&d(f.prototype,h),l&&d(f,l),f}}(),S=function d(f,h,l){f===null&&(f=Function.prototype);var u=Object.getOwnPropertyDescriptor(f,h);if(u===void 0){var p=Object.getPrototypeOf(f);return p===null?void 0:d(p,h,l)}else{if("value"in u)return u.value;var s=u.get;return s===void 0?void 0:s.call(l)}},w=a(28),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(h,l){m(this,f);var u=c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,h));return u.label.innerHTML=l,u.container.classList.add("ql-color-picker"),[].slice.call(u.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(p){p.classList.add("ql-primary")}),u}return O(f,[{key:"buildItem",value:function(l){var u=S(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"buildItem",this).call(this,l);return u.style.backgroundColor=l.getAttribute("value")||"",u}},{key:"selectItem",value:function(l,u){S(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"selectItem",this).call(this,l,u);var p=this.label.querySelector(".ql-color-label"),s=l&&l.getAttribute("data-value")||"";p&&(p.tagName==="line"?p.style.stroke=s:p.style.fill=s)}}]),f}(b.default);i.default=r},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function d(f,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,h,l){return h&&d(f.prototype,h),l&&d(f,l),f}}(),S=function d(f,h,l){f===null&&(f=Function.prototype);var u=Object.getOwnPropertyDescriptor(f,h);if(u===void 0){var p=Object.getPrototypeOf(f);return p===null?void 0:d(p,h,l)}else{if("value"in u)return u.value;var s=u.get;return s===void 0?void 0:s.call(l)}},w=a(28),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(h,l){m(this,f);var u=c(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,h));return u.container.classList.add("ql-icon-picker"),[].forEach.call(u.container.querySelectorAll(".ql-picker-item"),function(p){p.innerHTML=l[p.getAttribute("data-value")||""]}),u.defaultItem=u.container.querySelector(".ql-selected"),u.selectItem(u.defaultItem),u}return O(f,[{key:"selectItem",value:function(l,u){S(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"selectItem",this).call(this,l,u),l=l||this.defaultItem,this.label.innerHTML=l.innerHTML}}]),f}(b.default);i.default=r},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function b(_,m){for(var c=0;c<m.length;c++){var n=m[c];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(_,n.key,n)}}return function(_,m,c){return m&&b(_.prototype,m),c&&b(_,c),_}}();function S(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}var w=function(){function b(_,m){var c=this;S(this,b),this.quill=_,this.boundsContainer=m||document.body,this.root=_.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){c.root.style.marginTop=-1*c.quill.root.scrollTop+"px"}),this.hide()}return O(b,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(m){var c=m.left+m.width/2-this.root.offsetWidth/2,n=m.bottom+this.quill.root.scrollTop;this.root.style.left=c+"px",this.root.style.top=n+"px",this.root.classList.remove("ql-flip");var r=this.boundsContainer.getBoundingClientRect(),d=this.root.getBoundingClientRect(),f=0;if(d.right>r.right&&(f=r.right-d.right,this.root.style.left=c+f+"px"),d.left<r.left&&(f=r.left-d.left,this.root.style.left=c+f+"px"),d.bottom>r.bottom){var h=d.bottom-d.top,l=m.bottom-m.top+h;this.root.style.top=n-l+"px",this.root.classList.add("ql-flip")}return f}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),b}();i.default=w},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function T(E,v){var y=[],k=!0,C=!1,j=void 0;try{for(var B=E[Symbol.iterator](),W;!(k=(W=B.next()).done)&&(y.push(W.value),!(v&&y.length===v));k=!0);}catch(q){C=!0,j=q}finally{try{!k&&B.return&&B.return()}finally{if(C)throw j}}return y}return function(E,v){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return T(E,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function T(E,v,y){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,v);if(k===void 0){var C=Object.getPrototypeOf(E);return C===null?void 0:T(C,v,y)}else{if("value"in k)return k.value;var j=k.get;return j===void 0?void 0:j.call(y)}},w=function(){function T(E,v){for(var y=0;y<v.length;y++){var k=v[y];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,v,y){return v&&T(E.prototype,v),y&&T(E,y),E}}(),b=a(3),_=p(b),m=a(8),c=p(m),n=a(43),r=p(n),d=a(27),f=p(d),h=a(15),l=a(41),u=p(l);function p(T){return T&&T.__esModule?T:{default:T}}function s(T,E){if(!(T instanceof E))throw new TypeError("Cannot call a class as a function")}function g(T,E){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:T}function D(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);T.prototype=Object.create(E&&E.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(T,E):T.__proto__=E)}var x=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],A=function(T){D(E,T);function E(v,y){s(this,E),y.modules.toolbar!=null&&y.modules.toolbar.container==null&&(y.modules.toolbar.container=x);var k=g(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,v,y));return k.quill.container.classList.add("ql-snow"),k}return w(E,[{key:"extendToolbar",value:function(y){y.container.classList.add("ql-snow"),this.buildButtons([].slice.call(y.container.querySelectorAll("button")),u.default),this.buildPickers([].slice.call(y.container.querySelectorAll("select")),u.default),this.tooltip=new I(this.quill,this.options.bounds),y.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(k,C){y.handlers.link.call(y,!C.format.link)})}}]),E}(r.default);A.DEFAULTS=(0,_.default)(!0,{},r.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){if(E){var v=this.quill.getSelection();if(v==null||v.length==0)return;var y=this.quill.getText(v);/^\S+@\S+\.\S+$/.test(y)&&y.indexOf("mailto:")!==0&&(y="mailto:"+y);var k=this.quill.theme.tooltip;k.edit("link",y)}else this.quill.format("link",!1)}}}}});var I=function(T){D(E,T);function E(v,y){s(this,E);var k=g(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,v,y));return k.preview=k.root.querySelector("a.ql-preview"),k}return w(E,[{key:"listen",value:function(){var y=this;S(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(k){y.root.classList.contains("ql-editing")?y.save():y.edit("link",y.preview.textContent),k.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(k){if(y.linkRange!=null){var C=y.linkRange;y.restoreFocus(),y.quill.formatText(C,"link",!1,c.default.sources.USER),delete y.linkRange}k.preventDefault(),y.hide()}),this.quill.on(c.default.events.SELECTION_CHANGE,function(k,C,j){if(k!=null){if(k.length===0&&j===c.default.sources.USER){var B=y.quill.scroll.descendant(f.default,k.index),W=O(B,2),q=W[0],M=W[1];if(q!=null){y.linkRange=new h.Range(k.index-M,q.length());var L=f.default.formats(q.domNode);y.preview.textContent=L,y.preview.setAttribute("href",L),y.show(),y.position(y.quill.getBounds(y.linkRange));return}}else delete y.linkRange;y.hide()}})}},{key:"show",value:function(){S(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),E}(n.BaseTooltip);I.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),i.default=A},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(29),S=Q(O),w=a(36),b=a(38),_=a(64),m=a(65),c=Q(m),n=a(66),r=Q(n),d=a(67),f=Q(d),h=a(37),l=a(26),u=a(39),p=a(40),s=a(56),g=Q(s),D=a(68),x=Q(D),A=a(27),I=Q(A),T=a(69),E=Q(T),v=a(70),y=Q(v),k=a(71),C=Q(k),j=a(72),B=Q(j),W=a(73),q=Q(W),M=a(13),L=Q(M),N=a(74),P=Q(N),U=a(75),F=Q(U),$=a(57),R=Q($),z=a(41),H=Q(z),G=a(28),X=Q(G),J=a(59),tt=Q(J),nt=a(60),ot=Q(nt),ut=a(61),lt=Q(ut),V=a(108),K=Q(V),Y=a(62),Z=Q(Y);function Q(et){return et&&et.__esModule?et:{default:et}}S.default.register({"attributors/attribute/direction":b.DirectionAttribute,"attributors/class/align":w.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":l.ColorClass,"attributors/class/direction":b.DirectionClass,"attributors/class/font":u.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":w.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":l.ColorStyle,"attributors/style/direction":b.DirectionStyle,"attributors/style/font":u.FontStyle,"attributors/style/size":p.SizeStyle},!0),S.default.register({"formats/align":w.AlignClass,"formats/direction":b.DirectionClass,"formats/indent":_.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":l.ColorStyle,"formats/font":u.FontClass,"formats/size":p.SizeClass,"formats/blockquote":c.default,"formats/code-block":L.default,"formats/header":r.default,"formats/list":f.default,"formats/bold":g.default,"formats/code":M.Code,"formats/italic":x.default,"formats/link":I.default,"formats/script":E.default,"formats/strike":y.default,"formats/underline":C.default,"formats/image":B.default,"formats/video":q.default,"formats/list/item":d.ListItem,"modules/formula":P.default,"modules/syntax":F.default,"modules/toolbar":R.default,"themes/bubble":K.default,"themes/snow":Z.default,"ui/icons":H.default,"ui/picker":X.default,"ui/icon-picker":ot.default,"ui/color-picker":tt.default,"ui/tooltip":lt.default},!0),i.default=S.default},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.IndentClass=void 0;var O=function(){function f(h,l){for(var u=0;u<l.length;u++){var p=l[u];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,l,u){return l&&f(h.prototype,l),u&&f(h,u),h}}(),S=function f(h,l,u){h===null&&(h=Function.prototype);var p=Object.getOwnPropertyDescriptor(h,l);if(p===void 0){var s=Object.getPrototypeOf(h);return s===null?void 0:f(s,l,u)}else{if("value"in p)return p.value;var g=p.get;return g===void 0?void 0:g.call(u)}},w=a(0),b=_(w);function _(f){return f&&f.__esModule?f:{default:f}}function m(f,h){if(!(f instanceof h))throw new TypeError("Cannot call a class as a function")}function c(f,h){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:f}function n(f,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);f.prototype=Object.create(h&&h.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(f,h):f.__proto__=h)}var r=function(f){n(h,f);function h(){return m(this,h),c(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}return O(h,[{key:"add",value:function(u,p){if(p==="+1"||p==="-1"){var s=this.value(u)||0;p=p==="+1"?s+1:s-1}return p===0?(this.remove(u),!0):S(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"add",this).call(this,u,p)}},{key:"canAdd",value:function(u,p){return S(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,u,p)||S(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"canAdd",this).call(this,u,parseInt(p))}},{key:"value",value:function(u){return parseInt(S(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this).call(this,u))||void 0}}]),h}(b.default.Attributor.Class),d=new r("indent","ql-indent",{scope:b.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});i.IndentClass=d},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(4),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}function b(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function _(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function m(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var c=function(n){m(r,n);function r(){return b(this,r),_(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return r}(S.default);c.blotName="blockquote",c.tagName="blockquote",i.default=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function r(d,f){for(var h=0;h<f.length;h++){var l=f[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}return function(d,f,h){return f&&r(d.prototype,f),h&&r(d,h),d}}(),S=a(4),w=b(S);function b(r){return r&&r.__esModule?r:{default:r}}function _(r,d){if(!(r instanceof d))throw new TypeError("Cannot call a class as a function")}function m(r,d){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:r}function c(r,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);r.prototype=Object.create(d&&d.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(r,d):r.__proto__=d)}var n=function(r){c(d,r);function d(){return _(this,d),m(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return O(d,null,[{key:"formats",value:function(h){return this.tagName.indexOf(h.tagName)+1}}]),d}(w.default);n.blotName="header",n.tagName=["H1","H2","H3","H4","H5","H6"],i.default=n},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.ListItem=void 0;var O=function(){function s(g,D){for(var x=0;x<D.length;x++){var A=D[x];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(g,A.key,A)}}return function(g,D,x){return D&&s(g.prototype,D),x&&s(g,x),g}}(),S=function s(g,D,x){g===null&&(g=Function.prototype);var A=Object.getOwnPropertyDescriptor(g,D);if(A===void 0){var I=Object.getPrototypeOf(g);return I===null?void 0:s(I,D,x)}else{if("value"in A)return A.value;var T=A.get;return T===void 0?void 0:T.call(x)}},w=a(0),b=r(w),_=a(4),m=r(_),c=a(25),n=r(c);function r(s){return s&&s.__esModule?s:{default:s}}function d(s,g,D){return g in s?Object.defineProperty(s,g,{value:D,enumerable:!0,configurable:!0,writable:!0}):s[g]=D,s}function f(s,g){if(!(s instanceof g))throw new TypeError("Cannot call a class as a function")}function h(s,g){if(!s)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:s}function l(s,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);s.prototype=Object.create(g&&g.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(s,g):s.__proto__=g)}var u=function(s){l(g,s);function g(){return f(this,g),h(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}return O(g,[{key:"format",value:function(x,A){x===p.blotName&&!A?this.replaceWith(b.default.create(this.statics.scope)):S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"format",this).call(this,x,A)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(x,A){return this.parent.isolate(this.offset(this.parent),this.length()),x===this.parent.statics.blotName?(this.parent.replaceWith(x,A),this):(this.parent.unwrap(),S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"replaceWith",this).call(this,x,A))}}],[{key:"formats",value:function(x){return x.tagName===this.tagName?void 0:S(g.__proto__||Object.getPrototypeOf(g),"formats",this).call(this,x)}}]),g}(m.default);u.blotName="list-item",u.tagName="LI";var p=function(s){l(g,s),O(g,null,[{key:"create",value:function(x){var A=x==="ordered"?"OL":"UL",I=S(g.__proto__||Object.getPrototypeOf(g),"create",this).call(this,A);return(x==="checked"||x==="unchecked")&&I.setAttribute("data-checked",x==="checked"),I}},{key:"formats",value:function(x){if(x.tagName==="OL")return"ordered";if(x.tagName==="UL")return x.hasAttribute("data-checked")?x.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function g(D){f(this,g);var x=h(this,(g.__proto__||Object.getPrototypeOf(g)).call(this,D)),A=function(T){if(T.target.parentNode===D){var E=x.statics.formats(D),v=b.default.find(T.target);E==="checked"?v.format("list","unchecked"):E==="unchecked"&&v.format("list","checked")}};return D.addEventListener("touchstart",A),D.addEventListener("mousedown",A),x}return O(g,[{key:"format",value:function(x,A){this.children.length>0&&this.children.tail.format(x,A)}},{key:"formats",value:function(){return d({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(x,A){if(x instanceof u)S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"insertBefore",this).call(this,x,A);else{var I=A==null?this.length():A.offset(this),T=this.split(I);T.parent.insertBefore(x,T)}}},{key:"optimize",value:function(x){S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"optimize",this).call(this,x);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&A.domNode.tagName===this.domNode.tagName&&A.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(A.moveChildren(this),A.remove())}},{key:"replace",value:function(x){if(x.statics.blotName!==this.statics.blotName){var A=b.default.create(this.statics.defaultChild);x.moveChildren(A),this.appendChild(A)}S(g.prototype.__proto__||Object.getPrototypeOf(g.prototype),"replace",this).call(this,x)}}]),g}(n.default);p.blotName="list",p.scope=b.default.Scope.BLOCK_BLOT,p.tagName=["OL","UL"],p.defaultChild="list-item",p.allowedChildren=[u],i.ListItem=u,i.default=p},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(56),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}function b(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function _(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function m(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var c=function(n){m(r,n);function r(){return b(this,r),_(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return r}(S.default);c.blotName="italic",c.tagName=["EM","I"],i.default=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function d(f,h){for(var l=0;l<h.length;l++){var u=h[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(f,u.key,u)}}return function(f,h,l){return h&&d(f.prototype,h),l&&d(f,l),f}}(),S=function d(f,h,l){f===null&&(f=Function.prototype);var u=Object.getOwnPropertyDescriptor(f,h);if(u===void 0){var p=Object.getPrototypeOf(f);return p===null?void 0:d(p,h,l)}else{if("value"in u)return u.value;var s=u.get;return s===void 0?void 0:s.call(l)}},w=a(6),b=_(w);function _(d){return d&&d.__esModule?d:{default:d}}function m(d,f){if(!(d instanceof f))throw new TypeError("Cannot call a class as a function")}function c(d,f){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:d}function n(d,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);d.prototype=Object.create(f&&f.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(d,f):d.__proto__=f)}var r=function(d){n(f,d);function f(){return m(this,f),c(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return O(f,null,[{key:"create",value:function(l){return l==="super"?document.createElement("sup"):l==="sub"?document.createElement("sub"):S(f.__proto__||Object.getPrototypeOf(f),"create",this).call(this,l)}},{key:"formats",value:function(l){if(l.tagName==="SUB")return"sub";if(l.tagName==="SUP")return"super"}}]),f}(b.default);r.blotName="script",r.tagName=["SUB","SUP"],i.default=r},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(6),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}function b(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function _(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function m(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var c=function(n){m(r,n);function r(){return b(this,r),_(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return r}(S.default);c.blotName="strike",c.tagName="S",i.default=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=a(6),S=w(O);function w(n){return n&&n.__esModule?n:{default:n}}function b(n,r){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}function _(n,r){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r&&(typeof r=="object"||typeof r=="function")?r:n}function m(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);n.prototype=Object.create(r&&r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r)}var c=function(n){m(r,n);function r(){return b(this,r),_(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return r}(S.default);c.blotName="underline",c.tagName="U",i.default=c},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function h(l,u){for(var p=0;p<u.length;p++){var s=u[p];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,u,p){return u&&h(l.prototype,u),p&&h(l,p),l}}(),S=function h(l,u,p){l===null&&(l=Function.prototype);var s=Object.getOwnPropertyDescriptor(l,u);if(s===void 0){var g=Object.getPrototypeOf(l);return g===null?void 0:h(g,u,p)}else{if("value"in s)return s.value;var D=s.get;return D===void 0?void 0:D.call(p)}},w=a(0),b=m(w),_=a(27);function m(h){return h&&h.__esModule?h:{default:h}}function c(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function n(h,l){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:h}function r(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(h,l):h.__proto__=l)}var d=["alt","height","width"],f=function(h){r(l,h);function l(){return c(this,l),n(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return O(l,[{key:"format",value:function(p,s){d.indexOf(p)>-1?s?this.domNode.setAttribute(p,s):this.domNode.removeAttribute(p):S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"format",this).call(this,p,s)}}],[{key:"create",value:function(p){var s=S(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this,p);return typeof p=="string"&&s.setAttribute("src",this.sanitize(p)),s}},{key:"formats",value:function(p){return d.reduce(function(s,g){return p.hasAttribute(g)&&(s[g]=p.getAttribute(g)),s},{})}},{key:"match",value:function(p){return/\.(jpe?g|gif|png)$/.test(p)||/^data:image\/.+;base64/.test(p)}},{key:"sanitize",value:function(p){return(0,_.sanitize)(p,["http","https","data"])?p:"//:0"}},{key:"value",value:function(p){return p.getAttribute("src")}}]),l}(b.default.Embed);f.blotName="image",f.tagName="IMG",i.default=f},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0});var O=function(){function h(l,u){for(var p=0;p<u.length;p++){var s=u[p];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}return function(l,u,p){return u&&h(l.prototype,u),p&&h(l,p),l}}(),S=function h(l,u,p){l===null&&(l=Function.prototype);var s=Object.getOwnPropertyDescriptor(l,u);if(s===void 0){var g=Object.getPrototypeOf(l);return g===null?void 0:h(g,u,p)}else{if("value"in s)return s.value;var D=s.get;return D===void 0?void 0:D.call(p)}},w=a(4),b=a(27),_=m(b);function m(h){return h&&h.__esModule?h:{default:h}}function c(h,l){if(!(h instanceof l))throw new TypeError("Cannot call a class as a function")}function n(h,l){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:h}function r(h,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);h.prototype=Object.create(l&&l.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(h,l):h.__proto__=l)}var d=["height","width"],f=function(h){r(l,h);function l(){return c(this,l),n(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}return O(l,[{key:"format",value:function(p,s){d.indexOf(p)>-1?s?this.domNode.setAttribute(p,s):this.domNode.removeAttribute(p):S(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"format",this).call(this,p,s)}}],[{key:"create",value:function(p){var s=S(l.__proto__||Object.getPrototypeOf(l),"create",this).call(this,p);return s.setAttribute("frameborder","0"),s.setAttribute("allowfullscreen",!0),s.setAttribute("src",this.sanitize(p)),s}},{key:"formats",value:function(p){return d.reduce(function(s,g){return p.hasAttribute(g)&&(s[g]=p.getAttribute(g)),s},{})}},{key:"sanitize",value:function(p){return _.default.sanitize(p)}},{key:"value",value:function(p){return p.getAttribute("src")}}]),l}(w.BlockEmbed);f.blotName="video",f.className="ql-video",f.tagName="IFRAME",i.default=f},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.FormulaBlot=void 0;var O=function(){function p(s,g){for(var D=0;D<g.length;D++){var x=g[D];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(s,x.key,x)}}return function(s,g,D){return g&&p(s.prototype,g),D&&p(s,D),s}}(),S=function p(s,g,D){s===null&&(s=Function.prototype);var x=Object.getOwnPropertyDescriptor(s,g);if(x===void 0){var A=Object.getPrototypeOf(s);return A===null?void 0:p(A,g,D)}else{if("value"in x)return x.value;var I=x.get;return I===void 0?void 0:I.call(D)}},w=a(35),b=r(w),_=a(5),m=r(_),c=a(9),n=r(c);function r(p){return p&&p.__esModule?p:{default:p}}function d(p,s){if(!(p instanceof s))throw new TypeError("Cannot call a class as a function")}function f(p,s){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:p}function h(p,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);p.prototype=Object.create(s&&s.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(p,s):p.__proto__=s)}var l=function(p){h(s,p);function s(){return d(this,s),f(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return O(s,null,[{key:"create",value:function(D){var x=S(s.__proto__||Object.getPrototypeOf(s),"create",this).call(this,D);return typeof D=="string"&&(window.katex.render(D,x,{throwOnError:!1,errorColor:"#f00"}),x.setAttribute("data-value",D)),x}},{key:"value",value:function(D){return D.getAttribute("data-value")}}]),s}(b.default);l.blotName="formula",l.className="ql-formula",l.tagName="SPAN";var u=function(p){h(s,p),O(s,null,[{key:"register",value:function(){m.default.register(l,!0)}}]);function s(){d(this,s);var g=f(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return g}return s}(n.default);i.FormulaBlot=l,i.default=u},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.CodeToken=i.CodeBlock=void 0;var O=function(){function D(x,A){for(var I=0;I<A.length;I++){var T=A[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(x,T.key,T)}}return function(x,A,I){return A&&D(x.prototype,A),I&&D(x,I),x}}(),S=function D(x,A,I){x===null&&(x=Function.prototype);var T=Object.getOwnPropertyDescriptor(x,A);if(T===void 0){var E=Object.getPrototypeOf(x);return E===null?void 0:D(E,A,I)}else{if("value"in T)return T.value;var v=T.get;return v===void 0?void 0:v.call(I)}},w=a(0),b=f(w),_=a(5),m=f(_),c=a(9),n=f(c),r=a(13),d=f(r);function f(D){return D&&D.__esModule?D:{default:D}}function h(D,x){if(!(D instanceof x))throw new TypeError("Cannot call a class as a function")}function l(D,x){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:D}function u(D,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);D.prototype=Object.create(x&&x.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(D,x):D.__proto__=x)}var p=function(D){u(x,D);function x(){return h(this,x),l(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return O(x,[{key:"replaceWith",value:function(I){this.domNode.textContent=this.domNode.textContent,this.attach(),S(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"replaceWith",this).call(this,I)}},{key:"highlight",value:function(I){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=I(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),x}(d.default);p.className="ql-syntax";var s=new b.default.Attributor.Class("token","hljs",{scope:b.default.Scope.INLINE}),g=function(D){u(x,D),O(x,null,[{key:"register",value:function(){m.default.register(s,!0),m.default.register(p,!0)}}]);function x(A,I){h(this,x);var T=l(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,A,I));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var E=null;return T.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(E),E=setTimeout(function(){T.highlight(),E=null},T.options.interval)}),T.highlight(),T}return O(x,[{key:"highlight",value:function(){var I=this;if(!this.quill.selection.composing){this.quill.update(m.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(E){E.highlight(I.options.highlight)}),this.quill.update(m.default.sources.SILENT),T!=null&&this.quill.setSelection(T,m.default.sources.SILENT)}}}]),x}(n.default);g.DEFAULTS={highlight:function(){return window.hljs==null?null:function(D){var x=window.hljs.highlightAuto(D);return x.value}}(),interval:1e3},i.CodeBlock=p,i.CodeToken=s,i.default=g},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(e,i){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(e,i){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(e,i){e.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(e,i){e.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(e,i){e.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(e,i,a){Object.defineProperty(i,"__esModule",{value:!0}),i.default=i.BubbleTooltip=void 0;var O=function x(A,I,T){A===null&&(A=Function.prototype);var E=Object.getOwnPropertyDescriptor(A,I);if(E===void 0){var v=Object.getPrototypeOf(A);return v===null?void 0:x(v,I,T)}else{if("value"in E)return E.value;var y=E.get;return y===void 0?void 0:y.call(T)}},S=function(){function x(A,I){for(var T=0;T<I.length;T++){var E=I[T];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(A,E.key,E)}}return function(A,I,T){return I&&x(A.prototype,I),T&&x(A,T),A}}(),w=a(3),b=h(w),_=a(8),m=h(_),c=a(43),n=h(c),r=a(15),d=a(41),f=h(d);function h(x){return x&&x.__esModule?x:{default:x}}function l(x,A){if(!(x instanceof A))throw new TypeError("Cannot call a class as a function")}function u(x,A){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:x}function p(x,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);x.prototype=Object.create(A&&A.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(x,A):x.__proto__=A)}var s=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],g=function(x){p(A,x);function A(I,T){l(this,A),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=s);var E=u(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,I,T));return E.quill.container.classList.add("ql-bubble"),E}return S(A,[{key:"extendToolbar",value:function(T){this.tooltip=new D(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),f.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),f.default)}}]),A}(n.default);g.DEFAULTS=(0,b.default)(!0,{},n.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(A){A?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var D=function(x){p(A,x);function A(I,T){l(this,A);var E=u(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,I,T));return E.quill.on(m.default.events.EDITOR_CHANGE,function(v,y,k,C){if(v===m.default.events.SELECTION_CHANGE)if(y!=null&&y.length>0&&C===m.default.sources.USER){E.show(),E.root.style.left="0px",E.root.style.width="",E.root.style.width=E.root.offsetWidth+"px";var j=E.quill.getLines(y.index,y.length);if(j.length===1)E.position(E.quill.getBounds(y));else{var B=j[j.length-1],W=E.quill.getIndex(B),q=Math.min(B.length()-1,y.index+y.length-W),M=E.quill.getBounds(new r.Range(W,q));E.position(M)}}else document.activeElement!==E.textbox&&E.quill.hasFocus()&&E.hide()}),E}return S(A,[{key:"listen",value:function(){var T=this;O(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var E=T.quill.getSelection();E!=null&&T.position(T.quill.getBounds(E))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var E=O(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"position",this).call(this,T),v=this.root.querySelector(".ql-tooltip-arrow");if(v.style.marginLeft="",E===0)return E;v.style.marginLeft=-1*E-v.offsetWidth/2+"px"}}]),A}(c.BaseTooltip);D.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),i.BubbleTooltip=D,i.default=g},function(e,i,a){e.exports=a(63)}]).default})})(Vt);var dt=Xt(Vt.exports);function _t(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_t=function(o){return typeof o}:_t=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_t(t)}function Kt(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function Nt(t,o){for(var e=0;e<o.length;e++){var i=o[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Wt(t,o,e){return o&&Nt(t.prototype,o),e&&Nt(t,e),t}function Mt(t,o,e){return o in t?Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[o]=e,t}function wt(){return wt=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},wt.apply(this,arguments)}function Fe(t,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&Ot(t,o)}function vt(t){return vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(t)}function Ot(t,o){return Ot=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},Ot(t,o)}function Ue(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Et(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ze(t,o){if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Et(t)}function He(t){var o=Ue();return function(){var i=vt(t),a;if(o){var O=vt(this).constructor;a=Reflect.construct(i,arguments,O)}else a=i.apply(this,arguments);return ze(this,a)}}function Ve(t,o){for(;!Object.prototype.hasOwnProperty.call(t,o)&&(t=vt(t),t!==null););return t}function yt(){return typeof Reflect!="undefined"&&Reflect.get?yt=Reflect.get:yt=function(o,e,i){var a=Ve(o,e);if(!!a){var O=Object.getOwnPropertyDescriptor(a,e);return O.get?O.get.call(arguments.length<3?o:i):O.value}},yt.apply(this,arguments)}function Ke(t,o){if(!!t){if(typeof t=="string")return Pt(t,o);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Pt(t,o)}}function Pt(t,o){(o==null||o>t.length)&&(o=t.length);for(var e=0,i=new Array(o);e<o;e++)i[e]=t[e];return i}function We(t,o){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ke(t))||o&&t&&typeof t.length=="number"){e&&(t=e);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(b){throw b},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var O=!0,S=!1,w;return{s:function(){e=e.call(t)},n:function(){var b=e.next();return O=b.done,b},e:function(b){S=!0,w=b},f:function(){try{!O&&e.return!=null&&e.return()}finally{if(S)throw w}}}}var ht={TAB:9,ENTER:13,ESCAPE:27,UP:38,DOWN:40};function Ge(t,o,e){var i=t;return Object.keys(o).forEach(function(a){e.indexOf(a)>-1?i.dataset[a]=o[a]:delete i.dataset[a]}),i}function Qe(t,o){return o.reduce(function(e,i){var a=t.lastIndexOf(i);return a>e.mentionCharIndex?{mentionChar:i,mentionCharIndex:a}:{mentionChar:e.mentionChar,mentionCharIndex:e.mentionCharIndex}},{mentionChar:null,mentionCharIndex:-1})}function Ye(t,o){return o.test(t)}function Ze(t,o,e){return t>-1?!(e&&!(t===0||!!o[t-1].match(/\s/g))):!1}function Xe(t){return _t(t)!=="object"||t===null?t:JSON.parse(JSON.stringify(t))}var Je=dt.import("blots/embed"),kt=function(t){Fe(e,t);var o=He(e);function e(i,a){var O;return Kt(this,e),O=o.call(this,i,a),Mt(Et(O),"hoverHandler",void 0),Mt(Et(O),"hoverHandler",void 0),O.clickHandler=null,O.hoverHandler=null,O.mounted=!1,O}return Wt(e,[{key:"attach",value:function(){yt(vt(e.prototype),"attach",this).call(this),this.mounted||(this.mounted=!0,this.clickHandler=this.getClickHandler(),this.hoverHandler=this.getHoverHandler(),this.domNode.addEventListener("click",this.clickHandler,!1),this.domNode.addEventListener("mouseenter",this.hoverHandler,!1))}},{key:"detach",value:function(){yt(vt(e.prototype),"detach",this).call(this),this.mounted=!1,this.clickHandler&&(this.domNode.removeEventListener("click",this.clickHandler),this.clickHandler=null)}},{key:"getClickHandler",value:function(){var a=this;return function(O){var S=a.buildEvent("mention-clicked",O);window.dispatchEvent(S),O.preventDefault()}}},{key:"getHoverHandler",value:function(){var a=this;return function(O){var S=a.buildEvent("mention-hovered",O);window.dispatchEvent(S),O.preventDefault()}}},{key:"buildEvent",value:function(a,O){var S=new Event(a,{bubbles:!0,cancelable:!0});return S.value=wt({},this.domNode.dataset),S.event=O,S}}],[{key:"create",value:function(a){var O=yt(vt(e),"create",this).call(this),S=document.createElement("span");return S.className="ql-mention-denotation-char",S.innerHTML=a.denotationChar,O.appendChild(S),O.innerHTML+=a.value,e.setDataValues(O,a)}},{key:"setDataValues",value:function(a,O){var S=a;return Object.keys(O).forEach(function(w){S.dataset[w]=O[w]}),S}},{key:"value",value:function(a){return a.dataset}}]),e}(Je);kt.blotName="mention";kt.tagName="span";kt.className="mention";dt.register(kt);var ti=function(){function t(o,e){var i=this;Kt(this,t),this.isOpen=!1,this.itemIndex=0,this.mentionCharPos=null,this.cursorPos=null,this.values=[],this.suspendMouseEnter=!1,this.existingSourceExecutionToken=null,this.quill=o,this.options={source:null,renderItem:function(b){return"".concat(b.value)},renderLoading:function(){return null},onSelect:function(b,_){_(b)},mentionDenotationChars:["@"],showDenotationChar:!0,allowedChars:/^[a-zA-Z0-9_]*$/,minChars:0,maxChars:31,offsetTop:2,offsetLeft:0,isolateCharacter:!1,fixMentionsToQuill:!1,positioningStrategy:"normal",defaultMenuOrientation:"bottom",blotName:"mention",dataAttributes:["id","value","denotationChar","link","target","disabled"],linkTarget:"_blank",onOpen:function(){return!0},onBeforeClose:function(){return!0},onClose:function(){return!0},listItemClass:"ql-mention-list-item",mentionContainerClass:"ql-mention-list-container",mentionListClass:"ql-mention-list",spaceAfterInsert:!0,selectKeys:[ht.ENTER]},wt(this.options,e,{dataAttributes:Array.isArray(e.dataAttributes)?this.options.dataAttributes.concat(e.dataAttributes):this.options.dataAttributes}),this.mentionContainer=document.createElement("div"),this.mentionContainer.className=this.options.mentionContainerClass?this.options.mentionContainerClass:"",this.mentionContainer.style.cssText="display: none; position: absolute;",this.mentionContainer.onmousemove=this.onContainerMouseMove.bind(this),this.options.fixMentionsToQuill&&(this.mentionContainer.style.width="auto"),this.mentionList=document.createElement("ul"),this.mentionList.id="quill-mention-list",o.root.setAttribute("aria-owns","quill-mention-list"),this.mentionList.className=this.options.mentionListClass?this.options.mentionListClass:"",this.mentionContainer.appendChild(this.mentionList),o.on("text-change",this.onTextChange.bind(this)),o.on("selection-change",this.onSelectionChange.bind(this)),o.container.addEventListener("paste",function(){setTimeout(function(){var w=o.getSelection();i.onSelectionChange(w)})}),o.keyboard.addBinding({key:ht.TAB},this.selectHandler.bind(this)),o.keyboard.bindings[ht.TAB].unshift(o.keyboard.bindings[ht.TAB].pop());var a=We(this.options.selectKeys),O;try{for(a.s();!(O=a.n()).done;){var S=O.value;o.keyboard.addBinding({key:S},this.selectHandler.bind(this))}}catch(w){a.e(w)}finally{a.f()}o.keyboard.bindings[ht.ENTER].unshift(o.keyboard.bindings[ht.ENTER].pop()),o.keyboard.addBinding({key:ht.ESCAPE},this.escapeHandler.bind(this)),o.keyboard.addBinding({key:ht.UP},this.upHandler.bind(this)),o.keyboard.addBinding({key:ht.DOWN},this.downHandler.bind(this))}return Wt(t,[{key:"selectHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.selectItem(),!1):!0}},{key:"escapeHandler",value:function(){return this.isOpen?(this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.hideMentionList(),!1):!0}},{key:"upHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.prevItem(),!1):!0}},{key:"downHandler",value:function(){return this.isOpen&&!this.existingSourceExecutionToken?(this.nextItem(),!1):!0}},{key:"showMentionList",value:function(){this.options.positioningStrategy==="fixed"?document.body.appendChild(this.mentionContainer):this.quill.container.appendChild(this.mentionContainer),this.mentionContainer.style.visibility="hidden",this.mentionContainer.style.display="",this.mentionContainer.scrollTop=0,this.setMentionContainerPosition(),this.setIsOpen(!0)}},{key:"hideMentionList",value:function(){this.options.onBeforeClose(),this.mentionContainer.style.display="none",this.mentionContainer.remove(),this.setIsOpen(!1),this.quill.root.removeAttribute("aria-activedescendant")}},{key:"highlightItem",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=0;i<this.mentionList.childNodes.length;i+=1)this.mentionList.childNodes[i].classList.remove("selected");if(!(this.itemIndex===-1||this.mentionList.childNodes[this.itemIndex].dataset.disabled==="true")&&(this.mentionList.childNodes[this.itemIndex].classList.add("selected"),this.quill.root.setAttribute("aria-activedescendant",this.mentionList.childNodes[this.itemIndex].id),e)){var a=this.mentionList.childNodes[this.itemIndex].offsetHeight,O=this.mentionList.childNodes[this.itemIndex].offsetTop,S=this.mentionContainer.scrollTop,w=S+this.mentionContainer.offsetHeight;O<S?this.mentionContainer.scrollTop=O:O>w-a&&(this.mentionContainer.scrollTop+=O-w+a)}}},{key:"getItemData",value:function(){var e=this.mentionList.childNodes[this.itemIndex].dataset.link,i=typeof e!="undefined",a=this.mentionList.childNodes[this.itemIndex].dataset.target;return i&&(this.mentionList.childNodes[this.itemIndex].dataset.value='<a href="'.concat(e,'" target=').concat(a||this.options.linkTarget,">").concat(this.mentionList.childNodes[this.itemIndex].dataset.value)),this.mentionList.childNodes[this.itemIndex].dataset}},{key:"onContainerMouseMove",value:function(){this.suspendMouseEnter=!1}},{key:"selectItem",value:function(){var e=this;if(this.itemIndex!==-1){var i=this.getItemData();i.disabled||(this.options.onSelect(i,function(a){e.insertItem(a)}),this.hideMentionList())}}},{key:"insertItem",value:function(e,i){var a=e;if(a!==null){this.options.showDenotationChar||(a.denotationChar="");var O;i?O=this.cursorPos:(O=this.mentionCharPos,this.quill.deleteText(this.mentionCharPos,this.cursorPos-this.mentionCharPos,dt.sources.USER)),this.quill.insertEmbed(O,this.options.blotName,a,dt.sources.USER),this.options.spaceAfterInsert?(this.quill.insertText(O+1," ",dt.sources.USER),this.quill.setSelection(O+2,dt.sources.USER)):this.quill.setSelection(O+1,dt.sources.USER),this.hideMentionList()}}},{key:"onItemMouseEnter",value:function(e){if(!this.suspendMouseEnter){var i=Number(e.target.dataset.index);!Number.isNaN(i)&&i!==this.itemIndex&&(this.itemIndex=i,this.highlightItem(!1))}}},{key:"onDisabledItemMouseEnter",value:function(e){this.suspendMouseEnter||(this.itemIndex=-1,this.highlightItem(!1))}},{key:"onItemClick",value:function(e){e.button===0&&(e.preventDefault(),e.stopImmediatePropagation(),this.itemIndex=e.currentTarget.dataset.index,this.highlightItem(),this.selectItem())}},{key:"onItemMouseDown",value:function(e){e.preventDefault(),e.stopImmediatePropagation()}},{key:"renderLoading",value:function(){var e=this.options.renderLoading();if(!!e){if(this.mentionContainer.getElementsByClassName("ql-mention-loading").length>0){this.showMentionList();return}this.mentionList.innerHTML="";var i=document.createElement("div");i.className="ql-mention-loading",i.innerHTML=this.options.renderLoading(),this.mentionContainer.append(i),this.showMentionList()}}},{key:"removeLoading",value:function(){var e=this.mentionContainer.getElementsByClassName("ql-mention-loading");e.length>0&&e[0].remove()}},{key:"renderList",value:function(e,i,a){if(i&&i.length>0){this.removeLoading(),this.values=i,this.mentionList.innerHTML="";for(var O=-1,S=0;S<i.length;S+=1){var w=document.createElement("li");w.id="quill-mention-item-"+S,w.className=this.options.listItemClass?this.options.listItemClass:"",i[S].disabled?(w.className+=" disabled",w.setAttribute("aria-hidden","true")):O===-1&&(O=S),w.dataset.index=S,w.innerHTML=this.options.renderItem(i[S],a),i[S].disabled?w.onmouseenter=this.onDisabledItemMouseEnter.bind(this):(w.onmouseenter=this.onItemMouseEnter.bind(this),w.onmouseup=this.onItemClick.bind(this),w.onmousedown=this.onItemMouseDown.bind(this)),w.dataset.denotationChar=e,this.mentionList.appendChild(Ge(w,i[S],this.options.dataAttributes))}this.itemIndex=O,this.highlightItem(),this.showMentionList()}else this.hideMentionList()}},{key:"nextItem",value:function(){var e=0,i;do{e++,i=(this.itemIndex+e)%this.values.length;var a=this.mentionList.childNodes[i].dataset.disabled==="true";if(e===this.values.length+1){i=-1;break}}while(a);this.itemIndex=i,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"prevItem",value:function(){var e=0,i;do{e++,i=(this.itemIndex+this.values.length-e)%this.values.length;var a=this.mentionList.childNodes[i].dataset.disabled==="true";if(e===this.values.length+1){i=-1;break}}while(a);this.itemIndex=i,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"containerBottomIsNotVisible",value:function(e,i){var a=e+this.mentionContainer.offsetHeight+i.top;return a>window.pageYOffset+window.innerHeight}},{key:"containerRightIsNotVisible",value:function(e,i){if(this.options.fixMentionsToQuill)return!1;var a=e+this.mentionContainer.offsetWidth+i.left,O=window.pageXOffset+document.documentElement.clientWidth;return a>O}},{key:"setIsOpen",value:function(e){this.isOpen!==e&&(e?this.options.onOpen():this.options.onClose(),this.isOpen=e)}},{key:"setMentionContainerPosition",value:function(){this.options.positioningStrategy==="fixed"?this.setMentionContainerPosition_Fixed():this.setMentionContainerPosition_Normal()}},{key:"setMentionContainerPosition_Normal",value:function(){var e=this,i=this.quill.container.getBoundingClientRect(),a=this.quill.getBounds(this.mentionCharPos),O=this.mentionContainer.offsetHeight,S=this.options.offsetTop,w=this.options.offsetLeft;if(this.options.fixMentionsToQuill){var b=0;this.mentionContainer.style.right="".concat(b,"px")}else w+=a.left;if(this.containerRightIsNotVisible(w,i)){var _=this.mentionContainer.offsetWidth+this.options.offsetLeft,m=i.width;w=m-_}if(this.options.defaultMenuOrientation==="top"){if(this.options.fixMentionsToQuill?S=-1*(O+this.options.offsetTop):S=a.top-(O+this.options.offsetTop),S+i.top<=0){var c=this.options.offsetTop;this.options.fixMentionsToQuill?c+=i.height:c+=a.bottom,S=c}}else if(this.options.fixMentionsToQuill?S+=i.height:S+=a.bottom,this.containerBottomIsNotVisible(S,i)){var n=this.options.offsetTop*-1;this.options.fixMentionsToQuill||(n+=a.top),S=n-O}S>=0?this.options.mentionContainerClass.split(" ").forEach(function(r){e.mentionContainer.classList.add("".concat(r,"-bottom")),e.mentionContainer.classList.remove("".concat(r,"-top"))}):this.options.mentionContainerClass.split(" ").forEach(function(r){e.mentionContainer.classList.add("".concat(r,"-top")),e.mentionContainer.classList.remove("".concat(r,"-bottom"))}),this.mentionContainer.style.top="".concat(S,"px"),this.mentionContainer.style.left="".concat(w,"px"),this.mentionContainer.style.visibility="visible"}},{key:"setMentionContainerPosition_Fixed",value:function(){var e=this;this.mentionContainer.style.position="fixed",this.mentionContainer.style.height=null;var i=Xe(this.quill.container.getBoundingClientRect());i.top+=window.scrollY;var a=this.quill.getBounds(this.mentionCharPos),O={left:i.left+a.left,top:i.top+a.top,width:0,height:a.height},S=this.options.fixMentionsToQuill?i:O,w=this.options.offsetTop,b=this.options.offsetLeft;if(this.options.fixMentionsToQuill){var _=S.right;this.mentionContainer.style.right="".concat(_,"px")}else b+=S.left,b+this.mentionContainer.offsetWidth>document.documentElement.clientWidth&&(b-=b+this.mentionContainer.offsetWidth-document.documentElement.clientWidth);var m=S.top,c=document.documentElement.clientHeight-(S.top+S.height),n=this.mentionContainer.offsetHeight<=c,r=this.mentionContainer.offsetHeight<=m,d;this.options.defaultMenuOrientation==="top"&&r?d="top":this.options.defaultMenuOrientation==="bottom"&&n?d="bottom":d=c>m?"bottom":"top",d==="bottom"?(w=S.top+S.height,n||(this.mentionContainer.style.height=c-3+"px"),this.options.mentionContainerClass.split(" ").forEach(function(f){e.mentionContainer.classList.add("".concat(f,"-bottom")),e.mentionContainer.classList.remove("".concat(f,"-top"))})):(w=S.top-this.mentionContainer.offsetHeight,r||(this.mentionContainer.style.height=m-3+"px",w=3),this.options.mentionContainerClass.split(" ").forEach(function(f){e.mentionContainer.classList.add("".concat(f,"-top")),e.mentionContainer.classList.remove("".concat(f,"-bottom"))})),this.mentionContainer.style.top="".concat(w,"px"),this.mentionContainer.style.left="".concat(b,"px"),this.mentionContainer.style.visibility="visible"}},{key:"getTextBeforeCursor",value:function(){var e=Math.max(0,this.cursorPos-this.options.maxChars),i=this.quill.getText(e,this.cursorPos-e);return i}},{key:"onSomethingChange",value:function(){var e=this,i=this.quill.getSelection();if(i!=null){this.cursorPos=i.index;var a=this.getTextBeforeCursor(),O=Qe(a,this.options.mentionDenotationChars),S=O.mentionChar,w=O.mentionCharIndex;if(Ze(w,a,this.options.isolateCharacter)){var b=this.cursorPos-(a.length-w);this.mentionCharPos=b;var _=a.substring(w+S.length);if(_.length>=this.options.minChars&&Ye(_,this.getAllowedCharsRegex(S))){this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.renderLoading();var m={abandoned:!1};this.existingSourceExecutionToken=m,this.options.source(_,function(c,n){m.abandoned||(e.existingSourceExecutionToken=null,e.renderList(S,c,n))},S)}else this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.hideMentionList()}else this.existingSourceExecutionToken&&(this.existingSourceExecutionToken.abandoned=!0),this.hideMentionList()}}},{key:"getAllowedCharsRegex",value:function(e){return this.options.allowedChars instanceof RegExp?this.options.allowedChars:this.options.allowedChars(e)}},{key:"onTextChange",value:function(e,i,a){a==="user"&&this.onSomethingChange()}},{key:"onSelectionChange",value:function(e){e&&e.length===0?this.onSomethingChange():this.hideMentionList()}},{key:"openMenu",value:function(e){var i=this.quill.getSelection(!0);this.quill.insertText(i.index,e),this.quill.blur(),this.quill.focus()}}]),t}();dt.register("modules/mention",ti);function St(t,o){t=t.replace(/=/g,"");var e=[];switch(o.constructor){case String:case Number:case Boolean:e.push(encodeURIComponent(t)+"="+encodeURIComponent(o));break;case Array:o.forEach(function(i){e=e.concat(St(t+"[]=",i))});break;case Object:Object.keys(o).forEach(function(i){var a=o[i];e=e.concat(St(t+"["+i+"]",a))})}return e}function Gt(t){var o=[];return t.forEach(function(e){typeof e=="string"?o.push(e):o=o.concat(Gt(e))}),o}function ei(t,o,e){if(o===void 0&&(o={}),typeof t!="string")throw new Error('[Vue-jsonp] Type of param "url" is not string.');if(typeof o!="object"||!o)throw new Error("[Vue-jsonp] Invalid params, should be an object.");return e=typeof e=="number"?e:5e3,new Promise(function(i,a){var O=typeof o.callbackQuery=="string"?o.callbackQuery:"callback",S=typeof o.callbackName=="string"?o.callbackName:"jsonp_"+(Math.floor(1e5*Math.random())*Date.now()).toString(16);o[O]=S,delete o.callbackQuery,delete o.callbackName;var w=[];Object.keys(o).forEach(function(d){w=w.concat(St(d,o[d]))});var b=Gt(w).join("&"),_=function(){m(),clearTimeout(n),a({status:400,statusText:"Bad Request"})},m=function(){r.removeEventListener("error",_)},c=function(){document.body.removeChild(r),delete window[S]},n=null;e>-1&&(n=setTimeout(function(){m(),c(),a({statusText:"Request Timeout",status:408})},e)),window[S]=function(d){clearTimeout(n),m(),c(),i(d)};var r=document.createElement("script");r.addEventListener("error",_),r.src=t+(/\?/.test(t)?"&":"?")+b,document.body.appendChild(r)})}var ii=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"chat-emoji-wrapper"},[e("div",{staticClass:"chat-emoji-box"},[t.type==="emosearch"?e("div",{staticClass:"chat-emoji-emosearch"},[e("Input",{attrs:{clearable:"",placeholder:t.$L("\u641C\u7D22\u8868\u60C5")},model:{value:t.emosearchKey,callback:function(i){t.emosearchKey=i},expression:"emosearchKey"}},[e("Icon",{class:{"icon-loading":t.emosearchLoad},attrs:{slot:"prefix",type:t.emosearchLoad?"ios-loading":"ios-search"},slot:"prefix"})],1)],1):t.type==="emoji"?e("div",{staticClass:"chat-emoji-nav"},t._l(t.emojiNavList,function(i){var a;return e("div",{key:i.type,class:(a={},a[`i-${i.name}`]=!0,a.active=i.type===t.emojiNavActive,a),domProps:{innerHTML:t._s(i.content)},on:{click:function(O){t.emojiNavActive=i.type}}})}),0):t._e(),e("ul",{staticClass:"scrollbar-overlay",class:[t.type,"no-dark-content"]},t._l(t.list,function(i){return e("li",{on:{click:function(a){return t.onSelect(a,i)}}},[i.type==="emoticon"?e("img",{attrs:{src:i.src,title:i.name,alt:i.name}}):e("span",{attrs:{title:i.name},domProps:{innerHTML:t._s(i.html)}})])}),0)]),t.onlyEmoji?t._e():e("ul",{staticClass:"chat-emoji-menu"},[e("li",{class:{active:t.type==="emosearch"},on:{click:function(i){t.type="emosearch"}}},[e("i",{staticClass:"taskfont"},[t._v("\uE6F8")])]),e("li",{class:{active:t.type==="emoji"},on:{click:function(i){t.type="emoji"}}},[e("span",{staticClass:"no-dark-content"},[t._v("\u{1F600}")])]),t._l(t.emoticonData,function(i){return e("li",{class:{active:t.type==="emoticon"&&t.emoticonPath==i.path},on:{click:function(a){return t.onEmoticon(i.path)}}},[e("img",{attrs:{title:i.name,alt:i.name,src:i.src}})])})],2)])},ni=[];const ri={name:"ChatEmoji",props:{searchKey:{type:String,default:""},onlyEmoji:{type:Boolean,default:!1}},data(){return{type:"emoji",emojiNavActive:"p",emojiNavList:[{type:"p",name:"people",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256zM256 432C332.1 432 396.2 382 415.2 314.1C419.1 300.4 407.8 288 393.6 288H118.4C104.2 288 92.92 300.4 96.76 314.1C115.8 382 179.9 432 256 432V432zM176.4 160C158.7 160 144.4 174.3 144.4 192C144.4 209.7 158.7 224 176.4 224C194 224 208.4 209.7 208.4 192C208.4 174.3 194 160 176.4 160zM336.4 224C354 224 368.4 209.7 368.4 192C368.4 174.3 354 160 336.4 160C318.7 160 304.4 174.3 304.4 192C304.4 209.7 318.7 224 336.4 224z" /></svg>'},{type:"n",name:"nature",content:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M332.7 19.85C334.6 8.395 344.5 0 356.1 0C363.6 0 370.6 3.52 375.1 9.502L392 32H444.1C456.8 32 469.1 37.06 478.1 46.06L496 64H552C565.3 64 576 74.75 576 88V112C576 156.2 540.2 192 496 192H426.7L421.6 222.5L309.6 158.5L332.7 19.85zM448 64C439.2 64 432 71.16 432 80C432 88.84 439.2 96 448 96C456.8 96 464 88.84 464 80C464 71.16 456.8 64 448 64zM416 256.1V480C416 497.7 401.7 512 384 512H352C334.3 512 320 497.7 320 480V364.8C295.1 377.1 268.8 384 240 384C211.2 384 184 377.1 160 364.8V480C160 497.7 145.7 512 128 512H96C78.33 512 64 497.7 64 480V249.8C35.23 238.9 12.64 214.5 4.836 183.3L.9558 167.8C-3.331 150.6 7.094 133.2 24.24 128.1C41.38 124.7 58.76 135.1 63.05 152.2L66.93 167.8C70.49 182 83.29 191.1 97.97 191.1H303.8L416 256.1z" /></svg>
|
|
`},{type:"d",name:"food",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M481.9 270.1C490.9 279.1 496 291.3 496 304C496 316.7 490.9 328.9 481.9 337.9C472.9 346.9 460.7 352 448 352H64C51.27 352 39.06 346.9 30.06 337.9C21.06 328.9 16 316.7 16 304C16 291.3 21.06 279.1 30.06 270.1C39.06 261.1 51.27 256 64 256H448C460.7 256 472.9 261.1 481.9 270.1zM475.3 388.7C478.3 391.7 480 395.8 480 400V416C480 432.1 473.3 449.3 461.3 461.3C449.3 473.3 432.1 480 416 480H96C79.03 480 62.75 473.3 50.75 461.3C38.74 449.3 32 432.1 32 416V400C32 395.8 33.69 391.7 36.69 388.7C39.69 385.7 43.76 384 48 384H464C468.2 384 472.3 385.7 475.3 388.7zM50.39 220.8C45.93 218.6 42.03 215.5 38.97 211.6C35.91 207.7 33.79 203.2 32.75 198.4C31.71 193.5 31.8 188.5 32.99 183.7C54.98 97.02 146.5 32 256 32C365.5 32 457 97.02 479 183.7C480.2 188.5 480.3 193.5 479.2 198.4C478.2 203.2 476.1 207.7 473 211.6C469.1 215.5 466.1 218.6 461.6 220.8C457.2 222.9 452.3 224 447.3 224H64.67C59.73 224 54.84 222.9 50.39 220.8zM372.7 116.7C369.7 119.7 368 123.8 368 128C368 131.2 368.9 134.3 370.7 136.9C372.5 139.5 374.1 141.6 377.9 142.8C380.8 143.1 384 144.3 387.1 143.7C390.2 143.1 393.1 141.6 395.3 139.3C397.6 137.1 399.1 134.2 399.7 131.1C400.3 128 399.1 124.8 398.8 121.9C397.6 118.1 395.5 116.5 392.9 114.7C390.3 112.9 387.2 111.1 384 111.1C379.8 111.1 375.7 113.7 372.7 116.7V116.7zM244.7 84.69C241.7 87.69 240 91.76 240 96C240 99.16 240.9 102.3 242.7 104.9C244.5 107.5 246.1 109.6 249.9 110.8C252.8 111.1 256 112.3 259.1 111.7C262.2 111.1 265.1 109.6 267.3 107.3C269.6 105.1 271.1 102.2 271.7 99.12C272.3 96.02 271.1 92.8 270.8 89.88C269.6 86.95 267.5 84.45 264.9 82.7C262.3 80.94 259.2 79.1 256 79.1C251.8 79.1 247.7 81.69 244.7 84.69V84.69zM116.7 116.7C113.7 119.7 112 123.8 112 128C112 131.2 112.9 134.3 114.7 136.9C116.5 139.5 118.1 141.6 121.9 142.8C124.8 143.1 128 144.3 131.1 143.7C134.2 143.1 137.1 141.6 139.3 139.3C141.6 137.1 143.1 134.2 143.7 131.1C144.3 128 143.1 124.8 142.8 121.9C141.6 118.1 139.5 116.5 136.9 114.7C134.3 112.9 131.2 111.1 128 111.1C123.8 111.1 119.7 113.7 116.7 116.7L116.7 116.7z" /></svg>'},{type:"s",name:"symbols",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M500.3 7.251C507.7 13.33 512 22.41 512 31.1V175.1C512 202.5 483.3 223.1 447.1 223.1C412.7 223.1 383.1 202.5 383.1 175.1C383.1 149.5 412.7 127.1 447.1 127.1V71.03L351.1 90.23V207.1C351.1 234.5 323.3 255.1 287.1 255.1C252.7 255.1 223.1 234.5 223.1 207.1C223.1 181.5 252.7 159.1 287.1 159.1V63.1C287.1 48.74 298.8 35.61 313.7 32.62L473.7 .6198C483.1-1.261 492.9 1.173 500.3 7.251H500.3zM74.66 303.1L86.5 286.2C92.43 277.3 102.4 271.1 113.1 271.1H174.9C185.6 271.1 195.6 277.3 201.5 286.2L213.3 303.1H239.1C266.5 303.1 287.1 325.5 287.1 351.1V463.1C287.1 490.5 266.5 511.1 239.1 511.1H47.1C21.49 511.1-.0019 490.5-.0019 463.1V351.1C-.0019 325.5 21.49 303.1 47.1 303.1H74.66zM143.1 359.1C117.5 359.1 95.1 381.5 95.1 407.1C95.1 434.5 117.5 455.1 143.1 455.1C170.5 455.1 191.1 434.5 191.1 407.1C191.1 381.5 170.5 359.1 143.1 359.1zM440.3 367.1H496C502.7 367.1 508.6 372.1 510.1 378.4C513.3 384.6 511.6 391.7 506.5 396L378.5 508C372.9 512.1 364.6 513.3 358.6 508.9C352.6 504.6 350.3 496.6 353.3 489.7L391.7 399.1H336C329.3 399.1 323.4 395.9 321 389.6C318.7 383.4 320.4 376.3 325.5 371.1L453.5 259.1C459.1 255 467.4 254.7 473.4 259.1C479.4 263.4 481.6 271.4 478.7 278.3L440.3 367.1zM116.7 219.1L19.85 119.2C-8.112 90.26-6.614 42.31 24.85 15.34C51.82-8.137 93.26-3.642 118.2 21.83L128.2 32.32L137.7 21.83C162.7-3.642 203.6-8.137 231.6 15.34C262.6 42.31 264.1 90.26 236.1 119.2L139.7 219.1C133.2 225.6 122.7 225.6 116.7 219.1H116.7z" /></svg>'},{type:"a",name:"activity",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M16.17 337.5c0 44.98 7.565 83.54 13.98 107.9C35.22 464.3 50.46 496 174.9 496c9.566 0 19.59-.4707 29.84-1.271L17.33 307.3C16.53 317.6 16.17 327.7 16.17 337.5zM495.8 174.5c0-44.98-7.565-83.53-13.98-107.9c-4.688-17.54-18.34-31.23-36.04-35.95C435.5 27.91 392.9 16 337 16c-9.564 0-19.59 .4707-29.84 1.271l187.5 187.5C495.5 194.4 495.8 184.3 495.8 174.5zM26.77 248.8l236.3 236.3c142-36.1 203.9-150.4 222.2-221.1L248.9 26.87C106.9 62.96 45.07 177.2 26.77 248.8zM256 335.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L164.7 283.3C161.6 280.2 160 276.1 160 271.1c0-8.529 6.865-16 16-16c4.095 0 8.189 1.562 11.31 4.688l64.01 64C254.4 327.8 256 331.9 256 335.1zM304 287.1c0 9.141-7.474 16-16 16c-4.094 0-8.188-1.564-11.31-4.689L212.7 235.3C209.6 232.2 208 228.1 208 223.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01C302.5 279.8 304 283.9 304 287.1zM256 175.1c0-9.141 7.473-16 16-16c4.094 0 8.188 1.562 11.31 4.688l64.01 64.01c3.125 3.125 4.688 7.219 4.688 11.31c0 9.133-7.468 16-16 16c-4.094 0-8.189-1.562-11.31-4.688l-64.01-64.01C257.6 184.2 256 180.1 256 175.1z" /></svg>'},{type:"t",name:"travel",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M39.61 196.8L74.8 96.29C88.27 57.78 124.6 32 165.4 32H346.6C387.4 32 423.7 57.78 437.2 96.29L472.4 196.8C495.6 206.4 512 229.3 512 256V448C512 465.7 497.7 480 480 480H448C430.3 480 416 465.7 416 448V400H96V448C96 465.7 81.67 480 64 480H32C14.33 480 0 465.7 0 448V256C0 229.3 16.36 206.4 39.61 196.8V196.8zM109.1 192H402.9L376.8 117.4C372.3 104.6 360.2 96 346.6 96H165.4C151.8 96 139.7 104.6 135.2 117.4L109.1 192zM96 256C78.33 256 64 270.3 64 288C64 305.7 78.33 320 96 320C113.7 320 128 305.7 128 288C128 270.3 113.7 256 96 256zM416 320C433.7 320 448 305.7 448 288C448 270.3 433.7 256 416 256C398.3 256 384 270.3 384 288C384 305.7 398.3 320 416 320z" /></svg>'},{type:"o",name:"objects",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M112.1 454.3c0 6.297 1.816 12.44 5.284 17.69l17.14 25.69c5.25 7.875 17.17 14.28 26.64 14.28h61.67c9.438 0 21.36-6.401 26.61-14.28l17.08-25.68c2.938-4.438 5.348-12.37 5.348-17.7L272 415.1h-160L112.1 454.3zM191.4 .0132C89.44 .3257 16 82.97 16 175.1c0 44.38 16.44 84.84 43.56 115.8c16.53 18.84 42.34 58.23 52.22 91.45c.0313 .25 .0938 .5166 .125 .7823h160.2c.0313-.2656 .0938-.5166 .125-.7823c9.875-33.22 35.69-72.61 52.22-91.45C351.6 260.8 368 220.4 368 175.1C368 78.61 288.9-.2837 191.4 .0132zM192 96.01c-44.13 0-80 35.89-80 79.1C112 184.8 104.8 192 96 192S80 184.8 80 176c0-61.76 50.25-111.1 112-111.1c8.844 0 16 7.159 16 16S200.8 96.01 192 96.01z" /></svg>'},{type:"f",name:"flags",content:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M64 496C64 504.8 56.75 512 48 512h-32C7.25 512 0 504.8 0 496V32c0-17.75 14.25-32 32-32s32 14.25 32 32V496zM476.3 0c-6.365 0-13.01 1.35-19.34 4.233c-45.69 20.86-79.56 27.94-107.8 27.94c-59.96 0-94.81-31.86-163.9-31.87C160.9 .3055 131.6 4.867 96 15.75v350.5c32-9.984 59.87-14.1 84.85-14.1c73.63 0 124.9 31.78 198.6 31.78c31.91 0 68.02-5.971 111.1-23.09C504.1 355.9 512 344.4 512 332.1V30.73C512 11.1 495.3 0 476.3 0z" /></svg>'}],emoticonPath:"",emosearchKey:"",emosearchCache:null,emosearchLoad:!1,emosearchTimer:null,emosearchList:[],emojiData:[],emoticonData:[]}},mounted(){this.initData()},watch:{type(){this.onEmosearch()},emosearchKey(){this.onEmosearch()},searchKey:{handler(t){this.emosearchKey=t},immediate:!0}},computed:{list(){if(this.type==="emoji")return this.emojiData.filter(t=>t.category===this.emojiNavActive);if(this.type==="emosearch")return this.emosearchList;if(this.type==="emoticon"){const t=this.emoticonData.find(({path:o})=>o===this.emoticonPath);if(t)return t.list}return[]}},methods:{initData(){$A.loadScriptS(["js/emoji.all.js","js/emoticon.all.js"]).then(t=>{const o=$A.apiUrl("../images/emoticon");$A.isArray(window.emojiData)&&(this.emojiData=window.emojiData.sort(function(e,i){return e.emoji_order-i.emoji_order}).map(e=>({type:"emoji",name:e.name,category:e.category,html:e.code_decimal}))),$A.isArray(window.emoticonData)&&(this.emoticonData=window.emoticonData.map(e=>Object.assign(e,{src:`${o}/${e.path}/${e.icon}`,list:e.list.map(i=>Object.assign(i,{type:"emoticon",asset:`images/emoticon/${e.path}/${i.path}`,src:`${o}/${e.path}/${i.path}`}))})))})},onEmosearch(){this.type!=="emosearch"||this.emosearchCache===this.emosearchKey||(this.emosearchCache=this.emosearchKey,this.emosearchLoad=!0,this.emosearchTimer&&clearTimeout(this.emosearchTimer),this.emosearchTimer=setTimeout(t=>{ei("https://pic.sogou.com/napi/wap/pic",{query:this.emosearchKey+" \u8868\u60C5"}).then(o=>{if(this.emosearchList=[],o.status===0){const e=o.data.items;e.length>0&&(this.emosearchList=e.map(i=>({type:"emoticon",asset:"emosearch",name:i.title,src:i.thumbUrl,height:i.thumbHeight,width:i.thumbWidth})))}this.emosearchList.length===0&&$A.noticeWarning("\u6CA1\u6709\u641C\u7D22\u5230\u4EFB\u4F55\u8868\u60C5")}).catch(o=>{this.emosearchList=[],$A.noticeWarning("\u641C\u7D22\u7ED3\u679C\u4E3A\u7A7A")}).finally(o=>{this.emosearchLoad=!1})},300))},onEmoticon(t){this.type="emoticon",this.emoticonPath=t},onSelect(t,o){o.type==="emoji"?this.$emit("on-select",{type:"emoji",text:t.target.innerText}):this.$emit("on-select",o)}}},jt={};var oi=pt(ri,ii,ni,!1,ai,null,null,null);function ai(t){for(let o in jt)this[o]=jt[o]}var Qt=function(){return oi.exports}();const Rt="ontouchend"in document;var si={bind(t,o){let e=!1;t.__touchMouseDown__=i=>{i.preventDefault(),e=!0,o.value("down",i)},t.__touchMouseMove__=i=>{e&&o.value("move",i)},t.__touchMouseUp__=i=>{e&&(e=!1,o.value("up"))},Rt?(t.addEventListener("touchstart",t.__touchMouseDown__),t.addEventListener("touchmove",t.__touchMouseMove__),t.addEventListener("touchend",t.__touchMouseUp__)):(t.addEventListener("mousedown",t.__touchMouseDown__),document.addEventListener("mousemove",t.__touchMouseMove__),document.addEventListener("mouseup",t.__touchMouseUp__))},update(){},unbind(t){Rt?(t.removeEventListener("touchstart",t.__touchMouseDown__),t.removeEventListener("touchmove",t.__touchMouseMove__),t.removeEventListener("touchend",t.__touchMouseUp__)):(t.removeEventListener("mousedown",t.__touchMouseDown__),document.removeEventListener("mousemove",t.__touchMouseMove__),document.removeEventListener("mouseup",t.__touchMouseUp__)),delete t.__touchMouseDown__,delete t.__touchMouseMove__,delete t.__touchMouseUp__}};function gt(t){return t===void 0&&(t=document.body),t===!0?document.body:t instanceof window.Node?t:document.querySelector(t)}const li={inserted(t,{value:o},e){if(t.dataset&&t.dataset.transfer!=="true")return!1;t.className=t.className?t.className+" v-transfer-dom":"v-transfer-dom";const i=t.parentNode;if(!i)return;const a=document.createComment("");let O=!1;o!==!1&&(i.replaceChild(a,t),gt(o).appendChild(t),O=!0),t.__transferDomData||(t.__transferDomData={parentNode:i,home:a,target:gt(o),hasMovedOut:O})},componentUpdated(t,{value:o}){if(t.dataset&&t.dataset.transfer!=="true")return!1;const e=t.__transferDomData;if(!e)return;const i=e.parentNode,a=e.home,O=e.hasMovedOut;!O&&o?(i.replaceChild(a,t),gt(o).appendChild(t),t.__transferDomData=Object.assign({},t.__transferDomData,{hasMovedOut:!0,target:gt(o)})):O&&o===!1?(i.replaceChild(t,a),t.__transferDomData=Object.assign({},t.__transferDomData,{hasMovedOut:!1,target:gt(o)})):o&>(o).appendChild(t)},unbind(t){if(t.dataset&&t.dataset.transfer!=="true")return!1;t.className=t.className.replace("v-transfer-dom",""),t.__transferDomData&&(t.__transferDomData.hasMovedOut===!0&&t.__transferDomData.parentNode&&t.__transferDomData.parentNode.appendChild(t),t.__transferDomData=null)}};var ui=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.hidePopover,expression:"hidePopover"}],staticClass:"chat-input-box",class:t.boxClass},[e("div",{staticClass:"chat-input-quick-emoji"},[e("EPopover",{ref:"emojiQuickRef",attrs:{visibleArrow:!1,transition:"",placement:"top-end",popperClass:"chat-quick-emoji-popover"},model:{value:t.emojiQuickShow,callback:function(i){t.emojiQuickShow=i},expression:"emojiQuickShow"}},[e("div",{attrs:{slot:"reference"},slot:"reference"}),e("ul",{staticClass:"chat-quick-emoji-wrapper"},t._l(t.emojiQuickItems,function(i){return e("li",{on:{click:function(a){return t.onEmojiQuick(i)}}},[e("img",{attrs:{title:i.name,alt:i.name,src:i.src}})])}),0)])],1),e("div",{staticClass:"chat-input-wrapper",on:{click:function(i){return i.stopPropagation(),t.focus.apply(null,arguments)}}},[t.quoteData?e("div",{staticClass:"chat-quote"},[t.quoteUpdate?e("div",{staticClass:"quote-label"},[t._v(t._s(t.$L("\u7F16\u8F91\u6D88\u606F")))]):e("UserAvatar",{attrs:{userid:t.quoteData.userid,"show-icon":!1,"show-name":!0,"tooltip-disabled":!0}}),e("div",{staticClass:"quote-desc"},[t._v(t._s(t.$A.getMsgSimpleDesc(t.quoteData)))]),e("i",{staticClass:"taskfont",on:{click:function(i){return i.stopPropagation(),t.cancelQuote.apply(null,arguments)}}},[t._v("\uE6E5")])],1):t._e(),e("div",{ref:"editor",staticClass:"no-dark-content",style:t.editorStyle,on:{click:function(i){return i.stopPropagation(),t.onClickEditor.apply(null,arguments)},paste:t.handlePaste}}),e("ul",{staticClass:"chat-toolbar",on:{click:function(i){i.stopPropagation()}}},[e("li",[t.emojiBottom?e("ETooltip",{ref:"emojiTip",attrs:{disabled:t.windowSmall||t.$isEEUiApp||t.showEmoji,placement:"top",content:t.$L("\u8868\u60C5")}},[e("i",{staticClass:"taskfont",on:{click:function(i){t.showEmoji=!t.showEmoji}}},[t._v("\uE7AD")])]):e("EPopover",{attrs:{visibleArrow:!1,placement:"top",popperClass:"chat-input-emoji-popover"},model:{value:t.showEmoji,callback:function(i){t.showEmoji=i},expression:"showEmoji"}},[e("ETooltip",{ref:"emojiTip",attrs:{slot:"reference",disabled:t.windowSmall||t.$isEEUiApp||t.showEmoji,placement:"top",content:t.$L("\u8868\u60C5")},slot:"reference"},[e("i",{staticClass:"taskfont"},[t._v("\uE7AD")])]),t.showEmoji?e("ChatEmoji",{attrs:{searchKey:t.emojiQuickKey},on:{"on-select":t.onSelectEmoji}}):t._e()],1)],1),e("li",[e("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall||t.$isEEUiApp,content:t.$L("\u9009\u62E9\u6210\u5458")}},[e("i",{staticClass:"taskfont",on:{click:function(i){return t.onToolbar("user")}}},[t._v("\uE78F")])])],1),e("li",[e("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall||t.$isEEUiApp,content:t.$L("\u9009\u62E9\u4EFB\u52A1")}},[e("i",{staticClass:"taskfont",on:{click:function(i){return t.onToolbar("task")}}},[t._v("\uE7D6")])])],1),e("li",[e("EPopover",{attrs:{visibleArrow:!1,placement:"top",popperClass:"chat-input-more-popover"},model:{value:t.showMore,callback:function(i){t.showMore=i},expression:"showMore"}},[e("ETooltip",{ref:"moreTip",attrs:{slot:"reference",disabled:t.windowSmall||t.$isEEUiApp||t.showMore,placement:"top",content:t.$L("\u5C55\u5F00")},slot:"reference"},[e("i",{staticClass:"taskfont"},[t._v("\uE790")])]),t.recordReady?e("div",{staticClass:"chat-input-popover-item",on:{click:function(i){return t.onToolbar("meeting")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7C1")]),t._v(" "+t._s(t.$L("\u65B0\u4F1A\u8BAE"))+" ")]):t._e(),t.canCall?e("div",{staticClass:"chat-input-popover-item",on:{click:function(i){return t.onToolbar("call")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7BA")]),t._v(" "+t._s(t.$L("\u62E8\u6253\u7535\u8BDD"))+" ")]):t._e(),e("div",{staticClass:"chat-input-popover-item",on:{click:function(i){return t.onToolbar("image")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7BC")]),t._v(" "+t._s(t.$L("\u53D1\u9001\u56FE\u7247"))+" ")]),e("div",{staticClass:"chat-input-popover-item",on:{click:function(i){return t.onToolbar("file")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7C0")]),t._v(" "+t._s(t.$L("\u4E0A\u4F20\u6587\u4EF6"))+" ")]),t.canAnon?e("div",{staticClass:"chat-input-popover-item",on:{click:function(i){return t.onToolbar("anon")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE690")]),t._v(" "+t._s(t.$L("\u533F\u540D\u6D88\u606F"))+" ")]):t._e()],1)],1),e("li",{directives:[{name:"touchmouse",rawName:"v-touchmouse",value:t.clickSend,expression:"clickSend"}],staticClass:"chat-send",class:t.sendClass},[e("ETooltip",{attrs:{placement:"top",disabled:t.windowSmall||t.$isEEUiApp,content:t.$L(t.sendClass==="recorder"?"\u957F\u6309\u5F55\u97F3":"\u53D1\u9001")}},[t.loading?e("div",[e("div",{staticClass:"chat-load"},[e("Loading")],1)]):e("div",[e("transition",{attrs:{name:"mobile-send"}},[t.sendClass==="recorder"?e("i",{staticClass:"taskfont"},[t._v("\uE609")]):t._e()]),e("transition",{attrs:{name:"mobile-send"}},[t.sendClass!=="recorder"?e("i",{staticClass:"taskfont"},[t._v("\uE606")]):t._e()])],1)])],1),e("li",{staticClass:"chat-record-recwave"},[e("div",{ref:"recwave"})])]),e("div",{staticClass:"chat-cover",on:{click:function(i){return i.stopPropagation(),t.onClickCover.apply(null,arguments)}}})]),t.emojiBottom&&t.showEmoji?e("ChatEmoji",{attrs:{searchKey:t.emojiQuickKey},on:{"on-select":t.onSelectEmoji}}):t._e(),e("transition",{attrs:{name:"fade"}},[["ready","ing"].includes(t.recordState)?e("div",{directives:[{name:"transfer-dom",rawName:"v-transfer-dom"}],staticClass:"chat-input-record-transfer",class:{cancel:t.touchLimitY},style:t.recordTransferStyle,attrs:{"data-transfer":!0},on:{click:t.stopRecord}},[t.recordDuration>0?e("div",{staticClass:"record-duration"},[t._v(t._s(t.recordFormatDuration))]):e("div",{staticClass:"record-loading"},[e("Loading")],1),e("div",{staticClass:"record-cancel",on:{click:function(i){return i.stopPropagation(),t.stopRecord(!0)}}},[t._v(t._s(t.$L(t.touchLimitY?"\u677E\u5F00\u53D6\u6D88":"\u5411\u4E0A\u6ED1\u52A8\u53D6\u6D88")))])]):t._e()])],1)},ci=[];const fi={name:"ChatInput",components:{ChatEmoji:Qt},directives:{touchmouse:si,TransferDom:li,clickoutside:Jt},props:{value:{type:[String,Number],default:""},dialogId:{type:Number,default:0},taskId:{type:Number,default:0},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},disabledRecord:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enterSend:{type:[String,Boolean],default:null},emojiBottom:{type:Boolean,default:!1},options:{type:Object,default:()=>({})},maxlength:{type:Number},defaultMenuOrientation:{type:String,default:"top"}},data(){return{quill:null,isFocus:!1,rangeIndex:0,_content:"",_options:{},mentionMode:"",userList:null,userCache:null,taskList:null,fileList:{},showMore:!1,showEmoji:!1,emojiQuickTimer:null,emojiQuickShow:!1,emojiQuickKey:"",emojiQuickItems:[],observer:null,wrapperWidth:0,wrapperHeight:0,editorHeight:0,recordReady:!1,recordRec:null,recordBlob:null,recordWave:null,recordInter:null,recordState:"stop",recordDuration:0,touchStart:{},touchLimitX:!1,touchLimitY:!1,pasteClean:!0,isSpecVersion:this.checkIOSVersion()}},mounted(){this.init(),this.observer=new ResizeObserver(t=>{t.some(({target:o,contentRect:e})=>{o===this.$el?(this.wrapperWidth=e.width,this.wrapperHeight=e.height):o===this.$refs.editor&&(this.editorHeight=e.height)})}),this.observer.observe(this.$el),this.observer.observe(this.$refs.editor),this.recordInter=setInterval(t=>{this.recordState==="ing"&&(this.__recordDuration&&this.__recordDuration===this.recordDuration?(this.__recordDuration=null,this.stopRecord(!0),$A.messageWarning("\u5F55\u97F3\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")):this.__recordDuration=this.recordDuration)},1e3),this.$isEEUiApp&&(window.__onPermissionRequest=(t,o)=>{t==="recordAudio"&&o===!1&&this.stopRecord(!0)})},beforeDestroy(){this.quill&&(this.quill=null),this.recordRec&&(this.recordRec=null),this.observer&&(this.observer.disconnect(),this.observer=null),this.recordInter&&clearInterval(this.recordInter)},computed:{...bt(["cacheProjects","cacheTasks","cacheUserBasic","dialogMsgs","cacheDialogs"]),isEnterSend(){return typeof this.enterSend=="boolean"?this.enterSend:this.$store.state.windowLarge},canCall(){return this.dialogData.type==="user"&&!this.dialogData.bot&&this.$isEEUiApp},canAnon(){return this.dialogData.type==="user"&&!this.dialogData.bot},editorStyle(){const{wrapperWidth:t,editorHeight:o}=this;return t>0&&o>0&&(t<280||o>40)?{width:"100%"}:{}},recordTransferStyle(){const{windowScrollY:t}=this;return t>0?{marginTop:t/2+"px"}:null},boxClass(){const t=[];return["ready","ing"].includes(this.recordState)&&(this.recordState==="ing"&&this.recordDuration>0?t.push("record-progress"):t.push("record-ready")),this.showMore&&t.push("show-more"),this.showEmoji&&t.push("show-emoji"),this.mentionMode&&t.push(this.mentionMode),t},sendClass(){return this.value?"sender":this.recordReady?"recorder":""},recordFormatDuration(){const{recordDuration:t}=this;let o=Math.floor(t/6e4),e=Math.floor(t/1e3)%60,i=("00"+t%1e3).substr(-2);return o<10&&(o=`0${o}`),e<10&&(e=`0${e}`),`${o}:${e}\u2033${i}`},dialogData(){return this.dialogId>0?this.cacheDialogs.find(({id:t})=>t==this.dialogId)||{}:{}},quoteUpdate(){return this.dialogData.extra_quote_type==="update"},quoteData(){const{extra_quote_id:t}=this.dialogData;return t?this.dialogMsgs.find(o=>o.id===t):null}},watch:{value(t){this.quill&&(t&&t!==this._content?(this._content=t,this.setContent(t)):t||this.quill.setText("")),this.$store.dispatch("saveDialogDraft",{id:this.dialogId,extra_draft_content:t})},disabled(t){var o;(o=this.quill)==null||o.enable(!t)},dialogId(){this.userList=null,this.userCache=null,this.taskList=null,this.fileList={},this.loadInputDraft()},taskId(){this.userList=null,this.userCache=null,this.taskList=null,this.fileList={},this.loadInputDraft()},"dialogData.extra_draft_content"(){this.isFocus||this.loadInputDraft()},showEmoji(t){if(this.emojiBottom&&(t?this.quill.enable(!1):this.disabled||this.quill.enable(!0)),t){let o=this.value.replace(/ /g," ");if(o=o.replace(/<[^>]+>/g,""),o&&o.indexOf(" ")===-1&&o.length>=1&&o.length<=4?this.emojiQuickKey=o:this.emojiQuickKey="",this.showMore=!1,this.emojiQuickShow=!1,this.quill){const e=this.quill.selection.savedRange;this.rangeIndex=e?e.index:0}}else this.rangeIndex>0&&this.quill.setSelection(this.rangeIndex);this.$emit("on-emoji-visible-change",t)},showMore(t){t&&(this.showEmoji=!1),this.$emit("on-more-visible-change",t)},isFocus(t){this.timerScroll&&clearInterval(this.timerScroll),t?(this.$emit("on-focus"),this.hidePopover(),this.isSpecVersion||this.windowSmall&&(this.timerScroll=setInterval(()=>{var o;(o=this.quill)!=null&&o.hasFocus()?this.windowScrollY>0&&$A.scrollIntoViewIfNeeded(this.$refs.editor):clearInterval(this.timerScroll)},200))):this.$emit("on-blur")},recordState(t){t==="ing"?this.recordWave=window.Recorder.FrequencyHistogramView({elem:this.$refs.recwave,lineCount:90,position:0,minHeight:1,stripeEnable:!1}):(this.recordWave=null,this.$refs.recwave.innerHTML=""),this.$emit("on-record-state",t)},wrapperHeight(t,o){this.$emit("on-height-change",{newVal:t,oldVal:o})}},methods:{init(){this._options=Object.assign({theme:"bubble",readOnly:!1,placeholder:this.placeholder,modules:{toolbar:[["bold","strike","italic","underline",{list:"ordered"},{list:"bullet"},"blockquote","code-block"]],keyboard:{bindings:{"short enter":{key:13,shortKey:!0,handler:t=>this.isEnterSend?!0:(this.onSend(),!1)},enter:{key:13,shiftKey:!1,handler:t=>this.isEnterSend?(this.onSend(),!1):!0},esc:{key:27,shiftKey:!1,handler:t=>this.emojiQuickShow?(this.emojiQuickShow=!1,!1):!0}}},mention:{allowedChars:/^\S*$/,mentionDenotationChars:["@","#","~"],defaultMenuOrientation:this.defaultMenuOrientation,isolateCharacter:!0,positioningStrategy:"fixed",renderItem:t=>{if(t.disabled===!0)return`<div class="mention-item-disabled">${t.value}</div>`;if(t.id===0)return`<div class="mention-item-at">@</div><div class="mention-item-name">${t.value}</div><div class="mention-item-tip">${t.tip}</div>`;if(t.avatar){const o=t.bot?'<div class="taskfont mention-item-bot"></div>':"";return`<div class="mention-item-img${t.online?" online":""}"><img src="${t.avatar}"/><em></em></div>${o}<div class="mention-item-name">${t.value}</div>`}return t.tip?`<div class="mention-item-name" title="${t.value}">${t.value}</div><div class="mention-item-tip">${t.tip}</div>`:`<div class="mention-item-name" title="${t.value}">${t.value}</div>`},renderLoading:()=>"Loading...",source:(t,o,e)=>{const i=e=="@"?"user-mention":e=="#"?"task-mention":"file-mention",a=document.getElementsByClassName("ql-mention-list-container");for(let S=0;S<a.length;S++)a[S].classList.remove("user-mention"),a[S].classList.remove("task-mention"),a[S].classList.remove("file-mention"),a[S].classList.add(i),$A.scrollPreventThrough(a[S]);let O=null;this.getMentionSource(e,t,S=>{const w=[];S.some(b=>{let _=b.list;t&&(_=_.filter(({value:m})=>$A.strExists(m,t))),_.length>0&&(b.label&&w.push(...b.label),w.push(..._))}),$A.jsonStringify(w.map(({id:b})=>b))!==O&&(O=$A.jsonStringify(w.map(({id:b})=>b)),o(w,t))})}}}},this.options),this.quill=new dt(this.$refs.editor,this._options),this.quill.enable(!this.disabled),this.value?this.setContent(this.value):this.loadInputDraft(),this.quill.on("selection-change",t=>{if(!t){if(this.quill.hasFocus()){this.quill.setSelection(0);return}if(document.activeElement&&document.activeElement.className==="ql-clipboard"){this.quill.setSelection(this.quill.getLength());return}}this.isFocus=!!t}),this.quill.on("text-change",t=>{this.maxlength>0&&this.quill.getLength()>this.maxlength&&this.quill.deleteText(this.maxlength,this.quill.getLength());let o=this.$refs.editor.children[0].innerHTML;o=o.replace(/^(<p>\s*<\/p>)+|(<p>\s*<\/p>)+$/gi,""),o=o.replace(/^(<p><br\/*><\/p>)+|(<p><br\/*><\/p>)+$/gi,""),this.updateEmojiQuick(o),this._content=o,this.$emit("input",this._content),this.$nextTick(e=>{const i=this.quill.getSelection();if(i){const a=this.quill.getText(i.index);/^\n\n$/.test(a)&&this.quill.deleteText(i.index,1)}})}),this.quill.clipboard.addMatcher(Node.ELEMENT_NODE,(t,o)=>(this.pasteClean&&(o.ops=o.ops.map(e=>{const i={insert:e.insert};try{typeof i.insert.mention=="object"&&t.innerHTML&&(i.insert=t.innerHTML.replace(/<[^>]+>/g,""))}catch{}return e.attributes&&["bold","strike","italic","underline","list","blockquote","link"].some(a=>{e.attributes[a]&&(typeof i.attributes=="undefined"&&(i.attributes={}),i.attributes[a]=e.attributes[a])}),i})),o)),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"]).then(t=>{typeof window.Recorder=="function"&&(this.recordRec=window.Recorder({type:"mp3",bitRate:64,sampleRate:32e3,onProcess:(o,e,i,a,O,S)=>{var w;(w=this.recordWave)==null||w.input(o[o.length-1],e,a),this.recordDuration=i,i>=3*60*1e3&&this.stopRecord(!1)}}),window.Recorder.Support()&&(this.recordReady=!0))})},updateEmojiQuick(t){if(!this.isFocus||!t){this.emojiQuickShow=!1;return}this.emojiQuickTimer&&clearTimeout(this.emojiQuickTimer),this.emojiQuickTimer=setTimeout(o=>{if(t=t.replace(/ /g," "),t=t.replace(/<[^>]+>/g,""),t&&t.indexOf(" ")===-1&&t.length>=1&&t.length<=4&&$A.isArray(window.emoticonData)){this.emojiQuickItems=[];let e=$A.apiUrl("../images/emoticon");if(window.emoticonData.some(i=>{let a=i.list.find(O=>$A.strExists(O.name+(O.key?` ${O.key}`:""),t));if(a&&(this.emojiQuickItems.push(Object.assign(a,{type:"emoticon",asset:`images/emoticon/${i.path}/${a.path}`,src:`${e}/${i.path}/${a.path}`})),this.emojiQuickItems.length>=3))return!0}),this.emojiQuickItems.length>0){this.$nextTick(i=>{this.emojiQuickShow=!0,this.$refs.emojiQuickRef.updatePopper()});return}}this.emojiQuickShow=!1},100)},setText(t){this.quill&&this.quill.setText(t)},setContent(t){this.quill&&this.quill.setContents(this.quill.clipboard.convert(t))},setPasteMode(t){this.pasteClean=t},loadInputDraft(){const{extra_draft_content:t}=this.dialogData;t?(this.pasteClean=!1,this.$emit("input",t),this.$nextTick(o=>this.pasteClean=!0)):this.$emit("input","")},onClickEditor(){this.$store.state.messengerSearchKey={dialog:"",contacts:""},this.updateEmojiQuick(this.value)},focus(){this.$nextTick(()=>{this.quill&&(this.quill.setSelection(this.quill.getLength()),this.quill.focus())})},blur(){this.$nextTick(()=>{this.quill&&this.quill.blur()})},clickSend(t,o){if(!this.loading)switch(t){case"down":if(this.touchLimitX=!1,this.touchLimitY=!1,this.touchStart=o.type==="touchstart"?o.touches[0]:o,this.startRecord())return;break;case"move":const e=o.type==="touchmove"?o.touches[0]:o;this.touchLimitX=(this.touchStart.clientX-e.clientX)/window.innerWidth>.1,this.touchLimitY=(this.touchStart.clientY-e.clientY)/window.innerHeight>.1;break;case"up":if(this.stopRecord(this.touchLimitY)||this.touchLimitY||this.touchLimitX)return;this.onSend();break}},onSend(){this.rangeIndex=0,this.$store.state.messengerSearchKey={dialog:"",contacts:""},this.$emit("on-send")},startRecord(){return this.sendClass==="recorder"?(this.$store.dispatch("audioStop",!0),this.recordDuration=0,this.recordState="ready",this.$nextTick(t=>{this.recordRec.open(o=>{this.recordState==="ready"?(this.recordState="ing",this.recordBlob=null,setTimeout(e=>{this.recordRec.start()},300)):this.recordRec.close()},o=>{this.recordState="stop",$A.messageError(o||"\u6253\u5F00\u5F55\u97F3\u5931\u8D25")})}),!0):!1},stopRecord(t){switch(this.recordState){case"ing":return this.recordState="stop",this.recordRec.stop((o,e)=>{this.recordRec.close(),t!==!0&&(e<600?$A.messageWarning("\u8BF4\u8BDD\u65F6\u95F4\u592A\u77ED"):(this.recordBlob=o,this.uploadRecord(e)))},o=>{this.recordRec.close(),$A.messageError(o||"\u5F55\u97F3\u5931\u8D25")}),!0;case"ready":return this.recordState="stop",!0;default:return this.recordState="stop",!1}},hidePopover(){this.showMore=!1,this.showEmoji=!1,this.emojiQuickShow=!1},onClickCover(){this.hidePopover(),this.$nextTick(t=>{var o;(o=this.quill)==null||o.focus()})},uploadRecord(t){if(this.recordBlob===null)return;const o=new FileReader;o.onloadend=()=>{this.$emit("on-record",{type:this.recordBlob.type,base64:o.result,duration:t})},o.readAsDataURL(this.recordBlob)},onEmojiQuick(t){t.type==="online"?(this.$emit("input",""),this.$emit("on-send",`<img src="${t.src}"/>`)):(this.$emit("input",""),this.$emit("on-send",`<img class="emoticon" data-asset="${t.asset}" data-name="${t.name}" src="${t.src}"/>`)),this.emojiQuickShow=!1,this.focus()},onSelectEmoji(t){!this.quill||(t.type==="emoji"?(this.quill.insertText(this.rangeIndex,t.text),this.rangeIndex+=t.text.length,this.windowLarge&&(this.showEmoji=!1)):t.type==="emoticon"&&(this.$emit("on-send",`<img class="emoticon" data-asset="${t.asset}" data-name="${t.name}" src="${t.src}"/>`),t.asset==="emosearch"&&this.$emit("input",""),this.windowLarge&&(this.showEmoji=!1)))},onToolbar(t){switch(this.hidePopover(),t){case"user":this.openMenu("@");break;case"task":this.openMenu("#");break;case"meeting":Tt.Store.set("addMeeting",{type:"create",dialog_id:this.dialogId,userids:[this.userId]});break;case"image":case"file":case"call":case"anon":this.$emit("on-more",t);break}},onMoreVisibleChange(t){this.showMore=t},setQuote(t,o="reply"){this.dialogId>0&&this.$store.dispatch("saveDialog",{id:this.dialogId,extra_quote_id:t,extra_quote_type:o==="update"?"update":"reply"})},cancelQuote(){this.quoteUpdate&&this.$emit("input",""),this.setQuote(0)},openMenu(t){if(!!this.quill)if(this.value.length===0||this.value.endsWith("<p><br></p>"))this.quill.getModule("mention").openMenu(t);else{let o=this.value.replace(/<[^>]+>/g,"");o.length===0||o.endsWith(" ")?this.quill.getModule("mention").openMenu(t):this.quill.getModule("mention").openMenu(` ${t}`)}},addMention(t){!this.quill||this.quill.getModule("mention").insertItem(t,!0)},getProjectId(){let t=null;if(this.dialogId>0){if(t=this.cacheProjects.find(({dialog_id:o})=>o==this.dialogId),t)return t.id;if(t=this.cacheTasks.find(({dialog_id:o})=>o==this.dialogId),t)return t.project_id}else if(this.taskId>0&&(t=this.cacheTasks.find(({id:o})=>o==this.taskId),t))return t.project_id;return 0},getMentionSource(t,o,e){switch(t){case"@":this.mentionMode="user-mention";const i=w=>{this.getMoreUser(o,w.map(b=>b.id)).then(b=>{this.userList=w,this.userCache=[],b.length>0?(w.length>2&&this.userCache.push({label:null,list:[{id:0,value:this.$L("\u6240\u6709\u4EBA"),tip:this.$L("\u4EC5\u63D0\u793A\u4F1A\u8BDD\u5185\u6210\u5458")}]}),this.userCache.push({label:[{id:0,value:this.$L("\u4F1A\u8BDD\u5185\u6210\u5458"),disabled:!0}],list:w},{label:[{id:0,value:this.$L("\u4F1A\u8BDD\u4EE5\u5916\u6210\u5458"),disabled:!0}],list:b})):w.length>2?this.userCache.push({label:null,list:[{id:0,value:this.$L("\u6240\u6709\u4EBA"),tip:this.$L("\u63D0\u793A\u6240\u6709\u6210\u5458")}]},{label:[{id:0,value:this.$L("\u4F1A\u8BDD\u5185\u6210\u5458"),disabled:!0}],list:w}):this.userCache.push({label:null,list:w}),e(this.userCache)})};if(this.dialogData.people&&$A.arrayLength(this.userList)!==this.dialogData.people&&(this.userList=null,this.userCache=null),this.userCache!==null&&e(this.userCache),this.userList!==null){i(this.userList);return}const a=[];if(this.dialogId>0)this.$store.dispatch("call",{url:"dialog/user",data:{dialog_id:this.dialogId,getuser:1}}).then(({data:w})=>{this.cacheDialogs.find(({id:b})=>b==this.dialogId)&&this.$store.dispatch("saveDialog",{id:this.dialogId,people:w.length}),w.length>0&&a.push(...w.map(b=>({id:b.userid,value:b.nickname,avatar:b.userimg,online:b.online,bot:b.bot}))),i(a)}).catch(w=>{i(a)});else if(this.taskId>0){const w=this.cacheTasks.find(({id:b})=>b==this.taskId);w&&$A.isArray(w.task_user)&&w.task_user.some(b=>{const _=this.cacheUserBasic.find(({userid:m})=>m==b.userid);_&&a.push({id:_.userid,value:_.nickname,avatar:_.userimg,online:_.online,bot:_.bot})}),i(a)}break;case"#":if(this.mentionMode="task-mention",this.taskList!==null){e(this.taskList);return}const O=w=>{this.taskList=[],w.length>0&&(w=w.map(m=>({id:m.id,value:m.name,tip:m.complete_at?this.$L("\u5DF2\u5B8C\u6210"):null})).splice(0,100),this.taskList.push({label:[{id:0,value:this.$L("\u9879\u76EE\u4EFB\u52A1"),disabled:!0}],list:w}));let b=this.$store.getters.transforTasks(this.$store.getters.dashboardTask.all);b.length>0&&(b=b.sort((m,c)=>$A.Date(m.end_at||"2099-12-31 23:59:59")-$A.Date(c.end_at||"2099-12-31 23:59:59")).splice(0,100),this.taskList.push({label:[{id:0,value:this.$L("\u6211\u7684\u5F85\u5B8C\u6210\u4EFB\u52A1"),disabled:!0}],list:b.map(m=>({id:m.id,value:m.name}))}));let _=this.$store.getters.assistTask;_.length>0&&(_=_.sort((m,c)=>$A.Date(m.end_at||"2099-12-31 23:59:59")-$A.Date(c.end_at||"2099-12-31 23:59:59")).splice(0,100),this.taskList.push({label:[{id:0,value:this.$L("\u6211\u534F\u52A9\u7684\u4EFB\u52A1"),disabled:!0}],list:_.map(m=>({id:m.id,value:m.name}))})),e(this.taskList)},S=this.getProjectId();if(S>0){this.$store.dispatch("getTaskForProject",S).then(w=>{const b=this.cacheTasks.filter(_=>_.archived_at?!1:_.project_id==S&&_.parent_id===0&&!_.archived_at).sort((_,m)=>$A.Date(m.complete_at||"2099-12-31 23:59:59")-$A.Date(_.complete_at||"2099-12-31 23:59:59"));b.length>0?O(b):O([])}).catch(w=>{O([])});return}O([]);break;case"~":if(this.mentionMode="file-mention",$A.isArray(this.fileList[o])){e(this.fileList[o]);return}this.fileTimer&&clearTimeout(this.fileTimer),this.fileTimer=setTimeout(w=>{this.$store.dispatch("searchFiles",o).then(({data:b})=>{this.fileList[o]=[{label:[{id:0,value:this.$L("\u6587\u4EF6\u5206\u4EAB\u67E5\u770B"),disabled:!0}],list:b.filter(_=>_.type!=="folder").map(_=>({id:_.id,value:_.ext?`${_.name}.${_.ext}`:_.name}))}],e(this.fileList[o])}).catch(()=>{e([])})},300);break;default:e([]);break}},getMoreUser(t,o){return new Promise(e=>{const{owner_id:i,type:a}=this.dialogData,O=a==="group"&&[0,this.userId].includes(i);this.taskId>0||O?(this.__getMoreTimer&&clearTimeout(this.__getMoreTimer),this.__getMoreTimer=setTimeout(S=>{this.$store.dispatch("call",{url:"users/search",data:{keys:{key:t},state:1,take:30}}).then(({data:w})=>{const b=w.filter(_=>!o.includes(_.userid));e(b.map(_=>({id:_.userid,value:_.nickname,avatar:_.userimg,online:!!_.online})))}).catch(w=>{e([])})},this.userCache===null?0:600)):e([])})},checkIOSVersion(){let o=(window&&window.navigator&&window.navigator.userAgent).match(/OS ((\d+_?){2,3})\s/i);const i=(o?o[1].replace(/_/g,"."):"unknown").split(".");return+i[0]==11&&+i[1]>=0&&+i[1]<3},handlePaste(t){const o=Array.prototype.slice.call(t.clipboardData.files);o.filter(i=>!$A.leftExists(i.type,"image/")).length>0?(t.preventDefault(),this.$emit("on-file",o)):this.pasteRtf(t)&&t.preventDefault()},pasteRtf(t){if(t&&t.clipboardData&&t.clipboardData.items&&!new DOMParser().parseFromString(t.clipboardData.getData("text/html")||"","text/html").querySelector("img")){const e=[];let i=null;if(t.clipboardData.types&&[].indexOf.call(t.clipboardData.types,"text/rtf")!=-1||t.clipboardData.getData("text/rtf"))i=t.clipboardData.items[0].getAsFile(),i&&e.push(i);else for(let a=0;a<t.clipboardData.items.length;a++)i=t.clipboardData.items[a].getAsFile(),i&&e.push(i);if(e.length>0)return e.forEach(a=>{const O=new FileReader;O.onload=({target:S})=>{const w=this.quill.getSelection(!0).index;this.quill.insertEmbed(w,"image",S.result),this.quill.setSelection(w+1)},O.readAsDataURL(a)}),!0}return!1}}},qt={};var hi=pt(fi,ui,ci,!1,di,null,null,null);function di(t){for(let o in qt)this[o]=qt[o]}var pi=function(){return hi.exports}(),Yt={exports:{}};/*!
|
|
* vue-virtual-scroll-list v2.3.4-3
|
|
* open source under the MIT license
|
|
* https://github.com/tangbc/vue-virtual-scroll-list#readme
|
|
*/(function(t,o){(function(e,i){t.exports=i(te)})(Ut,function(e){e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;function i(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function a(v,y){for(var k=0;k<y.length;k++){var C=y[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(v,C.key,C)}}function O(v,y,k){return y&&a(v.prototype,y),k&&a(v,k),v}function S(v,y,k){return y in v?Object.defineProperty(v,y,{value:k,enumerable:!0,configurable:!0,writable:!0}):v[y]=k,v}function w(v,y){var k=Object.keys(v);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(v);y&&(C=C.filter(function(j){return Object.getOwnPropertyDescriptor(v,j).enumerable})),k.push.apply(k,C)}return k}function b(v){for(var y=1;y<arguments.length;y++){var k=arguments[y]!=null?arguments[y]:{};y%2?w(Object(k),!0).forEach(function(C){S(v,C,k[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(k)):w(Object(k)).forEach(function(C){Object.defineProperty(v,C,Object.getOwnPropertyDescriptor(k,C))})}return v}function _(v){return m(v)||c(v)||n(v)||d()}function m(v){if(Array.isArray(v))return r(v)}function c(v){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(v))return Array.from(v)}function n(v,y){if(!!v){if(typeof v=="string")return r(v,y);var k=Object.prototype.toString.call(v).slice(8,-1);if(k==="Object"&&v.constructor&&(k=v.constructor.name),k==="Map"||k==="Set")return Array.from(k);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return r(v,y)}}function r(v,y){(y==null||y>v.length)&&(y=v.length);for(var k=0,C=new Array(y);k<y;k++)C[k]=v[k];return C}function d(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f={FRONT:"FRONT",BEHIND:"BEHIND"},h={INIT:"INIT",FIXED:"FIXED",DYNAMIC:"DYNAMIC"},l=0,u=function(){function v(y,k){i(this,v),this.init(y,k)}return O(v,[{key:"init",value:function(k,C){this.param=k,this.callUpdate=C,this.sizes=new Map,this.firstRangeTotalSize=0,this.firstRangeAverageSize=0,this.lastCalcIndex=0,this.fixedSizeValue=0,this.calcType=h.INIT,this.offset=0,this.direction="",this.range=Object.create(null),k&&this.checkRange(0,k.keeps-1)}},{key:"destroy",value:function(){this.init(null,null)}},{key:"getRange",value:function(){var k=Object.create(null);return k.start=this.range.start,k.end=this.range.end,k.padFront=this.range.padFront,k.padBehind=this.range.padBehind,k}},{key:"isBehind",value:function(){return this.direction===f.BEHIND}},{key:"isFront",value:function(){return this.direction===f.FRONT}},{key:"getOffset",value:function(k){return(k<1?0:this.getIndexOffset(k))+this.param.slotHeaderSize}},{key:"updateParam",value:function(k,C){var j=this;this.param&&k in this.param&&(k==="uniqueIds"&&this.sizes.forEach(function(B,W){C.includes(W)||j.sizes.delete(W)}),this.param[k]=C)}},{key:"saveSize",value:function(k,C){this.sizes.set(k,C),this.calcType===h.INIT?(this.fixedSizeValue=C,this.calcType=h.FIXED):this.calcType===h.FIXED&&this.fixedSizeValue!==C&&(this.calcType=h.DYNAMIC,delete this.fixedSizeValue),this.calcType!==h.FIXED&&typeof this.firstRangeTotalSize!="undefined"&&(this.sizes.size<Math.min(this.param.keeps,this.param.uniqueIds.length)?(this.firstRangeTotalSize=_(this.sizes.values()).reduce(function(j,B){return j+B},0),this.firstRangeAverageSize=Math.round(this.firstRangeTotalSize/this.sizes.size)):delete this.firstRangeTotalSize)}},{key:"handleDataSourcesChange",value:function(){var k=this.range.start;this.isFront()?k=k-l:this.isBehind()&&(k=k+l),k=Math.max(k,0),this.updateRange(this.range.start,this.getEndByStart(k))}},{key:"handleSlotSizeChange",value:function(){this.handleDataSourcesChange()}},{key:"handleScroll",value:function(k){this.direction=k<this.offset||k===0?f.FRONT:f.BEHIND,this.offset=k,this.param&&(this.direction===f.FRONT?this.handleFront():this.direction===f.BEHIND&&this.handleBehind())}},{key:"handleFront",value:function(){var k=this.getScrollOvers();if(!(k>this.range.start)){var C=Math.max(k-this.param.buffer,0);this.checkRange(C,this.getEndByStart(C))}}},{key:"handleBehind",value:function(){var k=this.getScrollOvers();k<this.range.start+this.param.buffer||this.checkRange(k,this.getEndByStart(k))}},{key:"getScrollOvers",value:function(){var k=this.offset-this.param.slotHeaderSize;if(k<=0)return 0;if(this.isFixedType())return Math.floor(k/this.fixedSizeValue);for(var C=0,j=0,B=0,W=this.param.uniqueIds.length;C<=W;){if(j=C+Math.floor((W-C)/2),B=this.getIndexOffset(j),B===k)return j;B<k?C=j+1:B>k&&(W=j-1)}return C>0?--C:0}},{key:"getIndexOffset",value:function(k){if(!k)return 0;for(var C=0,j=0,B=0;B<k;B++)j=this.sizes.get(this.param.uniqueIds[B]),C=C+(typeof j=="number"?j:this.getEstimateSize());return this.lastCalcIndex=Math.max(this.lastCalcIndex,k-1),this.lastCalcIndex=Math.min(this.lastCalcIndex,this.getLastIndex()),C}},{key:"isFixedType",value:function(){return this.calcType===h.FIXED}},{key:"getLastIndex",value:function(){return this.param.uniqueIds.length-1}},{key:"checkRange",value:function(k,C){var j=this.param.keeps,B=this.param.uniqueIds.length;B<=j?(k=0,C=this.getLastIndex()):C-k<j-1&&(k=C-j+1),this.range.start!==k&&this.updateRange(k,C)}},{key:"updateRange",value:function(k,C){this.range.start=k,this.range.end=C,this.range.padFront=this.getPadFront(),this.range.padBehind=this.getPadBehind(),this.callUpdate(this.getRange())}},{key:"getEndByStart",value:function(k){var C=k+this.param.keeps-1,j=Math.min(C,this.getLastIndex());return j}},{key:"getPadFront",value:function(){return this.isFixedType()?this.fixedSizeValue*this.range.start:this.getIndexOffset(this.range.start)}},{key:"getPadBehind",value:function(){var k=this.range.end,C=this.getLastIndex();return this.isFixedType()?(C-k)*this.fixedSizeValue:this.lastCalcIndex===C?this.getIndexOffset(C)-this.getIndexOffset(k):(C-k)*this.getEstimateSize()}},{key:"getEstimateSize",value:function(){return this.isFixedType()?this.fixedSizeValue:this.param.estimateSize||this.param.estimateSize}}]),v}(),p={dataKey:{type:[String,Function],required:!0},dataSources:{type:Array,required:!0},dataComponent:{type:[Object,Function],required:!0},keeps:{type:Number,default:30},extraProps:{type:Object},estimateSize:{type:Number,default:50},direction:{type:String,default:"vertical"},start:{type:Number,default:0},offset:{type:Number,default:0},topThreshold:{type:Number,default:0},bottomThreshold:{type:Number,default:0},pageMode:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object},itemTag:{type:String,default:"div"},itemClass:{type:String,default:""},itemClassAdd:{type:Function},itemStyle:{type:Object},headerTag:{type:String,default:"div"},headerClass:{type:String,default:""},headerStyle:{type:Object},footerTag:{type:String,default:"div"},footerClass:{type:String,default:""},footerStyle:{type:Object},itemScopedSlots:{type:Object},disabled:{type:Boolean,default:!1}},s={index:{type:Number},event:{type:String},tag:{type:String},horizontal:{type:Boolean},source:{type:Object},component:{type:[Object,Function]},slotComponent:{type:Function},uniqueKey:{type:[String,Number]},extraProps:{type:Object},scopedSlots:{type:Object}},g={event:{type:String},uniqueKey:{type:String},tag:{type:String},horizontal:{type:Boolean}},D={created:function(){this.shapeKey=this.horizontal?"offsetWidth":"offsetHeight"},mounted:function(){var y=this;typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(function(){y.dispatchSizeChange()}),this.resizeObserver.observe(this.$el))},updated:function(){this.dispatchSizeChange()},beforeDestroy:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},methods:{getCurrentSize:function(){return this.$el?this.$el[this.shapeKey]:0},dispatchSizeChange:function(){this.$parent.$emit(this.event,this.uniqueKey,this.getCurrentSize(),this.hasInitial)}}},x=e.component("virtual-list-item",{mixins:[D],props:s,render:function(y){var k=this.tag,C=this.component,j=this.extraProps,B=j===void 0?{}:j,W=this.index,q=this.source,M=this.scopedSlots,L=M===void 0?{}:M,N=this.uniqueKey,P=this.slotComponent,U=b({},B,{source:q,index:W});return y(k,{key:N,attrs:{role:"listitem"}},[P?P({item:q,index:W,scope:U}):y(C,{props:U,scopedSlots:L})])}}),A=e.component("virtual-list-slot",{mixins:[D],props:g,render:function(y){var k=this.tag,C=this.uniqueKey;return y(k,{key:C,attrs:{role:C}},this.$slots.default)}}),I={ITEM:"item_resize",SLOT:"slot_resize"},T={HEADER:"thead",FOOTER:"tfoot"},E=e.component("virtual-list",{props:p,data:function(){return{range:null,toBottomTime:null}},watch:{"dataSources.length":function(){this.virtual.updateParam("uniqueIds",this.getUniqueIdFromDataSources()),this.virtual.handleDataSourcesChange()},keeps:function(y){this.virtual.updateParam("keeps",y),this.virtual.handleSlotSizeChange()},start:function(y){this.scrollToIndex(y)},offset:function(y){this.scrollToOffset(y)}},created:function(){this.isHorizontal=this.direction==="horizontal",this.directionKey=this.isHorizontal?"scrollLeft":"scrollTop",this.installVirtual(),this.$on(I.ITEM,this.onItemResized),(this.$slots.header||this.$slots.footer)&&this.$on(I.SLOT,this.onSlotResized)},activated:function(){this.scrollToOffset(this.virtual.offset),this.pageMode&&document.addEventListener("scroll",this.onScroll,{passive:!1})},deactivated:function(){this.pageMode&&document.removeEventListener("scroll",this.onScroll)},mounted:function(){this.start?this.scrollToIndex(this.start):this.offset&&this.scrollToOffset(this.offset),this.pageMode&&(this.updatePageModeFront(),document.addEventListener("scroll",this.onScroll,{passive:!1}))},beforeDestroy:function(){this.virtual.destroy(),this.pageMode&&document.removeEventListener("scroll",this.onScroll)},methods:{getSize:function(y){return this.virtual.sizes.get(y)},getSizes:function(){return this.virtual.sizes.size},getOffset:function(){if(this.pageMode)return document.documentElement[this.directionKey]||document.body[this.directionKey];var y=this.$refs.root;return y?Math.ceil(y[this.directionKey]):0},getClientSize:function(){var y=this.isHorizontal?"clientWidth":"clientHeight";if(this.pageMode)return document.documentElement[y]||document.body[y];var k=this.$refs.root;return k?Math.ceil(k[y]):0},getScrollSize:function(){var y=this.isHorizontal?"scrollWidth":"scrollHeight";if(this.pageMode)return document.documentElement[y]||document.body[y];var k=this.$refs.root;return k?Math.ceil(k[y]):0},scrollToOffset:function(y){if(this.pageMode)document.body[this.directionKey]=y,document.documentElement[this.directionKey]=y;else{var k=this.$refs.root;k&&(k[this.directionKey]=y)}},scrollToIndex:function(y){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(y>=this.dataSources.length-1)this.scrollToBottom();else{var C=this.virtual.getOffset(y);k!==0&&(C=Math.max(0,C+k)),this.scrollToOffset(C)}},scrollToBottom:function(){var y=this,k=this.$refs.shepherd;if(k){var C=k[this.isHorizontal?"offsetLeft":"offsetTop"];this.scrollToOffset(C),this.toBottomTime&&(clearTimeout(this.toBottomTime),this.toBottomTime=null),this.toBottomTime=setTimeout(function(){y.getOffset()+y.getClientSize()+1<y.getScrollSize()&&y.scrollToBottom()},3)}},stopToBottom:function(){this.toBottomTime&&(clearTimeout(this.toBottomTime),this.toBottomTime=null)},scrollStop:function(){this.stopToBottom(),this.scrollToOffset(this.getOffset())},scrollInfo:function(){var y=this.getClientSize(),k=this.getOffset(),C=this.getScrollSize();return{offset:k,scale:k/(C-y),tail:C-y-k}},updatePageModeFront:function(){var y=this.$refs.root;if(y){var k=y.getBoundingClientRect(),C=y.ownerDocument.defaultView,j=this.isHorizontal?k.left+C.pageXOffset:k.top+C.pageYOffset;this.virtual.updateParam("slotHeaderSize",j)}},reset:function(){this.virtual.destroy(),this.scrollToOffset(0),this.installVirtual()},installVirtual:function(){this.virtual=new u({slotHeaderSize:0,slotFooterSize:0,keeps:this.keeps,estimateSize:this.estimateSize,buffer:Math.round(this.keeps/3),uniqueIds:this.getUniqueIdFromDataSources()},this.onRangeChanged),this.range=this.virtual.getRange(),this.$emit("range",this.range)},getUniqueIdFromDataSources:function(){var y=this.dataKey;return this.dataSources.map(function(k){return typeof y=="function"?y(k):k[y]})},onItemResized:function(y,k){this.virtual.saveSize(y,k),this.$emit("resized",y,k)},onSlotResized:function(y,k,C){y===T.HEADER?this.virtual.updateParam("slotHeaderSize",k):y===T.FOOTER&&this.virtual.updateParam("slotFooterSize",k),C&&this.virtual.handleSlotSizeChange()},onRangeChanged:function(y){this.range=y,this.$emit("range",this.range)},onScroll:function(y){if(!this.disabled){var k=this.getOffset(),C=this.getClientSize(),j=this.getScrollSize();k<0||k+C>j+1||!j||(this.virtual.handleScroll(k),this.emitEvent(k,C,j,y))}},emitEvent:function(y,k,C,j){this.$emit("scroll",j,this.virtual.getRange()),this.virtual.isFront()&&!!this.dataSources.length&&y-this.topThreshold<=0?this.$emit("totop"):this.virtual.isBehind()&&y+k+this.bottomThreshold>=C&&this.$emit("tobottom")},getRenderSlots:function(y){for(var k=[],C=this.range,j=C.start,B=C.end,W=this.dataSources,q=this.dataKey,M=this.itemClass,L=this.itemTag,N=this.itemStyle,P=this.isHorizontal,U=this.extraProps,F=this.dataComponent,$=this.itemScopedSlots,R=this.$scopedSlots&&this.$scopedSlots.item,z=j;z<=B;z++){var H=W[z];if(H){var G=typeof q=="function"?q(H):H[q];typeof G=="string"||typeof G=="number"?k.push(y(x,{props:{index:z,tag:L,event:I.ITEM,horizontal:P,uniqueKey:G,source:H,extraProps:U,component:F,slotComponent:R,scopedSlots:$},style:N,class:"".concat(M).concat(this.itemClassAdd?" "+this.itemClassAdd(z):"")})):console.warn("Cannot get the data-key '".concat(q,"' from data-sources."))}else console.warn("Cannot get the index '".concat(z,"' from data-sources."))}return k}},render:function(y){var k=this.$slots,C=k.header,j=k.footer,B=this.range,W=B.padFront,q=B.padBehind,M=this.isHorizontal,L=this.pageMode,N=this.rootTag,P=this.wrapTag,U=this.wrapClass,F=this.wrapStyle,$=this.headerTag,R=this.headerClass,z=this.headerStyle,H=this.footerTag,G=this.footerClass,X=this.footerStyle,J=this.disabled,tt={padding:M?"0px ".concat(q,"px 0px ").concat(W,"px"):"".concat(W,"px 0px ").concat(q,"px")},nt=F?Object.assign({},F,tt):tt;return y(N,{ref:"root",style:J?{overflow:"hidden"}:null,on:{"&scroll":!L&&this.onScroll}},[C?y(A,{class:R,style:z,props:{tag:$,event:I.SLOT,uniqueKey:T.HEADER}},C):null,y(P,{class:U,attrs:{role:"group"},style:nt},this.getRenderSlots(y)),j?y(A,{class:G,style:X,props:{tag:H,event:I.SLOT,uniqueKey:T.FOOTER}},j):null,y("div",{ref:"shepherd",style:{width:M?"0px":"100%",height:M?"100%":"0px"}})])}});return E})})(Yt);var mi=Yt.exports;function vi(){return new Promise(t=>{const o=new ee({render(a){return a(ie.exports.Modal,{class:"chat-emoji-one-modal",props:{fullscreen:!0,footerHide:!0},on:{"on-visible-change":O=>{O||setTimeout(S=>{document.body.removeChild(this.$el)},500)}}},[a(Qt,{attrs:{onlyEmoji:!0},on:{"on-select":O=>{this.$children[0].visible=!1,O.type==="emoji"&&t(O.text)}}})])}}),e=o.$mount();document.body.appendChild(e.$el);const i=o.$children[0];i.visible=!0,i.$el.lastChild.addEventListener("click",({target:a})=>{a.classList.contains("ivu-modal-body")&&(i.visible=!1)})})}var gi=function(){var t=this,o=t.$createElement,e=t._self._c||o;return t.isReady?e("div",{staticClass:"dialog-wrapper",class:t.wrapperClass,on:{drop:function(i){return i.preventDefault(),t.chatPasteDrag(i,"drag")},dragover:function(i){return i.preventDefault(),t.chatDragOver(!0,i)},dragleave:function(i){return i.preventDefault(),t.chatDragOver(!1,i)},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("\uE676")]),t.msgUnreadOnly?e("div",{staticClass:"back-num"},[t._v(t._s(t.msgUnreadOnly))]):t._e()]),e("div",{staticClass:"dialog-block"},[e("div",{staticClass:"dialog-avatar",on:{click:t.onViewAvatar}},[t.dialogData.type=="group"?[t.dialogData.avatar?e("EAvatar",{staticClass:"img-avatar",attrs:{src:t.dialogData.avatar,size:42}}):t.dialogData.group_type=="department"?e("i",{staticClass:"taskfont icon-avatar department"},[t._v("\uE75C")]):t.dialogData.group_type=="project"?e("i",{staticClass:"taskfont icon-avatar project"},[t._v("\uE6F9")]):t.dialogData.group_type=="task"?e("i",{staticClass:"taskfont icon-avatar task"},[t._v("\uE6F4")]):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(i){return t.$set(t.dialogData,"online_state",i)}}},[t.dialogData.type==="user"&&t.dialogData.online_state!==!0?e("p",{attrs:{slot:"end"},slot:"end"},[t._v(" "+t._s(t.$L(t.dialogData.online_state))+" ")]):t._e()])],1):e("Icon",{staticClass:"icon-avatar",attrs:{type:"md-person"}})],2),e("div",{staticClass:"dialog-title"},[e("div",{staticClass:"main-title"},[t._l(t.$A.dialogTags(t.dialogData),function(i){return i.color!="success"?[e("Tag",{attrs:{color:i.color,fade:!1}},[t._v(t._s(t.$L(i.text)))])]:t._e()}),e("h2",[t._v(t._s(t.dialogData.name))]),t.peopleNum>0?e("em",{on:{click:function(i){return t.onDialogMenu("groupInfo")}}},[t._v("("+t._s(t.peopleNum)+")")]):t._e(),t.dialogData.bot?e("Tag",{staticClass:"after",attrs:{fade:!1}},[t._v(t._s(t.$L("\u673A\u5668\u4EBA")))]):t._e(),t.dialogData.group_type=="all"?e("Tag",{staticClass:"after pointer",attrs:{fade:!1},on:{"on-click":function(i){return t.onDialogMenu("groupInfo")}}},[t._v(t._s(t.$L("\u5168\u5458")))]):t.dialogData.group_type=="department"?e("Tag",{staticClass:"after pointer",attrs:{fade:!1},on:{"on-click":function(i){return t.onDialogMenu("groupInfo")}}},[t._v(t._s(t.$L("\u90E8\u95E8")))]):t._e(),t.msgLoadIng>0?e("div",{staticClass:"load"},[e("Loading")],1):t._e()],2),e("ul",{staticClass:"title-desc"},[t.dialogData.type==="user"?e("li",{class:[t.dialogData.online_state===!0?"online":"offline"]},[t._v(" "+t._s(t.$L(t.dialogData.online_state===!0?"\u5728\u7EBF":t.dialogData.online_state))+" ")]):t._e()]),t.tagShow?e("ul",{staticClass:"title-tags scrollbar-hidden"},t._l(t.msgTags,function(i){var a;return e("li",{key:i.type,class:(a={},a[i.type||"msg"]=!0,a.active=t.msgType===i.type,a),on:{click:function(O){return t.onMsgType(i.type)}}},[e("i",{staticClass:"no-dark-content"}),e("span",[t._v(t._s(t.$L(i.label)))])])}),0):t._e()])]),e("EDropdown",{staticClass:"dialog-menu",attrs:{trigger:"click"},on:{command:t.onDialogMenu}},[e("i",{staticClass:"taskfont dialog-menu-icon"},[t._v("\uE6E9")]),e("EDropdownMenu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("EDropdownItem",{attrs:{command:"searchMsg"}},[e("div",[t._v(t._s(t.$L("\u641C\u7D22\u6D88\u606F")))])]),t.dialogData.type==="user"?[t.dialogData.bot==t.userId?e("EDropdownItem",{attrs:{command:"modifyNormal"}},[e("div",[t._v(t._s(t.$L("\u4FEE\u6539\u8D44\u6599")))])]):t._e(),e("EDropdownItem",{attrs:{command:"openCreate"}},[e("div",[t._v(t._s(t.$L("\u521B\u5EFA\u7FA4\u7EC4")))])])]:[e("EDropdownItem",{attrs:{command:"groupInfo"}},[e("div",[t._v(t._s(t.$L("\u7FA4\u7EC4\u8BBE\u7F6E")))])]),t.dialogData.owner_id!=t.userId?[t.dialogData.group_type==="all"&&t.userIsAdmin?e("EDropdownItem",{attrs:{command:"modifyAdmin"}},[e("div",[t._v(t._s(t.$L("\u4FEE\u6539\u8D44\u6599")))])]):t._e(),e("EDropdownItem",{attrs:{command:"exit"}},[e("div",{staticStyle:{color:"#f00"}},[t._v(t._s(t.$L("\u9000\u51FA\u7FA4\u7EC4")))])])]:t.dialogData.group_type==="user"?[e("EDropdownItem",{attrs:{command:"modifyNormal"}},[e("div",[t._v(t._s(t.$L("\u4FEE\u6539\u8D44\u6599")))])]),e("EDropdownItem",{attrs:{command:"transfer"}},[e("div",[t._v(t._s(t.$L("\u8F6C\u8BA9\u7FA4\u4E3B")))])]),e("EDropdownItem",{attrs:{command:"disband"}},[e("div",{staticStyle:{color:"#f00"}},[t._v(t._s(t.$L("\u89E3\u6563\u7FA4\u7EC4")))])])]:t._e()]],2)],1),t.searchShow?e("div",{staticClass:"dialog-search"},[e("div",{staticClass:"search-location"},[e("i",{staticClass:"taskfont",on:{click:function(i){return t.onSearchSwitch("prev")}}},[t._v("\uE702")]),e("i",{staticClass:"taskfont",on:{click:function(i){return t.onSearchSwitch("next")}}},[t._v("\uE705")])]),e("div",{staticClass:"search-input"},[e("Input",{ref:"searchInput",attrs:{placeholder:t.$L("\u641C\u7D22\u6D88\u606F"),clearable:""},on:{"on-keyup":t.onSearchKeyup},model:{value:t.searchKey,callback:function(i){t.searchKey=i},expression:"searchKey"}},[e("div",{staticClass:"search-pre",attrs:{slot:"prefix"},slot:"prefix"},[t.searchLoad>0?e("Loading"):e("Icon",{attrs:{type:"ios-search"}})],1)]),t.searchLoad===0&&t.searchResult.length>0?e("div",{staticClass:"search-total",attrs:{slot:"append"},slot:"append"},[t._v(t._s(t.searchLocation)+"/"+t._s(t.searchResult.length))]):t._e()],1),e("div",{staticClass:"search-cancel",on:{click:function(i){return t.onSearchKeyup(null)}}},[t._v(t._s(t.$L("\u53D6\u6D88")))])]):t._e()],1)]})],2),t.positionMsg?e("div",{staticClass:"dialog-position",class:{down:t.tagShow}},[e("div",{staticClass:"position-label",on:{click:t.onPositionMark}},[t.positionLoad>0?e("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}):e("i",{staticClass:"taskfont"},[t._v("\uE624")]),t._v(" "+t._s(t.positionMsg.label)+" ")],1)]):t._e(),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":t.dialogData.type=="group"?105:77,keeps:50,disabled:t.scrollDisabled},on:{scroll:t.onScroll,range:t.onRange,totop:t.onPrevPage,"on-mention":t.onMention,"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},scopedSlots:t._u([{key:"header",fn:function(){return[t.allMsgs.length===0&&t.loadIng||t.prevId>0?e("div",{staticClass:"dialog-item loading"},[t.scrollOffset<100?e("div",{staticClass:"dialog-wrapper-loading"}):t._e()]):t.allMsgs.length===0?e("div",{staticClass:"dialog-item nothing"},[t._v(t._s(t.$L("\u6682\u65E0\u6D88\u606F")))]):t._e()]},proxy:!0}],null,!1,3828201241)}),e("div",{ref:"footer",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(`\u6709${t.msgNew}\u6761\u65B0\u6D88\u606F`)))]),e("div",{staticClass:"dialog-goto",on:{click:t.onToBottom}},[e("i",{staticClass:"taskfont"},[t._v("\uE72B")])]),e("DialogUpload",{ref:"chatUpload",staticClass:"chat-upload",attrs:{"dialog-id":t.dialogId},on:{"on-progress":function(i){return t.chatFile("progress",i)},"on-success":function(i){return t.chatFile("success",i)},"on-error":function(i){return t.chatFile("error",i)}}}),t.todoShow?e("div",{staticClass:"chat-bottom-menu"},[e("div",{staticClass:"bottom-menu-label"},[t._v(t._s(t.$L("\u5F85\u529E"))+":")]),e("ul",{staticClass:"scrollbar-hidden"},t._l(t.todoList,function(i){return e("li",{on:{click:function(a){return a.stopPropagation(),t.onViewTodo(i)}}},[e("div",{staticClass:"bottom-menu-desc no-dark-content"},[t._v(t._s(t.$A.getMsgSimpleDesc(i.msg_data)))])])}),0)]):t.quickShow?e("div",{staticClass:"chat-bottom-menu"},[e("ul",{staticClass:"scrollbar-hidden"},t._l(t.quickMsgs,function(i){return e("li",{on:{click:function(a){return a.stopPropagation(),t.sendQuick(i)}}},[e("div",{staticClass:"bottom-menu-desc no-dark-content",style:i.style||null},[t._v(t._s(i.label))])])}),0)]):t._e(),t.isMute?e("div",{staticClass:"chat-mute"},[t._v(" "+t._s(t.$L("\u7981\u8A00\u53D1\u8A00"))+" ")]):e("ChatInput",{ref:"input",attrs:{"dialog-id":t.dialogId,"emoji-bottom":t.windowSmall,maxlength:2e5,placeholder:t.$L("\u8F93\u5165\u6D88\u606F...")},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},model:{value:t.msgText,callback:function(i){t.msgText=i},expression:"msgText"}})],1),e("div",{directives:[{name:"show",rawName:"v-show",value:t.operateVisible,expression:"operateVisible"}],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(i){t.operateVisible=!1}}},[e("div",{style:{userSelect:t.operateVisible?"none":"auto",height:t.operateStyles.height}}),e("DropdownMenu",{attrs:{slot:"list"},slot:"list"},[e("DropdownItem",{attrs:{name:"action"}},[e("ul",{staticClass:"operate-action"},[t.msgId===0?e("li",{on:{click:function(i){return t.onOperate("reply")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE6EB")]),e("span",[t._v(t._s(t.$L("\u56DE\u590D")))])]):t._e(),t.operateItem.userid==t.userId&&t.operateItem.type==="text"?e("li",{on:{click:function(i){return t.onOperate("update")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE779")]),e("span",[t._v(t._s(t.$L("\u7F16\u8F91")))])]):t._e(),t._l(t.operateCopys,function(i){return e("li",{on:{click:function(a){return t.onOperate("copy",i)}}},[e("i",{staticClass:"taskfont",domProps:{innerHTML:t._s(i.icon)}}),e("span",[t._v(t._s(t.$L(i.label)))])])}),e("li",{on:{click:function(i){return t.onOperate("forward")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE638")]),e("span",[t._v(t._s(t.$L("\u8F6C\u53D1")))])]),t.operateItem.userid==t.userId?e("li",{on:{click:function(i){return t.onOperate("withdraw")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE637")]),e("span",[t._v(t._s(t.$L("\u64A4\u56DE")))])]):t._e(),t.operateItem.type==="file"?[e("li",{on:{click:function(i){return t.onOperate("view")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE77B")]),e("span",[t._v(t._s(t.$L("\u67E5\u770B")))])]),e("li",{on:{click:function(i){return t.onOperate("down")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7A8")]),e("span",[t._v(t._s(t.$L("\u4E0B\u8F7D")))])])]:t._e(),e("li",{on:{click:function(i){return t.onOperate("tag")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE61E")]),e("span",[t._v(t._s(t.$L(t.operateItem.tag?"\u53D6\u6D88\u6807\u6CE8":"\u6807\u6CE8")))])]),t.operateItem.type==="text"?e("li",{on:{click:function(i){return t.onOperate("newTask")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7B8")]),e("span",[t._v(t._s(t.$L("\u65B0\u4EFB\u52A1")))])]):t._e(),e("li",{on:{click:function(i){return t.onOperate("todo")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE7B7")]),e("span",[t._v(t._s(t.$L(t.operateItem.todo?"\u53D6\u6D88\u5F85\u529E":"\u8BBE\u5F85\u529E")))])]),t.msgType!==""?e("li",{on:{click:function(i){return t.onOperate("pos")}}},[e("i",{staticClass:"taskfont"},[t._v("\uEE15")]),e("span",[t._v(t._s(t.$L("\u5B8C\u6574\u5BF9\u8BDD")))])]):t._e()],2)]),e("DropdownItem",{staticClass:"dropdown-emoji",attrs:{name:"emoji"}},[e("ul",{staticClass:"operate-emoji scrollbar-hidden"},[t._l(t.operateEmojis,function(i,a){return e("li",{key:a,staticClass:"no-dark-content",domProps:{innerHTML:t._s(i)},on:{click:function(O){return t.onOperate("emoji",i)}}})}),e("li"),e("li",{staticClass:"more-emoji",on:{click:function(i){return t.onOperate("emoji","more")}}},[e("i",{staticClass:"taskfont"},[t._v("\uE790")])])],2)])],1)],1)],1),t.dialogDrag?e("div",{staticClass:"drag-over",on:{click:function(i){t.dialogDrag=!1}}},[e("div",{staticClass:"drag-text"},[t._v(t._s(t.$L("\u62D6\u52A8\u5230\u8FD9\u91CC\u53D1\u9001")))])]):t._e(),e("Modal",{attrs:{title:t.$L(t.pasteTitle),"cancel-text":t.$L("\u53D6\u6D88"),"ok-text":t.$L("\u53D1\u9001"),"enter-ok":!0},on:{"on-ok":t.pasteSend},model:{value:t.pasteShow,callback:function(i){t.pasteShow=i},expression:"pasteShow"}},[e("ul",{staticClass:"dialog-wrapper-paste",class:t.pasteWrapperClass},t._l(t.pasteItem,function(i){return e("li",[i.type=="image"?e("img",{attrs:{src:i.result}}):e("div",[t._v(t._s(t.$L("\u6587\u4EF6"))+": "+t._s(i.name)+" ("+t._s(t.$A.bytesToSize(i.size))+")")])])}),0)]),e("Modal",{attrs:{title:t.$L("\u521B\u5EFA\u7FA4\u7EC4"),"mask-closable":!1},model:{value:t.createGroupShow,callback:function(i){t.createGroupShow=i},expression:"createGroupShow"}},[e("Form",{attrs:{model:t.createGroupData,"label-width":"auto"},nativeOn:{submit:function(i){i.preventDefault()}}},[e("FormItem",{attrs:{prop:"avatar",label:t.$L("\u7FA4\u5934\u50CF")}},[e("ImgUpload",{attrs:{num:1,width:512,height:512,whcut:1},model:{value:t.createGroupData.avatar,callback:function(i){t.$set(t.createGroupData,"avatar",i)},expression:"createGroupData.avatar"}})],1),e("FormItem",{attrs:{prop:"chat_name",label:t.$L("\u7FA4\u540D\u79F0")}},[e("Input",{attrs:{placeholder:t.$L("\u8F93\u5165\u7FA4\u540D\u79F0\uFF08\u9009\u586B\uFF09")},model:{value:t.createGroupData.chat_name,callback:function(i){t.$set(t.createGroupData,"chat_name",i)},expression:"createGroupData.chat_name"}})],1),e("FormItem",{attrs:{prop:"userids",label:t.$L("\u7FA4\u6210\u5458")}},[e("UserInput",{attrs:{uncancelable:t.createGroupData.uncancelable,"multiple-max":100,"show-bot":"",placeholder:t.$L("\u9009\u62E9\u9879\u76EE\u6210\u5458")},model:{value:t.createGroupData.userids,callback:function(i){t.$set(t.createGroupData,"userids",i)},expression:"createGroupData.userids"}})],1)],1),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.createGroupShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.createGroupLoad>0},on:{click:t.onCreateGroup}},[t._v(t._s(t.$L("\u521B\u5EFA")))])],1)],1),e("Modal",{attrs:{title:t.$L("\u4FEE\u6539\u8D44\u6599"),"mask-closable":!1},model:{value:t.modifyShow,callback:function(i){t.modifyShow=i},expression:"modifyShow"}},[e("Form",{attrs:{model:t.modifyData,"label-width":"auto"},nativeOn:{submit:function(i){i.preventDefault()}}},[e("FormItem",{attrs:{prop:"avatar",label:t.$L("\u5934\u50CF")}},[e("ImgUpload",{attrs:{num:1,width:512,height:512,whcut:1},model:{value:t.modifyData.avatar,callback:function(i){t.$set(t.modifyData,"avatar",i)},expression:"modifyData.avatar"}})],1),typeof t.modifyData.name!="undefined"?e("FormItem",{attrs:{prop:"name",label:t.$L("\u540D\u79F0")}},[e("Input",{attrs:{maxlength:20},model:{value:t.modifyData.name,callback:function(i){t.$set(t.modifyData,"name",i)},expression:"modifyData.name"}})],1):t._e(),typeof t.modifyData.clear_day!="undefined"?e("FormItem",{attrs:{prop:"clear_day",label:t.$L("\u6D88\u606F\u4FDD\u7559")}},[e("Input",{attrs:{maxlength:3,type:"number"},model:{value:t.modifyData.clear_day,callback:function(i){t.$set(t.modifyData,"clear_day",i)},expression:"modifyData.clear_day"}},[e("div",{attrs:{slot:"append"},slot:"append"},[t._v(t._s(t.$L("\u5929")))])])],1):t._e(),typeof t.modifyData.webhook_url!="undefined"?e("FormItem",{attrs:{prop:"webhook_url",label:"Webhook"}},[e("Input",{attrs:{maxlength:255},model:{value:t.modifyData.webhook_url,callback:function(i){t.$set(t.modifyData,"webhook_url",i)},expression:"modifyData.webhook_url"}})],1):t._e()],1),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.modifyShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.modifyLoad>0},on:{click:t.onModify}},[t._v(t._s(t.$L("\u4FDD\u5B58")))])],1)],1),e("Modal",{attrs:{title:t.$L("\u8F6C\u53D1"),"mask-closable":!1},model:{value:t.forwardShow,callback:function(i){t.forwardShow=i},expression:"forwardShow"}},[e("DialogSelect",{model:{value:t.forwardData,callback:function(i){t.forwardData=i},expression:"forwardData"}}),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.forwardShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.forwardLoad},on:{click:function(i){return t.onForward("submit")}}},[t._v(t._s(t.$L("\u8F6C\u53D1")))])],1)],1),e("Modal",{attrs:{title:t.$L("\u8BBE\u7F6E\u5F85\u529E"),"mask-closable":!1},model:{value:t.todoSettingShow,callback:function(i){t.todoSettingShow=i},expression:"todoSettingShow"}},[e("Form",{ref:"todoSettingForm",attrs:{model:t.todoSettingData,"label-width":"auto"},nativeOn:{submit:function(i){i.preventDefault()}}},[e("FormItem",{attrs:{prop:"type",label:t.$L("\u5F53\u524D\u4F1A\u8BDD")}},[e("RadioGroup",{model:{value:t.todoSettingData.type,callback:function(i){t.$set(t.todoSettingData,"type",i)},expression:"todoSettingData.type"}},[e("Radio",{attrs:{label:"all"}},[t._v(t._s(t.$L("\u6240\u6709\u6210\u5458")))]),e("Radio",{attrs:{label:"user"}},[t._v(t._s(t.$L("\u6307\u5B9A\u6210\u5458")))]),t.todoSettingData.my_id?e("Radio",{attrs:{label:"my"}},[e("div",{staticClass:"dialog-wrapper-todo"},[e("div",[e("UserAvatar",{attrs:{userid:t.todoSettingData.my_id,"show-icon":!1,"show-name":!0}}),e("Tag",[t._v(t._s(t.$L("\u81EA\u5DF1")))])],1)])]):t._e(),t.todoSettingData.you_id?e("Radio",{attrs:{label:"you"}},[e("div",{staticClass:"dialog-wrapper-todo"},[e("div",[e("UserAvatar",{attrs:{userid:t.todoSettingData.you_id,"show-icon":!1,"show-name":!0}})],1)])]):t._e()],1)],1),t.todoSettingData.type==="user"?e("FormItem",{attrs:{prop:"userids"}},[e("UserInput",{attrs:{"dialog-id":t.dialogId,placeholder:t.$L("\u9009\u62E9\u6307\u5B9A\u6210\u5458")},model:{value:t.todoSettingData.userids,callback:function(i){t.$set(t.todoSettingData,"userids",i)},expression:"todoSettingData.userids"}})],1):t._e()],1),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.todoSettingShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.todoSettingLoad>0},on:{click:function(i){return t.onTodo("submit")}}},[t._v(t._s(t.$L("\u786E\u5B9A")))])],1)],1),e("DrawerOverlay",{attrs:{placement:"right",size:400},model:{value:t.groupInfoShow,callback:function(i){t.groupInfoShow=i},expression:"groupInfoShow"}},[t.groupInfoShow?e("DialogGroupInfo",{attrs:{dialogId:t.dialogId},on:{"on-close":function(i){t.groupInfoShow=!1}}}):t._e()],1),e("Modal",{attrs:{title:t.$L("\u8F6C\u8BA9\u7FA4\u4E3B\u8EAB\u4EFD"),"mask-closable":!1},model:{value:t.groupTransferShow,callback:function(i){t.groupTransferShow=i},expression:"groupTransferShow"}},[e("Form",{attrs:{model:t.groupTransferData,"label-width":"auto"},nativeOn:{submit:function(i){i.preventDefault()}}},[e("FormItem",{attrs:{prop:"userid",label:t.$L("\u65B0\u7684\u7FA4\u4E3B")}},[e("UserInput",{attrs:{disabledChoice:t.groupTransferData.disabledChoice,"multiple-max":1,"max-hidden-select":"",placeholder:t.$L("\u9009\u62E9\u65B0\u7684\u7FA4\u4E3B")},model:{value:t.groupTransferData.userid,callback:function(i){t.$set(t.groupTransferData,"userid",i)},expression:"groupTransferData.userid"}})],1)],1),e("div",{staticClass:"adaption",attrs:{slot:"footer"},slot:"footer"},[e("Button",{attrs:{type:"default"},on:{click:function(i){t.groupTransferShow=!1}}},[t._v(t._s(t.$L("\u53D6\u6D88")))]),e("Button",{attrs:{type:"primary",loading:t.groupTransferLoad>0},on:{click:function(i){return t.onDialogMenu("transferConfirm")}}},[t._v(t._s(t.$L("\u786E\u5B9A\u8F6C\u8BA9")))])],1)],1),e("DrawerOverlay",{attrs:{placement:"right","class-name":"dialog-wrapper-drawer-list",size:500},model:{value:t.replyListShow,callback:function(i){t.replyListShow=i},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("\u56DE\u590D\u6D88\u606F")))])]):t._e()],1),e("DrawerOverlay",{attrs:{placement:"right",size:400},model:{value:t.respondShow,callback:function(i){t.respondShow=i},expression:"respondShow"}},[t.respondShow?e("DialogRespond",{attrs:{"respond-data":t.respondData},on:{"on-close":function(i){t.respondShow=!1}}}):t._e()],1),e("DrawerOverlay",{attrs:{placement:"right","class-name":"dialog-wrapper-drawer-list",size:500},model:{value:t.todoViewShow,callback:function(i){t.todoViewShow=i},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("\u5F85\u529E\u6D88\u606F")))])]),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(),e("Button",{staticClass:"original-button",attrs:{icon:"md-exit",type:"text",loading:t.todoViewPosLoad},on:{click:t.onPosTodo}},[t._v(t._s(t.$L("\u56DE\u5230\u539F\u6587")))])],1),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("\u5B8C\u6210")))])],1)])])],1):t._e()},yi=[];const bi={name:"DialogWrapper",components:{ImgUpload:oe,DialogSelect:ne,DialogRespond:Be,DialogItem:Dt,VirtualList:mi,ChatInput:pi,DialogGroupInfo:Ne,DrawerOverlay:re,UserInput:Ht,DialogUpload:Ae},props:{dialogId:{type:Number,default:0},msgId:{type:Number,default:0},autoFocus:{type:Boolean,default:!1},beforeBack:Function},data(){return{msgItem:Dt,msgText:"",msgNew:0,msgType:"",loadIng:0,allMsgs:[],tempMsgs:[],tempId:$A.randNum(1e9,9999999999),msgLoadIng:0,msgActiveIndex:-1,pasteShow:!1,pasteFile:[],pasteItem:[],searchShow:!1,searchKey:"",searchLoad:0,searchLocation:1,searchResult:[],createGroupShow:!1,createGroupData:{},createGroupLoad:0,modifyShow:!1,modifyData:{},modifyLoad:0,forwardShow:!1,forwardLoad:!1,forwardData:{dialogids:[],userids:[]},openId:0,dialogDrag:!1,groupInfoShow:!1,groupTransferShow:!1,groupTransferLoad:0,groupTransferData:{userid:[],disabledChoice:[]},navStyle:{},operateVisible:!1,operateCopys:[],operateStyles:{},operateItem:{},recordState:"",wrapperStart:{},scrollOffset:0,scrollTail:0,preventMoreLoad:!1,preventToBottom:!1,replyListShow:!1,replyListId:0,respondShow:!1,respondData:{},todoSettingShow:!1,todoSettingLoad:0,todoSettingData:{type:"all",userids:[]},todoViewLoad:!1,todoViewPosLoad:!1,todoViewShow:!1,todoViewData:{},todoViewMid:0,todoViewId:0,scrollDisabled:!1,scrollDirection:null,scrollAction:0,scrollTmp:0,positionLoad:0}},beforeDestroy(){this.$store.dispatch("forgetInDialog",this._uid),this.$store.dispatch("closeDialog",this.dialogId)},computed:{...bt(["userIsAdmin","taskId","dialogSearchMsgId","dialogMsgs","dialogTodos","dialogMsgTransfer","cacheDialogs","wsOpenNum","touchBackInProgress","dialogIns","cacheUserBasic","fileLinks","cacheEmojis"]),...Ft(["isLoad"]),isReady(){return this.dialogId>0&&this.dialogData.id>0},dialogData(){return this.cacheDialogs.find(({id:t})=>t==this.dialogId)||{}},dialogList(){return this.cacheDialogs.filter(t=>!(t.name===void 0||t.dialog_delete===1)).sort((t,o)=>t.top_at||o.top_at?$A.Date(o.top_at)-$A.Date(t.top_at):t.todo_num>0||o.todo_num>0?o.todo_num-t.todo_num:$A.Date(o.last_at)-$A.Date(t.last_at))},dialogMsgList(){return this.isReady?this.dialogMsgs.filter(t=>t.dialog_id==this.dialogId):[]},tempMsgList(){return this.isReady?this.tempMsgs.filter(t=>t.dialog_id==this.dialogId):[]},allMsgList(){const t=[];if(t.push(...this.dialogMsgList.filter(o=>this.msgFilter(o))),this.msgId>0){const o=this.dialogMsgs.find(e=>e.id==this.msgId);o&&t.unshift(o)}if(this.tempMsgList.length>0){const o=t.map(({id:i})=>i),e=this.tempMsgList.filter(i=>!o.includes(i.id)&&this.msgFilter(i));e.length>0&&t.push(...e)}return t.sort((o,e)=>o.id-e.id)},loadMsg(){return this.isLoad(`msg::${this.dialogId}-${this.msgId}-${this.msgType}`)},prevId(){return this.allMsgs.length>0?$A.runNum(this.allMsgs[0].prev_id):0},peopleNum(){return this.dialogData.type==="group"?$A.runNum(this.dialogData.people):0},pasteTitle(){const{pasteItem:t}=this;let o=t.find(({type:i})=>i=="image"),e=t.find(({type:i})=>i!="image");return o&&e?"\u53D1\u9001\u6587\u4EF6/\u56FE\u7247":o?"\u53D1\u9001\u56FE\u7247":"\u53D1\u9001\u6587\u4EF6"},msgTags(){const t=[{type:"",label:"\u6D88\u606F"}];return this.dialogData.has_tag&&t.push({type:"tag",label:"\u6807\u6CE8"}),this.dialogData.has_image&&t.push({type:"image",label:"\u56FE\u7247"}),this.dialogData.has_file&&t.push({type:"file",label:"\u6587\u4EF6"}),this.dialogData.has_link&&t.push({type:"link",label:"\u94FE\u63A5"}),this.dialogData.group_type==="project"&&t.push({type:"project",label:"\u6253\u5F00\u9879\u76EE"}),this.dialogData.group_type==="task"&&t.push({type:"task",label:"\u6253\u5F00\u4EFB\u52A1"}),t},quickMsgs(){return this.dialogData.quick_msgs||[]},quickShow(){return this.quickMsgs.length>0&&this.windowScrollY===0&&this.quoteId===0},todoList(){return this.dialogData.todo_num?this.dialogTodos.filter(t=>!t.done_at&&t.dialog_id==this.dialogId).sort((t,o)=>o.id-t.id):[]},todoShow(){return this.todoList.length>0&&this.windowScrollY===0&&this.quoteId===0},wrapperClass(){return["ready","ing"].includes(this.recordState)?["record-ready"]:null},tagShow(){return this.msgTags.length>1&&this.windowScrollY===0&&!this.searchShow},scrollerClass(){return!this.$slots.head&&this.tagShow?"default-header":null},pasteWrapperClass(){return this.pasteItem.find(({type:t})=>t!=="image")?["multiple"]:[]},footerClass(){return this.msgNew>0&&this.allMsgs.length>0?"newmsg":this.scrollTail>500?"goto":null},msgUnreadOnly(){let t=0;return this.cacheDialogs.some(o=>{t+=$A.getDialogNum(o)}),t<=0?"":(t>999&&(t="999+"),String(t))},isMyDialog(){const{dialogData:t,userId:o}=this;return t.dialog_user&&t.dialog_user.userid==o},isMute(){if(this.dialogData.group_type==="all"){if(this.dialogData.all_group_mute==="all")return!0;if(this.dialogData.all_group_mute==="user"&&!this.userIsAdmin)return!0}return!1},quoteId(){return this.msgId>0?this.msgId:this.dialogData.extra_quote_id||0},quoteUpdate(){return this.dialogData.extra_quote_type==="update"},quoteData(){return this.quoteId?this.allMsgs.find(({id:t})=>t===this.quoteId):null},todoViewMsg(){if(this.todoViewMid){const t=this.allMsgs.find(o=>o.id==this.todoViewMid);if(t)return t;if(this.todoViewData.id===this.todoViewMid)return this.todoViewData}return null},positionMsg(){const{unread:t,position_msgs:o}=this.dialogData;if(!o||o.length===0||t===0||this.allMsgs.length===0)return null;const e=o.sort((i,a)=>a.msg_id-i.msg_id)[0];return this.allMsgs.findIndex(({id:i})=>i==e.msg_id)===-1?e.label==="{UNREAD}"?Object.assign(e,{label:this.$L(`\u672A\u8BFB\u6D88\u606F${t}\u6761`)}):e:null},operateEmojis(){const t=this.cacheEmojis.slice(0,3);return Object.values(["\u{1F44C}","\u{1F44D}","\u{1F602}","\u{1F389}","\u2764\uFE0F","\u{1F973}\uFE0F","\u{1F970}","\u{1F625}","\u{1F62D}"]).some(o=>{t.includes(o)||t.push(o)}),t}},watch:{dialogId:{handler(t,o){t&&(this.msgNew=0,this.msgType="",this.searchShow=!1,this.allMsgList.length>0&&(this.allMsgs=this.allMsgList,requestAnimationFrame(this.onToBottom)),this.getMsgs({dialog_id:t,msg_id:this.msgId,msg_type:this.msgType}).then(e=>{this.openId=t,setTimeout(this.onSearchMsgId,100)}).catch(e=>{}),this.$store.dispatch("saveInDialog",{uid:this._uid,dialog_id:t}),this.autoFocus&&this.inputFocus()),this.$store.dispatch("closeDialog",o)},immediate:!0},loadMsg:{handler(t){t?this.loadIng++:setTimeout(o=>{this.loadIng--},300)},immediate:!0},msgType(){this.getMsgs({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,clear_before:!0}).catch(t=>{})},searchKey(t){!t||(this.searchLoad++,setTimeout(o=>{this.searchKey===t&&(this.searchLoad++,this.searchResult=[],this.searchLocation=0,this.$store.dispatch("call",{url:"dialog/msg/search",data:{dialog_id:this.dialogId,key:t}}).then(({data:e})=>{this.searchKey===t&&(this.searchResult=e.data,this.searchLocation=this.searchResult.length)}).finally(e=>{this.searchLoad--})),this.searchLoad--},600))},searchLocation(t){if(t===0)return;const o=this.searchResult[t-1];o&&this.onPositionId(o)},dialogSearchMsgId(){this.onSearchMsgId()},dialogMsgTransfer:{handler({time:t,msgFile:o,msgRecord:e,msgText:i,dialogId:a}){t>$A.Time()&&a==this.dialogId&&(this.$store.state.dialogMsgTransfer.time=0,this.$nextTick(()=>{$A.isArray(o)&&o.length>0?this.sendFileMsg(o):$A.isJson(e)&&e.duration>0?this.sendRecord(e):i&&this.sendMsg(i)}))},immediate:!0},wsOpenNum(t){t<=1||this.getMsgs({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType}).catch(o=>{})},allMsgList(t,o){const{tail:e}=this.scrollInfo();if(this.allMsgs=t,!this.windowActive||e>10&&o.length>0){const i=o[o.length-1]?o[o.length-1].id:0,a=t.filter(O=>O.id&&O.id>i);this.msgNew+=a.length}else this.preventToBottom||this.$nextTick(this.onToBottom)},windowScrollY(t){if($A.isIos()){const{tail:o}=this.scrollInfo();this.navStyle={marginTop:t+"px"},o<=10&&requestAnimationFrame(this.onToBottom),this.$refs.input.isFocus&&$A.scrollToView(this.$refs.footer)}},windowActive(t){if(t&&this.autoFocus){const o=$A.last(this.dialogIns);o&&o.uid===this._uid&&this.inputFocus()}},dialogDrag(t){t&&(this.operateVisible=!1)},msgActiveIndex(t){t>-1&&setTimeout(o=>this.msgActiveIndex=-1,800)}},methods:{sendMsg(t){let o,e=!1;if(typeof t=="string"&&t?o=t:(o=this.msgText,e=!0),o==""){this.inputFocus();return}if(o=o.replace(/<\/span> <\/p>$/,"</span></p>"),this.quoteUpdate){o=o.replace(new RegExp(`src=(["'])${$A.apiUrl("../")}`,"g"),"src=$1{{RemoteURL}}");const i=this.quoteId;this.$store.dispatch("setLoad",{key:`msg-${i}`,delay:600}),this.cancelQuote(),this.onActive(),this.$store.dispatch("call",{url:"dialog/msg/sendtext",data:{dialog_id:this.dialogId,update_id:i,text:o},method:"post",complete:a=>this.$store.dispatch("cancelLoad",`msg-${i}`)}).then(({data:a})=>{this.sendSuccess(a),this.onPositionId(i)}).catch(({msg:a})=>{$A.modalError(a)})}else{const i=$A.stringLength(o.replace(/<img[^>]*?>/g,""))>5e3,a={id:this.getTempId(),dialog_id:this.dialogData.id,reply_id:this.quoteId,reply_data:this.quoteData,type:i?"loading":"text",userid:this.userId,msg:{text:i?"":o}};this.tempMsgs.push(a),this.msgType="",this.cancelQuote(),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:o},method:"post"}).then(({data:O})=>{this.tempMsgs=this.tempMsgs.filter(({id:S})=>S!=a.id),this.sendSuccess(O)}).catch(O=>{this.$set(a,"error",!0),this.$set(a,"errorData",{type:"text",content:O.msg,msg:o})})}e&&requestAnimationFrame(i=>this.msgText="")},sendRecord(t){const o={id:this.getTempId(),dialog_id:this.dialogData.id,reply_id:this.quoteId,reply_data:this.quoteData,type:"loading",userid:this.userId,msg:t};this.tempMsgs.push(o),this.msgType="",this.cancelQuote(),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.quoteId}),method:"post"}).then(({data:e})=>{this.tempMsgs=this.tempMsgs.filter(({id:i})=>i!=o.id),this.sendSuccess(e)}).catch(e=>{this.$set(o,"error",!0),this.$set(o,"errorData",{type:"record",content:e.msg,msg:t})})},sendFileMsg(t){const o=$A.isArray(t)?t:[t];o.length>0&&(this.pasteFile=[],this.pasteItem=[],o.some(e=>{const i={type:$A.getMiddle(e.type,null,"/"),name:e.name,size:e.size,result:null};if(i.type==="image"){const a=new FileReader;a.readAsDataURL(e),a.onload=({target:O})=>{i.result=O.result,this.pasteFile.push(e),this.pasteItem.push(i),this.pasteShow=!0}}else this.pasteFile.push(e),this.pasteItem.push(i),this.pasteShow=!0}))},sendQuick(t){this.sendMsg(`<p><span data-quick-key="${t.key}">${t.label}</span></p>`)},getTempId(){return this.tempId++},getMsgs(t){return new Promise((o,e)=>{setTimeout(i=>this.msgLoadIng++,2e3),this.$store.dispatch("getDialogMsgs",t).then(o).catch(e).finally(i=>{this.msgLoadIng--})})},msgFilter(t){if(this.msgType){if(this.msgType==="tag"){if(!t.tag)return!1}else if(this.msgType==="link"){if(!t.link)return!1}else if(this.msgType!==t.mtype)return!1}return!(this.msgId&&t.reply_id!=this.msgId)},onSearchMsgId(){this.dialogSearchMsgId>0&&this.openId===this.dialogId&&(this.onPositionId(this.dialogSearchMsgId),this.$store.state.dialogSearchMsgId=0)},onPositionId(t,o=0,e=0){return new Promise((i,a)=>{if(t===0){$A.modalError("\u67E5\u770B\u5931\u8D25\uFF1A\u53C2\u6570\u9519\u8BEF"),a();return}if(this.loadMsg||this.msgType!==""){if(this.msgType="",e===0)this.$store.dispatch("showSpinner",600);else if(e>20){this.$store.dispatch("hiddenSpinner"),$A.modalError("\u67E5\u770B\u5931\u8D25\uFF1A\u8BF7\u6C42\u8D85\u65F6"),a();return}e++,setTimeout(w=>{this.onPositionId(t,o,e).then(i).catch(a)},Math.min(800,200*e));return}e>0&&this.$store.dispatch("hiddenSpinner");const O=this.allMsgs.findIndex(w=>w.id===t),S=this.prevId>0?0:-1;O>S?setTimeout(w=>{this.onToIndex(O),i()},200):(o>0&&this.$store.dispatch("setLoad",{key:`msg-${o}`,delay:600}),this.preventToBottom=!0,this.getMsgs({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,position_id:t,spinner:2e3}).finally(w=>{const b=this.allMsgs.findIndex(_=>_.id===t);b>-1&&(this.onToIndex(b),i()),o>0&&this.$store.dispatch("cancelLoad",`msg-${o}`),this.preventToBottom=!1}))})},onViewTodo(t){if(this.operateVisible)return;this.todoViewId=t.id,this.todoViewMid=t.msg_id,this.todoViewShow=!0,this.allMsgs.findIndex(e=>e.id===this.todoViewMid)===-1&&this.$store.dispatch("call",{url:"dialog/msg/one",data:{msg_id:this.todoViewMid}}).then(({data:e})=>{this.todoViewData=e})},onCloseTodo(){this.todoViewLoad=!1,this.todoViewShow=!1,this.todoViewData={},this.todoViewMid=0,this.todoViewId=0},onPosTodo(){!this.todoViewMid||(this.todoViewPosLoad=!0,this.onPositionId(this.todoViewMid).then(this.onCloseTodo).finally(t=>{this.todoViewPosLoad=!1}))},onDoneTodo(){!this.todoViewId||this.todoViewLoad||(this.todoViewLoad=!0,this.$store.dispatch("call",{url:"dialog/msg/done",data:{id:this.todoViewId}}).then(({data:t})=>{this.$store.dispatch("saveDialogTodo",{id:this.todoViewId,done_at:$A.formatDate("Y-m-d H:i:s")}),this.$store.dispatch("saveDialog",{id:this.dialogId,todo_num:this.todoList.length}),t.add&&this.sendSuccess(t.add),this.todoList.length===0&&this.$store.dispatch("getDialogTodo",this.dialogId),this.onCloseTodo()}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.todoViewLoad=!1}))},itemClassAdd(t){return t===this.msgActiveIndex?"common-shake":""},inputFocus(){this.$nextTick(t=>{this.$refs.input&&this.$refs.input.focus()})},onRecordState(t){this.recordState=t},chatPasteDrag(t,o){this.dialogDrag=!1;const e=o==="drag"?t.dataTransfer.files:t.clipboardData.files,i=Array.prototype.slice.call(e);i.length>0&&(t.preventDefault(),this.sendFileMsg(i))},chatDragOver(t,o){let e=this.__dialogDrag=$A.randomString(8);if(!t)setTimeout(()=>{e===this.__dialogDrag&&(this.dialogDrag=t)},150);else{if(o.dataTransfer.effectAllowed==="move"||Array.prototype.slice.call(o.dataTransfer.files).length===0)return;this.dialogDrag=!0}},onTouchStart(t){this.wrapperStart=Object.assign(this.scrollInfo(),{clientY:t.touches[0].clientY,exclud:!this.$refs.scroller.$el.contains(t.target)})},onTouchMove(t){if(this.windowSmall&&this.windowScrollY>0){if(this.wrapperStart.exclud){t.preventDefault();return}this.wrapperStart.clientY>t.touches[0].clientY?this.wrapperStart.tail===0&&t.preventDefault():this.wrapperStart.offset===0&&t.preventDefault()}},pasteSend(){this.pasteFile.some(t=>{this.$refs.chatUpload.upload(t)})},chatFile(t,o){switch(t){case"progress":const e={id:o.tempId,dialog_id:this.dialogData.id,reply_id:this.quoteId,type:"loading",userid:this.userId,msg:{}};this.tempMsgs.push(e),this.msgType="",this.cancelQuote(),this.onActive(),this.$nextTick(this.onToBottom);break;case"error":this.tempMsgs=this.tempMsgs.filter(({id:i})=>i!=o.tempId);break;case"success":this.tempMsgs=this.tempMsgs.filter(({id:i})=>i!=o.tempId),this.sendSuccess(o.data);break}},sendSuccess(t){if($A.isArray(t)){t.some(this.sendSuccess);return}this.$store.dispatch("saveDialogMsg",t),this.quoteUpdate||(this.$store.dispatch("increaseTaskMsgNum",t),this.$store.dispatch("increaseMsgReplyNum",t),this.$store.dispatch("updateDialogLastMsg",t)),this.cancelQuote(),this.onActive()},setQuote(t,o){var e;(e=this.$refs.input)==null||e.setQuote(t,o)},cancelQuote(){var t;(t=this.$refs.input)==null||t.cancelQuote()},onEventFocus(){this.$emit("on-focus")},onEventBlur(){this.$emit("on-blur")},onEventMore(t){switch(t){case"image":case"file":this.$refs.chatUpload.handleClick();break;case"call":this.onCallTel();break;case"anon":this.onAnon();break}},onCallTel(){this.$store.dispatch("call",{url:"dialog/tel",data:{dialog_id:this.dialogId},spinner:600}).then(({data:t})=>{t.tel&&$A.eeuiAppSendMessage({action:"callTel",tel:t.tel}),t.add&&(this.$store.dispatch("saveDialogMsg",t.add),this.$store.dispatch("updateDialogLastMsg",t.add),this.onActive())}).catch(({msg:t})=>{$A.modalError(t)})},onAnon(){if(this.dialogData.type!=="user"||this.dialogData.bot){$A.modalWarning("\u533F\u540D\u6D88\u606F\u4EC5\u5141\u8BB8\u53D1\u9001\u7ED9\u4E2A\u4EBA");return}$A.modalInput({title:"\u53D1\u9001\u533F\u540D\u6D88\u606F",placeholder:"\u533F\u540D\u6D88\u606F\u5C06\u901A\u8FC7\u533F\u540D\u6D88\u606F\uFF08\u673A\u5668\u4EBA\uFF09\u53D1\u9001\u7ED9\u5BF9\u65B9\uFF0C\u4E0D\u4F1A\u8BB0\u5F55\u4F60\u7684\u4EFB\u4F55\u8EAB\u4EFD\u4FE1\u606F",inputProps:{type:"textarea",rows:3,autosize:{minRows:3,maxRows:6},maxlength:2e3},okText:"\u533F\u540D\u53D1\u9001",onOk:t=>t?new Promise((o,e)=>{this.$store.dispatch("call",{url:"dialog/msg/sendanon",data:{userid:this.dialogData.dialog_user.userid,text:t},method:"post"}).then(({msg:i})=>{o(i)}).catch(({msg:i})=>{e(i)})}):"\u8BF7\u8F93\u5165\u6D88\u606F\u5185\u5BB9"})},onEventEmojiVisibleChange(t){t&&this.windowSmall&&this.onToBottom()},onHeightChange({newVal:t,oldVal:o}){const e=t-o;if(e!==0){const{offset:i,tail:a}=this.scrollInfo();a>0&&this.onToOffset(i+e)}},onActive(){this.$emit("on-active")},onToBottom(){this.msgNew=0;const t=this.$refs.scroller;t&&(t.scrollToBottom(),requestAnimationFrame(o=>t.scrollToBottom()))},onToIndex(t){const o=this.$refs.scroller;o&&(o.stopToBottom(),o.scrollToIndex(t,-100),requestAnimationFrame(e=>o.scrollToIndex(t,-100))),requestAnimationFrame(e=>this.msgActiveIndex=t)},onToOffset(t){const o=this.$refs.scroller;o&&(o.stopToBottom(),o.scrollToOffset(t),setTimeout(e=>o.scrollToOffset(t),10))},scrollInfo(){const t=this.$refs.scroller;return t?t.scrollInfo():{offset:0,scale:0,tail:0}},openProject(){!this.dialogData.group_info||(this.windowSmall&&this.$store.dispatch("openDialog",0),this.goForward({name:"manage-project",params:{projectId:this.dialogData.group_info.id}}))},openTask(){!this.dialogData.group_info||(this.taskId>0&&this.$store.dispatch("openDialog",0),this.$store.dispatch("openTask",this.dialogData.group_info.id))},onPrevPage(){this.prevId!==0&&this.getMsgs({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,prev_id:this.prevId,save_before:t=>this.scrollDisabled=!0,save_after:t=>this.scrollDisabled=!1}).then(({data:t})=>{const o=t.list.map(e=>e.id);this.$nextTick(()=>{const e=this.$refs.scroller,i=o.reduce((O,S)=>({size:(typeof O=="object"?O.size:e.getSize(O))+e.getSize(S)}));let a=e.getOffset()+i.size;this.prevId===0&&(a-=36),this.onToOffset(a),setTimeout(O=>e.virtual.handleFront(),10)})}).catch(()=>{})},onDialogMenu(t){var o;switch(t){case"searchMsg":this.searchShow=!0,this.$nextTick(i=>{this.$refs.searchInput.focus()});break;case"openCreate":const e=[this.userId];this.dialogData.dialog_user&&this.userId!=this.dialogData.dialog_user.userid&&e.push(this.dialogData.dialog_user.userid),this.createGroupData={userids:e,uncancelable:[this.userId]},this.createGroupShow=!0;break;case"modifyNormal":this.modifyData={dialog_id:this.dialogData.id,avatar:this.dialogData.avatar,name:this.dialogData.name},this.dialogData.type==="user"&&(this.modifyData=Object.assign(this.modifyData,{userid:this.dialogData.dialog_user.userid,avatar:(o=this.cacheUserBasic.find(i=>i.userid===this.dialogData.dialog_user.userid))==null?void 0:o.userimg,clear_day:0,webhook_url:""}),this.modifyLoad++,this.$store.dispatch("call",{url:"users/bot/info",data:{id:this.dialogData.dialog_user.userid}}).then(({data:i})=>{this.modifyData.clear_day=i.clear_day,this.modifyData.webhook_url=i.webhook_url}).finally(()=>{this.modifyLoad--})),this.modifyShow=!0;break;case"modifyAdmin":this.modifyData={dialog_id:this.dialogData.id,avatar:this.dialogData.avatar,admin:1},this.modifyShow=!0;break;case"groupInfo":this.groupInfoShow=!0;break;case"transfer":this.groupTransferData={dialog_id:this.dialogId,userid:[],disabledChoice:[this.userId]},this.groupTransferShow=!0;break;case"transferConfirm":this.onTransferGroup();break;case"disband":this.onDisbandGroup();break;case"exit":this.onExitGroup();break}},onTransferGroup(){if(this.groupTransferData.userid.length===0){$A.messageError("\u8BF7\u9009\u62E9\u65B0\u7684\u7FA4\u4E3B");return}this.groupTransferLoad++,this.$store.dispatch("call",{url:"dialog/group/transfer",data:{dialog_id:this.dialogId,userid:this.groupTransferData.userid[0]}}).then(({data:t,msg:o})=>{$A.messageSuccess(o),this.$store.dispatch("saveDialog",t)}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.groupTransferLoad--,this.groupTransferShow=!1})},onDisbandGroup(){$A.modalConfirm({content:`\u4F60\u786E\u5B9A\u8981\u89E3\u6563\u3010${this.dialogData.name}\u3011\u7FA4\u7EC4\u5417\uFF1F`,loading:!0,okText:"\u89E3\u6563",onOk:()=>new Promise((t,o)=>{this.$store.dispatch("call",{url:"dialog/group/disband",data:{dialog_id:this.dialogId}}).then(({msg:e})=>{t(e),this.$store.dispatch("forgetDialog",this.dialogId),this.goForward({name:"manage-messenger"})}).catch(({msg:e})=>{o(e)})})})},onExitGroup(){$A.modalConfirm({content:"\u4F60\u786E\u5B9A\u8981\u9000\u51FA\u7FA4\u7EC4\u5417\uFF1F",loading:!0,onOk:()=>new Promise((t,o)=>{this.$store.dispatch("call",{url:"dialog/group/deluser",data:{dialog_id:this.dialogId}}).then(({msg:e})=>{t(e),this.$store.dispatch("forgetDialog",this.dialogId),this.goForward({name:"manage-messenger"})}).catch(({msg:e})=>{o(e)})})})},onCreateGroup(){this.createGroupLoad++,this.$store.dispatch("call",{url:"dialog/group/add",data:this.createGroupData}).then(({data:t,msg:o})=>{$A.messageSuccess(o),this.createGroupShow=!1,this.createGroupData={},this.$store.dispatch("saveDialog",t),this.$store.dispatch("openDialog",t.id)}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.createGroupLoad--})},onModify(){this.modifyData.userid?(this.modifyLoad++,this.$store.dispatch("call",{url:"users/bot/edit",data:{id:this.modifyData.userid,avatar:this.modifyData.avatar,name:this.modifyData.name,clear_day:this.modifyData.clear_day,webhook_url:this.modifyData.webhook_url},method:"post"}).then(({data:t,msg:o})=>{$A.messageSuccess(o),this.$store.dispatch("saveUserBasic",{userid:this.modifyData.userid,nickname:t.name,userimg:t.avatar}),this.$store.dispatch("saveDialog",{id:this.modifyData.dialog_id,name:t.name}),this.modifyShow=!1,this.modifyData={}}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.modifyLoad--})):(this.modifyLoad++,this.$store.dispatch("call",{url:"dialog/group/edit",data:this.modifyData}).then(({data:t,msg:o})=>{$A.messageSuccess(o),this.$store.dispatch("saveDialog",t),this.modifyShow=!1,this.modifyData={}}).catch(({msg:t})=>{$A.modalError(t)}).finally(t=>{this.modifyLoad--}))},onForward(t){if(t==="open")this.forwardData={dialogids:[],userids:[],msg_id:this.operateItem.id},this.forwardShow=!0;else if(t==="submit"){if($A.arrayLength(this.forwardData.dialogids)===0&&$A.arrayLength(this.forwardData.userids)===0){$A.messageWarning("\u8BF7\u9009\u62E9\u8F6C\u53D1\u5BF9\u8BDD\u6216\u6210\u5458");return}this.forwardLoad=!0,this.$store.dispatch("call",{url:"dialog/msg/forward",data:this.forwardData}).then(({data:o,msg:e})=>{this.forwardShow=!1,this.$store.dispatch("saveDialogMsg",o.msgs),this.$store.dispatch("updateDialogLastMsg",o.msgs),$A.messageSuccess(e)}).catch(({msg:o})=>{$A.modalError(o)}).finally(o=>{this.forwardLoad=!1})}},onScroll(t){this.operateVisible=!1;const{offset:o,tail:e}=this.scrollInfo();this.scrollOffset=o,this.scrollTail=e,this.scrollTail<=10&&(this.msgNew=0),this.scrollAction=t.target.scrollTop,this.scrollDirection=this.scrollTmp<=this.scrollAction?"down":"up",setTimeout(i=>this.scrollTmp=this.scrollAction,0)},onRange(t){if(this.preventMoreLoad)return;const o=this.scrollDirection==="down"?"next_id":"prev_id";for(let e=t.start;e<=t.end;e++){const i=this.allMsgs[e][o];if(i){const a=this.allMsgs[e+(o==="next_id"?1:-1)];a&&a.id!=i&&(this.preventMoreLoad=!0,this.getMsgs({dialog_id:this.dialogId,msg_id:this.msgId,msg_type:this.msgType,[o]:i}).finally(O=>{this.preventMoreLoad=!1}))}}},onBack(){if(!this.beforeBack)return this.handleBack();const t=this.beforeBack();t&&t.then?t.then(()=>{this.handleBack()}):this.handleBack()},handleBack(){const{name:t,params:o}=this.$store.state.routeHistoryLast;t===this.$route.name&&/^\d+$/.test(o.dialogId)?this.goForward({name:this.$route.name}):this.goBack()},onMsgType(t){switch(t){case"project":this.openProject();break;case"task":this.openTask();break;default:this.loadMsg?$A.messageWarning("\u6B63\u5728\u52A0\u8F7D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5..."):this.msgType=t;break}},onMention(t){const o=this.cacheUserBasic.find(({userid:e})=>e==t.userid);o&&this.$refs.input.addMention({denotationChar:"@",id:o.userid,value:o.nickname})},onLongpress({event:t,el:o,msgData:e}){this.operateVisible=this.operateItem.id===e.id,this.operateItem=$A.isJson(e)?e:{},this.operateCopys=[],t.target.nodeName==="IMG"&&this.$Electron?this.operateCopys.push({type:"image",icon:"",label:"\u590D\u5236\u56FE\u7247",value:$A.rightDelete(t.target.currentSrc,"_thumb.jpg")}):t.target.nodeName==="A"&&(t.target.classList.contains("mention")&&t.target.classList.contains("file")&&this.findOperateFile(this.operateItem.id,t.target.href),this.operateCopys.push({type:"link",icon:"",label:"\u590D\u5236\u94FE\u63A5",value:t.target.href})),e.type==="text"&&(t.target.nodeName==="IMG"&&this.operateCopys.push({type:"imagedown",icon:"",label:"\u4E0B\u8F7D\u56FE\u7247",value:$A.rightDelete(t.target.currentSrc,"_thumb.jpg")}),e.msg.text.replace(/<[^>]+>/g,"").length>0&&this.operateCopys.push({type:"text",icon:"",label:this.operateCopys.length>0?"\u590D\u5236\u6587\u672C":"\u590D\u5236",value:""})),this.$nextTick(()=>{const i=o.getBoundingClientRect(),a=this.$el.getBoundingClientRect();this.operateStyles={left:`${t.clientX-a.left}px`,top:`${i.top+this.windowScrollY}px`,height:i.height+"px"},this.operateVisible=!0})},onOperate(t,o=null){this.operateVisible=!1,this.$nextTick(e=>{switch(t){case"reply":this.onReply();break;case"update":this.onUpdate();break;case"copy":this.onCopy(o);break;case"forward":this.onForward("open");break;case"withdraw":this.onWithdraw();break;case"view":this.onViewFile();break;case"down":this.onDownFile();break;case"tag":this.onTag();break;case"newTask":let i=$A.formatMsgBasic(this.operateItem.msg.text);i=i.replace(/<img[^>]*?src=(["'])(.*?)(_thumb\.jpg)*\1[^>]*?>/g,'<img src="$2">'),Tt.Store.set("addTask",{owner:[this.userId],content:i});break;case"todo":this.onTodo();break;case"pos":this.onPositionId(this.operateItem.id);break;case"emoji":o==="more"?vi().then(this.onEmoji):this.onEmoji(o);break}})},onReply(t){const{tail:o}=this.scrollInfo();this.setQuote(this.operateItem.id,t),this.inputFocus(),o<=10&&requestAnimationFrame(this.onToBottom)},onUpdate(){const{type:t}=this.operateItem;if(this.onReply(t==="text"?"update":"reply"),t==="text"){let{text:o}=this.operateItem.msg;o.indexOf("mention")>-1&&(o=o.replace(/<a class="mention file" href="([^'"]*)"([^>]*)>~([^>]*)<\/a>/g,'<span class="mention" data-denotation-char="~" data-id="$1" data-value="$3"><span contenteditable="false"><span class="ql-mention-denotation-char">~</span>$3</span></span>'),o=o.replace(/<span class="mention ([^'"]*)" data-id="(\d+)">([@#])([^>]*)<\/span>/g,'<span class="mention" data-denotation-char="$3" data-id="$2" data-value="$4"><span contenteditable="false"><span class="ql-mention-denotation-char">$3</span>$4</span></span>')),o=o.replace(/<img[^>]*>/gi,e=>e.replace(/(width|height)="\d+"\s*/ig,"")),this.$refs.input.setPasteMode(!1),this.msgText=$A.formatMsgBasic(o),this.$nextTick(e=>this.$refs.input.setPasteMode(!0))}},onCopy(t){if(!$A.isJson(t))return;const{type:o,value:e}=t;switch(o){case"image":this.$Electron&&this.getBase64Image(e).then(a=>{this.$Electron.sendMessage("copyBase64Image",{base64:a})});break;case"imagedown":this.$store.dispatch("downUrl",{url:e,token:!1});break;case"filepos":this.windowSmall&&this.$store.dispatch("openDialog",0),this.goForward({name:"manage-file",params:e});break;case"link":this.$copyText(e).then(a=>$A.messageSuccess("\u590D\u5236\u6210\u529F")).catch(a=>$A.messageError("\u590D\u5236\u5931\u8D25"));break;case"text":const i=$A(this.$refs.scroller.$el).find(`[data-id="${this.operateItem.id}"]`).find(".dialog-content");if(i.length>0){const a=i[0].innerText.replace(/\n\n/g,`
|
|
`).replace(/(^\s*)|(\s*$)/g,"");this.$copyText(a).then(O=>$A.messageSuccess("\u590D\u5236\u6210\u529F")).catch(O=>$A.messageError("\u590D\u5236\u5931\u8D25"))}else $A.messageWarning("\u4E0D\u53EF\u590D\u5236\u7684\u5185\u5BB9");break}},onWithdraw(){$A.modalConfirm({content:"\u786E\u5B9A\u64A4\u56DE\u6B64\u4FE1\u606F\u5417\uFF1F",okText:"\u64A4\u56DE",loading:!0,onOk:()=>new Promise((t,o)=>{this.$store.dispatch("call",{url:"dialog/msg/withdraw",data:{msg_id:this.operateItem.id}}).then(()=>{t("\u6D88\u606F\u5DF2\u64A4\u56DE"),this.$store.dispatch("forgetDialogMsg",this.operateItem.id)}).catch(({msg:e})=>{o(e)})})})},onViewReply(t){this.operateVisible||this.onPositionId(t.reply_id,t.msg_id)},onViewText({target:t}){if(!this.operateVisible)switch(t.nodeName){case"IMG":t.classList.contains("browse")?this.onViewPicture(t.currentSrc):this.$store.dispatch("previewImage",{index:0,list:$A.getTextImagesInfo(t.outerHTML)});break;case"SPAN":t.classList.contains("mention")&&t.classList.contains("task")&&this.$store.dispatch("openTask",$A.runNum(t.getAttribute("data-id")));break}},onViewFile(t){if(this.operateVisible)return;$A.isJson(t)||(t=this.operateItem);const{msg:o}=t;if(["jpg","jpeg","gif","png"].includes(o.ext)){this.onViewPicture(o.path);return}const e=`/single/file/msg/${t.id}`;this.$Electron?this.$Electron.sendMessage("windowRouter",{name:`file-msg-${t.id}`,path:e,userAgent:"/hideenOfficeTitle/",force:!1,config:{title:`${o.name} (${$A.bytesToSize(o.size)})`,titleFixed:!0,parent:null,width:Math.min(window.screen.availWidth,1440),height:Math.min(window.screen.availHeight,900)},webPreferences:{nodeIntegrationInSubFrames:o.ext==="drawio"}}):this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:`${o.name} (${$A.bytesToSize(o.size)})`,url:"web.js",params:{titleFixed:!0,allowAccess:!0,url:$A.rightDelete(window.location.href,window.location.hash)+`#${e}`}}):window.open($A.apiUrl(`..${e}`))},onViewPicture(t){const o=this.allMsgs.filter(a=>a.type==="file"?["jpg","jpeg","gif","png"].includes(a.msg.ext):a.type==="text"?a.msg.text.match(/<img\s+class="browse"[^>]*?>/):!1),e=[];o.some(({type:a,msg:O})=>{a==="file"?e.push({src:O.path,width:O.width,height:O.height}):a==="text"&&e.push(...$A.getTextImagesInfo(O.text))});const i=e.findIndex(({src:a})=>a===t);i>-1?this.$store.dispatch("previewImage",{index:i,list:e}):this.$store.dispatch("previewImage",t)},onDownFile(t){this.operateVisible||($A.isJson(t)||(t=this.operateItem),$A.modalConfirm({title:"\u4E0B\u8F7D\u6587\u4EF6",content:`${t.msg.name} (${$A.bytesToSize(t.msg.size)})`,okText:"\u7ACB\u5373\u4E0B\u8F7D",onOk:()=>{this.$store.dispatch("downUrl",$A.apiUrl(`dialog/msg/download?msg_id=${t.id}`))}}))},onReplyList(t){this.operateVisible||(this.replyListId=t.msg_id,this.replyListShow=!0)},onError(t){if(t.error!==!0)return;const{type:o,content:e,msg:i}=t.errorData,a={icon:"error",title:"\u53D1\u9001\u5931\u8D25",content:e,cancelText:"\u53D6\u6D88\u53D1\u9001",onCancel:O=>{this.tempMsgs=this.tempMsgs.filter(({id:S})=>S!=t.id)}};if(o==="text")a.okText="\u518D\u6B21\u7F16\u8F91",a.onOk=()=>{this.tempMsgs=this.tempMsgs.filter(({id:O})=>O!=t.id),this.msgText=i,this.inputFocus()};else if(o==="record")a.okText="\u91CD\u65B0\u53D1\u9001",a.onOk=()=>{this.tempMsgs=this.tempMsgs.filter(({id:O})=>O!=t.id),this.sendRecord(i)};else return;$A.modalConfirm(a)},onEmoji(t){$A.isJson(t)||(t={msg_id:this.operateItem.id,symbol:t});const o=this.cacheEmojis.filter(e=>e!==t.symbol);o.unshift(t.symbol),$A.IDBSave("cacheEmojis",this.$store.state.cacheEmojis=o.slice(0,3)),this.$store.dispatch("setLoad",{key:`msg-${t.msg_id}`,delay:600}),this.$store.dispatch("call",{url:"dialog/msg/emoji",data:t}).then(({data:e})=>{this.dialogMsgs.findIndex(a=>a.id==e.id)>-1?this.$store.dispatch("saveDialogMsg",e):this.todoViewData.id===e.id&&(this.todoViewData=Object.assign(this.todoViewData,e))}).catch(({msg:e})=>{$A.messageError(e)}).finally(e=>{this.$store.dispatch("cancelLoad",`msg-${t.msg_id}`)})},onShowEmojiUser(t){this.operateVisible||(this.respondData=t,this.respondShow=!0)},onTag(){if(this.operateVisible)return;const t={msg_id:this.operateItem.id};this.$store.dispatch("setLoad",{key:`msg-${t.msg_id}`,delay:600}),this.$store.dispatch("call",{url:"dialog/msg/tag",data:t}).then(({data:o})=>{this.tagOrTodoSuccess(o)}).catch(({msg:o})=>{$A.messageError(o)}).finally(o=>{this.$store.dispatch("cancelLoad",`msg-${t.msg_id}`)})},onTodo(t){var o;if(!this.operateVisible)if(t==="submit"){const e=$A.cloneJSON(this.todoSettingData);if(e.type==="my")e.type="user",e.userids=[e.my_id];else if(e.type==="you")e.type="user",e.userids=[e.you_id];else if(e.type==="user"&&$A.arrayLength(e.userids)===0){$A.messageWarning("\u9009\u62E9\u6307\u5B9A\u6210\u5458");return}this.todoSettingLoad++,this.onTodoSubmit(e).then(i=>{$A.messageSuccess(i),this.todoSettingShow=!1}).catch($A.messageError).finally(i=>{this.todoSettingLoad--})}else{const e=(o=this.dialogData.dialog_user)==null?void 0:o.userid;this.todoSettingData={type:"all",userids:[],msg_id:this.operateItem.id,my_id:this.userId,you_id:e!=this.userId&&!this.dialogData.bot?e:0},this.operateItem.todo?$A.modalConfirm({content:"\u4F60\u786E\u5B9A\u53D6\u6D88\u5F85\u529E\u5417\uFF1F",cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",loading:!0,onOk:()=>this.onTodoSubmit(this.todoSettingData)}):this.todoSettingShow=!0}},onTodoSubmit(t){return new Promise((o,e)=>{this.$store.dispatch("setLoad",{key:`msg-${t.msg_id}`,delay:600}),this.$store.dispatch("call",{url:"dialog/msg/todo",data:t}).then(({data:i,msg:a})=>{o(a),this.tagOrTodoSuccess(i),this.onActive()}).catch(({msg:i})=>{e(i)}).finally(i=>{this.$store.dispatch("cancelLoad",`msg-${t.msg_id}`)})})},tagOrTodoSuccess(t){this.$store.dispatch("saveDialogMsg",t.update),t.add&&(this.$store.dispatch("saveDialogMsg",t.add),this.$store.dispatch("updateDialogLastMsg",t.add))},onSearchSwitch(t){if(this.searchResult.length!==0){if(this.searchLocation===1&&this.searchResult.length===1){this.onPositionId(this.searchResult[0]);return}t==="prev"?this.searchLocation<=1?this.searchLocation=this.searchResult.length:this.searchLocation--:this.searchLocation>=this.searchResult.length?this.searchLocation=1:this.searchLocation++}},onSearchKeyup(t){(t===null||t.keyCode===27)&&(this.searchShow=!1,this.searchKey="",this.searchResult=[])},onPositionMark(){if(this.positionLoad>0)return;this.positionLoad++;const{msg_id:t}=this.positionMsg;this.$store.dispatch("dialogMsgMark",{dialog_id:this.dialogId,type:"read",after_msg_id:t}).then(o=>{this.positionLoad++,this.onPositionId(t).finally(e=>{this.positionLoad--})}).catch(({msg:o})=>{$A.modalError(o)}).finally(o=>{this.positionLoad--})},findOperateFile(t,o){const e=this.fileLinks.find(i=>i.link===o);if(e){this.addFileMenu(t,e);return}this.$store.dispatch("searchFiles",{link:o}).then(({data:i})=>{if(i.length===1){const a={link:o,id:i[0].id,pid:i[0].pid};this.fileLinks.push(a),this.addFileMenu(t,a)}}).catch(i=>{})},addFileMenu(t,o){if(this.operateItem.id!=t||this.operateCopys.findIndex(i=>i.type==="filepos")!==-1)return;const e=Math.max(0,this.operateCopys.findIndex(i=>i.type==="link")-1);this.operateCopys.splice(e,0,{type:"filepos",icon:"",label:"\u663E\u793A\u6587\u4EF6",value:{folderId:o.pid,fileId:null,shakeId:o.id}})},getBase64Image(t){return new Promise(o=>{let e=document.createElement("CANVAS"),i=e.getContext("2d"),a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{e.height=a.height,e.width=a.width,i.drawImage(a,0,0);let O="png";$A.rightExists(t,"jpg")||$A.rightExists(t,"jpeg")?O="jpeg":$A.rightExists(t,"git")&&(O="git"),o(e.toDataURL(`image/${O}`)),e=null},a.src=t})},onViewAvatar(t){let o=null;t.target.tagName==="IMG"?o=t.target.src:o=$A(t.target).find("img").attr("src"),o&&this.$store.dispatch("previewImage",o)}}},Bt={};var _i=pt(bi,gi,yi,!1,wi,null,null,null);function wi(t){for(let o in Bt)this[o]=Bt[o]}var xi=function(){return _i.exports}();export{pi as C,xi as D};
|