/*! dropzone v5.5.0 | Copyright (c) 2012 Matias Meno */"use strict";function_possibleConstructorReturn(a,b){if(!a)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeofb&&"function"!=typeofb?a:b}function_inherits(a,b){if("function"!=typeofb&&null!==b)thrownewTypeError("Super expression must either be null or a function, not "+typeofb);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function_classCallCheck(a,b){if(!(ainstanceofb))thrownewTypeError("Cannot call a class as a function")}function__guard__(a,b){returnvoid0!==a&&null!==a?b(a):void0}function__guardMethod__(a,b,c){returnvoid0!==a&&null!==a&&"function"==typeofa[b]?c(a,b):void0}var_createClass=function(){functiona(a,b){for(varc=0;c<b.length;c++){vard=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"ind&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}returnfunction(b,c,d){returnc&&a(b.prototype,c),d&&a(b,d),b}}(),Emitter=function(){functiona(){_classCallCheck(this,a)}return_createClass(a,[{key:"on",value:function(a,b){returnthis._callbacks=this._callbacks||{},this._callbacks[a]||(this._callbacks[a]=[]),this._callbacks[a].push(b),this}},{key:"emit",value:function(a){this._callbacks=this._callbacks||{};varb=this._callbacks[a];if(b){for(varc=arguments.length,d=Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];for(varf=b,g=0,f=f;;){varh;if(g>=f.length)break;h=f[g++];h.apply(this,d)}}returnthis}},{key:"off",value:function(a,b){if(!this._callbacks||0===arguments.length)returnthis._callbacks={},this;varc=this._callbacks[a];if(!c)returnthis;if(1===arguments.length)returndeletethis._callbacks[a],this;for(vard=0;d<c.length;d++){if(c[d]===b){c.splice(d,1);break}}returnthis}}]),a}(),Dropzone=function(a){functionb(a,c){_classCallCheck(this,b);vard=_possibleConstructorReturn(this,(b.__proto__||Object.getPrototypeOf(b)).call(this)),e=void0,f=void0;if(d.element=a,d.version=b.version,d.defaultOptions.previewTemplate=d.defaultOptions.previewTemplate.replace(/\n*/g,""),d.clickableElements=[],d.listeners=[],d.files=[],"string"==typeofd.element&&(d.element=document.querySelector(d.element)),!d.element||null==d.element.nodeType)thrownewError("Invalid dropzone element.");if(d.element.dropzone)thrownewError("Dropzone already attached.");b.instances.push(d),d.element.dropzone=d;varg=null!=(f=b.optionsForElement(d.element))?f:{};if(d.options=b.extend({},d.defaultOptions,g,null!=c?c:{}),d.options.forceFallback||!b.isBrowserSupported()){varh;returnh=d.options.fallback.call(d),_possibleConstructorReturn(d,h)}if(null==d.options.url&&(d.options.url=d.element.getAttribute("action")),!d.options.url)thrownewError("No URL provided.");if(d.options.acceptedFiles&&d.options.acceptedMimeTypes)thrownewError("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(d.options.uploadMultiple&&d.options.chunking)thrownewError("You cannot set both: uploadMultiple and chunking.");returnd.options.acceptedMimeTypes&&(d.options.acceptedFiles=d.options.acceptedMimeTypes,deleted.options.acceptedMimeTypes),null!=d.options.renameFilename&&(d.options.renameFile=function(a){returnd.options.renameFilename.call(d,a.name,a)}),d.options.method=d.options.method.toUpperCase(),(e=d.getExistingFallback())&&e.parentNode&&e.parentNode.removeChild(e),!1!==d.options.previewsContainer&&(d.options.previewsContainer?d.previewsContainer=b.getElement(d.options.previewsContainer,"previewsContainer"):d.previewsContainer=d.element),d.options.clickable&&(!0===d.options.clickable?d.clickableElements=[d.element]:d.clickableElements=b.getElements(d.options.clickable,"clickable")),d.init(),d}return_inherits(b,a),_createClass(b,null,[{key:"initClass",value:function(){this.prototype.Emitter=Emitter,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","erro
++e===a.length&&b(d)})}(f)}},{key:"_addFormElementData",value:function(a){if("FORM"===this.element.tagName)for(varb=this.element.querySelectorAll("input, textarea, select, button"),c=0,b=b;;){vard;if(c>=b.length)break;d=b[c++];vare=d,f=e.getAttribute("name"),g=e.getAttribute("type");if(g&&(g=g.toLowerCase()),void0!==f&&null!==f)if("SELECT"===e.tagName&&e.hasAttribute("multiple"))for(varh=e.options,i=0,h=h;;){varj;if(i>=h.length)break;j=h[i++];vark=j;k.selected&&a.append(f,k.value)}else(!g||"checkbox"!==g&&"radio"!==g||e.checked)&&a.append(f,e.value)}}},{key:"_updateFilesUploadProgress",value:function(a,b,c){vard=void0;if(void0!==c){if(d=100*c.loaded/c.total,a[0].upload.chunked){vare=a[0],f=this._getChunk(e,b);f.progress=d,f.total=c.total,f.bytesSent=c.loaded;e.upload.progress=0,e.upload.total=0,e.upload.bytesSent=0;for(varg=0;g<e.upload.totalChunkCount;g++)void0!==e.upload.chunks[g]&&void0!==e.upload.chunks[g].progress&&(e.upload.progress+=e.upload.chunks[g].progress,e.upload.total+=e.upload.chunks[g].total,e.upload.bytesSent+=e.upload.chunks[g].bytesSent);e.upload.progress=e.upload.progress/e.upload.totalChunkCount}elsefor(varh=a,i=0,h=h;;){varj;if(i>=h.length)break;j=h[i++];vark=j;k.upload.progress=d,k.upload.total=c.total,k.upload.bytesSent=c.loaded}for(varl=a,m=0,l=l;;){varn;if(m>=l.length)break;n=l[m++];varo=n;this.emit("uploadprogress",o,o.upload.progress,o.upload.bytesSent)}}else{varp=!0;d=100;for(varq=a,r=0,q=q;;){vars;if(r>=q.length)break;s=q[r++];vart=s;100===t.upload.progress&&t.upload.bytesSent===t.upload.total||(p=!1),t.upload.progress=d,t.upload.bytesSent=t.upload.total}if(p)return;for(varu=a,v=0,u=u;;){varw;if(v>=u.length)break;w=u[v++];varx=w;this.emit("uploadprogress",x,d,x.upload.bytesSent)}}}},{key:"_finishedUploading",value:function(a,c,d){vare=void0;if(a[0].status!==b.CANCELED&&4===c.readyState){if("arraybuffer"!==c.responseType&&"blob"!==c.responseType&&(e=c.responseText,c.getResponseHeader("content-type")&&~c.getResponseHeader("content-type").indexOf("application/json")))try{e=JSON.parse(e)}catch(a){d=a,e="Invalid JSON response from server."}this._updateFilesUploadProgress(a),200<=c.status&&c.status<300?a[0].upload.chunked?a[0].upload.finishedChunkUpload(this._getChunk(a[0],c)):this._finished(a,e,d):this._handleUploadError(a,c,e)}}},{key:"_handleUploadError",value:function(a,c,d){if(a[0].status!==b.CANCELED){if(a[0].upload.chunked&&this.options.retryChunks){vare=this._getChunk(a[0],c);if(e.retries++<this.options.retryChunksLimit)returnvoidthis._uploadData(a,[e.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}for(varf=a,g=0,f=f;;){if(g>=f.length)break;f[g++];this._errorProcessing(a,d||this.options.dictResponseError.replace("{{statusCode}}",c.status),c)}}}},{key:"submitRequest",value:function(a,b,c){a.send(b)}},{key:"_finished",value:function(a,c,d){for(vare=a,f=0,e=e;;){varg;if(f>=e.length)break;g=e[f++];varh=g;h.status=b.SUCCESS,this.emit("success",h,c,d),this.emit("complete",h)}if(this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue)returnthis.processQueue()}},{key:"_errorProcessing",value:function(a,c,d){for(vare=a,f=0,e=e;;){varg;if(f>=e.length)break;g=e[f++];varh=g;h.status=b.ERROR,this.emit("error",h,c,d),this.emit("complete",h)}if(this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue)returnthis.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){varb=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)})}}]),b}(Emitter);Dropzone.initClass(),Dropzone.version="5.5.0",Dropzone.options={},Dropzone.optionsForElement=function(a){returna.getAttribute("id")?Dropzone.options[camelize(a.getAttribute("id"))]:void0},Dropzone.instances=[],Dropzone.forElement=function(a){if("string"==typeofa&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void0))thrownewError("NoDropzonefoundforgivenelement.Thisisprobabl