element,\n // Preact thinks it’s the Uppy root element in there when doing a diff,\n // and destroys it. So we are creating a fragment (could be empty div)\n\n const uppyRootElement = document.createDocumentFragment(); // API for plugins that require a synchronous rerender.\n\n _classPrivateFieldLooseBase(this, _updateUI)[_updateUI] = debounce(state => {\n // plugin could be removed, but this.rerender is debounced below,\n // so it could still be called even after uppy.removePlugin or uppy.close\n // hence the check\n if (!this.uppy.getPlugin(this.id)) return;\n render(this.render(state), uppyRootElement);\n this.afterUpdate();\n });\n this.uppy.log(`Installing ${callerPluginName} to a DOM element '${target}'`);\n\n if (this.opts.replaceTargetContent) {\n // Doing render(h(null), targetElement), which should have been\n // a better way, since because the component might need to do additional cleanup when it is removed,\n // stopped working — Preact just adds null into target, not replacing\n targetElement.innerHTML = '';\n }\n\n render(this.render(this.uppy.getState()), uppyRootElement);\n this.el = uppyRootElement.firstElementChild;\n targetElement.appendChild(uppyRootElement);\n this.onMount();\n return this.el;\n }\n\n let targetPlugin;\n\n if (typeof target === 'object' && target instanceof UIPlugin) {\n // Targeting a plugin *instance*\n targetPlugin = target;\n } else if (typeof target === 'function') {\n // Targeting a plugin type\n const Target = target; // Find the target plugin instance.\n\n this.uppy.iteratePlugins(p => {\n if (p instanceof Target) {\n targetPlugin = p;\n return false;\n }\n });\n }\n\n if (targetPlugin) {\n this.uppy.log(`Installing ${callerPluginName} to ${targetPlugin.id}`);\n this.parent = targetPlugin;\n this.el = targetPlugin.addTarget(plugin);\n this.onMount();\n return this.el;\n }\n\n this.uppy.log(`Not installing ${callerPluginName}`);\n let message = `Invalid target option given to ${callerPluginName}.`;\n\n if (typeof target === 'function') {\n message += ' The given target is not a Plugin class. ' + 'Please check that you\\'re not specifying a React Component instead of a plugin. ' + 'If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: ' + 'run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.';\n } else {\n message += 'If you meant to target an HTML element, please make sure that the element exists. ' + 'Check that the \n\n","import mod from \"-!../../cache-loader/dist/cjs.js??ref--12-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib/index.js??vue-loader-options!./PulseLoader.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../cache-loader/dist/cjs.js??ref--12-0!../../thread-loader/dist/cjs.js!../../babel-loader/lib/index.js!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib/index.js??vue-loader-options!./PulseLoader.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PulseLoader.vue?vue&type=template&id=7dc0198c&\"\nimport script from \"./PulseLoader.vue?vue&type=script&lang=js&\"\nexport * from \"./PulseLoader.vue?vue&type=script&lang=js&\"\nimport style0 from \"./PulseLoader.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n {{ processingMessage }}\r\n
\r\n
\r\n
\r\n Modal Content goes here\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Modal.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Modal.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Modal.vue?vue&type=template&id=ec8fbf10&\"\nimport script from \"./Modal.vue?vue&type=script&lang=js&\"\nexport * from \"./Modal.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\"use strict\";\n\nconst toArray = require('../../../toArray');\n\nconst getRelativePath = require('./getRelativePath');\n\nconst getFilesAndDirectoriesFromDirectory = require('./getFilesAndDirectoriesFromDirectory');\n\nmodule.exports = function webkitGetAsEntryApi(dataTransfer, logDropError) {\n const files = [];\n const rootPromises = [];\n /**\n * Returns a resolved promise, when :files array is enhanced\n *\n * @param {(FileSystemFileEntry|FileSystemDirectoryEntry)} entry\n * @returns {Promise} - empty promise that resolves when :files is enhanced with a file\n */\n\n const createPromiseToAddFileOrParseDirectory = entry => new Promise(resolve => {\n // This is a base call\n if (entry.isFile) {\n // Creates a new File object which can be used to read the file.\n entry.file(file => {\n // eslint-disable-next-line no-param-reassign\n file.relativePath = getRelativePath(entry);\n files.push(file);\n resolve();\n }, // Make sure we resolve on error anyway, it's fine if only one file couldn't be read!\n error => {\n logDropError(error);\n resolve();\n }); // This is a recursive call\n } else if (entry.isDirectory) {\n const directoryReader = entry.createReader();\n getFilesAndDirectoriesFromDirectory(directoryReader, [], logDropError, {\n onSuccess: entries => resolve(Promise.all(entries.map(createPromiseToAddFileOrParseDirectory)))\n });\n }\n }); // For each dropped item, - make sure it's a file/directory, and start deepening in!\n\n\n toArray(dataTransfer.items).forEach(item => {\n const entry = item.webkitGetAsEntry(); // :entry can be null when we drop the url e.g.\n\n if (entry) {\n rootPromises.push(createPromiseToAddFileOrParseDirectory(entry));\n }\n });\n return Promise.all(rootPromises).then(() => files);\n};","\"use strict\";\n\nconst {\n h,\n Component\n} = require('preact');\n\nconst classNames = require('classnames');\n\nconst shallowEqual = require('is-shallow-equal');\n\nconst FilePreviewAndLink = require('./FilePreviewAndLink');\n\nconst FileProgress = require('./FileProgress');\n\nconst FileInfo = require('./FileInfo');\n\nconst Buttons = require('./Buttons');\n\nmodule.exports = class FileItem extends Component {\n componentDidMount() {\n const {\n file\n } = this.props;\n\n if (!file.preview) {\n this.props.handleRequestThumbnail(file);\n }\n }\n\n shouldComponentUpdate(nextProps) {\n return !shallowEqual(this.props, nextProps);\n } // VirtualList mounts FileItems again and they emit `thumbnail:request`\n // Otherwise thumbnails are broken or missing after Golden Retriever restores files\n\n\n componentDidUpdate() {\n const {\n file\n } = this.props;\n\n if (!file.preview) {\n this.props.handleRequestThumbnail(file);\n }\n }\n\n componentWillUnmount() {\n const {\n file\n } = this.props;\n\n if (!file.preview) {\n this.props.handleCancelThumbnail(file);\n }\n }\n\n render() {\n const {\n file\n } = this.props;\n const isProcessing = file.progress.preprocess || file.progress.postprocess;\n const isUploaded = file.progress.uploadComplete && !isProcessing && !file.error;\n const uploadInProgressOrComplete = file.progress.uploadStarted || isProcessing;\n const uploadInProgress = file.progress.uploadStarted && !file.progress.uploadComplete || isProcessing;\n const error = file.error || false; // File that Golden Retriever was able to partly restore (only meta, not blob),\n // users still need to re-add it, so it’s a ghost\n\n const {\n isGhost\n } = file;\n let showRemoveButton = this.props.individualCancellation ? !isUploaded : !uploadInProgress && !isUploaded;\n\n if (isUploaded && this.props.showRemoveButtonAfterComplete) {\n showRemoveButton = true;\n }\n\n const dashboardItemClass = classNames({\n 'uppy-Dashboard-Item': true,\n 'is-inprogress': uploadInProgress && !this.props.recoveredState,\n 'is-processing': isProcessing,\n 'is-complete': isUploaded,\n 'is-error': !!error,\n 'is-resumable': this.props.resumableUploads,\n 'is-noIndividualCancellation': !this.props.individualCancellation,\n 'is-ghost': isGhost\n });\n return h(\"div\", {\n className: dashboardItemClass,\n id: `uppy_${file.id}`,\n role: this.props.role\n }, h(\"div\", {\n className: \"uppy-Dashboard-Item-preview\"\n }, h(FilePreviewAndLink, {\n file: file,\n showLinkToFileUploadResult: this.props.showLinkToFileUploadResult\n }), h(FileProgress, {\n uppy: this.props.uppy,\n file: file,\n error: error,\n isUploaded: isUploaded,\n hideRetryButton: this.props.hideRetryButton,\n hideCancelButton: this.props.hideCancelButton,\n hidePauseResumeButton: this.props.hidePauseResumeButton,\n recoveredState: this.props.recoveredState,\n showRemoveButtonAfterComplete: this.props.showRemoveButtonAfterComplete,\n resumableUploads: this.props.resumableUploads,\n individualCancellation: this.props.individualCancellation,\n i18n: this.props.i18n\n })), h(\"div\", {\n className: \"uppy-Dashboard-Item-fileInfoAndButtons\"\n }, h(FileInfo, {\n file: file,\n id: this.props.id,\n acquirers: this.props.acquirers,\n containerWidth: this.props.containerWidth,\n i18n: this.props.i18n,\n toggleAddFilesPanel: this.props.toggleAddFilesPanel\n }), h(Buttons, {\n file: file,\n metaFields: this.props.metaFields,\n showLinkToFileUploadResult: this.props.showLinkToFileUploadResult,\n showRemoveButton: showRemoveButton,\n canEditFile: this.props.canEditFile,\n uploadInProgressOrComplete: uploadInProgressOrComplete,\n toggleFileCard: this.props.toggleFileCard,\n openFileEditor: this.props.openFileEditor,\n uppy: this.props.uppy,\n i18n: this.props.i18n\n })));\n }\n\n};","\"use strict\";\n\n/**\n * Get the relative path from the FileEntry#fullPath, because File#webkitRelativePath is always '', at least onDrop.\n *\n * @param {FileEntry} fileEntry\n *\n * @returns {string|null} - if file is not in a folder - return null (this is to\n * be consistent with .relativePath-s of files selected from My Device). If file\n * is in a folder - return its fullPath, e.g. '/simpsons/hi.jpeg'.\n */\nmodule.exports = function getRelativePath(fileEntry) {\n // fileEntry.fullPath - \"/simpsons/hi.jpeg\" or undefined (for browsers that don't support it)\n // fileEntry.name - \"hi.jpeg\"\n if (!fileEntry.fullPath || fileEntry.fullPath === `/${fileEntry.name}`) {\n return null;\n }\n\n return fileEntry.fullPath;\n};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst FilePreview = require('../../FilePreview');\n\nconst getFileTypeIcon = require('../../../utils/getFileTypeIcon');\n\nmodule.exports = function FilePreviewAndLink(props) {\n return h(\"div\", {\n className: \"uppy-Dashboard-Item-previewInnerWrap\",\n style: {\n backgroundColor: getFileTypeIcon(props.file.type).color\n }\n }, props.showLinkToFileUploadResult && props.file.uploadURL && h(\"a\", {\n className: \"uppy-Dashboard-Item-previewLink\",\n href: props.file.uploadURL,\n rel: \"noreferrer noopener\",\n target: \"_blank\",\n \"aria-label\": props.file.meta.name\n }, h(\"span\", {\n hidden: true\n }, \"props.file.meta.name\")), h(FilePreview, {\n file: props.file\n }));\n};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nfunction onPauseResumeCancelRetry(props) {\n if (props.isUploaded) return;\n\n if (props.error && !props.hideRetryButton) {\n props.uppy.retryUpload(props.file.id);\n return;\n }\n\n if (props.resumableUploads && !props.hidePauseResumeButton) {\n props.uppy.pauseResume(props.file.id);\n } else if (props.individualCancellation && !props.hideCancelButton) {\n props.uppy.removeFile(props.file.id);\n }\n}\n\nfunction progressIndicatorTitle(props) {\n if (props.isUploaded) {\n return props.i18n('uploadComplete');\n }\n\n if (props.error) {\n return props.i18n('retryUpload');\n }\n\n if (props.resumableUploads) {\n if (props.file.isPaused) {\n return props.i18n('resumeUpload');\n }\n\n return props.i18n('pauseUpload');\n }\n\n if (props.individualCancellation) {\n return props.i18n('cancelUpload');\n }\n\n return '';\n}\n\nfunction ProgressIndicatorButton(props) {\n return h(\"div\", {\n className: \"uppy-Dashboard-Item-progress\"\n }, h(\"button\", {\n className: \"uppy-u-reset uppy-Dashboard-Item-progressIndicator\",\n type: \"button\",\n \"aria-label\": progressIndicatorTitle(props),\n title: progressIndicatorTitle(props),\n onClick: () => onPauseResumeCancelRetry(props)\n }, props.children));\n}\n\nfunction ProgressCircleContainer({\n children\n}) {\n return h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n width: \"70\",\n height: \"70\",\n viewBox: \"0 0 36 36\",\n className: \"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle\"\n }, children);\n}\n\nfunction ProgressCircle({\n progress\n}) {\n // circle length equals 2 * PI * R\n const circleLength = 2 * Math.PI * 15;\n return h(\"g\", null, h(\"circle\", {\n className: \"uppy-Dashboard-Item-progressIcon--bg\",\n r: \"15\",\n cx: \"18\",\n cy: \"18\",\n \"stroke-width\": \"2\",\n fill: \"none\"\n }), h(\"circle\", {\n className: \"uppy-Dashboard-Item-progressIcon--progress\",\n r: \"15\",\n cx: \"18\",\n cy: \"18\",\n transform: \"rotate(-90, 18, 18)\",\n fill: \"none\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": circleLength,\n \"stroke-dashoffset\": circleLength - circleLength / 100 * progress\n }));\n}\n\nmodule.exports = function FileProgress(props) {\n // Nothing if upload has not started\n if (!props.file.progress.uploadStarted) {\n return null;\n } // Green checkmark when complete\n\n\n if (props.isUploaded) {\n return h(\"div\", {\n className: \"uppy-Dashboard-Item-progress\"\n }, h(\"div\", {\n className: \"uppy-Dashboard-Item-progressIndicator\"\n }, h(ProgressCircleContainer, null, h(\"circle\", {\n r: \"15\",\n cx: \"18\",\n cy: \"18\",\n fill: \"#1bb240\"\n }), h(\"polygon\", {\n className: \"uppy-Dashboard-Item-progressIcon--check\",\n transform: \"translate(2, 3)\",\n points: \"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634\"\n }))));\n }\n\n if (props.recoveredState) {\n return;\n } // Retry button for error\n\n\n if (props.error && !props.hideRetryButton) {\n return h(ProgressIndicatorButton, props, h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry\",\n width: \"28\",\n height: \"31\",\n viewBox: \"0 0 16 19\"\n }, h(\"path\", {\n d: \"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z\"\n }), h(\"path\", {\n d: \"M7.9 3H10v2H7.9z\"\n }), h(\"path\", {\n d: \"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z\"\n }), h(\"path\", {\n d: \"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z\"\n })));\n } // Pause/resume button for resumable uploads\n\n\n if (props.resumableUploads && !props.hidePauseResumeButton) {\n return h(ProgressIndicatorButton, props, h(ProgressCircleContainer, null, h(ProgressCircle, {\n progress: props.file.progress.percentage\n }), props.file.isPaused ? h(\"polygon\", {\n className: \"uppy-Dashboard-Item-progressIcon--play\",\n transform: \"translate(3, 3)\",\n points: \"12 20 12 10 20 15\"\n }) : h(\"g\", {\n className: \"uppy-Dashboard-Item-progressIcon--pause\",\n transform: \"translate(14.5, 13)\"\n }, h(\"rect\", {\n x: \"0\",\n y: \"0\",\n width: \"2\",\n height: \"10\",\n rx: \"0\"\n }), h(\"rect\", {\n x: \"5\",\n y: \"0\",\n width: \"2\",\n height: \"10\",\n rx: \"0\"\n }))));\n } // Cancel button for non-resumable uploads if individualCancellation is supported (not bundled)\n\n\n if (!props.resumableUploads && props.individualCancellation && !props.hideCancelButton) {\n return h(ProgressIndicatorButton, props, h(ProgressCircleContainer, null, h(ProgressCircle, {\n progress: props.file.progress.percentage\n }), h(\"polygon\", {\n className: \"cancel\",\n transform: \"translate(2, 2)\",\n points: \"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12\"\n })));\n } // Just progress when buttons are disabled\n\n\n return h(\"div\", {\n className: \"uppy-Dashboard-Item-progress\"\n }, h(\"div\", {\n className: \"uppy-Dashboard-Item-progressIndicator\"\n }, h(ProgressCircleContainer, null, h(ProgressCircle, {\n progress: props.file.progress.percentage\n }))));\n};","/**\n * lodash (Custom Build)
\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors
\n * Released under MIT license
\n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst classNames = require('classnames');\n\nconst statusBarStates = require('./StatusBarStates');\n\nconst calculateProcessingProgress = require('./calculateProcessingProgress');\n\nconst {\n UploadBtn,\n RetryBtn,\n CancelBtn,\n PauseResumeButton,\n DoneBtn,\n ProgressBarProcessing,\n ProgressBarError,\n ProgressBarUploading,\n ProgressBarComplete\n} = require('./Components');\n\nconst {\n STATE_ERROR,\n STATE_WAITING,\n STATE_PREPROCESSING,\n STATE_UPLOADING,\n STATE_POSTPROCESSING,\n STATE_COMPLETE\n} = statusBarStates;\nmodule.exports = StatusBar;\n\nfunction StatusBar(props) {\n const {\n newFiles,\n allowNewUpload,\n isUploadInProgress,\n isAllPaused,\n resumableUploads,\n error,\n hideUploadButton,\n hidePauseResumeButton,\n hideCancelButton,\n hideRetryButton,\n recoveredState,\n uploadState,\n totalProgress,\n files,\n supportsUploadProgress,\n hideAfterFinish,\n isSomeGhost,\n isTargetDOMEl,\n doneButtonHandler,\n isUploadStarted,\n i18n,\n startUpload,\n uppy,\n isAllComplete,\n showProgressDetails,\n numUploads,\n complete,\n totalSize,\n totalETA,\n totalUploadedSize\n } = props;\n\n function getProgressValue() {\n switch (uploadState) {\n case STATE_POSTPROCESSING:\n case STATE_PREPROCESSING:\n {\n const progress = calculateProcessingProgress(files);\n\n if (progress.mode === 'determinate') {\n return progress.value * 100;\n }\n\n return totalProgress;\n }\n\n case STATE_ERROR:\n {\n return null;\n }\n\n case STATE_UPLOADING:\n {\n if (!supportsUploadProgress) {\n return null;\n }\n\n return totalProgress;\n }\n\n default:\n return totalProgress;\n }\n }\n\n function getIsIndeterminate() {\n switch (uploadState) {\n case STATE_POSTPROCESSING:\n case STATE_PREPROCESSING:\n {\n const {\n mode\n } = calculateProcessingProgress(files);\n return mode === 'indeterminate';\n }\n\n case STATE_UPLOADING:\n {\n if (!supportsUploadProgress) {\n return true;\n }\n\n return false;\n }\n\n default:\n return false;\n }\n }\n\n function getIsHidden() {\n if (recoveredState) {\n return false;\n }\n\n switch (uploadState) {\n case STATE_WAITING:\n return hideUploadButton || newFiles === 0;\n\n case STATE_COMPLETE:\n return hideAfterFinish;\n\n default:\n return false;\n }\n }\n\n const progressValue = getProgressValue();\n const isHidden = getIsHidden();\n const width = progressValue != null ? progressValue : 100;\n const showUploadBtn = !error && newFiles && !isUploadInProgress && !isAllPaused && allowNewUpload && !hideUploadButton;\n const showCancelBtn = !hideCancelButton && uploadState !== STATE_WAITING && uploadState !== STATE_COMPLETE;\n const showPauseResumeBtn = resumableUploads && !hidePauseResumeButton && uploadState === STATE_UPLOADING;\n const showRetryBtn = error && !hideRetryButton;\n const showDoneBtn = doneButtonHandler && uploadState === STATE_COMPLETE;\n const progressClassNames = classNames('uppy-StatusBar-progress', {\n 'is-indeterminate': getIsIndeterminate()\n });\n const statusBarClassNames = classNames({\n 'uppy-Root': isTargetDOMEl\n }, 'uppy-StatusBar', `is-${uploadState}`, {\n 'has-ghosts': isSomeGhost\n });\n return h(\"div\", {\n className: statusBarClassNames,\n \"aria-hidden\": isHidden\n }, h(\"div\", {\n className: progressClassNames,\n style: {\n width: `${width}%`\n },\n role: \"progressbar\",\n \"aria-label\": `${width}%`,\n \"aria-valuetext\": `${width}%`,\n \"aria-valuemin\": \"0\",\n \"aria-valuemax\": \"100\",\n \"aria-valuenow\": progressValue\n }), (() => {\n switch (uploadState) {\n case STATE_PREPROCESSING:\n case STATE_POSTPROCESSING:\n return h(ProgressBarProcessing, {\n progress: calculateProcessingProgress(files)\n });\n\n case STATE_COMPLETE:\n return h(ProgressBarComplete, {\n i18n: i18n\n });\n\n case STATE_ERROR:\n return h(ProgressBarError, {\n error: error,\n i18n: i18n\n });\n\n case STATE_UPLOADING:\n return h(ProgressBarUploading, {\n i18n: i18n,\n supportsUploadProgress: supportsUploadProgress,\n totalProgress: totalProgress,\n showProgressDetails: showProgressDetails,\n isUploadStarted: isUploadStarted,\n isAllComplete: isAllComplete,\n isAllPaused: isAllPaused,\n newFiles: newFiles,\n numUploads: numUploads,\n complete: complete,\n totalUploadedSize: totalUploadedSize,\n totalSize: totalSize,\n totalETA: totalETA,\n startUpload: startUpload\n });\n\n default:\n return null;\n }\n })(), h(\"div\", {\n className: \"uppy-StatusBar-actions\"\n }, recoveredState || showUploadBtn ? h(UploadBtn, {\n newFiles: newFiles,\n isUploadStarted: isUploadStarted,\n recoveredState: recoveredState,\n i18n: i18n,\n isSomeGhost: isSomeGhost,\n startUpload: startUpload,\n uploadState: uploadState\n }) : null, showRetryBtn ? h(RetryBtn, {\n i18n: i18n,\n uppy: uppy\n }) : null, showPauseResumeBtn ? h(PauseResumeButton, {\n isAllPaused: isAllPaused,\n i18n: i18n,\n isAllComplete: isAllComplete,\n resumableUploads: resumableUploads,\n uppy: uppy\n }) : null, showCancelBtn ? h(CancelBtn, {\n i18n: i18n,\n uppy: uppy\n }) : null, showDoneBtn ? h(DoneBtn, {\n i18n: i18n,\n doneButtonHandler: doneButtonHandler\n }) : null));\n}","\"use strict\";\n\nconst {\n h,\n Component\n} = require('preact');\n\nconst classNames = require('classnames');\n\nconst {\n nanoid\n} = require('nanoid');\n\nconst getFileTypeIcon = require('../../utils/getFileTypeIcon');\n\nconst ignoreEvent = require('../../utils/ignoreEvent.js');\n\nconst FilePreview = require('../FilePreview');\n\nclass FileCard extends Component {\n constructor(props) {\n super(props);\n this.form = document.createElement('form');\n\n this.updateMeta = (newVal, name) => {\n this.setState(({\n formState\n }) => ({\n formState: { ...formState,\n [name]: newVal\n }\n }));\n };\n\n this.handleSave = e => {\n e.preventDefault();\n const fileID = this.props.fileCardFor;\n this.props.saveFileCard(this.state.formState, fileID);\n };\n\n this.handleCancel = () => {\n this.props.toggleFileCard(false);\n };\n\n this.saveOnEnter = ev => {\n if (ev.keyCode === 13) {\n ev.stopPropagation();\n ev.preventDefault();\n const file = this.props.files[this.props.fileCardFor];\n this.props.saveFileCard(this.state.formState, file.id);\n }\n };\n\n this.renderMetaFields = () => {\n const metaFields = this.getMetaFields() || [];\n const fieldCSSClasses = {\n text: 'uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input'\n };\n return metaFields.map(field => {\n const id = `uppy-Dashboard-FileCard-input-${field.id}`;\n const required = this.props.requiredMetaFields.includes(field.id);\n return h(\"fieldset\", {\n key: field.id,\n className: \"uppy-Dashboard-FileCard-fieldset\"\n }, h(\"label\", {\n className: \"uppy-Dashboard-FileCard-label\",\n htmlFor: id\n }, field.name), field.render !== undefined ? field.render({\n value: this.state.formState[field.id],\n onChange: newVal => this.updateMeta(newVal, field.id),\n fieldCSSClasses,\n required,\n form: this.form.id\n }, h) : h(\"input\", {\n className: fieldCSSClasses.text,\n id: id,\n form: this.form.id,\n type: field.type || 'text',\n required: required,\n value: this.state.formState[field.id],\n placeholder: field.placeholder // If `form` attribute is not supported, we need to capture pressing Enter to avoid bubbling in case Uppy is\n // embedded inside a