1import{g as St,c as vs}from"./Cpj98o6Y.js";import{a as Nu}from"./BEF4OIlO.js";import{bN as Zo,bX as Bt,c6 as fa,c7 as He,bP as Qe,b$ as un,bQ as bs,ca as dn,bO as ws,cb as Iu,bU as qe,ck as hn,c8 as er,cf as Bu,cN as Lu,bY as $u,cn as zu,bo as ju,d1 as Hu,fj as qu,aY as Wu,co as Vu,dD as Gu}from"./F3J92rPK.js";import{V as Xu}from"./RFth3_qa.js";function _s(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Yu=0;function el(i){return"__private_"+Yu+++"_"+i}function Ku(i,e,t){const s=[];return i.forEach(r=>typeof r!="string"?s.push(r):e[Symbol.split](r).forEach((a,n,o)=>{a!==""&&s.push(a),n<o.length-1&&s.push(t)})),s}function cn(i,e){const t=/\$/g,s="$$$$";let r=[i];if(e==null)return r;for(const a of Object.keys(e))if(a!=="_"){let n=e[a];typeof n=="string"&&(n=t[Symbol.replace](n,s)),r=Ku(r,new RegExp(`%\\{${a}\\}`,"g"),n)}return r}const Qu=i=>{throw new Error(`missing string: ${i}`)};var ci=el("onMissingKey"),pi=el("apply");class tl{constructor(e,t){let{onMissingKey:s=Qu}=t===void 0?{}:t;Object.defineProperty(this,pi,{value:Ju}),Object.defineProperty(this,ci,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(_s(this,pi)[pi],this):_s(this,pi)[pi](e),_s(this,ci)[ci]=s}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];if(s==null&&(_s(this,ci)[ci](e),s=e),typeof s=="object"){if(t&&typeof t.smart_count<"u"){const a=this.locale.pluralize(t.smart_count);return cn(s[a],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof s!="string")throw new Error("string was not a string");return cn(s,t)}}function Ju(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var tr,pn;function Zu(){return pn||(pn=1,tr=function(){var e={},t=e._fns={};e.emit=function(n,o,l,u,h,d,p){var f=s(n);f.length&&r(n,f,[o,l,u,h,d,p])},e.on=function(n,o){t[n]||(t[n]=[]),t[n].push(o)},e.once=function(n,o){function l(){o.apply(this,arguments),e.off(n,l)}this.on(n,l)},e.off=function(n,o){var l=[];if(n&&o){var u=this._fns[n],h=0,d=u?u.length:0;for(h;h<d;h++)u[h]!==o&&l.push(u[h])}l.length?this._fns[n]=l:delete this._fns[n]};function s(a){var n=t[a]?t[a]:[],o=a.indexOf(":"),l=o===-1?[a]:[a.substring(0,o),a.substring(o+1)],u=Object.keys(t),h=0,d=u.length;for(h;h<d;h++){var p=u[h];if(p==="*"&&(n=n.concat(t[p])),l.length===2&&l[0]===p){n=n.concat(t[p]);break}}return n}function r(a,n,o){var l=0,u=n.length;for(l;l<u&&n[l];l++)n[l].event=a,n[l].apply(n[l],o)}return e}),tr}var ed=Zu();const td=St(ed);let id="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Vs=(i=21)=>{let e="",t=i;for(;t--;)e+=id[Math.random()*64|0];return e};var ir,fn;function $a(){if(fn)return ir;fn=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ir=i,ir}var sr,mn;
1function sd(){if(mn)return sr;mn=1;var i=typeof vs=="object"&&vs&&vs.Object===Object&&vs;return sr=i,sr}var rr,gn;function il(){if(gn)return rr;gn=1;var i=sd(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return rr=t,rr}var ar,yn;function rd(){if(yn)return ar;yn=1;var i=il(),e=function(){return i.Date.now()};return ar=e,ar}var nr,vn;function ad(){if(vn)return nr;vn=1;var i=/\s/;function e(t){for(var s=t.length;s--&&i.test(t.charAt(s)););return s}return nr=e,nr}var or,bn;function nd(){if(bn)return or;bn=1;var i=ad(),e=/^\s+/;function t(s){return s&&s.slice(0,i(s)+1).replace(e,"")}return or=t,or}var lr,wn;function sl(){if(wn)return lr;wn=1;var i=il(),e=i.Symbol;return lr=e,lr}var ur,_n;function od(){if(_n)return ur;_n=1;var i=sl(),e=Object.prototype,t=e.hasOwnProperty,s=e.toString,r=i?i.toStringTag:void 0;function a(n){var o=t.call(n,r),l=n[r];try{n[r]=void 0;var u=!0}catch{}var h=s.call(n);return u&&(o?n[r]=l:delete n[r]),h}return ur=a,ur}var dr,Sn;function ld(){if(Sn)return dr;Sn=1;var i=Object.prototype,e=i.toString;function t(s){return e.call(s)}return dr=t,dr}var hr,Pn;function ud(){if(Pn)return hr;Pn=1;var i=sl(),e=od(),t=ld(),s="[object Null]",r="[object Undefined]",a=i?i.toStringTag:void 0;function n(o){return o==null?o===void 0?r:s:a&&a in Object(o)?e(o):t(o)}return hr=n,hr}var cr,Fn;function dd(){if(Fn)return cr;Fn=1;function i(e){return e!=null&&typeof e=="object"}return cr=i,cr}var pr,Cn;function hd(){if(Cn)return pr;Cn=1;var i=ud(),e=dd(),t="[object Symbol]";function s(r){return typeof r=="symbol"||e(r)&&i(r)==t}return pr=s,pr}var fr,Tn;function cd(){if(Tn)return fr;Tn=1;var i=nd(),e=$a(),t=hd(),s=NaN,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,n=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return s;if(e(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=e(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=i(u);var d=a.test(u);return d||n.test(u)?o(u.slice(2),d?2:8):r.test(u)?s:+u}return fr=l,fr}var mr,En;function rl(){if(En)return mr;En=1;var i=$a(),e=rd(),t=cd(),s="Expected a function",r=Math.max,a=Math.min;function n(o,l,u){var h,d,p,f,m,y,g=0,b=!1,w=!1,S=!0;if(typeof o!="function")throw new TypeError(s);l=t(l)||0,i(u)&&(b=!!u.leading,w="maxWait"in u,p=w?r(t(u.maxWait)||0,l):p,S="trailing"in u?!!u.trailing:S);function T(k){var M=h,D=d;return h=d=void 0,g=k,f=o.apply(D,M),f}function O(k){return g=k,m=setTimeout(P,l),b?T(k):f}function v(k){var M=k-y,D=k-g,te=l-M;return w?a(te,p-D):te}function _(k){var M=k-y,D=k-g;return y===void 0||M>=l||M<0||w&&D>=p}function P(){var k=e();if(_(k))return E(k);m=setTimeout(P,v(k))}function E(k){return m=void 0,S&&h?T(k):(h=d=void 0,f)}function N(){m!==void 0&&clearTimeout(m),g=0,h=y=d=m=void 0}function le(){return m===void 0?f:E(e())}function Q(){var k=e(),M=_(k);if(h=arguments,d=this,y=k,M){if(m===void 0)return O(y);if(w)return clearTimeout(m),m=setTimeout(P,l),T(y)}return m===void 0&&(m=setTimeout(P,l)),f}return Q.cancel=N,Q.flush=le,Q}return mr=n,mr}var gr,On;function pd(){if(On)return gr;On=1;var i=rl(),e=$a(),t="Expected a function";function s(r,a,n){var o=!0,l=!0;if(typeof r!="function")throw new TypeError(t);return e(n)&&(o="leading"in n?!!n.leading:o,l="trailing"in n?!!n.trailing:l),i(r,a,{leading:o,maxWait:a,trailing:l})}return gr=s,gr}var fd=pd();const al=St(fd);function Ms(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var md=0;function nl(i){return"__private_"+md+++"_"+i}const gd={version:"3.2.2"};var zt=nl("callbacks"),yr=nl("publish");class ol{constructor(){Object.defineProperty(this,yr,{value:yd}),this.state={},Object.defineProperty(this,zt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},s={...this.state,...e};this.state=s,Ms(this,yr)[yr](t,s,e)}subscribe(e){return Ms(this,zt)[zt].add(e),()=>{Ms(this,zt)[zt].delete(e)}}}function yd(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ms(this,zt)[zt].forEach(s=>{s(...e)})}ol.VERSION=gd.version;function ll(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const An={__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",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 ul(i){var e;if(i.type)return i.type;const t=i.name?(e=ll(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in An?An[t]:"application/octet-stream"}
1function vd(i){return i.charCodeAt(0).toString(32)}function xn(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${vd(t)}`,"/"))+e}function bd(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${xn(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${xn(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function wd(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function _d(i,e){if(wd(i))return i.id;const t=ul(i);return bd({...i,type:t},e)}function Sd(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const s=e[1].split(".",2),r=parseInt(s[0],10),a=parseInt(s[1],10);return r<15||r===15&&a<15063||r>18||r===18&&a>=18218}function Pd(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function vr(i){return i<10?`0${i}`:i.toString()}function Ds(){const i=new Date,e=vr(i.getHours()),t=vr(i.getMinutes()),s=vr(i.getSeconds());return`${e}:${t}:${s}`}const Fd={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}},Cd={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ds()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ds()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ds()}]`,...e)}};var br,Un;function Td(){return Un||(Un=1,br=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),s===0)return"0 B";const r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],a=Math.min(Math.floor(Math.log(s)/Math.log(1024)),r.length-1),n=Number(s/1024**a),o=r[a];return`${n>=10||n%1===0?Math.round(n):n.toFixed(1)} ${o}`}),br}var Ed=Td();const Yt=St(Ed);var wr,kn;function Od(){if(kn)return wr;kn=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,s=this.parts,r,a=s.length,n;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(n=(e||"").split(this.separator),r=0;t&&r<a;r++)s[r]!=="*"&&(r<n.length?t=s[r]===n[r]:t=!1);t=t&&n}else if(typeof e.splice=="function")for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e=="object"){t={};for(var o in e)this.match(o)&&(t[o]=e[o])}return t},wr=function(e,t,s){var r=new i(e,s||/[\/\.]/);return typeof t<"u"?r.match(t):r},wr}var _r,Rn;function Ad(){if(Rn)return _r;Rn=1;var i=Od(),e=/[\/\+\.]/;return _r=function(t,s){function r(a){var n=i(a,t,e);return n&&n.length>=2}return s?r(s.split(";")[0]):r},_r}var xd=Ad();const Ud=St(xd),kd={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class De extends Error{constructor(e,t){var s;super(e),this.isRestriction=!0,this.isUserFacing=(s=t?.isUserFacing)!=null?s:!0,t!=null&&t.file&&(this.file=t.file)}}class Rd{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var s;const r=e();if(((s=r.restrictions)==null?void 0:s.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(n=>!n.isGhost).length+t.length>r)throw new De(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(s){const a=[...e,...t].reduce((n,o)=>{var l;return n+((l=o.size)!=null?l:0)},0);if(a>s)throw new De(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Yt(s),size:Yt(a)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(n=>n.includes("/")?e.type?Ud(e.type.replace(/;.*?$/,""),n):!1:n[0]==="."&&e.extension?e.extension.toLowerCase()===n.slice(1).toLowerCase():!1)){const n=r.join(", ");throw new De(this.getI18n()("youCanOnlyUploadFileTypes",{types:n}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new De(this.getI18n()("exceedsSize",{size:Yt(t),file:e.n
1ame}),{file:e});if(s&&e.size!=null&&e.size<s)throw new De(this.getI18n()("inferiorSize",{size:Yt(s)}),{file:e})}validate(e,t){t.forEach(s=>{this.validateSingleFile(s)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new De(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new De(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:s}=this.getOpts().restrictions,r=[];for(const a of s)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&r.push(a);return{missingFields:r,error:t}}}const Md={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",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"}};let dl,hl;function F(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Dd=0;function W(i){return"__private_"+Dd+++"_"+i}const Nd={version:"3.13.1"},Ss={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var ie=W("plugins"),Te=W("restricter"),fi=W("storeUnsubscribe"),Je=W("emitter"),jt=W("preProcessors"),Ht=W("uploaders"),ct=W("postProcessors"),Ee=W("informAndEmit"),rs=W("checkRequiredMetaFieldsOnFile"),Sr=W("checkRequiredMetaFields"),mi=W("assertNewUploadAllowed"),ma=W("transformFile"),gi=W("startIfAutoProceed"),yi=W("checkAndUpdateFileState"),Pr=W("addListeners"),Be=W("updateOnlineStatus"),vi=W("requestClientById"),Ze=W("createUpload"),Fr=W("getUpload"),Kt=W("removeUpload"),et=W("runUpload");dl=Symbol.for("uppy test: getPlugins");hl=Symbol.for("uppy test: createUpload");class Gs{constructor(e){Object.defineProperty(this,et,{value:Xd}),Object.defineProperty(this,Kt,{value:Gd}),Object.defineProperty(this,Fr,{value:Vd}),Object.defineProperty(this,Ze,{value:Wd}),Object.defineProperty(this,Pr,{value:qd}),Object.defineProperty(this,yi,{value:Hd}),Object.defineProperty(this,gi,{value:jd}),Object.defineProperty(this,ma,{value:zd}),Object.defineProperty(this,mi,{value:$d}),Object.defineProperty(this,Sr,{value:Ld}),Object.defineProperty(this,rs,{value:Bd}),Object.defineProperty(this,Ee,{value:Id}),Object.defineProperty(this,ie,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),Object.defineProperty(this,fi,{writable:!0,value:void 0}),Object.defineProperty(this,Je,{writable:!0,value:td()}),Object.defineProperty(this,jt,{writable:!0,value:new Set}),Object.defineProperty(this,Ht,{writable:!0,value:new Set}),Object.defineProperty(this,ct,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=al((r,a)=>{const n=this.getFile(r?.id);if(r==null||!n){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(n.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}const o=Number.isFinite(a.bytesTotal)&&a.bytesTotal>0;this.setFileState(r.id,{progress:{...n.progress,bytesUploaded:a.bytesUploaded,bytesTotal:a.bytesTotal,percentage:o?Math.round(a.bytesUploaded/a.bytesTotal*100):0}
vendor: 4,177 bytes, line 1
1}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Be,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,vi,{writable:!0,value:new Map}),this.defaultLocale=Md;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:kd,meta:{},onBeforeFileAdded:(r,a)=>!Object.hasOwn(a,r.id),onBeforeUpload:r=>r,store:new ol,logger:Fd,infoTimeout:5e3},s={...t,...e};this.opts={...s,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=Cd),this.log(`Using Core v${Gs.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Ss,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Sd(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),F(this,Te)[Te]=new Rd(()=>this.opts,()=>this.i18n),F(this,fi)[fi]=this.store.subscribe((r,a,n)=>{this.emit("state-update",r,a,n),this.updateAll(a)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),F(this,Pr)[Pr]()}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];F(this,Je)[Je].emit(e,...s)}on(e,t){return F(this,Je)[Je].on(e,t),this}once(e,t){return F(this,Je)[Je].once(e,t),this}off(e,t){return F(this,Je)[Je].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){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(s=>{let[r,a]=s;return[r,{...t[r],...a}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Canât set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=s=>this.log(`Missing i18n string: ${s}`,"error"),t=new tl([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(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},s={};Object.keys(t).forEach(r=>{s[r]={...t[r],progress:{...t[r].progress,...e}}}),this.setState({files:s,...Ss}),this.emit("reset-progress")}clearUploadedFiles(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Ss,files:{}})}addPreProcessor(e){F(this,jt)[jt].add(e)}removePreProcessor(e){return F(this,jt)[jt].delete(e)}addPostProcessor(e){F(this,ct)[ct].add(e)}removePostProcessor(e){return F(this,ct)[ct].delete(e)}addUploader(e){F(this,Ht)[Ht].add(e)}removeUploader(e){return F(this,Ht)[Ht].delete(e)}setMeta(e){const t={...this.getState().meta,...e},s={...this.getState().files};Object.keys(s).forEach(r=>{s[r]={...s[r],meta:{...s[r].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:s})}setFileMeta(e,t){const s={...this.getState().files};if(!s[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}const r={...s[e].meta,...t};s[e]={...s[e],meta:r},this.setState({files:s})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:s}=this.getState(),r=Object.values(e),a=[],n=[],o=[],l=[],u=[],h=[],d=[],p=[],f=[];for(const m of r){const{progress:y}=m;!y.uploadComplete&&y.uploadStarted&&(a.push(m),m.isPaused||p.push(m)),y.uploadStarted||n.push(m),(y.uploadStarted||y.preprocess||y.postprocess)&&o.push(m),y.uploadStarted&&l.push(m),m.isPau
1sed&&u.push(m),y.uploadComplete&&h.push(m),m.error&&d.push(m),(y.preprocess||y.postprocess)&&f.push(m)}return{newFiles:n,startedFiles:o,uploadStartedFiles:l,pausedFiles:u,completeFiles:h,erroredFiles:d,inProgressFiles:a,inProgressNotPausedFiles:p,processingFiles:f,isUploadStarted:l.length>0,isAllComplete:t===100&&h.length===r.length&&f.length===0,isAllErrored:!!s&&d.length===r.length,isAllPaused:a.length!==0&&u.length===a.length,isUploadInProgress:a.length>0,isSomeGhost:r.some(m=>m.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{F(this,Te)[Te].validate(t,[e])}catch(s){return s}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){F(this,mi)[mi](e);const{nextFilesState:t,validFilesToAdd:s,errors:r}=F(this,yi)[yi]([e]),a=r.filter(o=>o.isRestriction);if(F(this,Ee)[Ee](a),r.length>0)throw r[0];this.setState({files:t});const[n]=s;return this.emit("file-added",n),this.emit("files-added",s),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),F(this,gi)[gi](),n.id}addFiles(e){F(this,mi)[mi]();const{nextFilesState:t,validFilesToAdd:s,errors:r}=F(this,yi)[yi](e),a=r.filter(o=>o.isRestriction);F(this,Ee)[Ee](a);const n=r.filter(o=>!o.isRestriction);if(n.length>0){let o=`Multiple errors occurred while adding files: 2`;if(n.forEach(l=>{o+=` 3 * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:n.length}),details:o},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(n,o);{const l=new Error(o);throw l.errors=n,l}}this.setState({files:t}
3),s.forEach(o=>{this.emit("file-added",o)}),this.emit("files-added",s),s.length>5?this.log(`Added batch of ${s.length} files`):Object.values(s).forEach(o=>{this.log(`Added file: ${o.name} 4 id: ${o.id} 5 type: ${o.type}`)}),s.length>0&&F(this,gi)[gi]()}removeFiles(e,t){const{files:s,currentUploads:r}=this.getState(),a={...s},n={...r},o=Object.create(null);e.forEach(d=>{s[d]&&(o[d]=s[d],delete a[d])});function l(d){return o[d]===void 0}Object.keys(n).forEach(d=>{const p=r[d].fileIDs.filter(l);if(p.length===0){delete n[d];return}const{capabilities:f}=this.getState();if(p.length!==r[d].fileIDs.length&&!f.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[d]={...r[d],fileIDs:p}});const u={currentUploads:n,files:a};Object.keys(a).length===0&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const h=Object.keys(o);h.forEach(d=>{this.emit("file-removed",o[d],t)}),h.length>5?this.log(`Removed ${h.length} files`):this.log(`Removed files: ${h.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const s=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",e,s),s}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const r={...e[s],isPaused:!0};e[s]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const r={...e[s],isPaused:!1,error:null};e[s]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(r=>e[r].error);if(t.forEach(r=>{const a={...e[r],isPaused:!1,error:null};e[r]=a}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});const s=F(this,Ze)[Ze](t,{forceAllowNewUpload:!0});return F(this,et)[et](s)}cancelAll(e){let{reason:t="user"}=e===void 0?{}:e;if(this.emit("cancel-all",{reason:t}),t==="user"){const{files:s}=this.getState(),r=Object.keys(s);r.length&&this.removeFiles(r,"cancel-all"),this.setState(Ss)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=F(this,Ze)[Ze]([e],{forceAllowNewUpload:!0});return F(this,et)[et](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}calculateTotalProgress(){const t=this.getFiles().filter(u=>u.progress.uploadStarted||u.progress.preprocess||u.progress.postprocess);if(t.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}const s=t.filter(u=>u.progress.bytesTotal!=null),r=t.filter(u=>u.progress.bytesTotal==null);if(s.length===0){const u=t.length*100,h=r.reduce((p,f)=>p+f.progress.percentage,0),d=Math.round(h/u*100);this.setState({totalProgress:d});return}let a=s.reduce((u,h)=>{var d;return u+((d=h.progress.bytesTotal)!=null?d:0)},0);const n=a/s.length;a+=n*r.length;let o=0;s.forEach(u=>{o+=u.progress.bytesUploaded}),r.forEach(u=>{o+=n*(u.progress.percentage||0)/100});let l=a===0?0:Math.round(o/a*100);l>100&&(l=100),this.setState({totalProgress:l}),this.emit("progress",l)}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit
5("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(typeof e!="function"){const n=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(n)}const s=new e(this,t),r=s.id;if(!r)throw new Error("Your plugin must have an id");if(!s.type)throw new Error("Your plugin must have a type");const a=this.getPlugin(r);if(a){const n=`Already found a plugin named '${a.id}'. Tried to use: '${r}'. 6Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(n)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),s.type in F(this,ie)[ie]?F(this,ie)[ie][s.type].push(s):F(this,ie)[ie][s.type]=[s],s.install(),this.emit("plugin-added",s),this}getPlugin(e){for(const t of Object.values(F(this,ie)[ie])){const s=t.find(r=>r.id===e);if(s!=null)return s}}[dl](e){return F(this,ie)[ie][e]}iteratePlugins(e){Object.values(F(this,ie)[ie]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=F(this,ie)[ie][e.type],s=t.findIndex(n=>n.id===e.id);s!==-1&&t.splice(s,1);const a={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(a)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),F(this,fi)[fi](),this.iteratePlugins(s=>{this.removePlugin(s)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",F(this,Be)[Be]),window.removeEventListener("offline",F(this,Be)[Be]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,s){t===void 0&&(t="info"),s===void 0&&(s=3e3);const r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),s),this.emit("info-visible")}log(e,t){const{logger:s}=this.opts;switch(t){case"error":s.error(e);break;case"warning":s.warn(e);break;default:s.debug(e);break}}registerRequestClient(e,t){F(this,vi)[vi].set(e,t)}
6getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=F(this,vi)[vi].get(e.remote.requestClientId);if(t==null)throw new 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]?F(this,et)[et](e):(F(this,Kt)[Kt](e),Promise.reject(new Error("Nonexistent upload")))}[hl](){return F(this,Ze)[Ze](...arguments)}addResultData(e,t){if(!F(this,Fr)[Fr](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:s}=this.getState(),r={...s[e],result:{...s[e].result,...t}};this.setState({currentUploads:{...s,[e]:r}})}upload(){var e;(e=F(this,ie)[ie].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const s=this.opts.onBeforeUpload(t);return s===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(s&&typeof s=="object"&&(t=s,this.setState({files:t})),Promise.resolve().then(()=>F(this,Te)[Te].validateMinNumberOfFiles(t)).catch(r=>{throw F(this,Ee)[Ee]([r]),r}).then(()=>{if(!F(this,Sr)[Sr](t))throw new De(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{const{currentUploads:r}=this.getState(),a=Object.values(r).flatMap(l=>l.fileIDs),n=[];Object.keys(t).forEach(l=>{const u=this.getFile(l);!u.progress.uploadStarted&&a.indexOf(l)===-1&&n.push(u.id)});const o=F(this,Ze)[Ze](n);return F(this,et)[et](o)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}}function Id(i){for(const a of i)a.isRestriction?this.emit("restriction-failed",a.file,a):this.emit("error",a,a.file),this.log(a,"warning");const e=i.filter(a=>a.isUserFacing),t=4,s=e.slice(0,t),r=e.slice(t);s.forEach(a=>{let{message:n,details:o=""}=a;this.info({message:n,details:o},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function Bd(i){const{missingFields:e,error:t}=F(this,Te)[Te].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Ld(i){let e=!0;for(const t of Object.values(i))F(this,rs)[rs](t)||(e=!1);return e}function $d(i){const{allowNewUpload:e}=this.getState();if(e===!1){const t=new De(this.i18n("noMoreFilesAllowed"),{file:i});throw F(this,Ee)[Ee]([t]),t}}function zd(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=ul(e),s=Pd(t,e),r=ll(s).extension,a=_d(e,this.getID()),n=e.meta||{};n.name=s,n.type=t;const o=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:a,name:s,extension:r||"",meta:{...this.getState().meta,...n},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:o,uploadComplete:!1,uploadStarted:null},size:o,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}function jd(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function Hd(i){const{files:e}=this.getState(),t={...e},s=[],r=[];for(const n of i)try{var a;let o=F(this,ma)[ma](n);const l=(a=e[o.id])==null?void 0:a.isGhost;l&&(o={...e[o.id],isGhost:!1,data:n.data},this.log(`Replaced the blob in the restored ghost file: ${o.name}, ${o.id}`));const u=this.opts.onBeforeFileAdded(o,t);if(!u&&this.checkIfFileAlreadyExists(o.id))throw new De(this.i18n("noDuplicates",{fileName:o.name}),{file:n});if(u===!1&&!l)throw new De("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:n});typeof u=="object"&&u!==null&&(o=u),F(this,Te)[Te].validateSingleFile(o),t[o.id]=o,s.push(o)}catch(o){r.push(o)}try{F(this,Te)[Te].validateAggregateRestrictions(Object.values(e),s)}catch(n){return r.push(n),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:s,errors:r}}function qd(){const i=(s,r,a)=>{let n=s.message||"Unknown error";s.details&&(n+=` ${s.details}`),this.setState({error:n}
6),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:n,response:a})};this.on("error",i),this.on("upload-error",(s,r,a)=>{if(i(r,s,a),typeof r=="object"&&r.message){var n;this.log(r.message,"error");const o=new Error(this.i18n("failedToUpload",{file:(n=s?.name)!=null?n:""}));o.isUserFacing=!0,o.details=r.message,r.details&&(o.details+=` ${r.details}`),F(this,Ee)[Ee]([o])}else F(this,Ee)[Ee]([r])});let e=null;this.on("upload-stalled",(s,r)=>{const{message:a}=s,n=r.map(o=>o.meta.name).join(", ");e||(this.info({message:a,details:n},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${a} ${n}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const t=s=>{const r=s.filter(n=>{const o=n!=null&&this.getFile(n.id);return o||this.log(`Not setting progress for a file that has been removed: ${n?.id}`),o}),a=Object.fromEntries(r.map(n=>[n.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:n.size}}]));this.patchFilesState(a)};this.on("upload-start",s=>{s.forEach(r=>{this.emit("upload-started",r)}),t(s)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const a=this.getFile(s.id).progress;this.setFileState(s.id,{progress:{...a,postprocess:F(this,ct)[ct].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:a.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),s.size==null&&this.setFileState(s.id,{size:r.bytesUploaded||a.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}this.setFileState(s.id,{progress:{...this.getFile(s.id).progress,preprocess:r}})}),this.on("preprocess-complete",s=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const r={...this.getState().files};r[s.id]={...r[s.id],progress:{...r[s.id].progress}},delete r[s.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}this.setFileState(s.id,{progress:{...this.getState().files[s.id].progress,postprocess:r}})}),this.on("postprocess-complete",s=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const r={...this.getState().files};r[s.id]={...r[s.id],progress:{...r[s.id].progress}},delete r[s.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",s=>{s&&F(this,rs)[rs](s)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",F(this,Be)[Be]),window.addEventListener("offline",F(this,Be)[Be]),setTimeout(F(this,Be)[Be],3e3))}function Wd(i,e){e===void 0&&(e={});const{forceAllowNewUpload:t=!1}=e,{allowNewUpload:s,currentUploads:r}=this.getState();if(!s&&!t)throw new Error("Cannot create a new upload: already uploading.");const a=Vs();return this.emit("upload",{id:a,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[a]:{fileIDs:i,step:0,result:{}}}}),a}function Vd(i){const{currentUploads:e}=this.getState();return e[i]}function Gd(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function Xd(i){const e=()=>{const{currentUploads:a}=this.getState();return a[i]};let t=e();const s=[...F(this,jt)[jt],...F(this,Ht)[Ht],...F(this,ct)[ct]];try{for(let a=t.step||0;a<s.length&&t;a++){const n=s[a];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:a}}});const{fileIDs:o}=t;await n(o,i),t=e()}}catch(a){throw F(this,Kt)[Kt](i),a}if(t){t.fileIDs.forEach(l=>{const u=this.getFile(l);
vendor: 11,083 bytes, line 6
6u&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const a=t.fileIDs.map(l=>this.getFile(l)),n=a.filter(l=>!l.error),o=a.filter(l=>l.error);this.addResultData(i,{successful:n,failed:o,uploadID:i}),t=e()}let r;return t&&(r=t.result,this.emit("complete",r),F(this,Kt)[Kt](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r}Gs.VERSION=Nd.version;var cs,B,cl,mt,Mn,pl,fl,Cr,Ns,Qi,ml,za,ga,ya,$s={},zs=[],Yd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ps=Array.isArray;function Ve(i,e){for(var t in e)i[t]=e[t];return i}function ja(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function c(i,e,t){var s,r,a,n={};for(a in e)a=="key"?s=e[a]:a=="ref"?r=e[a]:n[a]=e[a];if(arguments.length>2&&(n.children=arguments.length>3?cs.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(a in i.defaultProps)n[a]===void 0&&(n[a]=i.defaultProps[a]);return Ji(i,n,s,r,null)}function Ji(i,e,t,s,r){var a={type:i,props:e,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++cl,__i:-1,__u:0};return r==null&&B.vnode!=null&&B.vnode(a),a}function Kd(){return{current:null}}function wt(i){return i.children}function Ge(i,e){this.props=i,this.context=e}function ui(i,e){if(e==null)return i.__?ui(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?ui(i):null}function Qd(i){if(i.__P&&i.__d){var e=i.__v,t=e.__e,s=[],r=[],a=Ve({},e);a.__v=e.__v+1,B.vnode&&B.vnode(a),Ha(i.__P,a,e,i.__n,i.__P.namespaceURI,32&e.__u?[t]:null,s,t??ui(e),!!(32&e.__u),r),a.__v=e.__v,a.__.__k[a.__i]=a,bl(s,a,r),e.__e=e.__=null,a.__e!=t&&gl(a)}}function gl(i){if((i=i.__)!=null&&i.__c!=null)return i.__e=i.__c.base=null,i.__k.some(function(e){if(e!=null&&e.__e!=null)return i.__e=i.__c.base=e.__e}),gl(i)}function Dn(i){(!i.__d&&(i.__d=!0)&&mt.push(i)&&!js.__r++||Mn!=B.debounceRendering)&&((Mn=B.debounceRendering)||pl)(js)}function js(){try{for(var i,e=1;mt.length;)mt.length>e&&mt.sort(fl),i=mt.shift(),e=mt.length,Qd(i)}finally{mt.length=js.__r=0}}function yl(i,e,t,s,r,a,n,o,l,u,h){var d,p,f,m,y,g,b,w=s&&s.__k||zs,S=e.length;for(l=Jd(t,e,w,l,S),d=0;d<S;d++)(f=t.__k[d])!=null&&(p=f.__i!=-1&&w[f.__i]||$s,f.__i=d,g=Ha(i,f,p,r,a,n,o,l,u,h),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&qa(p.ref,null,f),h.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),(b=!!(4&f.__u))||p.__k===f.__k?(l=vl(f,l,i,b),b&&p.__e&&(p.__e=null)):typeof f.type=="function"&&g!==void 0?l=g:m&&(l=m.nextSibling),f.__u&=-7);return t.__e=y,l}function Jd(i,e,t,s,r){var a,n,o,l,u,h=t.length,d=h,p=0;for(i.__k=new Array(r),a=0;a<r;a++)(n=e[a])!=null&&typeof n!="boolean"&&typeof n!="function"?(typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?n=i.__k[a]=Ji(null,n,null,null,null):ps(n)?n=i.__k[a]=Ji(wt,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?n=i.__k[a]=Ji(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):i.__k[a]=n,l=a+p,n.__=i,n.__b=i.__b+1,o=null,(u=n.__i=Zd(n,t,l,d))!=-1&&(d--,(o=t[u])&&(o.__u|=2)),o==null||o.__v==null?(u==-1&&(r>h?p--:r<h&&p++),typeof n.type!="function"&&(n.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,n.__u|=4))):i.__k[a]=null;if(d)for(a=0;a<h;a++)(o=t[a])!=null&&(2&o.__u)==0&&(o.__e==s&&(s=ui(o)),_l(o,o));return s}function vl(i,e,t,s){var r,a;if(typeof i.type=="function"){for(r=i.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=i,e=vl(r[a],e,t,s));return e}i.__e!=e&&(s&&(e&&i.type&&!e.parentNode&&(e=ui(i)),t.insertBefore(i.__e,e||null)),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gt(i,e){return e=e||[],i==null||typeof i=="boolean"||(ps(i)?i.some(function(t){gt(t,e)}):e.push(i)),e}function Zd(i,e,t,s){var r,a,n,o=i.key,l=i.type,u=e[t],h=u!=null&&(2&u.__u)==0;if(u===null&&o==null||h&&o==u.key&&l==u.type)return t;if(s>(h?1:0)){for(r=t-1,a=t+1;r>=0||a<e.length;)if((u=e[n=r>=0?r--:a++])!=null&&(2&u.__u)==0&&o==u.key&&l==u.type)return n}return-1}function Nn(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Yd.test(e)?t:t+"px"}function Ps(i,e,t,s,r){var a,n;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof s=="string"&&(i.style.cssText=s=""),s)for(e in s)t&&e in t||Nn(i.style,e,"");if(t)for(e in t)s&&t[e]==s[e]||Nn(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(ml,"$1")),n=e.toLowerCase(),e=n in i||e=="onFocusOut"||e=="onFocusIn"?n.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+a]=t,t?s?t[Qi]=s[Qi]:(t[Qi]=za,i.addEventListener(e,a?ya:ga,a)):i.removeEventListener(e,a?ya:ga,a);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function In(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e[Ns]==null)e[Ns]=za++;else if(e[Ns]<t[Qi])return;return t(B.event?B.event(e):e)}}}function Ha(i,e,t,s,r,a,n,o,l,u){var h,d,p,f,m,y,g,b,w,S,T,O,v,_,P,E=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),a=[o=e.__e=t.__e]),(h=B.__b)&&h(e);e:if(typeof E=="function")try{if(b=e.props,w=E.prototype&&E.prototype.render,S=(h=E.contextType)&&s[h.__c],T=h?S?S.props.value:h.__:s,t.__c?g=(d=e.__c=t.__c).__=d.__E:(w?e.__c=d=new E(b,T):(e.__c=d=new Ge(b,T),d.constructor=E,d.render=th),S&&S.sub(d),d.state||(d.state={}),d.__n=s,p=d.__d=!0,d.__h=[],d._sb=[]),w&&d.__s==null&&(d.__s=d.state),w&&E.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Ve({},d.__s)),Ve(d.__s,E.getDerivedStateFromProps(b,d.__s))),f=d.props,m=d.state,d.__v=e,p)w&&E.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),w&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(w&&E.getDerivedStateFromProps==null&&b!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,T),e.__v==t.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,T)===!1){e.__v!=t.__v&&(d.props=b,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(N){N&&(N.__=e)}),zs.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&n.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,T),w&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,m,y)})}if(d.context=T,d.props=b,d.__P=i,d.__e=!1,O=B.__r,v=0,w)d.state=d.__s,d.__d=!1,O&&O(e),h=d.render(d.props,d.state,d.context),zs.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,O&&O(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++v<25);d.state=d.__s,d.getChildContext!=null&&(s=Ve(Ve({},s),d.getChildContext())),w&&!p&&d.getSnapshotBeforeUpdate!=null&&(y=d.getSnapshotBeforeUpdate(f,m)),_=h!=null&&h.type===wt&&h.key==null?wl(h.props.children):h,o=yl(i,ps(_)?_:[_],e,t,s,r,a,n,o,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&n.push(d),g&&(d.__E=d.__=null)}catch(N){if(e.__v=null,l||a!=null)if(N.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,e.__e=o}else{for(P=a.length;P--;)ja(a[P]);va(e)}else e.__e=t.__e,e.__k=t.__k,N.then||va(e);B.__e(N,e,t)}else a==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=eh(t.__e,e,t,s,r,a,n,l,u);return(h=B.diffed)&&h(e),128&e.__u?void 0:o}function va(i){i&&(i.__c&&(i.__c.__e=!0),i.__k&&i.__k.some(va))}function bl(i,e,t){for(var s=0;s<t.length;s++)qa(t[s],t[++s],t[++s]);B.__c&&B.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(a){a.call(r)})}catch(a){B.__e(a,r.__v)}})}function wl(i){return typeof i!="object"||i==null||i.__b>0?i:ps(i)?i.map(wl):i.constructor!==void 0?null:Ve({},i)}function eh(i,e,t,s,r,a,n,o,l){var u,h,d,p,f,m,y,g=t.props||$s,b=e.props,w=e.type;if(w=="svg"?r="http://www.w3.org/2000/svg":w=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),a!=null){for(u=0;u<a.length;u++)if((f=a[u])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){i=f,a[u]=null;break}}if(i==null){if(w==null)return document.createTextNode(b);i=document.createElementNS(r,w,b.is&&b),o&&(B.__m&&B.__m(e,a),o=!1),a=null}if(w==null)g===b||o&&i.data==b||(i.data=b);else{if(a=w=="textarea"&&b.defaultValue!=null?null:a&&cs.call(i.childNodes),!o&&a!=null)for(g={},u=0;u<i.attributes.length;u++)g[(f=i.attributes[u]).name]=f.value;for(u in g)f=g[u],u=="dangerouslySetInnerHTML"?d=f:u=="children"||u in b||u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b||Ps(i,u,null,f,r);for(u in b)f=b[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?h=f:u=="value"?m=f:u=="checked"?y=f:o&&typeof f!="function"||g[u]===f||Ps(i,u,f,g[u],r);if(h)o||d&&(h.__html==d.__html||h.__html==i.innerHTML)||(i.innerHTML=h.__html),e.__k=[];else if(d&&(i.innerHTML=""),yl(e.type=="template"?i.content:i,ps(p)?p:[p],e,t,s,w=="foreignObject"?"http://www.w3.org/1999/xhtml":r,a,n,a?a[0]:t.__k&&ui(t,0),o,l),a!=null)for(u=a.length;u--;)ja(a[u]);o&&w!="textarea"||(u="value",w=="progress"&&m==null?i.removeAttribute("value"):m!=null&&(m!==i[u]||w=="progress"&&!m||w=="option"&&m!=g[u])&&Ps(i,u,m,g[u],r),u="checked",y!=null&&y!=i[u]&&Ps(i,u,y,g[u],r))}return i}function qa(i,e,t){try{if(typeof i=="function"){var s=typeof i.__u=="function";s&&i.__u(),s&&e==null||(i.__u=i(e))}else i.current=e}catch(r){B.__e(r,t)}}function _l(i,e,t){var s,r;if(B.unmount&&B.unmount(i),(s=i.ref)&&(s.current&&s.current!=i.__e||qa(s,null,e)),(s=i.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(a){B.__e(a,e)}s.base=s.__P=null}if(s=i.__k)for(r=0;r<s.length;r++)s[r]&&_l(s[r],e,t||typeof i.type!="function");t||ja(i.__e),i.__c=i.__=i.__e=void 0}function th(i,e,t){return this.constructor(i,t)}function Bn(i,e,t){var s,r,a,n;e==document&&(e=document.documentElement),B.__&&B.__(i,e),r=(s=!1)?null:e.__k,a=[],n=[],Ha(e,i=e.__k=c(wt,null,[i]),r||$s,$s,e.namespaceURI,r?null:e.firstChild?cs.call(e.childNodes):null,a,r?r.__e:e.firstChild,s,n),bl(a,i,n)}function Sl(i,e,t){var s,r,a,n,o=Ve({},i.props);for(a in i.type&&i.type.defaultProps&&(n=i.type.defaultProps),e)a=="key"?s=e[a]:a=="ref"?r=e[a]:o[a]=e[a]===void 0&&n!=null?n[a]:e[a];return arguments.length>2&&(o.children=arguments.length>3?cs.call(arguments,2):t),Ji(i.type,o,s||i.key,r||i.ref,null)}cs=zs.slice,B={__e:function(i,e,t,s){for(var r,a,n;e=e.__;)if((r=e.__c)&&!r.__)try{if((a=r.constructor)&&a.getDerivedStateFromError!=null&&(r.setState(a.getDerivedStateFromError(i)),n=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,s||{}),n=r.__d),n)return r.__E=r}catch(o){i=o}throw i}},cl=0,Ge.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ve({},this.state),typeof i=="function"&&(i=i(Ve({},t),this.props)),i&&Ve(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Dn(this))},Ge.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Dn(this))},Ge.prototype.render=wt,mt=[],pl=typeof Promise=="function"?Promise.prototype.then.bind(Prom
6ise.resolve()):setTimeout,fl=function(i,e){return i.__v.__b-e.__v.__b},js.__r=0,Cr=Math.random().toString(8),Ns="__d"+Cr,Qi="__a"+Cr,ml=/(PointerCapture)$|Capture$/i,za=0,ga=In(!1),ya=In(!0);function Pl(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function ih(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Pl(i)?i:null}function Fl(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class Wa{constructor(e,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(void 0),this.i18nInit()}i18nInit(){const e=new tl([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 new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function Ln(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var sh=0;function rh(i){return"__private_"+sh+++"_"+i}function ah(i){let e=null,t;return function(){for(var s=arguments.length,r=new Array(s),a=0;a<s;a++)r[a]=arguments[a];return t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var bi=rh("updateUI");class _t extends Wa{constructor(){super(...arguments),Object.defineProperty(this,bi,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof _t||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:_t}}));else if(typeof e=="function"){const s=e;this.uppy.iteratePlugins(r=>{r instanceof s&&(t=r)})}return t}mount(e,t){const s=t.id,r=ih(e);if(r){this.isTargetDOMEl=!0;const o=document.createElement("div");return o.classList.add("uppy-Root"),Ln(this,bi)[bi]=ah(l=>{this.uppy.getPlugin(this.id)&&(Bn(this.render(l),o),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),Bn(this.render(this.uppy.getState()),o),this.el=o,r.appendChild(o),o.dir=this.opts.direction||Fl(o)||"ltr",this.onMount(),this.el}const a=this.getTargetPlugin(e);
6if(a)return this.uppy.log(`Installing ${s} to ${a.id}`),this.parent=a,this.el=a.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let n=`Invalid target option given to ${s}.`;throw typeof e=="function"?n+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":n+="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\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(n)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,s;(t=(s=Ln(this,bi))[bi])==null||t.call(s,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}function $n(i,e,t,s){return i===e?i:s===0?e:i+(e-i)*2**(-s/t)}const We={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Tr={exports:{}};var zn;function nh(){return zn||(zn=1,(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var a="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(a=r(a,s(o)))}return a}function s(a){if(typeof a=="string"||typeof a=="number")return a;
6if(typeof a!="object")return"";if(Array.isArray(a))return t.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var n="";for(var o in a)e.call(a,o)&&a[o]&&(n=r(n,o));return n}function r(a,n){return n?a?a+" "+n:a+n:a}i.exports?(t.default=t,i.exports=t):window.classNames=t})()})(Tr)),Tr.exports}var oh=nh();const Le=St(oh);function Er(i){const e=[];let t="indeterminate",s;for(const{progress:a}of Object.values(i)){const{preprocess:n,postprocess:o}=a;s==null&&(n||o)&&({mode:t,message:s}=n||o),n?.mode==="determinate"&&e.push(n.value),o?.mode==="determinate"&&e.push(o.value)}const r=e.reduce((a,n)=>a+n/e.length,0);return{mode:t,message:s,value:r}}function lh(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,s=Math.floor(i%60);return{hours:e,minutes:t,seconds:s}}function uh(i){const e=lh(i),t=e.hours===0?"":`${e.hours}h`,s=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.
6seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${s}${r}`}const dh="·",jn=()=>` ${dh} `;function hh(i){const{newFiles:e,isUploadStarted:t,recoveredState:s,i18n:r,uploadState:a,isSomeGhost:n,startUpload:o}=i,l=Le("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":a===We.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":n}),u=e&&t&&!s?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return c("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:o,disabled:n,"data-uppy-super-focusable":!0},u)}function ch(i){const{i18n:e,uppy:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},c("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"})),e("retry"))}function ph(i){const{i18n:e,uppy:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},c("g",{fill:"none",fillRule:"evenodd"},c("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),c("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"}))))}function fh(i){const{isAllPaused:e,i18n:t,isAllComplete:s,resumableUploads:r,uppy:a}=i,n=t(e?"resume":"pause");function o(){if(!s){if(!r){a.cancelAll();return}if(e){a.resumeAll();return}a.pauseAll()}}return c("button",{title:n,"aria-label":n,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:o,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},c("g",{fill:"none",fillRule:"evenodd"},c("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),c("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function mh(i){const{i18n:e,doneButtonHandler:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Cl(){return c("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},c("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 gh(i){const{progress:e}=i,{value:t,mode:s,message:r}=e;return c("div",{className:"uppy-StatusBar-content"},c(Cl,null),s==="determinate"?`${Math.round(t*100)}% · `:"",r)}function yh(i){const{numUploads:e,complete:t,totalUploadedSize:s,totalSize:r,totalETA:a,i18n:n}=i,o=e>1;return c("div",{className:"uppy-StatusBar-statusSecondary"},o&&n("filesUploadedOfTotal",{complete:t,smart_count:e}),c("span",{className:"uppy-StatusBar-additionalInfo"},o&&jn(),n("dataUploadedOfTotal",{complete:Yt(s),total:Yt(r)}),jn(),n("xTimeLeft",{time:uh(a)})))}function Tl(i){const{i18n:e,complete:t,numUploads:s}=i;return c("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:s}))}function vh(i){const{i18n:e,newFiles:t,startUpload:s}=i,r=Le("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return c("div",{className:"uppy-StatusBar-statusSecondary"},c("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),c("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:s},e("upload")))}function bh(i){const{i18n:e,supportsUploadProgress:t,totalProgress:s,showProgressDetail
6s:r,isUploadStarted:a,isAllComplete:n,isAllPaused:o,newFiles:l,numUploads:u,complete:h,totalUploadedSize:d,totalSize:p,totalETA:f,startUpload:m}=i,y=l&&a;if(!a||n)return null;const g=e(o?"paused":"uploading");function b(){return!o&&!y&&r?t?c(yh,{numUploads:u,complete:h,totalUploadedSize:d,totalSize:p,totalETA:f,i18n:e}):c(Tl,{i18n:e,complete:h,numUploads:u}):null}return c("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},o?null:c(Cl,null),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t?`${g}: ${s}%`:g),b(),y?c(vh,{i18n:e,newFiles:l,startUpload:m}):null))}function wh(i){const{i18n:e}=i;return c("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},c("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function _h(i){const{error:e,i18n:t,complete:s,numUploads:r}=i;function a(){const n=`${t("uploadFailed")} 7 8 ${e}`;alert(n)}return c("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},c("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"})),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),c("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:a,type:"button"},"?")),c(Tl,{i18n:t,complete:s,numUploads:r})))}const{STATE_ERROR:Hn,STATE_WAITING:qn,STATE_PREPROCESSING:Or,STATE_UPLOADING:Fs,STATE_POSTPROCESSING:Ar,STATE_COMPLETE:Cs}=We;function El(i){const{newFiles:e,allowNewUpload:t,isUploadInProgress:s,isAllPaused:r,resumableUploads:a,error:n,hideUploadButton:o,hidePauseResumeButton:l,hideCancelButton:u,hideRetryButton:h,recoveredState:d,uploadState:p,totalProgress:f,files:m,supportsUploadProgress:y,hideAfterFinish:g,isSomeGhost:b,doneButtonHandler:w,isUploadStarted:S,i18n:T,startUpload:O,uppy:v,isAllComplete:_,showProgressDetails:P,numUploads:E,complete:N,totalSize:le,totalETA:Q,totalUploadedSize:k}=i;function M(){switch(p){case Ar:case Or:{const ys=Er(m);return ys.mode==="determinate"?ys.value*100:f}case Hn:return null;case Fs:return y?f:null;default:return f}}function D(){switch(p){case Ar:case Or:{const{mode:ys}=Er(m);return ys==="indeterminate"}case Fs:return!y;default:return!1}}function te(){if(d)return!1;switch(p){case qn:return o||e===0;case Cs:return g;default:return!1}}const ge=M(),ze=te(),ye=ge??100,Ke=!n&&e&&!s&&!r&&t&&!o,fs=!u&&p!==qn&&p!==Cs,ms=a&&!l&&p===Fs,gs=n&&!_&&!h,Js=w&&p===Cs,Zs=Le("uppy-StatusBar-progress",{"is-indeterminate":D()}),Du=Le("uppy-StatusBar",`is-${p}`,{"has-ghosts":b});return c("div",{className:Du,"aria-hidden":ze},c("div",{className:Zs,style:{width:`${ye}%`},role:"progressbar","aria-label":`${ye}%`,"aria-valuetext":`${ye}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ge}),(()=>{switch(p){case Or:case Ar:return c(gh,{progress:Er(m)});case Cs:return c(wh,{i18n:T});case Hn:return c(_h,{error:n,i18n:T,numUploads:E,complete:N});case Fs:return c(bh,{i18n:T,supportsUploadProgress:y,totalProgress:f,showProgressDetails:P,isUploadStarted:S,isAllComplete:_,isAllPaused:r,newFiles:e,numUploads:E,complete:N,totalUploadedSize:k,totalSize:le,totalETA:Q,startUpload:O});default:return null}})(),c("div",{className:"uppy-StatusBar-actions"},d||Ke?c(hh,{newFiles:e,isUploadStarted:S,recoveredState:d,i18n:T,isSomeGhost:b,startUpload:O,uploadState:p}):null,gs?c(ch,{i18n:T,uppy:v}):null,ms?c(fh,{isAllPaused:r,i18n:T,isAllComplete:_,resumableUploads:a,uppy:v}):null,fs?c(ph,{i18n:T,uppy:v}):null,Js?c(mh,{i18n:T,doneButtonHandler:w}):null))}El.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetail
8s:void 0};const Sh={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 j(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Ph=0;function di(i){return"__private_"+Ph+++"_"+i}const Fh={version:"3.3.3"},Ch=2e3,Th=2e3;function Eh(i,e,t,s){if(i)return We.STATE_ERROR;if(e)return We.STATE_COMPLETE;if(t)return We.STATE_WAITING;let r=We.STATE_WAITING;const a=Object.keys(s);for(let n=0;n<a.length;n++){const{progress:o}=s[a[n]];if(o.uploadStarted&&!o.uploadComplete)return We.STATE_UPLOADING;o.preprocess&&(r=We.STATE_PREPROCESSING),o.postprocess&&r!==We.STATE_PREPROCESSING&&(r=We.STATE_POSTPROCESSING)}return r}const Oh={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Ue=di("lastUpdateTime"),Ne=di("previousUploadedBytes"),dt=di("previousSpeed"),Pe=di("previousETA"),xr=di("computeSmoothETA"),wi=di("onUploadStart");class Ol extends _t{constructor(e,t){super(e,{...Oh,...t}),Object.defineProperty(this,xr,{value:Ah}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,Pe,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,wi,{writable:!0,value:()=>{const{recoveredState:s}=this.uppy.getState();if(j(this,dt)[dt]=null,j(this,Pe)[Pe]=null,s){j(this,Ne)[Ne]=Object.values(s.files).reduce((r,a)=>{let{progress:n}=a;return r+n.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}j(this,Ue)[Ue]=performance.now(),j(this,Ne)[Ne]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Sh,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:s,allowNewUpload:r,totalProgress:a,error:n,recoveredState:o}=e,{newFiles:l,startedFiles:u,completeFiles:h,isUploadStarted:d,isAllComplete:p,isAllErrored:f,isAllPaused:m,isUploadInProgress:y,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),b=o?Object.values(s):l,w=!!t.resumableUploads,S=t.uploadProgress!==!1;let T=0,O=0;u.forEach(_=>{T+=_.progress.bytesTotal||0,O+=_.progress.bytesUploaded||0});const v=j(this,xr)[xr]({uploaded:O,total:T,remaining:T-O});return El({error:n,uploadState:Eh(n,p,o,e.files||{}),allowNewUpload:r,totalProgress:a,totalSize:T,totalUploadedSize:O,isAllComplete:!1,isAllPaused:m,isUploadStarted:d,isUploadInProgress:y,isSomeGhost:g,recoveredState:o,complete:h.length,newFiles:b.length,numUploads:u.length,totalETA:v,files:s,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:w,supportsUploadProgress:S,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;Fl(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",j(this,wi)[wi]),j(this,Ue)[Ue]=performance.now(),j(this,Ne)[Ne]=this.uppy.getFiles().reduce((t,s)=>t+s.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",j(this,wi)[wi])}}function Ah(i){var e,t;if(i.total===0||i.remaining===0)return 0;(t=(e=j(this,Ue))[Ue])!=null||(e[Ue]=performance.now());const s=performance.now()-j(this,Ue)[Ue];if(s===0){var r;return Math.round(((r=j(this,Pe)[Pe])!=null?r:0)/100)/10}const a=i.uploaded-j(this,Ne)[Ne];if(j(this,Ne)[Ne]=i.uploaded,a<=0){var n;return Math.round(((n=j(this,Pe)[Pe])!=null?n:0)/100)/10}const o=a/s,l=j(this,dt)[dt]==null?o:$n(o,j(this,dt)[dt],Ch,s);j(this,dt)[dt]=l;const u=i.remaining/l,h=Math.max(j(this,Pe)[Pe]-s,0),d=j(this,Pe)[Pe]==null?u:$n(u,h,Th,s);return j(this,Pe)[Pe]=d,j(this,Ue)[Ue]=performance.now(),Math.round(d/100)/10}Ol.VERSION=Fh.version;const Wn=300;class xh extends Ge{constructor(){super(...arguments),this.ref=Kd()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Wn)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Wn)}render(){const{children:e}=this.props;return c("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function Uh(i,e){return Object.assign(i,e)}function kh(i,e){var t;return(t=i?.key)!=null?t:e}function Rh(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=s=>{i.refs[e]=s})}function _i(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const s=kh(i[t],t.toString(36));e[s]=i[t]}return e}function Mh(i,e){i=i||{},e=e||{};const t=n=>e.hasOwnProperty(n)?e[n]:i[n],s={};let r=[];for(const n in i)e.hasOwnProperty(n)?r.length&&(s[n]=r,r=[]):r.push(n);const a={};for(const n in e){if(s.hasOwnProperty(n))for(let o=0;o<s[n].length;o++){const l=s[n][o];a[s[n][o]]=t(l)}a[n]=t(n)}for(let n=0;n<r.length;n++)a[r[n]]=t(r[n]);return a}const Dh=i=>i;class Al extends Ge{constructor(e,t){super(e,t),this.refs={},this.state={children:_i(gt(gt(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=_i(gt(e.children)||[]),s=this.state.children;this.setState(a=>({children:Mh(a.children,t)}));let r;for(r in t)if(t.hasOwnProperty(r)){const a=s&&s.hasOwnProperty(r);t[r]&&a&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):t[r]&&!a&&!this.currentlyTransitioningKeys[r]&&this.keysToEnter.push(r)}for(r in s)if(s.hasOwnProperty(r)){const a=t&&t.hasOwnProperty(r);s[r]&&!a&&!this.currentlyTransitioningKeys[r]&&this.keysToLeave.push(r)}}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);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=_i(gt(this.props.children)||[]);(!s||!s.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=_i(gt(this.props.children)||[]);(!s||!s.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const s=this.refs[e];s!=null&&s.componentWillLeave?s.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const s=this.refs[e];s!=null&&s.componentDidLeave&&s.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const r=_i(gt(this.props.children)||[]);if(r&&r.hasOwnProperty(e))this.performEnter(e);else{const a=Uh({},this.state.children);delete a[e],this.setState({children:a})}}render(e,t){let{childFactory:s,transitionLeave:r,transitionName:a,transitionAppear:n,transitionEnter:o,transitionLeaveTimeout:l,transitionEnterTimeout:u,transitionAppearTimeout:h,component:d,...p}=e,{children:f}=t;const m=Object.entries(f).map(y=>{let[g,b]=y;if(!b)return;const w=Rh(this,g);return Sl(s(b),{ref:w,key:g})}
8).filter(Boolean);return c(d,p,m)}}Al.defaultProps={component:"span",childFactory:Dh};const Nh={version:"3.1.0"};class xl extends _t{constructor(e,t){super(e,t),this.render=s=>c("div",{className:"uppy uppy-Informer"},c(Al,null,s.info.map(r=>c(xh,{key:r.message},c("p",{role:"alert"},r.message," ",r.details&&c("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message} 9 10 ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}xl.VERSION=Nh.version;const Ih=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function Bh(i,e,t){var s,r;const a=Ih.exec(i),n=(s=(r=e.mimeType)!=null?r:a?.[1])!=null?s:"plain/text";let o;if(a?.[2]!=null){const l=atob(decodeURIComponent(a[3])),u=new Uint8Array(l.length);for(let h=0;h<l.length;h++)u[h]=l.charCodeAt(h);o=[u]}else a?.[3]!=null&&(o=[decodeURIComponent(a[3])]);return new Blob(o,{type:n})}function Vn(i){return i.startsWith("blob:")}function Gn(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function I(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Ul=typeof self<"u"?self:global;const as=typeof navigator<"u",Lh=as&&typeof HTMLImageElement>"u",Xn=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),kl=Ul.Buffer,Rl=!!kl,$h=i=>i!==void 0;function Ml(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter($h).length===0)}function ee(i){let e=new Error(i);throw delete e.stack,e}function Yn(i){let e=(function(t){let s=0;return t.ifd0.enabled&&(s+=1024),t.exif.enabled&&(s+=2048),t.makerNote&&(s+=2048),t.userComment&&(s+=1024),t.gps.enabled&&(s+=512),t.interop.enabled&&(s+=100),t.ifd1.enabled&&(s+=1024),s+2048})(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const Ur=i=>String.fromCharCode.apply(null,i),Kn=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;let ns=class ii{static from(e,t){return e instanceof this&&e.le===t?e:new ii(e,void 0,void 0,t)}constructor(e,t=0,s,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){s===void 0&&(s=e.byteLength-t);let a=new DataView(e,t,s);this._swapDataView(a)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof ii){s===void 0&&(s=e.byteLength-t),(t+=e.byteOffset)+s>e.byteOffset+e.byteLength&&ee("Creating view outside of available memory in ArrayBuffer");let a=new DataView(e.buffer,t,s);this._swapDataView(a)}else if(typeof e=="number"){let a=new DataView(new ArrayBuffer(e));this._swapDataView(a)}else ee("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,s=ii){return e instanceof DataView||e instanceof ii?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ee("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new s(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new ii(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 r=this.getUint8Array(e,t),Kn?Kn.decode(r):Rl?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Ur(r)));var r}getLatin1String(e=0,t=this.byteLength){let s=this.getUint8Array(e,t);return Ur(s)}getUnicodeString(e=0,t=this.byteLength){const s=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)s.push(this.getUint16(e+r));return Ur(s)}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)}
10getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,s){switch(t){case 1:return this.getUint8(e,s);case 2:return this.getUint16(e,s);case 4:return this.getUint32(e,s);case 8:return this.getUint64&&this.getUint64(e,s)}}getUint(e,t,s){switch(t){case 8:return this.getUint8(e,s);case 16:return this.getUint16(e,s);case 32:return this.getUint32(e,s);case 64:return this.getUint64&&this.getUint64(e,s)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function ba(i,e){ee(`${i} '${e}' was not loaded, try using full build of exifr.`)}class Va extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||ba(this.kind,e),t&&(e in t||(function(s,r){ee(`Unknown ${s} '${r}'.`)})(this.kind,e),t[e].enabled||ba(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Dl=new Va("file parser"),Ie=new Va("segment parser"),Ga=new Va("file reader");let zh=Ul.fetch;function Qn(i,e){return(t=i).startsWith("data:")||t.length>1e4?_a(i,e,"base64"):Xn&&i.includes("://")?wa(i,e,"url",Jn):Xn?_a(i,e,"fs"):as?wa(i,e,"url",Jn):void ee("Invalid input argument");var t}async function wa(i,e,t,s){return Ga.has(t)?_a(i,e,t):s?(async function(r,a){let n=await a(r);return new ns(n)})(i,s):void ee(`Parser ${t} is not loaded`)}async function _a(i,e,t){let s=new(Ga.get(t))(i,e);return await s.read(),s}const Jn=i=>zh(i).then((e=>e.arrayBuffer())),Sa=i=>new Promise(((e,t)=>{let s=new FileReader;s.onloadend=()=>e(s.result||new ArrayBuffer),s.onerror=t,s.readAsArrayBuffer(i)})),Xa=new Map,jh=new Map,Hh=new Map,Ts=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Nl=["jfif","xmp","icc","iptc","ihdr"],Pa=["tiff",...Nl],J=["ifd0","ifd1","exif","gps","interop"],Es=[...Pa,...J],Os=["makerNote","userComment"],Il=["translateKeys","translateValues","reviveValues","multiSegment"],As=[...Il,"sanitize","mergeOutput","silentErrors"];class Bl{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}let Si=class extends Bl{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,s,r){if(super(),I(this,"enabled",!1),I(this,"skip",new Set),I(this,"pick",
vendor: 6,431 bytes, line 10
10new Set),I(this,"deps",new Set),I(this,"translateKeys",!1),I(this,"translateValues",!1),I(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=J.includes(e),this.canBeFiltered&&(this.dict=Xa.get(e)),s!==void 0)if(Array.isArray(s))this.parse=this.enabled=!0,this.canBeFiltered&&s.length>0&&this.translateTagSet(s,this.pick);else if(typeof s=="object"){if(this.enabled=!0,this.parse=s.parse!==!1,this.canBeFiltered){let{pick:a,skip:n}=s;a&&a.length>0&&this.translateTagSet(a,this.pick),n&&n.length>0&&this.translateTagSet(n,this.skip)}this.applyInheritables(s)}else s===!0||s===!1?this.parse=this.enabled=s:ee(`Invalid options argument: ${s}`)}applyInheritables(e){let t,s;for(t of Il)s=e[t],s!==void 0&&(this[t]=s)}translateTagSet(e,t){if(this.dict){let s,r,{tagKeys:a,tagValues:n}=this.dict;for(s of e)typeof s=="string"?(r=n.indexOf(s),r===-1&&(r=a.indexOf(Number(s))),r!==-1&&t.add(Number(a[r]))):t.add(s)}else for(let s of e)t.add(s)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Hs(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Hs(this.pick,this.deps)}};var ce={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},Zn=new Map;class Ya extends Bl{static useCached(e){let t=Zn.get(e);return t!==void 0||(t=new this(e),Zn.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):ee(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=as?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Ts)this[e]=ce[e];for(e of As)this[e]=ce[e];for(e of Os)this[e]=ce[e];for(e of Es)this[e]=new Si(e,ce[e],void 0,this)}setupFromTrue(){let e;for(e of Ts)this[e]=ce[e];for(e of As)this[e]=ce[e];for(e of Os)this[e]=!0;for(e of Es)this[e]=new Si(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Ts)this[t]=ce[t];for(t of As)this[t]=ce[t];for(t of Os)this[t]=ce[t];for(t of Es)this[t]=new Si(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,J)}setupFromObject(e){let t;for(t of(J.ifd0=J.ifd0||J.image,J.ifd1=J.ifd1||J.thumbnail,Object.assign(this,e),Ts))this[t]=kr(e[t],ce[t]);for(t of As)this[t]=kr(e[t],ce[t]);for(t of Os)this[t]=kr(e[t],ce[t]);for(t of Pa)this[t]=new Si(t,ce[t],e[t],this);for(t of J)this[t]=new Si(t,ce[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,J,Es),e.tiff===!0?this.batchEnableWithBool(J,!0):e.tiff===!1?this.batchEnableWithUserValue(J,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,J):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,J)}batchEnableWithBool(e,t){for(let s of e)this[s].enabled=t}batchEnableWithUserValue(e,t){for(let s of e){let r=t[s];this[s].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,s,r=s){if(e&&e.length){for(let n of r)this[n].enabled=!1;let a=eo(e,s);for(let[n,o]of a)Hs(this[n].pick,o),this[n].enabled=!0}else if(t&&t.length){let a=eo(t,s);for(let[n,o]of a)Hs(this[n].skip,o)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:s,iptc:r,icc:a}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),s.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),a.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:s,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),s.needed&&e.deps.add(34853),this.tiff.enabled=J.some((a=>this[a].enabled===!0))||this.makerNote||this.userComment;for(let a of J)this[a].finalizeFilters()}get onlyTiff(){return!Nl.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Pa)this[e].enabled&&!Ie.has(e)&&ba("segment parser",e)}}function eo(i,e){let t,s,r,a,n=[];for(r of e){for(a of(t=Xa.get(r),s=[],t))(i.includes(a[0])||i.includes(a[1]))&&s.push(a[0]);s.length&&n.push([r,s])}return n}function kr(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Hs(i,e){for(let t of e)i.add(t)}I(Ya,"default",ce);class qh{constructor(e){I(this,"parsers",{}),I(this,"output",{}),I(this,"errors",[]),I(this,"pushToErrors",(t=>this.errors.push(t))),this.options=Ya.useCached(e)}async read(e){this.file=await(function(t,s){return typeof t=="string"?Qn(t,s):as&&!Lh&&t instanceof HTMLImageElement?Qn(t.src,s):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new ns(t):as&&t instanceof Blob?wa(t,s,"blob",Sa):void ee("Invalid input argument")})(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[s,r]of Dl)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[s]=!0;this.file.close&&this.file.close(),ee("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),Ml(s=e)?void 0:s;var s}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async s=>{let r=await s.parse();s.assignToOutput(e,r)}));this.options.silentErrors&&(t=t.map((s=>s.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,s=Ie.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let a=await this.fileParser.ensureSegmentChunk(r),n=this.parsers.tiff=new s(a,e,t),o=await n.extractThumbnail();return t.close&&t.close(),o}}class ri{static findPosition(e,t){let s=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,s):this.headerLength,a=t+r,n=s-r;return{offset:t,length:s,headerLength:r,start:a,size:n,end:a+n}}static parse(e,t={}){return new this(e,new Ya({[this.type]:t}),e).parse()}
10normalizeInput(e){return e instanceof ns?e:new ns(e)}constructor(e,t={},s){I(this,"errors",[]),I(this,"raw",new Map),I(this,"handleError",(r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)})),this.chunk=this.normalizeInput(e),this.file=s,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[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 s=Hh.get(t),r=jh.get(t),a=Xa.get(t),n=this.options[t],o=n.reviveValues&&!!s,l=n.translateValues&&!!r,u=n.translateKeys&&!!a,h={};for(let[d,p]of e)o&&s.has(d)?p=s.get(d)(p):l&&r.has(d)&&(p=this.translateValue(p,r.get(d))),u&&a.has(d)&&(d=a.get(d)||d),h[d]=p;return h}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,s){if(this.globalOptions.mergeOutput)return Object.assign(e,s);e[t]?Object.assign(e[t],s):e[t]=s}}I(ri,"headerLength",4),I(ri,"type",void 0),I(ri,"multiSegment",!1),I(ri,"canHandle",(()=>!1));function Wh(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function Vh(i){return i>=224&&i<=239}function Gh(i,e,t){for(let[s,r]of Ie)if(r.canHandle(i,e,t))return s}class to extends class{constructor(e,t,s){I(this,"errors",[]),I(this,"ensureSegmentChunk",(async r=>{let a=r.start,n=r.size||65536;if(this.file.chunked)if(this.file.available(a,n))r.chunk=this.file.subarray(a,n);else try{r.chunk=await this.file.readChunk(a,n)}catch(o){ee(`Couldn't read segment: ${JSON.stringify(r)}. ${o.message}`)}else this.file.byteLength>a+n?r.chunk=this.file.subarray(a,n):r.size===void 0?r.chunk=this.file.subarray(a):ee("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=s}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let s=new(Ie.get(e))(t,this.options,this.file);return this.parsers[e]=s}createParsers(e){for(let t of e){let{type:s,chunk:r}=t,a=this.options[s];if(a&&a.enabled){let n=this.parsers[s];n&&n.append||n||this.createParser(s,r)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),I(this,"appSegments",[]),I(this,"jpegSegments",[]),I(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Ie.keyList())):(e=e===void 0?Ie.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&Ie.has(t))),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:s,findAll:r,wanted:a,remaining:n}=this;if(!r&&this.file.chunked&&(r=Array.from(a).some((o=>{let l=Ie.get(o),u=this.options[o];return l.multiSegment&&u.multiSegment})),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,s.byteLength),!this.options.onlyTiff&&s.chunked){let o=!1;for(;n.size>0&&!o&&(s.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=s,u=this.appSegments.some((h=>!this.file.available(h.offset||h.start,h.length||h.size)));if(o=e>l&&!u?!await s.readNextChunk(e):!await s.readNextChunk(l),(e=this.findAppSegmentsInRange(e,s.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let s,r,a,n,o,l,{file:u,findAll:h,wanted:d,remaining:p,options:f}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(s=u.getUint8(e+1),Vh(s)){if(r=u.getUint16(e+2),a=Gh(u,e,r),a&&d.has(a)&&(n=Ie.get(a),o=n.findPosition(u,e),l=f[a],o.type=a,this.appSegments.push(o),!h&&(n.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||p.delete(a)):p.delete(a),p.size===0)))break;f.recordUnknownSegments&&(o=ri.findPosition(u,e),o.marker=s,this.unknownSegments.push(o)),e+=r+1}else if(Wh(s)){if(r=u.getUint16(e+2),s===218&&f.stopAfterSos!==!1)return;f.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:s}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,s){let r,a,n,o=new Map;for(let l=0;l<t.length;l++)r=t[l],a=r[s],o.has(a)?n=o.get(a):o.set(a,n=[]),n.push(r);return Array.from(o)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,s])=>{let r=Ie.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(s)}:s[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}I(to,"type","jpeg"),Dl.set("jpeg",to);const Xh=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Yh extends ri{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,s=new Map){let{pick:r,skip:a}=this.options[t];r=new Set(r);let n=r.size>0,o=a.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let h=this.chunk.getUint16(e);
vendor: 9,423 bytes, lines 10-11
10if(n){if(r.has(h)&&(s.set(h,this.parseTag(e,h,t)),r.delete(h),r.size===0))break}else!o&&a.has(h)||s.set(h,this.parseTag(e,h,t));e+=12}return s}parseTag(e,t,s){let{chunk:r}=this,a=r.getUint16(e+2),n=r.getUint32(e+4),o=Xh[a];if(o*n<=4?e+=8:e=r.getUint32(e+8),(a<1||a>13)&&ee(`Invalid TIFF value type. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${a}, offset ${e}`),e>r.byteLength&&ee(`Invalid TIFF value offset. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${a}, offset ${e} is outside of chunk size ${r.byteLength}`),a===1)return r.getUint8Array(e,n);if(a===2)return(l=(function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u})(l=r.getString(e,n)).trim())===""?void 0:l;var l;if(a===7)return r.getUint8Array(e,n);if(n===1)return this.parseTagValue(a,e);{let u=new((function(d){switch(d){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(a))(n),h=o;for(let d=0;d<n;d++)u[d]=this.parseTagValue(a,e),e+=h;return u}}parseTagValue(e,t){let{chunk:s}=this;switch(e){case 1:return s.getUint8(t);case 3:return s.getUint16(t);case 4:return s.getUint32(t);case 5:return s.getUint32(t)/s.getUint32(t+4);case 6:return s.getInt8(t);case 8:return s.getInt16(t);case 9:return s.getInt32(t);case 10:return s.getInt32(t)/s.getInt32(t+4);case 11:return s.getFloat(t);case 12:return s.getDouble(t);case 13:return s.getUint32(t);default:ee(`Invalid tiff type ${e}`)}}}class Rr extends Yh{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}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 t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){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 s=new Map;return this[t]=s,this.parseTags(e,t,s),s}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ee("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ee(`IFD0 offset points to outside of file. 11this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Yn(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Yn(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let s=e.get(t);s&&s.length===1&&e.set(t,s[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",io(...e.get(2),e.get(1))),e.set("longitude",io(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))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),this.ifd1===void 0)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,s,r={};for(t of J)if(e=this[t],!Ml(e))if(s=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,s)}else r[t]=s;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[s,r]of Object.entries(t))this.assignObjectToOutput(e,s,r)}}function io(i,e,t,s){var r=i+e/60+t/3600;return s!=="S"&&s!=="W"||(r*=-1),r}I(Rr,"type","tiff"),I(Rr,"headerLength",10),Ie.set("tiff",Rr);const Ka={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Ka,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Ka,{tiff:!1,ifd1:!0,mergeOutput:!1});const Kh=Object.assign({},Ka,{firstChunkSize:4e4,ifd0:[274]});async function Qh(i){let e=new qh(Kh);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const Jh=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}});let Wi=!0,Vi=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,s]=e;Wi=Number(t)+.1*Number(s)<13.4,Vi=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Wi=Vi=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Wi=Vi=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Wi=Vi=Number(e)<77}}async function Zh(i){let e=await Qh(i);return Object.assign({canvas:Wi,css:Vi},Jh[e])}class ec extends ns{constructor(...e){super(...e),I(this,"ranges",new tc),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,s){if(e===0&&this.byteLength===0&&s){let r=new DataView(s.buffer||s,s.byteOffset,s.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:a}=this._extend(r);this._swapDataView(a)}}}_extend(e){let t;t=Rl?kl.allocUnsafe(e):new Uint8Array(e);let s=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:s}}subarray(e,t,s=!1){return t=t||this._lengthToEnd(e),s&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,s=!1){s&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}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 tc{constructor(){I(this,"list",[])}get length(){return this.list.length}add(e,t,s=0){let r=e+t,a=this.list.filter((n=>so(e,n.offset,r)||so(e,n.end,r)));if(a.length>0){e=Math.min(e,...a.map((o=>o.offset))),r=Math.max(r,...a.map((o=>o.end))),t=r-e;let n=a.shift();n.offset=e,n.length=t,n.end=r,this.list=this.list.filter((o=>!a.includes(o)))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let s=e+t;return this.list.some((r=>r.offset<=e&&s<=r.end))}}function so(i,e,t){return i<=e&&e<=t}class ic extends ec{constructor(e,t){super(0),I(this,"chunksRead",0),this.input=e,this.options=t}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,s=await this.readChunk(e,t);return!!s&&s.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Ga.set("blob",class extends ic{async readWhole(){this.chunked=!1;let i=await Sa(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}
11async _readChunk(i,e){let t=e?i+e:void 0,s=this.input.slice(i,t),r=await Sa(s);return this.set(r,i,!0)}});const sc={strings:{generatingThumbnails:"Generating thumbnails..."}},rc={version:"3.1.0"};function ac(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(s){if(s.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(s=>{i.toBlob(s,e,t)}).then(s=>{if(s===null)throw new Error("cannot read image, probably an svg with external resources");return s}):Promise.resolve().then(()=>Bh(i.toDataURL(e,t),{})).then(s=>{if(s===null)throw new Error("could not extract blob, probably an old browser");return s})}function nc(i,e){let t=i.width,s=i.height;(e.deg===90||e.deg===270)&&(t=i.height,s=i.width);const r=document.createElement("canvas");r.width=t,r.height=s;const a=r.getContext("2d");return a.translate(t/2,s/2),e.canvas&&(a.rotate(e.rad),a.scale(e.scaleX,e.scaleY)),a.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function oc(i){const e=i.width/i.height,t=5e6,s=4096;let r=Math.floor(Math.sqrt(t*e)),a=Math.floor(t/Math.sqrt(t*e));if(r>s&&(r=s,a=Math.round(r/e)),a>s&&(a=s,r=Math.round(e*a)),i.width>r){const n=document.createElement("canvas");return n.width=r,n.height=a,n.getContext("2d").drawImage(i,0,0,r,a),n}return i}const lc={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Ll extends _t{constructor(e,t){if(super(e,{...lc,...t}),this.onFileAdded=s=>{!s.preview&&s.data&&Gn(s.type)&&!s.isRemote&&this.addToQueue(s.id)},this.onCancelRequest=s=>{const r=this.queue.indexOf(s.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=s=>{const r=this.queue.indexOf(s.id);r!==-1&&this.queue.splice(r,1),s.preview&&Vn(s.preview)&&URL.revokeObjectURL(s.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Vn(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=s=>{s.forEach(a=>{const n=this.uppy.getFile(a);
11this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const r=()=>{s.forEach(a=>{const n=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",n)})};return new Promise(a=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),a()}):(r(),a())})},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,this.defaultLocale=sc,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,s){const r=URL.createObjectURL(e.data),a=new Promise((o,l)=>{const u=new Image;u.src=r,u.addEventListener("load",()=>{URL.revokeObjectURL(r),o(u)}),u.addEventListener("error",h=>{URL.revokeObjectURL(r),l(h.error||new Error("Could not create thumbnail"))})}),n=Zh(e.data).catch(()=>1);return Promise.all([a,n]).then(o=>{let[l,u]=o;const h=this.getProportionalDimensions(l,t,s,u.deg),d=nc(l,u),p=this.resizeImage(d,h.width,h.height);return ac(p,this.thumbnailType,80)}).then(o=>URL.createObjectURL(o))}getProportionalDimensions(e,t,s,r){let a=e.width/e.height;return(r===90||r===270)&&(a=e.height/e.width),t!=null?{width:t,height:Math.round(t/a)}:s!=null?{width:Math.round(s*a),height:s}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/a)}}resizeImage(e,t,s){let r=oc(e),a=Math.ceil(Math.log2(r.width/t));a<1&&(a=1);let n=t*2**(a-1),o=s*2**(a-1);const l=2;for(;a--;){const u=document.createElement("canvas");u.width=n,u.height=o,u.getContext("2d").drawImage(r,0,0,n,o),r=u,n=Math.round(n/l),o=Math.round(o/l)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&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 Gn(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("thumbnail:request",this.onFileAdded),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("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}Ll.VERSION=rc.version;function ro(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Pl(i)?[i]:null}const Zi=Array.from;function $l(i,e,t,s){let{onSuccess:r}=s;i.readEntries(a=>{const n=[...e,...a];a.length?queueMicrotask(()=>{$l(i,n,t,{onSuccess:r})}):r(n)},a=>{t(a),r(e)})}function zl(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,s)=>i.file(t,s))},async*values(){const t=i.createReader();yield*await new Promise(r=>{$l(t,[],e,{onSuccess:a=>r(a.map(n=>zl(n,e)))})})},isSameEntry:void 0}}function jl(i,e,t){try{return t===void 0&&(t=void 0),(async function*(){const s=()=>`${e}/${i.name}`;if(i.kind==="file"){const r=await i.getFile();r!=null?(r.relativePath=e?s():null,yield r):t!=null&&(yield t)}else if(i.kind==="directory")for await(const r of i.values())yield*jl(r,e?s():i.name);else t!=null&&(yield t)})()}catch(s){return Promise.reject(s)}}async function*uc(i,e){const t=await Promise.all(Array.from(i.items,async s=>{var r;let a;const n=()=>typeof s.getAsEntry=="function"?s.getAsEntry():s.webkitGetAsEntry();return(r=a)!=null||(a=zl(n(),e)),{fileSystemHandle:a,lastResortFile:s.getAsFile()}}));for(const{lastResortFile:s,fileSystemHandle:r}
11of t)if(r!=null)try{yield*jl(r,"",s)}catch(a){s!=null?yield s:e(a)}else s!=null&&(yield s)}function dc(i){const e=Zi(i.files);return Promise.resolve(e)}async function hc(i,e){var t;const s=(t=e?.logDropError)!=null?t:Function.prototype;try{const r=[];for await(const a of uc(i,s))r.push(a);return r}catch{return dc(i)}}var Mr={exports:{}},ao;function cc(){return ao||(ao=1,(function(i){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function r(l,u,h){this.fn=l,this.context=u,this.once=h||!1}function a(l,u,h,d,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new r(h,d||l,p),m=t?t+u:u;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],f]:l._events[m].push(f):(l._events[m]=f,l._eventsCount++),l}function n(l,u){--l._eventsCount===0?l._events=new s:delete l._events[u]}function o(){this._events=new s,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,d;if(this._eventsCount===0)return u;for(d in h=this._events)e.call(h,d)&&u.push(t?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=t?t+u:u,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,f=d.length,m=new Array(f);p<f;p++)m[p]=d[p].fn;return m},o.prototype.listenerCount=function(u){var h=t?t+u:u,d=this._events[h];return d?d.fn?1:d.length:0},o.prototype.emit=function(u,h,d,p,f,m){var y=t?t+u:u;if(!this._events[y])return!1;var g=this._events[y],b=arguments.length,w,S;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),b){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,h),!0;case 3:return g.fn.call(g.context,h,d),!0;case 4:return g.fn.call(g.context,h,d,p),!0;case 5:return g.fn.call(g.context,h,d,p,f),!0;case 6:return g.fn.call(g.context,h,d,p,f,m),!0}for(S=1,w=new Array(b-1);S<b;S++)w[S-1]=arguments[S];g.fn.apply(g.context,w)}else{var T=g.length,O;for(S=0;S<T;S++)switch(g[S].once&&this.removeListener(u,g[S].fn,void 0,!0),b){case 1:g[S].fn.call(g[S].context);break;case 2:g[S].fn.call(g[S].context,h);break;case 3:g[S].fn.call(g[S].context,h,d);break;case 4:g[S].fn.call(g[S].context,h,d,p);break;default:if(!w)for(O=1,w=new Array(b-1);O<b;O++)w[O-1]=arguments[O];g[S].fn.apply(g[S].context,w)}}return!0},o.prototype.on=function(u,h,d){return a(this,u,h,d,!1)},o.prototype.once=function(u,h,d){return a(this,u,h,d,!0)},o.prototype.removeListener=function(u,h,d,p){var f=t?t+u:u;if(!this._events[f])return this;if(!h)return n(this,f),this;var m=this._events[f];if(m.fn)m.fn===h&&(!p||m.once)&&(!d||m.context===d)&&n(this,f);else{for(var y=0,g=[],b=m.length;y<b;y++)(m[y].fn!==h||p&&!m[y].once||d&&m[y].context!==d)&&g.push(m[y]);g.length?this._events[f]=g.length===1?g[0]:g:n(this,f)}return this},o.prototype.removeAllListeners=function(u){var h;return u?(h=t?t+u:u,this._events[h]&&n(this,h)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,i.exports=o})(Mr)),Mr.exports}cc();var os,q,Dr,no,ls=0,Hl=[],V=B,oo=V.__b,lo=V.__r,uo=V.diffed,ho=V.__c,co=V.unmount,po=V.__;function Qa(i,e){V.__h&&V.__h(q,i,ls||e),ls=0;var t=q.__H||(q.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function qs(i){return ls=1,pc(Wl,i)}function pc(i,e,t){var s=Qa(os++,2);if(s.t=i,!s.__c&&(s.__=[Wl(void 0,e),function(o){var l=s.__N?s.__N[0]:s.__[0],u=s.t(l,o);l!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=q,!q.__f)){var r=function(o,l,u){if(!s.__c.__H)return!0;var h=s.__c.__H.__.filter(function(p){return p.__c});if(h.every(function(p){return!p.__N}))return!a||a.call(this,o,l,u);var d=s.__c.props!==o;return h.some(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(d=!0)}}),a&&a.call(this,o,l,u)||d};q.__f=!0;var a=q.shouldComponentUpdate,n=q.componentWillUpdate;q.componentWillUpdate=function(o,l,u){if(this.__e){var h=a;a=void 0,r(o,l,u),a=h}n&&n.call(this,o,l,u)},q.shouldComponentUpdate=r}return s.__N||s.__}function Fa(i,e){var t=Qa(os++,3);!V.__s&&ql(t.__H,e)&&(t.__=i,t.u=e,q.__H.__h.push(t))}function Nr(i){return ls=5,Ja(function(){return{current:i}},[])}function Ja(i,e){var t=Qa(os++,7);return ql(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function fc(i,e){return ls=8,Ja(function(){return i},e)}function mc(){for(var i;i=Hl.shift();){var e=i.__H;if(i.__P&&e)try{e.__h.some(Is),e.__h.some(Ca),e.__h=[]}catch(t){e.__h=[],V.__e(t,i.__v)}}}V.__b=function(i){q=null,oo&&oo(i)},V.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),po&&po(i,e)},V.__r=function(i){lo&&lo(i),os=0;var e=(q=i.__c).__H;e&&(Dr===q?(e.__h=[],q.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.some(Is),e.__h.some(Ca),e.__h=[],os=0)),Dr=q},V.diffed=function(i){uo&&uo(i);var e=i.__c;
11e&&e.__H&&(e.__H.__h.length&&(Hl.push(e)!==1&&no===V.requestAnimationFrame||((no=V.requestAnimationFrame)||gc)(mc)),e.__H.__.some(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Dr=q=null},V.__c=function(i,e){e.some(function(t){try{t.__h.some(Is),t.__h=t.__h.filter(function(s){return!s.__||Ca(s)})}catch(s){e.some(function(r){r.__h&&(r.__h=[])}),e=[],V.__e(s,t.__v)}}),ho&&ho(i,e)},V.unmount=function(i){co&&co(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.some(function(s){try{Is(s)}catch(r){e=r}}),t.__H=void 0,e&&V.__e(e,t.__v))};var fo=typeof requestAnimationFrame=="function";function gc(i){var e,t=function(){clearTimeout(s),fo&&cancelAnimationFrame(e),setTimeout(i)},s=setTimeout(t,35);fo&&(e=requestAnimationFrame(t))}function Is(i){var e=q,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),q=e}function Ca(i){var e=q;i.__c=i.__(),q=e}function ql(i,e){return!i||i.length!==e.length||e.some(function(t,s){return t!==i[s]})}function Wl(i,e){return typeof e=="function"?e(i):e}function Ta(){return Ta=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Ta.apply(this,arguments)}const yc={position:"relative",width:"100%",minHeight:"100%"},vc={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class bc extends Ge{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:s,renderRow:r,overscanCount:a=10,...n}=e;const{offset:o,height:l}=this.state;let u=Math.floor(o/s),h=Math.floor(l/s);a&&(u=Math.max(0,u-u%a),h+=a);const d=u+h+4,p=t.slice(u,d),f={...yc,height:t.length*s}
11,m={...vc,top:u*s};return c("div",Ta({onScroll:this.handleScroll},n),c("div",{role:"presentation",style:f},c("div",{role:"presentation",style:m},p.map(r))))}}function wc(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},c("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 mo=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function _c(i,e){return!!(i===e||mo(i)&&mo(e))}function Sc(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!_c(i[t],e[t]))return!1;return!0}function go(i,e){e===void 0&&(e=Sc);var t=null;function s(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var n=i.apply(this,r);return t={lastResult:n,lastArgs:r,lastThis:this},n}return s.clear=function(){t=null},s}const Vl=['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])'];function Gl(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function yo(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function Pc(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Fc(i){return i.contains(document.activeElement)}function Xl(i,e,t){const s=Gl(t,e),r=Zi(s.querySelectorAll(Vl)),a=r.indexOf(document.activeElement);Fc(s)?i.shiftKey&&a===0?Pc(i,r):!i.shiftKey&&a===r.length-1&&yo(i,r):yo(i,r)}function Cc(i,e,t){e===null||Xl(i,e,t)}var Tc=rl();const Ec=St(Tc);function Oc(){let i=!1;return Ec((t,s)=>{const r=Gl(t,s),a=r.contains(document.activeElement);if(a&&i)return;const n=r.querySelector("[data-uppy-super-focusable]");if(!(a&&!n))if(n)n.focus({preventScroll:!0}),i=!0;else{const o=r.querySelector(Vl);o?.focus({preventScroll:!0}),i=!1}},260)}function Ac(){const i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Ir,vo;function xc(){return vo||(vo=1,Ir=function(e,t){if(e===t)return!0;for(var s in e)if(!(s in t))return!1;for(var s in t)if(e[s]!==t[s])return!1;return!0}),Ir}var Uc=xc();const kc=St(Uc);function Rc(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},c("g",{fill:"#686DE0",fillRule:"evenodd"},c("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"}),c("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"}),c("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function Mc(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}function Dc(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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 9H5v8h10V9zm
111 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function Nc(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}function Ic(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}function Bc(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("g",{fill:"#A7AFB7",fillRule:"nonzero"},c("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"}),c("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function Lc(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}function Za(i){const e={color:"#838999",icon:Bc()};if(!i)return e;const t=i.split("/")[0],s=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:Lc()}:t==="image"?{color:"#686de0",icon:Rc()}:t==="audio"?{color:"#068dbb",icon:Mc()}:t==="video"?{color:"#19af67",icon:Dc()}:t==="application"&&s==="pdf"?{color:"#e25149",icon:Nc()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)!==-1?{color:"#00C469",icon:Ic()}:e}function Yl(i){const{file:e}=i;if(e.preview)return c("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:s}=Za(e.type);return c("div",{className:"uppy-Dashboard-Item-previewIconWrap"},c("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},s),c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},c("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}const $c=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function Kl(i){const{file:e,toggleFileCard:t,i18n:s,metaFields:r}=i,{missingRequiredMetaFields:a}=e;if(!(a!=null&&a.length))return null;const n=a.map(o=>$c(o,r)).join(", ");return c("div",{className:"uppy-Dashboard-Item-errorMessage"},s("missingRequiredMetaFields",{smart_count:a.length,fields:n})," ",c("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},s("editFile")))}function zc(i){const{file:e,i18n:t,toggleFileCard:s,metaFields:r,showLinkToFileUploadResult:a}=i,o=e.preview?"rgba(255, 255, 255, 0.5)":Za(e.type).color;return c("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:o}},a&&e.uploadURL&&c("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},c("span",{hidden:!0},e.meta.name)),c(Yl,{file:e}),c(Kl,{file:e,i18n:t,toggleFileCard:s,metaFields:r}))}function jc(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){
11i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function bo(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function Br(i){return c("div",{className:"uppy-Dashboard-Item-progress"},c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":bo(i),title:bo(i),onClick:()=>jc(i)},i.children))}function xs(i){let{children:e}=i;return c("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function Lr(i){let{progress:e}=i;const t=2*Math.PI*15;return c("g",null,c("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),c("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":t,"stroke-dashoffset":t-t/100*e}))}function Hc(i){if(!i.file.progress.uploadStarted)return null;if(i.isUploaded)return c("div",{className:"uppy-Dashboard-Item-progress"},c("div",{className:"uppy-Dashboard-Item-progressIndicator"},c(xs,null,c("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),c("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"}))));if(!i.recoveredState)return i.error&&!i.hideRetryButton?c(Br,i,c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},c("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),c("path",{d:"M7.9 3H10v2H7.9z"}),c("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),c("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?c(Br,i,c(xs,null,c(Lr,{progress:i.file.progress.percentage}),i.file.isPaused?c("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):c("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},c("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),c("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?c(Br,i,c(xs,null,c(Lr,{progress:i.file.progress.percentage}),c("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"}))):c("div",{className:"uppy-Dashboard-Item-progress"},c("div",{className:"uppy-Dashboard-Item-progressIndicator"},c(xs,null,c(Lr,{progress:i.file.progress.percentage}))))}const $r="...";function Ql(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=$r.length+1)return`${i.slice(0,e-1)}â¦`;const t=e-$r.length,s=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,s)+$r+i.slice(-r)}const qc=i=>{const{author:e,name:t}=i.file.meta;function s(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return c("div",{className:"uppy-Dashboard-Item-name",title:t},Ql(t,s()))},Wc=i=>{var e;const{author:t}=i.file.meta,s=(e=i.file.remote)==null?void 0:e.providerName,r="·";return t?c("div",{className:"uppy-Dashboard-Item-author"},c("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Ql(t.name,13)),s?c(wt,null,` ${r} `,s,` ${r} `):null):null},Vc=i=>i.file.size&&c("div",{className:"uppy-Dashboard-Item-statusSize"},Yt(i.file.size)),Gc=i=>i.file.isGhost&&c("span",null," ⢠",c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:i.toggleAddFilesPanel},i.i18n("reSelect"))),Xc=i=>{let{file:e,onClick:t}=i;return e.error?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function Yc(i){const{file:e}=i;return c("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},c("div",{className:"uppy-Dashboard-Item-fileName"},qc(i),c(Xc,{file:i.file,onClick:()=>alert(i.file.error)})),c("div",{className:"uppy-Dashboard-Item-status"},Wc(i),Vc(i),Gc(i)),c(Kl,{file:i.file,i18n:i.i18n,toggleFileCard:i.toggleFileCard,metaFields:i.metaFields}))}function Kc(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{const s=document.createElement("textarea");s.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),s.value=i,document.body.appendChild(s),s.select();const r=()=>{document.body.removeChild(s),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(s),t()):r()}catch{return document.body.removeChild(s),r()}})}function Qc(i){let{file:e,uploadInProgressOrComplete:t,metaFields:s,canEditFile:r,i18n:a,onClick:n}=i;return!t&&s&&s.length>0||!t&&r(e)?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":a("editFileWithFilename",{file:e.meta.name}),title:a("editFileWithFilename",{file:e.meta.name}),onClick:()=>n()},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},c("g",{fillRule:"evenodd"},c("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"}),c("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),c("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}
11function Jc(i){let{i18n:e,onClick:t,file:s}=i;return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:s.meta.name}),title:e("removeFile",{file:s.meta.name}),onClick:()=>t()},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},c("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"}),c("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"})))}const Zc=(i,e)=>{Kc(e.file.uploadURL,e.i18n("copyLinkToClipboardFallback")).then(()=>{e.uppy.log("Link copied to clipboard."),e.uppy.info(e.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.uppy.log).then(()=>i.target.focus({preventScroll:!0}))};function ep(i){const{i18n:e}=i;return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e("copyLink"),title:e("copyLink"),onClick:t=>Zc(t,i)},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},c("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"})))}function tp(i){const{uppy:e,file:t,uploadInProgressOrComplete:s,canEditFile:r,metaFields:a,showLinkToFileUploadResult:n,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:h}=i;return c("div",{className:"uppy-Dashboard-Item-actionWrapper"},c(Qc,{i18n:l,file:t,uploadInProgressOrComplete:s,canEditFile:r,metaFields:a,onClick:()=>{a&&a.length>0?u(!0,t.id):h(t)}}),n&&t.uploadURL?c(ep,{file:t,uppy:e,i18n:l}):null,o?c(Jc,{i18n:l,file:t,uppy:e,onClick:()=>e.removeFile(t.id,"removed-by-user")}):null)}class ip extends Ge{componentDidMount(){const{file:e}=this.props;
11e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!kc(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,s=e.progress.uploadComplete&&!t&&!e.error,r=e.progress.uploadStarted||t,a=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:o}=e;let l=(this.props.individualCancellation||!a)&&!s;s&&this.props.showRemoveButtonAfterComplete&&(l=!0);const u=Le({"uppy-Dashboard-Item":!0,"is-inprogress":a&&!this.props.recoveredState,"is-processing":t,"is-complete":s,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":o});return c("div",{className:u,id:`uppy_${e.id}`,role:this.props.role},c("div",{className:"uppy-Dashboard-Item-preview"},c(zc,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),c(Hc,{uppy:this.props.uppy,file:e,error:n,isUploaded:s,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})),c("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},c(Yc,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),c(tp,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function sp(i,e){const t=[];let s=[];return i.forEach(r=>{s.length<e?s.push(r):(t.push(s),s=[r])}),s.length&&t.push(s),t}function rp(i){let{id:e,error:t,i18n:s,uppy:r,files:a,acquirers:n,resumableUploads:o,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:h,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:p,isWide:f,metaFields:m,isSingleFile:y,toggleFileCard:g,handleRequestThumbn
11ail:b,handleCancelThumbnail:w,recoveredState:S,individualCancellation:T,itemsPerRow:O,openFileEditor:v,canEditFile:_,toggleAddFilesPanel:P,containerWidth:E,containerHeight:N}=i;const le=O===1?71:200,Q=Ja(()=>{const M=(te,ge)=>a[ge].isGhost-a[te].isGhost,D=Object.keys(a);return S&&D.sort(M),sp(D,O)},[a,O,S]),k=M=>c("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:M[0]},M.map(D=>c(ip,{key:D,uppy:r,id:e,error:t,i18n:s,acquirers:n,resumableUploads:o,individualCancellation:T,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:h,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:p,isWide:f,metaFields:m,recoveredState:S,isSingleFile:y,containerWidth:E,containerHeight:N,toggleFileCard:g,handleRequestThumbnail:b,handleCancelThumbnail:w,role:"listitem",openFileEditor:v,canEditFile:_,toggleAddFilesPanel:P,file:a[D]})));return y?c("div",{class:"uppy-Dashboard-files"},k(Q[0])):c(bc,{class:"uppy-Dashboard-files",role:"list",data:Q,renderRow:k,rowHeight:le})}let Jl;Jl=Symbol.for("uppy test: disable unused locale key warning");class Zl extends Ge{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>c("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderHiddenCameraInput=(e,t,s)=>{const a={photo:"image/*",video:"video/*"}[e];return c("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:a,ref:s})},this.renderMyDeviceAcquirer=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},c("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},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{const s=this.props.acquirers.length;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":s===0},e)},this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),s=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,a=r.charAt(0).toUpperCase()+r.slice(1);return c("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${a}`,{browseFiles:t,browseFolders:s,browse:t}):this.props.i18nArray(`dropPaste${a}`,{browseFiles:t,browseFolders:s,browse:t}))},this.renderAcquirer=e=>{var t;return c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},c("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":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},c("div",{className:"uppy-DashboardTab-inner"},e.icon()),c("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],s=t.splice(e.length-2,e.length);return c(wt,null,t.map(r=>this.renderAcquirer(r)),c("span",{role:"presentation",style:{"white-space":"nowrap"}},s.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,t)=>
11{const{showNativePhotoCameraButton:s,showNativeVideoCameraButton:r}=this.props;let a=[];const n="myDevice";t||a.push({key:n,elements:this.renderMyDeviceAcquirer()}),s&&a.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&a.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),a.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),a.length===1&&a[0].key===n&&(a=[]);const l=[...a],u=l.splice(a.length-2,a.length),h=d=>d.map(p=>{let{key:f,elements:m}=p;return c(wt,{key:f},m)});return c(wt,null,this.renderDropPasteBrowseTagline(a.length),c("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},h(l),c("span",{role:"presentation",style:{"white-space":"nowrap"}},h(u))))}}[Jl](){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=c("span",null,c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},c("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),c("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),s=e("poweredBy",{uppy:t});return c("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},s)}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:s}=this.props;return c("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",s,r=>{this.mobilePhotoFileInput=r}),t&&this.renderHiddenCameraInput("video",s,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),c("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&c("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}const ap=i=>c("div",{className:Le("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),c(Zl,i));function yt(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function np(i){let{activePickerPanel:e,className:t,hideAllPanels:s,i18n:r,state:a,uppy:n}=i;return c("div",{className:Le("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:yt,onDragLeave:yt,onDrop:yt,onPaste:yt},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:s},r("cancel"))),c("div",{className:"uppy-DashboardContent-panelBody"},n.getPlugin(e.id).render(a)))}function op(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return c("div",{className:Le("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:c("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),c("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),c("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(s=>i.uppy.getPlugin(s.id).render(i.state))))}const je={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",
11STATE_PAUSED:"paused"};function lp(i,e,t,s){if(s===void 0&&(s={}),i)return je.STATE_ERROR;if(e)return je.STATE_COMPLETE;if(t)return je.STATE_PAUSED;let r=je.STATE_WAITING;const a=Object.keys(s);for(let n=0;n<a.length;n++){const{progress:o}=s[a[n]];if(o.uploadStarted&&!o.uploadComplete)return je.STATE_UPLOADING;o.preprocess&&r!==je.STATE_UPLOADING&&(r=je.STATE_PREPROCESSING),o.postprocess&&r!==je.STATE_UPLOADING&&r!==je.STATE_PREPROCESSING&&(r=je.STATE_POSTPROCESSING)}return r}function up(i){let{files:e,i18n:t,isAllComplete:s,isAllErrored:r,isAllPaused:a,inProgressNotPausedFiles:n,newFiles:o,processingFiles:l}=i;switch(lp(r,s,a,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:o.length});case"complete":return t("uploadComplete");case"error":return t("error")}}function dp(i){const{i18n:e,isAllComplete:t,hideCancelButton:s,maxNumberOfFiles:r,toggleAddFilesPanel:a,uppy:n}=i;let{allowNewUpload:o}=i;return o&&r&&(o=i.totalFileCount<i.maxNumberOfFiles),c("div",{className:"uppy-DashboardContent-bar"},!t&&!s?c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>n.cancelAll()},e("cancel")):c("div",null),c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},c(up,i)),o?c("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>a(!0)},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},c("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"})),c("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):c("div",null))}function hp(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:s,form:r,formState:a}=i,n={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(o=>{const l=`uppy-Dashboard-FileCard-input-${o.id}`,u=t.includes(o.id);return c("fieldset",{key:o.id,className:"uppy-Dashboard-FileCard-fieldset"},c("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},o.name),o.render!==void 0?o.render({value:a[o.id],onChange:h=>s(h,o.id),fieldCSSClasses:n,required:u,form:r.id},c):c("input",{className:n.text,id:l,form:r.id,type:o.type||"text",required:u,value:a[o.id],placeholder:o.placeholder,onInput:h=>s(h.target.value,o.id),"data-uppy-super-focusable":!0}))})}function cp(i){var e;const{files:t,fileCardFor:s,toggleFileCard:r,saveFileCard:a,metaFields:n,requiredMetaFields:o,openFileEditor:l,i18n:u,i18nArray:h,className:d,canEditFile:p}=i,f=()=>typeof n=="function"?n(t[s]):n,m=t[s],y=(e=f())!=null?e:[],g=p(m),b={};y.forEach(P=>{var E;b[P.id]=(E=m.meta[P.id])!=null?E:""});const[w,S]=qs(b),T=fc(P=>{P.preventDefault(),a(w,s)},[a,w,s]),O=(P,E)=>{S({...w,[E]:P})},v=()=>{r(!1)},[_]=qs(()=>{const P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=Vs(),P});return Fa(()=>(document.body.appendChild(_),_.addEventListener("submit",T),()=>{_.removeEventListener("submit",T),document.body.removeChild(_)}),[_,T]),c("div",{className:Le("uppy-Dashboard-FileCard",d),"data-uppy-panelType":"FileCard",onDragOver:yt,onDragLeave:yt,onDrop:yt,onPaste:yt},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},h("editing",{file:c("span",{className:"uppy-DashboardContent-titleFile"},m.meta?m.meta.name:m.name)})),c("button",{className:"uppy-DashboardContent-back",type:"button",form:_.id,title:u("finishEditingFile"),onClick:v},u("cancel"))),c("div",{className:"uppy-Dashboard-FileCard-inner"},c("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Za(m.type).color}},c(Yl,{file:m}),g&&c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:P=>{T(P),l(m)}},u("editImage"))),c("div",{className:"uppy-Dashboard-FileCard-info"}
11,c(hp,{computedMetaFields:y,requiredMetaFields:o,updateMeta:O,form:_,formState:w})),c("div",{className:"uppy-Dashboard-FileCard-actions"},c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:_.id},u("saveChanges")),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:v,form:_.id},u("cancel")))))}const ei="uppy-transition-slideDownUp",wo=250;function Us(i){let{children:e}=i;const[t,s]=qs(null),[r,a]=qs(""),n=Nr(),o=Nr(),l=Nr(),u=()=>{a(`${ei}-enter`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ei}-enter ${ei}-enter-active`),n.current=setTimeout(()=>{a("")},wo)})},h=()=>{a(`${ei}-leave`),cancelAnimationFrame(l.current),clearTimeout(n.current),n.current=void 0,l.current=requestAnimationFrame(()=>{a(`${ei}-leave ${ei}-leave-active`),o.current=setTimeout(()=>{s(null),a("")},wo)})};return Fa(()=>{const d=gt(e)[0];t!==d&&(d&&!t?u():t&&!d&&!o.current&&h(),s(d))},[e,t]),Fa(()=>()=>{clearTimeout(n.current),clearTimeout(o.current),cancelAnimationFrame(l.current)},[]),t?Sl(t,{className:Le(r,t.props.className)}):null}function qt(){return qt=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},qt.apply(this,arguments)}const _o=900,So=700,zr=576,Po=330;function pp(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,s=i.containerWidth>zr,r=i.containerHeight>Po,a=Le({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>zr,"uppy-size--lg":i.containerWidth>So,"uppy-size--xl":i.containerWidth>_o,"uppy-size--height-md":i.containerHeight>Po,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r});let n=1;i.containerWidth>_o?n=5:i.containerWidth>So?n=4:i.containerWidth>zr&&(n=3);const o=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(p=>i.files[p].isGhost).length:null,h=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return c("div",{className:a,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Ac(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},c("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),c("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:c("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},c("span",{"aria-hidden":"true"},"Ã")),c("div",{className:"uppy-Dashboard-innerWrap"},c("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),o&&c(dp,i),l&&c("div",{className:"uppy-Dashboard-serviceMsg"},c("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},c("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},c("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"}),c("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),c("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),c("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),c("div",{className:"uppy-Dashboard-serviceMsg-text"},h())),o?c(rp,{id:i.id,error:i.error,i18n:i.i18n,uppy:i.uppy,files:i.files,acquirers:i.acquirers,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,isWide:i.isWide,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbn
11ail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:n}):c(Zl,qt({},i,{isSizeMD:s})),c(Us,null,i.showAddFilesPanel?c(ap,qt({key:"AddFiles"},i,{isSizeMD:s})):null),c(Us,null,i.fileCardFor?c(cp,qt({key:"FileCard"},i)):null),c(Us,null,i.activePickerPanel?c(np,qt({key:"Picker"},i)):null),c(Us,null,i.showFileEditor?c(op,qt({key:"Editor"},i)):null),c("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(p=>i.uppy.getPlugin(p.id).render(i.state))))))}const fp={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",editImage:"Edit image",editing:"Editing %{file}",error:"Error",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}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function L(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var mp=0;function $e(i){return"__private_"+mp+++"_"+i}const gp={version:"3.9.1"},jr=go.default||go,Fo=9,yp=27;function Co(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const vp={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:wc,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null};
11var Pt=$e("disabledNodes"),tt=$e("generateLargeThumbnailIfSingleFile"),Pi=$e("openFileEditorWhenFilesAdded"),Ft=$e("attachRenderFunctionToTarget"),Hr=$e("isTargetSupported"),qr=$e("getAcquirers"),Wr=$e("getProgressIndicators"),it=$e("getEditors"),Vr=$e("addSpecifiedPluginsFromOptions"),Gr=$e("autoDiscoverPlugins"),Ct=$e("addSupportedPluginIfNoTarget");class Ea extends _t{constructor(e,t){var s,r;let a;t?t.autoOpen===void 0?a=t.autoOpenFileEditor?"imageEditor":null:a=t.autoOpen:a=null,super(e,{...vp,...t,autoOpen:a}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Vs()}`,this.superFocus=Oc(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=n=>{const l=this.getPluginState().targets.filter(u=>u.id!==n.id);this.setPluginState({targets:l})},this.addTarget=n=>{const o=n.id||n.constructor.name,l=n.title||o,u=n.type;if(u!=="acquirer"&&u!=="progressindicator"&&u!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const h={id:o,name:l,type:u},p=this.getPluginState().targets.slice();return p.push(h),this.setPluginState({targets:p}),this.el},this.hideAllPanels=()=>{var n;const o=this.getPluginState(),l={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};o.activePickerPanel===l.activePickerPanel&&o.showAddFilesPanel===l.showAddFilesPanel&&o.showFileEditor===l.showFileEditor&&o.activeOverlayType===l.activeOverlayType||(this.setPluginState(l),this.uppy.emit("dashboard:close-panel",(n=o.activePickerPanel)==null?void 0:n.id))},this.showPanel=n=>{const{targets:o}=this.getPluginState(),l=o.find(u=>u.type==="acquirer"&&u.id===n);this.setPluginState({activePickerPanel:l,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",n)},this.canEditFile=n=>{const{targets:o}=this.getPluginState();return L(this,it)[it](o).some(u=>this.uppy.getPlugin(u.id).canEditFile(n))},this.openFileEditor=n=>{const{targets:o}=this.getPluginState(),l=L(this,it)[it](o);this.setPluginState({showFileEditor:!0,fileCardFor:n.id||null,activeOverlayType:"FileEditor"}),l.forEach(u=>{this.uppy.getPlugin(u.id).selectFile(n)})},this.closeFileEditor=()=>{const{metaFields:n}=this.getPluginState();n&&n.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:n}=this.getPluginState();
11L(this,it)[it](n).forEach(l=>{this.uppy.getPlugin(l.id).save()}),this.closeFileEditor()},this.openModal=()=>{const{promise:n,resolve:o}=Co();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 l=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",l,!1),o()};this.el.addEventListener("animationend",l,!1)}else this.setPluginState({isHidden:!1}),o();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),n},this.closeModal=n=>{var o;const l=(o=n?.manualClose)!=null?o:!0,{isHidden:u,isClosing:h}=this.getPluginState();if(u||h)return;const{promise:d,resolve:p}=Co();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const m=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",m,!1),p()};this.el.addEventListener("animationend",m,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),p();if(document.removeEventListener("keydown",this.handleKeyDownInModal),l&&this.opts.browserBackButtonClose){var f;(f=history.state)!=null&&f[this.modalName]&&history.back()}
11return this.uppy.emit("dashboard:modal-closed"),d},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=n=>{const{capabilities:o}=this.uppy.getState();this.uppy.setState({capabilities:{...o,darkMode:n}})},this.handleSystemDarkModeChange=n=>{const o=n.matches;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o)},this.toggleFileCard=(n,o)=>{const l=this.uppy.getFile(o);n?this.uppy.emit("dashboard:file-edit-start",l):this.uppy.emit("dashboard:file-edit-complete",l),this.setPluginState({fileCardFor:n?o:null,activeOverlayType:n?"FileCard":null})},this.toggleAddFilesPanel=n=>{this.setPluginState({showAddFilesPanel:n,activeOverlayType:n?"AddFiles":null})},this.addFiles=n=>{const o=n.map(l=>({source:this.id,name:l.name,type:l.type,data:l,meta:{relativePath:l.relativePath||l.webkitRelativePath||null}}));try{this.uppy.addFiles(o)}catch(l){this.uppy.log(l)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(n=>{const o=n[0],{width:l,height:u}=o.contentRect;this.setPluginState({containerWidth:l,containerHeight:u,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const n=this.getPluginState(),o=!this.opts.inline&&n.isHidden;!n.areInsidesReadyToBeVisible&&!o&&(this.uppy.log("[Dashboard] resize event didnât fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=n=>{this.el.contains(n.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=n=>{var o;const l=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],u=(o=L(this,Pt)[Pt])!=null?o:Zi(this.el.querySelectorAll(l)).filter(h=>!h.classList.contains("uppy-Dashboard-close"));for(const h of u)h.tagName==="A"?h.setAttribute("aria-disabled",n):h.disabled=n;n?L(this,Pt)[Pt]=u:L(this,Pt)[Pt]=null,this.dashboardIsDisabled=n},this.updateBrowserHistory=()=>{var n;(n=history.state)!=null&&n[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=n=>{var o;this.isModalOpen()&&(!n.state||!n.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(o=n.state)!=null&&o[this.modalName]&&history.back()},this.handleKeyDownInModal=n=>{n.keyCode===yp&&this.requestCloseModal(),n.keyCode===Fo&&Xl(n,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=n=>{this.uppy.iteratePlugins(l=>{l.type==="acquirer"&&(l.handleRootPaste==null||l.handleRootPaste(n))});const o=Zi(n.clipboardData.files);o.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(o))},this.handleInputChange=n=>{n.preventDefault();const o=Zi(n.target.files);o.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(o))},this.handleDragOver=n=>{var o,l;n.preventDefault(),n.stopPropagation();const u=()=>{let f=!0;
11return this.uppy.iteratePlugins(m=>{m.canHandleRootDrop!=null&&m.canHandleRootDrop(n)&&(f=!0)}),f},h=()=>{const{types:f}=n.dataTransfer;return f.some(m=>m==="Files")},d=u(),p=h();if(!d&&!p||this.opts.disabled||this.opts.disableLocalFiles&&(p||!d)||!this.uppy.getState().allowNewUpload){n.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}n.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(o=(l=this.opts).onDragOver)==null||o.call(l,n)},this.handleDragLeave=n=>{var o,l;n.preventDefault(),n.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(o=(l=this.opts).onDragLeave)==null||o.call(l,n)},this.handleDrop=async n=>{var o,l;n.preventDefault(),n.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(n))});let u=!1;const h=p=>{this.uppy.log(p,"error"),u||(this.uppy.info(p.message,"error"),u=!0)};this.uppy.log("[Dashboard] Processing dropped files");const d=await hc(n.dataTransfer,{logDropError:h});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),(o=(l=this.opts).onDrop)==null||o.call(l,n)}
11,this.handleRequestThumbnail=n=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",n)},this.handleCancelThumbnail=n=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",n)},this.handleKeyDownInInline=n=>{n.keyCode===Fo&&Cc(n,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=n=>{this.el.contains(document.activeElement)&&this.handlePaste(n)},this.handleComplete=n=>{let{failed:o}=n;this.opts.closeAfterFinish&&!(o!=null&&o.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,tt,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const n=600,o=this.uppy.getFiles();if(o.length===1){const l=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);l?.setOptions({thumbnailWidth:n});const u={...o[0],preview:void 0};l?.requestThumbnail(u).then(()=>{l?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Pi,{writable:!0,value:n=>{const o=n[0],{metaFields:l}=this.getPluginState(),u=l&&l.length>0,h=this.canEditFile(o);u&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,o.id):h&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(o)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const n=ro(this.opts.trigger);n?n.forEach(o=>o.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.openM
11odal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",L(this,Ct)[Ct]),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("complete",this.handleComplete),this.uppy.on("files-added",L(this,tt)[tt]),this.uppy.on("file-removed",L(this,tt)[tt]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",L(this,Pi)[Pi])},this.removeEvents=()=>{const n=ro(this.opts.trigger);!this.opts.inline&&n&&n.forEach(o=>o.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",L(this,Ct)[Ct]),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("complete",this.handleComplete),this.uppy.off("files-added",L(this,tt)[tt]),this.uppy.off("file-removed",L(this,tt)[tt]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",L(this,Pi)[Pi])},this.superFocusOnEachUpdate=()=>{const n=this.el.contains(document.activeElement),o=document.activeElement===document.body||document.activeElement===null,l=this.uppy.getState().info.length===0,u=!this.opts.inline;l&&(u||n||o&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(n,o)=>{this.uppy.setFileMeta(o,n),this.toggleFileCard(!1,o)},Object.defineProperty(this,Ft,{writable:!0,value:n=>{const o=this.uppy.getPlugin(n.id);return{...n,icon:o.icon||this.opts.defaultPickerIcon,render:o.render}}}),Object.defineProperty(this,Hr,{writable:!0,value:n=>{const o=this.uppy.getPlugin(n.id);return typeof o.isSupported!="function"?!0:o.isSupported()}}),Object.defineProperty(this,qr,{writable:!0,value:jr(n=>n.filter(o=>o.type==="acquirer"&&L(this,Hr)[Hr](o)).map(L(this,Ft)[Ft]))}),Object.defineProperty(this,Wr,{writable:!0,value:jr(n=>n.filter(o=>o.type==="progressindicator").map(L(this,Ft)[Ft]))}),Object.defineProperty(this,it,{writable:!0,value:jr(n=>n.filter(o=>o.type==="editor").map(L(this,Ft)[Ft]))}),this.render=n=>{const o=this.getPluginState(),{files:l,capabilities:u,allowNewUpload:h}=n,{newFiles:d,uploadStartedFiles:p,completeFiles:f,erroredFiles:m,inProgressFiles:y,inProgressNotPausedFiles:g,processingFiles:b,isUploadStarted:w,isAllComplete:S,isAllErrored:T,isAllPaused:O}=this.uppy.getObjectOfFilesPerState(),v=L(this,qr)[qr](o.targets),_=L(this,Wr)[Wr](o.targets),P=L(this,it)[it](o.targets);let E;return this.opts.theme==="auto"?E=u.darkMode?"dark":"light":E=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}".`)),pp({state:n,isHidden:o.isHidden,files:l,newFiles:d,uploadStartedFiles:p,completeFiles:f,erroredFiles:m,inProgressFiles:y,inProgressNotPausedFiles:g,processingFiles:b,isUploadStarted:w,isAllComplete:S,isAllErrored:T,isAllPaused:O,totalFileCount:Object.keys(l).length,totalProgress:n.totalProgress,allowNewUpload:h,acquirers:v,theme:E,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:o.activePickerPanel,showFileEditor:o.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:o.isClosing,progressindicators:_,editors:P,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:n.recoveredState,metaFields:o.metaFields,resumableUploads:u.resumableUploads||!1,individualCancellation:u.individualCancellation,isMobileDevice:u.isMobileDevice,fileCardFor:o.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:o.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,f
11ileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:o.containerWidth,containerHeight:o.containerHeight,areInsidesReadyToBeVisible:o.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,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbn
11ail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:o.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,Vr,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach(o=>{const l=this.uppy.getPlugin(o);l?l.mount(this,l):this.uppy.log(`[Uppy] Dashboard could not find plugin '${o}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Gr,{writable:!0,value:()=>{this.uppy.iteratePlugins(L(this,Ct)[Ct])}}),Object.defineProperty(this,Ct,{writable:!0,value:n=>{var o;const l=["acquirer","editor"];n&&!((o=n.opts)!=null&&o.target)&&l.includes(n.type)&&(this.getPluginState().targets.some(h=>n.id===h.id)||n.mount(this,n))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:n,closeAfterFinish:o}=this.opts;if(n&&o)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:l,allowMultipleUploadBatches:u}=this.uppy.opts;(l||u)&&o&&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:h}=this.opts;h&&this.mount(h,this),this.opts.disableStatusBar||this.uppy.use(Ol,{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(xl,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(Ll,{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=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const d=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${d?"on":"off"}`),this.setDarkModeCapability(d),this.opts.theme==="auto"){var p;(p=this.darkModeMediaQuery)==null||p.addListener(this.handleSystemDarkModeChange)}L(this,Vr)[Vr](),L(this,Gr)[Gr](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const l=this.uppy.getPlugin(`${this.id}:Informer`);l&&this.uppy.removePlugin(l)}if(!this.opts.disableStatusBar){const l=this.uppy.getPlugin(`${this.id}:StatusBar`);l&&this.uppy.removePlugin(l)}if(!this.opts.disableThumbnailGenerator){const l=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);l&&this.uppy.removePlugin(l)}if((this.opts.plugins||[]).forEach(l=>{const u=this.uppy.getPlugin(l);u&&u.unmount()}),this.opts.theme==="auto"){var o;(o=this.darkModeMediaQuery)==null||o.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=fp,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),(r=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}}Ea.VERSION=gp.version;function Bs(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bs=function(e){return typeof e}:Bs=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bs(i)}function bp(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function To(i,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,s.key,s)}}function wp(i,e,t){return e&&To(i.prototype,e),t&&To(i,t),i}function _p(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Eo(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function eu(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
vendor: 10,503 bytes, lines 11-12
11e%2?Eo(Object(t),!0).forEach(function(s){_p(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function tu(i){return Sp(i)||Pp(i)||Fp(i)||Cp()}function Sp(i){if(Array.isArray(i))return Oa(i)}function Pp(i){if(typeof Symbol<"u"&&Symbol.iterator in Object(i))return Array.from(i)}function Fp(i,e){if(i){if(typeof i=="string")return Oa(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Oa(i,e)}}function Oa(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Cp(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Xs=typeof window<"u"&&typeof window.document<"u",Ye=Xs?window:{},en=Xs&&Ye.document.documentElement?"ontouchstart"in Ye.document.documentElement:!1,tn=Xs?"PointerEvent"in Ye:!1,$="cropper",sn="all",iu="crop",su="move",ru="zoom",Tt="e",Et="w",ti="s",ft="n",Fi="ne",Ci="nw",Ti="se",Ei="sw",Aa="".concat($,"-crop"),Oo="".concat($,"-disabled"),be="".concat($,"-hidden"),Ao="".concat($,"-hide"),Tp="".concat($,"-invisible"),Ws="".concat($,"-modal"),xa="".concat($,"-move"),us="".concat($,"Action"),ks="".concat($,"Preview"),rn="crop",au="move",nu="none",Ua="crop",ka="cropend",Ra="cropmove",Ma="cropstart",xo="dblclick",Ep=en?"touchstart":"mousedown",Op=en?"touchmove":"mousemove",Ap=en?"touchend touchcancel":"mouseup",Uo=tn?"pointerdown":Ep,ko=tn?"pointermove":Op,Ro=tn?"pointerup pointercancel":Ap,Mo="ready",Do="resize",No="wheel",Da="zoom",Io="image/jpeg",xp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Up=/^data:/,kp=/^data:image\/jpeg;base64,/,Rp=/^img|canvas$/i,Bo={viewMode:0,dragMode:rn,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Mp='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Dp=Number.isNaN||Ye.isNaN;function R(i){return typeof i=="number"&&!Dp(i)}var Lo=function(e){return e>0&&e<1/0};function Xr(i){return typeof i>"u"}function Zt(i){return Bs(i)==="object"&&i!==null}var Np=Object.prototype.hasOwnProperty;function ai(i){if(!Zt(i))return!1;try{var e=i.constructor,t=e.prototype;return e&&t&&Np.call(t,"isPrototypeOf")}catch{return!1}}function ve(i){return typeof i=="function"}var Ip=Array.prototype.slice;function ou(i){return Array.from?Array.from(i):Ip.call(i)}function G(i,e){return i&&ve(e)&&(Array.isArray(i)||R(i.length)?ou(i).forEach(function(t,s){e.call(i,t,s,i)}):Zt(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)})),i}var z=Object.assign||function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return Zt(e)&&s.length>0&&s.forEach(function(a){Zt(a)&&Object.keys(a).forEach(function(n){e[n]=a[n]})}),e},Bp=/\.\d*(?:0|9){12}\d*$/;function oi(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Bp.test(i)?Math.round(i*e)/e:i}var Lp=/^width|height|left|top|marginLeft|marginTop$/;function vt(i,e){var t=i.style;G(e,function(s,r){Lp.test(r)&&R(s)&&(s="".concat(s,"px")),t[r]=s})}function $p(i,e){return i.classList?i.classList.contains(e):i.className.indexOf(e)>-1}function Z(i,e){if(e){if(R(i.length)){G(i,function(s){Z(s,e)});return}if(i.classList){i.classList.add(e);return}var t=i.className.trim();t?t.indexOf(e)<0&&(i.className="".concat(t," ").concat(e)):i.className=e}}function Xe(i,e){if(e){if(R(i.length)){G(i,function(t){Xe(t,e)});return}if(i.classList){i.classList.remove(e);return}i.className.indexOf(e)>=0&&(i.className=i.className.replace(e,""))}}function ni(i,e,t){if(e){if(R(i.length)){G(i,function(s){ni(s,e,t)});return}t?Z(i,e):Xe(i,e)}}var zp=/([a-z\d])([A-Z])/g;function an(i){return i.replace(zp,"$1-$2").toLowerCase()}function Na(i,e){return Zt(i[e])?i[e]:i.dataset?i.dataset[e]:i.getAttribute("data-".concat(an(e)))}function ds(i,e,t){Zt(t)?i[e]=t:i.dataset?i.dataset[e]=t:i.setAttribute("data-".concat(an(e)),t)}function jp(i,e){if(Zt(i[e]))try{delete i[e]}catch{i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch{i.dataset[e]=void 0}else i.removeAttribute("data-".concat(an(e)))}var lu=/\s\s*/,uu=(function(){var i=!1;if(Xs){var e=!1,t=function(){},s=Object.defineProperty({},"once",{get:function(){return i=!0,e},set:function(a){e=a}});Ye.addEventListener("test",t,s),Ye.removeEventListener("test",t,s)}return i})();function Re(i,e,t){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(lu).forEach(function(a){if(!uu){var n=i.listeners;n&&n[a]&&n[a][t]&&(r=n[a][t],delete n[a][t],Object.keys(n[a]).length===0&&delete n[a],Object.keys(n).length===0&&delete i.listeners)}i.removeEventListener(a,r,s)})}function xe(i,e,t){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(lu).forEach(function(a){if(s.once&&!uu){var n=i.listeners,o=n===void 0?{}:n;r=function(){delete o[a][t],i.removeEventListener(a,r,s);for(var u=arguments.length,h=new Array(u),d=0;d<u;d++)h[d]=arguments[d];t.apply(i,h)},o[a]||(o[a]={}),o[a][t]&&i.removeEventListener(a,o[a][t],s),o[a][t]=r,i.listeners=o}i.addEventListener(a,r,s)})}function li(i,e,t){var s;return ve(Event)&&ve(CustomEvent)?s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)),i.dispatchEvent(s)}function du(i){var e=i.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Yr=Ye.location,Hp=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function $o(i){var e=i.match(Hp);return e!==null&&(e[1]!==Yr.protocol||e[2]!==Yr.hostname||e[3]!==Yr.port)}function zo(i){var e="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+e}function es(i){var e=i.rotate,t=i.scaleX,s=i.scaleY,r=i.translateX,a=i.translateY,n=[];R(r)&&r!==0&&n.push("translateX(".concat(r,"px)")),R(a)&&a!==0&&n.push("translateY(".concat(a,"px)")),R(e)&&e!==0&&n.push("rotate(".concat(e,"deg)")),R(t)&&t!==1&&n.push("scaleX(".concat(t,")")),R(s)&&s!==1&&n.push("scaleY(".concat(s,")"));var o=n.length?n.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function qp(i){var e=eu({},i),t=[];return G(i,function(s,r){delete e[r],G(e,function(a){var n=Math.abs(s.startX-a.startX),o=Math.abs(s.startY-a.startY),l=Math.abs(s.endX-a.endX),u=Math.abs(s.endY-a.endY),h=Math.sqrt(n*n+o*o),d=Math.sqrt(l*l+u*u),p=(d-h)/h;t.push(p)})}),t.sort(function(s,r){return Math.abs(s)<Math.abs(r)}),t[0]}function Rs(i,e){var t=i.pageX,s=i.pageY,r={endX:t,endY:s};return e?r:eu({startX:t,startY:s},r)}function Wp(i){var e=0,t=0,s=0;return G(i,function(r){var a=r.startX,n=r.startY;e+=a,t+=n,s+=1}),e/=s,t/=s,{pageX:e,pageY:t}}function bt(i){var e=i.aspectRatio,t=i.height,s=i.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=Lo(s),n=Lo(t);if(a&&n){var o=t*e;r==="contain"&&o>s||r==="cover"&&o<s?t=s/e:s=t*e}else a?t=s/e:n&&(s=t*e);return{width:s,height:t}}function Vp(i){var e=i.width,t=i.height,s=i.degree;if(s=Math.abs(s)%180,s===90)return{width:t,height:e};var r=s%90*Math.PI/180,a=Math.sin(r),n=Math.cos(r),o=e*n+t*a,l=e*a+t*n;return s>90?{width:l,height:o}:{width:o,height:l}}function Gp(i,e,t,s){var r=e.aspectRatio,a=e.naturalWidth,n=e.naturalHeight,o=e.rotate,l=o===void 0?0:o,u=e.scaleX,h=u===void 0?1:u,d=e.scaleY,p=d===void 0?1:d,f=t.aspectRatio,m=t.naturalWidth,y=t.naturalHeight,g=s.fillColor,b=g===void 0?"transparent":g,w=s.imageSmoothingEnabled,S=w===void 0?!0:w,T=s.imageSmoothingQuality,O=T===void 0?"low":T,v=s.maxWidth,_=v===void 0?1/0:v,P=s.maxHeight,E=P===void 0?1/0:P,N=s.minWidth,le=N===void 0?0:N,Q=s.minHeight,k=Q===void 0?0:Q,M=document.createElement("canvas"),D=M.getContext("2d"),te=bt({aspectRatio:f,width:_,height:E}),ge=bt({aspectRatio:f,width:le,height:k},"cover"),ze=Math.min(te.width,Math.max(ge.width,m)),ye=Math.min(te.height,Math.max(ge.height,y)),Ke=bt({aspectRatio:r,width:_,height:E}),fs=bt({aspectRatio:r,width:le,height:k},"cover"),ms=Math.min(Ke.width,Math.max(fs.width,a)),gs=Math.min(Ke.height,Math.max(fs.height,n)),Js=[-ms/2,-gs/2,ms,gs];return M.width=oi(ze),M.height=oi(ye),D.fillStyle=b,D.fillRect(0,0,ze,ye),D.save(),D.translate(ze/2,ye/2),D.rotate(l*Math.PI/180),D.scale(h,p),D.imageSmoothingEnabled=S,D.imageSmoothingQuality=O,D.drawImage.apply(D,[i].concat(tu(Js.map(function(Zs){return Math.floor(oi(Zs))})))),D.restore(),M}var hu=String.fromCharCode;function Xp(i,e,t){var s="";t+=e;for(var r=e;r<t;r+=1)s+=hu(i.getUint8(r));return s}var Yp=/^data:.*,/;function Kp(i){var e=i.replace(Yp,""),t=atob(e),s=new ArrayBuffer(t.length),r=new
vendor: 4,138 bytes, line 12
12Uint8Array(s);return G(r,function(a,n){r[n]=t.charCodeAt(n)}),s}function Qp(i,e){for(var t=[],s=8192,r=new Uint8Array(i);r.length>0;)t.push(hu.apply(null,ou(r.subarray(0,s)))),r=r.subarray(s);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function Jp(i){var e=new DataView(i),t;try{var s,r,a;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var n=e.byteLength,o=2;o+1<n;){if(e.getUint8(o)===255&&e.getUint8(o+1)===225){r=o;break}o+=1}if(r){var l=r+4,u=r+10;if(Xp(e,l,4)==="Exif"){var h=e.getUint16(u);if(s=h===18761,(s||h===19789)&&e.getUint16(u+2,s)===42){var d=e.getUint32(u+4,s);d>=8&&(a=u+d)}}}if(a){var p=e.getUint16(a,s),f,m;for(m=0;m<p;m+=1)if(f=a+m*12+2,e.getUint16(f,s)===274){f+=8,t=e.getUint16(f,s),e.setUint16(f,1,s);break}}}catch{t=1}return t}function Zp(i){var e=0,t=1,s=1;switch(i){case 2:t=-1;break;case 3:e=-180;break;case 4:s=-1;break;case 5:e=90,s=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:s}}var ef={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,s=this.container,r=this.cropper;Z(r,be),Xe(e,be);var a={width:Math.max(s.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(s.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=a,vt(r,{width:a.width,height:a.height}),Z(e,be),Xe(r,be)},initCanvas:function(){var e=this.containerData,t=this.imageData,s=this.options.viewMode,r=Math.abs(t.rotate)%180===90,a=r?t.naturalHeight:t.naturalWidth,n=r?t.naturalWidth:t.naturalHeight,o=a/n,l=e.width,u=e.height;e.height*o>e.width?s===3?l=e.height*o:u=e.width/o:s===3?u=e.width/o:l=e.height*o;var h={aspectRatio:o,naturalWidth:a,naturalHeight:n,width:l,height:u};h.left=(e.width-l)/2,h.top=(e.height-u)/2,h.oldLeft=h.left,h.oldTop=h.top,this.canvasData=h,this.limited=s===1||s===2,this.limitCanvas(!0,!0),this.initialImageData=z({},t),this.initialCanvasData=z({},h)},limitCanvas:function(e,t){var s=this.options,r=this.containerData,a=this.canvasData,n=this.cropBoxData,o=s.viewMode,l=a.aspectRatio,u=this.cropped&&n;if(e){var h=Number(s.minCanvasWidth)||0,d=Number(s.minCanvasHeight)||0;o>1?(h=Math.max(h,r.width),d=Math.max(d,r.height),o===3&&(d*l>h?h=d*l:d=h/l)):o>0&&(h?h=Math.max(h,u?n.width:0):d?d=Math.max(d,u?n.height:0):u&&(h=n.width,d=n.height,d*l>h?h=d*l:d=h/l));var p=bt({aspectRatio:l,width:h,height:d});h=p.width,d=p.height,a.minWidth=h,a.minHeight=d,a.maxWidth=1/0,a.maxHeight=1/0}if(t)if(o>(u?0:1)){var f=r.width-a.width,m=r.height-a.height;a.minLeft=Math.min(0,f),a.minTop=Math.min(0,m),a.maxLeft=Math.max(0,f),a.maxTop=Math.max(0,m),u&&this.limited&&(a.minLeft=Math.min(n.left,n.left+(n.width-a.width)),a.minTop=Math.min(n.top,n.top+(n.height-a.height)),a.maxLeft=n.left,a.maxTop=n.top,o===2&&(a.width>=r.width&&(a.minLeft=Math.min(0,f),a.maxLeft=Math.max(0,f)),a.height>=r.height&&(a.minTop=Math.min(0,m),a.maxTop=Math.max(0,m))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=r.width,a.maxTop=r.height},renderCanvas:function(e,t){var s=this.canvasData,r=this.imageData;if(t){var a=Vp({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),n=a.width,o=a.height,l=s.width*(n/s.naturalWidth),u=s.height*(o/s.naturalHeight);s.left-=(l-s.width)/2,s.top-=(u-s.height)/2,s.width=l,s.height=u,s.aspectRatio=n/o,s.naturalWidth=n,s.naturalHeight=o,this.limitCanvas(!0,!1)}(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCanvas(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,vt(this.canvas,z({width:s.width,height:s.height},es({translateX:s.left,translateY:s.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,s=this.imageData,r=s.naturalWi
vendor: 19,260 bytes, line 12
12dth*(t.width/t.naturalWidth),a=s.naturalHeight*(t.height/t.naturalHeight);z(s,{width:r,height:a,left:(t.width-r)/2,top:(t.height-a)/2}),vt(this.image,z({width:s.width,height:s.height},es(z({translateX:s.left,translateY:s.top},s)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,s=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,a={width:t.width,height:t.height};s&&(t.height*s>t.width?a.height=a.width/s:a.width=a.height*s),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*r),a.height=Math.max(a.minHeight,a.height*r),a.left=t.left+(t.width-a.width)/2,a.top=t.top+(t.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=z({},a)},limitCropBox:function(e,t){var s=this.options,r=this.containerData,a=this.canvasData,n=this.cropBoxData,o=this.limited,l=s.aspectRatio;if(e){var u=Number(s.minCropBoxWidth)||0,h=Number(s.minCropBoxHeight)||0,d=o?Math.min(r.width,a.width,a.width+a.left,r.width-a.left):r.width,p=o?Math.min(r.height,a.height,a.height+a.top,r.height-a.top):r.height;u=Math.min(u,r.width),h=Math.min(h,r.height),l&&(u&&h?h*l>u?h=u/l:u=h*l:u?h=u/l:h&&(u=h*l),p*l>d?p=d/l:d=p*l),n.minWidth=Math.min(u,d),n.minHeight=Math.min(h,p),n.maxWidth=d,n.maxHeight=p}t&&(o?(n.minLeft=Math.max(0,a.left),n.minTop=Math.max(0,a.top),n.maxLeft=Math.min(r.width,a.left+a.width)-n.width,n.maxTop=Math.min(r.height,a.top+a.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=r.width-n.width,n.maxTop=r.height-n.height))},renderCropBox:function(){var e=this.options,t=this.containerData,s=this.cropBoxData;(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCropBox(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,e.movable&&e.cropBoxMovable&&ds(this.face,us,s.width>=t.width&&s.height>=t.height?su:sn),vt(this.cropBox,z({width:s.width,height:s.height},es({translateX:s.left,translateY:s.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),li(this.element,Ua,this.getData())}},tf={initPreview:function(){var e=this.element,t=this.crossOrigin,s=this.options.preview,r=t?this.crossOriginUrl:this.url,a=e.alt||"The image to preview",n=document.createElement("img");if(t&&(n.crossOrigin=t),n.src=r,n.alt=a,this.viewBox.appendChild(n),this.viewBoxImage=n,!!s){var o=s;typeof s=="string"?o=e.ownerDocument.querySelectorAll(s):s.querySelector&&(o=[s]),this.previews=o,G(o,function(l){var u=document.createElement("img");ds(l,ks,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),t&&(u.crossOrigin=t),u.src=r,u.alt=a,u.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(u)})}},resetPreview:function(){G(this.previews,function(e){var t=Na(e,ks);vt(e,{width:t.width,height:t.height}),e.innerHTML=t.html,jp(e,ks)})},preview:function(){var e=this.imageData,t=this.canvasData,s=this.cropBoxData,r=s.width,a=s.height,n=e.width,o=e.height,l=s.left-t.left-e.left,u=s.top-t.top-e.top;!this.cropped||this.disabled||(vt(this.viewBoxImage,z({width:n,height:o},es(z({translateX:-l,translateY:-u},e)))),G(this.previews,function(h){var d=Na(h,ks),p=d.width,f=d.height,m=p,y=f,g=1;r&&(g=p/r,y=a*g),a&&y>f&&(g=f/a,m=r*g,y=f),vt(h,{width:m,height:y}),vt(h.getElementsByTagName("img")[0],z({width:n*g,height:o*g},es(z({translateX:-l*g,translateY:-u*g},e))))}))}},sf={bind:function(){var e=this.element,t=this.options,s=this.cropper;ve(t.cropstart)&&xe(e,Ma,t.cropstart),ve(t.cropmove)&&xe(e,Ra,t.cropmove),ve(t.cropend)&&xe(e,ka,t.cropend),ve(t.crop)&&xe(e,Ua,t.crop),ve(t.zoom)&&xe(e,Da,t.zoom),xe(s,Uo,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&xe(s,No,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&xe(s,xo,this.onDblclick=this.dblclick.bind(this)),xe(e.ownerDocument,ko,this.onCropMove=this.cropMove.bind(this)),xe(e.ownerDocument,Ro,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&xe(window,Do,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,s=this.cropper;ve(t.cropstart)&&Re(e,Ma,t.cropstart),ve(t.cropmove)&&Re(e,Ra,t.cropmove),ve(t.cropend)&&Re(e,ka,t.cropend),ve(t.crop)&&Re(e,Ua,t.crop),ve(t.zoom)&&Re(e,Da,t.zoom),Re(s,Uo,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Re(s,No,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Re(s,xo,this.onDblclick),Re(e.ownerDocument,ko,this.onCropMove),Re(e.ownerDocument,Ro,this.onCropEnd),t.responsive&&Re(window,Do,this.onResize)}},rf={resize:function(){if(!this.disabled){var e=this.options,t=this.container,s=this.containerData,r=t.offsetWidth/s.width;if(r!==1||t.offsetHeight!==s.height){var a,n;e.restore&&(a=this.getCanvasData(),n=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(G(a,function(o,l){a[l]=o*r})),this.setCropBoxData(G(n,function(o,l){n[l]=o*r})))}}},dblclick:function(){this.disabled||this.options.dragMode===nu||this.setDragMode($p(this.dragBox,Aa)?au:rn)},wheel:function(e){var t=this,s=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*s,e)))},cropStart:function(e){var t=e.buttons,s=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(R(t)&&t!==1||R(s)&&s!==0||e.ctrlKey))){var r=this.options,a=this.pointers,n;e.changedTouches?G(e.changedTouches,function(o){a[o.identifier]=Rs(o)}):a[e.pointerId||0]=Rs(e),Object.keys(a).length>1&&r.zoomable&&r.zoomOnTouch?n=ru:n=Na(e.target,us),xp.test(n)&&li(this.element,Ma,{originalEvent:e,action:n})!==!1&&(e.preventDefault(),this.action=n,this.cropping=!1,n===iu&&(this.cropping=!0,Z(this.dragBox,Ws)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var s=this.pointers;e.preventDefault(),li(this.element,Ra,{originalEvent:e,action:t})!==!1&&(e.changedTouches?G(e.changedTouches,function(r){z(s[r.identifier]||{},Rs(r,!0))}):z(s[e.pointerId||0]||{},Rs(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,s=this.pointers;e.changedTouches?G(e.changedTouches,function(r){delete s[r.identifier]}):delete s[e.pointerId||0],t&&(e.preventDefault(),Object.keys(s).length||(this.action=""),this.cropping&&(this.cropping=!1,ni(this.dragBox,Ws,this.cropped&&this.options.modal)),li(this.element,ka,{originalEvent:e,action:t}))}}},af={change:function(e){var t=this.options,s=this.canvasData,r=this.containerData,a=this.cropBoxData,n=this.pointers,o=this.action,l=t.aspectRatio,u=a.left,h=a.top,d=a.width,p=a.height,f=u+d,m=h+p,y=0,g=0,b=r.width,w=r.height,S=!0,T;!l&&e.shiftKey&&(l=d&&p?d/p:1),this.limited&&(y=a.minLeft,g=a.minTop,b=y+Math.min(r.width,s.width,s.left+s.width),w=g+Math.min(r.height,s.height,s.top+s.height));var O=n[Object.keys(n)[0]],v={x:O.endX-O.startX,y:O.endY-O.startY},_=function(E){switch(E){case Tt:f+v.x>b&&(v.x=b-f);break;case Et:u+v.x<y&&(v.x=y-u);break;case ft:h+v.y<g&&(v.y=g-h);break;case ti:m+v.y>w&&(v.y=w-m);break}};switch(o){case sn:u+=v.x,h+=v.y;break;case Tt:if(v.x>=0&&(f>=b||l&&(h<=g||m>=w))){S=!1;break}_(Tt),d+=v.x,d<0&&(o=Et,d=-d,u-=d),l&&(p=d/l,h+=(a.height-p)/2);break;case ft:if(v.y<=0&&(h<=g||l&&(u<=y||f>=b))){S=!1;break}_(ft),p-=v.y,h+=v.y,p<0&&(o=ti,p=-p,h-=p),l&&(d=p*l,u+=(a.width-d)/2);break;case Et:if(v.x<=0&&(u<=y||l&&(h<=g||m>=w))){S=!1;break}_(Et),d-=v.x,u+=v.x,d<0&&(o=Tt,d=-d,u-=d),l&&(p=d/l,h+=(a.height-p)/2);break;case ti:if(v.y>=0&&(m>=w||l&&(u<=y||f>=b))){S=!1;break}_(ti),p+=v.y,p<0&&(o=ft,p=-p,h-=p),l&&(d=p*l,u+=(a.width-d)/2);break;case Fi:if(l){if(v.y<=0&&(h<=g||f>=b)){S=!1;break}_(ft),p-=v.y,h+=v.y,d=p*l}else _(ft),_(Tt),v.x>=0?f<b?d+=v.x:v.y<=0&&h<=g&&(S=!1):d+=v.x,v.y<=0?h>g&&(p-=v.y,h+=v.y):(p-=v.y,h+=v.y);d<0&&p<0?(o=Ei,p=-p,d=-d,h-=p,u-=d):d<0?(o=Ci,d=-d,u-=d):p<0&&(o=Ti,p=-p,h-=p);break;case Ci:if(l){if(v.y<=0&&(h<=g||u<=y)){S=!1;break}_(ft),p-=v.y,h+=v.y,d=p*l,u+=a.width-d}else _(ft),_(Et),v.x<=0?u>y?(d-=v.x,u+=v.x):v.y<=0&&h<=g&&(S=!1):(d-=v.x,u+=v.x),v.y<=0?h>g&&(p-=v.y,h+=v.y):(p-=v.y,h+=v.y);d<0&&p<0?(o=Ti,p=-p,d=-d,h-=p,u-=d):d<0?(o=Fi,d=-d,u-=d):p<0&&(o=Ei,p=-p,h-=p);break;case Ei:if(l){if(v.x<=0&&(u<=y||m>=w)){S=!1;break}_(Et),d-=v.x,u+=v.x,p=d/l}else _(ti),_(Et),v.x<=0?u>y?(d-=v.x,u+=v.x):v.y>=0&&m>=w&&(S=!1):(d-=v.x,u+=v.x),v.y>=0?m<w&&(p+=v.y):p+=v.y;d<0&&p<0?(o=Fi,p=-p,d=-d,h-=p,u-=d):d<0?(o=Ti,d=-d,u-=d):p<0&&(o=Ci,p=-p,h-=p);break;case Ti:if(l){if(v.x>=0&&(f>=b||m>=w)){S=!1;break}_(Tt),d+=v.x,p=d/l}else _(ti),_(Tt),v.x>=0?f<b?d+=v.x:v.y>=0&&m>=w&&(S=!1):d+=v.x,v.y>=0?m<w&&(p+=v.y):p+=v.y;d<0&&p<0?(o=Ci,p=-p,d=-d,h-=p,u-=d):d<0?(o=Ei,d=-d,u-=d):p<0&&(o=Fi,p=-p,h-=p);break;case su:this.move(v.x,v.y),S=!1;break;case ru:this.zoom(qp(n),e),S=!1;break;case iu:if(!v.x||!v.y){S=!1;break}T=du(this.cropper),u=O.startX-T.left,h=O.startY-T.top,d=a.minWidth,p=a.minHeight,v.x>0?o=v.y>0?Ti:Fi:v.x<0&&(u-=d,o=v.y>0?Ei:Ci),v.y<0&&(h-=p),this.cropped||(Xe(this.cropBox,be),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}S&&(a.width=d,a.height=p,a.left=u,a.top=h,this.action=o,this.renderCropBox()),G(n,function(P){P.startX=P.endX,P.startY=P.endY})}},nf={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Z(this.dragBox,Ws),Xe(this.cropBox,be),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=z({},this.initialImageData),this.canvasData=z({},this.initialCanvasData),this.cropBoxData=z({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(z(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Xe(this.dragBox,Ws),Z(this.cropBox,be)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,G(this.previews,function(s){s.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Xe(this.cropper,Oo)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Z(this.cropper,Oo)),this},destroy:function(){var e=this.element;return e[$]?(e[$]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.canvasData,r=s.left,a=s.top;return this.moveTo(Xr(e)?e:r+Number(e),Xr(t)?t:a+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(R(e)&&(s.left=e,r=!0),R(t)&&(s.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var s=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(s.width*e/s.naturalWidth,null,t)},zoomTo:function(e,t,s){var r=this.options,a=this.canvasData,n=a.width,o=a.height,l=a.naturalWidth,u=a.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var h=l*e,d=u*e;if(li(this.element,Da,{ratio:e,oldRatio:n/l,originalEvent:s})===!1)return this;if(s){var p=this.pointers,f=du(this.cropper),m=p&&Object.keys(p).length?Wp(p):{pageX:s.pageX,pageY:s.pageY};a.left-=(h-n)*((m.pageX-f.left-a.left)/n),a.top-=(d-o)*((m.pageY-f.top-a.top)/o)}else ai(t)&&R(t.x)&&R(t.y)?(a.left-=(h-n)*((t.x-a.left)/n),a.top-=(d-o)*((t.y-a.top)/o)):(a.left-=(h-n)/2,a.top-=(d-o)/2);a.width=h,a.height=d,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),R(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,R(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(R(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(R(e)&&(s.scaleX=e,r=!0),R(t)&&(s.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,s=this.imageData,r=this.canvasData,a=this.cropBoxData,n;if(this.ready&&this.cropped){n={x:a.left-r.left,y:a.top-r.top,width:a.width,height:a.height};var o=s.width/s.naturalWidth;if(G(n,function(h,d){n[d]=h/o}),e){var l=Math.round(n.y+n.height),u=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=u-n.x,n.height=l-n.y}}else n={x:0,y:0,width:0,height:0};return t.rotatable&&(n.rotate=s.rotate||0),t.scalable&&(n.scaleX=s.scaleX||1,n.scaleY=s.scaleY||1),n},setData:function(e){var t=this.options,s=this.imageData,r=this.canvasData,a={};if(this.ready&&!this.disabled&&ai(e)){var n=!1;t.rotatable&&R(e.rotate)&&e.rotate!==s.rotate&&(s.rotate=e.rotate,n=!0),t.scalable&&(R(e.scaleX)&&e.scaleX!==s.scaleX&&(s.scaleX=e.scaleX,n=!0),R(e.scaleY)&&e.scaleY!==s.scaleY&&(s.scaleY=e.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var o=s.width/s.naturalWidth;R(e.x)&&(a.left=e.x*o+r.left),R(e.y)&&(a.top=e.y*o+r.top),R(e.width)&&(a.width=e.width*o),R(e.height)&&(a.height=e.height*o),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?z({},this.containerData):{}},getImageData:function(){return this.sized?z({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&G(["left","top","width","height","naturalWidth","naturalHeight"],function(s){t[s]=e[s]}),t},setCanvasData:function(e){var t=this.canvasData,s=t.aspectRatio;return this.ready&&!this.disabled&&ai(e)&&(R(e.left)&&(t.left=e.left),R(e.top)&&(t.top=e.top),R(e.width)?(t.width=e.width,t.height=e.width/s):R(e.height)&&(t.height=e.height,t.width=e.height*s),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,s=this.options.aspectRatio,r,a;return this.ready&&this.cropped&&!this.disabled&&ai(e)&&(R(e.left)&&(t.left=e.left),R(e.top)&&(t.top=e.top),R(e.width)&&e.width!==t.width&&(r=!0,t.width=e.width),R(e.height)&&e.height!==t.height&&(a=!0,t.height=e.height),s&&(r?t.height=t.width/s:a&&(t.width=t.height*s)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,s=Gp(this.image,this.imageData,t,e);if(!this.cropped)return s;var r=this.getData(),a=r.x,n=r.y,o=r.width,l=r.height,u=s.width/Math.floor(t.naturalWidth);u!==1&&(a*=u,n*=u,o*=u,l*=u);var h=o/l,d=bt({aspectRatio:h,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=bt({aspectRatio:h,width:e.minWidth||0,height:e.minHeight||0},"cover"),f=bt({aspectRatio:h,width:e.width||(u!==1?s.width:o),height:e.height||(u!==1?s.height:l)}),m=f.width,y=f.height;m=Math.min(d.width,Math.max(p.width,m)),y=Math.min(d.height,Math.max(p.height,y));var g=document.createElement("canvas"),b=g.getContext("2d");g.width=oi(m),g.height=oi(y),b.fillStyle=e.fillColor||"transparent",b.fillRect(0,0,m,y);var w=e.imageSmoothingEnabled,S=w===void 0?!0:w,T=e.imageSmoothingQuality;b.imageSmoothingEnabled=S,T&&(b.imageSmoothingQuality=T);var O=s.width,v=s.height,_=a,P=n,E,N,le,Q,k,M;_<=-o||_>O?(_=0,E=0,le=0,k=0):_<=0?(le=-_,_=0,E=Math.min(O,o+_),k=E):_<=O&&(le=0,E=Math.min(o,O-_),k=E),E<=0||P<=-l||P>v?(P=0,N=0,Q=0,M=0):P<=0?(Q=-P,P=0,N=Math.min(v,l+P),M=N):P<=v&&(Q=0,N=Math.min(l,v-P),M=N);var D=[_,P,E,N];if(k>0&&M>0){var te=m/o;D.push(le*te,Q*te,k*te,M*te)}return b.drawImage.apply(b,[s].concat(tu(D.map(function(ge){return Math.floor(oi(ge))})))),g},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Xr(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,s=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var a=e===rn,n=t.movable&&e===au;e=a||n?e:nu,t.dragMode=e,ds(s,us,e),ni(s,Aa,a),ni(s,xa,n),t.cropBoxMovable||(ds(r,us,e),ni(r,Aa,a),ni(r,xa,n))}return this}},of=Ye.Cropper,cu=(function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(bp(this,i),!e||!Rp.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=z({},Bo,ai(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return wp(i,[{key:"init",value:function(){var t=this.element,s=t.tagName.toLowerCase(),r;if(!t[$]){if(t[$]=this,s==="img"){if(this.isImg=!0,r=t.getAttribute("src")||"",this.originalUrl=r,!r)return;r=t.src}else s==="canvas"&&window.HTMLCanvasElement&&(r=t.toDataURL());this.load(r)}}},{key:"load",value:function(t){var s=this;if(t){this.url=t,this.imageData={};var r=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Up.test(t)){kp.test(t)?this.read(Kp(t)):this.clone();return}var n=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){n.getResponseHeader("content-type")!==Io&&n.abort()},n.onload=function(){s.read(n.response)},n.onloadend=function(){s.reloading=!1,s.xhr=null},a.checkCrossOrigin&&$o(t)&&r.crossOrigin&&(t=zo(t)),n.open("GET",t),n.responseType="arraybuffer",n.withCredentials=r.crossOrigin==="use-credentials",n.send()}}},{key:"read",value:function(t){var s=this.options,r=this.imageData,a=Jp(t),n=0,o=1,l=1;if(a>1){this.url=Qp(t,Io);var u=Zp(a);n=u.rotate,o=u.scaleX,l=u.scaleY}s.rotatable&&(r.rotate=n),s.scalable&&(r.scaleX=o,r.scaleY=l),this.clone()}},{key:"clone",value:function(){var t=this.element,s=this.url,r=t.crossOrigin,a=s;this.options.checkCrossOrigin&&$o(s)&&(r||(r="anonymous"),a=zo(s)),this.crossOrigin=r,this.crossOriginUrl=a;var n=document.createElement("img");r&&(n.crossOrigin=r),n.src=a||s,n.alt=t.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),Z(n,Ao),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){var t=this,s=this.image;
12s.onload=null,s.onerror=null,this.sizing=!0;var r=Ye.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Ye.navigator.userAgent),a=function(u,h){z(t.imageData,{naturalWidth:u,naturalHeight:h,aspectRatio:u/h}),t.sizing=!1,t.sized=!0,t.build()};if(s.naturalWidth&&!r){a(s.naturalWidth,s.naturalHeight);return}var n=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){a(n.width,n.height),r||o.removeChild(n)},n.src=s.src,r||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(n))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,s=this.options,r=this.image,a=t.parentNode,n=document.createElement("div");n.innerHTML=Mp;var o=n.querySelector(".".concat($,"-container")),l=o.querySelector(".".concat($,"-canvas")),u=o.querySelector(".".concat($,"-drag-box")),h=o.querySelector(".".concat($,"-crop-box")),d=h.querySelector(".".concat($,"-face"));this.container=a,this.cropper=o,this.canvas=l,this.dragBox=u,this.cropBox=h,this.viewBox=o.querySelector(".".concat($,"-view-box")),this.face=d,l.appendChild(r),Z(t,be),a.insertBefore(o,t.nextSibling),this.isImg||Xe(r,Ao),this.initPreview(),this.bind(),s.initialAspectRatio=Math.max(0,s.initialAspectRatio)||NaN,s.aspectRatio=Math.max(0,s.aspectRatio)||NaN,s.viewMode=Math.max(0,Math.min(3,Math.round(s.viewMode)))||0,Z(h,be),s.guides||Z(h.getElementsByClassName("".concat($,"-dashed")),be),s.center||Z(h.getElementsByClassName("".concat($,"-center")),be),s.background&&Z(o,"".concat($,"-bg")),s.highlight||Z(d,Tp),s.cropBoxMovable&&(Z(d,xa),ds(d,us,sn)),s.cropBoxResizable||(Z(h.getElementsByClassName("".concat($,"-line")),be),Z(h.getElementsByClassName("".concat($,"-point")),be)),this.render(),this.ready=!0,this.setDragMode(s.dragMode),s.autoCrop&&this.crop(),this.setData(s.data),ve(s.ready)&&xe(t,Mo,s.ready,{once:!0}),li(t,Mo)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Xe(this.element,be))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=of,i}},{key:"setDefaults",value:function(t){z(Bo,ai(t)&&t)}}]),i})();z(cu.prototype,ef,tf,sf,rf,af,nf);function lf(i,e){const t=i.width/e.width,s=i.height/e.height,r=Math.min(t,s),a=e.width*r,n=e.height*r,o=(i.width-a)/2,l=(i.height-n)/2;return{width:a,height:n,left:o,top:l}}function uf(i){return i*(Math.PI/180)}function df(i,e,t){const s=Math.abs(uf(t));return Math.max((Math.sin(s)*i+Math.cos(s)*e)/e,(Math.sin(s)*e+Math.cos(s)*i)/i)}function hf(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}function cf(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}class pf extends Ge{constructor(e){super(e),this.onRotate90Deg=()=>{const{angle90Deg:t}=this.state,s=t-90;this.setState({angle90Deg:s,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(s);const r=this.cropper.getCanvasData(),a=this.cropper.getContainerData(),n=lf(a,r);this.cropper.setCanvasData(n),this.cropper.setCropBoxData(n)},this.onRotateGranular=t=>{const s=Number(t.target.value);this.setState({angleGranular:s});const{angle90Deg:r}=this.state,a=r+s;this.cropper.rotateTo(a);
12const n=this.cropper.getImageData(),o=df(n.naturalWidth,n.naturalHeight,s),l=this.cropper.getImageData().scaleX<0?-o:o;this.cropper.scale(l,o)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:e,storeCropperInstance:t}=this.props;this.cropper=new cu(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){const t=this.cropper.getCanvasData(),s=this.cropper.getCropBoxData(),{prevCropboxData:r}=this.state;if(e.detail.action==="all"){const a=hf(t,s,r);a&&this.cropper.setCropBoxData(a)}else{const a=cf(t,s,r);a&&this.cropper.setCropBoxData(a)}}renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.state;return c("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},c("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){const{i18n:e,opts:t}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),c("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},c("path",{d:"M0 0h24v24H0V0z",fill:"none"}),c("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),c("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0V0z",fill:"none"}),c("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),c("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){const{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0
12-2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){const{currentImage:e,opts:t}=this.props,{actions:s}=t,r=URL.createObjectURL(e.data);return c("div",{className:"uppy-ImageCropper"},c("div",{className:"uppy-ImageCropper-container"},c("img",{className:"uppy-ImageCropper-image",alt:e.name,src:r,ref:a=>{this.imgElement=a}})),c("div",{className:"uppy-ImageCropper-controls"},s.revert&&this.renderRevert(),s.rotate&&this.renderRotate(),s.granularRotate&&this.renderGranularRotate(),s.flip&&this.renderFlip(),s.zoomIn&&this.renderZoomIn(),s.zoomOut&&this.renderZoomOut(),s.cropSquare&&this.renderCropSquare(),s.cropWidescreen&&this.renderCropWidescreen(),s.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}}const ff={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},mf={version:"2.4.6"},pu={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},fu={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},gf={quality:.8,actions:fu,cropperOptions:pu};class mu extends _t{constructor(e,t){super(e,{...gf,...t,actions:{...fu,...t?.actions},cropperOptions:{...pu,...t?.cropperOptions}}),this.save=()=>{const s=n=>{const{currentImage:o}=this.getPluginState();this.uppy.setFileState(o.id,{data:new File([n],o.name,{type:n.type}),size:n.size,preview:void 0});const l=this.uppy.getFile(o.id);this.uppy.emit("thumbnail:request",l),this.setPluginState({currentImage:l}),this.uppy.emit("file-editor:complete",l)},{currentImage:r}=this.getPluginState(),a=this.cropper.getCroppedCanvas({});a.width%2!==0&&this.cropper.setData({width:a.width-1}),a.height%2!==0&&this.cropper.setData({height:a.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(s,r.type,this.opts.quality)},this.storeCropperInstance=s=>{this.cropper=s},this.selectFile=s=>{this.uppy.emit("file-editor:start",s),this.setPluginState({currentImage:s})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=ff,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);
12this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){const{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:c(pf,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}mu.VERSION=mf.version;class yf extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}var Kr={},Qr,jo;function vf(){if(jo)return Qr;jo=1;function i(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return Qr=i,i.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},i.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},i.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},s),this._options.unref&&this._timer.unref(),!0},i.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},i.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},i.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},i.prototype.start=i.prototype.try,i.prototype.errors=function(){return this._errors},i.prototype.attempts=function(){return this._attempts},i.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,s=0,r=0;r<this._errors.length;r++){var a=this._errors[r],n=a.message,o=(e[n]||0)+1;e[n]=o,o>=s&&(t=a,s=o)}return t},Qr}var Ho;function bf(){return Ho||(Ho=1,(function(i){var e=vf();i.operation=function(t){var s=i.timeouts(t);return new e(s,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},i.timeouts=function(t){if(t instanceof Array)return[].concat(t);var s={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)s[r]=t[r];if(s.minTimeout>s.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],n=0;n<s.retries;n++)a.push(this.createTimeout(n,s));return t&&t.forever&&!a.length&&a.push(this.createTimeout(n,s)),a.sort(function(o,l){return o-l}),a},i.createTimeout=function(t,s){var r=s.randomize?Math.random()+1:1,a=Math.round(r*Math.max(s.minTimeout,1)*Math.pow(s.factor,t));return a=Math.min(a,s.maxTimeout),a},i.wrap=function(t,s,r){if(s instanceof Array&&(r=s,s=null),!r){r=[];for(var a in t)typeof t[a]=="function"&&r.push(a)}for(var n=0;n<r.length;n++){var o=r[n],l=t[o];t[o]=(function(h){var d=i.operation(s),p=Array.prototype.slice.call(arguments,1),f=p.pop();p.push(function(m){d.retry(m)||(m&&(arguments[0]=d.mainError()),f.apply(this,arguments))}),d.attempt(function(){h.apply(t,p)})}).bind(t,l),t[o].options=s}}})(Kr)),Kr}var Jr,qo;function wf(){return qo||(qo=1,Jr=bf()),Jr}var _f=wf();const Sf=St(_f),Pf=Object.prototype.toString,Ff=i=>Pf.call(i)==="[object Error]",Cf=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function Tf(i){if(!(i&&Ff(i)&&i.name==="TypeError"&&typeof i.message=="string"))return!1;const{message:t,stack:s}=i;return t==="Load failed"||t.startsWith("Load failed (")&&t.endsWith(")")?s===void 0||"__sentry_captured__"in i:t.startsWith("error sending request for url")||t==="Failed to fetch"||t.startsWith("Failed to fetch (")&&t.endsWith(")")?!0:Cf.has(t)}
12class Ia extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const Wo=(i,e,t)=>{const s=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=s,i};async function gu(i,e){return new Promise((t,s)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;const r=Sf.operation(e),a=()=>{r.stop(),s(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",a,{once:!0});const n=()=>{e.signal?.removeEventListener("abort",a),r.stop()};r.attempt(async o=>{try{const l=await i(o);n(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Ia)throw l.originalError;if(l instanceof TypeError&&!Tf(l))throw l;if(Wo(l,o,e),await e.shouldRetry(l)||(r.stop(),s(l)),await e.onFailedAttempt(l),!r.retry(l))throw r.mainError()}catch(u){Wo(u,o,e),n(),s(u)}}})})}class yu extends Error{constructor(e,t){t===void 0&&(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}}function Ef(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new yu(i)})}function vu(i,e){return Object.prototype.hasOwnProperty.call(i,e)}class bu extends Error{constructor(e,t){super(e),this.cause=t?.cause,this.cause&&vu(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function Of(i,e,t){const{progress:s,bytesUploaded:r,bytesTotal:a}=e;s&&(i.uppy.log(`Upload progress: ${s}`),i.uppy.emit("upload-progress",t,{uploader:i,bytesUploaded:r,bytesTotal:a}))}const Af=al(Of,300,{leading:!0,trailing:!0});function xf(i){var e;const s=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${s}`}class Uf extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let wu;function st(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var kf=0;function Ys(i){return"__private_"+kf+++"_"+i}const Rf={version:"3.8.2"};function Mf(i){return i.replace(/\/$/,"")}const _u=10,Df=300*1e3,Nf=401;class If extends Error{constructor(e){let{statusCode:t,message:s}=e;super(s),this.name="HttpError",this.statusCode=t}}async function Bf(i){if(i.status===Nf)throw new Uf;if(i.ok)return i.json();let e=`Failed request with status: ${i.status}. ${i.statusText}`,t;try{t=await i.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(s){throw new Error(e,{cause:s})}throw i.status>=400&&i.status<=499&&t.message?new yf(t.message):new If({statusCode:i.status,message:e})}var rt=Ys("companionHeaders"),Oi=Ys("getUrl"),Zr=Ys("requestSocketToken"),Ai=Ys("awaitRemoteFileUpload");wu=Symbol.for("uppy test: getCompanionHeaders");class nn{constructor(e,t){Object.defineProperty(this,Ai,{value:$f}),Object.defineProperty(this,Oi,{value:Lf}),Object.defineProperty(this,rt,{writable:!0,value:void 0}),Object.defineProperty(this,Zr,{writable:!0,value:async s=>{var r;let{file:a,postBody:n,signal:o}=s;if(((r=a.remote)==null?void 0:r.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(a.remote.url,{...a.remote.body,...n},{signal:o})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),st(this,rt)[rt]=t?.companionHeaders}setCompanionHeaders(e){st(this,rt)[rt]=e}[wu](){return st(this,rt)[rt]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return Mf(e&&e[t]?e[t]:t)}async headers(e){return e===void 0&&(e=!1),{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...st(this,rt)[rt]}}onReceiveResponse(e){const{headers:t}=e,r=this.uppy.getState().companion||{},a=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==r[a]&&this.uppy.setState({companion:{...r,[a]:t.get("i-am")}})}async request(e){let{path:t,method:s="GET",data:r,skipPostResponse:a,signal:n}=e;try{const o=await this.headers(!r),l=await Ef(st(this,Oi)[Oi](t),{method:s,signal:n,headers:o,credentials:this.opts.companionCookiesRule||"same-origin",body:r?JSON.stringify(r):null});return a||this.onReceiveResponse(l),await Bf(l)}catch(o){throw o.isAuthError||o.name==="UserFacingApiError"||o.name==="AbortError"?o:new bu(`Could not ${s} ${st(this,Oi)[Oi](t)}`,{cause:o})}}async get(e,t){return typeof t=="boolean"&&(t={skipPostResponse:t}),this.request({...t,path:e})}
12async post(e,t,s){return typeof s=="boolean"&&(s={skipPostResponse:s}),this.request({...s,path:e,method:"POST",data:t})}async delete(e,t,s){return typeof s=="boolean"&&(s={skipPostResponse:s}),this.request({...s,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,s){var r=this;try{const{signal:a,getQueue:n}=s||{};return await gu(async()=>{var o;const l=(o=this.uppy.getFile(e.id))==null?void 0:o.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),st(this,Ai)[Ai]({file:e,queue:n(),signal:a});const h=await n().wrapPromiseFunction(async function(){try{return await st(r,Zr)[Zr](...arguments)}catch(d){if(d.isAuthError)throw new Ia(d);if(d.cause==null)throw d;const p=d.cause,f=()=>[408,409,429,418,423].includes(p.statusCode)||p.statusCode>=500&&p.statusCode<=599&&![501,505].includes(p.statusCode);throw p.name==="HttpError"&&!f()?new Ia(p):p}},{priority:-1})({file:e,postBody:t,signal:a}).abortOn(a);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:h}),st(this,Ai)[Ai]({file:this.uppy.getFile(e.id),queue:n(),signal:a})},{retries:_u,signal:a,onFailedAttempt:o=>this.uppy.log(`Retrying upload due to: ${o.message}`,"warning")})}catch(a){if(a.name==="AbortError")return;throw this.uppy.emit("upload-error",e,a),a}}}function Lf(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}async function $f(i){let{file:e,queue:t,signal:s}=i,r;const{capabilities:a}=this.uppy.getState();try{return await new Promise((n,o)=>{const l=e.serverToken,u=xf(e.remote.companionUrl);let h,d,p,{isPaused:f}=e;const m=(_,P)=>{if(h==null||h.readyState!==h.OPEN){var E;this.uppy.log(`Cannot send "${_}" to socket ${e.id} because the socket state was ${String((E=h)==null?void 0:E.readyState)}`,"warning");return}h.send(JSON.stringify({action:_,payload:P??{}}))};function y(){a.resumableUploads&&m(f?"pause":"resume")}const g=async()=>{d&&d.abort(),d=new AbortController;const _=E=>{var N;this.uppy.setFileState(e.id,{serverToken:null}),(N=d)==null||N.abort==null||N.abort(),o(E)};function P(){clearTimeout(p),!f&&(p=setTimeout(()=>_(new Error("Timeout waiting for message from Companion socket")),Df))}try{await t.wrapPromiseFunction(async()=>{await gu(async()=>new Promise((N,le)=>{h=new WebSocket(`${u}/api/${l}`),P(),h.addEventListener("close",()=>{h=void 0,le(new Error("Socket closed unexpectedly"))}),h.addEventListener("error",k=>{var M;this.uppy.log(`Companion socket error ${JSON.stringify(k)}, closing socket`,"warning"),(M=h)==null||M.close()}),h.addEventListener("open",()=>{y()}),h.addEventListener("message",k=>{P();try{const{action:ze,payload:ye}=JSON.parse(k.data);switch(ze){case"progress":{Af(this,ye,this.uppy.getFile(e.id));break}case"success":{var M,D,te,ge;const Ke=(M=ye.response)==null?void 0:M.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:ye.url,status:(D=(te=ye.response)==null?void 0:te.status)!=null?D:200,body:Ke?JSON.parse(Ke):void 0}),(ge=d)==null||ge.abort==null||ge.abort(),n();break}case"error":{const{message:Ke}=ye.error;throw Object.assign(new Error(Ke),{cause:ye.error})}default:this.uppy.log(`Companion socket unknown action ${ze}`,"warning")}}catch(ze){_(ze)}});const Q=()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(p),h&&h.close(),h=void 0};d.signal.addEventListener("abort",()=>{Q()})}),{retries:_u,signal:d.signal,onFailedAttempt:()=>{d.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`,"info")}})})().abortOn(d.signal)}catch(E){if(d.signal.aborted)return;_(E)}},b=_=>{if(a.resumableUploads)if(f=_,h&&y(),_){var P;(P=d)==null||P.abort==null||P.abort()}else g()},w=_=>{var P;a.individualCancellation&&_.id===e.id&&(m("cancel"),(P=d)==null||P.abort==null||P.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),n())},S=_=>{var P;let{reason:E}=_;E==="user"&&m("cancel"),(P=d)==null||P.abort==null||P.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),n()},T=(_,P)=>{_===e.id&&b(P)},O=()=>b(!0),v=()=>b(!1);this.uppy.on("file-removed",w),this.uppy.on("cancel-all",S),this.uppy.on("upload-pause",T),this.uppy.on("pause-all",O),this.uppy.on("resume-all",v),r=()=>
12{this.uppy.off("file-removed",w),this.uppy.off("cancel-all",S),this.uppy.off("upload-pause",T),this.uppy.off("pause-all",O),this.uppy.off("resume-all",v)},s.addEventListener("abort",()=>{var _;(_=d)==null||_.abort()}),g()})}finally{r?.()}}nn.VERSION=Rf.version;function at(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var zf=0;function Su(i){return"__private_"+zf+++"_"+i}var ue=Su("uppy"),xi=Su("events");let jf=class{constructor(e){Object.defineProperty(this,ue,{writable:!0,value:void 0}),Object.defineProperty(this,xi,{writable:!0,value:[]}),at(this,ue)[ue]=e}on(e,t){return at(this,xi)[xi].push([e,t]),at(this,ue)[ue].on(e,t)}remove(){for(const[e,t]of at(this,xi)[xi].splice(0))at(this,ue)[ue].off(e,t)}onFilePause(e,t){this.on("upload-pause",(s,r)=>{e===s&&t(r)})}onFileRemove(e,t){this.on("file-removed",s=>{e===s.id&&t(s.id)})}onPause(e,t){this.on("upload-pause",(s,r)=>{e===s&&t(r)})}onRetry(e,t){this.on("upload-retry",s=>{e===s&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{at(this,ue)[ue].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{at(this,ue)[ue].getFile(e)&&t()})}onCancelAll(e,t){var s=this;this.on("cancel-all",function(){at(s,ue)[ue].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{at(this,ue)[ue].getFile(e)&&t()})}};function A(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Hf=0;function we(i){return"__private_"+Hf+++"_"+i}function qf(i){return new Error("Cancelled",{cause:i})}function Vo(i){if(i!=null){var e;const t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});const s=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,s,s)}return this}var Fe=we("activeRequests"),fe=we("queuedHandlers"),Se=we("paused"),Ot=we("pauseTimer"),de=we("downLimit"),At=we("upperLimit"),nt=we("rateLimitingTimer"),ts=we("call"),pt=we("queueNext"),Ba=we("next"),ea=we("queue"),La=we("dequeue"),ta=we("resume"),xt=we("increaseLimit");class Pu{constructor(e){Object.defineProperty(this,La,{value:Yf}),Object.defineProperty(this,ea,{value:Xf}),Object.defineProperty(this,Ba,{value:Gf}),Object.defineProperty(this,pt,{value:Vf}),Object.defineProperty(this,ts,{value:Wf}),Object.defineProperty(this,Fe,{writable:!0,value:0}),Object.defineProperty(this,fe,{writable:!0,value:[]}),Object.defineProperty(this,Se,{writable:!0,value:!1}),Object.defineProperty(this,Ot,{writable:!0,value:void 0}),Object.defineProperty(this,de,{writable:!0,value:1}),Object.defineProperty(this,At,{writable:!0,value:void 0}),Object.defineProperty(this,nt,{writable:!0,value:void 0}),Object.defineProperty(this,ta,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,xt,{writable:!0,value:()=>{if(A(this,Se)[Se]){A(this,nt)[nt]=setTimeout(A(this,xt)[xt],0);return}A(this,de)[de]=this.limit,this.limit=Math.ceil((A(this,At)[At]+A(this,de)[de])/2);for(let t=A(this,de)[de];t<=this.limit;t++)A(this,pt)[pt]();A(this,At)[At]-A(this,de)[de]>3?A(this,nt)[nt]=setTimeout(A(this,xt)[xt],2e3):A(this,de)[de]=Math.floor(A(this,de)[de]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!A(this,Se)[Se]&&A(this,Fe)[Fe]<this.limit?A(this,ts)[ts](e):A(this,ea)[ea](e,t)}wrapSyncFunction(e,t){var s=this;return function(){for(var r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];const o=s.run(()=>(e(...a),queueMicrotask(()=>o.done()),()=>{}),t);return{abortOn:Vo,abort(){o.abort()}}}}wrapPromiseFunction(e,t){var s=this;return function(){for(var r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];let o;const l=new Promise((u,h)=>{o=s.run(()=>{let d,p;try{p=Promise.resolve(e(...a))}catch(f){p=Promise.reject(f)}return p.then(f=>{d?h(d):(o.done(),u(f))},f=>{d?h(d):(o.done(),h(f))}),f=>{d=qf(f)}},t)});return l.abort=u=>{o.abort(u)},l.abortOn=Vo,l}}resume(){A(this,Se)[Se]=!1,clearTimeout(A(this,Ot)[Ot]);for(let e=0;e<this.limit;e++)A(this,pt)[pt]()}pause(e){e===void 0&&(e=null),A(this,Se)[Se]=!0,clearTimeout(A(this,Ot)[Ot]),e!=null&&(A(this,Ot)[Ot]=setTimeout(A(this,ta)[ta],e))}rateLimit(e){clearTimeout(A(this,nt)[nt]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(A(this,At)[At]=this.limit-1,this.limit=A(this,de)[de],A(this,nt)[nt]=setTimeout(A(this,xt)[xt],e))}get isPaused(){return A(this,Se)[Se]}}function Wf(i){A(this,Fe)[Fe]+=1;let e=!1,t;try{t=i()}catch(s){throw A(this,Fe)[Fe]-=1,s}return{abort:s=>{e||(e=!0,A(this,Fe)[Fe]-=1,t?.(s),A(this,pt)[pt]())},done:()=>{e||(e=!0,A(this,Fe)[Fe]-=1,A(this,pt)[pt]())}}}function Vf(){queueMicrotask(()=>A(this,Ba)[Ba]())}function Gf(){if(A(this,Se)[Se]||A(this,Fe)[Fe]>=this.limit||A(this,fe)[fe].length===0)return;const i=A(this,fe)[fe].shift();if(i==null)throw new Error("Invariant violation: next is null");const e=A(this,ts)[ts](i.fn);i.abort=e.abort,i.done=e.done}function Xf(i,e){const t={fn:i,priority:e?.priority||0,abort:()=>{A(this,La)[La](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},s=A(this,fe)[fe].findIndex(r=>t.priority>r.priority);return s===-1?A(this,fe)[fe].push(t):A(this,fe)[fe].splice(s,0,t),t}function Yf(i){const e=A(this,fe)[fe].indexOf(i);e!==-1&&A(this,fe)[fe].splice(e,1)}const Fu=Symbol("__queue");function Cu(i){const e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Tu(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}const{AbortController:ia}=globalThis,Eu=function(i,e){i===void 0&&(i="Aborted");const t=new DOMException(i,"AbortError");return e!=null&&vu(e,"cause")&&Object.defineProperty(t,"cause",{__proto__:null,configurable:!0,writable:!0,value:e.cause}),t};function C(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Kf=0;function K(i){return"__private_"+Kf+++"_"+i}const Qf=1024*1024,Go={getChunkSize(i){return Math.ceil(i.size/1e4)},onProgress(){},onPartComplete(){},onSuccess(){},onError(i){throw i}};function Jf(i){if(typeof i=="string")return parseInt(i,10);if(typeof i=="number")return i;throw new TypeError("Expected a number")}const Ls=Symbol("pausing upload, not an actual error");var ne=K("abortController"),Y=K("chunks"),pe=K("chunkState"),Ce=K("data"),Oe=K("file"),is=K("uploadHasStarted"),Ui=K("onError"),Jt=K("onSuccess"),ht=K("shouldUseMultipart"),Wt=K("isRestoring"),hs=K("onReject"),Lt=K("maxMultipartParts"),Gi=K("minPartSize"),sa=K("initChunks"),ra=K("createUpload"),ki=K("resumeUpload"),Xi=K("onPartProgress"),Yi=K("onPartComplete"),aa=K("abortUpload");class Zf{constructor(e,t){var s,r;Object.defineProperty(this,aa,{value:sm}),Object.defineProperty(this,ki,{value:im}),Object.defineProperty(this,ra,{value:tm}),Object.defineProperty(this,sa,{value:em}
12),Object.defineProperty(this,ne,{writable:!0,value:new ia}),Object.defineProperty(this,Y,{writable:!0,value:void 0}),Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,Ce,{writable:!0,value:void 0}),Object.defineProperty(this,Oe,{writable:!0,value:void 0}),Object.defineProperty(this,is,{writable:!0,value:!1}),Object.defineProperty(this,Ui,{writable:!0,value:void 0}),Object.defineProperty(this,Jt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,Wt,{writable:!0,value:void 0}),Object.defineProperty(this,hs,{writable:!0,value:a=>a?.cause===Ls?null:C(this,Ui)[Ui](a)}),Object.defineProperty(this,Lt,{writable:!0,value:1e4}),Object.defineProperty(this,Gi,{writable:!0,value:5*Qf}),Object.defineProperty(this,Xi,{writable:!0,value:a=>n=>{if(!n.lengthComputable)return;C(this,pe)[pe][a].uploaded=Jf(n.loaded);const o=C(this,pe)[pe].reduce((l,u)=>l+u.uploaded,0);this.options.onProgress(o,C(this,Ce)[Ce].size)}}),Object.defineProperty(this,Yi,{writable:!0,value:a=>n=>{C(this,Y)[Y][a]=null,C(this,pe)[pe][a].etag=n,C(this,pe)[pe][a].done=!0;const o={PartNumber:a+1,ETag:n};this.options.onPartComplete(o)}}),this.options={...Go,...t},(r=(s=this.options).getChunkSize)!=null||(s.getChunkSize=Go.getChunkSize),C(this,Ce)[Ce]=e,C(this,Oe)[Oe]=t.file,C(this,Jt)[Jt]=this.options.onSuccess,C(this,Ui)[Ui]=this.options.onError,C(this,ht)[ht]=this.options.shouldUseMultipart,C(this,Wt)[Wt]=t.uploadId&&t.key,C(this,sa)[sa]()}start(){C(this,is)[is]?(C(this,ne)[ne].signal.aborted||C(this,ne)[ne].abort(Ls),C(this,ne)[ne]=new ia,C(this,ki)[ki]()):C(this,Wt)[Wt]?(this.options.companionComm.restoreUploadFile(C(this,Oe)[Oe],{uploadId:this.options.uploadId,key:this.options.key}),C(this,ki)[ki]()):C(this,ra)[ra]()}pause(){C(this,ne)[ne].abort(Ls),C(this,ne)[ne]=new ia}abort(e){e!=null&&e.really?C(this,aa)[aa]():this.pause()}get chunkState(){return C(this,pe)[pe]}}function em(){const i=C(this,Ce)[Ce].size,e=typeof C(this,ht)[ht]=="function"?C(this,ht)[ht](C(this,Oe)[Oe]):!!C(this,ht)[ht];if(e&&i>C(this,Gi)[Gi]){let t=Math.max(this.options.getChunkSize(C(this,Ce)[Ce]),C(this,Gi)[Gi]),s=Math.floor(i/t);s>C(this,Lt)[Lt]&&(s=C(this,Lt)[Lt],t=i/C(this,Lt)[Lt]),C(this,Y)[Y]=Array(s);for(let r=0,a=0;r<i;r+=t,a++){const n=Math.min(i,r+t),o=()=>{const l=r;return C(this,Ce)[Ce].slice(l,n)};if(C(this,Y)[Y][a]={getData:o,onProgress:C(this,Xi)[Xi](a),onComplete:C(this,Yi)[Yi](a),shouldUseMultipart:e},C(this,Wt)[Wt]){const l=r+t>i?i-r:t;C(this,Y)[Y][a].setAsUploaded=()=>{C(this,Y)[Y][a]=null,C(this,pe)[pe][a].uploaded=l}}}}else C(this,Y)[Y]=[{getData:()=>C(this,Ce)[Ce],onProgress:C(this,Xi)[Xi](0),onComplete:C(this,Yi)[Yi](0),shouldUseMultipart:e}];C(this,pe)[pe]=C(this,Y)[Y].map(()=>({uploaded:0}))}function tm(){this.options.companionComm.uploadFile(C(this,Oe)[Oe],C(this,Y)[Y],C(this,ne)[ne].signal).then(C(this,Jt)[Jt],C(this,hs)[hs]),C(this,is)[is]=!0}function im(){this.options.companionComm.resumeUploadFile(C(this,Oe)[Oe],C(this,Y)[Y],C(this,ne)[ne].signal).then(C(this,Jt)[Jt],C(this,hs)[hs])}function sm(){C(this,ne)[ne].abort(),this.options.companionComm.abortFileUpload(C(this,Oe)[Oe]).catch(i=>this.options.log(i))}function oe(i){if(i!=null&&i.aborted)throw Eu("The operation was aborted",{cause:i.reason})}function rm(i){let{method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:s="",SignedHeaders:r,HashedPayload:a}=i;const n=Object.keys(r).map(o=>o.toLowerCase()).sort();return[e,t,s,...n.map(o=>`${o}:${r[o]}`),"",n.join(";"),a].join(` 13`)}const on=new TextEncoder,ln={name:"HMAC",hash:"SHA-256"};async function am(i){const{subtle:e}=globalThis.crypto;return e.digest(ln.hash,on.encode(i))}async function nm(i){const{subtle:e}=globalThis.crypto;return e.importKey("raw",typeof i=="string"?on.encode(i):i,ln,!1,["sign"])}function Xo(i){const e=new Uint8Array(i);let t="";for(let s=0;s<e.length;s++)t+=e[s].toString(16).padStart(2,"0");return t}async function Ri(i,e){const{subtle:t}=globalThis.crypto;return t.sign(ln,await nm(i),on.encode(e))}async function om(i){let{accountKey:e,accountSecret:t,sessionToken:s,bucketN
13ame:r,Key:a,Region:n,expires:o,uploadId:l,partNumber:u}=i;const h="s3",d=`${r}.${h}.${n}.amazonaws.com`,p=`/${encodeURI(a).replace(/[;?:@&=+$,#!'()*]/g,N=>`%${N.charCodeAt(0).toString(16).toUpperCase()}`)}`,f="UNSIGNED-PAYLOAD",m=new Date().toISOString().replace(/[-:]|\.\d+/g,""),y=m.slice(0,8),g=`${y}/${n}/${h}/aws4_request`,b=new URL(`https://${d}${p}`);b.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),b.searchParams.set("X-Amz-Content-Sha256",f),b.searchParams.set("X-Amz-Credential",`${e}/${g}`),b.searchParams.set("X-Amz-Date",m),b.searchParams.set("X-Amz-Expires",o),b.searchParams.set("X-Amz-Security-Token",s),b.searchParams.set("X-Amz-SignedHeaders","host"),u&&b.searchParams.set("partNumber",u),l&&b.searchParams.set("uploadId",l),b.searchParams.set("x-id",u&&l?"UploadPart":"PutObject");const w=rm({CanonicalUri:p,CanonicalQueryString:b.search.slice(1),SignedHeaders:{host:d},HashedPayload:f}),S=Xo(await am(w)),T=["AWS4-HMAC-SHA256",m,g,S].join(` 14`),O=await Ri(`AWS4${t}`,y),v=await Ri(O,n),_=await Ri(v,h),P=
14await Ri(_,"aws4_request"),E=Xo(await Ri(P,T));return b.searchParams.set("X-Amz-Signature",E),b}function x(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var lm=0;function me(i){return"__private_"+lm+++"_"+i}function um(i){const e=new URL(i);return e.search="",e.hash="",e.href}var Mi=me("abortMultipartUpload"),se=me("cache"),Di=me("createMultipartUpload"),Ni=me("fetchSignature"),ss=me("getUploadParameters"),Ii=me("listParts"),$t=me("previousRetryDelay"),Vt=me("requests"),Ut=me("retryDelays"),kt=me("sendCompletionRequest"),Rt=me("setS3MultipartState"),Gt=me("uploadPartBytes"),ae=me("getFile"),na=me("shouldRetry"),Bi=me("nonMultipartUpload");class dm{constructor(e,t,s,r){Object.defineProperty(this,Bi,{value:cm}),Object.defineProperty(this,na,{value:hm}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,se,{writable:!0,value:new WeakMap}),Object.defineProperty(this,Di,{writable:!0,value:void 0}),Object.defineProperty(this,Ni,{writable:!0,value:void 0}),Object.defineProperty(this,ss,{writable:!0,value:void 0}),Object.defineProperty(this,Ii,{writable:!0,value:void 0}),Object.defineProperty(this,$t,{writable:!0,value:void 0}),Object.defineProperty(this,Vt,{writable:!0,value:void 0}),Object.defineProperty(this,Ut,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),Object.defineProperty(this,Rt,{writable:!0,value:void 0}),Object.defineProperty(this,Gt,{writable:!0,value:void 0}),Object.defineProperty(this,ae,{writable:!0,value:void 0}),x(this,Vt)[Vt]=e,x(this,Rt)[Rt]=s,x(this,ae)[ae]=r,this.setOptions(t)}setOptions(e){const t=x(this,Vt)[Vt];if("abortMultipartUpload"in e&&(x(this,Mi)[Mi]=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(x(this,Di)[Di]=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(x(this,Ni)[Ni]=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(x(this,Ii)[Ii]=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(x(this,kt)[kt]=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e){var s;x(this,Ut)[Ut]=(s=e.retryDelays)!=null?s:[]}"uploadPartBytes"in e&&(x(this,Gt)[Gt]=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(x(this,ss)[ss]=t.wrapPromiseFunction(e.getUploadParameters))}async getUploadId(e,t){let s;for(;(s=x(this,se)[se].get(e.data))!=null;)try{return await s}catch{}const r=x(this,Di)[Di](x(this,ae)[ae](e),t),a=()=>{r.abort(t.reason),x(this,se)[se].delete(e.data)};return t.addEventListener("abort",a,{once:!0}),x(this,se)[se].set(e.data,r),r.then(async n=>{t.removeEventListener("abort",a),x(this,Rt)[Rt](e,n),x(this,se)[se].set(e.data,n)},()=>{t.removeEventListener("abort",a),x(this,se)[se].delete(e.data)}),r}async abortFileUpload(e){const t=x(this,se)[se].get(e.data);if(t==null)return;x(this,se)[se].delete(e.data),x(this,Rt)[Rt](e,Object.create(null));let s;try{s=await t}catch{return}await x(this,Mi)[Mi](x(this,ae)[ae](e),s)}async uploadFile(e,t,s){if(oe(s),t.length===1&&!t[0].shouldUseMultipart)return x(this,Bi)[Bi](e,t[0],s);const{uploadId:r,key:a}=await this.getUploadId(e,s);oe(s);try{const n=await Promise.all(t.map((o,l)=>this.uploadChunk(e,l+1,o,s)));return oe(s),await x(this,kt)[kt](x(this,ae)[ae](e),{key:a,uploadId:r,parts:n,signal:s},s).abortOn(s)}catch(n){throw n?.cause!==Ls&&n?.name!=="AbortError"&&this.abortFileUpload(e),n}}restoreUploadFile(e,t){x(this,se)[se].set(e.data,t)}async resumeUploadFile(e,t,s){if(oe(s),t.length===1&&t[0]!=null&&!t[0].shouldUseMultipart)return x(this,Bi)[Bi](e,t[0],s);const{uploadId:r,key:a}=await this.getUploadId(e,s);oe(s);const n=await x(this,Ii)[Ii](x(this,ae)[ae](e),{uploadId:r,key:a,signal:s},s).abortOn(s);oe(s);const o=await Promise.all(t.map((l,u)=>{const h=u+1,d=n.find(p=>{let{PartNumber:f}=p;return f===h});return d==null?this.uploadChunk(e,h,l,s):(l==null||l.setAsUploaded==null||l.setAsUploaded(),{PartNumber:h,ETag:d.ETag})}));return oe(s),x(this,kt)[kt](x(this,ae)[ae](e),{key:a,uploadId:r,parts:o,signal:s},s).abortOn(s)}async uploadChunk(e,t,s,r){oe(r);const{uploadId:a,key:n}=await this.getUploadId(e,r),o=x(this,Ut)[Ut].values(),l=x(this,Ut)[Ut].values(),u=()=>{const h=o.next();return h==null||h.done?null:h.value};for(;;){oe(r);const h=s.getData(),{onProgress:d,onComplete:p}=s;let f;try{f=await x(this,Ni)[Ni](x(this,ae)[ae](e),{uploadId:a,key:n,partNumber:t,body:h,signal:r}).abortOn(r)}catch(m){const y=u();if(y==null||r.aborted)throw m;await new Promise(g=>setTimeout(g,y));continue}oe(r);try{return{PartNumber:t,...await x(this,Gt)[Gt]({signature:f,body:h,size:h.size,onProgress:d,onComplete:p,signal:r}).abortOn(r)}}catch(m){if(!await x(this,na)[na](m,l))throw m}}}}async function hm(i,e){var t;const s=x(this,Vt)[Vt],r=i==null||(t=i.source)==null?void 0:t.status;if(r==null)return!1;if(r===403&&i.message==="Request has expired"){if(!s.isPaused){if(s.limit===1||x(this,$t)[$t]==null){const a=e.next();if(a==null||a.done)return!1;x(this,$t)[$t]=a.value}s.rateLimit(0),await new Promise(a=>setTimeout(a,x(this,$t)[$t]))}}else if(r===429){if(!s.isPaused){const a=e.next();if(a==null||a.done)return!1;s.rateLimit(a.value)}}else{if(r>400&&r<500&&r!==409)return!1;if(typeof navigator<"u"&&navigator.onLine===!1)s.isPaused||(s.pause(),window.addEventListener("online",()=>{s.resume()},{once:!0}));else{const a=e.next();if(a==null||a.done)return!1;await new Promise(n=>setTimeout(n,a.value))}}return!0}async function cm(i,e,t){const{method:s="POST",url:r,fields:a,headers:n}=await x(this,ss)[ss](x(this,ae)[ae](i),{signal:t}).abortOn(t);let o;const l=e.getData();if(s.toUpperCase()==="POST"){const p=new FormData;
14Object.entries(a).forEach(f=>{let[m,y]=f;return p.set(m,y)}),p.set("file",l),o=p}else o=l;const{onProgress:u,onComplete:h}=e,d=await x(this,Gt)[Gt]({signature:{url:r,headers:n,method:s},body:o,size:l.size,onProgress:u,onComplete:h,signal:t}).abortOn(t);return"location"in d?d:{location:um(r),...d}}let Ou;function U(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var pm=0;function ke(i){return"__private_"+pm+++"_"+i}const fm={version:"3.12.0"};function si(i){if(i!=null&&i.error){const e=new Error(i.message);throw Object.assign(e,i.error),e}return i}function Au(i){const e=i.Expiration;if(e){const t=Math.floor((new Date(e)-Date.now())/1e3);if(t>9)return t}}function Yo(i){let{meta:e,allowedMetaFields:t,querify:s=!1}=i;const r=t??Object.keys(e);return e?Object.fromEntries(r.filter(a=>e[a]!=null).map(a=>{const n=s?`metadata[${a}]`:a,o=String(e[a]);return[n,o]})):{}}const mm={allowedMetaFields:null,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:i=>i.size!==0,retryDelays:[0,1e3,3e3,5e3],companionHeaders:{}};var Xt=ke("companionCommunicationQueue"),H=ke("client"),re=ke("cachedTemporaryCredentials"),oa=ke("getTemporarySecurityCredentials"),la=ke("setS3MultipartState"),Qt=ke("getFile"),ua=ke("uploadLocalFile"),da=ke("getCompanionClientArgs"),Li=ke("upload"),Mt=ke("setCompanionHeaders"),ot=ke("setResumableUploadsCapability"),$i=ke("resetResumableCapability");Ou=Symbol.for("uppy test: getClient");class Ks extends Wa{constructor(e,t){var s;super(e,{...mm,uploadPartBytes:Ks.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),Object.defineProperty(this,da,{value:vm}),Object.defineProperty(this,ua,{value:ym}),Object.defineProperty(this,oa,{value:gm}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,re,{writable:!0,value:void 0}),Object.defineProperty(this,la,{writable:!0,value:(a,n)=>{let{key:o,uploadId:l}=n;const u=this.uppy.getFile(a.id);u!=null&&this.uppy.setFileState(a.id,{s3Multipart:{...u.s3Multipart,ke
14y:o,uploadId:l}})}}),Object.defineProperty(this,Qt,{writable:!0,value:a=>this.uppy.getFile(a.id)||a}),Object.defineProperty(this,Li,{writable:!0,value:async a=>{if(a.length===0)return;const n=this.uppy.getFilesByIds(a),o=Cu(n),l=Tu(o);this.uppy.emit("upload-start",l);const u=o.map(d=>{if(d.isRemote){const p=()=>this.requests;U(this,ot)[ot](!1);const f=new AbortController,m=g=>{g.id===d.id&&f.abort()};this.uppy.on("file-removed",m);const y=this.uppy.getRequestClientForFile(d).uploadRemoteFile(d,U(this,da)[da](d),{signal:f.signal,getQueue:p});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",m)},{priority:-1})(),y}return U(this,ua)[ua](d)}),h=await Promise.all(u);return U(this,ot)[ot](!0),h}}),Object.defineProperty(this,Mt,{writable:!0,value:()=>{U(this,H)[H].setCompanionHeaders(this.opts.companionHeaders)}}),Object.defineProperty(this,ot,{writable:!0,value:a=>{const{capabilities:n}=this.uppy.getState();this.uppy.setState({capabilities:{...n,resumableUploads:a}})}}),Object.defineProperty(this,$i,{writable:!0,value:()=>{U(this,ot)[ot](!0)}}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.title="AWS S3 Multipart",U(this,H)[H]=new nn(e,t);const r={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t!=null&&t.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t!=null&&t.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(const a of Object.keys(r))this.opts[a]==null&&(this.opts[a]=r[a].bind(this));t?.prepareUploadParts!=null&&t.signPart==null&&(this.opts.signPart=async(a,n)=>{let{uploadId:o,key:l,partNumber:u,body:h,signal:d}=n;const{presignedUrls:p,headers:f}=await t.prepareUploadParts(a,{uploadId:o,key:l,parts:[{number:u,chunk:h}],signal:d});return{url:p?.[u],headers:f?.[u]}}),this.requests=(s=this.opts.rateLimitedQueue)!=null?s:new Pu(this.opts.limit),U(this,Xt)[Xt]=new dm(this.requests,this.opts,U(this,la)[la],U(this,Qt)[Qt]),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.uploaderSockets=Object.create(null)}[Ou](){return U(this,H)[H]}setOptions(e){U(this,Xt)[Xt].setOptions(e),super.setOptions(e),U(this,Mt)[Mt]()}resetUploaderReferences(e,t){this.uploaders[e]&&(this.uploaders[e].abort({really:t?.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)}assertHost(e){if(!this.opts.companionUrl)throw new Error(`Expected a \`companionUrl\` option containing a Companion address, or if you are not using Companion, a custom \`${e}\` implementation.`)}createMultipartUpload(e,t){this.assertHost("createMultipartUpload"),oe(t);const s=Yo({meta:e.meta,allowedMetaFields:this.opts.allowedMetaFields});return U(this,H)[H].post("s3/multipart",{filename:e.name,type:e.type,metadata:s},{signal:t}).then(si)}listParts(e,t,s){var r;let{key:a,uploadId:n,signal:o}=t;(r=o)!=null||(o=s),this.assertHost("listParts"),oe(o);const l=encodeURIComponent(a);return U(this,H)[H].get(`s3/multipart/${n}?key=${l}`,{signal:o}).then(si)}completeMultipartUpload(e,t,s){var r;let{key:a,uploadId:n,parts:o,signal:l}=t;(r=l)!=null||(l=s),this.assertHost("completeMultipartUpload"),oe(l);const u=encodeURIComponent(a),h=encodeURIComponent(n);return U(this,H)[H].post(`s3/multipart/${h}/complete?key=${u}`,{parts:o},{signal:l}).then(si)}async createSignedURL(e,t){const s=await U(this,oa)[oa](t),r=Au(s.credentials)||604800,{uploadId:a,key:n,partNumber:o}=t;return{method:"PUT",expires:r,fields:{},url:`${await om({accountKey:s.credentials.AccessKeyId,accountSecret:s.credentials.SecretAccessKey,sessionToken:s.credentials.SessionToken,expires:r,bucketName:s.bucket,Region:s.region,Key:n??`${crypto.randomUUID()}-${e.name}`,uploadId:a,partNumber:o})}`,headers:{"Content-Type":e.type}}}signPart(e,t){let{uploadId:s,key:r,partNumber:a,signal:n}=t;if(this.assertHost("signPart"),oe(n),s==null||r==null||a==null)throw new Error("Cannot sign without a key, an uploadId, and a partNumber");const o=encodeURIComponent(r);return U(this,H)[H].get(`s3/multipart/${s}/${a}?key=${o}`,{signal:n}).then(si)}abortMultipartUpload(e,t,s){var r;let{key:a,uploadId:n,signal:o}=t;(r=o)!=null||(o=s),this.assertHost("abortMultipartUpload");const l=encodeURIComponent(a),u=encodeURIComponent(n);return U(this,H)[H].delete(`s3/multipart/${u}?key=${l}`,void 0,{signal:o}).then(si)}getUploadParameters(e,t){const{meta:s}=e,{type:r,name:a}=s,n=Yo({meta:s,allowedMetaFields:this.opts.allowedMetaFields,querify:!0}),o=new URLSearchParams({filename:a,type:r,...n});return U(this,H)[H].get(`s3/params?${o}`,t)}static async uploadPartBytes(e){let{signature:{url:t,expires:s,headers:r,method:a="PUT"},body:n,size:o=n.size,onProgress:l,onComplete:u,signal:h}=e;if(oe(h),t==null)throw new Error("Cannot upload to an undefined URL");return new Promise((d,p)=>{const f=new XMLHttpRequest;f.open(a,t,!0),r&&Object.keys(r).forEach(g=>{f.setRequestHeader(g,r[g])}),f.responseType="text",typeof s=="number"&&(f.timeout=s*1e3);function m(){f.abort()}function y(){h?.removeEventListener("abort",m)}h?.addEventListener("abort",m),f.upload.addEventListener("progress",g=>{l(g)}),f.addEventListener("abort",()=>{y(),p(Eu())}),f.addEventListener("timeout",()=>{y();const g=new Error("Request has expired");g.source={status:403},p(g)}),f.addEventListener("load",()=>{if(y(),f.status===403&&f.responseText.includes("<Message>Request has expired</Message>")){const T=new Error("Request has expired");T.source=f,p(T);return}
14if(f.status<200||f.status>=300){const T=new Error("Non 2xx");T.source=f,p(T);return}l?.({loaded:o,lengthComputable:!0});const g=f.getAllResponseHeaders().trim().split(/[\r\n]+/),b={__proto__:null};for(const T of g){const O=T.split(": "),v=O.shift(),_=O.join(": ");b[v]=_}const{etag:w,location:S}=b;if(a.toUpperCase()==="POST"&&S===null&&console.warn("AwsS3/Multipart: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."),w===null){p(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."));return}u?.(w),d({...b,ETag:w})}),f.addEventListener("error",g=>{y();const b=new Error("Unknown error");b.source=g.target,p(b)}),f.send(n)})}install(){U(this,ot)[ot](!0),this.uppy.addPreProcessor(U(this,Mt)[Mt]),this.uppy.addUploader(U(this,Li)[Li]),this.uppy.on("cancel-all",U(this,$i)[$i])}uninstall(){this.uppy.removePreProcessor(U(this,Mt)[Mt]),this.uppy.removeUploader(U(this,Li)[Li]),this.uppy.off("cancel-all",U(this,$i)[$i])}}async function gm(i){return oe(i?.signal),U(this,re)[re]==null&&(this.opts.getTemporarySecurityCredentials===!0?(this.assertHost("getTemporarySecurityCredentials"),U(this,re)[re]=U(this,H)[H].get("s3/sts",i).then(si)):U(this,re)[re]=this.opts.getTemporarySecurityCredentials(i),U(this,re)[re]=await U(this,re)[re],setTimeout(()=>{U(this,re)[re]=null},(Au(U(this,re)[re].credentials)||0)*500)),U(this,re)[re]}function ym(i){var e=this;return new Promise((t,s)=>{const r=(u,h)=>{this.uppy.emit("upload-progress",this.uppy.getFile(i.id),{uploader:this,bytesUploaded:u,bytesTotal:h})},a=u=>{this.uppy.log(u),this.uppy.emit("upload-error",i,u),this.resetUploaderReferences(i.id),s(u)},n=u=>{const h={body:{...u},status:200,uploadURL:u.location};this.resetUploaderReferences(i.id),this.uppy.emit("upload-success",U(this,Qt)[Qt](i),h),u.location&&this.uppy.log(`Download ${i.name} from ${u.location}`),t()},o=new Zf(i.data,{companionComm:U(this,Xt)[Xt],log:function(){return e.uppy.log(...arguments)},getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):null,onProgress:r,onError:a,onSuccess:n,onPartComplete:u=>{this.uppy.emit("s3-multipart:part-uploaded",U(this,Qt)[Qt](i),u)},file:i,shouldUseMultipart:this.opts.shouldUseMultipart,...i.s3Multipart});this.uploaders[i.id]=o;const l=new jf(this.uppy);this.uploaderEvents[i.id]=l,l.onFileRemove(i.id,u=>{o.abort(),this.resetUploaderReferences(i.id,{abort:!0}),t(`upload ${u} was removed`)}),l.onCancelAll(i.id,u=>{u?.reason==="user"&&(o.abort(),this.resetUploaderReferences(i.id,{abort:!0})),t(`upload ${i.id} was canceled`)}),l.onFilePause(i.id,u=>{u?o.pause():o.start()}),l.onPauseAll(i.id,()=>{o.pause()}),l.onResumeAll(i.id,()=>{o.start()}),o.start()})}function vm(i){var e;return{...(e=i.remote)==null?void 0:e.body,protocol:"s3-multipart",size:i.data.size,metadata:i.meta}}Ks.VERSION=fm.version;function lt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var bm=0;function xu(i){return"__private_"+bm+++"_"+i}var he=xu("uppy"),zi=xu("events");class wm{constructor(e){Object.defineProperty(this,he,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:[]}),lt(this,he)[he]=e}on(e,t){return lt(this,zi)[zi].push([e,t]),lt(this,he)[he].on(e,t)}remove(){for(const[e,t]of lt(this,zi)[zi].splice(0))lt(this,he)[he].off(e,t)}onFilePause(e,t){this.on("upload-pause",(s,r)=>{e===s&&t(r)})}onFileRemove(e,t){this.on("file-removed",s=>{e===s.id&&t(s.id)})}onPause(e,t){this.on("upload-pause",(s,r)=>{e===s&&t(r)})}onRetry(e,t){this.on("upload-retry",s=>{e===s&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{lt(this,he)[he].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{lt(this,he)[he].getFile(e)&&t()})}onCancelAll(e,t){var s=this;this.on("cancel-all",function(){lt(s,he)[he].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{lt(this,he)[he].getFile(e)&&t()})}}function Ae(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var _m=0;function Qs(i){return"__private_"+_m+++"_"+i}var ut=Qs("aliveTimer"),Dt=Qs("isDone"),ji=Qs("onTimedOut"),Nt=Qs("timeout");class Sm{constructor(e,t){Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,Dt,{writable:!0,value:!1}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Nt,{writable:!0,value:void 0}),Ae(this,Nt)[Nt]=e,Ae(this,ji)[ji]=()=>t(e)}progress(){Ae(this,Dt)[Dt]||Ae(this,Nt)[Nt]>0&&(clearTimeout(Ae(this,ut)[ut]),Ae(this,ut)[ut]=setTimeout(Ae(this,ji)[ji],Ae(this,Nt)[Nt]))}done(){Ae(this,Dt)[Dt]||(clearTimeout(Ae(this,ut)[ut]),Ae(this,ut)[ut]=void 0,Ae(this,Dt)[Dt]=!0)}}function Pm(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}function Ko(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Fm=0;function Uu(i){return"__private_"+Fm+++"_"+i}function Qo(i,e){if(Pm(i))return new yu(e,i);const t=new bu("Upload error",{cause:e});return t.request=i,t}function Cm(i){return i.data.slice(0,i.data.size,i.meta.type)}function Tm(i,e,t){(Array.isArray(t.allowedMetaFields)?t.allowedMetaFields:Object.keys(e)).forEac
14h(r=>{i.append(r,e[r])})}function Em(i,e){const t=new FormData;Tm(t,i.meta,e);const s=Cm(i);return i.name?t.append(e.fieldName,s,i.meta.name):t.append(e.fieldName,s),t}const Om=i=>i.data;var ha=Uu("addEventHandlerForFile"),ca=Uu("addEventHandlerIfFileStillExists");class Am{constructor(e,t){Object.defineProperty(this,ca,{value:Um}),Object.defineProperty(this,ha,{value:xm}),this.uppy=e,this.opts={validateStatus(s){return s>=200&&s<300},...t},this.requests=t[Fu],this.uploaderEvents=Object.create(null),this.i18n=t.i18n}getOptions(e){var t;const{uppy:s}=this,r=s.getState().xhrUpload;return{...this.opts,...r||{},...e.xhrUpload||{},headers:{...this.opts.headers,...r?.headers,...(t=e.xhrUpload)==null?void 0:t.headers}}}uploadLocalFile(e){const t=this.getOptions(e);return new Promise((s,r)=>{const a=t.formData?Em(e,t):Om(e),n=new XMLHttpRequest;this.uploaderEvents[e.id]=new wm(this.uppy);const o=new Sm(t.timeout,()=>{n.abort(),u.done();const h=new Error(this.i18n("timedOut",{seconds:Math.ceil(t.timeout/1e3)}));this.uppy.emit("upload-error",e,h),r(h)}),l=Vs();n.upload.addEventListener("loadstart",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} started`)}),n.upload.addEventListener("progress",h=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} progress: ${h.loaded} / ${h.total}`),o.progress(),h.lengthComputable&&this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,bytesUploaded:h.loaded,bytesTotal:h.total})}),n.addEventListener("load",h=>{if(this.uppy.log(`[AwsS3/XHRUpload] ${l} finished`),o.done(),u.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),t.validateStatus(h.target.status,n.responseText,n)){const m=t.getResponseData(n.responseText,n),y=m[t.responseUrlFieldName],g={status:h.target.status,body:m,uploadURL:y};
14return this.uppy.emit("upload-success",this.uppy.getFile(e.id),g),y&&this.uppy.log(`Download ${e.name} from ${y}`),s(e)}const d=t.getResponseData(n.responseText,n),p=Qo(n,t.getResponseError(n.responseText,n)),f={status:h.target.status,body:d};return this.uppy.emit("upload-error",e,p,f),r(p)}),n.addEventListener("error",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} errored`),o.done(),u.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const h=Qo(n,t.getResponseError(n.responseText,n));return this.uppy.emit("upload-error",e,h),r(h)}),n.open(t.method.toUpperCase(),t.endpoint,!0),n.withCredentials=!!t.withCredentials,t.responseType!==""&&(n.responseType=t.responseType),Object.keys(t.headers).forEach(h=>{n.setRequestHeader(h,t.headers[h])});const u=this.requests.run(()=>(n.send(a),()=>{o.done(),n.abort()}),{priority:1});Ko(this,ha)[ha]("file-removed",e.id,()=>{u.abort(),r(new Error("File removed"))}),Ko(this,ca)[ca]("cancel-all",e.id,function(h){let{reason:d}=h===void 0?{}:h;d==="user"&&u.abort(),r(new Error("Upload cancelled"))})})}}function xm(i,e,t){this.uploaderEvents[e].on(i,s=>{var r;const a=(r=s?.id)!=null?r:s;e===a&&t()})}function Um(i,e,t){var s=this;this.uploaderEvents[e].on(i,function(){s.uppy.getFile(e)&&t(...arguments)})}function km(i){return i.replace(/;.*$/,"")}function ku(i,e){const t=e.headers?e.headers["content-type"]:e.getResponseHeader("Content-Type");if(typeof t=="string"){const s=km(t).toLowerCase();if(s==="application/xml"||s==="text/xml"||s==="text/html"&&/^<\?xml /.test(i))return!0}return!1}const Rm={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};let Ru;function X(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Mm=0;function hi(i){return"__private_"+Mm+++"_"+i}const Dm={version:"3.6.2"};function Nm(i,e){return!i&&!e.startsWith("https://")&&!e.startsWith("http://")&&(e=`https://${e}`),new URL(e,i||void 0).toString()}function Ki(i,e){const t=i.indexOf(`<${e}>`),s=i.indexOf(`</${e}>`,t);return t!==-1&&s!==-1?i.slice(t+e.length+2,s):""}function Im(i){if(i&&i.error){const e=new Error(i.message);throw Object.assign(e,i.error),e}return i}function Bm(i,e){if(!(e!=null&&typeof e.url=="string"&&(typeof e.fields=="object"||e.fields==null)))throw new TypeError(`AwsS3: got incorrect result from 'getUploadParameters()' for file '${i.name}', expected an object '{ url, method, fields, headers }' but got '${JSON.stringify(e)}' instead. 15See https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.`);if(!(e.method==null||/^p(u|os)t$/i.test(e.method)))throw new TypeError(`AwsS3: got incorrect method from 'getUploadParameters()' for file '${i.name}', expected 'PUT' or 'POST' but got '${e.method}' instead. 16See https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.`)}function Lm(i,e){if(!ku(i,e))return;const t=Ki(i,"Message");return new Error(t)}let Jo=!1;var _e=hi("client"),Me=hi("requests"),It=hi("uploader"),Hi=hi("handleUpload"),qi=hi("setCompanionHeaders"),pa=hi("getCompanionClientArgs");Ru=Symbol.for("uppy test: getClient");class Mu extends Wa{constructor(e,t){if(t?.shouldUseMultipart!=null)return new Ks(e,t);super(e,t),Object.defineProperty(this,_e,{writable:!0,value:void 0}),Object.defineProperty(this,Me,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),Object.defineProperty(this,Hi,{writable:!0,value:async r=>{const a=Object.create(null);function n(p){var f;const{id:m}=p;(f=a[m])==null||f.abort()}this.uppy.on("file-removed",n);const o=this.uppy.getFilesByIds(r),l=Cu(o),u=Tu(l);this.uppy.emit("upload-start",u);const h=X(this,Me)[Me].wrapPromiseFunction(p=>this.opts.getUploadParameters(p)),d=r.length;return Promise.allSettled(r.map((p,f)=>(a[p]=h(this.uppy.getFile(p)),a[p].then(m=>{delete a[p];const y=this.uppy.getFile(p);Bm(y,m);const{method:g="POST",url:b,fields:w,headers:S}=m,T={method:g,formData:g.toUpperCase()==="POST",endpoint:b,allowedMetaFields:w?Object.keys(w):[]};return S&&(T.headers=S),this.uppy.setFileState(y.id,{meta:{...y.meta,...w},xhrUpload:T}),this.uploadFile(y.id,f,d)}).catch(m=>{delete a[p];const y=this.uppy.getFile(p);
16return this.uppy.emit("upload-error",y,m),Promise.reject(m)})))).finally(()=>{this.uppy.off("file-removed",n)})}}),Object.defineProperty(this,qi,{writable:!0,value:()=>(X(this,_e)[_e].setCompanionHeaders(this.opts.companionHeaders),Promise.resolve())}),Object.defineProperty(this,pa,{writable:!0,value:r=>{const a=X(this,It)[It].getOptions(r),n=Array.isArray(a.allowedMetaFields)?a.allowedMetaFields:Object.keys(r.meta);return{...r.remote.body,protocol:"multipart",endpoint:a.endpoint,size:r.data.size,fieldname:a.fieldName,metadata:Object.fromEntries(n.map(o=>[o,r.meta[o]])),httpMethod:a.method,useFormData:a.formData,headers:typeof a.headers=="function"?a.headers(r):a.headers}}}),this.type="uploader",this.id=this.opts.id||"AwsS3",this.title="AWS S3",this.defaultLocale=Rm;const s={timeout:30*1e3,limit:0,allowedMetaFields:[],getUploadParameters:this.getUploadParameters.bind(this),shouldUseMultipart:!1,companionHeaders:{}};if(this.opts={...s,...t},t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.i18nInit(),X(this,_e)[_e]=new nn(e,t),X(this,Me)[Me]=new Pu(this.opts.limit)}[Ru](){return X(this,_e)[_e]}get client(){return X(this,_e)[_e]}set client(e){X(this,_e)[_e]=e}getUploadParameters(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");const t=e.meta.name,{type:s}=e.meta,r=Object.fromEntries(this.opts.allowedMetaFields.filter(n=>e.meta[n]!=null).map(n=>[`metadata[${n}]`,e.meta[n].toString()])),a=new URLSearchParams({filename:t,type:s,...r});return X(this,_e)[_e].get(`s3/params?${a}`).then(Im)}uploadFile(e,t,s){const r=this.uppy.getFile(e);if(this.uppy.log(`uploading ${t} of ${s}`),r.error)throw new Error(r.error);if(r.isRemote){const a=()=>X(this,Me)[Me],n=new AbortController,o=u=>{u.id===r.id&&n.abort()};this.uppy.on("file-removed",o);
16const l=this.uppy.getRequestClientForFile(r).uploadRemoteFile(r,X(this,pa)[pa](r),{signal:n.signal,getQueue:a});return X(this,Me)[Me].wrapSyncFunction(()=>{this.uppy.off("file-removed",o)},{priority:-1})(),l}return X(this,It)[It].uploadLocalFile(r,t,s)}install(){const{uppy:e}=this;e.addPreProcessor(X(this,qi)[qi]),e.addUploader(X(this,Hi)[Hi]);function t(r,a){const n=this;return ku(r,a)?{location:Nm(a.responseURL,Ki(r,"Location")),bucket:Ki(r,"Bucket"),key:Ki(r,"Key"),etag:Ki(r,"ETag")}:n.method.toUpperCase()==="POST"?(Jo||(e.log("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),Jo=!0),{location:null}):a.responseURL?{location:a.responseURL.replace(/\?.*$/,"")}:{location:null}}const s={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,[Fu]:X(this,Me)[Me],responseType:"text",getResponseData:this.opts.getResponseData||t,getResponseError:Lm};s.i18n=this.i18n,X(this,It)[It]=new Am(e,s)}uninstall(){this.uppy.removePreProcessor(X(this,qi)[qi]),this.uppy.removeUploader(X(this,Hi)[Hi])}}Mu.VERSION=Dm.version;const $m={computed:{displayIsDesktop:Nu,maxFileSizeMB(){return this.maxFileSize/1e6},design(){return this.$designStore.design}},data(){return{numberOfFilesUploaded:null,numberOfProcessed:null,fileCount:null,maxFileSize:1e7,isOptimisingUploads:!1,errorSavingAsset:!1}},methods:{onClose(){this.isOptimisingUploads=!1,this.errorSavingAsset=!1,this.$emit("onClose")}},props:{imageEntity:{type:String,required:!0},updateAction:{type:String,required:!0},updateField:{type:String,default:void 0}},mounted(){const{getUploadUrl:i}=this.$mainStore,e=new Gs({debug:!1,autoProceed:!1,restrictions:{maxFileSize:this.maxFileSize,maxNumberOfFiles:5,minNumberOfFiles:1,allowedFileTypes:[".jpeg",".jpg",".png"]}}).use(Ea,{trigger:".UppyModalOpenerBtn",inline:!0,target:".DashboardContainer",showProgressDetails:!0,height:400,width:this.displayIsDesktop?750:"auto",proudlyDisplayPoweredByUppy:!1,metaFields:[{id:"name",name:"Name",placeholder:"file name"}],browserBackButtonClose:!1}).use(mu,{target:Ea}).use(Mu,{async getUploadParameters(t){const{extension:s}=t;return await i(s)}},this);e.on("files-added",async(t,s)=>{}),e.on("complete",t=>{this.fileCount=t.successful.length+t.failed.length,this.numberOfFilesUploaded=t.successful.length}),e.on("upload-success",async(t,s)=>{this.isOptimisingUploads=!0;const r=new Image;r.src=URL.createObjectURL(t.data),r.onerror=async()=>{this.isOptimisingUploads=!1,this.errorSavingAsset=!0,ju("There was an error loading uploaded image","warning")},r.onload=async()=>{try{const{location:a}=s.body,{width:n,height:o}=r,l={width:n,height:o},{fetch:u}=Hu(),h=await u("/api/asset/save-asset",{method:"POST",body:{params:{location:a,dimensions:l}}});if(!h)throw new Error("There was an asset when saving the asset");if(qu().cacheUrls(h.assetId,h.urls),this.numberOfProcessed++,this.updateAction==="updateInquiry"?this.$mainStore[this.updateAction]({field:this.updateField,value:h}):this.$designStore[this.updateAction]({field:this.updateField,value:h}),this.fileCount===this.numberOfProcessed){if(this.imageEntity==="COVER_IMAGE"&&this.updateAction!=="updateInquiry"){const p=this.design.selectedImages[0];this.$emitter.emit("change-design-image",p)}this.onClose()}}catch(a){Wu(a),this.isOptimisingUploads=!1,this.errorSavingAsset=!0}}})}},zm={style:{"font-size":"13px"},class:"dashboard-text"},jm={key:0},Hm={class:"dashboard-text"},qm={key:1},Wm={key:2,id:"UPPY",ref:"focusId",class:"DashboardContainer UppyDragDrop"};function Vm(i,e,t,s,r,a){return Bt(),fa(hn,{class:"upload-image-dashboard",style:{"padding-bottom":"8px !important"}},{default:He(()=>[Qe("div",null,[e[7]||(e[7]=Qe("h3",{class:"mb-1 dashboard-text"},"Upload your image",-1)),Qe("h5",zm,"Maximum image size: "+un(a.maxFileSizeMB)+"MB. Accepted file formats: .jpg, .jpeg, .png.",1),r.errorSavingAsset?(Bt(),fa(Xu,{key:0,type:"warning",width:"auto","max-width":"750",class:"mb-4"},{default:He(()=>[...e[0]||(e[0]=[bs(" Some users are reporting difficulties uploading images at the moment. We are working on fixing this as soon as possible! ",-1)])]),_:1})):dn("",!0),r.errorSavingAsset||r.isOptimisingUploads?(Bt(),ws("div",{key:1,style:Iu([{height:"400px"},{width:a.displayIsDesktop?"750px":"auto"}])},[qe(hn,{class:"optimisingCard fill-height",fluid:"",style:{"border-radius":"7px","min-height":"342px",width:"100%"}},{default:He(()=>
16[e[5]||(e[5]=Qe("div",{id:"UPPY",style:{display:"hidden"}},null,-1)),qe(er,{align:"center",justify:"center"},{default:He(()=>[qe(Bu,{align:"center",justify:"center"},{default:He(()=>[r.isOptimisingUploads?(Bt(),ws("div",jm,[e[1]||(e[1]=Qe("div",{id:"UPPY"},null,-1)),e[2]||(e[2]=Qe("h3",{class:"dashboard-text"},"Upload complete",-1)),Qe("h3",Hm,"Optimising your image"+un(r.numberOfFilesUploaded>1?"s":""),1),qe(Lu,{indeterminate:"",color:"primary",class:"mt-4"})])):r.errorSavingAsset?(Bt(),ws("div",qm,[e[4]||(e[4]=Qe("h3",{class:"dashboard-text"},"Oops!",-1)),qe($u,{large:"",dark:"",icon:"$heartBroken"}),qe(er,{class:"fill-height ma-0 pt-6",align:"center",justify:"center"},{default:He(()=>[...e[3]||(e[3]=[bs(" There was an error uploading your image.",-1),Qe("br",null,null,-1),bs("Please try again later. ",-1)])]),_:1})])):dn("",!0)]),_:1})]),_:1})]),_:1})],4)):(Bt(),ws("div",Wm,null,512)),qe(er,{justify:"end",class:"py-3 pt-4","no-gutters":""},{default:He(()=>[qe(zu,{color:"primary",class:"mx-2",onClick:a.onClose,elevation:"0",variant:"outlined",rounded:""},{default:He(()=>[...e[6]||(e[6]=[bs("Close",-1)])]),_:1},8,["onClick"])]),_:1})])]),_:1})}const Gm=Zo($m,[["render",Vm]]),Xm={data(){return{show:!1,imageEntity:void 0,updateAction:void 0,updateField:void 0}},mounted(){this.$emitter.off("show-upload-image",this.onShowUploadImage),this.$emitter.on("show-upload-image",this.onShowUploadImage)},beforeUnmount(){this.$emitter.off("show-upload-image",this.onShowUploadImage)},methods:{onShowUploadImage({imageEntity:i,updateField:e,updateAction:t}){this.imageEntity=i,this.updateAction=t,this.updateField=e,this.show=!0},onClose(){this.show=!1}}};function Ym(i,e,t,s,r,a){const n=Gm;return Bt(),fa(Gu,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=o=>r.show=o),dark:!1,class:"upload-image-overlay align-center justify-center"},{default:He(()=>[qe(Vu,{class:"upload-image-overlay__container px-5 mx-3"},{default:He(()=>[qe(n,{imageEntity:r.imageEntity,updateAction:r.updateAction,updateField:r.updateField,onOnClose:e[0]||(e[0]=o=>a.onClose())},null,8,["imageEntity","updateAction","updateField"])]),_:1})]),_:1},8,["modelValue"])}const ig=Zo(Xm,[["render",Ym],["__scopeId","data-v-dbdfc50a"]]);export{ig as default};
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.