/* jQuery filedrop v0.1.0, copyright Weixi Yen - modified by Bergware for jQuery v3.6 */ !function(n){var r,s,f={},t={url:"",refresh:1e3,paramname:"userfile",maxfiles:25,maxfilesize:1024,data:{},drop:e,dragEnter:e,dragOver:e,dragLeave:e,docEnter:e,docOver:e,docLeave:e,beforeEach:e,afterAll:e,rename:e,error:function(e,r,t){alert(e)},uploadStarted:e,uploadFinished:e,progressUpdated:e,speedUpdated:e},a=["BrowserNotSupported","TooManyFiles","FileTooLarge"],l=!1,c=0;function o(e){return f.drop(e),null==(s=e.dataTransfer.files)?(f.error(a[0]),!1):(c=s.length,e.preventDefault(),function(){if(l=!1,!s)return f.error(a[0]),!1;var d=0,u=0;if(c>f.maxfiles)return f.error(a[1]),!1;for(var e=0;et){f.error(a[2],s[e],e),u++;continue}r.onloadend=n,r.readAsDataURL(s[e])}else u++}catch(e){return f.error(a[0]),!1}}function n(e){null==e.target.index&&(e.target.index=function(e){for(var r=0;r=f.refresh&&(t=(e.loaded-this.startData)/t,f.speedUpdated(this.index,this.file,t),this.startData=e.loaded,this.currentStart=r)))}function i(e){clearTimeout(r),e.preventDefault(),f.dragEnter(e)}function d(e){clearTimeout(r),e.preventDefault(),f.docOver(e),f.dragOver(e)}function u(e){clearTimeout(r),f.dragLeave(e),e.stopPropagation()}function v(e){return e.preventDefault(),f.docLeave(e),!1}function m(e){return clearTimeout(r),e.preventDefault(),f.docEnter(e),!1}function h(e){return clearTimeout(r),e.preventDefault(),f.docOver(e),!1}function T(e){r=setTimeout(function(){f.docLeave(e)},200)}function e(){}n.fn.filedrop=function(e){f=n.extend({},t,e),this.on("drop",o).on("dragenter",i).on("dragover",d).on("dragleave",u),n(document).on("drop",v).on("dragenter",m).on("dragover",h).on("dragleave",T)}}(jQuery);