@bigbinary/neeto-editor 1.10.3 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import*as e from"react";import t,{useState as n,useRef as i,useEffect as r,creat
|
|
|
14
14
|
* @param {string} phrase that needs interpolation, with placeholders
|
|
15
15
|
* @param {object} options with values that will be used to replace placeholders
|
|
16
16
|
* @returns {any[]} interpolated
|
|
17
|
-
*/function xe(e,t){const n=/\$/g,i="$$$$";let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=n[Symbol.replace](o,i)),r=ye(r,new RegExp(`%\\{${e}\\}`,"g"),o)}return r}var we=ve("apply");function _e(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var ke=class{constructor(e){Object.defineProperty(this,we,{value:_e}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(me(this,we)[we],this):me(this,we)[we](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!be(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return xe(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return xe(n,t)}},Ee="Expected a function",Me=0/0,Ce="[object Symbol]",Oe=/^\s+|\s+$/g,De=/^[-+]0x[0-9a-f]+$/i,Se=/^0b[01]+$/i,Te=/^0o[0-7]+$/i,Ae=parseInt,Ne="object"==typeof B&&B&&B.Object===Object&&B,je="object"==typeof self&&self&&self.Object===Object&&self,Le=Ne||je||Function("return this")(),Ie=Object.prototype.toString,ze=Math.max,Re=Math.min,Fe=function(){return Le.Date.now()};function Be(e,t,n){var i,r,o,s,a,l,c=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError(Ee);function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function f(e){return c=e,a=setTimeout(g,t),u?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function g(){var e=Fe();if(m(e))return v(e);a=setTimeout(g,function(e){var n=t-(e-l);return p?Re(n,o-(e-c)):n}(e))}function v(e){return a=void 0,d&&i?h(e):(i=r=void 0,s)}function b(){var e=Fe(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return f(l);if(p)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Ue(t)||0,Pe(n)&&(u=!!n.leading,o=(p="maxWait"in n)?ze(Ue(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},b.flush=function(){return void 0===a?s:v(Fe())},b}function Pe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ue(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ie.call(e)==Ce}(e))return Me;if(Pe(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Pe(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Oe,"");var n=Se.test(e);return n||Te.test(e)?Ae(e.slice(2),n?2:8):De.test(e)?Me:+e}var He=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(Ee);return Pe(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Be(e,t,{leading:i,maxWait:t,trailing:r})};var $e=0;function We(e){return"__private_"+$e+++"_"+e}var qe=We("publish");class Ve{constructor(){Object.defineProperty(this,qe,{value:Ke}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,qe)[qe](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function Ke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}Ve.VERSION="2.1.1";var Ge=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}};const Ye=Ge,Qe={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Ze(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}var Je=function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${Ze(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${Ze(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t};var Xe=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[i,r]=n.split(".");return i=parseInt(i,10),r=parseInt(r,10),i<15||15===i&&r<15063||(i>18||18===i&&r>=18218)};var et=se,tt=X,nt=ae;let it,rt;function ot(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var st=0;function at(e){return"__private_"+st+++"_"+e}const lt=ke,ct=function(){var e={},t=e._fns={};return e.emit=function(e,n,i,r,o,s,a){var l=function(e){var n=t[e]?t[e]:[],i=e.indexOf(":"),r=-1===i?[e]:[e.substring(0,i),e.substring(i+1)],o=Object.keys(t),s=0,a=o.length;for(;s<a;s++){var l=o[s];if("*"===l&&(n=n.concat(t[l])),2===r.length&&r[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){var i=0,r=t.length;for(;i<r&&t[i];i++)t[i].event=e,t[i].apply(t[i],n)}(e,l,[n,i,r,o,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function i(){n.apply(this,arguments),e.off(t,i)}))},e.off=function(e,t){var n=[];if(e&&t)for(var i=this._fns[e],r=0,o=i?i.length:0;r<o;r++)i[r]!==t&&n.push(i[r]);n.length?this._fns[e]=n:delete this._fns[e]},e},ut=He,pt=function(){return new Ve},dt=function(e){var t;if(e.type)return e.type;const n=e.name?null==(t=Ye(e.name).extension)?void 0:t.toLowerCase():null;return n&&n in Qe?Qe[n]:"application/octet-stream"},ht=Ge,ft=Je,mt=Xe,gt=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"},vt={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var bt=at("plugins"),yt=at("restricter"),xt=at("storeUnsubscribe"),wt=at("emitter"),_t=at("preProcessors"),kt=at("uploaders"),Et=at("postProcessors"),Mt=at("informAndEmit"),Ct=at("checkRequiredMetaFieldsOnFile"),Ot=at("checkRequiredMetaFields"),Dt=at("assertNewUploadAllowed"),St=at("checkAndCreateFileStateObject"),Tt=at("startIfAutoProceed"),At=at("addListeners"),Nt=at("updateOnlineStatus"),jt=at("createUpload"),Lt=at("getUpload"),It=at("removeUpload"),zt=at("runUpload");it=Symbol.for("uppy test: getPlugins"),rt=Symbol.for("uppy test: createUpload");class Rt{constructor(e){Object.defineProperty(this,zt,{value:Gt}),Object.defineProperty(this,It,{value:Kt}),Object.defineProperty(this,Lt,{value:Vt}),Object.defineProperty(this,jt,{value:qt}),Object.defineProperty(this,At,{value:Wt}),Object.defineProperty(this,Tt,{value:$t}),Object.defineProperty(this,St,{value:Ht}),Object.defineProperty(this,Dt,{value:Ut}),Object.defineProperty(this,Ot,{value:Pt}),Object.defineProperty(this,Ct,{value:Bt}),Object.defineProperty(this,Mt,{value:Ft}),Object.defineProperty(this,bt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:ct()}),Object.defineProperty(this,_t,{writable:!0,value:new Set}),Object.defineProperty(this,kt,{writable:!0,value:new Set}),Object.defineProperty(this,Et,{writable:!0,value:new Set}),Object.defineProperty(this,Nt,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=vt;const t={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:nt.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:pt(),logger:tt.justErrorsLogger,infoTimeout:5e3};this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=tt.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=ut(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:mt(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),ot(this,yt)[yt]=new nt.Restricter((()=>this.opts),this.i18n),ot(this,xt)[xt]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),ot(this,At)[At]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];ot(this,wt)[wt].emit(e,...n)}on(e,t){return ot(this,wt)[wt].on(e,t),this}once(e,t){return ot(this,wt)[wt].once(e,t),this}off(e,t){return ot(this,wt)[wt].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new lt([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((i=>{const r={...t[i]};r.progress={...r.progress,...e},n[i]=r})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){ot(this,_t)[_t].add(e)}removePreProcessor(e){return ot(this,_t)[_t].delete(e)}addPostProcessor(e){ot(this,Et)[Et].add(e)}removePostProcessor(e){return ot(this,Et)[Et].delete(e)}addUploader(e){ot(this,kt)[kt].add(e)}removeUploader(e){return ot(this,kt)[kt].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const i={...n[e].meta,...t};n[e]={...n[e],meta:i},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),i=Object.values(e),r=i.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),o=i.filter((e=>!e.progress.uploadStarted)),s=i.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),a=i.filter((e=>e.progress.uploadStarted)),l=i.filter((e=>e.isPaused)),c=i.filter((e=>e.progress.uploadComplete)),u=i.filter((e=>e.error)),p=r.filter((e=>!e.isPaused)),d=i.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:o,startedFiles:s,uploadStartedFiles:a,pausedFiles:l,completeFiles:c,erroredFiles:u,inProgressFiles:r,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:a.length>0,isAllComplete:100===t&&c.length===i.length&&0===d.length,isAllErrored:!!n&&u.length===i.length,isAllPaused:0!==r.length&&l.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:i.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return ot(this,yt)[yt].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){ot(this,Dt)[Dt](e);const{files:t}=this.getState();let n=ot(this,St)[St](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),ot(this,Tt)[Tt](),n.id}addFiles(e){ot(this,Dt)[Dt]();const t={...this.getState().files},n=[],i=[];for(let r=0;r<e.length;r++)try{let i=ot(this,St)[St](t,e[r]);t[i.id]&&t[i.id].isGhost&&(i={...t[i.id],data:e[r].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${i.name}, ${i.id}`)),t[i.id]=i,n.push(i)}catch(e){e.isRestriction||i.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&ot(this,Tt)[Tt](),i.length>0){let e="Multiple errors occurred while adding files:\n";if(i.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(i,e);{const t=new Error(e);throw t.errors=i,t}}}removeFiles(e,t){const{files:n,currentUploads:i}=this.getState(),r={...n},o={...i},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach((e=>{n[e]&&(s[e]=n[e],delete r[e])})),Object.keys(o).forEach((e=>{const t=i[e].fileIDs.filter(a);0!==t.length?o[e]={...i[e],fileIDs:t}:delete o[e]}));const l={currentUploads:o,files:r};0===Object.keys(r).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const c=Object.keys(s);c.forEach((e=>{this.emit("file-removed",s[e],t)})),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=ot(this,jt)[jt](t,{forceAllowNewUpload:!0});return ot(this,zt)[zt](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=ot(this,jt)[jt]([e],{forceAllowNewUpload:!0});return ot(this,zt)[zt](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,i=n.reduce(((e,t)=>e+t.progress.percentage),0),r=Math.round(i/t*100);return void this.setState({totalProgress:r})}let i=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const r=i/t.length;i+=r*n.length;let o=0;t.forEach((e=>{o+=e.progress.bytesUploaded})),n.forEach((e=>{o+=r*(e.progress.percentage||0)/100}));let s=0===i?0:Math.round(o/i*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}.`+" Please verify that the plugin was imported and spelled correctly.")}const n=new e(this,t),i=n.id;if(!i)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(i);if(r){const e=`Already found a plugin named '${r.id}'. `+`Tried to use: '${i}'.\n`+"Uppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(e)}return e.VERSION&&this.log(`Using ${i} v${e.VERSION}`),n.type in ot(this,bt)[bt]?ot(this,bt)[bt][n.type].push(n):ot(this,bt)[bt][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(ot(this,bt)[bt])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[it](e){return ot(this,bt)[bt][e]}iteratePlugins(e){Object.values(ot(this,bt)[bt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=ot(this,bt)[bt][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const i={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(i)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),ot(this,xt)[xt](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",ot(this,Nt)[Nt]),window.removeEventListener("offline",ot(this,Nt)[Nt]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const i="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:i?e.message:e,details:i?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?ot(this,zt)[zt](e):(ot(this,It)[It](e),Promise.reject(new Error("Nonexistent upload")))}[rt](){return ot(this,jt)[jt](...arguments)}addResultData(e,t){if(!ot(this,Lt)[Lt](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),i={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:i}})}upload(){var e;null!=(e=ot(this,bt)[bt].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"==typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((()=>ot(this,yt)[yt].validateMinNumberOfFiles(t))).catch((e=>{throw ot(this,Mt)[Mt](e),e})).then((()=>{if(!ot(this,Ot)[Ot](t))throw new nt.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),i=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||i.push(t.id)}));const r=ot(this,jt)[jt](i);return ot(this,zt)[zt](r)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function Ft(e,t){const{message:n,details:i=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:i},"error",this.opts.infoTimeout),this.log(`${n} ${i}`.trim(),"error")}function Bt(e){const{missingFields:t,error:n}=ot(this,yt)[yt].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function Pt(e){let t=!0;for(const n of Object.values(e))ot(this,Ct)[Ct](n)||(t=!1);return t}function Ut(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new nt.RestrictionError(this.i18n("noMoreFilesAllowed"));throw ot(this,Mt)[Mt](t,e),t}}function Ht(e,t){const n=dt(t),i=gt(n,t),r=ht(i).extension,o=Boolean(t.isRemote),s=ft({...t,type:n});if(this.checkIfFileAlreadyExists(s)){const e=new nt.RestrictionError(this.i18n("noDuplicates",{fileName:i}));throw ot(this,Mt)[Mt](e,t),e}const a=t.meta||{};a.name=i,a.type=n;const l=Number.isFinite(t.data.size)?t.data.size:null;let c={source:t.source||"",id:s,name:i,extension:r||"",meta:{...this.getState().meta,...a},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const u=this.opts.onBeforeFileAdded(c,e);if(!1===u){const e=new nt.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof u&&null!==u&&(c=u);try{const t=Object.keys(e).map((t=>e[t]));ot(this,yt)[yt].validate(c,t)}catch(e){throw ot(this,Mt)[Mt](e,c),e}return c}function $t(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function Wt(){const e=(e,t,n)=>{let i=e.message||"Unknown error";e.details&&(i+=` ${e.details}`),this.setState({error:i}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:i,response:n})};this.on("error",e),this.on("upload-error",((t,n,i)=>{if(e(n,t,i),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),ot(this,Mt)[Mt](e)}else ot(this,Mt)[Mt](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:ot(this,Et)[Et].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&ot(this,Ct)[Ct](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",ot(this,Nt)[Nt]),window.addEventListener("offline",ot(this,Nt)[Nt]),setTimeout(ot(this,Nt)[Nt],3e3))}function qt(e,t){void 0===t&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:i,currentUploads:r}=this.getState();if(!i&&!n)throw new Error("Cannot create a new upload: already uploading.");const o=(0,et.nanoid)();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[o]:{fileIDs:e,step:0,result:{}}}}),o}function Vt(e){const{currentUploads:t}=this.getState();return t[e]}function Kt(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function Gt(e){let{currentUploads:t}=this.getState(),n=t[e];const i=n.step||0,r=[...ot(this,_t)[_t],...ot(this,kt)[kt],...ot(this,Et)[Et]];try{for(let o=i;o<r.length&&n;o++){const i=r[o],s={...n,step:o};this.setState({currentUploads:{...t,[e]:s}}),await i(s.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw ot(this,It)[It](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const i=n.fileIDs.map((e=>this.getFile(e))),r=i.filter((e=>!e.error)),o=i.filter((e=>e.error));await this.addResultData(e,{successful:r,failed:o,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let o;return n&&(o=n.result,this.emit("complete",o),ot(this,It)[It](e)),null==o&&this.log(`Not setting result for an upload that has been removed: ${e}`),o}Rt.VERSION="2.3.1";var Yt,Qt,Zt,Jt,Xt,en,tn,nn=Rt,rn={},on={},sn=[],an=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ln(e,t){for(var n in t)e[n]=t[n];return e}function cn(e){var t=e.parentNode;t&&t.removeChild(e)}function un(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Yt.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return pn(e,s,i,r,null)}function pn(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++Zt:r};return null==r&&null!=Qt.vnode&&Qt.vnode(o),o}function dn(e){return e.children}function hn(e,t){this.props=e,this.context=t}function fn(e,t){if(null==t)return e.__?fn(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?fn(e):null}function mn(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return mn(e)}}function gn(e){(!e.__d&&(e.__d=!0)&&Xt.push(e)&&!vn.__r++||en!==Qt.debounceRendering)&&((en=Qt.debounceRendering)||setTimeout)(vn)}function vn(){for(var e;vn.__r=Xt.length;)e=Xt.sort((function(e,t){return e.__v.__b-t.__v.__b})),Xt=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=ln({},r)).__v=r.__v+1,Mn(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?fn(r):o,r.__h),Cn(n,r),r.__e!=o&&mn(r)))}))}function bn(e,t,n,i,r,o,s,a,l,c){var u,p,d,h,f,m,g,v=i&&i.__k||sn,b=v.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?pn(null,h,null,null,h):Array.isArray(h)?pn(dn,{children:h},null,null,null):h.__b>0?pn(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(d=v[u])||d&&h.key==d.key&&h.type===d.type)v[u]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&h.key==d.key&&h.type===d.type){v[p]=void 0;break}d=null}Mn(e,h,d=d||on,r,o,s,a,l,c),f=h.__e,(p=h.ref)&&d.ref!=p&&(g||(g=[]),d.ref&&g.push(d.ref,null,h),g.push(p,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===d.__k?h.__d=l=yn(h,l,e):l=xn(e,h,d,v,f,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=fn(d))}for(n.__e=m,u=b;u--;)null!=v[u]&&("function"==typeof n.type&&null!=v[u].__e&&v[u].__e==n.__d&&(n.__d=fn(i,u+1)),Dn(v[u],v[u]));if(g)for(u=0;u<g.length;u++)On(g[u],g[++u],g[++u])}function yn(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?yn(i,t,n):xn(n,i,i,r,i.__e,t));return t}function xn(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=2)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function wn(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||an.test(t)?n:n+"px"}function _n(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||wn(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||wn(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?En:kn,o):e.removeEventListener(t,o?En:kn,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function kn(e){this.l[e.type+!1](Qt.event?Qt.event(e):e)}function En(e){this.l[e.type+!0](Qt.event?Qt.event(e):e)}function Mn(e,t,n,i,r,o,s,a,l){var c,u,p,d,h,f,m,g,v,b,y,x,w,_=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=Qt.__b)&&c(t);try{e:if("function"==typeof _){if(g=t.props,v=(c=_.contextType)&&i[c.__c],b=c?v?v.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(g,b):(t.__c=u=new hn(g,b),u.constructor=_,u.render=Sn),v&&v.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=i,p=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=ln({},u.__s)),ln(u.__s,_.getDerivedStateFromProps(g,u.__s))),d=u.props,h=u.state,p)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,h,f)}))}if(u.context=b,u.props=g,u.__v=t,u.__P=e,y=Qt.__r,x=0,"prototype"in _&&_.prototype.render)u.state=u.__s,u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context);else do{u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++x<25);u.state=u.__s,null!=u.getChildContext&&(i=ln(ln({},i),u.getChildContext())),p||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(d,h)),w=null!=c&&c.type===dn&&null==c.key?c.props.children:c,bn(e,Array.isArray(w)?w:[w],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a){var l,c,u,p=n.props,d=t.props,h=t.type,f=0;if("svg"===h&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,d.is&&d),o=null,a=!1}if(null===h)p===d||a&&e.data===d||(e.data=d);else{if(o=o&&Yt.call(e.childNodes),c=(p=n.props||on).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(p={},f=0;f<e.attributes.length;f++)p[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||_n(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||_n(e,o,t[o],n[o],i)}(e,d,p,r,a),u)t.__k=[];else if(f=t.props.children,bn(e,Array.isArray(f)?f:[f],t,n,i,r&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&fn(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&cn(o[f]);a||("value"in d&&void 0!==(f=d.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==p.value)&&_n(e,"value",f,p.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==e.checked&&_n(e,"checked",f,p.checked,!1))}return e}(n.__e,t,n,i,r,o,s,l);(c=Qt.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Qt.__e(e,t,n)}}function Cn(e,t){Qt.__c&&Qt.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Qt.__e(e,t.__v)}}))}function On(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Qt.__e(e,n)}}function Dn(e,t,n){var i,r;if(Qt.unmount&&Qt.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||On(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Qt.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Dn(i[r],t,"function"!=typeof e.type);n||null==e.__e||cn(e.__e),e.__=e.__e=e.__d=void 0}function Sn(e,t,n){return this.constructor(e,n)}function Tn(e,t,n){var i,r,o;Qt.__&&Qt.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Mn(t,e=(!i&&n||t).__k=un(dn,null,[e]),r||on,on,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Yt.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Cn(o,e)}Yt=sn.slice,Qt={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},Zt=0,Jt=function(e){return null!=e&&void 0===e.constructor},hn.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ln({},this.state),"function"==typeof e&&(e=e(ln({},n),this.props)),e&&ln(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),gn(this))},hn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gn(this))},hn.prototype.render=dn,Xt=[],vn.__r=0,tn=0,rn.Component=hn,rn.Fragment=dn,rn.cloneElement=function(e,t,n){var i,r,o,s=ln({},e.props);for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?Yt.call(arguments,2):n),pn(e.type,s,i||e.key,r||e.ref,null)},rn.createContext=function(e,t){var n={__c:t="__cC"+tn++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(gn)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},rn.createElement=un,rn.createRef=function(){return{current:null}},rn.h=un,rn.hydrate=function e(t,n){Tn(t,n,e)},rn.isValidElement=Jt,rn.options=Qt,rn.render=Tn,rn.toChildArray=function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n};var An=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE};const Nn=An;var jn=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):Nn(e)?e:null};var Ln=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};const In=ke;var zn=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new In([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}},Rn=rn;function Fn(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Bn=0;function Pn(e){return"__private_"+Bn+++"_"+e}const Un=jn,Hn=Ln,$n=zn;var Wn=Pn("updateUI");class qn extends $n{constructor(){super(...arguments),Object.defineProperty(this,Wn,{writable:!0,value:void 0})}mount(e,t){const n=t.id,i=Un(e);if(i){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),Fn(this,Wn)[Wn]=function(e){let t=null,n=null;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return n=r,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((e=>{this.uppy.getPlugin(this.id)&&((0,Rn.render)(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(i.innerHTML=""),(0,Rn.render)(this.render(this.uppy.getState()),t),this.el=t,i.appendChild(t),t.dir=this.opts.direction||Hn(t)||"ltr",this.onMount(),this.el}let r;if("object"==typeof e&&e instanceof qn)r=e;else if("function"==typeof e){const t=e;this.uppy.iteratePlugins((e=>{e instanceof t&&(r=e)}))}if(r)return this.uppy.log(`Installing ${n} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let o=`Invalid target option given to ${n}.`;throw o+="function"==typeof e?" 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.":"If you meant to target an HTML element, please make sure that the element exists. "+"Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. "+"(see https://github.com/transloadit/uppy/issues/1042)\n\n"+"If you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}update(e){var t,n;null!=this.el&&(null==(t=(n=Fn(this,Wn))[Wn])||t.call(n,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var Vn=qn;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=X;e.exports=nn;const i=Vn;t.UIPlugin=i;const r=zn;t.BasePlugin=r;const o=nn;t.Uppy=o;const s=Vn,a=zn;o.Uppy=o,o.UIPlugin=s,o.BasePlugin=a,o.debugLogger=n.debugLogger}(J,J.exports);var Kn=P(J.exports),Gn={exports:{}},Yn={},Qn=Array.from,Zn=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];var Jn=function(e,t){if(t){const n=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(n)return n}return e};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.forInline=function(e,t,n){null===t||ii(e,t,n)},Yn.forModal=ii;const Xn=Qn,ei=Zn,ti=Jn;function ni(e,t){const n=t[0];n&&(n.focus(),e.preventDefault())}function ii(e,t,n){const i=ti(n,t),r=Xn(i.querySelectorAll(ei)),o=r.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(i)?ni(e,r):e.shiftKey&&0===o?function(e,t){const n=t[t.length-1];n&&(n.focus(),e.preventDefault())}(e,r):e.shiftKey||o!==r.length-1||ni(e,r)}var ri={exports:{}};var oi=function(e){if(!e.bytesUploaded)return 0;const t=Date.now()-e.uploadStarted;return e.bytesUploaded/(t/1e3)};var si=function(e){return e.bytesTotal-e.bytesUploaded},ai={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},li={};const ci=function(e){return{hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)}};var ui=function(e){const t=ci(e);return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`};Object.defineProperty(li,"__esModule",{value:!0}),li.CancelBtn=function(e){const{i18n:t,uppy:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>n.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,pi.h)("g",{fill:"none",fillRule:"evenodd"},(0,pi.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,pi.h)("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},li.DoneBtn=function(e){const{i18n:t,doneButtonHandler:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},t("done"))},li.LoadingSpinner=bi,li.PauseResumeButton=function(e){const{isAllPaused:t,i18n:n,isAllComplete:i,resumableUploads:r,uppy:o}=e,s=n(t?"resume":"pause");return(0,pi.h)("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){return i?null:r?t?o.resumeAll():o.pauseAll():o.cancelAll()},"data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,pi.h)("g",{fill:"none",fillRule:"evenodd"},(0,pi.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,pi.h)("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))},li.ProgressBarComplete=function(e){const{i18n:t}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},(0,pi.h)("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},li.ProgressBarError=function(e){const{error:t,i18n:n,complete:i,numUploads:r}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-content",title:n("uploadFailed")},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,pi.h)("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},n("uploadFailed"),(0,pi.h)("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${n("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),(0,pi.h)(xi,{i18n:n,complete:i,numUploads:r})))},li.ProgressBarProcessing=function(e){const{progress:t}=e,{value:n,mode:i,message:r}=t,o=Math.round(100*n),s=`·`;return(0,pi.h)("div",{className:"uppy-StatusBar-content"},(0,pi.h)(bi,null),"determinate"===i?`${o}% ${s} `:"",r)},li.ProgressBarUploading=function(e){const{i18n:t,supportsUploadProgress:n,totalProgress:i,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:u,totalUploadedSize:p,totalSize:d,totalETA:h,startUpload:f}=e,m=l&&o;if(!o||s)return null;const g=t(a?"paused":"uploading");return(0,pi.h)("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},a?null:(0,pi.h)(bi,null),(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},n?`${g}: ${i}%`:g),a||m||!r?null:n?(0,pi.h)(_i,{numUploads:c,complete:u,totalUploadedSize:p,totalSize:d,totalETA:h,i18n:t}):(0,pi.h)(xi,{i18n:t,complete:u,numUploads:c}),m?(0,pi.h)(wi,{i18n:t,newFiles:l,startUpload:f}):null))},li.ProgressDetails=yi,li.RetryBtn=function(e){const{i18n:t,uppy:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>n.retryAll(),"data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},(0,pi.h)("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))},li.UploadBtn=function(e){const{newFiles:t,isUploadStarted:n,recoveredState:i,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=e,l=di("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===mi.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=r(t&&n&&!i?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return(0,pi.h)("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)};var pi=rn;const di=$.exports,hi=le,fi=ui,mi=ai,gi=`·`,vi=()=>` ${gi} `;function bi(){return(0,pi.h)("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},(0,pi.h)("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function yi(e){const{numUploads:t,complete:n,totalUploadedSize:i,totalSize:r,totalETA:o,i18n:s}=e,a=t>1;return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:t}),(0,pi.h)("span",{className:"uppy-StatusBar-additionalInfo"},a&&vi(),s("dataUploadedOfTotal",{complete:hi(i),total:hi(r)}),vi(),s("xTimeLeft",{time:fi(o)})))}function xi(e){const{i18n:t,complete:n,numUploads:i}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:n,smart_count:i}))}function wi(e){const{i18n:t,newFiles:n,startUpload:i}=e,r=di("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:n})),(0,pi.h)("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:n}),onClick:i},t("upload")))}const _i=He(yi,500,{leading:!0,trailing:!0});var ki=rn,Ei=li;const Mi=$.exports,Ci=ai,Oi=function(e){const t=[];let n,i;for(const{progress:r}of Object.values(e)){const{preprocess:e,postprocess:o}=r;null==i&&(e||o)&&({mode:n,message:i}=e||o),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==o?void 0:o.mode)&&t.push(o.value)}return{mode:n,message:i,value:t.reduce(((e,n)=>e+n/t.length),0)}},{STATE_ERROR:Di,STATE_WAITING:Si,STATE_PREPROCESSING:Ti,STATE_UPLOADING:Ai,STATE_POSTPROCESSING:Ni,STATE_COMPLETE:ji}=Ci;var Li=function(e){const{newFiles:t,allowNewUpload:n,isUploadInProgress:i,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:c,hideRetryButton:u,recoveredState:p,uploadState:d,totalProgress:h,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:v,doneButtonHandler:b,isUploadStarted:y,i18n:x,startUpload:w,uppy:_,isAllComplete:k,showProgressDetails:E,numUploads:M,complete:C,totalSize:O,totalETA:D,totalUploadedSize:S}=e,T=function(){switch(d){case Ni:case Ti:{const e=Oi(f);return"determinate"===e.mode?100*e.value:h}case Di:return null;case Ai:return m?h:null;default:return h}}(),A=function(){if(p)return!1;switch(d){case Si:return a||0===t;case ji:return g;default:return!1}}(),N=null!=T?T:100,j=!s&&t&&!i&&!r&&n&&!a,L=!c&&d!==Si&&d!==ji,I=o&&!l&&d===Ai,z=s&&!k&&!u,R=b&&d===ji,F=Mi("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(d){case Ni:case Ti:{const{mode:e}=Oi(f);return"indeterminate"===e}case Ai:return!m;default:return!1}}()}),B=Mi("uppy-StatusBar",`is-${d}`,{"has-ghosts":v});return(0,ki.h)("div",{className:B,"aria-hidden":A},(0,ki.h)("div",{className:F,style:{width:`${N}%`},role:"progressbar","aria-label":`${N}%`,"aria-valuetext":`${N}%`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":T}),(()=>{switch(d){case Ti:case Ni:return(0,ki.h)(Ei.ProgressBarProcessing,{progress:Oi(f)});case ji:return(0,ki.h)(Ei.ProgressBarComplete,{i18n:x});case Di:return(0,ki.h)(Ei.ProgressBarError,{error:s,i18n:x,numUploads:M,complete:C});case Ai:return(0,ki.h)(Ei.ProgressBarUploading,{i18n:x,supportsUploadProgress:m,totalProgress:h,showProgressDetails:E,isUploadStarted:y,isAllComplete:k,isAllPaused:r,newFiles:t,numUploads:M,complete:C,totalUploadedSize:S,totalSize:O,totalETA:D,startUpload:w});default:return null}})(),(0,ki.h)("div",{className:"uppy-StatusBar-actions"},p||j?(0,ki.h)(Ei.UploadBtn,{newFiles:t,isUploadStarted:y,recoveredState:p,i18n:x,isSomeGhost:v,startUpload:w,uploadState:d}):null,z?(0,ki.h)(Ei.RetryBtn,{i18n:x,uppy:_}):null,I?(0,ki.h)(Ei.PauseResumeButton,{isAllPaused:r,i18n:x,isAllComplete:k,resumableUploads:o,uppy:_}):null,L?(0,ki.h)(Ei.CancelBtn,{i18n:x,uppy:_}):null,R?(0,ki.h)(Ei.DoneBtn,{i18n:x,doneButtonHandler:b}):null))},Ii=J.exports;const zi=oi,Ri=si,Fi=Ln,Bi=ai,Pi=Li,Ui={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Hi(e){const t=function(e){let t=0;return e.forEach((e=>{t+=zi(e.progress)})),t}(e);if(0===t)return 0;const n=e.reduce(((e,t)=>e+Ri(t.progress)),0);return Math.round(n/t*10)/10}function $i(e,t,n,i){if(e&&!t)return Bi.STATE_ERROR;if(t)return Bi.STATE_COMPLETE;if(n)return Bi.STATE_WAITING;let r=Bi.STATE_WAITING;const o=Object.keys(i);for(let e=0;e<o.length;e++){const{progress:t}=i[o[e]];if(t.uploadStarted&&!t.uploadComplete)return Bi.STATE_UPLOADING;t.preprocess&&r!==Bi.STATE_UPLOADING&&(r=Bi.STATE_PREPROCESSING),t.postprocess&&r!==Bi.STATE_UPLOADING&&r!==Bi.STATE_PREPROCESSING&&(r=Bi.STATE_POSTPROCESSING)}return r}class Wi extends Ii.UIPlugin{constructor(e,t){super(e,t),this.startUpload=()=>{const{recoveredState:e}=this.uppy.getState();if(!e)return this.uppy.upload().catch((()=>{}));this.uppy.emit("restore-confirmed")},this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ui;this.opts={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null,...t},this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:n,allowNewUpload:i,totalProgress:r,error:o,recoveredState:s}=e,{newFiles:a,startedFiles:l,completeFiles:c,inProgressNotPausedFiles:u,isUploadStarted:p,isAllComplete:d,isAllErrored:h,isAllPaused:f,isUploadInProgress:m,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),v=s?Object.values(n):a,b=Hi(u),y=!!t.resumableUploads,x=!1!==t.uploadProgress;let w=0,_=0;return l.forEach((e=>{w+=e.progress.bytesTotal||0,_+=e.progress.bytesUploaded||0})),Pi({error:o,uploadState:$i(o,d,s,e.files||{}),allowNewUpload:i,totalProgress:r,totalSize:w,totalUploadedSize:_,isAllComplete:!1,isAllPaused:f,isAllErrored:h,isUploadStarted:p,isUploadInProgress:m,isSomeGhost:g,recoveredState:s,complete:c.length,newFiles:v.length,numUploads:l.length,totalETA:b,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:y,supportsUploadProgress:x,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;Fi(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}Wi.VERSION="2.2.2",ri.exports=Wi;var qi={exports:{}},Vi=rn;const Ki=300;class Gi extends Vi.Component{constructor(){super(...arguments),this.ref=(0,Vi.createRef)()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Ki)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Ki)}render(){const{children:e}=this.props;return(0,Vi.h)("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}var Yi=Gi,Qi=rn;function Zi(e,t){const n=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return n[t]||(n[t]=n=>{e.refs[t]=n})}function Ji(e){const t={};for(let o=0;o<e.length;o++)if(null!=e[o]){t[(n=e[o],i=o.toString(36),r=void 0,null!=(r=null==n?void 0:n.key)?r:i)]=e[o]}var n,i,r;return t}function Xi(e,t){e=e||{},t=t||{};const n=n=>t.hasOwnProperty(n)?t[n]:e[n],i={};let r=[];for(const n in e)t.hasOwnProperty(n)?r.length&&(i[n]=r,r=[]):r.push(n);const o={};for(const e in t){if(i.hasOwnProperty(e))for(let t=0;t<i[e].length;t++){const r=i[e][t];o[i[e][t]]=n(r)}o[e]=n(e)}for(let e=0;e<r.length;e++)o[r[e]]=n(r[e]);return o}class er extends Qi.Component{constructor(e,t){super(e,t),this.refs={},this.state={children:Ji((0,Qi.toChildArray)((0,Qi.toChildArray)(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Ji((0,Qi.toChildArray)(e.children)||[]),n=this.state.children;let i;for(i in this.setState((e=>({children:Xi(e.children,t)}))),t)if(t.hasOwnProperty(i)){const e=n&&n.hasOwnProperty(i);t[i]&&e&&this.currentlyTransitioningKeys[i]?(this.keysToEnter.push(i),this.keysToAbortLeave.push(i)):!t[i]||e||this.currentlyTransitioningKeys[i]||this.keysToEnter.push(i)}for(i in n)if(n.hasOwnProperty(i)){const e=t&&t.hasOwnProperty(i);!n[i]||e||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const t=(i={},r=this.state.children,Object.assign(i,r));delete t[e],this.setState({children:t})}var i,r}render(e,t){let{childFactory:n,transitionLeave:i,transitionName:r,transitionAppear:o,transitionEnter:s,transitionLeaveTimeout:a,transitionEnterTimeout:l,transitionAppearTimeout:c,component:u,...p}=e,{children:d}=t;const h=[];for(const e in d)if(d.hasOwnProperty(e)){const t=d[e];if(t){const i=Zi(this,e),r=(0,Qi.cloneElement)(n(t),{ref:i,key:e});h.push(r)}}return(0,Qi.h)(u,p,h)}}er.defaultProps={component:"span",childFactory:e=>e};var tr=rn,nr=J.exports;const ir=Yi,rr=er;class or extends nr.UIPlugin{constructor(e,t){super(e,t),this.render=e=>(0,tr.h)("div",{className:"uppy uppy-Informer"},(0,tr.h)(rr,null,e.info.map((e=>(0,tr.h)(ir,{key:e.message},(0,tr.h)("p",{role:"alert"},e.message," ",e.details&&(0,tr.h)("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer";this.opts={...t}}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}or.VERSION="2.1.1",qi.exports=or;var sr={exports:{}};!function(e){function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n="undefined"!=typeof self?self:B;const i="undefined"!=typeof navigator,r=i&&"undefined"==typeof HTMLImageElement,o=!(void 0===B||"undefined"==typeof process||!process.versions||!process.versions.node),s=n.Buffer,a=!!s,l=e=>void 0!==e;function c(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(l).length)}function u(e){let t=new Error(e);throw delete t.stack,t}function p(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const d=e=>String.fromCharCode.apply(null,e),h="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class f{static from(e,t){return e instanceof this&&e.le===t?e:new f(e,void 0,void 0,t)}constructor(e,t=0,n,i){if("boolean"==typeof i&&(this.le=i),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===n&&(n=e.byteLength-t);let i=new DataView(e,t,n);this._swapDataView(i)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof f){void 0===n&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&u("Creating view outside of available memory in ArrayBuffer");let i=new DataView(e.buffer,t,n);this._swapDataView(i)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else u("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=f){return e instanceof DataView||e instanceof f?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||u("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new f(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),h?h.decode(n):a?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(d(n)));var n}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return d(n)}getUnicodeString(e=0,t=this.byteLength){const n=[];for(let i=0;i<t&&e+i<this.byteLength;i+=2)n.push(this.getUint16(e+i));return d(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function m(e,t){u(`${e} '${t}' was not loaded, try using full build of exifr.`)}class g extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||m(this.kind,e),t&&(e in t||function(e,t){u(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||m(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var v=new g("file parser"),b=new g("segment parser"),y=new g("file reader");let x=n.fetch;const w="Invalid input argument";function _(e,t){return(n=e).startsWith("data:")||n.length>1e4?E(e,t,"base64"):o&&e.includes("://")?k(e,t,"url",M):o?E(e,t,"fs"):i?k(e,t,"url",M):void u(w);var n}async function k(e,t,n,i){return y.has(n)?E(e,t,n):i?async function(e,t){let n=await t(e);return new f(n)}(e,i):void u(`Parser ${n} is not loaded`)}async function E(e,t,n){let i=new(y.get(n))(e,t);return await i.read(),i}const M=e=>x(e).then((e=>e.arrayBuffer())),C=e=>new Promise(((t,n)=>{let i=new FileReader;i.onloadend=()=>t(i.result||new ArrayBuffer),i.onerror=n,i.readAsArrayBuffer(e)}));class O extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function D(e,t,n){let i=new O;for(let[e,t]of n)i.set(e,t);if(Array.isArray(t))for(let n of t)e.set(n,i);else e.set(t,i);return i}function S(e,t,n){let i,r=e.get(t);for(i of n)r.set(i[0],i[1])}const T=new Map,A=new Map,N=new Map,j=37500,L=37510,I=33723,z=34675,R=34665,F=34853,P=40965,U=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],H=["jfif","xmp","icc","iptc","ihdr"],$=["tiff",...H],W=["ifd0","ifd1","exif","gps","interop"],q=[...$,...W],V=["makerNote","userComment"],K=["translateKeys","translateValues","reviveValues","multiSegment"],G=[...K,"sanitize","mergeOutput","silentErrors"];class Y{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Q extends Y{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,i,r){if(super(),t(this,"enabled",!1),t(this,"skip",new Set),t(this,"pick",new Set),t(this,"deps",new Set),t(this,"translateKeys",!1),t(this,"translateValues",!1),t(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=W.includes(e),this.canBeFiltered&&(this.dict=T.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:u(`Invalid options argument: ${i}`)}applyInheritables(e){let t,n;for(t of K)n=e[t],void 0!==n&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,i,{tagKeys:r,tagValues:o}=this.dict;for(n of e)"string"==typeof n?(i=o.indexOf(n),-1===i&&(i=r.indexOf(Number(n))),-1!==i&&t.add(Number(r[i]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,ne(this.pick,this.deps)):this.enabled&&this.pick.size>0&&ne(this.pick,this.deps)}}var Z={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},J=new Map;class X extends Y{static useCached(e){let t=J.get(e);return void 0!==t||(t=new this(e),J.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):u(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=i?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of U)this[e]=Z[e];for(e of G)this[e]=Z[e];for(e of V)this[e]=Z[e];for(e of q)this[e]=new Q(e,Z[e],void 0,this)}setupFromTrue(){let e;for(e of U)this[e]=Z[e];for(e of G)this[e]=Z[e];for(e of V)this[e]=!0;for(e of q)this[e]=new Q(e,!0,void 0,this)}setupFromArray(e){let t;for(t of U)this[t]=Z[t];for(t of G)this[t]=Z[t];for(t of V)this[t]=Z[t];for(t of q)this[t]=new Q(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,W)}setupFromObject(e){let t;for(t of(W.ifd0=W.ifd0||W.image,W.ifd1=W.ifd1||W.thumbnail,Object.assign(this,e),U))this[t]=te(e[t],Z[t]);for(t of G)this[t]=te(e[t],Z[t]);for(t of V)this[t]=te(e[t],Z[t]);for(t of $)this[t]=new Q(t,Z[t],e[t],this);for(t of W)this[t]=new Q(t,Z[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,W,q),!0===e.tiff?this.batchEnableWithBool(W,!0):!1===e.tiff?this.batchEnableWithUserValue(W,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,W):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,W)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let e=t[n];this[n].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,n,i=n){if(e&&e.length){for(let e of i)this[e].enabled=!1;let t=ee(e,n);for(let[e,n]of t)ne(this[e].pick,n),this[e].enabled=!0}else if(t&&t.length){let e=ee(t,n);for(let[t,n]of e)ne(this[t].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:i,icc:r}=this;this.makerNote?t.deps.add(j):t.skip.add(j),this.userComment?t.deps.add(L):t.skip.add(L),n.enabled||e.skip.add(700),i.enabled||e.skip.add(I),r.enabled||e.skip.add(z)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:i}=this;i.needed&&(t.deps.add(P),e.deps.add(P)),t.needed&&e.deps.add(R),n.needed&&e.deps.add(F),this.tiff.enabled=W.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of W)this[e].finalizeFilters()}get onlyTiff(){return!H.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of $)this[e].enabled&&!b.has(e)&&m("segment parser",e)}}function ee(e,t){let n,i,r,o,s=[];for(r of t){for(o of(n=T.get(r),i=[],n))(e.includes(o[0])||e.includes(o[1]))&&i.push(o[0]);i.length&&s.push([r,i])}return s}function te(e,t){return void 0!==e?e:void 0!==t?t:void 0}function ne(e,t){for(let n of t)e.add(n)}t(X,"default",Z);class ie{constructor(e){t(this,"parsers",{}),t(this,"output",{}),t(this,"errors",[]),t(this,"pushToErrors",(e=>this.errors.push(e))),this.options=X.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?_(e,t):i&&!r&&e instanceof HTMLImageElement?_(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new f(e):i&&e instanceof Blob?k(e,t,"blob",C):void u(w)}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,i]of v)if(i.canHandle(e,t))return this.fileParser=new i(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),u("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),c(n=e)?void 0:n;var n}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let n=await t.parse();t.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,n=b.get("tiff",e);var i;if(t.tiff?i={start:0,type:"tiff"}:t.jpeg&&(i=await this.fileParser.getOrFindSegment("tiff")),void 0===i)return;let r=await this.fileParser.ensureSegmentChunk(i),o=this.parsers.tiff=new n(r,e,t),s=await o.extractThumbnail();return t.close&&t.close(),s}}async function re(e,t){let n=new ie(t);return await n.read(e),n.parse()}var oe=Object.freeze({__proto__:null,parse:re,Exifr:ie,fileParsers:v,segmentParsers:b,fileReaders:y,tagKeys:T,tagValues:A,tagRevivers:N,createDictionary:D,extendDictionary:S,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:C,chunkedProps:U,otherSegments:H,segments:$,tiffBlocks:W,segmentsAndBlocks:q,tiffExtractables:V,inheritables:K,allFormatters:G,Options:X});class se{static findPosition(e,t){let n=e.getUint16(t+2)+2,i="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,r=t+i,o=n-i;return{offset:t,length:n,headerLength:i,start:r,size:o,end:r+o}}static parse(e,t={}){return new this(e,new X({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof f?e:new f(e)}constructor(e,n={},i){t(this,"errors",[]),t(this,"raw",new Map),t(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=N.get(t),i=A.get(t),r=T.get(t),o=this.options[t],s=o.reviveValues&&!!n,a=o.translateValues&&!!i,l=o.translateKeys&&!!r,c={};for(let[t,o]of e)s&&n.has(t)?o=n.get(t)(o):a&&i.has(t)&&(o=this.translateValue(o,i.get(t))),l&&r.has(t)&&(t=r.get(t)||t),c[t]=o;return c}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}}function ae(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function le(e){return e>=224&&e<=239}function ce(e,t,n){for(let[i,r]of b)if(r.canHandle(e,t,n))return i}t(se,"headerLength",4),t(se,"type",void 0),t(se,"multiSegment",!1),t(se,"canHandle",(()=>!1));class ue extends class{constructor(e,n,i){t(this,"errors",[]),t(this,"ensureSegmentChunk",(async e=>{let t=e.start,n=e.size||65536;if(this.file.chunked)if(this.file.available(t,n))e.chunk=this.file.subarray(t,n);else try{e.chunk=await this.file.readChunk(t,n)}catch(t){u(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+n?e.chunk=this.file.subarray(t,n):void 0===e.size?e.chunk=this.file.subarray(t):u("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(b.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:e,chunk:n}=t,i=this.options[e];if(i&&i.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),t(this,"appSegments",[]),t(this,"jpegSegments",[]),t(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(b.keyList())):(e=void 0===e?b.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:n,findAll:i,wanted:r,remaining:o}=this;if(!i&&this.file.chunked&&(i=Array.from(r).some((e=>{let t=b.get(e),n=this.options[e];return t.multiSegment&&n.multiSegment})),i&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let t=!1;for(;o.size>0&&!t&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:i}=n,r=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>i&&!r?!await n.readNextChunk(e):!await n.readNextChunk(i),void 0===(e=this.findAppSegmentsInRange(e,n.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let n,i,r,o,s,a,{file:l,findAll:c,wanted:u,remaining:p,options:d}=this;for(;e<t;e++)if(255===l.getUint8(e))if(n=l.getUint8(e+1),le(n)){if(i=l.getUint16(e+2),r=ce(l,e,i),r&&u.has(r)&&(o=b.get(r),s=o.findPosition(l,e),a=d[r],s.type=r,this.appSegments.push(s),!c&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||p.delete(r)):p.delete(r),0===p.size)))break;d.recordUnknownSegments&&(s=se.findPosition(l,e),s.marker=n,this.unknownSegments.push(s)),e+=i+1}else if(ae(n)){if(i=l.getUint16(e+2),218===n&&!1!==d.stopAfterSos)return;d.recordJpegSegments&&this.jpegSegments.push({offset:e,length:i,marker:n}),e+=i+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let n,i,r,o=new Map;for(let s=0;s<e.length;s++)n=e[s],i=n[t],o.has(i)?r=o.get(i):o.set(i,r=[]),r.push(n);return Array.from(o)}(this.appSegments,"type");this.mergedAppSegments=e.map((([e,t])=>{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}t(ue,"type","jpeg"),v.set("jpeg",ue);const pe=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class de extends se{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:i,skip:r}=this.options[t];i=new Set(i);let o=i.size>0,s=0===r.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(o){if(i.has(a)&&(n.set(a,this.parseTag(e,a,t)),i.delete(a),0===i.size))break}else!s&&r.has(a)||n.set(a,this.parseTag(e,a,t));e+=12}return n}parseTag(e,t,n){let{chunk:i}=this,r=i.getUint16(e+2),o=i.getUint32(e+4),s=pe[r];if(s*o<=4?e+=8:e=i.getUint32(e+8),(r<1||r>13)&&u(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e}`),e>i.byteLength&&u(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e} is outside of chunk size ${i.byteLength}`),1===r)return i.getUint8Array(e,o);if(2===r)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=i.getString(e,o)).trim())?void 0:a;var a;if(7===r)return i.getUint8Array(e,o);if(1===o)return this.parseTagValue(r,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(r))(o),n=s;for(let i=0;i<o;i++)t[i]=this.parseTagValue(r,e),e+=n;return t}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:case 13:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);default:u(`Invalid tiff type ${e}`)}}}class he extends de{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&u("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&u(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,p(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(R),this.interopOffset=t.get(P),this.gpsOffset=t.get(F),this.xmp=t.get(700),this.iptc=t.get(I),this.icc=t.get(z),this.options.sanitize&&(t.delete(R),t.delete(P),t.delete(F),t.delete(700),t.delete(I),t.delete(z)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,p(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(P)),this.makerNote=e.get(j),this.userComment=e.get(L),this.options.sanitize&&(e.delete(P),e.delete(j),e.delete(L)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let n=e.get(t);n&&1===n.length&&e.set(t,n[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",fe(...e.get(2),e.get(1))),e.set("longitude",fe(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,i={};for(t of W)if(e=this[t],!c(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(i,n)}else i[t]=n;return this.makerNote&&(i.makerNote=this.makerNote),this.userComment&&(i.userComment=this.userComment),i}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,i]of Object.entries(t))this.assignObjectToOutput(e,n,i)}}function fe(e,t,n,i){var r=e+t/60+n/3600;return"S"!==i&&"W"!==i||(r*=-1),r}t(he,"type","tiff"),t(he,"headerLength",10),b.set("tiff",he);var me=Object.freeze({__proto__:null,default:oe,Exifr:ie,fileParsers:v,segmentParsers:b,fileReaders:y,tagKeys:T,tagValues:A,tagRevivers:N,createDictionary:D,extendDictionary:S,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:C,chunkedProps:U,otherSegments:H,segments:$,tiffBlocks:W,segmentsAndBlocks:q,tiffExtractables:V,inheritables:K,allFormatters:G,Options:X,parse:re});const ge={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},ve=Object.assign({},ge,{firstChunkSize:4e4,gps:[1,2,3,4]}),be=Object.assign({},ge,{tiff:!1,ifd1:!0,mergeOutput:!1}),ye=Object.assign({},ge,{firstChunkSize:4e4,ifd0:[274]});async function xe(e){let t=new ie(ye);await t.read(e);let n=await t.parse();if(n&&n.ifd0)return n.ifd0[274]}const we=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let n=t.match(/OS (\d+)_(\d+)/);if(n){let[,t,i]=n,r=Number(t)+.1*Number(i);e.rotateCanvas=r<13.4,e.rotateCss=!1}}else if(t.includes("OS X 10")){let[,n]=t.match(/OS X 10[_.](\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<15}if(t.includes("Chrome/")){let[,n]=t.match(/Chrome\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<81}else if(t.includes("Firefox/")){let[,n]=t.match(/Firefox\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<77}}class _e extends f{constructor(...e){super(...e),t(this,"ranges",new ke),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(0===e&&0===this.byteLength&&n){let e=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(e)}else{let n=e+t;if(n>this.byteLength){let{dataView:e}=this._extend(n);this._swapDataView(e)}}}_extend(e){let t;t=a?s.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let i=super.set(e,t);return this.ranges.add(t,i.byteLength),i}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class ke{constructor(){t(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let i=e+t,r=this.list.filter((t=>Ee(e,t.offset,i)||Ee(e,t.end,i)));if(r.length>0){e=Math.min(e,...r.map((e=>e.offset))),i=Math.max(i,...r.map((e=>e.end))),t=i-e;let n=r.shift();n.offset=e,n.length=t,n.end=i,this.list=this.list.filter((e=>!r.includes(e)))}else this.list.push({offset:e,length:t,end:i})}available(e,t){let n=e+t;return this.list.some((t=>t.offset<=e&&n<=t.end))}}function Ee(e,t,n){return e<=t&&t<=n}class Me extends _e{constructor(e,n){super(0),t(this,"chunksRead",0),this.input=e,this.options=n}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=await this.readChunk(e,t);return!!n&&n.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}y.set("blob",class extends Me{async readWhole(){this.chunked=!1;let e=await C(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let n=t?e+t:void 0,i=this.input.slice(e,n),r=await C(i);return this.set(r,e,!0)}}),e.Exifr=ie,e.Options=X,e.allFormatters=G,e.chunkedProps=U,e.createDictionary=D,e.default=me,e.extendDictionary=S,e.fetchUrlAsArrayBuffer=M,e.fileParsers=v,e.fileReaders=y,e.gps=async function(e){let t=new ie(ve);await t.read(e);let n=await t.parse();if(n&&n.gps){let{latitude:e,longitude:t}=n.gps;return{latitude:e,longitude:t}}},e.gpsOnlyOptions=ve,e.inheritables=K,e.orientation=xe,e.orientationOnlyOptions=ye,e.otherSegments=H,e.parse=re,e.readBlobAsArrayBuffer=C,e.rotation=async function(t){let n=await xe(t);return Object.assign({canvas:e.rotateCanvas,css:e.rotateCss},we[n])},e.rotations=we,e.segmentParsers=b,e.segments=$,e.segmentsAndBlocks=q,e.tagKeys=T,e.tagRevivers=N,e.tagValues=A,e.thumbnail=async function(e){let t=new ie(be);await t.read(e);let n=await t.extractThumbnail();return n&&a?s.from(n):n},e.thumbnailOnlyOptions=be,e.thumbnailUrl=async function(e){let t=await this.thumbnail(e);if(void 0!==t){let e=new Blob([t]);return URL.createObjectURL(e)}},e.tiffBlocks=W,e.tiffExtractables=V,Object.defineProperty(e,"__esModule",{value:!0})}(sr.exports);const ar=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var lr=function(e,t,n){var i,r;const o=ar.exec(e),s=null!=(i=null!=(r=t.mimeType)?r:null==o?void 0:o[1])?i:"plain/text";let a;if(null!=o[2]){const e=atob(decodeURIComponent(o[3])),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);a=[t]}else a=[decodeURIComponent(o[3])];return n?new File(a,t.name||"",{type:s}):new Blob(a,{type:s})};var cr=J.exports,ur=sr.exports;const pr=lr,dr=function(e){return e.startsWith("blob:")},hr=function(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)},fr={strings:{generatingThumbnails:"Generating thumbnails..."}};class mr extends cr.UIPlugin{constructor(e,t){super(e,t),this.onFileAdded=e=>{!e.preview&&e.data&&hr(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&dr(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!dr(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType||"image/jpeg",this.defaultLocale=fr;if(this.opts={thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1,...t},this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){const i=URL.createObjectURL(e.data),r=new Promise(((e,t)=>{const n=new Image;n.src=i,n.addEventListener("load",(()=>{URL.revokeObjectURL(i),e(n)})),n.addEventListener("error",(e=>{URL.revokeObjectURL(i),t(e.error||new Error("Could not create thumbnail"))}))})),o=(0,ur.rotation)(e.data).catch((()=>1));return Promise.all([r,o]).then((e=>{let[i,r]=e;const o=this.getProportionalDimensions(i,t,n,r.deg),s=this.rotateImage(i,r),a=this.resizeImage(s,o.width,o.height);return this.canvasToBlob(a,this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,n,i){let r=e.width/e.height;return 90!==i&&270!==i||(r=e.height/e.width),null!=t?{width:t,height:Math.round(t/r)}:null!=n?{width:Math.round(n*r),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}}resizeImage(e,t,n){let i=this.protect(e),r=Math.ceil(Math.log2(i.width/t));r<1&&(r=1);let o=t*2**(r-1),s=n*2**(r-1);const a=2;for(;r--;){const e=document.createElement("canvas");e.width=o,e.height=s,e.getContext("2d").drawImage(i,0,0,o,s),i=e,o=Math.round(o/a),s=Math.round(s/a)}return i}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return hr(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}mr.VERSION="2.2.2";var gr=mr;mr.prototype.canvasToBlob=function(e,t,n){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((i=>{e.toBlob(i,t,n)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>pr(e.toDataURL(t,n),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},mr.prototype.protect=function(e){const t=e.width/e.height,n=5e6,i=4096;let r=Math.floor(Math.sqrt(n*t)),o=Math.floor(n/Math.sqrt(n*t));if(r>i&&(r=i,o=Math.round(r/t)),o>i&&(o=i,r=Math.round(t*o)),e.width>r){const t=document.createElement("canvas");return t.width=r,t.height=o,t.getContext("2d").drawImage(e,0,0,r,o),t}return e},mr.prototype.rotateImage=function(e,t){let n=e.width,i=e.height;90!==t.deg&&270!==t.deg||(n=e.height,i=e.width);const r=document.createElement("canvas");r.width=n,r.height=i;const o=r.getContext("2d");return o.translate(n/2,i/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),r};const vr=An;var br=function(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&vr(e)?[e]:null};var yr=function e(t,n,i,r){let{onSuccess:o}=r;t.readEntries((r=>{const s=[...n,...r];r.length?queueMicrotask((()=>{e(t,s,i,{onSuccess:o})})):o(s)}),(e=>{i(e),o(n)}))};const xr=yr;function wr(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise(((t,n)=>e.file(t,n))),async*values(){const n=e.createReader(),i=await new Promise((e=>{xr(n,[],t,{onSuccess:n=>e(n.map((e=>wr(e,t))))})}));yield*i}}}async function*_r(e,t){if("file"===e.kind){const n=await e.getFile();null!==n&&(n.relativePath=t?`${t}/${e.name}`:null,yield n)}else if("directory"===e.kind)for await(const n of e.values())yield*_r(n,`${t}/${e.name}`)}const kr=Qn;const Er=async function*(e,t){const n=await Promise.all(Array.from(e.items,(async e=>{var n;return{lastResortFile:e.getAsFile(),entry:null!=(n=await(null==e.getAsFileSystemHandle?void 0:e.getAsFileSystemHandle()))?n:wr(e.webkitGetAsEntry(),t)}})));for(const{lastResortFile:e,entry:i}of n)if(null!=i)try{yield*_r(i,"")}catch(n){e?yield e:t(n)}},Mr=function(e){const t=kr(e.files);return Promise.resolve(t)};var Cr=async function(e,t){let{logDropError:n=(()=>{})}=void 0===t?{}:t;try{const t=[];for await(const i of Er(e,n))t.push(i);return t}catch{return Mr(e)}},Or=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Dr(e,t){return e===t||!(!Or(e)||!Or(t))}function Sr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}var Tr=Object.freeze({__proto__:null,default:function(e,t){var n;void 0===t&&(t=Sr);var i,r=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,r)||(i=e.apply(this,s),o=!0,n=this,r=s),i}}}),Ar=U(Tr),Nr="Expected a function",jr=0/0,Lr="[object Symbol]",Ir=/^\s+|\s+$/g,zr=/^[-+]0x[0-9a-f]+$/i,Rr=/^0b[01]+$/i,Fr=/^0o[0-7]+$/i,Br=parseInt,Pr="object"==typeof B&&B&&B.Object===Object&&B,Ur="object"==typeof self&&self&&self.Object===Object&&self,Hr=Pr||Ur||Function("return this")(),$r=Object.prototype.toString,Wr=Math.max,qr=Math.min,Vr=function(){return Hr.Date.now()};function Kr(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Gr(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&$r.call(e)==Lr}(e))return jr;if(Kr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Kr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ir,"");var n=Rr.test(e);return n||Fr.test(e)?Br(e.slice(2),n?2:8):zr.test(e)?jr:+e}var Yr=function(e,t,n){var i,r,o,s,a,l,c=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError(Nr);function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function f(e){return c=e,a=setTimeout(g,t),u?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function g(){var e=Vr();if(m(e))return v(e);a=setTimeout(g,function(e){var n=t-(e-l);return p?qr(n,o-(e-c)):n}(e))}function v(e){return a=void 0,d&&i?h(e):(i=r=void 0,s)}function b(){var e=Vr(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return f(l);if(p)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Gr(t)||0,Kr(n)&&(u=!!n.leading,o=(p="maxWait"in n)?Wr(Gr(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},b.flush=function(){return void 0===a?s:v(Vr())},b};const Qr=Yr,Zr=Zn,Jr=Jn;var Xr=function(){let e=!1;return Qr(((t,n)=>{const i=Jr(t,n),r=i.contains(document.activeElement);if(r&&e)return;const o=i.querySelector("[data-uppy-super-focusable]");if(!r||o)if(o)o.focus({preventScroll:!0}),e=!0;else{const t=i.querySelector(Zr);null==t||t.focus({preventScroll:!0}),e=!1}}),260)};var eo=function(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)},to=rn;var no=function(e){const t={color:"#838999",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("g",{fill:"#A7AFB7",fillRule:"nonzero"},(0,to.h)("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),(0,to.h)("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const n=e.split("/")[0],i=e.split("/")[1];return"text"===n?{color:"#5a5e69",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===n?{color:"#686de0",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("g",{fill:"#686DE0",fillRule:"evenodd"},(0,to.h)("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),(0,to.h)("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),(0,to.h)("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===n?{color:"#068dbb",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===n?{color:"#19af67",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===n&&"pdf"===i?{color:"#e25149",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===n&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)?{color:"#00C469",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t},io=rn;const ro=no;var oo=function(e){const{file:t}=e;if(t.preview)return(0,io.h)("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:n,icon:i}=ro(t.type);return(0,io.h)("div",{className:"uppy-Dashboard-Item-previewIconWrap"},(0,io.h)("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),(0,io.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},(0,io.h)("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},so=rn;var ao=function(e){const{file:t,toggleFileCard:n,i18n:i,metaFields:r}=e,{missingRequiredMetaFields:o}=t;if(null==o||!o.length)return null;const s=o.map((e=>((e,t)=>{const n=t.filter((t=>t.id===e));return n[0].name})(e,r))).join(", ");return(0,so.h)("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",(0,so.h)("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,t.id)},i("editFile")))},lo=rn;const co=oo,uo=ao,po=no;var ho=rn;function fo(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function mo(e){return(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":fo(e),title:fo(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function go(e){let{children:t}=e;return(0,ho.h)("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function vo(e){let{progress:t}=e;const n=2*Math.PI*15;return(0,ho.h)("g",null,(0,ho.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),(0,ho.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":n,"stroke-dashoffset":n-n/100*t}))}const bo="...";var yo=rn;const xo=le,wo=function(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=bo.length+1)return`${e.slice(0,t-1)}…`;const n=t-bo.length,i=Math.ceil(n/2),r=Math.floor(n/2);return e.slice(0,i)+bo+e.slice(-r)},_o=ao,ko=e=>{let{file:t,onClick:n}=e;return t.error?(0,yo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};var Eo=rn;const Mo=function(e,t){return t||(t="Copy the URL below"),new Promise((n=>{const i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=e,document.body.appendChild(i),i.select();const r=()=>{document.body.removeChild(i),window.prompt(t,e),n()};try{return document.execCommand("copy")?(document.body.removeChild(i),n()):r()}catch(e){return document.body.removeChild(i),r()}}))};function Co(e){let{file:t,uploadInProgressOrComplete:n,metaFields:i,canEditFile:r,i18n:o,onClick:s}=e;return!n&&i&&i.length>0||!n&&r(t)?(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>s()},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},(0,Eo.h)("g",{fillRule:"evenodd"},(0,Eo.h)("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),(0,Eo.h)("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),(0,Eo.h)("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Oo(e){let{i18n:t,onClick:n,file:i}=e;return(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:i.meta.name}),title:t("removeFile",{file:i.meta.name}),onClick:()=>n()},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},(0,Eo.h)("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),(0,Eo.h)("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function Do(e){const{i18n:t}=e;return(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>((e,t)=>{Mo(t.file.uploadURL,t.i18n("copyLinkToClipboardFallback")).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))})(t,e)},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},(0,Eo.h)("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var So=function(e){const{uppy:t,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:u}=e;return(0,Eo.h)("div",{className:"uppy-Dashboard-Item-actionWrapper"},(0,Eo.h)(Co,{i18n:l,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,n.id):u(n)}}),s&&n.uploadURL?(0,Eo.h)(Do,{file:n,uppy:t,i18n:l}):null,a?(0,Eo.h)(Oo,{i18n:l,file:n,uppy:t,onClick:()=>e.uppy.removeFile(n.id,"removed-by-user")}):null)},To=rn;const Ao=$.exports,No=function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0},jo=function(e){return(0,lo.h)("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:po(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&(0,lo.h)("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name},(0,lo.h)("span",{hidden:!0},e.file.meta.name)),(0,lo.h)(co,{file:e.file}),(0,lo.h)(uo,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},Lo=function(e){return e.file.progress.uploadStarted?e.isUploaded?(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,ho.h)(go,null,(0,ho.h)("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),(0,ho.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?(0,ho.h)(mo,e,(0,ho.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},(0,ho.h)("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),(0,ho.h)("path",{d:"M7.9 3H10v2H7.9z"}),(0,ho.h)("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),(0,ho.h)("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?(0,ho.h)(mo,e,(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage}),e.file.isPaused?(0,ho.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):(0,ho.h)("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},(0,ho.h)("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),(0,ho.h)("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage})))):(0,ho.h)(mo,e,(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage}),(0,ho.h)("polygon",{className:"cancel",transform:"translate(2, 2)",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"}))):null},Io=function(e){const{file:t}=e;return(0,yo.h)("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},(0,yo.h)("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:n}=e.file.meta;return(0,yo.h)("div",{className:"uppy-Dashboard-Item-name",title:n},wo(n,e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),(0,yo.h)(ko,{file:e.file,onClick:()=>alert(e.file.error)})),(0,yo.h)("div",{className:"uppy-Dashboard-Item-status"},(e=>{const{author:t}=e.file.meta,{providerName:n}=e.file.remote,i=`·`;return t?(0,yo.h)("div",{className:"uppy-Dashboard-Item-author"},(0,yo.h)("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},wo(t.name,13)),n?(0,yo.h)(yo.Fragment,null,` ${i} `,n,` ${i} `):null):null})(e),(e=>e.file.size&&(0,yo.h)("div",{className:"uppy-Dashboard-Item-statusSize"},xo(e.file.size)))(e),(e=>e.file.isGhost&&(0,yo.h)("span",null," • ",(0,yo.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),(0,yo.h)(_o,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},zo=So;class Ro extends To.Component{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!No(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=e.progress.uploadComplete&&!t&&!e.error,i=e.progress.uploadStarted||t,r=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:s}=e;let a=(this.props.individualCancellation||!r)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(a=!0);const l=Ao({"uppy-Dashboard-Item":!0,"is-inprogress":r&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return(0,To.h)("div",{className:l,id:`uppy_${e.id}`,role:this.props.role},(0,To.h)("div",{className:"uppy-Dashboard-Item-preview"},(0,To.h)(jo,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,To.h)(Lo,{uppy:this.props.uppy,file:e,error:o,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),(0,To.h)("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},(0,To.h)(Io,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,To.h)(zo,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:i,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}var Fo=Ro,Bo=rn;function Po(){return Po=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Po.apply(this,arguments)}const Uo={position:"relative",width:"100%",minHeight:"100%"},Ho={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class $o extends Bo.Component{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:n,renderRow:i,overscanCount:r=10,...o}=e;const{offset:s,height:a}=this.state;let l=Math.floor(s/n),c=Math.floor(a/n);r&&(l=Math.max(0,l-l%r),c+=r);const u=l+c+4,p=t.slice(l,u),d={...Uo,height:t.length*n},h={...Ho,top:l*n};return(0,Bo.h)("div",Po({onScroll:this.handleScroll},o),(0,Bo.h)("div",{role:"presentation",style:d},(0,Bo.h)("div",{role:"presentation",style:h},p.map(i))))}}var Wo=rn;function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qo.apply(this,arguments)}const Vo=$.exports,Ko=Fo,Go=$o;var Yo=rn;let Qo;Qo=Symbol.for("uppy test: disable unused locale key warning");class Zo extends Yo.Component{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>(0,Yo.h)("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderMyDeviceAcquirer=()=>(0,Yo.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},(0,Yo.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,Yo.h)("g",{fill:"none",fillRule:"evenodd"},(0,Yo.h)("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),(0,Yo.h)("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),(0,Yo.h)("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderBrowseButton=(e,t)=>{const n=this.props.acquirers.length;return(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===n},e)},this.renderDropPasteBrowseTagline=()=>{const e=this.props.acquirers.length,t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),i=this.props.fileManagerSelectionType,r=i.charAt(0).toUpperCase()+i.slice(1);return(0,Yo.h)("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${r}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${r}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>(0,Yo.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":this.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},e.icon(),(0,Yo.h)("div",{className:"uppy-DashboardTab-name"},e.name))),this.renderAcquirers=(e,t)=>{const n=[...e],i=n.splice(e.length-2,e.length);return(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!t&&this.renderMyDeviceAcquirer(),n.map((e=>this.renderAcquirer(e))),(0,Yo.h)("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map((e=>this.renderAcquirer(e)))))}}[Qo](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=e("poweredBy",{uppy:(0,Yo.h)("span",null,(0,Yo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,Yo.h)("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),(0,Yo.h)("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"))});return(0,Yo.h)("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)}render(){return(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&(0,Yo.h)("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}var Jo=Zo,Xo=rn;const es=$.exports,ts=Jo;var ns=e=>(0,Xo.h)("div",{className:es("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},(0,Xo.h)("div",{className:"uppy-DashboardContent-bar"},(0,Xo.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),(0,Xo.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),(0,Xo.h)(ts,e));var is=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},rs=rn;const ss=$.exports,as=is;var ls=function(e){let{activePickerPanel:t,className:n,hideAllPanels:i,i18n:r,state:o,uppy:s}=e;return(0,rs.h)("div",{className:ss("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:as,onDragLeave:as,onDrop:as,onPaste:as},(0,rs.h)("div",{className:"uppy-DashboardContent-bar"},(0,rs.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:t.name})),(0,rs.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i},r("cancel"))),(0,rs.h)("div",{className:"uppy-DashboardContent-panelBody"},s.getPlugin(t.id).render(o)))},cs=rn;const us=$.exports;var ps=function(e){const t=e.files[e.fileCardFor];return(0,cs.h)("div",{className:us("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},(0,cs.h)("div",{className:"uppy-DashboardContent-bar"},(0,cs.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:(0,cs.h)("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),(0,cs.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel")),(0,cs.h)("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),(0,cs.h)("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))},ds=rn;const hs="error",fs="waiting",ms="preprocessing",gs="uploading",vs="postprocessing",bs="complete",ys="paused";function xs(e){let{files:t,i18n:n,isAllComplete:i,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=e;const c=function(e,t,n,i){if(void 0===i&&(i={}),e)return hs;if(t)return bs;if(n)return ys;let r=fs;const o=Object.keys(i);for(let e=0;e<o.length;e++){const{progress:t}=i[o[e]];if(t.uploadStarted&&!t.uploadComplete)return gs;t.preprocess&&r!==gs&&(r=ms),t.postprocess&&r!==gs&&r!==ms&&(r=vs)}return r}(r,i,o,t);switch(c){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete")}}var ws=function(e){const{i18n:t,isAllComplete:n,hideCancelButton:i,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=e;let{allowNewUpload:a}=e;return a&&r&&(a=e.totalFileCount<e.maxNumberOfFiles),(0,ds.h)("div",{className:"uppy-DashboardContent-bar"},n||i?(0,ds.h)("div",null):(0,ds.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},t("cancel")),(0,ds.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},(0,ds.h)(xs,e)),a?(0,ds.h)("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},(0,ds.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},(0,ds.h)("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),(0,ds.h)("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):(0,ds.h)("div",null))},_s=rn,ks=se;const Es=$.exports,Ms=no,Cs=is,Os=oo;class Ds extends _s.Component{constructor(e){super(e),this.form=document.createElement("form"),this.updateMeta=(e,t)=>{this.setState((n=>{let{formState:i}=n;return{formState:{...i,[t]:e}}}))},this.handleSave=e=>{e.preventDefault();const t=this.props.fileCardFor;this.props.saveFileCard(this.state.formState,t)},this.handleCancel=()=>{const e=this.props.files[this.props.fileCardFor];this.props.uppy.emit("file-editor:cancel",e),this.props.toggleFileCard(!1)},this.saveOnEnter=e=>{if(13===e.keyCode){e.stopPropagation(),e.preventDefault();const t=this.props.files[this.props.fileCardFor];this.props.saveFileCard(this.state.formState,t.id)}},this.renderMetaFields=()=>{const e=this.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((e=>{const n=`uppy-Dashboard-FileCard-input-${e.id}`,i=this.props.requiredMetaFields.includes(e.id);return(0,_s.h)("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},(0,_s.h)("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:n},e.name),void 0!==e.render?e.render({value:this.state.formState[e.id],onChange:t=>this.updateMeta(t,e.id),fieldCSSClasses:t,required:i,form:this.form.id},_s.h):(0,_s.h)("input",{className:t.text,id:n,form:this.form.id,type:e.type||"text",required:i,value:this.state.formState[e.id],placeholder:e.placeholder,onKeyUp:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyDown:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyPress:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onInput:t=>this.updateMeta(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))};const t=this.props.files[this.props.fileCardFor],n=this.getMetaFields()||[],i={};n.forEach((e=>{i[e.id]=t.meta[e.id]||""})),this.state={formState:i},this.form.id=(0,ks.nanoid)()}componentWillMount(){this.form.addEventListener("submit",this.handleSave),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",this.handleSave),document.body.removeChild(this.form)}getMetaFields(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields}render(){const e=this.props.files[this.props.fileCardFor],t=this.props.canEditFile(e);return(0,_s.h)("div",{className:Es("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:Cs,onDragLeave:Cs,onDrop:Cs,onPaste:Cs},(0,_s.h)("div",{className:"uppy-DashboardContent-bar"},(0,_s.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:(0,_s.h)("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),(0,_s.h)("button",{className:"uppy-DashboardContent-back",type:"button",form:this.form.id,title:this.props.i18n("finishEditingFile"),onClick:this.handleCancel},this.props.i18n("cancel"))),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-inner"},(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ms(e.type).color}},(0,_s.h)(Os,{file:e}),t&&(0,_s.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:t=>{this.handleSave(t),this.props.openFileEditor(e)},form:this.form.id},this.props.i18n("editFile"))),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-actions"},(0,_s.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"form"in HTMLButtonElement.prototype?"submit":"button",onClick:"form"in HTMLButtonElement.prototype?void 0:this.handleSave,form:this.form.id},this.props.i18n("saveChanges")),(0,_s.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel,form:this.form.id},this.props.i18n("cancel")))))}}var Ss=Ds,Ts=rn;const As=$.exports,Ns="uppy-transition-slideDownUp",js=250;class Ls extends Ts.Component{constructor(e){super(e),this.state={cachedChildren:null,className:""}}componentWillUpdate(e){const{cachedChildren:t}=this.state,n=(0,Ts.toChildArray)(e.children)[0];if(t===n)return null;const i={cachedChildren:n};n&&!t&&(i.className=`${Ns}-enter`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ns}-enter ${Ns}-enter-active`}),this.enterTimeout=setTimeout((()=>{this.setState({className:""})}),js)}))),t&&!n&&void 0===this.leaveTimeout&&(i.cachedChildren=t,i.className=`${Ns}-leave`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ns}-leave ${Ns}-leave-active`}),this.leaveTimeout=setTimeout((()=>{this.setState({cachedChildren:null,className:""})}),js)}))),this.setState(i)}render(){const{cachedChildren:e,className:t}=this.state;return e?(0,Ts.cloneElement)(e,{className:As(t,e.props.className)}):null}}var Is=rn;function zs(){return zs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zs.apply(this,arguments)}const Rs=$.exports,Fs=eo,Bs=e=>{const t=0===e.totalFileCount,n=Vo("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),i=1===e.itemsPerRow?71:200,r={id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},o=Object.keys(e.files);e.recoveredState&&o.sort(((t,n)=>e.files[n].isGhost-e.files[t].isGhost));const s=function(e,t){const n=[];let i=[];return e.forEach((e=>{i.length<t?i.push(e):(n.push(i),i=[e])})),i.length&&n.push(i),n}(o,e.itemsPerRow);return(0,Wo.h)(Go,{class:n,role:"list",data:s,renderRow:t=>(0,Wo.h)("div",{role:"presentation",key:t[0]},t.map((t=>(0,Wo.h)(Ko,qo({key:t,uppy:e.uppy},r,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))))),rowHeight:i})},Ps=Jo,Us=ns,Hs=ls,$s=ps,Ws=ws,qs=Ss,Vs=Ls,Ks=900,Gs=700,Ys=576,Qs=400;var Zs=rn,Js=J.exports,Xs=se,ea=Yn;function ta(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var na=0;function ia(e){return"__private_"+na+++"_"+e}const ra=ri.exports,oa=qi.exports,sa=gr,aa=br,la=Qn,ca=Cr,ua=Ar,pa=Zn,da=Xr,ha=function(e){const t=0===e.totalFileCount,n=e.containerWidth>Ys,i=Rs({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>Ys,"uppy-size--lg":e.containerWidth>Gs,"uppy-size--xl":e.containerWidth>Ks,"uppy-size--height-md":e.containerHeight>Qs,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible});let r=1;e.containerWidth>Ks?r=5:e.containerWidth>Gs?r=4:e.containerWidth>Ys&&(r=3);const o=e.showSelectedFiles&&!t,s=e.recoveredState?Object.keys(e.recoveredState.files).length:null,a=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return(0,Is.h)("div",{className:i,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&Fs(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},(0,Is.h)("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),(0,Is.h)("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:(0,Is.h)("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},(0,Is.h)("span",{"aria-hidden":"true"},"×")),(0,Is.h)("div",{className:"uppy-Dashboard-innerWrap"},(0,Is.h)("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&(0,Is.h)(Ws,e),s&&(0,Is.h)("div",{className:"uppy-Dashboard-serviceMsg"},(0,Is.h)("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},(0,Is.h)("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},(0,Is.h)("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),(0,Is.h)("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),(0,Is.h)("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),(0,Is.h)("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),(0,Is.h)("div",{className:"uppy-Dashboard-serviceMsg-text"},a>0?e.i18n("recoveredXFiles",{smart_count:a}):e.i18n("recoveredAllFiles"))),o?(0,Is.h)(Bs,zs({},e,{itemsPerRow:r})):(0,Is.h)(Ps,zs({},e,{isSizeMD:n})),(0,Is.h)(Vs,null,e.showAddFilesPanel?(0,Is.h)(Us,zs({key:"AddFiles"},e,{isSizeMD:n})):null),(0,Is.h)(Vs,null,e.fileCardFor?(0,Is.h)(qs,zs({key:"FileCard"},e)):null),(0,Is.h)(Vs,null,e.activePickerPanel?(0,Is.h)(Hs,zs({key:"Picker"},e)):null),(0,Is.h)(Vs,null,e.showFileEditor?(0,Is.h)($s,zs({key:"Editor"},e)):null),(0,Is.h)("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))},fa={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."}}},ma=ua.default||ua,ga=9,va=27;function ba(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}function ya(){return(0,Zs.h)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},(0,Zs.h)("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var xa=ia("openFileEditorWhenFilesAdded"),wa=ia("attachRenderFunctionToTarget"),_a=ia("isTargetSupported"),ka=ia("getAcquirers"),Ea=ia("getProgressIndicators"),Ma=ia("getEditors");class Ca extends Js.UIPlugin{constructor(e,t){var n;super(e,t),n=this,this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,n=e.title||t,i=e.type;if("acquirer"!==i&&"progressindicator"!==i&&"editor"!==i){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return void this.uppy.log(e,"error")}const r={id:t,name:n,type:i},o=this.getPluginState().targets.slice();return o.push(r),this.setPluginState({targets:o}),this.el},this.hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||this.setPluginState(t)},this.showPanel=e=>{const{targets:t}=this.getPluginState(),n=t.filter((t=>"acquirer"===t.type&&t.id===e))[0];this.setPluginState({activePickerPanel:n,activeOverlayType:"PickerPanel"})},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return ta(this,Ma)[Ma](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),n=ta(this,Ma)[Ma](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),n.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();ta(this,Ma)[Ma](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.hideAllPanels()},this.openModal=()=>{const{promise:e,resolve:t}=ba();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=function(e){void 0===e&&(e={});const{manualClose:t=!0}=e,{isHidden:i,isClosing:r}=n.getPluginState();if(i||r)return;const{promise:o,resolve:s}=ba();if(n.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),n.opts.animateOpenClose){n.setPluginState({isClosing:!0});const e=()=>{n.setPluginState({isHidden:!0,isClosing:!1}),n.superFocus.cancel(),n.savedActiveElement.focus(),n.el.removeEventListener("animationend",e,!1),s()};n.el.addEventListener("animationend",e,!1)}else n.setPluginState({isHidden:!0}),n.superFocus.cancel(),n.savedActiveElement.focus(),s();var a;(document.removeEventListener("keydown",n.handleKeyDownInModal),t)&&(n.opts.browserBackButtonClose&&null!=(a=history.state)&&a[n.modalName]&&history.back());return n.uppy.emit("dashboard:modal-closed"),o},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const n=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",n):this.uppy.emit("dashboard:file-edit-complete",n),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:n,height:i}=t.contentRect;this.uppy.log(`[Dashboard] resized: ${n} / ${i}`,"debug"),this.setPluginState({containerWidth:n,containerHeight:i,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableAllFocusableElements=e=>{const t=la(this.el.querySelectorAll(pa));e?t.forEach((e=>{const t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((e=>{"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{e.keyCode===va&&this.requestCloseModal(e),e.keyCode===ga&&ea.forModal(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=la(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=la(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,n;e.preventDefault(),e.stopPropagation();const i=(()=>{let t=!0;return this.uppy.iteratePlugins((n=>{null!=n.canHandleRootDrop&&n.canHandleRootDrop(e)&&(t=!0)})),t})(),r=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!i&&!r||this.opts.disabled||this.opts.disableLocalFiles&&(r||!i)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)},this.handleDragLeave=e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)},this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let i=!1;const r=await ca(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),i||(this.uppy.info(e.message,"error"),i=!0)}});r.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(r)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{e.keyCode===ga&&ea.forInline(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,xa,{writable:!0,value:e=>{const t=e[0];this.canEditFile(t)&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=aa(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("file-editor:complete",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.on("files-added",ta(this,xa)[xa])},this.removeEvents=()=>{const e=aa(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("file-editor:complete",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.off("files-added",ta(this,xa)[xa])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,n=0===this.uppy.getState().info.length,i=!this.opts.inline;n&&(i||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableAllFocusableElements(!1),this.superFocusOnEachUpdate()):this.disableAllFocusableElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,wa,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,_a,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,ka,{writable:!0,value:ma((e=>e.filter((e=>"acquirer"===e.type&&ta(this,_a)[_a](e))).map(ta(this,wa)[wa])))}),Object.defineProperty(this,Ea,{writable:!0,value:ma((e=>e.filter((e=>"progressindicator"===e.type)).map(ta(this,wa)[wa])))}),Object.defineProperty(this,Ma,{writable:!0,value:ma((e=>e.filter((e=>"editor"===e.type)).map(ta(this,wa)[wa])))}),this.render=e=>{const t=this.getPluginState(),{files:n,capabilities:i,allowNewUpload:r}=e,{newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:c,inProgressNotPausedFiles:u,processingFiles:p,isUploadStarted:d,isAllComplete:h,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=ta(this,ka)[ka](t.targets),v=ta(this,Ea)[Ea](t.targets),b=ta(this,Ma)[Ma](t.targets);let y;return y="auto"===this.opts.theme?i.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ha({state:e,isHidden:t.isHidden,files:n,newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:c,inProgressNotPausedFiles:u,processingFiles:p,isUploadStarted:d,isAllComplete:h,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(n).length,totalProgress:e.totalProgress,allowNewUpload:r,acquirers:g,theme:y,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,disableAllFocusableElements:this.disableAllFocusableElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:v,editors:b,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:i.resumableUploads||!1,individualCancellation:i.individualCancellation,isMobileDevice:i.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},this.discoverProviderPlugins=()=>{this.uppy.iteratePlugins((e=>{e&&!e.target&&e.opts&&e.opts.target===this.constructor&&this.addTarget(e)}))},this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:n,allowMultipleUploadBatches:i}=this.uppy.opts;(n||i)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:r}=this.opts;r&&this.mount(r,this);(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.mount(this,t)})),this.opts.disableStatusBar||this.uppy.use(ra,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(oa,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(sa,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),"auto"===this.opts.theme&&this.darkModeMediaQuery.addListener(this.handleSystemDarkModeChange),this.discoverProviderPlugins(),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery.removeListener(this.handleSystemDarkModeChange),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.modalName=`uppy-Dashboard-${(0,Xs.nanoid)()}`,this.defaultLocale=fa;const i={target:"body",metaFields:[],trigger:null,inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:ya,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:()=>{this.uppy.reset(),this.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:()=>this.closeModal(),showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};this.opts={...i,...t},this.i18nInit(),this.superFocus=da(),this.ifFocusedOnUppyRecently=!1,this.makeDashboardInsidesVisibleAnywayTimeout=null,this.removeDragOverClassTimeout=null}}Ca.VERSION="2.4.3",Gn.exports=Ca;var Oa={exports:{}},Da="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Sa(){}function Ta(){}Ta.resetWarningCache=Sa;Oa.exports=function(){function e(e,t,n,i,r,o){if(o!==Da){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. "+"Use PropTypes.checkPropTypes() to call them. "+"Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ta,resetWarningCache:Sa};return n.PropTypes=n,n}();const Aa=Oa.exports,Na=J.exports.Uppy,ja=Aa.instanceOf(Na).isRequired,La=Aa.arrayOf(Aa.string),Ia=Aa.shape({strings:Aa.object,pluralize:Aa.func}),za=Aa.shape({id:Aa.string.isRequired,name:Aa.string.isRequired,placeholder:Aa.string}),Ra=Aa.oneOfType([Aa.arrayOf(za),Aa.func]),Fa=Aa.oneOfType([Aa.string,Aa.number]);var Ba={uppy:ja,locale:Ia,dashboard:{uppy:ja,inline:Aa.bool,plugins:La,width:Fa,height:Fa,showProgressDetails:Aa.bool,hideUploadButton:Aa.bool,hideProgressAfterFinish:Aa.bool,note:Aa.string,metaFields:Ra,proudlyDisplayPoweredByUppy:Aa.bool,disableStatusBar:Aa.bool,disableInformer:Aa.bool,disableThumbnailGenerator:Aa.bool,thumbnailWidth:Aa.number,locale:Ia}};const Pa=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ua=/^(aria-|data-)/;var Ha=e=>Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return Ua.test(t)||Pa.includes(t)})));var $a=function(e,t){return Object.keys(e.props).some((n=>!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e.validProps,n)&&e.props[n]!==t[n]))};const Wa=t,qa=Gn.exports,Va=Ba.dashboard,Ka=Ha,Ga=$a,Ya=Wa.createElement;class Qa extends Wa.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Ga(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:Dashboard",...this.props,target:this.container};delete t.uppy,e.use(qa,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Ka(this.props),Ya("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Qa.propTypes=Va,Qa.defaultProps={inline:!0};const Za=t,Ja=Oa.exports,Xa=Gn.exports,el=Ba.dashboard,tl=Ha,nl=$a,il=Za.createElement;class rl extends Za.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(nl(this,e)){const e={...this.props,onRequestCloseModal:this.props.onRequestClose};delete e.uppy,this.plugin.setOptions(e)}e.open&&!this.props.open?this.plugin.closeModal():!e.open&&this.props.open&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DashboardModal",...this.props,onRequestCloseModal:this.props.onRequestClose};t.target||(t.target=this.container),delete t.uppy,e.use(Xa,t),this.plugin=e.getPlugin(t.id),this.props.open&&this.plugin.openModal()}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=tl(this.props),il("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}rl.propTypes={target:"undefined"!=typeof window?Ja.instanceOf(window.HTMLElement):Ja.any,open:Ja.bool,onRequestClose:Ja.func,closeModalOnClickOutside:Ja.bool,disablePageScrollWhenModalOpen:Ja.bool,...el};var ol={exports:{}},sl=J.exports,al=rn;const ll=Qn,cl=eo,ul=Cr,pl={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};class dl extends sl.UIPlugin{constructor(e,t){super(e,t),this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const i=await ul(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});i.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(i)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=pl;this.opts={target:null,inputName:"files[]",width:"100%",height:"100%",note:null,...t},this.i18nInit(),this.isDragDropSupported=cl(),this.removeDragOverClassTimeout=null,this.onInputChange=this.onInputChange.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.addFiles=this.addFiles.bind(this),this.render=this.render.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}onInputChange(e){const t=ll(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null}handleDragOver(e){var t,n;e.preventDefault(),e.stopPropagation();const{types:i}=e.dataTransfer,r=i.some((e=>"Files"===e)),{allowNewUpload:o}=this.uppy.getState();if(!r||!o)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)}handleDragLeave(e){var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return(0,al.h)("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return(0,al.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},(0,al.h)("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return(0,al.h)("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:(0,al.h)("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return(0,al.h)("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset\n uppy-DragDrop-container\n ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n `,t={width:this.opts.width,height:this.opts.height};return(0,al.h)("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),(0,al.h)("div",{className:"uppy-DragDrop-inner"},dl.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}dl.VERSION="2.1.2";const hl=t,fl=ol.exports=dl,ml=Ba,gl=Ha,vl=$a,bl=hl.createElement;class yl extends hl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(vl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DragDrop",...this.props,target:this.container};delete t.uppy,e.use(fl,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=gl(this.props),bl("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}yl.propTypes={uppy:ml.uppy,locale:ml.locale},yl.defaultProps={};var xl=yl,wl={exports:{}},_l=rn,kl=J.exports;class El extends kl.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator";this.opts={target:"body",fixed:!1,hideAfterFinish:!0,...t},this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,n=(0===t||100===t)&&this.opts.hideAfterFinish;return(0,_l.h)("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},(0,_l.h)("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),(0,_l.h)("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}El.VERSION="2.1.2",wl.exports=El;const Ml=t,Cl=Oa.exports,Ol=wl.exports,Dl=Ba.uppy,Sl=Ha,Tl=$a,Al=Ml.createElement;class Nl extends Ml.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Tl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:ProgressBar",...this.props,target:this.container};delete t.uppy,e.use(Ol,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Sl(this.props),Al("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Nl.propTypes={uppy:Dl,fixed:Cl.bool,hideAfterFinish:Cl.bool},Nl.defaultProps={};const jl=t,Ll=Oa.exports,Il=ri.exports,zl=Ba.uppy,Rl=Ha,Fl=$a,Bl=jl.createElement;class Pl extends jl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Fl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:StatusBar",...this.props,target:this.container};delete t.uppy,e.use(Il,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Rl(this.props),Bl("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Pl.propTypes={uppy:zl,hideAfterFinish:Ll.bool,showProgressDetails:Ll.bool},Pl.defaultProps={};var Ul={exports:{}},Hl=J.exports,$l=rn;const Wl=Qn,ql={strings:{chooseFiles:"Choose files"}};class Vl extends Hl.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=ql;this.opts={target:null,pretty:!0,inputName:"files[]",...t},this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=Wl(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):null;return(0,$l.h)("div",{className:"uppy-FileInput-container"},(0,$l.h)("input",{className:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&(0,$l.h)("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}Vl.VERSION="2.1.2",Ul.exports=Vl;const Kl=Oa.exports,Gl=t,Yl=Ul.exports,Ql=Ba,Zl=Gl.createElement;class Jl extends Gl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:FileInput",...this.props,target:this.container};delete t.uppy,e.use(Yl,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return Zl("div",{className:"uppy-Container",ref:e=>{this.container=e}})}}Jl.propTypes={uppy:Ql.uppy,locale:Ql.locale,pretty:Kl.bool,inputName:Kl.string},Jl.defaultProps={};const{useEffect:Xl,useRef:ec}=t,tc=J.exports.Uppy;const nc=5*1024*1024,ic={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:nc,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},rc={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxFileSize:100*1024*1024,allowedFileTypes:[".mp4",".mov",".avi",".mkv"]}},oc={formData:!0,fieldName:"blob"},sc=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}];function ac(){return ac=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ac.apply(this,arguments)}function lc(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cc={exports:{}},uc={},pc=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,hc=Object.prototype.propertyIsEnumerable;function fc(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var mc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var i=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==i.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=fc(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))dc.call(n,s)&&(r[s]=n[s]);if(pc){i=pc(n);for(var a=0;a<i.length;a++)hc.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},gc=mc,vc=60103,bc=60106;
|
|
17
|
+
*/function xe(e,t){const n=/\$/g,i="$$$$";let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=n[Symbol.replace](o,i)),r=ye(r,new RegExp(`%\\{${e}\\}`,"g"),o)}return r}var we=ve("apply");function _e(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var ke=class{constructor(e){Object.defineProperty(this,we,{value:_e}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(me(this,we)[we],this):me(this,we)[we](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!be(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return xe(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return xe(n,t)}},Ee="Expected a function",Me=0/0,Ce="[object Symbol]",Oe=/^\s+|\s+$/g,De=/^[-+]0x[0-9a-f]+$/i,Se=/^0b[01]+$/i,Te=/^0o[0-7]+$/i,Ae=parseInt,Ne="object"==typeof B&&B&&B.Object===Object&&B,je="object"==typeof self&&self&&self.Object===Object&&self,Le=Ne||je||Function("return this")(),Ie=Object.prototype.toString,ze=Math.max,Re=Math.min,Fe=function(){return Le.Date.now()};function Be(e,t,n){var i,r,o,s,a,l,c=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError(Ee);function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function f(e){return c=e,a=setTimeout(g,t),u?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function g(){var e=Fe();if(m(e))return v(e);a=setTimeout(g,function(e){var n=t-(e-l);return p?Re(n,o-(e-c)):n}(e))}function v(e){return a=void 0,d&&i?h(e):(i=r=void 0,s)}function b(){var e=Fe(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return f(l);if(p)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Ue(t)||0,Pe(n)&&(u=!!n.leading,o=(p="maxWait"in n)?ze(Ue(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},b.flush=function(){return void 0===a?s:v(Fe())},b}function Pe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ue(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Ie.call(e)==Ce}(e))return Me;if(Pe(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Pe(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Oe,"");var n=Se.test(e);return n||Te.test(e)?Ae(e.slice(2),n?2:8):De.test(e)?Me:+e}var He=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(Ee);return Pe(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Be(e,t,{leading:i,maxWait:t,trailing:r})};var $e=0;function We(e){return"__private_"+$e+++"_"+e}var qe=We("publish");class Ve{constructor(){Object.defineProperty(this,qe,{value:Ke}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},n={...this.state,...e};this.state=n,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,qe)[qe](t,n,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function Ke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((e=>{e(...t)}))}Ve.VERSION="2.1.1";var Ge=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}};const Ye=Ge,Qe={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Ze(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}var Je=function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${Ze(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${Ze(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t};var Xe=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[i,r]=n.split(".");return i=parseInt(i,10),r=parseInt(r,10),i<15||15===i&&r<15063||(i>18||18===i&&r>=18218)};var et=se,tt=X,nt=ae;let it,rt;function ot(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var st=0;function at(e){return"__private_"+st+++"_"+e}const lt=ke,ct=function(){var e={},t=e._fns={};return e.emit=function(e,n,i,r,o,s,a){var l=function(e){var n=t[e]?t[e]:[],i=e.indexOf(":"),r=-1===i?[e]:[e.substring(0,i),e.substring(i+1)],o=Object.keys(t),s=0,a=o.length;for(;s<a;s++){var l=o[s];if("*"===l&&(n=n.concat(t[l])),2===r.length&&r[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){var i=0,r=t.length;for(;i<r&&t[i];i++)t[i].event=e,t[i].apply(t[i],n)}(e,l,[n,i,r,o,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function i(){n.apply(this,arguments),e.off(t,i)}))},e.off=function(e,t){var n=[];if(e&&t)for(var i=this._fns[e],r=0,o=i?i.length:0;r<o;r++)i[r]!==t&&n.push(i[r]);n.length?this._fns[e]=n:delete this._fns[e]},e},ut=He,pt=function(){return new Ve},dt=function(e){var t;if(e.type)return e.type;const n=e.name?null==(t=Ye(e.name).extension)?void 0:t.toLowerCase():null;return n&&n in Qe?Qe[n]:"application/octet-stream"},ht=Ge,ft=Je,mt=Xe,gt=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"},vt={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var bt=at("plugins"),yt=at("restricter"),xt=at("storeUnsubscribe"),wt=at("emitter"),_t=at("preProcessors"),kt=at("uploaders"),Et=at("postProcessors"),Mt=at("informAndEmit"),Ct=at("checkRequiredMetaFieldsOnFile"),Ot=at("checkRequiredMetaFields"),Dt=at("assertNewUploadAllowed"),St=at("checkAndCreateFileStateObject"),Tt=at("startIfAutoProceed"),At=at("addListeners"),Nt=at("updateOnlineStatus"),jt=at("createUpload"),Lt=at("getUpload"),It=at("removeUpload"),zt=at("runUpload");it=Symbol.for("uppy test: getPlugins"),rt=Symbol.for("uppy test: createUpload");class Rt{constructor(e){Object.defineProperty(this,zt,{value:Gt}),Object.defineProperty(this,It,{value:Kt}),Object.defineProperty(this,Lt,{value:Vt}),Object.defineProperty(this,jt,{value:qt}),Object.defineProperty(this,At,{value:Wt}),Object.defineProperty(this,Tt,{value:$t}),Object.defineProperty(this,St,{value:Ht}),Object.defineProperty(this,Dt,{value:Ut}),Object.defineProperty(this,Ot,{value:Pt}),Object.defineProperty(this,Ct,{value:Bt}),Object.defineProperty(this,Mt,{value:Ft}),Object.defineProperty(this,bt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:ct()}),Object.defineProperty(this,_t,{writable:!0,value:new Set}),Object.defineProperty(this,kt,{writable:!0,value:new Set}),Object.defineProperty(this,Et,{writable:!0,value:new Set}),Object.defineProperty(this,Nt,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=vt;const t={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:nt.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:pt(),logger:tt.justErrorsLogger,infoTimeout:5e3};this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=tt.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=ut(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:mt(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),ot(this,yt)[yt]=new nt.Restricter((()=>this.opts),this.i18n),ot(this,xt)[xt]=this.store.subscribe(((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),ot(this,At)[At]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];ot(this,wt)[wt].emit(e,...n)}on(e,t){return ot(this,wt)[wt].on(e,t),this}once(e,t){return ot(this,wt)[wt].once(e,t),this}off(e,t){return ot(this,wt)[wt].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new lt([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((e=>{e.setOptions()})),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach((i=>{const r={...t[i]};r.progress={...r.progress,...e},n[i]=r})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){ot(this,_t)[_t].add(e)}removePreProcessor(e){return ot(this,_t)[_t].delete(e)}addPostProcessor(e){ot(this,Et)[Et].add(e)}removePostProcessor(e){return ot(this,Et)[Et].delete(e)}addUploader(e){ot(this,kt)[kt].add(e)}removeUploader(e){return ot(this,kt)[kt].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach((t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const i={...n[e].meta,...t};n[e]={...n[e],meta:i},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),i=Object.values(e),r=i.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),o=i.filter((e=>!e.progress.uploadStarted)),s=i.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),a=i.filter((e=>e.progress.uploadStarted)),l=i.filter((e=>e.isPaused)),c=i.filter((e=>e.progress.uploadComplete)),u=i.filter((e=>e.error)),p=r.filter((e=>!e.isPaused)),d=i.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:o,startedFiles:s,uploadStartedFiles:a,pausedFiles:l,completeFiles:c,erroredFiles:u,inProgressFiles:r,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:a.length>0,isAllComplete:100===t&&c.length===i.length&&0===d.length,isAllErrored:!!n&&u.length===i.length,isAllPaused:0!==r.length&&l.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:i.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return ot(this,yt)[yt].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){ot(this,Dt)[Dt](e);const{files:t}=this.getState();let n=ot(this,St)[St](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),ot(this,Tt)[Tt](),n.id}addFiles(e){ot(this,Dt)[Dt]();const t={...this.getState().files},n=[],i=[];for(let r=0;r<e.length;r++)try{let i=ot(this,St)[St](t,e[r]);t[i.id]&&t[i.id].isGhost&&(i={...t[i.id],data:e[r].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${i.name}, ${i.id}`)),t[i.id]=i,n.push(i)}catch(e){e.isRestriction||i.push(e)}if(this.setState({files:t}),n.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach((e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)})),n.length>0&&ot(this,Tt)[Tt](),i.length>0){let e="Multiple errors occurred while adding files:\n";if(i.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(i,e);{const t=new Error(e);throw t.errors=i,t}}}removeFiles(e,t){const{files:n,currentUploads:i}=this.getState(),r={...n},o={...i},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach((e=>{n[e]&&(s[e]=n[e],delete r[e])})),Object.keys(o).forEach((e=>{const t=i[e].fileIDs.filter(a);0!==t.length?o[e]={...i[e],fileIDs:t}:delete o[e]}));const l={currentUploads:o,files:r};0===Object.keys(r).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const c=Object.keys(s);c.forEach((e=>{this.emit("file-removed",s[e],t)})),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!0};e[t]=n})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=ot(this,jt)[jt](t,{forceAllowNewUpload:!0});return ot(this,zt)[zt](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=ot(this,jt)[jt]([e],{forceAllowNewUpload:!0});return ot(this,zt)[zt](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins((e=>{e.provider&&e.provider.logout&&e.provider.logout()}))}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),n=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,i=n.reduce(((e,t)=>e+t.progress.percentage),0),r=Math.round(i/t*100);return void this.setState({totalProgress:r})}let i=t.reduce(((e,t)=>e+t.progress.bytesTotal),0);const r=i/t.length;i+=r*n.length;let o=0;t.forEach((e=>{o+=e.progress.bytesUploaded})),n.forEach((e=>{o+=r*(e.progress.percentage||0)/100}));let s=0===i?0:Math.round(o/i*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}.`+" Please verify that the plugin was imported and spelled correctly.")}const n=new e(this,t),i=n.id;if(!i)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(i);if(r){const e=`Already found a plugin named '${r.id}'. `+`Tried to use: '${i}'.\n`+"Uppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(e)}return e.VERSION&&this.log(`Using ${i} v${e.VERSION}`),n.type in ot(this,bt)[bt]?ot(this,bt)[bt][n.type].push(n):ot(this,bt)[bt][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(ot(this,bt)[bt])){const n=t.find((t=>t.id===e));if(null!=n)return n}}[it](e){return ot(this,bt)[bt][e]}iteratePlugins(e){Object.values(ot(this,bt)[bt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=ot(this,bt)[bt][e.type],n=t.findIndex((t=>t.id===e.id));-1!==n&&t.splice(n,1);const i={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(i)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),ot(this,xt)[xt](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",ot(this,Nt)[Nt]),window.removeEventListener("offline",ot(this,Nt)[Nt]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const i="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:i?e.message:e,details:i?e.details:null}]}),setTimeout((()=>this.hideInfo()),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?ot(this,zt)[zt](e):(ot(this,It)[It](e),Promise.reject(new Error("Nonexistent upload")))}[rt](){return ot(this,jt)[jt](...arguments)}addResultData(e,t){if(!ot(this,Lt)[Lt](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),i={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:i}})}upload(){var e;null!=(e=ot(this,bt)[bt].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"==typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((()=>ot(this,yt)[yt].validateMinNumberOfFiles(t))).catch((e=>{throw ot(this,Mt)[Mt](e),e})).then((()=>{if(!ot(this,Ot)[Ot](t))throw new nt.RestrictionError(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap((e=>e.fileIDs)),i=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||i.push(t.id)}));const r=ot(this,jt)[jt](i);return ot(this,zt)[zt](r)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function Ft(e,t){const{message:n,details:i=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:i},"error",this.opts.infoTimeout),this.log(`${n} ${i}`.trim(),"error")}function Bt(e){const{missingFields:t,error:n}=ot(this,yt)[yt].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function Pt(e){let t=!0;for(const n of Object.values(e))ot(this,Ct)[Ct](n)||(t=!1);return t}function Ut(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new nt.RestrictionError(this.i18n("noMoreFilesAllowed"));throw ot(this,Mt)[Mt](t,e),t}}function Ht(e,t){const n=dt(t),i=gt(n,t),r=ht(i).extension,o=Boolean(t.isRemote),s=ft({...t,type:n});if(this.checkIfFileAlreadyExists(s)){const e=new nt.RestrictionError(this.i18n("noDuplicates",{fileName:i}));throw ot(this,Mt)[Mt](e,t),e}const a=t.meta||{};a.name=i,a.type=n;const l=Number.isFinite(t.data.size)?t.data.size:null;let c={source:t.source||"",id:s,name:i,extension:r||"",meta:{...this.getState().meta,...a},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isRemote:o,remote:t.remote||"",preview:t.preview};const u=this.opts.onBeforeFileAdded(c,e);if(!1===u){const e=new nt.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof u&&null!==u&&(c=u);try{const t=Object.keys(e).map((t=>e[t]));ot(this,yt)[yt].validate(c,t)}catch(e){throw ot(this,Mt)[Mt](e,c),e}return c}function $t(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function Wt(){const e=(e,t,n)=>{let i=e.message||"Unknown error";e.details&&(i+=` ${e.details}`),this.setState({error:i}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:i,response:n})};this.on("error",e),this.on("upload-error",((t,n,i)=>{if(e(n,t,i),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),ot(this,Mt)[Mt](e)}else ot(this,Mt)[Mt](n)})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-started",(e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:ot(this,Et)[Et].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&ot(this,Ct)[Ct](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",ot(this,Nt)[Nt]),window.addEventListener("offline",ot(this,Nt)[Nt]),setTimeout(ot(this,Nt)[Nt],3e3))}function qt(e,t){void 0===t&&(t={});const{forceAllowNewUpload:n=!1}=t,{allowNewUpload:i,currentUploads:r}=this.getState();if(!i&&!n)throw new Error("Cannot create a new upload: already uploading.");const o=(0,et.nanoid)();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[o]:{fileIDs:e,step:0,result:{}}}}),o}function Vt(e){const{currentUploads:t}=this.getState();return t[e]}function Kt(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function Gt(e){let{currentUploads:t}=this.getState(),n=t[e];const i=n.step||0,r=[...ot(this,_t)[_t],...ot(this,kt)[kt],...ot(this,Et)[Et]];try{for(let o=i;o<r.length&&n;o++){const i=r[o],s={...n,step:o};this.setState({currentUploads:{...t,[e]:s}}),await i(s.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw ot(this,It)[It](e),t}if(n){n.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const i=n.fileIDs.map((e=>this.getFile(e))),r=i.filter((e=>!e.error)),o=i.filter((e=>e.error));await this.addResultData(e,{successful:r,failed:o,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let o;return n&&(o=n.result,this.emit("complete",o),ot(this,It)[It](e)),null==o&&this.log(`Not setting result for an upload that has been removed: ${e}`),o}Rt.VERSION="2.3.1";var Yt,Qt,Zt,Jt,Xt,en,tn,nn=Rt,rn={},on={},sn=[],an=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ln(e,t){for(var n in t)e[n]=t[n];return e}function cn(e){var t=e.parentNode;t&&t.removeChild(e)}function un(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Yt.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return pn(e,s,i,r,null)}function pn(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++Zt:r};return null==r&&null!=Qt.vnode&&Qt.vnode(o),o}function dn(e){return e.children}function hn(e,t){this.props=e,this.context=t}function fn(e,t){if(null==t)return e.__?fn(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?fn(e):null}function mn(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return mn(e)}}function gn(e){(!e.__d&&(e.__d=!0)&&Xt.push(e)&&!vn.__r++||en!==Qt.debounceRendering)&&((en=Qt.debounceRendering)||setTimeout)(vn)}function vn(){for(var e;vn.__r=Xt.length;)e=Xt.sort((function(e,t){return e.__v.__b-t.__v.__b})),Xt=[],e.some((function(e){var t,n,i,r,o,s;e.__d&&(o=(r=(t=e).__v).__e,(s=t.__P)&&(n=[],(i=ln({},r)).__v=r.__v+1,Mn(s,r,i,t.__n,void 0!==s.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?fn(r):o,r.__h),Cn(n,r),r.__e!=o&&mn(r)))}))}function bn(e,t,n,i,r,o,s,a,l,c){var u,p,d,h,f,m,g,v=i&&i.__k||sn,b=v.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?pn(null,h,null,null,h):Array.isArray(h)?pn(dn,{children:h},null,null,null):h.__b>0?pn(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(d=v[u])||d&&h.key==d.key&&h.type===d.type)v[u]=void 0;else for(p=0;p<b;p++){if((d=v[p])&&h.key==d.key&&h.type===d.type){v[p]=void 0;break}d=null}Mn(e,h,d=d||on,r,o,s,a,l,c),f=h.__e,(p=h.ref)&&d.ref!=p&&(g||(g=[]),d.ref&&g.push(d.ref,null,h),g.push(p,h.__c||f,h)),null!=f?(null==m&&(m=f),"function"==typeof h.type&&h.__k===d.__k?h.__d=l=yn(h,l,e):l=xn(e,h,d,v,f,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=fn(d))}for(n.__e=m,u=b;u--;)null!=v[u]&&("function"==typeof n.type&&null!=v[u].__e&&v[u].__e==n.__d&&(n.__d=fn(i,u+1)),Dn(v[u],v[u]));if(g)for(u=0;u<g.length;u++)On(g[u],g[++u],g[++u])}function yn(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?yn(i,t,n):xn(n,i,i,r,i.__e,t));return t}function xn(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=2)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function wn(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||an.test(t)?n:n+"px"}function _n(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||wn(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||wn(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?En:kn,o):e.removeEventListener(t,o?En:kn,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function kn(e){this.l[e.type+!1](Qt.event?Qt.event(e):e)}function En(e){this.l[e.type+!0](Qt.event?Qt.event(e):e)}function Mn(e,t,n,i,r,o,s,a,l){var c,u,p,d,h,f,m,g,v,b,y,x,w,_=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=Qt.__b)&&c(t);try{e:if("function"==typeof _){if(g=t.props,v=(c=_.contextType)&&i[c.__c],b=c?v?v.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?t.__c=u=new _(g,b):(t.__c=u=new hn(g,b),u.constructor=_,u.render=Sn),v&&v.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=i,p=u.__d=!0,u.__h=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=ln({},u.__s)),ln(u.__s,_.getDerivedStateFromProps(g,u.__s))),d=u.props,h=u.state,p)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,h,f)}))}if(u.context=b,u.props=g,u.__v=t,u.__P=e,y=Qt.__r,x=0,"prototype"in _&&_.prototype.render)u.state=u.__s,u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context);else do{u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++x<25);u.state=u.__s,null!=u.getChildContext&&(i=ln(ln({},i),u.getChildContext())),p||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(d,h)),w=null!=c&&c.type===dn&&null==c.key?c.props.children:c,bn(e,Array.isArray(w)?w:[w],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,i,r,o,s,a){var l,c,u,p=n.props,d=t.props,h=t.type,f=0;if("svg"===h&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===h)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,d.is&&d),o=null,a=!1}if(null===h)p===d||a&&e.data===d||(e.data=d);else{if(o=o&&Yt.call(e.childNodes),c=(p=n.props||on).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(p={},f=0;f<e.attributes.length;f++)p[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||_n(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||_n(e,o,t[o],n[o],i)}(e,d,p,r,a),u)t.__k=[];else if(f=t.props.children,bn(e,Array.isArray(f)?f:[f],t,n,i,r&&"foreignObject"!==h,o,s,o?o[0]:n.__k&&fn(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&cn(o[f]);a||("value"in d&&void 0!==(f=d.value)&&(f!==e.value||"progress"===h&&!f||"option"===h&&f!==p.value)&&_n(e,"value",f,p.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==e.checked&&_n(e,"checked",f,p.checked,!1))}return e}(n.__e,t,n,i,r,o,s,l);(c=Qt.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Qt.__e(e,t,n)}}function Cn(e,t){Qt.__c&&Qt.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Qt.__e(e,t.__v)}}))}function On(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Qt.__e(e,n)}}function Dn(e,t,n){var i,r;if(Qt.unmount&&Qt.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||On(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Qt.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Dn(i[r],t,"function"!=typeof e.type);n||null==e.__e||cn(e.__e),e.__=e.__e=e.__d=void 0}function Sn(e,t,n){return this.constructor(e,n)}function Tn(e,t,n){var i,r,o;Qt.__&&Qt.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Mn(t,e=(!i&&n||t).__k=un(dn,null,[e]),r||on,on,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Yt.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Cn(o,e)}Yt=sn.slice,Qt={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},Zt=0,Jt=function(e){return null!=e&&void 0===e.constructor},hn.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ln({},this.state),"function"==typeof e&&(e=e(ln({},n),this.props)),e&&ln(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),gn(this))},hn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),gn(this))},hn.prototype.render=dn,Xt=[],vn.__r=0,tn=0,rn.Component=hn,rn.Fragment=dn,rn.cloneElement=function(e,t,n){var i,r,o,s=ln({},e.props);for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];return arguments.length>2&&(s.children=arguments.length>3?Yt.call(arguments,2):n),pn(e.type,s,i||e.key,r||e.ref,null)},rn.createContext=function(e,t){var n={__c:t="__cC"+tn++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(gn)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n},rn.createElement=un,rn.createRef=function(){return{current:null}},rn.h=un,rn.hydrate=function e(t,n){Tn(t,n,e)},rn.isValidElement=Jt,rn.options=Qt,rn.render=Tn,rn.toChildArray=function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,n)})):n.push(t)),n};var An=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE};const Nn=An;var jn=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):Nn(e)?e:null};var Ln=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};const In=ke;var zn=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new In([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}},Rn=rn;function Fn(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Bn=0;function Pn(e){return"__private_"+Bn+++"_"+e}const Un=jn,Hn=Ln,$n=zn;var Wn=Pn("updateUI");class qn extends $n{constructor(){super(...arguments),Object.defineProperty(this,Wn,{writable:!0,value:void 0})}mount(e,t){const n=t.id,i=Un(e);if(i){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),Fn(this,Wn)[Wn]=function(e){let t=null,n=null;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return n=r,t||(t=Promise.resolve().then((()=>(t=null,e(...n))))),t}}((e=>{this.uppy.getPlugin(this.id)&&((0,Rn.render)(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(i.innerHTML=""),(0,Rn.render)(this.render(this.uppy.getState()),t),this.el=t,i.appendChild(t),t.dir=this.opts.direction||Hn(t)||"ltr",this.onMount(),this.el}let r;if("object"==typeof e&&e instanceof qn)r=e;else if("function"==typeof e){const t=e;this.uppy.iteratePlugins((e=>{e instanceof t&&(r=e)}))}if(r)return this.uppy.log(`Installing ${n} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let o=`Invalid target option given to ${n}.`;throw o+="function"==typeof e?" 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.":"If you meant to target an HTML element, please make sure that the element exists. "+"Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. "+"(see https://github.com/transloadit/uppy/issues/1042)\n\n"+"If you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}update(e){var t,n;null!=this.el&&(null==(t=(n=Fn(this,Wn))[Wn])||t.call(n,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var Vn=qn;!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=X;e.exports=nn;const i=Vn;t.UIPlugin=i;const r=zn;t.BasePlugin=r;const o=nn;t.Uppy=o;const s=Vn,a=zn;o.Uppy=o,o.UIPlugin=s,o.BasePlugin=a,o.debugLogger=n.debugLogger}(J,J.exports);var Kn=P(J.exports),Gn={exports:{}},Yn={},Qn=Array.from,Zn=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];var Jn=function(e,t){if(t){const n=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(n)return n}return e};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.forInline=function(e,t,n){null===t||ii(e,t,n)},Yn.forModal=ii;const Xn=Qn,ei=Zn,ti=Jn;function ni(e,t){const n=t[0];n&&(n.focus(),e.preventDefault())}function ii(e,t,n){const i=ti(n,t),r=Xn(i.querySelectorAll(ei)),o=r.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(i)?ni(e,r):e.shiftKey&&0===o?function(e,t){const n=t[t.length-1];n&&(n.focus(),e.preventDefault())}(e,r):e.shiftKey||o!==r.length-1||ni(e,r)}var ri={exports:{}};var oi=function(e){if(!e.bytesUploaded)return 0;const t=Date.now()-e.uploadStarted;return e.bytesUploaded/(t/1e3)};var si=function(e){return e.bytesTotal-e.bytesUploaded},ai={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},li={};const ci=function(e){return{hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)}};var ui=function(e){const t=ci(e);return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`};Object.defineProperty(li,"__esModule",{value:!0}),li.CancelBtn=function(e){const{i18n:t,uppy:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>n.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,pi.h)("g",{fill:"none",fillRule:"evenodd"},(0,pi.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,pi.h)("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},li.DoneBtn=function(e){const{i18n:t,doneButtonHandler:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},t("done"))},li.LoadingSpinner=bi,li.PauseResumeButton=function(e){const{isAllPaused:t,i18n:n,isAllComplete:i,resumableUploads:r,uppy:o}=e,s=n(t?"resume":"pause");return(0,pi.h)("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){return i?null:r?t?o.resumeAll():o.pauseAll():o.cancelAll()},"data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},(0,pi.h)("g",{fill:"none",fillRule:"evenodd"},(0,pi.h)("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),(0,pi.h)("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))},li.ProgressBarComplete=function(e){const{i18n:t}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},(0,pi.h)("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},li.ProgressBarError=function(e){const{error:t,i18n:n,complete:i,numUploads:r}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-content",title:n("uploadFailed")},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,pi.h)("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},n("uploadFailed"),(0,pi.h)("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${n("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),(0,pi.h)(xi,{i18n:n,complete:i,numUploads:r})))},li.ProgressBarProcessing=function(e){const{progress:t}=e,{value:n,mode:i,message:r}=t,o=Math.round(100*n),s=`·`;return(0,pi.h)("div",{className:"uppy-StatusBar-content"},(0,pi.h)(bi,null),"determinate"===i?`${o}% ${s} `:"",r)},li.ProgressBarUploading=function(e){const{i18n:t,supportsUploadProgress:n,totalProgress:i,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:u,totalUploadedSize:p,totalSize:d,totalETA:h,startUpload:f}=e,m=l&&o;if(!o||s)return null;const g=t(a?"paused":"uploading");return(0,pi.h)("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},a?null:(0,pi.h)(bi,null),(0,pi.h)("div",{className:"uppy-StatusBar-status"},(0,pi.h)("div",{className:"uppy-StatusBar-statusPrimary"},n?`${g}: ${i}%`:g),a||m||!r?null:n?(0,pi.h)(_i,{numUploads:c,complete:u,totalUploadedSize:p,totalSize:d,totalETA:h,i18n:t}):(0,pi.h)(xi,{i18n:t,complete:u,numUploads:c}),m?(0,pi.h)(wi,{i18n:t,newFiles:l,startUpload:f}):null))},li.ProgressDetails=yi,li.RetryBtn=function(e){const{i18n:t,uppy:n}=e;return(0,pi.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>n.retryAll(),"data-uppy-super-focusable":!0},(0,pi.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},(0,pi.h)("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))},li.UploadBtn=function(e){const{newFiles:t,isUploadStarted:n,recoveredState:i,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=e,l=di("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===mi.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=r(t&&n&&!i?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return(0,pi.h)("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)};var pi=rn;const di=$.exports,hi=le,fi=ui,mi=ai,gi=`·`,vi=()=>` ${gi} `;function bi(){return(0,pi.h)("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},(0,pi.h)("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function yi(e){const{numUploads:t,complete:n,totalUploadedSize:i,totalSize:r,totalETA:o,i18n:s}=e,a=t>1;return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:t}),(0,pi.h)("span",{className:"uppy-StatusBar-additionalInfo"},a&&vi(),s("dataUploadedOfTotal",{complete:hi(i),total:hi(r)}),vi(),s("xTimeLeft",{time:fi(o)})))}function xi(e){const{i18n:t,complete:n,numUploads:i}=e;return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:n,smart_count:i}))}function wi(e){const{i18n:t,newFiles:n,startUpload:i}=e,r=di("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondary"},(0,pi.h)("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:n})),(0,pi.h)("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:n}),onClick:i},t("upload")))}const _i=He(yi,500,{leading:!0,trailing:!0});var ki=rn,Ei=li;const Mi=$.exports,Ci=ai,Oi=function(e){const t=[];let n,i;for(const{progress:r}of Object.values(e)){const{preprocess:e,postprocess:o}=r;null==i&&(e||o)&&({mode:n,message:i}=e||o),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==o?void 0:o.mode)&&t.push(o.value)}return{mode:n,message:i,value:t.reduce(((e,n)=>e+n/t.length),0)}},{STATE_ERROR:Di,STATE_WAITING:Si,STATE_PREPROCESSING:Ti,STATE_UPLOADING:Ai,STATE_POSTPROCESSING:Ni,STATE_COMPLETE:ji}=Ci;var Li=function(e){const{newFiles:t,allowNewUpload:n,isUploadInProgress:i,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:c,hideRetryButton:u,recoveredState:p,uploadState:d,totalProgress:h,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:v,doneButtonHandler:b,isUploadStarted:y,i18n:x,startUpload:w,uppy:_,isAllComplete:k,showProgressDetails:E,numUploads:M,complete:C,totalSize:O,totalETA:D,totalUploadedSize:S}=e,T=function(){switch(d){case Ni:case Ti:{const e=Oi(f);return"determinate"===e.mode?100*e.value:h}case Di:return null;case Ai:return m?h:null;default:return h}}(),A=function(){if(p)return!1;switch(d){case Si:return a||0===t;case ji:return g;default:return!1}}(),N=null!=T?T:100,j=!s&&t&&!i&&!r&&n&&!a,L=!c&&d!==Si&&d!==ji,I=o&&!l&&d===Ai,z=s&&!k&&!u,R=b&&d===ji,F=Mi("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(d){case Ni:case Ti:{const{mode:e}=Oi(f);return"indeterminate"===e}case Ai:return!m;default:return!1}}()}),B=Mi("uppy-StatusBar",`is-${d}`,{"has-ghosts":v});return(0,ki.h)("div",{className:B,"aria-hidden":A},(0,ki.h)("div",{className:F,style:{width:`${N}%`},role:"progressbar","aria-label":`${N}%`,"aria-valuetext":`${N}%`,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":T}),(()=>{switch(d){case Ti:case Ni:return(0,ki.h)(Ei.ProgressBarProcessing,{progress:Oi(f)});case ji:return(0,ki.h)(Ei.ProgressBarComplete,{i18n:x});case Di:return(0,ki.h)(Ei.ProgressBarError,{error:s,i18n:x,numUploads:M,complete:C});case Ai:return(0,ki.h)(Ei.ProgressBarUploading,{i18n:x,supportsUploadProgress:m,totalProgress:h,showProgressDetails:E,isUploadStarted:y,isAllComplete:k,isAllPaused:r,newFiles:t,numUploads:M,complete:C,totalUploadedSize:S,totalSize:O,totalETA:D,startUpload:w});default:return null}})(),(0,ki.h)("div",{className:"uppy-StatusBar-actions"},p||j?(0,ki.h)(Ei.UploadBtn,{newFiles:t,isUploadStarted:y,recoveredState:p,i18n:x,isSomeGhost:v,startUpload:w,uploadState:d}):null,z?(0,ki.h)(Ei.RetryBtn,{i18n:x,uppy:_}):null,I?(0,ki.h)(Ei.PauseResumeButton,{isAllPaused:r,i18n:x,isAllComplete:k,resumableUploads:o,uppy:_}):null,L?(0,ki.h)(Ei.CancelBtn,{i18n:x,uppy:_}):null,R?(0,ki.h)(Ei.DoneBtn,{i18n:x,doneButtonHandler:b}):null))},Ii=J.exports;const zi=oi,Ri=si,Fi=Ln,Bi=ai,Pi=Li,Ui={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Hi(e){const t=function(e){let t=0;return e.forEach((e=>{t+=zi(e.progress)})),t}(e);if(0===t)return 0;const n=e.reduce(((e,t)=>e+Ri(t.progress)),0);return Math.round(n/t*10)/10}function $i(e,t,n,i){if(e&&!t)return Bi.STATE_ERROR;if(t)return Bi.STATE_COMPLETE;if(n)return Bi.STATE_WAITING;let r=Bi.STATE_WAITING;const o=Object.keys(i);for(let e=0;e<o.length;e++){const{progress:t}=i[o[e]];if(t.uploadStarted&&!t.uploadComplete)return Bi.STATE_UPLOADING;t.preprocess&&r!==Bi.STATE_UPLOADING&&(r=Bi.STATE_PREPROCESSING),t.postprocess&&r!==Bi.STATE_UPLOADING&&r!==Bi.STATE_PREPROCESSING&&(r=Bi.STATE_POSTPROCESSING)}return r}class Wi extends Ii.UIPlugin{constructor(e,t){super(e,t),this.startUpload=()=>{const{recoveredState:e}=this.uppy.getState();if(!e)return this.uppy.upload().catch((()=>{}));this.uppy.emit("restore-confirmed")},this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ui;this.opts={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null,...t},this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:n,allowNewUpload:i,totalProgress:r,error:o,recoveredState:s}=e,{newFiles:a,startedFiles:l,completeFiles:c,inProgressNotPausedFiles:u,isUploadStarted:p,isAllComplete:d,isAllErrored:h,isAllPaused:f,isUploadInProgress:m,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),v=s?Object.values(n):a,b=Hi(u),y=!!t.resumableUploads,x=!1!==t.uploadProgress;let w=0,_=0;return l.forEach((e=>{w+=e.progress.bytesTotal||0,_+=e.progress.bytesUploaded||0})),Pi({error:o,uploadState:$i(o,d,s,e.files||{}),allowNewUpload:i,totalProgress:r,totalSize:w,totalUploadedSize:_,isAllComplete:!1,isAllPaused:f,isAllErrored:h,isUploadStarted:p,isUploadInProgress:m,isSomeGhost:g,recoveredState:s,complete:c.length,newFiles:v.length,numUploads:l.length,totalETA:b,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:y,supportsUploadProgress:x,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;Fi(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}Wi.VERSION="2.2.2",ri.exports=Wi;var qi={exports:{}},Vi=rn;const Ki=300;class Gi extends Vi.Component{constructor(){super(...arguments),this.ref=(0,Vi.createRef)()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Ki)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Ki)}render(){const{children:e}=this.props;return(0,Vi.h)("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}var Yi=Gi,Qi=rn;function Zi(e,t){const n=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return n[t]||(n[t]=n=>{e.refs[t]=n})}function Ji(e){const t={};for(let o=0;o<e.length;o++)if(null!=e[o]){t[(n=e[o],i=o.toString(36),r=void 0,null!=(r=null==n?void 0:n.key)?r:i)]=e[o]}var n,i,r;return t}function Xi(e,t){e=e||{},t=t||{};const n=n=>t.hasOwnProperty(n)?t[n]:e[n],i={};let r=[];for(const n in e)t.hasOwnProperty(n)?r.length&&(i[n]=r,r=[]):r.push(n);const o={};for(const e in t){if(i.hasOwnProperty(e))for(let t=0;t<i[e].length;t++){const r=i[e][t];o[i[e][t]]=n(r)}o[e]=n(e)}for(let e=0;e<r.length;e++)o[r[e]]=n(r[e]);return o}class er extends Qi.Component{constructor(e,t){super(e,t),this.refs={},this.state={children:Ji((0,Qi.toChildArray)((0,Qi.toChildArray)(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Ji((0,Qi.toChildArray)(e.children)||[]),n=this.state.children;let i;for(i in this.setState((e=>({children:Xi(e.children,t)}))),t)if(t.hasOwnProperty(i)){const e=n&&n.hasOwnProperty(i);t[i]&&e&&this.currentlyTransitioningKeys[i]?(this.keysToEnter.push(i),this.keysToAbortLeave.push(i)):!t[i]||e||this.currentlyTransitioningKeys[i]||this.keysToEnter.push(i)}for(i in n)if(n.hasOwnProperty(i)){const e=t&&t.hasOwnProperty(i);!n[i]||e||this.currentlyTransitioningKeys[i]||this.keysToLeave.push(i)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);n&&n.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=Ji((0,Qi.toChildArray)(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const t=(i={},r=this.state.children,Object.assign(i,r));delete t[e],this.setState({children:t})}var i,r}render(e,t){let{childFactory:n,transitionLeave:i,transitionName:r,transitionAppear:o,transitionEnter:s,transitionLeaveTimeout:a,transitionEnterTimeout:l,transitionAppearTimeout:c,component:u,...p}=e,{children:d}=t;const h=[];for(const e in d)if(d.hasOwnProperty(e)){const t=d[e];if(t){const i=Zi(this,e),r=(0,Qi.cloneElement)(n(t),{ref:i,key:e});h.push(r)}}return(0,Qi.h)(u,p,h)}}er.defaultProps={component:"span",childFactory:e=>e};var tr=rn,nr=J.exports;const ir=Yi,rr=er;class or extends nr.UIPlugin{constructor(e,t){super(e,t),this.render=e=>(0,tr.h)("div",{className:"uppy uppy-Informer"},(0,tr.h)(rr,null,e.info.map((e=>(0,tr.h)(ir,{key:e.message},(0,tr.h)("p",{role:"alert"},e.message," ",e.details&&(0,tr.h)("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer";this.opts={...t}}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}or.VERSION="2.1.1",qi.exports=or;var sr={exports:{}};!function(e){function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var n="undefined"!=typeof self?self:B;const i="undefined"!=typeof navigator,r=i&&"undefined"==typeof HTMLImageElement,o=!(void 0===B||"undefined"==typeof process||!process.versions||!process.versions.node),s=n.Buffer,a=!!s,l=e=>void 0!==e;function c(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(l).length)}function u(e){let t=new Error(e);throw delete t.stack,t}function p(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const d=e=>String.fromCharCode.apply(null,e),h="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class f{static from(e,t){return e instanceof this&&e.le===t?e:new f(e,void 0,void 0,t)}constructor(e,t=0,n,i){if("boolean"==typeof i&&(this.le=i),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===n&&(n=e.byteLength-t);let i=new DataView(e,t,n);this._swapDataView(i)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof f){void 0===n&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&u("Creating view outside of available memory in ArrayBuffer");let i=new DataView(e.buffer,t,n);this._swapDataView(i)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else u("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=f){return e instanceof DataView||e instanceof f?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||u("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new f(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),h?h.decode(n):a?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(d(n)));var n}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return d(n)}getUnicodeString(e=0,t=this.byteLength){const n=[];for(let i=0;i<t&&e+i<this.byteLength;i+=2)n.push(this.getUint16(e+i));return d(n)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function m(e,t){u(`${e} '${t}' was not loaded, try using full build of exifr.`)}class g extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||m(this.kind,e),t&&(e in t||function(e,t){u(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||m(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var v=new g("file parser"),b=new g("segment parser"),y=new g("file reader");let x=n.fetch;const w="Invalid input argument";function _(e,t){return(n=e).startsWith("data:")||n.length>1e4?E(e,t,"base64"):o&&e.includes("://")?k(e,t,"url",M):o?E(e,t,"fs"):i?k(e,t,"url",M):void u(w);var n}async function k(e,t,n,i){return y.has(n)?E(e,t,n):i?async function(e,t){let n=await t(e);return new f(n)}(e,i):void u(`Parser ${n} is not loaded`)}async function E(e,t,n){let i=new(y.get(n))(e,t);return await i.read(),i}const M=e=>x(e).then((e=>e.arrayBuffer())),C=e=>new Promise(((t,n)=>{let i=new FileReader;i.onloadend=()=>t(i.result||new ArrayBuffer),i.onerror=n,i.readAsArrayBuffer(e)}));class O extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function D(e,t,n){let i=new O;for(let[e,t]of n)i.set(e,t);if(Array.isArray(t))for(let n of t)e.set(n,i);else e.set(t,i);return i}function S(e,t,n){let i,r=e.get(t);for(i of n)r.set(i[0],i[1])}const T=new Map,A=new Map,N=new Map,j=37500,L=37510,I=33723,z=34675,R=34665,F=34853,P=40965,U=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],H=["jfif","xmp","icc","iptc","ihdr"],$=["tiff",...H],W=["ifd0","ifd1","exif","gps","interop"],q=[...$,...W],V=["makerNote","userComment"],K=["translateKeys","translateValues","reviveValues","multiSegment"],G=[...K,"sanitize","mergeOutput","silentErrors"];class Y{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Q extends Y{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,i,r){if(super(),t(this,"enabled",!1),t(this,"skip",new Set),t(this,"pick",new Set),t(this,"deps",new Set),t(this,"translateKeys",!1),t(this,"translateValues",!1),t(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=W.includes(e),this.canBeFiltered&&(this.dict=T.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:u(`Invalid options argument: ${i}`)}applyInheritables(e){let t,n;for(t of K)n=e[t],void 0!==n&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,i,{tagKeys:r,tagValues:o}=this.dict;for(n of e)"string"==typeof n?(i=o.indexOf(n),-1===i&&(i=r.indexOf(Number(n))),-1!==i&&t.add(Number(r[i]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,ne(this.pick,this.deps)):this.enabled&&this.pick.size>0&&ne(this.pick,this.deps)}}var Z={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},J=new Map;class X extends Y{static useCached(e){let t=J.get(e);return void 0!==t||(t=new this(e),J.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):u(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=i?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of U)this[e]=Z[e];for(e of G)this[e]=Z[e];for(e of V)this[e]=Z[e];for(e of q)this[e]=new Q(e,Z[e],void 0,this)}setupFromTrue(){let e;for(e of U)this[e]=Z[e];for(e of G)this[e]=Z[e];for(e of V)this[e]=!0;for(e of q)this[e]=new Q(e,!0,void 0,this)}setupFromArray(e){let t;for(t of U)this[t]=Z[t];for(t of G)this[t]=Z[t];for(t of V)this[t]=Z[t];for(t of q)this[t]=new Q(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,W)}setupFromObject(e){let t;for(t of(W.ifd0=W.ifd0||W.image,W.ifd1=W.ifd1||W.thumbnail,Object.assign(this,e),U))this[t]=te(e[t],Z[t]);for(t of G)this[t]=te(e[t],Z[t]);for(t of V)this[t]=te(e[t],Z[t]);for(t of $)this[t]=new Q(t,Z[t],e[t],this);for(t of W)this[t]=new Q(t,Z[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,W,q),!0===e.tiff?this.batchEnableWithBool(W,!0):!1===e.tiff?this.batchEnableWithUserValue(W,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,W):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,W)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let e=t[n];this[n].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,n,i=n){if(e&&e.length){for(let e of i)this[e].enabled=!1;let t=ee(e,n);for(let[e,n]of t)ne(this[e].pick,n),this[e].enabled=!0}else if(t&&t.length){let e=ee(t,n);for(let[t,n]of e)ne(this[t].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:i,icc:r}=this;this.makerNote?t.deps.add(j):t.skip.add(j),this.userComment?t.deps.add(L):t.skip.add(L),n.enabled||e.skip.add(700),i.enabled||e.skip.add(I),r.enabled||e.skip.add(z)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:i}=this;i.needed&&(t.deps.add(P),e.deps.add(P)),t.needed&&e.deps.add(R),n.needed&&e.deps.add(F),this.tiff.enabled=W.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of W)this[e].finalizeFilters()}get onlyTiff(){return!H.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of $)this[e].enabled&&!b.has(e)&&m("segment parser",e)}}function ee(e,t){let n,i,r,o,s=[];for(r of t){for(o of(n=T.get(r),i=[],n))(e.includes(o[0])||e.includes(o[1]))&&i.push(o[0]);i.length&&s.push([r,i])}return s}function te(e,t){return void 0!==e?e:void 0!==t?t:void 0}function ne(e,t){for(let n of t)e.add(n)}t(X,"default",Z);class ie{constructor(e){t(this,"parsers",{}),t(this,"output",{}),t(this,"errors",[]),t(this,"pushToErrors",(e=>this.errors.push(e))),this.options=X.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?_(e,t):i&&!r&&e instanceof HTMLImageElement?_(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new f(e):i&&e instanceof Blob?k(e,t,"blob",C):void u(w)}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,i]of v)if(i.canHandle(e,t))return this.fileParser=new i(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),u("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),c(n=e)?void 0:n;var n}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let n=await t.parse();t.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,n=b.get("tiff",e);var i;if(t.tiff?i={start:0,type:"tiff"}:t.jpeg&&(i=await this.fileParser.getOrFindSegment("tiff")),void 0===i)return;let r=await this.fileParser.ensureSegmentChunk(i),o=this.parsers.tiff=new n(r,e,t),s=await o.extractThumbnail();return t.close&&t.close(),s}}async function re(e,t){let n=new ie(t);return await n.read(e),n.parse()}var oe=Object.freeze({__proto__:null,parse:re,Exifr:ie,fileParsers:v,segmentParsers:b,fileReaders:y,tagKeys:T,tagValues:A,tagRevivers:N,createDictionary:D,extendDictionary:S,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:C,chunkedProps:U,otherSegments:H,segments:$,tiffBlocks:W,segmentsAndBlocks:q,tiffExtractables:V,inheritables:K,allFormatters:G,Options:X});class se{static findPosition(e,t){let n=e.getUint16(t+2)+2,i="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,r=t+i,o=n-i;return{offset:t,length:n,headerLength:i,start:r,size:o,end:r+o}}static parse(e,t={}){return new this(e,new X({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof f?e:new f(e)}constructor(e,n={},i){t(this,"errors",[]),t(this,"raw",new Map),t(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=N.get(t),i=A.get(t),r=T.get(t),o=this.options[t],s=o.reviveValues&&!!n,a=o.translateValues&&!!i,l=o.translateKeys&&!!r,c={};for(let[t,o]of e)s&&n.has(t)?o=n.get(t)(o):a&&i.has(t)&&(o=this.translateValue(o,i.get(t))),l&&r.has(t)&&(t=r.get(t)||t),c[t]=o;return c}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}}function ae(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function le(e){return e>=224&&e<=239}function ce(e,t,n){for(let[i,r]of b)if(r.canHandle(e,t,n))return i}t(se,"headerLength",4),t(se,"type",void 0),t(se,"multiSegment",!1),t(se,"canHandle",(()=>!1));class ue extends class{constructor(e,n,i){t(this,"errors",[]),t(this,"ensureSegmentChunk",(async e=>{let t=e.start,n=e.size||65536;if(this.file.chunked)if(this.file.available(t,n))e.chunk=this.file.subarray(t,n);else try{e.chunk=await this.file.readChunk(t,n)}catch(t){u(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+n?e.chunk=this.file.subarray(t,n):void 0===e.size?e.chunk=this.file.subarray(t):u("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(b.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:e,chunk:n}=t,i=this.options[e];if(i&&i.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),t(this,"appSegments",[]),t(this,"jpegSegments",[]),t(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(b.keyList())):(e=void 0===e?b.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:n,findAll:i,wanted:r,remaining:o}=this;if(!i&&this.file.chunked&&(i=Array.from(r).some((e=>{let t=b.get(e),n=this.options[e];return t.multiSegment&&n.multiSegment})),i&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let t=!1;for(;o.size>0&&!t&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:i}=n,r=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>i&&!r?!await n.readNextChunk(e):!await n.readNextChunk(i),void 0===(e=this.findAppSegmentsInRange(e,n.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let n,i,r,o,s,a,{file:l,findAll:c,wanted:u,remaining:p,options:d}=this;for(;e<t;e++)if(255===l.getUint8(e))if(n=l.getUint8(e+1),le(n)){if(i=l.getUint16(e+2),r=ce(l,e,i),r&&u.has(r)&&(o=b.get(r),s=o.findPosition(l,e),a=d[r],s.type=r,this.appSegments.push(s),!c&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||p.delete(r)):p.delete(r),0===p.size)))break;d.recordUnknownSegments&&(s=se.findPosition(l,e),s.marker=n,this.unknownSegments.push(s)),e+=i+1}else if(ae(n)){if(i=l.getUint16(e+2),218===n&&!1!==d.stopAfterSos)return;d.recordJpegSegments&&this.jpegSegments.push({offset:e,length:i,marker:n}),e+=i+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let n,i,r,o=new Map;for(let s=0;s<e.length;s++)n=e[s],i=n[t],o.has(i)?r=o.get(i):o.set(i,r=[]),r.push(n);return Array.from(o)}(this.appSegments,"type");this.mergedAppSegments=e.map((([e,t])=>{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}t(ue,"type","jpeg"),v.set("jpeg",ue);const pe=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class de extends se{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:i,skip:r}=this.options[t];i=new Set(i);let o=i.size>0,s=0===r.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(o){if(i.has(a)&&(n.set(a,this.parseTag(e,a,t)),i.delete(a),0===i.size))break}else!s&&r.has(a)||n.set(a,this.parseTag(e,a,t));e+=12}return n}parseTag(e,t,n){let{chunk:i}=this,r=i.getUint16(e+2),o=i.getUint32(e+4),s=pe[r];if(s*o<=4?e+=8:e=i.getUint32(e+8),(r<1||r>13)&&u(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e}`),e>i.byteLength&&u(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e} is outside of chunk size ${i.byteLength}`),1===r)return i.getUint8Array(e,o);if(2===r)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=i.getString(e,o)).trim())?void 0:a;var a;if(7===r)return i.getUint8Array(e,o);if(1===o)return this.parseTagValue(r,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(r))(o),n=s;for(let i=0;i<o;i++)t[i]=this.parseTagValue(r,e),e+=n;return t}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:case 13:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);default:u(`Invalid tiff type ${e}`)}}}class he extends de{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&u("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&u(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,p(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(R),this.interopOffset=t.get(P),this.gpsOffset=t.get(F),this.xmp=t.get(700),this.iptc=t.get(I),this.icc=t.get(z),this.options.sanitize&&(t.delete(R),t.delete(P),t.delete(F),t.delete(700),t.delete(I),t.delete(z)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,p(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(P)),this.makerNote=e.get(j),this.userComment=e.get(L),this.options.sanitize&&(e.delete(P),e.delete(j),e.delete(L)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let n=e.get(t);n&&1===n.length&&e.set(t,n[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",fe(...e.get(2),e.get(1))),e.set("longitude",fe(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,i={};for(t of W)if(e=this[t],!c(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(i,n)}else i[t]=n;return this.makerNote&&(i.makerNote=this.makerNote),this.userComment&&(i.userComment=this.userComment),i}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,i]of Object.entries(t))this.assignObjectToOutput(e,n,i)}}function fe(e,t,n,i){var r=e+t/60+n/3600;return"S"!==i&&"W"!==i||(r*=-1),r}t(he,"type","tiff"),t(he,"headerLength",10),b.set("tiff",he);var me=Object.freeze({__proto__:null,default:oe,Exifr:ie,fileParsers:v,segmentParsers:b,fileReaders:y,tagKeys:T,tagValues:A,tagRevivers:N,createDictionary:D,extendDictionary:S,fetchUrlAsArrayBuffer:M,readBlobAsArrayBuffer:C,chunkedProps:U,otherSegments:H,segments:$,tiffBlocks:W,segmentsAndBlocks:q,tiffExtractables:V,inheritables:K,allFormatters:G,Options:X,parse:re});const ge={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},ve=Object.assign({},ge,{firstChunkSize:4e4,gps:[1,2,3,4]}),be=Object.assign({},ge,{tiff:!1,ifd1:!0,mergeOutput:!1}),ye=Object.assign({},ge,{firstChunkSize:4e4,ifd0:[274]});async function xe(e){let t=new ie(ye);await t.read(e);let n=await t.parse();if(n&&n.ifd0)return n.ifd0[274]}const we=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let n=t.match(/OS (\d+)_(\d+)/);if(n){let[,t,i]=n,r=Number(t)+.1*Number(i);e.rotateCanvas=r<13.4,e.rotateCss=!1}}else if(t.includes("OS X 10")){let[,n]=t.match(/OS X 10[_.](\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<15}if(t.includes("Chrome/")){let[,n]=t.match(/Chrome\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<81}else if(t.includes("Firefox/")){let[,n]=t.match(/Firefox\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<77}}class _e extends f{constructor(...e){super(...e),t(this,"ranges",new ke),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(0===e&&0===this.byteLength&&n){let e=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(e)}else{let n=e+t;if(n>this.byteLength){let{dataView:e}=this._extend(n);this._swapDataView(e)}}}_extend(e){let t;t=a?s.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let i=super.set(e,t);return this.ranges.add(t,i.byteLength),i}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class ke{constructor(){t(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let i=e+t,r=this.list.filter((t=>Ee(e,t.offset,i)||Ee(e,t.end,i)));if(r.length>0){e=Math.min(e,...r.map((e=>e.offset))),i=Math.max(i,...r.map((e=>e.end))),t=i-e;let n=r.shift();n.offset=e,n.length=t,n.end=i,this.list=this.list.filter((e=>!r.includes(e)))}else this.list.push({offset:e,length:t,end:i})}available(e,t){let n=e+t;return this.list.some((t=>t.offset<=e&&n<=t.end))}}function Ee(e,t,n){return e<=t&&t<=n}class Me extends _e{constructor(e,n){super(0),t(this,"chunksRead",0),this.input=e,this.options=n}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=await this.readChunk(e,t);return!!n&&n.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}y.set("blob",class extends Me{async readWhole(){this.chunked=!1;let e=await C(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let n=t?e+t:void 0,i=this.input.slice(e,n),r=await C(i);return this.set(r,e,!0)}}),e.Exifr=ie,e.Options=X,e.allFormatters=G,e.chunkedProps=U,e.createDictionary=D,e.default=me,e.extendDictionary=S,e.fetchUrlAsArrayBuffer=M,e.fileParsers=v,e.fileReaders=y,e.gps=async function(e){let t=new ie(ve);await t.read(e);let n=await t.parse();if(n&&n.gps){let{latitude:e,longitude:t}=n.gps;return{latitude:e,longitude:t}}},e.gpsOnlyOptions=ve,e.inheritables=K,e.orientation=xe,e.orientationOnlyOptions=ye,e.otherSegments=H,e.parse=re,e.readBlobAsArrayBuffer=C,e.rotation=async function(t){let n=await xe(t);return Object.assign({canvas:e.rotateCanvas,css:e.rotateCss},we[n])},e.rotations=we,e.segmentParsers=b,e.segments=$,e.segmentsAndBlocks=q,e.tagKeys=T,e.tagRevivers=N,e.tagValues=A,e.thumbnail=async function(e){let t=new ie(be);await t.read(e);let n=await t.extractThumbnail();return n&&a?s.from(n):n},e.thumbnailOnlyOptions=be,e.thumbnailUrl=async function(e){let t=await this.thumbnail(e);if(void 0!==t){let e=new Blob([t]);return URL.createObjectURL(e)}},e.tiffBlocks=W,e.tiffExtractables=V,Object.defineProperty(e,"__esModule",{value:!0})}(sr.exports);const ar=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var lr=function(e,t,n){var i,r;const o=ar.exec(e),s=null!=(i=null!=(r=t.mimeType)?r:null==o?void 0:o[1])?i:"plain/text";let a;if(null!=o[2]){const e=atob(decodeURIComponent(o[3])),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);a=[t]}else a=[decodeURIComponent(o[3])];return n?new File(a,t.name||"",{type:s}):new Blob(a,{type:s})};var cr=J.exports,ur=sr.exports;const pr=lr,dr=function(e){return e.startsWith("blob:")},hr=function(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)},fr={strings:{generatingThumbnails:"Generating thumbnails..."}};class mr extends cr.UIPlugin{constructor(e,t){super(e,t),this.onFileAdded=e=>{!e.preview&&e.data&&hr(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&dr(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!dr(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType||"image/jpeg",this.defaultLocale=fr;if(this.opts={thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1,...t},this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){const i=URL.createObjectURL(e.data),r=new Promise(((e,t)=>{const n=new Image;n.src=i,n.addEventListener("load",(()=>{URL.revokeObjectURL(i),e(n)})),n.addEventListener("error",(e=>{URL.revokeObjectURL(i),t(e.error||new Error("Could not create thumbnail"))}))})),o=(0,ur.rotation)(e.data).catch((()=>1));return Promise.all([r,o]).then((e=>{let[i,r]=e;const o=this.getProportionalDimensions(i,t,n,r.deg),s=this.rotateImage(i,r),a=this.resizeImage(s,o.width,o.height);return this.canvasToBlob(a,this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,n,i){let r=e.width/e.height;return 90!==i&&270!==i||(r=e.height/e.width),null!=t?{width:t,height:Math.round(t/r)}:null!=n?{width:Math.round(n*r),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}}resizeImage(e,t,n){let i=this.protect(e),r=Math.ceil(Math.log2(i.width/t));r<1&&(r=1);let o=t*2**(r-1),s=n*2**(r-1);const a=2;for(;r--;){const e=document.createElement("canvas");e.width=o,e.height=s,e.getContext("2d").drawImage(i,0,0,o,s),i=e,o=Math.round(o/a),s=Math.round(s/a)}return i}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return hr(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}mr.VERSION="2.2.2";var gr=mr;mr.prototype.canvasToBlob=function(e,t,n){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((i=>{e.toBlob(i,t,n)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>pr(e.toDataURL(t,n),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},mr.prototype.protect=function(e){const t=e.width/e.height,n=5e6,i=4096;let r=Math.floor(Math.sqrt(n*t)),o=Math.floor(n/Math.sqrt(n*t));if(r>i&&(r=i,o=Math.round(r/t)),o>i&&(o=i,r=Math.round(t*o)),e.width>r){const t=document.createElement("canvas");return t.width=r,t.height=o,t.getContext("2d").drawImage(e,0,0,r,o),t}return e},mr.prototype.rotateImage=function(e,t){let n=e.width,i=e.height;90!==t.deg&&270!==t.deg||(n=e.height,i=e.width);const r=document.createElement("canvas");r.width=n,r.height=i;const o=r.getContext("2d");return o.translate(n/2,i/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),r};const vr=An;var br=function(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&vr(e)?[e]:null};var yr=function e(t,n,i,r){let{onSuccess:o}=r;t.readEntries((r=>{const s=[...n,...r];r.length?queueMicrotask((()=>{e(t,s,i,{onSuccess:o})})):o(s)}),(e=>{i(e),o(n)}))};const xr=yr;function wr(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise(((t,n)=>e.file(t,n))),async*values(){const n=e.createReader(),i=await new Promise((e=>{xr(n,[],t,{onSuccess:n=>e(n.map((e=>wr(e,t))))})}));yield*i}}}async function*_r(e,t){if("file"===e.kind){const n=await e.getFile();null!==n&&(n.relativePath=t?`${t}/${e.name}`:null,yield n)}else if("directory"===e.kind)for await(const n of e.values())yield*_r(n,`${t}/${e.name}`)}const kr=Qn;const Er=async function*(e,t){const n=await Promise.all(Array.from(e.items,(async e=>{var n;return{lastResortFile:e.getAsFile(),entry:null!=(n=await(null==e.getAsFileSystemHandle?void 0:e.getAsFileSystemHandle()))?n:wr(e.webkitGetAsEntry(),t)}})));for(const{lastResortFile:e,entry:i}of n)if(null!=i)try{yield*_r(i,"")}catch(n){e?yield e:t(n)}},Mr=function(e){const t=kr(e.files);return Promise.resolve(t)};var Cr=async function(e,t){let{logDropError:n=(()=>{})}=void 0===t?{}:t;try{const t=[];for await(const i of Er(e,n))t.push(i);return t}catch{return Mr(e)}},Or=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Dr(e,t){return e===t||!(!Or(e)||!Or(t))}function Sr(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dr(e[n],t[n]))return!1;return!0}var Tr=Object.freeze({__proto__:null,default:function(e,t){var n;void 0===t&&(t=Sr);var i,r=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,r)||(i=e.apply(this,s),o=!0,n=this,r=s),i}}}),Ar=U(Tr),Nr="Expected a function",jr=0/0,Lr="[object Symbol]",Ir=/^\s+|\s+$/g,zr=/^[-+]0x[0-9a-f]+$/i,Rr=/^0b[01]+$/i,Fr=/^0o[0-7]+$/i,Br=parseInt,Pr="object"==typeof B&&B&&B.Object===Object&&B,Ur="object"==typeof self&&self&&self.Object===Object&&self,Hr=Pr||Ur||Function("return this")(),$r=Object.prototype.toString,Wr=Math.max,qr=Math.min,Vr=function(){return Hr.Date.now()};function Kr(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Gr(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&$r.call(e)==Lr}(e))return jr;if(Kr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Kr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Ir,"");var n=Rr.test(e);return n||Fr.test(e)?Br(e.slice(2),n?2:8):zr.test(e)?jr:+e}var Yr=function(e,t,n){var i,r,o,s,a,l,c=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError(Nr);function h(t){var n=i,o=r;return i=r=void 0,c=t,s=e.apply(o,n)}function f(e){return c=e,a=setTimeout(g,t),u?h(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-c>=o}function g(){var e=Vr();if(m(e))return v(e);a=setTimeout(g,function(e){var n=t-(e-l);return p?qr(n,o-(e-c)):n}(e))}function v(e){return a=void 0,d&&i?h(e):(i=r=void 0,s)}function b(){var e=Vr(),n=m(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return f(l);if(p)return a=setTimeout(g,t),h(l)}return void 0===a&&(a=setTimeout(g,t)),s}return t=Gr(t)||0,Kr(n)&&(u=!!n.leading,o=(p="maxWait"in n)?Wr(Gr(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0},b.flush=function(){return void 0===a?s:v(Vr())},b};const Qr=Yr,Zr=Zn,Jr=Jn;var Xr=function(){let e=!1;return Qr(((t,n)=>{const i=Jr(t,n),r=i.contains(document.activeElement);if(r&&e)return;const o=i.querySelector("[data-uppy-super-focusable]");if(!r||o)if(o)o.focus({preventScroll:!0}),e=!0;else{const t=i.querySelector(Zr);null==t||t.focus({preventScroll:!0}),e=!1}}),260)};var eo=function(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)},to=rn;var no=function(e){const t={color:"#838999",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("g",{fill:"#A7AFB7",fillRule:"nonzero"},(0,to.h)("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),(0,to.h)("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const n=e.split("/")[0],i=e.split("/")[1];return"text"===n?{color:"#5a5e69",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===n?{color:"#686de0",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("g",{fill:"#686DE0",fillRule:"evenodd"},(0,to.h)("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),(0,to.h)("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),(0,to.h)("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===n?{color:"#068dbb",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===n?{color:"#19af67",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===n&&"pdf"===i?{color:"#e25149",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===n&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)?{color:"#00C469",icon:(0,to.h)("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},(0,to.h)("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t},io=rn;const ro=no;var oo=function(e){const{file:t}=e;if(t.preview)return(0,io.h)("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:n,icon:i}=ro(t.type);return(0,io.h)("div",{className:"uppy-Dashboard-Item-previewIconWrap"},(0,io.h)("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),(0,io.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},(0,io.h)("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},so=rn;var ao=function(e){const{file:t,toggleFileCard:n,i18n:i,metaFields:r}=e,{missingRequiredMetaFields:o}=t;if(null==o||!o.length)return null;const s=o.map((e=>((e,t)=>{const n=t.filter((t=>t.id===e));return n[0].name})(e,r))).join(", ");return(0,so.h)("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",(0,so.h)("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,t.id)},i("editFile")))},lo=rn;const co=oo,uo=ao,po=no;var ho=rn;function fo(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function mo(e){return(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":fo(e),title:fo(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function go(e){let{children:t}=e;return(0,ho.h)("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function vo(e){let{progress:t}=e;const n=2*Math.PI*15;return(0,ho.h)("g",null,(0,ho.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),(0,ho.h)("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":n,"stroke-dashoffset":n-n/100*t}))}const bo="...";var yo=rn;const xo=le,wo=function(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=bo.length+1)return`${e.slice(0,t-1)}…`;const n=t-bo.length,i=Math.ceil(n/2),r=Math.floor(n/2);return e.slice(0,i)+bo+e.slice(-r)},_o=ao,ko=e=>{let{file:t,onClick:n}=e;return t.error?(0,yo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};var Eo=rn;const Mo=function(e,t){return t||(t="Copy the URL below"),new Promise((n=>{const i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=e,document.body.appendChild(i),i.select();const r=()=>{document.body.removeChild(i),window.prompt(t,e),n()};try{return document.execCommand("copy")?(document.body.removeChild(i),n()):r()}catch(e){return document.body.removeChild(i),r()}}))};function Co(e){let{file:t,uploadInProgressOrComplete:n,metaFields:i,canEditFile:r,i18n:o,onClick:s}=e;return!n&&i&&i.length>0||!n&&r(t)?(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>s()},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},(0,Eo.h)("g",{fillRule:"evenodd"},(0,Eo.h)("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),(0,Eo.h)("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),(0,Eo.h)("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Oo(e){let{i18n:t,onClick:n,file:i}=e;return(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:i.meta.name}),title:t("removeFile",{file:i.meta.name}),onClick:()=>n()},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},(0,Eo.h)("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),(0,Eo.h)("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function Do(e){const{i18n:t}=e;return(0,Eo.h)("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>((e,t)=>{Mo(t.file.uploadURL,t.i18n("copyLinkToClipboardFallback")).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))})(t,e)},(0,Eo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},(0,Eo.h)("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var So=function(e){const{uppy:t,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:u}=e;return(0,Eo.h)("div",{className:"uppy-Dashboard-Item-actionWrapper"},(0,Eo.h)(Co,{i18n:l,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,n.id):u(n)}}),s&&n.uploadURL?(0,Eo.h)(Do,{file:n,uppy:t,i18n:l}):null,a?(0,Eo.h)(Oo,{i18n:l,file:n,uppy:t,onClick:()=>e.uppy.removeFile(n.id,"removed-by-user")}):null)},To=rn;const Ao=$.exports,No=function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0},jo=function(e){return(0,lo.h)("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:po(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&(0,lo.h)("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name},(0,lo.h)("span",{hidden:!0},e.file.meta.name)),(0,lo.h)(co,{file:e.file}),(0,lo.h)(uo,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},Lo=function(e){return e.file.progress.uploadStarted?e.isUploaded?(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,ho.h)(go,null,(0,ho.h)("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),(0,ho.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?(0,ho.h)(mo,e,(0,ho.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},(0,ho.h)("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),(0,ho.h)("path",{d:"M7.9 3H10v2H7.9z"}),(0,ho.h)("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),(0,ho.h)("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?(0,ho.h)(mo,e,(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage}),e.file.isPaused?(0,ho.h)("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):(0,ho.h)("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},(0,ho.h)("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),(0,ho.h)("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?(0,ho.h)("div",{className:"uppy-Dashboard-Item-progress"},(0,ho.h)("div",{className:"uppy-Dashboard-Item-progressIndicator"},(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage})))):(0,ho.h)(mo,e,(0,ho.h)(go,null,(0,ho.h)(vo,{progress:e.file.progress.percentage}),(0,ho.h)("polygon",{className:"cancel",transform:"translate(2, 2)",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"}))):null},Io=function(e){const{file:t}=e;return(0,yo.h)("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},(0,yo.h)("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:n}=e.file.meta;return(0,yo.h)("div",{className:"uppy-Dashboard-Item-name",title:n},wo(n,e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),(0,yo.h)(ko,{file:e.file,onClick:()=>alert(e.file.error)})),(0,yo.h)("div",{className:"uppy-Dashboard-Item-status"},(e=>{const{author:t}=e.file.meta,{providerName:n}=e.file.remote,i=`·`;return t?(0,yo.h)("div",{className:"uppy-Dashboard-Item-author"},(0,yo.h)("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},wo(t.name,13)),n?(0,yo.h)(yo.Fragment,null,` ${i} `,n,` ${i} `):null):null})(e),(e=>e.file.size&&(0,yo.h)("div",{className:"uppy-Dashboard-Item-statusSize"},xo(e.file.size)))(e),(e=>e.file.isGhost&&(0,yo.h)("span",null," • ",(0,yo.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),(0,yo.h)(_o,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))},zo=So;class Ro extends To.Component{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!No(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,n=e.progress.uploadComplete&&!t&&!e.error,i=e.progress.uploadStarted||t,r=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:s}=e;let a=(this.props.individualCancellation||!r)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(a=!0);const l=Ao({"uppy-Dashboard-Item":!0,"is-inprogress":r&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return(0,To.h)("div",{className:l,id:`uppy_${e.id}`,role:this.props.role},(0,To.h)("div",{className:"uppy-Dashboard-Item-preview"},(0,To.h)(jo,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,To.h)(Lo,{uppy:this.props.uppy,file:e,error:o,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),(0,To.h)("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},(0,To.h)(Io,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),(0,To.h)(zo,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:i,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}var Fo=Ro,Bo=rn;function Po(){return Po=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Po.apply(this,arguments)}const Uo={position:"relative",width:"100%",minHeight:"100%"},Ho={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class $o extends Bo.Component{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:n,renderRow:i,overscanCount:r=10,...o}=e;const{offset:s,height:a}=this.state;let l=Math.floor(s/n),c=Math.floor(a/n);r&&(l=Math.max(0,l-l%r),c+=r);const u=l+c+4,p=t.slice(l,u),d={...Uo,height:t.length*n},h={...Ho,top:l*n};return(0,Bo.h)("div",Po({onScroll:this.handleScroll},o),(0,Bo.h)("div",{role:"presentation",style:d},(0,Bo.h)("div",{role:"presentation",style:h},p.map(i))))}}var Wo=rn;function qo(){return qo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qo.apply(this,arguments)}const Vo=$.exports,Ko=Fo,Go=$o;var Yo=rn;let Qo;Qo=Symbol.for("uppy test: disable unused locale key warning");class Zo extends Yo.Component{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>(0,Yo.h)("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderMyDeviceAcquirer=()=>(0,Yo.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},(0,Yo.h)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},(0,Yo.h)("g",{fill:"none",fillRule:"evenodd"},(0,Yo.h)("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),(0,Yo.h)("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),(0,Yo.h)("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderBrowseButton=(e,t)=>{const n=this.props.acquirers.length;return(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===n},e)},this.renderDropPasteBrowseTagline=()=>{const e=this.props.acquirers.length,t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),i=this.props.fileManagerSelectionType,r=i.charAt(0).toUpperCase()+i.slice(1);return(0,Yo.h)("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${r}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${r}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>(0,Yo.h)("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},(0,Yo.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":this.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},e.icon(),(0,Yo.h)("div",{className:"uppy-DashboardTab-name"},e.name))),this.renderAcquirers=(e,t)=>{const n=[...e],i=n.splice(e.length-2,e.length);return(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!t&&this.renderMyDeviceAcquirer(),n.map((e=>this.renderAcquirer(e))),(0,Yo.h)("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map((e=>this.renderAcquirer(e)))))}}[Qo](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=e("poweredBy",{uppy:(0,Yo.h)("span",null,(0,Yo.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},(0,Yo.h)("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),(0,Yo.h)("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"))});return(0,Yo.h)("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)}render(){return(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),(0,Yo.h)("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&(0,Yo.h)("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}var Jo=Zo,Xo=rn;const es=$.exports,ts=Jo;var ns=e=>(0,Xo.h)("div",{className:es("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},(0,Xo.h)("div",{className:"uppy-DashboardContent-bar"},(0,Xo.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),(0,Xo.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),(0,Xo.h)(ts,e));var is=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},rs=rn;const ss=$.exports,as=is;var ls=function(e){let{activePickerPanel:t,className:n,hideAllPanels:i,i18n:r,state:o,uppy:s}=e;return(0,rs.h)("div",{className:ss("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:as,onDragLeave:as,onDrop:as,onPaste:as},(0,rs.h)("div",{className:"uppy-DashboardContent-bar"},(0,rs.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:t.name})),(0,rs.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i},r("cancel"))),(0,rs.h)("div",{className:"uppy-DashboardContent-panelBody"},s.getPlugin(t.id).render(o)))},cs=rn;const us=$.exports;var ps=function(e){const t=e.files[e.fileCardFor];return(0,cs.h)("div",{className:us("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},(0,cs.h)("div",{className:"uppy-DashboardContent-bar"},(0,cs.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:(0,cs.h)("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),(0,cs.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel")),(0,cs.h)("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),(0,cs.h)("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))},ds=rn;const hs="error",fs="waiting",ms="preprocessing",gs="uploading",vs="postprocessing",bs="complete",ys="paused";function xs(e){let{files:t,i18n:n,isAllComplete:i,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=e;const c=function(e,t,n,i){if(void 0===i&&(i={}),e)return hs;if(t)return bs;if(n)return ys;let r=fs;const o=Object.keys(i);for(let e=0;e<o.length;e++){const{progress:t}=i[o[e]];if(t.uploadStarted&&!t.uploadComplete)return gs;t.preprocess&&r!==gs&&(r=ms),t.postprocess&&r!==gs&&r!==ms&&(r=vs)}return r}(r,i,o,t);switch(c){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete")}}var ws=function(e){const{i18n:t,isAllComplete:n,hideCancelButton:i,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=e;let{allowNewUpload:a}=e;return a&&r&&(a=e.totalFileCount<e.maxNumberOfFiles),(0,ds.h)("div",{className:"uppy-DashboardContent-bar"},n||i?(0,ds.h)("div",null):(0,ds.h)("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},t("cancel")),(0,ds.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},(0,ds.h)(xs,e)),a?(0,ds.h)("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},(0,ds.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},(0,ds.h)("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),(0,ds.h)("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):(0,ds.h)("div",null))},_s=rn,ks=se;const Es=$.exports,Ms=no,Cs=is,Os=oo;class Ds extends _s.Component{constructor(e){super(e),this.form=document.createElement("form"),this.updateMeta=(e,t)=>{this.setState((n=>{let{formState:i}=n;return{formState:{...i,[t]:e}}}))},this.handleSave=e=>{e.preventDefault();const t=this.props.fileCardFor;this.props.saveFileCard(this.state.formState,t)},this.handleCancel=()=>{const e=this.props.files[this.props.fileCardFor];this.props.uppy.emit("file-editor:cancel",e),this.props.toggleFileCard(!1)},this.saveOnEnter=e=>{if(13===e.keyCode){e.stopPropagation(),e.preventDefault();const t=this.props.files[this.props.fileCardFor];this.props.saveFileCard(this.state.formState,t.id)}},this.renderMetaFields=()=>{const e=this.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((e=>{const n=`uppy-Dashboard-FileCard-input-${e.id}`,i=this.props.requiredMetaFields.includes(e.id);return(0,_s.h)("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},(0,_s.h)("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:n},e.name),void 0!==e.render?e.render({value:this.state.formState[e.id],onChange:t=>this.updateMeta(t,e.id),fieldCSSClasses:t,required:i,form:this.form.id},_s.h):(0,_s.h)("input",{className:t.text,id:n,form:this.form.id,type:e.type||"text",required:i,value:this.state.formState[e.id],placeholder:e.placeholder,onKeyUp:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyDown:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onKeyPress:"form"in HTMLInputElement.prototype?void 0:this.saveOnEnter,onInput:t=>this.updateMeta(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))};const t=this.props.files[this.props.fileCardFor],n=this.getMetaFields()||[],i={};n.forEach((e=>{i[e.id]=t.meta[e.id]||""})),this.state={formState:i},this.form.id=(0,ks.nanoid)()}componentWillMount(){this.form.addEventListener("submit",this.handleSave),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",this.handleSave),document.body.removeChild(this.form)}getMetaFields(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields}render(){const e=this.props.files[this.props.fileCardFor],t=this.props.canEditFile(e);return(0,_s.h)("div",{className:Es("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:Cs,onDragLeave:Cs,onDrop:Cs,onPaste:Cs},(0,_s.h)("div",{className:"uppy-DashboardContent-bar"},(0,_s.h)("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:(0,_s.h)("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),(0,_s.h)("button",{className:"uppy-DashboardContent-back",type:"button",form:this.form.id,title:this.props.i18n("finishEditingFile"),onClick:this.handleCancel},this.props.i18n("cancel"))),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-inner"},(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ms(e.type).color}},(0,_s.h)(Os,{file:e}),t&&(0,_s.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:t=>{this.handleSave(t),this.props.openFileEditor(e)},form:this.form.id},this.props.i18n("editFile"))),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),(0,_s.h)("div",{className:"uppy-Dashboard-FileCard-actions"},(0,_s.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"form"in HTMLButtonElement.prototype?"submit":"button",onClick:"form"in HTMLButtonElement.prototype?void 0:this.handleSave,form:this.form.id},this.props.i18n("saveChanges")),(0,_s.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel,form:this.form.id},this.props.i18n("cancel")))))}}var Ss=Ds,Ts=rn;const As=$.exports,Ns="uppy-transition-slideDownUp",js=250;class Ls extends Ts.Component{constructor(e){super(e),this.state={cachedChildren:null,className:""}}componentWillUpdate(e){const{cachedChildren:t}=this.state,n=(0,Ts.toChildArray)(e.children)[0];if(t===n)return null;const i={cachedChildren:n};n&&!t&&(i.className=`${Ns}-enter`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ns}-enter ${Ns}-enter-active`}),this.enterTimeout=setTimeout((()=>{this.setState({className:""})}),js)}))),t&&!n&&void 0===this.leaveTimeout&&(i.cachedChildren=t,i.className=`${Ns}-leave`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ns}-leave ${Ns}-leave-active`}),this.leaveTimeout=setTimeout((()=>{this.setState({cachedChildren:null,className:""})}),js)}))),this.setState(i)}render(){const{cachedChildren:e,className:t}=this.state;return e?(0,Ts.cloneElement)(e,{className:As(t,e.props.className)}):null}}var Is=rn;function zs(){return zs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zs.apply(this,arguments)}const Rs=$.exports,Fs=eo,Bs=e=>{const t=0===e.totalFileCount,n=Vo("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),i=1===e.itemsPerRow?71:200,r={id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},o=Object.keys(e.files);e.recoveredState&&o.sort(((t,n)=>e.files[n].isGhost-e.files[t].isGhost));const s=function(e,t){const n=[];let i=[];return e.forEach((e=>{i.length<t?i.push(e):(n.push(i),i=[e])})),i.length&&n.push(i),n}(o,e.itemsPerRow);return(0,Wo.h)(Go,{class:n,role:"list",data:s,renderRow:t=>(0,Wo.h)("div",{role:"presentation",key:t[0]},t.map((t=>(0,Wo.h)(Ko,qo({key:t,uppy:e.uppy},r,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))))),rowHeight:i})},Ps=Jo,Us=ns,Hs=ls,$s=ps,Ws=ws,qs=Ss,Vs=Ls,Ks=900,Gs=700,Ys=576,Qs=400;var Zs=rn,Js=J.exports,Xs=se,ea=Yn;function ta(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var na=0;function ia(e){return"__private_"+na+++"_"+e}const ra=ri.exports,oa=qi.exports,sa=gr,aa=br,la=Qn,ca=Cr,ua=Ar,pa=Zn,da=Xr,ha=function(e){const t=0===e.totalFileCount,n=e.containerWidth>Ys,i=Rs({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>Ys,"uppy-size--lg":e.containerWidth>Gs,"uppy-size--xl":e.containerWidth>Ks,"uppy-size--height-md":e.containerHeight>Qs,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible});let r=1;e.containerWidth>Ks?r=5:e.containerWidth>Gs?r=4:e.containerWidth>Ys&&(r=3);const o=e.showSelectedFiles&&!t,s=e.recoveredState?Object.keys(e.recoveredState.files).length:null,a=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return(0,Is.h)("div",{className:i,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&Fs(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},(0,Is.h)("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),(0,Is.h)("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:(0,Is.h)("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},(0,Is.h)("span",{"aria-hidden":"true"},"×")),(0,Is.h)("div",{className:"uppy-Dashboard-innerWrap"},(0,Is.h)("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&(0,Is.h)(Ws,e),s&&(0,Is.h)("div",{className:"uppy-Dashboard-serviceMsg"},(0,Is.h)("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},(0,Is.h)("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},(0,Is.h)("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),(0,Is.h)("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),(0,Is.h)("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),(0,Is.h)("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),(0,Is.h)("div",{className:"uppy-Dashboard-serviceMsg-text"},a>0?e.i18n("recoveredXFiles",{smart_count:a}):e.i18n("recoveredAllFiles"))),o?(0,Is.h)(Bs,zs({},e,{itemsPerRow:r})):(0,Is.h)(Ps,zs({},e,{isSizeMD:n})),(0,Is.h)(Vs,null,e.showAddFilesPanel?(0,Is.h)(Us,zs({key:"AddFiles"},e,{isSizeMD:n})):null),(0,Is.h)(Vs,null,e.fileCardFor?(0,Is.h)(qs,zs({key:"FileCard"},e)):null),(0,Is.h)(Vs,null,e.activePickerPanel?(0,Is.h)(Hs,zs({key:"Picker"},e)):null),(0,Is.h)(Vs,null,e.showFileEditor?(0,Is.h)($s,zs({key:"Editor"},e)):null),(0,Is.h)("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))},fa={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."}}},ma=ua.default||ua,ga=9,va=27;function ba(){const e={};return e.promise=new Promise(((t,n)=>{e.resolve=t,e.reject=n})),e}function ya(){return(0,Zs.h)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},(0,Zs.h)("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var xa=ia("openFileEditorWhenFilesAdded"),wa=ia("attachRenderFunctionToTarget"),_a=ia("isTargetSupported"),ka=ia("getAcquirers"),Ea=ia("getProgressIndicators"),Ma=ia("getEditors");class Ca extends Js.UIPlugin{constructor(e,t){var n;super(e,t),n=this,this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,n=e.title||t,i=e.type;if("acquirer"!==i&&"progressindicator"!==i&&"editor"!==i){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return void this.uppy.log(e,"error")}const r={id:t,name:n,type:i},o=this.getPluginState().targets.slice();return o.push(r),this.setPluginState({targets:o}),this.el},this.hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||this.setPluginState(t)},this.showPanel=e=>{const{targets:t}=this.getPluginState(),n=t.filter((t=>"acquirer"===t.type&&t.id===e))[0];this.setPluginState({activePickerPanel:n,activeOverlayType:"PickerPanel"})},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return ta(this,Ma)[Ma](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),n=ta(this,Ma)[Ma](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),n.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();ta(this,Ma)[Ma](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.hideAllPanels()},this.openModal=()=>{const{promise:e,resolve:t}=ba();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=function(e){void 0===e&&(e={});const{manualClose:t=!0}=e,{isHidden:i,isClosing:r}=n.getPluginState();if(i||r)return;const{promise:o,resolve:s}=ba();if(n.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),n.opts.animateOpenClose){n.setPluginState({isClosing:!0});const e=()=>{n.setPluginState({isHidden:!0,isClosing:!1}),n.superFocus.cancel(),n.savedActiveElement.focus(),n.el.removeEventListener("animationend",e,!1),s()};n.el.addEventListener("animationend",e,!1)}else n.setPluginState({isHidden:!0}),n.superFocus.cancel(),n.savedActiveElement.focus(),s();var a;(document.removeEventListener("keydown",n.handleKeyDownInModal),t)&&(n.opts.browserBackButtonClose&&null!=(a=history.state)&&a[n.modalName]&&history.back());return n.uppy.emit("dashboard:modal-closed"),o},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const n=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",n):this.uppy.emit("dashboard:file-edit-complete",n),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:n,height:i}=t.contentRect;this.uppy.log(`[Dashboard] resized: ${n} / ${i}`,"debug"),this.setPluginState({containerWidth:n,containerHeight:i,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableAllFocusableElements=e=>{const t=la(this.el.querySelectorAll(pa));e?t.forEach((e=>{const t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((e=>{"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{e.keyCode===va&&this.requestCloseModal(e),e.keyCode===ga&&ea.forModal(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=la(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=la(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,n;e.preventDefault(),e.stopPropagation();const i=(()=>{let t=!0;return this.uppy.iteratePlugins((n=>{null!=n.canHandleRootDrop&&n.canHandleRootDrop(e)&&(t=!0)})),t})(),r=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!i&&!r||this.opts.disabled||this.opts.disableLocalFiles&&(r||!i)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)},this.handleDragLeave=e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)},this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let i=!1;const r=await ca(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),i||(this.uppy.info(e.message,"error"),i=!0)}});r.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(r)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{e.keyCode===ga&&ea.forInline(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,xa,{writable:!0,value:e=>{const t=e[0];this.canEditFile(t)&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=aa(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("file-editor:complete",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.on("files-added",ta(this,xa)[xa])},this.removeEvents=()=>{const e=aa(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("file-editor:complete",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.off("files-added",ta(this,xa)[xa])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,n=0===this.uppy.getState().info.length,i=!this.opts.inline;n&&(i||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableAllFocusableElements(!1),this.superFocusOnEachUpdate()):this.disableAllFocusableElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,wa,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,_a,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,ka,{writable:!0,value:ma((e=>e.filter((e=>"acquirer"===e.type&&ta(this,_a)[_a](e))).map(ta(this,wa)[wa])))}),Object.defineProperty(this,Ea,{writable:!0,value:ma((e=>e.filter((e=>"progressindicator"===e.type)).map(ta(this,wa)[wa])))}),Object.defineProperty(this,Ma,{writable:!0,value:ma((e=>e.filter((e=>"editor"===e.type)).map(ta(this,wa)[wa])))}),this.render=e=>{const t=this.getPluginState(),{files:n,capabilities:i,allowNewUpload:r}=e,{newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:c,inProgressNotPausedFiles:u,processingFiles:p,isUploadStarted:d,isAllComplete:h,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=ta(this,ka)[ka](t.targets),v=ta(this,Ea)[Ea](t.targets),b=ta(this,Ma)[Ma](t.targets);let y;return y="auto"===this.opts.theme?i.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ha({state:e,isHidden:t.isHidden,files:n,newFiles:o,uploadStartedFiles:s,completeFiles:a,erroredFiles:l,inProgressFiles:c,inProgressNotPausedFiles:u,processingFiles:p,isUploadStarted:d,isAllComplete:h,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(n).length,totalProgress:e.totalProgress,allowNewUpload:r,acquirers:g,theme:y,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,disableAllFocusableElements:this.disableAllFocusableElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:v,editors:b,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:i.resumableUploads||!1,individualCancellation:i.individualCancellation,isMobileDevice:i.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},this.discoverProviderPlugins=()=>{this.uppy.iteratePlugins((e=>{e&&!e.target&&e.opts&&e.opts.target===this.constructor&&this.addTarget(e)}))},this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:n,allowMultipleUploadBatches:i}=this.uppy.opts;(n||i)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:r}=this.opts;r&&this.mount(r,this);(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.mount(this,t)})),this.opts.disableStatusBar||this.uppy.use(ra,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(oa,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(sa,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),"auto"===this.opts.theme&&this.darkModeMediaQuery.addListener(this.handleSystemDarkModeChange),this.discoverProviderPlugins(),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery.removeListener(this.handleSystemDarkModeChange),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.modalName=`uppy-Dashboard-${(0,Xs.nanoid)()}`,this.defaultLocale=fa;const i={target:"body",metaFields:[],trigger:null,inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:ya,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:()=>{this.uppy.reset(),this.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:()=>this.closeModal(),showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};this.opts={...i,...t},this.i18nInit(),this.superFocus=da(),this.ifFocusedOnUppyRecently=!1,this.makeDashboardInsidesVisibleAnywayTimeout=null,this.removeDragOverClassTimeout=null}}Ca.VERSION="2.4.3",Gn.exports=Ca;var Oa={exports:{}},Da="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";function Sa(){}function Ta(){}Ta.resetWarningCache=Sa;Oa.exports=function(){function e(e,t,n,i,r,o){if(o!==Da){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. "+"Use PropTypes.checkPropTypes() to call them. "+"Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ta,resetWarningCache:Sa};return n.PropTypes=n,n}();const Aa=Oa.exports,Na=J.exports.Uppy,ja=Aa.instanceOf(Na).isRequired,La=Aa.arrayOf(Aa.string),Ia=Aa.shape({strings:Aa.object,pluralize:Aa.func}),za=Aa.shape({id:Aa.string.isRequired,name:Aa.string.isRequired,placeholder:Aa.string}),Ra=Aa.oneOfType([Aa.arrayOf(za),Aa.func]),Fa=Aa.oneOfType([Aa.string,Aa.number]);var Ba={uppy:ja,locale:Ia,dashboard:{uppy:ja,inline:Aa.bool,plugins:La,width:Fa,height:Fa,showProgressDetails:Aa.bool,hideUploadButton:Aa.bool,hideProgressAfterFinish:Aa.bool,note:Aa.string,metaFields:Ra,proudlyDisplayPoweredByUppy:Aa.bool,disableStatusBar:Aa.bool,disableInformer:Aa.bool,disableThumbnailGenerator:Aa.bool,thumbnailWidth:Aa.number,locale:Ia}};const Pa=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Ua=/^(aria-|data-)/;var Ha=e=>Object.fromEntries(Object.entries(e).filter((e=>{let[t]=e;return Ua.test(t)||Pa.includes(t)})));var $a=function(e,t){return Object.keys(e.props).some((n=>!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e.validProps,n)&&e.props[n]!==t[n]))};const Wa=t,qa=Gn.exports,Va=Ba.dashboard,Ka=Ha,Ga=$a,Ya=Wa.createElement;class Qa extends Wa.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Ga(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:Dashboard",...this.props,target:this.container};delete t.uppy,e.use(qa,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Ka(this.props),Ya("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Qa.propTypes=Va,Qa.defaultProps={inline:!0};const Za=t,Ja=Oa.exports,Xa=Gn.exports,el=Ba.dashboard,tl=Ha,nl=$a,il=Za.createElement;class rl extends Za.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(nl(this,e)){const e={...this.props,onRequestCloseModal:this.props.onRequestClose};delete e.uppy,this.plugin.setOptions(e)}e.open&&!this.props.open?this.plugin.closeModal():!e.open&&this.props.open&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DashboardModal",...this.props,onRequestCloseModal:this.props.onRequestClose};t.target||(t.target=this.container),delete t.uppy,e.use(Xa,t),this.plugin=e.getPlugin(t.id),this.props.open&&this.plugin.openModal()}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=tl(this.props),il("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}rl.propTypes={target:"undefined"!=typeof window?Ja.instanceOf(window.HTMLElement):Ja.any,open:Ja.bool,onRequestClose:Ja.func,closeModalOnClickOutside:Ja.bool,disablePageScrollWhenModalOpen:Ja.bool,...el};var ol={exports:{}},sl=J.exports,al=rn;const ll=Qn,cl=eo,ul=Cr,pl={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};class dl extends sl.UIPlugin{constructor(e,t){super(e,t),this.handleDrop=async e=>{var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const i=await ul(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});i.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(i)),null==(t=(n=this.opts).onDrop)||t.call(n,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=pl;this.opts={target:null,inputName:"files[]",width:"100%",height:"100%",note:null,...t},this.i18nInit(),this.isDragDropSupported=cl(),this.removeDragOverClassTimeout=null,this.onInputChange=this.onInputChange.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this),this.addFiles=this.addFiles.bind(this),this.render=this.render.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}onInputChange(e){const t=ll(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null}handleDragOver(e){var t,n;e.preventDefault(),e.stopPropagation();const{types:i}=e.dataTransfer,r=i.some((e=>"Files"===e)),{allowNewUpload:o}=this.uppy.getState();if(!r||!o)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(n=this.opts).onDragOver)||t.call(n,e)}handleDragLeave(e){var t,n;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(n=this.opts).onDragLeave)||t.call(n,e)}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return(0,al.h)("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return(0,al.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},(0,al.h)("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return(0,al.h)("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:(0,al.h)("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return(0,al.h)("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset\n uppy-DragDrop-container\n ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n `,t={width:this.opts.width,height:this.opts.height};return(0,al.h)("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),(0,al.h)("div",{className:"uppy-DragDrop-inner"},dl.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}dl.VERSION="2.1.2";const hl=t,fl=ol.exports=dl,ml=Ba,gl=Ha,vl=$a,bl=hl.createElement;class yl extends hl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(vl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DragDrop",...this.props,target:this.container};delete t.uppy,e.use(fl,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=gl(this.props),bl("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}yl.propTypes={uppy:ml.uppy,locale:ml.locale},yl.defaultProps={};var xl=yl,wl={exports:{}},_l=rn,kl=J.exports;class El extends kl.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator";this.opts={target:"body",fixed:!1,hideAfterFinish:!0,...t},this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,n=(0===t||100===t)&&this.opts.hideAfterFinish;return(0,_l.h)("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},(0,_l.h)("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),(0,_l.h)("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}El.VERSION="2.1.2",wl.exports=El;const Ml=t,Cl=Oa.exports,Ol=wl.exports,Dl=Ba.uppy,Sl=Ha,Tl=$a,Al=Ml.createElement;class Nl extends Ml.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Tl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:ProgressBar",...this.props,target:this.container};delete t.uppy,e.use(Ol,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Sl(this.props),Al("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Nl.propTypes={uppy:Dl,fixed:Cl.bool,hideAfterFinish:Cl.bool},Nl.defaultProps={};const jl=t,Ll=Oa.exports,Il=ri.exports,zl=Ba.uppy,Rl=Ha,Fl=$a,Bl=jl.createElement;class Pl extends jl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(Fl(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:StatusBar",...this.props,target:this.container};delete t.uppy,e.use(Il,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=Rl(this.props),Bl("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}Pl.propTypes={uppy:zl,hideAfterFinish:Ll.bool,showProgressDetails:Ll.bool},Pl.defaultProps={};var Ul={exports:{}},Hl=J.exports,$l=rn;const Wl=Qn,ql={strings:{chooseFiles:"Choose files"}};class Vl extends Hl.UIPlugin{constructor(e,t){super(e,t),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=ql;this.opts={target:null,pretty:!0,inputName:"files[]",...t},this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=Wl(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):null;return(0,$l.h)("div",{className:"uppy-FileInput-container"},(0,$l.h)("input",{className:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&(0,$l.h)("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}Vl.VERSION="2.1.2",Ul.exports=Vl;const Kl=Oa.exports,Gl=t,Yl=Ul.exports,Ql=Ba,Zl=Gl.createElement;class Jl extends Gl.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:FileInput",...this.props,target:this.container};delete t.uppy,e.use(Yl,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return Zl("div",{className:"uppy-Container",ref:e=>{this.container=e}})}}Jl.propTypes={uppy:Ql.uppy,locale:Ql.locale,pretty:Kl.bool,inputName:Kl.string},Jl.defaultProps={};const{useEffect:Xl,useRef:ec}=t,tc=J.exports.Uppy;const nc=5*1024*1024,ic={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxNumberOfFiles:1,maxFileSize:nc,allowedFileTypes:[".jpg",".jpeg",".png",".gif"]}},rc={autoProceed:!0,allowMultipleUploads:!1,restrictions:{maxNumberOfFiles:1,maxFileSize:100*1024*1024,allowedFileTypes:[".mp4",".mov",".avi",".mkv"]}},oc={formData:!0,fieldName:"blob"},sc=[{title:"Upload",key:"local"},{title:"Link",key:"link"},{title:"Unsplash",key:"unsplash"}];function ac(){return ac=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ac.apply(this,arguments)}function lc(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cc={exports:{}},uc={},pc=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,hc=Object.prototype.propertyIsEnumerable;function fc(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var mc=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var i=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==i.join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,r=fc(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))dc.call(n,s)&&(r[s]=n[s]);if(pc){i=pc(n);for(var a=0;a<i.length;a++)hc.call(n,i[a])&&(r[i[a]]=n[i[a]])}}return r},gc=mc,vc=60103,bc=60106;
|
|
18
18
|
/** @license React v17.0.2
|
|
19
19
|
* react.production.min.js
|
|
20
20
|
*
|