(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),n=e.i(778268),o=e.i(216912),a=e.i(244180),l=e.i(358003);let u=["h","minH","height","minHeight"],h=(0,o.forwardRef)((e,o)=>{let h=(0,a.useStyleConfig)("Textarea",e),{className:p,rows:d,...c}=(0,i.omitThemingProps)(e),f=(0,n.useFormControl)(c),m=d?(0,r.omit)(h,u):h;return(0,t.jsx)(l.chakra.textarea,{ref:o,rows:d,...f,className:(0,s.cx)("chakra-textarea",p),__css:m})});h.displayName="Textarea",e.s(["Textarea",0,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",0,i])},80192,e=>{"use strict";let t=new(e.i(161385)).EventEmitter;e.s(["openThemeEditorReadOnly",0,({theme:e})=>{t.emit("openThemeConfiguration",{baseTheme:e,view:"editor",readOnly:!0})},"openThemeEditorWithCurrentTheme",0,({theme:e})=>{t.emit("openThemeConfiguration",{baseTheme:e,view:"editor"})},"openThemeEditorWithNewFork",0,({theme:e,sourceThemeInfo:i})=>{t.emit("openThemeConfiguration",{baseTheme:e,view:"editor",isNewFork:!0,sourceThemeInfo:i})}],80192)},283591,294988,e=>{"use strict";var t=e.i(391398),i=e.i(29215),r=e.i(428683),s=e.i(382167),n=e.i(620020),o=e.i(272191),a=e.i(358280),l=e.i(408122),u=e.i(191788),h=e.i(367792);e.i(185340);var p=e.i(863750);e.i(144786);var d=e.i(849187);e.i(159859);var c=e.i(418755);e.i(734710),e.i(468738);var f=e.i(595408),m=e.i(686296),g=e.i(551880);e.i(195305);var y=e.i(994633),b=e.i(25747);e.i(80192);var v=e.i(78387);e.s(["trackThemeCreate",0,(e,t)=>{e?.track(v.SegmentEvents.THEME_CREATED,t)},"trackThemeDuplicate",0,(e,t)=>{e?.track(v.SegmentEvents.THEME_DUPLICATED,t)},"trackThemeSharedLinkOpened",0,(e,t)=>{e?.track(v.SegmentEvents.THEME_SHARED_LINK_OPENED,t)}],294988),e.i(995324);let w=({theme:e})=>{let t=(0,n.useToast)(),[i]=(0,p.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:p.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])},_=({showLinkToDashboard:e,unarchiveTheme:n})=>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:n})}})}):(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:n})}})});e.s(["useArchiveTheme",0,({theme:e,showLinkToDashboard:i=!1})=>{let r=(0,n.useToast)(),[s]=(0,p.useArchiveThemeMutation)(),o=w({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:p.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)(_,{showLinkToDashboard:i,unarchiveTheme:o}),status:"success",duration:3e3,position:"top",isClosable:!0})}).catch(e=>{console.error(`Couldn't archive theme ${a} error: ${e}`)})},[e,s,r,i,o,a])},"useCanManageThemesAndFonts",0,()=>{let{currentWorkspace:e}=(0,b.useUserContext)();return(0,y.useCan)("theme_and_font_management",e)},"useConvertToStandardTheme",0,e=>{let{isGammaOrgUser:t}=(0,b.useUserContext)(),i=(0,d.useFeatureFlag)("gammaStandardThemeAdmin"),r=null!==e.workspaceId&&t&&i&&"production"!==h.config.APPLICATION_ENVIRONMENT&&!e.archived,[s]=(0,p.useMakeThemeStandardMutation)(),n=(0,u.useCallback)(()=>{if(!r)return;let t=prompt("Enter new theme ID",(0,o.slugifyLowercase)(e.name));t&&s({variables:{id:e.id,newId:t},refetchQueries:["GetThemes"]})},[e,s,r]);return{canMakeStandard:r,convertToStandard:n}},"useIsThemeDark",0,()=>{let e=(0,c.useAppSelector)(g.selectTheme);return!!e&&(0,m.isThemeDark)(e)},"useStandardThemeImageBucket",0,(e,t)=>{let{isGammaOrgUser:i}=(0,b.useUserContext)(),r=(0,d.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,w],283591)},102844,(e,t,i)=>{t.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,r,s,n,o,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)],n=Object.keys(t),o=0,a=n.length;o{var r="Expected a function",s=0/0,n=/^\s+|\s+$/g,o=/^[-+]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,p="object"==typeof self&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),c=Object.prototype.toString,f=Math.max,m=Math.min,g=function(){return d.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(n,"");var r=a.test(e);return r||l.test(e)?u(e.slice(2),r?2:8):o.test(e)?s:+e}t.exports=function(e,t,i){var s=!0,n=!0;if("function"!=typeof e)throw TypeError(r);return y(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),function(e,t,i){var s,n,o,a,l,u,h=0,p=!1,d=!1,c=!0;if("function"!=typeof e)throw TypeError(r);function v(t){var i=s,r=n;return s=n=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||d&&r>=o}function _(){var e,i,r,s=g();if(w(s))return P(s);l=setTimeout(_,(e=s-u,i=s-h,r=t-e,d?m(r,o-i):r))}function P(e){return(l=void 0,c&&s)?v(e):(s=n=void 0,a)}function S(){var e,i=g(),r=w(i);if(s=arguments,n=this,u=i,r){if(void 0===l)return h=e=u,l=setTimeout(_,t),p?v(e):a;if(d)return l=setTimeout(_,t),v(u)}return void 0===l&&(l=setTimeout(_,t)),a}return t=b(t)||0,y(i)&&(p=!!i.leading,o=(d="maxWait"in i)?f(b(i.maxWait)||0,t):o,c="trailing"in i?!!i.trailing:c),S.cancel=function(){void 0!==l&&clearTimeout(l),h=0,s=u=n=l=void 0},S.flush=function(){return void 0===l?a:P(g())},S}(e,t,{leading:s,maxWait:t,trailing:n})}},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,n=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 n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function o(e){try{return encodeURIComponent(e)}catch(e){return null}}i.stringify=function(e,t){var i,n,a=[];for(n in"string"!=typeof(t=t||"")&&(t="?"),e)if(s.call(e,n)){if(!(i=e[n])&&(null===i||i===r||isNaN(i))&&(i=""),n=o(n),i=o(i),null===n||null===i)continue;a.push(n+"="+i)}return a.length?t+a.join("&"):""},i.parse=function(e){for(var t,i=/([^=?#&]+)=?([^&]*)/g,r={};t=i.exec(e);){var s=n(t[1]),o=n(t[2]);null===s||null===o||s in r||(r[s]=o)}return r}},707095,(e,t,i)=>{"use strict";var r=e.r(31578),s=e.r(72349),n=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\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 p(e){return(e||"").toString().replace(n,"")}var d=[["#","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||{},n={},o=typeof(t=t||s);if("blob:"===t.protocol)n=new y(unescape(t.pathname),{});else if("string"===o)for(r in n=new y(t,{}),c)delete n[r];else if("object"===o){for(r in t)r in c||(n[r]=t[r]);void 0===n.slashes&&(n.slashes=a.test(t.href))}return n}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=p(e)).replace(o,""),t=t||{};var i,r=u.exec(e),s=r[1]?r[1].toLowerCase():"",n=!!r[2],a=!!r[3],l=0;return n?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?n&&(i=i.slice(2)):l>=2&&m(t.protocol)&&(i=r[4]),{protocol:s,slashes:n||m(s),slashesCount:l,rest:i}}function y(e,t,i){if(e=(e=p(e)).replace(o,""),!(this instanceof y))return new y(e,t,i);var n,a,l,u,c,b,v=d.slice(),w=typeof t,_=0;for("object"!==w&&"string"!==w&&(i=t,t=null),i&&"function"!=typeof i&&(i=s.parse),n=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,this.slashes=a.slashes||n&&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"]);_{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,n,o;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,p=0;function d(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 d(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 d(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 _=w("callbacks"),P=w("publish");class S{constructor(){Object.defineProperty(this,P,{value:k}),Object.defineProperty(this,_,{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,P)[P](t,i,e)}subscribe(e){return b(this,_)[_].add(e),()=>{b(this,_)[_].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 E(){let e=new Date,t=T(e.getHours()),i=T(e.getMinutes()),r=T(e.getSeconds());return`${t}:${i}:${r}`}let A={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:n,allowedFileTypes:o}=this.getOpts().restrictions;if(n&&t.filter(e=>!e.isGhost).length+1>n)throw new D(`${this.i18n("youCanOnlyUploadX",{smart_count:n})}`);if(o&&!o.some(t=>t.includes("/")?!!e.type&&(0,U.default)(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let e=o.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:A,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}),n=r.filter(e=>!e.progress.uploadStarted),o=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),p=s.filter(e=>!e.isPaused),d=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:n,startedFiles:o,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:h,inProgressFiles:s,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===r.length&&0===d.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},n={...r},o=Object.create(null);function a(e){return void 0===o[e]}e.forEach(e=>{i[e]&&(o[e]=i[e],delete s[e])}),Object.keys(n).forEach(e=>{let t=r[e].fileIDs.filter(a);if(0===t.length)return void delete n[e];let{capabilities:i}=this.getState();if(t.length!==r[e].fileIDs.length&&!i.individualCancellation)throw Error("individualCancellation is disabled");n[e]={...r[e],fileIDs:t}});let l={currentUploads:n,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(o);u.forEach(e=>{this.emit("file-removed",o[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,en)[en](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,en)[en](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 n=0;t.forEach(e=>{n+=e.progress.bytesUploaded}),i.forEach(e=>{n+=s*(e.progress.percentage||0)/100});let o=0===r?0:Math.round(n/r*100);o>100&&(o=100),this.setState({totalProgress:o}),this.emit("progress",o)}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,en)[en](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,en)[en](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 ep(e,t){var i,r;let s;t instanceof File&&(t={name:t.name,type:t.type,size:t.size,data:t});let n=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),o=(i=t).name?i.name:"image"===n.split("/")[0]?`${n.split("/")[0]}.${n.split("/")[1]}`:"noname",a=C(o).extension,l=!!t.isRemote,u=(r={...t,type:n},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:o}));throw j(this,K)[K](e,t),e}let h=t.meta||{};h.name=o,h.type=n;let p=Number.isFinite(t.data.size)?t.data.size:null,d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...h},type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:p,uploadComplete:!1,uploadStarted:null},size:p,isRemote:l,remote:t.remote||"",preview:t.preview},c=this.opts.onBeforeFileAdded(d,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&&(d=c);try{let t=Object.keys(e).map(t=>e[t]);j(this,H)[H].validate(d,t)}catch(e){throw j(this,K)[K](e,d),e}return d}function ed(){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 n=((e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})();return this.emit("upload",{id:n,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...s,[n]:{fileIDs:e,step:0,result:{}}}}),n}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,n=[...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),n=t.filter(e=>e.error);await this.addResultData(e,{successful:s,failed:n,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}eo.VERSION="3.0.6",e.s(["default",0,eo],677457);var eb,ev,ew,e_,eP,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 eE(e,t,i){var r,s,n,o={};for(n in t)"key"==n?r=t[n]:"ref"==n?s=t[n]:o[n]=t[n];if(arguments.length>2&&(o.children=arguments.length>3?eb.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(n in e.defaultProps)void 0===o[n]&&(o[n]=e.defaultProps[n]);return eA(e,o,r,s,null)}function eA(e,t,i,r,s){var n={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(n),n}function eR(e){return e.children}function eF(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?eA(c.type,c.props,c.key,null,c.__v):c)){if(c.__=i,c.__b=i.__b+1,null===(d=y[h])||d&&c.key==d.key&&c.type===d.type)y[h]=void 0;else for(p=0;p2&&(o.children=arguments.length>3?eb.call(arguments,2):i),eA(e.type,o,r||e.key,s||e.ref,null)},"createRef",0,function(){return{current:null}},"h",0,eE,"render",0,eG,"toChildArray",0,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",0,eW],145876);let eK=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};e.s(["default",0,eK],655929);class eY{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 eQ(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var eX=0,eJ="__private_"+eX+++"_updateUI";class eZ extends eY{constructor(){super(...arguments),Object.defineProperty(this,eJ,{writable:!0,value:void 0})}getTargetPlugin(e){let t;return"object"==typeof e&&e instanceof eZ?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,n=(void 0===i&&(i=document),"string"==typeof e)?i.querySelector(e):eW(e)?e:null;if(n){let t,i;this.isTargetDOMEl=!0;let o=document.createElement("div");return o.classList.add("uppy-Root"),eQ(this,eJ)[eJ]=(r=e=>{this.uppy.getPlugin(this.id)&&(eG(this.render(e),o),this.afterUpdate())},t=null,i=null,function(){for(var e=arguments.length,s=Array(e),n=0;n(t=null,r(...i)))),t}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),eG(this.render(this.uppy.getState()),o),this.el=o,n.appendChild(o),o.dir=this.opts.direction||eK(o)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${s} to ${o.id}`),this.parent=o,this.el=o.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