ninesurvey/src/ninesurvey-1.0/public/build/3.4bbc28da.js

1 line
47 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},ZsRK:function(e,t,n){},nmqf:function(e,t,n){"use strict";(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,n){return!n||"object"!==t(n)&&"function"!=typeof n?r(e):n}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}var u=function(){function e(){a(this,e)}return s(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=!0,a=!1,l=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0)s.value.apply(this,i)}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1);break}return this}}]),e}(),c=function(){function e(t,o){var l,s,u;if(a(this,e),(l=n(this,i(e).call(this))).element=t,l.version=e.version,l.defaultOptions.previewTemplate=l.defaultOptions.previewTemplate.replace(/\n*/g,""),l.clickableElements=[],l.listeners=[],l.files=[],"string"==typeof l.element&&(l.element=document.querySelector(l.element)),!l.element||null==l.element.nodeType)throw new Error("Invalid dropzone element.");if(l.element.dropzone)throw new Error("Dropzone already attached.");e.instances.push(r(l)),l.element.dropzone=r(l);var c=null!=(u=e.optionsForElement(l.element))?u:{};if(l.options=e.extend({},l.defaultOptions,c,null!=o?o:{}),l.options.forceFallback||!e.isBrowserSupported())return n(l,l.options.fallback.call(r(l)));if(null==l.options.url&&(l.options.url=l.element.getAttribute("action")),!l.options.url)throw new Error("No URL provided.");if(l.options.acceptedFiles&&l.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(l.options.uploadMultiple&&l.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return l.options.acceptedMimeTypes&&(l.options.acceptedFiles=l.options.acceptedMimeTypes,delete l.options.acceptedMimeTypes),null!=l.options.renameFilename&&(l.options.renameFile=function(e){return l.options.renameFilename.call(r(l),e.name,e)}),l.options.method=l.options.method.toUpperCase(),(s=l.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),!1!==l.options.previewsContainer&&(l.options.previewsContainer?l.previewsContainer=e.getElement(l.options.previewsContainer,"previewsContainer"):l.previewsContainer=l.element),l.options.clickable&&(!0===l.options.clickable?l.clickableElements=[l.element]:l.clickableElements=e.getElements(l.options.clickable,"clickable")),l.init(),l}return o(e,u),s(e,null,[{key:"initClass",value:function(){this.prototype.Emitter=u,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var t;this.element.className="".concat(this.element.className," dz-browser-not-supported");var n=!0,i=!1,r=void 0;try{for(var o,a=this.element.getElementsByTagName("div")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;if(/(^| )dz-message($| )/.test(l.className)){(t=l).className="dz-message";break}}}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}t||(t=e.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t));var s=t.getElementsByTagName("span")[0];return s&&(null!=s.textContent?s.textContent=this.options.dictFallbackMessage:null!=s.innerText&&(s.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*o:null==n&&(n=t/o);var a=(t=Math.min(t,r.srcWidth))/(n=Math.min(n,r.srcHeight));if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a<o?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==i)throw new Error("Unknown resizeMethod '".concat(i,"'"));a<o?n=t/o:t=n*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=n,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Check</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Error</title>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:function(){},dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:function(){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var n=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){t.previewElement=e.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var i=!0,r=!1,o=void 0;try{for(var a,l=t.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;s.textContent=t.name}}catch(i){r=!0,o=i}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}var u=!0,c=!1,d=void 0;try{for(var h,p=t.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)(s=h.value).innerHTML=this.filesize(t.size)}catch(i){c=!0,d=i}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}this.options.addRemoveLinks&&(t._removeLink=e.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),t.previewElement.appendChild(t._removeLink));var f=function(i){return i.preventDefault(),i.stopPropagation(),t.status===e.UPLOADING?e.confirm(n.options.dictCancelUploadConfirmation,(function(){return n.removeFile(t)})):n.options.dictRemoveFileConfirmation?e.confirm(n.options.dictRemoveFileConfirmation,(function(){return n.removeFile(t)})):n.removeFile(t)},v=!0,m=!1,y=void 0;try{for(var g,b=t.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator]();!(v=(g=b.next()).done);v=!0)g.value.addEventListener("click",f)}catch(i){m=!0,y=i}finally{try{v||null==b.return||b.return()}finally{if(m)throw y}}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;l.alt=e.name,l.src=t}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return setTimeout((function(){return e.previewElement.classList.add("dz-image-preview")}),1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)o.value.textContent=t}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t){if(e.previewElement){var n=!0,i=!1,r=void 0;try{for(var o,a=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;"PROGRESS"===l.nodeName?l.value=t:l.style.width="".concat(t,"%")}}catch(e){i=!0,r=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=0,o=n;r<o.length;r++){var a=o[r];for(var l in a){var s=a[l];e[l]=s}}return e}}]),s(e,[{key:"getAcceptedFiles",value:function(){return this.files.filter((function(e){return e.accepted})).map((function(e){return e}))}},{key:"getRejectedFiles",value:function(){return this.files.filter((function(e){return!e.accepted})).map((function(e){return e}))}},{key:"getFilesWithStatus",value:function(e){return this.files.filter((function(t){return t.status===e})).map((function(e){return e}))}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(e.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(e.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(e.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter((function(t){return t.status===e.UPLOADING||t.status===e.QUEUED})).map((function(e){return e}))}},{key:"init",value:function(){var t=this;"form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(e.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length&&function n(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null===t.options.maxFiles||1<t.options.maxFiles)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!==t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!==t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",e.getElement(t.options.hiddenInputContainer,"hiddenInputContainer").appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",(function(){var e=t.hiddenFileInput.files;if(e.length){var i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;t.addFile(s)}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}}return t.emit("addedfiles",e),n()}))}(),this.URL=null!==window.URL?window.URL:window.webkitURL;var n=!0,i=!1,r=void 0;try{for(var o,a=this.events[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;this.on(l,this.options[l])}}catch(n){i=!0,r=n}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}function s(e){return function(e){if(e.dataTransfer.types)for(var t=0;t<e.dataTransfer.types.length;t++)if("Files"===e.dataTransfer.types[t])return!0;return!1}(e)&&(e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1)}return this.on("uploadprogress",(function(){return t.updateTotalUploadProgress()})),this.on("removedfile",(function(){return t.updateTotalUploadProgress()})),this.on("canceled",(function(e){return t.emit("complete",e)})),this.on("complete",(function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout((function(){return t.emit("queuecomplete")}),0)})),this.listeners=[{element:this.element,events:{dragstart:function(e){return t.emit("dragstart",e)},dragenter:function(e){return s(e),t.emit("dragenter",e)},dragover:function(e){var n;try{n=e.dataTransfer.effectAllowed}catch(e){}return e.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",s(e),t.emit("dragover",e)},dragleave:function(e){return t.emit("dragleave",e)},drop:function(e){return s(e),t.drop(e)},dragend:function(e){return t.emit("dragend",e)}}}],this.clickableElements.forEach((function(n){return t.listeners.push({element:n,events:{click:function(i){return n===t.element&&i.target!==t.element&&!e.elementInside(i.target,t.element.querySelector(".dz-message"))||t.hiddenFileInput.click(),!0}}})})),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),null!=this.hiddenFileInput&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,e.instances.splice(e.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e,t=0,n=0;if(this.getActiveFiles().length){var i=!0,r=!1,o=void 0;try{for(var a,l=this.getActiveFiles()[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;t+=s.upload.bytesSent,n+=s.upload.total}}catch(e){r=!0,o=e}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var t,n;if(t=this.getExistingFallback())return t;var i='<div class="dz-fallback">';this.options.dictFallbackText&&(i+="<p>".concat(this.options.dictFallbackText,"</p>")),i+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var r=e.createElement(i);return"FORM"!==this.element.tagName?(n=e.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(r):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=n?n:r}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;if(/(^| )fallback($| )/.test(a.className))return a}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}},t=0,n=["div","form"];t<n.length;t++){var i,r=n[t];if(i=e(this.element.getElementsByTagName(r)))return i}}},{key:"setupEventListeners",value:function(){return this.listeners.map((function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.addEventListener(n,i,!1))}return t}()}))}},{key:"removeEventListeners",value:function(){return this.listeners.map((function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.removeEventListener(n,i,!1))}return t}()}))}},{key:"disable",value:function(){var e=this;return this.clickableElements.forEach((function(e){return e.classList.remove("dz-clickable")})),this.removeEventListeners(),this.disabled=!0,this.files.map((function(t){return e.cancelUpload(t)}))}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach((function(e){return e.classList.add("dz-clickable")})),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(0<e){for(var i=["tb","gb","mb","kb","b"],r=0;r<i.length;r++){var o=i[r];if(Math.pow(this.options.filesizeBase,4-r)/10<=e){t=e/Math.pow(this.options.filesizeBase,4-r),n=o;break}}t=Math.round(10*t)/10}return"<strong>".concat(t,"</strong> ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}}},{key:"paste",value:function(e){if(null!=function(e,t){return null!=e?t(e):void 0}(null!=e?e.clipboardData:void 0,(function(e){return e.items}))){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.addFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){var n=[],i=!0,r=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s,u=a.value;null!=u.webkitGetAsEntry&&(s=u.webkitGetAsEntry())?s.isFile?n.push(t.addFile(u.getAsFile())):s.isDirectory?n.push(t._addFilesFromDirectory(s,s.name)):n.push(void 0):null==u.getAsFile||null!=u.kind&&"file"!==u.kind?n.push(void 0):n.push(t.addFile(u.getAsFile()))}}catch(n){r=!0,o=n}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}return n}()}},{key:"_addFilesFromDirectory",value:function(e,t){function n(e){return function(e,t,n){return null!=e&&"function"==typeof e[t]?n(e,t):void 0}(console,"log",(function(t){return t.log(e)}))}var i=this,r=e.createReader();return function e(){return r.readEntries((function(n){if(0<n.length){var r=!0,o=!1,a=void 0;try{for(var l,s=n[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;u.isFile?u.file((function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(t,"/").concat(e.name),i.addFile(e)})):u.isDirectory&&i._addFilesFromDirectory(u,"".concat(t,"/").concat(u.name))}}catch(n){o=!0,a=n}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}e()}return null}),n)}()}},{key:"accept",value:function(t,n){this.options.maxFilesize&&t.size>1024*this.options.maxFilesize*1024?n(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):e.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(n(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,n):n(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var n=this;t.upload={uuid:e.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=e.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,(function(e){e?(t.accepted=!1,n._errorProcessing([t],e)):(t.accepted=!0,n.options.autoQueue&&n.enqueueFile(t)),n._updateMaxFilesReachedClass()}))}},{key:"enqueueFiles",value:function(e){var t=!0,n=!1,i=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value;this.enqueueFile(a)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}return null}},{key:"enqueueFile",value:function(t){var n=this;if(t.status!==e.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=e.QUEUED,this.options.autoProcessQueue)return setTimeout((function(){return n.processQueue()}),0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout((function(){return t._processThumbnailQueue()}),0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(function(n){return e.emit("thumbnail",t,n),e._processingThumbnail=!1,e._processThumbnailQueue()}))}}},{key:"removeFile",value:function(t){if(t.status===e.UPLOADING&&this.cancelUpload(t),this.files=d(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(t){null==t&&(t=!1);var n=!0,i=!1,r=void 0;try{for(var o,a=this.files.slice()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;l.status===e.UPLOADING&&!t||this.removeFile(l)}}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return null}},{key:"resizeImage",value:function(t,n,i,r,o){var a=this;return this.createThumbnail(t,n,i,r,!0,(function(n,i){if(null==i)return o(t);var r=a.options.resizeMimeType;null==r&&(r=t.type);var l=i.toDataURL(r,a.options.resizeQuality);return"image/jpeg"!==r&&"image/jpg"!==r||(l=f.restore(t.dataURL,l)),o(e.dataURItoBlob(l))}))}},{key:"createThumbnail",value:function(e,t,n,i,r,o){var a=this,l=new FileReader;l.onload=function(){e.dataURL=l.result,"image/svg+xml"!==e.type?a.createThumbnailFromUrl(e,t,n,i,r,o):null!=o&&o(l.result)},l.readAsDataURL(e)}},{key:"displayExistingFile",value:function(e,t,n,i,r){var o=this,a=!(4<arguments.length&&void 0!==r)||r;this.emit("addedfile",e),this.emit("complete",e),a?(e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,(function(t){o.emit("thumbnail",e,t),n&&n()}),i)):(this.emit("thumbnail",e,t),n&&n())}},{key:"createThumbnailFromUrl",value:function(e,t,n,i,r,o,a){var l=this,s=document.createElement("img");return a&&(s.crossOrigin=a),s.onload=function(){var a=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(a=function(e){return EXIF.getData(s,(function(){return e(EXIF.getTag(this,"Orientation"))}))}),a((function(r){e.width=s.width,e.height=s.height;var a=l.options.resize.call(l,e,t,n,i),u=document.createElement("canvas"),c=u.getContext("2d");switch(u.width=a.trgWidth,u.height=a.trgHeight,4<r&&(u.width=a.trgHeight,u.height=a.trgWidth),r){case 2:c.translate(u.width,0),c.scale(-1,1);break;case 3:c.translate(u.width,u.height),c.rotate(Math.PI);break;case 4:c.translate(0,u.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-u.width);break;case 7:c.rotate(.5*Math.PI),c.translate(u.height,-u.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-u.height,0)}p(c,s,null!=a.srcX?a.srcX:0,null!=a.srcY?a.srcY:0,a.srcWidth,a.srcHeight,null!=a.trgX?a.trgX:0,null!=a.trgY?a.trgY:0,a.trgWidth,a.trgHeight);var d=u.toDataURL("image/png");if(null!=o)return o(d,u)}))},null!=o&&(s.onerror=o),s.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(e<=t)){var i=this.getQueuedFiles();if(0<i.length){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(t){var n=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;l.processing=!0,l.status=e.UPLOADING,this.emit("processing",l)}}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)}},{key:"_getFilesWithXhr",value:function(e){return this.files.filter((function(t){return t.xhr===e})).map((function(e){return e}))}},{key:"cancelUpload",value:function(t){if(t.status===e.UPLOADING){var n=this._getFilesWithXhr(t.xhr),i=!0,r=!1,o=void 0;try{for(var a,l=n[Symbol.iterator]();!(i=(a=l.next()).done);i=!0)a.value.status=e.CANCELED}catch(t){r=!0,o=t}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}void 0!==t.xhr&&t.xhr.abort();var s=!0,u=!1,c=void 0;try{for(var d,h=n[Symbol.iterator]();!(s=(d=h.next()).done);s=!0){var p=d.value;this.emit("canceled",p)}}catch(t){u=!0,c=t}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else t.status!==e.ADDED&&t.status!==e.QUEUED||(t.status=e.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"!=typeof e)return e;for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.apply(this,n)}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(t){var n=this;this._transformFiles(t,(function(i){if(n.options.chunking){var r=i[0];t[0].upload.chunked=n.options.chunking&&(n.options.forceChunking||r.size>n.options.chunkSize),t[0].upload.totalChunkCount=Math.ceil(r.size/n.options.chunkSize)}if(t[0].upload.chunked){var o=t[0],a=i[0];o.upload.chunks=[];var l=function(){for(var i=0;void 0!==o.upload.chunks[i];)i++;if(!(i>=o.upload.totalChunkCount)){var r=i*n.options.chunkSize,l=Math.min(r+n.options.chunkSize,o.size),s={name:n._getParamName(0),data:a.webkitSlice?a.webkitSlice(r,l):a.slice(r,l),filename:o.upload.filename,chunkIndex:i};o.upload.chunks[i]={file:o,index:i,dataBlock:s,status:e.UPLOADING,progress:0,retries:0},n._uploadData(t,[s])}};if(o.upload.finishedChunkUpload=function(i){var r=!0;i.status=e.SUCCESS,i.dataBlock=null,i.xhr=null;for(var a=0;a<o.upload.totalChunkCount;a++){if(void 0===o.upload.chunks[a])return l();o.upload.chunks[a].status!==e.SUCCESS&&(r=!1)}r&&n.options.chunksUploaded(o,(function(){n._finished(t,"",null)}))},n.options.parallelChunkUploads)for(var s=0;s<o.upload.totalChunkCount;s++)l();else l()}else{for(var u=[],c=0;c<t.length;c++)u[c]={name:n._getParamName(c),data:i[c],filename:t[c].upload.filename};n._uploadData(t,u)}}))}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(t,n){var i=this,r=new XMLHttpRequest,o=!0,a=!1,l=void 0;try{for(var s,u=t[Symbol.iterator]();!(o=(s=u.next()).done);o=!0)s.value.xhr=r}catch(n){a=!0,l=n}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}t[0].upload.chunked&&(t[0].upload.chunks[n[0].chunkIndex].xhr=r);var c=this.resolveOption(this.options.method,t),d=this.resolveOption(this.options.url,t);r.open(c,d,!0),r.timeout=this.resolveOption(this.options.timeout,t),r.withCredentials=!!this.options.withCredentials,r.onload=function(e){i._finishedUploading(t,r,e)},r.ontimeout=function(){i._handleUploadError(t,r,"Request timedout after ".concat(i.options.timeout," seconds"))},r.onerror=function(){i._handleUploadError(t,r)},(null!=r.upload?r.upload:r).onprogress=function(e){return i._updateFilesUploadProgress(t,r,e)};var h={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var p in this.options.headers&&e.extend(h,this.options.headers),h){var f=h[p];f&&r.setRequestHeader(p,f)}var v=new FormData;if(this.options.params){var m=this.options.params;for(var y in"function"==typeof m&&(m=m.call(this,t,r,t[0].upload.chunked?this._getChunk(t[0],r):null)),m){var g=m[y];v.append(y,g)}}var b=!0,k=!1,w=void 0;try{for(var F,x=t[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var E=F.value;this.emit("sending",E,r,v)}}catch(n){k=!0,w=n}finally{try{b||null==x.return||x.return()}finally{if(k)throw w}}this.options.uploadMultiple&&this.emit("sendingmultiple",t,r,v),this._addFormElementData(v);for(var C=0;C<n.length;C++){var z=n[C];v.append(z.name,z.data,z.filename)}this.submitRequest(r,v,t)}},{key:"_transformFiles",value:function(e,t){for(var n=this,i=[],r=0,o=function(o){n.options.transformFile.call(n,e[o],(function(n){i[o]=n,++r===e.length&&t(i)}))},a=0;a<e.length;a++)o(a)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName){var t=!0,n=!1,i=void 0;try{for(var r,o=this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var a=r.value,l=a.getAttribute("name"),s=a.getAttribute("type");if(s=s&&s.toLowerCase(),null!=l)if("SELECT"===a.tagName&&a.hasAttribute("multiple")){var u=!0,c=!1,d=void 0;try{for(var h,p=a.options[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var f=h.value;f.selected&&e.append(l,f.value)}}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}}else(!s||"checkbox"!==s&&"radio"!==s||a.checked)&&e.append(l,a.value)}}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){var i;if(void 0!==n){if(i=100*n.loaded/n.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=i,o.total=n.total,o.bytesSent=n.loaded,r.upload.progress=0,r.upload.total=0;for(var a=r.upload.bytesSent=0;a<r.upload.totalChunkCount;a++)void 0!==r.upload.chunks[a]&&void 0!==r.upload.chunks[a].progress&&(r.upload.progress+=r.upload.chunks[a].progress,r.upload.total+=r.upload.chunks[a].total,r.upload.bytesSent+=r.upload.chunks[a].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else{var l=!0,s=!1,u=void 0;try{for(var c,d=e[Symbol.iterator]();!(l=(c=d.next()).done);l=!0){var h=c.value;h.upload.progress=i,h.upload.total=n.total,h.upload.bytesSent=n.loaded}}catch(e){s=!0,u=e}finally{try{l||null==d.return||d.return()}finally{if(s)throw u}}}var p=!0,f=!1,v=void 0;try{for(var m,y=e[Symbol.iterator]();!(p=(m=y.next()).done);p=!0){var g=m.value;this.emit("uploadprogress",g,g.upload.progress,g.upload.bytesSent)}}catch(e){f=!0,v=e}finally{try{p||null==y.return||y.return()}finally{if(f)throw v}}}else{var b=!0,k=!0,w=!(i=100),F=void 0;try{for(var x,E=e[Symbol.iterator]();!(k=(x=E.next()).done);k=!0){var C=x.value;100===C.upload.progress&&C.upload.bytesSent===C.upload.total||(b=!1),C.upload.progress=i,C.upload.bytesSent=C.upload.total}}catch(e){w=!0,F=e}finally{try{k||null==E.return||E.return()}finally{if(w)throw F}}if(b)return;var z=!0,S=!1,T=void 0;try{for(var L,_=e[Symbol.iterator]();!(z=(L=_.next()).done);z=!0){var A=L.value;this.emit("uploadprogress",A,i,A.upload.bytesSent)}}catch(e){S=!0,T=e}finally{try{z||null==_.return||_.return()}finally{if(S)throw T}}}}},{key:"_finishedUploading",value:function(t,n,i){var r;if(t[0].status!==e.CANCELED&&4===n.readyState){if("arraybuffer"!==n.responseType&&"blob"!==n.responseType&&(r=n.responseText,n.getResponseHeader("content-type")&&~n.getResponseHeader("content-type").indexOf("application/json")))try{r=JSON.parse(r)}catch(t){i=t,r="Invalid JSON response from server."}this._updateFilesUploadProgress(t),200<=n.status&&n.status<300?t[0].upload.chunked?t[0].upload.finishedChunkUpload(this._getChunk(t[0],n)):this._finished(t,r,i):this._handleUploadError(t,n,r)}}},{key:"_handleUploadError",value:function(t,n,i){if(t[0].status!==e.CANCELED){if(t[0].upload.chunked&&this.options.retryChunks){var r=this._getChunk(t[0],n);if(r.retries++<this.options.retryChunksLimit)return void this._uploadData(t,[r.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(t,i||this.options.dictResponseError.replace("{{statusCode}}",n.status),n)}}},{key:"submitRequest",value:function(e,t){e.send(t)}},{key:"_finished",value:function(t,n,i){var r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;u.status=e.SUCCESS,this.emit("success",u,n,i),this.emit("complete",u)}}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}if(this.options.uploadMultiple&&(this.emit("successmultiple",t,n,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(t,n,i){var r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;u.status=e.ERROR,this.emit("error",u,n,i),this.emit("complete",u)}}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}if(this.options.uploadMultiple&&(this.emit("errormultiple",t,n,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}}]),e}();c.initClass(),c.version="5.7.1",c.options={},c.optionsForElement=function(e){return e.getAttribute("id")?c.options[h(e.getAttribute("id"))]:void 0},c.instances=[],c.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},c.autoDiscover=!0,c.discover=function(){var e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){var n=[],i=!0,r=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(i=(a=l.next()).done);i=!0){var s=a.value;/(^| )dropzone($| )/.test(s.className)?n.push(e.push(s)):n.push(void 0)}}catch(n){r=!0,o=n}finally{try{i||null==l.return||l.return()}finally{if(r)throw o}}return n}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){var t=[],n=!0,i=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var l=o.value;!1!==c.optionsForElement(l)?t.push(new c(l)):t.push(void 0)}}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}return t}()},c.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],c.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var t=!0,n=!1,i=void 0;try{for(var r,o=c.blacklistedBrowsers[Symbol.iterator]();!(t=(r=o.next()).done);t=!0)r.value.test(navigator.userAgent)&&(e=!1)}catch(e){n=!0,i=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw i}}}else e=!1;else e=!1;return e},c.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),o=0,a=t.length,l=0<=a;l?o<=a:a<=o;l?o++:o--)r[o]=t.charCodeAt(o);return new Blob([i],{type:n})};var d=function(e,t){return e.filter((function(e){return e!==t})).map((function(e){return e}))},h=function(e){return e.replace(/[\-_](\w)/g,(function(e){return e.charAt(1).toUpperCase()}))};c.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},c.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},c.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return n},c.getElements=function(e,t){var n,i;if(e instanceof Array){i=[];try{var r=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(r=(l=s.next()).done);r=!0)n=l.value,i.push(this.getElement(n,t))}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}}catch(e){i=null}}else if("string"==typeof e){var u=!0,c=!(i=[]),d=void 0;try{for(var h,p=document.querySelectorAll(e)[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)n=h.value,i.push(n)}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}}else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return i},c.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},c.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");var n=e.type,i=n.replace(/\/.*$/,""),r=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){var u=l.value;if("."===(u=u.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(u.toLowerCase(),e.name.length-u.length))return!0}else if(/\/\*$/.test(u)){if(i===u.replace(/\/.*$/,""))return!0}else if(n===u)return!0}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new c(this,e)}))}),null!==e?e.exports=c:window.Dropzone=c,c.ADDED="added",c.QUEUED="queued",c.ACCEPTED=c.QUEUED,c.UPLOADING="uploading",c.PROCESSING=c.UPLOADING,c.CANCELED="canceled",c.ERROR="error",c.SUCCESS="success";var p=function(e,t,n,i,r,o,a,l,s,u){var c=function(e){e.naturalWidth;var t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;var i=n.getContext("2d");i.drawImage(e,0,0);for(var r=i.getImageData(1,0,1,t).data,o=0,a=t,l=t;o<l;)0===r[4*(l-1)+3]?a=l:o=l,l=a+o>>1;var s=l/t;return 0==s?1:s}(t);return e.drawImage(t,n,i,r,o,a,l,s,u/c)},f=function(){function e(){a(this,e)}return s(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;o=(n=e[u++])>>2,a=(3&n)<<4|(i=e[u++])>>4,l=(15&i)<<2|(r=e[u++])>>6,s=63&r,isNaN(i)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),n=i=r="",o=a=l=s="",u<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(n),r=this.exifManipulation(t,i);return"data:image/jpeg;base64,".concat(this.encode64(r))}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n);return new Uint8Array(i)}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++}return[]}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),r=i.indexOf(255,3),o=i.slice(0,r),a=i.slice(r),l=o;return(l=l.concat(t)).concat(a)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];!(255===e[t]&218===e[t+1]);){if(255===e[t]&216===e[t+1])t+=2;else{var i=t+(256*e[t+2]+e[t+3])+2,r=e.slice(t,i);n.push(r),t=i}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,o=void 0,a="",l=0,s=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(l++))<<2|(r=this.KEY_STR.indexOf(e.charAt(l++)))>>4,n=(15&r)<<4|(o=this.KEY_STR.indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(l++))),s.push(t),64!==o&&s.push(n),64!==a&&s.push(i),t=n=i="",r=o=a="",l<e.length;);return s}}]),e}();f.initClass();c._autoDiscoverFunction=function(){if(c.autoDiscover)return c.discover()},function(e,t){function n(r){if("readystatechange"!==r.type||"complete"===o.readyState)return("load"===r.type?e:o)[s](u+r.type,n,!1),!i&&(i=!0)?t.call(e,r.type||r):void 0}var i=!1,r=!0,o=e.document,a=o.documentElement,l=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",u=o.addEventListener?"":"on";if("complete"!==o.readyState){if(o.createEventObject&&a.doScroll){try{r=!e.frameElement}catch(r){}r&&function e(){try{a.doScroll("left")}catch(t){return void setTimeout(e,50)}return n("poll")}()}o[l](u+"DOMContentLoaded",n,!1),o[l](u+"readystatechange",n,!1),e[l](u+"load",n,!1)}}(window,c._autoDiscoverFunction)}).call(this,n("YuTi")(e))}}]);