(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,963912,e=>{"use strict";var t=e.i(391398),i=e.i(66657),r=e.i(173899),s=e.i(470645),o=e.i(778268),n=e.i(216912),a=e.i(244180),l=e.i(358003);let u=["h","minH","height","minHeight"],h=(0,n.forwardRef)((e,n)=>{let h=(0,a.useStyleConfig)("Textarea",e),{className:d,rows:p,...c}=(0,i.omitThemingProps)(e),f=(0,o.useFormControl)(c),m=p?(0,r.omit)(h,u):h;return(0,t.jsx)(l.chakra.textarea,{ref:n,rows:p,...f,className:(0,s.cx)("chakra-textarea",d),__css:m})});h.displayName="Textarea",e.s(["Textarea",()=>h])},29215,e=>{"use strict";var t=e.i(391398);let i=(0,e.i(275561).createIcon)({displayName:"ExternalLinkIcon",path:(0,t.jsxs)("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[(0,t.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,t.jsx)("path",{d:"M15 3h6v6"}),(0,t.jsx)("path",{d:"M10 14L21 3"})]})});e.s(["ExternalLinkIcon",()=>i])},80192,e=>{"use strict";let t=new(e.i(161385)).EventEmitter;e.s(["openThemeEditorWithCurrentTheme",0,({theme:e})=>{t.emit("openThemeConfiguration",{baseTheme:e,view:"editor"})},"openThemeEditorWithNewFork",0,({theme:e})=>{t.emit("openThemeConfiguration",{baseTheme:e,view:"editor",isNewFork:!0})}],80192)},283591,e=>{"use strict";var t=e.i(391398),i=e.i(29215),r=e.i(428683),s=e.i(382167),o=e.i(620020),n=e.i(272191),a=e.i(358280),l=e.i(408122),u=e.i(191788),h=e.i(367792);e.i(185340);var d=e.i(863750);e.i(144786);var p=e.i(849187);e.i(159859);var c=e.i(418755),f=e.i(595408),m=e.i(686296),g=e.i(551880);e.i(195305),e.i(994633);var y=e.i(25747);e.i(80192),e.i(995324);let b=({theme:e})=>{let t=(0,o.useToast)(),[i]=(0,d.useUnarchiveThemeMutation)(),r=e.name.replace(f.ARCHIVED_THEME_NAME_REPLACE_REGEX,"");return(0,u.useCallback)(()=>{e&&e.id&&(t.close("archive-theme-toast"),i({variables:{id:e.id},update:(t,{data:i})=>{i?.unarchiveTheme&&t.writeQuery({query:d.GetThemesDocument,variables:{workspaceId:e.workspaceId,archived:!1},data:{themes:[i.unarchiveTheme]}})},optimisticResponse:{unarchiveTheme:{__typename:"Theme",...e,archived:!1,updatedTime:new Date().toISOString()}},refetchQueries:["GetThemes"]}).then(()=>{t({id:"unarchive-theme-toast",title:l.i18n._({id:"QFw1At",message:"Theme {displayName} has been restored",values:{displayName:r}}),status:"success",duration:3e3,position:"top",isClosable:!0})}).catch(e=>{console.error(`Couldn't restore theme ${r} error: ${e}`)}))},[i,e,t,r])},v=({showLinkToDashboard:e,unarchiveTheme:o})=>e?(0,t.jsx)(r.Box,{children:(0,t.jsx)(a.Trans,{message:"Go to <0>theme dashboard <1/> or <2>undo",id:"1jSYVL",components:{0:(0,t.jsx)(s.Link,{textDecoration:"underline",isExternal:!0,href:f.THEMES_DASHBOARD_LINK}),1:(0,t.jsx)(i.ExternalLinkIcon,{mx:"2px"}),2:(0,t.jsx)(s.Link,{textDecoration:"underline",as:s.Link,variant:"link",onClick:o})}})}):(0,t.jsx)(r.Box,{children:(0,t.jsx)(a.Trans,{message:"Made a mistake? <0>Restore theme.",id:"HFliJ0",components:{0:(0,t.jsx)(s.Link,{textDecoration:"underline",as:s.Link,variant:"link",onClick:o})}})});e.s(["useArchiveTheme",0,({theme:e,showLinkToDashboard:i=!1})=>{let r=(0,o.useToast)(),[s]=(0,d.useArchiveThemeMutation)(),n=b({theme:e}),a=e.name.replace(f.ARCHIVED_THEME_NAME_REPLACE_REGEX,"");return(0,u.useCallback)(()=>{e&&e.id&&s({variables:{id:e.id},update:(t,{data:i})=>{i?.archiveTheme&&t.writeQuery({query:d.GetThemesDocument,variables:{workspaceId:e.workspaceId,archived:!1},data:{themes:[i.archiveTheme]}})},optimisticResponse:{archiveTheme:{__typename:"Theme",...e,archived:!0,updatedTime:new Date().toISOString()}},refetchQueries:["GetThemes"]}).then(()=>{let s=e.name;r({id:"archive-theme-toast",title:l.i18n._({id:"TEDDwv",message:"Theme {themeName} has been archived",values:{themeName:s}}),description:(0,t.jsx)(v,{showLinkToDashboard:i,unarchiveTheme:n}),status:"success",duration:3e3,position:"top",isClosable:!0})}).catch(e=>{console.error(`Couldn't archive theme ${a} error: ${e}`)})},[e,s,r,i,n,a])},"useConvertToStandardTheme",0,e=>{let{isGammaOrgUser:t}=(0,y.useUserContext)(),i=(0,p.useFeatureFlag)("gammaStandardThemeAdmin"),r=null!==e.workspaceId&&t&&i&&"production"!==h.config.APPLICATION_ENVIRONMENT&&!e.archived,[s]=(0,d.useMakeThemeStandardMutation)(),o=(0,u.useCallback)(()=>{if(!r)return;let t=prompt("Enter new theme ID",(0,n.slugifyLowercase)(e.name));t&&s({variables:{id:e.id,newId:t},refetchQueries:["GetThemes"]})},[e,s,r]);return{canMakeStandard:r,convertToStandard:o}},"useIsThemeDark",0,()=>{let e=(0,c.useAppSelector)(g.selectTheme);return!!e&&(0,m.isThemeDark)(e)},"useStandardThemeImageBucket",0,(e,t)=>{let{isGammaOrgUser:i}=(0,y.useUserContext)(),r=(0,p.useFeatureFlag)("uploadThemeImagesToProd");return i&&r&&"themeBackground"===t?{orgId:"theme_images/standard",templateId:h.config.TRANSLOADIT_THEME_IMAGE_TEMPLATE_ID,useStandardThemeBucket:!0}:{orgId:e,templateId:void 0,useStandardThemeBucket:!1}},"useUnarchiveTheme",0,b])},102844,(e,t,i)=>{t.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,r,s,o,n,a){var l=function(e){for(var i=t[e]?t[e]:[],r=e.indexOf(":"),s=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],o=Object.keys(t),n=0,a=o.length;n{var r="Expected a function",s=0/0,o=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt,h=e.g&&e.g.Object===Object&&e.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=h||d||Function("return this")(),c=Object.prototype.toString,f=Math.max,m=Math.min,g=function(){return p.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==c.call(t))return s;if(y(e)){var t,i="function"==typeof e.valueOf?e.valueOf():e;e=y(i)?i+"":i}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=a.test(e);return r||l.test(e)?u(e.slice(2),r?2:8):n.test(e)?s:+e}t.exports=function(e,t,i){var s=!0,o=!0;if("function"!=typeof e)throw TypeError(r);return y(i)&&(s="leading"in i?!!i.leading:s,o="trailing"in i?!!i.trailing:o),function(e,t,i){var s,o,n,a,l,u,h=0,d=!1,p=!1,c=!0;if("function"!=typeof e)throw TypeError(r);function v(t){var i=s,r=o;return s=o=void 0,h=t,a=e.apply(r,i)}function w(e){var i=e-u,r=e-h;return void 0===u||i>=t||i<0||p&&r>=n}function P(){var e,i,r,s=g();if(w(s))return _(s);l=setTimeout(P,(e=s-u,i=s-h,r=t-e,p?m(r,n-i):r))}function _(e){return(l=void 0,c&&s)?v(e):(s=o=void 0,a)}function S(){var e,i=g(),r=w(i);if(s=arguments,o=this,u=i,r){if(void 0===l)return h=e=u,l=setTimeout(P,t),d?v(e):a;if(p)return l=setTimeout(P,t),v(u)}return void 0===l&&(l=setTimeout(P,t)),a}return t=b(t)||0,y(i)&&(d=!!i.leading,n=(p="maxWait"in i)?f(b(i.maxWait)||0,t):n,c="trailing"in i?!!i.trailing:c),S.cancel=function(){void 0!==l&&clearTimeout(l),h=0,s=u=o=l=void 0},S.flush=function(){return void 0===l?a:_(g())},S}(e,t,{leading:s,maxWait:t,trailing:o})}},296285,(e,t,i)=>{t.exports=function(e){if("number"!=typeof e||isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=e<0,i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;let r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1);e=Number(e/Math.pow(1024,r));let s=i[r];return e>=10||e%1==0?`${(t?"-":"")+e.toFixed(0)} ${s}`:`${(t?"-":"")+e.toFixed(1)} ${s}`}},872270,(e,t,i)=>{"use strict";function r(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}r.prototype.match=function(e){var t,i,r=!0,s=this.parts,o=s.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(t=0,i=(e||"").split(this.separator);r&&t{var r=e.r(872270),s=/[\/\+\.]/;t.exports=function(e,t){function i(t){var i=r(t,e,s);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},31578,(e,t,i)=>{"use strict";t.exports=function(e,t){if(t=t.split(":")[0],!(e*=1))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},72349,(e,t,i)=>{"use strict";var r,s=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function n(e){try{return encodeURIComponent(e)}catch(e){return null}}i.stringify=function(e,t){var i,o,a=[];for(o in"string"!=typeof(t=t||"")&&(t="?"),e)if(s.call(e,o)){if(!(i=e[o])&&(null===i||i===r||isNaN(i))&&(i=""),o=n(o),i=n(i),null===o||null===i)continue;a.push(o+"="+i)}return a.length?t+a.join("&"):""},i.parse=function(e){for(var t,i=/([^=?#&]+)=?([^&]*)/g,r={};t=i.exec(e);){var s=o(t[1]),n=o(t[2]);null===s||null===n||s in r||(r[s]=n)}return r}},707095,(e,t,i)=>{"use strict";var r=e.r(31578),s=e.r(72349),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,n=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,h=/^[a-zA-Z]:/;function d(e){return(e||"").toString().replace(o,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],c={hash:1,query:1};function f(t){var i,r,s=(i="u">typeof window?window:e.g).location||{},o={},n=typeof(t=t||s);if("blob:"===t.protocol)o=new y(unescape(t.pathname),{});else if("string"===n)for(r in o=new y(t,{}),c)delete o[r];else if("object"===n){for(r in t)r in c||(o[r]=t[r]);void 0===o.slashes&&(o.slashes=a.test(t.href))}return o}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=d(e)).replace(n,""),t=t||{};var i,r=u.exec(e),s=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],l=0;return o?a?(i=r[2]+r[3]+r[4],l=r[2].length+r[3].length):(i=r[2]+r[4],l=r[2].length):a?(i=r[3]+r[4],l=r[3].length):i=r[4],"file:"===s?l>=2&&(i=i.slice(2)):m(s)?i=r[4]:s?o&&(i=i.slice(2)):l>=2&&m(t.protocol)&&(i=r[4]),{protocol:s,slashes:o||m(s),slashesCount:l,rest:i}}function y(e,t,i){if(e=(e=d(e)).replace(n,""),!(this instanceof y))return new y(e,t,i);var o,a,l,u,c,b,v=p.slice(),w=typeof t,P=0;for("object"!==w&&"string"!==w&&(i=t,t=null),i&&"function"!=typeof i&&(i=s.parse),o=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,this.slashes=a.slashes||o&&t.slashes,this.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||h.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(this.protocol)))&&(v[3]=[/(.*)/,"pathname"]);P{function r(e){if(e){var t=e;for(var i in r.prototype)t[i]=r.prototype[i];return t}}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function i(){this.off(e,i),t.apply(this,arguments)}return i.fn=t,this.on(e,i),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s{"use strict";let t,i,r,s,o,n;function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var u,h,d=0;function p(e,t){let i=/\$/g,r=[e];if(null==t)return r;for(let e of Object.keys(t))if("_"!==e){let s=t[e];"string"==typeof s&&(s=i[Symbol.replace](s,"$$$$")),r=function(e,t,i){let r=[];return e.forEach(e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,s)=>{""!==e&&r.push(e),t+(1!==e)},Array.isArray(e)?e.forEach(l(this,c)[c],this):l(this,c)[c](e)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!a(this.locale.strings,e))throw Error(`missing string: ${e}`);let i=this.locale.strings[e];if("object"==typeof i){if(t&&void 0!==t.smart_count)return p(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return p(i,t)}}function m(e){if(!(null!=e&&e.strings))return;let t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}var g=e.i(102844),y=e.i(56018);function b(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var v=0;function w(e){return"__private_"+v+++"_"+e}var P=w("callbacks"),_=w("publish");class S{constructor(){Object.defineProperty(this,_,{value:k}),Object.defineProperty(this,P,{writable:!0,value:new Set}),this.state={}}getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,b(this,_)[_](t,i,e)}subscribe(e){return b(this,P)[P].add(e),()=>{b(this,P)[P].delete(e)}}}function k(){for(var e=arguments.length,t=Array(e),i=0;i{e(...t)})}function C(e){let t=e.lastIndexOf(".");return -1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}S.VERSION="3.0.2";let O={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function x(e){let t="";return e.replace(/[^A-Z0-9]/ig,e=>(t+=`-${e.charCodeAt(0).toString(32)}`,"/"))+t}function T(e){return e<10?`0${e}`:e.toString()}function A(){let e=new Date,t=T(e.getHours()),i=T(e.getMinutes()),r=T(e.getSeconds());return`${t}:${i}:${r}`}let E={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=Array(e),i=0;i{let t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,t){let{maxFileSize:i,minFileSize:r,maxTotalFileSize:s,maxNumberOfFiles:o,allowedFileTypes:n}=this.getOpts().restrictions;if(o&&t.filter(e=>!e.isGhost).length+1>o)throw new D(`${this.i18n("youCanOnlyUploadX",{smart_count:o})}`);if(n&&!n.some(t=>t.includes("/")?!!e.type&&(0,I.default)(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let e=n.join(", ");throw new D(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}if(s&&null!=e.size&&t.reduce((e,t)=>e+t.size,e.size)>s)throw new D(this.i18n("exceedsSize",{size:(0,F.default)(s),file:e.name}));if(i&&null!=e.size&&e.size>i)throw new D(this.i18n("exceedsSize",{size:(0,F.default)(i),file:e.name}));if(r&&null!=e.size&&e.sizee,onBeforeUpload:e=>e,store:new S,logger:E,infoTimeout:5e3};this.opts={...t,...e,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=R),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=(0,y.default)(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:function(e){if(null==e&&"u">typeof navigator&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let[i,r]=t[1].split(".");return i=parseInt(i,10),r=parseInt(r,10),!!(i<15)||15===i&&!!(r<15063)||!!(i>18)||18===i&&!!(r>=18218)}(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),j(this,H)[H]=new N(()=>this.opts,this.i18n),j(this,q)[q]=this.store.subscribe((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)}),this.opts.debug&&"u">typeof window&&(window[this.opts.id]=this),j(this,ee)[ee]()}emit(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}setFileState(e,t){if(!this.getState().files[e])throw Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){let e=new f([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){let e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i={};Object.keys(t).forEach(r=>{let s={...t[r]};s.progress={...s.progress,...e},i[r]=s}),this.setState({files:i,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){j(this,V)[V].add(e)}removePreProcessor(e){return j(this,V)[V].delete(e)}addPostProcessor(e){j(this,W)[W].add(e)}removePostProcessor(e){return j(this,W)[W].delete(e)}addUploader(e){j(this,G)[G].add(e)}removeUploader(e){return j(this,G)[G].delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i={...this.getState().files};if(!i[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);let r={...i[e].meta,...t};i[e]={...i[e],meta:r},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),r=Object.values(e),s=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),o=r.filter(e=>!e.progress.uploadStarted),n=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),a=r.filter(e=>e.progress.uploadStarted),l=r.filter(e=>e.isPaused),u=r.filter(e=>e.progress.uploadComplete),h=r.filter(e=>e.error),d=s.filter(e=>!e.isPaused),p=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:o,startedFiles:n,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:h,inProgressFiles:s,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===r.length&&0===p.length,isAllErrored:!!i&&h.length===r.length,isAllPaused:0!==s.length&&l.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{j(this,H)[H].validate(e,t)}catch(e){return e}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!t[e]&&!t[e].isGhost}addFile(e){j(this,X)[X](e);let{files:t}=this.getState(),i=j(this,J)[J](t,e);return t[i.id]&&t[i.id].isGhost&&(i={...t[i.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${i.name}, ${i.id}`)),this.setState({files:{...t,[i.id]:i}}),this.emit("file-added",i),this.emit("files-added",[i]),this.log(`Added file: ${i.name}, ${i.id}, mime type: ${i.type}`),j(this,Z)[Z](),i.id}addFiles(e){j(this,X)[X]();let t={...this.getState().files},i=[],r=[];for(let s=0;s{this.emit("file-added",e)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.keys(i).forEach(e=>{this.log(`Added file: ${i[e].name} id: ${i[e].id} type: ${i[e].type}`)}),i.length>0&&j(this,Z)[Z](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=` * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw AggregateError(r,e);{let t=Error(e);throw t.errors=r,t}}}removeFiles(e,t){let{files:i,currentUploads:r}=this.getState(),s={...i},o={...r},n=Object.create(null);function a(e){return void 0===n[e]}e.forEach(e=>{i[e]&&(n[e]=i[e],delete s[e])}),Object.keys(o).forEach(e=>{let t=r[e].fileIDs.filter(a);if(0===t.length)return void delete o[e];let{capabilities:i}=this.getState();if(t.length!==r[e].fileIDs.length&&!i.individualCancellation)throw Error("individualCancellation is disabled");o[e]={...r[e],fileIDs:t}});let l={currentUploads:o,files:s};0===Object.keys(s).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();let u=Object.keys(n);u.forEach(e=>{this.emit("file-removed",n[e],t)}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;let t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!0};e[t]=i}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{let i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});let i=j(this,ei)[ei](t,{forceAllowNewUpload:!0});return j(this,eo)[eo](i)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);let t=j(this,ei)[ei]([e],{forceAllowNewUpload:!0});return j(this,eo)[eo](t)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);let i=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:i?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length){this.emit("progress",0),this.setState({totalProgress:0});return}let t=e.filter(e=>null!=e.progress.bytesTotal),i=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){let t=100*e.length,r=Math.round(i.reduce((e,t)=>e+t.progress.percentage,0)/t*100);this.setState({totalProgress:r});return}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0),s=r/t.length;r+=s*i.length;let o=0;t.forEach(e=>{o+=e.progress.bytesUploaded}),i.forEach(e=>{o+=s*(e.progress.percentage||0)/100});let n=0===r?0:Math.round(o/r*100);n>100&&(n=100),this.setState({totalProgress:n}),this.emit("progress",n)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e)throw TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);let i=new e(this,t),r=i.id;if(!r)throw Error("Your plugin must have an id");if(!i.type)throw Error("Your plugin must have a type");let s=this.getPlugin(r);if(s)throw Error(`Already found a plugin named '${s.id}'. Tried to use: '${r}'. Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`);return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in j(this,z)[z]?j(this,z)[z][i.type].push(i):j(this,z)[z][i.type]=[i],i.install(),this}getPlugin(e){for(let t of Object.values(j(this,z)[z])){let i=t.find(t=>t.id===e);if(null!=i)return i}}[t](e){return j(this,z)[z][e]}iteratePlugins(e){Object.values(j(this,z)[z]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=j(this,z)[z][e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);let r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),j(this,q)[q](),this.iteratePlugins(e=>{this.removePlugin(e)}),"u">typeof window&&window.removeEventListener&&(window.removeEventListener("online",j(this,et)[et]),window.removeEventListener("offline",j(this,et)[et]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,i){void 0===t&&(t="info"),void 0===i&&(i=3e3);let r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,t){let{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}}restore(e){return(this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e])?j(this,eo)[eo](e):(j(this,es)[es](e),Promise.reject(Error("Nonexistent upload")))}[i](){return j(this,ei)[ei](...arguments)}addResultData(e,t){if(!j(this,er)[er](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);let{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:r}})}upload(){var e;null!=(e=j(this,z)[z].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),i=this.opts.onBeforeUpload(t);return!1===i?Promise.reject(Error("Not starting the upload because onBeforeUpload returned false")):(i&&"object"==typeof i&&(t=i,this.setState({files:t})),Promise.resolve().then(()=>j(this,H)[H].validateMinNumberOfFiles(t)).catch(e=>{throw j(this,K)[K](e),e}).then(()=>{if(!j(this,Q)[Q](t))throw new D(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{let{currentUploads:e}=this.getState(),i=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{let t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||r.push(t.id)});let s=j(this,ei)[ei](r);return j(this,eo)[eo](s)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function ea(e,t){let{message:i,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:i,details:r},"error",this.opts.infoTimeout),this.log(e,"warning")}function el(e){let{missingFields:t,error:i}=j(this,H)[H].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),!1)}function eu(e){let t=!0;for(let i of Object.values(e))j(this,Y)[Y](i)||(t=!1);return t}function eh(e){let{allowNewUpload:t}=this.getState();if(!1===t){let t=new D(this.i18n("noMoreFilesAllowed"));throw j(this,K)[K](t,e),t}}function ed(e,t){var i,r;let s;t instanceof File&&(t={name:t.name,type:t.type,size:t.size,data:t});let o=function(e){var t;if(e.type)return e.type;let i=e.name?null==(t=C(e.name).extension)?void 0:t.toLowerCase():null;return i&&i in O?O[i]:"application/octet-stream"}(t),n=(i=t).name?i.name:"image"===o.split("/")[0]?`${o.split("/")[0]}.${o.split("/")[1]}`:"noname",a=C(n).extension,l=!!t.isRemote,u=(r={...t,type:o},s="uppy","string"==typeof r.name&&(s+=`-${x(r.name.toLowerCase())}`),void 0!==r.type&&(s+=`-${r.type}`),r.meta&&"string"==typeof r.meta.relativePath&&(s+=`-${x(r.meta.relativePath.toLowerCase())}`),void 0!==r.data.size&&(s+=`-${r.data.size}`),void 0!==r.data.lastModified&&(s+=`-${r.data.lastModified}`),s);if(this.checkIfFileAlreadyExists(u)){let e=new D(this.i18n("noDuplicates",{fileName:n}));throw j(this,K)[K](e,t),e}let h=t.meta||{};h.name=n,h.type=o;let d=Number.isFinite(t.data.size)?t.data.size:null,p={source:t.source||"",id:u,name:n,extension:a||"",meta:{...this.getState().meta,...h},type:o,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:d,uploadComplete:!1,uploadStarted:null},size:d,isRemote:l,remote:t.remote||"",preview:t.preview},c=this.opts.onBeforeFileAdded(p,e);if(!1===c){let e=new D("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof c&&null!==c&&(p=c);try{let t=Object.keys(e).map(t=>e[t]);j(this,H)[H].validate(p,t)}catch(e){throw j(this,K)[K](e,p),e}return p}function ep(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function ec(){let e,t=(e,t,i)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:i})};this.on("error",t),this.on("upload-error",(e,i,r)=>{if(t(i,e,r),"object"==typeof i&&i.message){let t=Error(i.message);t.details=i.message,i.details&&(t.details+=` ${i.details}`),t.message=this.i18n("failedToUpload",{file:null==e?void 0:e.name}),j(this,K)[K](t)}else j(this,K)[K](i)}),this.on("upload-stalled",(t,i)=>{let{message:r}=t,s=i.map(e=>e.meta.name).join(", ");e||(this.info({message:r,details:s},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${r} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);let i=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...i,postprocess:j(this,W)[W].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);let t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);let t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&j(this,Y)[Y](e)}),"u">typeof window&&window.addEventListener&&(window.addEventListener("online",j(this,et)[et]),window.addEventListener("offline",j(this,et)[et]),setTimeout(j(this,et)[et],3e3))}function ef(e,t){void 0===t&&(t={});let{forceAllowNewUpload:i=!1}=t,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!i)throw Error("Cannot create a new upload: already uploading.");let o=((e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})();return this.emit("upload",{id:o,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...s,[o]:{fileIDs:e,step:0,result:{}}}}),o}function em(e){let{currentUploads:t}=this.getState();return t[e]}function eg(e){let t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function ey(e){let t,{currentUploads:i}=this.getState(),r=i[e],s=r.step||0,o=[...j(this,V)[V],...j(this,G)[G],...j(this,W)[W]];try{for(let t=s;t{let t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});let t=r.fileIDs.map(e=>this.getFile(e)),s=t.filter(e=>!e.error),o=t.filter(e=>e.error);await this.addResultData(e,{successful:s,failed:o,uploadID:e}),r=(i=this.getState().currentUploads)[e]}return r&&(t=r.result,this.emit("complete",t),j(this,es)[es](e)),null==t&&this.log(`Not setting result for an upload that has been removed: ${e}`),t}en.VERSION="3.0.6",e.s(["default",0,en],677457);var eb,ev,ew,eP,e_,eS,ek={},eC=[],eO=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ex(e,t){for(var i in t)e[i]=t[i];return e}function eT(e){var t=e.parentNode;t&&t.removeChild(e)}function eA(e,t,i){var r,s,o,n={};for(o in t)"key"==o?r=t[o]:"ref"==o?s=t[o]:n[o]=t[o];if(arguments.length>2&&(n.children=arguments.length>3?eb.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===n[o]&&(n[o]=e.defaultProps[o]);return eE(e,n,r,s,null)}function eE(e,t,i,r,s){var o={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++ew:s};return null==s&&null!=ev.vnode&&ev.vnode(o),o}function eR(){return{current:null}}function eF(e){return e.children}function eI(e,t){this.props=e,this.context=t}function eU(e,t){if(null==t)return e.__?eU(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t0?eE(c.type,c.props,c.key,null,c.__v):c)){if(c.__=i,c.__b=i.__b+1,null===(p=y[h])||p&&c.key==p.key&&c.type===p.type)y[h]=void 0;else for(d=0;d2&&(n.children=arguments.length>3?eb.call(arguments,2):i),eE(e.type,n,r||e.key,s||e.ref,null)}function eY(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE}eb=eC.slice,ev={__e:function(e,t,i,r){for(var s,o,n;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(e)),n=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),n=s.__d),n)return s.__E=s}catch(t){e=t}throw e}},ew=0,eI.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ex({},this.state),"function"==typeof e&&(e=e(ex({},i),this.props)),e&&ex(i,e),null!=e&&this.__v&&(t&&this.__h.push(t),eD(this))},eI.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),eD(this))},eI.prototype.render=eF,eP=[],e_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,eN.__r=0,e.s(["Component",()=>eI,"Fragment",()=>eF,"cloneElement",()=>eK,"createRef",()=>eR,"h",()=>eA,"render",()=>eW,"toChildArray",()=>function e(t,i){return i=i||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some(function(t){e(t,i)}):i.push(t)),i}],111756),e.s(["default",()=>eY],145876);let eQ=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};e.s(["default",0,eQ],655929);class eX{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){let{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){let e=new f([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}function eJ(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var eZ=0,e0="__private_"+eZ+++"_updateUI";class e1 extends eX{constructor(){super(...arguments),Object.defineProperty(this,e0,{writable:!0,value:void 0})}getTargetPlugin(e){let t;return"object"==typeof e&&e instanceof e1?t=e:"function"==typeof e&&this.uppy.iteratePlugins(i=>{i instanceof e&&(t=i)}),t}mount(e,t){var i,r;let s=t.id,o=(void 0===i&&(i=document),"string"==typeof e)?i.querySelector(e):eY(e)?e:null;if(o){let t,i;this.isTargetDOMEl=!0;let n=document.createElement("div");return n.classList.add("uppy-Root"),eJ(this,e0)[e0]=(r=e=>{this.uppy.getPlugin(this.id)&&(eW(this.render(e),n),this.afterUpdate())},t=null,i=null,function(){for(var e=arguments.length,s=Array(e),o=0;o(t=null,r(...i)))),t}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(o.innerHTML=""),eW(this.render(this.uppy.getState()),n),this.el=n,o.appendChild(n),n.dir=this.opts.direction||eQ(n)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${s} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let a=`Invalid target option given to ${s}.`;throw"function"==typeof e?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the