1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="918e5bde-40a8-49a9-9d4c-8367a88ff064",e._sentryDebugIdIdentifier="sentry-dbid-918e5bde-40a8-49a9-9d4c-8367a88ff064")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4632],{18821:e=>{e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,s,r,l,o,a){var n=function(e){for(var i=t[e]?t[e]:[],s=e.indexOf(":"),r=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],l=Object.keys(t),o=0,a=l.length;o<a;o++){var n=l[o];if("*"===n&&(i=i.concat(t[n])),2===r.length&&r[0]===n){i=i.concat(t[n]);break}}return i}(e);n.length&&function(e,t,i){for(var s=0,r=t.length;s<r&&t[s];s++)t[s].event=e,t[s].apply(t[s],i)}(e,n,[i,s,r,l,o,a])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,function s(){i.apply(this,arguments),e.off(t,s)})},e.off=function(e,t){var i=[];if(e&&t)for(var s=this._fns[e],r=0,l=s?s.length:0;r<l;r++)s[r]!==t&&i.push(s[r]);i.length?this._fns[e]=i:delete this._fns[e]},e}},24022:(e,t,i)=>{var s=i(99674),r=i(56863),l=i(96961),o=Math.max,a=Math.min;e.exports=function(e,t,i){var n,d,u,h,p,c,g=0,f=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var i=n,s=d;return n=d=void 0,g=t,h=e.apply(s,i)}function w(e){var i=e-c,s=e-g;return void 0===c||i>=t||i<0||m&&s>=u}function b(){var e,i,s,l=r();if(w(l))return S(l);p=setTimeout(b,(e=l-c,i=l-g,s=t-e,m?a(s,u-i):s))}function S(e){return(p=void 0,y&&n)?v(e):(n=d=void 0,h)}function F(){var e,i=r(),s=w(i);if(n=arguments,d=this,c=i,s){if(void 0===p)return g=e=c,p=setTimeout(b,t),f?v(e):h;if(m)return clearTimeout(p),p=setTimeout(b,t),v(c)}return void 0===p&&(p=setTimeout(b,t)),h}return t=l(t)||0,s(i)&&(f=!!i.leading,u=(m="maxWait"in i)?o(l(i.maxWait)||0,t):u,y="trailing"in i?!!i.trailing:y),F.cancel=function(){void 0!==p&&clearTimeout(p),g=0,n=c=d=p=void 0},F.flush=function(){return void 0===p?h:S(r())},F}},29452:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var s=i(89853);let r={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",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",msg:"application/vnd.ms-outlook",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 l(e){if(e.type)return e.type;let t=e.name?(0,s.A)(e.name).extension?.toLowerCase():null;return t&&t in r?r[t]:"application/octet-stream"}},29901:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});let s=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}},29949:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});class s{#e;#t=[];constructor(e){this.#e=e}on(e,t){return this.#t.push([e,t]),this.#e.on(e,t)}remove(){for(let[e,t]of this.#t.splice(0))this.#e.off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,s)=>{e===i?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,s)=>{e===i?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#e.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#e.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{this.#e.getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#e.getFile(e)&&t()})}}},30532:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var s=i(56044);class r{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;
1constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{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(void 0),this.i18nInit()}i18nInit(){let e=new s.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}},54579:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},56044:(e,t,i)=>{"use strict";function s(e,t){let i=/\$/g,s=[e];if(null==t)return s;for(let e of Object.keys(t))if("_"!==e){let r=t[e];"string"==typeof r&&(r=i[Symbol.replace](r,"$$$$")),s=function(e,t,i){let s=[];return e.forEach(e=>"string"!=typeof e?s.push(e):t[Symbol.split](e).forEach((e,t,r)=>{""!==e&&s.push(e),t<r.length-1&&s.push(i)})),s}(s,RegExp(`%\\{${e}\\}`,"g"),r)}return s}i.d(t,{A:()=>l});let r=e=>{throw Error(`missing string: ${e}`)};class l{locale;constructor(e,{onMissingKey:t=r}={}){this.locale={strings:{},pluralize:e=>+(1!==e)},Array.isArray(e)?e.forEach(this.#i,this):this.#i(e),this.#s=t}#s;#i(e){if(!e?.strings)return;let t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&(this.#s(e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return s(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw Error("string was not a string");return s(i,t)}}},56863:(e,t,i)=>{var s=i(49258);e.exports=function(){return s.Date.now()}},59936:e=>{"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=e<0,i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;let s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1);e=Number(e/1024**s);let r=i[s];return e>=10||e%1==0?`${(t?"-":"")+e.toFixed(0)} ${r}`:`${(t?"-":"")+e.toFixed(1)} ${r}`}},63681:(e,t,i)=>{var s=i(24022),r=i(99674);e.exports=function(e,t,i){var l=!0,o=!0;if("function"!=typeof e)throw TypeError("Expected a function");return r(i)&&(l="leading"in i?!!i.leading:l,o="trailing"in i?!!i.trailing:o),s(e,t,{leading:l,maxWait:t,trailing:o})}},69366:(e,t,i)=>{"use strict";i.d(t,{N:()=>l});var s=i(29452);function r(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${e.charCodeAt(0).toString(32)}`,"/"))+t}function l(e,t){var i;let l;if(e.isRemote&&e.remote&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider))return e.id;let o=(0,s.A)(e);return i={...e,type:o},l=t||"uppy","string"==typeof i.name&&(l+=`-${r(i.name.toLowerCase())}`),void 0!==i.type&&(l+=`-${i.type}`),i.meta&&"string"==typeof i.meta.relativePath&&(l+=`-${r(i.meta.relativePath.toLowerCase())}`),void 0!==i.data.size&&(l+=`-${i.data.size}`),void 0!==i.data.lastModified&&(l+=`-${i.data.lastModified}`),l}},70228:(e,t,i)=>{"use strict";i.d(t,{A:()=>E});let s={rE:"4.3.2"};class r{static VERSION=s.rE;state={};#r=new Set;getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,this.#l(t,i,e)}subscribe(e){return this.#r.add(e),()=>{this.#r.delete(e)}}#l(...e){this.#r.forEach(t=>{t(...e)})}}var l=i(69366),o=i(89853),a=i(29452),n=i(56044),d=i(63681),u=i(18821),h=i(29901);let p={rE:"4.5.3"},c={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"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",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",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",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",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function g(e){return e<10?`0${e}`:e.toString()}function f(){let e=new Date,t=g(e.getHours()),i=g(e.getMinutes()),s=g(e.getSeconds());return`${t}:${i}:${s}`}let m={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${f()}]`,...e)},y={debug:(...e)=>console.debug(`[Uppy] [${f()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${f()}]`,...e),error:(...e)=>console.error(`[Uppy] [${f()}]`,...e)};var v=i(59936),w=i(85683);let b={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};
1class S extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class F{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{let t=e();if(t.restrictions?.allowedFileTypes!=null&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(e=>!e.isGhost).length+t.length>s)throw new S(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(i){let s=[...e,...t].reduce((e,t)=>e+(t.size??0),0);if(s>i)throw new S(this.getI18n()("aggregateExceedsSize",{sizeAllowed:v(i),size:v(s)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(t=>t.includes("/")?!!e.type&&w(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let t=s.join(", ");throw new S(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new S(this.getI18n()("exceedsSize",{size:v(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&null!=e.size&&e.size<i)throw new S(this.getI18n()("inferiorSize",{size:v(i)}),{file:e})}validate(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new S(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new S(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,s=[];for(let t of i)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||s.push(t);return{missingFields:s,error:t}}}let x={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class A{static VERSION=p.rE;#o=Object.create(null);#a;#n;#d=u();#u=new Set;#h=new Set;#p=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=c;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:b,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new r,logger:m,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...e?.restrictions}},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?.debug&&(this.opts.logger=y),this.log(`Using Core v${A.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...x,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let i=t[1].split(".",2),s=parseInt(i[0],10),r=parseInt(i[1],10);return!!(s<15)||15===s&&!!(r<15063)||!!(s>18)||18===s&&!!(r>=18218)}(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#a=new F(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.#c()}emit(e,...t){this.#d.emit(e,...t)}on(e,t){return this.#d.on(e,t),this}once(e,t){return this.#d.once(e,t),this}off(e,t){return this.#d.off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{...t[e],...i}]))}})}setFileState(e,t){if(!this.getState().files[e])throw Error(`Canât set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=e=>this.log(`Missing i18n string: ${e}`,"error"),t=new n.A([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null}
1,t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(s=>{i[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...x})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...x,files:{}})}addPreProcessor(e){this.#u.add(e)}removePreProcessor(e){return this.#u.delete(e)}addPostProcessor(e){this.#p.add(e)}removePostProcessor(e){return this.#p.delete(e)}addUploader(e){this.#h.add(e)}removeUploader(e){return this.#h.delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i={...this.getState().files};if(!i[e])return void this.log(`Was trying to set metadata for a file that has been removed: ${e}`);let s={...i[e].meta,...t};i[e]={...i[e],meta:s},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),s=Object.values(e),r=[],l=[],o=[],a=[],n=[],d=[],u=[],h=[],p=[];for(let e of s){let{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(r.push(e),e.isPaused||h.push(e)),t.uploadStarted||l.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&o.push(e),t.uploadStarted&&a.push(e),e.isPaused&&n.push(e),t.uploadComplete&&d.push(e),e.error&&u.push(e),(t.preprocess||t.postprocess)&&p.push(e)}return{newFiles:l,startedFiles:o,uploadStartedFiles:a,pausedFiles:n,completeFiles:d,erroredFiles:u,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:p,isUploadStarted:a.length>0,isAllComplete:100===t&&d.length===s.length&&0===p.length,isAllErrored:!!i&&u.length===s.length,isAllPaused:0!==r.length&&n.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:s.some(e=>e.isGhost)}}#g(e){for(let t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");let t=e.filter(e=>e.isUserFacing),i=t.slice(0,4),s=t.slice(4);i.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#a.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#a.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{this.#a.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#f(e){let{missingFields:t,error:i}=this.#a.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#m(e){let t=!0;for(let i of Object.values(e))this.#f(i)||(t=!1);return t}#y(e){let{allowNewUpload:t}=this.getState();if(!1===t){let t=new S(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#g([t]),t}}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!t[e]&&!t[e].isGhost}#v(e){let t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=(0,a.A)(t),s=t.name?t.name:"image"===i.split("/")[0]?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname",r=(0,o.A)(s).extension,n=(0,l.N)(t,this.getID()),d=t.meta||{};d.name=s,d.type=i;let u=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:n,name:s,extension:r||"",meta:{...this.getState().meta,...d},type:i,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:u,uploadComplete:!1,uploadStarted:null},size:u,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}#w(){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))}#b(e){let{files:t}=this.getState(),i={...t},s=[],r=[];for(let l of e)try{let e=this.#v(l),r=t[e.id]?.isGhost;r&&(e={...t[e.id],isGhost:!1,data:l.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`));let o=this.opts.onBeforeFileAdded(e,i);if(i={...t=this.getState().files,...i},!o&&this.checkIfFileAlreadyExists(e.id))throw new S(this.i18n("noDuplicates",{fileName:e.name??this.i18n("unnamed")}),{file:l});if(!1!==o||r)"object"==typeof o&&null!==o&&(e=o);else throw new S("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:l});this.#a.validateSingleFile(e),i[e.id]=e,s.push(e)}catch(e){r.push(e)}try{this.#a.validateAggregateRestrictions(Object.values(t),s)}catch(e){return r.push(e),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:s,errors:r}}addFile(e){this.#y(e);let{nextFilesState:t,validFilesToAdd:i,errors:s}=this.#b([e]),r=s.filter(e=>e.isRestriction);if(this.#g(r),s.length>0)throw s[0];this.setState({files:t});let[l]=i;
1return this.emit("file-added",l),this.emit("files-added",i),this.log(`Added file: ${l.name}, ${l.id}, mime type: ${l.type}`),this.#w(),l.id}addFiles(e){this.#y();let{nextFilesState:t,validFilesToAdd:i,errors:s}=this.#b(e),r=s.filter(e=>e.isRestriction);this.#g(r);let l=s.filter(e=>!e.isRestriction);if(l.length>0){let e="Multiple errors occurred while adding files:\n";if(l.forEach(t=>{e+=` 2 * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:l.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw AggregateError(l,e);{let t=Error(e);throw t.errors=l,t}}this.setState({files:t}),i.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(e=>{this.log(`Added file: ${e.name} 3 id: ${e.id} 4 type: ${e.type}`)}),i.length>0&&this.#w()}removeFiles(e){let{files:t,currentUploads:i}=this.getState(),s={...t},r={...i},l=Object.create(null);function o(e){return void 0===l[e]}e.forEach(e=>{t[e]&&(l[e]=t[e],delete s[e])}),Object.keys(r).forEach(e=>{let t=i[e].fileIDs.filter(o);if(0===t.length)return void delete r[e];let{capabilities:s}=this.getState();if(t.length!==i[e].fileIDs.length&&!s.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");r[e]={...i[e],fileIDs:t}});let a={currentUploads:r,files:s};0===Object.keys(s).length&&(a.allowNewUpload=!0,a.error=null,a.recoveredState=null),this.setState(a),this.#S();let n=Object.keys(l);n.forEach(e=>{this.emit("file-removed",l[e])}),n.length>5?this.log(`Removed ${n.length} files`):this.log(`Removed files: ${n.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),i=!t.isPaused;return this.setFileState(e,{isPaused:i}),this.emit("upload-pause",t,i),i}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!0};e[t]=i}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e}),this.emit("resume-all")}#F(){let{files:e}=this.getState();return Object.keys(e).filter(t=>{let i=e[t];return i.error&&(!i.missingRequiredMetaFields||0===i.missingRequiredMetaFields.length)})}async #x(){let e=this.#F(),t={...this.getState().files};if(e.forEach(e=>{t[e]={...t[e],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};let i=this.#A(e,{forceAllowNewUpload:!0});return this.#E(i)}async retryAll(){let e=await this.#x();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(x)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=this.#A([e],{forceAllowNewUpload:!0});return this.#E(t)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#U=(e,t)=>{let i=e?this.getFile(e.id):void 0;if(null==e||!i)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);if(100===i.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);let s={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};null!=i.progress.uploadStarted?this.setFileState(e.id,{progress:{...i.progress,...s,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...s}}),this.#S()};#O(){let e=this.#P(),t=null;null!=e&&((t=Math.round(100*e))>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}#S=d(()=>this.#O(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#O()}#P(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return 0;if(e.every(e=>e.progress.uploadComplete))return 1;let t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,i=e.filter(t),s=e.filter(e=>!t(e));if(i.every(e=>e.progress.uploadComplete)&&s.length>0&&!s.every(e=>e.progress.uploadComplete))return null;let r=i.reduce((e,t)=>
4e+(t.progress.bytesTotal??0),0),l=i.reduce((e,t)=>e+(t.progress.bytesUploaded||0),0);return 0===r?0:l/r}#c(){let e=(e,t,i)=>{let s=e.message||"Unknown error";e.details&&(s+=` ${e.details}`),this.setState({error:s}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:s,response:i})};this.on("error",e),this.on("upload-error",(t,i,s)=>{if(e(i,t,s),"object"==typeof i&&i.message){this.log(i.message,"error");let e=Error(this.i18n("failedToUpload",{file:t?.name??""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),this.#g([e])}else this.#g([i])});let t=null;this.on("upload-stalled",(e,i)=>{let{message:s}=e,r=i.map(e=>e.meta.name).join(", ");t||(this.info({message:s,details:r},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${s} ${r}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let i=e=>{let t=Object.fromEntries(e.filter(e=>{let t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${e?.id}`),t}).map(e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}]));this.patchFilesState(t)};this.on("upload-start",i),this.on("upload-progress",this.#U),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: ${e?.id}`);let i=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...i,postprocess:this.#p.size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.#S()}),this.on("preprocess-progress",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}})}),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: ${e?.id}`);let 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)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}})}),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: ${e?.id}`);let 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.#S()}),this.on("dashboard:file-edit-complete",e=>{e&&this.#f(e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",this.#T),window.addEventListener("offline",this.#T),setTimeout(this.#T,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit
4("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)}#T=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if("function"!=typeof e)throw TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);let i=new e(this,...t),s=i.id;if(!s)throw Error("Your plugin must have an id");if(!i.type)throw Error("Your plugin must have a type");let r=this.getPlugin(s);if(r)throw Error(`Already found a plugin named '${r.id}'. Tried to use: '${s}'. 5Uppy plugins must have unique \`id\` options.`);return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),i.type in this.#o?this.#o[i.type].push(i):this.#o[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(let t of Object.values(this.#o)){let i=t.find(t=>t.id===e);if(null!=i)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#o[e]}iteratePlugins(e){Object.values(this.#o).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=this.#o[e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);let s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",this.#T),window.removeEventListener("offline",this.#T))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){let s="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,t){let{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}}#$=new Map;registerRequestClient(e,t){this.#$.set(e,t)}
5getRequestClientForFile(e){if(!e.remote)throw Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=this.#$.get(e.remote.requestClientId);if(null==t)throw Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return(this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e])?this.#E(e):(this.#I(e),Promise.reject(Error("Nonexistent upload")))}#A(e,t={}){let{forceAllowNewUpload:i=!1}=t,{allowNewUpload:s,currentUploads:r}=this.getState();if(!s&&!i)throw Error("Cannot create a new upload: already uploading.");let l=(0,h.A)();return this.emit("upload",l,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[l]:{fileIDs:e,step:0,result:{}}}}),l}[Symbol.for("uppy test: createUpload")](...e){return this.#A(...e)}#R(e){let{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#R(e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);let{currentUploads:i}=this.getState(),s={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:s}})}#I(e){let t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async #E(e){let t,i=()=>{let{currentUploads:t}=this.getState();return t[e]},s=i(),r=[...this.#u,...this.#h,...this.#p];try{for(let t=s.step||0;t<r.length&&s;t++){let l=r[t];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...s,step:t}}});let{fileIDs:o}=s;await l(o,e),s=i()}}catch(t){throw this.#I(e),t}if(s){s.fileIDs.forEach(e=>{let t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)});let t=s.fileIDs.map(e=>this.getFile(e)),r=t.filter(e=>!e.error),l=t.filter(e=>e.error);this.addResultData(e,{successful:r,failed:l,uploadID:e}),s=i()}return s&&(t=s.result,this.#I(e)),null==t&&(this.log(`Not setting result for an upload that has been removed: ${e}`),t={successful:[],failed:[],uploadID:e}),t}async upload(){this.#o.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#F().length>0){let t=await this.#x();if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}let t=this.opts.onBeforeUpload(e);return!1===t?Promise.reject(Error("Not starting the upload because onBeforeUpload returned false")):(t&&"object"==typeof t&&(e=t,this.setState({files:e})),Promise.resolve().then(()=>this.#a.validateMinNumberOfFiles(e)).catch(e=>{throw this.#g([e]),e}).then(()=>{if(!this.#m(e))throw new S(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(async()=>{let{currentUploads:t}=this.getState(),i=Object.values(t).flatMap(e=>e.fileIDs),s=[];Object.keys(e).forEach(e=>{let t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||s.push(t.id)});let r=this.#A(s),l=await this.#E(r);return this.emit("complete",l),l}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}let E=A},74140:e=>{"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,s=!0,r=this.parts,l=r.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(t=0,i=(e||"").split(this.separator);s&&t<l;t++)if("*"===r[t])continue;else s=t<i.length&&r[t]===i[t];s=s&&i}else s=!1;else if("function"==typeof e.splice)for(s=[],t=e.length;t--;)this.match(e[t])&&(s[s.length]=e[t]);else if("object"==typeof e)for(var o in s={},e)this.match(o)&&(s[o]=e[o]);return s},e.exports=function(e,i,s){var r=new t(e,s||/[\/\.]/);return void 0!==i?r.match(i):r}},85683:(e,t,i)=>{var s=i(74140),r=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=s(t,e,r);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},85943:(e,t,i)=>{var s=i(54579),r=/^\s+/;e.exports=function(e){return e?e.slice(0,s(e)+1).replace(r,""):e}},89853:(e,t,i)=>{"use strict";function s(e){let 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)}}i.d(t,{A:()=>s})},91666:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});
5class s extends Error{cause;isNetworkError;request;constructor(e,t=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}let r=s},96961:(e,t,i)=>{var s=i(85943),r=i(99674),l=i(7901),o=0/0,a=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,d=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(l(e))return o;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=s(e);var i=n.test(e);return i||d.test(e)?u(e.slice(2),i?2:8):a.test(e)?o:+e}},99674:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.