iking-web-ui-pro 0.3.2 → 0.3.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.
Files changed (109) hide show
  1. package/dist/IkApprovalProcessDetail/ik.index.es.js +16 -14
  2. package/dist/IkApprovalProcessDetail/iking-web-ui-pro.css +1 -1
  3. package/dist/IkBaseDialog/ik.index.es.js +28 -28
  4. package/dist/IkBaseDialog/iking-web-ui-pro.css +1 -1
  5. package/dist/IkBtnSetting/ik.index.es.js +25 -24
  6. package/dist/IkBtnSetting/iking-web-ui-pro.css +1 -1
  7. package/dist/IkCalendar/ik.index.es.js +10320 -10322
  8. package/dist/IkCollapseCard/ik.index.es.js +20 -19
  9. package/dist/IkCollapseCard/iking-web-ui-pro.css +1 -1
  10. package/dist/IkDescription/ik.index.es.js +16 -14
  11. package/dist/IkDescription/iking-web-ui-pro.css +1 -1
  12. package/dist/IkDetailPreviewFiles/ik.index.es.js +16 -14
  13. package/dist/IkDetailPreviewFiles/iking-web-ui-pro.css +1 -1
  14. package/dist/IkEmpty/ik.index.es.js +7 -7
  15. package/dist/IkEmpty/iking-web-ui-pro.css +1 -1
  16. package/dist/IkExpandCollapse/ik.index.es.js +59 -58
  17. package/dist/IkExpandCollapse/iking-web-ui-pro.css +1 -1
  18. package/dist/IkFullCalendar/ik.index.es.js +12 -9334
  19. package/dist/IkIconPicker/ik.index.es.js +22 -21
  20. package/dist/IkIconPicker/iking-web-ui-pro.css +1 -1
  21. package/dist/IkMonacoEditor/ik.index.es.js +31 -30
  22. package/dist/IkMonacoEditor/iking-web-ui-pro.css +1 -1
  23. package/dist/IkPageFull/ik.index.es.js +127 -126
  24. package/dist/IkPageFull/iking-web-ui-pro.css +1 -1
  25. package/dist/IkPreviewFile/ik.index.es.js +16 -14
  26. package/dist/IkPreviewFile/iking-web-ui-pro.css +1 -1
  27. package/dist/IkPreviewFileDialog/ik.index.es.js +50 -50
  28. package/dist/IkPreviewFileDialog/iking-web-ui-pro.css +1 -1
  29. package/dist/IkSchedule/ik.index.es.js +385 -9680
  30. package/dist/IkSchedule/iking-web-ui-pro.css +1 -1
  31. package/dist/IkSelectTag/ik.index.es.js +83 -82
  32. package/dist/IkSelectTag/iking-web-ui-pro.css +1 -1
  33. package/dist/IkSideText/ik.index.es.js +23 -22
  34. package/dist/IkSideText/iking-web-ui-pro.css +1 -1
  35. package/dist/IkStatuOver/ik.index.es.js +68 -67
  36. package/dist/IkStatuOver/iking-web-ui-pro.css +1 -1
  37. package/dist/IkSvgIcon/ik.index.es.js +51 -50
  38. package/dist/IkSvgIcon/iking-web-ui-pro.css +1 -1
  39. package/dist/IkUploadFile/ik.index.es.js +71 -71
  40. package/dist/IkUploadFile/iking-web-ui-pro.css +1 -1
  41. package/dist/IkUploadImage/ik.index.es.js +82 -86
  42. package/dist/IkUploadImage/iking-web-ui-pro.css +1 -1
  43. package/dist/IkVerticalStepBar/ik.index.es.js +75 -74
  44. package/dist/IkVerticalStepBar/iking-web-ui-pro.css +1 -1
  45. package/dist/iking-web-ui-pro.css +2 -2
  46. package/dist/index.es.js +22453 -22651
  47. package/dist/index.umd.js +115 -115
  48. package/dist/src/components/IkFullCalendar/index.d.ts +1 -63
  49. package/dist/src/components/IkFullCalendar/src/IkFullCalendar.vue.d.ts +2 -0
  50. package/dist/src/components/IkMonacoEditor/index.d.ts +3 -0
  51. package/dist/src/components/IkMonacoEditor/src/index.vue.d.ts +3 -0
  52. package/dist/src/components/IkSchedule/index.d.ts +12 -12
  53. package/dist/src/components/IkSvgIcon/index.d.ts +3 -0
  54. package/dist/src/components/IkSvgIcon/src/index.vue.d.ts +3 -0
  55. package/package.json +1 -1
  56. package/dist/Demo/ik.index.umd.js +0 -1
  57. package/dist/IkApprovalProcess/ik.index.umd.js +0 -1
  58. package/dist/IkApprovalProcessDetail/ik.index.umd.js +0 -226
  59. package/dist/IkAutoCard/ik.index.umd.js +0 -1
  60. package/dist/IkBaseDialog/ik.index.umd.js +0 -1
  61. package/dist/IkBottomOperate/ik.index.umd.js +0 -1
  62. package/dist/IkBtnContent/ik.index.umd.js +0 -1
  63. package/dist/IkBtnSetting/ik.index.umd.js +0 -1
  64. package/dist/IkCalendar/ik.index.umd.js +0 -1
  65. package/dist/IkCollapseCard/ik.index.umd.js +0 -1
  66. package/dist/IkCurrencyInput/ik.index.umd.js +0 -1
  67. package/dist/IkDescription/ik.index.umd.js +0 -226
  68. package/dist/IkDetailPreviewFiles/ik.index.umd.js +0 -226
  69. package/dist/IkDragList/ik.index.umd.js +0 -1
  70. package/dist/IkEmpty/ik.index.umd.js +0 -1
  71. package/dist/IkExpandCollapse/ik.index.umd.js +0 -1
  72. package/dist/IkFileIcon/ik.index.umd.js +0 -1
  73. package/dist/IkFullCalendar/ik.index.umd.js +0 -1
  74. package/dist/IkFullCalendar/iking-web-ui-pro.css +0 -1
  75. package/dist/IkHorizontalStepBar/ik.index.umd.js +0 -1
  76. package/dist/IkIconPicker/ik.index.umd.js +0 -1
  77. package/dist/IkImageEditor/ik.index.umd.js +0 -1
  78. package/dist/IkImageUploadEditor/ik.index.umd.js +0 -37
  79. package/dist/IkImageViewer/ik.index.umd.js +0 -1
  80. package/dist/IkMonacoEditor/ik.index.umd.js +0 -11
  81. package/dist/IkOnlyOffice/ik.index.umd.js +0 -1
  82. package/dist/IkPage/ik.index.umd.js +0 -1
  83. package/dist/IkPageFull/ik.index.umd.js +0 -17
  84. package/dist/IkPageTabs/ik.index.umd.js +0 -1
  85. package/dist/IkPickerUser/ik.index.umd.js +0 -1
  86. package/dist/IkPlayer/ik.index.umd.js +0 -226
  87. package/dist/IkPreviewFile/ik.index.umd.js +0 -226
  88. package/dist/IkPreviewFileDialog/ik.index.umd.js +0 -226
  89. package/dist/IkPrintConfig/ik.index.umd.js +0 -1
  90. package/dist/IkPrintView/ik.index.umd.js +0 -1
  91. package/dist/IkRadioGroup/ik.index.umd.js +0 -1
  92. package/dist/IkSchedule/ik.index.umd.js +0 -1
  93. package/dist/IkSearch/ik.index.umd.js +0 -26
  94. package/dist/IkSearchHead/ik.index.umd.js +0 -1
  95. package/dist/IkSelectTag/ik.index.umd.js +0 -1
  96. package/dist/IkSideText/ik.index.umd.js +0 -1
  97. package/dist/IkStatu/ik.index.umd.js +0 -1
  98. package/dist/IkStatuOver/ik.index.umd.js +0 -1
  99. package/dist/IkSvgIcon/ik.index.umd.js +0 -1
  100. package/dist/IkTaskResume/ik.index.umd.js +0 -1
  101. package/dist/IkTemplateOfficeConfig/ik.index.umd.js +0 -1
  102. package/dist/IkTinymce/ik.index.umd.js +0 -90
  103. package/dist/IkTooltip/ik.index.umd.js +0 -1
  104. package/dist/IkTree/ik.index.umd.js +0 -1
  105. package/dist/IkUploadFile/ik.index.umd.js +0 -226
  106. package/dist/IkUploadImage/ik.index.umd.js +0 -1
  107. package/dist/IkVerticalStepBar/ik.index.umd.js +0 -9
  108. package/dist/Provider/ik.index.umd.js +0 -1
  109. package/dist/src/components/IkFullCalendar/src/ik-full-calendar.d.ts +0 -8
