1/*! For license information please see upload.62543e8151.js.LICENSE.txt */ 2(globalThis.webpackChunklawinsidercontracts||=[]).push([[1188],{2891(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>a});var n=i(9869),r=i(8231),o=i(5161),s=i(9698);function a({endpoint:e,onSuccessUpload:t,open:i,provider:a,setOpen:l}){const[u,d]=(0,n.useState)(!1),p=(0,o.Lf)(),c=(0,o.OR)(),h=(0,o.KY)(),f=(0,o.kI)({endpoint:e}),{loading:m,uppy:g}=(0,o.Sj)({allowedFileTypes:r.i_,onUploadSuccess:(e,i)=>{if(!i.body.file_ids?.length)return;const[n]=i.body.file_ids;t(n),d(!0)},options:{onBeforeUpload:o.Pm},plugins:[p,f,c,h]});return(0,n.useEffect)(()=>{a&&g.getPlugin("Dashboard").showPanel(a)},[g,a]),(0,s.Y)(o.Ay,{disabled:!u,loading:m,open:i,uppy:g,onClose:()=>{d(!1),l(!1),g.cancelAll()},onContinue:()=>{d(!1),l(!1),g.clear()}})}},5161(e,t,i){"use strict";i.d(t,{Pm:()=>Rd,Ay:()=>Bd,P_:()=>Ud,OR:()=>xd,Lf:()=>Dd,KY:()=>Id,Sj:()=>Md,kI:()=>Nd});var n={};i.r(n),i.d(n,{getItem:()=>Jn,removeItem:()=>Zn,setItem:()=>Qn});var r=i(4579),o=i.n(r),s=i(9511),a=i.n(s),l=i(3883),u=i(55),d=i(1837);const p=function(e){function t(...t){var i;return(i=e.call.apply(e,[this].concat(t))||this).name="UserFacingApiError",i}return s(t,e),r(t)}(d(Error));var c=i(889);function h(e,t){return Object.hasOwn(e,t)}const f=function(e){function t(t,i){var n;return(n=e.call(this,t)||this).isNetworkError=void 0,n.cause=void 0,n.cause=i?.cause,n.cause&&h(n.cause,"isNetworkError")?n.isNetworkError=n.cause.isNetworkError:n.isNetworkError=!1,n}return s(t,e),r(t)}(d(Error));var m=i(5617);const g=Object.prototype.toString,y=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"]);let v=function(e){function t(t){var i;return i=e.call(this)||this,t instanceof Error?(i.originalError=t,({message:t}=t)):(i.originalError=new Error(t),i.originalError.stack=i.stack),i.name="AbortError",i.message=t,i}return s(t,e),r(t)}(d(Error));const b=(e,t,i)=>{const n=i.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=n,e};async function w(e,t){return new Promise((i,n)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;const r=m.operation(t),o=()=>{r.stop(),n(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",o,{once:!0});const s=()=>{t.signal?.removeEventListener("abort",o),r.stop()};r.attempt(async o=>{try{const t=await e(o);s(),i(t)}catch(e){try{if(!(e instanceof Error))throw new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof v)throw e.originalError;if(e instanceof TypeError&&!function(e){var t;if(!e||(t=e,"[object Error]"!==g.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;const{message:i,stack:n}=e;return"Load failed"===i||i.startsWith("Load failed (")&&i.endsWith(")")?void 0===n||"__sentry_captured__"in e:!!i.startsWith("error sending request for url")||!!("Failed to fetch"===i||i.startsWith("Failed to fetch (")&&i.endsWith(")"))||y.has(i)}(e))throw e;if(b(e,o,t),await t.shouldRetry(e)||(r.stop(),n(e)),await t.onFailedAttempt(e),!r.retry(e))throw r.mainError()}catch(e){b(e,o,t),s(),n(e)}}})})}const P=function(e){function t(){var t;return(t=e.call(this,"Authorization required")||this).isAuthError=void 0,t.name="AuthError",t.isAuthError=!0,t}return s(t,e),r(t)}(d(Error));let _=function(e){function t({statusCode:t,message:i}){var n;return(n=e.call(this,i)||this).statusCode=void 0,n.name="HttpError",n.statusCode=t,n}return s(t,e),r(t)}(d(Error));var F=u("companionHeaders"),S=u("getUrl"),C=u("requestSocketToken"),k=u("awaitRemoteFileUpload");let T=function(){function e(e,t){Object.defineProperty(this,k,{value:A}),Object.defineProperty(this,S,{value:O}),Object.defineProperty(this,F,{writable:!0,value:void 0}),this.uppy=void 0,this.opts=void 0,Object.defineProperty(this,C,{writable:!0,value:async({file:e,postBody:t,signal:i})=>{if(null==e.remote?.url)throw new Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),l(this,F)[F]=t.companionHeaders}var t=e.prototype;return t.setCompanionHeaders=function(e){l(this,F)[F]=e},t[Symbol.for("uppy test: getCompanionHeaders")]=function(){return l(this,F)[F]},t.headers=async function(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...l(this,F)[F]}},t.onReceiveResponse=function(e){const{headers:t}=e,i=this.uppy.getState().companion||{},n=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==i[n]&&this.uppy.setState({companion:{...i,[n]:t.get("i-am")}})},t.request=async function({path:e,method:t="GET",data:i,skipPostResponse:n,signal:r}){try{const o=await this.headers(!i),s=await function(...e){return fetch.apply(void 0,e).catch(e=>{throw"AbortError"===e.name?e:new c.A(e)})}(l(this,S)[S](e),{method:t,signal:r,headers:o,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return n||this.onReceiveResponse(s),await async function(e){if(401===e.status)throw new P;if(e.ok)return e.json();let t,i=`Failed request with status: ${e.status}. ${e.statusText}`;try{t=await e.json(),t.message&&(i=`${i} message: ${t.message}`),t.requestId&&(i=`${i} request-Id: ${t.requestId}`)}catch(e){throw new Error(i,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new p(t.message);
2throw new _({statusCode:e.status,message:i})}(s)}catch(i){if(i.isAuthError||"UserFacingApiError"===i.name||"AbortError"===i.name)throw i;throw new f(`Could not ${t} ${l(this,S)[S](e)}`,{cause:i})}},t.get=async function(e,t){return this.request({...t,path:e})},t.post=async function(e,t,i){return this.request({...i,path:e,method:"POST",data:t})},t.delete=async function(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})},t.uploadRemoteFile=async function(e,t,i){try{const{signal:n,getQueue:r}=i||{};return await w(async()=>{const i=this.uppy.getFile(e.id)?.serverToken;if(null!=i)return this.uppy.log(`Connecting to exiting websocket ${i}`),l(this,k)[k]({file:e,queue:r(),signal:n});const o=r().wrapPromiseFunction(async(...e)=>{try{var t;return await(t=l(this,C))[C].apply(t,e)}catch(e){if(e.isAuthError)throw new v(e);if(null==e.cause)throw e;const t=e.cause,i=()=>[408,409,429,418,423].includes(t.statusCode)||t.statusCode>=500&&t.statusCode<=599&&![501,505].includes(t.statusCode);if("HttpError"===t.name&&!i())throw new v(t);throw t}},{priority:-1}),s=await o({file:e,postBody:t,signal:n}).abortOn(n);
2return this.uppy.getFile(e.id)?(this.uppy.setFileState(e.id,{serverToken:s}),l(this,k)[k]({file:this.uppy.getFile(e.id),queue:r(),signal:n})):void 0},{retries:10,signal:n,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}},r(e,[{key:"hostname",get:function(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}}])}();function O(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async function A({file:e,queue:t,signal:i}){let n;const{capabilities:r}=this.uppy.getState();try{return await new Promise((o,s)=>{const a=e.serverToken,l=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}(e.remote.companionUrl);let u,d,p,{isPaused:c}=e;const h=(t,i)=>{null!=u&&u.readyState===u.OPEN?u.send(JSON.stringify({action:t,payload:null!=i?i:{}})):this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(u?.readyState)}`,"warning")};function f(){r.resumableUploads&&h(c?"pause":"resume")}const m=e=>{r.resumableUploads&&(c=e,u&&f())},g=t=>{r.individualCancellation&&t.id===e.id&&(h("cancel"),d?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),o())},y=()=>{h("cancel"),d?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),o()},v=(t,i)=>{t?.id===e.id&&m(i)},b=()=>m(!0),P=()=>m(!1);this.uppy.on("file-removed",g),this.uppy.on("cancel-all",y),this.uppy.on("upload-pause",v),this.uppy.on("pause-all",b),this.uppy.on("resume-all",P),n=()=>{this.uppy.off("file-removed",g),this.uppy.off("cancel-all",y),this.uppy.off("upload-pause",v),this.uppy.off("pause-all",b),this.uppy.off("resume-all",P)},i.addEventListener("abort",()=>{d?.abort()}),(async()=>{d&&d.abort(),d=new AbortController;const i=t=>{this.uppy.setFileState(e.id,{serverToken:null}),d?.abort?.(),s(t)};function n(){clearTimeout(p),c||(p=setTimeout(()=>i(new Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{await w(async()=>new Promise((t,r)=>{u=new WebSocket(`${l}/api/${a}`),n(),u.addEventListener("close",()=>{u=void 0,r(new Error("Socket closed unexpectedly"))}),u.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),u?.close()}),u.addEventListener("open",()=>{f()}),u.addEventListener("message",t=>{n();try{const{action:i,payload:n}=JSON.parse(t.data);switch(i){case"progress":!function(e,t,i){const{progress:n,bytesUploaded:r,bytesTotal:o}=t;var s;n&&(e.uppy.log(`Upload progress: ${n}`),e.uppy.emit("upload-progress",i,{uploadStarted:null!=(s=i.progress.uploadStarted)?s:0,bytesUploaded:r,bytesTotal:o}))}(this,n,this.uppy.getFile(e.id));break;case"success":{var r;const t=n.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:n.url,status:null!=(r=n.response?.status)?r:200,body:t?JSON.parse(t):void 0}),d?.abort?.(),o();break}case"error":{const{message:e}=n.error;throw Object.assign(new Error(e),{cause:n.error})}default:this.uppy.log(`Companion socket unknown action ${i}`,"warning")}}catch(e){i(e)}});const s=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(p),u&&u.close(),u=void 0};d.signal.addEventListener("abort",()=>{s()})}),{retries:10,signal:d.signal,onFailedAttempt:()=>{d.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(d.signal)}catch(e){if(d.signal.aborted)return;i(e)}})()})}finally{n?.()}}function E(e,t,i){const n=[];return e.forEach(e=>"string"!=typeof e?n.push(e):t[Symbol.split](e).forEach((e,t,r)=>{""!==e&&n.push(e),t<r.length-1&&n.push(i)})),n}function U(e,t){const i=/\$/g;let n=[e];if(null==t)return n;for(const e of Object.keys(t))if("_"!==e){let r=t[e];"string"==typeof r&&(r=i[Symbol.replace](r,"$$$$")),n=E(n,new RegExp(`%\\{${e}\\}`,"g"),r)}return n}T.VERSION="5.1.1";const I=e=>{throw new Error(`missing string: ${e}`)};var x=u("onMissingKey"),N=u("apply");let D=function(){function e(e,{onMissingKey:t=I}={}){Object.defineProperty(this,N,{value:R}),this.locale=void 0,Object.defineProperty(this,x,{writable:!0,value:void 0}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(l(this,N)[N],this):l(this,N)[N](e),l(this,x)[x]=t}var t=e.prototype;return t.translate=function(e,t){return this.translateArray(e,t).join("")},t.translateArray=function(e,t){let i=this.locale.strings[e];if(null==i&&(l(this,x)[x](e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return U(i[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw new Error("string was not a string");return U(i,t)},r(e)}();function R(e){if(!e?.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}
2let M=function(){function e(e,t){this.uppy=void 0,this.opts=void 0,this.id=void 0,this.defaultLocale=void 0,this.i18n=void 0,this.i18nArray=void 0,this.type=void 0,this.VERSION=void 0,this.uppy=e,this.opts=null!=t?t:{}}var t=e.prototype;return t.getPluginState=function(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}},t.setPluginState=function(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})},t.setOptions=function(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()},t.i18nInit=function(){const e=new D([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)},t.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},t.install=function(){},t.uninstall=function(){},t.update=function(e){},t.afterUpdate=function(){},r(e)}();var B=u("uppy"),L=u("events");let j=function(){function e(e){Object.defineProperty(this,B,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:[]}),l(this,B)[B]=e}var t=e.prototype;return t.on=function(e,t){return l(this,L)[L].push([e,t]),l(this,B)[B].on(e,t)},t.remove=function(){for(const[e,t]of l(this,L)[L].splice(0))l(this,B)[B].off(e,t)},t.onFilePause=function(e,t){this.on("upload-pause",(i,n)=>{e===i?.id&&t(n)})},t.onFileRemove=function(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})},t.onPause=function(e,t){this.on("upload-pause",(i,n)=>{e===i?.id&&t(n)})},t.onRetry=function(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})},t.onRetryAll=function(e,t){this.on("retry-all",()=>{l(this,B)[B].getFile(e)&&t()})},t.onPauseAll=function(e,t){this.on("pause-all",()=>{l(this,B)[B].getFile(e)&&t()})},t.onCancelAll=function(e,t){this.on("cancel-all",(...i)=>{l(this,B)[B].getFile(e)&&t.apply(void 0,i)})},t.onResumeAll=function(e,t){this.on("resume-all",()=>{l(this,B)[B].getFile(e)&&t()})},r(e)}();function z(e){return e.filter(e=>!(e=>"error"in e&&!!e.error)(e)&&!(e=>e.progress.uploadComplete)(e))}function $(e){return e.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function q(e){if(null!=e){const t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});const i=()=>{e.removeEventListener("abort",t)};this.then?.(i,i)}return this}var H=u("activeRequests"),V=u("queuedHandlers"),W=u("paused"),G=u("pauseTimer"),K=u("downLimit"),X=u("upperLimit"),Y=u("rateLimitingTimer"),Q=u("call"),J=u("queueNext"),Z=u("next"),ee=u("queue"),te=u("dequeue"),ie=u("resume"),ne=u("increaseLimit");let re=function(){function e(e){Object.defineProperty(this,te,{value:ue}),Object.defineProperty(this,ee,{value:le}),Object.defineProperty(this,Z,{value:ae}),Object.defineProperty(this,J,{value:se}),Object.defineProperty(this,Q,{value:oe}),Object.defineProperty(this,H,{writable:!0,value:0}),Object.defineProperty(this,V,{writable:!0,value:[]}),Object.defineProperty(this,W,{writable:!0,value:!1}),Object.defineProperty(this,G,{writable:!0,value:void 0}),Object.defineProperty(this,K,{writable:!0,value:1}),Object.defineProperty(this,X,{writable:!0,value:void 0}),Object.defineProperty(this,Y,{writable:!0,value:void 0}),this.limit=void 0,Object.defineProperty(this,ie,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ne,{writable:!0,value:()=>{if(l(this,W)[W])l(this,Y)[Y]=setTimeout(l(this,ne)[ne],0);else{l(this,K)[K]=this.limit,this.limit=Math.ceil((l(this,X)[X]+l(this,K)[K])/2);for(let e=l(this,K)[K];e<=this.limit;e++)l(this,J)[J]();l(this,X)[X]-l(this,K)[K]>3?l(this,Y)[Y]=setTimeout(l(this,ne)[ne],2e3):l(this,K)[K]=Math.floor(l(this,K)[K]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}var t=e.prototype;return t.run=function(e,t){return!l(this,W)[W]&&l(this,H)[H]<this.limit?l(this,Q)[Q](e):l(this,ee)[ee](e,t)},t.wrapSyncFunction=function(e,t){return(...i)=>{const n=this.run(()=>(e.apply(void 0,i),queueMicrotask(()=>n.done()),()=>{}),t);return{abortOn:q,abort(){n.abort()}}}},t.wrapPromiseFunction=function(e,t){return(...i)=>{let n;const r=new Promise((r,o)=>{n=this.run(()=>{let t,s;try{s=Promise.resolve(e.apply(void 0,i))}catch(e){s=Promise.reject(e)}return s.then(e=>{t?o(t):(n.done(),r(e))},e=>{t?o(t):(n.done(),o(e))}),e=>{t=function(e){return new Error("Cancelled",{cause:e})}(e)}},t)});return r.abort=e=>{n.abort(e)},r.abortOn=q,r}},t.resume=function(){l(this,W)[W]=!1,clearTimeout(l(this,G)[G]);for(let e=0;e<this.limit;e++)l(this,J)[J]()},t.pause=function(e=null){l(this,W)[W]=!0,clearTimeout(l(this,G)[G]),null!=e&&(l(this,G)[G]=setTimeout(l(this,ie)[ie],e))},t.rateLimit=function(e){clearTimeout(l(this,Y)[Y]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(l(this,X)[X]=this.limit-1,this.limit=l(this,K)[K],l(this,Y)[Y]=setTimeout(l(this,ne)[ne],e))},r(e,[{key:"isPaused",get:function(){return l(this,W)[W]}}])}();function oe(e){l(this,H)[H]+=1;let t,i=!1;try{t=e()}catch(e){throw l(this,H)[H]-=1,e}return{abort:e=>{i||(i=!0,l(this,H)[H]-=1,t?.(e),l(this,J)[J]())},done:()=>{i||(i=!0,l(this,H)[H]-=1,l(this,J)[J]())}}}function se(){queueMicrotask(()=>l(this,Z)[Z]())}function ae(){if(l(this,W)[W]||l(this,H)[H]>=this.limit)return;if(0===l(this,V)[V].length)return;const e=l(this,V)[V].shift();if(null==e)throw new Error("Invariant violation: next is null");const t=l(this,Q)[Q](e.fn);e.abort=t.abort,e.done=t.done}function le(e,t){const i={fn:e,priority:t?.priority||0,abort:()=>{l(this,te)[te](i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=l(this,V)[V].findIndex(e=>i.priority>e.priority);return-1===n?l(this,V)[V].push(i):l(this,V)[V].splice(n,0,i),i}function ue(e){const t=l(this,V)[V].indexOf(e);-1!==t&&l(this,V)[V].splice(t,1)}function de(e,t){return!0===e?Object.keys(t):Array.isArray(e)?e:[]}Symbol("__queue");const{AbortController:pe}=globalThis,{AbortSignal:ce}=globalThis,he=(e="Aborted",t)=>{const i=new DOMException(e,"AbortError");return null!=t&&h(t,"cause")&&Object.defineProperty(i,"cause",{__proto__:null,configurable:!0,writable:!0,value:t.cause}),i};var fe=i(3269),me=i(1132);const ge=new TextEncoder,ye={name:"HMAC",hash:"SHA-256"};function ve(e){const t=new Uint8Array(e);let i="";for(let e=0;e<t.length;e++)i+=t[e].toString(16).padStart(2,"0");return i}async function be(e,t){const{subtle:i}=globalThis.crypto;return i.sign(ye,await async function(e){const{subtle:t}=globalThis.crypto;return t.importKey("raw","string"==typeof e?ge.encode(e):e,ye,!1,["sign"])}(e),ge.encode(t))}async function we({accountKey:e,accountSecret:t,sessionToken:i,bucketN
2ame:n,Key:r,Region:o,expires:s,uploadId:a,partNumber:l}){const u="s3",d=`${u}.${o}.amazonaws.com`,p=`/${n}/${encodeURI(r).replace(/[;?:@&=+$,#!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}`,c="UNSIGNED-PAYLOAD",h=(new Date).toISOString().replace(/[-:]|\.\d+/g,""),f=h.slice(0,8),m=`${f}/${o}/${u}/aws4_request`,g=new URL(`https://${d}${p}`);g.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.searchParams.set("X-Amz-Content-Sha256",c),g.searchParams.set("X-Amz-Credential",`${e}/${m}`),g.searchParams.set("X-Amz-Date",h),g.searchParams.set("X-Amz-Expires",s),g.searchParams.set("X-Amz-Security-Token",i),g.searchParams.set("X-Amz-SignedHeaders","host"),l&&g.searchParams.set("partNumber",l),a&&g.searchParams.set("uploadId",a),g.searchParams.set("x-id",l&&a?"UploadPart":"PutObject");const y=function({method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:n,HashedPayload:r}){const o=Object.keys(n).map(e=>e.toLowerCase()).sort();return[e,t,i].concat(fe(me,o.map(e=>`${e}:${n[e]}`)),["",o.join(";"),r]).join("\n")}({CanonicalUri:p,CanonicalQueryString:g.search.slice(1),SignedHeaders:{host:d},HashedPayload:c}),v=["AWS4-HMAC-SHA256",h,m,ve(await async function(e){const{subtle:t}=globalThis.crypto;return t.digest(ye.hash,ge.encode(e))}(y))].join("\n"),b=await be(`AWS4${t}`,f),w=await be(b,o),P=await be(w,u),_=await be(P,"aws4_request"),F=ve(await be(_,v));return g.searchParams.set("X-Amz-Signature",F),g}const Pe={getChunkSize:e=>Math.ceil(e.size/1e4),onProgress(){},onPartComplete(){},onSuccess(){},onError(e){throw e}},_e=Symbol("pausing upload, not an actual error");var Fe=u("abortController"),Se=u("chunks"),Ce=u("chunkState"),ke=u("data"),Te=u("file"),Oe=u("uploadHasStarted"),Ae=u("onError"),Ee=u("onSuccess"),Ue=u("shouldUseMultipart"),Ie=u("isRestoring"),xe=u("onReject"),Ne=u("maxMultipartParts"),De=u("minPartSize"),Re=u("initChunks"),Me=u("createUpload"),Be=u("resumeUpload"),Le=u("onPartProgress"),je=u("onPartComplete"),ze=u("abortUpload");let $e=function(){function e(e,t){Object.defineProperty(this,ze,{value:We}),Object.defineProperty(this,Be,{value:Ve}),Object.defineProperty(this,Me,{value:He}),Object.defineProperty(this,Re,{value:qe}),this.options=void 0,Object.defineProperty(this,Fe,{writable:!0,value:new pe}),Object.defineProperty(this,Se,{writable:!0,value:[]}),Object.defineProperty(this,Ce,{writable:!0,value:[]}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),Object.defineProperty(this,Oe,{writable:!0,value:!1}),Object.defineProperty(this,Ae,{writable:!0,value:void 0}),Object.defineProperty(this,Ee,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Ie,{writable:!0,value:void 0}),Object.defineProperty(this,xe,{writable:!0,value:e=>e?.cause===_e?null:l(this,Ae)[Ae](e)}),Object.defineProperty(this,Ne,{writable:!0,value:1e4}),Object.defineProperty(this,De,{writable:!0,value:5242880}),Object.defineProperty(this,Le,{writable:!0,value:e=>t=>{if(!t.lengthComputable)return;l(this,Ce)[Ce][e].uploaded=function(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw new TypeError("Expected a number")}(t.loaded);const i=l(this,Ce)[Ce].reduce((e,t)=>e+t.uploaded,0);this.options.onProgress(i,l(this,ke)[ke].size)}}),Object.defineProperty(this,je,{writable:!0,value:e=>t=>{l(this,Se)[Se][e]=null,l(this,Ce)[Ce][e].etag=t,l(this,Ce)[Ce][e].done=!0;const i={PartNumber:e+1,ETag:t};this.options.onPartComplete(i)}}),this.options={...Pe,...t},this.options.getChunkSize??=Pe.getChunkSize,l(this,ke)[ke]=e,l(this,Te)[Te]=t.file,l(this,Ee)[Ee]=this.options.onSuccess,l(this,Ae)[Ae]=this.options.onError,l(this,Ue)[Ue]=this.options.shouldUseMultipart,l(this,Ie)[Ie]=t.uploadId&&t.key,l(this,Re)[Re]()}var t=e.prototype;return t.start=function(){l(this,Oe)[Oe]?(l(this,Fe)[Fe].signal.aborted||l(this,Fe)[Fe].abort(_e),l(this,Fe)[Fe]=new pe,l(this,Be)[Be]()):l(this,Ie)[Ie]?(this.options.companionComm.restoreUploadFile(l(this,Te)[Te],{uploadId:this.options.uploadId,key:this.options.key}),l(this,Be)[Be]()):l(this,Me)[Me]()},t.pause=function(){l(this,Fe)[Fe].abort(_e),l(this,Fe)[Fe]=new pe},t.abort=function(e){e?.really?l(this,ze)[ze]():this.pause()},t[Symbol.for("uppy test: getChunkState")]=function(){return l(this,Ce)[Ce]},r(e)}();function qe(){const e=l(this,ke)[ke].size,t="function"==typeof l(this,Ue)[Ue]?l(this,Ue)[Ue](l(this,Te)[Te]):Boolean(l(this,Ue)[Ue]);if(t&&e>l(this,De)[De]){let i=Math.max(this.options.getChunkSize(l(this,ke)[ke]),l(this,De)[De]),n=Math.floor(e/i);n>l(this,Ne)[Ne]&&(n=l(this,Ne)[Ne],i=e/l(this,Ne)[Ne]),l(this,Se)[Se]=Array(n);for(let n=0,r=0;n<e;n+=i,r++){const o=Math.min(e,n+i),s=()=>{const e=n;return l(this,ke)[ke].slice(e,o)};if(l(this,Se)[Se][r]={getData:s,onProgress:l(this,Le)[Le](r),onComplete:l(this,je)[je](r),shouldUseMultipart:t},l(this,Ie)[Ie]){const t=n+i>e?e-n:i;l(this,Se)[Se][r].setAsUploaded=()=>{l(this,Se)[Se][r]=null,l(this,Ce)[Ce][r].uploaded=t}}}}else l(this,Se)[Se]=[{getData:()=>l(this,ke)[ke],onProgress:l(this,Le)[Le](0),onComplete:l(this,je)[je](0),shouldUseMultipart:t}];l(this,Ce)[Ce]=l(this,Se)[Se].map(()=>({uploaded:0}))}function He(){this.options.companionComm.uploadFile(l(this,Te)[Te],l(this,Se)[Se],l(this,Fe)[Fe].signal).then(l(this,Ee)[Ee],l(this,xe)[xe]),l(this,Oe)[Oe]=!0}function Ve(){this.options.companionComm.resumeUploadFile(l(this,Te)[Te],l(this,Se)[Se],l(this,Fe)[Fe].signal).then(l(this,Ee)[Ee],l(this,xe)[xe])}function We(){l(this,Fe)[Fe].abort(),this.options.companionComm.abortFileUpload(l(this,Te)[Te]).catch(e=>this.options.log(e))}const Ge=$e;function Ke(e){if(e?.aborted)throw he("The operation was aborted",{cause:e.reason})}function Xe(e){const t=new URL(e);return t.search="",t.hash="",t.href}var Ye=u("abortMultipartUpload"),Qe=u("cache"),Je=u("createMultipartUpload"),Ze=u("fetchSignature"),et=u("getUploadParameters"),tt=u("listParts"),it=u("previousRetryDelay"),nt=u("requests"),rt=u("retryDelays"),ot=u("sendCompletionRequest"),st=u("setS3MultipartState"),at=u("uploadPartBytes"),lt=u("getFile"),ut=u("shouldRetry"),dt=u("nonMultipartUpload");let pt=function(){function e(e,t,i,n){Object.defineProperty(this,dt,{value:ht}
2),Object.defineProperty(this,ut,{value:ct}),Object.defineProperty(this,Ye,{writable:!0,value:void 0}),Object.defineProperty(this,Qe,{writable:!0,value:new WeakMap}),Object.defineProperty(this,Je,{writable:!0,value:void 0}),Object.defineProperty(this,Ze,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),Object.defineProperty(this,tt,{writable:!0,value:void 0}),Object.defineProperty(this,it,{writable:!0,value:void 0}),Object.defineProperty(this,nt,{writable:!0,value:void 0}),Object.defineProperty(this,rt,{writable:!0,value:void 0}),Object.defineProperty(this,ot,{writable:!0,value:void 0}),Object.defineProperty(this,st,{writable:!0,value:void 0}),Object.defineProperty(this,at,{writable:!0,value:void 0}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),l(this,nt)[nt]=e,l(this,st)[st]=i,l(this,lt)[lt]=n,this.setOptions(t)}var t=e.prototype;return t.setOptions=function(e){const t=l(this,nt)[nt];var i;"abortMultipartUpload"in e&&(l(this,Ye)[Ye]=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(l(this,Je)[Je]=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(l(this,Ze)[Ze]=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(l(this,tt)[tt]=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(l(this,ot)[ot]=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e&&(l(this,rt)[rt]=null!=(i=e.retryDelays)?i:[]),"uploadPartBytes"in e&&(l(this,at)[at]=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(l(this,et)[et]=t.wrapPromiseFunction(e.getUploadParameters))},t.getUploadId=async function(e,t){let i;for(;;){if(null==e.data)throw new Error("File data is empty");if(i=l(this,Qe)[Qe].get(e.data),null==i)break;try{return await i}catch{}}const n=l(this,Je)[Je](l(this,lt)[lt](e),t),r=()=>{if(null==e.data)throw new Error("File data is empty");n.abort(t.reason),l(this,Qe)[Qe].delete(e.data)};return t.addEventListener("abort",r,{once:!0}),l(this,Qe)[Qe].set(e.data,n),n.then(async i=>{if(t.removeEventListener("abort",r),l(this,st)[st](e,i),null==e.data)throw new Error("File data is empty");l(this,Qe)[Qe].set(e.data,i)},()=>{if(t.removeEventListener("abort",r),null==e.data)throw new Error("File data is empty");l(this,Qe)[Qe].delete(e.data)}),n},t.abortFileUpload=async function(e){if(null==e.data)throw new Error("File data is empty");const t=l(this,Qe)[Qe].get(e.data);if(null==t)return;let i;l(this,Qe)[Qe].delete(e.data),l(this,st)[st](e,Object.create(null));try{i=await t}catch{return}await l(this,Ye)[Ye](l(this,lt)[lt](e),i)},t.uploadFile=async function(e,t,i){if(Ke(i),1===t.length&&!t[0].shouldUseMultipart)return l(this,dt)[dt](e,t[0],i);const{uploadId:n,key:r}=await this.getUploadId(e,i);Ke(i);try{const o=await Promise.all(t.map((t,n)=>this.uploadChunk(e,n+1,t,i)));return Ke(i),await l(this,ot)[ot](l(this,lt)[lt](e),{key:r,uploadId:n,parts:o,signal:i},i).abortOn(i)}catch(t){throw t?.cause!==_e&&"AbortError"!==t?.name&&this.abortFileUpload(e),t}},t.restoreUploadFile=function(e,t){if(null==e.data)throw new Error("File data is empty");l(this,Qe)[Qe].set(e.data,t)},t.resumeUploadFile=async function(e,t,i){if(Ke(i),1===t.length&&null!=t[0]&&!t[0].shouldUseMultipart)return l(this,dt)[dt](e,t[0],i);const{uploadId:n,key:r}=await this.getUploadId(e,i);Ke(i);const o=await l(this,tt)[tt](l(this,lt)[lt](e),{uploadId:n,key:r,signal:i},i).abortOn(i);Ke(i);const s=await Promise.all(t.map((t,n)=>{const r=n+1,s=o.find(({PartNumber:e})=>e===r);return null==s?this.uploadChunk(e,r,t,i):(t?.setAsUploaded?.(),{PartNumber:r,ETag:s.ETag})}));return Ke(i),l(this,ot)[ot](l(this,lt)[lt](e),{key:r,uploadId:n,parts:s,signal:i},i).abortOn(i)},t.uploadChunk=async function(e,t,i,n){Ke(n);const{uploadId:r,key:o}=await this.getUploadId(e,n),s=l(this,rt)[rt].values(),a=l(this,rt)[rt].values(),u=()=>{const e=s.next();return null==e||e.done?null:e.value};for(;;){Ke(n);const s=i.getData(),{onProgress:d,onComplete:p}=i;let c;try{c=await l(this,Ze)[Ze](l(this,lt)[lt](e),{uploadId:r,key:o,partNumber:t,body:s,signal:n}).abortOn(n)}catch(e){const t=u();if(null==t||n.aborted)throw e;await new Promise(e=>setTimeout(e,t));continue}Ke(n);try{return{PartNumber:t,...await l(this,at)[at]({signature:c,body:s,size:s.size,onProgress:d,onComplete:p,signal:n}).abortOn(n)}}catch(e){if(!await l(this,ut)[ut](e,a))throw e}}},r(e)}();async function ct(e,t){const i=l(this,nt)[nt],n=e?.source?.status;if(null==n)return!1;if(403===n&&"Request has expired"===e.message){if(!i.isPaused){if(1===i.limit||null==l(this,it)[it]){const e=t.next();if(null==e||e.done)return!1;l(this,it)[it]=e.value}i.rateLimit(0),await new Promise(e=>setTimeout(e,l(this,it)[it]))}}else if(429===n){if(!i.isPaused){const e=t.next();if(null==e||e.done)return!1;i.rateLimit(e.value)}}else{if(n>400&&n<500&&409!==n)return!1;if("undefined"!=typeof navigator&&!1===navigator.onLine)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.resume()},{once:!0}));else{const e=t.next();if(null==e||e.done)return!1;await new Promise(t=>setTimeout(t,e.value))}}return!0}async function ht(e,t,i){var n;const{method:r="POST",url:o,fields:s,headers:a}=await l(this,et)[et](l(this,lt)[lt](e),{signal:i}).abortOn(i);let u;const d=t.getData();if("POST"===r.toUpperCase()){const e=new FormData;
2Object.entries(s).forEach(([t,i])=>e.set(t,i)),e.set("file",d),u=e}else u=d;const{onProgress:p,onComplete:c}=t,h=await l(this,at)[at]({signature:{url:o,headers:a,method:r},body:u,size:d.size,onProgress:p,onComplete:c,signal:i}).abortOn(i),f=s?.key;return l(this,st)[st](e,{key:f}),{...h,location:null!=(n=h.location)?n:Xe(o),bucket:s?.bucket,key:f}}function ft(e){if(e?.error){const t=new Error(e.message);throw Object.assign(t,e.error),t}return e}function mt(e){const t=e.Expiration;if(t){const e=Math.floor((new Date(t)-Date.now())/1e3);if(e>9)return e}}function gt({meta:e,allowedMetaFields:t,querify:i=!1}){const n=null!=t?t:Object.keys(e);return e?Object.fromEntries(n.filter(t=>null!=e[t]).map(t=>[i?`metadata[${t}]`:t,String(e[t])])):{}}const yt={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:e=>(e.size||0)>104857600,retryDelays:[0,1e3,3e3,5e3]};var vt=u("companionCommunicationQueue"),bt=u("client"),wt=u("setClient"),Pt=u("assertHost"),_t=u("cachedTemporaryCredentials"),Ft=u("getTemporarySecurityCredentials"),St=u("setS3MultipartState"),Ct=u("getFile"),kt=u("uploadLocalFile"),Tt=u("getCompanionClientArgs"),Ot=u("upload"),At=u("setCompanionHeaders"),Et=u("setResumableUploadsCapability"),Ut=u("resetResumableCapability");let It=function(e){function t(i,n){var r,o;o=e.call(this,i,{...yt,uploadPartBytes:t.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...n})||this,Object.defineProperty(o,Tt,{value:Mt}
2),Object.defineProperty(o,kt,{value:Rt}),Object.defineProperty(o,Ft,{value:Dt}),Object.defineProperty(o,Pt,{value:Nt}),Object.defineProperty(o,wt,{value:xt}),Object.defineProperty(o,vt,{writable:!0,value:void 0}),Object.defineProperty(o,bt,{writable:!0,value:void 0}),o.requests=void 0,o.uploaderEvents=void 0,o.uploaders=void 0,Object.defineProperty(o,_t,{writable:!0,value:void 0}),Object.defineProperty(o,St,{writable:!0,value:(e,{key:t,uploadId:i})=>{const n=o.uppy.getFile(e.id);null!=n&&o.uppy.setFileState(e.id,{s3Multipart:{...n.s3Multipart,key:t,uploadId:i}})}}),Object.defineProperty(o,Ct,{writable:!0,value:e=>o.uppy.getFile(e.id)||e}),Object.defineProperty(o,Ot,{writable:!0,value:async e=>{if(0===e.length)return;const t=z(o.uppy.getFilesByIds(e)),i=$(t);o.uppy.emit("upload-start",i);const n=t.map(e=>{if(e.isRemote){const t=()=>o.requests;l(o,Et)[Et](!1);const i=new AbortController,n=t=>{t.id===e.id&&i.abort()};o.uppy.on("file-removed",n);const r=o.uppy.getRequestClientForFile(e).uploadRemoteFile(e,l(o,Tt)[Tt](e),{signal:i.signal,getQueue:t});return o.requests.wrapSyncFunction(()=>
2{o.uppy.off("file-removed",n)},{priority:-1})(),r}return l(o,kt)[kt](e)}),r=await Promise.allSettled(n);return l(o,Et)[Et](!0),r}}),Object.defineProperty(o,At,{writable:!0,value:()=>{l(o,bt)[bt]?.setCompanionHeaders(o.opts.headers)}}),Object.defineProperty(o,Et,{writable:!0,value:e=>{const{capabilities:t}=o.uppy.getState();o.uppy.setState({capabilities:{...t,resumableUploads:e}})}}),Object.defineProperty(o,Ut,{writable:!0,value:()=>{l(o,Et)[Et](!0)}}),o.type="uploader",o.id=o.opts.id||"AwsS3Multipart",l(o,wt)[wt](n);const s={createMultipartUpload:o.createMultipartUpload,listParts:o.listParts,abortMultipartUpload:o.abortMultipartUpload,completeMultipartUpload:o.completeMultipartUpload,signPart:n?.getTemporarySecurityCredentials?o.createSignedURL:o.signPart,getUploadParameters:n?.getTemporarySecurityCredentials?o.createSignedURL:o.getUploadParameters};for(const e of Object.keys(s))null==o.opts[e]&&(o.opts[e]=s[e].bind(o));return o.requests=null!=(r=o.opts.rateLimitedQueue)?r:new re(o.opts.limit),l(o,vt)[vt]=new pt(o.requests,o.opts,l(o,St)[St],l(o,Ct)[Ct]),o.uploaders=Object.create(null),o.uploaderEvents=Object.create(null),o}s(t,e);var i=t.prototype;return i[Symbol.for("uppy test: getClient")]=function(){return l(this,bt)[bt]},i.setOptions=function(t){l(this,vt)[vt].setOptions(t),e.prototype.setOptions.call(this,t),l(this,wt)[wt](t)},i.resetUploaderReferences=function(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)},i.createMultipartUpload=function(e,t){l(this,Pt)[Pt]("createMultipartUpload"),Ke(t);const i=de(this.opts.allowedMetaFields,e.meta),n=gt({meta:e.meta,allowedMetaFields:i});return l(this,bt)[bt].post("s3/multipart",{filename:e.name,type:e.type,metadata:n},{signal:t}).then(ft)},i.listParts=function(e,{key:t,uploadId:i,signal:n},r){n??=r,l(this,Pt)[Pt]("listParts"),Ke(n);const o=encodeURIComponent(t);return l(this,bt)[bt].get(`s3/multipart/${encodeURIComponent(i)}?key=${o}`,{signal:n}).then(ft)},i.completeMultipartUpload=function(e,{key:t,uploadId:i,parts:n,signal:r},o){r??=o,l(this,Pt)[Pt]("completeMultipartUpload"),Ke(r);const s=encodeURIComponent(t),a=encodeURIComponent(i);return l(this,bt)[bt].post(`s3/multipart/${a}/complete?key=${s}`,{parts:n.map(({ETag:e,PartNumber:t})=>({ETag:e,PartNumber:t}))},{signal:r}).then(ft)},i.createSignedURL=async function(e,t){const i=await l(this,Ft)[Ft](t),n=mt(i.credentials)||604800,{uploadId:r,key:o,partNumber:s}=t;return{method:"PUT",expires:n,fields:{},url:`${await we({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:n,bucketName:i.bucket,Region:i.region,Key:null!=o?o:`${crypto.randomUUID()}-${e.name}`,uploadId:r,partNumber:s})}`,headers:{"Content-Type":e.type}}},i.signPart=function(e,{uploadId:t,key:i,partNumber:n,signal:r}){if(l(this,Pt)[Pt]("signPart"),Ke(r),null==t||null==i||null==n)throw new Error("Cannot sign without a key, an uploadId, and a partNumber");const o=encodeURIComponent(i);return l(this,bt)[bt].get(`s3/multipart/${encodeURIComponent(t)}/${n}?key=${o}`,{signal:r}).then(ft)},i.abortMultipartUpload=function(e,{key:t,uploadId:i,signal:n}){l(this,Pt)[Pt]("abortMultipartUpload");const r=encodeURIComponent(t),o=encodeURIComponent(i);return l(this,bt)[bt].delete(`s3/multipart/${o}?key=${r}`,void 0,{signal:n}).then(ft)},i.getUploadParameters=function(e,t){l(this,Pt)[Pt]("getUploadParameters");const{meta:i}=e,{type:n,name:r}=i,o=gt({meta:i,allowedMetaFields:de(this.opts.allowedMetaFields,e.meta),querify:!0}),s=new URLSearchParams({filename:r,type:n,...o});return l(this,bt)[bt].get(`s3/params?${s}`,t)},t.uploadPartBytes=async function({signature:{url:e,expires:t,headers:i,method:n="PUT"},body:r,size:o=r.size,onProgress:s,onComplete:a,signal:l}){if(Ke(l),null==e)throw new Error("Cannot upload to an undefined URL");return new Promise((u,d)=>{const p=new XMLHttpRequest;function c(){p.abort()}function h(){l?.removeEventListener("abort",c)}
2p.open(n,e,!0),i&&Object.keys(i).forEach(e=>{p.setRequestHeader(e,i[e])}),p.responseType="text","number"==typeof t&&(p.timeout=1e3*t),l?.addEventListener("abort",c),p.upload.addEventListener("progress",e=>{s(e)}),p.addEventListener("abort",()=>{h(),d(he())}),p.addEventListener("timeout",()=>{h();const e=new Error("Request has expired");e.source={status:403},d(e)}),p.addEventListener("load",()=>{if(h(),403===p.status&&p.responseText.includes("<Message>Request has expired</Message>")){const e=new Error("Request has expired");return e.source=p,void d(e)}if(p.status<200||p.status>=300){const e=new Error("Non 2xx");return e.source=p,void d(e)}s?.({loaded:o,lengthComputable:!0});const e=p.getAllResponseHeaders().trim().split(/[\r\n]+/),t={__proto__:null};for(const i of e){const e=i.split(": "),n=e.shift(),r=e.join(": ");t[n]=r}const{etag:i,location:r}=t;n.toUpperCase(),null!=i&&(a?.(i),u({...t,ETag:i}))}),p.addEventListener("error",e=>{h();const t=new Error("Unknown error");t.source=e.target,d(t)}),p.send(r)})},i.install=function(){l(this,Et)[Et](!0),this.uppy.addPreProcessor(l(this,At)[At]),this.uppy.addUploader(l(this,Ot)[Ot]),this.uppy.on("cancel-all",l(this,Ut)[Ut])},i.uninstall=function(){this.uppy.removePreProcessor(l(this,At)[At]),this.uppy.removeUploader(l(this,Ot)[Ot]),this.uppy.off("cancel-all",l(this,Ut)[Ut])},r(t)}(M);function xt(e){null!=e&&("endpoint"in e||"companionUrl"in e||"headers"in e||"companionHeaders"in e||"cookiesRule"in e||"companionCookiesRule"in e)&&("companionUrl"in e&&!("endpoint"in e)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in e&&!("headers"in e)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in e&&!("cookiesRule"in e)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in e?l(this,bt)[bt]=new T(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in e&&l(this,At)[At](),"cookiesRule"in e&&(l(this,bt)[bt].opts.companionCookiesRule=e.cookiesRule)))}function Nt(e){if(!l(this,bt)[bt])throw new Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${e}\` implementation.`)}async function Dt(e){if(Ke(e?.signal),null==l(this,_t)[_t]){const{getTemporarySecurityCredentials:t}=this.opts;!0===t?(l(this,Pt)[Pt]("getTemporarySecurityCredentials"),l(this,_t)[_t]=l(this,bt)[bt].get("s3/sts",e).then(ft)):l(this,_t)[_t]=t(e),l(this,_t)[_t]=await l(this,_t)[_t],setTimeout(()=>{l(this,_t)[_t]=null},500*(mt(l(this,_t)[_t].credentials)||0))}return l(this,_t)[_t]}function Rt(e){return new Promise((t,i)=>{if(null==e.data)throw new Error("File data is empty");const n=new Ge(e.data,{companionComm:l(this,vt)[vt],log:(...e)=>{var t;return(t=this.uppy).log.apply(t,e)},getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:(t,i)=>{var n;const r=this.uppy.getFile(e.id);
2this.uppy.emit("upload-progress",r,{uploadStarted:null!=(n=r.progress.uploadStarted)?n:0,bytesUploaded:t,bytesTotal:i})},onError:t=>{this.uppy.log(t),this.uppy.emit("upload-error",e,t),this.resetUploaderReferences(e.id),i(t)},onSuccess:i=>{const n={body:{...i},status:200,uploadURL:i.location};this.resetUploaderReferences(e.id),this.uppy.emit("upload-success",l(this,Ct)[Ct](e),n),i.location&&this.uppy.log(`Download ${e.name} from ${i.location}`),t(void 0)},onPartComplete:t=>{this.uppy.emit("s3-multipart:part-uploaded",l(this,Ct)[Ct](e),t)},file:e,shouldUseMultipart:this.opts.shouldUseMultipart,...e.s3Multipart});this.uploaders[e.id]=n;const r=new j(this.uppy);this.uploaderEvents[e.id]=r,r.onFileRemove(e.id,i=>{n.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${i} was removed`)}),r.onCancelAll(e.id,()=>{n.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${e.id} was canceled`)}),r.onFilePause(e.id,e=>{e?n.pause():n.start()}),r.onPauseAll(e.id,()=>{n.pause()}),r.onResumeAll(e.id,()=>{n.start()}),n.start()})}function Mt(e){return{..."remote"in e&&e.remote?.body,protocol:"s3-multipart",size:e.data.size,metadata:e.meta}}It.VERSION="5.1.0";var Bt=i(9646),Lt=u("callbacks"),jt=u("publish");let zt=function(){function e(){Object.defineProperty(this,jt,{value:$t}),this.state={},Object.defineProperty(this,Lt,{writable:!0,value:new Set})}var t=e.prototype;return t.getState=function(){return this.state},t.setState=function(e){const t={...this.state},i={...this.state,...e};this.state=i,l(this,jt)[jt](t,i,e)},t.subscribe=function(e){return l(this,Lt)[Lt].add(e),()=>{l(this,Lt)[Lt].delete(e)}},r(e)}();function $t(...e){l(this,Lt)[Lt].forEach(t=>{t.apply(void 0,e)})}zt.VERSION="5.0.0";const qt=zt;function Ht(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}const Vt={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Wt(e){if(e.type)return e.type;const t=e.name?Ht(e.name).extension?.toLowerCase():null;return t&&t in Vt?Vt[t]:"application/octet-stream"}function Gt(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}function Kt(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const i=Wt(e);return function(e,t){let i=t||"uppy";return"string"==typeof e.name&&(i+=`-${Gt(e.name.toLowerCase())}`),void 0!==e.type&&(i+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(i+=`-${Gt(e.meta.relativePath.toLowerCase())}`),void 0!==e.data?.size&&(i+=`-${e.data.size}`),void 0!==e.data.lastModified&&(i+=`-${e.data.lastModified}`),i}({...e,type:i},t)}var Xt=i(7350),Yt=i(6216);let Qt=(e=21)=>{let t="",i=0|e;for(;i-- >0;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};const Jt={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function Zt(e){return e<10?`0${e}`:e.toString()}function ei(){const e=new Date;return`${Zt(e.getHours())}:${Zt(e.getMinutes())}:${Zt(e.getSeconds())}`}const ti={debug:()=>{},warn:()=>{},error:(...e)=>{var t;return(t=console).error.apply(t,[`[Uppy] [${ei()}]`].concat(e))}},ii={debug:(...e)=>{var t;return(t=console).debug.apply(t,[`[Uppy] [${ei()}]`].concat(e))},warn:(...e)=>{var t;return(t=console).warn.apply(t,[`[Uppy] [${ei()}]`].concat(e))},error:(...e)=>{var t;return(t=console).error.apply(t,[`[Uppy] [${ei()}]`].concat(e))}};var ni=i.cjs(function(e,t){e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0;let i=Math.abs(e);if(t&&(i=-i),0===i)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(i)/Math.log(1024)),n.length-1),o=Number(i/1024**r),s=n[r];return`${o>=10||o%1==0?Math.round(o):o.toFixed(1)} ${s}`}}),ri=i(7057);const oi={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};let si=function(e){function t(t,i){var n,r;return(r=e.call(this,t)||this).isUserFacing=void 0,r.file=void 0,r.isRestriction=!0,r.isUserFacing=null==(n=i?.isUserFacing)||n,i?.file&&(r.file=i.file),r}return s(t,e),r(t)}(d(Error)),ai=function(){function e(e,t){this.getI18n=void 0,this.getOpts=void 0,this.getI18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions?.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}var t=e.prototype;return t.validateAggregateRestrictions=function(e,t){const{maxTotalFileSize:i,maxNumberOfFiles:n}=this.getOpts().restrictions;if(n){const i=e.filter(e=>!e.isGhost);if(i.length+t.length>n)throw new si(`${this.getI18n()("youCanOnlyUploadX",{smart_count:n})}`)}if(i){const n=[].concat(fe(me,e),fe(me,t)).reduce((e,t)=>
2{var i;return e+(null!=(i=t.size)?i:0)},0);if(n>i)throw new si(this.getI18n()("aggregateExceedsSize",{sizeAllowed:ni(i),size:ni(n)}))}},t.validateSingleFile=function(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:n}=this.getOpts().restrictions;if(n&&!n.some(t=>t.includes("/")?!!e.type&&ri(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){const t=n.join(", ");throw new si(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}var r;if(t&&null!=e.size&&e.size>t)throw new si(this.getI18n()("exceedsSize",{size:ni(t),file:null!=(r=e.name)?r:this.getI18n()("unnamed")}),{file:e});if(i&&null!=e.size&&e.size<i)throw new si(this.getI18n()("inferiorSize",{size:ni(i)}),{file:e})},t.validate=function(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)},t.validateMinNumberOfFiles=function(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new si(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))},t.getMissingRequiredMetaFields=function(e){var t;const i=new si(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:null!=(t=e.name)?t:this.getI18n()("unnamed")})),{requiredMetaFields:n}=this.getOpts().restrictions,r=[];for(const t of n)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||r.push(t);return{missingFields:r,error:i}},r(e)}();function li(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const i=t[1].split(".",2),n=parseInt(i[0],10),r=parseInt(i[1],10);return n<15||15===n&&r<15063||n>18||18===n&&r>=18218}const ui={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var di=u("plugins"),pi=u("restricter"),ci=u("storeUnsubscribe"),hi=u("emitter"),fi=u("preProcessors"),mi=u("uploaders"),gi=u("postProcessors"),yi=u("informAndEmit"),vi=u("checkRequiredMetaFieldsOnFile"),bi=u("checkRequiredMetaFields"),wi=u("assertNewUploadAllowed"),Pi=u("transformFile"),_i=u("startIfAutoProceed"),Fi=u("checkAndUpdateFileState"),Si=u("getFilesToRetry"),Ci=u("doRetryAll"),ki=u("handleUploadProgress"),Ti=u("updateTotalProgress"),Oi=u("updateTotalProgressThrottled"),Ai=u("calculateTotalProgress"),Ei=u("addListeners"),Ui=u("updateOnlineStatus"),Ii=u("requestClientById"),xi=u("createUpload"),Ni=u("getUpload"),Di=u("removeUpload"),Ri=u("runUpload");let Mi=function(){function e(t){Object.defineProperty(this,Ri,{value:Zi}),Object.defineProperty(this,Di,{value:Ji}),Object.defineProperty(this,Ni,{value:Qi}),Object.defineProperty(this,xi,{value:Yi}),Object.defineProperty(this,Ei,{value:Xi}),Object.defineProperty(this,Ai,{value:Ki}),Object.defineProperty(this,Ti,{value:Gi}),Object.defineProperty(this,Ci,{value:Wi}),Object.defineProperty(this,Si,{value:Vi}),Object.defineProperty(this,Fi,{value:Hi}),Object.defineProperty(this,_i,{value:qi}),Object.defineProperty(this,Pi,{value:$i}),Object.defineProperty(this,wi,{value:zi}),Object.defineProperty(this,bi,{value:ji}),Object.defineProperty(this,vi,{value:Li}),Object.defineProperty(this,yi,{value:Bi}),Object.defineProperty(this,di,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,ci,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:Yt()}),Object.defineProperty(this,fi,{writable:!0,value:new Set}),Object.defineProperty(this,mi,{writable:!0,value:new Set}),Object.defineProperty(this,gi,{writable:!0,value:new Set}),this.defaultLocale=void 0,this.locale=void 0,this.opts=void 0,this.store=void 0,this.i18n=void 0,this.i18nArray=void 0,this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,ki,{writable:!0,value:(e,t)=>{const i=e?this.getFile(e.id):void 0;if(null==e||!i)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);if(100===i.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);const n={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};null!=i.progress.uploadStarted?this.setFileState(e.id,{progress:{...i.progress,...n,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...n}}),l(this,Oi)[Oi]()}}),Object.defineProperty(this,Oi,{writable:!0,value:Xt(()=>l(this,Ti)[Ti](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,Ui,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Ii,{writable:!0,value:new Map}),this.defaultLocale=Jt;const i={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:oi,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new qt,logger:ti,infoTimeout:5e3},n={...i,...t};this.opts={...n,restrictions:{...i.restrictions,...t?.restrictions}},t?.logger&&t.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"):t?.debug&&(this.opts.logger=ii),this.log(`Using Core v${e.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...ui,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:li(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),l(this,pi)[pi]=new ai(()=>this.opts,()=>this.i18n),l(this,ci)[ci]=this.store.subscribe((e,t,i)=>
2{this.emit("state-update",e,t,i),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),l(this,Ei)[Ei]()}var t=e.prototype;return t.emit=function(e,...t){var i;(i=l(this,hi)[hi]).emit.apply(i,[e].concat(t))},t.on=function(e,t){return l(this,hi)[hi].on(e,t),this},t.once=function(e,t){return l(this,hi)[hi].once(e,t),this},t.off=function(e,t){return l(this,hi)[hi].off(e,t),this},t.updateAll=function(e){this.iteratePlugins(t=>{t.update(e)})},t.setState=function(e){this.store.setState(e)},t.getState=function(){return this.store.getState()},t.patchFilesState=function(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{...t[e],...i}]))}})},t.setFileState=function(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})},t.i18nInit=function(){const e=new D([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale},t.setOptions=function(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)},t.resetProgress=function(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(n=>{i[n]={...t[n],progress:{...t[n].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...ui})},t.clear=function(){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({...ui,files:{}})},t.addPreProcessor=function(e){l(this,fi)[fi].add(e)},t.removePreProcessor=function(e){return l(this,fi)[fi].delete(e)},t.addPostProcessor=function(e){l(this,gi)[gi].add(e)},t.removePostProcessor=function(e){return l(this,gi)[gi].delete(e)},t.addUploader=function(e){l(this,mi)[mi].add(e)},t.removeUploader=function(e){return l(this,mi)[mi].delete(e)},t.setMeta=function(e){const t={...this.getState().meta,...e},i={...this.getState().files};
2Object.keys(i).forEach(t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})},t.setFileMeta=function(e,t){const i={...this.getState().files};if(!i[e])return void this.log(`Was trying to set metadata for a file that has been removed: ${e}`);const n={...i[e].meta,...t};i[e]={...i[e],meta:n},this.setState({files:i})},t.getFile=function(e){return this.getState().files[e]},t.getFiles=function(){const{files:e}=this.getState();return Object.values(e)},t.getFilesByIds=function(e){return e.map(e=>this.getFile(e))},t.getObjectOfFilesPerState=function(){const{files:e,totalProgress:t,error:i}=this.getState(),n=Object.values(e),r=[],o=[],s=[],a=[],l=[],u=[],d=[],p=[],c=[];for(const e of n){const{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(r.push(e),e.isPaused||p.push(e)),t.uploadStarted||o.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&s.push(e),t.uploadStarted&&a.push(e),e.isPaused&&l.push(e),t.uploadComplete&&u.push(e),e.error&&d.push(e),(t.preprocess||t.postprocess)&&c.push(e)}return{newFiles:o,startedFiles:s,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:p,processingFiles:c,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===n.length&&0===c.length,isAllErrored:!!i&&d.length===n.length,isAllPaused:0!==r.length&&l.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:n.some(e=>e.isGhost)}},t.validateRestrictions=function(e,t=this.getFiles()){try{l(this,pi)[pi].validate(t,[e])}catch(e){return e}return null},t.validateSingleFile=function(e){try{l(this,pi)[pi].validateSingleFile(e)}catch(e){return e.message}return null},t.validateAggregateRestrictions=function(e){const t=this.getFiles();try{l(this,pi)[pi].validateAggregateRestrictions(t,e)}catch(e){return e.message}return null},t.checkIfFileAlreadyExists=function(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)},t.addFile=function(e){const{nextFilesState:t,validFilesToAdd:i,errors:n}=l(this,Fi)[Fi]([e]),r=n.filter(e=>e.isRestriction);if(l(this,yi)[yi](r),n.length>0)throw n[0];this.setState({files:t});const[o]=i;return this.emit("file-added",o),this.emit("files-added",i),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),l(this,_i)[_i](),o.id},t.addFiles=function(e){const{nextFilesState:t,validFilesToAdd:i,errors:n}=l(this,Fi)[Fi](e),r=n.filter(e=>e.isRestriction);l(this,yi)[yi](r);const o=n.filter(e=>!e.isRestriction);if(o.length>0){let e="Multiple errors occurred while adding files:\n";if(o.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(o,e);{const t=new Error(e);throw t.errors=o,t}}this.setState({files:t}),i.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(e=>{this.log(`Added file: ${e.name}\n id: ${e.id}\n type: ${e.type}`)}),i.length>0&&l(this,_i)[_i]()},t.removeFiles=function(e){const{files:t,currentUploads:i}=this.getState(),n={...t},r={...i},o=Object.create(null);function s(e){return void 0===o[e]}e.forEach(e=>{t[e]&&(o[e]=t[e],delete n[e])}),Object.keys(r).forEach(e=>{const t=i[e].fileIDs.filter(s);if(0===t.length)return void delete r[e];const{capabilities:n}=this.getState();if(t.length!==i[e].fileIDs.length&&!n.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[e]={...i[e],fileIDs:t}});const a={currentUploads:r,files:n};0===Object.keys(n).length&&(a.allowNewUpload=!0,a.error=null,a.recoveredState=null),this.setState(a),l(this,Oi)[Oi]();const u=Object.keys(o);u.forEach(e=>{this.emit("file-removed",o[e])}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)},t.removeFile=function(e){this.removeFiles([e])},t.pauseResume=function(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;
2const t=this.getFile(e),i=!t.isPaused;return this.setFileState(e,{isPaused:i}),this.emit("upload-pause",t,i),i},t.pauseAll=function(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const i={...e[t],isPaused:!0};e[t]=i}),this.setState({files:e}),this.emit("pause-all")},t.resumeAll=function(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e}),this.emit("resume-all")},t.retryAll=async function(){const e=await l(this,Ci)[Ci]();return this.emit("complete",e),e},t.cancelAll=function(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(ui)},t.retryUpload=function(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=l(this,xi)[xi]([e],{forceAllowNewUpload:!0});return l(this,Ri)[Ri](t)},t.logout=function(){this.iteratePlugins(e=>{e.provider?.logout?.()})},t[Symbol.for("uppy test: updateTotalProgress")]=function(){return l(this,Ti)[Ti]()},t.updateOnlineStatus=function(){var e;
2null==(e=window.navigator.onLine)||e?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)},t.getID=function(){return this.opts.id},t.use=function(e,...t){if("function"!=typeof e)throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const i=Bt(e,[this].concat(t)),n=i.id;if(!n)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(n);if(r){const e=`Already found a plugin named '${r.id}'. Tried to use: '${n}'.\nUppy plugins must have unique \`id\` options.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),i.type in l(this,di)[di]?l(this,di)[di][i.type].push(i):l(this,di)[di][i.type]=[i],i.install(),this.emit("plugin-added",i),this},t.getPlugin=function(e){for(const t of Object.values(l(this,di)[di])){const i=t.find(t=>t.id===e);if(null!=i)return i}},t[Symbol.for("uppy test: getPlugins")]=function(e){return l(this,di)[di][e]},t.iteratePlugins=function(e){Object.values(l(this,di)[di]).flat(1).forEach(e)},t.removePlugin=function(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=l(this,di)[di][e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);const n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)},t.destroy=function(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),l(this,ci)[ci](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",l(this,Ui)[Ui]),window.removeEventListener("offline",l(this,Ui)[Ui]))},t.hideInfo=function(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")},t.info=function(e,t="info",i=3e3){const n="object"==typeof e;this.setState({info:[].concat(fe(me,this.getState().info),[{type:t,message:n?e.message:e,details:n?e.details:null}])}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")},t.log=function(e,t){const{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}},t.registerRequestClient=function(e,t){l(this,Ii)[Ii].set(e,t)},t.getRequestClientForFile=function(e){if(!("remote"in e)||!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=l(this,Ii)[Ii].get(e.remote.requestClientId);if(null==t)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t},t.restore=async function(e){this.log(`Core: Running restored upload "${e}"`);const t=await l(this,Ri)[Ri](e);return this.emit("complete",t),t},t[Symbol.for("uppy test: createUpload")]=function(...e){var t;return(t=l(this,xi))[xi].apply(t,e)},t.addResultData=function(e,t){if(!l(this,Ni)[Ni](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:i}=this.getState(),n={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:n}})},t.upload=async function(){l(this,di)[di].uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(l(this,Si)[Si]().length>0){const t=await l(this,Ci)[Ci]();if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}const t=this.opts.onBeforeUpload(e);if(!1===t)throw new Error("Not starting the upload because onBeforeUpload returned false");t&&"object"==typeof t&&(e=t,this.setState({files:e}));try{if(l(this,pi)[pi].validateMinNumberOfFiles(e),!l(this,bi)[bi](e))throw new si(this.i18n("missingRequiredMetaField"));const{currentUploads:t}=this.getState(),i=Object.values(t).flatMap(e=>e.fileIDs),n=Object.keys(e).filter(e=>{const t=this.getFile(e);return t&&!t.progress.uploadStarted&&!i.includes(e)}),r=l(this,xi)[xi](n),o=await l(this,Ri)[Ri](r);
2return this.emit("complete",o),o}catch(e){throw l(this,yi)[yi]([e]),e}},r(e)}();function Bi(e){for(const t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");const t=e.filter(e=>e.isUserFacing),i=t.slice(0,4),n=t.slice(4);i.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),n.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:n.length})})}function Li(e){const{missingFields:t,error:i}=l(this,pi)[pi].getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}function ji(e){let t=!0;for(const i of Object.values(e))l(this,vi)[vi](i)||(t=!1);return t}function zi(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new si(this.i18n("noMoreFilesAllowed"),{file:e});throw l(this,yi)[yi]([t]),t}}function $i(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=Wt(t),n=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(i,t),r=Ht(n).extension,o=Kt(t,this.getID()),s={...t.meta,name:n,type:i},a=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:o,name:n,extension:r||"",meta:{...this.getState().meta,...s},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}}function qi(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function Hi(e){let{files:t}=this.getState(),i={...t};const n=[],r=[];for(const s of e)try{let e=l(this,Pi)[Pi](s);l(this,wi)[wi](e);const r=t[e.id],a=r?.isGhost;if(a&&!e.isRemote){if(null==e.data)throw new Error("File data is missing");e={...r,isGhost:!1,data:e.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`)}const u=this.opts.onBeforeFileAdded(e,i);var o;if(t=this.getState().files,i={...t,...i},!u&&this.checkIfFileAlreadyExists(e.id))throw new si(this.i18n("noDuplicates",{fileName:null!=(o=e.name)?o:this.i18n("unnamed")}),{file:e});if(!1===u&&!a)throw new si("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:e});"object"==typeof u&&null!==u&&(e=u),l(this,pi)[pi].validateSingleFile(e),i[e.id]=e,n.push(e)}catch(e){r.push(e)}try{l(this,pi)[pi].validateAggregateRestrictions(Object.values(t),n)}catch(e){return r.push(e),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:n,errors:r}}function Vi(){const{files:e}=this.getState();return Object.keys(e).filter(t=>{const i=e[t];return i.error&&(!i.missingRequiredMetaFields||0===i.missingRequiredMetaFields.length)})}async function Wi(){const e=l(this,Si)[Si](),t={...this.getState().files};if(e.forEach(e=>{t[e]={...t[e],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};const i=l(this,xi)[xi](e,{forceAllowNewUpload:!0});return l(this,Ri)[Ri](i)}function Gi(){const e=l(this,Ai)[Ai]();let t=null;null!=e&&(t=Math.round(100*e),t>100?t=100:t<0&&(t=0)),this.emit("progress",null!=t?t:0),this.setState({totalProgress:null!=t?t:0})}function Ki(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return 0;if(e.every(e=>e.progress.uploadComplete))return 1;const t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,i=e.filter(t),n=e.filter(e=>!t(e));if(i.every(e=>e.progress.uploadComplete)&&n.length>0&&!n.every(e=>e.progress.uploadComplete))return null;const r=i.reduce((e,t)=>{var i;return e+(null!=(i=t.progress.bytesTotal)?i:0)},0),o=i.reduce((e,t)=>
2e+(t.progress.bytesUploaded||0),0);return 0===r?0:o/r}function Xi(){const e=(e,t,i)=>{let n=e.message||"Unknown error";e.details&&(n+=` ${e.details}`),this.setState({error:n}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:n,response:i})};this.on("error",e),this.on("upload-error",(t,i,n)=>{if(e(i,t,n),"object"==typeof i&&i.message){var r;this.log(i.message,"error");const e=new Error(this.i18n("failedToUpload",{file:null!=(r=t?.name)?r:""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),l(this,yi)[yi]([e])}else l(this,yi)[yi]([i])});let t=null;this.on("upload-stalled",(e,i)=>{const{message:n}=e,r=i.map(e=>e.meta.name).join(", ");t||(this.info({message:n,details:r},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${n} ${r}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-start",e=>{const t=e.filter(e=>{const t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${e?.id}`),t}),i=Object.fromEntries(t.map(e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}]));this.patchFilesState(i)}),this.on("upload-progress",l(this,ki)[ki]),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const i=this.getFile(e.id).progress,n=l(this,gi)[gi].size>0;this.setFileState(e.id,{progress:{...i,postprocess:n?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!n&&{complete:!0},percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),l(this,Oi)[Oi]()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)}),this.on("postprocess-complete",e=>{const t=e&&this.getFile(e.id);if(null==t)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const{postprocess:i,...n}=t.progress;this.patchFilesState({[t.id]:{progress:{...n,complete:!0}}})}),this.on("restored",()=>{l(this,Oi)[Oi]()}),this.on("dashboard:file-edit-complete",e=>{e&&l(this,vi)[vi](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",l(this,Ui)[Ui]),window.addEventListener("offline",l(this,Ui)[Ui]),setTimeout(l(this,Ui)[Ui],3e3))}function Yi(e,t={}){const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!i)throw new Error("Cannot create a new upload: already uploading.");const o=Qt();return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[o]:{fileIDs:e,step:0,result:{}}}}),o}function Qi(e){const{currentUploads:t}=this.getState();return t[e]}function Ji(e){const{[e]:t,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async function Zi(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let i=t();if(!i)throw new Error("Nonexistent upload");const n=[].concat(fe(me,l(this,fi)[fi]),fe(me,l(this,mi)[mi]),fe(me,l(this,gi)[gi]));try{for(let r=i.step||0;r<n.length;r++){const o=n[r];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:r}}});const{fileIDs:s}=i;if(await o(s,e),i=t(),!i)break}}catch(t){throw l(this,Di)[Di](e),t}
vendor: 7,079 bytes, line 2
2if(i){i.fileIDs.forEach(e=>{const t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)});const n=i.fileIDs.map(e=>this.getFile(e)),r=n.filter(e=>!e.error),o=n.filter(e=>e.error);this.addResultData(e,{successful:r,failed:o,uploadID:e}),i=t()}let r;return i&&(r=i.result,l(this,Di)[Di](e)),null==r&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}Mi.VERSION="5.2.0";const en=Mi;var tn,nn,rn,on,sn,an,ln,un,dn,pn,cn,hn,fn,mn,gn={},yn=[],vn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,bn=Array.isArray;function wn(e,t){for(var i in t)e[i]=t[i];return e}function Pn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _n(e,t,i){var n,r,o,s={};for(o in t)"key"==o?n=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?tn.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Fn(e,s,n,r,null)}function Fn(e,t,i,n,r){var o={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++rn,__i:-1,__u:0};return null==r&&null!=nn.vnode&&nn.vnode(o),o}function Sn(e){return e.children}function Cn(e,t){this.props=e,this.context=t}function kn(e,t){if(null==t)return e.__?kn(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?kn(e):null}function Tn(e){if(e.__P&&e.__d){var t=e.__v,i=t.__e,n=[],r=[],o=wn({},t);o.__v=t.__v+1,nn.vnode&&nn.vnode(o),Ln(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[i]:null,n,i??kn(t),!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,zn(n,o,r),t.__e=t.__=null,o.__e!=i&&On(o)}}function On(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),On(e)}function An(e){(!e.__d&&(e.__d=!0)&&on.push(e)&&!En.__r++||sn!=nn.debounceRendering)&&((sn=nn.debounceRendering)||an)(En)}function En(){try{for(var e,t=1;on.length;)on.length>t&&on.sort(ln),e=on.shift(),t=on.length,Tn(e)}finally{on.length=En.__r=0}}function Un(e,t,i,n,r,o,s,a,l,u,d){var p,c,h,f,m,g,y=n&&n.__k||yn,v=t.length;for(l=In(i,t,y,l,v),p=0;p<v;p++)null!=(h=i.__k[p])&&(c=-1!=h.__i&&y[h.__i]||gn,h.__i=p,g=Ln(e,h,c,r,o,s,a,l,u,d),f=h.__e,h.ref&&c.ref!=h.ref&&(c.ref&&Hn(c.ref,null,h),d.push(h.ref,h.__c||f,h)),null==m&&null!=f&&(m=f),4&h.__u?(l=xn(h,l,e),c.__e&&(c.__e=null)):"function"==typeof h.type&&void 0!==g?l=g:f&&(l=f.nextSibling),h.__u&=-7);return i.__e=m,l}function In(e,t,i,n,r){var o,s,a,l,u,d=i.length,p=d,c=0;for(e.__k=new Array(r),o=0;o<r;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[o]=Fn(null,s,null,null,null):bn(s)?s=e.__k[o]=Fn(Sn,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[o]=Fn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,l=o+c,s.__=e,s.__b=e.__b+1,a=null,-1!=(u=s.__i=Dn(s,i,l,p))&&(p--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(r>d?c--:r<d&&c++),"function"!=typeof s.type&&(s.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,s.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<d;o++)null!=(a=i[o])&&!(2&a.__u)&&(a.__e==n&&(n=kn(a)),Vn(a,a));return n}function xn(e,t,i){var n,r;if("function"==typeof e.type){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=xn(n[r],t,i));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=kn(e)),t=i.insertBefore(e.__e,t||null));do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Nn(e,t){return t=t||[],null==e||"boolean"==typeof e||(bn(e)?e.some(function(e){Nn(e,t)}):t.push(e)),t}function Dn(e,t,i,n){var r,o,s,a=e.key,l=e.type,u=t[i],d=null!=u&&!(2&u.__u);if(null===u&&null==a||d&&a==u.key&&l==u.type)return i;if(n>(d?1:0))for(r=i-1,o=i+1;r>=0||o<t.length;)if(null!=(u=t[s=r>=0?r--:o++])&&!(2&u.__u)&&a==u.key&&l==u.type)return s;return-1}function Rn(e,t,i){"-"==t[0]?e.setProperty(t,i??""):e[t]=null==i?"":"number"!=typeof i||vn.test(t)?i:i+"px"}function Mn(e,t,i,n,r){var o,s;e:if("style"==t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||Rn(e.style,t,"");if(i)for(t in i)n&&i[t]==n[t]||Rn(e.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(cn,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=i,i?n?i[pn]=n[pn]:(i[pn]=hn,e.addEventListener(t,o?mn:fn,o)):e.removeEventListener(t,o?mn:fn,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=i??"";break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function Bn(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t[dn])t[dn]=hn++;else if(t[dn]<i[pn])return;return i(nn.event?nn.event(t):t)}}}function Ln(e,t,i,n,r,o,s,a,l,u){var d,p,c,h,f,m,g,y,v,b,w,P,_,F,S,C,k=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),o=[a=t.__e=i.__e]),(d=nn.__b)&&d(t);e:if("function"==typeof k){p=s.length;try{if(v=t.props,b=k.prototype&&k.prototype.render,w=(d=k.contextType)&&n[d.__c],P=d?w?w.props.value:d.__:n,i.__c?y=(c=t.__c=i.__c).__=c.__E:(b?t.__c=c=new k(v,P):(t.__c=c=new Cn(v,P),c.constructor=k,c.render=Wn),w&&w.sub(c),c.state||(c.state={}),c.__n=n,h=c.__d=!0,c.__h=[],c._sb=[]),b&&null==c.__s&&(c.__s=c.state),b&&null!=k.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=wn({},c.__s)),wn(c.__s,k.getDerivedStateFromProps(v,c.__s))),f=c.props,m=c.state,c.__v=t,h)b&&null==k.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),b&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(b&&null==k.getDerivedStateFromProps&&v!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(v,P),t.__v==i.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(v,c.__s,P)){t.__v!=i.__v&&(c.props=v,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),yn.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c),a=kn(i);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(v,c.__s,P),b&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(f,m,g)})}if(c.context=P,c.props=v,c.__P=e,c.__e=!1,_=nn.__r,F=0,b)c.state=c.__s,c.__d=!1,_&&_(t),d=c.render(c.props,c.state,c.context),yn.push.apply(c.__h,c._sb),c._sb=[];else do{c.__d=!1,_&&_(t),d=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++F<25);c.state=c.__s,null!=c.getChildContext&&(n=wn(wn({},n),c.getChildContext())),b&&!h&&null!=c.getSnapshotBeforeUpdate&&(g=c.getSnapshotBeforeUpdate(f,m)),S=null!=d&&d.type===Sn&&null==d.key?$n(d.props.children):d,a=Un(e,bn(S)?S:[S],t,i,n,r,o,s,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&s.push(c),y&&(c.__E=c.__=null)}
vendor: 4,172 bytes, line 2
2catch(e){if(s.length=p,t.__v=null,l||null!=o){if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=o&&(o[o.indexOf(a)]=null),t.__e=a}else if(null!=o)for(C=o.length;C--;)Pn(o[C])}else t.__e=i.__e;null==t.__k&&(t.__k=i.__k||[]),e.then||jn(t),nn.__e(e,t,i)}}else null==o&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):a=t.__e=qn(i.__e,t,i,n,r,o,s,l,u);return(d=nn.diffed)&&d(t),128&t.__u?void 0:a}function jn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(jn))}function zn(e,t,i){for(var n=0;n<i.length;n++)Hn(i[n],i[++n],i[++n]);nn.__c&&nn.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){nn.__e(e,t.__v)}})}function $n(e){return"object"!=typeof e||null==e||e.__b>0?e:bn(e)?e.map($n):void 0!==e.constructor?null:wn({},e)}function qn(e,t,i,n,r,o,s,a,l){var u,d,p,c,h,f,m,g=i.props||gn,y=t.props,v=t.type;if("svg"==v?r="http://www.w3.org/2000/svg":"math"==v?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!v&&(v?h.localName==v:3==h.nodeType)){e=h,o[u]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(r,v,y.is&&y),a&&(nn.__m&&nn.__m(t,o),a=!1),o=null}if(null==v)g===y||a&&e.data==y||(e.data=y);else{if(o="textarea"==v&&null!=y.defaultValue?null:o&&tn.call(e.childNodes),!a&&null!=o)for(g={},u=0;u<e.attributes.length;u++)g[(h=e.attributes[u]).name]=h.value;for(u in g)h=g[u],"dangerouslySetInnerHTML"==u?p=h:"children"==u||u in y||"value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y||Mn(e,u,null,h,r);for(u in y)h=y[u],"children"==u?c=h:"dangerouslySetInnerHTML"==u?d=h:"value"==u?f=h:"checked"==u?m=h:a&&"function"!=typeof h||g[u]===h||Mn(e,u,h,g[u],r);if(d)a||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),Un("template"==t.type?e.content:e,bn(c)?c:[c],t,i,n,"foreignObject"==v?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:i.__k&&kn(i,0),a,l),null!=o)for(u=o.length;u--;)Pn(o[u]);a&&"textarea"!=v||(u="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==v&&!f||"option"==v&&f!=g[u])&&Mn(e,u,f,g[u],r),u="checked",null!=m&&m!=e[u]&&Mn(e,u,m,g[u],r))}return e}function Hn(e,t,i){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){nn.__e(e,i)}}function Vn(e,t,i){var n,r;if(nn.unmount&&nn.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Hn(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){nn.__e(e,t)}n.base=n.__P=n.__n=null}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&Vn(n[r],t,i||"function"!=typeof e.type);i||Pn(e.__e),e.__c=e.__=e.__e=void 0}function Wn(e,t,i){return this.constructor(e,i)}function Gn(e,t,i){var n,r,o,s;t==document&&(t=document.documentElement),nn.__&&nn.__(e,t),r=(n="function"==typeof i)?null:i&&i.__k||t.__k,o=[],s=[],Ln(t,e=(!n&&i||t).__k=_n(Sn,null,[e]),r||gn,gn,t.namespaceURI,!n&&i?[i]:r?null:t.firstChild?tn.call(t.childNodes):null,o,!n&&i?i:r?r.__e:t.firstChild,n,s),zn(o,e,s),e.props.children=null}function Kn(e,t,i){var n,r,o,s,a=wn({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?r=t[o]:a[o]=void 0===t[o]&&null!=s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?tn.call(arguments,2):i),Fn(e.type,a,n||e.key,r||e.ref,null)}tn=yn.slice,nn={__e:function(e,t,i,n){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,n||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},rn=0,Cn.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=wn({},this.state),"function"==typeof e&&(e=e(wn({},i),this.props)),e&&wn(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),An(this))},Cn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),An(this))},Cn.prototype.render=Sn,on=[],an="function"==typeof Promise?Promise.prototype.then.bind(Prom
2ise.resolve()):setTimeout,ln=function(e,t){return e.__v.__b-t.__v.__b},En.__r=0,un=Math.random().toString(8),dn="__d"+un,pn="__a"+un,cn=/(PointerCapture)$|Capture$/i,hn=0,fn=Bn(!1),mn=Bn(!0);var Xn=0;function Yn(e,t,i,n,r,o){t||(t={});var s,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?s=t[a]:l[a]=t[a];var u={type:e,props:l,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xn,__i:-1,__u:0,__source:r,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return nn.vnode&&nn.vnode(u),u}async function Qn(e,t){localStorage.setItem(e,t)}async function Jn(e){return localStorage.getItem(e)}async function Zn(e){localStorage.removeItem(e)}function er(e){return"string"==typeof e?new RegExp(e):e instanceof RegExp?e:void 0}function tr(e,t){if(e){const t=e=>{if(!("string"==typeof e&&er(e)||e instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp')};return Array.isArray(e)?e.every(t):t(e),e}let i=t;return/^(?!https?:\/\/).*$/i.test(i)&&(i=`https://${t.replace(/^\/\//,"")}`),i=new URL(i).origin,i=i.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&"),i}Array.isArray;var ir=u("refreshingTokenPromise"),nr=u("getAuthToken"),rr=u("getPlugin");let or=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,Object.defineProperty(n,rr,{value:ar}),Object.defineProperty(n,nr,{value:sr}),Object.defineProperty(n,ir,{writable:!0,value:void 0}),n.provider=void 0,n.id=void 0,n.name=void 0,n.pluginId=void 0,n.tokenKey=void 0,n.companionKeysParams=void 0,n.preAuthToken=void 0,n.supportsRefreshToken=void 0,n.provider=i.provider,n.id=n.provider,n.name=n.opts.name||n.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),n.pluginId=n.opts.pluginId,n.tokenKey=`companion-${n.pluginId}-auth-token`,n.companionKeysParams=n.opts.companionKeysParams,n.preAuthToken=null,n.supportsRefreshToken=!!i.supportsRefreshToken,n}s(t,e);var i=t.prototype;return i.headers=async function(){const[t,i]=await Promise.all([e.prototype.headers.call(this),l(this,nr)[nr]()]),n={};return i&&(n["uppy-auth-token"]=i),this.companionKeysParams&&(n["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...n}},i.onReceiveResponse=function(t){e.prototype.onReceiveResponse.call(this,t);const i=l(this,rr)[rr](),n=i.getPluginState().authenticated?401!==t.status:t.status<400;return i.setPluginState({authenticated:n}),t},i.setAuthToken=async function(e){return l(this,rr)[rr]().storage.setItem(this.tokenKey,e)},i.removeAuthToken=async function(){return l(this,rr)[rr]().storage.removeItem(this.tokenKey)},i.ensurePreAuth=async function(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")},i.authQuery=function(e){return{}},i.authUrl=function({authFormData:e,query:t}){const i=new URLSearchParams({...t,state:btoa(JSON.stringify({origin:location.origin})),...this.authQuery({authFormData:e})});
2return this.preAuthToken&&i.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${i}`},i.loginSimpleAuth=async function({uppyVersions:e,authFormData:t,signal:i}){const n=await this.post(`${this.id}/simple-auth`,{form:t},{qs:{uppyVersions:e},signal:i});this.setAuthToken(n.uppyAuthToken)},i.loginOAuth=async function({uppyVersions:e,authFormData:t,signal:i}){await this.ensurePreAuth(),i.throwIfAborted();const n=this.authUrl({query:{uppyVersions:e},authFormData:t}),r=window.open(n,"_blank");let o,s;try{return await new Promise((e,t)=>{s=i=>{if(i.source!==r){let e="";try{e=JSON.stringify(i.data)}catch(e){}return void this.uppy.log(`ignoring event from unknown source ${e}`,"warning")}const{companionAllowedHosts:n}=l(this,rr)[rr]().opts;if(o=i.origin,s=n,!(Array.isArray(s)?s.map(er):[er(s)]).some(e=>e?.test(o)||e?.test(`${o}/`)))return void this.uppy.log(`ignoring event from ${i.origin} vs allowed pattern ${n}`,"warning");var o,s;const a="string"==typeof i.data?JSON.parse(i.data):i.data;if(a.error){const{uppy:e}=this,i=e.i18n("authAborted");return e.info({message:i},"warning",5e3),void t(new Error("auth aborted"))}a.token?e(this.setAuthToken(a.token)):t(new Error("did not receive token from auth window"))},r&&(o=window.setInterval(()=>{r.closed&&t(new Error("Auth window was closed by the user"))},500)),i.addEventListener("abort",()=>t(new Error("Aborted"))),window.addEventListener("message",s)})}finally{r?.close(),window.clearInterval(o),s&&window.removeEventListener("message",s)}},i.login=async function({uppyVersions:e,authFormData:t,signal:i}){return this.loginOAuth({uppyVersions:e,authFormData:t,signal:i})},i.refreshTokenUrl=function(){return`${this.hostname}/${this.id}/refresh-token`},i.fileUrl=function(e){return`${this.hostname}/${this.id}/get/${e}`},i.request=async function(...t){await l(this,ir)[ir];try{var i;return await(i=e.prototype.request).call.apply(i,[this].concat(t))}catch(i){var n;if(!this.supportsRefreshToken)throw i;const r=await l(this,nr)[nr]();if(!i.isAuthError||!r)throw i;return null==l(this,ir)[ir]&&(l(this,ir)[ir]=(async()=>{try{this.uppy.log("[CompanionClient] Refreshing expired auth token");const t=await e.prototype.request.call(this,{path:this.refreshTokenUrl(),method:"POST"});await this.setAuthToken(t.uppyAuthToken)}catch(e){throw e.isAuthError&&await this.removeAuthToken(),i}finally{l(this,ir)[ir]=void 0}})()),await l(this,ir)[ir],(n=e.prototype.request).call.apply(n,[this].concat(t))}},i.fetchPreAuthToken=async function(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}},i.list=function(e,t){return this.get(`${this.id}/list/${e||""}`,t)},i.search=function(e,t={}){const i=new URLSearchParams;i.set("q",e),t.path&&i.set("path",t.path),t.cursor&&i.set("cursor",t.cursor);const n=`${this.id}/search?${i.toString()}`;return this.get(n,t)},i.logout=async function(e){const t=await this.get(`${this.id}/logout`,e);return await this.removeAuthToken(),t},r(t)}(T);async function sr(){return l(this,rr)[rr]().storage.getItem(this.tokenKey)}function ar(){const e=this.uppy.getPlugin(this.pluginId);if(null==e)throw new Error("Plugin was nullish");return e}function lr(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}var ur=u("updateUI");let dr=function(e){function t(...t){var i;return i=e.call.apply(e,[this].concat(t))||this,Object.defineProperty(i,ur,{writable:!0,value:void 0}),i.isTargetDOMEl=void 0,i.el=void 0,i.parent=void 0,i.title=void 0,i}s(t,e);var i=t.prototype;return i.getTargetPlugin=function(e){let t;if("function"==typeof e?.addTarget)t=e;else if("function"==typeof e){const i=e;this.uppy.iteratePlugins(e=>{e instanceof i&&(t=e)})}return t}
2,i.mount=function(e,t){const i=t.id,n=function(e,t=document){return"string"==typeof e?t.querySelector(e):lr(e)?e:null}(e);if(n){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),l(this,ur)[ur]=function(e){let t,i=null;return(...n)=>(t=n,i||(i=Promise.resolve().then(()=>(i=null,e.apply(void 0,fe(me,t))))),i)}(e=>{this.uppy.getPlugin(this.id)&&(Gn(this.render(e,t),t),this.afterUpdate())}),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),Gn(this.render(this.uppy.getState(),t),t),this.el=t,n.appendChild(t),t.dir=this.opts.direction||function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir}(t)||"ltr",this.onMount(),this.el}const r=this.getTargetPlugin(e);if(r)return this.uppy.log(`Installing ${i} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let o=`Invalid target option given to ${i}.`;throw o+="function"==typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)},i.render=function(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")},i.update=function(e){null!=this.el&&l(this,ur)[ur]?.(e)},i.unmount=function(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()},i.onMount=function(){},i.onUnmount=function(){},r(t)}(M);const pr=dr;var cr,hr,fr,mr,gr=i(6942),yr=i(8221),vr=0,br=[],wr=nn,Pr=wr.__b,_r=wr.__r,Fr=wr.diffed,Sr=wr.__c,Cr=wr.unmount,kr=wr.__;function Tr(e,t){wr.__h&&wr.__h(hr,e,vr||t),vr=0;var i=hr.__H||(hr.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Or(e){return vr=1,function(e,t){var i=Tr(cr++,2);if(i.t=e,!i.__c&&(i.__=[Lr(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=hr,!hr.__f)){var n=function(e,t,n){if(!i.__c.__H)return!0;var o=!1,s=i.__c.props!==e;if(i.__c.__H.__.some(function(e){if(e.__N){o=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),r){var a=r.call(this,e,t,n);return o?a||s:a}return!o||s};hr.__f=!0;var r=hr.shouldComponentUpdate,o=hr.componentWillUpdate;hr.componentWillUpdate=function(e,t,i){if(this.__e){var s=r;r=void 0,n(e,t,i),r=s}o&&o.call(this,e,t,i)},hr.shouldComponentUpdate=n}return i.__N||i.__}(Lr,e)}function Ar(e,t){var i=Tr(cr++,3);!wr.__s&&Br(i.__H,t)&&(i.__=e,i.u=t,hr.__H.__h.push(i))}function Er(e){return vr=5,Ur(function(){return{current:e}},[])}function Ur(e,t){var i=Tr(cr++,7);return Br(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Ir(e,t){return vr=8,Ur(function(){return e},t)}function xr(){for(var e;e=br.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Rr),t.__h.some(Mr),t.__h=[]}catch(i){t.__h=[],wr.__e(i,e.__v)}}}wr.__b=function(e){hr=null,Pr&&Pr(e)},wr.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),kr&&kr(e,t)},wr.__r=function(e){_r&&_r(e),cr=0;var t=(hr=e.__c).__H;t&&(fr===hr?(t.__h=[],hr.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Rr),t.__h.some(Mr),t.__h=[],cr=0)),fr=hr},wr.diffed=function(e){Fr&&Fr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==br.push(t)&&mr===wr.requestAnimationFrame||((mr=wr.requestAnimationFrame)||Dr)(xr)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),fr=hr=null},wr.__c=function(e,t){t.some(function(e){try{e.__h.some(Rr),e.__h=e.__h.filter(function(e){return!e.__||Mr(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],wr.__e(i,e.__v)}}),Sr&&Sr(e,t)},wr.unmount=function(e){Cr&&Cr(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.some(function(e){try{Rr(e)}catch(e){t=e}}),i.__H=void 0,t&&wr.__e(t,i.__v))};var Nr="function"==typeof requestAnimationFrame;function Dr(e){var t,i=function(){clearTimeout(n),Nr&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,35);Nr&&(t=requestAnimationFrame(i))}function Rr(e){var t=hr,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),hr=t}function Mr(e){var t=hr;e.__c=e.__(),hr=t}function Br(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function Lr(e,t){return"function"==typeof t?t(e):t}const jr={position:"relative",width:"100%",minHeight:"100%"},zr={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function $r({data:e,rowHeight:t,renderRow:i,overscanCount:n=10,padding:r=4,...o}){const s=Er(null),[a,l]=Or(0),[u,d]=Or(0);Ar(()=>{function e(){null!=s.current&&u!==s.current.offsetHeight&&d(s.current.offsetHeight)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[u]);const p=Ir(()=>{s.current&&l(s.current.scrollTop)},[]);let c=Math.floor(a/t),h=Math.floor(u/t);n&&(c=Math.max(0,c-c%n),h+=n);const f=c+h+r,m=e.slice(c,f),g={...jr,height:e.length*t},y={...zr,top:c*t};return Yn("div",{onScroll:p,ref:s,...o,children:Yn("div",{role:"presentation",style:g,children:Yn("div",{role:"presentation",style:y,children:m.map(i)})})})}function qr(){return Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:Yn("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"})})}function Hr(){return Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:Yn("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32
2-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"})})}function Vr(){return Yn("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[Yn("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),Yn("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"})]})}function Wr({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return Yn(qr,{});case"folder":return Yn(Hr,{});case"video":return Yn(Vr,{});default:return Yn("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}const Gr=function({file:e,toggleCheckbox:t,className:i,isDisabled:n,restrictionError:r,showTitles:o,children:s=null,i18n:a}){var l,u;return Yn("li",{className:i,title:n&&r?r:void 0,children:[Yn("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:n,"data-uppy-super-focusable":!0}),Yn("label",{htmlFor:e.id,"aria-label":null!=(l=e.data.name)?l:a("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[Yn(Wr,{itemIconString:e.data.thumbnail||e.data.icon}),o&&(null!=(u=e.data.name)?u:a("unnamed")),s]})]})};function Kr({file:e,openFolder:t,className:i,isDisabled:n,restrictionError:r,toggleCheckbox:o,showTitles:s,i18n:a}){var l,u,d;return Yn("li",{className:i,title:"checked"!==e.status&&r?r:void 0,children:[Yn("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:o,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?a("allFilesFromFolderNamed",{name:null!=(l=e.data.name)?l:a("unnamed")}):null,disabled:n,"data-uppy-super-focusable":!0}),e.data.isFolder?Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":a("openFolderNamed",{name:null!=(u=e.data.name)?u:a("unnamed")}),children:[Yn("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:Yn(Wr,{itemIconString:e.data.icon})}),s&&e.data.name?Yn("span",{className:"uppy-truncate-text",children:e.data.name}):a("unnamed")]}):Yn("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[Yn("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:Yn(Wr,{itemIconString:e.data.icon})}),s&&Yn("span",{className:"uppy-truncate-text",children:null!=(d=e.data.name)?d:a("unnamed")})]})]})}function Xr(e){const{viewType:t,toggleCheckbox:i,showTitles:n,i18n:r,openFolder:o,file:s,utmSource:a}=e,l="folder"===s.type?null:s.restrictionError,u=!!l&&"checked"!==s.status,d={file:s,openFolder:o,toggleCheckbox:i,utmSource:a,i18n:r,viewType:t,showTitles:n,className:gr("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":"video"===s.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===s.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===s.status}),isDisabled:u,restrictionError:l};switch(t){case"grid":return Yn(Gr,{...d});case"list":return Yn(Kr,{...d});case"unsplash":return Yn(Gr,{...d,children:Yn("a",{href:`${s.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,
2children:s.data.author.name})});default:throw new Error(`There is no such type ${t}`)}}const Yr=function(e){const{displayedPartialTree:t,viewType:i,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:s,isLoading:a,openFolder:l,noResultsLabel:u,virtualList:d,utmSource:p}=e,[c,h]=Or(!1);if(Ar(()=>{const e=e=>{"Shift"===e.key&&h(!1)},t=e=>{"Shift"===e.key&&h(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),a)return Yn("div",{className:"uppy-Provider-loading",children:"string"==typeof a?a:s("loading")});if(0===t.length)return Yn("div",{className:"uppy-Provider-empty",children:u});const f=e=>Yn(Xr,{viewType:i,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),n(e,c)},showTitles:o,i18n:s,openFolder:l,file:e,utmSource:p},e.id);return Yn("div",d?{className:"uppy-ProviderBrowser-body",children:Yn($r,{className:"uppy-ProviderBrowser-list",data:t,renderRow:f,rowHeight:35.5})}:{className:"uppy-ProviderBrowser-body",children:Yn("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,tabIndex:-1,children:t.map(f)})})},Qr=function({value:e,onChange:t,onSubmit:i,inputLabel:n,i18n:r}){const{formId:o}=function(e){const t=Ir(t=>{t.preventDefault(),e()},[e]),[i]=Or(()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=Qt(),e});return Ar(()=>(document.body.appendChild(i),i.addEventListener("submit",t),()=>{i.removeEventListener("submit",t),document.body.removeChild(i)}),[i,t]),{formId:i.id}}(i);return Yn("section",{className:"uppy-ProviderBrowser-searchFilter",children:[Yn("input",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterInput",type:"search","aria-label":n,placeholder:n,value:e,onInput:e=>t(e.target.value),form:o,"data-uppy-super-focusable":!0}),Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:Yn("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})}),e&&Yn("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":r("resetFilter"),onClick:()=>t(""),children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:Yn("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"})})})]})},Jr=e=>{const t=e.filter(t=>{if("file"===t.type&&"checked"===t.status)return!0;if("folder"===t.type&&"checked"===t.status){const i=e.some(e=>"root"!==e.type&&e.parentId===t.id);return!i}return!1});return t.length};function Zr({cancelSelection:e,donePicking:t,i18n:i,partialTree:n,validateAggregateRestrictions:r}){const o=Ur(()=>r(n),[n,r]),s=Ur(()=>Jr(n),[n]);return 0===s?null:Yn("div",{className:"uppy-ProviderBrowser-footer",children:[Yn("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[Yn("button",{className:gr("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button",children:i("selectX",{smart_count:s})}),Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:i("cancel")})]}),o&&Yn("div",{className:"uppy-ProviderBrowser-footer-error",children:o})]})}const eo=e=>t=>{t.isAuthError||("AbortError"!==t.name?(e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)):e.log("Aborting request","warning"))},to=(e,t,i)=>{const n=null===t?"null":t;if(i[n])return i[n];const r=e.find(e=>e.id===t);if("root"===r.type)return[];const o=[].concat(fe(me,to(e,r.parentId,i)),[r]);return i[n]=o,o};var io=i.cjs(function(e,t){var i=Object.prototype.hasOwnProperty,n="~";function r(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,i,r,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,r||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function l(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),l.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)i.call(e,t)&&r.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},l.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},l.prototype.emit=function(e,t,i,r,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var l,u,d=this._events[a],p=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),p){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,i),!0;case 4:return d.fn.call(d.context,t,i,r),!0;case 5:return d.fn.call(d.context,t,i,r,o),!0;case 6:return d.fn.call(d.context,t,i,r,o,s),!0}for(u=1,l=new Array(p-1);u<p;u++)l[u-1]=arguments[u];d.fn.apply(d.context,l)}else{var c,h=d.length;for(u=0;
2u<h;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),p){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,i);break;case 4:d[u].fn.call(d[u].context,t,i,r);break;default:if(!l)for(c=1,l=new Array(p-1);c<p;c++)l[c-1]=arguments[c];d[u].fn.apply(d[u].context,l)}}return!0},l.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},l.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},l.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,u=[],d=s.length;l<d;l++)(s[l].fn!==t||r&&!s[l].once||i&&s[l].context!==i)&&u.push(s[l]);u.length?this._events[o]=1===u.length?u[0]:u:a(this,o)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l});let no=function(e){function t(t){var i;return(i=e.call(this,t)||this).name="TimeoutError",i}return s(t,e),r(t)}(d(Error)),ro=function(e){function t(t){var i;return(i=e.call(this)||this).name="AbortError",i.message=t,i}return s(t,e),r(t)}(d(Error));const oo=e=>void 0===globalThis.DOMException?new ro(e):new DOMException(e),so=e=>{const t=void 0===e.reason?oo("This operation was aborted."):e.reason;return t instanceof Error?t:oo(t)};var ao=u("queue");let lo=function(){function e(){Object.defineProperty(this,ao,{writable:!0,value:[]})}var t=e.prototype;return t.enqueue=function(e,t){const i={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||l(this,ao)[ao][this.size-1].priority>=t.priority)return void l(this,ao)[ao].push(i);const n=function(e,t,i){let n=0,r=e.length;for(;r>0;){const o=Math.trunc(r/2);let s=n+o;i(e[s],t)<=0?(n=++s,r-=o+1):r=o}return n}(l(this,ao)[ao],i,(e,t)=>t.priority-e.priority);l(this,ao)[ao].splice(n,0,i)},t.setPriority=function(e,t){const i=l(this,ao)[ao].findIndex(t=>t.id===e);if(-1===i)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[n]=l(this,ao)[ao].splice(i,1);this.enqueue(n.run,{priority:t,id:e})},t.dequeue=function(){const e=l(this,ao)[ao].shift();return e?.run},t.filter=function(e){return l(this,ao)[ao].filter(t=>t.priority===e.priority).map(e=>e.run)},r(e,[{key:"size",get:function(){return l(this,ao)[ao].length}}])}();var uo=u("carryoverConcurrencyCount"),po=u("isIntervalIgnored"),co=u("intervalCount"),ho=u("intervalCap"),fo=u("interval"),mo=u("intervalEnd"),go=u("intervalId"),yo=u("timeoutId"),vo=u("queue"),bo=u("queueClass"),wo=u("pending"),Po=u("concurrency"),_o=u("isPaused"),Fo=u("throwOnTimeout"),So=u("idAssigner"),Co=u("doesIntervalAllowAnother"),ko=u("doesConcurrentAllowAnother"),To=u("next"),Oo=u("onResumeInterval"),Ao=u("isIntervalPaused"),Eo=u("tryToStartAnother"),Uo=u("initializeIntervalIfNeeded"),Io=u("onInterval"),xo=u("processQueue"),No=u("throwOnAbort"),Do=u("onEvent");let Ro=function(e){function t(t){var i,n,r;if(i=e.call(this)||this,Object.defineProperty(i,Do,{value:Go}),Object.defineProperty(i,No,{value:Wo}),Object.defineProperty(i,xo,{value:Vo}),Object.defineProperty(i,Io,{value:Ho}),Object.defineProperty(i,Uo,{value:qo}),Object.defineProperty(i,Eo,{value:$o}),Object.defineProperty(i,Ao,{get:zo,set:void 0}),Object.defineProperty(i,Oo,{value:jo}),Object.defineProperty(i,To,{value:Lo}),Object.defineProperty(i,ko,{get:Bo,set:void 0}),Object.defineProperty(i,Co,{get:Mo,set:void 0}),Object.defineProperty(i,uo,{writable:!0,value:void 0}),Object.defineProperty(i,po,{writable:!0,value:void 0}),Object.defineProperty(i,co,{writable:!0,value:0}),Object.defineProperty(i,ho,{writable:!0,value:void 0}),Object.defineProperty(i,fo,{writable:!0,value:void 0}),Object.defineProperty(i,mo,{writable:!0,value:0}),Object.defineProperty(i,go,{writable:!0,value:void 0}),Object.defineProperty(i,yo,{writable:!0,value:void 0}),Object.defineProperty(i,vo,{writable:!0,value:void 0}),Object.defineProperty(i,bo,{writable:!0,value:void 0}),Object.defineProperty(i,wo,{writable:!0,value:0}),Object.defineProperty(i,Po,{writable:!0,value:void 0}),Object.defineProperty(i,_o,{writable:!0,value:void 0}),Object.defineProperty(i,Fo,{writable:!0,value:void 0}),Object.defineProperty(i,So,{writable:!0,value:1n}),i.timeout=void 0,!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:lo,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!=(n=t.intervalCap?.toString())?n:""}\` (${typeof t.intervalCap})`);
2if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!=(r=t.interval?.toString())?r:""}\` (${typeof t.interval})`);return l(i,uo)[uo]=t.carryoverConcurrencyCount,l(i,po)[po]=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,l(i,ho)[ho]=t.intervalCap,l(i,fo)[fo]=t.interval,l(i,vo)[vo]=new t.queueClass,l(i,bo)[bo]=t.queueClass,i.concurrency=t.concurrency,i.timeout=t.timeout,l(i,Fo)[Fo]=!0===t.throwOnTimeout,l(i,_o)[_o]=!1===t.autoStart,i}s(t,e);var i=t.prototype;return i.setPriority=function(e,t){l(this,vo)[vo].setPriority(e,t)},i.add=async function(e,t={}){return t.id??=(l(this,So)[So]++).toString(),t={timeout:this.timeout,throwOnTimeout:l(this,Fo)[Fo],...t},new Promise((i,n)=>{l(this,vo)[vo].enqueue(async()=>{l(this,wo)[wo]++;try{t.signal?.throwIfAborted(),l(this,co)[co]++;let n=e({signal:t.signal});t.timeout&&(n=function(e,t){const{milliseconds:i,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=t;let s,a;const l=new Promise((l,u)=>{if("number"!=typeof i||1!==Math.sign(i))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${i}\``);if(t.signal){const{signal:e}=t;e.aborted&&u(so(e)),a=()=>{u(so(e))},e.addEventListener("abort",a,{once:!0})}if(i===Number.POSITIVE_INFINITY)return void e.then(l,u);const d=new no;s=o.setTimeout.call(void 0,()=>{if(n)try{l(n())}catch(e){u(e)}else"function"==typeof e.cancel&&e.cancel(),!1===r?l():r instanceof Error?u(r):(d.message=null!=r?r:`Promise timed out after ${i} milliseconds`,u(d))},i),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),a&&t.signal&&t.signal.removeEventListener("abort",a)});return l.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},l}(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,l(this,No)[No](t.signal)]));const r=await n;i(r),this.emit("completed",r)}catch(e){if(e instanceof no&&!t.throwOnTimeout)return void i();n(e),this.emit("error",e)}finally{l(this,To)[To]()}},t),this.emit("add"),l(this,Eo)[Eo]()})},i.addAll=async function(e,t){return Promise.all(e.map(async e=>this.add(e,t)))},i.start=function(){return l(this,_o)[_o]?(l(this,_o)[_o]=!1,l(this,xo)[xo](),this):this},i.pause=function(){l(this,_o)[_o]=!0},i.clear=function(){l(this,vo)[vo]=new(l(this,bo)[bo])},i.onEmpty=async function(){0!==l(this,vo)[vo].size&&await l(this,Do)[Do]("empty")},i.onSizeLessThan=async function(e){l(this,vo)[vo].size<e||await l(this,Do)[Do]("next",()=>l(this,vo)[vo].size<e)},i.onIdle=async function(){0===l(this,wo)[wo]&&0===l(this,vo)[vo].size||await l(this,Do)[Do]("idle")},i.sizeBy=function(e){return l(this,vo)[vo].filter(e).length},r(t,[{key:"concurrency",get:function(){return l(this,Po)[Po]},set:function(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);l(this,Po)[Po]=e,l(this,xo)[xo]()}},{key:"size",get:function(){return l(this,vo)[vo].size}},{key:"pending",get:function(){return l(this,wo)[wo]}},{key:"isPaused",get:function(){return l(this,_o)[_o]}}])}(io);function Mo(){return l(this,po)[po]||l(this,co)[co]<l(this,ho)[ho]}function Bo(){return l(this,wo)[wo]<l(this,Po)[Po]}function Lo(){l(this,wo)[wo]--,l(this,Eo)[Eo](),this.emit("next")}function jo(){l(this,Io)[Io](),l(this,Uo)[Uo](),l(this,yo)[yo]=void 0}function zo(){const e=Date.now();if(void 0===l(this,go)[go]){const t=l(this,mo)[mo]-e;if(!(t<0))return void 0===l(this,yo)[yo]&&(l(this,yo)[yo]=setTimeout(()=>{l(this,Oo)[Oo]()},t)),!0;l(this,co)[co]=l(this,uo)[uo]?l(this,wo)[wo]:0}return!1}function $o(){if(0===l(this,vo)[vo].size)return l(this,go)[go]&&clearInterval(l(this,go)[go]),l(this,go)[go]=void 0,this.emit("empty"),0===l(this,wo)[wo]&&this.emit("idle"),!1;if(!l(this,_o)[_o]){const e=!l(this,Ao)[Ao];if(l(this,Co)[Co]&&l(this,ko)[ko]){const t=l(this,vo)[vo].dequeue();
2return!!t&&(this.emit("active"),t(),e&&l(this,Uo)[Uo](),!0)}}return!1}function qo(){l(this,po)[po]||void 0!==l(this,go)[go]||(l(this,go)[go]=setInterval(()=>{l(this,Io)[Io]()},l(this,fo)[fo]),l(this,mo)[mo]=Date.now()+l(this,fo)[fo])}function Ho(){0===l(this,co)[co]&&0===l(this,wo)[wo]&&l(this,go)[go]&&(clearInterval(l(this,go)[go]),l(this,go)[go]=void 0),l(this,co)[co]=l(this,uo)[uo]?l(this,wo)[wo]:0,l(this,xo)[xo]()}function Vo(){for(;l(this,Eo)[Eo](););}async function Wo(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}async function Go(e,t){return new Promise(i=>{const n=()=>{t&&!t()||(this.off(e,n),i())};this.on(e,n)})}const Ko=e=>e.map(e=>({...e})),Xo=async(e,t,i,n,r)=>{let o=[],s=i.cached?i.nextPagePath:i.id;for(;s;){const e=await n(s);o=o.concat(e.items),s=e.nextPagePath}const a=o.filter(e=>!0===e.isFolder),l=o.filter(e=>!1===e.isFolder),u=a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:i.id,data:e})),d=l.map(e=>{const t=r(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:i.id,data:e}});i.cached=!0,i.nextPagePath=null,t.push.apply(t,fe(me,d).concat(fe(me,u))),u.forEach(async i=>{e.add(()=>Xo(e,t,i,n,r))})},Yo=(e,t,i)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=!i||"file"===t.type&&t.restrictionError?"unchecked":"checked",Yo(e,t.id,i)})},Qo=(e,t)=>{const i=e.find(e=>e.id===t);if("root"===i.type)return;const n=e.filter(e=>"root"!==e.type&&e.parentId===i.id&&!("file"===e.type&&e.restrictionError)),r=n.every(e=>"checked"===e.status),o=n.every(e=>"unchecked"===e.status);r&&i.cached?i.status="checked":i.status=o?"unchecked":"partial",Qo(e,i.parentId)};function Jo(){return Yn("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:Yn("g",{fill:"none","fill-rule":"evenodd",children:[Yn("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),Yn("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),Yn("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),Yn("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),Yn("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),Yn("path",{d:"M4 4h18v18H4z"})]})})}function Zo({pluginName:e,i18n:t,onAuth:i}){const n="Google Drive"===e,r=Ir(e=>{e.preventDefault(),i()},[i]);return Yn("form",{onSubmit:r,children:Yn("button",n?{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0,children:[Yn(Jo,{}),t("signInWithGoogle")]}:{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}const es=({pluginName:e,i18n:t,onAuth:i})=>Yn(Zo,{pluginName:e,i18n:t,onAuth:i});function ts({loading:e,pluginName:t,pluginIcon:i,i18n:n,handleAuth:r,renderForm:o=es}){return Yn("div",{className:"uppy-Provider-auth",children:[Yn("div",{className:"uppy-Provider-authIcon",children:i()}),Yn("div",{className:"uppy-Provider-authTitle",children:n("authenticateWithTitle",{pluginName:t})}),o({pluginName:t,i18n:n,loading:e,onAuth:r})]})}const is=({i18n:e,item:t,toggleCheckbox:i,openFolder:n})=>{var r,o,s;const a="restrictionError"in t&&null!=t.restrictionError&&"checked"!==t.status;return Yn("li",{className:gr("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":a},{"uppy-ProviderBrowserItem--noPreview":"video"===t.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===t.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===t.status}),title:null!=(r="restrictionError"in t?t.restrictionError:void 0)?r:void 0,children:[Yn("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:()=>i(t,!1),checked:"checked"===t.status,"aria-label":null!=(o=t.data.name)?o:e("unnamed"),disabled:a,"data-uppy-super-focusable":!0}),Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",disabled:a,"aria-label":t.data.name,onClick:()=>{t.data.isFolder&&n(t.id)},children:[Yn("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:Yn(Wr,{itemIconString:t.data.icon})}),null!=(s=t.data.name)?s:e("unnamed")]})]})},ns=({searchResults:e,toggleCheckbox:t,openFolder:i,i18n:n})=>0===e.length?Yn("div",{className:"uppy-Provider-empty",children:n("noFilesFound")}):Yn("div",{className:"uppy-ProviderBrowser-body",children:Yn("ul",{className:"uppy-ProviderBrowser-list",children:e.map(e=>Yn(is,{i18n:n,item:e,toggleCheckbox:t,openFolder:i},e.id))})});function rs(e){const{openFolder:t,title:i,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=e;return Yn("div",{className:"uppy-Provider-breadcrumbs",children:[Yn("div",{className:"uppy-Provider-breadcrumbsIcon",children:n}),r.map((e,n)=>{var s;return Yn(Sn,{children:[Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?i:null!=(s=e.data.name)?s:o("unnamed")},e.id),r.length===n+1?"":" / "]})})]})}function os({i18n:e,logout:t,username:i}){return Yn(Sn,{children:[i&&Yn("span",{className:"uppy-ProviderBrowser-user",children:i},"username"),Yn("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userL
2ogout",children:e("logOut")},"logout")]})}function ss(e){return Yn("div",{className:"uppy-ProviderBrowser-header",children:Yn("div",{className:gr("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&Yn(rs,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),Yn(os,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function as(){return Yn("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:Yn("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"})})}const ls=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});var us=u("searchDebounced"),ds=u("abortController"),ps=u("withAbort"),cs=u("search"),hs=u("renderSearchResults");let fs=function(){function e(t,i){Object.defineProperty(this,hs,{value:ys}),Object.defineProperty(this,cs,{value:gs}),Object.defineProperty(this,ps,{value:ms}),this.plugin=void 0,this.provider=void 0,this.opts=void 0,this.isHandlingScroll=!1,this.previousCheckbox=null,Object.defineProperty(this,us,{writable:!0,value:void 0}),Object.defineProperty(this,ds,{writable:!0,value:void 0}),this.onSearchInput=e=>{this.plugin.setPluginState({searchString:e}),this.opts.supportsSearch&&l(this,us)[us]()},this.validateSingleFile=e=>{const t=function(e){return{...e,type:e.mimeType,extension:e.name?Ht(e.name).extension:null}}(e);return this.plugin.uppy.validateSingleFile(t)},this.getDisplayedPartialTree=()=>{const{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),n=e.filter(e=>"root"!==e.type&&e.parentId===t);return this.opts.supportsSearch||""===i.trim()?n:n.filter(e=>{var t;return-1!==(null!=(t=e.data.name)?t:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(i.trim().toLowerCase())})},this.getBreadcrumbs=()=>{const{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return((e,t)=>{let i=e.find(e=>e.id===t),n=[];for(;n=[i].concat(fe(me,n)),"root"!==i.type;){const t=i.parentId;i=e.find(e=>e.id===t)}return n})(e,t)},this.getSelectedAmount=()=>{const{partialTree:e}=this.plugin.getPluginState();return Jr(e)},this.validateAggregateRestrictions=e=>{const t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)},this.plugin=t,this.provider=i.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...i},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.openSearchResultFolder=this.openSearchResultFolder.bind(this),this.clearSearchState=this.clearSearchState.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider);const n=e[Symbol.for("uppy test: searchDebounceMs")],r=null!=n?n:500,o=0===n?{leading:!0,trailing:!0}:void 0;l(this,us)[us]=yr(l(this,cs)[cs],r,o)}var t=e.prototype;return t.resetPluginState=function(){this.plugin.setPluginState(ls(this.plugin.rootFolderId))},t.tearDown=function(){},t.setLoading=function(e){this.plugin.setPluginState({loading:e})},t.cancelSelection=function(){const{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})},t.clearSearchState=function(){this.plugin.setPluginState({searchResults:void 0})},t.openSearchResultFolder=async function(e){this.plugin.setPluginState({searchString:""}),await this.openFolder(e)},t.openFolder=async function(e){this.clearSearchState(),this.previousCheckbox=null;const{partialTree:t}=this.plugin.getPluginState(),i=t.find(t=>
2t.id===e);i.cached?this.plugin.setPluginState({currentFolderId:e,searchString:""}):(this.setLoading(!0),await l(this,ps)[ps](async n=>{let r=e,o=[];do{const{username:e,nextPagePath:t,items:i}=await this.provider.list(r,{signal:n});this.plugin.setPluginState({username:e}),r=t,o=o.concat(i),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&r);const s=((e,t,i,n,r)=>{const o=t.filter(t=>!e.find(e=>e.id===t.requestPath)),s=o.filter(e=>!0===e.isFolder),a=o.filter(e=>!1===e.isFolder),l="folder"===i.type&&"checked"===i.status,u=s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:l?"checked":"unchecked",parentId:i.id,data:e})),d=a.map(e=>{const t=r(e);return{type:"file",id:e.requestPath,restrictionError:t,status:l&&!t?"checked":"unchecked",parentId:i.id,data:e}}),p={...i,cached:!0,nextPagePath:n},c=e.map(e=>e.id===p.id?p:e);return[].concat(fe(me,c),fe(me,u),fe(me,d))})(t,o,i,r,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:e,searchString:""})}).catch(eo(this.plugin.uppy)),this.setLoading(!1))},t.logout=async function(){await l(this,ps)[ps](async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...ls(this.plugin.rootFolderId),authenticated:!1})}}).catch(eo(this.plugin.uppy))},t.handleAuth=async function(e){await l(this,ps)[ps](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(eo(this.plugin.uppy)),this.setLoading(!1)},t.handleScroll=async function(e){const{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),n=t.find(e=>e.id===i);(e=>{const{scrollHeight:t,scrollTop:i,offsetHeight:n}=e.target;return t-(i+n)<50})(e)&&!this.isHandlingScroll&&n.nextPagePath&&(this.isHandlingScroll=!0,await l(this,ps)[ps](async e=>{const{nextPagePath:r,items:o}=await this.provider.list(n.nextPagePath,{signal:e}),s=((e,t,i,n,r)=>{const o=e.find(e=>e.id===t),s=i.filter(e=>!0===e.isFolder),a=i.filter(e=>!1===e.isFolder),l={...o,nextPagePath:n},u=e.map(e=>e.id===l.id?l:e),d="folder"===l.type&&"checked"===l.status,p=s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:e})),c=a.map(e=>{const t=r(e);return{type:"file",id:e.requestPath,restrictionError:t,status:d&&!t?"checked":"unchecked",parentId:l.id,data:e}});return[].concat(fe(me,u),fe(me,p),fe(me,c))})(t,i,o,r,this.validateSingleFile);this.plugin.setPluginState({partialTree:s})}).catch(eo(this.plugin.uppy)),this.isHandlingScroll=!1)},t.donePicking=async function(){const{partialTree:e}=this.plugin.getPluginState();this.isLoading||(this.setLoading(!0),await l(this,ps)[ps](async t=>{const i=await(async(e,t,i,n)=>{const r=new Ro({concurrency:6}),o=Ko(e);return o.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{r.add(()=>Xo(r,o,e,t,i))}),r.on("completed",()=>{const e=o.filter(e=>"file"===e.type&&"checked"===e.status).length;n(e)}),await r.onIdle(),o})(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(i))return void this.plugin.setPluginState({partialTree:i});const n=(e=>{const t=Object.create(null),i=e.filter(e=>"file"===e.type&&"checked"===e.status).map(i=>{const n=to(e,i.id,t),r=n.findIndex(e=>"folder"===e.type&&"checked"===e.status),o=n.slice(r),s=`/${n.map(e=>e.data.name).join("/")}`,a=1===o.length?void 0:o.map(e=>e.data.name).join("/");return{...i.data,absDirPath:s,relDirPath:a}});return i})(i);((e,t,i)=>{const n=e.map(e=>((e,t,i)=>{const n=e.name||e.id;return{id:e.id,source:t.id,name:n,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath}
2,body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${i.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:i.name,provider:i.provider,requestClientId:i.provider}}})(e,t,i)),r=[],o=[];n.forEach(e=>{t.uppy.checkIfFileAlreadyExists(Kt(e,t.uppy.getID()))?o.push(e):r.push(e)}),r.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&t.uppy.info(`Not adding ${o.length} files because they already exist`),t.uppy.addFiles(r)})(n,this.plugin,this.provider),this.resetPluginState()}).catch(eo(this.plugin.uppy)),this.setLoading(!1))},t.toggleCheckbox=function(e,t){const{partialTree:i}=this.plugin.getPluginState(),n=((e,t,i,n)=>{const r=t.findIndex(e=>e.id===n);if(-1!==r&&i){const i=t.findIndex(t=>t.id===e);return t.slice(Math.min(r,i),Math.max(r,i)+1).map(e=>e.id)}return[e]})(e.id,this.getDisplayedPartialTree(),t,this.previousCheckbox),r=((e,t)=>{const i=Ko(e),n=i.filter(e=>"root"!==e.type&&t.includes(e.id));return n.forEach(e=>{const t="checked"===e.status?"unchecked":"checked";"file"===e.type?e.status=e.restrictionError?"unchecked":t:e.status=t,Yo(i,e.id,"checked"===e.status)}),Qo(i,n[0].parentId),i})(i,n);this.plugin.setPluginState({partialTree:r}),this.previousCheckbox=e.id},t.render=function(e,t={}){const{didFirstRender:i}=this.plugin.getPluginState(),{i18n:n}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));const r={...this.opts,...t},{authenticated:o,loading:s}=this.plugin.getPluginState(),a=this.plugin.icon||as;if(!1===o)return Yn(ts,{pluginName:this.plugin.title,pluginIcon:a,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:r.renderAuthForm,loading:s});const{partialTree:u,username:d,searchString:p,searchResults:c}=this.plugin.getPluginState(),h=this.getBreadcrumbs();return Yn("div",{className:gr("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${r.viewType}`),children:[Yn(ss,{showBreadcrumbs:r.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:a,title:this.plugin.title,logout:this.logout,username:d,i18n:n}),r.showFilter&&Yn(Qr,{value:p,onChange:e=>this.onSearchInput(e),onSubmit:()=>{},inputLabel:n("filter"),i18n:n}),c?l(this,hs)[hs]():Yn(Yr,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:r.virtualList,noResultsLabel:n("noFilesFound"),handleScroll:this.handleScroll,viewType:r.viewType,showTitles:r.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),Yn(Zr,{partialTree:u,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:n,validateAggregateRestrictions:this.validateAggregateRestrictions})]})},r(e,[{key:"isLoading",get:function(){return this.plugin.getPluginState().loading}}])}();async function ms(e){l(this,ds)[ds]?.abort();const t=new AbortController;l(this,ds)[ds]=t;const i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),l(this,ds)[ds]=void 0}}async function gs(){const{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),n=e.find(e=>e.id===t);if(""===i.trim())return l(this,ds)[ds]?.abort(),void this.clearSearchState();this.setLoading(!0),await l(this,ps)[ps](async e=>{const r="root"===n.type?void 0:t,{items:o}=await this.provider.search(i,{signal:e,path:r}),{partialTree:s}=this.plugin.getPluginState(),a=fe(me,s);for(const e of o){const t=decodeURIComponent(e.requestPath).split("/").filter(e=>e.length>0);let i,n=this.plugin.rootFolderId;t.forEach((r,o,s)=>{const l=t.slice(0,o+1),u=encodeURIComponent(`/${l.join("/")}`),d=a.find(e=>e.id===u&&"root"!==e.type);if(d)return n=u,void(i="checked"===d.status);const p=o===s.length-1;let c;const h=i?"checked":"unchecked";if(p)if(e.isFolder)c={type:"folder",id:u,cached:!1,nextPagePath:null,status:h,parentId:n,data:e};else{const t=this.validateSingleFile(e);c={type:"file",id:u,restrictionError:t,status:t?"unchecked":h,parentId:n,data:e}}else c={type:"folder",id:u,cached:!1,nextPagePath:null,status:h,parentId:n,data:{name:decodeURIComponent(r),icon:"folder",isFolder:!0}};a.push(c),n=u,i="checked"===h})}this.plugin.setPluginState({partialTree:a,searchResults:o.map(e=>e.requestPath)})}).catch(eo(this.plugin.uppy)),this.setLoading(!1)}function ys(){const{i18n:e}=this.plugin.uppy,{searchResults:t,partialTree:i}=this.plugin.getPluginState(),n=new Map;
2i.forEach(e=>{"root"!==e.type&&n.set(e.id,e)});const r=t.map(e=>{const t=n.get(e);if(null==t)throw new Error("Partial tree not complete");return t});return Yn(ns,{searchResults:r,openFolder:this.openSearchResultFolder,toggleCheckbox:this.toggleCheckbox,i18n:e})}fs.VERSION="5.2.2",fs[Symbol.for("uppy test: searchDebounceMs")]=void 0;const vs={strings:{pluginNameDropbox:"Dropbox"}};let bs=function(e){function t(t,i){var r;return(r=e.call(this,t,i)||this).icon=void 0,r.provider=void 0,r.view=void 0,r.storage=void 0,r.files=void 0,r.rootFolderId=null,r.id=r.opts.id||"Dropbox",r.type="acquirer",r.storage=r.opts.storage||n,r.files=[],r.icon=()=>Yn("svg",{className:"uppy-DashboardTab-iconDropbox","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("path",{d:"M10.5 7.5L5 10.955l5.5 3.454 5.5-3.454 5.5 3.454 5.5-3.454L21.5 7.5 16 10.955zM10.5 21.319L5 17.864l5.5-3.455 5.5 3.455zM16 17.864l5.5-3.455 5.5 3.455-5.5 3.455zM16 25.925l-5.5-3.455 5.5-3.454 5.5 3.454z",fill:"currentcolor",fillRule:"nonzero"})}),r.opts.companionAllowedHosts=tr(r.opts.companionAllowedHosts,r.opts.companionUrl),r.provider=new or(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"dropbox",pluginId:r.id,supportsRefreshToken:!0}),r.defaultLocale=vs,r.i18nInit(),r.title=r.i18n("pluginNameDropbox"),r.render=r.render.bind(r),r}s(t,e);var i=t.prototype;return i.install=function(){this.view=new fs(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0,supportsSearch:!0});const{target:e}=this.opts;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.render=function(e){return this.view.render(e)},r(t)}(pr);bs.VERSION="5.1.0";let ws=function(e){function t(){return e.apply(this,arguments)||this}return s(t,e),t.prototype.toggleCheckbox=function(t,i){t.data.custom?.isSharedDrive||e.prototype.toggleCheckbox.call(this,t,i)},r(t)}(fs);const Ps={strings:{pluginNameGoogleDrive:"Google Drive"}};let _s=function(e){function t(t,i){var r;return(r=e.call(this,t,i)||this).icon=void 0,r.provider=void 0,r.view=void 0,r.storage=void 0,r.files=void 0,r.rootFolderId="root",r.type="acquirer",r.storage=r.opts.storage||n,r.files=[],r.id=r.opts.id||"GoogleDrive",r.icon=()=>Yn("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("g",{fillRule:"nonzero",fill:"none",children:[Yn("path",{d:"M6.663 22.284l.97 1.62c.202.34.492.609.832.804l3.465-5.798H5c0 .378.1.755.302 1.096l1.361 2.278z",fill:"#0066DA"}),Yn("path",{d:"M16 12.09l-3.465-5.798c-.34.195-.63.463-.832.804l-6.4 10.718A2.15 2.15 0 005 18.91h6.93L16 12.09z",fill:"#00AC47"}),Yn("path",{d:"M23.535 24.708c.34-.195.63-.463.832-.804l.403-.67 1.928-3.228c.201-.34.302-.718.302-1.096h-6.93l1.474 2.802 1.991 2.996z",fill:"#EA4335"}),Yn("path",{d:"M16 12.09l3.465-5.798A2.274 2.274 0 0018.331 6h-4.662c-.403 0-.794.11-1.134.292L16 12.09z",fill:"#00832D"}),Yn("path",{d:"M20.07 18.91h-8.14l-3.465 5.798c.34.195.73.292 1.134.292h12.802c.403 0 .794-.11 1.134-.292L20.07 18.91z",fill:"#2684FC"}),Yn("path",{d:"M23.497 12.455l-3.2-5.359a2.252 2.252 0 00-.832-.804L16 12.09l4.07 6.82h6.917c0-.377-.1-.755-.302-1.096l-3.188-5.359z",fill:"#FFBA00"})]})}),r.opts.companionAllowedHosts=tr(r.opts.companionAllowedHosts,r.opts.companionUrl),r.provider=new or(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"drive",pluginId:r.id,supportsRefreshToken:!0}),r.defaultLocale=Ps,r.i18nInit(),r.title=r.i18n("pluginNameGoogleDrive"),r.render=r.render.bind(r),r}s(t,e);var i=t.prototype;return i.install=function(){this.view=new ws(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});const{target:e}=this.opts;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.render=function(e){return this.view.render(e)},r(t)}(pr);_s.VERSION="5.1.0";const Fs={strings:{pluginNameOneDrive:"OneDrive"}};let Ss=function(e){function t(t,i){var r;return(r=e.call(this,t,i)||this).icon=void 0,r.provider=void 0,r.view=void 0,r.storage=void 0,r.files=void 0,r.rootFolderId=null,r.type="acquirer",r.files=[],r.storage=r.opts.storage||n,r.id=r.opts.id||"OneDrive",r.icon=()=>Yn("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("g",{fill:"none",fillRule:"nonzero",children:[Yn("path",{d:"M13.39 12.888l4.618 2.747 2.752-1.15a4.478 4.478 0 012.073-.352 6.858 6.858 0 00-5.527-5.04 6.895 6.895 0 00-6.876 2.982l.07-.002a5.5 5.5 0 012.89.815z",fill:"#0364B8"}),Yn("path",{d:"M13.39 12.887v.001a5.5 5.5 0 00-2.89-.815l-.07.002a5.502 5.502 0 00-4.822 2.964 5.43 5.43 0 00.38 5.62l4.073-1.702 1.81-.757 4.032-1.685 2.105-.88-4.619-2.748z",fill:"#0078D4"}),Yn("path",{d:"M22.833 14.133a4.479 4.479 0 00-2.073.352l-2.752 1.15.798.475 2.616 1.556 1.141.68 3.902 2.321a4.413 4.413 0 00-.022-4.25 4.471 4.471 0 00-3.61-2.284z",fill:"#1490DF"}),Yn("path",{d:"M22.563 18.346l-1.141-.68-2.616-1.556-.798-.475-2.105.88L11.87 18.2l-1.81.757-4.073 1.702A5.503 5.503 0 0010.5 23h12.031a4.472 4.472 0 003.934-2.333l-3.902-2.321z",fill:"#28A8EA"})]})}
2),r.opts.companionAllowedHosts=tr(r.opts.companionAllowedHosts,r.opts.companionUrl),r.provider=new or(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"onedrive",pluginId:r.id,supportsRefreshToken:!0}),r.defaultLocale=Fs,r.i18nInit(),r.title=r.i18n("pluginNameOneDrive"),r.render=r.render.bind(r),r}s(t,e);var i=t.prototype;return i.install=function(){this.view=new fs(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});const{target:e}=this.opts;e&&this.mount(e,this)},i.uninstall=function(){this.view.tearDown(),this.unmount()},i.render=function(e){return this.view.render(e)},r(t)}(pr);Ss.VERSION="5.1.0";const Cs=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ks(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function Ts(e){return e.startsWith("blob:")}function Os(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var As="undefined"!=typeof self?self:globalThis;const Es="undefined"!=typeof navigator,Us=Es&&"undefined"==typeof HTMLImageElement,Is=!("undefined"==typeof globalThis||"undefined"==typeof process||!process.versions||!process.versions.node),xs=As.Buffer,Ns=!!xs,Ds=e=>void 0!==e;function Rs(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(Ds).length)}function Ms(e){let t=new Error(e);throw delete t.stack,t}function Bs(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const Ls=e=>String.fromCharCode.apply(null,e),js="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class zs{static from(e,t){return e instanceof this&&e.le===t?e:new zs(e,void 0,void 0,t)}constructor(e,t=0,i,n){if("boolean"==typeof n&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let n=new DataView(e,t,i);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof zs){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Ms("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,i);this._swapDataView(n)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else Ms("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,i=zs){return e instanceof DataView||e instanceof zs?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Ms("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new zs(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 i=this.getUint8Array(e,t),js?js.decode(i):Ns?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(Ls(i)));var i}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return Ls(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)i.push(this.getUint16(e+n));return Ls(i)}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)}
2getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function $s(e,t){Ms(`${e} '${t}' was not loaded, try using full build of exifr.`)}class qs extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||$s(this.kind,e),t&&(e in t||function(e,t){Ms(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||$s(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Hs=new qs("file parser"),Vs=new qs("segment parser"),Ws=new qs("file reader");let Gs=As.fetch;function Ks(e,t){return(i=e).startsWith("data:")||i.length>1e4?Ys(e,t,"base64"):Is&&e.includes("://")?Xs(e,t,"url",Qs):Is?Ys(e,t,"fs"):Es?Xs(e,t,"url",Qs):void Ms("Invalid input argument");var i}async function Xs(e,t,i,n){return Ws.has(i)?Ys(e,t,i):n?async function(e,t){let i=await t(e);return new zs(i)}(e,n):void Ms(`Parser ${i} is not loaded`)}async function Ys(e,t,i){let n=new(Ws.get(i))(e,t);return await n.read(),n}const Qs=e=>Gs(e).then(e=>e.arrayBuffer()),Js=e=>new Promise((t,i)=>{let n=new FileReader;n.onloadend=()=>t(n.result||new ArrayBuffer),n.onerror=i,n.readAsArrayBuffer(e)});class Zs extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function ea(e,t,i){let n=new Zs;for(let[e,t]of i)n.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,n);else e.set(t,n);return n}function ta(e,t,i){let n,r=e.get(t);for(n of i)r.set(n[0],n[1])}const ia=new Map,na=new Map,ra=new Map,oa=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],sa=["jfif","xmp","icc","iptc","ihdr"],aa=["tiff",...sa],la=["ifd0","ifd1","exif","gps","interop"],ua=[...aa,...la],da=["makerNote","userComment"],pa=["translateKeys","translateValues","reviveValues","multiSegment"],ca=[...pa,"sanitize","mergeOutput","silentErrors"];class ha{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class fa extends ha{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,n){if(super(),Os(this,"enabled",!1),Os(this,"skip",new Set),Os(this,"pick",
vendor: 21,850 bytes, line 2
2new Set),Os(this,"deps",new Set),Os(this,"translateKeys",!1),Os(this,"translateValues",!1),Os(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=la.includes(e),this.canBeFiltered&&(this.dict=ia.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:Ms(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of pa)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,n,{tagKeys:r,tagValues:o}=this.dict;for(i of e)"string"==typeof i?(n=o.indexOf(i),-1===n&&(n=r.indexOf(Number(i))),-1!==n&&t.add(Number(r[n]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,wa(this.pick,this.deps)):this.enabled&&this.pick.size>0&&wa(this.pick,this.deps)}}var ma={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},ga=new Map;class ya extends ha{static useCached(e){let t=ga.get(e);return void 0!==t||(t=new this(e),ga.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):Ms(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=Es?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of oa)this[e]=ma[e];for(e of ca)this[e]=ma[e];for(e of da)this[e]=ma[e];for(e of ua)this[e]=new fa(e,ma[e],void 0,this)}setupFromTrue(){let e;for(e of oa)this[e]=ma[e];for(e of ca)this[e]=ma[e];for(e of da)this[e]=!0;for(e of ua)this[e]=new fa(e,!0,void 0,this)}setupFromArray(e){let t;for(t of oa)this[t]=ma[t];for(t of ca)this[t]=ma[t];for(t of da)this[t]=ma[t];for(t of ua)this[t]=new fa(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,la)}setupFromObject(e){let t;for(t of(la.ifd0=la.ifd0||la.image,la.ifd1=la.ifd1||la.thumbnail,Object.assign(this,e),oa))this[t]=ba(e[t],ma[t]);for(t of ca)this[t]=ba(e[t],ma[t]);for(t of da)this[t]=ba(e[t],ma[t]);for(t of aa)this[t]=new fa(t,ma[t],e[t],this);for(t of la)this[t]=new fa(t,ma[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,la,ua),!0===e.tiff?this.batchEnableWithBool(la,!0):!1===e.tiff?this.batchEnableWithUserValue(la,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,la):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,la)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,n=i){if(e&&e.length){for(let e of n)this[e].enabled=!1;let t=va(e,i);for(let[e,i]of t)wa(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=va(t,i);for(let[t,i]of e)wa(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:n,icc:r}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),r.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=la.some(e=>!0===this[e].enabled)||this.makerNote||this.userComment;for(let e of la)this[e].finalizeFilters()}get onlyTiff(){return!sa.map(e=>this[e].enabled).some(e=>!0===e)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of aa)this[e].enabled&&!Vs.has(e)&&$s("segment parser",e)}}function va(e,t){let i,n,r,o,s=[];for(r of t){for(o of(i=ia.get(r),n=[],i))(e.includes(o[0])||e.includes(o[1]))&&n.push(o[0]);n.length&&s.push([r,n])}return s}function ba(e,t){return void 0!==e?e:void 0!==t?t:void 0}function wa(e,t){for(let i of t)e.add(i)}Os(ya,"default",ma);class Pa{constructor(e){Os(this,"parsers",{}),Os(this,"output",{}),Os(this,"errors",[]),Os(this,"pushToErrors",e=>this.errors.push(e)),this.options=ya.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?Ks(e,t):Es&&!Us&&e instanceof HTMLImageElement?Ks(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new zs(e):Es&&e instanceof Blob?Xs(e,t,"blob",Js):void Ms("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,n]of Hs)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),Ms("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),Rs(i=e)?void 0:i;var i}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async t=>{let i=await t.parse();t.assignToOutput(e,i)});this.options.silentErrors&&(t=t.map(e=>e.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=Vs.get("tiff",e);var n;if(t.tiff?n={start:0,type:"tiff"}:t.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),void 0===n)return;let r=await this.fileParser.ensureSegmentChunk(n),o=this.parsers.tiff=new i(r,e,t),s=await o.extractThumbnail();return t.close&&t.close(),s}}async function _a(e,t){let i=new Pa(t);return await i.read(e),i.parse()}var Fa=Object.freeze({__proto__:null,parse:_a,Exifr:Pa,fileParsers:Hs,segmentParsers:Vs,fileReaders:Ws,tagKeys:ia,tagValues:na,tagRevivers:ra,createDictionary:ea,extendDictionary:ta,fetchUrlAsArrayBuffer:Qs,readBlobAsArrayBuffer:Js,chunkedProps:oa,otherSegments:sa,segments:aa,tiffBlocks:la,segmentsAndBlocks:ua,tiffExtractables:da,inheritables:pa,allFormatters:ca,Options:ya});class Sa{static findPosition(e,t){let i=e.getUint16(t+2)+2,n="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,r=t+n,o=i-n;return{offset:t,length:i,headerLength:n,start:r,size:o,end:r+o}}static parse(e,t={}){return new this(e,new ya({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof zs?e:new zs(e)}constructor(e,t={},i){Os(this,"errors",[]),Os(this,"raw",new Map),Os(this,"handleError",e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=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 i=ra.get(t),n=na.get(t),r=ia.get(t),o=this.options[t],s=o.reviveValues&&!!i,a=o.translateValues&&!!n,l=o.translateKeys&&!!r,u={};for(let[t,o]of e)s&&i.has(t)?o=i.get(t)(o):a&&n.has(t)&&(o=this.translateValue(o,n.get(t))),l&&r.has(t)&&(t=r.get(t)||t),u[t]=o;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}function Ca(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function ka(e){return e>=224&&e<=239}function Ta(e,t,i){for(let[n,r]of Vs)if(r.canHandle(e,t,i))return n}Os(Sa,"headerLength",4),Os(Sa,"type",void 0),Os(Sa,"multiSegment",!1),Os(Sa,"canHandle",()=>!1);class Oa extends class{constructor(e,t,i){Os(this,"errors",[]),Os(this,"ensureSegmentChunk",async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked)if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){Ms(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):Ms("Segment unreachable: "+JSON.stringify(e));return e.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(Vs.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,n=this.options[e];if(n&&n.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),Os(this,"appSegments",[]),Os(this,"jpegSegments",[]),Os(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(Vs.keyList())):(e=void 0===e?Vs.keyList().filter(e=>this.options[e].enabled):e.filter(e=>this.options[e].enabled&&Vs.has(e)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:n,wanted:r,remaining:o}=this;if(!n&&this.file.chunked&&(n=Array.from(r).some(e=>{let t=Vs.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment}),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;o.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:n}=i,r=this.appSegments.some(e=>!this.file.available(e.offset||e.start,e.length||e.size));if(t=e>n&&!r?!await i.readNextChunk(e):!await i.readNextChunk(n),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,n,r,o,s,a,{file:l,findAll:u,wanted:d,remaining:p,options:c}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),ka(i)){if(n=l.getUint16(e+2),r=Ta(l,e,n),r&&d.has(r)&&(o=Vs.get(r),s=o.findPosition(l,e),a=c[r],s.type=r,this.appSegments.push(s),!u&&(o.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||p.delete(r)):p.delete(r),0===p.size)))break;c.recordUnknownSegments&&(s=Sa.findPosition(l,e),s.marker=i,this.unknownSegments.push(s)),e+=n+1}else if(Ca(i)){if(n=l.getUint16(e+2),218===i&&!1!==c.stopAfterSos)return;c.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:i}),e+=n+1}return e}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let e=function(e){let t,i,n,r=new Map;for(let o=0;o<e.length;o++)t=e[o],i=t.type,r.has(i)?n=r.get(i):r.set(i,n=[]),n.push(t);return Array.from(r)}(this.appSegments);this.mergedAppSegments=e.map(([e,t])=>{let i=Vs.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}Os(Oa,"type","jpeg"),Hs.set("jpeg",Oa);const Aa=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Ea extends Sa{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:n,skip:r}=this.options[t];n=new Set(n);let o=n.size>0,s=0===r.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(o){if(n.has(a)&&(i.set(a,this.parseTag(e,a,t)),n.delete(a),0===n.size))break}else!s&&r.has(a)||i.set(a,this.parseTag(e,a,t));e+=12}return i}parseTag(e,t,i){let{chunk:n}=this,r=n.getUint16(e+2),o=n.getUint32(e+4),s=Aa[r];if(s*o<=4?e+=8:e=n.getUint32(e+8),(r<1||r>13)&&Ms(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e}`),e>n.byteLength&&Ms(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e} is outside of chunk size ${n.byteLength}`),1===r)return n.getUint8Array(e,o);if(2===r)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=n.getString(e,o)).trim())?void 0:a;var a;if(7===r)return n.getUint8Array(e,o);if(1===o)return this.parseTagValue(r,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(r))(o),i=s;for(let n=0;n<o;n++)t[n]=this.parseTagValue(r,e),e+=i;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);default:Ms(`Invalid tiff type ${e}`)}}}class Ua extends Ea{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Ms("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Ms(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Bs(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(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)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Bs(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 i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Ia(...e.get(2),e.get(1))),e.set("longitude",Ia(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,n={};for(t of la)if(e=this[t],!Rs(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(n,i)}else n[t]=i;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,n]of Object.entries(t))this.assignObjectToOutput(e,i,n)}}function Ia(e,t,i,n){var r=e+t/60+i/3600;return"S"!==n&&"W"!==n||(r*=-1),r}Os(Ua,"type","tiff"),Os(Ua,"headerLength",10),Vs.set("tiff",Ua),Object.freeze({__proto__:null,default:Fa,Exifr:Pa,fileParsers:Hs,segmentParsers:Vs,fileReaders:Ws,tagKeys:ia,tagValues:na,tagRevivers:ra,createDictionary:ea,extendDictionary:ta,fetchUrlAsArrayBuffer:Qs,readBlobAsArrayBuffer:Js,chunkedProps:oa,otherSegments:sa,segments:aa,tiffBlocks:la,segmentsAndBlocks:ua,tiffExtractables:da,inheritables:pa,allFormatters:ca,Options:ya,parse:_a});const xa={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},xa,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},xa,{tiff:!1,ifd1:!0,mergeOutput:!1});const Na=Object.assign({},xa,{firstChunkSize:4e4,ifd0:[274]}),Da=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 Ra=!0,Ma=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t,n=Number(e)+.1*Number(i);Ra=n<13.4,Ma=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);Ra=Ma=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);Ra=Ma=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);Ra=Ma=Number(t)<77}}class Ba extends zs{constructor(...e){super(...e),Os(this,"ranges",new La),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;t=Ns?xs.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let n=super.set(e,t);return this.ranges.add(t,n.byteLength),n}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 La{constructor(){Os(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let n=e+t,r=this.list.filter(t=>ja(e,t.offset,n)||ja(e,t.end,n));if(r.length>0){e=Math.min(e,...r.map(e=>e.offset)),n=Math.max(n,...r.map(e=>e.end)),t=n-e;let i=r.shift();i.offset=e,i.length=t,i.end=n,this.list=this.list.filter(e=>!r.includes(e))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let i=e+t;return this.list.some(t=>t.offset<=e&&i<=t.end)}}function ja(e,t,i){return e<=t&&t<=i}class za extends Ba{constructor(e,t){super(0),Os(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,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Ws.set("blob",class extends za{async readWhole(){this.chunked=!1;let e=await Js(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}
2async _readChunk(e,t){let i=t?e+t:void 0,n=this.input.slice(e,i),r=await Js(n);return this.set(r,e,!0)}});const $a={strings:{generatingThumbnails:"Generating thumbnails..."}},qa={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};let Ha=function(e){function t(t,i){var n;if((n=e.call(this,t,{...qa,...i})||this).queue=void 0,n.queueProcessing=void 0,n.defaultThumbnailDimension=void 0,n.thumbnailType=void 0,n.onFileAdded=e=>{!e.preview&&e.data&&ks(e.type)&&!e.isRemote&&n.addToQueue(e.id)},n.onCancelRequest=e=>{const t=n.queue.indexOf(e.id);-1!==t&&n.queue.splice(t,1)},n.onFileRemoved=e=>{const t=n.queue.indexOf(e.id);-1!==t&&n.queue.splice(t,1),e.preview&&Ts(e.preview)&&URL.revokeObjectURL(e.preview)},n.onRestored=()=>{n.uppy.getFiles().filter(e=>e.isRestored).forEach(e=>{e.preview&&!Ts(e.preview)||n.addToQueue(e.id)})},n.onAllFilesRemoved=()=>{n.queue=[]},n.waitUntilAllProcessed=e=>{e.forEach(e=>{const t=n.uppy.getFile(e);n.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:n.i18n("generatingThumbnails")})});const t=()=>{e.forEach(e=>{const t=n.uppy.getFile(e);n.uppy.emit("preprocess-complete",t)})};return new Promise(e=>{n.queueProcessing?n.uppy.once("thumbnail:all-generated",()=>{t(),e()}):(t(),e())})},n.type="modifier",n.id=n.opts.id||"ThumbnailGenerator",n.title="Thumbnail Generator",n.queue=[],n.queueProcessing=!1,n.defaultThumbnailDimension=200,n.thumbnailType=n.opts.thumbnailType,n.defaultLocale=$a,n.i18nInit(),n.opts.lazy&&n.opts.waitForThumbnailsBeforeUpload)throw new Error("Thumbn
2ailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.");return n}s(t,e);var i=t.prototype;return i.createThumbnail=function(e,t,i){if(null==e.data)throw new Error("File data is empty");const n=URL.createObjectURL(e.data),r=new Promise((e,t)=>{const i=new Image;i.src=n,i.addEventListener("load",()=>{URL.revokeObjectURL(n),e(i)}),i.addEventListener("error",e=>{URL.revokeObjectURL(n),t(e.error||new Error("Could not create thumbnail"))})}),o=async function(e){let t=await async function(e){let t=new Pa(Na);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}(e);return Object.assign({canvas:Ra,css:Ma},Da[t])}(e.data).catch(()=>1);return Promise.all([r,o]).then(([e,n])=>{const r=this.getProportionalDimensions(e,t,i,n.deg),o=function(e,t){let i=e.width,n=e.height;90!==t.deg&&270!==t.deg||(i=e.height,n=e.width);const r=document.createElement("canvas");r.width=i,r.height=n;const o=r.getContext("2d");return o.translate(i/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),r}(e,n);return function(e,t){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(i=>{e.toBlob(i,t,80)}).then(e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(()=>function(e,t){var i,n;const r=Cs.exec(e),o=null!=(i=null!=(n=t.mimeType)?n:r?.[1])?i:"plain/text";let s;if(null!=r?.[2]){const e=atob(decodeURIComponent(r[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);s=[t]}else null!=r?.[3]&&(s=[decodeURIComponent(r[3])]);return new Blob(s,{type:o})}(e.toDataURL(t,80),{})).then(e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e})}(this.resizeImage(o,r.width,r.height),this.thumbnailType)}).then(e=>URL.createObjectURL(e))},i.getProportionalDimensions=function(e,t,i,n){let r=e.width/e.height;if(90!==n&&270!==n||(r=e.height/e.width),null!=t){let i=t;return e.width<t&&(i=e.width),{width:i,height:Math.round(i/r)}}if(null!=i){let t=i;return e.height<i&&(t=e.height),{width:Math.round(t*r),height:t}}return{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}},i.resizeImage=function(e,t,i){let n=function(e){const t=e.width/e.height,i=5e6,n=4096;let r=Math.floor(Math.sqrt(i*t)),o=Math.floor(i/Math.sqrt(i*t));if(r>n&&(r=n,o=Math.round(r/t)),o>n&&(o=n,r=Math.round(t*o)),e.width>r){const t=document.createElement("canvas");return t.width=r,t.height=o,t.getContext("2d").drawImage(e,0,0,r,o),t}return e}(e),r=Math.ceil(Math.log2(n.width/t));r<1&&(r=1);let o=t*2**(r-1),s=i*2**(r-1);for(;r--;){const e=document.createElement("canvas");e.width=o,e.height=s,e.getContext("2d").drawImage(n,0,0,o,s),n=e,o=Math.round(o/2),s=Math.round(s/2)}return n},i.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},i.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},i.processQueue=function(){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()},i.requestThumbnail=function(e){return ks(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.up
2py.getFile(e.id),t)}):Promise.resolve()},i.install=function(){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)},i.uninstall=function(){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)},r(t)}(pr);Ha.VERSION="5.1.0";const Va=Array.from;function Wa(e,t,i,{onSuccess:n}){e.readEntries(r=>{const o=[].concat(fe(me,t),fe(me,r));r.length?queueMicrotask(()=>{Wa(e,o,i,{onSuccess:n})}):n(o)},e=>{i(e),n(t)})}function Ga(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise((t,i)=>e.file(t,i)),async*values(){const i=e.createReader(),n=await new Promise(e=>{Wa(i,[],t,{onSuccess:i=>e(i.map(e=>Ga(e,t)))})});yield*n},isSameEntry:void 0}}async function*Ka(e,t,i=void 0){const n=()=>`${t}/${e.name}`;if("file"===e.kind){const r=await e.getFile();null!=r?(r.relativePath=t?n():null,yield r):null!=i&&(yield i)}else if("directory"===e.kind)for await(const i of e.values())yield*Ka(i,t?n():e.name);else null!=i&&(yield i)}const Xa=function(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&lr(e)?[e]:null};function Ya(){if("undefined"==typeof window)return!1;const e=document.body;return null!=e&&null!=window&&"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window}const Qa=function(e){function t(...t){var i;return(i=e.call.apply(e,[this].concat(t))||this).fileInput=null,i.folderInput=null,i.mobilePhotoFileInput=null,i.mobileVideoFileInput=null,i.triggerFileInputClick=()=>{i.fileInput?.click()},i.triggerFolderInputClick=()=>{i.folderInput?.click()},i.triggerVideoCameraInputClick=()=>{i.mobileVideoFileInput?.click()},i.triggerPhotoCameraInputClick=()=>{i.mobilePhotoFileInput?.click()},i.onFileInputChange=e=>{i.props.handleInputChange(e),e.currentTarget.value=""},i.renderHiddenInput=(e,t)=>Yn("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==i.props.maxNumberOfFiles,onChange:i.onFileInputChange,accept:i.props.allowedFileTypes?.join(", "),ref:t}),i.renderHiddenCameraInput=(e,t,n)=>{const r={photo:"image/*",video:"video/*"}[e];return Yn("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:i.onFileInputChange,capture:""===t?"environment":t,accept:r,ref:n})},i.renderMyDeviceAcquirer=()=>Yn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:i.triggerFileInputClick,children:[Yn("div",{className:"uppy-DashboardTab-inner",children:Yn("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("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:"
2currentcolor","fill-rule":"evenodd"})})}),Yn("div",{className:"uppy-DashboardTab-name",children:i.props.i18n("myDevice")})]})}),i.renderPhotoCamera=()=>Yn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:i.triggerPhotoCameraInputClick,children:[Yn("div",{className:"uppy-DashboardTab-inner",children:Yn("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("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"})})}),Yn("div",{className:"uppy-DashboardTab-name",children:i.props.i18n("takePictureBtn")})]})}),i.renderVideoCamera=()=>Yn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:i.triggerVideoCameraInputClick,children:[Yn("div",{className:"uppy-DashboardTab-inner",children:Yn("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:Yn("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 "})})}),Yn("div",{className:"uppy-DashboardTab-name",children:i.props.i18n("recordVideoBtn")})]})}),i.renderBrowseButton=(e,t)=>Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===i.props.acquirers.length,children:e}),i.renderDropPasteBrowseTagline=e=>{const t=i.renderBrowseButton(i.props.i18n("browseFiles"),i.triggerFileInputClick),n=i.renderBrowseButton(i.props.i18n("browseFolders"),i.triggerFolderInputClick),r=i.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return Yn("div",{class:"uppy-Dashboard-AddFiles-title",children:i.props.disableLocalFiles?i.props.i18n("importFiles"):e>0?i.props.i18nArray(`dropPasteImport${o}`,{browseFiles:t,browseFolders:n,browse:t}):i.props.i18nArray(`dropPaste${o}`,{browseFiles:t,browseFolders:n,browse:t})})},i.renderAcquirer=e=>Yn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:Yn("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":i.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>i.props.showPanel(e.id),children:[Yn("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),Yn("div",{className:"uppy-DashboardTab-name",children:e.name})]})}),i.renderAcquirers=e=>{const t=fe(me,e),n=t.splice(e.length-2,e.length);return Yn(Sn,{children:[t.map(e=>i.renderAcquirer(e)),Yn("span",{role:"presentation",style:{"white-space":"nowrap"},children:n.map(e=>i.renderAcquirer(e))})]})},i.renderSourcesList=(e,t)=>{var n;const{showNativePhotoCameraButton:r,showNativeVideoCameraButton:o}=i.props;let s=[];const a="myDevice";t||s.push({key:a,elements:i.renderMyDeviceAcquirer()}),r&&s.push({key:"nativePhotoCameraButton",elements:i.renderPhotoCamera()}),o&&s.push({key:"nativePhotoCameraButton",elements:i.renderVideoCamera()}),(n=s).push.apply(n,fe(me,e.map(e=>({key:e.id,elements:i.renderAcquirer(e)})))),1===s.length&&s[0].key===a&&(s=[]);const l=fe(me,s),u=l.splice(s.length-2,s.length);return Yn(Sn,{children:[i.renderDropPasteBrowseTagline(s.length),Yn("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[l.map(({key:e,elements:t})=>Yn(Sn,{children:t},e)),Yn("span",{role:"presentation",style:{"white-space":"nowrap"},children:u.map(({key:e,elements:t})=>Yn(Sn,{children:t},e))})]})]})},i}s(t,e);var i=t.prototype;return i[Symbol.for("uppy test: disable unused locale key warning")]=function(){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")},i.renderPoweredByUppy=function(){const{i18nArray:e}=this.props,t=Yn("span",{children:[Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:Yn("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),Yn("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]});return Yn("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:e("poweredBy",{uppy:t})})},i.render=function(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return Yn("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,e=>{this.fileInput=e}),this.renderHiddenInput(!0,e=>{this.folderInput=e}),e&&this.renderHiddenCameraInput("photo",i,e=>{this.mobilePhotoFileInput=e}),t&&this.renderHiddenCameraInput("video",i,e=>{this.mobileVideoFileInput=e}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),Yn("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&Yn("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})},r(t)}(Cn),Ja=e=>Yn("div",{className:gr("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[Yn("div",{className:"uppy-DashboardContent-bar",children:[Yn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),Yn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),Yn(Qa,{...e})]}),Za=function(e){const t=e.files[e.fileCardFor];return Yn("div",{className:gr("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[Yn("div",{className:"uppy-DashboardContent-bar",children:[Yn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:Yn("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),Yn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()}
2,children:e.i18n("cancel")}),Yn("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),Yn("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})};function el(e){const t={color:"#838999",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[Yn("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"}),Yn("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;const i=e.split("/")[0],n=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"})})}:"image"===i?{color:"#686de0",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("g",{fill:"#686DE0",fillRule:"evenodd",children:[Yn("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"}),Yn("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"}),Yn("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"})})}:"video"===i?{color:"#19af67",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}:"application"===i&&"pdf"===n?{color:"#e25149",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)?{color:"#00C469",icon:Yn("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:Yn("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"})})}:t}const tl=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()};function il(e){const{file:t}=e;
2if(t.preview)return Yn("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:i,icon:n}=el(t.type);return Yn("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[Yn("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:n}),Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:Yn("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function nl(e){const{computedMetaFields:t,requiredMetaFields:i,updateMeta:n,form:r,formState:o}=e,s={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(e=>{const t=`uppy-Dashboard-FileCard-input-${e.id}`,a=i.includes(e.id);return Yn("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[Yn("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:o[e.id],onChange:t=>n(t,e.id),fieldCSSClasses:s,required:a,form:r.id},_n):Yn("input",{className:s.text,id:t,form:r.id,type:e.type||"text",required:a,value:o[e.id],placeholder:e.placeholder,onInput:t=>n(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)})}function rl(e){var t;const{files:i,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:l,i18n:u,i18nArray:d,className:p,canEditFile:c}=e,h=i[n],f=null!=(t="function"==typeof s?s(i[n]):s)?t:[],m=c(h),g={};f.forEach(e=>{var t;g[e.id]=null!=(t=h.meta[e.id])?t:""});const[y,v]=Or(g),b=Ir(e=>{e.preventDefault(),o(y,n)},[o,y,n]),w=()=>{r(!1)},[P]=Or(()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=Qt(),e}),_=Er(null);return Ar(()=>{var e;const t=null!=(e=_.current?.getRootNode())?e:document;return t instanceof Document?t.body.appendChild(P):(ShadowRoot,t.appendChild(P)),P.addEventListener("submit",b),()=>{P.removeEventListener("submit",b),P.parentNode&&P.parentNode.removeChild(P)}},[P,b]),Yn("div",{className:gr("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:tl,onDragLeave:tl,onDrop:tl,onPaste:tl,ref:_,children:[Yn("div",{className:"uppy-DashboardContent-bar",children:[Yn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:d("editing",{file:Yn("span",{className:"uppy-DashboardContent-titleFile",children:h.meta?h.meta.name:h.name})})}),Yn("button",{className:"uppy-DashboardContent-back",type:"button",form:P.id,title:u("finishEditingFile"),onClick:w,children:u("cancel")})]}),Yn("div",{className:"uppy-Dashboard-FileCard-inner",children:[Yn("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:el(h.type).color},children:[Yn(il,{file:h}),m&&Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{b(e),l(h)},children:u("editImage")})]}),Yn("div",{className:"uppy-Dashboard-FileCard-info",children:Yn(nl,{computedMetaFields:f,requiredMetaFields:a,updateMeta:(e,t)=>{v({...y,[t]:e})},form:P,formState:y})}),Yn("div",{className:"uppy-Dashboard-FileCard-actions",children:[Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:P.id,children:u("saveChanges")}),Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:w,form:P.id,children:u("cancel")})]})]})]})}function ol({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:n,i18n:r,onClick:o}){return!t&&i&&i.length>0||!t&&n(e)?Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":r("editFileWithFilename",{file:e.meta.name}),title:r("editFileWithFilename",{file:e.meta.name}),onClick:()=>o(),children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:Yn("g",{fillRule:"evenodd",children:[Yn("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"}),Yn("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),Yn("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function sl({i18n:e,onClick:t,file:i}){return Yn("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>t(),children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[Yn("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"}),Yn("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})]})})}function al({file:e,uppy:t,i18n:i}){return Yn("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:n=>(n=>{(function(e,t="Copy the URL below"){return new Promise(i=>{const n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=e,document.body.appendChild(n),n.select();const r=()=>{document.body.removeChild(n),window.prompt(t,e),i()};try{return document.execCommand("copy")?(document.body.removeChild(n),i()):r()}catch(e){return document.body.removeChild(n),r()}})})(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>
2n.target.focus({preventScroll:!0}))})(n),children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:Yn("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 ll(e){const{uppy:t,file:i,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:d}=e;return Yn("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[Yn(ol,{i18n:l,file:i,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?u(!0,i.id):d(i)}}),s&&i.uploadURL?Yn(al,{file:i,uppy:t,i18n:l}):null,a?Yn(sl,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function ul(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}â¦`;const i=t-3,n=Math.ceil(i/2),r=Math.floor(i/2);return e.slice(0,n)+"..."+e.slice(-r)}function dl(e){const{file:t,toggleFileCard:i,i18n:n,metaFields:r}=e,{missingRequiredMetaFields:o}=t;if(!o?.length)return null;const s=o.map(e=>((e,t)=>{const i=("function"==typeof t?t():t).filter(t=>t.id===e);return i[0].name})(e,r)).join(", ");return Yn("div",{className:"uppy-Dashboard-Item-errorMessage",children:[n("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",Yn("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:n("editFile")})]})}const pl=e=>{const{author:t,name:i}=e.file.meta;return Yn("div",{className:"uppy-Dashboard-Item-name",title:i,children:ul(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},cl=e=>{const{author:t}=e.file.meta,i="remote"in e.file?e.file.remote?.providerName:void 0;return t?Yn("div",{className:"uppy-Dashboard-Item-author",children:[Yn("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:ul(t.name,13)}),i?Yn(Sn,{children:[" · ",i," · "]}):null]}):null},hl=e=>e.file.size&&Yn("div",{className:"uppy-Dashboard-Item-statusSize",children:ni(e.file.size)}),fl=e=>e.file.isGhost&&Yn("span",{children:[" ⢠",Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),ml=({file:e,onClick:t})=>e.error?Yn("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",children:"?"}):null;function gl(e){const{file:t,i18n:i,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:s,containerHeight:a,containerWidth:l}=e;return Yn("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[Yn("div",{className:"uppy-Dashboard-Item-fileName",children:[pl({file:t,isSingleFile:s,containerHeight:a,containerWidth:l}),Yn(ml,{file:t,onClick:()=>alert(t.error)})]}),Yn("div",{className:"uppy-Dashboard-Item-status",children:[cl({file:t}),hl({file:t}),fl({file:t,toggleAddFilesPanel:o,i18n:i})]}),Yn(dl,{file:t,i18n:i,toggleFileCard:n,metaFields:r})]})}function yl(e){const{file:t,i18n:i,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=e;return Yn("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":el(t.type).color},children:[o&&t.uploadURL&&Yn("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:Yn("span",{hidden:!0,children:t.meta.name})}),Yn(il,{file:t}),Yn(dl,{file:t,i18n:i,toggleFileCard:n,metaFields:r})]})}function vl(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("c
2ancelUpload"):""}function bl(e){return Yn("div",{className:"uppy-Dashboard-Item-progress",children:Yn("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":vl(e),title:vl(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e),children:e.children})})}function wl({children:e}){return Yn("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function Pl({progress:e}){const t=2*Math.PI*15;return Yn("g",{children:[Yn("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),Yn("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 _l(e){return e.file.progress.uploadStarted?void 0===e.file.progress.percentage?null:e.isUploaded?Yn("div",{className:"uppy-Dashboard-Item-progress",children:Yn("div",{className:"uppy-Dashboard-Item-progressIndicator",children:Yn(wl,{children:[Yn("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),Yn("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?Yn(bl,{...e,children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[Yn("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),Yn("path",{d:"M7.9 3H10v2H7.9z"}),Yn("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),Yn("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?Yn(bl,{...e,children:Yn(wl,{children:[Yn(Pl,{progress:e.file.progress.percentage}),e.file.isPaused?Yn("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):Yn("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[Yn("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),Yn("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?Yn("div",{className:"uppy-Dashboard-Item-progress",children:Yn("div",{className:"uppy-Dashboard-Item-progressIndicator",children:Yn(wl,{children:Yn(Pl,{progress:e.file.progress.percentage})})})}):Yn(bl,{...e,children:Yn(wl,{children:[Yn(Pl,{progress:e.file.progress.percentage}),Yn("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})]})}):null}let Fl=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var i=t.prototype;return i.componentDidMount=function(){const{file:e}=this.props;
2e.preview||this.props.handleRequestThumbnail(e)},i.shouldComponentUpdate=function(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;const i=Object.keys(e),n=Object.keys(t),r=i.length;if(n.length!==r)return!1;for(let n=0;n<r;n++){const r=i[n];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1}return!0}(this.props,e)},i.componentDidUpdate=function(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)},i.componentWillUnmount=function(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)},i.render=function(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,n=!!e.progress.uploadStarted||!!t,r=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:s}=e;let a=(this.props.individualCancellation||!r)&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(a=!0),Yn("div",{className:gr({"uppy-Dashboard-Item":!0,"is-inprogress":r&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s}),id:`uppy_${e.id}`,role:this.props.role,children:[Yn("div",{className:"uppy-Dashboard-Item-preview",children:[Yn(yl,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),Yn(_l,{uppy:this.props.uppy,file:e,error:o,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),Yn("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[Yn(gl,{file:e,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}),Yn(ll,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})},r(t)}(Cn);function Sl({id:e,i18n:t,uppy:i,files:n,resumableUploads:r,hideRetryButton:o,hidePauseResumeButton:s,hideCancelButton:a,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:d,isSingleFile:p,toggleFileCard:c,handleRequestThumbn
2ail:h,handleCancelThumbnail:f,recoveredState:m,individualCancellation:g,itemsPerRow:y,openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,containerWidth:P,containerHeight:_}){const F=1===y?71:200,S=Ur(()=>{const e=Object.keys(n);return m&&e.sort((e,t)=>Number(n[t].isGhost)-Number(n[e].isGhost)),function(e,t){const i=[];let n=[];return e.forEach(e=>{n.length<t?n.push(e):(i.push(n),n=[e])}),n.length&&i.push(n),i}(e,y)},[n,y,m]),C=y=>Yn("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map(y=>Yn(Fl,{uppy:i,id:e,i18n:t,resumableUploads:r,individualCancellation:g,hideRetryButton:o,hidePauseResumeButton:s,hideCancelButton:a,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:d,recoveredState:m,isSingleFile:p,containerWidth:P,containerHeight:_,toggleFileCard:c,handleRequestThumbnail:h,handleCancelThumbnail:f,role:"listitem",openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,file:n[y]},y))},y[0]);return p?Yn("div",{class:"uppy-Dashboard-files",children:C(S[0])}):Yn($r,{class:"uppy-Dashboard-files",role:"list",data:S,renderRow:C,rowHeight:F})}let Cl=function(e){function t(...t){var i;return(i=e.call.apply(e,[this].concat(t))||this).ref={current:null},i}s(t,e);var i=t.prototype;return i.componentWillEnter=function(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)},i.componentWillLeave=function(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)},i.render=function(){const{children:e}=this.props;return Yn("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})},r(t)}(Cn);function kl(e,t){var i;return null!=(i=e?.key)?i:t}function Tl(e){const t={};for(let i=0;i<e.length;i++)null!=e[i]&&(t[kl(e[i],i.toString(36))]=e[i]);return t}function Ol(e,t){e=e||{},t=t||{};const i=i=>Object.hasOwn(t,i)?t[i]:e[i],n={};let r=[];for(const i in e)Object.hasOwn(t,i)?r.length&&(n[i]=r,r=[]):r.push(i);const o={};for(const e in t){if(Object.hasOwn(n,e))for(let t=0;t<n[e].length;t++){const r=n[e][t];o[n[e][t]]=i(r)}o[e]=i(e)}for(let e=0;e<r.length;e++)o[r[e]]=i(r[e]);return o}let Al=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).refs={},n.state={children:Tl(Nn(Nn(n.props.children))||[])},n.performAppear=n.performAppear.bind(n),n.performEnter=n.performEnter.bind(n),n.performLeave=n.performLeave.bind(n),n}s(t,e);var i=t.prototype;return i.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]},i.componentDidMount=function(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)},i.componentWillReceiveProps=function(e){const t=Tl(Nn(e.children)||[]),i=this.state.children;let n;for(n in this.setState(e=>({children:Ol(e.children,t)})),t)if(Object.hasOwn(t,n)){const e=i&&Object.hasOwn(i,n);t[n]&&e&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):!t[n]||e||this.currentlyTransitioningKeys[n]||this.keysToEnter.push(n)}for(n in i)if(Object.hasOwn(i,n)){const e=t&&Object.hasOwn(t,n);!i[n]||e||this.currentlyTransitioningKeys[n]||this.keysToLeave.push(n)}},i.componentDidUpdate=function(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)},i._finishAbort=function(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)},i.performAppear=function(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)},i._handleDoneAppearing=function(e){const t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Tl(Nn(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)},i.performEnter=function(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)},i._handleDoneEntering=function(e){const t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Tl(Nn(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)},i.performLeave=function(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)},i._handleDoneLeaving=function(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const i=Tl(Nn(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{const t=(n={},r=this.state.children,Object.assign(n,r));delete t[e],this.setState({children:t})}var n,r},i.render=function({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:n,transitionEnter:r,transitionLeaveTimeout:o,transitionEnterTimeout:s,transitionAppearTimeout:a,component:l,...u},{children:d}){const p=Object.entries(d).map(([t,i])=>{if(!i)return;const n=function(e,t){const i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return Kn(e(i),{ref:n,key:t})}
2).filter(Boolean);return _n(l,u,p)},r(t)}(Cn);Al.defaultProps={component:"span",childFactory:e=>e};const El=Al;let Ul=function(e){function t(){return e.apply(this,arguments)||this}return s(t,e),t.prototype.render=function(){const{info:e}=this.props.uppy.getState();return Yn("div",{className:"uppy uppy-Informer",children:Yn(El,{children:e.map(e=>Yn(Cl,{children:Yn("p",{role:"alert",children:[e.message," ",e.details&&Yn("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`),children:"?"})]})},e.message))})})},r(t)}(Cn);const Il=function({activePickerPanel:e,className:t,hideAllPanels:i,i18n:n,state:r,uppy:o}){const s=Er(null);return Yn("div",{className:gr("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:tl,onDragLeave:tl,onDrop:tl,onPaste:tl,children:[Yn("div",{className:"uppy-DashboardContent-bar",children:[Yn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:n("importFrom",{name:e.name})}),Yn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:n("cancel")})]}),Yn("div",{ref:s,className:"uppy-DashboardContent-panelBody",children:o.getPlugin(e.id).render(r,s.current)})]})},xl="preprocessing",Nl="uploading";function Dl({files:e,i18n:t,isAllComplete:i,isAllErrored:n,isAllPaused:r,inProgressNotPausedFiles:o,newFiles:s,processingFiles:a}){const l=function(e,t,i,n={}){if(e)return"error";if(t)return"complete";if(i)return"paused";let r="waiting";const o=Object.keys(n);for(let e=0;e<o.length;e++){const{progress:t}=n[o[e]];if(t.uploadStarted&&!t.uploadComplete)return Nl;t.preprocess&&r!==Nl&&(r=xl),t.postprocess&&r!==Nl&&r!==xl&&(r="postprocessing")}return r}(n,i,r,e);switch(l){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:a.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:s.length});case"complete":return t("uploadComplete");case"error":return t("error")}}const Rl=function(e){const{i18n:t,isAllComplete:i,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=e;let{allowNewUpload:a}=e;return a&&r&&(a=e.totalFileCount<e.maxNumberOfFiles),Yn("div",{className:"uppy-DashboardContent-bar",children:[i||n?Yn("div",{}):Yn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll(),children:t("cancel")}),Yn("div",{className:"uppy-DashboardContent-title",children:Yn(Dl,{...e})}),a?Yn("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0),children:[Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:Yn("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"})}),Yn("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):Yn("div",{})]})}
2,Ml="uppy-transition-slideDownUp",Bl=function({children:e}){const[t,i]=Or(null),[n,r]=Or(""),o=Er(),s=Er(),a=Er(),l=Ir(()=>{r(`${Ml}-enter`),cancelAnimationFrame(a.current),clearTimeout(s.current),s.current=void 0,a.current=requestAnimationFrame(()=>{r(`${Ml}-enter ${Ml}-enter-active`),o.current=setTimeout(()=>{r("")},250)})},[]),u=Ir(()=>{r(`${Ml}-leave`),cancelAnimationFrame(a.current),clearTimeout(o.current),o.current=void 0,a.current=requestAnimationFrame(()=>{r(`${Ml}-leave ${Ml}-leave-active`),s.current=setTimeout(()=>{i(null),r("")},250)})},[]);return Ar(()=>{const n=Nn(e)[0];t!==n&&(n&&!t?l():!t||n||s.current||u(),i(n))},[e,t,l,u]),Ar(()=>()=>{clearTimeout(o.current),clearTimeout(s.current),cancelAnimationFrame(a.current)},[]),t?Kn(t,{className:gr(n,t.props.className)}):null};function Ll(e,t,i,n){return 0===i||e===t?e:0===n?t:e+(t-e)*2**(-n/i)}const jl={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};function zl(e){const t=(i=e,{hours:Math.floor(i/3600)%24,minutes:Math.floor(i/60)%60,seconds:Math.floor(i%60)});var i;return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`}function $l(e){const{newFiles:t,isUploadStarted:i,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=e,l=gr("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===jl.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),u=r(t&&i&&!n?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return Yn("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:a,disabled:s,"data-uppy-super-focusable":!0,children:u})}function ql(e){const{i18n:t,uppy:i}=e;return Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:Yn("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})}),t("retry")]})}function Hl(e){const{i18n:t,uppy:i}=e;return Yn("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:Yn("g",{fill:"none",fillRule:"evenodd",children:[Yn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Yn("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 Vl(e){const{isAllPaused:t,i18n:i,isAllComplete:n,resumableUploads:r,uppy:o}=e,s=i(t?"resume":"pause");return Yn("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){n||(r?t?o.resumeAll():o.pauseAll():o.cancelAll())},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:Yn("g",{fill:"none",fillRule:"evenodd",children:[Yn("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Yn("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function Wl(e){const{i18n:t,doneButtonHandler:i}=e;return Yn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function Gl(){return Yn("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:Yn("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 Kl(e){const{progress:t}=e,{value:i,mode:n,message:r}=t;return Yn("div",{className:"uppy-StatusBar-content",children:[Yn(Gl,{}),"determinate"===n?`${Math.round(100*i)}% · `:"",r]})}function Xl(e){const{numUploads:t,complete:i,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:s}=e,a=t>1,l=ni(n);return Yn("div",{className:"uppy-StatusBar-statusSecondary",children:[a&&s("filesUploadedOfTotal",{complete:i,smart_count:t}),Yn("span",{className:"uppy-StatusBar-additionalInfo",children:[a&&" · ",null!=r?s("dataUploadedOfTotal",{complete:l,total:ni(r)}):s("dataUploadedOfUnknown",{complete:l})," · ",null!=o&&s("xTimeLeft",{time:zl(o)})]})]})}function Yl(e){const{i18n:t,complete:i,numUploads:n}=e;return Yn("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:n})})}function Ql(e){const{i18n:t,newFiles:i,startUpload:n}=e,r=gr("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Yn("div",{className:"uppy-StatusBar-statusSecondary",children:[Yn("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),Yn("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:n,children:t("upload")})]})}
2function Jl(e){const{i18n:t,supportsUploadProgress:i,totalProgress:n,hideProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:u,complete:d,totalUploadedSize:p,totalSize:c,totalETA:h,startUpload:f}=e,m=l&&o;if(!o||s)return null;const g=t(a?"paused":"uploading");return Yn("div",{className:"uppy-StatusBar-content",title:g,children:[a?null:Yn(Gl,{}),Yn("div",{className:"uppy-StatusBar-status",children:[Yn("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==n?`${g}: ${n}%`:g}),a||m||r?null:i?Yn(Xl,{numUploads:u,complete:d,totalUploadedSize:p,totalSize:c,totalETA:h,i18n:t}):Yn(Yl,{i18n:t,complete:d,numUploads:u}),m?Yn(Ql,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function Zl(e){const{i18n:t}=e;return Yn("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:Yn("div",{className:"uppy-StatusBar-status",children:Yn("div",{className:"uppy-StatusBar-statusPrimary",children:[Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:Yn("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function eu(e){const{error:t,i18n:i,complete:n,numUploads:r}=e;return Yn("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[Yn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:Yn("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"})}),Yn("div",{className:"uppy-StatusBar-status",children:[Yn("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),Yn("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${i("uploadFailed")} \n\n ${t}`;alert(e)},type:"button",children:"?"})]}),Yn(Yl,{i18n:i,complete:n,numUploads:r})]})]})}function tu(e){const t=[];let i,n="indeterminate";for(const{progress:r}of Object.values(e)){const{preprocess:e,postprocess:o}=r;null==i&&(e||o)&&({mode:n,message:i}=e||o),"determinate"===e?.mode&&t.push(e.value),"determinate"===o?.mode&&t.push(o.value)}return{mode:n,message:i,value:t.reduce((e,i)=>e+i/t.length,0)}}const{STATE_ERROR:iu,STATE_WAITING:nu,STATE_PREPROCESSING:ru,STATE_UPLOADING:ou,STATE_POSTPROCESSING:su,STATE_COMPLETE:au}=jl;function lu({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:n,resumableUploads:r,error:o,hideUploadButton:s,hidePauseResumeButton:a=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:d,uploadState:p,totalProgress:c,files:h,supportsUploadProgress:f,hideAfterFinish:m=!1,isSomeGhost:g,doneButtonHandler:y,isUploadStarted:v,i18n:b,startUpload:w,uppy:P,isAllComplete:_,hideProgressDetails:F,numUploads:S,complete:C,totalSize:k,totalETA:T,totalUploadedSize:O}){const A=function(){switch(p){case su:case ru:{const e=tu(h);return"determinate"===e.mode?100*e.value:c}case iu:return null;case ou:return f?c:null;default:return c}}(),E=null!=A?A:100,U=!o&&e&&(!i&&!n||d)&&t&&!s,I=!l&&p!==nu&&p!==au,x=r&&!a&&p===ou,N=o&&!_&&!u,D=y&&p===au,R=gr("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(p){case su:case ru:{const{mode:e}=tu(h);return"indeterminate"===e}case ou:return!f;default:return!1}}()}),M=gr("uppy-StatusBar",`is-${p}`,{"has-ghosts":g}),B=(()=>{switch(p){case ru:case su:return Yn(Kl,{progress:tu(h)});case au:return Yn(Zl,{i18n:b});case iu:return Yn(eu,{error:o,i18n:b,numUploads:S,complete:C});case ou:return Yn(Jl,{i18n:b,supportsUploadProgress:f,totalProgress:c,hideProgressDetails:F,isUploadStarted:v,isAllComplete:_,isAllPaused:n,newFiles:e,numUploads:S,complete:C,totalUploadedSize:O,totalSize:k,totalETA:T,startUpload:w});default:return null}})();return!(U||N||x||I||D)&&!B||p===au&&m?null:Yn("div",{className:M,children:[Yn("div",{className:R,style:{width:`${E}%`},role:"progressbar","aria-label":`${E}%`,"aria-valuetext":`${E}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":A}),B,Yn("div",{className:"uppy-StatusBar-actions",children:[U?Yn($l,{newFiles:e,isUploadStarted:v,recoveredState:d,i18n:b,isSomeGhost:g,startUpload:w,uploadState:p}):null,N?Yn(ql,{i18n:b,uppy:P}):null,x?Yn(Vl,{isAllPaused:n,i18n:b,isAllComplete:_,resumableUploads:r,uppy:P}):null,I?Yn(Hl,{i18n:b,uppy:P}):null,D?Yn(Wl,{i18n:b,doneButtonHandler:y}):null]})]})}function uu(e,t,i,n){if(e)return jl.STATE_ERROR;if(t)return jl.STATE_COMPLETE;if(i)return jl.STATE_WAITING;let r=jl.STATE_WAITING;const o=Object.keys(n);for(let e=0;e<o.length;e++){const{progress:t}=n[o[e]];if(t.uploadStarted&&!t.uploadComplete)return jl.STATE_UPLOADING;t.preprocess&&(r=jl.STATE_PREPROCESSING),t.postprocess&&r!==jl.STATE_PREPROCESSING&&(r=jl.STATE_POSTPROCESSING)}return r}
2var du=u("lastUpdateTime"),pu=u("previousUploadedBytes"),cu=u("previousSpeed"),hu=u("previousETA"),fu=u("onUploadStart"),mu=u("computeSmoothETA");let gu=function(e){function t(...t){var i;return i=e.call.apply(e,[this].concat(t))||this,Object.defineProperty(i,mu,{value:yu}),Object.defineProperty(i,du,{writable:!0,value:void 0}),Object.defineProperty(i,pu,{writable:!0,value:void 0}),Object.defineProperty(i,cu,{writable:!0,value:void 0}),Object.defineProperty(i,hu,{writable:!0,value:void 0}),Object.defineProperty(i,fu,{writable:!0,value:()=>{const{recoveredState:e}=i.props.uppy.getState();l(i,cu)[cu]=null,l(i,hu)[hu]=null,e?l(i,pu)[pu]=Object.values(e.files).reduce((e,{progress:t})=>e+(t.bytesUploaded||0),0):(l(i,du)[du]=performance.now(),l(i,pu)[pu]=0)}}),i.startUpload=()=>{const{recoveredState:e}=i.props.uppy.getState();e?i.props.uppy.emit("restore-confirmed"):i.props.uppy.upload().catch(()=>{})},i}s(t,e);var i=t.prototype;return i.componentDidMount=function(){l(this,du)[du]=performance.now(),l(this,pu)[pu]=this.props.uppy.getFiles().reduce((e,t)=>e+(t.progress.bytesUploaded||0),0),this.props.uppy.on("upload",l(this,fu)[fu])},i.componentWillUnmount=function(){this.props.uppy.off("upload",l(this,fu)[fu])},i.render=function(){const{capabilities:e,files:t,allowNewUpload:i,totalProgress:n,error:r,recoveredState:o}=this.props.uppy.getState(),{newFiles:s,startedFiles:a,completeFiles:u,isUploadStarted:d,isAllComplete:p,isAllPaused:c,isUploadInProgress:h,isSomeGhost:f}=this.props.uppy.getObjectOfFilesPerState(),m=o?Object.values(t):s,g=!!e.resumableUploads,y=!1!==e.uploadProgress;let v=null,b=0;a.every(e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal)?(v=0,a.forEach(e=>{v+=e.progress.bytesTotal||0,b+=e.progress.bytesUploaded||0})):a.forEach(e=>{b+=e.progress.bytesUploaded||0});const w=l(this,mu)[mu]({uploaded:b,total:v});return Yn(lu,{error:r,uploadState:uu(r,p,o,t||{}),allowNewUpload:i,totalProgress:n,totalSize:v,totalUploadedSize:b,isAllComplete:p,isAllPaused:c,isUploadStarted:d,isUploadInProgress:h,isSomeGhost:f,recoveredState:o,complete:u.length,newFiles:m.length,numUploads:a.length,totalETA:w,files:t,i18n:this.props.i18n,uppy:this.props.uppy,startUpload:this.startUpload,doneButtonHandler:this.props.doneButtonHandler,resumableUploads:g,supp
2ortsUploadProgress:y,hideProgressDetails:this.props.hideProgressDetails,hideUploadButton:this.props.hideUploadButton,hideRetryButton:this.props.hideRetryButton,hidePauseResumeButton:this.props.hidePauseResumeButton,hideCancelButton:this.props.hideCancelButton,hideAfterFinish:this.props.hideAfterFinish})},r(t)}(Cn);function yu(e){var t;if(null==e.total||0===e.total)return null;const i=e.total-e.uploaded;if(i<=0)return null;l(this,du)[du]??=performance.now();const n=performance.now()-l(this,du)[du];var r;if(0===n)return Math.round((null!=(r=l(this,hu)[hu])?r:0)/100)/10;if(null==l(this,pu)[pu])return l(this,pu)[pu]=e.uploaded,null;const o=e.uploaded-l(this,pu)[pu];var s;if(l(this,pu)[pu]=e.uploaded,o<=0)return Math.round((null!=(s=l(this,hu)[hu])?s:0)/100)/10;const a=o/n;if(!Number.isFinite(a)||a<=0)return null;const u=null==l(this,cu)[cu]?a:Ll(a,l(this,cu)[cu],2e3,n);if(!Number.isFinite(u)||u<=0)return null;l(this,cu)[cu]=u;const d=i/u;if(!Number.isFinite(d)||d<0)return null;const p=Math.max((null!=(t=l(this,hu)[hu])?t:0)-n,0),c=null==l(this,hu)[hu]?d:Ll(d,p,2e3,n);return!Number.isFinite(c)||c<0?null:(l(this,hu)[hu]=c,l(this,du)[du]=performance.now(),Math.round(c/100)/10)}const vu={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",uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",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}",dataUploadedOfUnknown:"%{complete} of unknown",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",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}},bu=['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
2([tabindex^="-"]):not([inert]):not([aria-hidden])'];function wu(e,t){if(t){const i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function Pu(e,t){const i=t[0];i&&(i.focus(),e.preventDefault())}function _u(e,t,i){const n=wu(i,t),r=Va(n.querySelectorAll(bu)),o=r.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(n)?Pu(e,r):e.shiftKey&&0===o?function(e,t){const i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,r):e.shiftKey||o!==r.length-1||Pu(e,r)}function Fu(){const e={};return e.promise=new Promise((t,i)=>{e.resolve=t,e.reject=i}),e}const Su={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:as,showLinkToFileUploadResult:!1,hideProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550};var Cu=u("disabledNodes"),ku=u("generateLargeThumbnailIfSingleFile"),Tu=u("openFileEditorWhenFilesAdded"),Ou=u("attachRenderFunctionToTarget"),Au=u("isTargetSupported"),Eu=u("getAcquirers"),Uu=u("getProgressIndicators"),Iu=u("getEditors"),xu=u("addSpecifiedPluginsFromOptions"),Nu=u("autoDiscoverPlugins"),Du=u("addSupportedPluginIfNoTarget"),Ru=u("getThumbnailGeneratorOpts"),Mu=u("getThumbnailGeneratorId");let Bu=function(e){function t(t,i){var n,r;const o=null!=(n=i?.autoOpen)?n:null;return r=e.call(this,t,{...Su,...i,autoOpen:o})||this,Object.defineProperty(r,Mu,{value:ju}),Object.defineProperty(r,Ru,{value:Lu}),Object.defineProperty(r,Cu,{writable:!0,value:void 0}),r.modalName=`uppy-Dashboard-${Qt()}`,r.superFocus=function(){let e=!1;return yr((t,i)=>{const n=wu(t,i),r=n.contains(document.activeElement);if(r&&e)return;const o=n.querySelector("[data-uppy-super-focusable]");if(!r||o)if(o)o.focus({preventScroll:!0}),e=!0;else{const t=n.querySelector(bu);t?.focus({preventScroll:!0}),e=!1}},260)}(),r.ifFocusedOnUppyRecently=!1,r.dashboardIsDisabled=void 0,r.savedScrollPosition=void 0,r.savedActiveElement=void 0,r.resizeObserver=void 0,r.darkModeMediaQuery=void 0,r.makeDashboardInsidesVisibleAnywayTimeout=void 0,r.removeTarget=e=>{const t=r.getPluginState().targets.filter(t=>t.id!==e.id);r.setPluginState({targets:t})},r.addTarget=e=>{const t=e.id||e.constructor.name,i=e.title||t,n=e.type;if("acquirer"!==n&&"progressindicator"!==n&&"editor"!==n){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return r.uppy.log(e,"error"),null}const o={id:t,name:i,type:n},s=r.getPluginState().targets.slice();return s.push(o),r.setPluginState({targets:s}),r.el},r.hideAllPanels=()=>{const e=r.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||(r.setPluginState(t),r.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))},r.showPanel=e=>{const{targets:t}=r.getPluginState(),i=t.find(t=>"acquirer"===t.type&&t.id===e);r.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),r.uppy.emit("dashboard:show-panel",e)},r.canEditFile=e=>{const{targets:t}=r.getPluginState();return l(r,Iu)[Iu](t).some(t=>r.uppy.getPlugin(t.id).canEditFile(e))},r.openFileEditor=e=>{const{targets:t}=r.getPluginState(),i=l(r,Iu)[Iu](t);r.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}
2),i.forEach(t=>{r.uppy.getPlugin(t.id).selectFile(e)})},r.closeFileEditor=()=>{const{metaFields:e}=r.getPluginState();e&&e.length>0?r.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):r.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},r.saveFileEditor=()=>{const{targets:e}=r.getPluginState();l(r,Iu)[Iu](e).forEach(e=>{r.uppy.getPlugin(e.id).save()}),r.closeFileEditor()},r.openModal=()=>{const{promise:e,resolve:t}=Fu();if(r.savedScrollPosition=window.pageYOffset,r.savedActiveElement=document.activeElement,r.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),r.opts.animateOpenClose&&r.getPluginState().isClosing){const e=()=>{r.setPluginState({isHidden:!1}),r.el.removeEventListener("animationend",e,!1),t()};r.el.addEventListener("animationend",e,!1)}else r.setPluginState({isHidden:!1}),t();return r.opts.browserBackButtonClose&&r.updateBrowserHistory(),document.addEventListener("keydown",r.handleKeyDownInModal),r.uppy.emit("dashboard:modal-open"),e},r.closeModal=e=>{var t;const i=null==(t=e?.manualClose)||t,{isHidden:n,isClosing:o}=r.getPluginState();if(n||o)return;const{promise:s,resolve:a}=Fu();if(r.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),r.opts.animateOpenClose){r.setPluginState({isClosing:!0});const e=()=>{r.setPluginState({isHidden:!0,isClosing:!1}),r.superFocus.cancel(),r.savedActiveElement.focus(),r.el.removeEventListener("animationend",e,!1),a()};r.el.addEventListener("animationend",e,!1)}else r.setPluginState({isHidden:!0}),r.superFocus.cancel(),r.savedActiveElement.focus(),a();return document.removeEventListener("keydown",r.handleKeyDownInModal),i&&r.opts.browserBackButtonClose&&history.state?.[r.modalName]&&history.back(),r.uppy.emit("dashboard:modal-closed"),s},r.isModalOpen=()=>!r.getPluginState().isHidden||!1,r.requestCloseModal=()=>r.opts.onRequestCloseModal?r.opts.onRequestCloseModal():r.closeModal(),r.setDarkModeCapability=e=>{const{capabilities:t}=r.uppy.getState();r.uppy.setState({capabilities:{...t,darkMode:e}})},r.handleSystemDarkModeChange=e=>{const t=e.matches;r.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),r.setDarkModeCapability(t)},r.toggleFileCard=(e,t)=>{const i=r.uppy.getFile(t);e?r.uppy.emit("dashboard:file-edit-start",i):r.uppy.emit("dashboard:file-edit-complete",i),r.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},r.toggleAddFilesPanel=e=>{r.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},r.addFiles=e=>{const t=e.map(e=>({source:r.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}}));try{r.uppy.addFiles(t)}catch(e){r.uppy.log(e)}},r.startListeningToResize=()=>{r.resizeObserver=new ResizeObserver(e=>{const t=e[0],{width:i,height:n}=t.contentRect;r.setPluginState({containerWidth:i,containerHeight:n,areInsidesReadyToBeVisible:!0})}),r.resizeObserver.observe(r.el.querySelector(".uppy-Dashboard-inner")),r.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const e=r.getPluginState(),t=!r.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(r.uppy.log("[Dashboard] resize event didnât fire on time: defaulted to mobile layout","warning"),r.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},r.stopListeningToResize=()=>{r.resizeObserver.disconnect(),clearTimeout(r.makeDashboardInsidesVisibleAnywayTimeout)},r.recordIfFocusedOnUppyRecently=e=>{r.el.contains(e.target)?r.ifFocusedOnUppyRecently=!0:(r.ifFocusedOnUppyRecently=!1,r.superFocus.cancel())},r.disableInteractiveElements=e=>{var t;const i=null!=(t=l(r,Cu)[Cu])?t:Va(r.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter(e=>!e.classList.contains("uppy-Dashboard-close"));for(const t of i)"A"===t.tagName?t.setAttribute("aria-disabled",e):t.disabled=e;l(r,Cu)[Cu]=e?i:null,r.dashboardIsDisabled=e},r.updateBrowserHistory=()=>{history.state?.[r.modalName]||history.pushState({...history.state,[r.modalName]:!0},""),window.addEventListener("popstate",r.handlePopState,!1)},r.handlePopState=e=>
2{!r.isModalOpen()||e.state&&e.state[r.modalName]||r.closeModal({manualClose:!1}),!r.isModalOpen()&&e.state?.[r.modalName]&&history.back()},r.handleKeyDownInModal=e=>{27===e.keyCode&&r.requestCloseModal(),9===e.keyCode&&_u(e,r.getPluginState().activeOverlayType,r.el)},r.handleClickOutside=()=>{r.opts.closeModalOnClickOutside&&r.requestCloseModal()},r.handlePaste=e=>{r.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)});const t=Va(e.clipboardData.files);t.length>0&&(r.uppy.log("[Dashboard] Files pasted"),r.addFiles(t))},r.handleInputChange=e=>{e.preventDefault();const t=Va(e.currentTarget.files||[]);t.length>0&&(r.uppy.log("[Dashboard] Files selected through input"),r.addFiles(t))},r.handleDragOver=e=>{e.preventDefault(),e.stopPropagation();const t=(()=>{let t=!0;return r.uppy.iteratePlugins(i=>{i.canHandleRootDrop?.(e)&&(t=!0)}),t})(),i=(()=>{const{types:t}=e.dataTransfer;return t.some(e=>"Files"===e)})();!t&&!i||r.opts.disabled||r.opts.disableLocalFiles&&(i||!t)||!r.uppy.getState().allowNewUpload?e.dataTransfer.dropEffect="none":(e.dataTransfer.dropEffect="copy",r.setPluginState({isDraggingOver:!0}),r.opts.onDragOver(e))},r.handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),r.setPluginState({isDraggingOver:!1}),r.opts.onDragLeave(e)},r.handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),r.setPluginState({isDraggingOver:!1}),r.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)});let t=!1;r.uppy.log("[Dashboard] Processing dropped files");const i=await async function(e,t){var i;const n=null!=(i=t?.logDropError)?i:Function.prototype;try{const t=[];for await(const i of async function*(e,t){const i=await Promise.all(Array.from(e.items,async e=>{let i;return i??=Ga("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),{fileSystemHandle:i,lastResortFile:e.getAsFile()}}));for(const{lastResortFile:e,fileSystemHandle:n}of i)if(null!=n)try{yield*Ka(n,"",e)}catch(i){null!=e?yield e:t(i)}else null!=e&&(yield e)}(e,n))t.push(i);return t}catch{return function(e){const t=Va(e.files);return Promise.resolve(t)}(e)}}(e.dataTransfer,{logDropError:e=>{r.uppy.log(e,"error"),t||(r.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(r.uppy.log("[Dashboard] Files dropped"),r.addFiles(i)),r.opts.onDrop(e)}
2,r.handleRequestThumbnail=e=>{r.opts.waitForThumbnailsBeforeUpload||r.uppy.emit("thumbnail:request",e)},r.handleCancelThumbnail=e=>{r.opts.waitForThumbnailsBeforeUpload||r.uppy.emit("thumbnail:cancel",e)},r.handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||_u(e,t,i)}(e,r.getPluginState().activeOverlayType,r.el)},r.handlePasteOnBody=e=>{r.el.contains(document.activeElement)&&r.handlePaste(e)},r.handleComplete=({failed:e})=>{r.opts.closeAfterFinish&&!e?.length&&r.requestCloseModal()},Object.defineProperty(r,ku,{writable:!0,value:()=>{if(r.opts.disableThumbnailGenerator)return;const e=r.uppy.getFiles();if(1===e.length){const t=r.uppy.getPlugin(`${r.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});const i={...e[0],preview:void 0};t?.requestThumbnail(i).then(()=>{t?.setOptions({thumbnailWidth:r.opts.thumbnailWidth})})}}}),Object.defineProperty(r,Tu,{writable:!0,value:e=>{const t=e[0],{metaFields:i}=r.getPluginState(),n=i&&i.length>0,o=r.canEditFile(t);n&&"metaEditor"===r.opts.autoOpen?r.toggleFileCard(!0,t.id):o&&"imageEditor"===r.opts.autoOpen&&r.openFileEditor(t)}}),r.initEvents=()=>{if(r.opts.trigger&&!r.opts.inline){const e=Xa(r.opts.trigger);e?e.forEach(e=>e.addEventListener("click",r.openModal)):r.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openM
2odal()` method yourself","warning")}r.startListeningToResize(),document.addEventListener("paste",r.handlePasteOnBody),r.uppy.on("plugin-added",l(r,Du)[Du]),r.uppy.on("plugin-remove",r.removeTarget),r.uppy.on("file-added",r.hideAllPanels),r.uppy.on("dashboard:modal-closed",r.hideAllPanels),r.uppy.on("complete",r.handleComplete),r.uppy.on("files-added",l(r,ku)[ku]),r.uppy.on("file-removed",l(r,ku)[ku]),document.addEventListener("focus",r.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",r.recordIfFocusedOnUppyRecently,!0),r.opts.inline&&r.el.addEventListener("keydown",r.handleKeyDownInInline),r.opts.autoOpen&&r.uppy.on("files-added",l(r,Tu)[Tu])},r.removeEvents=()=>{const e=Xa(r.opts.trigger);!r.opts.inline&&e&&e.forEach(e=>e.removeEventListener("click",r.openModal)),r.stopListeningToResize(),document.removeEventListener("paste",r.handlePasteOnBody),window.removeEventListener("popstate",r.handlePopState,!1),r.uppy.off("plugin-added",l(r,Du)[Du]),r.uppy.off("plugin-remove",r.removeTarget),r.uppy.off("file-added",r.hideAllPanels),r.uppy.off("dashboard:modal-closed",r.hideAllPanels),r.uppy.off("complete",r.handleComplete),r.uppy.off("files-added",l(r,ku)[ku]),r.uppy.off("file-removed",l(r,ku)[ku]),document.removeEventListener("focus",r.recordIfFocusedOnUppyRecently,!0),document.removeEventListener("click",r.recordIfFocusedOnUppyRecently,!0),r.opts.inline&&r.el.removeEventListener("keydown",r.handleKeyDownInInline),r.opts.autoOpen&&r.uppy.off("files-added",l(r,Tu)[Tu])},r.superFocusOnEachUpdate=()=>{const e=r.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===r.uppy.getState().info.length,n=!r.opts.inline;i&&(n||e||t&&r.ifFocusedOnUppyRecently)?r.superFocus(r.el,r.getPluginState().activeOverlayType):r.superFocus.cancel()},r.afterUpdate=()=>{!r.opts.disabled||r.dashboardIsDisabled?(!r.opts.disabled&&r.dashboardIsDisabled&&r.disableInteractiveElements(!1),r.superFocusOnEachUpdate()):r.disableInteractiveElements(!0)},r.saveFileCard=(e,t)=>{r.uppy.setFileMeta(t,e),r.toggleFileCard(!1,t)},Object.defineProperty(r,Ou,{writable:!0,value:e=>{const t=r.uppy.getPlugin(e.id);return{...e,icon:t.icon||r.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(r,Au,{writable:!0,value:e=>{const t=r.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(r,Eu,{writable:!0,value:e=>e.filter(e=>"acquirer"===e.type&&l(r,Au)[Au](e)).map(l(r,Ou)[Ou])}),Object.defineProperty(r,Uu,{writable:!0,value:e=>e.filter(e=>"progressindicator"===e.type).map(l(r,Ou)[Ou])}),Object.defineProperty(r,Iu,{writable:!0,value:e=>e.filter(e=>"editor"===e.type).map(l(r,Ou)[Ou])}),r.render=e=>{const t=r.getPluginState(),{files:i,capabilities:n,allowNewUpload:o}=e,{newFiles:s,uploadStartedFiles:a,completeFiles:u,erroredFiles:d,inProgressFiles:p,inProgressNotPausedFiles:c,processingFiles:h,isUploadStarted:f,isAllComplete:m,isAllPaused:g}=r.uppy.getObjectOfFilesPerState(),y=l(r,Eu)[Eu](t.targets),v=l(r,Uu)[Uu](t.targets),b=l(r,Iu)[Iu](t.targets);let w;return w="auto"===r.opts.theme?n.darkMode?"dark":"light":r.opts.theme,["files","folders","both"].indexOf(r.opts.fileManagerSelectionType)<0&&(r.opts.fileManagerSelectionType="files"),function(e){const t=0===e.totalFileCount,i=1===e.totalFileCount,n=e.containerWidth>576,r=e.containerHeight>330,o=gr({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&r});let s=1;e.containerWidth>900?s=5:e.containerWidth>700?s=4:e.containerWidth>576&&(s=3);const a=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter(t=>e.files[t].isGhost).length:0;return Yn("div",{className:o,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&Ya(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[Yn("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),Yn("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:Yn("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:Yn("span",{"aria-hidden":"true",children:"Ã"})}),Yn("div",{className:"uppy-Dashboard-innerWrap",children:[Yn("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),a&&Yn(Rl,{...e}),null!=l&&l>0&&Yn("div",{className:"uppy-Dashboard-serviceMsg",children:[Yn("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:Yn("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[Yn("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"}),Yn("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),Yn("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),Yn("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),Yn("div",{className:"uppy-Dashboard-serviceMsg-text",children:u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles")})]}),a?Yn(Sl,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbn
2ail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:s,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):Yn(Qa,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),Yn(Bl,{children:e.showAddFilesPanel?Yn(Ja,{...e,isSizeMD:n},"AddFiles"):null}),Yn(Bl,{children:e.fileCardFor?Yn(rl,{...e},"FileCard"):null}),Yn(Bl,{children:e.activePickerPanel?Yn(Il,{...e},"Picker"):null}),Yn(Bl,{children:e.showFileEditor?Yn(Za,{...e},"Editor"):null}),Yn("div",{className:"uppy-Dashboard-progressindicators",children:[!e.disableInformer&&Yn(Ul,{uppy:e.uppy}),!e.disableStatusBar&&Yn(gu,{uppy:e.uppy,i18n:e.i18n,hideProgressDetails:e.hideProgressDetails,hideUploadButton:e.hideUploadButton,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,hideAfterFinish:e.hideProgressAfterFinish,doneButtonHandler:e.doneButtonHandler}),!e.disableInformer&&Yn(Ul,{uppy:e.uppy}),e.progressindicators.map(t=>e.uppy.getPlugin(t.id).render(e.state))]})]})]})]})}({state:e,isHidden:t.isHidden,files:i,newFiles:s,uploadStartedFiles:a,completeFiles:u,erroredFiles:d,inProgressFiles:p,inProgressNotPausedFiles:c,processingFiles:h,isUploadStarted:f,isAllComplete:m,isAllPaused:g,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:o,acquirers:y,theme:w,disabled:r.opts.disabled,disableLocalFiles:r.opts.disableLocalFiles,direction:r.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:r.saveFileEditor,closeFileEditor:r.closeFileEditor,disableInteractiveElements:r.disableInteractiveElements,animateOpenClose:r.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:v,editors:b,autoProceed:r.uppy.opts.autoProceed,id:r.id,closeModal:r.requestCloseModal,handleClickOutside:r.handleClickOutside,handleInputChange:r.handleInputChange,handlePaste:r.handlePaste,inline:r.opts.inline,showPanel:r.showPanel,hideAllPanels:r.hideAllPanels,i18n:r.i18n,i18nArray:r.i18nArray,uppy:r.uppy,note:r.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:n.resumableUploads||!1,individualCancellation:n.individualCancellation,isMobileDevice:n.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:r.toggleFileCard,toggleAddFilesPanel:r.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:r.saveFileCard,openFileEditor:r.openFileEditor,canEditFile:r.canEditFile,width:r.opts.width,height:r.opts.height,showLinkToFileUploadResult:r.opts.showLinkToFileUploadResult,fileManagerSelectionType:r.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:r.opts.proudlyDisplayPoweredByUppy,showRemoveButtonAfterComplete:r.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,parentElement:r.el,allowedFileTypes:r.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:r.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:r.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:r.opts.showSelectedFiles,showNativePhotoCameraButton:r.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:r.opts.showNativeVideoCameraButton,nativeCameraFacingMode:r.opts.nativeCameraFacingMode,singleFileFullScreen:r.opts.singleFileFullScreen,handleRequestThumbn
2ail:r.handleRequestThumbnail,handleCancelThumbnail:r.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:r.handleDragOver,handleDragLeave:r.handleDragLeave,handleDrop:r.handleDrop,disableInformer:r.opts.disableInformer,disableStatusBar:r.opts.disableStatusBar,hideProgressDetails:r.opts.hideProgressDetails,hideUploadButton:r.opts.hideUploadButton,hideRetryButton:r.opts.hideRetryButton,hidePauseResumeButton:r.opts.hidePauseResumeButton,hideCancelButton:r.opts.hideCancelButton,hideProgressAfterFinish:r.opts.hideProgressAfterFinish,doneButtonHandler:r.opts.doneButtonHandler})},Object.defineProperty(r,xu,{writable:!0,value:()=>{const{plugins:e}=r.opts;e.forEach(e=>{const t=r.uppy.getPlugin(e);t?t.mount(r,t):r.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(r,Nu,{writable:!0,value:()=>{r.uppy.iteratePlugins(l(r,Du)[Du])}}),Object.defineProperty(r,Du,{writable:!0,value:e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&(r.getPluginState().targets.some(t=>e.id===t.id)||e.mount(r,e))}}),r.install=()=>{r.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:r.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=r.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:i,allowMultipleUploadBatches:n}=r.uppy.opts;(i||n)&&t&&r.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:o}=r.opts;o&&r.mount(o,r),r.opts.disableThumbnailGenerator||r.uppy.use(Ha,{id:l(r,Mu)[Mu](),...l(r,Ru)[Ru]()}),r.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const s=!!r.darkModeMediaQuery&&r.darkModeMediaQuery.matches;r.uppy.log("[Dashboard] Dark mode is "+(s?"on":"off")),r.setDarkModeCapability(s),"auto"===r.opts.theme&&r.darkModeMediaQuery?.addListener(r.handleSystemDarkModeChange),l(r,xu)[xu](),l(r,Nu)[Nu](),r.initEvents()},r.uninstall=()=>{if(!r.opts.disableThumbnailGenerator){const e=r.uppy.getPlugin(`${r.id}:ThumbnailGenerator`);e&&r.uppy.removePlugin(e)}const{plugins:e}=r.opts;e.forEach(e=>{const t=r.uppy.getPlugin(e);t&&t.unmount()}),"auto"===r.opts.theme&&r.darkModeMediaQuery?.removeListener(r.handleSystemDarkModeChange),r.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),r.unmount(),r.removeEvents()},r.id=r.opts.id||"Dashboard",r.title="Dashboard",r.type="orchestrator",r.defaultLocale=vu,void 0===r.opts.doneButtonHandler&&(r.opts.doneButtonHandler=()=>{r.uppy.clear(),r.requestCloseModal()}),r.opts.onRequestCloseModal??=()=>r.closeModal(),r.i18nInit(),r}return s(t,e),t.prototype.setOptions=function(t){e.prototype.setOptions.call(this,t),this.uppy.getPlugin(l(this,Mu)[Mu]())?.setOptions(l(this,Ru)[Ru]())},r(t)}(pr);function Lu(){const{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:n,lazy:!n}}function ju(){return`${this.id}:ThumbnailGenerator`}Bu.VERSION="5.1.1";var zu=i(9869);const $u=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
2ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],qu=/^(aria-|data-)/,Hu=e=>Object.fromEntries(Object.entries(e).filter(([e])=>qu.test(e)||$u.includes(e))),Vu=function(e){function t(...t){var i;return(i=e.call.apply(e,[this].concat(t))||this).container=void 0,i.plugin=void 0,i}s(t,e);var i=t.prototype;return i.componentDidMount=function(){this.installPlugin()},i.componentDidUpdate=function(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(function(e,t){const i=Hu(e);return Object.keys(e).some(n=>!Object.hasOwn(i,n)&&e[n]!==t[n])}(this.props,e)){const{uppy:e,...t}={...this.props,target:this.container};this.plugin.setOptions(t)}},i.componentWillUnmount=function(){this.uninstallPlugin()},i.installPlugin=function(){const{uppy:e,...t}={id:"Dashboard",...this.props,inline:!0,target:this.container};e.use(Bu,t),this.plugin=e.getPlugin(t.id)},i.uninstallPlugin=function(e=this.props){const{uppy:t}=e;t.removePlugin(this.plugin)},i.render=function(){return(0,zu.createElement)("div",{className:"uppy-Container",ref:e=>{this.container=e},...Hu(this.props)})},r(t)}(zu.Component);var Wu=u("queue"),Gu=u("running"),Ku=u("concurrency"),Xu=u("paused"),Yu=u("execute"),Qu=u("advance");let Ju=function(){function e(e){Object.defineProperty(this,Qu,{value:ed}),Object.defineProperty(this,Yu,{value:Zu}),Object.defineProperty(this,Wu,{writable:!0,value:[]}),Object.defineProperty(this,Gu,{writable:!0,value:0}),Object.defineProperty(this,Ku,{writable:!0,value:void 0}),Object.defineProperty(this,Xu,{writable:!0,value:!1});const t=e?.concurrency;l(this,Ku)[Ku]="number"!=typeof t||0===t?1/0:t}var t=e.prototype;return t.add=function(e){const t=new AbortController;let i,n;const r=new Promise((e,t)=>
2{i=e,n=t}),o={run:()=>e(t.signal),resolve:i,reject:n,controller:t};return t.signal.addEventListener("abort",()=>{const e=l(this,Wu)[Wu].indexOf(o);var i;-1!==e&&(l(this,Wu)[Wu].splice(e,1),n(null!=(i=t.signal.reason)?i:new DOMException("Aborted","AbortError")))},{once:!0}),r.abort=e=>{t.abort(null!=e?e:new DOMException("Aborted","AbortError"))},r.abortOn=e=>{if(e){const t=()=>r.abort(e.reason);e.addEventListener("abort",t,{once:!0}),r.then(()=>e.removeEventListener("abort",t),()=>e.removeEventListener("abort",t))}return r},!l(this,Xu)[Xu]&&l(this,Gu)[Gu]<l(this,Ku)[Ku]?l(this,Yu)[Yu](o):l(this,Wu)[Wu].push(o),r},t.pause=function(){l(this,Xu)[Xu]=!0},t.resume=function(){l(this,Xu)[Xu]=!1;const e=l(this,Ku)[Ku]-l(this,Gu)[Gu];for(let t=0;t<e;t++)l(this,Qu)[Qu]()},t.clear=function(e){const t=l(this,Wu)[Wu].splice(0),i=null!=e?e:new DOMException("Cleared","AbortError");for(const e of t)e.controller.abort(i),e.reject(i)},t.wrapPromiseFunction=function(e){return(...t)=>this.add(i=>e.apply(void 0,t))},r(e,[{key:"concurrency",get:function(){return l(this,Ku)[Ku]},set:function(e){if(l(this,Ku)[Ku]="number"!=typeof e||0===e?1/0:e,!l(this,Xu)[Xu]){const e=l(this,Ku)[Ku]-l(this,Gu)[Gu];for(let t=0;t<e;t++)l(this,Qu)[Qu]()}}},{key:"pending",get:function(){return l(this,Wu)[Wu].length}},{key:"running",get:function(){return l(this,Gu)[Gu]}},{key:"isPaused",get:function(){return l(this,Xu)[Xu]}}])}();function Zu(e){var t;if(l(this,Gu)[Gu]++,e.controller.signal.aborted)return l(this,Gu)[Gu]--,e.reject(null!=(t=e.controller.signal.reason)?t:new DOMException("Aborted","AbortError")),void l(this,Qu)[Qu]();let i;try{i=e.run()}catch(e){i=Promise.reject(e)}i.then(t=>{var i;e.controller.signal.aborted?e.reject(null!=(i=e.controller.signal.reason)?i:new DOMException("Aborted","AbortError")):e.resolve(t)},t=>{e.reject(t)}).finally(()=>{l(this,Gu)[Gu]--,l(this,Qu)[Qu]()})}function ed(){queueMicrotask(()=>{if(!(l(this,Xu)[Xu]||l(this,Gu)[Gu]>=l(this,Ku)[Ku]))for(;l(this,Wu)[Wu].length>0;){const e=l(this,Wu)[Wu].shift();if(!e.controller.signal.aborted)return void l(this,Yu)[Yu](e)}})}var td=i(6415);const id={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function nd(e,t){let i=t;return i||(i=new Error("Upload error")),"string"==typeof i&&(i=new Error(i)),i instanceof Error||(i=Object.assign(new Error("Upload error"),{data:i})),function(e){return!!e&&4===e.readyState&&0===e.status}(e)?(i=new c.A(i,e),i):(i.request=e,i)}function rd(e){return e.data.slice(0,e.data.size,e.meta.type)}const od={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:""};var sd=u("getFetcher"),ad=u("queue"),ld=u("uploadLocalFile"),ud=u("uploadBundle"),dd=u("getCompanionClientArgs"),pd=u("uploadFiles"),cd=u("handleUpload");let hd=function(e){function t(t,i){var n;if(n=e.call(this,t,{...od,fieldName:i.bundle?"files[]":"file",...i})||this,Object.defineProperty(n,pd,{value:yd}),Object.defineProperty(n,dd,{value:gd}),Object.defineProperty(n,ud,{value:md}),Object.defineProperty(n,ld,{value:fd}),Object.defineProperty(n,sd,{writable:!0,value:void 0}),Object.defineProperty(n,ad,{writable:!0,value:void 0}),n.uploaderEvents=void 0,Object.defineProperty(n,cd,{writable:!0,value:async e=>{if(0===e.length)return void n.uppy.log("[XHRUpload] No files to upload!");0===n.opts.limit&&n.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),n.uppy.log("[XHRUpload] Uploading...");const t=z(n.uppy.getFilesByIds(e)),i=$(t);if(n.uppy.emit("upload-start",i),n.opts.bundle){if(t.some(e=>e.isRemote))throw new Error("Canât upload remote files when the `bundle: true` option is set");if("function"==typeof n.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await l(n,ud)[ud](t)}else await l(n,pd)[pd](t)}}),n.type="uploader",n.id=n.opts.id||"XHRUpload",n.defaultLocale=id,n.i18nInit(),l(n,ad)[ad]=new Ju({concurrency:n.opts.limit}),n.opts.bundle&&!n.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");
2if(n.opts.bundle&&"function"==typeof n.opts.headers)throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(void 0===i?.allowedMetaFields&&"metaFields"in n.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");return n.uploaderEvents=Object.create(null),l(n,sd)[sd]=e=>async(t,i)=>{try{const r=await(0,td.G)(t,{...i,onBeforeRequest:(t,i)=>n.opts.onBeforeRequest?.(t,i,e),shouldRetry:n.opts.shouldRetry,onAfterResponse:n.opts.onAfterResponse,onTimeout:t=>{const i=Math.ceil(t/1e3),r=new Error(n.i18n("uploadStalled",{seconds:i}));n.uppy.emit("upload-stalled",r,e)},onUploadProgress:t=>{if(t.lengthComputable)for(const{id:r}of e){const e=n.uppy.getFile(r);var i;null!=e&&n.uppy.emit("upload-progress",e,{uploadStarted:null!=(i=e.progress.uploadStarted)?i:0,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}}});let o=await(n.opts.getResponseData?.(r));if("json"===r.responseType)o??=r.response;else try{o??=JSON.parse(r.responseText)}catch(e){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:e})}const s="string"==typeof o?.url?o.url:void 0;for(const{id:t}of e)n.uppy.emit("upload-success",n.uppy.getFile(t),{status:r.status,body:o,uploadURL:s});return r}catch(t){if("AbortError"===t.name)return;const i=t.request;for(const r of e)n.uppy.emit("upload-error",n.uppy.getFile(r.id),nd(i,t),i);throw t}},n}s(t,e);var i=t.prototype;return i.getOptions=function(e){const t=this.uppy.getState().xhrUpload,{headers:i}=this.opts,n={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof i?n.headers=i(e):Object.assign(n.headers,this.opts.headers),t&&Object.assign(n.headers,t.headers),e.xhrUpload&&Object.assign(n.headers,e.xhrUpload.headers),n},i.addMetadata=function(e,t,i){de(i.allowedMetaFields,t).forEach(i=>{const n=t[i];Array.isArray(n)?n.forEach(t=>e.append(i,t)):e.append(i,n)})},i.createFormDataUpload=function(e,t){const i=new FormData;this.addMetadata(i,e.meta,t);const n=rd(e);return e.name?i.append(t.fieldName,n,e.meta.name):i.append(t.fieldName,n),i},i.createBundledUpload=function(e,t){const i=new FormData,{meta:n}=this.uppy.getState();return this.addMetadata(i,n,t),e.forEach(e=>{const t=this.getOptions(e),n=rd(e);e.name?i.append(t.fieldName,n,e.name):i.append(t.fieldName,n)}),i},i.install=function(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(l(this,cd)[cd])},i.uninstall=function(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(l(this,cd)[cd])},r(t)}(M);async function fd(e){const t=new j(this.uppy),i=new AbortController;t.onFileRemove(e.id,()=>i.abort()),t.onCancelAll(e.id,()=>i.abort());try{await l(this,ad)[ad].add(async t=>{const n=this.getOptions(e),r=l(this,sd)[sd]([e]),o=n.formData?this.createFormDataUpload(e,n):e.data;return r("string"==typeof n.endpoint?n.endpoint:await n.endpoint(e),{...n,body:o,signal:AbortSignal.any([t,i.signal])})})}catch(e){if("AbortError"===e.name)return;throw e}finally{t.remove()}}async function md(e){const t=new AbortController;function i(){t.abort()}this.uppy.once("cancel-all",i);try{await l(this,ad)[ad].add(async i=>{var n;const r=null!=(n=this.uppy.getState().xhrUpload)?n:{},o=l(this,sd)[sd](e),s=this.createBundledUpload(e,{...this.opts,...r});return o("string"==typeof this.opts.endpoint?this.opts.endpoint:await this.opts.endpoint(e),{...this.opts,body:s,signal:AbortSignal.any([i,t.signal])})})}catch(e){if("AbortError"===e.name)return;throw e}finally{this.uppy.off("cancel-all",i)}}function gd(e){const t=this.getOptions(e),i=de(t.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(i.map(t=>[t,e.meta[t]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function yd(e){await Promise.allSettled(e.map(e=>{if(e.isRemote){const t=()=>l(this,ad)[ad],i=new AbortController,n=t=>{t.id===e.id&&i.abort()};
2return this.uppy.on("file-removed",n),this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,l(this,dd)[dd](e),{signal:i.signal,getQueue:t}).finally(()=>{this.uppy.off("file-removed",n)})}return l(this,ld)[ld](e)}))}hd.VERSION="5.2.0";var vd=i(2109),bd=i(7071),wd=i(5809),Pd=i(8231),_d=i(7399),Fd=i(3002),Sd=i(1897),Cd=i(5549),kd=i(5391),Td=i(6660),Od=i(9698);const Ad=[".doc",".docx",".pdf"];function Ed(e){const t=_d.A.NAMESPACE.get()?`${_d.A.NAMESPACE.get()}/`:"";return`${e.origin}/${t}upload/`}const Ud=e=>[It,{id:vd.Su.AWSS3,...e}],Id=()=>{const{location:e}=(0,zu.useContext)(wd.A);return[Ss,{companionUrl:Ed(e),id:vd.Su.ONEDRIVE}]},xd=()=>{const{location:e}=(0,zu.useContext)(wd.A);return[bs,{companionUrl:Ed(e),id:vd.Su.DROPBOX}]},Nd=e=>[hd,{fieldName:"files",formData:!0,id:vd.Su.XHR,...e}],Dd=()=>{const{dev:e,location:t}=(0,zu.useContext)(wd.A);function i({allowedFileTypes:e,appId:t,companionUrl:i,onCancel:n,onFileSelect:r,setUserInfo:o,userInfo:{email:s,token:a}}){const[l,u]=Or(!1),[d,p]=Or(!1);!function(e,t){var i=Tr(cr++,4);!wr.__s&&Br(i.__H,t)&&(i.__=()=>{(async()=>{try{await(0,bd.k0)("https://apis.google.com/js/api.js","gapi"),u(!0)}catch{u(!1)}})()},i.u=t,hr.__h.push(i))}(0,[]);const c=()=>{p(!0)},h=Ir(async e=>{const t=e.map(async e=>{const t=await fetch(`https://www.googleapis.com/drive/v3/files/${e.id}?fields=thumbnailLink,id`,{headers:{Authorization:`Bearer ${a}`}}),i=await t.json();return{...e,...i}});return Promise.all(t)},[a]),f=e.map(e=>Pd.Wh[e]),m=Ir(()=>{(new window.google.picker.PickerBuilder).addView((new window.google.picker.DocsView).setIncludeFolders(!0).setMimeTypes(Object.values(f).join(","))).setAppId(t).setOAuthToken(a).setLocale("en").setCallback(async e=>{e.action===window.google.picker.Action.PICKED&&r(await h(e.docs)),e.action===window.google.picker.Action.CANCEL&&n()}).enableFeature(window.google.picker.Feature.MULTISELECT_ENABLED).enableFeature(window.google.picker.Feature.SUPPORT_DRIVES).build().setVisible(!0)},[h,a,n,r]);Ar(()=>{const e=e=>{if(e.origin!==window.location.origin)return;const{email:t,token:i}=e.data;i&&t&&o({email:t,token:i})};return window.addEventListener("message",e,!1),()=>{window.removeEventListener("message",e)}},[]);const g=Ir(async()=>{window.gapi.load("picker",{callback:c})},[c]);Ar(()=>{l&&!d&&g()},[d,g,l]);const y=_n("button",{className:"mdc-button",onClick:()=>{o({email:null,token:null}),fetch(`${i}drive/logout`)}},"Log out"),v=_n("div",{className:"google-picker header"},_n("div",{className:"google-picker header-title"},"Google Drive"),_n("div",{className:"google-picker header-actions"},s,y)),b=_n("button",{className:"mdc-button mdc-button--raised picker-dashboard-button",onClick:()=>{window.open(`${i}drive/connect`)}},_n("i",{className:" icon icon--md chevron-right-icon"},null),"Connect to Google Drive"),w=_n("button",{className:"mdc-button mdc-button--raised picker-dashboard-button",onClick:m},_n("i",{className:" icon icon--md add-icon"},null),"Add Files to Upload"),P=a?[v,_n("div",{className:"google-picker container"},w)]:[_n("div",{className:"google-picker container"},b)],_=_n.apply(void 0,["div",{className:"google-picker dashboard"}].concat(P));return _n("div",{className:"google-picker wrapper"},_)}return[function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).onFileSelect=async e=>{for(const t of e)n.uppy.addFile({data:{},isRemote:!0,meta:{relativePath:t.id},name:t.name,preview:t.thumbnailLink,remote:{...t,url:`${n.opts.companionUrl}drive/get/${t.id}`},source:"drive",type:t.mimeType})},n.onCancel=()=>n.uppy.emit("dashboard:modal-closed"),n.setUserInfo=({email:e,token:t})=>{n.uppy.setState({...n.uppy.getState(),plugins:{...n.uppy.getState().plugins,drive:{...n.uppy.getState().plugins.drive,email:e,token:t}}})},n.id=i?.id||"GooglePicker",n.oauthToken={current:null},n}return a()(t,e),t.prototype.render=function(){return _n(i,{allowedFileTypes:this.opts.allowedFileTypes,appId:this.opts.appId,companionUrl:this.opts.companionUrl,developerKey:this.opts.developerKey,onCancel:this.onCancel,onFileSelect:this.onFileSelect,setUserInfo:this.setUserInfo,userInfo:this.uppy.getState().plugins.drive})},o()(t)}(_s),{appId:e?"53443209823":"948740859141",companionUrl:Ed(t),id:vd.Su.GOOGLEDRIVE}]},Rd=e=>{const t={};for(const i of Object.keys(e))e[i].isRemote?t[i]={...e[i],data:new Blob,isRemote:!1,meta:{...e[i].meta,file_id:e[i].remote?.body?.fileId||e[i].remote.id,provider:e[i].source}}:t[i]={...e[i]};return t},Md=({allowedFileTypes:e=Ad,id:t="uppy",meta:i={},onComplete:n=()=>null,onRemove:r=()=>null,onUploadSuccess:o=()=>null,options:s={},plugins:a=[]})=>{const[l,u]=(0,zu.useState)(!1),[d]=(0,zu.useState)(()=>{const i=new en({debug:!1,id:t,restrictions:{allowedFileTypes:e,maxFileSize:16777216,maxNumberOfFiles:!1,minNumberOfFiles:1}});return i.on("complete",e=>{u(!1),n(e)}),i.on("file-removed",e=>{u(!1),r(e)}),i.on("upload-started",()=>{u(!0)}),i.on("upload-success",(e,i)=>{(0,Td.s)(`${t}:file_upload`,{file_count:1,file_extensions:e.name.split(".").pop()}),o(e,i,d)}),i.on("upload-error",(e,t)=>{(0,Td.N)(t)}),i});return(0,zu.useEffect)(()=>{for(const[t,i]of a){const n=d.getPlugin(i?.id),r={...i,allowedFileTypes:e};n?n.setOptions(r||{}):d.use(t,r||{})}},[d,a,e]),(0,zu.useEffect)(()=>{d.setMeta(i)},[d,i]),(0,zu.useEffect)(()=>{d.setOptions(s)},[d,s]),{loading:l,uppy:d}};function Bd({dashboardOptions:e={},disabled:t=!1,initializing:i=!1,loading:n=!1,onClose:r=()=>null,onContinue:o=()=>null,open:s=!1,plugins:a=[],title:l="Add Files",uppy:u}){return(0,Od.FD)(Fd.A,{closeWhenClickOutside:!1,open:s,size:"xxl",onClose:r,children:[(0,Od.Y)(Sd.A,{children:l}),i?(0,Od.Y)(Cd.A,{}
2):(0,Od.Y)(Vu,{showProgressDetails:!0,height:"480px",plugins:a,proudlyDisplayPoweredByUppy:!1,uppy:u,...e}),!t&&!n&&(0,Od.Y)("div",{className:"uppy-buttons",children:(0,Od.Y)(kd.A,{raised:!0,style:{minWidth:"100px"},onClick:o,children:n?(0,Od.Y)(Cd.A,{}):"Continue"})})]})}},4254(e,t,i){var n=i(9325).Symbol;e.exports=n},2552(e,t,i){var n=i(4254),r=i(659),o=i(9350),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?r(e):o(e)}},4128(e,t,i){var n=i(1800),r=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(r,""):e}},4840(e){var t="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},659(e,t,i){var n=i(4254),r=Object.prototype,o=r.hasOwnProperty,s=r.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),i=e[a];try{e[a]=void 0;var n=!0}catch(e){}var r=s.call(e);return n&&(t?e[a]=i:delete e[a]),r}},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9325(e,t,i){var n=i(4840),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();e.exports=o},1800(e){var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},8221(e,t,i){var n=i(3805),r=i(124),o=i(9374),s=Math.max,a=Math.min;e.exports=function(e,t,i){var l,u,d,p,c,h,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var i=l,n=u;return l=u=void 0,f=t,p=e.apply(n,i)}function b(e){var i=e-h;return void 0===h||i>=t||i<0||g&&e-f>=d}function w(){var e=r();if(b(e))return P(e);c=setTimeout(w,function(e){var i=t-(e-h);return g?a(i,d-(e-f)):i}(e))}function P(e){return c=void 0,y&&l?v(e):(l=u=void 0,p)}function _(){var e=r(),i=b(e);if(l=arguments,u=this,h=e,i){if(void 0===c)return function(e){return f=e,c=setTimeout(w,t),m?v(e):p}(h);if(g)return clearTimeout(c),c=setTimeout(w,t),v(h)}return void 0===c&&(c=setTimeout(w,t)),p}return t=o(t)||0,n(i)&&(m=!!i.leading,d=(g="maxWait"in i)?s(o(i.maxWait)||0,t):d,y="trailing"in i?!!i.trailing:y),_.cancel=function(){void 0!==c&&clearTimeout(c),f=0,l=h=u=c=void 0},_.flush=function(){return void 0===c?p:P(r())},_}},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4394(e,t,i){var n=i(2552),r=i(346);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==n(e)}},124(e,t,i){var n=i(9325);e.exports=function(){return n.Date.now()}},7350(e,t,i){var n=i(8221),r=i(3805);e.exports=function(e,t,i){var o=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(i)&&(o="leading"in i?!!i.leading:o,s="trailing"in i?!!i.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}},9374(e,t,i){var n=i(4128),r=i(3805),o=i(4394),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var i=a.test(e);return i||l.test(e)?u(e.slice(2),i?2:8):s.test(e)?NaN:+e}},7057(e,t,i){var n=i(7163),r=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=n(t,e,r);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},6216(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,n,r,o,s,a){var l=function(e){for(var i=t[e]?t[e]:[],n=e.indexOf(":"),r=-1===n?[e]:[e.substring(0,n),e.substring(n+1)],o=Object.keys(t),s=0,a=o.length;s<a;s++){var l=o[s];if("*"===l&&(i=i.concat(t[l])),2===r.length&&r[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var n=0,r=t.length;n<r&&t[n];n++)t[n].event=e,t[n].apply(t[n],i)}(e,l,[i,n,r,o,s,a])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,function n(){i.apply(this,arguments),e.off(t,n)})},e.off=function(e,t){var i=[];if(e&&t)for(var n=this._fns[e],r=0,o=n?n.length:0;r<o;r++)n[r]!==t&&i.push(n[r]);i.length?this._fns[e]=i:delete this._fns[e]},e}},5617(e,t,i){e.exports=i(8303)},8303(e,t,i){var n=i(3961);t.operation=function(e){var i=t.timeouts(e);return new n(i,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],r=0;r<t.retries;r++)n.push(this.createTimeout(r,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(r,t)),n.sort(function(e,t){return e-t}),n},t.createTimeout=function(e,t){var i=t.randomize?Math.random()+1:1,n=Math.round(i*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(n,t.maxTimeout)},t.wrap=function(e,i,n){if(i instanceof Array&&(n=i,i=null),!n)for(var r in n=[],e)"function"==typeof e[r]&&n.push(r);for(var o=0;o<n.length;o++){var s=n[o],a=e[s];e[s]=function(n){var r=t.operation(i),o=Array.prototype.slice.call(arguments,1
2),s=o.pop();o.push(function(e){r.retry(e)||(e&&(arguments[0]=r.mainError()),s.apply(this,arguments))}),r.attempt(function(){n.apply(e,o)})}.bind(e,a),e[s].options=i}}},3961(e){function t(e,t){"boolean"==typeof t&&(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))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.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 i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){this.attempt(e)},t.prototype.start=function(e){this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,n=0;n<this._errors.length;n++){var r=this._errors[n],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=i&&(t=r,i=s)}return t}},7163(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,n=!0,r=this.parts,o=r.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(i=(e||"").split(this.separator),t=0;n&&t<o;t++)"*"!==r[t]&&(n=t<i.length&&r[t]===i[t]);n=n&&i}else n=!1;else if("function"==typeof e.splice)for(n=[],t=e.length;t--;)this.match(e[t])&&(n[n.length]=e[t]);else if("object"==typeof e)for(var s in n={},e)this.match(s)&&(n[s]=e[s]);return n},e.exports=function(e,i,n){var r=new t(e,n||/[\/\.]/);return void 0!==i?r.match(i):r}},889(e,t,i){"use strict";var n=i(4579),r=i(9511);const o=function(e){function t(t,i=null){var n;return(n=e.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.")||this).cause=void 0,n.isNetworkError=void 0,n.request=void 0,n.cause=t,n.isNetworkError=!0,n.request=i,n}return r(t,e),n(t)}(i(1837)(Error));i.d(t,["A",0,o])},6415(e,t,i){"use strict";i.d(t,{G:()=>h});var n=i(889),r=i(4579),o=i(3883),s=i(55),a=s("aliveTimer"),l=s("isDone"),u=s("onTimedOut"),d=s("timeout");const p=function(){function e(e,t){Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:!1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),o(this,d)[d]=e,o(this,u)[u]=()=>t(e)}var t=e.prototype;return t.progress=function(){o(this,l)[l]||o(this,d)[d]>0&&(clearTimeout(o(this,a)[a]),o(this,a)[a]=setTimeout(o(this,u)[u],o(this,d)[d]))},t.done=function(){o(this,l)[l]||(clearTimeout(o(this,a)[a]),o(this,a)[a]=void 0,o(this,l)[l]=!0)},r(e)}(),c=()=>{};function h(e,t={}){const{body:i=null,headers:r={},method:o="GET",onBeforeRequest:s=c,onUploadProgress:a=c,shouldRetry:l=()=>!0,onAfterResponse:u=c,onTimeout:d=c,responseType:h,retries:f=3,signal:m=null,timeout:g=3e4,withCredentials:y=!1}=t,v=e=>.3*2**(e-1)*1e3,b=new p(g,d);return function t(d=0){return new Promise(async(p,c)=>{const g=new XMLHttpRequest,w=e=>{l(g)&&d<f?setTimeout(()=>{t(d+1).then(p,c)},v(d)):(b.done(),c(e))};function P(){g.abort(),c(new DOMException("Aborted","AbortError"))}g.open(o,e,!0),g.withCredentials=y,h&&(g.responseType=h),g.onload=async()=>{try{await u(g,d)}catch(e){return e.request=g,void w(e)}g.status>=200&&g.status<300?(b.done(),p(g)):l(g)&&d<f?setTimeout(()=>{t(d+1).then(p,c)},v(d)):(b.done(),c(new n.A(g.statusText,g)))},g.onerror=()=>w(new n.A(g.statusText,g)),g.upload.onprogress=e=>{b.progress(),a(e)}
2,r&&Object.keys(r).forEach(e=>{g.setRequestHeader(e,r[e])}),m?.addEventListener("abort",P),m?.aborted?P():(await s(g,d),g.send(i))})}()}}}]); 3//# sourceMappingURL=upload.62543e8151.js.map
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.