{"version":3,"sources":["jsdelivr-header.js","/npm/dropzone@6.3.4/src/extend.ts","/npm/dropzone@6.3.4/src/emitter.ts","/npm/dropzone@6.3.4/src/options.ts","/npm/dropzone@6.3.4/src/dropzone.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,mHCsDA,SAAwB,UAAU,GAChC,IAAI,GAAO,EACW,kBAAX,EAAK,KACd,EAAO,EAAK,SAEd,IAAI,EAAS,EAAK,GAClB,GAAI,eAAe,GACjB,MAAM,IAAI,MAAM,8BAIlB,IAFA,IAAI,EAAY,EAAK,MAAM,GACvB,EAAM,EAAU,OACX,EAAI,EAAG,EAAI,EAAK,IAAK,CAC5B,IAAI,EAAW,EAAU,GACzB,IAAK,IAAI,KAAO,EACd,GAAI,OAAO,UAAU,eAAe,KAAK,EAAU,GAAM,CACvD,IAAI,EAAQ,EAAS,GACrB,GAAI,GAAQ,YAAY,GAAQ,CAC9B,IAAI,EAAO,MAAM,QAAQ,GAAS,GAAK,CAAC,EACxC,EAAO,GAAO,QACZ,EACA,OAAO,UAAU,eAAe,KAAK,EAAQ,KAAS,eAAe,EAAO,IACxE,EAAO,GACP,EACJ,EAEJ,MACE,EAAO,GAAO,CAElB,CAEJ,CACA,OAAO,CACT,CAEA,SAAS,YAAY,GACnB,OAAO,MAAM,QAAQ,IAAiC,mBAAzB,CAAC,EAAE,SAAS,KAAK,EAChD,CAEA,SAAS,eAAe,GACtB,OAAQ,GAAsB,iBAAP,GAAiC,mBAAP,CACnD,CC9FA,I,UAAqB,QAArB,MAME,EAAA,CAAG,EAAe,GAOhB,OANA,KAAK,WAAa,KAAK,YAAc,CAAC,EAEjC,KAAK,WAAW,KACnB,KAAK,WAAW,GAAS,IAE3B,KAAK,WAAW,GAAO,KAAK,GACrB,IACT,CAEA,IAAA,CAAK,KAAkB,GACrB,KAAK,WAAa,KAAK,YAAc,CAAC,EACtC,IAAI,EAAY,KAAK,WAAW,GAEhC,GAAI,EAMF,IAAK,IAAI,K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AAO,EAAO,GACtB,EAAI,EAAM,SAIlB,OAAO,CACT,GAIF,SAAS,UAAU,EAAY,GAC7B,OAAO,MAAO,EAA0C,EAAU,QAAS,CAC7E,CACA,SAAS,gBAAgB,EAAU,EAAoB,GACrD,OAAI,MAAO,GAAkE,mBAApB,EAAI,GACpD,EAAU,EAAK,QAEtB,CAEJ,CAXA,YAAY,Y","file":"/npm/dropzone@6.3.4/dist/dropzone.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/dropzone@6.3.4/dist/dropzone.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Vendored from just-extend 6.2.0 (https://github.com/angus-c/just), which was\n// Dropzone's only runtime dependency. The whole package is the forty lines\n// below, so carrying it directly means Dropzone installs with no dependencies\n// at all -- no supply chain to audit, and no CommonJS/ESM interop for consumers\n// to resolve. The code is unchanged from upstream; only the export differs.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2016 angus croll\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/*\n  var obj = {a: 3, b: 5};\n  extend(obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}\n  obj; // {a: 4, b: 5, c: 8}\n\n  var obj = {a: 3, b: 5};\n  extend({}, obj, {a: 4, c: 8}); // {a: 4, b: 5, c: 8}\n  obj; // {a: 3, b: 5}\n\n  var arr = [1, 2, 3];\n  var obj = {a: 3, b: 5};\n  extend(obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}\n  arr.push(4);\n  obj; // {a: 3, b: 5, c: [1, 2, 3, 4]}\n\n  var arr = [1, 2, 3];\n  var obj = {a: 3, b: 5};\n  extend(true, obj, {c: arr}); // {a: 3, b: 5, c: [1, 2, 3]}\n  arr.push(4);\n  obj; // {a: 3, b: 5, c: [1, 2, 3]}\n\n  extend({a: 4, b: 5}); // {a: 4, b: 5}\n  extend({a: 4, b: 5}, 3); {a: 4, b: 5}\n  extend({a: 4, b: 5}, true); {a: 4, b: 5}\n  extend('hello', {a: 4, b: 5}); // throws\n  extend(3, {a: 4, b: 5}); // throws\n*/\n\n// Overloads describe the two shapes the arguments-based signature accepts: an\n// optional leading `deep` flag, then the extendee and any number of extenders.\nexport default function extend<T>(deep: boolean, target: T, ...sources: any[]): T;\nexport default function extend<T>(target: T, ...sources: any[]): T;\nexport default function extend(...args: any[]): any {\n  var deep = false;\n  if (typeof args[0] == \"boolean\") {\n    deep = args.shift();\n  }\n  var result = args[0];\n  if (isUnextendable(result)) {\n    throw new Error(\"extendee must be an object\");\n  }\n  var extenders = args.slice(1);\n  var len = extenders.length;\n  for (var i = 0; i < len; i++) {\n    var extender = extenders[i];\n    for (var key in extender) {\n      if (Object.prototype.hasOwnProperty.call(extender, key)) {\n        var value = extender[key];\n        if (deep && isCloneable(value)) {\n          var base = Array.isArray(value) ? [] : {};\n          result[key] = extend(\n            true,\n            Object.prototype.hasOwnProperty.call(result, key) && !isUnextendable(result[key])\n              ? result[key]\n              : base,\n            value,\n          );\n        } else {\n          result[key] = value;\n        }\n      }\n    }\n  }\n  return result;\n}\n\nfunction isCloneable(obj: any) {\n  return Array.isArray(obj) || {}.toString.call(obj) == \"[object Object]\";\n}\n\nfunction isUnextendable(val: any) {\n  return !val || (typeof val != \"object\" && typeof val != \"function\");\n}\n","// The Emitter class provides the ability to call `.on()` on Dropzone to listen\n// to events.\n// It is strongly based on component's emitter class, and I removed the\n// functionality because of the dependency hell with different frameworks.\nexport type EmitterListener = (...args: any[]) => void;\n\nexport default class Emitter {\n  _callbacks?: Record<string, EmitterListener[]>;\n  // Set by Dropzone: the element the DOM events are dispatched on.\n  element?: HTMLElement;\n\n  // Add an event listener for given event\n  on(event: string, fn: EmitterListener): this {\n    this._callbacks = this._callbacks || {};\n    // Create namespace for this event\n    if (!this._callbacks[event]) {\n      this._callbacks[event] = [];\n    }\n    this._callbacks[event].push(fn);\n    return this;\n  }\n\n  emit(event: string, ...args: any[]): this {\n    this._callbacks = this._callbacks || {};\n    let callbacks = this._callbacks[event!];\n\n    if (callbacks) {\n      // Iterating the live array would skip a listener whenever one of them\n      // removes itself: `off` splices in place, so everything after the\n      // removed entry shifts down past the loop's index. Snapshotting also\n      // means a listener added by another listener does not run until the\n      // next emit, which is how EventEmitter behaves. See #2367.\n      for (let callback of callbacks.slice()) {\n        callback.apply(this, args);\n      }\n    }\n    // trigger a corresponding DOM event\n    if (this.element) {\n      this.element.dispatchEvent(this.makeEvent(\"dropzone:\" + event, { args: args }));\n    }\n    return this;\n  }\n\n  makeEvent(eventName: string, detail: unknown): CustomEvent {\n    let params = { bubbles: true, cancelable: true, detail: detail };\n\n    if (typeof window.CustomEvent === \"function\") {\n      return new CustomEvent(eventName, params);\n    } else {\n      // IE 11 support\n      // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n      var evt = document.createEvent(\"CustomEvent\");\n      evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);\n      return evt;\n    }\n  }\n\n  // Remove event listener for given event. If fn is not provided, all event\n  // listeners for that event will be removed. If neither is provided, all\n  // event listeners will be removed.\n  off(event?: string, fn?: EmitterListener): this {\n    if (!this._callbacks || arguments.length === 0) {\n      this._callbacks = {};\n      return this;\n    }\n\n    // specific event\n    let callbacks = this._callbacks[event!];\n    if (!callbacks) {\n      return this;\n    }\n\n    // remove all handlers\n    if (arguments.length === 1) {\n      delete this._callbacks[event!];\n      return this;\n    }\n\n    // remove specific handler\n    for (let i = 0; i < callbacks.length; i++) {\n      let callback = callbacks[i];\n      if (callback === fn) {\n        callbacks.splice(i, 1);\n        break;\n      }\n    }\n\n    return this;\n  }\n}\n","import Dropzone from \"./dropzone\";\nimport type { DropzoneAcceptCallback, DropzoneFile, DropzoneTransformCallback } from \"./dropzone\";\nimport defaultPreviewTemplate from \"./preview-template.html?raw\";\n\nlet defaultOptions = {\n  /**\n   * Has to be specified on elements other than form (or when the form doesn't\n   * have an `action` attribute).\n   *\n   * You can also provide a function that will be called with `files` and\n   * `dataBlocks`  and must return the url as string.\n   */\n  url: null as string | ((files: DropzoneFile[], dataBlocks?: any[]) => string) | null,\n\n  /**\n   * Can be changed to `\"put\"` if necessary. You can also provide a function\n   * that will be called with `files` and must return the method (since `v3.12.0`).\n   */\n  method: \"post\",\n\n  /**\n   * Will be set on the XHRequest.\n   */\n  withCredentials: false,\n\n  /**\n   * The timeout for the XHR requests in milliseconds (since `v4.4.0`).\n   * If set to null or 0, no timeout is going to be set.\n   */\n  timeout: null as number | null,\n\n  /**\n   * How many file uploads to process in parallel (See the\n   * Enqueuing file uploads documentation section for more info)\n   */\n  parallelUploads: 2,\n\n  /**\n   * Whether to send multiple files in one request. If\n   * this it set to true, then the fallback file input element will\n   * have the `multiple` attribute as well. This option will\n   * also trigger additional events (like `processingmultiple`). See the events\n   * documentation section for more information.\n   */\n  uploadMultiple: false,\n\n  /**\n   * Whether you want files to be uploaded in chunks to your server. This can't be\n   * used in combination with `uploadMultiple`.\n   *\n   * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.\n   */\n  chunking: false,\n\n  /**\n   * If `chunking` is enabled, this defines whether **every** file should be chunked,\n   * even if the file size is below chunkSize. This means, that the additional chunk\n   * form data will be submitted and the `chunksUploaded` callback will be invoked.\n   */\n  forceChunking: false,\n\n  /**\n   * If `chunking` is `true`, then this defines the chunk size in bytes.\n   */\n  chunkSize: 2 * 1024 * 1024,\n\n  /**\n   * If `true`, the individual chunks of a file are uploaded simultaneously, at\n   * most `parallelUploads` of them at a time. Set a number to use a different\n   * limit, or `Infinity` to start every chunk at once.\n   */\n  parallelChunkUploads: false,\n\n  /**\n   * Whether a chunk should be retried if it fails.\n   */\n  retryChunks: false,\n\n  /**\n   * If `retryChunks` is true, how many times should it be retried.\n   */\n  retryChunksLimit: 3,\n\n  /**\n   * The maximum filesize (in MiB) that is allowed to be uploaded.\n   */\n  maxFilesize: 256,\n\n  /**\n   * The name of the file param that gets transferred.\n   * **NOTE**: If you have the option  `uploadMultiple` set to `true`, then\n   * Dropzone will append `[]` to the name.\n   */\n  paramName: \"file\",\n\n  /**\n   * Whether thumbnails for images should be generated\n   */\n  createImageThumbnails: true,\n\n  /**\n   * In MB. When the filename exceeds this limit, the thumbnail will not be generated.\n   */\n  maxThumbnailFilesize: 10,\n\n  /**\n   * If `null`, the ratio of the image will be used to calculate it.\n   */\n  thumbnailWidth: 120,\n\n  /**\n   * The same as `thumbnailWidth`. If both are null, images will not be resized.\n   */\n  thumbnailHeight: 120,\n\n  /**\n   * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.\n   * Can be either `contain` or `crop`.\n   */\n  thumbnailMethod: \"crop\",\n\n  /**\n   * If set, images will be resized to these dimensions before being **uploaded**.\n   * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect\n   * ratio of the file will be preserved.\n   *\n   * The `options.transformFile` function uses these options, so if the `transformFile` function\n   * is overridden, these options don't do anything.\n   */\n  resizeWidth: null as number | null,\n\n  /**\n   * See `resizeWidth`.\n   */\n  resizeHeight: null as number | null,\n\n  /**\n   * The mime type of the resized image (before it gets uploaded to the server).\n   * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.\n   * See `resizeWidth` for more information.\n   */\n  resizeMimeType: null as string | null,\n\n  /**\n   * The quality of the resized images. See `resizeWidth`.\n   */\n  resizeQuality: 0.8,\n\n  /**\n   * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.\n   * Can be either `contain` or `crop`.\n   */\n  resizeMethod: \"contain\",\n\n  /**\n   * The color to show through transparent parts of a resized image, as any\n   * CSS color. Formats without an alpha channel cannot store transparency, so\n   * a transparent PNG resized to `image/jpeg` comes out with black where it\n   * used to be see-through; setting this to `\"#fff\"` makes it white instead.\n   *\n   * `null` leaves transparency alone, which only produces black once the image\n   * is encoded to a format that cannot represent it. This has no effect on the\n   * preview thumbnails, which are always PNG.\n   */\n  resizeTransparencyFill: null as string | null,\n\n  /**\n   * The base that is used to calculate the **displayed** filesize. You can\n   * change this to 1024 if you would rather display kibibytes, mebibytes,\n   * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`\n   * not `1 kilobyte`. You can change this to `1024` if you don't care about\n   * validity.\n   */\n  filesizeBase: 1000,\n\n  /**\n   * If not `null` defines how many files this Dropzone handles. If it exceeds,\n   * the event `maxfilesexceeded` will be called. The dropzone element gets the\n   * class `dz-max-files-reached` accordingly so you can provide visual\n   * feedback.\n   */\n  maxFiles: null as number | null,\n\n  /**\n   * An optional object to send additional headers to the server. Eg:\n   * `{ \"My-Awesome-Header\": \"header value\" }`\n   */\n  headers: null as Record<string, string> | null,\n\n  /**\n   * Should the default headers be set or not?\n   * Accept: application/json <- for requesting json response\n   * Cache-Control: no-cache <- Request shouldnt be cached\n   * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest\n   */\n  defaultHeaders: true,\n\n  /**\n   * If `true`, the dropzone element itself will be clickable, if `false`\n   * nothing will be clickable.\n   *\n   * You can also pass an HTML element, a CSS selector (for multiple elements)\n   * or an array of those. In that case, all of those elements will trigger an\n   * upload when clicked.\n   */\n  clickable: true as boolean | string | HTMLElement | (string | HTMLElement)[],\n\n  /**\n   * Whether hidden files in directories should be ignored.\n   */\n  ignoreHiddenFiles: true,\n\n  /**\n   * The default implementation of `accept` checks the file's mime type or\n   * extension against this list. This is a comma separated list of mime\n   * types or file extensions.\n   *\n   * Eg.: `image/*,application/pdf,.psd`\n   *\n   * If the Dropzone is `clickable` this option will also be used as\n   * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n   * parameter on the hidden file input as well.\n   */\n  acceptedFiles: null as string | null,\n\n  /**\n   * **Deprecated!**\n   * Use acceptedFiles instead.\n   */\n  acceptedMimeTypes: null as string | null,\n\n  /**\n   * If false, files will be added to the queue but the queue will not be\n   * processed automatically.\n   * This can be useful if you need some additional user input before sending\n   * files (or if you want want all files sent at once).\n   * If you're ready to send the file simply call `myDropzone.processQueue()`.\n   *\n   * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation\n   * section for more information.\n   */\n  autoProcessQueue: true,\n\n  /**\n   * If false, files added to the dropzone will not be queued by default.\n   * You'll have to call `enqueueFile(file)` manually.\n   */\n  autoQueue: true,\n\n  /**\n   * If `true`, this will add a link to every file preview to remove or cancel (if\n   * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`\n   * and `dictRemoveFile` options are used for the wording.\n   */\n  addRemoveLinks: false,\n\n  /**\n   * Defines where to display the file previews – if `null` the\n   * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS\n   * selector. The element should have the `dropzone-previews` class so\n   * the previews are displayed properly.\n   */\n  previewsContainer: null as string | HTMLElement | false | null,\n\n  /**\n   * Set this to `true` if you don't want previews to be shown.\n   */\n  disablePreviews: false,\n\n  /**\n   * This is the element the hidden input field (which is used when clicking on the\n   * dropzone to trigger file selection) will be appended to. This might\n   * be important in case you use frameworks to switch the content of your page.\n   *\n   * Can be a selector string, or an element directly.\n   */\n  hiddenInputContainer: \"body\" as string | HTMLElement,\n\n  /**\n   * If null, no capture type will be specified\n   * If camera, mobile devices will skip the file selection and choose camera\n   * If microphone, mobile devices will skip the file selection and choose the microphone\n   * If camcorder, mobile devices will skip the file selection and choose the camera in video mode\n   * On apple devices multiple must be set to false.  AcceptedFiles may need to\n   * be set to an appropriate mime type (e.g. \"image/*\", \"audio/*\", or \"video/*\").\n   */\n  capture: null as string | null,\n\n  /**\n   * **Deprecated**. Use `renameFile` instead.\n   */\n  renameFilename: null as ((name: string, file: DropzoneFile) => string) | null,\n\n  /**\n   * A function that is invoked before the file is uploaded to the server and renames the file.\n   * This function gets the `File` as argument and can use the `file.name`. The actual name of the\n   * file that gets used during the upload can be accessed through `file.upload.filename`.\n   */\n  renameFile: null as ((file: DropzoneFile) => string) | null,\n\n  /**\n   * If `true` the fallback will be forced. This is very useful to test your server\n   * implementations first and make sure that everything works as\n   * expected without dropzone if you experience problems, and to test\n   * how your fallbacks will look.\n   */\n  forceFallback: false,\n\n  /**\n   * The text used before any files are dropped.\n   */\n  dictDefaultMessage: \"Drop files here to upload\",\n\n  /**\n   * The text that replaces the default message text it the browser is not supported.\n   */\n  dictFallbackMessage: \"Your browser does not support drag'n'drop file uploads.\",\n\n  /**\n   * The text that will be added before the fallback form.\n   * If you provide a  fallback element yourself, or if this option is `null` this will\n   * be ignored.\n   */\n  dictFallbackText:\n    \"Please use the fallback form below to upload your files like in the olden days.\",\n\n  /**\n   * If the filesize is too big.\n   * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.\n   */\n  dictFileTooBig: \"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.\",\n\n  /**\n   * If the file doesn't match the file type.\n   */\n  dictInvalidFileType: \"You can't upload files of this type.\",\n\n  /**\n   * If the file looks like an image but cannot be decoded, so no thumbnail can\n   * be generated for it.\n   */\n  dictThumbnailError: \"Failed to load the image. The file may be corrupted.\",\n\n  /**\n   * If the server response was invalid.\n   * `{{statusCode}}` will be replaced with the servers status code.\n   */\n  dictResponseError: \"Server responded with {{statusCode}} code.\",\n\n  /**\n   * If `addRemoveLinks` is true, the text to be used for the cancel upload link.\n   */\n  dictCancelUpload: \"Cancel upload\",\n\n  /**\n   * The text that is displayed if an upload was manually canceled\n   */\n  dictUploadCanceled: \"Upload canceled.\",\n\n  /**\n   * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.\n   */\n  dictCancelUploadConfirmation: \"Are you sure you want to cancel this upload?\",\n\n  /**\n   * If `addRemoveLinks` is true, the text to be used to remove a file.\n   */\n  dictRemoveFile: \"Remove file\",\n\n  /**\n   * If this is not null, then the user will be prompted before removing a file.\n   */\n  dictRemoveFileConfirmation: null as string | null,\n\n  /**\n   * Displayed if `maxFiles` is set and exceeded.\n   * The string `{{maxFiles}}` will be replaced by the configuration value.\n   */\n  dictMaxFilesExceeded: \"You cannot upload any more files.\",\n\n  /**\n   * Allows you to translate the different units. Starting with `tb` for terabytes and going down to\n   * `b` for bytes.\n   */\n  dictFileSizeUnits: { tb: \"TB\", gb: \"GB\", mb: \"MB\", kb: \"KB\", b: \"b\" },\n  /**\n   * Called when dropzone initialized\n   * You can add event listeners here\n   */\n  init() {},\n\n  /**\n   * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`\n   * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case\n   * of a function, this needs to return a map.\n   *\n   * The default implementation does nothing for normal uploads, but adds relevant information for\n   * chunked uploads.\n   *\n   * This is the same as adding hidden input fields in the form element.\n   */\n  params(this: Dropzone, files: DropzoneFile[], xhr: XMLHttpRequest, chunk: any) {\n    if (chunk) {\n      return {\n        dzuuid: chunk.file.upload.uuid,\n        dzchunkindex: chunk.index,\n        dztotalfilesize: chunk.file.size,\n        dzchunksize: this.options.chunkSize,\n        dztotalchunkcount: chunk.file.upload.totalChunkCount,\n        dzchunkbyteoffset: chunk.index * this.options.chunkSize,\n      };\n    }\n    return undefined;\n  },\n\n  /**\n   * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n   * and a `done` function as parameters.\n   *\n   * If the done function is invoked without arguments, the file is \"accepted\" and will\n   * be processed. If you pass an error message, the file is rejected, and the error\n   * message will be displayed.\n   * This function will not be called if the file is too big or doesn't match the mime types.\n   */\n  accept(file: DropzoneFile, done: DropzoneAcceptCallback) {\n    return done();\n  },\n\n  /**\n   * The callback that will be invoked when all chunks have been uploaded for a file.\n   * It gets the file for which the chunks have been uploaded as the first parameter,\n   * and the `done` function as second. `done()` needs to be invoked when everything\n   * needed to finish the upload process is done.\n   */\n  chunksUploaded: function (file: DropzoneFile, done: () => void) {\n    done();\n  },\n\n  /**\n   * Sends the file as binary blob in body instead of form data.\n   * If this is set, the `params` option will be ignored.\n   * It's an error to set this to `true` along with `uploadMultiple` since\n   * multiple files cannot be in a single binary body.\n   */\n  binaryBody: false,\n\n  /**\n   * Gets called when the browser is not supported.\n   * The default implementation shows the fallback input field and adds\n   * a text.\n   */\n  fallback(this: Dropzone) {\n    // This code should pass in IE7... :(\n    let messageElement;\n    this.element.className = `${this.element.className} dz-browser-not-supported`;\n\n    for (let child of this.element.getElementsByTagName(\"div\")) {\n      if (/(^| )dz-message($| )/.test(child.className)) {\n        messageElement = child;\n        child.className = \"dz-message\"; // Removes the 'dz-default' class\n        break;\n      }\n    }\n    if (!messageElement) {\n      messageElement = Dropzone.createElement('<div class=\"dz-message\"><span></span></div>');\n      this.element.appendChild(messageElement);\n    }\n\n    let span = messageElement.getElementsByTagName(\"span\")[0];\n    if (span) {\n      if (span.textContent != null) {\n        span.textContent = this.options.dictFallbackMessage;\n      } else if (span.innerText != null) {\n        span.innerText = this.options.dictFallbackMessage;\n      }\n    }\n\n    return this.element.appendChild(this.getFallbackForm());\n  },\n\n  /**\n   * Gets called to calculate the thumbnail dimensions.\n   *\n   * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:\n   *\n   *  - `srcWidth` & `srcHeight` (required)\n   *  - `trgWidth` & `trgHeight` (required)\n   *  - `srcX` & `srcY` (optional, default `0`)\n   *  - `trgX` & `trgY` (optional, default `0`)\n   *\n   * Those values are going to be used by `ctx.drawImage()`.\n   */\n  resize(file: DropzoneFile, width: number | null, height: number | null, resizeMethod: string) {\n    let info: Record<string, number> = {\n      srcX: 0,\n      srcY: 0,\n      srcWidth: file.width!,\n      srcHeight: file.height!,\n    };\n\n    let srcRatio = file.width! / file.height!;\n\n    // Automatically calculate dimensions if not specified\n    if (width == null && height == null) {\n      width = info.srcWidth;\n      height = info.srcHeight;\n    } else if (width == null) {\n      // Reaching here means height is set: the branch above took both-null.\n      width = height! * srcRatio;\n    } else if (height == null) {\n      height = width / srcRatio;\n    }\n\n    // Make sure images aren't upscaled. Both are set by the chain above,\n    // whichever branch it took.\n    width = Math.min(width!, info.srcWidth);\n    height = Math.min(height!, info.srcHeight);\n\n    let trgRatio = width / height;\n\n    if (info.srcWidth > width || info.srcHeight > height) {\n      // Image is bigger and needs rescaling\n      if (resizeMethod === \"crop\") {\n        if (srcRatio > trgRatio) {\n          info.srcHeight = file.height!;\n          info.srcWidth = info.srcHeight * trgRatio;\n        } else {\n          info.srcWidth = file.width!;\n          info.srcHeight = info.srcWidth / trgRatio;\n        }\n      } else if (resizeMethod === \"contain\") {\n        // Method 'contain'\n        if (srcRatio > trgRatio) {\n          height = width / srcRatio;\n        } else {\n          width = height * srcRatio;\n        }\n      } else {\n        throw new Error(`Unknown resizeMethod '${resizeMethod}'`);\n      }\n    }\n\n    info.srcX = (file.width! - info.srcWidth) / 2;\n    info.srcY = (file.height! - info.srcHeight) / 2;\n\n    info.trgWidth = width;\n    info.trgHeight = height;\n\n    return info;\n  },\n\n  /**\n   * Can be used to transform the file (for example, resize an image if necessary).\n   *\n   * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes\n   * images according to those dimensions.\n   *\n   * Gets the `file` as the first parameter, and a `done()` function as the second, that needs\n   * to be invoked with the file when the transformation is done.\n   */\n  transformFile(this: Dropzone, file: DropzoneFile, done: DropzoneTransformCallback) {\n    if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) {\n      return this.resizeImage(\n        file,\n        this.options.resizeWidth,\n        this.options.resizeHeight,\n        this.options.resizeMethod,\n        done,\n      );\n    } else {\n      return done(file);\n    }\n  },\n\n  /**\n   * A string that contains the template used for each dropped\n   * file. Change it to fulfill your needs but make sure to properly\n   * provide all elements.\n   *\n   * If you want to use an actual HTML element instead of providing a String\n   * as a config option, you could create a div with the id `tpl`,\n   * put the template inside it and provide the element like this:\n   *\n   *     document\n   *       .querySelector('#tpl')\n   *       .innerHTML\n   *\n   */\n  previewTemplate: defaultPreviewTemplate,\n\n  /*\n   Those functions register themselves to the events on init and handle all\n   the user interface specific stuff. Overwriting them won't break the upload\n   but can break the way it's displayed.\n   You can overwrite them if you don't like the default behavior. If you just\n   want to add an additional event handler, register it on the dropzone object\n   and don't overwrite those options.\n   */\n\n  // Those are self explanatory and simply concern the DragnDrop.\n  drop(this: Dropzone, e: any) {\n    return this.element.classList.remove(\"dz-drag-hover\");\n  },\n  dragstart(e: any) {},\n  dragend(this: Dropzone, e: any) {\n    return this.element.classList.remove(\"dz-drag-hover\");\n  },\n  dragenter(this: Dropzone, e: any) {\n    return this.element.classList.add(\"dz-drag-hover\");\n  },\n  dragover(this: Dropzone, e: any) {\n    return this.element.classList.add(\"dz-drag-hover\");\n  },\n  dragleave(this: Dropzone, e: any) {\n    return this.element.classList.remove(\"dz-drag-hover\");\n  },\n\n  paste(e: any) {},\n\n  // Called whenever there are no files left in the dropzone anymore, and the\n  // dropzone should be displayed as if in the initial state.\n  reset(this: Dropzone) {\n    return this.element.classList.remove(\"dz-started\");\n  },\n\n  // Called when a file is added to the queue\n  // Receives `file`\n  addedfile(this: Dropzone, file: DropzoneFile) {\n    if (this.element === this.previewsContainer) {\n      this.element.classList.add(\"dz-started\");\n    }\n\n    if (this.previewsContainer && !this.options.disablePreviews) {\n      file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());\n      file.previewTemplate = file.previewElement; // Backwards compatibility\n\n      this.previewsContainer.appendChild(file.previewElement);\n      for (var node of file.previewElement.querySelectorAll(\"[data-dz-name]\")) {\n        node.textContent = file.name;\n      }\n      for (node of file.previewElement.querySelectorAll(\"[data-dz-size]\")) {\n        node.innerHTML = this.filesize(file.size);\n      }\n\n      if (this.options.addRemoveLinks) {\n        file._removeLink = Dropzone.createElement(\n          `<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>${this.options.dictRemoveFile}</a>`,\n        );\n        file.previewElement.appendChild(file._removeLink);\n      }\n\n      let removeFileEvent = (e: any) => {\n        e.preventDefault();\n        e.stopPropagation();\n        if (file.status === Dropzone.UPLOADING) {\n          return Dropzone.confirm(this.options.dictCancelUploadConfirmation, () =>\n            this.removeFile(file),\n          );\n        } else {\n          if (this.options.dictRemoveFileConfirmation) {\n            return Dropzone.confirm(this.options.dictRemoveFileConfirmation, () =>\n              this.removeFile(file),\n            );\n          } else {\n            return this.removeFile(file);\n          }\n        }\n      };\n\n      for (let removeLink of file.previewElement.querySelectorAll(\"[data-dz-remove]\")) {\n        removeLink.addEventListener(\"click\", removeFileEvent);\n      }\n    }\n  },\n\n  // Called whenever a file is removed.\n  removedfile(this: Dropzone, file: DropzoneFile) {\n    if (file.previewElement != null && file.previewElement.parentNode != null) {\n      file.previewElement.parentNode.removeChild(file.previewElement);\n    }\n    return this._updateMaxFilesReachedClass();\n  },\n\n  // Called when a thumbnail has been generated\n  // Receives `file` and `dataUrl`\n  thumbnail(file: DropzoneFile, dataUrl: string) {\n    if (file.previewElement) {\n      file.previewElement.classList.remove(\"dz-file-preview\");\n      for (let thumbnailElement of file.previewElement.querySelectorAll<HTMLImageElement>(\n        \"[data-dz-thumbnail]\",\n      )) {\n        thumbnailElement.alt = file.name;\n        thumbnailElement.src = dataUrl;\n      }\n\n      return setTimeout(() => file.previewElement!.classList.add(\"dz-image-preview\"), 1);\n    }\n    return undefined;\n  },\n\n  // Called whenever an error occurs\n  // Receives `file` and `message`\n  error(file: DropzoneFile, message: string) {\n    if (file.previewElement) {\n      file.previewElement.classList.add(\"dz-error\");\n      if (typeof message !== \"string\" && (message as any).error) {\n        message = (message as any).error;\n      }\n      for (let node of file.previewElement.querySelectorAll(\"[data-dz-errormessage]\")) {\n        node.textContent = message;\n      }\n    }\n  },\n\n  errormultiple() {},\n\n  // Called when a file gets processed. Since there is a queue, not all added\n  // files are processed immediately.\n  // Receives `file`\n  processing(this: Dropzone, file: DropzoneFile) {\n    if (file.previewElement) {\n      file.previewElement.classList.add(\"dz-processing\");\n      if (file._removeLink) {\n        return (file._removeLink.innerHTML = this.options.dictCancelUpload);\n      }\n    }\n    return undefined;\n  },\n\n  processingmultiple() {},\n\n  // Called whenever the upload progress gets updated.\n  // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.\n  // To get the total number of bytes of the file, use `file.size`\n  uploadprogress(file: DropzoneFile, progress: number, bytesSent: number) {\n    if (file.previewElement) {\n      for (let node of file.previewElement.querySelectorAll<HTMLProgressElement>(\n        \"[data-dz-uploadprogress]\",\n      )) {\n        if (node.nodeName === \"PROGRESS\") {\n          node.value = progress;\n        } else {\n          node.style.width = `${progress}%`;\n        }\n      }\n    }\n  },\n\n  // Called whenever the total upload progress gets updated.\n  // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent\n  totaluploadprogress() {},\n\n  // Called just before the file is sent. Gets the `xhr` object as second\n  // parameter, so you can modify it (for example to add a CSRF token) and a\n  // `formData` object to add additional information.\n  sending() {},\n\n  sendingmultiple() {},\n\n  // When the complete upload is finished and successful\n  // Receives `file`\n  success(file: DropzoneFile) {\n    if (file.previewElement) {\n      return file.previewElement.classList.add(\"dz-success\");\n    }\n  },\n\n  successmultiple() {},\n\n  // When the upload is canceled.\n  canceled(this: Dropzone, file: DropzoneFile) {\n    return this.emit(\"error\", file, this.options.dictUploadCanceled);\n  },\n\n  canceledmultiple() {},\n\n  // When the upload is finished, either with success or an error.\n  // Receives `file`\n  complete(this: Dropzone, file: DropzoneFile) {\n    if (file._removeLink) {\n      file._removeLink.innerHTML = this.options.dictRemoveFile;\n    }\n    if (file.previewElement) {\n      return file.previewElement.classList.add(\"dz-complete\");\n    }\n  },\n\n  completemultiple() {},\n\n  maxfilesexceeded() {},\n\n  maxfilesreached() {},\n\n  queuecomplete() {},\n\n  addedfiles() {},\n\n  /**\n   * Called when a dropped folder turns out to have nothing in it at all.\n   * Receives the folder's path.\n   */\n  emptyfolder() {},\n};\n\n// Derived from the defaults rather than hand-written, so the options and their\n// types stay in step with the source by construction.\n//\n// No index signature, deliberately: adding one would accept any key at all,\n// and `maxFileSize` -- the wrong capitalisation of `maxFilesize` -- would pass\n// silently, which is exactly what an option type is for. Custom keys are still\n// merged onto the instance at runtime and readable through this.options, which\n// does carry one.\nexport type DropzoneOptions = Partial<typeof defaultOptions>;\n\n// What a Dropzone instance holds: the user's options merged over the defaults,\n// so every one of them is present. Reading this.options through the Partial\n// above would make each access `| undefined` for a value that is always there.\n//\n// No index signature here either. One would let the library read an option\n// that does not exist without complaint, which is exactly what it was doing\n// with this.options.fixOrientation.\nexport type ResolvedDropzoneOptions = typeof defaultOptions;\n\nexport default defaultOptions;\n","/// <reference path=\"./types.d.ts\" />\nimport { version } from \"../package.json\";\nimport extend from \"./extend\";\nimport Emitter from \"./emitter\";\nimport defaultOptions from \"./options\";\nimport type { DropzoneOptions, ResolvedDropzoneOptions } from \"./options\";\n\nexport type { DropzoneOptions, ResolvedDropzoneOptions };\n\n/** One chunk of a chunked upload, as tracked on `file.upload.chunks!`. */\nexport type DropzoneChunk = {\n  file: DropzoneFile;\n  index: number;\n  dataBlock: any;\n  status: string;\n  progress: number;\n  total?: number;\n  bytesSent?: number;\n  retries: number;\n  xhr?: XMLHttpRequest;\n};\n\n/**\n * The upload bookkeeping Dropzone keeps on each file. The chunking fields are\n * only filled in once chunking is known to apply, which is after\n * `transformFile` has had its say about the data.\n */\nexport type DropzoneFileUpload = {\n  uuid: string;\n  progress: number;\n  total: number;\n  bytesSent: number;\n  filename: string;\n  chunked?: boolean;\n  totalChunkCount?: number;\n  chunks?: DropzoneChunk[];\n  finishedChunkUpload?: (chunk: DropzoneChunk, response: any) => void;\n};\n\n/** A File as Dropzone hands it back: the browser's, plus its own bookkeeping. */\nexport type DropzoneFile = File & {\n  status: string;\n  accepted?: boolean;\n  processing?: boolean;\n  previewElement?: HTMLElement | null;\n  previewTemplate?: HTMLElement | null;\n  xhr?: XMLHttpRequest;\n  dataURL?: string;\n  width?: number;\n  height?: number;\n  upload: DropzoneFileUpload;\n  [key: string]: any;\n};\n\n/**\n * Invoked by `accept` to admit a file, or to reject it with a message. Called\n * with no argument the file is accepted; anything passed is shown as the error.\n */\nexport type DropzoneAcceptCallback = (error?: string) => void;\n\n/**\n * Invoked with the file to upload once `transformFile` is finished. It is the\n * original file when there was nothing to do, and a Blob when the image was\n * resized.\n */\nexport type DropzoneTransformCallback = (file: DropzoneFile | Blob) => void;\n\n/**\n * Invoked with the rendered thumbnail as a data URL, and the canvas it was\n * drawn on -- which is null when the image needed no resizing.\n *\n * There is no separate error callback: when the thumbnail cannot be produced,\n * because the file cannot be read or the image cannot be decoded, this is\n * invoked with the error event in place of the data URL. Check with\n * `typeof dataUrl === \"string\"` before using it.\n */\nexport type DropzoneThumbnailCallback = (\n  dataUrl: string | Event,\n  canvas?: HTMLCanvasElement | null,\n) => void;\n\n/** One element and the handlers bound to it, as tracked for removal. */\nexport type DropzoneListener = {\n  element: HTMLElement | Document;\n  events: Record<string, (event: any) => any>;\n};\n\n// Every event Dropzone emits. Kept at module scope so the listener\n// signatures can be derived from it rather than written out twice.\nconst dropzoneEvents = [\n  \"drop\",\n  \"dragstart\",\n  \"dragend\",\n  \"dragenter\",\n  \"dragover\",\n  \"dragleave\",\n  \"addedfile\",\n  \"addedfiles\",\n  \"removedfile\",\n  \"thumbnail\",\n  \"error\",\n  \"errormultiple\",\n  \"processing\",\n  \"processingmultiple\",\n  \"uploadprogress\",\n  \"totaluploadprogress\",\n  \"sending\",\n  \"sendingmultiple\",\n  \"success\",\n  \"successmultiple\",\n  \"canceled\",\n  \"canceledmultiple\",\n  \"complete\",\n  \"completemultiple\",\n  \"reset\",\n  \"maxfilesexceeded\",\n  \"maxfilesreached\",\n  \"queuecomplete\",\n  \"emptyfolder\",\n] as const;\n\nexport type DropzoneEventName = (typeof dropzoneEvents)[number];\n\n/**\n * What each event's listener receives, taken from the option handler of the\n * same name so the two cannot disagree.\n */\nexport type DropzoneEventMap = {\n  [K in DropzoneEventName]: K extends keyof typeof defaultOptions\n    ? (typeof defaultOptions)[K] extends (...args: infer A) => any\n      ? A\n      : any[]\n    : any[];\n};\n\nexport default class Dropzone extends Emitter {\n  /**\n   * Every event you can register a handler for:\n   *\n   *     dropzone.on(\"dragenter\", function () {});\n   */\n  events: DropzoneEventName[] = [...dropzoneEvents];\n\n  // Per instance, not shared. These lived on the prototype, which meant two\n  // dropzones on one page pushed into the same queue and rendered each\n  // other's thumbnails.\n  _thumbnailQueue: DropzoneFile[] = [];\n  _processingThumbnail = false;\n\n  declare element: HTMLElement & { dropzone?: Dropzone };\n  disabled!: boolean;\n  options!: ResolvedDropzoneOptions;\n  files!: DropzoneFile[];\n  clickableElements!: HTMLElement[];\n  listeners!: DropzoneListener[];\n  previewsContainer!: HTMLElement | null;\n  hiddenFileInput!: HTMLInputElement | null;\n  URL!: typeof window.URL;\n\n  // Narrows what Emitter offers: a known event name types its listener's\n  // arguments, and anything else still works as before.\n  override on<K extends DropzoneEventName>(\n    event: K,\n    fn: (...args: DropzoneEventMap[K]) => void,\n  ): this;\n  override on(event: string, fn: (...args: any[]) => void): this;\n  override on(event: string, fn: (...args: any[]) => void): this {\n    return super.on(event, fn);\n  }\n\n  override emit<K extends DropzoneEventName>(event: K, ...args: DropzoneEventMap[K]): this;\n  override emit(event: string, ...args: any[]): this;\n  override emit(event: string, ...args: any[]): this {\n    return super.emit(event, ...args);\n  }\n\n  // Taken from package.json so it cannot drift from what was published.\n  static version = version;\n\n  // Set by users as the pre-6.0 name for blockedBrowsers; read by\n  // isBrowserSupported, never assigned here.\n  static blacklistedBrowsers?: RegExp[];\n\n  // The emitter class Dropzone inherits from, exposed for tests.\n  static Emitter = Emitter;\n\n  constructor(el: HTMLElement | string, options?: DropzoneOptions) {\n    super();\n    let fallback, left;\n    this.element = el as any;\n\n    this.clickableElements = [];\n    this.listeners = [];\n    this.files = []; // All files\n\n    if (typeof this.element === \"string\") {\n      this.element = document.querySelector(this.element as any) as any;\n    }\n\n    // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.\n    if (!this.element || this.element.nodeType == null) {\n      throw new Error(\"Invalid dropzone element.\");\n    }\n\n    if (this.element.dropzone) {\n      throw new Error(\"Dropzone already attached.\");\n    }\n\n    // Now add this dropzone to the instances.\n    Dropzone.instances.push(this);\n\n    // Put the dropzone inside the element itself.\n    this.element.dropzone = this;\n\n    let elementOptions = (left = Dropzone.optionsForElement(this.element)) != null ? left : {};\n\n    this.options = extend(\n      true,\n      {} as ResolvedDropzoneOptions,\n      defaultOptions,\n      elementOptions,\n      options != null ? options : {},\n    );\n\n    this.options.previewTemplate = this.options.previewTemplate.replace(/\\n*/g, \"\");\n\n    // If the browser failed, just call the fallback and leave\n    if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {\n      return this.options.fallback.call(this);\n    }\n\n    // @options.url = @element.getAttribute \"action\" unless @options.url?\n    if (this.options.url == null) {\n      this.options.url = this.element.getAttribute(\"action\");\n    }\n\n    if (!this.options.url) {\n      throw new Error(\"No URL provided.\");\n    }\n\n    if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {\n      throw new Error(\n        \"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.\",\n      );\n    }\n\n    if (this.options.uploadMultiple && this.options.chunking) {\n      throw new Error(\"You cannot set both: uploadMultiple and chunking.\");\n    }\n\n    if (this.options.binaryBody && this.options.uploadMultiple) {\n      throw new Error(\"You cannot set both: binaryBody and uploadMultiple.\");\n    }\n\n    // Backwards compatibility\n    if (this.options.acceptedMimeTypes) {\n      this.options.acceptedFiles = this.options.acceptedMimeTypes;\n      delete (this.options as any).acceptedMimeTypes;\n    }\n\n    // Backwards compatibility\n    if (this.options.renameFilename != null) {\n      let renameFilename = this.options.renameFilename;\n      this.options.renameFile = (file: DropzoneFile) => renameFilename.call(this, file.name, file);\n    }\n\n    if (typeof this.options.method === \"string\") {\n      this.options.method = this.options.method.toUpperCase();\n    }\n\n    if ((fallback = this.getExistingFallback()) && fallback.parentNode) {\n      // Remove the fallback\n      fallback.parentNode.removeChild(fallback);\n    }\n\n    // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false\n    if (this.options.previewsContainer !== false) {\n      if (this.options.previewsContainer) {\n        this.previewsContainer = Dropzone.getElement(\n          this.options.previewsContainer,\n          \"previewsContainer\",\n        );\n      } else {\n        this.previewsContainer = this.element;\n      }\n    }\n\n    if (this.options.clickable) {\n      if (this.options.clickable === true) {\n        this.clickableElements = [this.element];\n      } else {\n        this.clickableElements = Dropzone.getElements(this.options.clickable, \"clickable\");\n      }\n    }\n\n    this.init();\n  }\n\n  // Returns all files that have been accepted\n  getAcceptedFiles() {\n    return this.files.filter((file) => file.accepted).map((file) => file);\n  }\n\n  // Returns all files that have been rejected\n  // Not sure when that's going to be useful, but added for completeness.\n  getRejectedFiles() {\n    return this.files.filter((file) => !file.accepted).map((file) => file);\n  }\n\n  getFilesWithStatus(status: string) {\n    return this.files.filter((file) => file.status === status).map((file) => file);\n  }\n\n  // Returns all files that are in the queue\n  getQueuedFiles() {\n    return this.getFilesWithStatus(Dropzone.QUEUED);\n  }\n\n  getUploadingFiles() {\n    return this.getFilesWithStatus(Dropzone.UPLOADING);\n  }\n\n  getAddedFiles() {\n    return this.getFilesWithStatus(Dropzone.ADDED);\n  }\n\n  // Files that are either queued or uploading\n  getActiveFiles() {\n    return this.files\n      .filter((file) => file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED)\n      .map((file) => file);\n  }\n\n  // The function that gets called when Dropzone is initialized. You\n  // can (and should) setup event listeners inside this function.\n  init() {\n    // In case it isn't set already. `tagName` is upper case on HTML elements,\n    // so this never matched and the attribute was never set.\n    if (this.element.tagName === \"FORM\") {\n      this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n    }\n\n    if (this.element.classList.contains(\"dropzone\") && !this.element.querySelector(\".dz-message\")) {\n      this.element.appendChild(\n        Dropzone.createElement(\n          `<div class=\"dz-default dz-message\"><button class=\"dz-button\" type=\"button\">${this.options.dictDefaultMessage}</button></div>`,\n        ),\n      );\n    }\n\n    if (this.clickableElements.length) {\n      let setupHiddenFileInput = () => {\n        if (this.hiddenFileInput) {\n          this.hiddenFileInput!.parentNode!.removeChild(this.hiddenFileInput!);\n        }\n        this.hiddenFileInput = document.createElement(\"input\");\n        this.hiddenFileInput.setAttribute(\"type\", \"file\");\n        if (this.options.maxFiles === null || this.options.maxFiles > 1) {\n          this.hiddenFileInput.setAttribute(\"multiple\", \"multiple\");\n        }\n        this.hiddenFileInput.className = \"dz-hidden-input\";\n\n        if (this.options.acceptedFiles !== null) {\n          this.hiddenFileInput.setAttribute(\"accept\", this.options.acceptedFiles);\n        }\n        if (this.options.capture !== null) {\n          this.hiddenFileInput.setAttribute(\"capture\", this.options.capture);\n        }\n\n        // Making sure that no one can \"tab\" into this field.\n        this.hiddenFileInput.setAttribute(\"tabindex\", \"-1\");\n\n        // Auditors such as WAVE report this input as unlabelled. It never\n        // actually reaches assistive technology -- browsers drop\n        // `visibility: hidden` elements from the accessibility tree entirely,\n        // and the .dz-button carrying `dictDefaultMessage` is the control a\n        // screen reader sees. The name is here to clear the audit, which a lot\n        // of people are obliged to pass.\n        this.hiddenFileInput.setAttribute(\"aria-label\", \"hidden file upload\");\n\n        // Not setting `display=\"none\"` because some browsers don't accept clicks\n        // on elements that aren't displayed.\n        this.hiddenFileInput.style.visibility = \"hidden\";\n        this.hiddenFileInput.style.position = \"absolute\";\n        this.hiddenFileInput.style.top = \"0\";\n        this.hiddenFileInput.style.left = \"0\";\n        this.hiddenFileInput.style.height = \"0\";\n        this.hiddenFileInput.style.width = \"0\";\n        // The input is appended to `hiddenInputContainer` -- the body by\n        // default -- so it ends up outside whatever form it belongs to, and\n        // with several dropzones on a page nothing tells one input from\n        // another. Associating it with the form gives tooling something to go\n        // on.\n        //\n        // Only ever pointed at a real <form>: the attribute has to reference\n        // one, and aiming it at anything else leaves the input owned by no\n        // form at all. The input carries no `name`, so this cannot change what\n        // a native submit sends.\n        let ownerForm = this.element.closest(\"form\");\n        if (ownerForm && ownerForm.id) {\n          this.hiddenFileInput.setAttribute(\"form\", ownerForm.id);\n        }\n\n        Dropzone.getElement(this.options.hiddenInputContainer, \"hiddenInputContainer\").appendChild(\n          this.hiddenFileInput,\n        );\n        this.hiddenFileInput.addEventListener(\"change\", () => {\n          let { files } = this.hiddenFileInput!;\n          if (files && files.length) {\n            for (let file of files) {\n              this.addFile(file as DropzoneFile);\n            }\n          }\n          this.emit(\"addedfiles\", files);\n          setupHiddenFileInput();\n        });\n      };\n      setupHiddenFileInput();\n    }\n\n    this.URL = window.URL !== null ? window.URL : window.webkitURL;\n\n    // Setup all event listeners on the Dropzone object itself.\n    // They're not in @setupEventListeners() because they shouldn't be removed\n    // again when the dropzone gets disabled.\n    for (let eventName of this.events) {\n      this.on(eventName, this.options[eventName]);\n    }\n\n    this.on(\"uploadprogress\", () => this.updateTotalUploadProgress());\n\n    this.on(\"removedfile\", () => this.updateTotalUploadProgress());\n\n    this.on(\"canceled\", (file) => this.emit(\"complete\", file));\n\n    // Emit a `queuecomplete` event if all files finished uploading.\n    this.on(\"complete\", (file) => {\n      if (\n        this.getAddedFiles().length === 0 &&\n        this.getUploadingFiles().length === 0 &&\n        this.getQueuedFiles().length === 0\n      ) {\n        // This needs to be deferred so that `queuecomplete` really triggers after `complete`\n        return setTimeout(() => this.emit(\"queuecomplete\"), 0);\n      }\n      return undefined;\n    });\n\n    const containsFiles = function (e: any) {\n      if (e.dataTransfer.types) {\n        // Because e.dataTransfer.types is an Object in\n        // IE, we need to iterate like this instead of\n        // using e.dataTransfer.types.some()\n        for (var i = 0; i < e.dataTransfer.types.length; i++) {\n          if (e.dataTransfer.types[i] === \"Files\") return true;\n        }\n      }\n      return false;\n    };\n\n    let noPropagation = function (e: any) {\n      // If there are no files, we don't want to stop\n      // propagation so we don't interfere with other\n      // drag and drop behaviour.\n      if (!containsFiles(e)) return;\n      e.stopPropagation();\n      if (e.preventDefault) {\n        return e.preventDefault();\n      } else {\n        return (e.returnValue = false);\n      }\n    };\n\n    // Create the listeners\n    this.listeners = [\n      {\n        element: this.element,\n        events: {\n          dragstart: (e) => {\n            return this.emit(\"dragstart\", e);\n          },\n          dragenter: (e) => {\n            noPropagation(e);\n            return this.emit(\"dragenter\", e);\n          },\n          dragover: (e) => {\n            // Makes it possible to drag files from chrome's download bar\n            // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar\n            // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)\n            let efct;\n            try {\n              efct = e.dataTransfer.effectAllowed;\n            } catch (error) {}\n            e.dataTransfer.dropEffect = \"move\" === efct || \"linkMove\" === efct ? \"move\" : \"copy\";\n\n            noPropagation(e);\n            return this.emit(\"dragover\", e);\n          },\n          dragleave: (e) => {\n            return this.emit(\"dragleave\", e);\n          },\n          drop: (e) => {\n            noPropagation(e);\n            return this.drop(e);\n          },\n          dragend: (e) => {\n            return this.emit(\"dragend\", e);\n          },\n        },\n\n        // This is disabled right now, because the browsers don't implement it properly.\n        // \"paste\": (e) =>\n        //   noPropagation e\n        //   @paste e\n      },\n    ];\n\n    this.clickableElements.forEach((clickableElement) => {\n      return this.listeners.push({\n        element: clickableElement,\n        events: {\n          click: (evt) => {\n            // Only the actual dropzone or the message element should trigger file selection\n            if (\n              clickableElement !== this.element ||\n              evt.target === this.element ||\n              Dropzone.elementInside(evt.target as Node, this.element.querySelector(\".dz-message\")!)\n            ) {\n              this.hiddenFileInput!.click(); // Forward the click\n            }\n            return true;\n          },\n        },\n      });\n    });\n\n    this.enable();\n\n    return this.options.init.call(this);\n  }\n\n  // Not fully tested yet\n  destroy() {\n    this.disable();\n    this.removeAllFiles(true);\n    if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {\n      this.hiddenFileInput!.parentNode!.removeChild(this.hiddenFileInput!);\n      this.hiddenFileInput = null;\n    }\n    delete this.element.dropzone;\n    // `indexOf` returns -1 for an instance that is no longer registered --\n    // destroying twice is enough -- and `splice(-1, 1)` would then quietly\n    // drop the last entry, which is a different, live Dropzone.\n    let index = Dropzone.instances.indexOf(this);\n    return index === -1 ? [] : Dropzone.instances.splice(index, 1);\n  }\n\n  updateTotalUploadProgress() {\n    let totalUploadProgress;\n    let totalBytesSent = 0;\n    let totalBytes = 0;\n\n    let activeFiles = this.getActiveFiles();\n\n    if (activeFiles.length) {\n      for (let file of this.getActiveFiles()) {\n        totalBytesSent += file.upload.bytesSent;\n        totalBytes += file.upload.total;\n      }\n      totalUploadProgress = (100 * totalBytesSent) / totalBytes;\n    } else {\n      totalUploadProgress = 100;\n    }\n\n    return this.emit(\"totaluploadprogress\", totalUploadProgress, totalBytes, totalBytesSent);\n  }\n\n  // @options.paramName can be a function taking one parameter rather than a string.\n  // A parameter name for a file is obtained simply by calling this with an index number.\n  _getParamName(n: number) {\n    if (typeof this.options.paramName === \"function\") {\n      return (this.options.paramName as (n: number) => string)(n);\n    } else {\n      return `${this.options.paramName}${this.options.uploadMultiple ? `[${n}]` : \"\"}`;\n    }\n  }\n\n  // If @options.renameFile is a function,\n  // the function will be used to rename the file.name before appending it to the formData\n  _renameFile(file: DropzoneFile) {\n    if (typeof this.options.renameFile !== \"function\") {\n      return file.name;\n    }\n    return this.options.renameFile(file);\n  }\n\n  // Returns a form that can be used as fallback if the browser does not support DragnDrop\n  //\n  // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.\n  // This code has to pass in IE7 :(\n  getFallbackForm() {\n    let existingFallback, form;\n    if ((existingFallback = this.getExistingFallback())) {\n      return existingFallback;\n    }\n\n    let fieldsString = '<div class=\"dz-fallback\">';\n    if (this.options.dictFallbackText) {\n      fieldsString += `<p>${this.options.dictFallbackText}</p>`;\n    }\n    fieldsString += `<input type=\"file\" name=\"${this._getParamName(0)}\" ${\n      this.options.uploadMultiple ? 'multiple=\"multiple\"' : undefined\n    } /><input type=\"submit\" value=\"Upload!\"></div>`;\n\n    let fields = Dropzone.createElement(fieldsString);\n    if (this.element.tagName !== \"FORM\") {\n      form = Dropzone.createElement(\n        `<form action=\"${this.options.url}\" enctype=\"multipart/form-data\" method=\"${this.options.method}\"></form>`,\n      );\n      form.appendChild(fields);\n    } else {\n      // Make sure that the enctype and method attributes are set properly\n      this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n      this.element.setAttribute(\"method\", this.options.method);\n    }\n    return form != null ? form : fields;\n  }\n\n  // Returns the fallback elements if they exist already\n  //\n  // This code has to pass in IE7 :(\n  getExistingFallback() {\n    let getFallback = function (elements: any[]) {\n      for (let el of elements) {\n        if (/(^| )fallback($| )/.test(el.className)) {\n          return el;\n        }\n      }\n    };\n\n    for (let tagName of [\"div\", \"form\"]) {\n      var fallback;\n      if ((fallback = getFallback([...this.element.getElementsByTagName(tagName)]))) {\n        return fallback;\n      }\n    }\n  }\n\n  // Activates all listeners stored in @listeners\n  setupEventListeners() {\n    return this.listeners.map((elementListeners) =>\n      (() => {\n        let result = [];\n        for (let event in elementListeners.events) {\n          let listener = elementListeners.events[event];\n          result.push(elementListeners.element.addEventListener(event, listener, false));\n        }\n        return result;\n      })(),\n    );\n  }\n\n  // Deactivates all listeners stored in @listeners\n  removeEventListeners() {\n    return this.listeners.map((elementListeners) =>\n      (() => {\n        let result = [];\n        for (let event in elementListeners.events) {\n          let listener = elementListeners.events[event];\n          result.push(elementListeners.element.removeEventListener(event, listener, false));\n        }\n        return result;\n      })(),\n    );\n  }\n\n  // Removes all event listeners and cancels all files in the queue or being processed.\n  disable() {\n    this.clickableElements.forEach((element) => element.classList.remove(\"dz-clickable\"));\n    this.removeEventListeners();\n    this.disabled = true;\n\n    return this.files.map((file) => this.cancelUpload(file));\n  }\n\n  enable() {\n    delete (this as any).disabled;\n    this.clickableElements.forEach((element) => element.classList.add(\"dz-clickable\"));\n    return this.setupEventListeners();\n  }\n\n  // Returns a nicely formatted filesize\n  filesize(size: number) {\n    let selectedSize = 0;\n    let selectedUnit = \"b\";\n\n    if (size > 0) {\n      let units = [\"tb\", \"gb\", \"mb\", \"kb\", \"b\"];\n\n      for (let i = 0; i < units.length; i++) {\n        let unit = units[i];\n        let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n        if (size >= cutoff) {\n          selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n          selectedUnit = unit;\n          break;\n        }\n      }\n\n      selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits\n    }\n\n    return `<strong>${selectedSize}</strong> ${(this.options.dictFileSizeUnits as any)[selectedUnit]}`;\n  }\n\n  // Adds or removes the `dz-max-files-reached` class from the form.\n  _updateMaxFilesReachedClass() {\n    if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {\n      if (this.getAcceptedFiles().length === this.options.maxFiles) {\n        this.emit(\"maxfilesreached\", this.files);\n      }\n      return this.element.classList.add(\"dz-max-files-reached\");\n    } else {\n      return this.element.classList.remove(\"dz-max-files-reached\");\n    }\n  }\n\n  drop(e: any) {\n    if (!e.dataTransfer) {\n      return;\n    }\n    this.emit(\"drop\", e);\n\n    // Convert the FileList to an Array\n    let files = [];\n    for (let i = 0; i < e.dataTransfer.files.length; i++) {\n      files[i] = e.dataTransfer.files[i];\n    }\n\n    // Even if it's a folder, files.length will contain the folders.\n    if (files && files.length) {\n      let { items } = e.dataTransfer;\n      if (items && items.length && items[0].webkitGetAsEntry != null) {\n        // The browser supports dropping of folders, so the items get walked\n        // rather than the files. `e.dataTransfer.files` holds the folder\n        // entries themselves, not what is inside them, so `addedfiles` waits\n        // for the walk and reports what was actually added.\n        this._addFilesFromItems(items).then((addedFiles) => {\n          this.emit(\"addedfiles\", addedFiles);\n        });\n        return;\n      }\n      this.handleFiles(files);\n    }\n\n    this.emit(\"addedfiles\", files);\n  }\n\n  paste(e: any) {\n    if (__guard__(e != null ? e.clipboardData : undefined, (x: any) => x.items) == null) {\n      return;\n    }\n\n    this.emit(\"paste\", e);\n    let { items } = e.clipboardData;\n\n    if (items.length) {\n      return this._addFilesFromItems(items);\n    }\n    return undefined;\n  }\n\n  handleFiles(files: DropzoneFile[]) {\n    for (let file of files) {\n      this.addFile(file as DropzoneFile);\n    }\n  }\n\n  // When a folder is dropped (or files are pasted), items must be handled\n  // instead of files.\n  //\n  // Resolves with every file that was added, so `drop` can report the real\n  // contents of a dropped folder rather than the folder entry itself.\n  _addFilesFromItems(items: any[]) {\n    let files = [];\n    let directories = [];\n\n    for (let item of items) {\n      let entry = item.webkitGetAsEntry != null ? item.webkitGetAsEntry() : null;\n\n      if (entry) {\n        if (entry.isFile) {\n          let file = item.getAsFile();\n          this.addFile(file as DropzoneFile);\n          files.push(file);\n        } else if (entry.isDirectory) {\n          // Append all files from that directory to files\n          directories.push(this._addFilesFromDirectory(entry, entry.name));\n        }\n      } else if (item.getAsFile != null && (item.kind == null || item.kind === \"file\")) {\n        let file = item.getAsFile();\n        this.addFile(file as DropzoneFile);\n        files.push(file);\n      }\n    }\n\n    return Promise.all(directories).then((fromDirectories) => files.concat(...fromDirectories));\n  }\n\n  // Goes through the directory, and adds each file it finds recursively.\n  // Resolves with the files that were added.\n  _addFilesFromDirectory(directory: any, path: string) {\n    let dirReader = directory.createReader();\n\n    return new Promise((resolve) => {\n      let pending: Promise<any>[] = [];\n      let entryCount = 0;\n\n      // Every pending entry resolves with an array, so a single concat\n      // flattens files and nested directories together.\n      let settle = () =>\n        Promise.all(pending).then((results) => resolve(([] as any[]).concat(...results)));\n\n      let errorHandler = (error: any) => {\n        __guardMethod__(console, \"log\", (o: any) => o.log(error));\n        // Settle instead of hanging: a directory that cannot be read must not\n        // stop `addedfiles` from ever firing.\n        settle();\n      };\n\n      let readEntries = () =>\n        dirReader.readEntries((entries: any[]) => {\n          if (entries.length > 0) {\n            entryCount += entries.length;\n\n            for (let entry of entries) {\n              if (entry.isFile) {\n                pending.push(\n                  new Promise((resolveEntry) =>\n                    entry.file(\n                      (file: DropzoneFile) => {\n                        if (this.options.ignoreHiddenFiles && file.name.substring(0, 1) === \".\") {\n                          resolveEntry([]);\n                          return;\n                        }\n                        file.fullPath = `${path}/${file.name}`;\n                        this.addFile(file as DropzoneFile);\n                        resolveEntry([file]);\n                      },\n                      // Same reasoning as errorHandler: never leave it pending.\n                      () => resolveEntry([]),\n                    ),\n                  ),\n                );\n              } else if (entry.isDirectory) {\n                pending.push(this._addFilesFromDirectory(entry, `${path}/${entry.name}`));\n              }\n            }\n\n            // Recursively call readEntries() again, since browser only handle\n            // the first 100 entries.\n            // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries\n            readEntries();\n            return null;\n          }\n\n          // Counting every entry rather than only the files, so a folder that\n          // holds nothing but other folders is not reported as empty.\n          if (entryCount === 0) {\n            this.emit(\"emptyfolder\", path);\n          }\n\n          settle();\n          return null;\n        }, errorHandler);\n\n      readEntries();\n    });\n  }\n\n  // If `done()` is called without argument the file is accepted\n  // If you call it with an error message, the file is rejected\n  // (This allows for asynchronous validation)\n  //\n  // This function checks the filesize, and if the file.type passes the\n  // `acceptedFiles` check.\n  accept(file: DropzoneFile, done: DropzoneAcceptCallback) {\n    if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {\n      done(\n        this.options.dictFileTooBig\n          .replace(\"{{filesize}}\", String(Math.round(file.size / 1024 / 10.24) / 100))\n          .replace(\"{{maxFilesize}}\", String(this.options.maxFilesize)),\n      );\n    } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {\n      done(this.options.dictInvalidFileType);\n    } else if (\n      this.options.maxFiles != null &&\n      this.getAcceptedFiles().length >= this.options.maxFiles\n    ) {\n      done(\n        this.options.dictMaxFilesExceeded.replace(\"{{maxFiles}}\", String(this.options.maxFiles)),\n      );\n      this.emit(\"maxfilesexceeded\", file);\n    } else {\n      this.options.accept.call(this, file, done);\n    }\n  }\n\n  addFile(file: DropzoneFile) {\n    file.upload = {\n      uuid: Dropzone.uuidv4(),\n      progress: 0,\n      // Setting the total upload size to file.size for the beginning\n      // It's actual different than the size to be transmitted.\n      total: file.size,\n      bytesSent: 0,\n      filename: this._renameFile(file),\n      // Not setting chunking information here, because the acutal data — and\n      // thus the chunks — might change if `options.transformFile` is set\n      // and does something to the data.\n    };\n    this.files.push(file);\n\n    file.status = Dropzone.ADDED;\n\n    this.emit(\"addedfile\", file);\n\n    this._enqueueThumbnail(file);\n\n    this.accept(file, (error: any) => {\n      if (error) {\n        file.accepted = false;\n        this._errorProcessing([file], error); // Will set the file.status\n      } else {\n        file.accepted = true;\n        if (this.options.autoQueue) {\n          this.enqueueFile(file);\n        } // Will set .accepted = true\n      }\n      this._updateMaxFilesReachedClass();\n    });\n  }\n\n  // Wrapper for enqueueFile\n  enqueueFiles(files: DropzoneFile[]) {\n    for (let file of files) {\n      this.enqueueFile(file);\n    }\n    return null;\n  }\n\n  enqueueFile(file: DropzoneFile) {\n    if (file.status === Dropzone.ADDED && file.accepted === true) {\n      file.status = Dropzone.QUEUED;\n      if (this.options.autoProcessQueue) {\n        return setTimeout(() => this.processQueue(), 0); // Deferring the call\n      }\n    } else {\n      throw new Error(\n        \"This file can't be queued because it has already been processed or was rejected.\",\n      );\n    }\n    return undefined;\n  }\n\n  _enqueueThumbnail(file: DropzoneFile) {\n    if (\n      this.options.createImageThumbnails &&\n      file.type.match(/image.*/) &&\n      file.size <= this.options.maxThumbnailFilesize * 1024 * 1024\n    ) {\n      this._thumbnailQueue.push(file);\n      return setTimeout(() => this._processThumbnailQueue(), 0); // Deferring the call\n    }\n    return undefined;\n  }\n\n  _processThumbnailQueue() {\n    if (this._processingThumbnail || this._thumbnailQueue.length === 0) {\n      return;\n    }\n\n    this._processingThumbnail = true;\n    let file = this._thumbnailQueue.shift();\n    return this.createThumbnail(\n      file!,\n      this.options.thumbnailWidth,\n      this.options.thumbnailHeight,\n      this.options.thumbnailMethod,\n      true,\n      (dataUrl: string | Event) => {\n        // Both failure paths -- the file not being readable, and the image\n        // not being decodable -- hand the callback the error event. Emitting\n        // that as a thumbnail would set the preview's `img.src` to\n        // \"[object Event]\" and render a broken image. See #2218 and #2365.\n        if (typeof dataUrl === \"string\") {\n          this.emit(\"thumbnail\", file, dataUrl);\n        } else {\n          this.emit(\"error\", file, this.options.dictThumbnailError);\n        }\n        this._processingThumbnail = false;\n        return this._processThumbnailQueue();\n      },\n    );\n  }\n\n  // Can be called by the user to remove a file\n  removeFile(file: DropzoneFile) {\n    if (file.status === Dropzone.UPLOADING) {\n      this.cancelUpload(file);\n    }\n    this.files = without(this.files, file);\n\n    this.emit(\"removedfile\", file);\n    if (this.files.length === 0) {\n      return this.emit(\"reset\");\n    }\n    return undefined;\n  }\n\n  // Removes all files that aren't currently processed from the list\n  removeAllFiles(cancelIfNecessary: boolean) {\n    // Create a copy of files since removeFile() changes the @files array.\n    if (cancelIfNecessary == null) {\n      cancelIfNecessary = false;\n    }\n    for (let file of this.files.slice()) {\n      if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {\n        this.removeFile(file);\n      }\n    }\n    return null;\n  }\n\n  // Resizes an image before it gets sent to the server. This function is the default behavior of\n  // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with\n  // the resized blob.\n  resizeImage(\n    file: DropzoneFile,\n    width: number | null,\n    height: number | null,\n    resizeMethod: string,\n    callback: DropzoneTransformCallback,\n  ) {\n    return this.createThumbnail(\n      file,\n      width,\n      height,\n      resizeMethod,\n      true,\n      (dataUrl: string | Event, canvas?: HTMLCanvasElement | null) => {\n        if (canvas == null) {\n          // The image has not been resized, or could not be read or decoded at\n          // all -- either way there is nothing to send but the original file.\n          return callback(file);\n        } else {\n          let { resizeMimeType } = this.options;\n          if (resizeMimeType == null) {\n            resizeMimeType = file.type;\n          }\n          if (this.options.resizeTransparencyFill != null) {\n            // Painted *underneath* what has already been drawn, so the color\n            // only shows through where the image is actually transparent. Doing\n            // it here rather than before the draw keeps it off the preview\n            // thumbnails, which are encoded as PNG and keep their transparency.\n            let ctx = canvas.getContext(\"2d\")!;\n            ctx.globalCompositeOperation = \"destination-over\";\n            ctx.fillStyle = this.options.resizeTransparencyFill;\n            ctx.fillRect(0, 0, canvas.width, canvas.height);\n          }\n\n          let resizedDataURL = canvas.toDataURL(resizeMimeType, this.options.resizeQuality);\n          if (resizeMimeType === \"image/jpeg\" || resizeMimeType === \"image/jpg\") {\n            // Now add the original EXIF information\n            resizedDataURL = ExifRestore.restore(file.dataURL!, resizedDataURL);\n          }\n          return callback(Dropzone.dataURItoBlob(resizedDataURL));\n        }\n      },\n    );\n  }\n\n  createThumbnail(\n    file: DropzoneFile,\n    width: number | null,\n    height: number | null,\n    resizeMethod: string,\n    fixOrientation: boolean,\n    callback: DropzoneThumbnailCallback,\n  ) {\n    let fileReader = new FileReader();\n\n    fileReader.onload = () => {\n      file.dataURL = fileReader.result as string;\n\n      // Don't bother creating a thumbnail for SVG images since they're vector\n      if (file.type === \"image/svg+xml\") {\n        if (callback != null) {\n          callback(fileReader.result as string);\n        }\n        return;\n      }\n\n      this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);\n    };\n\n    // A file that cannot be read -- moved, locked by another process, or on a\n    // drive that went away since it was dropped -- fires `error` and never\n    // `load`. Without this the callback is never invoked at all, which leaves\n    // `_processThumbnailQueue` holding its lock forever: no later file gets a\n    // thumbnail, and an upload waiting on `transformFile` never sends. See\n    // #2365.\n    fileReader.onerror = (e) => {\n      if (callback != null) {\n        callback(e);\n      }\n    };\n\n    fileReader.readAsDataURL(file);\n  }\n\n  // `mockFile` needs to have these attributes:\n  //\n  //     { name: 'name', size: 12345, imageUrl: '' }\n  //\n  // `callback` will be invoked when the image has been downloaded and displayed.\n  // `crossOrigin` will be added to the `img` tag when accessing the file.\n  displayExistingFile(\n    mockFile: DropzoneFile,\n    imageUrl: string,\n    callback: (() => void) | null,\n    crossOrigin: string,\n    resizeThumbnail = true,\n  ) {\n    this.emit(\"addedfile\", mockFile);\n    this.emit(\"complete\", mockFile);\n\n    if (!resizeThumbnail) {\n      this.emit(\"thumbnail\", mockFile, imageUrl);\n      if (callback) callback();\n    } else {\n      let onDone = (thumbnail: string | Event) => {\n        // An image URL that does not load -- gone from the server, or blocked\n        // by CORS -- arrives here as the error event. Emitting that as a\n        // thumbnail would set the preview's `img.src` to \"[object Event]\", so\n        // leave the preview alone and just report that we are done.\n        if (typeof thumbnail === \"string\") {\n          this.emit(\"thumbnail\", mockFile, thumbnail);\n        }\n        if (callback) callback();\n      };\n      mockFile.dataURL = imageUrl;\n\n      this.createThumbnailFromUrl(\n        mockFile,\n        this.options.thumbnailWidth,\n        this.options.thumbnailHeight,\n        this.options.thumbnailMethod,\n        // There is no fixOrientation option: this read was always undefined,\n        // and the value is only ever tested for truthiness.\n        false,\n        onDone,\n        crossOrigin,\n      );\n    }\n  }\n\n  createThumbnailFromUrl(\n    file: DropzoneFile,\n    width: number | null,\n    height: number | null,\n    resizeMethod: string,\n    fixOrientation: boolean,\n    callback: DropzoneThumbnailCallback,\n    crossOrigin?: string,\n  ) {\n    // Not using `new Image` here because of a bug in latest Chrome versions.\n    // See https://github.com/enyo/dropzone/pull/226\n    let img = document.createElement(\"img\");\n\n    if (crossOrigin) {\n      img.crossOrigin = crossOrigin;\n    }\n\n    // fixOrientation is not needed anymore with browsers handling imageOrientation\n    fixOrientation =\n      getComputedStyle(document.body)[\"imageOrientation\"] == \"from-image\" ? false : fixOrientation;\n\n    img.onload = () => {\n      let loadExif = (callback: (orientation: number) => void) => callback(1);\n      if (typeof EXIF !== \"undefined\" && EXIF !== null && fixOrientation) {\n        loadExif = (callback: (orientation: number) => void) =>\n          EXIF.getData(img, function (this: any) {\n            return callback(EXIF.getTag(this as any, \"Orientation\"));\n          });\n      }\n\n      return loadExif((orientation: number) => {\n        file.width = img.width;\n        file.height = img.height;\n\n        let resizeInfo = this.options.resize.call(this, file, width, height, resizeMethod);\n\n        let canvas = document.createElement(\"canvas\");\n        let ctx = canvas.getContext(\"2d\")!;\n\n        canvas.width = resizeInfo.trgWidth;\n        canvas.height = resizeInfo.trgHeight;\n\n        if (orientation > 4) {\n          canvas.width = resizeInfo.trgHeight;\n          canvas.height = resizeInfo.trgWidth;\n        }\n\n        switch (orientation) {\n          case 2:\n            // horizontal flip\n            ctx.translate(canvas.width, 0);\n            ctx.scale(-1, 1);\n            break;\n          case 3:\n            // 180° rotate left\n            ctx.translate(canvas.width, canvas.height);\n            ctx.rotate(Math.PI);\n            break;\n          case 4:\n            // vertical flip\n            ctx.translate(0, canvas.height);\n            ctx.scale(1, -1);\n            break;\n          case 5:\n            // vertical flip + 90 rotate right\n            ctx.rotate(0.5 * Math.PI);\n            ctx.scale(1, -1);\n            break;\n          case 6:\n            // 90° rotate right\n            ctx.rotate(0.5 * Math.PI);\n            ctx.translate(0, -canvas.width);\n            break;\n          case 7:\n            // horizontal flip + 90 rotate right\n            ctx.rotate(0.5 * Math.PI);\n            ctx.translate(canvas.height, -canvas.width);\n            ctx.scale(-1, 1);\n            break;\n          case 8:\n            // 90° rotate left\n            ctx.rotate(-0.5 * Math.PI);\n            ctx.translate(-canvas.height, 0);\n            break;\n        }\n\n        // This is a bugfix for iOS' scaling bug.\n        drawImageIOSFix(\n          ctx,\n          img,\n          resizeInfo.srcX != null ? resizeInfo.srcX : 0,\n          resizeInfo.srcY != null ? resizeInfo.srcY : 0,\n          resizeInfo.srcWidth,\n          resizeInfo.srcHeight,\n          resizeInfo.trgX != null ? resizeInfo.trgX : 0,\n          resizeInfo.trgY != null ? resizeInfo.trgY : 0,\n          resizeInfo.trgWidth,\n          resizeInfo.trgHeight,\n        );\n\n        let thumbnail = canvas.toDataURL(\"image/png\");\n\n        if (callback != null) {\n          return callback(thumbnail, canvas);\n        }\n      });\n    };\n\n    if (callback != null) {\n      // The same callback does double duty: it receives the thumbnail on\n      // success, and the error event on failure.\n      img.onerror = (e) => callback(e);\n    }\n\n    return (img.src = file.dataURL!);\n  }\n\n  // Goes through the queue and processes files if there aren't too many already.\n  processQueue() {\n    let { parallelUploads } = this.options;\n    let processingLength = this.getUploadingFiles().length;\n    let i = processingLength;\n\n    // There are already at least as many files uploading than should be\n    if (processingLength >= parallelUploads) {\n      return;\n    }\n\n    let queuedFiles = this.getQueuedFiles();\n\n    if (!(queuedFiles.length > 0)) {\n      return;\n    }\n\n    if (this.options.uploadMultiple) {\n      // The files should be uploaded in one request\n      return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));\n    } else {\n      while (i < parallelUploads) {\n        if (!queuedFiles.length) {\n          return;\n        } // Nothing left to process\n        this.processFile(queuedFiles.shift()!);\n        i++;\n      }\n    }\n  }\n\n  // Wrapper for `processFiles`\n  processFile(file: DropzoneFile) {\n    return this.processFiles([file]);\n  }\n\n  // Loads the file, then calls finishedLoading()\n  processFiles(files: DropzoneFile[]) {\n    for (let file of files) {\n      file.processing = true; // Backwards compatibility\n      file.status = Dropzone.UPLOADING;\n\n      this.emit(\"processing\", file);\n    }\n\n    if (this.options.uploadMultiple) {\n      this.emit(\"processingmultiple\", files);\n    }\n\n    return this.uploadFiles(files);\n  }\n\n  _getFilesWithXhr(xhr: XMLHttpRequest) {\n    return this.files.filter((file) => file.xhr === xhr).map((file) => file);\n  }\n\n  // Cancels the file upload and sets the status to CANCELED\n  // **if** the file is actually being uploaded.\n  // If it's still in the queue, the file is being removed from it and the status\n  // set to CANCELED.\n  cancelUpload(file: DropzoneFile) {\n    if (file.status === Dropzone.UPLOADING) {\n      let groupedFiles = this._getFilesWithXhr(file.xhr!);\n      for (let groupedFile of groupedFiles) {\n        groupedFile.status = Dropzone.CANCELED;\n      }\n      if (file.upload.chunked && file.upload.chunks) {\n        // `file.xhr` only ever holds the request that started last, so with\n        // `parallelChunkUploads` aborting it leaves every other chunk\n        // streaming to the server for a file the user has already canceled.\n        // Each chunk keeps its own request, so abort them all. See #2366.\n        for (let chunk of file.upload.chunks) {\n          if (chunk && chunk.xhr && chunk.status === Dropzone.UPLOADING) {\n            chunk.status = Dropzone.CANCELED;\n            chunk.xhr.abort();\n          }\n        }\n      } else if (typeof file.xhr !== \"undefined\") {\n        file.xhr.abort();\n      }\n      for (let groupedFile of groupedFiles) {\n        this.emit(\"canceled\", groupedFile);\n      }\n      if (this.options.uploadMultiple) {\n        this.emit(\"canceledmultiple\", groupedFiles);\n      }\n    } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {\n      file.status = Dropzone.CANCELED;\n      this.emit(\"canceled\", file);\n      if (this.options.uploadMultiple) {\n        this.emit(\"canceledmultiple\", [file]);\n      }\n    }\n\n    if (this.options.autoProcessQueue) {\n      return this.processQueue();\n    }\n  }\n\n  resolveOption(option: any, ...args: any[]) {\n    if (typeof option === \"function\") {\n      return option.apply(this, args);\n    }\n    return option;\n  }\n\n  uploadFile(file: DropzoneFile) {\n    return this.uploadFiles([file]);\n  }\n\n  uploadFiles(files: DropzoneFile[]) {\n    this._transformFiles(files, (transformedFiles: (DropzoneFile | Blob)[]) => {\n      // Options are often read straight out of markup or a config file, so\n      // `chunkSize` can arrive as a string. `start + \"2097152\"` would then\n      // concatenate instead of adding, and every chunk after the first would\n      // be sliced at the wrong offset. See #1988.\n      let chunkSize = Number(this.options.chunkSize);\n\n      if (this.options.chunking) {\n        // Chunking is not allowed to be used with `uploadMultiple` so we know\n        // that there is only __one__file.\n        let transformedFile = transformedFiles[0];\n        files[0].upload.chunked =\n          this.options.chunking && (this.options.forceChunking || transformedFile.size > chunkSize);\n        // An empty file still has to be sent, otherwise it would have no\n        // chunks at all, `handleNextChunk` would return immediately and the\n        // upload would hang forever. See #1982.\n        files[0].upload.totalChunkCount = Math.max(1, Math.ceil(transformedFile.size / chunkSize));\n      }\n\n      if (files[0].upload.chunked) {\n        // This file should be sent in chunks!\n\n        // If the chunking option is set, we **know** that there can only be **one** file, since\n        // uploadMultiple is not allowed with this option.\n        let file = files[0];\n        let transformedFile = transformedFiles[0];\n        file.upload.chunks = [];\n\n        let handleNextChunk = () => {\n          let chunkIndex = 0;\n\n          // Find the next item in file.upload.chunks! that is not defined yet.\n          while (file.upload.chunks![chunkIndex] !== undefined) {\n            chunkIndex++;\n          }\n\n          // This means, that all chunks have already been started.\n          if (chunkIndex >= file.upload.totalChunkCount!) return;\n\n          let start = chunkIndex * chunkSize;\n          let end = Math.min(start + chunkSize, transformedFile.size);\n\n          let dataBlock = {\n            name: this._getParamName(0),\n            // webkitSlice is the pre-standard name for Blob.slice, kept for\n            // old WebKit. It is on the 7.0 list for removal.\n            data: (transformedFile as any).webkitSlice\n              ? (transformedFile as any).webkitSlice(start, end)\n              : transformedFile.slice(start, end),\n            filename: file.upload.filename,\n            chunkIndex: chunkIndex,\n          };\n\n          file.upload.chunks![chunkIndex] = {\n            file: file,\n            index: chunkIndex,\n            dataBlock: dataBlock, // In case we want to retry.\n            status: Dropzone.UPLOADING,\n            progress: 0,\n            retries: 0, // The number of times this block has been retried.\n          };\n\n          this._uploadData(files, [dataBlock]);\n        };\n\n        file.upload.finishedChunkUpload = (chunk: any, response: any) => {\n          let allFinished = true;\n          chunk.status = Dropzone.SUCCESS;\n\n          // Clear the data from the chunk\n          chunk.dataBlock = null;\n          chunk.response = chunk.xhr.responseText;\n          chunk.responseHeaders = chunk.xhr.getAllResponseHeaders();\n          // Leaving this reference to xhr will cause memory leaks.\n          chunk.xhr = null;\n\n          for (let i = 0; i < file.upload.totalChunkCount!; i++) {\n            if (file.upload.chunks![i] === undefined) {\n              return handleNextChunk();\n            }\n            if (file.upload.chunks![i].status !== Dropzone.SUCCESS) {\n              allFinished = false;\n            }\n          }\n\n          if (allFinished) {\n            this.options.chunksUploaded(file, () => {\n              this._finished(files, response, null);\n            });\n          }\n        };\n\n        if (this.options.parallelChunkUploads) {\n          // Starting every chunk at once means a large file arrives as\n          // hundreds of simultaneous requests -- HTTP/1.1 queues most of them\n          // in the browser, but over HTTP/2 they all reach the server\n          // together. `true` defers to parallelUploads; a number sets its own\n          // limit. Whatever does not start now is picked up by\n          // finishedChunkUpload as earlier chunks complete.\n          let limit =\n            this.options.parallelChunkUploads === true\n              ? this.options.parallelUploads\n              : this.options.parallelChunkUploads;\n\n          // At least one, or nothing would ever start.\n          let startCount = Math.max(1, Math.min(limit, file.upload.totalChunkCount!));\n          for (let i = 0; i < startCount; i++) {\n            handleNextChunk();\n          }\n        } else {\n          handleNextChunk();\n        }\n      } else {\n        let dataBlocks = [];\n        for (let i = 0; i < files.length; i++) {\n          dataBlocks[i] = {\n            name: this._getParamName(i),\n            data: transformedFiles[i],\n            filename: files[i].upload.filename,\n          };\n        }\n        this._uploadData(files, dataBlocks);\n      }\n    });\n  }\n\n  /// Returns the right chunk for given file and xhr\n  _getChunk(file: DropzoneFile, xhr: XMLHttpRequest): DropzoneChunk | undefined {\n    for (let i = 0; i < file.upload.totalChunkCount!; i++) {\n      if (file.upload.chunks![i] !== undefined && file.upload.chunks![i].xhr === xhr) {\n        return file.upload.chunks![i];\n      }\n    }\n    return undefined;\n  }\n\n  // This function actually uploads the file(s) to the server.\n  //\n  //  If dataBlocks contains the actual data to upload (meaning, that this could\n  // either be transformed files, or individual chunks for chunked upload) then\n  // they will be used for the actual data to upload.\n  _uploadData(files: DropzoneFile[], dataBlocks: any[]) {\n    let xhr = new XMLHttpRequest();\n\n    // Put the xhr object in the file objects to be able to reference it later.\n    for (let file of files) {\n      file.xhr = xhr;\n    }\n    if (files[0].upload.chunked) {\n      // Put the xhr object in the right chunk object, so it can be associated\n      // later, and found with _getChunk.\n      files[0].upload.chunks![dataBlocks[0].chunkIndex].xhr = xhr;\n    }\n\n    let method = this.resolveOption(this.options.method, files, dataBlocks);\n    let url = this.resolveOption(this.options.url, files, dataBlocks);\n    xhr.open(method, url, true);\n\n    // Setting the timeout after open because of IE11 issue\n    let timeout = this.resolveOption(this.options.timeout, files);\n    if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files);\n\n    // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n    xhr.withCredentials = !!this.options.withCredentials;\n\n    xhr.onload = (e) => {\n      this._finishedUploading(files, xhr, e);\n    };\n\n    xhr.ontimeout = () => {\n      this._handleUploadError(\n        files,\n        xhr,\n        `Request timedout after ${this.options.timeout! / 1000} seconds`,\n      );\n    };\n\n    xhr.onerror = () => {\n      this._handleUploadError(files, xhr);\n    };\n\n    // Some browsers do not have the .upload property\n    let progressObj = xhr.upload != null ? xhr.upload : xhr;\n    progressObj.onprogress = (e) => this._updateFilesUploadProgress(files, xhr, e);\n\n    let headers: Record<string, string> = this.options.defaultHeaders\n      ? {\n          Accept: \"application/json\",\n          \"Cache-Control\": \"no-cache\",\n          \"X-Requested-With\": \"XMLHttpRequest\",\n        }\n      : {};\n\n    if (this.options.binaryBody) {\n      headers[\"Content-Type\"] = files[0].type;\n    }\n\n    if (this.options.headers) {\n      extend(headers, this.options.headers);\n    }\n\n    for (let headerName in headers) {\n      let headerValue = headers[headerName];\n      if (headerValue) {\n        xhr.setRequestHeader(headerName, headerValue);\n      }\n    }\n\n    if (this.options.binaryBody) {\n      // Since the file is going to be sent as binary body, it doesn't make\n      // any sense to generate `FormData` for it.\n      for (let file of files) {\n        this.emit(\"sending\", file, xhr);\n      }\n      if (this.options.uploadMultiple) {\n        this.emit(\"sendingmultiple\", files, xhr);\n      }\n      this.submitRequest(xhr, null as any, files);\n    } else {\n      let formData = new FormData();\n\n      // Adding all @options parameters\n      if (this.options.params) {\n        let additionalParams = this.options.params;\n        if (typeof additionalParams === \"function\") {\n          additionalParams = (additionalParams as any).call(\n            this,\n            files,\n            xhr,\n            files[0].upload.chunked ? this._getChunk(files[0], xhr) : null,\n          );\n        }\n\n        for (let key in additionalParams) {\n          let value = (additionalParams as any)[key];\n          if (Array.isArray(value)) {\n            // The additional parameter contains an array,\n            // so lets iterate over it to attach each value\n            // individually.\n            for (let i = 0; i < value.length; i++) {\n              formData.append(key, value[i]);\n            }\n          } else {\n            formData.append(key, value);\n          }\n        }\n      }\n\n      // Let the user add additional data if necessary\n      for (let file of files) {\n        this.emit(\"sending\", file, xhr, formData);\n      }\n      if (this.options.uploadMultiple) {\n        this.emit(\"sendingmultiple\", files, xhr, formData);\n      }\n\n      this._addFormElementData(formData);\n\n      // Finally add the files\n      // Has to be last because some servers (eg: S3) expect the file to be the last parameter\n      for (let i = 0; i < dataBlocks.length; i++) {\n        let dataBlock = dataBlocks[i];\n        formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);\n      }\n\n      this.submitRequest(xhr, formData, files);\n    }\n  }\n\n  // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.\n  _transformFiles(files: DropzoneFile[], done: (files: (DropzoneFile | Blob)[]) => void) {\n    let transformedFiles = [];\n    // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n    let doneCounter = 0;\n    for (let i = 0; i < files.length; i++) {\n      this.options.transformFile.call(this, files[i], (transformedFile: any) => {\n        transformedFiles[i] = transformedFile;\n        if (++doneCounter === files.length) {\n          done(transformedFiles);\n        }\n      });\n    }\n  }\n\n  // Takes care of adding other input elements of the form to the AJAX request\n  _addFormElementData(formData: FormData) {\n    // Take care of other input elements\n    if (this.element.tagName === \"FORM\") {\n      for (let input of this.element.querySelectorAll(\"input, textarea, select, button\")) {\n        let inputName = input.getAttribute(\"name\");\n        let inputType = input.getAttribute(\"type\");\n        if (inputType) inputType = inputType.toLowerCase();\n\n        // If the input doesn't have a name, we can't use it.\n        if (typeof inputName === \"undefined\" || inputName === null) continue;\n\n        if (input.tagName === \"SELECT\" && input.hasAttribute(\"multiple\")) {\n          // Possibly multiple values\n          for (let option of (input as HTMLSelectElement).options) {\n            if (option.selected) {\n              formData.append(inputName, option.value);\n            }\n          }\n        } else if (\n          !inputType ||\n          (inputType !== \"checkbox\" && inputType !== \"radio\") ||\n          (input as HTMLInputElement).checked\n        ) {\n          formData.append(inputName, (input as HTMLInputElement).value);\n        }\n      }\n    }\n  }\n\n  // Invoked when there is new progress information about given files.\n  // If e is not provided, it is assumed that the upload is finished.\n  _updateFilesUploadProgress(files: DropzoneFile[], xhr: XMLHttpRequest, e?: any) {\n    if (!files[0].upload.chunked) {\n      // Handle file uploads without chunking\n      for (let file of files) {\n        if (\n          file.upload.total &&\n          file.upload.bytesSent &&\n          file.upload.bytesSent == file.upload.total\n        ) {\n          // If both, the `total` and `bytesSent` have already been set, and\n          // they are equal (meaning progress is at 100%), we can skip this\n          // file, since an upload progress shouldn't go down.\n          continue;\n        }\n\n        if (e) {\n          file.upload.progress = (100 * e.loaded) / e.total;\n          file.upload.total = e.total;\n          file.upload.bytesSent = e.loaded;\n        } else {\n          // No event, so we're at 100%\n          file.upload.progress = 100;\n          file.upload.bytesSent = file.upload.total;\n        }\n\n        this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n      }\n    } else {\n      // Handle chunked file uploads\n\n      // Chunked upload is not compatible with uploading multiple files in one\n      // request, so we know there's only one file.\n      let file = files[0];\n\n      // Since this is a chunked upload, we need to update the appropriate chunk\n      // progress.\n      let chunk = this._getChunk(file, xhr)!;\n\n      if (e) {\n        chunk.progress = (100 * e.loaded) / e.total;\n        chunk.total = e.total;\n        chunk.bytesSent = e.loaded;\n      } else {\n        // No event, so we're at 100%\n        chunk.progress = 100;\n        chunk.bytesSent = chunk.total;\n      }\n\n      // Now tally the *file* upload progress from its individual chunks\n      file.upload.progress = 0;\n      file.upload.total = 0;\n      file.upload.bytesSent = 0;\n      for (let i = 0; i < file.upload.totalChunkCount!; i++) {\n        if (file.upload.chunks![i] && typeof file.upload.chunks![i].progress !== \"undefined\") {\n          file.upload.progress += file.upload.chunks![i].progress;\n          file.upload.total += file.upload.chunks![i].total!;\n          file.upload.bytesSent += file.upload.chunks![i].bytesSent!;\n        }\n      }\n      // Since the process is a percentage, we need to divide by the amount of\n      // chunks we've used.\n      file.upload.progress = file.upload.progress / file.upload.totalChunkCount!;\n\n      this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n    }\n  }\n\n  _finishedUploading(files: DropzoneFile[], xhr: XMLHttpRequest, e: any) {\n    let response;\n\n    if (files[0].status === Dropzone.CANCELED) {\n      return;\n    }\n\n    if (xhr.readyState !== 4) {\n      return;\n    }\n\n    if (xhr.responseType !== \"arraybuffer\" && xhr.responseType !== \"blob\") {\n      response = xhr.responseText;\n\n      if (\n        xhr.getResponseHeader(\"content-type\") &&\n        ~xhr.getResponseHeader(\"content-type\")!.indexOf(\"application/json\")\n      ) {\n        try {\n          response = JSON.parse(response);\n        } catch (error) {\n          e = error;\n          response = \"Invalid JSON response from server.\";\n        }\n      }\n    }\n\n    this._updateFilesUploadProgress(files, xhr);\n\n    if (!(200 <= xhr.status && xhr.status < 300)) {\n      this._handleUploadError(files, xhr, response);\n    } else {\n      if (files[0].upload.chunked) {\n        files[0].upload.finishedChunkUpload!(this._getChunk(files[0], xhr)!, response);\n      } else {\n        this._finished(files, response, e);\n      }\n    }\n  }\n\n  _handleUploadError(files: DropzoneFile[], xhr: XMLHttpRequest, response?: any) {\n    if (files[0].status === Dropzone.CANCELED) {\n      return;\n    }\n\n    if (files[0].upload.chunked && this.options.retryChunks) {\n      let chunk = this._getChunk(files[0], xhr)!;\n      if (chunk.retries++ < this.options.retryChunksLimit) {\n        this._uploadData(files, [chunk.dataBlock]);\n        return;\n      } else {\n        console.warn(\"Retried this chunk too often. Giving up.\");\n      }\n    }\n\n    this._errorProcessing(\n      files,\n      response || this.options.dictResponseError.replace(\"{{statusCode}}\", String(xhr.status)),\n      xhr,\n    );\n  }\n\n  submitRequest(xhr: XMLHttpRequest, formData: FormData, files: DropzoneFile[]) {\n    if (xhr.readyState != 1) {\n      console.warn(\"Cannot send this request because the XMLHttpRequest.readyState is not OPENED.\");\n      return;\n    }\n    if (this.options.binaryBody) {\n      if (files[0].upload.chunked) {\n        const chunk = this._getChunk(files[0], xhr)!;\n        xhr.send(chunk.dataBlock.data);\n      } else {\n        xhr.send(files[0]);\n      }\n    } else {\n      xhr.send(formData);\n    }\n  }\n\n  // Called internally when processing is finished.\n  // Individual callbacks have to be called in the appropriate sections.\n  _finished(files: DropzoneFile[], responseText: string, e: any) {\n    for (let file of files) {\n      file.status = Dropzone.SUCCESS;\n      this.emit(\"success\", file, responseText, e);\n      this.emit(\"complete\", file);\n    }\n    if (this.options.uploadMultiple) {\n      this.emit(\"successmultiple\", files, responseText, e);\n      this.emit(\"completemultiple\", files);\n    }\n\n    if (this.options.autoProcessQueue) {\n      return this.processQueue();\n    }\n  }\n\n  // Called internally when processing is finished.\n  // Individual callbacks have to be called in the appropriate sections.\n  _errorProcessing(files: DropzoneFile[], message: string, xhr?: XMLHttpRequest) {\n    for (let file of files) {\n      file.status = Dropzone.ERROR;\n      this.emit(\"error\", file, message, xhr);\n      this.emit(\"complete\", file);\n    }\n    if (this.options.uploadMultiple) {\n      this.emit(\"errormultiple\", files, message, xhr);\n      this.emit(\"completemultiple\", files);\n    }\n\n    if (this.options.autoProcessQueue) {\n      return this.processQueue();\n    }\n  }\n\n  static uuidv4() {\n    return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n      let r = (Math.random() * 16) | 0,\n        v = c === \"x\" ? r : (r & 0x3) | 0x8;\n      return v.toString(16);\n    });\n  }\n\n  // This is a map of options for your different dropzones. Add configurations\n  // to this object for your different dropzone elemens.\n  //\n  // Example:\n  //\n  //     Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };\n  //\n  // And in html:\n  //\n  //     <form action=\"/upload\" id=\"my-dropzone-element-id\" class=\"dropzone\"></form>\n  static options: Record<string, DropzoneOptions | false> = {};\n\n  // Returns the options for an element or undefined if none available.\n  static optionsForElement(element: HTMLElement): DropzoneOptions | false | undefined {\n    // Get the `Dropzone.options.elementId` for this element if it exists\n    if (element.getAttribute(\"id\")) {\n      return Dropzone.options[camelize(element.getAttribute(\"id\")!)];\n    } else {\n      return undefined;\n    }\n  }\n\n  // Holds a list of all dropzone instances\n  static instances: Dropzone[] = [];\n\n  // Returns the dropzone for given element if any\n  static forElement(element: HTMLElement | string): Dropzone {\n    if (typeof element === \"string\") {\n      element = document.querySelector(element) as HTMLElement;\n    }\n    if ((element != null ? (element as any).dropzone : undefined) == null) {\n      throw new Error(\n        \"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.\",\n      );\n    }\n    return (element as any).dropzone;\n  }\n\n  // Looks for all .dropzone elements and creates a dropzone for them\n  static discover(): (Dropzone | undefined)[] {\n    let dropzones;\n    if (document.querySelectorAll) {\n      dropzones = document.querySelectorAll(\".dropzone\");\n    } else {\n      dropzones = [];\n      // IE :(\n      let checkElements = (elements: any[]) =>\n        (() => {\n          let result = [];\n          for (let el of elements) {\n            if (/(^| )dropzone($| )/.test(el.className)) {\n              result.push(dropzones.push(el));\n            } else {\n              result.push(undefined);\n            }\n          }\n          return result;\n        })();\n      checkElements([...document.getElementsByTagName(\"div\")]);\n      checkElements([...document.getElementsByTagName(\"form\")]);\n    }\n\n    return (() => {\n      let result = [];\n      for (let dropzone of dropzones) {\n        // Create a dropzone unless auto discover has been disabled for specific element\n        if (Dropzone.optionsForElement(dropzone) !== false) {\n          result.push(new Dropzone(dropzone));\n        } else {\n          result.push(undefined);\n        }\n      }\n      return result;\n    })();\n  }\n\n  // Some browsers support drag and drog functionality, but not correctly.\n  //\n  // So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.\n  // But what to do when browsers *theoretically* support an API, but crash\n  // when using it.\n  //\n  // This is a list of regular expressions tested against navigator.userAgent\n  //\n  // ** It should only be used on browser that *do* support the API, but\n  // incorrectly **\n  static blockedBrowsers = [\n    // The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.\n    /opera.*(Macintosh|Windows Phone).*version\\/12/i,\n  ];\n\n  // Checks if the browser is supported\n  static isBrowserSupported(): boolean {\n    let capableBrowser = true;\n\n    if (\n      window.File &&\n      window.FileReader &&\n      window.FileList &&\n      window.Blob &&\n      window.FormData &&\n      (document as any).querySelector\n    ) {\n      if (!(\"classList\" in document.createElement(\"a\"))) {\n        capableBrowser = false;\n      } else {\n        if (Dropzone.blacklistedBrowsers !== undefined) {\n          // Since this has been renamed, this makes sure we don't break older\n          // configuration.\n          Dropzone.blockedBrowsers = Dropzone.blacklistedBrowsers;\n        }\n        // The browser supports the API, but may be blocked.\n        for (let regex of Dropzone.blockedBrowsers) {\n          if (regex.test(navigator.userAgent)) {\n            capableBrowser = false;\n            continue;\n          }\n        }\n      }\n    } else {\n      capableBrowser = false;\n    }\n\n    return capableBrowser;\n  }\n\n  static dataURItoBlob(dataURI: string): Blob {\n    // convert base64 to raw binary data held in a string\n    // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n    let byteString = atob(dataURI.split(\",\")[1]);\n\n    // separate out the mime component\n    let mimeString = dataURI.split(\",\")[0].split(\":\")[1].split(\";\")[0];\n\n    // write the bytes of the string to an ArrayBuffer\n    let ab = new ArrayBuffer(byteString.length);\n    let ia = new Uint8Array(ab);\n    for (\n      let i = 0, end = byteString.length, asc = 0 <= end;\n      asc ? i <= end : i >= end;\n      asc ? i++ : i--\n    ) {\n      ia[i] = byteString.charCodeAt(i);\n    }\n\n    // write the ArrayBuffer to a blob\n    return new Blob([ab], { type: mimeString });\n  }\n\n  // Creates an element from string\n  static createElement(string: string): HTMLElement {\n    let div = document.createElement(\"div\");\n    div.innerHTML = string;\n    return div.childNodes[0] as HTMLElement;\n  }\n\n  // Tests if given element is inside (or simply is) the container\n  static elementInside(element: Node, container: Node): boolean {\n    if (element === container) {\n      return true;\n    } // Coffeescript doesn't support do/while loops\n    while ((element = element.parentNode as Node)) {\n      if (element === container) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  static getElement(el: HTMLElement | string, name: string): HTMLElement {\n    let element;\n    if (typeof el === \"string\") {\n      element = document.querySelector(el) as HTMLElement;\n    } else if (el.nodeType != null) {\n      element = el;\n    }\n    if (element == null) {\n      throw new Error(\n        `Invalid \\`${name}\\` option provided. Please provide a CSS selector or a plain HTML element.`,\n      );\n    }\n    return element;\n  }\n\n  static getElements(els: any, name: string): HTMLElement[] {\n    let el, elements;\n    if (els instanceof Array) {\n      elements = [];\n      try {\n        for (el of els) {\n          elements.push(this.getElement(el, name));\n        }\n      } catch (e) {\n        elements = null;\n      }\n    } else if (typeof els === \"string\") {\n      elements = [];\n      for (el of document.querySelectorAll(els)) {\n        elements.push(el);\n      }\n    } else if (els.nodeType != null) {\n      elements = [els];\n    }\n\n    if (elements == null || !elements.length) {\n      throw new Error(\n        `Invalid \\`${name}\\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`,\n      );\n    }\n\n    return elements;\n  }\n\n  // Asks the user the question and calls accepted or rejected accordingly\n  //\n  // The default implementation just uses `window.confirm` and then calls the\n  // appropriate callback.\n  static confirm(question: string, accepted: () => void, rejected?: () => void): void {\n    if (window.confirm(question)) {\n      return accepted();\n    } else if (rejected != null) {\n      return rejected();\n    }\n  }\n\n  // Validates the mime type like this:\n  //\n  // https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept\n  static isValidFile(file: DropzoneFile, acceptedFiles: string | string[] | null): boolean {\n    if (!acceptedFiles) {\n      return true;\n    } // If there are no accepted mime types, it's OK\n    acceptedFiles = typeof acceptedFiles === \"string\" ? acceptedFiles.split(\",\") : acceptedFiles;\n\n    let mimeType = file.type;\n    let baseMimeType = mimeType.replace(/\\/.*$/, \"\");\n\n    for (let validType of acceptedFiles) {\n      validType = validType.trim();\n      if (validType.charAt(0) === \".\") {\n        if (\n          file.name\n            .toLowerCase()\n            .indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1\n        ) {\n          return true;\n        }\n      } else if (validType.endsWith(\"/*\")) {\n        // This is something like a image/* mime type\n        if (baseMimeType === validType.replace(/\\/.*$/, \"\")) {\n          return true;\n        }\n      } else {\n        if (mimeType === validType) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  // Dropzone file status codes\n  static ADDED = \"added\";\n\n  static QUEUED = \"queued\";\n\n  // For backwards compatibility. Now, if a file is accepted, it's either queued\n  // or uploading.\n  static ACCEPTED = Dropzone.QUEUED;\n\n  static UPLOADING = \"uploading\";\n\n  static PROCESSING = Dropzone.UPLOADING; // alias\n\n  static CANCELED = \"canceled\";\n\n  static ERROR = \"error\";\n\n  static SUCCESS = \"success\";\n}\n// Returns an array without the rejected item\nconst without = (list: any[], rejectedItem: any) =>\n  list.filter((item: any) => item !== rejectedItem).map((item: any) => item);\n\n// abc-def_ghi -> abcDefGhi\nconst camelize = (str: string) =>\n  str.replace(/[-_](\\w)/g, (match: any) => match.charAt(1).toUpperCase());\n\n// Augment jQuery\nif (typeof jQuery !== \"undefined\" && jQuery !== null) {\n  jQuery.fn.dropzone = function (options: any) {\n    return this.each(function (this: any) {\n      return new Dropzone(this as any, options);\n    });\n  };\n}\n\n/*\n\n Bugfix for iOS 6 and 7\n Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios\n based on the work of https://github.com/stomita/ios-imagefile-megapixel\n\n */\n\n// Detecting vertical squash in loaded image.\n// Fixes a bug which squash image vertically while drawing into canvas for some images.\n// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel\nlet detectVerticalSquash = function (img: HTMLImageElement) {\n  let ih = img.naturalHeight;\n  let canvas = document.createElement(\"canvas\");\n  canvas.width = 1;\n  canvas.height = ih;\n  let ctx = canvas.getContext(\"2d\")!;\n  ctx.drawImage(img, 0, 0);\n  let { data } = ctx.getImageData(1, 0, 1, ih);\n\n  // search image edge pixel position in case it is squashed vertically.\n  let sy = 0;\n  let ey = ih;\n  let py = ih;\n  while (py > sy) {\n    let alpha = data[(py - 1) * 4 + 3];\n\n    if (alpha === 0) {\n      ey = py;\n    } else {\n      sy = py;\n    }\n\n    py = (ey + sy) >> 1;\n  }\n  let ratio = py / ih;\n\n  if (ratio === 0) {\n    return 1;\n  } else {\n    return ratio;\n  }\n};\n\n// A replacement for context.drawImage\n// (args are for source and destination).\nvar drawImageIOSFix = function (\n  ctx: CanvasRenderingContext2D,\n  img: HTMLImageElement,\n  sx: number,\n  sy: number,\n  sw: number,\n  sh: number,\n  dx: number,\n  dy: number,\n  dw: number,\n  dh: number,\n) {\n  let vertSquashRatio = detectVerticalSquash(img);\n  return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);\n};\n\n// Based on MinifyJpeg\n// Source: http://www.perry.cz/files/ExifRestorer.js\n// http://elicon.blog57.fc2.com/blog-entry-206.html\nclass ExifRestore {\n  static KEY_STR: string;\n\n  static initClass() {\n    this.KEY_STR = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n  }\n\n  static encode64(input: any) {\n    let output = \"\";\n    let chr1: any = undefined;\n    let chr2: any = undefined;\n    let chr3: any = \"\";\n    let enc1: any = undefined;\n    let enc2: any = undefined;\n    let enc3: any = undefined;\n    let enc4: any = \"\";\n    let i = 0;\n    while (true) {\n      chr1 = input[i++];\n      chr2 = input[i++];\n      chr3 = input[i++];\n      enc1 = chr1 >> 2;\n      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n      enc4 = chr3 & 63;\n      if (isNaN(chr2)) {\n        enc3 = enc4 = 64;\n      } else if (isNaN(chr3)) {\n        enc4 = 64;\n      }\n      output =\n        output +\n        this.KEY_STR.charAt(enc1) +\n        this.KEY_STR.charAt(enc2) +\n        this.KEY_STR.charAt(enc3) +\n        this.KEY_STR.charAt(enc4);\n      chr1 = chr2 = chr3 = \"\";\n      enc1 = enc2 = enc3 = enc4 = \"\";\n      if (!(i < input.length)) {\n        break;\n      }\n    }\n    return output;\n  }\n\n  static restore(origFileBase64: string, resizedFileBase64: string) {\n    if (!origFileBase64.match(\"data:image/jpeg;base64,\")) {\n      return resizedFileBase64;\n    }\n    let rawImage = this.decode64(origFileBase64.replace(\"data:image/jpeg;base64,\", \"\"));\n    let segments = this.slice2Segments(rawImage);\n    let image = this.exifManipulation(resizedFileBase64, segments);\n    return `data:image/jpeg;base64,${this.encode64(image)}`;\n  }\n\n  static exifManipulation(resizedFileBase64: string, segments: any[]) {\n    let exifArray = this.getExifArray(segments);\n    let newImageArray = this.insertExif(resizedFileBase64, exifArray);\n    let aBuffer = new Uint8Array(newImageArray);\n    return aBuffer;\n  }\n\n  static getExifArray(segments: any[]) {\n    let seg = undefined;\n    let x = 0;\n    while (x < segments.length) {\n      seg = segments[x];\n      if (seg[0] === 255 && seg[1] === 225) {\n        return seg;\n      }\n      x++;\n    }\n    return [];\n  }\n\n  static insertExif(resizedFileBase64: string, exifArray: any[]) {\n    let imageData = resizedFileBase64.replace(\"data:image/jpeg;base64,\", \"\");\n    let buf = this.decode64(imageData);\n    let separatePoint = buf.indexOf(255, 3);\n    let mae = buf.slice(0, separatePoint);\n    let ato = buf.slice(separatePoint);\n    let array = mae;\n    array = array.concat(exifArray);\n    array = array.concat(ato);\n    return array;\n  }\n\n  static slice2Segments(rawImageArray: any[]) {\n    let head = 0;\n    let segments = [];\n    while (true) {\n      var length;\n      if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 218) {\n        break;\n      }\n      if (rawImageArray[head] === 255 && rawImageArray[head + 1] === 216) {\n        head += 2;\n      } else {\n        length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3];\n        let endPoint = head + length + 2;\n        let seg = rawImageArray.slice(head, endPoint);\n        segments.push(seg);\n        head = endPoint;\n      }\n      if (head > rawImageArray.length) {\n        break;\n      }\n    }\n    return segments;\n  }\n\n  static decode64(input: any) {\n    let chr1: any = undefined;\n    let chr2: any = undefined;\n    let chr3: any = \"\";\n    let enc1: any = undefined;\n    let enc2: any = undefined;\n    let enc3: any = undefined;\n    let enc4: any = \"\";\n    let i = 0;\n    let buf: number[] = [];\n    // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n    let base64test = /[^A-Za-z0-9+/=]/g;\n    if (base64test.exec(input)) {\n      console.warn(\n        \"There were invalid base64 characters in the input text.\\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\nExpect errors in decoding.\",\n      );\n    }\n    input = input.replace(/[^A-Za-z0-9+/=]/g, \"\");\n    while (true) {\n      enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n      enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n      enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n      enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n      chr1 = (enc1 << 2) | (enc2 >> 4);\n      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n      chr3 = ((enc3 & 3) << 6) | enc4;\n      buf.push(chr1);\n      if (enc3 !== 64) {\n        buf.push(chr2);\n      }\n      if (enc4 !== 64) {\n        buf.push(chr3);\n      }\n      chr1 = chr2 = chr3 = \"\";\n      enc1 = enc2 = enc3 = enc4 = \"\";\n      if (!(i < input.length)) {\n        break;\n      }\n    }\n    return buf;\n  }\n}\nExifRestore.initClass();\n\nfunction __guard__(value: any, transform: any) {\n  return typeof value !== \"undefined\" && value !== null ? transform(value) : undefined;\n}\nfunction __guardMethod__(obj: any, methodName: string, transform: any) {\n  if (typeof obj !== \"undefined\" && obj !== null && typeof obj[methodName] === \"function\") {\n    return transform(obj, methodName);\n  } else {\n    return undefined;\n  }\n}\n\nexport { Dropzone };\n"]}