@@ -1,37 +0,0 @@
1
- (function(Ye,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],T):(Ye=typeof globalThis<"u"?globalThis:Ye||self,T(Ye.index={},Ye.vue))})(this,function(Ye,T){"use strict";const Pl=(i,e)=>(i.install=t=>{for(const s of[i,...Object.values({})])t.component(s.name,s)},i);function Oi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cl=0;function pn(i){return"__private_"+Cl+++"_"+i}function El(i,e,t){const s=[];return i.forEach(r=>typeof r!="string"?s.push(r):e[Symbol.split](r).forEach((n,a,o)=>{n!==""&&s.push(n),a<o.length-1&&s.push(t)})),s}/**
2
- * Takes a string with placeholder variables like `%{smart_count} file selected`
3
- * and replaces it with values from options `{smart_count: 5}`
4
- *
5
- * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
6
- * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
7
- *
8
- * @param phrase that needs interpolation, with placeholders
9
- * @param options with values that will be used to replace placeholders
10
- */function fn(i,e){const t=/\$/g,s="$$$$";let r=[i];if(e==null)return r;for(const n of Object.keys(e))if(n!=="_"){let a=e[n];typeof a=="string"&&(a=t[Symbol.replace](a,s)),r=El(r,new RegExp(`%\\{${n}\\}`,"g"),a)}return r}const Ol=i=>{throw new Error(`missing string: ${i}`)};var Nt=pn("onMissingKey"),It=pn("apply");class mn{constructor(e,t){let{onMissingKey:s=Ol}=t===void 0?{}:t;Object.defineProperty(this,It,{value:xl}),Object.defineProperty(this,Nt,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(Oi(this,It)[It],this):Oi(this,It)[It](e),Oi(this,Nt)[Nt]=s}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];if(s==null&&(Oi(this,Nt)[Nt](e),s=e),typeof s=="object"){if(t&&typeof t.smart_count<"u"){const n=this.locale.pluralize(t.smart_count);return fn(s[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof s!="string")throw new Error("string was not a string");return fn(s,t)}}function xl(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var os,gn;function Rl(){return gn||(gn=1,os=function(){var e={},t=e._fns={};e.emit=function(a,o,l,u,c,h,p){var f=s(a);f.length&&r(a,f,[o,l,u,c,h,p])},e.on=function(a,o){t[a]||(t[a]=[]),t[a].push(o)},e.once=function(a,o){function l(){o.apply(this,arguments),e.off(a,l)}this.on(a,l)},e.off=function(a,o){var l=[];if(a&&o){var u=this._fns[a],c=0,h=u?u.length:0;for(c;c<h;c++)u[c]!==o&&l.push(u[c])}l.length?this._fns[a]=l:delete this._fns[a]};function s(n){var a=t[n]?t[n]:[],o=n.indexOf(":"),l=o===-1?[n]:[n.substring(0,o),n.substring(o+1)],u=Object.keys(t),c=0,h=u.length;for(c;c<h;c++){var p=u[c];if(p==="*"&&(a=a.concat(t[p])),l.length===2&&l[0]===p){a=a.concat(t[p]);break}}return a}function r(n,a,o){var l=0,u=a.length;for(l;l<u&&a[l];l++)a[l].event=n,a[l].apply(a[l],o)}return e}),os}var Dl=Rl();const Al=Ke(Dl);let kl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Ri=(i=21)=>{let e="",t=i|0;for(;t--;)e+=kl[Math.random()*64|0];return e};var ls,yn;function us(){if(yn)return ls;yn=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ls=i,ls}var ds,vn;function Ml(){if(vn)return ds;vn=1;var i=typeof xi=="object"&&xi&&xi.Object===Object&&xi;return ds=i,ds}var hs,bn;function wn(){if(bn)return hs;bn=1;var i=Ml(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return hs=t,hs}var cs,Sn;function Nl(){if(Sn)return cs;Sn=1;var i=wn(),e=function(){return i.Date.now()};return cs=e,cs}var ps,_n;function Il(){if(_n)return ps;_n=1;var i=/\s/;function e(t){for(var s=t.length;s--&&i.test(t.charAt(s)););return s}return ps=e,ps}var fs,Fn;function Ul(){if(Fn)return fs;Fn=1;var i=Il(),e=/^\s+/;function t(s){return s&&s.slice(0,i(s)+1).replace(e,"")}return fs=t,fs}var ms,Tn;function Pn(){if(Tn)return ms;Tn=1;var i=wn(),e=i.Symbol;return ms=e,ms}var gs,Cn;function Bl(){if(Cn)return gs;Cn=1;var i=Pn(),e=Object.prototype,t=e.hasOwnProperty,s=e.toString,r=i?i.toStringTag:void 0;function n(a){var o=t.call(a,r),l=a[r];try{a[r]=void 0;var u=!0}catch{}var c=s.call(a);return u&&(o?a[r]=l:delete a[r]),c}return gs=n,gs}var ys,En;function Ll(){if(En)return ys;En=1;var i=Object.prototype,e=i.toString;function t(s){return e.call(s)}return ys=t,ys}var vs,On;function zl(){if(On)return vs;On=1;var i=Pn(),e=Bl(),t=Ll(),s="[object Null]",r="[object Undefined]",n=i?i.toStringTag:void 0;function a(o){return o==null?o===void 0?r:s:n&&n in Object(o)?e(o):t(o)}return vs=a,vs}var bs,xn;function $l(){if(xn)return bs;xn=1;function i(e){return e!=null&&typeof e=="object"}return bs=i,bs}var ws,Rn;function jl(){if(Rn)return ws;Rn=1;var i=zl(),e=$l(),t="[object Symbol]";function s(r){return typeof r=="symbol"||e(r)&&i(r)==t}return ws=s,ws}var Ss,Dn;function Hl(){if(Dn)return Ss;Dn=1;var i=Ul(),e=us(),t=jl(),s=NaN,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return s;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=i(u);var h=n.test(u);return h||a.test(u)?o(u.slice(2),h?2:8):r.test(u)?s:+u}return Ss=l,Ss}var _s,An;function kn(){if(An)return _s;An=1;var i=us(),e=Nl(),t=Hl(),s="Expected a function",r=Math.max,n=Math.min;function a(o,l,u){var c,h,p,f,m,v,y=0,w=!1,b=!1,E=!0;if(typeof o!="function")throw new TypeError(s);l=t(l)||0,i(u)&&(w=!!u.leading,b="maxWait"in u,p=b?r(t(u.maxWait)||0,l):p,E="trailing"in u?!!u.trailing:E);function C(D){var N=c,z=h;return c=h=void 0,y=D,f=o.apply(z,N),f}function P(D){return y=D,m=setTimeout(F,l),w?C(D):f}function g(D){var N=D-v,z=D-y,Z=l-N;return b?n(Z,p-z):Z}function S(D){var N=D-v,z=D-y;return v===void 0||N>=l||N<0||b&&z>=p}function F(){var D=e();if(S(D))return x(D);m=setTimeout(F,g(D))}function x(D){return m=void 0,E&&c?C(D):(c=h=void 0,f)}function U(){m!==void 0&&clearTimeout(m),y=0,c=v=h=m=void 0}function M(){return m===void 0?f:x(e())}function I(){var D=e(),N=S(D);if(c=arguments,h=this,v=D,N){if(m===void 0)return P(v);if(b)return clearTimeout(m),m=setTimeout(F,l),C(v)}return m===void 0&&(m=setTimeout(F,l)),f}return I.cancel=U,I.flush=M,I}return _s=a,_s}var Fs,Mn;function ql(){if(Mn)return Fs;Mn=1;var i=kn(),e=us(),t="Expected a function";function s(r,n,a){var o=!0,l=!0;if(typeof r!="function")throw new TypeError(t);return e(a)&&(o="leading"in a?!!a.leading:o,l="trailing"in a?!!a.trailing:l),i(r,n,{leading:o,maxWait:n,trailing:l})}return Fs=s,Fs}var Vl=ql();const Wl=Ke(Vl);function Di(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Gl=0;function Nn(i){return"__private_"+Gl+++"_"+i}const Xl={version:"4.1.2"};var rt=Nn("callbacks"),Ts=Nn("publish");class In{constructor(){Object.defineProperty(this,Ts,{value:Yl}),this.state={},Object.defineProperty(this,rt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},s={...this.state,...e};this.state=s,Di(this,Ts)[Ts](t,s,e)}subscribe(e){return Di(this,rt)[rt].add(e),()=>{Di(this,rt)[rt].delete(e)}}}function Yl(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Di(this,rt)[rt].forEach(s=>{s(...e)})}In.VERSION=Xl.version;function Un(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const Ps={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Bn(i){var e;if(i.type)return i.type;const t=i.name?(e=Un(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in Ps?Ps[t]:"application/octet-stream"}function Kl(i){return i.charCodeAt(0).toString(32)}function Ln(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Kl(t)}`,"/"))+e}function Jl(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Ln(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Ln(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function Ql(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Zl(i,e){if(Ql(i))return i.id;const t=Bn(i);return Jl({...i,type:t},e)}function eu(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const s=e[1].split(".",2),r=parseInt(s[0],10),n=parseInt(s[1],10);return r<15||r===15&&n<15063||r>18||r===18&&n>=18218}function tu(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Cs(i){return i<10?`0${i}`:i.toString()}function Ai(){const i=new Date,e=Cs(i.getHours()),t=Cs(i.getMinutes()),s=Cs(i.getSeconds());return`${e}:${t}:${s}`}const iu={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ai()}]`,...e)}},su={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ai()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ai()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ai()}]`,...e)}};var Es,zn;function ru(){return zn||(zn=1,Es=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),s===0)return"0 B";const r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(s)/Math.log(1024)),r.length-1),a=Number(s/1024**n),o=r[n];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${o}`}),Es}var nu=ru();const nt=Ke(nu);var Os,$n;function au(){if($n)return Os;$n=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,s=this.parts,r,n=s.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||"").split(this.separator),r=0;t&&r<n;r++)s[r]!=="*"&&(r<a.length?t=s[r]===a[r]:t=!1);t=t&&a}else if(typeof e.splice=="function")for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e=="object"){t={};for(var o in e)this.match(o)&&(t[o]=e[o])}return t},Os=function(e,t,s){var r=new i(e,s||/[\/\.]/);return typeof t<"u"?r.match(t):r},Os}var xs,jn;function ou(){if(jn)return xs;jn=1;var i=au(),e=/[\/\+\.]/;return xs=function(t,s){function r(n){var a=i(n,t,e);return a&&a.length>=2}return s?r(s.split(";")[0]):r},xs}var lu=ou();const uu=Ke(lu),du={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class ve extends Error{constructor(e,t){var s;super(e),this.isRestriction=!0,this.isUserFacing=(s=t==null?void 0:t.isUserFacing)!=null?s:!0,t!=null&&t.file&&(this.file=t.file)}}class hu{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var s;const r=e();if(((s=r.restrictions)==null?void 0:s.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(a=>!a.isGhost).length+t.length>r)throw new ve(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(s){const n=[...e,...t].reduce((a,o)=>{var l;return a+((l=o.size)!=null?l:0)},0);if(n>s)throw new ve(this.getI18n()("aggregateExceedsSize",{sizeAllowed:nt(s),size:nt(n)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(o=>o.includes("/")?e.type?uu(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=r.join(", ");throw new ve(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new ve(this.getI18n()("exceedsSize",{size:nt(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(s&&e.size!=null&&e.size<s)throw new ve(this.getI18n()("inferiorSize",{size:nt(s)}),{file:e})}validate(e,t){t.forEach(s=>{this.validateSingleFile(s)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new ve(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;const s=new ve(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,n=[];for(const a of r)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&n.push(a);return{missingFields:n,error:s}}}const cu={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function _(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var pu=0;function B(i){return"__private_"+pu+++"_"+i}const fu={version:"4.3.1"},ki={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var K=B("plugins"),J=B("restricter"),Ut=B("storeUnsubscribe"),De=B("emitter"),at=B("preProcessors"),ot=B("uploaders"),Ae=B("postProcessors"),ue=B("informAndEmit"),Bt=B("checkRequiredMetaFieldsOnFile"),Rs=B("checkRequiredMetaFields"),Lt=B("assertNewUploadAllowed"),Ds=B("transformFile"),zt=B("startIfAutoProceed"),$t=B("checkAndUpdateFileState"),As=B("handleUploadProgress"),jt=B("updateTotalProgress"),ke=B("updateTotalProgressThrottled"),ks=B("calculateTotalProgress"),Ms=B("addListeners"),be=B("updateOnlineStatus"),Ht=B("requestClientById"),Me=B("createUpload"),Ns=B("getUpload"),lt=B("removeUpload"),Ne=B("runUpload");class Ie{constructor(e){Object.defineProperty(this,Ne,{value:Ou}),Object.defineProperty(this,lt,{value:Eu}),Object.defineProperty(this,Ns,{value:Cu}),Object.defineProperty(this,Me,{value:Pu}),Object.defineProperty(this,Ms,{value:Tu}),Object.defineProperty(this,ks,{value:Fu}),Object.defineProperty(this,jt,{value:_u}),Object.defineProperty(this,$t,{value:Su}),Object.defineProperty(this,zt,{value:wu}),Object.defineProperty(this,Ds,{value:bu}),Object.defineProperty(this,Lt,{value:vu}),Object.defineProperty(this,Rs,{value:yu}),Object.defineProperty(this,Bt,{value:gu}),Object.defineProperty(this,ue,{value:mu}),Object.defineProperty(this,K,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,Ut,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:Al()}),Object.defineProperty(this,at,{writable:!0,value:new Set}),Object.defineProperty(this,ot,{writable:!0,value:new Set}),Object.defineProperty(this,Ae,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,As,{writable:!0,value:(r,n)=>{const a=r?this.getFile(r.id):void 0;if(r==null||!a){this.log(`Not setting progress for a file that has been removed: ${r==null?void 0:r.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}const o={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(r.id,{progress:{...a.progress,...o,bytesUploaded:n.bytesUploaded}}):this.setFileState(r.id,{progress:{...a.progress,...o}}),_(this,ke)[ke]()}}),Object.defineProperty(this,ke,{writable:!0,value:Wl(()=>_(this,jt)[jt](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,be,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Ht,{writable:!0,value:new Map}),this.defaultLocale=cu;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:du,meta:{},onBeforeFileAdded:(r,n)=>!Object.hasOwn(n,r.id),onBeforeUpload:r=>r,store:new In,logger:iu,infoTimeout:5e3},s={...t,...e};this.opts={...s,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=su),this.log(`Using Core v${Ie.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...ki,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:eu(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),_(this,J)[J]=new hu(()=>this.opts,()=>this.i18n),_(this,Ut)[Ut]=this.store.subscribe((r,n,a)=>{this.emit("state-update",r,n,a),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),_(this,Ms)[Ms]()}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];_(this,De)[De].emit(e,...s)}on(e,t){return _(this,De)[De].on(e,t),this}once(e,t){return _(this,De)[De].once(e,t),this}off(e,t){return _(this,De)[De].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(s=>{let[r,n]=s;return[r,{...t[r],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=s=>this.log(`Missing i18n string: ${s}`,"error"),t=new mn([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e==null?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},s=Object.create(null);Object.keys(t).forEach(r=>{s[r]={...t[r],progress:{...t[r].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:s,...ki})}clear(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...ki,files:{}})}addPreProcessor(e){_(this,at)[at].add(e)}removePreProcessor(e){return _(this,at)[at].delete(e)}addPostProcessor(e){_(this,Ae)[Ae].add(e)}removePostProcessor(e){return _(this,Ae)[Ae].delete(e)}addUploader(e){_(this,ot)[ot].add(e)}removeUploader(e){return _(this,ot)[ot].delete(e)}setMeta(e){const t={...this.getState().meta,...e},s={...this.getState().files};Object.keys(s).forEach(r=>{s[r]={...s[r],meta:{...s[r].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:s})}setFileMeta(e,t){const s={...this.getState().files};if(!s[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const r={...s[e].meta,...t};s[e]={...s[e],meta:r},this.setState({files:s})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:s}=this.getState(),r=Object.values(e),n=[],a=[],o=[],l=[],u=[],c=[],h=[],p=[],f=[];for(const m of r){const{progress:v}=m;!v.uploadComplete&&v.uploadStarted&&(n.push(m),m.isPaused||p.push(m)),v.uploadStarted||a.push(m),(v.uploadStarted||v.preprocess||v.postprocess)&&o.push(m),v.uploadStarted&&l.push(m),m.isPaused&&u.push(m),v.uploadComplete&&c.push(m),m.error&&h.push(m),(v.preprocess||v.postprocess)&&f.push(m)}return{newFiles:a,startedFiles:o,uploadStartedFiles:l,pausedFiles:u,completeFiles:c,erroredFiles:h,inProgressFiles:n,inProgressNotPausedFiles:p,processingFiles:f,isUploadStarted:l.length>0,isAllComplete:t===100&&c.length===r.length&&f.length===0,isAllErrored:!!s&&h.length===r.length,isAllPaused:n.length!==0&&u.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:r.some(m=>m.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{_(this,J)[J].validate(t,[e])}catch(s){return s}return null}validateSingleFile(e){try{_(this,J)[J].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{_(this,J)[J].validateAggregateRestrictions(t,e)}catch(s){return s.message}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){_(this,Lt)[Lt](e);const{nextFilesState:t,validFilesToAdd:s,errors:r}=_(this,$t)[$t]([e]),n=r.filter(o=>o.isRestriction);if(_(this,ue)[ue](n),r.length>0)throw r[0];this.setState({files:t});const[a]=s;return this.emit("file-added",a),this.emit("files-added",s),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),_(this,zt)[zt](),a.id}addFiles(e){_(this,Lt)[Lt]();const{nextFilesState:t,validFilesToAdd:s,errors:r}=_(this,$t)[$t](e),n=r.filter(o=>o.isRestriction);_(this,ue)[ue](n);const a=r.filter(o=>!o.isRestriction);if(a.length>0){let o=`Multiple errors occurred while adding files:
11
- `;if(a.forEach(l=>{o+=`
12
- * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:o},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,o);{const l=new Error(o);throw l.errors=a,l}}this.setState({files:t}),s.forEach(o=>{this.emit("file-added",o)}),this.emit("files-added",s),s.length>5?this.log(`Added batch of ${s.length} files`):Object.values(s).forEach(o=>{this.log(`Added file: ${o.name}
13
- id: ${o.id}
14
- type: ${o.type}`)}),s.length>0&&_(this,zt)[zt]()}removeFiles(e){const{files:t,currentUploads:s}=this.getState(),r={...t},n={...s},a=Object.create(null);e.forEach(c=>{t[c]&&(a[c]=t[c],delete r[c])});function o(c){return a[c]===void 0}Object.keys(n).forEach(c=>{const h=s[c].fileIDs.filter(o);if(h.length===0){delete n[c];return}const{capabilities:p}=this.getState();if(h.length!==s[c].fileIDs.length&&!p.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[c]={...s[c],fileIDs:h}});const l={currentUploads:n,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),_(this,ke)[ke]();const u=Object.keys(a);u.forEach(c=>{this.emit("file-removed",a[c])}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=this.getFile(e),r=!(t.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const r={...e[s],isPaused:!0};e[s]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const r={...e[s],isPaused:!1,error:null};e[s]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(r=>e[r].error);if(t.forEach(r=>{const n={...e[r],isPaused:!1,error:null};e[r]=n}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});const s=_(this,Me)[Me](t,{forceAllowNewUpload:!0});return _(this,Ne)[Ne](s)}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(ki)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=_(this,Me)[Me]([e],{forceAllowNewUpload:!0});return _(this,Ne)[Ne](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return _(this,jt)[jt]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(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){if(typeof e!="function"){const l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];const n=new e(this,...s),a=n.id;if(!a)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(a);if(o){const l=`Already found a plugin named '${o.id}'. Tried to use: '${a}'.
15
- Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${a} v${e.VERSION}`),n.type in _(this,K)[K]?_(this,K)[K][n.type].push(n):_(this,K)[K][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(const t of Object.values(_(this,K)[K])){const s=t.find(r=>r.id===e);if(s!=null)return s}}[Symbol.for("uppy test: getPlugins")](e){return _(this,K)[K][e]}iteratePlugins(e){Object.values(_(this,K)[K]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=_(this,K)[K][e.type],s=t.findIndex(a=>a.id===e.id);s!==-1&&t.splice(s,1);const n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),_(this,Ut)[Ut](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",_(this,be)[be]),window.removeEventListener("offline",_(this,be)[be]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,s){t===void 0&&(t="info"),s===void 0&&(s=3e3);const r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),s),this.emit("info-visible")}log(e,t){const{logger:s}=this.opts;switch(t){case"error":s.error(e);break;case"warning":s.warn(e);break;default:s.debug(e);break}}registerRequestClient(e,t){_(this,Ht)[Ht].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=_(this,Ht)[Ht].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?_(this,Ne)[Ne](e):(_(this,lt)[lt](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return _(this,Me)[Me](...arguments)}addResultData(e,t){if(!_(this,Ns)[Ns](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:s}=this.getState(),r={...s[e],result:{...s[e].result,...t}};this.setState({currentUploads:{...s,[e]:r}})}upload(){var e;(e=_(this,K)[K].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const s=this.opts.onBeforeUpload(t);return s===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(s&&typeof s=="object"&&(t=s,this.setState({files:t})),Promise.resolve().then(()=>_(this,J)[J].validateMinNumberOfFiles(t)).catch(r=>{throw _(this,ue)[ue]([r]),r}).then(()=>{if(!_(this,Rs)[Rs](t))throw new ve(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{const{currentUploads:r}=this.getState(),n=Object.values(r).flatMap(l=>l.fileIDs),a=[];Object.keys(t).forEach(l=>{const u=this.getFile(l);!u.progress.uploadStarted&&n.indexOf(l)===-1&&a.push(u.id)});const o=_(this,Me)[Me](a);return _(this,Ne)[Ne](o)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}}function mu(i){for(const n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");const e=i.filter(n=>n.isUserFacing),t=4,s=e.slice(0,t),r=e.slice(t);s.forEach(n=>{let{message:a,details:o=""}=n;this.info({message:a,details:o},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function gu(i){const{missingFields:e,error:t}=_(this,J)[J].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function yu(i){let e=!0;for(const t of Object.values(i))_(this,Bt)[Bt](t)||(e=!1);return e}function vu(i){const{allowNewUpload:e}=this.getState();if(e===!1){const t=new ve(this.i18n("noMoreFilesAllowed"),{file:i});throw _(this,ue)[ue]([t]),t}}function bu(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Bn(e),s=tu(t,e),r=Un(s).extension,n=Zl(e,this.getID()),a=e.meta||{};a.name=s,a.type=t;const o=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:s,extension:r||"",meta:{...this.getState().meta,...a},type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:o,uploadComplete:!1,uploadStarted:null},size:o,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function wu(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function Su(i){const{files:e}=this.getState(),t={...e},s=[],r=[];for(const o of i)try{var n;let l=_(this,Ds)[Ds](o);const u=(n=e[l.id])==null?void 0:n.isGhost;u&&(l={...e[l.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));const c=this.opts.onBeforeFileAdded(l,t);if(!c&&this.checkIfFileAlreadyExists(l.id)){var a;throw new ve(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:o})}if(c===!1&&!u)throw new ve("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof c=="object"&&c!==null&&(l=c),_(this,J)[J].validateSingleFile(l),t[l.id]=l,s.push(l)}catch(l){r.push(l)}try{_(this,J)[J].validateAggregateRestrictions(Object.values(e),s)}catch(o){return r.push(o),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:s,errors:r}}function _u(){var i,e;const t=_(this,ks)[ks]();let s=null;t!=null&&(s=Math.round(t*100),s>100?s=100:s<0&&(s=0)),this.emit("progress",(i=s)!=null?i:0),this.setState({totalProgress:(e=s)!=null?e:0})}function Fu(){const e=this.getFiles().filter(o=>o.progress.uploadStarted||o.progress.preprocess||o.progress.postprocess);if(e.length===0)return 0;if(e.every(o=>o.progress.uploadComplete))return 1;const t=o=>o.progress.bytesTotal!=null&&o.progress.bytesTotal!==0,s=e.filter(t),r=e.filter(o=>!t(o));if(s.every(o=>o.progress.uploadComplete)&&r.length>0&&!r.every(o=>o.progress.uploadComplete))return null;const n=s.reduce((o,l)=>{var u;return o+((u=l.progress.bytesTotal)!=null?u:0)},0),a=s.reduce((o,l)=>o+(l.progress.bytesUploaded||0),0);return n===0?0:a/n}function Tu(){const i=(s,r,n)=>{let a=s.message||"Unknown error";s.details&&(a+=` ${s.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:n})};this.on("error",i),this.on("upload-error",(s,r,n)=>{if(i(r,s,n),typeof r=="object"&&r.message){var a;this.log(r.message,"error");const o=new Error(this.i18n("failedToUpload",{file:(a=s==null?void 0:s.name)!=null?a:""}));o.isUserFacing=!0,o.details=r.message,r.details&&(o.details+=` ${r.details}`),_(this,ue)[ue]([o])}else _(this,ue)[ue]([r])});let e=null;this.on("upload-stalled",(s,r)=>{const{message:n}=s,a=r.map(o=>o.meta.name).join(", ");e||(this.info({message:n,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const t=s=>{const r=s.filter(a=>{const o=a!=null&&this.getFile(a.id);return o||this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`),o}),n=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(n)};this.on("upload-start",t),this.on("upload-progress",_(this,As)[As]),this.on("upload-success",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}const n=this.getFile(s.id).progress;this.setFileState(s.id,{progress:{...n,postprocess:_(this,Ae)[Ae].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),s.size==null&&this.setFileState(s.id,{size:r.bytesUploaded||n.bytesTotal}),_(this,ke)[ke]()}),this.on("preprocess-progress",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}this.setFileState(s.id,{progress:{...this.getFile(s.id).progress,preprocess:r}})}),this.on("preprocess-complete",s=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}const r={...this.getState().files};r[s.id]={...r[s.id],progress:{...r[s.id].progress}},delete r[s.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(s,r)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}this.setFileState(s.id,{progress:{...this.getState().files[s.id].progress,postprocess:r}})}),this.on("postprocess-complete",s=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s==null?void 0:s.id}`);return}const r={...this.getState().files};r[s.id]={...r[s.id],progress:{...r[s.id].progress}},delete r[s.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{_(this,ke)[ke]()}),this.on("dashboard:file-edit-complete",s=>{s&&_(this,Bt)[Bt](s)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",_(this,be)[be]),window.addEventListener("offline",_(this,be)[be]),setTimeout(_(this,be)[be],3e3))}function Pu(i,e){e===void 0&&(e={});const{forceAllowNewUpload:t=!1}=e,{allowNewUpload:s,currentUploads:r}=this.getState();if(!s&&!t)throw new Error("Cannot create a new upload: already uploading.");const n=Ri();return this.emit("upload",n,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[n]:{fileIDs:i,step:0,result:{}}}}),n}function Cu(i){const{currentUploads:e}=this.getState();return e[i]}function Eu(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function Ou(i){const e=()=>{const{currentUploads:n}=this.getState();return n[i]};let t=e();const s=[..._(this,at)[at],..._(this,ot)[ot],..._(this,Ae)[Ae]];try{for(let n=t.step||0;n<s.length&&t;n++){const a=s[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});const{fileIDs:o}=t;await a(o,i),t=e()}}catch(n){throw _(this,lt)[lt](i),n}if(t){t.fileIDs.forEach(l=>{const u=this.getFile(l);u&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const n=t.fileIDs.map(l=>this.getFile(l)),a=n.filter(l=>!l.error),o=n.filter(l=>l.error);this.addResultData(i,{successful:a,failed:o,uploadID:i}),t=e()}let r;return t&&(r=t.result,this.emit("complete",r),_(this,lt)[lt](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r}Ie.VERSION=fu.version;var qt,L,Hn,ut,qn,Vn,Is,Wn,Us,Bs,Ls,Vt={},Gn=[],xu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Mi=Array.isArray;function Ue(i,e){for(var t in e)i[t]=e[t];return i}function zs(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function d(i,e,t){var s,r,n,a={};for(n in e)n=="key"?s=e[n]:n=="ref"?r=e[n]:a[n]=e[n];if(arguments.length>2&&(a.children=arguments.length>3?qt.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)a[n]===void 0&&(a[n]=i.defaultProps[n]);return Wt(i,a,s,r,null)}function Wt(i,e,t,s,r){var n={type:i,props:e,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Hn,__i:-1,__u:0};return r==null&&L.vnode!=null&&L.vnode(n),n}function Ru(){return{current:null}}function Je(i){return i.children}function re(i,e){this.props=i,this.context=e}function _t(i,e){if(e==null)return i.__?_t(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?_t(i):null}function Xn(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Xn(i)}}function Yn(i){(!i.__d&&(i.__d=!0)&&ut.push(i)&&!Ni.__r++||qn!==L.debounceRendering)&&((qn=L.debounceRendering)||Vn)(Ni)}function Ni(){var i,e,t,s,r,n,a,o;for(ut.sort(Is);i=ut.shift();)i.__d&&(e=ut.length,s=void 0,n=(r=(t=i).__v).__e,a=[],o=[],t.__P&&((s=Ue({},r)).__v=r.__v+1,L.vnode&&L.vnode(s),$s(t.__P,s,r,t.__n,t.__P.namespaceURI,32&r.__u?[n]:null,a,n??_t(r),!!(32&r.__u),o),s.__v=r.__v,s.__.__k[s.__i]=s,ea(a,s,o),s.__e!=n&&Xn(s)),ut.length>e&&ut.sort(Is));Ni.__r=0}function Kn(i,e,t,s,r,n,a,o,l,u,c){var h,p,f,m,v,y,w=s&&s.__k||Gn,b=e.length;for(l=Du(t,e,w,l,b),h=0;h<b;h++)(f=t.__k[h])!=null&&(p=f.__i===-1?Vt:w[f.__i]||Vt,f.__i=h,y=$s(i,f,p,r,n,a,o,l,u,c),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&js(p.ref,null,f),c.push(f.ref,f.__c||m,f)),v==null&&m!=null&&(v=m),4&f.__u||p.__k===f.__k?l=Jn(f,l,i):typeof f.type=="function"&&y!==void 0?l=y:m&&(l=m.nextSibling),f.__u&=-7);return t.__e=v,l}function Du(i,e,t,s,r){var n,a,o,l,u,c=t.length,h=c,p=0;for(i.__k=new Array(r),n=0;n<r;n++)(a=e[n])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=n+p,(a=i.__k[n]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Wt(null,a,null,null,null):Mi(a)?Wt(Je,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Wt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,o=null,(u=a.__i=Au(a,t,l,h))!==-1&&(h--,(o=t[u])&&(o.__u|=2)),o==null||o.__v===null?(u==-1&&p--,typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,a.__u|=4))):i.__k[n]=null;if(h)for(n=0;n<c;n++)(o=t[n])!=null&&!(2&o.__u)&&(o.__e==s&&(s=_t(o)),ta(o,o));return s}function Jn(i,e,t){var s,r;if(typeof i.type=="function"){for(s=i.__k,r=0;s&&r<s.length;r++)s[r]&&(s[r].__=i,e=Jn(s[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=_t(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Qe(i,e){return e=e||[],i==null||typeof i=="boolean"||(Mi(i)?i.some(function(t){Qe(t,e)}):e.push(i)),e}function Au(i,e,t,s){var r,n,a=i.key,o=i.type,l=e[t];if(l===null||l&&a==l.key&&o===l.type&&!(2&l.__u))return t;if(s>(l!=null&&!(2&l.__u)?1:0))for(r=t-1,n=t+1;r>=0||n<e.length;){if(r>=0){if((l=e[r])&&!(2&l.__u)&&a==l.key&&o===l.type)return r;r--}if(n<e.length){if((l=e[n])&&!(2&l.__u)&&a==l.key&&o===l.type)return n;n++}}return-1}function Qn(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||xu.test(e)?t:t+"px"}function Ii(i,e,t,s,r){var n;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof s=="string"&&(i.style.cssText=s=""),s)for(e in s)t&&e in t||Qn(i.style,e,"");if(t)for(e in t)s&&t[e]===s[e]||Qn(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Wn,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?s?t.u=s.u:(t.u=Us,i.addEventListener(e,n?Ls:Bs,n)):i.removeEventListener(e,n?Ls:Bs,n);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Zn(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=Us++;else if(e.t<t.u)return;return t(L.event?L.event(e):e)}}}function $s(i,e,t,s,r,n,a,o,l,u){var c,h,p,f,m,v,y,w,b,E,C,P,g,S,F,x,U,M=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),n=[o=e.__e=t.__e]),(c=L.__b)&&c(e);e:if(typeof M=="function")try{if(w=e.props,b="prototype"in M&&M.prototype.render,E=(c=M.contextType)&&s[c.__c],C=c?E?E.props.value:c.__:s,t.__c?y=(h=e.__c=t.__c).__=h.__E:(b?e.__c=h=new M(w,C):(e.__c=h=new re(w,C),h.constructor=M,h.render=Mu),E&&E.sub(h),h.props=w,h.state||(h.state={}),h.context=C,h.__n=s,p=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&M.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ue({},h.__s)),Ue(h.__s,M.getDerivedStateFromProps(w,h.__s))),f=h.props,m=h.state,h.__v=e,p)b&&M.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&M.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,C),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,C)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(h.props=w,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(I){I&&(I.__=e)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,C),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,m,v)})}if(h.context=C,h.props=w,h.__P=i,h.__e=!1,g=L.__r,S=0,b){for(h.state=h.__s,h.__d=!1,g&&g(e),c=h.render(h.props,h.state,h.context),F=0;F<h._sb.length;F++)h.__h.push(h._sb[F]);h._sb=[]}else do h.__d=!1,g&&g(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++S<25);h.state=h.__s,h.getChildContext!=null&&(s=Ue(Ue({},s),h.getChildContext())),b&&!p&&h.getSnapshotBeforeUpdate!=null&&(v=h.getSnapshotBeforeUpdate(f,m)),o=Kn(i,Mi(x=c!=null&&c.type===Je&&c.key==null?c.props.children:c)?x:[x],e,t,s,r,n,a,o,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&a.push(h),y&&(h.__E=h.__=null)}catch(I){if(e.__v=null,l||n!=null)if(I.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;n[n.indexOf(o)]=null,e.__e=o}else for(U=n.length;U--;)zs(n[U]);else e.__e=t.__e,e.__k=t.__k;L.__e(I,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=ku(t.__e,e,t,s,r,n,a,l,u);return(c=L.diffed)&&c(e),128&e.__u?void 0:o}function ea(i,e,t){for(var s=0;s<t.length;s++)js(t[s],t[++s],t[++s]);L.__c&&L.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(n){n.call(r)})}catch(n){L.__e(n,r.__v)}})}function ku(i,e,t,s,r,n,a,o,l){var u,c,h,p,f,m,v,y=t.props,w=e.props,b=e.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),n!=null){for(u=0;u<n.length;u++)if((f=n[u])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){i=f,n[u]=null;break}}if(i==null){if(b==null)return document.createTextNode(w);i=document.createElementNS(r,b,w.is&&w),o&&(L.__m&&L.__m(e,n),o=!1),n=null}if(b===null)y===w||o&&i.data===w||(i.data=w);else{if(n=n&&qt.call(i.childNodes),y=t.props||Vt,!o&&n!=null)for(y={},u=0;u<i.attributes.length;u++)y[(f=i.attributes[u]).name]=f.value;for(u in y)if(f=y[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=f;else if(!(u in w)){if(u=="value"&&"defaultValue"in w||u=="checked"&&"defaultChecked"in w)continue;Ii(i,u,null,f,r)}}for(u in w)f=w[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?m=f:u=="checked"?v=f:o&&typeof f!="function"||y[u]===f||Ii(i,u,f,y[u],r);if(c)o||h&&(c.__html===h.__html||c.__html===i.innerHTML)||(i.innerHTML=c.__html),e.__k=[];else if(h&&(i.innerHTML=""),Kn(i,Mi(p)?p:[p],e,t,s,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,n,a,n?n[0]:t.__k&&_t(t,0),o,l),n!=null)for(u=n.length;u--;)zs(n[u]);o||(u="value",b=="progress"&&m==null?i.removeAttribute("value"):m!==void 0&&(m!==i[u]||b=="progress"&&!m||b=="option"&&m!==y[u])&&Ii(i,u,m,y[u],r),u="checked",v!==void 0&&v!==i[u]&&Ii(i,u,v,y[u],r))}return i}function js(i,e,t){try{if(typeof i=="function"){var s=typeof i.__u=="function";s&&i.__u(),s&&e==null||(i.__u=i(e))}else i.current=e}catch(r){L.__e(r,t)}}function ta(i,e,t){var s,r;if(L.unmount&&L.unmount(i),(s=i.ref)&&(s.current&&s.current!==i.__e||js(s,null,e)),(s=i.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(n){L.__e(n,e)}s.base=s.__P=null}if(s=i.__k)for(r=0;r<s.length;r++)s[r]&&ta(s[r],e,t||typeof i.type!="function");t||zs(i.__e),i.__c=i.__=i.__e=void 0}function Mu(i,e,t){return this.constructor(i,t)}function ia(i,e,t){var s,r,n,a;e==document&&(e=document.documentElement),L.__&&L.__(i,e),r=(s=typeof t=="function")?null:e.__k,n=[],a=[],$s(e,i=e.__k=d(Je,null,[i]),r||Vt,Vt,e.namespaceURI,r?null:e.firstChild?qt.call(e.childNodes):null,n,r?r.__e:e.firstChild,s,a),ea(n,i,a)}function sa(i,e,t){var s,r,n,a,o=Ue({},i.props);for(n in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),e)n=="key"?s=e[n]:n=="ref"?r=e[n]:o[n]=e[n]===void 0&&a!==void 0?a[n]:e[n];return arguments.length>2&&(o.children=arguments.length>3?qt.call(arguments,2):t),Wt(i.type,o,s||i.key,r||i.ref,null)}qt=Gn.slice,L={__e:function(i,e,t,s){for(var r,n,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((n=r.constructor)&&n.getDerivedStateFromError!=null&&(r.setState(n.getDerivedStateFromError(i)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,s||{}),a=r.__d),a)return r.__E=r}catch(o){i=o}throw i}},Hn=0,re.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ue({},this.state),typeof i=="function"&&(i=i(Ue({},t),this.props)),i&&Ue(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Yn(this))},re.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Yn(this))},re.prototype.render=Je,ut=[],Vn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Is=function(i,e){return i.__v.__b-e.__v.__b},Ni.__r=0,Wn=/(PointerCapture)$|Capture$/i,Us=0,Bs=Zn(!1),Ls=Zn(!0);function ra(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Nu(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):ra(i)?i:null}function na(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class aa{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new mn([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function oa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Iu=0;function Uu(i){return"__private_"+Iu+++"_"+i}function Bu(i){let e=null,t;return function(){for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];return t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var Gt=Uu("updateUI");class ne extends aa{constructor(){super(...arguments),Object.defineProperty(this,Gt,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof(e==null?void 0:e.addTarget)=="function")t=e,t instanceof ne||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:ne}}));else if(typeof e=="function"){const s=e;this.uppy.iteratePlugins(r=>{r instanceof s&&(t=r)})}return t}mount(e,t){const s=t.id,r=Nu(e);if(r){this.isTargetDOMEl=!0;const o=document.createElement("div");return o.classList.add("uppy-Root"),oa(this,Gt)[Gt]=Bu(l=>{this.uppy.getPlugin(this.id)&&(ia(this.render(l,o),o),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),ia(this.render(this.uppy.getState(),o),o),this.el=o,r.appendChild(o),o.dir=this.opts.direction||na(o)||"ltr",this.onMount(),this.el}const 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 typeof e=="function"?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 <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,s;(t=(s=oa(this,Gt))[Gt])==null||t.call(s,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}function la(i,e,t,s){return i===e?i:s===0?e:i+(e-i)*2**(-s/t)}const Ce={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Hs={exports:{}};/*!
16
- Copyright (c) 2018 Jed Watson.
17
- Licensed under the MIT License (MIT), see
18
- http://jedwatson.github.io/classnames
19
- */var ua;function Lu(){return ua||(ua=1,function(i){(function(){var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(n=r(n,s(o)))}return n}function s(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var o in n)e.call(n,o)&&n[o]&&(a=r(a,o));return a}function r(n,a){return a?n?n+" "+a:n+a:n}i.exports?(t.default=t,i.exports=t):window.classNames=t})()}(Hs)),Hs.exports}var zu=Lu();const we=Ke(zu);function qs(i){const e=[];let t="indeterminate",s;for(const{progress:n}of Object.values(i)){const{preprocess:a,postprocess:o}=n;s==null&&(a||o)&&({mode:t,message:s}=a||o),(a==null?void 0:a.mode)==="determinate"&&e.push(a.value),(o==null?void 0:o.mode)==="determinate"&&e.push(o.value)}const r=e.reduce((n,a)=>n+a/e.length,0);return{mode:t,message:s,value:r}}function $u(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,s=Math.floor(i%60);return{hours:e,minutes:t,seconds:s}}function ju(i){const e=$u(i),t=e.hours===0?"":`${e.hours}h`,s=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${s}${r}`}const Hu="·",da=()=>` ${Hu} `;function qu(i){const{newFiles:e,isUploadStarted:t,recoveredState:s,i18n:r,uploadState:n,isSomeGhost:a,startUpload:o}=i,l=we("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===Ce.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=e&&t&&!s?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return d("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:o,disabled:a,"data-uppy-super-focusable":!0},u)}function Vu(i){const{i18n:e,uppy:t}=i;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},d("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function Wu(i){const{i18n:e,uppy:t}=i;return d("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},d("g",{fill:"none",fillRule:"evenodd"},d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function Gu(i){const{isAllPaused:e,i18n:t,isAllComplete:s,resumableUploads:r,uppy:n}=i,a=t(e?"resume":"pause");function o(){if(!s){if(!r){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return d("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:o,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},d("g",{fill:"none",fillRule:"evenodd"},d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Xu(i){const{i18n:e,doneButtonHandler:t}=i;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function ha(){return d("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},d("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function Yu(i){const{progress:e}=i,{value:t,mode:s,message:r}=e;return d("div",{className:"uppy-StatusBar-content"},d(ha,null),s==="determinate"?`${Math.round(t*100)}% · `:"",r)}function Ku(i){const{numUploads:e,complete:t,totalUploadedSize:s,totalSize:r,totalETA:n,i18n:a}=i,o=e>1,l=nt(s);return d("div",{className:"uppy-StatusBar-statusSecondary"},o&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),d("span",{className:"uppy-StatusBar-additionalInfo"},o&&da(),r!=null?a("dataUploadedOfTotal",{complete:l,total:nt(r)}):a("dataUploadedOfUnknown",{complete:l}),da(),n!=null&&a("xTimeLeft",{time:ju(n)})))}function ca(i){const{i18n:e,complete:t,numUploads:s}=i;return d("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:s}))}function Ju(i){const{i18n:e,newFiles:t,startUpload:s}=i,r=we("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return d("div",{className:"uppy-StatusBar-statusSecondary"},d("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),d("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:s},e("upload")))}function Qu(i){const{i18n:e,supportsUploadProgress:t,totalProgress:s,showProgressDetails:r,isUploadStarted:n,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:u,complete:c,totalUploadedSize:h,totalSize:p,totalETA:f,startUpload:m}=i,v=l&&n;if(!n||a)return null;const y=e(o?"paused":"uploading");function w(){return!o&&!v&&r?t?d(Ku,{numUploads:u,complete:c,totalUploadedSize:h,totalSize:p,totalETA:f,i18n:e}):d(ca,{i18n:e,complete:c,numUploads:u}):null}return d("div",{className:"uppy-StatusBar-content","aria-label":y,title:y},o?null:d(ha,null),d("div",{className:"uppy-StatusBar-status"},d("div",{className:"uppy-StatusBar-statusPrimary"},t&&s!==0?`${y}: ${s}%`:y),w(),v?d(Ju,{i18n:e,newFiles:l,startUpload:m}):null))}function Zu(i){const{i18n:e}=i;return d("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},d("div",{className:"uppy-StatusBar-status"},d("div",{className:"uppy-StatusBar-statusPrimary"},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},d("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function ed(i){const{error:e,i18n:t,complete:s,numUploads:r}=i;function n(){const a=`${t("uploadFailed")}
20
-
21
- ${e}`;alert(a)}return d("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},d("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"})),d("div",{className:"uppy-StatusBar-status"},d("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),d("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"},"?")),d(ca,{i18n:t,complete:s,numUploads:r})))}const{STATE_ERROR:pa,STATE_WAITING:td,STATE_PREPROCESSING:Vs,STATE_UPLOADING:Ui,STATE_POSTPROCESSING:Ws,STATE_COMPLETE:Bi}=Ce;function id(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:s,isAllPaused:r,resumableUploads:n,error:a,hideUploadButton:o=void 0,hidePauseResumeButton:l=!1,hideCancelButton:u=!1,hideRetryButton:c=!1,recoveredState:h,uploadState:p,totalProgress:f,files:m,supportsUploadProgress:v,hideAfterFinish:y=!1,isSomeGhost:w,doneButtonHandler:b=void 0,isUploadStarted:E,i18n:C,startUpload:P,uppy:g,isAllComplete:S,showProgressDetails:F=void 0,numUploads:x,complete:U,totalSize:M,totalETA:I,totalUploadedSize:D}=i;function N(){switch(p){case Ws:case Vs:{const as=qs(m);return as.mode==="determinate"?as.value*100:f}case pa:return null;case Ui:return v?f:null;default:return f}}function z(){switch(p){case Ws:case Vs:{const{mode:as}=qs(m);return as==="indeterminate"}case Ui:return!v;default:return!1}}const Z=N(),ye=Z??100,Pe=!a&&e&&(!s&&!r||h)&&t&&!o,pe=!u&&p!==td&&p!==Bi,Re=n&&!l&&p===Ui,Ci=a&&!S&&!c,Ei=b&&p===Bi,rs=we("uppy-StatusBar-progress",{"is-indeterminate":z()}),cn=we("uppy-StatusBar",`is-${p}`,{"has-ghosts":w}),ns=(()=>{switch(p){case Vs:case Ws:return d(Yu,{progress:qs(m)});case Bi:return d(Zu,{i18n:C});case pa:return d(ed,{error:a,i18n:C,numUploads:x,complete:U});case Ui:return d(Qu,{i18n:C,supportsUploadProgress:v,totalProgress:f,showProgressDetails:F,isUploadStarted:E,isAllComplete:S,isAllPaused:r,newFiles:e,numUploads:x,complete:U,totalUploadedSize:D,totalSize:M,totalETA:I,startUpload:P});default:return null}})();return d("div",{className:cn,"aria-hidden":!(Pe||Ci||Re||pe||Ei)&&!ns||p===Bi&&y},d("div",{className:rs,style:{width:`${ye}%`},role:"progressbar","aria-label":`${ye}%`,"aria-valuetext":`${ye}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Z}),ns,d("div",{className:"uppy-StatusBar-actions"},Pe?d(qu,{newFiles:e,isUploadStarted:E,recoveredState:h,i18n:C,isSomeGhost:w,startUpload:P,uploadState:p}):null,Ci?d(Vu,{i18n:C,uppy:g}):null,Re?d(Gu,{isAllPaused:r,i18n:C,isAllComplete:S,resumableUploads:n,uppy:g}):null,pe?d(Wu,{i18n:C,uppy:g}):null,Ei?d(Xu,{i18n:C,doneButtonHandler:b}):null))}const sd={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 H(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var rd=0;function Ft(i){return"__private_"+rd+++"_"+i}const nd={version:"4.0.6"},ad=2e3,od=2e3;function ld(i,e,t,s){if(i)return Ce.STATE_ERROR;if(e)return Ce.STATE_COMPLETE;if(t)return Ce.STATE_WAITING;let r=Ce.STATE_WAITING;const n=Object.keys(s);for(let a=0;a<n.length;a++){const{progress:o}=s[n[a]];if(o.uploadStarted&&!o.uploadComplete)return Ce.STATE_UPLOADING;o.preprocess&&(r=Ce.STATE_PREPROCESSING),o.postprocess&&r!==Ce.STATE_PREPROCESSING&&(r=Ce.STATE_POSTPROCESSING)}return r}const ud={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var fe=Ft("lastUpdateTime"),Se=Ft("previousUploadedBytes"),Be=Ft("previousSpeed"),de=Ft("previousETA"),Gs=Ft("computeSmoothETA"),Xt=Ft("onUploadStart");class Xs extends ne{constructor(e,t){super(e,{...ud,...t}),Object.defineProperty(this,Gs,{value:dd}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,Se,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,de,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Xt,{writable:!0,value:()=>{const{recoveredState:s}=this.uppy.getState();if(H(this,Be)[Be]=null,H(this,de)[de]=null,s){H(this,Se)[Se]=Object.values(s.files).reduce((r,n)=>{let{progress:a}=n;return r+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}H(this,fe)[fe]=performance.now(),H(this,Se)[Se]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=sd,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:s,allowNewUpload:r,totalProgress:n,error:a,recoveredState:o}=e,{newFiles:l,startedFiles:u,completeFiles:c,isUploadStarted:h,isAllComplete:p,isAllPaused:f,isUploadInProgress:m,isSomeGhost:v}=this.uppy.getObjectOfFilesPerState(),y=o?Object.values(s):l,w=!!t.resumableUploads,b=t.uploadProgress!==!1;let E=null,C=0;u.every(g=>g.progress.bytesTotal!=null&&g.progress.bytesTotal!==0)&&(E=0,u.forEach(g=>{E+=g.progress.bytesTotal||0,C+=g.progress.bytesUploaded||0})),u.forEach(g=>{C+=g.progress.bytesUploaded||0});const P=H(this,Gs)[Gs]({uploaded:C,total:E});return id({error:a,uploadState:ld(a,p,o,e.files||{}),allowNewUpload:r,totalProgress:n,totalSize:E,totalUploadedSize:C,isAllComplete:!1,isAllPaused:f,isUploadStarted:h,isUploadInProgress:m,isSomeGhost:v,recoveredState:o,complete:c.length,newFiles:y.length,numUploads:u.length,totalETA:P,files:s,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:w,supportsUploadProgress:b,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(){const e=this.el;na(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",H(this,Xt)[Xt]),H(this,fe)[fe]=performance.now(),H(this,Se)[Se]=this.uppy.getFiles().reduce((t,s)=>t+s.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",H(this,Xt)[Xt])}}function dd(i){var e,t;if(i.total==null||i.total===0)return null;const s=i.total-i.uploaded;if(s<=0)return null;(t=(e=H(this,fe))[fe])!=null||(e[fe]=performance.now());const r=performance.now()-H(this,fe)[fe];if(r===0){var n;return Math.round(((n=H(this,de)[de])!=null?n:0)/100)/10}const a=i.uploaded-H(this,Se)[Se];if(H(this,Se)[Se]=i.uploaded,a<=0){var o;return Math.round(((o=H(this,de)[de])!=null?o:0)/100)/10}const l=a/r,u=H(this,Be)[Be]==null?l:la(l,H(this,Be)[Be],ad,r);H(this,Be)[Be]=u;const c=s/u,h=Math.max(H(this,de)[de]-r,0),p=H(this,de)[de]==null?c:la(c,h,od,r);return H(this,de)[de]=p,H(this,fe)[fe]=performance.now(),Math.round(p/100)/10}Xs.VERSION=nd.version;const fa=300;class hd extends re{constructor(){super(...arguments),this.ref=Ru()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,fa)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,fa)}render(){const{children:e}=this.props;return d("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function cd(i,e){return Object.assign(i,e)}function pd(i,e){var t;return(t=i==null?void 0:i.key)!=null?t:e}function fd(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=s=>{i.refs[e]=s})}function Yt(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const s=pd(i[t],t.toString(36));e[s]=i[t]}return e}function md(i,e){i=i||{},e=e||{};const t=a=>e.hasOwnProperty(a)?e[a]:i[a],s={};let r=[];for(const a in i)e.hasOwnProperty(a)?r.length&&(s[a]=r,r=[]):r.push(a);const n={};for(const a in e){if(s.hasOwnProperty(a))for(let o=0;o<s[a].length;o++){const l=s[a][o];n[s[a][o]]=t(l)}n[a]=t(a)}for(let a=0;a<r.length;a++)n[r[a]]=t(r[a]);return n}const gd=i=>i;class ma extends re{constructor(e,t){super(e,t),this.refs={},this.state={children:Yt(Qe(Qe(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Yt(Qe(e.children)||[]),s=this.state.children;this.setState(n=>({children:md(n.children,t)}));let r;for(r in t)if(t.hasOwnProperty(r)){const n=s&&s.hasOwnProperty(r);t[r]&&n&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):t[r]&&!n&&!this.currentlyTransitioningKeys[r]&&this.keysToEnter.push(r)}for(r in s)if(s.hasOwnProperty(r)){const n=t&&t.hasOwnProperty(r);s[r]&&!n&&!this.currentlyTransitioningKeys[r]&&this.keysToLeave.push(r)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=Yt(Qe(this.props.children)||[]);(!s||!s.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=Yt(Qe(this.props.children)||[]);(!s||!s.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const s=this.refs[e];s!=null&&s.componentWillLeave?s.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const s=this.refs[e];s!=null&&s.componentDidLeave&&s.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const r=Yt(Qe(this.props.children)||[]);if(r&&r.hasOwnProperty(e))this.performEnter(e);else{const n=cd({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:s,transitionLeave:r,transitionName:n,transitionAppear:a,transitionEnter:o,transitionLeaveTimeout:l,transitionEnterTimeout:u,transitionAppearTimeout:c,component:h,...p}=e,{children:f}=t;const m=Object.entries(f).map(v=>{let[y,w]=v;if(!w)return;const b=fd(this,y);return sa(s(w),{ref:b,key:y})}).filter(Boolean);return d(h,p,m)}}ma.defaultProps={component:"span",childFactory:gd};const yd={version:"4.1.2"};class ga extends ne{constructor(e,t){super(e,t),this.render=s=>d("div",{className:"uppy uppy-Informer"},d(ma,null,s.info.map(r=>d(hd,{key:r.message},d("p",{role:"alert"},r.message," ",r.details&&d("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
22
-
23
- ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}ga.VERSION=yd.version;const vd=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function bd(i,e,t){var s,r;const n=vd.exec(i),a=(s=(r=e.mimeType)!=null?r:n==null?void 0:n[1])!=null?s:"plain/text";let o;if((n==null?void 0:n[2])!=null){const l=atob(decodeURIComponent(n[3])),u=new Uint8Array(l.length);for(let c=0;c<l.length;c++)u[c]=l.charCodeAt(c);o=[u]}else(n==null?void 0:n[3])!=null&&(o=[decodeURIComponent(n[3])]);return new Blob(o,{type:a})}function ya(i){return i.startsWith("blob:")}function va(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function k(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var ba=typeof self<"u"?self:global;const Kt=typeof navigator<"u",wd=Kt&&typeof HTMLImageElement>"u",wa=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Sa=ba.Buffer,_a=!!Sa,Sd=i=>i!==void 0;function Fa(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(Sd).length===0)}function G(i){let e=new Error(i);throw delete e.stack,e}function Ta(i){let e=function(t){let s=0;return t.ifd0.enabled&&(s+=1024),t.exif.enabled&&(s+=2048),t.makerNote&&(s+=2048),t.userComment&&(s+=1024),t.gps.enabled&&(s+=512),t.interop.enabled&&(s+=100),t.ifd1.enabled&&(s+=1024),s+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const Ys=i=>String.fromCharCode.apply(null,i),Pa=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;let Jt=class Mt{static from(e,t){return e instanceof this&&e.le===t?e:new Mt(e,void 0,void 0,t)}constructor(e,t=0,s,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){s===void 0&&(s=e.byteLength-t);let n=new DataView(e,t,s);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof Mt){s===void 0&&(s=e.byteLength-t),(t+=e.byteOffset)+s>e.byteOffset+e.byteLength&&G("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,s);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else G("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,s=Mt){return e instanceof DataView||e instanceof Mt?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||G("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new s(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new Mt(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return r=this.getUint8Array(e,t),Pa?Pa.decode(r):_a?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Ys(r)));var r}getLatin1String(e=0,t=this.byteLength){let s=this.getUint8Array(e,t);return Ys(s)}getUnicodeString(e=0,t=this.byteLength){const s=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)s.push(this.getUint16(e+r));return Ys(s)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}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,s){switch(t){case 1:return this.getUint8(e,s);case 2:return this.getUint16(e,s);case 4:return this.getUint32(e,s);case 8:return this.getUint64&&this.getUint64(e,s)}}getUint(e,t,s){switch(t){case 8:return this.getUint8(e,s);case 16:return this.getUint16(e,s);case 32:return this.getUint32(e,s);case 64:return this.getUint64&&this.getUint64(e,s)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Ks(i,e){G(`${i} '${e}' was not loaded, try using full build of exifr.`)}class Js extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Ks(this.kind,e),t&&(e in t||function(s,r){G(`Unknown ${s} '${r}'.`)}(this.kind,e),t[e].enabled||Ks(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Ca=new Js("file parser"),_e=new Js("segment parser"),Qs=new Js("file reader");let _d=ba.fetch;function Ea(i,e){return(t=i).startsWith("data:")||t.length>1e4?er(i,e,"base64"):wa&&i.includes("://")?Zs(i,e,"url",Oa):wa?er(i,e,"fs"):Kt?Zs(i,e,"url",Oa):void G("Invalid input argument");var t}async function Zs(i,e,t,s){return Qs.has(t)?er(i,e,t):s?async function(r,n){let a=await n(r);return new Jt(a)}(i,s):void G(`Parser ${t} is not loaded`)}async function er(i,e,t){let s=new(Qs.get(t))(i,e);return await s.read(),s}const Oa=i=>_d(i).then(e=>e.arrayBuffer()),tr=i=>new Promise((e,t)=>{let s=new FileReader;s.onloadend=()=>e(s.result||new ArrayBuffer),s.onerror=t,s.readAsArrayBuffer(i)}),ir=new Map,Fd=new Map,Td=new Map,Li=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],xa=["jfif","xmp","icc","iptc","ihdr"],sr=["tiff",...xa],X=["ifd0","ifd1","exif","gps","interop"],zi=[...sr,...X],$i=["makerNote","userComment"],Ra=["translateKeys","translateValues","reviveValues","multiSegment"],ji=[...Ra,"sanitize","mergeOutput","silentErrors"];class Da{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}let Qt=class extends Da{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,s,r){if(super(),k(this,"enabled",!1),k(this,"skip",new Set),k(this,"pick",new Set),k(this,"deps",new Set),k(this,"translateKeys",!1),k(this,"translateValues",!1),k(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=X.includes(e),this.canBeFiltered&&(this.dict=ir.get(e)),s!==void 0)if(Array.isArray(s))this.parse=this.enabled=!0,this.canBeFiltered&&s.length>0&&this.translateTagSet(s,this.pick);else if(typeof s=="object"){if(this.enabled=!0,this.parse=s.parse!==!1,this.canBeFiltered){let{pick:n,skip:a}=s;n&&n.length>0&&this.translateTagSet(n,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(s)}else s===!0||s===!1?this.parse=this.enabled=s:G(`Invalid options argument: ${s}`)}applyInheritables(e){let t,s;for(t of Ra)s=e[t],s!==void 0&&(this[t]=s)}translateTagSet(e,t){if(this.dict){let s,r,{tagKeys:n,tagValues:a}=this.dict;for(s of e)typeof s=="string"?(r=a.indexOf(s),r===-1&&(r=n.indexOf(Number(s))),r!==-1&&t.add(Number(n[r]))):t.add(s)}else for(let s of e)t.add(s)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Hi(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Hi(this.pick,this.deps)}};var ee={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},Aa=new Map;class rr extends Da{static useCached(e){let t=Aa.get(e);return t!==void 0||(t=new this(e),Aa.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):G(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Kt?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Li)this[e]=ee[e];for(e of ji)this[e]=ee[e];for(e of $i)this[e]=ee[e];for(e of zi)this[e]=new Qt(e,ee[e],void 0,this)}setupFromTrue(){let e;for(e of Li)this[e]=ee[e];for(e of ji)this[e]=ee[e];for(e of $i)this[e]=!0;for(e of zi)this[e]=new Qt(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Li)this[t]=ee[t];for(t of ji)this[t]=ee[t];for(t of $i)this[t]=ee[t];for(t of zi)this[t]=new Qt(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,X)}setupFromObject(e){let t;for(t of(X.ifd0=X.ifd0||X.image,X.ifd1=X.ifd1||X.thumbnail,Object.assign(this,e),Li))this[t]=nr(e[t],ee[t]);for(t of ji)this[t]=nr(e[t],ee[t]);for(t of $i)this[t]=nr(e[t],ee[t]);for(t of sr)this[t]=new Qt(t,ee[t],e[t],this);for(t of X)this[t]=new Qt(t,ee[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,X,zi),e.tiff===!0?this.batchEnableWithBool(X,!0):e.tiff===!1?this.batchEnableWithUserValue(X,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,X):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,X)}batchEnableWithBool(e,t){for(let s of e)this[s].enabled=t}batchEnableWithUserValue(e,t){for(let s of e){let r=t[s];this[s].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,s,r=s){if(e&&e.length){for(let a of r)this[a].enabled=!1;let n=ka(e,s);for(let[a,o]of n)Hi(this[a].pick,o),this[a].enabled=!0}else if(t&&t.length){let n=ka(t,s);for(let[a,o]of n)Hi(this[a].skip,o)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:s,iptc:r,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),s.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:s,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),s.needed&&e.deps.add(34853),this.tiff.enabled=X.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of X)this[n].finalizeFilters()}get onlyTiff(){return!xa.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of sr)this[e].enabled&&!_e.has(e)&&Ks("segment parser",e)}}function ka(i,e){let t,s,r,n,a=[];for(r of e){for(n of(t=ir.get(r),s=[],t))(i.includes(n[0])||i.includes(n[1]))&&s.push(n[0]);s.length&&a.push([r,s])}return a}function nr(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Hi(i,e){for(let t of e)i.add(t)}k(rr,"default",ee);class Pd{constructor(e){k(this,"parsers",{}),k(this,"output",{}),k(this,"errors",[]),k(this,"pushToErrors",t=>this.errors.push(t)),this.options=rr.useCached(e)}async read(e){this.file=await function(t,s){return typeof t=="string"?Ea(t,s):Kt&&!wd&&t instanceof HTMLImageElement?Ea(t.src,s):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Jt(t):Kt&&t instanceof Blob?Zs(t,s,"blob",tr):void G("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[s,r]of Ca)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[s]=!0;this.file.close&&this.file.close(),G("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),Fa(s=e)?void 0:s;var s}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async s=>{let r=await s.parse();s.assignToOutput(e,r)});this.options.silentErrors&&(t=t.map(s=>s.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,s=_e.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let n=await this.fileParser.ensureSegmentChunk(r),a=this.parsers.tiff=new s(n,e,t),o=await a.extractThumbnail();return t.close&&t.close(),o}}class Tt{static findPosition(e,t){let s=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,s):this.headerLength,n=t+r,a=s-r;return{offset:t,length:s,headerLength:r,start:n,size:a,end:n+a}}static parse(e,t={}){return new this(e,new rr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Jt?e:new Jt(e)}constructor(e,t={},s){k(this,"errors",[]),k(this,"raw",new Map),k(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=s,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let s=Td.get(t),r=Fd.get(t),n=ir.get(t),a=this.options[t],o=a.reviveValues&&!!s,l=a.translateValues&&!!r,u=a.translateKeys&&!!n,c={};for(let[h,p]of e)o&&s.has(h)?p=s.get(h)(p):l&&r.has(h)&&(p=this.translateValue(p,r.get(h))),u&&n.has(h)&&(h=n.get(h)||h),c[h]=p;return c}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,s){if(this.globalOptions.mergeOutput)return Object.assign(e,s);e[t]?Object.assign(e[t],s):e[t]=s}}k(Tt,"headerLength",4),k(Tt,"type",void 0),k(Tt,"multiSegment",!1),k(Tt,"canHandle",()=>!1);function Cd(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function Ed(i){return i>=224&&i<=239}function Od(i,e,t){for(let[s,r]of _e)if(r.canHandle(i,e,t))return s}class Ma extends class{constructor(e,t,s){k(this,"errors",[]),k(this,"ensureSegmentChunk",async r=>{let n=r.start,a=r.size||65536;if(this.file.chunked)if(this.file.available(n,a))r.chunk=this.file.subarray(n,a);else try{r.chunk=await this.file.readChunk(n,a)}catch(o){G(`Couldn't read segment: ${JSON.stringify(r)}. ${o.message}`)}else this.file.byteLength>n+a?r.chunk=this.file.subarray(n,a):r.size===void 0?r.chunk=this.file.subarray(n):G("Segment unreachable: "+JSON.stringify(r));return r.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=s}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let s=new(_e.get(e))(t,this.options,this.file);return this.parsers[e]=s}createParsers(e){for(let t of e){let{type:s,chunk:r}=t,n=this.options[s];if(n&&n.enabled){let a=this.parsers[s];a&&a.append||a||this.createParser(s,r)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),k(this,"appSegments",[]),k(this,"jpegSegments",[]),k(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(_e.keyList())):(e=e===void 0?_e.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&_e.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:s,findAll:r,wanted:n,remaining:a}=this;if(!r&&this.file.chunked&&(r=Array.from(n).some(o=>{let l=_e.get(o),u=this.options[o];return l.multiSegment&&u.multiSegment}),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,s.byteLength),!this.options.onlyTiff&&s.chunked){let o=!1;for(;a.size>0&&!o&&(s.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=s,u=this.appSegments.some(c=>!this.file.available(c.offset||c.start,c.length||c.size));if(o=e>l&&!u?!await s.readNextChunk(e):!await s.readNextChunk(l),(e=this.findAppSegmentsInRange(e,s.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let s,r,n,a,o,l,{file:u,findAll:c,wanted:h,remaining:p,options:f}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(s=u.getUint8(e+1),Ed(s)){if(r=u.getUint16(e+2),n=Od(u,e,r),n&&h.has(n)&&(a=_e.get(n),o=a.findPosition(u,e),l=f[n],o.type=n,this.appSegments.push(o),!c&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||p.delete(n)):p.delete(n),p.size===0)))break;f.recordUnknownSegments&&(o=Tt.findPosition(u,e),o.marker=s,this.unknownSegments.push(o)),e+=r+1}else if(Cd(s)){if(r=u.getUint16(e+2),s===218&&f.stopAfterSos!==!1)return;f.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:s}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,s){let r,n,a,o=new Map;for(let l=0;l<t.length;l++)r=t[l],n=r[s],o.has(n)?a=o.get(n):o.set(n,a=[]),a.push(r);return Array.from(o)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,s])=>{let r=_e.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(s)}:s[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}k(Ma,"type","jpeg"),Ca.set("jpeg",Ma);const xd=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Rd extends Tt{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,s=new Map){let{pick:r,skip:n}=this.options[t];r=new Set(r);let a=r.size>0,o=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let c=this.chunk.getUint16(e);if(a){if(r.has(c)&&(s.set(c,this.parseTag(e,c,t)),r.delete(c),r.size===0))break}else!o&&n.has(c)||s.set(c,this.parseTag(e,c,t));e+=12}return s}parseTag(e,t,s){let{chunk:r}=this,n=r.getUint16(e+2),a=r.getUint32(e+4),o=xd[n];if(o*a<=4?e+=8:e=r.getUint32(e+8),(n<1||n>13)&&G(`Invalid TIFF value type. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>r.byteLength&&G(`Invalid TIFF value offset. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${r.byteLength}`),n===1)return r.getUint8Array(e,a);if(n===2)return(l=function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u}(l=r.getString(e,a)).trim())===""?void 0:l;var l;if(n===7)return r.getUint8Array(e,a);if(a===1)return this.parseTagValue(n,e);{let u=new(function(h){switch(h){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))(a),c=o;for(let h=0;h<a;h++)u[h]=this.parseTagValue(n,e),e+=c;return u}}parseTagValue(e,t){let{chunk:s}=this;switch(e){case 1:return s.getUint8(t);case 3:return s.getUint16(t);case 4:return s.getUint32(t);case 5:return s.getUint32(t)/s.getUint32(t+4);case 6:return s.getInt8(t);case 8:return s.getInt16(t);case 9:return s.getInt32(t);case 10:return s.getInt32(t)/s.getInt32(t+4);case 11:return s.getFloat(t);case 12:return s.getDouble(t);case 13:return s.getUint32(t);default:G(`Invalid tiff type ${e}`)}}}class ar extends Rd{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let s=new Map;return this[t]=s,this.parseTags(e,t,s),s}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&G("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&G(`IFD0 offset points to outside of file.
24
- this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Ta(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,Ta(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let s=e.get(t);s&&s.length===1&&e.set(t,s[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Na(...e.get(2),e.get(1))),e.set("longitude",Na(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,s,r={};for(t of X)if(e=this[t],!Fa(e))if(s=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,s)}else r[t]=s;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[s,r]of Object.entries(t))this.assignObjectToOutput(e,s,r)}}function Na(i,e,t,s){var r=i+e/60+t/3600;return s!=="S"&&s!=="W"||(r*=-1),r}k(ar,"type","tiff"),k(ar,"headerLength",10),_e.set("tiff",ar);const or={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},or,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},or,{tiff:!1,ifd1:!0,mergeOutput:!1});const Dd=Object.assign({},or,{firstChunkSize:4e4,ifd0:[274]});async function Ad(i){let e=new Pd(Dd);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const kd=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let Zt=!0,ei=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,s]=e;Zt=Number(t)+.1*Number(s)<13.4,ei=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Zt=ei=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Zt=ei=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Zt=ei=Number(e)<77}}async function Md(i){let e=await Ad(i);return Object.assign({canvas:Zt,css:ei},kd[e])}class Nd extends Jt{constructor(...e){super(...e),k(this,"ranges",new Id),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,s){if(e===0&&this.byteLength===0&&s){let r=new DataView(s.buffer||s,s.byteOffset,s.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:n}=this._extend(r);this._swapDataView(n)}}}_extend(e){let t;t=_a?Sa.allocUnsafe(e):new Uint8Array(e);let s=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:s}}subarray(e,t,s=!1){return t=t||this._lengthToEnd(e),s&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,s=!1){s&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class Id{constructor(){k(this,"list",[])}get length(){return this.list.length}add(e,t,s=0){let r=e+t,n=this.list.filter(a=>Ia(e,a.offset,r)||Ia(e,a.end,r));if(n.length>0){e=Math.min(e,...n.map(o=>o.offset)),r=Math.max(r,...n.map(o=>o.end)),t=r-e;let a=n.shift();a.offset=e,a.length=t,a.end=r,this.list=this.list.filter(o=>!n.includes(o))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let s=e+t;return this.list.some(r=>r.offset<=e&&s<=r.end)}}function Ia(i,e,t){return i<=e&&e<=t}class Ud extends Nd{constructor(e,t){super(0),k(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,s=await this.readChunk(e,t);return!!s&&s.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Qs.set("blob",class extends Ud{async readWhole(){this.chunked=!1;let i=await tr(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,s=this.input.slice(i,t),r=await tr(s);return this.set(r,i,!0)}});const Bd={strings:{generatingThumbnails:"Generating thumbnails..."}},Ld={version:"4.0.2"};function zd(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(s){if(s.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(s=>{i.toBlob(s,e,t)}).then(s=>{if(s===null)throw new Error("cannot read image, probably an svg with external resources");return s}):Promise.resolve().then(()=>bd(i.toDataURL(e,t),{})).then(s=>{if(s===null)throw new Error("could not extract blob, probably an old browser");return s})}function $d(i,e){let t=i.width,s=i.height;(e.deg===90||e.deg===270)&&(t=i.height,s=i.width);const r=document.createElement("canvas");r.width=t,r.height=s;const n=r.getContext("2d");return n.translate(t/2,s/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),r}function jd(i){const e=i.width/i.height,t=5e6,s=4096;let r=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(r>s&&(r=s,n=Math.round(r/e)),n>s&&(n=s,r=Math.round(e*n)),i.width>r){const a=document.createElement("canvas");return a.width=r,a.height=n,a.getContext("2d").drawImage(i,0,0,r,n),a}return i}const Hd={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Ua extends ne{constructor(e,t){if(super(e,{...Hd,...t}),this.onFileAdded=s=>{!s.preview&&s.data&&va(s.type)&&!s.isRemote&&this.addToQueue(s.id)},this.onCancelRequest=s=>{const r=this.queue.indexOf(s.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=s=>{const r=this.queue.indexOf(s.id);r!==-1&&this.queue.splice(r,1),s.preview&&ya(s.preview)&&URL.revokeObjectURL(s.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||ya(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=s=>{s.forEach(n=>{const a=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const r=()=>{s.forEach(n=>{const a=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",a)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),n()}):(r(),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=Bd,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,s){const r=URL.createObjectURL(e.data),n=new Promise((o,l)=>{const u=new Image;u.src=r,u.addEventListener("load",()=>{URL.revokeObjectURL(r),o(u)}),u.addEventListener("error",c=>{URL.revokeObjectURL(r),l(c.error||new Error("Could not create thumbnail"))})}),a=Md(e.data).catch(()=>1);return Promise.all([n,a]).then(o=>{let[l,u]=o;const c=this.getProportionalDimensions(l,t,s,u.deg),h=$d(l,u),p=this.resizeImage(h,c.width,c.height);return zd(p,this.thumbnailType,80)}).then(o=>URL.createObjectURL(o))}getProportionalDimensions(e,t,s,r){let n=e.width/e.height;return(r===90||r===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:s!=null?{width:Math.round(s*n),height:s}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,s){let r=jd(e),n=Math.ceil(Math.log2(r.width/t));n<1&&(n=1);let a=t*2**(n-1),o=s*2**(n-1);const l=2;for(;n--;){const u=document.createElement("canvas");u.width=a,u.height=o,u.getContext("2d").drawImage(r,0,0,a,o),r=u,a=Math.round(a/l),o=Math.round(o/l)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return va(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)}}Ua.VERSION=Ld.version;function Ba(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&ra(i)?[i]:null}const Le=Array.from;function La(i,e,t,s){let{onSuccess:r}=s;i.readEntries(n=>{const a=[...e,...n];n.length?queueMicrotask(()=>{La(i,a,t,{onSuccess:r})}):r(a)},n=>{t(n),r(e)})}function za(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,s)=>i.file(t,s))},async*values(){const t=i.createReader();yield*await new Promise(r=>{La(t,[],e,{onSuccess:n=>r(n.map(a=>za(a,e)))})})},isSameEntry:void 0}}function $a(i,e,t){try{return t===void 0&&(t=void 0),async function*(){const s=()=>`${e}/${i.name}`;if(i.kind==="file"){const r=await i.getFile();r!=null?(r.relativePath=e?s():null,yield r):t!=null&&(yield t)}else if(i.kind==="directory")for await(const r of i.values())yield*$a(r,e?s():i.name);else t!=null&&(yield t)}()}catch(s){return Promise.reject(s)}}async function*qd(i,e){const t=await Promise.all(Array.from(i.items,async s=>{var r;let n;const a=()=>typeof s.getAsEntry=="function"?s.getAsEntry():s.webkitGetAsEntry();return(r=n)!=null||(n=za(a(),e)),{fileSystemHandle:n,lastResortFile:s.getAsFile()}}));for(const{lastResortFile:s,fileSystemHandle:r}of t)if(r!=null)try{yield*$a(r,"",s)}catch(n){s!=null?yield s:e(n)}else s!=null&&(yield s)}function Vd(i){const e=Le(i.files);return Promise.resolve(e)}async function ja(i,e){var t;const s=(t=e==null?void 0:e.logDropError)!=null?t:Function.prototype;try{const r=[];for await(const n of qd(i,s))r.push(n);return r}catch{return Vd(i)}}var ti,q,lr,Ha,ii=0,qa=[],V=L,Va=V.__b,Wa=V.__r,Ga=V.diffed,Xa=V.__c,Ya=V.unmount,Ka=V.__;function ur(i,e){V.__h&&V.__h(q,i,ii||e),ii=0;var t=q.__H||(q.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function qi(i){return ii=1,Wd(Za,i)}function Wd(i,e,t){var s=ur(ti++,2);if(s.t=i,!s.__c&&(s.__=[Za(void 0,e),function(o){var l=s.__N?s.__N[0]:s.__[0],u=s.t(l,o);l!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=q,!q.u)){var r=function(o,l,u){if(!s.__c.__H)return!0;var c=s.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!n||n.call(this,o,l,u);var h=s.__c.props!==o;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),n&&n.call(this,o,l,u)||h};q.u=!0;var n=q.shouldComponentUpdate,a=q.componentWillUpdate;q.componentWillUpdate=function(o,l,u){if(this.__e){var c=n;n=void 0,r(o,l,u),n=c}a&&a.call(this,o,l,u)},q.shouldComponentUpdate=r}return s.__N||s.__}function dr(i,e){var t=ur(ti++,3);!V.__s&&Qa(t.__H,e)&&(t.__=i,t.i=e,q.__H.__h.push(t))}function Vi(i){return ii=5,hr(function(){return{current:i}},[])}function hr(i,e){var t=ur(ti++,7);return Qa(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Gd(i,e){return ii=8,hr(function(){return i},e)}function Xd(){for(var i;i=qa.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Wi),i.__H.__h.forEach(cr),i.__H.__h=[]}catch(e){i.__H.__h=[],V.__e(e,i.__v)}}V.__b=function(i){q=null,Va&&Va(i)},V.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Ka&&Ka(i,e)},V.__r=function(i){Wa&&Wa(i),ti=0;var e=(q=i.__c).__H;e&&(lr===q?(e.__h=[],q.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Wi),e.__h.forEach(cr),e.__h=[],ti=0)),lr=q},V.diffed=function(i){Ga&&Ga(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(qa.push(e)!==1&&Ha===V.requestAnimationFrame||((Ha=V.requestAnimationFrame)||Yd)(Xd)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),lr=q=null},V.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Wi),t.__h=t.__h.filter(function(s){return!s.__||cr(s)})}catch(s){e.some(function(r){r.__h&&(r.__h=[])}),e=[],V.__e(s,t.__v)}}),Xa&&Xa(i,e)},V.unmount=function(i){Ya&&Ya(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(s){try{Wi(s)}catch(r){e=r}}),t.__H=void 0,e&&V.__e(e,t.__v))};var Ja=typeof requestAnimationFrame=="function";function Yd(i){var e,t=function(){clearTimeout(s),Ja&&cancelAnimationFrame(e),setTimeout(i)},s=setTimeout(t,100);Ja&&(e=requestAnimationFrame(t))}function Wi(i){var e=q,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),q=e}function cr(i){var e=q;i.__c=i.__(),q=e}function Qa(i,e){return!i||i.length!==e.length||e.some(function(t,s){return t!==i[s]})}function Za(i,e){return typeof e=="function"?e(i):e}function pr(){return pr=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},pr.apply(null,arguments)}const Kd={position:"relative",width:"100%",minHeight:"100%"},Jd={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class Qd extends re{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:s,renderRow:r,overscanCount:n=10,...a}=e;const{offset:o,height:l}=this.state;let u=Math.floor(o/s),c=Math.floor(l/s);n&&(u=Math.max(0,u-u%n),c+=n);const h=u+c+4,p=t.slice(u,h),f={...Kd,height:t.length*s},m={...Jd,top:u*s};return d("div",pr({onScroll:this.handleScroll},a),d("div",{role:"presentation",style:f},d("div",{role:"presentation",style:m},p.map(r))))}}function Zd(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},d("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 eo=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function eh(i,e){return!!(i===e||eo(i)&&eo(e))}function th(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!eh(i[t],e[t]))return!1;return!0}function to(i,e){e===void 0&&(e=th);var t=null;function s(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var a=i.apply(this,r);return t={lastResult:a,lastArgs:r,lastThis:this},a}return s.clear=function(){t=null},s}const io=['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 so(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function ro(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function ih(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function sh(i){return i.contains(document.activeElement)}function no(i,e,t){const s=so(t,e),r=Le(s.querySelectorAll(io)),n=r.indexOf(document.activeElement);sh(s)?i.shiftKey&&n===0?ih(i,r):!i.shiftKey&&n===r.length-1&&ro(i,r):ro(i,r)}function rh(i,e,t){e===null||no(i,e,t)}var nh=kn();const ah=Ke(nh);function oh(){let i=!1;return ah((t,s)=>{const r=so(t,s),n=r.contains(document.activeElement);if(n&&i)return;const a=r.querySelector("[data-uppy-super-focusable]");if(!(n&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{const o=r.querySelector(io);o==null||o.focus({preventScroll:!0}),i=!1}},260)}function ao(){const i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function oo(i,e){if(i===e)return!0;if(!i||!e)return!1;const t=Object.keys(i),s=Object.keys(e),r=t.length;if(s.length!==r)return!1;for(let n=0;n<r;n++){const a=t[n];if(i[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}function lh(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},d("g",{fill:"#686DE0",fillRule:"evenodd"},d("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"}),d("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"}),d("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function uh(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},d("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 dh(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},d("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 hh(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},d("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 ch(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},d("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 ph(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},d("g",{fill:"#A7AFB7",fillRule:"nonzero"},d("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"}),d("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function fh(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},d("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 fr(i){const e={color:"#838999",icon:ph()};if(!i)return e;const t=i.split("/")[0],s=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:fh()}:t==="image"?{color:"#686de0",icon:lh()}:t==="audio"?{color:"#068dbb",icon:uh()}:t==="video"?{color:"#19af67",icon:dh()}:t==="application"&&s==="pdf"?{color:"#e25149",icon:hh()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)!==-1?{color:"#00C469",icon:ch()}:e}function lo(i){const{file:e}=i;if(e.preview)return d("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:s}=fr(e.type);return d("div",{className:"uppy-Dashboard-Item-previewIconWrap"},d("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},s),d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},d("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}const mh=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function uo(i){const{file:e,toggleFileCard:t,i18n:s,metaFields:r}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;const a=n.map(o=>mh(o,r)).join(", ");return d("div",{className:"uppy-Dashboard-Item-errorMessage"},s("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",d("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},s("editFile")))}function gh(i){const{file:e,i18n:t,toggleFileCard:s,metaFields:r,showLinkToFileUploadResult:n}=i,o=e.preview?"rgba(255, 255, 255, 0.5)":fr(e.type).color;return d("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:o}},n&&e.uploadURL&&d("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},d("span",{hidden:!0},e.meta.name)),d(lo,{file:e}),d(uo,{file:e,i18n:t,toggleFileCard:s,metaFields:r}))}function yh(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 ho(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 mr(i){return d("div",{className:"uppy-Dashboard-Item-progress"},d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":ho(i),title:ho(i),onClick:()=>yh(i)},i.children))}function Gi(i){let{children:e}=i;return d("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 gr(i){let{progress:e}=i;const t=2*Math.PI*15;return d("g",null,d("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),d("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 vh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?d("div",{className:"uppy-Dashboard-Item-progress"},d("div",{className:"uppy-Dashboard-Item-progressIndicator"},d(Gi,null,d("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),d("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?d(mr,i,d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},d("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),d("path",{d:"M7.9 3H10v2H7.9z"}),d("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),d("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?d(mr,i,d(Gi,null,d(gr,{progress:i.file.progress.percentage}),i.file.isPaused?d("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):d("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},d("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),d("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?d(mr,i,d(Gi,null,d(gr,{progress:i.file.progress.percentage}),d("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"}))):d("div",{className:"uppy-Dashboard-Item-progress"},d("div",{className:"uppy-Dashboard-Item-progressIndicator"},d(Gi,null,d(gr,{progress:i.file.progress.percentage}))))}const yr="...";function co(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=yr.length+1)return`${i.slice(0,e-1)}…`;const t=e-yr.length,s=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,s)+yr+i.slice(-r)}const bh=i=>{const{author:e,name:t}=i.file.meta;function s(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return d("div",{className:"uppy-Dashboard-Item-name",title:t},co(t,s()))},wh=i=>{var e;const{author:t}=i.file.meta,s=(e=i.file.remote)==null?void 0:e.providerName,r="·";return t?d("div",{className:"uppy-Dashboard-Item-author"},d("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},co(t.name,13)),s?d(Fragment,null,` ${r} `,s,` ${r} `):null):null},Sh=i=>i.file.size&&d("div",{className:"uppy-Dashboard-Item-statusSize"},nt(i.file.size)),_h=i=>i.file.isGhost&&d("span",null," • ",d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),Fh=i=>{let{file:e,onClick:t}=i;return e.error?d("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 Th(i){const{file:e,i18n:t,toggleFileCard:s,metaFields:r,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:o,containerWidth:l}=i;return d("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},d("div",{className:"uppy-Dashboard-Item-fileName"},bh({file:e,isSingleFile:a,containerHeight:o,containerWidth:l}),d(Fh,{file:e,onClick:()=>alert(e.error)})),d("div",{className:"uppy-Dashboard-Item-status"},wh({file:e}),Sh({file:e}),_h({file:e,toggleAddFilesPanel:n,i18n:t})),d(uo,{file:e,i18n:t,toggleFileCard:s,metaFields:r}))}function Ph(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{const s=document.createElement("textarea");s.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),s.value=i,document.body.appendChild(s),s.select();const r=()=>{document.body.removeChild(s),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(s),t()):r()}catch{return document.body.removeChild(s),r()}})}function Ch(i){let{file:e,uploadInProgressOrComplete:t,metaFields:s,canEditFile:r,i18n:n,onClick:a}=i;return!t&&s&&s.length>0||!t&&r(e)?d("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:()=>a()},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},d("g",{fillRule:"evenodd"},d("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"}),d("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),d("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Eh(i){let{i18n:e,onClick:t,file:s}=i;return d("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:s.meta.name}),title:e("removeFile",{file:s.meta.name}),onClick:()=>t()},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},d("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"}),d("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 Oh(i){let{file:e,uppy:t,i18n:s}=i;const r=n=>{Ph(e.uploadURL,s("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(s("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return d("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":s("copyLink"),title:s("copyLink"),onClick:n=>r(n)},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},d("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){const{uppy:e,file:t,uploadInProgressOrComplete:s,canEditFile:r,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:c}=i;return d("div",{className:"uppy-Dashboard-Item-actionWrapper"},d(Ch,{i18n:l,file:t,uploadInProgressOrComplete:s,canEditFile:r,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,t.id):c(t)}}),a&&t.uploadURL?d(Oh,{file:t,uppy:e,i18n:l}):null,o?d(Eh,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}class Rh extends re{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!oo(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,s=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:o}=e;let l=(this.props.individualCancellation||!n)&&!s;s&&this.props.showRemoveButtonAfterComplete&&(l=!0);const u=we({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":s,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":o});return d("div",{className:u,id:`uppy_${e.id}`,role:this.props.role},d("div",{className:"uppy-Dashboard-Item-preview"},d(gh,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),d(vh,{uppy:this.props.uppy,file:e,error:a,isUploaded:s,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})),d("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},d(Th,{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}),d(xh,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function Dh(i,e){const t=[];let s=[];return i.forEach(r=>{s.length<e?s.push(r):(t.push(s),s=[r])}),s.length&&t.push(s),t}function Ah(i){let{id:e,i18n:t,uppy:s,files:r,resumableUploads:n,hideRetryButton:a,hidePauseResumeButton:o,hideCancelButton:l,showLinkToFileUploadResult:u,showRemoveButtonAfterComplete:c,metaFields:h,isSingleFile:p,toggleFileCard:f,handleRequestThumbnail:m,handleCancelThumbnail:v,recoveredState:y,individualCancellation:w,itemsPerRow:b,openFileEditor:E,canEditFile:C,toggleAddFilesPanel:P,containerWidth:g,containerHeight:S}=i;const F=b===1?71:200,x=hr(()=>{const M=(D,N)=>Number(r[N].isGhost)-Number(r[D].isGhost),I=Object.keys(r);return y&&I.sort(M),Dh(I,b)},[r,b,y]),U=M=>d("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:M[0]},M.map(I=>d(Rh,{key:I,uppy:s,id:e,i18n:t,resumableUploads:n,individualCancellation:w,hideRetryButton:a,hidePauseResumeButton:o,hideCancelButton:l,showLinkToFileUploadResult:u,showRemoveButtonAfterComplete:c,metaFields:h,recoveredState:y,isSingleFile:p,containerWidth:g,containerHeight:S,toggleFileCard:f,handleRequestThumbnail:m,handleCancelThumbnail:v,role:"listitem",openFileEditor:E,canEditFile:C,toggleAddFilesPanel:P,file:r[I]})));return p?d("div",{class:"uppy-Dashboard-files"},U(x[0])):d(Qd,{class:"uppy-Dashboard-files",role:"list",data:x,renderRow:U,rowHeight:F})}class po extends re{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 s;return d("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:(s=this.props.allowedFileTypes)==null?void 0:s.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,s)=>{const n={photo:"image/*",video:"video/*"}[e];return d("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:s})},this.renderMyDeviceAcquirer=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},d("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},d("div",{className:"uppy-DashboardTab-inner"},d("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},d("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"}))),d("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},d("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},d("div",{className:"uppy-DashboardTab-inner"},d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},d("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"}))),d("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},d("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},d("div",{className:"uppy-DashboardTab-inner"},d("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},d("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 "}))),d("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{const s=this.props.acquirers.length;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":s===0},e)},this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),s=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,n=r.charAt(0).toUpperCase()+r.slice(1);return d("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:s,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:s,browse:t}))},this.renderAcquirer=e=>{var t;return d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},d("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)},d("div",{className:"uppy-DashboardTab-inner"},e.icon()),d("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],s=t.splice(e.length-2,e.length);return d(Je,null,t.map(r=>this.renderAcquirer(r)),d("span",{role:"presentation",style:{"white-space":"nowrap"}},s.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:s,showNativeVideoCameraButton:r}=this.props;let n=[];const a="myDevice";t||n.push({key:a,elements:this.renderMyDeviceAcquirer()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(c=>({key:c.id,elements:this.renderAcquirer(c)}))),n.length===1&&n[0].key===a&&(n=[]);const l=[...n],u=l.splice(n.length-2,n.length);return d(Je,null,this.renderDropPasteBrowseTagline(n.length),d("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(c=>{let{key:h,elements:p}=c;return d(Je,{key:h},p)}),d("span",{role:"presentation",style:{"white-space":"nowrap"}},u.map(c=>{let{key:h,elements:p}=c;return d(Je,{key:h},p)}))))}}[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(){const{i18nArray:e}=this.props,t=d("span",null,d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},d("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),d("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),s=e("poweredBy",{uppy:t});return d("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},s)}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:s}=this.props;return d("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",s,r=>{this.mobilePhotoFileInput=r}),t&&this.renderHiddenCameraInput("video",s,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),d("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&d("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}}const kh=i=>d("div",{className:we("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},d("div",{className:"uppy-DashboardContent-bar"},d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),d(po,i));function Ze(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function Mh(i){let{activePickerPanel:e,className:t,hideAllPanels:s,i18n:r,state:n,uppy:a}=i;const o=Vi(null);return d("div",{className:we("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ze,onDragLeave:Ze,onDrop:Ze,onPaste:Ze},d("div",{className:"uppy-DashboardContent-bar"},d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:s},r("cancel"))),d("div",{ref:o,className:"uppy-DashboardContent-panelBody"},a.getPlugin(e.id).render(n,o.current)))}function Nh(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return d("div",{className:we("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},d("div",{className:"uppy-DashboardContent-bar"},d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),d("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),d("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(s=>i.uppy.getPlugin(s.id).render(i.state))))}const Ee={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Ih(i,e,t,s){if(s===void 0&&(s={}),i)return Ee.STATE_ERROR;if(e)return Ee.STATE_COMPLETE;if(t)return Ee.STATE_PAUSED;let r=Ee.STATE_WAITING;const n=Object.keys(s);for(let a=0;a<n.length;a++){const{progress:o}=s[n[a]];if(o.uploadStarted&&!o.uploadComplete)return Ee.STATE_UPLOADING;o.preprocess&&r!==Ee.STATE_UPLOADING&&(r=Ee.STATE_PREPROCESSING),o.postprocess&&r!==Ee.STATE_UPLOADING&&r!==Ee.STATE_PREPROCESSING&&(r=Ee.STATE_POSTPROCESSING)}return r}function Uh(i){let{files:e,i18n:t,isAllComplete:s,isAllErrored:r,isAllPaused:n,inProgressNotPausedFiles:a,newFiles:o,processingFiles:l}=i;switch(Ih(r,s,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:o.length});case"complete":return t("uploadComplete");case"error":return t("error")}}function Bh(i){const{i18n:e,isAllComplete:t,hideCancelButton:s,maxNumberOfFiles:r,toggleAddFilesPanel:n,uppy:a}=i;let{allowNewUpload:o}=i;return o&&r&&(o=i.totalFileCount<i.maxNumberOfFiles),d("div",{className:"uppy-DashboardContent-bar"},!t&&!s?d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},e("cancel")):d("div",null),d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d(Uh,i)),o?d("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},d("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"})),d("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):d("div",null))}function Lh(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:s,form:r,formState:n}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(o=>{const l=`uppy-Dashboard-FileCard-input-${o.id}`,u=t.includes(o.id);return d("fieldset",{key:o.id,className:"uppy-Dashboard-FileCard-fieldset"},d("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},o.name),o.render!==void 0?o.render({value:n[o.id],onChange:c=>s(c,o.id),fieldCSSClasses:a,required:u,form:r.id},d):d("input",{className:a.text,id:l,form:r.id,type:o.type||"text",required:u,value:n[o.id],placeholder:o.placeholder,onInput:c=>s(c.target.value,o.id),"data-uppy-super-focusable":!0}))})}function zh(i){var e;const{files:t,fileCardFor:s,toggleFileCard:r,saveFileCard:n,metaFields:a,requiredMetaFields:o,openFileEditor:l,i18n:u,i18nArray:c,className:h,canEditFile:p}=i,f=()=>typeof a=="function"?a(t[s]):a,m=t[s],v=(e=f())!=null?e:[],y=p(m),w={};v.forEach(F=>{var x;w[F.id]=(x=m.meta[F.id])!=null?x:""});const[b,E]=qi(w),C=Gd(F=>{F.preventDefault(),n(b,s)},[n,b,s]),P=(F,x)=>{E({...b,[x]:F})},g=()=>{r(!1)},[S]=qi(()=>{const F=document.createElement("form");return F.setAttribute("tabindex","-1"),F.id=Ri(),F});return dr(()=>(document.body.appendChild(S),S.addEventListener("submit",C),()=>{S.removeEventListener("submit",C),document.body.removeChild(S)}),[S,C]),d("div",{className:we("uppy-Dashboard-FileCard",h),"data-uppy-panelType":"FileCard",onDragOver:Ze,onDragLeave:Ze,onDrop:Ze,onPaste:Ze},d("div",{className:"uppy-DashboardContent-bar"},d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},c("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile"},m.meta?m.meta.name:m.name)})),d("button",{className:"uppy-DashboardContent-back",type:"button",form:S.id,title:u("finishEditingFile"),onClick:g},u("cancel"))),d("div",{className:"uppy-Dashboard-FileCard-inner"},d("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:fr(m.type).color}},d(lo,{file:m}),y&&d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:F=>{C(F),l(m)}},u("editImage"))),d("div",{className:"uppy-Dashboard-FileCard-info"},d(Lh,{computedMetaFields:v,requiredMetaFields:o,updateMeta:P,form:S,formState:b})),d("div",{className:"uppy-Dashboard-FileCard-actions"},d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:S.id},u("saveChanges")),d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:g,form:S.id},u("cancel")))))}const Pt="uppy-transition-slideDownUp",fo=250;function Xi(i){let{children:e}=i;const[t,s]=qi(null),[r,n]=qi(""),a=Vi(),o=Vi(),l=Vi(),u=()=>{n(`${Pt}-enter`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Pt}-enter ${Pt}-enter-active`),a.current=setTimeout(()=>{n("")},fo)})},c=()=>{n(`${Pt}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Pt}-leave ${Pt}-leave-active`),o.current=setTimeout(()=>{s(null),n("")},fo)})};return dr(()=>{const h=Qe(e)[0];t!==h&&(h&&!t?u():t&&!h&&!o.current&&c(),s(h))},[e,t]),dr(()=>()=>{clearTimeout(a.current),clearTimeout(o.current),cancelAnimationFrame(l.current)},[]),t?sa(t,{className:we(r,t.props.className)}):null}function Ct(){return Ct=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Ct.apply(null,arguments)}const mo=900,go=700,vr=576,yo=330;function $h(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,s=i.containerWidth>vr,r=i.containerHeight>yo,n=we({"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>vr,"uppy-size--lg":i.containerWidth>go,"uppy-size--xl":i.containerWidth>mo,"uppy-size--height-md":i.containerHeight>yo,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r});let a=1;i.containerWidth>mo?a=5:i.containerWidth>go?a=4:i.containerWidth>vr&&(a=3);const o=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(p=>i.files[p].isGhost).length:0,c=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return d("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&ao(),"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},d("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),d("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:d("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},d("span",{"aria-hidden":"true"},"×")),d("div",{className:"uppy-Dashboard-innerWrap"},d("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),o&&d(Bh,i),l&&d("div",{className:"uppy-Dashboard-serviceMsg"},d("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},d("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},d("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"}),d("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),d("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),d("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),d("div",{className:"uppy-Dashboard-serviceMsg-text"},c())),o?d(Ah,{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:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):d(po,{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}),d(Xi,null,i.showAddFilesPanel?d(kh,Ct({key:"AddFiles"},i,{isSizeMD:s})):null),d(Xi,null,i.fileCardFor?d(zh,Ct({key:"FileCard"},i)):null),d(Xi,null,i.activePickerPanel?d(Mh,Ct({key:"Picker"},i)):null),d(Xi,null,i.showFileEditor?d(Nh,Ct({key:"Editor"},i)):null),d("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(p=>i.uppy.getPlugin(p.id).render(i.state))))))}const jh={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 A(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Hh=0;function Q(i){return"__private_"+Hh+++"_"+i}const qh={version:"4.1.3"},br=to.default||to,vo=9,Vh=27;function bo(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const Wh={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Zd,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};var dt=Q("disabledNodes"),ze=Q("generateLargeThumbnailIfSingleFile"),si=Q("openFileEditorWhenFilesAdded"),ht=Q("attachRenderFunctionToTarget"),wr=Q("isTargetSupported"),Sr=Q("getAcquirers"),_r=Q("getProgressIndicators"),$e=Q("getEditors"),Fr=Q("addSpecifiedPluginsFromOptions"),Tr=Q("autoDiscoverPlugins"),ct=Q("addSupportedPluginIfNoTarget"),ri=Q("getStatusBarOpts"),ni=Q("getThumbnailGeneratorOpts"),Pr=Q("getInformerOpts"),ai=Q("getStatusBarId"),oi=Q("getThumbnailGeneratorId"),Cr=Q("getInformerId");let Er=class extends ne{constructor(e,t){var s,r,n;const a=(s=t==null?void 0:t.autoOpen)!=null?s:null;super(e,{...Wh,...t,autoOpen:a}),Object.defineProperty(this,Cr,{value:Qh}),Object.defineProperty(this,oi,{value:Jh}),Object.defineProperty(this,ai,{value:Kh}),Object.defineProperty(this,Pr,{value:Yh}),Object.defineProperty(this,ni,{value:Xh}),Object.defineProperty(this,ri,{value:Gh}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Ri()}`,this.superFocus=oh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=o=>{const u=this.getPluginState().targets.filter(c=>c.id!==o.id);this.setPluginState({targets:u})},this.addTarget=o=>{const l=o.id||o.constructor.name,u=o.title||l,c=o.type;if(c!=="acquirer"&&c!=="progressindicator"&&c!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const h={id:l,name:u,type:c},f=this.getPluginState().targets.slice();return f.push(h),this.setPluginState({targets:f}),this.el},this.hideAllPanels=()=>{var o;const l=this.getPluginState(),u={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===u.activePickerPanel&&l.showAddFilesPanel===u.showAddFilesPanel&&l.showFileEditor===u.showFileEditor&&l.activeOverlayType===u.activeOverlayType||(this.setPluginState(u),this.uppy.emit("dashboard:close-panel",(o=l.activePickerPanel)==null?void 0:o.id))},this.showPanel=o=>{const{targets:l}=this.getPluginState(),u=l.find(c=>c.type==="acquirer"&&c.id===o);this.setPluginState({activePickerPanel:u,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",o)},this.canEditFile=o=>{const{targets:l}=this.getPluginState();return A(this,$e)[$e](l).some(c=>this.uppy.getPlugin(c.id).canEditFile(o))},this.openFileEditor=o=>{const{targets:l}=this.getPluginState(),u=A(this,$e)[$e](l);this.setPluginState({showFileEditor:!0,fileCardFor:o.id||null,activeOverlayType:"FileEditor"}),u.forEach(c=>{this.uppy.getPlugin(c.id).selectFile(o)})},this.closeFileEditor=()=>{const{metaFields:o}=this.getPluginState();o&&o.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:o}=this.getPluginState();A(this,$e)[$e](o).forEach(u=>{this.uppy.getPlugin(u.id).save()}),this.closeFileEditor()},this.openModal=()=>{const{promise:o,resolve:l}=bo();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const u=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",u,!1),l()};this.el.addEventListener("animationend",u,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),o},this.closeModal=o=>{var l;const u=(l=o==null?void 0:o.manualClose)!=null?l:!0,{isHidden:c,isClosing:h}=this.getPluginState();if(c||h)return;const{promise:p,resolve:f}=bo();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const v=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",v,!1),f()};this.el.addEventListener("animationend",v,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),f();if(document.removeEventListener("keydown",this.handleKeyDownInModal),u&&this.opts.browserBackButtonClose){var m;(m=history.state)!=null&&m[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),p},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=o=>{const{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:o}})},this.handleSystemDarkModeChange=o=>{const l=o.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(o,l)=>{const u=this.uppy.getFile(l);o?this.uppy.emit("dashboard:file-edit-start",u):this.uppy.emit("dashboard:file-edit-complete",u),this.setPluginState({fileCardFor:o?l:null,activeOverlayType:o?"FileCard":null})},this.toggleAddFilesPanel=o=>{this.setPluginState({showAddFilesPanel:o,activeOverlayType:o?"AddFiles":null})},this.addFiles=o=>{const l=o.map(u=>({source:this.id,name:u.name,type:u.type,data:u,meta:{relativePath:u.relativePath||u.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(u){this.uppy.log(u)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(o=>{const l=o[0],{width:u,height:c}=l.contentRect;this.setPluginState({containerWidth:u,containerHeight:c,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const o=this.getPluginState(),l=!this.opts.inline&&o.isHidden;!o.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=o=>{this.el.contains(o.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=o=>{var l;const u=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],c=(l=A(this,dt)[dt])!=null?l:Le(this.el.querySelectorAll(u)).filter(h=>!h.classList.contains("uppy-Dashboard-close"));for(const h of c)h.tagName==="A"?h.setAttribute("aria-disabled",o):h.disabled=o;o?A(this,dt)[dt]=c:A(this,dt)[dt]=null,this.dashboardIsDisabled=o},this.updateBrowserHistory=()=>{var o;(o=history.state)!=null&&o[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=o=>{var l;this.isModalOpen()&&(!o.state||!o.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=o.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=o=>{o.keyCode===Vh&&this.requestCloseModal(),o.keyCode===vo&&no(o,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=o=>{this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootPaste==null||u.handleRootPaste(o))});const l=Le(o.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=o=>{o.preventDefault();const l=Le(o.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=o=>{o.preventDefault(),o.stopPropagation();const l=()=>{let p=!0;return this.uppy.iteratePlugins(f=>{f.canHandleRootDrop!=null&&f.canHandleRootDrop(o)&&(p=!0)}),p},u=()=>{const{types:p}=o.dataTransfer;return p.some(f=>f==="Files")},c=l(),h=u();if(!c&&!h||this.opts.disabled||this.opts.disableLocalFiles&&(h||!c)||!this.uppy.getState().allowNewUpload){o.dataTransfer.dropEffect="none";return}o.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(o)},this.handleDragLeave=o=>{o.preventDefault(),o.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(o)},this.handleDrop=async o=>{o.preventDefault(),o.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(h=>{h.type==="acquirer"&&(h.handleRootDrop==null||h.handleRootDrop(o))});let l=!1;const u=h=>{this.uppy.log(h,"error"),l||(this.uppy.info(h.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");const c=await ja(o.dataTransfer,{logDropError:u});c.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(c)),this.opts.onDrop(o)},this.handleRequestThumbnail=o=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",o)},this.handleCancelThumbnail=o=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",o)},this.handleKeyDownInInline=o=>{o.keyCode===vo&&rh(o,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=o=>{this.el.contains(document.activeElement)&&this.handlePaste(o)},this.handleComplete=o=>{let{failed:l}=o;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,ze,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const o=600,l=this.uppy.getFiles();if(l.length===1){const u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u==null||u.setOptions({thumbnailWidth:o});const c={...l[0],preview:void 0};u==null||u.requestThumbnail(c).then(()=>{u==null||u.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,si,{writable:!0,value:o=>{const l=o[0],{metaFields:u}=this.getPluginState(),c=u&&u.length>0,h=this.canEditFile(l);c&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):h&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const o=Ba(this.opts.trigger);o?o.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",A(this,ct)[ct]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",A(this,ze)[ze]),this.uppy.on("file-removed",A(this,ze)[ze]),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",A(this,si)[si])},this.removeEvents=()=>{const o=Ba(this.opts.trigger);!this.opts.inline&&o&&o.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",A(this,ct)[ct]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",A(this,ze)[ze]),this.uppy.off("file-removed",A(this,ze)[ze]),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",A(this,si)[si])},this.superFocusOnEachUpdate=()=>{const o=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,u=this.uppy.getState().info.length===0,c=!this.opts.inline;u&&(c||o||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=(o,l)=>{this.uppy.setFileMeta(l,o),this.toggleFileCard(!1,l)},Object.defineProperty(this,ht,{writable:!0,value:o=>{const l=this.uppy.getPlugin(o.id);return{...o,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,wr,{writable:!0,value:o=>{const l=this.uppy.getPlugin(o.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Sr,{writable:!0,value:br(o=>o.filter(l=>l.type==="acquirer"&&A(this,wr)[wr](l)).map(A(this,ht)[ht]))}),Object.defineProperty(this,_r,{writable:!0,value:br(o=>o.filter(l=>l.type==="progressindicator").map(A(this,ht)[ht]))}),Object.defineProperty(this,$e,{writable:!0,value:br(o=>o.filter(l=>l.type==="editor").map(A(this,ht)[ht]))}),this.render=o=>{const l=this.getPluginState(),{files:u,capabilities:c,allowNewUpload:h}=o,{newFiles:p,uploadStartedFiles:f,completeFiles:m,erroredFiles:v,inProgressFiles:y,inProgressNotPausedFiles:w,processingFiles:b,isUploadStarted:E,isAllComplete:C,isAllPaused:P}=this.uppy.getObjectOfFilesPerState(),g=A(this,Sr)[Sr](l.targets),S=A(this,_r)[_r](l.targets),F=A(this,$e)[$e](l.targets);let x;return this.opts.theme==="auto"?x=c.darkMode?"dark":"light":x=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}".`)),$h({state:o,isHidden:l.isHidden,files:u,newFiles:p,uploadStartedFiles:f,completeFiles:m,erroredFiles:v,inProgressFiles:y,inProgressNotPausedFiles:w,processingFiles:b,isUploadStarted:E,isAllComplete:C,isAllPaused:P,totalFileCount:Object.keys(u).length,totalProgress:o.totalProgress,allowNewUpload:h,acquirers:g,theme:x,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:S,editors:F,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:o.recoveredState,metaFields:l.metaFields,resumableUploads:c.resumableUploads||!1,individualCancellation:c.individualCancellation,isMobileDevice:c.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,Fr,{writable:!0,value:()=>{const{plugins:o}=this.opts;o.forEach(l=>{const u=this.uppy.getPlugin(l);u?u.mount(this,u):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Tr,{writable:!0,value:()=>{this.uppy.iteratePlugins(A(this,ct)[ct])}}),Object.defineProperty(this,ct,{writable:!0,value:o=>{var l;const u=["acquirer","editor"];o&&!((l=o.opts)!=null&&l.target)&&u.includes(o.type)&&(this.getPluginState().targets.some(h=>o.id===h.id)||o.mount(this,o))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:o,closeAfterFinish:l}=this.opts;if(o&&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.");const{allowMultipleUploads:u,allowMultipleUploadBatches:c}=this.uppy.opts;(u||c)&&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");const{target:h}=this.opts;h&&this.mount(h,this),this.opts.disableStatusBar||this.uppy.use(Xs,{id:A(this,ai)[ai](),target:this,...A(this,ri)[ri]()}),this.opts.disableInformer||this.uppy.use(ga,{id:A(this,Cr)[Cr](),target:this,...A(this,Pr)[Pr]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Ua,{id:A(this,oi)[oi](),...A(this,ni)[ni]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const p=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${p?"on":"off"}`),this.setDarkModeCapability(p),this.opts.theme==="auto"){var f;(f=this.darkModeMediaQuery)==null||f.addListener(this.handleSystemDarkModeChange)}A(this,Fr)[Fr](),A(this,Tr)[Tr](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const u=this.uppy.getPlugin(`${this.id}:Informer`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableStatusBar){const u=this.uppy.getPlugin(`${this.id}:StatusBar`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableThumbnailGenerator){const u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u&&this.uppy.removePlugin(u)}const{plugins:o}=this.opts;if(o.forEach(u=>{const c=this.uppy.getPlugin(u);c&&c.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=jh,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,s;super.setOptions(e),(t=this.uppy.getPlugin(A(this,ai)[ai]()))==null||t.setOptions(A(this,ri)[ri]()),(s=this.uppy.getPlugin(A(this,oi)[oi]()))==null||s.setOptions(A(this,ni)[ni]())}};function Gh(){const{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:s,showProgressDetails:r,hideProgressAfterFinish:n,locale:a,doneButtonHandler:o}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:s,showProgressDetails:r,hideAfterFinish:n,locale:a,doneButtonHandler:o}}function Xh(){const{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:s}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:s,lazy:!s}}function Yh(){return{}}function Kh(){return`${this.id}:StatusBar`}function Jh(){return`${this.id}:ThumbnailGenerator`}function Qh(){return`${this.id}:Informer`}Er.VERSION=qh.version;function Et(i,e,t,s){T.onMounted(()=>{i()}),T.onBeforeUnmount(()=>{t.removePlugin(e.value)}),T.watch(()=>s.value,(r,n)=>{oo(r,n)||e.value.setOptions({...r})})}const Zh=T.defineComponent({name:"Dashboard",props:{uppy:{type:Object,required:!0},props:{type:Object}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"Dashboard",inline:!0,...i.props,target:e.value};n.use(Er,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),()=>T.h("div",{ref:e})}}),ec=T.defineComponent({name:"DashboardModal",props:{uppy:{type:Ie,required:!0},props:{type:Object},open:{type:Boolean,required:!0}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"DashboardModal",inline:!1,...i.props,target:e.value};n.use(Er,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),T.watch(()=>i.open,(n,a)=>{n&&!a&&t.value.openModal(),!n&&a&&t.value.closeModal()}),()=>T.h("div",{ref:e})}}),tc={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},ic={version:"4.0.5"},sc={inputName:"files[]",width:"100%",height:"100%"};class Yi extends ne{constructor(e,t){super(e,{...sc,...t}),this.isDragDropSupported=ao(),this.addFiles=s=>{const r=s.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(r)}catch(n){this.uppy.log(n)}},this.onInputChange=s=>{const r=Le(s.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),s.currentTarget.value=""},this.handleDragOver=s=>{var r,n;s.preventDefault(),s.stopPropagation();const{types:a}=s.dataTransfer,o=a.some(u=>u==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!o||!l){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(n=this.opts).onDragOver)==null||r.call(n,s)},this.handleDragLeave=s=>{var r,n;s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(n=this.opts).onDragLeave)==null||r.call(n,s)},this.handleDrop=async s=>{var r,n;s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1});const a=l=>{this.uppy.log(l,"error")},o=await ja(s.dataTransfer,{logDropError:a});o.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(o)),(r=(n=this.opts).onDrop)==null||r.call(n,s)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=tc,this.i18nInit()}renderHiddenFileInput(){var e;const{restrictions:t}=this.uppy.opts;return d("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:s=>{this.fileInputRef=s},name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},d("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return d("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:d("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return d("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset
25
- uppy-DragDrop-container
26
- ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
27
- ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
28
- `,t={width:this.opts.width,height:this.opts.height};return d("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),d("div",{className:"uppy-DragDrop-inner"},Yi.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}Yi.VERSION=ic.version,T.defineComponent({name:"DragDrop",props:{uppy:{type:Ie,required:!0},props:{type:Object}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"DragDrop",...i.props,target:e.value};n.use(Yi,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),()=>T.h("div",{ref:e})}});const rc={version:"4.1.0"},nc={fixed:!1,hideAfterFinish:!0};class wo extends ne{constructor(e,t){super(e,{...nc,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){const{totalProgress:t}=e,s=(t===0||t===100)&&this.opts.hideAfterFinish;return d("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":s},d("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),d("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}wo.VERSION=rc.version,T.defineComponent({name:"ProgressBar",props:{uppy:{type:Ie,required:!0},props:{type:Object}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"ProgressBar",...i.props,target:e.value};n.use(wo,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),()=>T.h("div",{ref:e})}}),T.defineComponent({name:"StatusBar",props:{uppy:{type:Ie,required:!0},props:{type:Object}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"StatusBar",...i.props,target:e.value};n.use(Xs,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),()=>T.h("div",{ref:e})}});const ac={strings:{chooseFiles:"Choose files"}},oc={version:"4.0.4"},lc={pretty:!0,inputName:"files[]"};class So extends ne{constructor(e,t){super(e,{...lc,...t}),this.input=null,this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=ac,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map(s=>({source:this.id,name:s.name,type:s.type,data:s}));try{this.uppy.addFiles(t)}catch(s){this.uppy.log(s)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=Le(e.currentTarget.files||[]);this.addFiles(t),e.currentTarget.value=""}handleClick(){this.input.click()}render(){var e;const t={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},{restrictions:s}=this.uppy.opts;return d("div",{className:"uppy-FileInput-container"},d("input",{className:"uppy-FileInput-input",style:this.opts.pretty?t:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:s.maxNumberOfFiles!==1,accept:(e=s.allowedFileTypes)==null?void 0:e.join(", "),ref:r=>{this.input=r}}),this.opts.pretty&&d("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}So.VERSION=oc.version,T.defineComponent({name:"FileInput",props:{uppy:{type:Ie,required:!0},props:{type:Object}},setup(i){const e=T.ref(),t=T.ref(),s=T.ref(i.props);return Et(()=>{const{uppy:n}=i,a={id:"FileInput",...i.props,target:e.value};n.use(So,a),t.value=n.getPlugin(a.id)},t,i.uppy,s),()=>T.h("div",{ref:e})}});const uc={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function li(i){return[i]=i.split(";",1),uc[i]||null}var ui={exports:{}},_o;function dc(){if(_o)return ui.exports;_o=1,ui.exports=s,ui.exports.isMobile=s,ui.exports.default=s;const i=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,e=/CrOS/,t=/android|ipad|playbook|silk/i;function s(r){r||(r={});let n=r.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;let a=i.test(n)&&!e.test(n)||!!r.tablet&&t.test(n);return!a&&r.tablet&&r.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(a=!0),a}return ui.exports}var hc=dc();const cc=Ke(hc);function pc(i,e,t){return new Promise(s=>{i.toBlob(s,e,t)})}function fc(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function Fo(){return d("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},d("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}function mc(i){let{onSnapshot:e,i18n:t}=i;return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0},Fo())}function gc(i){let{recording:e,onStartRecording:t,onStopRecording:s,i18n:r}=i;return e?d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("stopRecording"),"aria-label":r("stopRecording"),onClick:s,"data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},d("rect",{x:"15",y:"15",width:"70",height:"70"}))):d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("startRecording"),"aria-label":r("startRecording"),onClick:t,"data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},d("circle",{cx:"50",cy:"50",r:"40"})))}function yc(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}function vc(i){let{recordingLengthSeconds:e,i18n:t}=i;const s=yc(e);return d("span",{"aria-label":t("recordingLength",{recording_length:s})},s)}function bc(i){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:s}=i;return d("div",{className:"uppy-Webcam-videoSource"},d("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:r=>{s(r.target.value)}},t.map(r=>d("option",{key:r.deviceId,value:r.deviceId,selected:r.deviceId===e},r.label))))}function wc(i){let{onSubmit:e,i18n:t}=i;return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},d("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},d("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}function Sc(i){let{onDiscard:e,i18n:t}=i;return d("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},d("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},d("g",{fill:"#FFF",fillRule:"evenodd"},d("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),d("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}function Or(){return Or=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Or.apply(null,arguments)}function Ki(i,e){return i.includes(e)}class _c extends re{componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,recording:s,modes:r,supportsRecording:n,videoSources:a,showVideoSourceDropdown:o,showRecordingLength:l,onSubmit:u,i18n:c,mirror:h,onSnapshot:p,onStartRecording:f,onStopRecording:m,onDiscardRecordedVideo:v,recordingLengthSeconds:y}=this.props,w=!!t,b=!w&&n&&(Ki(r,"video-only")||Ki(r,"audio-only")||Ki(r,"video-audio")),E=!w&&Ki(r,"picture"),C=n&&l&&!w,P=o&&a&&a.length>1,g={playsInline:!0};return t?(g.muted=!1,g.controls=!0,g.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(g.muted=!0,g.autoPlay=!0,g.srcObject=e),d("div",{className:"uppy uppy-Webcam-container"},d("div",{className:"uppy-Webcam-videoContainer"},d("video",Or({ref:S=>this.videoElement=S,className:`uppy-Webcam-video ${h?"uppy-Webcam-video--mirrored":""}`},g))),d("div",{className:"uppy-Webcam-footer"},d("div",{className:"uppy-Webcam-videoSourceContainer"},P?bc(this.props):null),d("div",{className:"uppy-Webcam-buttonContainer"},E&&d(mc,{onSnapshot:p,i18n:c}),b&&d(gc,{recording:s,onStartRecording:f,onStopRecording:m,i18n:c}),w&&d(wc,{onSubmit:u,i18n:c}),w&&d(Sc,{onDiscard:v,i18n:c})),d("div",{className:"uppy-Webcam-recordingLength"},C&&d(vc,{recordingLengthSeconds:y,i18n:c}))))}}function Fc(i){let{icon:e,i18n:t,hasCamera:s}=i;return d("div",{className:"uppy-Webcam-permissons"},d("div",{className:"uppy-Webcam-permissonsIcon"},e()),d("div",{className:"uppy-Webcam-title"},t(s?"allowAccessTitle":"noCameraTitle")),d("p",null,t(s?"allowAccessDescription":"noCameraDescription")))}const Tc={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function xr(){return xr=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},xr.apply(null,arguments)}function di(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Pc=0;function Cc(i){return"__private_"+Pc+++"_"+i}const Ec={version:"4.0.3"};function To(i){return i[0]==="."?Ps[i.slice(1)]:i}function Oc(i){return/^video\/[^*]+$/.test(i)}function xc(i){return/^image\/[^*]+$/.test(i)}function Rc(){return navigator.mediaDevices}function Rr(i,e){return i.includes(e)}const Dc={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:cc({tablet:!0})};var Fe=Cc("enableMirror");class Po extends ne{constructor(e,t){super(e,{...Dc,...t}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),this.stream=null,this.recorder=null,this.recordingChunks=null,this.captureInProgress=!1,this.mediaDevices=Rc(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},d("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",fillRule:"nonzero"})),this.defaultLocale=Tc,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),di(this,Fe)[Fe]=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedVideo=this.discardRecordedVideo.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null})}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e==null?void 0:e.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(e=>e.some(t=>t.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(e){e===void 0&&(e=null);const t=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,s=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),r={...this.opts.videoConstraints||{},...e!=null&&{deviceId:e}};return{audio:t,video:s?r:!1}}start(e){var t;if(e===void 0&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(di(this,Fe)[Fe]=!0);const s=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(r=>(this.setPluginState({hasCamera:r}),this.mediaDevices.getUserMedia(s).then(n=>{this.stream=n;let a=null;const o=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!e||!e.deviceId?a=o[0].getSettings().deviceId:o.forEach(l=>{l.getSettings().deviceId===e.deviceId&&(a=l.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:a,cameraReady:!0})}).catch(n=>{this.setPluginState({cameraReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let s=[];this.opts.preferredVideoMimeType?s=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(s=t.allowedFileTypes.map(To).filter(Oc));const r=a=>MediaRecorder.isTypeSupported(a)&&li(a),n=s.filter(r);n.length>0&&(e.mimeType=n[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);const{restrictions:s}=this.uppy.opts;if(this.recordingChunks.length>1&&s.maxFileSize!=null&&!e){const r=this.recordingChunks.reduce((l,u)=>l+u.size,0),a=(r-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,o=Math.max(0,s.maxFileSize-a);r>o&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const t=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(t=>{try{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),di(this,Fe)[Fe]=!1}catch(s){s.isRestriction||this.uppy.log(s)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(di(this,Fe)[Fe]=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach(s=>s.stop())}this.recorder&&await new Promise(e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((e,t)=>{let s=this.opts.countdown;const r=setInterval(()=>{if(!this.webcamActive)return clearInterval(r),this.captureInProgress=!1,t(new Error("Webcam is not active"));s?(this.uppy.info(`${s}...`,"warning",800),s--):(clearInterval(r),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}takeSnapshot(){this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(e=>{const t=typeof e=="object"?e.message:e;return this.uppy.info(t,"error",5e3),Promise.reject(new Error(`onBeforeSnapshot: ${t}`))}).then(()=>this.getImage()).then(e=>{this.captureInProgress=!1;try{this.uppy.addFile(e)}catch(t){t.isRestriction||this.uppy.log(t)}},e=>{throw this.captureInProgress=!1,e}))}getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,s=e.videoHeight,r=document.createElement("canvas");r.width=t,r.height=s,r.getContext("2d").drawImage(e,0,0);const{restrictions:a}=this.uppy.opts;let o=[];this.opts.preferredImageMimeType?o=[this.opts.preferredImageMimeType]:a.allowedFileTypes&&(o=a.allowedFileTypes.map(To).filter(xc));const l=o[0]||"image/jpeg",u=li(l)||"jpg",c=`cam-${Date.now()}.${u}`;return pc(r,l).then(h=>({source:this.id,name:c,data:new Blob([h],{type:l}),type:l}))}getVideo(){const e=this.recordingChunks.find(a=>{var o;return((o=a.type)==null?void 0:o.length)>0}).type,t=li(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const s=`webcam-${Date.now()}.${t}`,r=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:s,data:new Blob([r],{type:e}),type:e};return Promise.resolve(n)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(t=>t.kind==="videoinput")})})}render(){this.webcamActive||this.start();const e=this.getPluginState();return!e.cameraReady||!e.hasCamera?d(Fc,{icon:Fo,i18n:this.i18n,hasCamera:e.hasCamera}):d(_c,xr({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:fc(),recording:e.isRecording,mirror:di(this,Fe)[Fe],src:this.stream}))}install(){const{mobileNativeCamera:e,modes:t,videoConstraints:s}=this.opts,{target:r}=this.opts;if(e&&r){var n;(n=this.getTargetPlugin(r))==null||n.setOptions({showNativeVideoCameraButton:Rr(t,"video-only")||Rr(t,"video-audio"),showNativePhotoCameraButton:Rr(t,"picture"),nativeCameraFacingMode:s==null?void 0:s.facingMode});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),r&&this.mount(r,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let a=!0;const{videoSources:o,currentDeviceId:l}=this.getPluginState();o.forEach(u=>{l===u.deviceId&&(a=!1)}),a&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}Po.VERSION=Ec.version;const Dr={strings:{},pluralize(){return 0}};Dr.strings={addBulkFilesFailed:"内部错误导致添加 %{smart_count} 个文件失败",addMore:"添加更多文件",addMoreFiles:"添加更多文件",addingMoreFiles:"添加更多文件",allowAccessDescription:"为了通过您的相机进行拍照或录像,请给网站相机的访问权限",allowAccessTitle:"请允许对相机的访问权限",authenticateWith:"连接到 %{pluginName}",authenticateWithTitle:"请使用 %{pluginName} 进行认证以选择文件",back:"返回",browse:"浏览",browseFiles:"浏览",cancel:"取消",cancelUpload:"取消上传",chooseFiles:"选择文件",closeModal:"关闭窗口",companionError:"和 Companion 连接失败了",companionUnauthorizeHint:"请访问 %{url} 以认证您的 %{provider} 账户",complete:"上传完毕",connectedToInternet:"连接至网络",copyLink:"复制链接",copyLinkToClipboardFallback:"复制以下网址",copyLinkToClipboardSuccess:"链接已复制到剪贴板",creatingAssembly:"正在准备上传…",creatingAssemblyFailed:"Transloadit:无法创建程序集",dashboardTitle:"文件上传工具",dashboardWindowTitle:"文件上传工具窗口(点击离开以关闭)",dataUploadedOfTotal:"%{total} / %{complete}",done:"完成",dropHereOr:"拖拽文件到这里,或%{browse}",dropHint:"拖拽文件到这里",dropPasteBoth:"拖拽文件到这里,或者%{browse}文件",dropPasteFiles:"拖拽文件到这里,或者%{browse}文件",dropPasteFolders:"拖拽文件到这里,或者%{browse}文件",dropPasteImportBoth:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFiles:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFolders:"拖拽文件到这里,粘贴、%{browse}或者导入",editFile:"编辑文件",editImage:"编辑图片",editing:"正在编辑 %{file}",emptyFolderAdded:"无法从空文件夹添加文件",encoding:"正在编码…",enterCorrectUrl:"错误链接: 请确认您输入的是文件的链接",enterUrlToImport:"输入链接或者导入文件",exceedsSize:"文件超过了最大尺寸限制 %{size}",failedToFetch:"Companion 无法抓取此链接,请确保它是正确的",failedToUpload:"上传 %{file} 失败",fileSource:"文件源:%{name}",filesUploadedOfTotal:"已上传 %{smart_count} 个文件中的 %{complete} 个",filter:"筛选器",finishEditingFile:"完成文件编辑",folderAdded:"从 %{folder} 添加了 %{smart_count} 个文件",generatingThumbnails:"正在生成缩略图…",import:"导入",importFrom:"从 %{name} 导入",inferiorSize:"文件大小必须超过 %{size}",loading:"正在载入…",logOut:"登出",micDisabled:"麦克风的权限访问被用户拒绝",myDevice:"我的设备",noCameraDescription:"为了拍摄照片或录制视频,请连接一个摄像设备",noCameraTitle:"摄像头不可用",noDuplicates:"无法添加重复文件 %{fileName},该文件已存在",noFilesFound:"这里空空如也",noInternetConnection:"无法连接到网络",noMoreFilesAllowed:"无法添加新文件:已正在上传文件",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"强力驱动于 %{uppy}",processingXFiles:"正在处理 %{smart_count} 个文件",recording:"正在录制",recordingLength:"录制长度 %{recording_length}",recordingStoppedMaxSize:"录像已停止,文件大小即将超过限制",removeFile:"删除文件",resetFilter:"重置筛选器",resume:"恢复",resumeUpload:"恢复上传",retry:"重试",retryUpload:"重试",saveChanges:"保存变更",selectFileNamed:"选择文件 %{name}",selectX:"选择 %{smart_count}",smile:"笑一笑!",startCapturing:"开始屏幕录制",startRecording:"开始视频录制",stopCapturing:"停止屏幕录制",stopRecording:"停止视频录制",streamActive:"视频流已激活",streamPassive:"视频流未激活",submitRecordedFile:"提交已录制视频",takePicture:"拍照",timedOut:"上传已超时 %{seconds} 秒,中止上传",unselectFileNamed:"取消选择文件 %{name}",upload:"上传",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传暂停",uploadXFiles:"上传 %{smart_count} 个文件",uploadXNewFiles:"新上传了 %{smart_count} 个文件",uploading:"正在上传",uploadingXFiles:"正在上传 %{smart_count} 个文件",xFilesSelected:"%{smart_count} 个文件待上传",xMoreFilesAdded:"又有 %{smart_count} 个文件被添加",xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传这些文件类型:%{types}",youCanOnlyUploadX:"您只能上传 %{smart_count} 个文件",youHaveToAtLeastSelectX:"您至少要选择 %{smart_count} 个文件"};class Ac extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}var Ar={},kr,Co;function kc(){if(Co)return kr;Co=1;function i(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return kr=i,i.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},i.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},i.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},s),this._options.unref&&this._timer.unref(),!0},i.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},i.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},i.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},i.prototype.start=i.prototype.try,i.prototype.errors=function(){return this._errors},i.prototype.attempts=function(){return this._attempts},i.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,s=0,r=0;r<this._errors.length;r++){var n=this._errors[r],a=n.message,o=(e[a]||0)+1;e[a]=o,o>=s&&(t=n,s=o)}return t},kr}var Eo;function Mc(){return Eo||(Eo=1,function(i){var e=kc();i.operation=function(t){var s=i.timeouts(t);return new e(s,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},i.timeouts=function(t){if(t instanceof Array)return[].concat(t);var s={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)s[r]=t[r];if(s.minTimeout>s.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],a=0;a<s.retries;a++)n.push(this.createTimeout(a,s));return t&&t.forever&&!n.length&&n.push(this.createTimeout(a,s)),n.sort(function(o,l){return o-l}),n},i.createTimeout=function(t,s){var r=s.randomize?Math.random()+1:1,n=Math.round(r*Math.max(s.minTimeout,1)*Math.pow(s.factor,t));return n=Math.min(n,s.maxTimeout),n},i.wrap=function(t,s,r){if(s instanceof Array&&(r=s,s=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var a=0;a<r.length;a++){var o=r[a],l=t[o];t[o]=(function(c){var h=i.operation(s),p=Array.prototype.slice.call(arguments,1),f=p.pop();p.push(function(m){h.retry(m)||(m&&(arguments[0]=h.mainError()),f.apply(this,arguments))}),h.attempt(function(){c.apply(t,p)})}).bind(t,l),t[o].options=s}}}(Ar)),Ar}var Mr,Oo;function Nc(){return Oo||(Oo=1,Mr=Mc()),Mr}var Ic=Nc();const Uc=Ke(Ic),Bc=Object.prototype.toString,Lc=i=>Bc.call(i)==="[object Error]",zc=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function $c(i){return i&&Lc(i)&&i.name==="TypeError"&&typeof i.message=="string"?i.message==="Load failed"?i.stack===void 0:zc.has(i.message):!1}class Nr extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const xo=(i,e,t)=>{const s=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=s,i};async function Ro(i,e){return new Promise((t,s)=>{e={...e},e.onFailedAttempt??(e.onFailedAttempt=()=>{}),e.shouldRetry??(e.shouldRetry=()=>!0),e.retries??(e.retries=10);const r=Uc.operation(e),n=()=>{var o;r.stop(),s((o=e.signal)==null?void 0:o.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});const a=()=>{var o;(o=e.signal)==null||o.removeEventListener("abort",n),r.stop()};r.attempt(async o=>{try{const l=await i(o);a(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Nr)throw l.originalError;if(l instanceof TypeError&&!$c(l))throw l;if(xo(l,o,e),await e.shouldRetry(l)||(r.stop(),s(l)),await e.onFailedAttempt(l),!r.retry(l))throw r.mainError()}catch(u){xo(u,o,e),a(),s(u)}}})})}class hi extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}function jc(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new hi(i)})}function Hc(i,e){return Object.prototype.hasOwnProperty.call(i,e)}class qc extends Error{constructor(e,t){super(e),this.cause=t==null?void 0:t.cause,this.cause&&Hc(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function Vc(i){var e;const s=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${s}`}class Wc extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}function je(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Gc=0;function Ji(i){return"__private_"+Gc+++"_"+i}const Xc={version:"4.3.0"};function Yc(i){return i.replace(/\/$/,"")}const Do=10,Kc=5*60*1e3,Jc=401;class Qc extends Error{constructor(e){let{statusCode:t,message:s}=e;super(s),this.name="HttpError",this.statusCode=t}}async function Zc(i){if(i.status===Jc)throw new Wc;if(i.ok)return i.json();let e=`Failed request with status: ${i.status}. ${i.statusText}`,t;try{t=await i.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(s){throw new Error(e,{cause:s})}throw i.status>=400&&i.status<=499&&t.message?new Ac(t.message):new Qc({statusCode:i.status,message:e})}function ep(i,e,t){const{progress:s,bytesUploaded:r,bytesTotal:n}=e;if(s){var a;i.uppy.log(`Upload progress: ${s}`),i.uppy.emit("upload-progress",t,{uploadStarted:(a=t.progress.uploadStarted)!=null?a:0,bytesUploaded:r,bytesTotal:n})}}var He=Ji("companionHeaders"),ci=Ji("getUrl"),Ir=Ji("requestSocketToken"),pi=Ji("awaitRemoteFileUpload");class Ao{constructor(e,t){Object.defineProperty(this,pi,{value:ip}),Object.defineProperty(this,ci,{value:tp}),Object.defineProperty(this,He,{writable:!0,value:void 0}),Object.defineProperty(this,Ir,{writable:!0,value:async s=>{var r;let{file:n,postBody:a,signal:o}=s;if(((r=n.remote)==null?void 0:r.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(n.remote.url,{...n.remote.body,...a},{signal:o})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),je(this,He)[He]=t.companionHeaders}setCompanionHeaders(e){je(this,He)[He]=e}[Symbol.for("uppy test: getCompanionHeaders")](){return je(this,He)[He]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return Yc(e&&e[t]?e[t]:t)}async headers(e){return e===void 0&&(e=!1),{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...je(this,He)[He]}}onReceiveResponse(e){const{headers:t}=e,r=this.uppy.getState().companion||{},n=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==r[n]&&this.uppy.setState({companion:{...r,[n]:t.get("i-am")}})}async request(e){let{path:t,method:s="GET",data:r,skipPostResponse:n,signal:a}=e;try{const o=await this.headers(!r),l=await jc(je(this,ci)[ci](t),{method:s,signal:a,headers:o,credentials:this.opts.companionCookiesRule||"same-origin",body:r?JSON.stringify(r):null});return n||this.onReceiveResponse(l),await Zc(l)}catch(o){throw o.isAuthError||o.name==="UserFacingApiError"||o.name==="AbortError"?o:new qc(`Could not ${s} ${je(this,ci)[ci](t)}`,{cause:o})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,s){return this.request({...s,path:e,method:"POST",data:t})}async delete(e,t,s){return this.request({...s,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,s){var r=this;try{const{signal:n,getQueue:a}=s||{};return await Ro(async()=>{var o;const l=(o=this.uppy.getFile(e.id))==null?void 0:o.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),je(this,pi)[pi]({file:e,queue:a(),signal:n});const c=await a().wrapPromiseFunction(async function(){try{return await je(r,Ir)[Ir](...arguments)}catch(h){if(h.isAuthError)throw new Nr(h);if(h.cause==null)throw h;const p=h.cause,f=()=>[408,409,429,418,423].includes(p.statusCode)||p.statusCode>=500&&p.statusCode<=599&&![501,505].includes(p.statusCode);throw p.name==="HttpError"&&!f()?new Nr(p):p}},{priority:-1})({file:e,postBody:t,signal:n}).abortOn(n);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:c}),je(this,pi)[pi]({file:this.uppy.getFile(e.id),queue:a(),signal:n})},{retries:Do,signal:n,onFailedAttempt:o=>this.uppy.log(`Retrying upload due to: ${o.message}`,"warning")})}catch(n){if(n.name==="AbortError")return;throw this.uppy.emit("upload-error",e,n),n}}}function tp(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}async function ip(i){let{file:e,queue:t,signal:s}=i,r;const{capabilities:n}=this.uppy.getState();try{return await new Promise((a,o)=>{const l=e.serverToken,u=Vc(e.remote.companionUrl);let c,h,p,{isPaused:f}=e;const m=(S,F)=>{if(c==null||c.readyState!==c.OPEN){var x;this.uppy.log(`Cannot send "${S}" to socket ${e.id} because the socket state was ${String((x=c)==null?void 0:x.readyState)}`,"warning");return}c.send(JSON.stringify({action:S,payload:F??{}}))};function v(){n.resumableUploads&&m(f?"pause":"resume")}const y=async()=>{h&&h.abort(),h=new AbortController;const S=x=>{var U;this.uppy.setFileState(e.id,{serverToken:null}),(U=h)==null||U.abort==null||U.abort(),o(x)};function F(){clearTimeout(p),!f&&(p=setTimeout(()=>S(new Error("Timeout waiting for message from Companion socket")),Kc))}try{await t.wrapPromiseFunction(async()=>{await Ro(async()=>new Promise((U,M)=>{c=new WebSocket(`${u}/api/${l}`),F(),c.addEventListener("close",()=>{c=void 0,M(new Error("Socket closed unexpectedly"))}),c.addEventListener("error",D=>{var N;this.uppy.log(`Companion socket error ${JSON.stringify(D)}, closing socket`,"warning"),(N=c)==null||N.close()}),c.addEventListener("open",()=>{v()}),c.addEventListener("message",D=>{F();try{const{action:Pe,payload:pe}=JSON.parse(D.data);switch(Pe){case"progress":{ep(this,pe,this.uppy.getFile(e.id));break}case"success":{var N,z,Z,ye;const Re=(N=pe.response)==null?void 0:N.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:pe.url,status:(z=(Z=pe.response)==null?void 0:Z.status)!=null?z:200,body:Re?JSON.parse(Re):void 0}),(ye=h)==null||ye.abort==null||ye.abort(),a();break}case"error":{const{message:Re}=pe.error;throw Object.assign(new Error(Re),{cause:pe.error})}default:this.uppy.log(`Companion socket unknown action ${Pe}`,"warning")}}catch(Pe){S(Pe)}});const I=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(p),c&&c.close(),c=void 0};h.signal.addEventListener("abort",()=>{I()})}),{retries:Do,signal:h.signal,onFailedAttempt:()=>{h.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(h.signal)}catch(x){if(h.signal.aborted)return;S(x)}},w=S=>{n.resumableUploads&&(f=S,c&&v())},b=S=>{var F;n.individualCancellation&&S.id===e.id&&(m("cancel"),(F=h)==null||F.abort==null||F.abort(),this.uppy.log(`upload ${e.id} was removed`),a())},E=()=>{var S;m("cancel"),(S=h)==null||S.abort==null||S.abort(),this.uppy.log(`upload ${e.id} was canceled`),a()},C=(S,F)=>{(S==null?void 0:S.id)===e.id&&w(F)},P=()=>w(!0),g=()=>w(!1);this.uppy.on("file-removed",b),this.uppy.on("cancel-all",E),this.uppy.on("upload-pause",C),this.uppy.on("pause-all",P),this.uppy.on("resume-all",g),r=()=>{this.uppy.off("file-removed",b),this.uppy.off("cancel-all",E),this.uppy.off("upload-pause",C),this.uppy.off("pause-all",P),this.uppy.off("resume-all",g)},s.addEventListener("abort",()=>{var S;(S=h)==null||S.abort()}),y()})}finally{r==null||r()}}Ao.VERSION=Xc.version;function ko(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var sp=0;function rp(i){return"__private_"+sp+++"_"+i}var fi=rp("handleSubmit");class np extends re{constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,fi,{writable:!0,value:t=>{t.preventDefault();const{addFile:s}=this.props,r=this.input.value.trim();s(r)}}),this.form.id=Ri()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",ko(this,fi)[fi]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",ko(this,fi)[fi]),document.body.removeChild(this.form)}render(){const{i18n:e}=this.props;return d("div",{className:"uppy-Url"},d("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":e("enterUrlToImport"),placeholder:e("enterUrlToImport"),ref:t=>{this.input=t},"data-uppy-super-focusable":!0,form:this.form.id}),d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id},e("import")))}}function Mo(i,e,t){const s=Le(i.items);let r;switch(e){case"paste":{if(s.some(a=>a.kind==="file"))return;r=s.filter(a=>a.kind==="string"&&a.type==="text/plain");break}case"drop":{r=s.filter(n=>n.kind==="string"&&n.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}r.forEach(n=>{n.getAsString(a=>t(a))})}const ap={strings:{pluginNameUrl:"Link",import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}};var No;const op={version:"4.1.2"};function lp(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},d("path",{d:"M23.637 15.312l-2.474 2.464a3.582 3.582 0 01-.577.491c-.907.657-1.897.986-2.968.986a4.925 4.925 0 01-3.959-1.971c-.248-.329-.164-.902.165-1.149.33-.247.907-.164 1.155.164 1.072 1.478 3.133 1.724 4.618.656a.642.642 0 00.33-.328l2.473-2.463c1.238-1.313 1.238-3.366-.082-4.597a3.348 3.348 0 00-4.618 0l-1.402 1.395a.799.799 0 01-1.154 0 .79.79 0 010-1.15l1.402-1.394a4.843 4.843 0 016.843 0c2.062 1.805 2.144 5.007.248 6.896zm-8.081 5.664l-1.402 1.395a3.348 3.348 0 01-4.618 0c-1.319-1.23-1.319-3.365-.082-4.596l2.475-2.464.328-.328c.743-.492 1.567-.739 2.475-.657.906.165 1.648.574 2.143 1.314.248.329.825.411 1.155.165.33-.248.412-.822.165-1.15-.825-1.068-1.98-1.724-3.216-1.888-1.238-.247-2.556.082-3.628.902l-.495.493-2.474 2.464c-1.897 1.969-1.814 5.09.083 6.977.99.904 2.226 1.396 3.463 1.396s2.473-.492 3.463-1.395l1.402-1.396a.79.79 0 000-1.15c-.33-.328-.908-.41-1.237-.082z",fill:"#FF753E","fill-rule":"nonzero"}))}function up(i){const e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}function dp(i){return Le(i.dataTransfer.items).filter(s=>s.kind==="string"&&s.type==="text/uri-list").length>0}function hp(i){return(i==null?void 0:i.startsWith("http://"))||(i==null?void 0:i.startsWith("https://"))}function cp(i){const{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}class et extends ne{constructor(e,t){if(super(e,t),this.getMeta=s=>this.client.post("url/meta",{url:s}),this.addFile=async(s,r)=>{const n=up(s);if(!hp(n)){this.uppy.log(`[URL] Incorrect URL entered: ${n}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}try{const a=await this.getMeta(n),o={meta:r,source:this.id,name:a.name||cp(n),type:a.type,data:{size:a.size},isRemote:!0,body:{url:n},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:n,url:n},requestClientId:et.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(o)}catch(l){return l.isRestriction||this.uppy.log(l),l}}catch(a){return this.uppy.log(a),this.uppy.info({message:this.i18n("failedToFetch"),details:a},"error",4e3),a}},this.handleRootDrop=s=>{Mo(s.dataTransfer,"drop",r=>{this.uppy.log(`[URL] Adding file from dropped url: ${r}`),this.addFile(r)})},this.handleRootPaste=s=>{Mo(s.clipboardData,"paste",r=>{this.uppy.log(`[URL] Adding file from pasted url: ${r}`),this.addFile(r)})},this.id=this.opts.id||"Url",this.type="acquirer",this.icon=()=>d(lp,null),this.defaultLocale=ap,this.i18nInit(),this.title=this.i18n("pluginNameUrl"),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new Ao(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(et.requestClientId,this.client)}render(){return d(np,{i18n:this.i18n,addFile:this.addFile})}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}No=et,et.VERSION=op.version,et.requestClientId=No.name,et.prototype.canHandleRootDrop=dp;function pp(){return d("svg",{className:"uppy-DashboardTab-iconScreenRec","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},d("g",{fill:"currentcolor",fillRule:"evenodd"},d("path",{d:"M24.182 9H7.818C6.81 9 6 9.742 6 10.667v10c0 .916.81 1.666 1.818 1.666h4.546V24h7.272v-1.667h4.546c1 0 1.809-.75 1.809-1.666l.009-10C26 9.742 25.182 9 24.182 9zM24 21H8V11h16v10z"}),d("circle",{cx:"16",cy:"16",r:"2"})))}function fp(i){let{recording:e,onStartRecording:t,onStopRecording:s,i18n:r}=i;return e?d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:r("stopCapturing"),"aria-label":r("stopCapturing"),onClick:s,"data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},d("rect",{x:"15",y:"15",width:"70",height:"70"}))):d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:r("startCapturing"),"aria-label":r("startCapturing"),onClick:t,"data-uppy-super-focusable":!0},d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},d("circle",{cx:"50",cy:"50",r:"40"})))}function mp(i){let{recording:e,recordedVideo:t,onSubmit:s,i18n:r}=i;return t&&!e?d("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:r("submitRecordedFile"),"aria-label":r("submitRecordedFile"),onClick:s,"data-uppy-super-focusable":!0},d("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},d("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"}))):null}function gp(i){return(i-(i%=60))/60+(i>9?":":":0")+i}class yp extends re{constructor(e){super(e),this.wrapperStyle={width:"100%",height:"100%",display:"flex"},this.overlayStyle={position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7},this.infoContainerStyle={marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"},this.infotextStyle={marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"},this.timeStyle={display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"},this.timerRunning=!1,this.state={elapsedTime:0}}startTimer(){this.timerTick(),this.timerRunning=!0}resetTimer(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1}timerTick(){this.timer=setTimeout(()=>{this.setState(e=>({elapsedTime:e.elapsedTime+1})),this.timerTick()},1e3)}render(){const{recording:e,i18n:t}={...this.props},{elapsedTime:s}=this.state,r=gp(s);return e&&!this.timerRunning&&this.startTimer(),!e&&this.timerRunning&&this.resetTimer(),e?d("div",{style:this.wrapperStyle},d("div",{style:this.overlayStyle}),d("div",{style:this.infoContainerStyle},d("div",{style:this.infotextStyle},t("recording")),d("div",{style:this.timeStyle},r))):null}}function vp(i){let{streamActive:e,i18n:t}=i;return e?d("div",{title:t("streamActive"),"aria-label":t("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},d("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))):d("div",{title:t("streamPassive"),"aria-label":t("streamPassive"),className:"uppy-ScreenCapture-icon--stream"},d("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"})))}function Ur(){return Ur=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Ur.apply(null,arguments)}class bp extends re{constructor(){super(...arguments),this.videoElement=null}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{recording:e,stream:t,recordedVideo:s}=this.props,r={playsinline:!0};return(e||!s&&!e)&&(r.muted=!0,r.autoplay=!0,r.srcObject=t),s&&!e&&(r.muted=!1,r.controls=!0,r.src=s,this.videoElement&&(this.videoElement.srcObject=null)),d("div",{className:"uppy uppy-ScreenCapture-container"},d("div",{className:"uppy-ScreenCapture-videoContainer"},d(vp,this.props),d("video",Ur({ref:n=>{this.videoElement=n},className:"uppy-ScreenCapture-video"},r)),d(yp,this.props)),d("div",{className:"uppy-ScreenCapture-buttonContainer"},d(fp,this.props),d(mp,this.props)))}}const wp={strings:{pluginNameScreenCapture:"Screencast",startCapturing:"Begin screen capturing",stopCapturing:"Stop screen capturing",submitRecordedFile:"Submit recorded file",streamActive:"Stream active",streamPassive:"Stream passive",micDisabled:"Microphone access denied by user",recording:"Recording"}};function Br(){return Br=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},Br.apply(null,arguments)}const Sp={version:"4.1.2"};function _p(){var i;return window.MediaRecorder&&((i=navigator.mediaDevices)==null?void 0:i.getDisplayMedia)}function Fp(){return window.MediaRecorder&&navigator.mediaDevices}const Tp={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"};class Io extends ne{constructor(e,t){super(e,{...Tp,...t}),this.videoStream=null,this.audioStream=null,this.userDenied=!1,this.recorder=null,this.outputStream=null,this.recordingChunks=null,this.mediaDevices=Fp(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.type="acquirer",this.icon=pp,this.defaultLocale=wp,this.i18nInit(),this.title=this.i18n("pluginNameScreenCapture"),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.submit=this.submit.bind(this),this.streamInterrupted=this.streamInactivated.bind(this),this.captureActive=!1,this.capturedMediaFile=null}install(){if(!_p())return this.uppy.log("Screen recorder access is not supported","warning"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.videoStream&&this.stop(),this.unmount()}start(){return this.mediaDevices?(this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then(e=>{e===!1&&this.parent&&this.parent.hideAllPanels&&(this.parent.hideAllPanels(),this.captureActive=!1)})):Promise.reject(new Error("Screen recorder access not supported"))}selectVideoStreamSource(){return this.videoStream?new Promise(e=>e(this.videoStream)):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then(e=>(this.videoStream=e,this.videoStream.addEventListener("inactive",()=>{this.streamInactivated()}),this.setPluginState({streamActive:!0}),e)).catch(e=>(this.setPluginState({screenRecError:e}),this.userDenied=!0,setTimeout(()=>{this.userDenied=!1},1e3),!1))}selectAudioStreamSource(){return this.audioStream?new Promise(e=>e(this.audioStream)):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then(e=>(this.audioStream=e,this.setPluginState({audioStreamActive:!0}),e)).catch(e=>(e.name==="NotAllowedError"&&(this.uppy.info(this.i18n("micDisabled"),"error",5e3),this.uppy.log(this.i18n("micDisabled"),"warning")),!1))}startRecording(){const e={};this.capturedMediaFile=null,this.recordingChunks=[];const{preferredVideoMimeType:t}=this.opts;this.selectVideoStreamSource().then(s=>{if(s===!1)throw new Error("No video stream available");t&&MediaRecorder.isTypeSupported(t)&&li(t)&&(e.mimeType=t);const r=[s.getVideoTracks()[0]];this.audioStream&&r.push(this.audioStream.getAudioTracks()[0]),this.outputStream=new MediaStream(r),this.recorder=new MediaRecorder(this.outputStream,e),this.recorder.addEventListener("dataavailable",n=>{this.recordingChunks.push(n.data)}),this.recorder.start(),this.setPluginState({recording:!0})}).catch(s=>{this.uppy.log(s,"error")})}streamInactivated(){const{recordedVideo:e,recording:t}={...this.getPluginState()};!e&&!t?this.parent&&this.parent.hideAllPanels&&this.parent.hideAllPanels():t&&(this.uppy.log("Capture stream inactive — stop recording"),this.stopRecording()),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop()}).then(()=>(this.setPluginState({recording:!1}),this.getVideo())).then(t=>{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)})}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"warning")}}stop(){this.videoStream&&(this.videoStream.getVideoTracks().forEach(e=>{e.stop()}),this.videoStream.getAudioTracks().forEach(e=>{e.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(e=>{e.stop()}),this.audioStream.getVideoTracks().forEach(e=>{e.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(e=>{e.stop()}),this.outputStream.getVideoTracks().forEach(e=>{e.stop()}),this.outputStream=null),this.setPluginState({recordedVideo:null}),this.captureActive=!1}getVideo(){const e=this.recordingChunks[0].type,t=li(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const s=`screencap-${Date.now()}.${t}`,r=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:s,data:new Blob([r],{type:e}),type:e};return Promise.resolve(n)}render(){const e=this.getPluginState();return!e.streamActive&&!this.captureActive&&!this.userDenied&&this.start(),d(bp,Br({},e,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))}}Io.VERSION=Sp.version;/*!
29
- * Cropper.js v1.6.2
30
- * https://fengyuanchen.github.io/cropperjs
31
- *
32
- * Copyright 2015-present Chen Fengyuan
33
- * Released under the MIT license
34
- *
35
- * Date: 2024-04-21T07:43:05.335Z
36
- */function Uo(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Bo(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Uo(Object(t),!0).forEach(function(s){Op(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Uo(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Pp(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var s=t.call(i,e||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Lo(i){var e=Pp(i,"string");return typeof e=="symbol"?e:e+""}function Lr(i){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lr(i)}function Cp(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(i,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,Lo(s.key),s)}}function Ep(i,e,t){return zo(i.prototype,e),zo(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Op(i,e,t){return e=Lo(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function $o(i){return xp(i)||Rp(i)||Dp(i)||Ap()}function xp(i){if(Array.isArray(i))return zr(i)}function Rp(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Dp(i,e){if(i){if(typeof i=="string")return zr(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zr(i,e)}}function zr(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Ap(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
37
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Qi=typeof window<"u"&&typeof window.document<"u",Oe=Qi?window:{},$r=Qi&&Oe.document.documentElement?"ontouchstart"in Oe.document.documentElement:!1,jr=Qi?"PointerEvent"in Oe:!1,$="cropper",Hr="all",jo="crop",Ho="move",qo="zoom",pt="e",ft="w",Ot="s",tt="n",mi="ne",gi="nw",yi="se",vi="sw",qr="".concat($,"-crop"),Vo="".concat($,"-disabled"),ae="".concat($,"-hidden"),Wo="".concat($,"-hide"),kp="".concat($,"-invisible"),Zi="".concat($,"-modal"),Vr="".concat($,"-move"),bi="".concat($,"Action"),es="".concat($,"Preview"),Wr="crop",Go="move",Xo="none",Gr="crop",Xr="cropend",Yr="cropmove",Kr="cropstart",Yo="dblclick",Mp=$r?"touchstart":"mousedown",Np=$r?"touchmove":"mousemove",Ip=$r?"touchend touchcancel":"mouseup",Ko=jr?"pointerdown":Mp,Jo=jr?"pointermove":Np,Qo=jr?"pointerup pointercancel":Ip,Zo="ready",el="resize",tl="wheel",Jr="zoom",il="image/jpeg",Up=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Bp=/^data:/,Lp=/^data:image\/jpeg;base64,/,zp=/^img|canvas$/i,sl=200,rl=100,nl={viewMode:0,dragMode:Wr,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:sl,minContainerHeight:rl,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},$p='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',jp=Number.isNaN||Oe.isNaN;function R(i){return typeof i=="number"&&!jp(i)}var al=function(e){return e>0&&e<1/0};function Qr(i){return typeof i>"u"}function mt(i){return Lr(i)==="object"&&i!==null}var Hp=Object.prototype.hasOwnProperty;function xt(i){if(!mt(i))return!1;try{var e=i.constructor,t=e.prototype;return e&&t&&Hp.call(t,"isPrototypeOf")}catch{return!1}}function oe(i){return typeof i=="function"}var qp=Array.prototype.slice;function ol(i){return Array.from?Array.from(i):qp.call(i)}function W(i,e){return i&&oe(e)&&(Array.isArray(i)||R(i.length)?ol(i).forEach(function(t,s){e.call(i,t,s,i)}):mt(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)})),i}var j=Object.assign||function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return mt(e)&&s.length>0&&s.forEach(function(n){mt(n)&&Object.keys(n).forEach(function(a){e[a]=n[a]})}),e},Vp=/\.\d*(?:0|9){12}\d*$/;function Rt(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Vp.test(i)?Math.round(i*e)/e:i}var Wp=/^width|height|left|top|marginLeft|marginTop$/;function it(i,e){var t=i.style;W(e,function(s,r){Wp.test(r)&&R(s)&&(s="".concat(s,"px")),t[r]=s})}function Gp(i,e){return i.classList?i.classList.contains(e):i.className.indexOf(e)>-1}function Y(i,e){if(e){if(R(i.length)){W(i,function(s){Y(s,e)});return}if(i.classList){i.classList.add(e);return}var t=i.className.trim();t?t.indexOf(e)<0&&(i.className="".concat(t," ").concat(e)):i.className=e}}function xe(i,e){if(e){if(R(i.length)){W(i,function(t){xe(t,e)});return}if(i.classList){i.classList.remove(e);return}i.className.indexOf(e)>=0&&(i.className=i.className.replace(e,""))}}function Dt(i,e,t){if(e){if(R(i.length)){W(i,function(s){Dt(s,e,t)});return}t?Y(i,e):xe(i,e)}}var Xp=/([a-z\d])([A-Z])/g;function Zr(i){return i.replace(Xp,"$1-$2").toLowerCase()}function en(i,e){return mt(i[e])?i[e]:i.dataset?i.dataset[e]:i.getAttribute("data-".concat(Zr(e)))}function wi(i,e,t){mt(t)?i[e]=t:i.dataset?i.dataset[e]=t:i.setAttribute("data-".concat(Zr(e)),t)}function Yp(i,e){if(mt(i[e]))try{delete i[e]}catch{i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch{i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Zr(e)))}var ll=/\s\s*/,ul=function(){var i=!1;if(Qi){var e=!1,t=function(){},s=Object.defineProperty({},"once",{get:function(){return i=!0,e},set:function(n){e=n}});Oe.addEventListener("test",t,s),Oe.removeEventListener("test",t,s)}return i}();function Te(i,e,t){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(ll).forEach(function(n){if(!ul){var a=i.listeners;a&&a[n]&&a[n][t]&&(r=a[n][t],delete a[n][t],Object.keys(a[n]).length===0&&delete a[n],Object.keys(a).length===0&&delete i.listeners)}i.removeEventListener(n,r,s)})}function me(i,e,t){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},r=t;e.trim().split(ll).forEach(function(n){if(s.once&&!ul){var a=i.listeners,o=a===void 0?{}:a;r=function(){delete o[n][t],i.removeEventListener(n,r,s);for(var u=arguments.length,c=new Array(u),h=0;h<u;h++)c[h]=arguments[h];t.apply(i,c)},o[n]||(o[n]={}),o[n][t]&&i.removeEventListener(n,o[n][t],s),o[n][t]=r,i.listeners=o}i.addEventListener(n,r,s)})}function At(i,e,t){var s;return oe(Event)&&oe(CustomEvent)?s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent"),s.initCustomEvent(e,!0,!0,t)),i.dispatchEvent(s)}function dl(i){var e=i.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var tn=Oe.location,Kp=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function hl(i){var e=i.match(Kp);return e!==null&&(e[1]!==tn.protocol||e[2]!==tn.hostname||e[3]!==tn.port)}function cl(i){var e="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+e}function Si(i){var e=i.rotate,t=i.scaleX,s=i.scaleY,r=i.translateX,n=i.translateY,a=[];R(r)&&r!==0&&a.push("translateX(".concat(r,"px)")),R(n)&&n!==0&&a.push("translateY(".concat(n,"px)")),R(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),R(t)&&t!==1&&a.push("scaleX(".concat(t,")")),R(s)&&s!==1&&a.push("scaleY(".concat(s,")"));var o=a.length?a.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function Jp(i){var e=Bo({},i),t=0;return W(i,function(s,r){delete e[r],W(e,function(n){var a=Math.abs(s.startX-n.startX),o=Math.abs(s.startY-n.startY),l=Math.abs(s.endX-n.endX),u=Math.abs(s.endY-n.endY),c=Math.sqrt(a*a+o*o),h=Math.sqrt(l*l+u*u),p=(h-c)/c;Math.abs(p)>Math.abs(t)&&(t=p)})}),t}function ts(i,e){var t=i.pageX,s=i.pageY,r={endX:t,endY:s};return e?r:Bo({startX:t,startY:s},r)}function Qp(i){var e=0,t=0,s=0;return W(i,function(r){var n=r.startX,a=r.startY;e+=n,t+=a,s+=1}),e/=s,t/=s,{pageX:e,pageY:t}}function st(i){var e=i.aspectRatio,t=i.height,s=i.width,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",n=al(s),a=al(t);if(n&&a){var o=t*e;r==="contain"&&o>s||r==="cover"&&o<s?t=s/e:s=t*e}else n?t=s/e:a&&(s=t*e);return{width:s,height:t}}function Zp(i){var e=i.width,t=i.height,s=i.degree;if(s=Math.abs(s)%180,s===90)return{width:t,height:e};var r=s%90*Math.PI/180,n=Math.sin(r),a=Math.cos(r),o=e*a+t*n,l=e*n+t*a;return s>90?{width:l,height:o}:{width:o,height:l}}function ef(i,e,t,s){var r=e.aspectRatio,n=e.naturalWidth,a=e.naturalHeight,o=e.rotate,l=o===void 0?0:o,u=e.scaleX,c=u===void 0?1:u,h=e.scaleY,p=h===void 0?1:h,f=t.aspectRatio,m=t.naturalWidth,v=t.naturalHeight,y=s.fillColor,w=y===void 0?"transparent":y,b=s.imageSmoothingEnabled,E=b===void 0?!0:b,C=s.imageSmoothingQuality,P=C===void 0?"low":C,g=s.maxWidth,S=g===void 0?1/0:g,F=s.maxHeight,x=F===void 0?1/0:F,U=s.minWidth,M=U===void 0?0:U,I=s.minHeight,D=I===void 0?0:I,N=document.createElement("canvas"),z=N.getContext("2d"),Z=st({aspectRatio:f,width:S,height:x}),ye=st({aspectRatio:f,width:M,height:D},"cover"),Pe=Math.min(Z.width,Math.max(ye.width,m)),pe=Math.min(Z.height,Math.max(ye.height,v)),Re=st({aspectRatio:r,width:S,height:x}),Ci=st({aspectRatio:r,width:M,height:D},"cover"),Ei=Math.min(Re.width,Math.max(Ci.width,n)),rs=Math.min(Re.height,Math.max(Ci.height,a)),cn=[-Ei/2,-rs/2,Ei,rs];return N.width=Rt(Pe),N.height=Rt(pe),z.fillStyle=w,z.fillRect(0,0,Pe,pe),z.save(),z.translate(Pe/2,pe/2),z.rotate(l*Math.PI/180),z.scale(c,p),z.imageSmoothingEnabled=E,z.imageSmoothingQuality=P,z.drawImage.apply(z,[i].concat($o(cn.map(function(ns){return Math.floor(Rt(ns))})))),z.restore(),N}var pl=String.fromCharCode;function tf(i,e,t){var s="";t+=e;for(var r=e;r<t;r+=1)s+=pl(i.getUint8(r));return s}var sf=/^data:.*,/;function rf(i){var e=i.replace(sf,""),t=atob(e),s=new ArrayBuffer(t.length),r=new Uint8Array(s);return W(r,function(n,a){r[a]=t.charCodeAt(a)}),s}function nf(i,e){for(var t=[],s=8192,r=new Uint8Array(i);r.length>0;)t.push(pl.apply(null,ol(r.subarray(0,s)))),r=r.subarray(s);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function af(i){var e=new DataView(i),t;try{var s,r,n;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,o=2;o+1<a;){if(e.getUint8(o)===255&&e.getUint8(o+1)===225){r=o;break}o+=1}if(r){var l=r+4,u=r+10;if(tf(e,l,4)==="Exif"){var c=e.getUint16(u);if(s=c===18761,(s||c===19789)&&e.getUint16(u+2,s)===42){var h=e.getUint32(u+4,s);h>=8&&(n=u+h)}}}if(n){var p=e.getUint16(n,s),f,m;for(m=0;m<p;m+=1)if(f=n+m*12+2,e.getUint16(f,s)===274){f+=8,t=e.getUint16(f,s),e.setUint16(f,1,s);break}}}catch{t=1}return t}function of(i){var e=0,t=1,s=1;switch(i){case 2:t=-1;break;case 3:e=-180;break;case 4:s=-1;break;case 5:e=90,s=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:s}}var lf={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,s=this.container,r=this.cropper,n=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Y(r,ae),xe(e,ae);var o={width:Math.max(s.offsetWidth,n>=0?n:sl),height:Math.max(s.offsetHeight,a>=0?a:rl)};this.containerData=o,it(r,{width:o.width,height:o.height}),Y(e,ae),xe(r,ae)},initCanvas:function(){var e=this.containerData,t=this.imageData,s=this.options.viewMode,r=Math.abs(t.rotate)%180===90,n=r?t.naturalHeight:t.naturalWidth,a=r?t.naturalWidth:t.naturalHeight,o=n/a,l=e.width,u=e.height;e.height*o>e.width?s===3?l=e.height*o:u=e.width/o:s===3?u=e.width/o:l=e.height*o;var c={aspectRatio:o,naturalWidth:n,naturalHeight:a,width:l,height:u};this.canvasData=c,this.limited=s===1||s===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(e.width-c.width)/2,c.top=(e.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=j({},c)},limitCanvas:function(e,t){var s=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=s.viewMode,l=n.aspectRatio,u=this.cropped&&a;if(e){var c=Number(s.minCanvasWidth)||0,h=Number(s.minCanvasHeight)||0;o>1?(c=Math.max(c,r.width),h=Math.max(h,r.height),o===3&&(h*l>c?c=h*l:h=c/l)):o>0&&(c?c=Math.max(c,u?a.width:0):h?h=Math.max(h,u?a.height:0):u&&(c=a.width,h=a.height,h*l>c?c=h*l:h=c/l));var p=st({aspectRatio:l,width:c,height:h});c=p.width,h=p.height,n.minWidth=c,n.minHeight=h,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(o>(u?0:1)){var f=r.width-n.width,m=r.height-n.height;n.minLeft=Math.min(0,f),n.minTop=Math.min(0,m),n.maxLeft=Math.max(0,f),n.maxTop=Math.max(0,m),u&&this.limited&&(n.minLeft=Math.min(a.left,a.left+(a.width-n.width)),n.minTop=Math.min(a.top,a.top+(a.height-n.height)),n.maxLeft=a.left,n.maxTop=a.top,o===2&&(n.width>=r.width&&(n.minLeft=Math.min(0,f),n.maxLeft=Math.max(0,f)),n.height>=r.height&&(n.minTop=Math.min(0,m),n.maxTop=Math.max(0,m))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=r.width,n.maxTop=r.height},renderCanvas:function(e,t){var s=this.canvasData,r=this.imageData;if(t){var n=Zp({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),a=n.width,o=n.height,l=s.width*(a/s.naturalWidth),u=s.height*(o/s.naturalHeight);s.left-=(l-s.width)/2,s.top-=(u-s.height)/2,s.width=l,s.height=u,s.aspectRatio=a/o,s.naturalWidth=a,s.naturalHeight=o,this.limitCanvas(!0,!1)}(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCanvas(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,it(this.canvas,j({width:s.width,height:s.height},Si({translateX:s.left,translateY:s.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,s=this.imageData,r=s.naturalWidth*(t.width/t.naturalWidth),n=s.naturalHeight*(t.height/t.naturalHeight);j(s,{width:r,height:n,left:(t.width-r)/2,top:(t.height-n)/2}),it(this.image,j({width:s.width,height:s.height},Si(j({translateX:s.left,translateY:s.top},s)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,s=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,n={width:t.width,height:t.height};s&&(t.height*s>t.width?n.height=n.width/s:n.width=n.height*s),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*r),n.height=Math.max(n.minHeight,n.height*r),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=j({},n)},limitCropBox:function(e,t){var s=this.options,r=this.containerData,n=this.canvasData,a=this.cropBoxData,o=this.limited,l=s.aspectRatio;if(e){var u=Number(s.minCropBoxWidth)||0,c=Number(s.minCropBoxHeight)||0,h=o?Math.min(r.width,n.width,n.width+n.left,r.width-n.left):r.width,p=o?Math.min(r.height,n.height,n.height+n.top,r.height-n.top):r.height;u=Math.min(u,r.width),c=Math.min(c,r.height),l&&(u&&c?c*l>u?c=u/l:u=c*l:u?c=u/l:c&&(u=c*l),p*l>h?p=h/l:h=p*l),a.minWidth=Math.min(u,h),a.minHeight=Math.min(c,p),a.maxWidth=h,a.maxHeight=p}t&&(o?(a.minLeft=Math.max(0,n.left),a.minTop=Math.max(0,n.top),a.maxLeft=Math.min(r.width,n.left+n.width)-a.width,a.maxTop=Math.min(r.height,n.top+n.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=r.width-a.width,a.maxTop=r.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,s=this.cropBoxData;(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCropBox(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,e.movable&&e.cropBoxMovable&&wi(this.face,bi,s.width>=t.width&&s.height>=t.height?Ho:Hr),it(this.cropBox,j({width:s.width,height:s.height},Si({translateX:s.left,translateY:s.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),At(this.element,Gr,this.getData())}},uf={initPreview:function(){var e=this.element,t=this.crossOrigin,s=this.options.preview,r=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=r,a.alt=n,this.viewBox.appendChild(a),this.viewBoxImage=a,!!s){var o=s;typeof s=="string"?o=e.ownerDocument.querySelectorAll(s):s.querySelector&&(o=[s]),this.previews=o,W(o,function(l){var u=document.createElement("img");wi(l,es,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),t&&(u.crossOrigin=t),u.src=r,u.alt=n,u.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(u)})}},resetPreview:function(){W(this.previews,function(e){var t=en(e,es);it(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Yp(e,es)})},preview:function(){var e=this.imageData,t=this.canvasData,s=this.cropBoxData,r=s.width,n=s.height,a=e.width,o=e.height,l=s.left-t.left-e.left,u=s.top-t.top-e.top;!this.cropped||this.disabled||(it(this.viewBoxImage,j({width:a,height:o},Si(j({translateX:-l,translateY:-u},e)))),W(this.previews,function(c){var h=en(c,es),p=h.width,f=h.height,m=p,v=f,y=1;r&&(y=p/r,v=n*y),n&&v>f&&(y=f/n,m=r*y,v=f),it(c,{width:m,height:v}),it(c.getElementsByTagName("img")[0],j({width:a*y,height:o*y},Si(j({translateX:-l*y,translateY:-u*y},e))))}))}},df={bind:function(){var e=this.element,t=this.options,s=this.cropper;oe(t.cropstart)&&me(e,Kr,t.cropstart),oe(t.cropmove)&&me(e,Yr,t.cropmove),oe(t.cropend)&&me(e,Xr,t.cropend),oe(t.crop)&&me(e,Gr,t.crop),oe(t.zoom)&&me(e,Jr,t.zoom),me(s,Ko,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&me(s,tl,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&me(s,Yo,this.onDblclick=this.dblclick.bind(this)),me(e.ownerDocument,Jo,this.onCropMove=this.cropMove.bind(this)),me(e.ownerDocument,Qo,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&me(window,el,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,s=this.cropper;oe(t.cropstart)&&Te(e,Kr,t.cropstart),oe(t.cropmove)&&Te(e,Yr,t.cropmove),oe(t.cropend)&&Te(e,Xr,t.cropend),oe(t.crop)&&Te(e,Gr,t.crop),oe(t.zoom)&&Te(e,Jr,t.zoom),Te(s,Ko,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Te(s,tl,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Te(s,Yo,this.onDblclick),Te(e.ownerDocument,Jo,this.onCropMove),Te(e.ownerDocument,Qo,this.onCropEnd),t.responsive&&Te(window,el,this.onResize)}},hf={resize:function(){if(!this.disabled){var e=this.options,t=this.container,s=this.containerData,r=t.offsetWidth/s.width,n=t.offsetHeight/s.height,a=Math.abs(r-1)>Math.abs(n-1)?r:n;if(a!==1){var o,l;e.restore&&(o=this.getCanvasData(),l=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(W(o,function(u,c){o[c]=u*a})),this.setCropBoxData(W(l,function(u,c){l[c]=u*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===Xo||this.setDragMode(Gp(this.dragBox,qr)?Go:Wr)},wheel:function(e){var t=this,s=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*s,e)))},cropStart:function(e){var t=e.buttons,s=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(R(t)&&t!==1||R(s)&&s!==0||e.ctrlKey))){var r=this.options,n=this.pointers,a;e.changedTouches?W(e.changedTouches,function(o){n[o.identifier]=ts(o)}):n[e.pointerId||0]=ts(e),Object.keys(n).length>1&&r.zoomable&&r.zoomOnTouch?a=qo:a=en(e.target,bi),Up.test(a)&&At(this.element,Kr,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===jo&&(this.cropping=!0,Y(this.dragBox,Zi)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var s=this.pointers;e.preventDefault(),At(this.element,Yr,{originalEvent:e,action:t})!==!1&&(e.changedTouches?W(e.changedTouches,function(r){j(s[r.identifier]||{},ts(r,!0))}):j(s[e.pointerId||0]||{},ts(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,s=this.pointers;e.changedTouches?W(e.changedTouches,function(r){delete s[r.identifier]}):delete s[e.pointerId||0],t&&(e.preventDefault(),Object.keys(s).length||(this.action=""),this.cropping&&(this.cropping=!1,Dt(this.dragBox,Zi,this.cropped&&this.options.modal)),At(this.element,Xr,{originalEvent:e,action:t}))}}},cf={change:function(e){var t=this.options,s=this.canvasData,r=this.containerData,n=this.cropBoxData,a=this.pointers,o=this.action,l=t.aspectRatio,u=n.left,c=n.top,h=n.width,p=n.height,f=u+h,m=c+p,v=0,y=0,w=r.width,b=r.height,E=!0,C;!l&&e.shiftKey&&(l=h&&p?h/p:1),this.limited&&(v=n.minLeft,y=n.minTop,w=v+Math.min(r.width,s.width,s.left+s.width),b=y+Math.min(r.height,s.height,s.top+s.height));var P=a[Object.keys(a)[0]],g={x:P.endX-P.startX,y:P.endY-P.startY},S=function(x){switch(x){case pt:f+g.x>w&&(g.x=w-f);break;case ft:u+g.x<v&&(g.x=v-u);break;case tt:c+g.y<y&&(g.y=y-c);break;case Ot:m+g.y>b&&(g.y=b-m);break}};switch(o){case Hr:u+=g.x,c+=g.y;break;case pt:if(g.x>=0&&(f>=w||l&&(c<=y||m>=b))){E=!1;break}S(pt),h+=g.x,h<0&&(o=ft,h=-h,u-=h),l&&(p=h/l,c+=(n.height-p)/2);break;case tt:if(g.y<=0&&(c<=y||l&&(u<=v||f>=w))){E=!1;break}S(tt),p-=g.y,c+=g.y,p<0&&(o=Ot,p=-p,c-=p),l&&(h=p*l,u+=(n.width-h)/2);break;case ft:if(g.x<=0&&(u<=v||l&&(c<=y||m>=b))){E=!1;break}S(ft),h-=g.x,u+=g.x,h<0&&(o=pt,h=-h,u-=h),l&&(p=h/l,c+=(n.height-p)/2);break;case Ot:if(g.y>=0&&(m>=b||l&&(u<=v||f>=w))){E=!1;break}S(Ot),p+=g.y,p<0&&(o=tt,p=-p,c-=p),l&&(h=p*l,u+=(n.width-h)/2);break;case mi:if(l){if(g.y<=0&&(c<=y||f>=w)){E=!1;break}S(tt),p-=g.y,c+=g.y,h=p*l}else S(tt),S(pt),g.x>=0?f<w?h+=g.x:g.y<=0&&c<=y&&(E=!1):h+=g.x,g.y<=0?c>y&&(p-=g.y,c+=g.y):(p-=g.y,c+=g.y);h<0&&p<0?(o=vi,p=-p,h=-h,c-=p,u-=h):h<0?(o=gi,h=-h,u-=h):p<0&&(o=yi,p=-p,c-=p);break;case gi:if(l){if(g.y<=0&&(c<=y||u<=v)){E=!1;break}S(tt),p-=g.y,c+=g.y,h=p*l,u+=n.width-h}else S(tt),S(ft),g.x<=0?u>v?(h-=g.x,u+=g.x):g.y<=0&&c<=y&&(E=!1):(h-=g.x,u+=g.x),g.y<=0?c>y&&(p-=g.y,c+=g.y):(p-=g.y,c+=g.y);h<0&&p<0?(o=yi,p=-p,h=-h,c-=p,u-=h):h<0?(o=mi,h=-h,u-=h):p<0&&(o=vi,p=-p,c-=p);break;case vi:if(l){if(g.x<=0&&(u<=v||m>=b)){E=!1;break}S(ft),h-=g.x,u+=g.x,p=h/l}else S(Ot),S(ft),g.x<=0?u>v?(h-=g.x,u+=g.x):g.y>=0&&m>=b&&(E=!1):(h-=g.x,u+=g.x),g.y>=0?m<b&&(p+=g.y):p+=g.y;h<0&&p<0?(o=mi,p=-p,h=-h,c-=p,u-=h):h<0?(o=yi,h=-h,u-=h):p<0&&(o=gi,p=-p,c-=p);break;case yi:if(l){if(g.x>=0&&(f>=w||m>=b)){E=!1;break}S(pt),h+=g.x,p=h/l}else S(Ot),S(pt),g.x>=0?f<w?h+=g.x:g.y>=0&&m>=b&&(E=!1):h+=g.x,g.y>=0?m<b&&(p+=g.y):p+=g.y;h<0&&p<0?(o=gi,p=-p,h=-h,c-=p,u-=h):h<0?(o=vi,h=-h,u-=h):p<0&&(o=mi,p=-p,c-=p);break;case Ho:this.move(g.x,g.y),E=!1;break;case qo:this.zoom(Jp(a),e),E=!1;break;case jo:if(!g.x||!g.y){E=!1;break}C=dl(this.cropper),u=P.startX-C.left,c=P.startY-C.top,h=n.minWidth,p=n.minHeight,g.x>0?o=g.y>0?yi:mi:g.x<0&&(u-=h,o=g.y>0?vi:gi),g.y<0&&(c-=p),this.cropped||(xe(this.cropBox,ae),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}E&&(n.width=h,n.height=p,n.left=u,n.top=c,this.action=o,this.renderCropBox()),W(a,function(F){F.startX=F.endX,F.startY=F.endY})}},pf={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Y(this.dragBox,Zi),xe(this.cropBox,ae),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=j({},this.initialImageData),this.canvasData=j({},this.initialCanvasData),this.cropBoxData=j({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(j(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),xe(this.dragBox,Zi),Y(this.cropBox,ae)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,W(this.previews,function(s){s.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,xe(this.cropper,Vo)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Y(this.cropper,Vo)),this},destroy:function(){var e=this.element;return e[$]?(e[$]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.canvasData,r=s.left,n=s.top;return this.moveTo(Qr(e)?e:r+Number(e),Qr(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(R(e)&&(s.left=e,r=!0),R(t)&&(s.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var s=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(s.width*e/s.naturalWidth,null,t)},zoomTo:function(e,t,s){var r=this.options,n=this.canvasData,a=n.width,o=n.height,l=n.naturalWidth,u=n.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&r.zoomable){var c=l*e,h=u*e;if(At(this.element,Jr,{ratio:e,oldRatio:a/l,originalEvent:s})===!1)return this;if(s){var p=this.pointers,f=dl(this.cropper),m=p&&Object.keys(p).length?Qp(p):{pageX:s.pageX,pageY:s.pageY};n.left-=(c-a)*((m.pageX-f.left-n.left)/a),n.top-=(h-o)*((m.pageY-f.top-n.top)/o)}else xt(t)&&R(t.x)&&R(t.y)?(n.left-=(c-a)*((t.x-n.left)/a),n.top-=(h-o)*((t.y-n.top)/o)):(n.left-=(c-a)/2,n.top-=(h-o)/2);n.width=c,n.height=h,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),R(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,R(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(R(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,s=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(R(e)&&(s.scaleX=e,r=!0),R(t)&&(s.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,s=this.imageData,r=this.canvasData,n=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:n.left-r.left,y:n.top-r.top,width:n.width,height:n.height};var o=s.width/s.naturalWidth;if(W(a,function(c,h){a[h]=c/o}),e){var l=Math.round(a.y+a.height),u=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=u-a.x,a.height=l-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=s.rotate||0),t.scalable&&(a.scaleX=s.scaleX||1,a.scaleY=s.scaleY||1),a},setData:function(e){var t=this.options,s=this.imageData,r=this.canvasData,n={};if(this.ready&&!this.disabled&&xt(e)){var a=!1;t.rotatable&&R(e.rotate)&&e.rotate!==s.rotate&&(s.rotate=e.rotate,a=!0),t.scalable&&(R(e.scaleX)&&e.scaleX!==s.scaleX&&(s.scaleX=e.scaleX,a=!0),R(e.scaleY)&&e.scaleY!==s.scaleY&&(s.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var o=s.width/s.naturalWidth;R(e.x)&&(n.left=e.x*o+r.left),R(e.y)&&(n.top=e.y*o+r.top),R(e.width)&&(n.width=e.width*o),R(e.height)&&(n.height=e.height*o),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?j({},this.containerData):{}},getImageData:function(){return this.sized?j({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&W(["left","top","width","height","naturalWidth","naturalHeight"],function(s){t[s]=e[s]}),t},setCanvasData:function(e){var t=this.canvasData,s=t.aspectRatio;return this.ready&&!this.disabled&&xt(e)&&(R(e.left)&&(t.left=e.left),R(e.top)&&(t.top=e.top),R(e.width)?(t.width=e.width,t.height=e.width/s):R(e.height)&&(t.height=e.height,t.width=e.height*s),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,s=this.options.aspectRatio,r,n;return this.ready&&this.cropped&&!this.disabled&&xt(e)&&(R(e.left)&&(t.left=e.left),R(e.top)&&(t.top=e.top),R(e.width)&&e.width!==t.width&&(r=!0,t.width=e.width),R(e.height)&&e.height!==t.height&&(n=!0,t.height=e.height),s&&(r?t.height=t.width/s:n&&(t.width=t.height*s)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,s=ef(this.image,this.imageData,t,e);if(!this.cropped)return s;var r=this.getData(e.rounded),n=r.x,a=r.y,o=r.width,l=r.height,u=s.width/Math.floor(t.naturalWidth);u!==1&&(n*=u,a*=u,o*=u,l*=u);var c=o/l,h=st({aspectRatio:c,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=st({aspectRatio:c,width:e.minWidth||0,height:e.minHeight||0},"cover"),f=st({aspectRatio:c,width:e.width||(u!==1?s.width:o),height:e.height||(u!==1?s.height:l)}),m=f.width,v=f.height;m=Math.min(h.width,Math.max(p.width,m)),v=Math.min(h.height,Math.max(p.height,v));var y=document.createElement("canvas"),w=y.getContext("2d");y.width=Rt(m),y.height=Rt(v),w.fillStyle=e.fillColor||"transparent",w.fillRect(0,0,m,v);var b=e.imageSmoothingEnabled,E=b===void 0?!0:b,C=e.imageSmoothingQuality;w.imageSmoothingEnabled=E,C&&(w.imageSmoothingQuality=C);var P=s.width,g=s.height,S=n,F=a,x,U,M,I,D,N;S<=-o||S>P?(S=0,x=0,M=0,D=0):S<=0?(M=-S,S=0,x=Math.min(P,o+S),D=x):S<=P&&(M=0,x=Math.min(o,P-S),D=x),x<=0||F<=-l||F>g?(F=0,U=0,I=0,N=0):F<=0?(I=-F,F=0,U=Math.min(g,l+F),N=U):F<=g&&(I=0,U=Math.min(l,g-F),N=U);var z=[S,F,x,U];if(D>0&&N>0){var Z=m/o;z.push(M*Z,I*Z,D*Z,N*Z)}return w.drawImage.apply(w,[s].concat($o(z.map(function(ye){return Math.floor(Rt(ye))})))),y},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Qr(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,s=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var n=e===Wr,a=t.movable&&e===Go;e=n||a?e:Xo,t.dragMode=e,wi(s,bi,e),Dt(s,qr,n),Dt(s,Vr,a),t.cropBoxMovable||(wi(r,bi,e),Dt(r,qr,n),Dt(r,Vr,a))}return this}},ff=Oe.Cropper,fl=function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Cp(this,i),!e||!zp.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=j({},nl,xt(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ep(i,[{key:"init",value:function(){var t=this.element,s=t.tagName.toLowerCase(),r;if(!t[$]){if(t[$]=this,s==="img"){if(this.isImg=!0,r=t.getAttribute("src")||"",this.originalUrl=r,!r)return;r=t.src}else s==="canvas"&&window.HTMLCanvasElement&&(r=t.toDataURL());this.load(r)}}},{key:"load",value:function(t){var s=this;if(t){this.url=t,this.imageData={};var r=this.element,n=this.options;if(!n.rotatable&&!n.scalable&&(n.checkOrientation=!1),!n.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Bp.test(t)){Lp.test(t)?this.read(rf(t)):this.clone();return}var a=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=o,a.onerror=o,a.ontimeout=o,a.onprogress=function(){a.getResponseHeader("content-type")!==il&&a.abort()},a.onload=function(){s.read(a.response)},a.onloadend=function(){s.reloading=!1,s.xhr=null},n.checkCrossOrigin&&hl(t)&&r.crossOrigin&&(t=cl(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=r.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var s=this.options,r=this.imageData,n=af(t),a=0,o=1,l=1;if(n>1){this.url=nf(t,il);var u=of(n);a=u.rotate,o=u.scaleX,l=u.scaleY}s.rotatable&&(r.rotate=a),s.scalable&&(r.scaleX=o,r.scaleY=l),this.clone()}},{key:"clone",value:function(){var t=this.element,s=this.url,r=t.crossOrigin,n=s;this.options.checkCrossOrigin&&hl(s)&&(r||(r="anonymous"),n=cl(s)),this.crossOrigin=r,this.crossOriginUrl=n;var a=document.createElement("img");r&&(a.crossOrigin=r),a.src=n||s,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),Y(a,Wo),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,s=this.image;s.onload=null,s.onerror=null,this.sizing=!0;var r=Oe.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Oe.navigator.userAgent),n=function(u,c){j(t.imageData,{naturalWidth:u,naturalHeight:c,aspectRatio:u/c}),t.initialImageData=j({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(s.naturalWidth&&!r){n(s.naturalWidth,s.naturalHeight);return}var a=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){n(a.width,a.height),r||o.removeChild(a)},a.src=s.src,r||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,s=this.options,r=this.image,n=t.parentNode,a=document.createElement("div");a.innerHTML=$p;var o=a.querySelector(".".concat($,"-container")),l=o.querySelector(".".concat($,"-canvas")),u=o.querySelector(".".concat($,"-drag-box")),c=o.querySelector(".".concat($,"-crop-box")),h=c.querySelector(".".concat($,"-face"));this.container=n,this.cropper=o,this.canvas=l,this.dragBox=u,this.cropBox=c,this.viewBox=o.querySelector(".".concat($,"-view-box")),this.face=h,l.appendChild(r),Y(t,ae),n.insertBefore(o,t.nextSibling),xe(r,Wo),this.initPreview(),this.bind(),s.initialAspectRatio=Math.max(0,s.initialAspectRatio)||NaN,s.aspectRatio=Math.max(0,s.aspectRatio)||NaN,s.viewMode=Math.max(0,Math.min(3,Math.round(s.viewMode)))||0,Y(c,ae),s.guides||Y(c.getElementsByClassName("".concat($,"-dashed")),ae),s.center||Y(c.getElementsByClassName("".concat($,"-center")),ae),s.background&&Y(o,"".concat($,"-bg")),s.highlight||Y(h,kp),s.cropBoxMovable&&(Y(h,Vr),wi(h,bi,Hr)),s.cropBoxResizable||(Y(c.getElementsByClassName("".concat($,"-line")),ae),Y(c.getElementsByClassName("".concat($,"-point")),ae)),this.render(),this.ready=!0,this.setDragMode(s.dragMode),s.autoCrop&&this.crop(),this.setData(s.data),oe(s.ready)&&me(t,Zo,s.ready,{once:!0}),At(t,Zo)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),xe(this.element,ae)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ff,i}},{key:"setDefaults",value:function(t){j(nl,xt(t)&&t)}}])}();j(fl.prototype,lf,uf,df,hf,cf,pf);function mf(i,e){const t=i.width/e.width,s=i.height/e.height,r=Math.min(t,s),n=e.width*r,a=e.height*r,o=(i.width-n)/2,l=(i.height-a)/2;return{width:n,height:a,left:o,top:l}}function gf(i){return i*(Math.PI/180)}function yf(i,e,t){const s=Math.abs(gf(t));return Math.max((Math.sin(s)*i+Math.cos(s)*e)/e,(Math.sin(s)*e+Math.cos(s)*i)/i)}function vf(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}function bf(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}class wf extends re{constructor(e){super(e),this.onRotate90Deg=()=>{const{angle90Deg:t}=this.state,s=t-90;this.setState({angle90Deg:s,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(s);const r=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),a=mf(n,r);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a)},this.onRotateGranular=t=>{const s=Number(t.target.value);this.setState({angleGranular:s});const{angle90Deg:r}=this.state,n=r+s;this.cropper.rotateTo(n);const a=this.cropper.getImageData(),o=yf(a.naturalWidth,a.naturalHeight,s),l=this.cropper.getImageData().scaleX<0?-o:o;this.cropper.scale(l,o)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:e,storeCropperInstance:t}=this.props;this.cropper=new fl(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){const t=this.cropper.getCanvasData(),s=this.cropper.getCropBoxData(),{prevCropboxData:r}=this.state;if(e.detail.action==="all"){const n=vf(t,s,r);n&&this.cropper.setCropBoxData(n)}else{const n=bf(t,s,r);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.state;return d("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},d("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){const{i18n:e,opts:t}=this.props;return d("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})}},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){const{i18n:e}=this.props;return d("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),d("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},d("path",{d:"M0 0h24v24H0V0z",fill:"none"}),d("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"}),d("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0V0z",fill:"none"}),d("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("path",{d:"M0 0h24v24H0z",fill:"none"}),d("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("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"}),d("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){const{i18n:e}=this.props;return d("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)},d("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},d("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"}),d("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){const{currentImage:e,opts:t}=this.props,{actions:s}=t,r=URL.createObjectURL(e.data);return d("div",{className:"uppy-ImageCropper"},d("div",{className:"uppy-ImageCropper-container"},d("img",{className:"uppy-ImageCropper-image",alt:e.name,src:r,ref:n=>{this.imgElement=n}})),d("div",{className:"uppy-ImageCropper-controls"},s.revert&&this.renderRevert(),s.rotate&&this.renderRotate(),s.granularRotate&&this.renderGranularRotate(),s.flip&&this.renderFlip(),s.zoomIn&&this.renderZoomIn(),s.zoomOut&&this.renderZoomOut(),s.cropSquare&&this.renderCropSquare(),s.cropWidescreen&&this.renderCropWidescreen(),s.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}}const Sf={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},_f={version:"3.2.1"},ml={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},gl={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},Ff={quality:.8,actions:gl,cropperOptions:ml};class yl extends ne{constructor(e,t){super(e,{...Ff,...t,actions:{...gl,...t==null?void 0:t.actions},cropperOptions:{...ml,...t==null?void 0:t.cropperOptions}}),this.save=()=>{const s=a=>{var o;const{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([a],(o=l.name)!=null?o:this.i18n("unnamed"),{type:a.type}),size:a.size,preview:void 0});const u=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",u),this.setPluginState({currentImage:u}),this.uppy.emit("file-editor:complete",u)},{currentImage:r}=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(s,r.type,this.opts.quality)},this.storeCropperInstance=s=>{this.cropper=s},this.selectFile=s=>{this.uppy.emit("file-editor:start",s),this.setPluginState({currentImage:s})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Sf,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){const{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:d(wf,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}yl.VERSION=_f.version;function qe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Tf=0;function vl(i){return"__private_"+Tf+++"_"+i}var te=vl("uppy"),_i=vl("events");class Pf{constructor(e){Object.defineProperty(this,te,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:[]}),qe(this,te)[te]=e}on(e,t){return qe(this,_i)[_i].push([e,t]),qe(this,te)[te].on(e,t)}remove(){for(const[e,t]of qe(this,_i)[_i].splice(0))qe(this,te)[te].off(e,t)}onFilePause(e,t){this.on("upload-pause",(s,r)=>{e===(s==null?void 0:s.id)&&t(r)})}onFileRemove(e,t){this.on("file-removed",s=>{e===s.id&&t(s.id)})}onPause(e,t){this.on("upload-pause",(s,r)=>{e===(s==null?void 0:s.id)&&t(r)})}onRetry(e,t){this.on("upload-retry",s=>{e===(s==null?void 0:s.id)&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{qe(this,te)[te].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{qe(this,te)[te].getFile(e)&&t()})}onCancelAll(e,t){var s=this;this.on("cancel-all",function(){qe(s,te)[te].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{qe(this,te)[te].getFile(e)&&t()})}}function O(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cf=0;function le(i){return"__private_"+Cf+++"_"+i}function Ef(i){return new Error("Cancelled",{cause:i})}function bl(i){if(i!=null){var e;const t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});const s=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,s,s)}return this}var he=le("activeRequests"),ie=le("queuedHandlers"),ce=le("paused"),gt=le("pauseTimer"),se=le("downLimit"),yt=le("upperLimit"),Ve=le("rateLimitingTimer"),Fi=le("call"),We=le("queueNext"),sn=le("next"),rn=le("queue"),nn=le("dequeue"),an=le("resume"),vt=le("increaseLimit");class Of{constructor(e){Object.defineProperty(this,nn,{value:kf}),Object.defineProperty(this,rn,{value:Af}),Object.defineProperty(this,sn,{value:Df}),Object.defineProperty(this,We,{value:Rf}),Object.defineProperty(this,Fi,{value:xf}),Object.defineProperty(this,he,{writable:!0,value:0}),Object.defineProperty(this,ie,{writable:!0,value:[]}),Object.defineProperty(this,ce,{writable:!0,value:!1}),Object.defineProperty(this,gt,{writable:!0,value:void 0}),Object.defineProperty(this,se,{writable:!0,value:1}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,Ve,{writable:!0,value:void 0}),Object.defineProperty(this,an,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,vt,{writable:!0,value:()=>{if(O(this,ce)[ce]){O(this,Ve)[Ve]=setTimeout(O(this,vt)[vt],0);return}O(this,se)[se]=this.limit,this.limit=Math.ceil((O(this,yt)[yt]+O(this,se)[se])/2);for(let t=O(this,se)[se];t<=this.limit;t++)O(this,We)[We]();O(this,yt)[yt]-O(this,se)[se]>3?O(this,Ve)[Ve]=setTimeout(O(this,vt)[vt],2e3):O(this,se)[se]=Math.floor(O(this,se)[se]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!O(this,ce)[ce]&&O(this,he)[he]<this.limit?O(this,Fi)[Fi](e):O(this,rn)[rn](e,t)}wrapSyncFunction(e,t){var s=this;return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];const o=s.run(()=>(e(...n),queueMicrotask(()=>o.done()),()=>{}),t);return{abortOn:bl,abort(){o.abort()}}}}wrapPromiseFunction(e,t){var s=this;return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];let o;const l=new Promise((u,c)=>{o=s.run(()=>{let h,p;try{p=Promise.resolve(e(...n))}catch(f){p=Promise.reject(f)}return p.then(f=>{h?c(h):(o.done(),u(f))},f=>{h?c(h):(o.done(),c(f))}),f=>{h=Ef(f)}},t)});return l.abort=u=>{o.abort(u)},l.abortOn=bl,l}}resume(){O(this,ce)[ce]=!1,clearTimeout(O(this,gt)[gt]);for(let e=0;e<this.limit;e++)O(this,We)[We]()}pause(e){e===void 0&&(e=null),O(this,ce)[ce]=!0,clearTimeout(O(this,gt)[gt]),e!=null&&(O(this,gt)[gt]=setTimeout(O(this,an)[an],e))}rateLimit(e){clearTimeout(O(this,Ve)[Ve]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(O(this,yt)[yt]=this.limit-1,this.limit=O(this,se)[se],O(this,Ve)[Ve]=setTimeout(O(this,vt)[vt],e))}get isPaused(){return O(this,ce)[ce]}}function xf(i){O(this,he)[he]+=1;let e=!1,t;try{t=i()}catch(s){throw O(this,he)[he]-=1,s}return{abort:s=>{e||(e=!0,O(this,he)[he]-=1,t==null||t(s),O(this,We)[We]())},done:()=>{e||(e=!0,O(this,he)[he]-=1,O(this,We)[We]())}}}function Rf(){queueMicrotask(()=>O(this,sn)[sn]())}function Df(){if(O(this,ce)[ce]||O(this,he)[he]>=this.limit||O(this,ie)[ie].length===0)return;const i=O(this,ie)[ie].shift();if(i==null)throw new Error("Invariant violation: next is null");const e=O(this,Fi)[Fi](i.fn);i.abort=e.abort,i.done=e.done}function Af(i,e){const t={fn:i,priority:(e==null?void 0:e.priority)||0,abort:()=>{O(this,nn)[nn](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},s=O(this,ie)[ie].findIndex(r=>t.priority>r.priority);return s===-1?O(this,ie)[ie].push(t):O(this,ie)[ie].splice(s,0,t),t}function kf(i){const e=O(this,ie)[ie].indexOf(i);e!==-1&&O(this,ie)[ie].splice(e,1)}const on=Symbol("__queue");function Mf(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}function ge(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Nf=0;function is(i){return"__private_"+Nf+++"_"+i}var Ge=is("aliveTimer"),bt=is("isDone"),Ti=is("onTimedOut"),wt=is("timeout");class If{constructor(e,t){Object.defineProperty(this,Ge,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:!1}),Object.defineProperty(this,Ti,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),ge(this,wt)[wt]=e,ge(this,Ti)[Ti]=()=>t(e)}progress(){ge(this,bt)[bt]||ge(this,wt)[wt]>0&&(clearTimeout(ge(this,Ge)[Ge]),ge(this,Ge)[Ge]=setTimeout(ge(this,Ti)[Ti],ge(this,wt)[wt]))}done(){ge(this,bt)[bt]||(clearTimeout(ge(this,Ge)[Ge]),ge(this,Ge)[Ge]=void 0,ge(this,bt)[bt]=!0)}}const ss=()=>{};function Uf(i,e){e===void 0&&(e={});const{body:t=null,headers:s={},method:r="GET",onBeforeRequest:n=ss,onUploadProgress:a=ss,shouldRetry:o=()=>!0,onAfterResponse:l=ss,onTimeout:u=ss,responseType:c,retries:h=3,signal:p=null,timeout:f=3e4,withCredentials:m=!1}=e,v=b=>.3*2**(b-1)*1e3,y=new If(f,u);function w(b){return b===void 0&&(b=0),new Promise(async(E,C)=>{const P=new XMLHttpRequest;P.open(r,i,!0),P.withCredentials=m,c&&(P.responseType=c),p==null||p.addEventListener("abort",()=>{P.abort(),C(new DOMException("Aborted","AbortError"))}),P.onload=async()=>{await l(P,b),P.status>=200&&P.status<300?(y.done(),E(P)):o(P)&&b<h?setTimeout(()=>{w(b+1).then(E,C)},v(b)):(y.done(),C(new hi(P.statusText,P)))},P.onerror=()=>{o(P)&&b<h?setTimeout(()=>{w(b+1).then(E,C)},v(b)):(y.done(),C(new hi(P.statusText,P)))},P.upload.onprogress=g=>{y.progress(),a(g)},s&&Object.keys(s).forEach(g=>{P.setRequestHeader(g,s[g])}),await n(P,b),P.send(t)})}return w()}function Bf(i){const e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Lf(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function wl(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}const zf={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Xe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $f=0;function kt(i){return"__private_"+$f+++"_"+i}const jf={version:"4.2.3"};function Hf(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})),Mf(i)?(t=new hi(t,i),t):(t.request=i,t)}function Sl(i){return i.data.slice(0,i.data.size,i.meta.type)}const qf={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};var St=kt("getFetcher"),ln=kt("uploadLocalFile"),un=kt("uploadBundle"),dn=kt("getCompanionClientArgs"),hn=kt("uploadFiles"),Pi=kt("handleUpload");class _l extends aa{constructor(e,t){if(super(e,{...qf,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,hn,{value:Xf}),Object.defineProperty(this,dn,{value:Gf}),Object.defineProperty(this,un,{value:Wf}),Object.defineProperty(this,ln,{value:Vf}),Object.defineProperty(this,St,{writable:!0,value:void 0}),Object.defineProperty(this,Pi,{writable:!0,value:async s=>{if(s.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[on]&&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...");const r=this.uppy.getFilesByIds(s),n=Bf(r),a=Lf(n);if(this.uppy.emit("upload-start",a),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can’t 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 Xe(this,un)[un](n)}else await Xe(this,hn)[hn](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=zf,this.i18nInit(),on in this.opts?this.requests=this.opts[on]:this.requests=new Of(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==null?void 0:t.allowedMetaFields)===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),Xe(this,St)[St]=s=>async(r,n)=>{try{var a,o,l;const c=await Uf(r,{...n,onBeforeRequest:(f,m)=>{var v,y;return(v=(y=this.opts).onBeforeRequest)==null?void 0:v.call(y,f,m,s)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:f=>{const m=Math.ceil(f/1e3),v=new Error(this.i18n("uploadStalled",{seconds:m}));this.uppy.emit("upload-stalled",v,s)},onUploadProgress:f=>{if(f.lengthComputable)for(const{id:v}of s){var m;const y=this.uppy.getFile(v);this.uppy.emit("upload-progress",y,{uploadStarted:(m=y.progress.uploadStarted)!=null?m:0,bytesUploaded:f.loaded/f.total*y.size,bytesTotal:y.size})}}});let h=await((a=(o=this.opts).getResponseData)==null?void 0:a.call(o,c));try{var u;(u=h)!=null||(h=JSON.parse(c.responseText))}catch(f){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:f})}const p=typeof((l=h)==null?void 0:l.url)=="string"?h.url:void 0;for(const{id:f}of s)this.uppy.emit("upload-success",this.uppy.getFile(f),{status:c.status,body:h,uploadURL:p});return c}catch(c){if(c.name==="AbortError")return;if(c instanceof hi){const h=c.request;for(const p of s)this.uppy.emit("upload-error",this.uppy.getFile(p.id),Hf(h,c),h)}throw c}}}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:s}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof s=="function"?r.headers=s(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,s){wl(s.allowedMetaFields,t).forEach(n=>{const a=t[n];Array.isArray(a)?a.forEach(o=>e.append(n,o)):e.append(n,a)})}createFormDataUpload(e,t){const s=new FormData;this.addMetadata(s,e.meta,t);const r=Sl(e);return e.name?s.append(t.fieldName,r,e.meta.name):s.append(t.fieldName,r),s}createBundledUpload(e,t){const s=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(s,r,t),e.forEach(n=>{const a=this.getOptions(n),o=Sl(n);n.name?s.append(a.fieldName,o,n.name):s.append(a.fieldName,o)}),s}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Xe(this,Pi)[Pi])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Xe(this,Pi)[Pi])}}async function Vf(i){const e=new Pf(this.uppy),t=new AbortController,s=this.requests.wrapPromiseFunction(async()=>{const r=this.getOptions(i),n=Xe(this,St)[St]([i]),a=r.formData?this.createFormDataUpload(i,r):i.data;return n(r.endpoint,{...r,body:a,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await s().abortOn(t.signal)}catch(r){if(r.message!=="Cancelled")throw r}finally{e.remove()}}async function Wf(i){const e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var r;const n=(r=this.uppy.getState().xhrUpload)!=null?r:{},a=Xe(this,St)[St](i),o=this.createBundledUpload(i,{...this.opts,...n});return a(this.opts.endpoint,{...this.opts,body:o,signal:e.signal})});function s(){e.abort()}this.uppy.once("cancel-all",s);try{await t().abortOn(e.signal)}catch(r){if(r.message!=="Cancelled")throw r}finally{this.uppy.off("cancel-all",s)}}function Gf(i){var e;const t=this.getOptions(i),s=wl(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(s.map(r=>[r,i.meta[r]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function Xf(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){const t=()=>this.requests,s=new AbortController,r=a=>{a.id===e.id&&s.abort()};this.uppy.on("file-removed",r);const n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Xe(this,dn)[dn](e),{signal:s.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",r)},{priority:-1})(),n}return Xe(this,ln)[ln](e)}))}_l.VERSION=jf.version;const Fl=["csv","djvu","doc","docm","docx","docxf","dot","dotm","dotx","epub","fb2","fodp","fods","fodt","htm","html","mht","odp","ods","odt","oform","otp","ots","ott","oxps","pdf","pot","potm","potx","pps","ppsm","ppsx","ppt","pptm","pptx","rtf","txt","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xml","xps","png","jpeg","jpg","webp","video","mp4","flv","tls"],Yf=i=>{const e=T.inject("loadUrl"),t=T.computed(()=>i.loadUrl||i.fileUrl||(e==null?void 0:e.value)),s=T.inject("uploadUrl"),r=T.computed(()=>i.action||i.uploadUrl||(s==null?void 0:s.value)),n=T.inject("token"),a=T.computed(()=>i.token||(n==null?void 0:n.value)),o=T.inject("onlyofficeConfig"),l=T.computed(()=>i.onlyofficeConfig||(o==null?void 0:o.value)),u=T.inject("userInfo"),c=T.computed(()=>i.userInfo||(u==null?void 0:u.value)),h=[...Fl,...Fl.map(p=>p.toLocaleUpperCase())];return{cLoadUrl:t,cUploadUrl:r,cToken:a,cOnlyofficeConfig:l,cUserInfo:c,cOnlyofficePreviewType:h}},Tl=Pl(((i,e)=>{const t=i.__vccOpts||i;for(const[s,r]of e)t[s]=r;return t})(T.defineComponent({__name:"IkImageUploadEditor",props:T.mergeModels({tools:{type:Array,default:()=>[]},isModal:{type:Boolean,default:!1},uploadFun:{type:Function,default:()=>()=>{}},accept:{type:Array,default:["image/*"]},disabled:{type:Boolean,default:!1},width:{type:Number,default:580},height:{type:Number,default:350},showProgressDetails:{type:Boolean,default:!0},hideUploadButton:{type:Boolean,default:!1},fileManagerSelectionType:{type:String,default:"both"},minFileSize:{type:Number,default:0},maxFileSize:{type:Number,default:10},maxNumberOfFiles:{type:Number,default:100},minNumberOfFiles:{type:Number,default:1},allowedFileTypes:{type:Array,default:()=>["image/*","video/*"]}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(i){const e=i;Dr.strings.poweredBy="";const{cToken:t,cUploadUrl:s}=Yf(e),r=new Ie({locale:{strings:{...Dr.strings,save:"确定",dropHereOr:"拖拽文件到这里,或%{browse}",dropHint:"拖拽文件到这里",browse:"浏览",browseFiles:"浏览本地文件",dropPasteBoth:"拖拽文件到这里,或者%{browse}文件",dropPasteFiles:"拖拽文件到这里,或者%{browse}文件",dropPasteFolders:"拖拽文件到这里,或者%{browse}文件",dropPasteImportBoth:"拖拽文件到这里、粘贴、%{browse}",dropPasteImportFiles:"拖拽文件到这里、粘贴、%{browse}",dropPasteImportFolders:"拖拽文件到这里、粘贴、%{browse}"},pluralize(){return 0}},autoProceed:!1,restrictions:{minFileSize:e.minFileSize*1024*1024,maxFileSize:e.maxFileSize*1024*1024,maxNumberOfFiles:e.maxNumberOfFiles,minNumberOfFiles:e.minNumberOfFiles,allowedFileTypes:e.accept},debug:!1,meta:{type:"avatar"},onBeforeFileAdded:a=>(console.log("onBeforeFileAdded: ",a),!0),onBeforeUpload:a=>(console.log("onBeforeUpload: ",a),!0)}).use(Po,{locale:{strings:{pluginNameCamera:"摄像头"},pluralize(){return 0}}}).use(et,{locale:{strings:{pluginNameUrl:"文件链接"},pluralize(){return 0}},companionUrl:"http://localhost:5173"}).use(Io,{locale:{strings:{pluginNameScreenCapture:"录屏"},pluralize(){return 0}}}).use(yl).use(_l,{endpoint:s.value,fieldName:"file",headers:{Authorization:`Bearer ${t.value}`}}),n=T.useModel(i,"open");return r.on("upload-success",(a,o)=>{console.log("res: ",o),console.log("result: ",a)}),r.on("upload-error",(a,o)=>{console.log("res: ",o),console.log("error: ",a)}),r.on("dashboard:modal-closed",()=>{n.value=!1}),(a,o)=>i.isModal?(T.openBlock(),T.createBlock(T.unref(ec),{key:0,open:n.value,uppy:T.unref(r),props:{disabled:e.disabled,fileManagerSelectionType:i.fileManagerSelectionType}},null,8,["open","uppy","props"])):(T.openBlock(),T.createBlock(T.unref(Zh),{key:1,uppy:T.unref(r),props:{disabled:e.disabled,width:e.width,height:e.height,fileManagerSelectionType:i.fileManagerSelectionType}},null,8,["uppy","props"]))}}),[["__scopeId","data-v-235b9712"]]));Ye.IkImageUploadEditor=Tl,Ye.default=Tl,Object.defineProperties(Ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});