plutonium 0.26.2 → 0.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +2 -1
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +1 -1
- data/app/assets/plutonium.min.js.map +2 -2
- data/docs/modules/generator.md +1 -1
- data/lib/generators/pu/res/entity/entity_generator.rb +37 -2
- data/lib/generators/pu/rodauth/customer_generator.rb +0 -2
- data/lib/plutonium/ui/form/components/uppy.rb +2 -1
- data/lib/plutonium/ui/form/resource.rb +26 -0
- data/lib/plutonium/ui/layout/basic_layout.rb +15 -0
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/src/js/controllers/attachment_input_controller.js +2 -1
- metadata +3 -2
data/app/assets/plutonium.min.js
CHANGED
@@ -94,7 +94,7 @@ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSI
|
|
94
94
|
${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("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"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),u(Hm,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:jm,STATE_WAITING:kS,STATE_PREPROCESSING:Qu,STATE_UPLOADING:Xa,STATE_POSTPROCESSING:Ju,STATE_COMPLETE:Ya}=It;function th(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:o,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:f,uploadState:y,totalProgress:v,files:x,supportsUploadProgress:P,hideAfterFinish:F=!1,isSomeGhost:R,doneButtonHandler:D=void 0,isUploadStarted:V,i18n:M,startUpload:$,uppy:z,isAllComplete:G,showProgressDetails:K=void 0,numUploads:Q,complete:ne,totalSize:Y,totalETA:re,totalUploadedSize:le}=i;function ke(){switch(y){case Ju:case Qu:{let He=Kn(x);return He.mode==="determinate"?He.value*100:v}case jm:return null;case Xa:return P?v:null;default:return v}}function We(){switch(y){case Ju:case Qu:{let{mode:He}=Kn(x);return He==="indeterminate"}case Xa:return!P;default:return!1}}let T=ke(),k=T??100,A=!o&&e&&(!r&&!s||f)&&t&&!a,H=!c&&y!==kS&&y!==Ya,j=n&&!l&&y===Xa,U=o&&!G&&!d,J=D&&y===Ya,ee=(0,eh.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),Ae=(0,eh.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":R}),oe=(()=>{switch(y){case Qu:case Ju:return u(zm,{progress:Kn(x)});case Ya:return u(qm,{i18n:M});case jm:return u(Vm,{error:o,i18n:M,numUploads:Q,complete:ne});case Xa:return u($m,{i18n:M,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:V,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:Q,complete:ne,totalUploadedSize:le,totalSize:Y,totalETA:re,startUpload:$});default:return null}})();return!(A||U||j||H||J)&&!oe||y===Ya&&F?null:u("div",{className:Ae},u("div",{className:ee,style:{width:`${k}%`},role:"progressbar","aria-label":`${k}%`,"aria-valuetext":`${k}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T}),oe,u("div",{className:"uppy-StatusBar-actions"},A?u(Mm,{newFiles:e,isUploadStarted:V,recoveredState:f,i18n:M,isSomeGhost:R,startUpload:$,uploadState:y}):null,U?u(Im,{i18n:M,uppy:z}):null,j?u(Nm,{isAllPaused:s,i18n:M,isAllComplete:G,resumableUploads:n,uppy:z}):null,H?u(Dm,{i18n:M,uppy:z}):null,J?u(Bm,{i18n:M,doneButtonHandler:D}):null))}var Wm={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",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",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Oe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var AS=0;function Bs(i){return"__private_"+AS+++"_"+i}var PS={version:"4.1.2"},CS=2e3,FS=2e3;function _S(i,e,t,r){if(i)return It.STATE_ERROR;if(e)return It.STATE_COMPLETE;if(t)return It.STATE_WAITING;let s=It.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return It.STATE_UPLOADING;a.preprocess&&(s=It.STATE_PREPROCESSING),a.postprocess&&s!==It.STATE_PREPROCESSING&&(s=It.STATE_POSTPROCESSING)}return s}var OS={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Xt=Bs("lastUpdateTime"),pi=Bs("previousUploadedBytes"),Wi=Bs("previousSpeed"),Dt=Bs("previousETA"),ih=Bs("computeSmoothETA"),Xn=Bs("onUploadStart"),Xr=class extends di{constructor(e,t){super(e,{...OS,...t}),Object.defineProperty(this,ih,{value:RS}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,Wi,{writable:!0,value:void 0}),Object.defineProperty(this,Dt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Xn,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Oe(this,Wi)[Wi]=null,Oe(this,Dt)[Dt]=null,r){Oe(this,pi)[pi]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Oe(this,Xt)[Xt]=performance.now(),Oe(this,pi)[pi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Wm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:o,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:f,isAllComplete:y,isAllPaused:v,isUploadInProgress:x,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),F=a?Object.values(r):l,R=!!t.resumableUploads,D=t.uploadProgress!==!1,V=null,M=0;c.every(z=>z.progress.bytesTotal!=null&&z.progress.bytesTotal!==0)?(V=0,c.forEach(z=>{V+=z.progress.bytesTotal||0,M+=z.progress.bytesUploaded||0})):c.forEach(z=>{M+=z.progress.bytesUploaded||0});let $=Oe(this,ih)[ih]({uploaded:M,total:V});return th({error:o,uploadState:_S(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:V,totalUploadedSize:M,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:x,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:F.length,numUploads:c.length,totalETA:$,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:R,supportsUploadProgress:D,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;Wa(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Oe(this,Xn)[Xn]),Oe(this,Xt)[Xt]=performance.now(),Oe(this,pi)[pi]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Oe(this,Xn)[Xn])}};function RS(i){var e,t;if(i.total==null||i.total===0)return null;let r=i.total-i.uploaded;if(r<=0)return null;(t=(e=Oe(this,Xt))[Xt])!=null||(e[Xt]=performance.now());let s=performance.now()-Oe(this,Xt)[Xt];if(s===0){var n;return Math.round(((n=Oe(this,Dt)[Dt])!=null?n:0)/100)/10}let o=i.uploaded-Oe(this,pi)[pi];if(Oe(this,pi)[pi]=i.uploaded,o<=0){var a;return Math.round(((a=Oe(this,Dt)[Dt])!=null?a:0)/100)/10}let l=o/s,c=Oe(this,Wi)[Wi]==null?l:Ga(l,Oe(this,Wi)[Wi],CS,s);Oe(this,Wi)[Wi]=c;let d=r/c,f=Math.max(Oe(this,Dt)[Dt]-s,0),y=Oe(this,Dt)[Dt]==null?d:Ga(d,f,FS,s);return Oe(this,Dt)[Dt]=y,Oe(this,Xt)[Xt]=performance.now(),Math.round(y/100)/10}Xr.VERSION=PS.version;var Gm=300,Yn=class extends dt{constructor(){super(...arguments),this.ref=xm()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Gm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Gm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function LS(i,e){return Object.assign(i,e)}function MS(i,e){var t;return(t=i?.key)!=null?t:e}function IS(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function Zn(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=MS(i[t],t.toString(36));e[r]=i[t]}return e}function DS(i,e){i=i||{},e=e||{};let t=o=>e.hasOwnProperty(o)?e[o]:i[o],r={},s=[];for(let o in i)e.hasOwnProperty(o)?s.length&&(r[o]=s,s=[]):s.push(o);let n={};for(let o in e){if(r.hasOwnProperty(o))for(let a=0;a<r[o].length;a++){let l=r[o][a];n[r[o][a]]=t(l)}n[o]=t(o)}for(let o=0;o<s.length;o++)n[s[o]]=t(s[o]);return n}var NS=i=>i,Za=class extends dt{constructor(e,t){super(e,t),this.refs={},this.state={children:Zn(xi(xi(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t=Zn(xi(e.children)||[]),r=this.state.children;this.setState(n=>({children:DS(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=Zn(xi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=Zn(xi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=Zn(xi(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=LS({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:f,...y}=e,{children:v}=t,x=Object.entries(v).map(P=>{let[F,R]=P;if(!R)return;let D=IS(this,F);return ja(r(R),{ref:D,key:F})}).filter(Boolean);return u(f,y,x)}};Za.defaultProps={component:"span",childFactory:NS};var Km=Za;var BS={version:"4.2.1"},Yr=class extends di{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(Km,null,r.info.map(s=>u(Yn,{key:s.message},u("p",{role:"alert"},s.message," ",s.details&&u("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
|
95
95
|
|
96
96
|
${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};Yr.VERSION=BS.version;var US=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function zS(i,e,t){var r,s;let n=US.exec(i),o=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text",a;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else n?.[3]!=null&&(a=[decodeURIComponent(n[3])]);return t?new File(a,e.name||"",{type:o}):new Blob(a,{type:o})}var Xm=zS;function Qa(i){return i.startsWith("blob:")}function Ja(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function ve(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var sg=typeof self<"u"?self:global,to=typeof navigator<"u",HS=to&&typeof HTMLImageElement>"u",Ym=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),ng=sg.Buffer,og=!!ng,$S=i=>i!==void 0;function ag(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter($S).length===0)}function st(i){let e=new Error(i);throw delete e.stack,e}function Zm(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var rh=i=>String.fromCharCode.apply(null,i),Qm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Qr=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&st("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else st("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,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||st("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(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 s=this.getUint8Array(e,t),Qm?Qm.decode(s):og?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(rh(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return rh(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return rh(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function nh(i,e){st(`${i} '${e}' was not loaded, try using full build of exifr.`)}var io=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||nh(this.kind,e),t&&(e in t||function(r,s){st(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||nh(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},sl=new io("file parser"),Nt=new io("segment parser"),no=new io("file reader"),qS=sg.fetch;function Jm(i,e){return(t=i).startsWith("data:")||t.length>1e4?ah(i,e,"base64"):Ym&&i.includes("://")?oh(i,e,"url",el):Ym?ah(i,e,"fs"):to?oh(i,e,"url",el):void st("Invalid input argument");var t}async function oh(i,e,t,r){return no.has(t)?ah(i,e,t):r?async function(s,n){let o=await n(s);return new Qr(o)}(i,r):void st(`Parser ${t} is not loaded`)}async function ah(i,e,t){let r=new(no.get(t))(i,e);return await r.read(),r}var el=i=>qS(i).then(e=>e.arrayBuffer()),ro=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),lh=class 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 lg(i,e,t){let r=new lh;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function cg(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var oo=new Map,ph=new Map,fh=new Map,Us=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],nl=["jfif","xmp","icc","iptc","ihdr"],so=["tiff",...nl],Ve=["ifd0","ifd1","exif","gps","interop"],zs=[...so,...Ve],Hs=["makerNote","userComment"],ol=["translateKeys","translateValues","reviveValues","multiSegment"],$s=[...ol,"sanitize","mergeOutput","silentErrors"],tl=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Zr=class extends tl{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),ve(this,"enabled",!1),ve(this,"skip",new Set),ve(this,"pick",new Set),ve(this,"deps",new Set),ve(this,"translateKeys",!1),ve(this,"translateValues",!1),ve(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ve.includes(e),this.canBeFiltered&&(this.dict=oo.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:st(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of ol)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,il(this.pick,this.deps)):this.enabled&&this.pick.size>0&&il(this.pick,this.deps)}},St={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},eg=new Map,Jr=class extends tl{static useCached(e){let t=eg.get(e);return t!==void 0||(t=new this(e),eg.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):st(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=to?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Us)this[e]=St[e];for(e of $s)this[e]=St[e];for(e of Hs)this[e]=St[e];for(e of zs)this[e]=new Zr(e,St[e],void 0,this)}setupFromTrue(){let e;for(e of Us)this[e]=St[e];for(e of $s)this[e]=St[e];for(e of Hs)this[e]=!0;for(e of zs)this[e]=new Zr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Us)this[t]=St[t];for(t of $s)this[t]=St[t];for(t of Hs)this[t]=St[t];for(t of zs)this[t]=new Zr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ve)}setupFromObject(e){let t;for(t of(Ve.ifd0=Ve.ifd0||Ve.image,Ve.ifd1=Ve.ifd1||Ve.thumbnail,Object.assign(this,e),Us))this[t]=sh(e[t],St[t]);for(t of $s)this[t]=sh(e[t],St[t]);for(t of Hs)this[t]=sh(e[t],St[t]);for(t of so)this[t]=new Zr(t,St[t],e[t],this);for(t of Ve)this[t]=new Zr(t,St[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ve,zs),e.tiff===!0?this.batchEnableWithBool(Ve,!0):e.tiff===!1?this.batchEnableWithUserValue(Ve,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ve):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ve)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=tg(e,r);for(let[o,a]of n)il(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=tg(t,r);for(let[o,a]of n)il(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=Ve.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of Ve)this[n].finalizeFilters()}get onlyTiff(){return!nl.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of so)this[e].enabled&&!Nt.has(e)&&nh("segment parser",e)}};function tg(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=oo.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function sh(i,e){return i!==void 0?i:e!==void 0?e:void 0}function il(i,e){for(let t of e)i.add(t)}ve(Jr,"default",St);var qs=class{constructor(e){ve(this,"parsers",{}),ve(this,"output",{}),ve(this,"errors",[]),ve(this,"pushToErrors",t=>this.errors.push(t)),this.options=Jr.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?Jm(t,r):to&&!HS&&t instanceof HTMLImageElement?Jm(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Qr(t):to&&t instanceof Blob?oh(t,r,"blob",ro):void st("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of sl)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),st("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),ag(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async r=>{let s=await r.parse();r.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=Nt.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}};async function ug(i,e){let t=new qs(e);return await t.read(i),t.parse()}var VS=Object.freeze({__proto__:null,parse:ug,Exifr:qs,fileParsers:sl,segmentParsers:Nt,fileReaders:no,tagKeys:oo,tagValues:ph,tagRevivers:fh,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:el,readBlobAsArrayBuffer:ro,chunkedProps:Us,otherSegments:nl,segments:so,tiffBlocks:Ve,segmentsAndBlocks:zs,tiffExtractables:Hs,inheritables:ol,allFormatters:$s,Options:Jr}),vr=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new Jr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Qr?e:new Qr(e)}constructor(e,t={},r){ve(this,"errors",[]),ve(this,"raw",new Map),ve(this,"handleError",s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)}),this.chunk=this.normalizeInput(e),this.file=r,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 r=fh.get(t),s=ph.get(t),n=oo.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,c=o.translateKeys&&!!n,d={};for(let[f,y]of e)a&&r.has(f)?y=r.get(f)(y):l&&s.has(f)&&(y=this.translateValue(y,s.get(f))),c&&n.has(f)&&(f=n.get(f)||f),d[f]=y;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};ve(vr,"headerLength",4),ve(vr,"type",void 0),ve(vr,"multiSegment",!1),ve(vr,"canHandle",()=>!1);function jS(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function WS(i){return i>=224&&i<=239}function GS(i,e,t){for(let[r,s]of Nt)if(s.canHandle(i,e,t))return r}var rl=class extends class{constructor(e,t,r){ve(this,"errors",[]),ve(this,"ensureSegmentChunk",async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){st(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):st("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(Nt.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),ve(this,"appSegments",[]),ve(this,"jpegSegments",[]),ve(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Nt.keyList())):(e=e===void 0?Nt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Nt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(a=>{let l=Nt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:c,findAll:d,wanted:f,remaining:y,options:v}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(r=c.getUint8(e+1),WS(r)){if(s=c.getUint16(e+2),n=GS(c,e,s),n&&f.has(n)&&(o=Nt.get(n),a=o.findPosition(c,e),l=v[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;v.recordUnknownSegments&&(a=vr.findPosition(c,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(jS(r)){if(s=c.getUint16(e+2),r===218&&v.stopAfterSos!==!1)return;v.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=Nt.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}};ve(rl,"type","jpeg"),sl.set("jpeg",rl);var KS=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],ch=class extends vr{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=KS[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&st(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&st(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=s.getString(e,o)).trim())===""?void 0:l;var l;if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let c=new(function(f){switch(f){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(n))(o),d=a;for(let f=0;f<o;f++)c[f]=this.parseTagValue(n,e),e+=d;return c}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:st(`Invalid tiff type ${e}`)}}},eo=class extends ch{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&st("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&st(`IFD0 offset points to outside of file.
|
97
|
-
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Zm(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Zm(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 r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",ig(...e.get(2),e.get(1))),e.set("longitude",ig(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of Ve)if(e=this[t],!ag(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function ig(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ve(eo,"type","tiff"),ve(eo,"headerLength",10),Nt.set("tiff",eo);var iF=Object.freeze({__proto__:null,default:VS,Exifr:qs,fileParsers:sl,segmentParsers:Nt,fileReaders:no,tagKeys:oo,tagValues:ph,tagRevivers:fh,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:el,readBlobAsArrayBuffer:ro,chunkedProps:Us,otherSegments:nl,segments:so,tiffBlocks:Ve,segmentsAndBlocks:zs,tiffExtractables:Hs,inheritables:ol,allFormatters:$s,Options:Jr,parse:ug}),mh={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},rF=Object.assign({},mh,{firstChunkSize:4e4,gps:[1,2,3,4]});var sF=Object.assign({},mh,{tiff:!1,ifd1:!0,mergeOutput:!1});var XS=Object.assign({},mh,{firstChunkSize:4e4,ifd0:[274]});async function YS(i){let e=new qs(XS);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var ZS=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}}),Qn=!0,Jn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Qn=Number(t)+.1*Number(r)<13.4,Jn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Qn=Jn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Qn=Jn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Qn=Jn=Number(e)<77}}async function hg(i){let e=await YS(i);return Object.assign({canvas:Qn,css:Jn},ZS[e])}var uh=class extends Qr{constructor(...e){super(...e),ve(this,"ranges",new hh),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=og?ng.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}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)}},hh=class{constructor(){ve(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>rg(e,o.offset,s)||rg(e,o.end,s));if(n.length>0){e=Math.min(e,...n.map(a=>a.offset)),s=Math.max(s,...n.map(a=>a.end)),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter(a=>!n.includes(a))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function rg(i,e,t){return i<=e&&e<=t}var dh=class extends uh{constructor(e,t){super(0),ve(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,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};no.set("blob",class extends dh{async readWhole(){this.chunked=!1;let i=await ro(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await ro(r);return this.set(s,i,!0)}});var dg={strings:{generatingThumbnails:"Generating thumbnails..."}};var QS={version:"4.1.1"};function JS(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>Xm(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function eE(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function tE(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}var iE={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Vs=class extends di{constructor(e,t){if(super(e,{...iE,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&Ja(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&Qa(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Qa(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=()=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=dg,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{let c=new Image;c.src=s,c.addEventListener("load",()=>{URL.revokeObjectURL(s),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=hg(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),f=eE(l,c),y=this.resizeImage(f,d.width,d.height);return JS(y,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=tE(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1),l=2;for(;n--;){let c=document.createElement("canvas");c.width=o,c.height=a,c.getContext("2d").drawImage(s,0,0,o,a),s=c,o=Math.round(o/l),a=Math.round(a/l)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ja(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};Vs.VERSION=QS.version;function rE(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Wn(i)?[i]:null}var gh=rE;var br=Array.from;function al(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{al(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function pg(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{al(t,[],e,{onSuccess:n=>s(n.map(o=>pg(o,e)))})})},isSameEntry:void 0}}function fg(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=()=>`${e}/${i.name}`;if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*fg(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*vh(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=pg(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*fg(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function bh(i){let e=br(i.files);return Promise.resolve(e)}async function yh(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of vh(i,r))s.push(n);return s}catch{return bh(i)}}var Vg=Fe(wt(),1);function ao(i){return{...i,type:i.mimeType,extension:i.name?Vr(i.name).extension:null}}var lo,ze,wh,mg,co=0,Tg=[],je=Ee,gg=je.__b,vg=je.__r,bg=je.diffed,yg=je.__c,wg=je.unmount,Sg=je.__;function Eh(i,e){je.__h&&je.__h(ze,i,co||e),co=0;var t=ze.__H||(ze.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function fi(i){return co=1,sE(kg,i)}function sE(i,e,t){var r=Eh(lo++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):kg(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ze,!ze.__f)){var s=function(a,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(y){return!!y.__c});if(d.every(function(y){return!y.__N}))return!n||n.call(this,a,l,c);var f=r.__c.props!==a;return d.forEach(function(y){if(y.__N){var v=y.__[0];y.__=y.__N,y.__N=void 0,v!==y.__[0]&&(f=!0)}}),n&&n.call(this,a,l,c)||f};ze.__f=!0;var n=ze.shouldComponentUpdate,o=ze.componentWillUpdate;ze.componentWillUpdate=function(a,l,c){if(this.__e){var d=n;n=void 0,s(a,l,c),n=d}o&&o.call(this,a,l,c)},ze.shouldComponentUpdate=s}return r.__N||r.__}function ki(i,e){var t=Eh(lo++,3);!je.__s&&xg(t.__H,e)&&(t.__=i,t.u=e,ze.__H.__h.push(t))}function es(i){return co=5,ts(function(){return{current:i}},[])}function ts(i,e){var t=Eh(lo++,7);return xg(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function is(i,e){return co=8,ts(function(){return i},e)}function nE(){for(var i;i=Tg.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(ll),i.__H.__h.forEach(Sh),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){ze=null,gg&&gg(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Sg&&Sg(i,e)},je.__r=function(i){vg&&vg(i),lo=0;var e=(ze=i.__c).__H;e&&(wh===ze?(e.__h=[],ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ll),e.__h.forEach(Sh),e.__h=[],lo=0)),wh=ze},je.diffed=function(i){bg&&bg(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Tg.push(e)!==1&&mg===je.requestAnimationFrame||((mg=je.requestAnimationFrame)||oE)(nE)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),wh=ze=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(ll),t.__h=t.__h.filter(function(r){return!r.__||Sh(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),yg&&yg(i,e)},je.unmount=function(i){wg&&wg(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ll(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var Eg=typeof requestAnimationFrame=="function";function oE(i){var e,t=function(){clearTimeout(r),Eg&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Eg&&(e=requestAnimationFrame(t))}function ll(i){var e=ze,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ze=e}function Sh(i){var e=ze;i.__c=i.__(),ze=e}function xg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function kg(i,e){return typeof e=="function"?e(i):e}function aE(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("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"}),u("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"}),u("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"}),u("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"}),u("path",{d:"M4 4h18v18H4z"})))}function lE(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=is(o=>{o.preventDefault(),r()},[r]);return u("form",{onSubmit:n},s?u("button",{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},u(aE,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var cE=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(lE,{pluginName:e,i18n:t,onAuth:r})};function cl(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=cE}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},r()),u("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),o({pluginName:t,i18n:s,loading:e,onAuth:n}))}var Ag=Fe(wt(),1);function Th(i){let{i18n:e,logout:t,username:r}=i;return u(Mt,null,r&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function xh(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((o,a)=>{var l;return u(Mt,null,u("button",{key:o.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(o.id)},o.type==="root"?t:(l=o.data.name)!=null?l:n("unnamed")),s.length===a+1?"":" / ")}))}function kh(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Ag.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(xh,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Th,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Ah(){return Ah=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ah.apply(null,arguments)}var uE={position:"relative",width:"100%",minHeight:"100%"},hE={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ph=class extends dt{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...o}=e,{offset:a,height:l}=this.state,c=Math.floor(a/r),d=Math.floor(l/r);n&&(c=Math.max(0,c-c%n),d+=n);let f=c+d+4,y=t.slice(c,f),v={...uE,height:t.length*r},x={...hE,top:c*r};return u("div",Ah({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:x},y.map(s))))}},ul=Ph;var Pg=Fe(wt(),1);function dE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("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 pE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-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 fE(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("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"}),u("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 js(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(dE,null);case"folder":return u(pE,null);case"video":return u(fE,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function mE(i){var e,t;let{file:r,toggleCheckbox:s,className:n,isDisabled:o,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:n,title:o&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:r.id,checked:r.status==="checked",disabled:o,"data-uppy-super-focusable":!0}),u("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(js,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var Ch=mE;function Fh(i){var e,t,r;let{file:s,openFolder:n,className:o,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:f}=i;return u("li",{className:o,title:s.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?f("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:f("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),s.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>n(s.id),"aria-label":f("openFolderNamed",{name:(t=s.data.name)!=null?t:f("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(js,{itemIconString:s.data.icon})),d&&s.data.name?u("span",null,s.data.name):f("unnamed")):u("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(js,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:f("unnamed"))))}function _h(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:s,openFolder:n,file:o,utmSource:a}=i,l=o.type==="folder"?null:o.restrictionError,c=!!l&&o.status!=="checked",d={file:o,openFolder:n,toggleCheckbox:t,utmSource:a,i18n:s,viewType:e,showTitles:r,className:(0,Pg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":o.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":o.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":o.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return u(Ch,d);case"list":return u(Fh,d);case"unsplash":return u(Ch,d,u("a",{href:`${o.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},o.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function gE(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:f}=i,[y,v]=fi(!1);if(ki(()=>{let P=R=>{R.key==="Shift"&&v(!1)},F=R=>{R.key==="Shift"&&v(!0)};return document.addEventListener("keyup",P),document.addEventListener("keydown",F),()=>{document.removeEventListener("keyup",P),document.removeEventListener("keydown",F)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:o("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let x=P=>u(_h,{viewType:t,toggleCheckbox:F=>{var R;F.stopPropagation(),F.preventDefault(),(R=document.getSelection())==null||R.removeAllRanges(),r(P,y)},showTitles:n,i18n:o,openFolder:l,file:P,utmSource:f});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(ul,{data:e,renderRow:x,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(x)))}var hl=gE;var vE=(i,e,t,r,s)=>{let n=e.filter(v=>v.isFolder===!0),o=e.filter(v=>v.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:v})),c=o.map(v=>{let x=s(v);return{type:"file",id:v.requestPath,restrictionError:x,status:a&&!x?"checked":"unchecked",parentId:t.id,data:v}}),d={...t,cached:!0,nextPagePath:r};return[...i.map(v=>v.id===d.id?d:v),...l,...c]},Cg=vE;var bE=(i,e,t,r,s)=>{let n=i.find(x=>x.id===e),o=t.filter(x=>x.isFolder===!0),a=t.filter(x=>x.isFolder===!1),l={...n,nextPagePath:r},c=i.map(x=>x.id===l.id?l:x),d=l.type==="folder"&&l.status==="checked",f=o.map(x=>({type:"folder",id:x.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:x})),y=a.map(x=>{let P=s(x);return{type:"file",id:x.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:x}});return[...c,...f,...y]},Fg=bE;var yE=i=>i.map(e=>({...e})),dl=yE;var Oh=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",Oh(i,s.id,t)})},Rh=(i,e)=>{let t=i.find(o=>o.id===e);if(t.type==="root")return;let r=i.filter(o=>o.type!=="root"&&o.parentId===t.id&&!(o.type==="file"&&o.restrictionError)),s=r.every(o=>o.status==="checked"),n=r.every(o=>o.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Rh(i,t.parentId)},wE=(i,e)=>{let t=dl(i);if(e.length>=2){let r=t.filter(s=>s.type!=="root"&&e.includes(s.id));r.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),r.forEach(s=>{Oh(t,s.id,!0)}),Rh(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Oh(t,r.id,r.status==="checked"),Rh(t,r.parentId)}return t},_g=wE;var Mh=Fe(Rg(),1);var ho=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Ih=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Lg=i=>globalThis.DOMException===void 0?new Ih(i):new DOMException(i),Mg=i=>{let e=i.reason===void 0?Lg("This operation was aborted."):i.reason;return e instanceof Error?e:Lg(e)};function Dh(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,a,c=new Promise((d,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:v}=e;v.aborted&&f(Mg(v)),a=()=>{f(Mg(v))},v.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,f);return}let y=new ho;o=n.setTimeout.call(void 0,()=>{if(r){try{d(r())}catch(v){f(v)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?d():s instanceof Error?f(s):(y.message=s??`Promise timed out after ${t} milliseconds`,f(y))},t),(async()=>{try{d(await i)}catch(v){f(v)}})()}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{n.clearTimeout.call(void 0,o),o=void 0},c}function Nh(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var po=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let s=Nh(this.#e,r,(n,o)=>o.priority-n.priority);this.#e.splice(s,0,r)}setPriority(e,t){let r=this.#e.findIndex(n=>n.id===e);if(r===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[s]=this.#e.splice(r,1);this.enqueue(s.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var fo=class extends Mh.default{#e;#t;#i=0;#o;#s;#a=0;#r;#c;#n;#d;#l=0;#p;#u;#g;#v=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:po,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#o=e.intervalCap,this.#s=e.interval,this.#n=new e.queueClass,this.#d=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#u=e.autoStart===!1}get#h(){return this.#t||this.#i<this.#o}get#b(){return this.#l<this.#p}#f(){this.#l--,this.#m(),this.emit("next")}#y(){this.#x(),this.#T(),this.#c=void 0}get#w(){let e=Date.now();if(this.#r===void 0){let t=this.#a-e;if(t<0)this.#i=this.#e?this.#l:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#y()},t)),!0}return!1}#m(){if(this.#n.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#l===0&&this.emit("idle"),!1;if(!this.#u){let e=!this.#w;if(this.#h&&this.#b){let t=this.#n.dequeue();return t?(this.emit("active"),t(),e&&this.#T(),!0):!1}}return!1}#T(){this.#t||this.#r!==void 0||(this.#r=setInterval(()=>{this.#x()},this.#s),this.#a=Date.now()+this.#s)}#x(){this.#i===0&&this.#l===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#i=this.#e?this.#l:0,this.#S()}#S(){for(;this.#m(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#S()}async#k(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}setPriority(e,t){this.#n.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#v++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((r,s)=>{this.#n.enqueue(async()=>{this.#l++,this.#i++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Dh(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#k(t.signal)]));let o=await n;r(o),this.emit("completed",o)}catch(n){if(n instanceof ho&&!t.throwOnTimeout){r();return}s(n),this.emit("error",n)}finally{this.#f()}},t),this.emit("add"),this.#m()})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return this.#u?(this.#u=!1,this.#S(),this):this}pause(){this.#u=!0}clear(){this.#n=new this.#d}async onEmpty(){this.#n.size!==0&&await this.#E("empty")}async onSizeLessThan(e){this.#n.size<e||await this.#E("next",()=>this.#n.size<e)}async onIdle(){this.#l===0&&this.#n.size===0||await this.#E("idle")}async#E(e,t){return new Promise(r=>{let s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})}get size(){return this.#n.size}sizeBy(e){return this.#n.filter(e).length}get pending(){return this.#l}get isPaused(){return this.#u}};var Ig=async(i,e,t,r,s)=>{let n=[],o=t.cached?t.nextPagePath:t.id;for(;o;){let f=await r(o);n=n.concat(f.items),o=f.nextPagePath}let a=n.filter(f=>f.isFolder===!0),l=n.filter(f=>f.isFolder===!1),c=a.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),d=l.map(f=>{let y=s(f);return{type:"file",id:f.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(async f=>{i.add(()=>Ig(i,e,f,r,s))})},TE=async(i,e,t,r)=>{let s=new fo({concurrency:6}),n=dl(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>Ig(s,n,a,e,t))}),s.on("completed",()=>{let a=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(a)}),await s.onIdle(),n},Dg=TE;var rs={afterOpenFolder:Cg,afterScrollFolder:Fg,afterToggleCheckbox:_g,afterFill:Dg};var xE=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},fl=xE;var kE=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Gi=kE;var AE=(i,e,t,r)=>{let s=e.findIndex(n=>n.id===r);if(s!==-1&&t){let n=e.findIndex(a=>a.id===i);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(a=>a.id)}return[i]},ml=AE;function PE(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:s,inputClassName:n,inputLabel:o,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,f=x=>{t(x.target.value)},y=is(x=>{x.preventDefault(),r()},[r]),[v]=fi(()=>{let x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=mr(),x});return ki(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),u("section",{className:s},u("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":o,placeholder:o,value:e,onInput:f,form:v.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("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"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("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"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:v.id},c))}var Ws=PE;var Bg=Fe(wt(),1);var CE=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,Ng=CE;function mo(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=ts(()=>n(s),[s,n]),a=ts(()=>Ng(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Bg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button"},r("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),o&&u("div",{className:"uppy-ProviderBrowser-footer-error"},o))}var FE=(i,e,t)=>{var r,s;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(s=i.author)==null?void 0:s.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},Ug=FE;var _E=(i,e,t)=>{let r=i.map(o=>Ug(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(Na(o,e.uppy.getID()))?n.push(o):s.push(o)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},gl=_E;var zg=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let s=i.find(o=>o.id===e);if(s.type==="root")return[];let n=[...zg(i,s.parentId,t),s];return t[r]=n,n},OE=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=zg(i,s.id,e),o=n.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=n.slice(o),l=`/${n.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return{...s.data,absDirPath:l,relDirPath:c}})},vl=OE;var RE=(i,e)=>{let t=i.find(s=>s.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let s=t.parentId;t=i.find(n=>n.id===s)}return r},Hg=RE;function yr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LE=0;function qg(i){return"__private_"+LE+++"_"+i}var ME={version:"4.4.2"};function go(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var $g=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),ss=qg("abortController"),mi=qg("withAbort"),Gs=class{constructor(e,t){Object.defineProperty(this,mi,{value:IE}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,ss,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=ao(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:o}=this.plugin.getPluginState(),a=s.filter(c=>c.type!=="root"&&c.parentId===n);return o===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(o.toLowerCase())!==-1})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...r,...t},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.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState($g(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(s=>s.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await yr(this,mi)[mi](async s=>{let n=e,o=[];do{let{username:l,nextPagePath:c,items:d}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:l}),n=c,o=o.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);let a=rs.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}async logout(){await yr(this,mi)[mi](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState({...$g(this.plugin.rootFolderId),authenticated:!1})}}).catch(Gi(this.plugin.uppy))}async handleAuth(e){await yr(this,mi)[mi](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(Gi(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);fl(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await yr(this,mi)[mi](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=rs.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(Gi(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await yr(this,mi)[mi](async t=>{let r=await rs.afterFill(e,o=>this.provider.list(o,{signal:t}),this.validateSingleFile,o=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:o}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=vl(r);gl(n,this.plugin,this.provider),this.resetPluginState()}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:o,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||go;if(o===!1)return u(cl,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:f,searchString:y}=this.plugin.getPluginState(),v=Hg(c,d);return u("div",{className:(0,Vg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(kh,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:s}),n.showFilter&&u(Ws,{searchString:y,setSearchString:x=>{this.plugin.setPluginState({searchString:x})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),u(mo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function IE(i){var e;(e=yr(this,ss)[ss])==null||e.abort();let t=new AbortController;yr(this,ss)[ss]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),yr(this,ss)[ss]=void 0}}Gs.VERSION=ME.version;var jg=Fe(wt(),1);var DE={version:"4.4.2"},NE={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},BE={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},Ks=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let s=ao(r);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(s=>s.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let n=r.filter(o=>o.type==="file"&&o.status==="checked").map(o=>o.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider,this.opts={...BE,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(NE)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){Gi(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(fl(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(r,s.nextPagePath),o={...s,nextPagePath:n.nextPageQuery},a=t.filter(c=>c.type!=="root"),l=[o,...a,...n.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(n){Gi(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=vl(e);gl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:s,loading:n,partialTree:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l={...this.opts,...t};return r?u(Ws,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,jg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Ws,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),u(mo,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Ks.VERSION=DE.version;var Wg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function UE(i,e){return!!(i===e||Wg(i)&&Wg(e))}function zE(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!UE(i[t],e[t]))return!1;return!0}function Bh(i,e){e===void 0&&(e=zE);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}var bl=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function vo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Gg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function HE(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function $E(i){return i.contains(document.activeElement)}function Uh(i,e,t){let r=vo(t,e),s=br(r.querySelectorAll(bl)),n=s.indexOf(document.activeElement);$E(r)?i.shiftKey&&n===0?HE(i,s):!i.shiftKey&&n===s.length-1&&Gg(i,s):Gg(i,s)}function Kg(i,e,t){e===null||Uh(i,e,t)}var Xg=Fe(Cu(),1);function zh(){let i=!1;return(0,Xg.default)((t,r)=>{let s=vo(t,r),n=s.contains(document.activeElement);if(n&&i)return;let o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{let a=s.querySelector(bl);a?.focus({preventScroll:!0}),i=!1}},260)}var pv=Fe(wt(),1);function Hh(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Jg=Fe(wt(),1);function Yg(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),s=t.length;if(r.length!==s)return!1;for(let n=0;n<s;n++){let o=t[n];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function VE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("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"}),u("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"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function jE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function WE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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"}))}function GE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function KE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function XE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("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"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function YE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function ns(i){let e={color:"#838999",icon:XE()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:YE()}:t==="image"?{color:"#686de0",icon:VE()}:t==="audio"?{color:"#068dbb",icon:jE()}:t==="video"?{color:"#19af67",icon:WE()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:GE()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:KE()}:e}function bo(i){let{file:e}=i;if(e.preview)return u("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=ns(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var ZE=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function yo(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let o=n.map(a=>ZE(a,s)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function $h(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":ns(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(bo,{file:e}),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function QE(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function Zg(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function qh(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Zg(i),title:Zg(i),onClick:()=>QE(i)},i.children))}function yl(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function Vh(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("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 jh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(yl,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("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"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(qh,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(qh,i,u(yl,null,u(Vh,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(qh,i,u(yl,null,u(Vh,{progress:i.file.progress.percentage}),u("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"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(yl,null,u(Vh,{progress:i.file.progress.percentage}))))}var Qg=Fe(Ba(),1);var Wh="...";function wl(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Wh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-Wh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Wh+i.slice(-s)}var JE=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},wl(t,r()))},eT=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},wl(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},tT=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Qg.default)(i.file.size)),iT=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),rT=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function Gh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},JE({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(rT,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},eT({file:e}),tT({file:e}),iT({file:e,toggleAddFilesPanel:n,i18n:t})),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function Kh(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function sT(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("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"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function nT(i){let{i18n:e,onClick:t,file:r}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("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"}),u("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 oT(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{Kh(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:n=>s(n)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("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 Xh(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(sT,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(oT,{file:t,uppy:e,i18n:l}):null,a?u(nT,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var wo=class extends dt{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Yg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,Jg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u($h,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(jh,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,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})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(Gh,{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}),u(Xh,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function aT(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function Yh(i){let{id:e,i18n:t,uppy:r,files:s,resumableUploads:n,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,recoveredState:F,individualCancellation:R,itemsPerRow:D,openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,containerWidth:z,containerHeight:G}=i,K=D===1?71:200,Q=ts(()=>{let Y=(le,ke)=>Number(s[ke].isGhost)-Number(s[le].isGhost),re=Object.keys(s);return F&&re.sort(Y),aT(re,D)},[s,D,F]),ne=Y=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Y[0]},Y.map(re=>u(wo,{key:re,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:R,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,recoveredState:F,isSingleFile:y,containerWidth:z,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,file:s[re]})));return y?u("div",{class:"uppy-Dashboard-files"},ne(Q[0])):u(ul,{class:"uppy-Dashboard-files",role:"list",data:Q,renderRow:ne,rowHeight:K})}var Zh=class extends dt{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("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"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("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 "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return u(Mt,null,t.map(s=>this.renderAcquirer(s)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),n.length===1&&n[0].key===o&&(n=[]);let l=[...n],c=l.splice(n.length-2,n.length);return u(Mt,null,this.renderDropPasteBrowseTagline(n.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:f,elements:y}=d;return u(Mt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Mt,{key:f},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Sl=Zh;var ev=Fe(wt(),1);var lT=i=>u("div",{className:(0,ev.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(Sl,i)),tv=lT;var iv=Fe(wt(),1);function cT(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ai=cT;function uT(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=es(null);return u("div",{className:(0,iv.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n,a.current)))}var rv=uT;var sv=Fe(wt(),1);function hT(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,sv.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var nv=hT;var Pi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function dT(i,e,t,r){if(r===void 0&&(r={}),i)return Pi.STATE_ERROR;if(e)return Pi.STATE_COMPLETE;if(t)return Pi.STATE_PAUSED;let s=Pi.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return Pi.STATE_UPLOADING;a.preprocess&&s!==Pi.STATE_UPLOADING&&(s=Pi.STATE_PREPROCESSING),a.postprocess&&s!==Pi.STATE_UPLOADING&&s!==Pi.STATE_PREPROCESSING&&(s=Pi.STATE_POSTPROCESSING)}return s}function pT(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(dT(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function fT(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i,{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!r?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(pT,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("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"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var ov=fT;var av=Fe(wt(),1);function Qh(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:c,form:s.id},u):u("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:c,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Jh(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:f,canEditFile:y}=i,v=()=>typeof o=="function"?o(t[r]):o,x=t[r],P=(e=v())!=null?e:[],F=y(x),R={};P.forEach(K=>{var Q;R[K.id]=(Q=x.meta[K.id])!=null?Q:""});let[D,V]=fi(R),M=is(K=>{K.preventDefault(),n(D,r)},[n,D,r]),$=(K,Q)=>{V({...D,[Q]:K})},z=()=>{s(!1)},[G]=fi(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=mr(),K});return ki(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,av.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},x.meta?x.meta.name:x.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:c("finishEditingFile"),onClick:z},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:ns(x.type).color}},u(bo,{file:x}),F&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{M(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Qh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:$,form:G,formState:D})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:G.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:z,form:G.id},c("cancel")))))}var cv=Fe(wt(),1),Xs="uppy-transition-slideDownUp",lv=250;function mT(i){let{children:e}=i,[t,r]=fi(null),[s,n]=fi(""),o=es(),a=es(),l=es(),c=()=>{n(`${Xs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-enter ${Xs}-enter-active`),o.current=setTimeout(()=>{n("")},lv)})},d=()=>{n(`${Xs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-leave ${Xs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},lv)})};return ki(()=>{let f=xi(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),ki(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?ja(t,{className:(0,cv.default)(s,t.props.className)}):null}var So=mT;function Ys(){return Ys=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ys.apply(null,arguments)}var uv=900,hv=700,ed=576,dv=330;function td(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>ed,s=i.containerHeight>dv,n=(0,pv.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>ed,"uppy-size--lg":i.containerWidth>hv,"uppy-size--xl":i.containerWidth>uv,"uppy-size--height-md":i.containerHeight>dv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>uv?o=5:i.containerWidth>hv?o=4:i.containerWidth>ed&&(o=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Hh(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(ov,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("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"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(Yh,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(Sl,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(So,null,i.showAddFilesPanel?u(tv,Ys({key:"AddFiles"},i,{isSizeMD:r})):null),u(So,null,i.fileCardFor?u(Jh,Ys({key:"FileCard"},i)):null),u(So,null,i.activePickerPanel?u(rv,Ys({key:"Picker"},i)):null),u(So,null,i.showFileEditor?u(nv,Ys({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var fv={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function de(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var gT=0;function ct(i){return"__private_"+gT+++"_"+i}var vT={version:"4.3.2"},id=Bh.default||Bh,mv=9,bT=27;function gv(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var yT={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:go,showLinkToFileUploadResult:!1,showProgressDetails:!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},os=ct("disabledNodes"),Ki=ct("generateLargeThumbnailIfSingleFile"),Eo=ct("openFileEditorWhenFilesAdded"),as=ct("attachRenderFunctionToTarget"),rd=ct("isTargetSupported"),sd=ct("getAcquirers"),nd=ct("getProgressIndicators"),Xi=ct("getEditors"),od=ct("addSpecifiedPluginsFromOptions"),ad=ct("autoDiscoverPlugins"),ls=ct("addSupportedPluginIfNoTarget"),To=ct("getStatusBarOpts"),xo=ct("getThumbnailGeneratorOpts"),ld=ct("getInformerOpts"),ko=ct("getStatusBarId"),Ao=ct("getThumbnailGeneratorId"),cd=ct("getInformerId"),wr=class extends di{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...yT,...t,autoOpen:o}),Object.defineProperty(this,cd,{value:kT}),Object.defineProperty(this,Ao,{value:xT}),Object.defineProperty(this,ko,{value:TT}),Object.defineProperty(this,ld,{value:ET}),Object.defineProperty(this,xo,{value:ST}),Object.defineProperty(this,To,{value:wT}),Object.defineProperty(this,os,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${mr()}`,this.superFocus=zh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:c,type:d},v=this.getPluginState().targets.slice();return v.push(f),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return de(this,Xi)[Xi](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Xi)[Xi](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();de(this,Xi)[Xi](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=gv();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:f}=this.getPluginState();if(d||f)return;let{promise:y,resolve:v}=gv();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),v()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var x;(x=history.state)!=null&&x[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=de(this,os)[os])!=null?l:br(this.el.querySelectorAll(c)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of d)f.tagName==="A"?f.setAttribute("aria-disabled",a):f.disabled=a;a?de(this,os)[os]=d:de(this,os)[os]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===bT&&this.requestCloseModal(),a.keyCode===mv&&Uh(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=br(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=br(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(a)&&(y=!0)}),y},c=()=>{let{types:y}=a.dataTransfer;return y.some(v=>v==="Files")},d=l(),f=c();if(!d&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=async a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(a))});let l=!1,c=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=await yh(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===mv&&Kg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Ki,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d={...l[0],preview:void 0};c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Eo,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,f=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=gh(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",de(this,ls)[ls]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",de(this,Ki)[Ki]),this.uppy.on("file-removed",de(this,Ki)[Ki]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",de(this,Eo)[Eo])},this.removeEvents=()=>{let a=gh(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",de(this,ls)[ls]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",de(this,Ki)[Ki]),this.uppy.off("file-removed",de(this,Ki)[Ki]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",de(this,Eo)[Eo])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,as,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,rd,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,sd,{writable:!0,value:id(a=>a.filter(l=>l.type==="acquirer"&&de(this,rd)[rd](l)).map(de(this,as)[as]))}),Object.defineProperty(this,nd,{writable:!0,value:id(a=>a.filter(l=>l.type==="progressindicator").map(de(this,as)[as]))}),Object.defineProperty(this,Xi,{writable:!0,value:id(a=>a.filter(l=>l.type==="editor").map(de(this,as)[as]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$}=this.uppy.getObjectOfFilesPerState(),z=de(this,sd)[sd](l.targets),G=de(this,nd)[nd](l.targets),K=de(this,Xi)[Xi](l.targets),Q;return this.opts.theme==="auto"?Q=d.darkMode?"dark":"light":Q=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),td({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:z,theme:Q,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:G,editors:K,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,od,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,ad,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,ls)[ls])}}),Object.defineProperty(this,ls,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(f=>a.id===f.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)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.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use(Xr,{id:de(this,ko)[ko](),target:this,...de(this,To)[To]()}),this.opts.disableInformer||this.uppy.use(Yr,{id:de(this,cd)[cd](),target:this,...de(this,ld)[ld]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Vs,{id:de(this,Ao)[Ao](),...de(this,xo)[xo]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}de(this,od)[od](),de(this,ad)[ad](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=fv,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(de(this,ko)[ko]()))==null||t.setOptions(de(this,To)[To]()),(r=this.uppy.getPlugin(de(this,Ao)[Ao]()))==null||r.setOptions(de(this,xo)[xo]())}};function wT(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:o,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:o,doneButtonHandler:a}}function ST(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function ET(){return{}}function TT(){return`${this.id}:StatusBar`}function xT(){return`${this.id}:ThumbnailGenerator`}function kT(){return`${this.id}:Informer`}wr.VERSION=vT.version;var Ev=Fe(vv(),1);function AT(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}var bv=AT;function PT(i){return i*(Math.PI/180)}function CT(i,e,t){let r=Math.abs(PT(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var yv=CT;function FT(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var wv=FT;function _T(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var Sv=_T;var Po=class extends dt{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=bv(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let o=this.cropper.getImageData(),a=yv(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Ev.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=wv(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=Sv(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return u("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},u("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),u("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),u("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),u("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return u("div",{className:"uppy-ImageCropper"},u("div",{className:"uppy-ImageCropper-container"},u("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),u("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var Tv={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var OT={version:"3.3.1"},xv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},kv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},RT={quality:.8,actions:kv,cropperOptions:xv},cs=class extends di{constructor(e,t){super(e,{...RT,...t,actions:{...kv,...t?.actions},cropperOptions:{...xv,...t?.cropperOptions}}),this.save=()=>{let r=o=>{var a;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([o],(a=l.name)!=null?a:this.i18n("unnamed"),{type:o.type}),size:o.size,preview:void 0});let c=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",c),this.setPluginState({currentImage:c}),this.uppy.emit("file-editor:complete",c)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Tv,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:u(Po,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};cs.VERSION=OT.version;function Yi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LT=0;function Av(i){return"__private_"+LT+++"_"+i}var Tt=Av("uppy"),Co=Av("events"),Fo=class{constructor(e){Object.defineProperty(this,Tt,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:[]}),Yi(this,Tt)[Tt]=e}on(e,t){return Yi(this,Co)[Co].push([e,t]),Yi(this,Tt)[Tt].on(e,t)}remove(){for(let[e,t]of Yi(this,Co)[Co].splice(0))Yi(this,Tt)[Tt].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Yi(r,Tt)[Tt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}};function te(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MT=0;function Ft(i){return"__private_"+MT+++"_"+i}function IT(i){return new Error("Cancelled",{cause:i})}function Pv(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Ut=Ft("activeRequests"),kt=Ft("queuedHandlers"),Bt=Ft("paused"),us=Ft("pauseTimer"),xt=Ft("downLimit"),hs=Ft("upperLimit"),Zi=Ft("rateLimitingTimer"),_o=Ft("call"),Qi=Ft("queueNext"),fd=Ft("next"),dd=Ft("queue"),md=Ft("dequeue"),pd=Ft("resume"),ds=Ft("increaseLimit"),El=class{constructor(e){Object.defineProperty(this,md,{value:zT}),Object.defineProperty(this,dd,{value:UT}),Object.defineProperty(this,fd,{value:BT}),Object.defineProperty(this,Qi,{value:NT}),Object.defineProperty(this,_o,{value:DT}),Object.defineProperty(this,Ut,{writable:!0,value:0}),Object.defineProperty(this,kt,{writable:!0,value:[]}),Object.defineProperty(this,Bt,{writable:!0,value:!1}),Object.defineProperty(this,us,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:1}),Object.defineProperty(this,hs,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,pd,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ds,{writable:!0,value:()=>{if(te(this,Bt)[Bt]){te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],0);return}te(this,xt)[xt]=this.limit,this.limit=Math.ceil((te(this,hs)[hs]+te(this,xt)[xt])/2);for(let t=te(this,xt)[xt];t<=this.limit;t++)te(this,Qi)[Qi]();te(this,hs)[hs]-te(this,xt)[xt]>3?te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],2e3):te(this,xt)[xt]=Math.floor(te(this,xt)[xt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!te(this,Bt)[Bt]&&te(this,Ut)[Ut]<this.limit?te(this,_o)[_o](e):te(this,dd)[dd](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:Pv,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a,l=new Promise((c,d)=>{a=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{f?d(f):(a.done(),c(v))},v=>{f?d(f):(a.done(),d(v))}),v=>{f=IT(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Pv,l}}resume(){te(this,Bt)[Bt]=!1,clearTimeout(te(this,us)[us]);for(let e=0;e<this.limit;e++)te(this,Qi)[Qi]()}pause(e){e===void 0&&(e=null),te(this,Bt)[Bt]=!0,clearTimeout(te(this,us)[us]),e!=null&&(te(this,us)[us]=setTimeout(te(this,pd)[pd],e))}rateLimit(e){clearTimeout(te(this,Zi)[Zi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,hs)[hs]=this.limit-1,this.limit=te(this,xt)[xt],te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],e))}get isPaused(){return te(this,Bt)[Bt]}};function DT(i){te(this,Ut)[Ut]+=1;let e=!1,t;try{t=i()}catch(r){throw te(this,Ut)[Ut]-=1,r}return{abort:r=>{e||(e=!0,te(this,Ut)[Ut]-=1,t?.(r),te(this,Qi)[Qi]())},done:()=>{e||(e=!0,te(this,Ut)[Ut]-=1,te(this,Qi)[Qi]())}}}function NT(){queueMicrotask(()=>te(this,fd)[fd]())}function BT(){if(te(this,Bt)[Bt]||te(this,Ut)[Ut]>=this.limit||te(this,kt)[kt].length===0)return;let i=te(this,kt)[kt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,_o)[_o](i.fn);i.abort=e.abort,i.done=e.done}function UT(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,md)[md](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,kt)[kt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,kt)[kt].push(t):te(this,kt)[kt].splice(r,0,t),t}function zT(i){let e=te(this,kt)[kt].indexOf(i);e!==-1&&te(this,kt)[kt].splice(e,1)}var Tl=Symbol("__queue");var gd=class extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},Oo=gd;function HT(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Cv=HT;function Yt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $T=0;function xl(i){return"__private_"+$T+++"_"+i}var Ji=xl("aliveTimer"),ps=xl("isDone"),Ro=xl("onTimedOut"),fs=xl("timeout"),vd=class{constructor(e,t){Object.defineProperty(this,Ji,{writable:!0,value:void 0}),Object.defineProperty(this,ps,{writable:!0,value:!1}),Object.defineProperty(this,Ro,{writable:!0,value:void 0}),Object.defineProperty(this,fs,{writable:!0,value:void 0}),Yt(this,fs)[fs]=e,Yt(this,Ro)[Ro]=()=>t(e)}progress(){Yt(this,ps)[ps]||Yt(this,fs)[fs]>0&&(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=setTimeout(Yt(this,Ro)[Ro],Yt(this,fs)[fs]))}done(){Yt(this,ps)[ps]||(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=void 0,Yt(this,ps)[ps]=!0)}},Fv=vd;var kl=()=>{};function _v(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=kl,onUploadProgress:o=kl,shouldRetry:a=()=>!0,onAfterResponse:l=kl,onTimeout:c=kl,responseType:d,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:x=!1}=e,P=D=>.3*2**(D-1)*1e3,F=new Fv(v,c);function R(D){return D===void 0&&(D=0),new Promise(async(V,M)=>{let $=new XMLHttpRequest,z=G=>{a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(G))};$.open(s,i,!0),$.withCredentials=x,d&&($.responseType=d),y?.addEventListener("abort",()=>{$.abort(),M(new DOMException("Aborted","AbortError"))}),$.onload=async()=>{try{await l($,D)}catch(G){G.request=$,z(G);return}$.status>=200&&$.status<300?(F.done(),V($)):a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(new Oo($.statusText,$)))},$.onerror=()=>z(new Oo($.statusText,$)),$.upload.onprogress=G=>{F.progress(),o(G)},r&&Object.keys(r).forEach(G=>{$.setRequestHeader(G,r[G])}),await n($,D),$.send(t)})}return R()}function Ov(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Rv(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function Al(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var Lv={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function er(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qT=0;function Qs(i){return"__private_"+qT+++"_"+i}var VT={version:"4.3.3"};function jT(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),Cv(i)?(t=new Oo(t,i),t):(t.request=i,t)}function Mv(i){return i.data.slice(0,i.data.size,i.meta.type)}var WT={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},ms=Qs("getFetcher"),wd=Qs("uploadLocalFile"),bd=Qs("uploadBundle"),Sd=Qs("getCompanionClientArgs"),yd=Qs("uploadFiles"),Lo=Qs("handleUpload"),Zs=class extends gr{constructor(e,t){if(super(e,{...WT,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,yd,{value:YT}),Object.defineProperty(this,Sd,{value:XT}),Object.defineProperty(this,bd,{value:KT}),Object.defineProperty(this,wd,{value:GT}),Object.defineProperty(this,ms,{writable:!0,value:void 0}),Object.defineProperty(this,Lo,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[Tl]&&this.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"),this.uppy.log("[XHRUpload] Uploading...");let s=this.uppy.getFilesByIds(r),n=Ov(s),o=Rv(n);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await er(this,bd)[bd](n)}else await er(this,yd)[yd](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Lv,this.i18nInit(),Tl in this.opts?this.requests=this.opts[Tl]:this.requests=new El(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),er(this,ms)[ms]=r=>async(s,n)=>{try{var o,a,l;let f=await _v(s,{...n,onBeforeRequest:(x,P)=>{var F,R;return(F=(R=this.opts).onBeforeRequest)==null?void 0:F.call(R,x,P,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:x=>{let P=Math.ceil(x/1e3),F=new Error(this.i18n("uploadStalled",{seconds:P}));this.uppy.emit("upload-stalled",F,r)},onUploadProgress:x=>{if(x.lengthComputable)for(let{id:F}of r){var P;let R=this.uppy.getFile(F);this.uppy.emit("upload-progress",R,{uploadStarted:(P=R.progress.uploadStarted)!=null?P:0,bytesUploaded:x.loaded/x.total*R.size,bytesTotal:R.size})}}}),y=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,f));if(f.responseType==="json"){var c;(c=y)!=null||(y=f.response)}else try{var d;(d=y)!=null||(y=JSON.parse(f.responseText))}catch(x){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:x})}let v=typeof((l=y)==null?void 0:l.url)=="string"?y.url:void 0;for(let{id:x}of r)this.uppy.emit("upload-success",this.uppy.getFile(x),{status:f.status,body:y,uploadURL:v});return f}catch(f){if(f.name==="AbortError")return;let y=f.request;for(let v of r)this.uppy.emit("upload-error",this.uppy.getFile(v.id),jT(y,f),y);throw f}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){Al(r.allowedMetaFields,t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(a=>e.append(n,a)):e.append(n,o)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=Mv(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let o=this.getOptions(n),a=Mv(n);n.name?r.append(o.fieldName,a,n.name):r.append(o.fieldName,a)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(er(this,Lo)[Lo])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(er(this,Lo)[Lo])}};async function GT(i){let e=new Fo(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=er(this,ms)[ms]([i]),o=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:o,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function KT(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=er(this,ms)[ms](i),a=this.createBundledUpload(i,{...this.opts,...n});return o(this.opts.endpoint,{...this.opts,body:a,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function XT(i){var e;let t=this.getOptions(i),r=Al(t.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function YT(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=()=>this.requests,r=new AbortController,s=o=>{o.id===e.id&&r.abort()};this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,er(this,Sd)[Sd](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return er(this,wd)[wd](e)}))}Zs.VERSION=VT.version;var ut=class{static fromTemplate(i){if(Rs.isSupported)return Rs.sanitize(i,{USE_PROFILES:{html:!0,svg:!0},RETURN_DOM:!0}).children[0];{let e=new DOMParser().parseFromString(i,"text/html").body.children[0];return ZT(e)}}};function ZT(i){return QT(i),Iv(i),i}function QT(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function JT(i,e){let t=e.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(i)&&(t.includes("javascript:")||t.includes("data:"))||i.startsWith("on"))return!0}function ex(i){let e=i.attributes;for(let{name:t,value:r}of e)JT(t,r)&&i.removeAttribute(t)}function Iv(i){let e=i.children;for(let t of e)ex(t),Iv(t)}var Pl=class extends ie{static values={identifier:String,maxFileSize:{type:Number,default:null},minFileSize:{type:Number,default:null},maxTotalSize:{type:Number,default:null},maxFileNum:{type:Number,default:null},minFileNum:{type:Number,default:null},allowedFileTypes:{type:Array,default:null},requiredMetaFields:{type:Array,default:[]}};static outlets=["attachment-preview","attachment-preview-container"];connect(){this.uploadedFiles=[],this.element.style.display="none",this.configureUppy(),this.#a(),this.#s()}disconnect(){this.uppy=null}attachmentPreviewOutletConnected(i,e){this.#s()}attachmentPreviewOutletDisconnected(i,e){this.#s()}configureUppy(){this.uppy=new $a({restrictions:{maxFileSize:this.maxFileSizeValue,minFileSize:this.minFileSizeValue,maxTotalFileSize:this.maxTotalSizeValue,maxNumberOfFiles:this.maxFileNumValue,minNumberOfFiles:this.minFileNumValue,allowedFileTypes:this.allowedFileTypesValue,requiredMetaFields:this.requiredMetaFieldsValue}}).use(wr,{inline:!1,closeAfterFinish:!0}).use(cs,{target:wr}),this.#e(),this.#t()}#e(){this.uppy.use(Zs,{endpoint:"/upload"})}#t(){this.uppy.on("upload-success",this.#o.bind(this))}#i(){let i=document.documentElement.getAttribute("data-bs-theme")||"auto";this.#l.setOptions({theme:i});let e=null;for(;e=this.uploadedFiles.pop();)this.uppy.removeFile(e.id);this.#l.openModal()}#o(i,e){this.uploadedFiles.push(i),this.multiple||this.attachmentPreviewOutlets.forEach(s=>s.remove());let t=e.body.data,r=e.body.url;this.attachmentPreviewContainerOutlet.element.appendChild(this.#n(t,r))}#s(){if(!this.deleteAllTrigger)return;this.attachmentPreviewOutlets.length>1?(this.deleteAllTrigger.style.display="initial",this.deleteAllTrigger.textContent=`Delete ${this.attachmentPreviewOutlets.length}`):this.deleteAllTrigger.style.display="none"}#a(){this.triggerContainer=document.createElement("div"),this.triggerContainer.className="flex items-center gap-2",this.element.insertAdjacentElement("afterend",this.triggerContainer),this.#r(),this.uploadTrigger&&this.triggerContainer.append(this.uploadTrigger),this.deleteAllTrigger&&this.triggerContainer.append(this.deleteAllTrigger)}#r(){let i=this.multiple?"Choose files":"Choose file";this.uploadTrigger=ut.fromTemplate(`<button type="button" class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700 inline-flex items-center">
|
97
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Zm(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Zm(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 r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",ig(...e.get(2),e.get(1))),e.set("longitude",ig(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of Ve)if(e=this[t],!ag(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function ig(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ve(eo,"type","tiff"),ve(eo,"headerLength",10),Nt.set("tiff",eo);var iF=Object.freeze({__proto__:null,default:VS,Exifr:qs,fileParsers:sl,segmentParsers:Nt,fileReaders:no,tagKeys:oo,tagValues:ph,tagRevivers:fh,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:el,readBlobAsArrayBuffer:ro,chunkedProps:Us,otherSegments:nl,segments:so,tiffBlocks:Ve,segmentsAndBlocks:zs,tiffExtractables:Hs,inheritables:ol,allFormatters:$s,Options:Jr,parse:ug}),mh={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},rF=Object.assign({},mh,{firstChunkSize:4e4,gps:[1,2,3,4]});var sF=Object.assign({},mh,{tiff:!1,ifd1:!0,mergeOutput:!1});var XS=Object.assign({},mh,{firstChunkSize:4e4,ifd0:[274]});async function YS(i){let e=new qs(XS);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var ZS=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}}),Qn=!0,Jn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Qn=Number(t)+.1*Number(r)<13.4,Jn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Qn=Jn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Qn=Jn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Qn=Jn=Number(e)<77}}async function hg(i){let e=await YS(i);return Object.assign({canvas:Qn,css:Jn},ZS[e])}var uh=class extends Qr{constructor(...e){super(...e),ve(this,"ranges",new hh),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=og?ng.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}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)}},hh=class{constructor(){ve(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>rg(e,o.offset,s)||rg(e,o.end,s));if(n.length>0){e=Math.min(e,...n.map(a=>a.offset)),s=Math.max(s,...n.map(a=>a.end)),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter(a=>!n.includes(a))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function rg(i,e,t){return i<=e&&e<=t}var dh=class extends uh{constructor(e,t){super(0),ve(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,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};no.set("blob",class extends dh{async readWhole(){this.chunked=!1;let i=await ro(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await ro(r);return this.set(s,i,!0)}});var dg={strings:{generatingThumbnails:"Generating thumbnails..."}};var QS={version:"4.1.1"};function JS(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>Xm(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function eE(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function tE(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}var iE={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Vs=class extends di{constructor(e,t){if(super(e,{...iE,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&Ja(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&Qa(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Qa(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=()=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=dg,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{let c=new Image;c.src=s,c.addEventListener("load",()=>{URL.revokeObjectURL(s),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=hg(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),f=eE(l,c),y=this.resizeImage(f,d.width,d.height);return JS(y,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=tE(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1),l=2;for(;n--;){let c=document.createElement("canvas");c.width=o,c.height=a,c.getContext("2d").drawImage(s,0,0,o,a),s=c,o=Math.round(o/l),a=Math.round(a/l)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ja(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};Vs.VERSION=QS.version;function rE(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Wn(i)?[i]:null}var gh=rE;var br=Array.from;function al(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{al(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function pg(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{al(t,[],e,{onSuccess:n=>s(n.map(o=>pg(o,e)))})})},isSameEntry:void 0}}function fg(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=()=>`${e}/${i.name}`;if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*fg(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*vh(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=pg(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*fg(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function bh(i){let e=br(i.files);return Promise.resolve(e)}async function yh(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of vh(i,r))s.push(n);return s}catch{return bh(i)}}var Vg=Fe(wt(),1);function ao(i){return{...i,type:i.mimeType,extension:i.name?Vr(i.name).extension:null}}var lo,ze,wh,mg,co=0,Tg=[],je=Ee,gg=je.__b,vg=je.__r,bg=je.diffed,yg=je.__c,wg=je.unmount,Sg=je.__;function Eh(i,e){je.__h&&je.__h(ze,i,co||e),co=0;var t=ze.__H||(ze.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function fi(i){return co=1,sE(kg,i)}function sE(i,e,t){var r=Eh(lo++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):kg(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ze,!ze.__f)){var s=function(a,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(y){return!!y.__c});if(d.every(function(y){return!y.__N}))return!n||n.call(this,a,l,c);var f=r.__c.props!==a;return d.forEach(function(y){if(y.__N){var v=y.__[0];y.__=y.__N,y.__N=void 0,v!==y.__[0]&&(f=!0)}}),n&&n.call(this,a,l,c)||f};ze.__f=!0;var n=ze.shouldComponentUpdate,o=ze.componentWillUpdate;ze.componentWillUpdate=function(a,l,c){if(this.__e){var d=n;n=void 0,s(a,l,c),n=d}o&&o.call(this,a,l,c)},ze.shouldComponentUpdate=s}return r.__N||r.__}function ki(i,e){var t=Eh(lo++,3);!je.__s&&xg(t.__H,e)&&(t.__=i,t.u=e,ze.__H.__h.push(t))}function es(i){return co=5,ts(function(){return{current:i}},[])}function ts(i,e){var t=Eh(lo++,7);return xg(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function is(i,e){return co=8,ts(function(){return i},e)}function nE(){for(var i;i=Tg.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(ll),i.__H.__h.forEach(Sh),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){ze=null,gg&&gg(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Sg&&Sg(i,e)},je.__r=function(i){vg&&vg(i),lo=0;var e=(ze=i.__c).__H;e&&(wh===ze?(e.__h=[],ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ll),e.__h.forEach(Sh),e.__h=[],lo=0)),wh=ze},je.diffed=function(i){bg&&bg(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Tg.push(e)!==1&&mg===je.requestAnimationFrame||((mg=je.requestAnimationFrame)||oE)(nE)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),wh=ze=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(ll),t.__h=t.__h.filter(function(r){return!r.__||Sh(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),yg&&yg(i,e)},je.unmount=function(i){wg&&wg(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ll(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var Eg=typeof requestAnimationFrame=="function";function oE(i){var e,t=function(){clearTimeout(r),Eg&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Eg&&(e=requestAnimationFrame(t))}function ll(i){var e=ze,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ze=e}function Sh(i){var e=ze;i.__c=i.__(),ze=e}function xg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function kg(i,e){return typeof e=="function"?e(i):e}function aE(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("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"}),u("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"}),u("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"}),u("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"}),u("path",{d:"M4 4h18v18H4z"})))}function lE(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=is(o=>{o.preventDefault(),r()},[r]);return u("form",{onSubmit:n},s?u("button",{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},u(aE,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var cE=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(lE,{pluginName:e,i18n:t,onAuth:r})};function cl(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=cE}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},r()),u("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),o({pluginName:t,i18n:s,loading:e,onAuth:n}))}var Ag=Fe(wt(),1);function Th(i){let{i18n:e,logout:t,username:r}=i;return u(Mt,null,r&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function xh(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((o,a)=>{var l;return u(Mt,null,u("button",{key:o.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(o.id)},o.type==="root"?t:(l=o.data.name)!=null?l:n("unnamed")),s.length===a+1?"":" / ")}))}function kh(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Ag.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(xh,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Th,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Ah(){return Ah=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ah.apply(null,arguments)}var uE={position:"relative",width:"100%",minHeight:"100%"},hE={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ph=class extends dt{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...o}=e,{offset:a,height:l}=this.state,c=Math.floor(a/r),d=Math.floor(l/r);n&&(c=Math.max(0,c-c%n),d+=n);let f=c+d+4,y=t.slice(c,f),v={...uE,height:t.length*r},x={...hE,top:c*r};return u("div",Ah({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:x},y.map(s))))}},ul=Ph;var Pg=Fe(wt(),1);function dE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("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 pE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-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 fE(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("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"}),u("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 js(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(dE,null);case"folder":return u(pE,null);case"video":return u(fE,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function mE(i){var e,t;let{file:r,toggleCheckbox:s,className:n,isDisabled:o,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:n,title:o&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:r.id,checked:r.status==="checked",disabled:o,"data-uppy-super-focusable":!0}),u("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(js,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var Ch=mE;function Fh(i){var e,t,r;let{file:s,openFolder:n,className:o,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:f}=i;return u("li",{className:o,title:s.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?f("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:f("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),s.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>n(s.id),"aria-label":f("openFolderNamed",{name:(t=s.data.name)!=null?t:f("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(js,{itemIconString:s.data.icon})),d&&s.data.name?u("span",null,s.data.name):f("unnamed")):u("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(js,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:f("unnamed"))))}function _h(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:s,openFolder:n,file:o,utmSource:a}=i,l=o.type==="folder"?null:o.restrictionError,c=!!l&&o.status!=="checked",d={file:o,openFolder:n,toggleCheckbox:t,utmSource:a,i18n:s,viewType:e,showTitles:r,className:(0,Pg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":o.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":o.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":o.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return u(Ch,d);case"list":return u(Fh,d);case"unsplash":return u(Ch,d,u("a",{href:`${o.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},o.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function gE(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:f}=i,[y,v]=fi(!1);if(ki(()=>{let P=R=>{R.key==="Shift"&&v(!1)},F=R=>{R.key==="Shift"&&v(!0)};return document.addEventListener("keyup",P),document.addEventListener("keydown",F),()=>{document.removeEventListener("keyup",P),document.removeEventListener("keydown",F)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:o("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let x=P=>u(_h,{viewType:t,toggleCheckbox:F=>{var R;F.stopPropagation(),F.preventDefault(),(R=document.getSelection())==null||R.removeAllRanges(),r(P,y)},showTitles:n,i18n:o,openFolder:l,file:P,utmSource:f});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(ul,{data:e,renderRow:x,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(x)))}var hl=gE;var vE=(i,e,t,r,s)=>{let n=e.filter(v=>v.isFolder===!0),o=e.filter(v=>v.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:v})),c=o.map(v=>{let x=s(v);return{type:"file",id:v.requestPath,restrictionError:x,status:a&&!x?"checked":"unchecked",parentId:t.id,data:v}}),d={...t,cached:!0,nextPagePath:r};return[...i.map(v=>v.id===d.id?d:v),...l,...c]},Cg=vE;var bE=(i,e,t,r,s)=>{let n=i.find(x=>x.id===e),o=t.filter(x=>x.isFolder===!0),a=t.filter(x=>x.isFolder===!1),l={...n,nextPagePath:r},c=i.map(x=>x.id===l.id?l:x),d=l.type==="folder"&&l.status==="checked",f=o.map(x=>({type:"folder",id:x.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:x})),y=a.map(x=>{let P=s(x);return{type:"file",id:x.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:x}});return[...c,...f,...y]},Fg=bE;var yE=i=>i.map(e=>({...e})),dl=yE;var Oh=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",Oh(i,s.id,t)})},Rh=(i,e)=>{let t=i.find(o=>o.id===e);if(t.type==="root")return;let r=i.filter(o=>o.type!=="root"&&o.parentId===t.id&&!(o.type==="file"&&o.restrictionError)),s=r.every(o=>o.status==="checked"),n=r.every(o=>o.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Rh(i,t.parentId)},wE=(i,e)=>{let t=dl(i);if(e.length>=2){let r=t.filter(s=>s.type!=="root"&&e.includes(s.id));r.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),r.forEach(s=>{Oh(t,s.id,!0)}),Rh(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Oh(t,r.id,r.status==="checked"),Rh(t,r.parentId)}return t},_g=wE;var Mh=Fe(Rg(),1);var ho=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Ih=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Lg=i=>globalThis.DOMException===void 0?new Ih(i):new DOMException(i),Mg=i=>{let e=i.reason===void 0?Lg("This operation was aborted."):i.reason;return e instanceof Error?e:Lg(e)};function Dh(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,a,c=new Promise((d,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:v}=e;v.aborted&&f(Mg(v)),a=()=>{f(Mg(v))},v.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,f);return}let y=new ho;o=n.setTimeout.call(void 0,()=>{if(r){try{d(r())}catch(v){f(v)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?d():s instanceof Error?f(s):(y.message=s??`Promise timed out after ${t} milliseconds`,f(y))},t),(async()=>{try{d(await i)}catch(v){f(v)}})()}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{n.clearTimeout.call(void 0,o),o=void 0},c}function Nh(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var po=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let s=Nh(this.#e,r,(n,o)=>o.priority-n.priority);this.#e.splice(s,0,r)}setPriority(e,t){let r=this.#e.findIndex(n=>n.id===e);if(r===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[s]=this.#e.splice(r,1);this.enqueue(s.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var fo=class extends Mh.default{#e;#t;#i=0;#o;#s;#a=0;#r;#c;#n;#d;#l=0;#p;#u;#g;#v=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:po,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#o=e.intervalCap,this.#s=e.interval,this.#n=new e.queueClass,this.#d=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#u=e.autoStart===!1}get#h(){return this.#t||this.#i<this.#o}get#b(){return this.#l<this.#p}#f(){this.#l--,this.#m(),this.emit("next")}#y(){this.#x(),this.#T(),this.#c=void 0}get#w(){let e=Date.now();if(this.#r===void 0){let t=this.#a-e;if(t<0)this.#i=this.#e?this.#l:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#y()},t)),!0}return!1}#m(){if(this.#n.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#l===0&&this.emit("idle"),!1;if(!this.#u){let e=!this.#w;if(this.#h&&this.#b){let t=this.#n.dequeue();return t?(this.emit("active"),t(),e&&this.#T(),!0):!1}}return!1}#T(){this.#t||this.#r!==void 0||(this.#r=setInterval(()=>{this.#x()},this.#s),this.#a=Date.now()+this.#s)}#x(){this.#i===0&&this.#l===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#i=this.#e?this.#l:0,this.#S()}#S(){for(;this.#m(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#S()}async#k(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}setPriority(e,t){this.#n.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#v++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((r,s)=>{this.#n.enqueue(async()=>{this.#l++,this.#i++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Dh(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#k(t.signal)]));let o=await n;r(o),this.emit("completed",o)}catch(n){if(n instanceof ho&&!t.throwOnTimeout){r();return}s(n),this.emit("error",n)}finally{this.#f()}},t),this.emit("add"),this.#m()})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return this.#u?(this.#u=!1,this.#S(),this):this}pause(){this.#u=!0}clear(){this.#n=new this.#d}async onEmpty(){this.#n.size!==0&&await this.#E("empty")}async onSizeLessThan(e){this.#n.size<e||await this.#E("next",()=>this.#n.size<e)}async onIdle(){this.#l===0&&this.#n.size===0||await this.#E("idle")}async#E(e,t){return new Promise(r=>{let s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})}get size(){return this.#n.size}sizeBy(e){return this.#n.filter(e).length}get pending(){return this.#l}get isPaused(){return this.#u}};var Ig=async(i,e,t,r,s)=>{let n=[],o=t.cached?t.nextPagePath:t.id;for(;o;){let f=await r(o);n=n.concat(f.items),o=f.nextPagePath}let a=n.filter(f=>f.isFolder===!0),l=n.filter(f=>f.isFolder===!1),c=a.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),d=l.map(f=>{let y=s(f);return{type:"file",id:f.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(async f=>{i.add(()=>Ig(i,e,f,r,s))})},TE=async(i,e,t,r)=>{let s=new fo({concurrency:6}),n=dl(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>Ig(s,n,a,e,t))}),s.on("completed",()=>{let a=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(a)}),await s.onIdle(),n},Dg=TE;var rs={afterOpenFolder:Cg,afterScrollFolder:Fg,afterToggleCheckbox:_g,afterFill:Dg};var xE=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},fl=xE;var kE=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Gi=kE;var AE=(i,e,t,r)=>{let s=e.findIndex(n=>n.id===r);if(s!==-1&&t){let n=e.findIndex(a=>a.id===i);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(a=>a.id)}return[i]},ml=AE;function PE(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:s,inputClassName:n,inputLabel:o,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,f=x=>{t(x.target.value)},y=is(x=>{x.preventDefault(),r()},[r]),[v]=fi(()=>{let x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=mr(),x});return ki(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),u("section",{className:s},u("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":o,placeholder:o,value:e,onInput:f,form:v.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("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"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("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"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:v.id},c))}var Ws=PE;var Bg=Fe(wt(),1);var CE=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,Ng=CE;function mo(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=ts(()=>n(s),[s,n]),a=ts(()=>Ng(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Bg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button"},r("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),o&&u("div",{className:"uppy-ProviderBrowser-footer-error"},o))}var FE=(i,e,t)=>{var r,s;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(s=i.author)==null?void 0:s.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},Ug=FE;var _E=(i,e,t)=>{let r=i.map(o=>Ug(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(Na(o,e.uppy.getID()))?n.push(o):s.push(o)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},gl=_E;var zg=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let s=i.find(o=>o.id===e);if(s.type==="root")return[];let n=[...zg(i,s.parentId,t),s];return t[r]=n,n},OE=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=zg(i,s.id,e),o=n.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=n.slice(o),l=`/${n.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return{...s.data,absDirPath:l,relDirPath:c}})},vl=OE;var RE=(i,e)=>{let t=i.find(s=>s.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let s=t.parentId;t=i.find(n=>n.id===s)}return r},Hg=RE;function yr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LE=0;function qg(i){return"__private_"+LE+++"_"+i}var ME={version:"4.4.2"};function go(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var $g=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),ss=qg("abortController"),mi=qg("withAbort"),Gs=class{constructor(e,t){Object.defineProperty(this,mi,{value:IE}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,ss,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=ao(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:o}=this.plugin.getPluginState(),a=s.filter(c=>c.type!=="root"&&c.parentId===n);return o===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(o.toLowerCase())!==-1})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...r,...t},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.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState($g(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(s=>s.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await yr(this,mi)[mi](async s=>{let n=e,o=[];do{let{username:l,nextPagePath:c,items:d}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:l}),n=c,o=o.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);let a=rs.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}async logout(){await yr(this,mi)[mi](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState({...$g(this.plugin.rootFolderId),authenticated:!1})}}).catch(Gi(this.plugin.uppy))}async handleAuth(e){await yr(this,mi)[mi](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(Gi(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);fl(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await yr(this,mi)[mi](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=rs.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(Gi(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await yr(this,mi)[mi](async t=>{let r=await rs.afterFill(e,o=>this.provider.list(o,{signal:t}),this.validateSingleFile,o=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:o}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=vl(r);gl(n,this.plugin,this.provider),this.resetPluginState()}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:o,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||go;if(o===!1)return u(cl,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:f,searchString:y}=this.plugin.getPluginState(),v=Hg(c,d);return u("div",{className:(0,Vg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(kh,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:s}),n.showFilter&&u(Ws,{searchString:y,setSearchString:x=>{this.plugin.setPluginState({searchString:x})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),u(mo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function IE(i){var e;(e=yr(this,ss)[ss])==null||e.abort();let t=new AbortController;yr(this,ss)[ss]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),yr(this,ss)[ss]=void 0}}Gs.VERSION=ME.version;var jg=Fe(wt(),1);var DE={version:"4.4.2"},NE={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},BE={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},Ks=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let s=ao(r);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(s=>s.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let n=r.filter(o=>o.type==="file"&&o.status==="checked").map(o=>o.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider,this.opts={...BE,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(NE)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){Gi(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(fl(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(r,s.nextPagePath),o={...s,nextPagePath:n.nextPageQuery},a=t.filter(c=>c.type!=="root"),l=[o,...a,...n.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(n){Gi(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=vl(e);gl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:s,loading:n,partialTree:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l={...this.opts,...t};return r?u(Ws,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,jg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Ws,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),u(mo,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Ks.VERSION=DE.version;var Wg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function UE(i,e){return!!(i===e||Wg(i)&&Wg(e))}function zE(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!UE(i[t],e[t]))return!1;return!0}function Bh(i,e){e===void 0&&(e=zE);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}var bl=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function vo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Gg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function HE(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function $E(i){return i.contains(document.activeElement)}function Uh(i,e,t){let r=vo(t,e),s=br(r.querySelectorAll(bl)),n=s.indexOf(document.activeElement);$E(r)?i.shiftKey&&n===0?HE(i,s):!i.shiftKey&&n===s.length-1&&Gg(i,s):Gg(i,s)}function Kg(i,e,t){e===null||Uh(i,e,t)}var Xg=Fe(Cu(),1);function zh(){let i=!1;return(0,Xg.default)((t,r)=>{let s=vo(t,r),n=s.contains(document.activeElement);if(n&&i)return;let o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{let a=s.querySelector(bl);a?.focus({preventScroll:!0}),i=!1}},260)}var pv=Fe(wt(),1);function Hh(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Jg=Fe(wt(),1);function Yg(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),s=t.length;if(r.length!==s)return!1;for(let n=0;n<s;n++){let o=t[n];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function VE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("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"}),u("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"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function jE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function WE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("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"}))}function GE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function KE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function XE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("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"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function YE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function ns(i){let e={color:"#838999",icon:XE()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:YE()}:t==="image"?{color:"#686de0",icon:VE()}:t==="audio"?{color:"#068dbb",icon:jE()}:t==="video"?{color:"#19af67",icon:WE()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:GE()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:KE()}:e}function bo(i){let{file:e}=i;if(e.preview)return u("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=ns(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var ZE=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function yo(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let o=n.map(a=>ZE(a,s)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function $h(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":ns(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(bo,{file:e}),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function QE(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function Zg(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function qh(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Zg(i),title:Zg(i),onClick:()=>QE(i)},i.children))}function yl(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function Vh(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("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 jh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(yl,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("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"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(qh,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(qh,i,u(yl,null,u(Vh,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(qh,i,u(yl,null,u(Vh,{progress:i.file.progress.percentage}),u("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"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(yl,null,u(Vh,{progress:i.file.progress.percentage}))))}var Qg=Fe(Ba(),1);var Wh="...";function wl(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Wh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-Wh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Wh+i.slice(-s)}var JE=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},wl(t,r()))},eT=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},wl(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},tT=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Qg.default)(i.file.size)),iT=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),rT=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function Gh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},JE({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(rT,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},eT({file:e}),tT({file:e}),iT({file:e,toggleAddFilesPanel:n,i18n:t})),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function Kh(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function sT(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("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"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function nT(i){let{i18n:e,onClick:t,file:r}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("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"}),u("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 oT(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{Kh(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:n=>s(n)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("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 Xh(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(sT,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(oT,{file:t,uppy:e,i18n:l}):null,a?u(nT,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var wo=class extends dt{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Yg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,Jg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u($h,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(jh,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,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})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(Gh,{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}),u(Xh,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function aT(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function Yh(i){let{id:e,i18n:t,uppy:r,files:s,resumableUploads:n,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,recoveredState:F,individualCancellation:R,itemsPerRow:D,openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,containerWidth:z,containerHeight:G}=i,K=D===1?71:200,Q=ts(()=>{let Y=(le,ke)=>Number(s[ke].isGhost)-Number(s[le].isGhost),re=Object.keys(s);return F&&re.sort(Y),aT(re,D)},[s,D,F]),ne=Y=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Y[0]},Y.map(re=>u(wo,{key:re,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:R,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,recoveredState:F,isSingleFile:y,containerWidth:z,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,file:s[re]})));return y?u("div",{class:"uppy-Dashboard-files"},ne(Q[0])):u(ul,{class:"uppy-Dashboard-files",role:"list",data:Q,renderRow:ne,rowHeight:K})}var Zh=class extends dt{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("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"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("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 "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return u(Mt,null,t.map(s=>this.renderAcquirer(s)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),n.length===1&&n[0].key===o&&(n=[]);let l=[...n],c=l.splice(n.length-2,n.length);return u(Mt,null,this.renderDropPasteBrowseTagline(n.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:f,elements:y}=d;return u(Mt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Mt,{key:f},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Sl=Zh;var ev=Fe(wt(),1);var lT=i=>u("div",{className:(0,ev.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(Sl,i)),tv=lT;var iv=Fe(wt(),1);function cT(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ai=cT;function uT(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=es(null);return u("div",{className:(0,iv.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n,a.current)))}var rv=uT;var sv=Fe(wt(),1);function hT(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,sv.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var nv=hT;var Pi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function dT(i,e,t,r){if(r===void 0&&(r={}),i)return Pi.STATE_ERROR;if(e)return Pi.STATE_COMPLETE;if(t)return Pi.STATE_PAUSED;let s=Pi.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return Pi.STATE_UPLOADING;a.preprocess&&s!==Pi.STATE_UPLOADING&&(s=Pi.STATE_PREPROCESSING),a.postprocess&&s!==Pi.STATE_UPLOADING&&s!==Pi.STATE_PREPROCESSING&&(s=Pi.STATE_POSTPROCESSING)}return s}function pT(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(dT(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function fT(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i,{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!r?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(pT,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("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"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var ov=fT;var av=Fe(wt(),1);function Qh(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:c,form:s.id},u):u("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:c,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Jh(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:f,canEditFile:y}=i,v=()=>typeof o=="function"?o(t[r]):o,x=t[r],P=(e=v())!=null?e:[],F=y(x),R={};P.forEach(K=>{var Q;R[K.id]=(Q=x.meta[K.id])!=null?Q:""});let[D,V]=fi(R),M=is(K=>{K.preventDefault(),n(D,r)},[n,D,r]),$=(K,Q)=>{V({...D,[Q]:K})},z=()=>{s(!1)},[G]=fi(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=mr(),K});return ki(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,av.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},x.meta?x.meta.name:x.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:c("finishEditingFile"),onClick:z},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:ns(x.type).color}},u(bo,{file:x}),F&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{M(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Qh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:$,form:G,formState:D})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:G.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:z,form:G.id},c("cancel")))))}var cv=Fe(wt(),1),Xs="uppy-transition-slideDownUp",lv=250;function mT(i){let{children:e}=i,[t,r]=fi(null),[s,n]=fi(""),o=es(),a=es(),l=es(),c=()=>{n(`${Xs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-enter ${Xs}-enter-active`),o.current=setTimeout(()=>{n("")},lv)})},d=()=>{n(`${Xs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-leave ${Xs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},lv)})};return ki(()=>{let f=xi(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),ki(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?ja(t,{className:(0,cv.default)(s,t.props.className)}):null}var So=mT;function Ys(){return Ys=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ys.apply(null,arguments)}var uv=900,hv=700,ed=576,dv=330;function td(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>ed,s=i.containerHeight>dv,n=(0,pv.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>ed,"uppy-size--lg":i.containerWidth>hv,"uppy-size--xl":i.containerWidth>uv,"uppy-size--height-md":i.containerHeight>dv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>uv?o=5:i.containerWidth>hv?o=4:i.containerWidth>ed&&(o=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Hh(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(ov,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("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"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(Yh,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(Sl,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(So,null,i.showAddFilesPanel?u(tv,Ys({key:"AddFiles"},i,{isSizeMD:r})):null),u(So,null,i.fileCardFor?u(Jh,Ys({key:"FileCard"},i)):null),u(So,null,i.activePickerPanel?u(rv,Ys({key:"Picker"},i)):null),u(So,null,i.showFileEditor?u(nv,Ys({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var fv={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function de(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var gT=0;function ct(i){return"__private_"+gT+++"_"+i}var vT={version:"4.3.2"},id=Bh.default||Bh,mv=9,bT=27;function gv(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var yT={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:go,showLinkToFileUploadResult:!1,showProgressDetails:!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},os=ct("disabledNodes"),Ki=ct("generateLargeThumbnailIfSingleFile"),Eo=ct("openFileEditorWhenFilesAdded"),as=ct("attachRenderFunctionToTarget"),rd=ct("isTargetSupported"),sd=ct("getAcquirers"),nd=ct("getProgressIndicators"),Xi=ct("getEditors"),od=ct("addSpecifiedPluginsFromOptions"),ad=ct("autoDiscoverPlugins"),ls=ct("addSupportedPluginIfNoTarget"),To=ct("getStatusBarOpts"),xo=ct("getThumbnailGeneratorOpts"),ld=ct("getInformerOpts"),ko=ct("getStatusBarId"),Ao=ct("getThumbnailGeneratorId"),cd=ct("getInformerId"),wr=class extends di{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...yT,...t,autoOpen:o}),Object.defineProperty(this,cd,{value:kT}),Object.defineProperty(this,Ao,{value:xT}),Object.defineProperty(this,ko,{value:TT}),Object.defineProperty(this,ld,{value:ET}),Object.defineProperty(this,xo,{value:ST}),Object.defineProperty(this,To,{value:wT}),Object.defineProperty(this,os,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${mr()}`,this.superFocus=zh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:c,type:d},v=this.getPluginState().targets.slice();return v.push(f),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return de(this,Xi)[Xi](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Xi)[Xi](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();de(this,Xi)[Xi](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=gv();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:f}=this.getPluginState();if(d||f)return;let{promise:y,resolve:v}=gv();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),v()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var x;(x=history.state)!=null&&x[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=de(this,os)[os])!=null?l:br(this.el.querySelectorAll(c)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of d)f.tagName==="A"?f.setAttribute("aria-disabled",a):f.disabled=a;a?de(this,os)[os]=d:de(this,os)[os]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===bT&&this.requestCloseModal(),a.keyCode===mv&&Uh(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=br(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=br(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(a)&&(y=!0)}),y},c=()=>{let{types:y}=a.dataTransfer;return y.some(v=>v==="Files")},d=l(),f=c();if(!d&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=async a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(a))});let l=!1,c=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=await yh(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===mv&&Kg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Ki,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d={...l[0],preview:void 0};c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Eo,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,f=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=gh(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",de(this,ls)[ls]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",de(this,Ki)[Ki]),this.uppy.on("file-removed",de(this,Ki)[Ki]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",de(this,Eo)[Eo])},this.removeEvents=()=>{let a=gh(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",de(this,ls)[ls]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",de(this,Ki)[Ki]),this.uppy.off("file-removed",de(this,Ki)[Ki]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",de(this,Eo)[Eo])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,as,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,rd,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,sd,{writable:!0,value:id(a=>a.filter(l=>l.type==="acquirer"&&de(this,rd)[rd](l)).map(de(this,as)[as]))}),Object.defineProperty(this,nd,{writable:!0,value:id(a=>a.filter(l=>l.type==="progressindicator").map(de(this,as)[as]))}),Object.defineProperty(this,Xi,{writable:!0,value:id(a=>a.filter(l=>l.type==="editor").map(de(this,as)[as]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$}=this.uppy.getObjectOfFilesPerState(),z=de(this,sd)[sd](l.targets),G=de(this,nd)[nd](l.targets),K=de(this,Xi)[Xi](l.targets),Q;return this.opts.theme==="auto"?Q=d.darkMode?"dark":"light":Q=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),td({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:z,theme:Q,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:G,editors:K,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,od,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,ad,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,ls)[ls])}}),Object.defineProperty(this,ls,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(f=>a.id===f.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)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.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use(Xr,{id:de(this,ko)[ko](),target:this,...de(this,To)[To]()}),this.opts.disableInformer||this.uppy.use(Yr,{id:de(this,cd)[cd](),target:this,...de(this,ld)[ld]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Vs,{id:de(this,Ao)[Ao](),...de(this,xo)[xo]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}de(this,od)[od](),de(this,ad)[ad](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=fv,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(de(this,ko)[ko]()))==null||t.setOptions(de(this,To)[To]()),(r=this.uppy.getPlugin(de(this,Ao)[Ao]()))==null||r.setOptions(de(this,xo)[xo]())}};function wT(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:o,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:o,doneButtonHandler:a}}function ST(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function ET(){return{}}function TT(){return`${this.id}:StatusBar`}function xT(){return`${this.id}:ThumbnailGenerator`}function kT(){return`${this.id}:Informer`}wr.VERSION=vT.version;var Ev=Fe(vv(),1);function AT(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}var bv=AT;function PT(i){return i*(Math.PI/180)}function CT(i,e,t){let r=Math.abs(PT(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var yv=CT;function FT(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var wv=FT;function _T(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var Sv=_T;var Po=class extends dt{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=bv(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let o=this.cropper.getImageData(),a=yv(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Ev.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=wv(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=Sv(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return u("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},u("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),u("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),u("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),u("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return u("div",{className:"uppy-ImageCropper"},u("div",{className:"uppy-ImageCropper-container"},u("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),u("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var Tv={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var OT={version:"3.3.1"},xv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},kv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},RT={quality:.8,actions:kv,cropperOptions:xv},cs=class extends di{constructor(e,t){super(e,{...RT,...t,actions:{...kv,...t?.actions},cropperOptions:{...xv,...t?.cropperOptions}}),this.save=()=>{let r=o=>{var a;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([o],(a=l.name)!=null?a:this.i18n("unnamed"),{type:o.type}),size:o.size,preview:void 0});let c=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",c),this.setPluginState({currentImage:c}),this.uppy.emit("file-editor:complete",c)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Tv,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:u(Po,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};cs.VERSION=OT.version;function Yi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LT=0;function Av(i){return"__private_"+LT+++"_"+i}var Tt=Av("uppy"),Co=Av("events"),Fo=class{constructor(e){Object.defineProperty(this,Tt,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:[]}),Yi(this,Tt)[Tt]=e}on(e,t){return Yi(this,Co)[Co].push([e,t]),Yi(this,Tt)[Tt].on(e,t)}remove(){for(let[e,t]of Yi(this,Co)[Co].splice(0))Yi(this,Tt)[Tt].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Yi(r,Tt)[Tt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Yi(this,Tt)[Tt].getFile(e)&&t()})}};function te(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MT=0;function Ft(i){return"__private_"+MT+++"_"+i}function IT(i){return new Error("Cancelled",{cause:i})}function Pv(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Ut=Ft("activeRequests"),kt=Ft("queuedHandlers"),Bt=Ft("paused"),us=Ft("pauseTimer"),xt=Ft("downLimit"),hs=Ft("upperLimit"),Zi=Ft("rateLimitingTimer"),_o=Ft("call"),Qi=Ft("queueNext"),fd=Ft("next"),dd=Ft("queue"),md=Ft("dequeue"),pd=Ft("resume"),ds=Ft("increaseLimit"),El=class{constructor(e){Object.defineProperty(this,md,{value:zT}),Object.defineProperty(this,dd,{value:UT}),Object.defineProperty(this,fd,{value:BT}),Object.defineProperty(this,Qi,{value:NT}),Object.defineProperty(this,_o,{value:DT}),Object.defineProperty(this,Ut,{writable:!0,value:0}),Object.defineProperty(this,kt,{writable:!0,value:[]}),Object.defineProperty(this,Bt,{writable:!0,value:!1}),Object.defineProperty(this,us,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:1}),Object.defineProperty(this,hs,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,pd,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ds,{writable:!0,value:()=>{if(te(this,Bt)[Bt]){te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],0);return}te(this,xt)[xt]=this.limit,this.limit=Math.ceil((te(this,hs)[hs]+te(this,xt)[xt])/2);for(let t=te(this,xt)[xt];t<=this.limit;t++)te(this,Qi)[Qi]();te(this,hs)[hs]-te(this,xt)[xt]>3?te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],2e3):te(this,xt)[xt]=Math.floor(te(this,xt)[xt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!te(this,Bt)[Bt]&&te(this,Ut)[Ut]<this.limit?te(this,_o)[_o](e):te(this,dd)[dd](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:Pv,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a,l=new Promise((c,d)=>{a=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{f?d(f):(a.done(),c(v))},v=>{f?d(f):(a.done(),d(v))}),v=>{f=IT(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Pv,l}}resume(){te(this,Bt)[Bt]=!1,clearTimeout(te(this,us)[us]);for(let e=0;e<this.limit;e++)te(this,Qi)[Qi]()}pause(e){e===void 0&&(e=null),te(this,Bt)[Bt]=!0,clearTimeout(te(this,us)[us]),e!=null&&(te(this,us)[us]=setTimeout(te(this,pd)[pd],e))}rateLimit(e){clearTimeout(te(this,Zi)[Zi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,hs)[hs]=this.limit-1,this.limit=te(this,xt)[xt],te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],e))}get isPaused(){return te(this,Bt)[Bt]}};function DT(i){te(this,Ut)[Ut]+=1;let e=!1,t;try{t=i()}catch(r){throw te(this,Ut)[Ut]-=1,r}return{abort:r=>{e||(e=!0,te(this,Ut)[Ut]-=1,t?.(r),te(this,Qi)[Qi]())},done:()=>{e||(e=!0,te(this,Ut)[Ut]-=1,te(this,Qi)[Qi]())}}}function NT(){queueMicrotask(()=>te(this,fd)[fd]())}function BT(){if(te(this,Bt)[Bt]||te(this,Ut)[Ut]>=this.limit||te(this,kt)[kt].length===0)return;let i=te(this,kt)[kt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,_o)[_o](i.fn);i.abort=e.abort,i.done=e.done}function UT(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,md)[md](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,kt)[kt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,kt)[kt].push(t):te(this,kt)[kt].splice(r,0,t),t}function zT(i){let e=te(this,kt)[kt].indexOf(i);e!==-1&&te(this,kt)[kt].splice(e,1)}var Tl=Symbol("__queue");var gd=class extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},Oo=gd;function HT(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Cv=HT;function Yt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $T=0;function xl(i){return"__private_"+$T+++"_"+i}var Ji=xl("aliveTimer"),ps=xl("isDone"),Ro=xl("onTimedOut"),fs=xl("timeout"),vd=class{constructor(e,t){Object.defineProperty(this,Ji,{writable:!0,value:void 0}),Object.defineProperty(this,ps,{writable:!0,value:!1}),Object.defineProperty(this,Ro,{writable:!0,value:void 0}),Object.defineProperty(this,fs,{writable:!0,value:void 0}),Yt(this,fs)[fs]=e,Yt(this,Ro)[Ro]=()=>t(e)}progress(){Yt(this,ps)[ps]||Yt(this,fs)[fs]>0&&(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=setTimeout(Yt(this,Ro)[Ro],Yt(this,fs)[fs]))}done(){Yt(this,ps)[ps]||(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=void 0,Yt(this,ps)[ps]=!0)}},Fv=vd;var kl=()=>{};function _v(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=kl,onUploadProgress:o=kl,shouldRetry:a=()=>!0,onAfterResponse:l=kl,onTimeout:c=kl,responseType:d,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:x=!1}=e,P=D=>.3*2**(D-1)*1e3,F=new Fv(v,c);function R(D){return D===void 0&&(D=0),new Promise(async(V,M)=>{let $=new XMLHttpRequest,z=G=>{a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(G))};$.open(s,i,!0),$.withCredentials=x,d&&($.responseType=d),y?.addEventListener("abort",()=>{$.abort(),M(new DOMException("Aborted","AbortError"))}),$.onload=async()=>{try{await l($,D)}catch(G){G.request=$,z(G);return}$.status>=200&&$.status<300?(F.done(),V($)):a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(new Oo($.statusText,$)))},$.onerror=()=>z(new Oo($.statusText,$)),$.upload.onprogress=G=>{F.progress(),o(G)},r&&Object.keys(r).forEach(G=>{$.setRequestHeader(G,r[G])}),await n($,D),$.send(t)})}return R()}function Ov(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Rv(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function Al(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var Lv={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function er(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qT=0;function Qs(i){return"__private_"+qT+++"_"+i}var VT={version:"4.3.3"};function jT(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),Cv(i)?(t=new Oo(t,i),t):(t.request=i,t)}function Mv(i){return i.data.slice(0,i.data.size,i.meta.type)}var WT={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},ms=Qs("getFetcher"),wd=Qs("uploadLocalFile"),bd=Qs("uploadBundle"),Sd=Qs("getCompanionClientArgs"),yd=Qs("uploadFiles"),Lo=Qs("handleUpload"),Zs=class extends gr{constructor(e,t){if(super(e,{...WT,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,yd,{value:YT}),Object.defineProperty(this,Sd,{value:XT}),Object.defineProperty(this,bd,{value:KT}),Object.defineProperty(this,wd,{value:GT}),Object.defineProperty(this,ms,{writable:!0,value:void 0}),Object.defineProperty(this,Lo,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[Tl]&&this.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"),this.uppy.log("[XHRUpload] Uploading...");let s=this.uppy.getFilesByIds(r),n=Ov(s),o=Rv(n);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await er(this,bd)[bd](n)}else await er(this,yd)[yd](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Lv,this.i18nInit(),Tl in this.opts?this.requests=this.opts[Tl]:this.requests=new El(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),er(this,ms)[ms]=r=>async(s,n)=>{try{var o,a,l;let f=await _v(s,{...n,onBeforeRequest:(x,P)=>{var F,R;return(F=(R=this.opts).onBeforeRequest)==null?void 0:F.call(R,x,P,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:x=>{let P=Math.ceil(x/1e3),F=new Error(this.i18n("uploadStalled",{seconds:P}));this.uppy.emit("upload-stalled",F,r)},onUploadProgress:x=>{if(x.lengthComputable)for(let{id:F}of r){var P;let R=this.uppy.getFile(F);this.uppy.emit("upload-progress",R,{uploadStarted:(P=R.progress.uploadStarted)!=null?P:0,bytesUploaded:x.loaded/x.total*R.size,bytesTotal:R.size})}}}),y=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,f));if(f.responseType==="json"){var c;(c=y)!=null||(y=f.response)}else try{var d;(d=y)!=null||(y=JSON.parse(f.responseText))}catch(x){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:x})}let v=typeof((l=y)==null?void 0:l.url)=="string"?y.url:void 0;for(let{id:x}of r)this.uppy.emit("upload-success",this.uppy.getFile(x),{status:f.status,body:y,uploadURL:v});return f}catch(f){if(f.name==="AbortError")return;let y=f.request;for(let v of r)this.uppy.emit("upload-error",this.uppy.getFile(v.id),jT(y,f),y);throw f}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){Al(r.allowedMetaFields,t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(a=>e.append(n,a)):e.append(n,o)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=Mv(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let o=this.getOptions(n),a=Mv(n);n.name?r.append(o.fieldName,a,n.name):r.append(o.fieldName,a)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(er(this,Lo)[Lo])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(er(this,Lo)[Lo])}};async function GT(i){let e=new Fo(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=er(this,ms)[ms]([i]),o=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:o,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function KT(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=er(this,ms)[ms](i),a=this.createBundledUpload(i,{...this.opts,...n});return o(this.opts.endpoint,{...this.opts,body:a,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function XT(i){var e;let t=this.getOptions(i),r=Al(t.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function YT(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=()=>this.requests,r=new AbortController,s=o=>{o.id===e.id&&r.abort()};this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,er(this,Sd)[Sd](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return er(this,wd)[wd](e)}))}Zs.VERSION=VT.version;var ut=class{static fromTemplate(i){if(Rs.isSupported)return Rs.sanitize(i,{USE_PROFILES:{html:!0,svg:!0},RETURN_DOM:!0}).children[0];{let e=new DOMParser().parseFromString(i,"text/html").body.children[0];return ZT(e)}}};function ZT(i){return QT(i),Iv(i),i}function QT(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function JT(i,e){let t=e.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(i)&&(t.includes("javascript:")||t.includes("data:"))||i.startsWith("on"))return!0}function ex(i){let e=i.attributes;for(let{name:t,value:r}of e)JT(t,r)&&i.removeAttribute(t)}function Iv(i){let e=i.children;for(let t of e)ex(t),Iv(t)}var Pl=class extends ie{static values={identifier:String,endpoint:String,maxFileSize:{type:Number,default:null},minFileSize:{type:Number,default:null},maxTotalSize:{type:Number,default:null},maxFileNum:{type:Number,default:null},minFileNum:{type:Number,default:null},allowedFileTypes:{type:Array,default:null},requiredMetaFields:{type:Array,default:[]}};static outlets=["attachment-preview","attachment-preview-container"];connect(){this.uploadedFiles=[],this.element.style.display="none",this.configureUppy(),this.#a(),this.#s()}disconnect(){this.uppy=null}attachmentPreviewOutletConnected(i,e){this.#s()}attachmentPreviewOutletDisconnected(i,e){this.#s()}configureUppy(){this.uppy=new $a({restrictions:{maxFileSize:this.maxFileSizeValue,minFileSize:this.minFileSizeValue,maxTotalFileSize:this.maxTotalSizeValue,maxNumberOfFiles:this.maxFileNumValue,minNumberOfFiles:this.minFileNumValue,allowedFileTypes:this.allowedFileTypesValue,requiredMetaFields:this.requiredMetaFieldsValue}}).use(wr,{inline:!1,closeAfterFinish:!0}).use(cs,{target:wr}),this.#e(),this.#t()}#e(){this.uppy.use(Zs,{endpoint:this.endpointValue})}#t(){this.uppy.on("upload-success",this.#o.bind(this))}#i(){let i=document.documentElement.getAttribute("data-bs-theme")||"auto";this.#l.setOptions({theme:i});let e=null;for(;e=this.uploadedFiles.pop();)this.uppy.removeFile(e.id);this.#l.openModal()}#o(i,e){this.uploadedFiles.push(i),this.multiple||this.attachmentPreviewOutlets.forEach(s=>s.remove());let t=e.body.data,r=e.body.url;this.attachmentPreviewContainerOutlet.element.appendChild(this.#n(t,r))}#s(){if(!this.deleteAllTrigger)return;this.attachmentPreviewOutlets.length>1?(this.deleteAllTrigger.style.display="initial",this.deleteAllTrigger.textContent=`Delete ${this.attachmentPreviewOutlets.length}`):this.deleteAllTrigger.style.display="none"}#a(){this.triggerContainer=document.createElement("div"),this.triggerContainer.className="flex items-center gap-2",this.element.insertAdjacentElement("afterend",this.triggerContainer),this.#r(),this.uploadTrigger&&this.triggerContainer.append(this.uploadTrigger),this.deleteAllTrigger&&this.triggerContainer.append(this.deleteAllTrigger)}#r(){let i=this.multiple?"Choose files":"Choose file";this.uploadTrigger=ut.fromTemplate(`<button type="button" class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700 inline-flex items-center">
|
98
98
|
<svg class="w-4 h-4 mr-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 16">
|
99
99
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"/>
|
100
100
|
</svg>
|