"use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[168],{22168:function(e,n,t){t.r(n),t.d(n,{default:function(){return D}});var r=function(){var e=this,n=e._self._c;return n("div",{ref:"container",staticClass:"mc-drop-zone-container",on:{dragenter:e.$onDragEnter,dragover:e.debouncedDragOver,dragleave:e.$onDragLeave}},[e._t("default"),e.canDrop?n("div",{staticClass:"mc-drop-zone-overlay"},[e._t("mc-drop-zone-place-holder",(function(){return[n("span",{staticClass:"mc-drop-zone-place-holder"},[e._v(e._s(e.$t("editor.dropFilesHere")))])]}))],2):e._e()],2)},o=[],a=t(37761),i=t.n(a),s={name:"DropZone",props:{onDragEnter:{type:Function},onDragOver:{type:Function},onDrop:{type:Function},onLeaveWindow:{type:Function},filesOnly:{type:Boolean,default:!1}},data:function(){return{canDrop:!1,isDraggingLeave:!0,lastEnterElement:null}},watch:{canDrop:{handler:function(e){!e&&this.debouncedCanDrop(),e&&this.$onDragEnter()}}},created:function(){var e=this;this.debouncedDragOver=i().debounce(this.$onDragOver,16),this.debouncedCanDrop=i().debounce(this.$canDrop,100),this.$once("hook:beforeDestroy",(function(){e.debouncedDragOver.cancel(),e.debouncedCanDrop.cancel()}))},mounted:function(){var e=this;window.addEventListener("dragenter",this.$setCanDrop),window.addEventListener("dragover",this.$setCanDrop),window.addEventListener("dragleave",this.$unsetCanDrop),window.addEventListener("mouseout",this.$unsetCanDrop),window.addEventListener("drop",this.$unsetCanDrop),this.$once("hook:beforeDestroy",(function(){window.removeEventListener("dragenter",e.$setCanDrop),window.removeEventListener("dragover",e.$setCanDrop),window.removeEventListener("dragleave",e.$unsetCanDrop),window.removeEventListener("drop",e.$unsetCanDrop),window.removeEventListener("mouseout",e.$unsetCanDrop)}))},methods:{$canDrop:function(){this.onLeaveWindow&&this.onLeaveWindow()},$onDragEnter:function(){if(this.onDragEnter&&this.canDrop){var e=this.$refs.container.getBoundingClientRect();return this.onDragEnter(e)}},$onDragOver:function(){if(this.onDragOver)return this.onDragOver()},$onDragLeave:function(){this.onDragLeave&&this.onDragLeave()},$setCanDrop:function(e){this.lastEnterElement=e.target,e.preventDefault(),this.filesOnly&&!e.dataTransfer.types.includes("Files")||(this.canDrop=!0)},$unsetCanDrop:function(e){e.preventDefault(),this.canDrop&&e.target===this.lastEnterElement&&(this.canDrop=!1)}}},d=s,c=t(93483),u=(0,c.Z)(d,r,o,!1,null,"49f00b24",null),p=u.exports,D=p}}]);