@exulu/frontend 1.8.0 → 1.9.0

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 (146) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +129 -131
  3. package/dist/.next/app-path-routes-manifest.json +1 -1
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/prerender-manifest.json +1 -1
  6. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
  7. package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
  8. package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +7 -7
  11. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
  12. package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
  16. package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
  18. package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
  19. package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
  21. package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
  22. package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
  24. package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
  25. package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
  27. package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
  30. package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
  31. package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
  32. package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/(application)/projects/page.js +1 -1
  34. package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/(application)/prompts/page.js +1 -1
  36. package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
  38. package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
  39. package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
  40. package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
  41. package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
  42. package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
  43. package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
  44. package/dist/.next/server/app/(application)/workflows/page.js +1 -1
  45. package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
  46. package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
  47. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  48. package/dist/.next/server/app/_not-found.html +1 -1
  49. package/dist/.next/server/app/_not-found.rsc +1 -1
  50. package/dist/.next/server/app-paths-manifest.json +6 -6
  51. package/dist/.next/server/chunks/1025.js +1 -0
  52. package/dist/.next/server/chunks/2270.js +11 -48
  53. package/dist/.next/server/chunks/3434.js +1 -1
  54. package/dist/.next/server/chunks/3503.js +1 -0
  55. package/dist/.next/server/chunks/5084.js +1 -0
  56. package/dist/.next/server/chunks/5192.js +1 -1
  57. package/dist/.next/server/chunks/5485.js +1 -1
  58. package/dist/.next/server/chunks/5600.js +1 -1
  59. package/dist/.next/server/chunks/5974.js +1 -0
  60. package/dist/.next/server/chunks/6590.js +1 -1
  61. package/dist/.next/server/chunks/7471.js +1 -1
  62. package/dist/.next/server/chunks/8286.js +1 -1
  63. package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
  64. package/dist/.next/server/middleware-manifest.json +5 -5
  65. package/dist/.next/server/pages/404.html +1 -1
  66. package/dist/.next/server/pages/500.html +1 -1
  67. package/dist/.next/server/server-reference-manifest.json +1 -1
  68. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
  69. package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
  70. package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
  71. package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
  72. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
  73. package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
  74. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
  75. package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
  76. package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
  77. package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
  78. package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
  79. package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
  80. package/dist/.next/static/chunks/6373-601400fab8a3bb55.js +2 -0
  81. package/dist/.next/static/chunks/6373-601400fab8a3bb55.js.map +1 -0
  82. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
  83. package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
  84. package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-0e69d89d2dac7111.js} +10 -10
  85. package/dist/.next/static/chunks/8293-0e69d89d2dac7111.js.map +1 -0
  86. package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
  87. package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
  88. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
  89. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
  90. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js +2 -0
  91. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js.map +1 -0
  92. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js +2 -0
  93. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js.map +1 -0
  94. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
  95. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
  96. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
  97. package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
  98. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
  99. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
  100. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
  101. package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
  102. package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
  103. package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
  104. package/dist/.next/static/css/6f8c5212af8ef284.css +4 -0
  105. package/dist/.next/static/css/6f8c5212af8ef284.css.map +1 -0
  106. package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
  107. package/package.json +1 -1
  108. package/dist/.next/server/chunks/2948.js +0 -1
  109. package/dist/.next/server/chunks/38.js +0 -1
  110. package/dist/.next/server/chunks/7958.js +0 -1
  111. package/dist/.next/server/chunks/8050.js +0 -1
  112. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
  113. package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
  114. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
  115. package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
  116. package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
  117. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
  118. package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
  119. package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
  120. package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
  121. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
  122. package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
  123. package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
  124. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
  125. package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
  126. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
  127. package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
  128. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
  129. package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
  130. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
  131. package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
  132. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
  133. package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
  134. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
  135. package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
  136. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
  137. package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
  138. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
  139. package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
  140. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
  141. package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
  142. package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
  143. package/dist/.next/static/css/c8c015815c72d053.css +0 -4
  144. package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
  145. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_buildManifest.js +0 -0
  146. /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → ls-syPkq9-MWp-VWWDEZJ}/_ssgManifest.js +0 -0
@@ -1,10 +1,10 @@
1
- exports.id=3679,exports.ids=[3679],exports.modules={4354:e=>{"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=Math.abs(e);if(e<0&&(t=-t),0===t)return"0 B";let i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),s=Number(t/1024**r),n=i[r];return`${s>=10||s%1==0?Math.round(s):s.toFixed(1)} ${n}`}},76245:(e,t,i)=>{var r=i(39288).Symbol;e.exports=r},1534:(e,t,i)=>{var r=i(76245),s=i(34244),n=i(13390),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?s(e):n(e)}},37192:(e,t,i)=>{var r=i(5587),s=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(s,""):e}},37611:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},34244:(e,t,i)=>{var r=i(76245),s=Object.prototype,n=s.hasOwnProperty,a=s.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var r=!0}catch(e){}var s=a.call(e);return r&&(t?e[o]=i:delete e[o]),s}},13390:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},39288:(e,t,i)=>{var r=i(37611),s="object"==typeof self&&self&&self.Object===Object&&self,n=r||s||Function("return this")();e.exports=n},5587:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},19788:(e,t,i)=>{var r=i(62880),s=i(22695),n=i(41309),a=Math.max,o=Math.min;e.exports=function(e,t,i){var l,u,p,h,d,c,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var i=l,r=u;return l=u=void 0,f=t,h=e.apply(r,i)}function b(e){var i=e-c,r=e-f;return void 0===c||i>=t||i<0||g&&r>=p}function _(){var e,i,r,n=s();if(b(n))return w(n);d=setTimeout(_,(e=n-c,i=n-f,r=t-e,g?o(r,p-i):r))}function w(e){return(d=void 0,y&&l)?v(e):(l=u=void 0,h)}function P(){var e,i=s(),r=b(i);if(l=arguments,u=this,c=i,r){if(void 0===d)return f=e=c,d=setTimeout(_,t),m?v(e):h;if(g)return clearTimeout(d),d=setTimeout(_,t),v(c)}return void 0===d&&(d=setTimeout(_,t)),h}return t=n(t)||0,r(i)&&(m=!!i.leading,p=(g="maxWait"in i)?a(n(i.maxWait)||0,t):p,y="trailing"in i?!!i.trailing:y),P.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=c=u=d=void 0},P.flush=function(){return void 0===d?h:w(s())},P}},62880:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},91380:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},76871:(e,t,i)=>{var r=i(1534),s=i(91380);e.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==r(e)}},22695:(e,t,i)=>{var r=i(39288);e.exports=function(){return r.Date.now()}},41309:(e,t,i)=>{var r=i(37192),s=i(62880),n=i(76871),a=0/0,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,p=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=l.test(e);return i||u.test(e)?p(e.slice(2),i?2:8):o.test(e)?a:+e}},11890:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},31540:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},15557:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FilePlus",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"12",x2:"12",y1:"18",y2:"12",key:"1tsf04"}],["line",{x1:"9",x2:"15",y1:"15",y2:"15",key:"110plj"}]])},36283:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},61086:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FileWarning",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},39572:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]])},71709:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},3240:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]])},83855:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},37520:e=>{"use strict";var t=Object.prototype.hasOwnProperty,i="~";function r(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function n(e,t,r,n,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new s(r,n||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=Array(n);s<n;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,s,n,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,u,p=this._events[o],h=arguments.length;if(p.fn){switch(p.once&&this.removeListener(e,p.fn,void 0,!0),h){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,t),!0;case 3:return p.fn.call(p.context,t,r),!0;case 4:return p.fn.call(p.context,t,r,s),!0;case 5:return p.fn.call(p.context,t,r,s,n),!0;case 6:return p.fn.call(p.context,t,r,s,n,a),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var d,c=p.length;for(u=0;u<c;u++)switch(p[u].once&&this.removeListener(e,p[u].fn,void 0,!0),h){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,t);break;case 3:p[u].fn.call(p[u].context,t,r);break;case 4:p[u].fn.call(p[u].context,t,r,s);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];p[u].fn.apply(p[u].context,l)}}return!0},o.prototype.on=function(e,t,i){return n(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return n(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,s){var n=i?i+e:e;if(!this._events[n])return this;if(!t)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||s&&!o.once||r&&o.context!==r||a(this,n);else{for(var l=0,u=[],p=o.length;l<p;l++)(o[l].fn!==t||s&&!o[l].once||r&&o[l].context!==r)&&u.push(o[l]);u.length?this._events[n]=1===u.length?u[0]:u:a(this,n)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o},77888:(e,t,i)=>{e.exports=i(98440)},98440:(e,t,i)=>{var r=i(26186);t.operation=function(e){return new r(t.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<t.retries;s++)r.push(this.createTimeout(s,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(s,t)),r.sort(function(e,t){return e-t}),r},t.createTimeout=function(e,t){return Math.min(Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e)),t.maxTimeout)},t.wrap=function(e,i,r){if(i instanceof Array&&(r=i,i=null),!r)for(var s in r=[],e)"function"==typeof e[s]&&r.push(s);for(var n=0;n<r.length;n++){var a=r[n],o=e[a];e[a]=(function(r){var s=t.operation(i),n=Array.prototype.slice.call(arguments,1),a=n.pop();n.push(function(e){s.retry(e)||(e&&(arguments[0]=s.mainError()),a.apply(this,arguments))}),s.attempt(function(){r.apply(e,n)})}).bind(e,o),e[a].options=i}}},26186:e=>{function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var 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)},i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(e[n]||0)+1;e[n]=a,a>=i&&(t=s,i=a)}return t}},19509:(e,t,i)=>{"use strict";var r=i(17577);"function"==typeof Object.is&&Object.is,r.useSyncExternalStore,r.useRef,r.useEffect,r.useMemo,r.useDebugValue},9911:(e,t,i)=>{"use strict";i(19509)},59946:()=>{},27221:()=>{},48029:(e,t)=>{var i;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)r.call(e,i)&&e[i]&&(t=n(t,i));return t}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0!==(i=(function(){return s}).apply(t,[]))&&(e.exports=i)}()},10119:(e,t,i)=>{"use strict";i.d(t,{D:()=>p});var r=i(17577),s=i(71180),n=i(12113),a=i(64351),o=i(3341),l=class extends a.l{#e;#t=void 0;#i;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#i,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(t.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#i?.state.status==="pending"&&this.#i.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#i?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#n(e)}getCurrentResult(){return this.#t}reset(){this.#i?.removeObserver(this),this.#i=void 0,this.#s(),this.#n()}mutate(e,t){return this.#r=t,this.#i?.removeObserver(this),this.#i=this.#e.getMutationCache().build(this.#e,this.options),this.#i.addObserver(this),this.#i.execute(e)}#s(){let e=this.#i?.state??(0,s.R)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#n(e){n.Vr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,i=this.#t.context;e?.type==="success"?(this.#r.onSuccess?.(e.data,t,i),this.#r.onSettled?.(e.data,null,t,i)):e?.type==="error"&&(this.#r.onError?.(e.error,t,i),this.#r.onSettled?.(void 0,e.error,t,i))}this.listeners.forEach(e=>{e(this.#t)})})}},u=i(44976);function p(e,t){let i=(0,u.NL)(t),[s]=r.useState(()=>new l(i,e));r.useEffect(()=>{s.setOptions(e)},[s,e]);let a=r.useSyncExternalStore(r.useCallback(e=>s.subscribe(n.Vr.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),p=r.useCallback((e,t)=>{s.mutate(e,t).catch(o.ZT)},[s]);if(a.error&&(0,o.L3)(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:p,mutateAsync:a.mutate}}},32964:(e,t,i)=>{"use strict";function r(e,t){return Object.hasOwn(e,t)}class s extends Error{isNetworkError;cause;constructor(e,t){super(e),this.cause=t?.cause,this.cause&&r(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}class n extends Error{cause;isNetworkError;request;constructor(e,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}}class a extends Error{name="UserFacingApiError"}var o=i(77888);let l=Object.prototype.toString,u=e=>"[object Error]"===l.call(e),p=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"]);class h extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}let d=(e,t,i)=>{let r=i.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e};async function c(e,t){return new Promise((i,r)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;let s=o.operation(t),n=()=>{s.stop(),r(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",n,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async n=>{try{let t=await e(n);a(),i(t)}catch(e){try{if(!(e instanceof Error))throw TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof h)throw e.originalError;if(e instanceof TypeError&&!(e&&u(e)&&"TypeError"===e.name&&"string"==typeof e.message&&("Load failed"===e.message?void 0===e.stack:p.has(e.message))))throw e;if(d(e,n,t),await t.shouldRetry(e)||(s.stop(),r(e)),await t.onFailedAttempt(e),!s.retry(e))throw s.mainError()}catch(e){d(e,n,t),a(),r(e)}}})})}let f={i8:"4.5.1"};class m extends Error{isAuthError;constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}class g extends Error{statusCode;constructor({statusCode:e,message:t}){super(t),this.name="HttpError",this.statusCode=e}}async function y(e){let t;if(401===e.status)throw new m;if(e.ok)return e.json();let i=`Failed request with status: ${e.status}. ${e.statusText}`;try{(t=await e.json()).message&&(i=`${i} message: ${t.message}`),t.requestId&&(i=`${i} request-Id: ${t.requestId}`)}catch(e){throw Error(i,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new a(t.message);throw new g({statusCode:e.status,message:i})}class v{static VERSION=f.i8;#a;uppy;opts;constructor(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.#a=t.companionHeaders}setCompanionHeaders(e){this.#a=e}[Symbol.for("uppy test: getCompanionHeaders")](){return this.#a}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...this.#a}}onReceiveResponse(e){let{headers:t}=e,i=this.uppy.getState().companion||{},r=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==i[r]&&this.uppy.setState({companion:{...i,[r]:t.get("i-am")}})}#o(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async request({path:e,method:t="GET",data:i,skipPostResponse:r,signal:a}){try{let s=await this.headers(!i),o=await function(...e){return fetch(...e).catch(e=>{if("AbortError"===e.name)throw e;throw new n(e)})}(this.#o(e),{method:t,signal:a,headers:s,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return r||this.onReceiveResponse(o),await y(o)}catch(i){if(i.isAuthError||"UserFacingApiError"===i.name||"AbortError"===i.name)throw i;throw new s(`Could not ${t} ${this.#o(e)}`,{cause:i})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){try{let{signal:r,getQueue:s}=i||{};return await c(async()=>{let i=this.uppy.getFile(e.id)?.serverToken;if(null!=i)return this.uppy.log(`Connecting to exiting websocket ${i}`),this.#l({file:e,queue:s(),signal:r});let n=s().wrapPromiseFunction(async(...e)=>{try{return await this.#u(...e)}catch(t){if(t.isAuthError)throw new h(t);if(null==t.cause)throw t;let e=t.cause;if("HttpError"===e.name&&!([408,409,429,418,423].includes(e.statusCode)||e.statusCode>=500&&e.statusCode<=599&&![501,505].includes(e.statusCode)))throw new h(e);throw e}},{priority:-1}),a=await n({file:e,postBody:t,signal:r}).abortOn(r);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:a}),this.#l({file:this.uppy.getFile(e.id),queue:s(),signal:r})},{retries:10,signal:r,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}}#u=async({file:e,postBody:t,signal:i})=>{if(e.remote?.url==null)throw Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token};async #l({file:e,queue:t,signal:i}){let r;let{capabilities:s}=this.uppy.getState();try{return await new Promise((n,a)=>{let o,l,u;let p=e.serverToken,h=function(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1],i=/^http:\/\//i.test(e)?"ws":"wss";return`${i}://${t}`}(e.remote.companionUrl),{isPaused:d}=e,f=(t,i)=>{if(null==o||o.readyState!==o.OPEN){this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(o?.readyState)}`,"warning");return}o.send(JSON.stringify({action:t,payload:i??{}}))};function m(){s.resumableUploads&&(d?f("pause"):f("resume"))}let g=async()=>{l&&l.abort(),l=new AbortController;let i=t=>{this.uppy.setFileState(e.id,{serverToken:null}),l?.abort?.(),a(t)};function r(){clearTimeout(u),d||(u=setTimeout(()=>i(Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{let t=async()=>new Promise((t,s)=>{o=new WebSocket(`${h}/api/${p}`),r(),o.addEventListener("close",()=>{o=void 0,s(Error("Socket closed unexpectedly"))}),o.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),o?.close()}),o.addEventListener("open",()=>{m()}),o.addEventListener("message",t=>{r();try{let{action:i,payload:r}=JSON.parse(t.data);switch(i){case"progress":!function(e,t,i){let{progress:r,bytesUploaded:s,bytesTotal:n}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",i,{uploadStarted:i.progress.uploadStarted??0,bytesUploaded:s,bytesTotal:n}))}(this,r,this.uppy.getFile(e.id));break;case"success":{let t=r.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:r.url,status:r.response?.status??200,body:t?JSON.parse(t):void 0}),l?.abort?.(),n();break}case"error":{let{message:e}=r.error;throw Object.assign(Error(e),{cause:r.error})}default:this.uppy.log(`Companion socket unknown action ${i}`,"warning")}}catch(e){i(e)}});let a=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(u),o&&o.close(),o=void 0};l.signal.addEventListener("abort",()=>{a()})});await c(t,{retries:10,signal:l.signal,onFailedAttempt:()=>{l.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(l.signal)}catch(e){if(l.signal.aborted)return;i(e)}},y=e=>{s.resumableUploads&&(d=e,o&&m())},v=t=>{s.individualCancellation&&t.id===e.id&&(f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),n())},b=()=>{f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),n()},_=(t,i)=>{t?.id===e.id&&y(i)},w=()=>y(!0),P=()=>y(!1);this.uppy.on("file-removed",v),this.uppy.on("cancel-all",b),this.uppy.on("upload-pause",_),this.uppy.on("pause-all",w),this.uppy.on("resume-all",P),r=()=>{this.uppy.off("file-removed",v),this.uppy.off("cancel-all",b),this.uppy.off("upload-pause",_),this.uppy.off("pause-all",w),this.uppy.off("resume-all",P)},i.addEventListener("abort",()=>{l?.abort()}),g()})}finally{r?.()}}}var b=i(81374);class _{#p;#h=[];constructor(e){this.#p=e}on(e,t){return this.#h.push([e,t]),this.#p.on(e,t)}remove(){for(let[e,t]of this.#h.splice(0))this.#p.off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#p.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#p.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{this.#p.getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#p.getFile(e)&&t()})}}let{AbortController:w}=globalThis,{AbortSignal:P}=globalThis,C=(e="Aborted",t)=>{let i=new DOMException(e,"AbortError");return null!=t&&r(t,"cause")&&Object.defineProperty(i,"cause",{__proto__:null,configurable:!0,writable:!0,value:t.cause}),i};function S(e,t){return!0===e?Object.keys(t):Array.isArray(e)?e:[]}function k(e){if(null!=e){let t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});let i=()=>{e.removeEventListener("abort",t)};this.then?.(i,i)}return this}class F{#d=0;#c=[];#f=!1;#m;#g=1;#y;#v;limit;constructor(e){"number"!=typeof e||0===e?this.limit=1/0:this.limit=e}#b(e){let t;this.#d+=1;let i=!1;try{t=e()}catch(e){throw this.#d-=1,e}return{abort:e=>{i||(i=!0,this.#d-=1,t?.(e),this.#_())},done:()=>{i||(i=!0,this.#d-=1,this.#_())}}}#_(){queueMicrotask(()=>this.#w())}#w(){if(this.#f||this.#d>=this.limit||0===this.#c.length)return;let e=this.#c.shift();if(null==e)throw Error("Invariant violation: next is null");let t=this.#b(e.fn);e.abort=t.abort,e.done=t.done}#P(e,t){let i={fn:e,priority:t?.priority||0,abort:()=>{this.#C(i)},done:()=>{throw Error("Cannot mark a queued request as done: this indicates a bug")}},r=this.#c.findIndex(e=>i.priority>e.priority);return -1===r?this.#c.push(i):this.#c.splice(r,0,i),i}#C(e){let t=this.#c.indexOf(e);-1!==t&&this.#c.splice(t,1)}run(e,t){return!this.#f&&this.#d<this.limit?this.#b(e):this.#P(e,t)}wrapSyncFunction(e,t){return(...i)=>{let r=this.run(()=>(e(...i),queueMicrotask(()=>r.done()),()=>{}),t);return{abortOn:k,abort(){r.abort()}}}}wrapPromiseFunction(e,t){return(...i)=>{let r;let s=new Promise((s,n)=>{r=this.run(()=>{let t,a;try{a=Promise.resolve(e(...i))}catch(e){a=Promise.reject(e)}return a.then(e=>{t?n(t):(r.done(),s(e))},e=>{t?n(t):(r.done(),n(e))}),e=>{t=Error("Cancelled",{cause:e})}},t)});return s.abort=e=>{r.abort(e)},s.abortOn=k,s}}resume(){this.#f=!1,clearTimeout(this.#m);for(let e=0;e<this.limit;e++)this.#_()}#S=()=>this.resume();pause(e=null){this.#f=!0,clearTimeout(this.#m),null!=e&&(this.#m=setTimeout(this.#S,e))}rateLimit(e){clearTimeout(this.#v),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#y=this.limit-1,this.limit=this.#g,this.#v=setTimeout(this.#k,e))}#k=()=>{if(this.#f){this.#v=setTimeout(this.#k,0);return}this.#g=this.limit,this.limit=Math.ceil((this.#y+this.#g)/2);for(let e=this.#g;e<=this.limit;e++)this.#_();this.#y-this.#g>3?this.#v=setTimeout(this.#k,2e3):this.#g=Math.floor(this.#g/2)};get isPaused(){return this.#f}}Symbol("__queue");let T={i8:"4.3.1"},E=new TextEncoder,x={name:"HMAC",hash:"SHA-256"};async function I(e){let{subtle:t}=globalThis.crypto;return t.digest(x.hash,E.encode(e))}async function D(e){let{subtle:t}=globalThis.crypto;return t.importKey("raw","string"==typeof e?E.encode(e):e,x,!1,["sign"])}function A(e){let t=new Uint8Array(e),i="";for(let e=0;e<t.length;e++)i+=t[e].toString(16).padStart(2,"0");return i}async function O(e,t){let{subtle:i}=globalThis.crypto;return i.sign(x,await D(e),E.encode(t))}async function U({accountKey:e,accountSecret:t,sessionToken:i,bucketName:r,Key:s,Region:n,expires:a,uploadId:o,partNumber:l}){let u=`s3.${n}.amazonaws.com`,p=`/${r}/${encodeURI(s).replace(/[;?:@&=+$,#!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}`,h="UNSIGNED-PAYLOAD",d=new Date().toISOString().replace(/[-:]|\.\d+/g,""),c=d.slice(0,8),f=`${c}/${n}/s3/aws4_request`,m=new URL(`https://${u}${p}`);m.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),m.searchParams.set("X-Amz-Content-Sha256",h),m.searchParams.set("X-Amz-Credential",`${e}/${f}`),m.searchParams.set("X-Amz-Date",d),m.searchParams.set("X-Amz-Expires",a),m.searchParams.set("X-Amz-Security-Token",i),m.searchParams.set("X-Amz-SignedHeaders","host"),l&&m.searchParams.set("partNumber",l),o&&m.searchParams.set("uploadId",o),m.searchParams.set("x-id",l&&o?"UploadPart":"PutObject");let g=function({method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:r,HashedPayload:s}){let n=Object.keys(r).map(e=>e.toLowerCase()).sort();return[e,t,i,...n.map(e=>`${e}:${r[e]}`),"",n.join(";"),s].join("\n")}({CanonicalUri:p,CanonicalQueryString:m.search.slice(1),SignedHeaders:{host:u},HashedPayload:h}),y=["AWS4-HMAC-SHA256",d,f,A(await I(g))].join("\n"),v=await O(`AWS4${t}`,c),b=await O(v,n),_=await O(b,"s3"),w=await O(_,"aws4_request"),P=A(await O(w,y));return m.searchParams.set("X-Amz-Signature",P),m}let N={getChunkSize:e=>Math.ceil(e.size/1e4),onProgress(){},onPartComplete(){},onSuccess(){},onError(e){throw e}},M=Symbol("pausing upload, not an actual error");class R{options;#F=new w;#T=[];#E=[];#x;#I;#D=!1;#A;#O;#U;#N;#M=e=>e?.cause===M?null:this.#A(e);#R=1e4;#B=5242880;constructor(e,t){this.options={...N,...t},this.options.getChunkSize??=N.getChunkSize,this.#x=e,this.#I=t.file,this.#O=this.options.onSuccess,this.#A=this.options.onError,this.#U=this.options.shouldUseMultipart,this.#N=t.uploadId&&t.key,this.#L()}#L(){let e=this.#x.size,t="function"==typeof this.#U?this.#U(this.#I):!!this.#U;if(t&&e>this.#B){let i=Math.max(this.options.getChunkSize(this.#x),this.#B),r=Math.floor(e/i);r>this.#R&&(r=this.#R,i=e/this.#R),this.#T=Array(r);for(let r=0,s=0;r<e;r+=i,s++){let n=Math.min(e,r+i),a=()=>{let e=r;return this.#x.slice(e,n)};if(this.#T[s]={getData:a,onProgress:this.#z(s),onComplete:this.#q(s),shouldUseMultipart:t},this.#N){let t=r+i>e?e-r:i;this.#T[s].setAsUploaded=()=>{this.#T[s]=null,this.#E[s].uploaded=t}}}}else this.#T=[{getData:()=>this.#x,onProgress:this.#z(0),onComplete:this.#q(0),shouldUseMultipart:t}];this.#E=this.#T.map(()=>({uploaded:0}))}#H(){this.options.companionComm.uploadFile(this.#I,this.#T,this.#F.signal).then(this.#O,this.#M),this.#D=!0}#$(){this.options.companionComm.resumeUploadFile(this.#I,this.#T,this.#F.signal).then(this.#O,this.#M)}#z=e=>t=>{if(!t.lengthComputable)return;this.#E[e].uploaded=function(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw TypeError("Expected a number")}(t.loaded);let i=this.#E.reduce((e,t)=>e+t.uploaded,0);this.options.onProgress(i,this.#x.size)};#q=e=>t=>{this.#T[e]=null,this.#E[e].etag=t,this.#E[e].done=!0,this.options.onPartComplete({PartNumber:e+1,ETag:t})};#V(){this.#F.abort(),this.options.companionComm.abortFileUpload(this.#I).catch(e=>this.options.log(e))}start(){this.#D?(this.#F.signal.aborted||this.#F.abort(M),this.#F=new w,this.#$()):this.#N?(this.options.companionComm.restoreUploadFile(this.#I,{uploadId:this.options.uploadId,key:this.options.key}),this.#$()):this.#H()}pause(){this.#F.abort(M),this.#F=new w}abort(e){e?.really?this.#V():this.pause()}[Symbol.for("uppy test: getChunkState")](){return this.#E}}function B(e){if(e?.aborted)throw C("The operation was aborted",{cause:e.reason})}class L{#j;#W=new WeakMap;#G;#K;#X;#Z;#Q;#Y;#J;#ee;#et;#ei;#er;constructor(e,t,i,r){this.#Y=e,this.#et=i,this.#er=r,this.setOptions(t)}setOptions(e){let t=this.#Y;"abortMultipartUpload"in e&&(this.#j=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(this.#G=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(this.#K=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(this.#Z=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(this.#ee=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e&&(this.#J=e.retryDelays??[]),"uploadPartBytes"in e&&(this.#ei=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(this.#X=t.wrapPromiseFunction(e.getUploadParameters))}async #es(e,t){let i=this.#Y,r=e?.source?.status;if(null==r)return!1;if(403===r&&"Request has expired"===e.message){if(!i.isPaused){if(1===i.limit||null==this.#Q){let e=t.next();if(null==e||e.done)return!1;this.#Q=e.value}i.rateLimit(0),await new Promise(e=>setTimeout(e,this.#Q))}}else if(429===r){if(!i.isPaused){let e=t.next();if(null==e||e.done)return!1;i.rateLimit(e.value)}}else if(r>400&&r<500&&409!==r)return!1;else if("undefined"!=typeof navigator&&!1===navigator.onLine)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.resume()},{once:!0}));else{let e=t.next();if(null==e||e.done)return!1;await new Promise(t=>setTimeout(t,e.value))}return!0}async getUploadId(e,t){let i;for(;null!=(i=this.#W.get(e.data));)try{return await i}catch{}let r=this.#G(this.#er(e),t),s=()=>{r.abort(t.reason),this.#W.delete(e.data)};return t.addEventListener("abort",s,{once:!0}),this.#W.set(e.data,r),r.then(async i=>{t.removeEventListener("abort",s),this.#et(e,i),this.#W.set(e.data,i)},()=>{t.removeEventListener("abort",s),this.#W.delete(e.data)}),r}async abortFileUpload(e){let t;let i=this.#W.get(e.data);if(null!=i){this.#W.delete(e.data),this.#et(e,Object.create(null));try{t=await i}catch{return}await this.#j(this.#er(e),t)}}async #en(e,t,i){let r;let{method:s="POST",url:n,fields:a,headers:o}=await this.#X(this.#er(e),{signal:i}).abortOn(i),l=t.getData();if("POST"===s.toUpperCase()){let e=new FormData;Object.entries(a).forEach(([t,i])=>e.set(t,i)),e.set("file",l),r=e}else r=l;let{onProgress:u,onComplete:p}=t,h=await this.#ei({signature:{url:n,headers:o,method:s},body:r,size:l.size,onProgress:u,onComplete:p,signal:i}).abortOn(i),d=a?.key;return this.#et(e,{key:d}),{...h,location:h.location??function(e){let t=new URL(e);return t.search="",t.hash="",t.href}(n),bucket:a?.bucket,key:d}}async uploadFile(e,t,i){if(B(i),1===t.length&&!t[0].shouldUseMultipart)return this.#en(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);B(i);try{let n=await Promise.all(t.map((t,r)=>this.uploadChunk(e,r+1,t,i)));return B(i),await this.#ee(this.#er(e),{key:s,uploadId:r,parts:n,signal:i},i).abortOn(i)}catch(t){throw t?.cause!==M&&t?.name!=="AbortError"&&this.abortFileUpload(e),t}}restoreUploadFile(e,t){this.#W.set(e.data,t)}async resumeUploadFile(e,t,i){if(B(i),1===t.length&&null!=t[0]&&!t[0].shouldUseMultipart)return this.#en(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);B(i);let n=await this.#Z(this.#er(e),{uploadId:r,key:s,signal:i},i).abortOn(i);B(i);let a=await Promise.all(t.map((t,r)=>{let s=r+1,a=n.find(({PartNumber:e})=>e===s);return null==a?this.uploadChunk(e,s,t,i):(t?.setAsUploaded?.(),{PartNumber:s,ETag:a.ETag})}));return B(i),this.#ee(this.#er(e),{key:s,uploadId:r,parts:a,signal:i},i).abortOn(i)}async uploadChunk(e,t,i,r){B(r);let{uploadId:s,key:n}=await this.getUploadId(e,r),a=this.#J.values(),o=this.#J.values(),l=()=>{let e=a.next();return null==e||e.done?null:e.value};for(;;){let a;B(r);let u=i.getData(),{onProgress:p,onComplete:h}=i;try{a=await this.#K(this.#er(e),{uploadId:s,key:n,partNumber:t,body:u,signal:r}).abortOn(r)}catch(t){let e=l();if(null==e||r.aborted)throw t;await new Promise(t=>setTimeout(t,e));continue}B(r);try{return{PartNumber:t,...await this.#ei({signature:a,body:u,size:u.size,onProgress:p,onComplete:h,signal:r}).abortOn(r)}}catch(e){if(!await this.#es(e,o))throw e}}}}function z(e){if(e?.error){let t=Error(e.message);throw Object.assign(t,e.error),t}return e}function q(e){let t=e.Expiration;if(t){let e=Math.floor((new Date(t)-Date.now())/1e3);if(e>9)return e}}function H({meta:e,allowedMetaFields:t,querify:i=!1}){let r=t??Object.keys(e);return e?Object.fromEntries(r.filter(t=>null!=e[t]).map(t=>[i?`metadata[${t}]`:t,String(e[t])])):{}}let $={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:e=>(e.size||0)>104857600,retryDelays:[0,1e3,3e3,5e3]};class V extends b.Z{static VERSION=T.i8;#ea;#e;requests;uploaderEvents;uploaders;constructor(e,t){super(e,{...$,uploadPartBytes:V.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.#eo(t);let i={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t?.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t?.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(let e of Object.keys(i))null==this.opts[e]&&(this.opts[e]=i[e].bind(this));this.requests=this.opts.rateLimitedQueue??new F(this.opts.limit),this.#ea=new L(this.requests,this.opts,this.#et,this.#er),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}[Symbol.for("uppy test: getClient")](){return this.#e}#eo(e){null!=e&&("endpoint"in e||"companionUrl"in e||"headers"in e||"companionHeaders"in e||"cookiesRule"in e||"companionCookiesRule"in e)&&("companionUrl"in e&&!("endpoint"in e)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in e&&!("headers"in e)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in e&&!("cookiesRule"in e)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in e?this.#e=new v(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in e&&this.#el(),"cookiesRule"in e&&(this.#e.opts.companionCookiesRule=e.cookiesRule)))}setOptions(e){this.#ea.setOptions(e),super.setOptions(e),this.#eo(e)}resetUploaderReferences(e,t){this.uploaders[e]&&(this.uploaders[e].abort({really:t?.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}#eu(e){if(!this.#e)throw Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${e}\` implementation.`)}createMultipartUpload(e,t){this.#eu("createMultipartUpload"),B(t);let i=S(this.opts.allowedMetaFields,e.meta),r=H({meta:e.meta,allowedMetaFields:i});return this.#e.post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(z)}listParts(e,{key:t,uploadId:i,signal:r},s){r??=s,this.#eu("listParts"),B(r);let n=encodeURIComponent(t);return this.#e.get(`s3/multipart/${encodeURIComponent(i)}?key=${n}`,{signal:r}).then(z)}completeMultipartUpload(e,{key:t,uploadId:i,parts:r,signal:s},n){s??=n,this.#eu("completeMultipartUpload"),B(s);let a=encodeURIComponent(t),o=encodeURIComponent(i);return this.#e.post(`s3/multipart/${o}/complete?key=${a}`,{parts:r.map(({ETag:e,PartNumber:t})=>({ETag:e,PartNumber:t}))},{signal:s}).then(z)}#ep;async #eh(e){if(B(e?.signal),null==this.#ep){let{getTemporarySecurityCredentials:t}=this.opts;!0===t?(this.#eu("getTemporarySecurityCredentials"),this.#ep=this.#e.get("s3/sts",e).then(z)):this.#ep=t(e),this.#ep=await this.#ep,setTimeout(()=>{this.#ep=null},500*(q(this.#ep.credentials)||0))}return this.#ep}async createSignedURL(e,t){let i=await this.#eh(t),r=q(i.credentials)||604800,{uploadId:s,key:n,partNumber:a}=t;return{method:"PUT",expires:r,fields:{},url:`${await U({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:r,bucketName:i.bucket,Region:i.region,Key:n??`${crypto.randomUUID()}-${e.name}`,uploadId:s,partNumber:a})}`,headers:{"Content-Type":e.type}}}signPart(e,{uploadId:t,key:i,partNumber:r,signal:s}){if(this.#eu("signPart"),B(s),null==t||null==i||null==r)throw Error("Cannot sign without a key, an uploadId, and a partNumber");let n=encodeURIComponent(i);return this.#e.get(`s3/multipart/${encodeURIComponent(t)}/${r}?key=${n}`,{signal:s}).then(z)}abortMultipartUpload(e,{key:t,uploadId:i,signal:r}){this.#eu("abortMultipartUpload");let s=encodeURIComponent(t),n=encodeURIComponent(i);return this.#e.delete(`s3/multipart/${n}?key=${s}`,void 0,{signal:r}).then(z)}getUploadParameters(e,t){this.#eu("getUploadParameters");let{meta:i}=e,{type:r,name:s}=i,n=new URLSearchParams({filename:s,type:r,...H({meta:i,allowedMetaFields:S(this.opts.allowedMetaFields,e.meta),querify:!0})});return this.#e.get(`s3/params?${n}`,t)}static async uploadPartBytes({signature:{url:e,expires:t,headers:i,method:r="PUT"},body:s,size:n=s.size,onProgress:a,onComplete:o,signal:l}){if(B(l),null==e)throw Error("Cannot upload to an undefined URL");return new Promise((u,p)=>{let h=new XMLHttpRequest;function d(){h.abort()}function c(){l?.removeEventListener("abort",d)}h.open(r,e,!0),i&&Object.keys(i).forEach(e=>{h.setRequestHeader(e,i[e])}),h.responseType="text","number"==typeof t&&(h.timeout=1e3*t),l?.addEventListener("abort",d),h.upload.addEventListener("progress",e=>{a(e)}),h.addEventListener("abort",()=>{c(),p(C())}),h.addEventListener("timeout",()=>{c();let e=Error("Request has expired");e.source={status:403},p(e)}),h.addEventListener("load",()=>{if(c(),403===h.status&&h.responseText.includes("<Message>Request has expired</Message>")){let e=Error("Request has expired");e.source=h,p(e);return}if(h.status<200||h.status>=300){let e=Error("Non 2xx");e.source=h,p(e);return}a?.({loaded:n,lengthComputable:!0});let e=h.getAllResponseHeaders().trim().split(/[\r\n]+/),t={__proto__:null};for(let i of e){let e=i.split(": "),r=e.shift(),s=e.join(": ");t[r]=s}let{etag:i,location:s}=t;if("POST"===r.toUpperCase()&&null==s&&console.error("@uppy/aws-s3: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket"),null==i){console.error("@uppy/aws-s3: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket");return}o?.(i),u({...t,ETag:i})}),h.addEventListener("error",e=>{c();let t=Error("Unknown error");t.source=e.target,p(t)}),h.send(s)})}#et=(e,{key:t,uploadId:i})=>{let r=this.uppy.getFile(e.id);null!=r&&this.uppy.setFileState(e.id,{s3Multipart:{...r.s3Multipart,key:t,uploadId:i}})};#er=e=>this.uppy.getFile(e.id)||e;#ed(e){return new Promise((t,i)=>{let r=new R(e.data,{companionComm:this.#ea,log:(...e)=>this.uppy.log(...e),getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:(t,i)=>{let r=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",r,{uploadStarted:r.progress.uploadStarted??0,bytesUploaded:t,bytesTotal:i})},onError:t=>{this.uppy.log(t),this.uppy.emit("upload-error",e,t),this.resetUploaderReferences(e.id),i(t)},onSuccess:i=>{let r={body:{...i},status:200,uploadURL:i.location};this.resetUploaderReferences(e.id),this.uppy.emit("upload-success",this.#er(e),r),i.location&&this.uppy.log(`Download ${e.name} from ${i.location}`),t(void 0)},onPartComplete:t=>{this.uppy.emit("s3-multipart:part-uploaded",this.#er(e),t)},file:e,shouldUseMultipart:this.opts.shouldUseMultipart,...e.s3Multipart});this.uploaders[e.id]=r;let s=new _(this.uppy);this.uploaderEvents[e.id]=s,s.onFileRemove(e.id,i=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${i} was removed`)}),s.onCancelAll(e.id,()=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${e.id} was canceled`)}),s.onFilePause(e.id,e=>{e?r.pause():r.start()}),s.onPauseAll(e.id,()=>{r.pause()}),s.onResumeAll(e.id,()=>{r.start()}),r.start()})}#ec(e){return{...e.remote?.body,protocol:"s3-multipart",size:e.data.size,metadata:e.meta}}#ef=async e=>{if(0===e.length)return;let t=function(e){let t=e=>"error"in e&&!!e.error;return e.filter(e=>!t(e))}(this.uppy.getFilesByIds(e)),i=t.filter(e=>!e.progress?.uploadStarted||!e.isRestored);this.uppy.emit("upload-start",i);let r=t.map(e=>{if(e.isRemote){this.#em(!1);let t=new AbortController,i=i=>{i.id===e.id&&t.abort()};this.uppy.on("file-removed",i);let r=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,this.#ec(e),{signal:t.signal,getQueue:()=>this.requests});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",i)},{priority:-1})(),r}return this.#ed(e)}),s=await Promise.allSettled(r);return this.#em(!0),s};#el=()=>{this.#e?.setCompanionHeaders(this.opts.headers)};#em=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,resumableUploads:e}})};#eg=()=>{this.#em(!0)};install(){this.#em(!0),this.uppy.addPreProcessor(this.#el),this.uppy.addUploader(this.#ef),this.uppy.on("cancel-all",this.#eg)}uninstall(){this.uppy.removePreProcessor(this.#el),this.uppy.removeUploader(this.#ef),this.uppy.off("cancel-all",this.#eg)}}},81374:(e,t,i)=>{"use strict";function r(e,t){let i=/\$/g,r=[e];if(null==t)return r;for(let e of Object.keys(t))if("_"!==e){let s=t[e];"string"==typeof s&&(s=i[Symbol.replace](s,"$$$$")),r=function(e,t,i){let r=[];return e.forEach(e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,s)=>{""!==e&&r.push(e),t<s.length-1&&r.push(i)})),r}(r,RegExp(`%\\{${e}\\}`,"g"),s)}return r}i.d(t,{Z:()=>a});let s=e=>{throw Error(`missing string: ${e}`)};class n{locale;constructor(e,{onMissingKey:t=s}={}){this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(this.#ey,this):this.#ey(e),this.#ev=t}#ev;#ey(e){if(!e?.strings)return;let t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&(this.#ev(e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return r(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw Error("string was not a string");return r(i,t)}}class a{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new n([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 Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}},84714:(e,t,i)=>{"use strict";function r(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}i.d(t,{A:()=>si});let s=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir};var n,a,o,l,u,p,h,d,c,f,m={},g=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function b(e,t){for(var i in t)e[i]=t[i];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,i){var r,s,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?s=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return P(e,o,r,s,null)}function P(e,t,i,r,s){var n={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=a.vnode&&a.vnode(n),n}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?k(e):null}function F(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!T.__r++||u!==a.debounceRendering)&&((u=a.debounceRendering)||p)(T)}function T(){var e,t,i,r,s,n,o,u;for(l.sort(h);e=l.shift();)e.__d&&(t=l.length,r=void 0,n=(s=(i=e).__v).__e,o=[],u=[],i.__P&&((r=b({},s)).__v=s.__v+1,a.vnode&&a.vnode(r),O(i.__P,r,s,i.__n,i.__P.namespaceURI,32&s.__u?[n]:null,o,null==n?k(s):n,!!(32&s.__u),u),r.__v=s.__v,r.__.__k[r.__i]=r,U(o,r,u),r.__e!=n&&function e(t){var i,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(r=t.__k[i])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)),l.length>t&&l.sort(h));T.__r=0}function E(e,t,i,r,s,n,o,l,u,p,h){var d,c,f,y,b,w=r&&r.__k||g,S=t.length;for(i.__d=u,function(e,t,i){var r,s,n,o,l,u=t.length,p=i.length,h=p,d=0;for(e.__k=[],r=0;r<u;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(o=r+d,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?P(null,s,null,null,null):v(s)?P(C,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?P(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,n=null,-1!==(l=s.__i=function(e,t,i,r){var s=e.key,n=e.type,a=i-1,o=i+1,l=t[i];if(null===l||l&&s==l.key&&n===l.type&&0==(131072&l.__u))return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return a;a--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return o;o++}}return -1}(s,i,o,h))&&(h--,(n=i[l])&&(n.__u|=131072)),null==n||null===n.__v?(-1==l&&d--,"function"!=typeof s.type&&(s.__u|=65536)):l!==o&&(l==o-1?d--:l==o+1?d++:(l>o?d--:d++,s.__u|=65536))):s=e.__k[r]=null;if(h)for(r=0;r<p;r++)null!=(n=i[r])&&0==(131072&n.__u)&&(n.__e==e.__d&&(e.__d=k(n)),function e(t,i,r){var s,n;if(a.unmount&&a.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||N(s,null,i)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){a.__e(e,i)}s.base=s.__P=null}if(s=t.__k)for(n=0;n<s.length;n++)s[n]&&e(s[n],i,r||"function"!=typeof t.type);r||_(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(n,n))}(i,t,w),u=i.__d,d=0;d<S;d++)null!=(f=i.__k[d])&&(c=-1===f.__i?m:w[f.__i]||m,f.__i=d,O(e,f,c,s,n,o,l,u,p,h),y=f.__e,f.ref&&c.ref!=f.ref&&(c.ref&&N(c.ref,null,f),h.push(f.ref,f.__c||y,f)),null==b&&null!=y&&(b=y),65536&f.__u||c.__k===f.__k?u=function e(t,i,r){var s,n;if("function"==typeof t.type){for(s=t.__k,n=0;s&&n<s.length;n++)s[n]&&(s[n].__=t,i=e(s[n],i,r));return i}t.__e!=i&&(i&&t.type&&!r.contains(i)&&(i=k(t)),r.insertBefore(t.__e,i||null),i=t.__e);do i=i&&i.nextSibling;while(null!=i&&8===i.nodeType);return i}(f,u,e):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:y&&(u=y.nextSibling),f.__d=void 0,f.__u&=-196609);i.__d=u,i.__e=b}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){x(e,t)}):t.push(e)),t}function I(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||y.test(t)?i:i+"px"}function D(e,t,i,r,s){var n;e:if("style"===t){if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||I(e.style,t,"");if(i)for(t in i)r&&i[t]===r[t]||I(e.style,t,i[t])}}else if("o"===t[0]&&"n"===t[1])n=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=i,i?r?i.u=r.u:(i.u=d,e.addEventListener(t,n?f:c,n)):e.removeEventListener(t,n?f:c,n);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function A(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<i.u)return;return i(a.event?a.event(t):t)}}}function O(e,t,i,r,s,o,l,u,p,h){var d,c,f,g,y,w,P,F,T,x,I,A,O,U,N,R,B=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(p=!!(32&i.__u),o=[u=t.__e=i.__e]),(d=a.__b)&&d(t);e:if("function"==typeof B)try{if(F=t.props,T="prototype"in B&&B.prototype.render,x=(d=B.contextType)&&r[d.__c],I=d?x?x.props.value:d.__:r,i.__c?P=(c=t.__c=i.__c).__=c.__E:(T?t.__c=c=new B(F,I):(t.__c=c=new S(F,I),c.constructor=B,c.render=M),x&&x.sub(c),c.props=F,c.state||(c.state={}),c.context=I,c.__n=r,f=c.__d=!0,c.__h=[],c._sb=[]),T&&null==c.__s&&(c.__s=c.state),T&&null!=B.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=b({},c.__s)),b(c.__s,B.getDerivedStateFromProps(F,c.__s))),g=c.props,y=c.state,c.__v=t,f)T&&null==B.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),T&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(T&&null==B.getDerivedStateFromProps&&F!==g&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(F,I),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(F,c.__s,I)||t.__v===i.__v)){for(t.__v!==i.__v&&(c.props=F,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),A=0;A<c._sb.length;A++)c.__h.push(c._sb[A]);c._sb=[],c.__h.length&&l.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(F,c.__s,I),T&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(g,y,w)})}if(c.context=I,c.props=F,c.__P=e,c.__e=!1,O=a.__r,U=0,T){for(c.state=c.__s,c.__d=!1,O&&O(t),d=c.render(c.props,c.state,c.context),N=0;N<c._sb.length;N++)c.__h.push(c._sb[N]);c._sb=[]}else do c.__d=!1,O&&O(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++U<25);c.state=c.__s,null!=c.getChildContext&&(r=b(b({},r),c.getChildContext())),T&&!f&&null!=c.getSnapshotBeforeUpdate&&(w=c.getSnapshotBeforeUpdate(g,y)),E(e,v(R=null!=d&&d.type===C&&null==d.key?d.props.children:d)?R:[R],t,i,r,s,o,l,u,p,h),c.base=t.__e,t.__u&=-161,c.__h.length&&l.push(c),P&&(c.__E=c.__=null)}catch(e){if(t.__v=null,p||null!=o){for(t.__u|=p?160:128;u&&8===u.nodeType&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u}else t.__e=i.__e,t.__k=i.__k;a.__e(e,t,i)}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,r,s,o,l,u,p){var h,d,c,f,g,y,b,w=i.props,P=t.props,C=t.type;if("svg"===C?s="http://www.w3.org/2000/svg":"math"===C?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=o){for(h=0;h<o.length;h++)if((g=o[h])&&"setAttribute"in g==!!C&&(C?g.localName===C:3===g.nodeType)){e=g,o[h]=null;break}}if(null==e){if(null===C)return document.createTextNode(P);e=document.createElementNS(s,C,P.is&&P),u&&(a.__m&&a.__m(t,o),u=!1),o=null}if(null===C)w===P||u&&e.data===P||(e.data=P);else{if(o=o&&n.call(e.childNodes),w=i.props||m,!u&&null!=o)for(w={},h=0;h<e.attributes.length;h++)w[(g=e.attributes[h]).name]=g.value;for(h in w)if(g=w[h],"children"==h);else if("dangerouslySetInnerHTML"==h)c=g;else if(!(h in P)){if("value"==h&&"defaultValue"in P||"checked"==h&&"defaultChecked"in P)continue;D(e,h,null,g,s)}for(h in P)g=P[h],"children"==h?f=g:"dangerouslySetInnerHTML"==h?d=g:"value"==h?y=g:"checked"==h?b=g:u&&"function"!=typeof g||w[h]===g||D(e,h,g,w[h],s);if(d)u||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),E(e,v(f)?f:[f],t,i,r,"foreignObject"===C?"http://www.w3.org/1999/xhtml":s,o,l,o?o[0]:i.__k&&k(i,0),u,p),null!=o)for(h=o.length;h--;)_(o[h]);u||(h="value","progress"===C&&null==y?e.removeAttribute("value"):void 0===y||y===e[h]&&("progress"!==C||y)&&("option"!==C||y===w[h])||D(e,h,y,w[h],s),h="checked",void 0!==b&&b!==e[h]&&D(e,h,b,w[h],s))}return e}(i.__e,t,i,r,s,o,l,p,h);(d=a.diffed)&&d(t)}function U(e,t,i){t.__d=void 0;for(var r=0;r<i.length;r++)N(i[r],i[++r],i[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function N(e,t,i){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,i)}}function M(e,t,i){return this.constructor(e,i)}function R(e,t,i){var r,s,a,o,l=b({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?s=t[a]:l[a]=void 0===t[a]&&void 0!==o?o[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):i),P(e.type,l,r||e.key,s||e.ref,null)}n=g.slice,a={__e:function(e,t,i,r){for(var s,n,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&null!=n.getDerivedStateFromError&&(s.setState(n.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},o=0,S.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=b({},this.state),"function"==typeof e&&(e=e(b({},i),this.props)),e&&b(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),F(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),F(this))},S.prototype.render=C,l=[],p="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,h=function(e,t){return e.__v.__b-t.__v.__b},T.__r=0,d=0,c=A(!1),f=A(!0);var B,L,z,q,H=0,$=[],V=a,j=V.__b,W=V.__r,G=V.diffed,K=V.__c,X=V.unmount,Z=V.__;function Q(e,t){V.__h&&V.__h(L,e,H||t),H=0;var i=L.__H||(L.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Y(e){return H=1,function(e,t,i){var r=Q(B++,2);if(r.t=e,!r.__c&&(r.__=[el(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=L,!L.u)){var s=function(e,t,i){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter(function(e){return!!e.__c});if(s.every(function(e){return!e.__N}))return!n||n.call(this,e,t,i);var a=!1;return s.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),!(!a&&r.__c.props===e)&&(!n||n.call(this,e,t,i))};L.u=!0;var n=L.shouldComponentUpdate,a=L.componentWillUpdate;L.componentWillUpdate=function(e,t,i){if(this.__e){var r=n;n=void 0,s(e,t,i),n=r}a&&a.call(this,e,t,i)},L.shouldComponentUpdate=s}return r.__N||r.__}(el,e)}function J(e,t){var i=Q(B++,3);!V.__s&&eo(i.__H,t)&&(i.__=e,i.i=t,L.__H.__h.push(i))}function ee(e){return H=5,et(function(){return{current:e}},[])}function et(e,t){var i=Q(B++,7);return eo(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function ei(e,t){return H=8,et(function(){return e},t)}function er(){for(var e;e=$.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(ea),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){L=null,j&&j(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Z&&Z(e,t)},V.__r=function(e){W&&W(e),B=0;var t=(L=e.__c).__H;t&&(z===L?(t.__h=[],L.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(ea),t.__h=[],B=0)),z=L},V.diffed=function(e){G&&G(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==$.push(t)&&q===V.requestAnimationFrame||((q=V.requestAnimationFrame)||function(e){var t,i=function(){clearTimeout(r),es&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,100);es&&(t=requestAnimationFrame(i))})(er)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),z=L=null},V.__c=function(e,t){t.some(function(e){try{e.__h.forEach(en),e.__h=e.__h.filter(function(e){return!e.__||ea(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],V.__e(i,e.__v)}}),K&&K(e,t)},V.unmount=function(e){X&&X(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(e){try{en(e)}catch(e){t=e}}),i.__H=void 0,t&&V.__e(t,i.__v))};var es="function"==typeof requestAnimationFrame;function en(e){var t=L,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),L=t}function ea(e){var t=L;e.__c=e.__(),L=t}function eo(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function el(e,t){return"function"==typeof t?t(e):t}function eu(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ep(e,t){this.props=e,this.context=t}(ep.prototype=new S).isPureReactComponent=!0,ep.prototype.shouldComponentUpdate=function(e,t){return eu(this.props,e)||eu(this.state,t)};var eh=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),eh&&eh(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var ed=a.__e;a.__e=function(e,t,i,r){if(e.then){for(var s,n=t;n=n.__;)if((s=n.__c)&&s.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),s.__c(e,t)}ed(e,t,i,r)};var ec=a.unmount;function ef(){this.__u=0,this.t=null,this.__b=null}function em(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function eg(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ec&&ec(e)},(ef.prototype=new S).__c=function(e,t){var i=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(i);var s=em(r.__v),n=!1,a=function(){n||(n=!0,i.__R=null,s?s(o):o())};i.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e,t=r.state.__a;r.__v.__k[0]=function e(t,i,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)}),t.__c&&t.__c.__P===i&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}(t,t.__c.__P,t.__c.__O)}for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ef.prototype.componentWillUnmount=function(){this.t=[]},ef.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,i,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var i in t)e[i]=t[i];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=i),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)})),t}(this.__b,i,r.__O=r.__P)}this.__b=null}var s=t.__a&&w(C,null,e.fallback);return s&&(s.__u&=-33),[w(C,null,t.__a?null:e.children),s]};var ey=function(e,t,i){if(++i[1]===i[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(i=e.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.u=i=i[2]}};(eg.prototype=new S).__a=function(e){var t=this,i=em(t.__v),r=t.o.get(e);return r[0]++,function(s){var n=function(){t.props.revealOrder?(r.push(s),ey(t,e,r)):s()};i?i(n):n()}},eg.prototype.render=function(e){this.u=null,this.o=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.o.set(t[i],this.u=[1,0,this.u]);return e.children},eg.prototype.componentDidUpdate=eg.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,i){ey(e,i,t)})};var ev="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,eb=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,e_=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ew=/[A-Z0-9]/g,eP="undefined"!=typeof document;function eC(e,t,i){var r,s,o,l,u,p,h;return null==t.__k&&(t.textContent=""),r=e,s=t,a.__&&a.__(r,s),u=(l=false,o&&o.__k||s.__k),p=[],h=[],O(s,r=(!l&&o||s).__k=w(C,null,[r]),u||m,m,s.namespaceURI,!l&&o?[o]:u?null:s.firstChild?n.call(s.childNodes):null,p,!l&&o?o:u?u.__e:s.firstChild,l,h),U(p,r,h),"function"==typeof i&&i(),e?e.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var eS=a.event;function ek(){}function eF(){return this.cancelBubble}function eT(){return this.defaultPrevented}a.event=function(e){return eS&&(e=eS(e)),e.persist=ek,e.isPropagationStopped=eF,e.isDefaultPrevented=eT,e.nativeEvent=e};var eE={enumerable:!1,configurable:!0,get:function(){return this.class}},ex=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,i=e.type,r={},s=-1===i.indexOf("-");for(var n in t){var a=t[n];if(!("value"===n&&"defaultValue"in t&&null==a||eP&&"children"===n&&"noscript"===i||"class"===n||"className"===n)){var o,l=n.toLowerCase();"defaultValue"===n&&"value"in t&&null==t.value?n="value":"download"===n&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?n="ondblclick":"onchange"!==l||"input"!==i&&"textarea"!==i||(o=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(o))?"onfocus"===l?n="onfocusin":"onblur"===l?n="onfocusout":e_.test(n)&&(n=l):l=n="oninput":s&&eb.test(n)?n=n.replace(ew,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[n=l]&&(n="oninputCapture"),r[n]=a}}"select"==i&&r.multiple&&Array.isArray(r.value)&&(r.value=x(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==i&&null!=r.defaultValue&&(r.value=x(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",eE)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ev,ex&&ex(e)};var eI=a.__r;a.__r=function(e){eI&&eI(e),e.__c};var eD=a.diffed;a.diffed=function(e){eD&&eD(e);var t=e.props,i=e.__e;null!=i&&"textarea"===e.type&&"value"in t&&t.value!==i.value&&(i.value=null==t.value?"":t.value)};var eA=i(81374);class eO extends eA.Z{#eb;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;return"function"==typeof e?.addTarget?(t=e)instanceof eO||console.warn(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:eO}})):"function"==typeof e&&this.uppy.iteratePlugins(i=>{i instanceof e&&(t=i)}),t}mount(e,t){let i=t.id,n=function(e,t=document){return"string"==typeof e?t.querySelector(e):r(e)?e:null}(e);if(n){var a;let t,r;this.isTargetDOMEl=!0;let o=document.createElement("div");return o.classList.add("uppy-Root"),this.#eb=(a=e=>{this.uppy.getPlugin(this.id)&&(eC(this.render(e,o),o),this.afterUpdate())},r=null,(...e)=>(t=e,r||(r=Promise.resolve().then(()=>(r=null,a(...t)))),r)),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),eC(this.render(this.uppy.getState(),o),o),this.el=o,n.appendChild(o),o.dir=this.opts.direction||s(o)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let l=`Invalid target option given to ${i}.`;throw"function"==typeof e?l+=" 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.":l+="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.",Error(l)}render(e,t){throw Error("Extend the render method to add your plugin to a DOM element")}update(e){null!=this.el&&this.#eb?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}let eU=eO;var eN=0;function eM(e,t,i,r,s,n){t||(t={});var o,l,u=t;"ref"in t&&(o=t.ref,delete t.ref);var p={type:e,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--eN,__i:-1,__u:0,__source:s,__self:n};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===u[l]&&(u[l]=o[l]);return a.vnode&&a.vnode(p),p}let eR={i8:"4.3.1"};class eB extends S{ref={current:null};componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){let{children:e}=this.props;return eM("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function eL(e){let t={};for(let s=0;s<e.length;s++)if(null!=e[s]){var i,r;t[i=e[s],r=s.toString(36),i?.key??r]=e[s]}return t}class ez extends S{constructor(e,t){super(e,t),this.refs={},this.state={children:eL(x(x(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t;let i=eL(x(e.children)||[]),r=this.state.children;for(t in this.setState(e=>({children:function(e,t){e=e||{},t=t||{};let i=i=>Object.hasOwn(t,i)?t[i]:e[i],r={},s=[];for(let i in e)Object.hasOwn(t,i)?s.length&&(r[i]=s,s=[]):s.push(i);let n={};for(let e in t){if(Object.hasOwn(r,e))for(let t=0;t<r[e].length;t++){let s=r[e][t];n[r[e][t]]=i(s)}n[e]=i(e)}for(let e=0;e<s.length;e++)n[s[e]]=i(s[e]);return n}(e.children,i)})),i)if(Object.hasOwn(i,t)){let e=r&&Object.hasOwn(r,t);i[t]&&e&&this.currentlyTransitioningKeys[t]?(this.keysToEnter.push(t),this.keysToAbortLeave.push(t)):!i[t]||e||this.currentlyTransitioningKeys[t]||this.keysToEnter.push(t)}for(t in r)if(Object.hasOwn(r,t)){let e=i&&Object.hasOwn(i,t);!r[t]||e||this.currentlyTransitioningKeys[t]||this.keysToLeave.push(t)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;let t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let i=eL(x(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{let t=Object.assign({},this.state.children);delete t[e],this.setState({children:t})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:s,transitionLeaveTimeout:n,transitionEnterTimeout:a,transitionAppearTimeout:o,component:l,...u},{children:p}){return w(l,u,Object.entries(p).map(([t,i])=>{if(!i)return;let r=function(e,t){let i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return R(e(i),{ref:r,key:t})}).filter(Boolean))}}ez.defaultProps={component:"span",childFactory:e=>e};class eq extends eU{static VERSION=eR.i8;constructor(e,t){super(e,t),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}render=e=>eM("div",{className:"uppy uppy-Informer",children:eM(ez,{children:e.info.map(e=>eM(eB,{children:eM("p",{role:"alert",children:[e.message," ",e.details&&eM("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message}
1
+ exports.id=9874,exports.ids=[9874],exports.modules={4354:e=>{"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=Math.abs(e);if(e<0&&(t=-t),0===t)return"0 B";let i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),n=Number(t/1024**r),s=i[r];return`${n>=10||n%1==0?Math.round(n):n.toFixed(1)} ${s}`}},76245:(e,t,i)=>{var r=i(39288).Symbol;e.exports=r},1534:(e,t,i)=>{var r=i(76245),n=i(34244),s=i(13390),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?n(e):s(e)}},37192:(e,t,i)=>{var r=i(5587),n=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(n,""):e}},37611:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},34244:(e,t,i)=>{var r=i(76245),n=Object.prototype,s=n.hasOwnProperty,a=n.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,o),i=e[o];try{e[o]=void 0;var r=!0}catch(e){}var n=a.call(e);return r&&(t?e[o]=i:delete e[o]),n}},13390:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},39288:(e,t,i)=>{var r=i(37611),n="object"==typeof self&&self&&self.Object===Object&&self,s=r||n||Function("return this")();e.exports=s},5587:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},19788:(e,t,i)=>{var r=i(62880),n=i(22695),s=i(41309),a=Math.max,o=Math.min;e.exports=function(e,t,i){var l,u,p,d,h,c,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var i=l,r=u;return l=u=void 0,f=t,d=e.apply(r,i)}function b(e){var i=e-c,r=e-f;return void 0===c||i>=t||i<0||g&&r>=p}function _(){var e,i,r,s=n();if(b(s))return w(s);h=setTimeout(_,(e=s-c,i=s-f,r=t-e,g?o(r,p-i):r))}function w(e){return(h=void 0,y&&l)?v(e):(l=u=void 0,d)}function C(){var e,i=n(),r=b(i);if(l=arguments,u=this,c=i,r){if(void 0===h)return f=e=c,h=setTimeout(_,t),m?v(e):d;if(g)return clearTimeout(h),h=setTimeout(_,t),v(c)}return void 0===h&&(h=setTimeout(_,t)),d}return t=s(t)||0,r(i)&&(m=!!i.leading,p=(g="maxWait"in i)?a(s(i.maxWait)||0,t):p,y="trailing"in i?!!i.trailing:y),C.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=c=u=h=void 0},C.flush=function(){return void 0===h?d:w(n())},C}},62880:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},91380:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},76871:(e,t,i)=>{var r=i(1534),n=i(91380);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==r(e)}},22695:(e,t,i)=>{var r=i(39288);e.exports=function(){return r.Date.now()}},41309:(e,t,i)=>{var r=i(37192),n=i(62880),s=i(76871),a=0/0,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,p=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=l.test(e);return i||u.test(e)?p(e.slice(2),i?2:8):o.test(e)?a:+e}},11890:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},31540:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},15557:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FilePlus",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"12",x2:"12",y1:"18",y2:"12",key:"1tsf04"}],["line",{x1:"9",x2:"15",y1:"15",y2:"15",key:"110plj"}]])},36283:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},61086:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("FileWarning",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},39572:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]])},71709:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},18019:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},3240:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]])},83855:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r=(0,i(76557).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},37520:e=>{"use strict";var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,r,s,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new n(r,s||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,a=Array(s);n<s;n++)a[n]=r[n].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,n,s,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,u,p=this._events[o],d=arguments.length;if(p.fn){switch(p.once&&this.removeListener(e,p.fn,void 0,!0),d){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,t),!0;case 3:return p.fn.call(p.context,t,r),!0;case 4:return p.fn.call(p.context,t,r,n),!0;case 5:return p.fn.call(p.context,t,r,n,s),!0;case 6:return p.fn.call(p.context,t,r,n,s,a),!0}for(u=1,l=Array(d-1);u<d;u++)l[u-1]=arguments[u];p.fn.apply(p.context,l)}else{var h,c=p.length;for(u=0;u<c;u++)switch(p[u].once&&this.removeListener(e,p[u].fn,void 0,!0),d){case 1:p[u].fn.call(p[u].context);break;case 2:p[u].fn.call(p[u].context,t);break;case 3:p[u].fn.call(p[u].context,t,r);break;case 4:p[u].fn.call(p[u].context,t,r,n);break;default:if(!l)for(h=1,l=Array(d-1);h<d;h++)l[h-1]=arguments[h];p[u].fn.apply(p[u].context,l)}}return!0},o.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,n){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||n&&!o.once||r&&o.context!==r||a(this,s);else{for(var l=0,u=[],p=o.length;l<p;l++)(o[l].fn!==t||n&&!o[l].once||r&&o[l].context!==r)&&u.push(o[l]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o},77888:(e,t,i)=>{e.exports=i(98440)},98440:(e,t,i)=>{var r=i(26186);t.operation=function(e){return new r(t.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n<t.retries;n++)r.push(this.createTimeout(n,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(n,t)),r.sort(function(e,t){return e-t}),r},t.createTimeout=function(e,t){return Math.min(Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e)),t.maxTimeout)},t.wrap=function(e,i,r){if(i instanceof Array&&(r=i,i=null),!r)for(var n in r=[],e)"function"==typeof e[n]&&r.push(n);for(var s=0;s<r.length;s++){var a=r[s],o=e[a];e[a]=(function(r){var n=t.operation(i),s=Array.prototype.slice.call(arguments,1),a=s.pop();s.push(function(e){n.retry(e)||(e&&(arguments[0]=n.mainError()),a.apply(this,arguments))}),n.attempt(function(){r.apply(e,s)})}).bind(e,o),e[a].options=i}}},26186:e=>{function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var 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)},i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var n=this._errors[r],s=n.message,a=(e[s]||0)+1;e[s]=a,a>=i&&(t=n,i=a)}return t}},19509:(e,t,i)=>{"use strict";var r=i(17577);"function"==typeof Object.is&&Object.is,r.useSyncExternalStore,r.useRef,r.useEffect,r.useMemo,r.useDebugValue},9911:(e,t,i)=>{"use strict";i(19509)},59946:()=>{},27221:()=>{},48029:(e,t)=>{var i;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=s(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)r.call(e,i)&&e[i]&&(t=s(t,i));return t}(i)))}return e}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0!==(i=(function(){return n}).apply(t,[]))&&(e.exports=i)}()},35663:(e,t,i)=>{"use strict";i.d(t,{zF:()=>v,Fw:()=>C,wy:()=>_,fC:()=>k});var r=i(17577),n=("undefined"!=typeof window&&window.document&&window.document.createElement,i(93095)),s=i(52067),a=i(65819),o=i(48051),l=i(45226),u=e=>{let{present:t,children:i}=e,n=function(e){var t,i;let[n,s]=r.useState(),o=r.useRef(null),l=r.useRef(e),u=r.useRef("none"),[d,h]=(t=e?"mounted":"unmounted",i={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>i[e][t]??e,t));return r.useEffect(()=>{let e=p(o.current);u.current="mounted"===d?e:"none"},[d]),(0,a.b)(()=>{let t=o.current,i=l.current;if(i!==e){let r=u.current,n=p(t);e?h("MOUNT"):"none"===n||t?.display==="none"?h("UNMOUNT"):i&&r!==n?h("ANIMATION_OUT"):h("UNMOUNT"),l.current=e}},[e,h]),(0,a.b)(()=>{if(n){let e;let t=n.ownerDocument.defaultView??window,i=i=>{let r=p(o.current).includes(CSS.escape(i.animationName));if(i.target===n&&r&&(h("ANIMATION_END"),!l.current)){let i=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=i)})}},r=e=>{e.target===n&&(u.current=p(o.current))};return n.addEventListener("animationstart",r),n.addEventListener("animationcancel",i),n.addEventListener("animationend",i),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",r),n.removeEventListener("animationcancel",i),n.removeEventListener("animationend",i)}}h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,s(e)},[])}}(t),s="function"==typeof i?i({present:n.isPresent}):r.Children.only(i),l=(0,o.e)(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=t&&"isReactWarning"in t&&t.isReactWarning;return i?e.ref:(i=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(s));return"function"==typeof i||n.isPresent?r.cloneElement(s,{ref:l}):null};function p(e){return e?.animationName||"none"}u.displayName="Presence";var d=i(88957),h=i(10326),c="Collapsible",[f,m]=(0,n.b)(c),[g,y]=f(c),v=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,open:n,defaultOpen:a,disabled:o,onOpenChange:u,...p}=e,[f,m]=(0,s.T)({prop:n,defaultProp:a??!1,onChange:u,caller:c});return(0,h.jsx)(g,{scope:i,disabled:o,contentId:(0,d.M)(),open:f,onOpenToggle:r.useCallback(()=>m(e=>!e),[m]),children:(0,h.jsx)(l.WV.div,{"data-state":S(f),"data-disabled":o?"":void 0,...p,ref:t})})});v.displayName=c;var b="CollapsibleTrigger",_=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,...r}=e,n=y(b,i);return(0,h.jsx)(l.WV.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":S(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:t,onClick:function(e,t,{checkForDefaultPrevented:i=!0}={}){return function(r){if(e?.(r),!1===i||!r.defaultPrevented)return t?.(r)}}(e.onClick,n.onOpenToggle)})});_.displayName=b;var w="CollapsibleContent",C=r.forwardRef((e,t)=>{let{forceMount:i,...r}=e,n=y(w,e.__scopeCollapsible);return(0,h.jsx)(u,{present:i||n.open,children:({present:e})=>(0,h.jsx)(P,{...r,ref:t,present:e})})});C.displayName=w;var P=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,present:n,children:s,...u}=e,p=y(w,i),[d,c]=r.useState(n),f=r.useRef(null),m=(0,o.e)(t,f),g=r.useRef(0),v=g.current,b=r.useRef(0),_=b.current,C=p.open||d,P=r.useRef(C),k=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>P.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,a.b)(()=>{let e=f.current;if(e){k.current=k.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();g.current=t.height,b.current=t.width,P.current||(e.style.transitionDuration=k.current.transitionDuration,e.style.animationName=k.current.animationName),c(n)}},[p.open,n]),(0,h.jsx)(l.WV.div,{"data-state":S(p.open),"data-disabled":p.disabled?"":void 0,id:p.contentId,hidden:!C,...u,ref:m,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:C&&s})});function S(e){return e?"open":"closed"}var k=v},10119:(e,t,i)=>{"use strict";i.d(t,{D:()=>p});var r=i(17577),n=i(71180),s=i(12113),a=i(64351),o=i(3341),l=class extends a.l{#e;#t=void 0;#i;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,o.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#i,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(t.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#i?.state.status==="pending"&&this.#i.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#i?.removeObserver(this)}onMutationUpdate(e){this.#n(),this.#s(e)}getCurrentResult(){return this.#t}reset(){this.#i?.removeObserver(this),this.#i=void 0,this.#n(),this.#s()}mutate(e,t){return this.#r=t,this.#i?.removeObserver(this),this.#i=this.#e.getMutationCache().build(this.#e,this.options),this.#i.addObserver(this),this.#i.execute(e)}#n(){let e=this.#i?.state??(0,n.R)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#s(e){s.Vr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,i=this.#t.context;e?.type==="success"?(this.#r.onSuccess?.(e.data,t,i),this.#r.onSettled?.(e.data,null,t,i)):e?.type==="error"&&(this.#r.onError?.(e.error,t,i),this.#r.onSettled?.(void 0,e.error,t,i))}this.listeners.forEach(e=>{e(this.#t)})})}},u=i(44976);function p(e,t){let i=(0,u.NL)(t),[n]=r.useState(()=>new l(i,e));r.useEffect(()=>{n.setOptions(e)},[n,e]);let a=r.useSyncExternalStore(r.useCallback(e=>n.subscribe(s.Vr.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),p=r.useCallback((e,t)=>{n.mutate(e,t).catch(o.ZT)},[n]);if(a.error&&(0,o.L3)(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:p,mutateAsync:a.mutate}}},32964:(e,t,i)=>{"use strict";function r(e,t){return Object.hasOwn(e,t)}class n extends Error{isNetworkError;cause;constructor(e,t){super(e),this.cause=t?.cause,this.cause&&r(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}class s extends Error{cause;isNetworkError;request;constructor(e,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}}class a extends Error{name="UserFacingApiError"}var o=i(77888);let l=Object.prototype.toString,u=e=>"[object Error]"===l.call(e),p=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"]);class d extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}let h=(e,t,i)=>{let r=i.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e};async function c(e,t){return new Promise((i,r)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;let n=o.operation(t),s=()=>{n.stop(),r(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",s,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",s),n.stop()};n.attempt(async s=>{try{let t=await e(s);a(),i(t)}catch(e){try{if(!(e instanceof Error))throw TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof d)throw e.originalError;if(e instanceof TypeError&&!(e&&u(e)&&"TypeError"===e.name&&"string"==typeof e.message&&("Load failed"===e.message?void 0===e.stack:p.has(e.message))))throw e;if(h(e,s,t),await t.shouldRetry(e)||(n.stop(),r(e)),await t.onFailedAttempt(e),!n.retry(e))throw n.mainError()}catch(e){h(e,s,t),a(),r(e)}}})})}let f={i8:"4.5.1"};class m extends Error{isAuthError;constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}class g extends Error{statusCode;constructor({statusCode:e,message:t}){super(t),this.name="HttpError",this.statusCode=e}}async function y(e){let t;if(401===e.status)throw new m;if(e.ok)return e.json();let i=`Failed request with status: ${e.status}. ${e.statusText}`;try{(t=await e.json()).message&&(i=`${i} message: ${t.message}`),t.requestId&&(i=`${i} request-Id: ${t.requestId}`)}catch(e){throw Error(i,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new a(t.message);throw new g({statusCode:e.status,message:i})}class v{static VERSION=f.i8;#a;uppy;opts;constructor(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.#a=t.companionHeaders}setCompanionHeaders(e){this.#a=e}[Symbol.for("uppy test: getCompanionHeaders")](){return this.#a}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...this.#a}}onReceiveResponse(e){let{headers:t}=e,i=this.uppy.getState().companion||{},r=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==i[r]&&this.uppy.setState({companion:{...i,[r]:t.get("i-am")}})}#o(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async request({path:e,method:t="GET",data:i,skipPostResponse:r,signal:a}){try{let n=await this.headers(!i),o=await function(...e){return fetch(...e).catch(e=>{if("AbortError"===e.name)throw e;throw new s(e)})}(this.#o(e),{method:t,signal:a,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return r||this.onReceiveResponse(o),await y(o)}catch(i){if(i.isAuthError||"UserFacingApiError"===i.name||"AbortError"===i.name)throw i;throw new n(`Could not ${t} ${this.#o(e)}`,{cause:i})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){try{let{signal:r,getQueue:n}=i||{};return await c(async()=>{let i=this.uppy.getFile(e.id)?.serverToken;if(null!=i)return this.uppy.log(`Connecting to exiting websocket ${i}`),this.#l({file:e,queue:n(),signal:r});let s=n().wrapPromiseFunction(async(...e)=>{try{return await this.#u(...e)}catch(t){if(t.isAuthError)throw new d(t);if(null==t.cause)throw t;let e=t.cause;if("HttpError"===e.name&&!([408,409,429,418,423].includes(e.statusCode)||e.statusCode>=500&&e.statusCode<=599&&![501,505].includes(e.statusCode)))throw new d(e);throw e}},{priority:-1}),a=await s({file:e,postBody:t,signal:r}).abortOn(r);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:a}),this.#l({file:this.uppy.getFile(e.id),queue:n(),signal:r})},{retries:10,signal:r,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}}#u=async({file:e,postBody:t,signal:i})=>{if(e.remote?.url==null)throw Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token};async #l({file:e,queue:t,signal:i}){let r;let{capabilities:n}=this.uppy.getState();try{return await new Promise((s,a)=>{let o,l,u;let p=e.serverToken,d=function(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1],i=/^http:\/\//i.test(e)?"ws":"wss";return`${i}://${t}`}(e.remote.companionUrl),{isPaused:h}=e,f=(t,i)=>{if(null==o||o.readyState!==o.OPEN){this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(o?.readyState)}`,"warning");return}o.send(JSON.stringify({action:t,payload:i??{}}))};function m(){n.resumableUploads&&(h?f("pause"):f("resume"))}let g=async()=>{l&&l.abort(),l=new AbortController;let i=t=>{this.uppy.setFileState(e.id,{serverToken:null}),l?.abort?.(),a(t)};function r(){clearTimeout(u),h||(u=setTimeout(()=>i(Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{let t=async()=>new Promise((t,n)=>{o=new WebSocket(`${d}/api/${p}`),r(),o.addEventListener("close",()=>{o=void 0,n(Error("Socket closed unexpectedly"))}),o.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),o?.close()}),o.addEventListener("open",()=>{m()}),o.addEventListener("message",t=>{r();try{let{action:i,payload:r}=JSON.parse(t.data);switch(i){case"progress":!function(e,t,i){let{progress:r,bytesUploaded:n,bytesTotal:s}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",i,{uploadStarted:i.progress.uploadStarted??0,bytesUploaded:n,bytesTotal:s}))}(this,r,this.uppy.getFile(e.id));break;case"success":{let t=r.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:r.url,status:r.response?.status??200,body:t?JSON.parse(t):void 0}),l?.abort?.(),s();break}case"error":{let{message:e}=r.error;throw Object.assign(Error(e),{cause:r.error})}default:this.uppy.log(`Companion socket unknown action ${i}`,"warning")}}catch(e){i(e)}});let a=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(u),o&&o.close(),o=void 0};l.signal.addEventListener("abort",()=>{a()})});await c(t,{retries:10,signal:l.signal,onFailedAttempt:()=>{l.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(l.signal)}catch(e){if(l.signal.aborted)return;i(e)}},y=e=>{n.resumableUploads&&(h=e,o&&m())},v=t=>{n.individualCancellation&&t.id===e.id&&(f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),s())},b=()=>{f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),s()},_=(t,i)=>{t?.id===e.id&&y(i)},w=()=>y(!0),C=()=>y(!1);this.uppy.on("file-removed",v),this.uppy.on("cancel-all",b),this.uppy.on("upload-pause",_),this.uppy.on("pause-all",w),this.uppy.on("resume-all",C),r=()=>{this.uppy.off("file-removed",v),this.uppy.off("cancel-all",b),this.uppy.off("upload-pause",_),this.uppy.off("pause-all",w),this.uppy.off("resume-all",C)},i.addEventListener("abort",()=>{l?.abort()}),g()})}finally{r?.()}}}var b=i(81374);class _{#p;#d=[];constructor(e){this.#p=e}on(e,t){return this.#d.push([e,t]),this.#p.on(e,t)}remove(){for(let[e,t]of this.#d.splice(0))this.#p.off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#p.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#p.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{this.#p.getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#p.getFile(e)&&t()})}}let{AbortController:w}=globalThis,{AbortSignal:C}=globalThis,P=(e="Aborted",t)=>{let i=new DOMException(e,"AbortError");return null!=t&&r(t,"cause")&&Object.defineProperty(i,"cause",{__proto__:null,configurable:!0,writable:!0,value:t.cause}),i};function S(e,t){return!0===e?Object.keys(t):Array.isArray(e)?e:[]}function k(e){if(null!=e){let t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});let i=()=>{e.removeEventListener("abort",t)};this.then?.(i,i)}return this}class F{#h=0;#c=[];#f=!1;#m;#g=1;#y;#v;limit;constructor(e){"number"!=typeof e||0===e?this.limit=1/0:this.limit=e}#b(e){let t;this.#h+=1;let i=!1;try{t=e()}catch(e){throw this.#h-=1,e}return{abort:e=>{i||(i=!0,this.#h-=1,t?.(e),this.#_())},done:()=>{i||(i=!0,this.#h-=1,this.#_())}}}#_(){queueMicrotask(()=>this.#w())}#w(){if(this.#f||this.#h>=this.limit||0===this.#c.length)return;let e=this.#c.shift();if(null==e)throw Error("Invariant violation: next is null");let t=this.#b(e.fn);e.abort=t.abort,e.done=t.done}#C(e,t){let i={fn:e,priority:t?.priority||0,abort:()=>{this.#P(i)},done:()=>{throw Error("Cannot mark a queued request as done: this indicates a bug")}},r=this.#c.findIndex(e=>i.priority>e.priority);return -1===r?this.#c.push(i):this.#c.splice(r,0,i),i}#P(e){let t=this.#c.indexOf(e);-1!==t&&this.#c.splice(t,1)}run(e,t){return!this.#f&&this.#h<this.limit?this.#b(e):this.#C(e,t)}wrapSyncFunction(e,t){return(...i)=>{let r=this.run(()=>(e(...i),queueMicrotask(()=>r.done()),()=>{}),t);return{abortOn:k,abort(){r.abort()}}}}wrapPromiseFunction(e,t){return(...i)=>{let r;let n=new Promise((n,s)=>{r=this.run(()=>{let t,a;try{a=Promise.resolve(e(...i))}catch(e){a=Promise.reject(e)}return a.then(e=>{t?s(t):(r.done(),n(e))},e=>{t?s(t):(r.done(),s(e))}),e=>{t=Error("Cancelled",{cause:e})}},t)});return n.abort=e=>{r.abort(e)},n.abortOn=k,n}}resume(){this.#f=!1,clearTimeout(this.#m);for(let e=0;e<this.limit;e++)this.#_()}#S=()=>this.resume();pause(e=null){this.#f=!0,clearTimeout(this.#m),null!=e&&(this.#m=setTimeout(this.#S,e))}rateLimit(e){clearTimeout(this.#v),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#y=this.limit-1,this.limit=this.#g,this.#v=setTimeout(this.#k,e))}#k=()=>{if(this.#f){this.#v=setTimeout(this.#k,0);return}this.#g=this.limit,this.limit=Math.ceil((this.#y+this.#g)/2);for(let e=this.#g;e<=this.limit;e++)this.#_();this.#y-this.#g>3?this.#v=setTimeout(this.#k,2e3):this.#g=Math.floor(this.#g/2)};get isPaused(){return this.#f}}Symbol("__queue");let T={i8:"4.3.1"},E=new TextEncoder,x={name:"HMAC",hash:"SHA-256"};async function I(e){let{subtle:t}=globalThis.crypto;return t.digest(x.hash,E.encode(e))}async function D(e){let{subtle:t}=globalThis.crypto;return t.importKey("raw","string"==typeof e?E.encode(e):e,x,!1,["sign"])}function A(e){let t=new Uint8Array(e),i="";for(let e=0;e<t.length;e++)i+=t[e].toString(16).padStart(2,"0");return i}async function O(e,t){let{subtle:i}=globalThis.crypto;return i.sign(x,await D(e),E.encode(t))}async function N({accountKey:e,accountSecret:t,sessionToken:i,bucketName:r,Key:n,Region:s,expires:a,uploadId:o,partNumber:l}){let u=`s3.${s}.amazonaws.com`,p=`/${r}/${encodeURI(n).replace(/[;?:@&=+$,#!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}`,d="UNSIGNED-PAYLOAD",h=new Date().toISOString().replace(/[-:]|\.\d+/g,""),c=h.slice(0,8),f=`${c}/${s}/s3/aws4_request`,m=new URL(`https://${u}${p}`);m.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),m.searchParams.set("X-Amz-Content-Sha256",d),m.searchParams.set("X-Amz-Credential",`${e}/${f}`),m.searchParams.set("X-Amz-Date",h),m.searchParams.set("X-Amz-Expires",a),m.searchParams.set("X-Amz-Security-Token",i),m.searchParams.set("X-Amz-SignedHeaders","host"),l&&m.searchParams.set("partNumber",l),o&&m.searchParams.set("uploadId",o),m.searchParams.set("x-id",l&&o?"UploadPart":"PutObject");let g=function({method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:r,HashedPayload:n}){let s=Object.keys(r).map(e=>e.toLowerCase()).sort();return[e,t,i,...s.map(e=>`${e}:${r[e]}`),"",s.join(";"),n].join("\n")}({CanonicalUri:p,CanonicalQueryString:m.search.slice(1),SignedHeaders:{host:u},HashedPayload:d}),y=["AWS4-HMAC-SHA256",h,f,A(await I(g))].join("\n"),v=await O(`AWS4${t}`,c),b=await O(v,s),_=await O(b,"s3"),w=await O(_,"aws4_request"),C=A(await O(w,y));return m.searchParams.set("X-Amz-Signature",C),m}let U={getChunkSize:e=>Math.ceil(e.size/1e4),onProgress(){},onPartComplete(){},onSuccess(){},onError(e){throw e}},M=Symbol("pausing upload, not an actual error");class R{options;#F=new w;#T=[];#E=[];#x;#I;#D=!1;#A;#O;#N;#U;#M=e=>e?.cause===M?null:this.#A(e);#R=1e4;#L=5242880;constructor(e,t){this.options={...U,...t},this.options.getChunkSize??=U.getChunkSize,this.#x=e,this.#I=t.file,this.#O=this.options.onSuccess,this.#A=this.options.onError,this.#N=this.options.shouldUseMultipart,this.#U=t.uploadId&&t.key,this.#B()}#B(){let e=this.#x.size,t="function"==typeof this.#N?this.#N(this.#I):!!this.#N;if(t&&e>this.#L){let i=Math.max(this.options.getChunkSize(this.#x),this.#L),r=Math.floor(e/i);r>this.#R&&(r=this.#R,i=e/this.#R),this.#T=Array(r);for(let r=0,n=0;r<e;r+=i,n++){let s=Math.min(e,r+i),a=()=>{let e=r;return this.#x.slice(e,s)};if(this.#T[n]={getData:a,onProgress:this.#z(n),onComplete:this.#q(n),shouldUseMultipart:t},this.#U){let t=r+i>e?e-r:i;this.#T[n].setAsUploaded=()=>{this.#T[n]=null,this.#E[n].uploaded=t}}}}else this.#T=[{getData:()=>this.#x,onProgress:this.#z(0),onComplete:this.#q(0),shouldUseMultipart:t}];this.#E=this.#T.map(()=>({uploaded:0}))}#H(){this.options.companionComm.uploadFile(this.#I,this.#T,this.#F.signal).then(this.#O,this.#M),this.#D=!0}#$(){this.options.companionComm.resumeUploadFile(this.#I,this.#T,this.#F.signal).then(this.#O,this.#M)}#z=e=>t=>{if(!t.lengthComputable)return;this.#E[e].uploaded=function(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw TypeError("Expected a number")}(t.loaded);let i=this.#E.reduce((e,t)=>e+t.uploaded,0);this.options.onProgress(i,this.#x.size)};#q=e=>t=>{this.#T[e]=null,this.#E[e].etag=t,this.#E[e].done=!0,this.options.onPartComplete({PartNumber:e+1,ETag:t})};#j(){this.#F.abort(),this.options.companionComm.abortFileUpload(this.#I).catch(e=>this.options.log(e))}start(){this.#D?(this.#F.signal.aborted||this.#F.abort(M),this.#F=new w,this.#$()):this.#U?(this.options.companionComm.restoreUploadFile(this.#I,{uploadId:this.options.uploadId,key:this.options.key}),this.#$()):this.#H()}pause(){this.#F.abort(M),this.#F=new w}abort(e){e?.really?this.#j():this.pause()}[Symbol.for("uppy test: getChunkState")](){return this.#E}}function L(e){if(e?.aborted)throw P("The operation was aborted",{cause:e.reason})}class B{#V;#W=new WeakMap;#G;#K;#X;#Z;#Q;#Y;#J;#ee;#et;#ei;#er;constructor(e,t,i,r){this.#Y=e,this.#et=i,this.#er=r,this.setOptions(t)}setOptions(e){let t=this.#Y;"abortMultipartUpload"in e&&(this.#V=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(this.#G=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(this.#K=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(this.#Z=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(this.#ee=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e&&(this.#J=e.retryDelays??[]),"uploadPartBytes"in e&&(this.#ei=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(this.#X=t.wrapPromiseFunction(e.getUploadParameters))}async #en(e,t){let i=this.#Y,r=e?.source?.status;if(null==r)return!1;if(403===r&&"Request has expired"===e.message){if(!i.isPaused){if(1===i.limit||null==this.#Q){let e=t.next();if(null==e||e.done)return!1;this.#Q=e.value}i.rateLimit(0),await new Promise(e=>setTimeout(e,this.#Q))}}else if(429===r){if(!i.isPaused){let e=t.next();if(null==e||e.done)return!1;i.rateLimit(e.value)}}else if(r>400&&r<500&&409!==r)return!1;else if("undefined"!=typeof navigator&&!1===navigator.onLine)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.resume()},{once:!0}));else{let e=t.next();if(null==e||e.done)return!1;await new Promise(t=>setTimeout(t,e.value))}return!0}async getUploadId(e,t){let i;for(;null!=(i=this.#W.get(e.data));)try{return await i}catch{}let r=this.#G(this.#er(e),t),n=()=>{r.abort(t.reason),this.#W.delete(e.data)};return t.addEventListener("abort",n,{once:!0}),this.#W.set(e.data,r),r.then(async i=>{t.removeEventListener("abort",n),this.#et(e,i),this.#W.set(e.data,i)},()=>{t.removeEventListener("abort",n),this.#W.delete(e.data)}),r}async abortFileUpload(e){let t;let i=this.#W.get(e.data);if(null!=i){this.#W.delete(e.data),this.#et(e,Object.create(null));try{t=await i}catch{return}await this.#V(this.#er(e),t)}}async #es(e,t,i){let r;let{method:n="POST",url:s,fields:a,headers:o}=await this.#X(this.#er(e),{signal:i}).abortOn(i),l=t.getData();if("POST"===n.toUpperCase()){let e=new FormData;Object.entries(a).forEach(([t,i])=>e.set(t,i)),e.set("file",l),r=e}else r=l;let{onProgress:u,onComplete:p}=t,d=await this.#ei({signature:{url:s,headers:o,method:n},body:r,size:l.size,onProgress:u,onComplete:p,signal:i}).abortOn(i),h=a?.key;return this.#et(e,{key:h}),{...d,location:d.location??function(e){let t=new URL(e);return t.search="",t.hash="",t.href}(s),bucket:a?.bucket,key:h}}async uploadFile(e,t,i){if(L(i),1===t.length&&!t[0].shouldUseMultipart)return this.#es(e,t[0],i);let{uploadId:r,key:n}=await this.getUploadId(e,i);L(i);try{let s=await Promise.all(t.map((t,r)=>this.uploadChunk(e,r+1,t,i)));return L(i),await this.#ee(this.#er(e),{key:n,uploadId:r,parts:s,signal:i},i).abortOn(i)}catch(t){throw t?.cause!==M&&t?.name!=="AbortError"&&this.abortFileUpload(e),t}}restoreUploadFile(e,t){this.#W.set(e.data,t)}async resumeUploadFile(e,t,i){if(L(i),1===t.length&&null!=t[0]&&!t[0].shouldUseMultipart)return this.#es(e,t[0],i);let{uploadId:r,key:n}=await this.getUploadId(e,i);L(i);let s=await this.#Z(this.#er(e),{uploadId:r,key:n,signal:i},i).abortOn(i);L(i);let a=await Promise.all(t.map((t,r)=>{let n=r+1,a=s.find(({PartNumber:e})=>e===n);return null==a?this.uploadChunk(e,n,t,i):(t?.setAsUploaded?.(),{PartNumber:n,ETag:a.ETag})}));return L(i),this.#ee(this.#er(e),{key:n,uploadId:r,parts:a,signal:i},i).abortOn(i)}async uploadChunk(e,t,i,r){L(r);let{uploadId:n,key:s}=await this.getUploadId(e,r),a=this.#J.values(),o=this.#J.values(),l=()=>{let e=a.next();return null==e||e.done?null:e.value};for(;;){let a;L(r);let u=i.getData(),{onProgress:p,onComplete:d}=i;try{a=await this.#K(this.#er(e),{uploadId:n,key:s,partNumber:t,body:u,signal:r}).abortOn(r)}catch(t){let e=l();if(null==e||r.aborted)throw t;await new Promise(t=>setTimeout(t,e));continue}L(r);try{return{PartNumber:t,...await this.#ei({signature:a,body:u,size:u.size,onProgress:p,onComplete:d,signal:r}).abortOn(r)}}catch(e){if(!await this.#en(e,o))throw e}}}}function z(e){if(e?.error){let t=Error(e.message);throw Object.assign(t,e.error),t}return e}function q(e){let t=e.Expiration;if(t){let e=Math.floor((new Date(t)-Date.now())/1e3);if(e>9)return e}}function H({meta:e,allowedMetaFields:t,querify:i=!1}){let r=t??Object.keys(e);return e?Object.fromEntries(r.filter(t=>null!=e[t]).map(t=>[i?`metadata[${t}]`:t,String(e[t])])):{}}let $={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:e=>(e.size||0)>104857600,retryDelays:[0,1e3,3e3,5e3]};class j extends b.Z{static VERSION=T.i8;#ea;#e;requests;uploaderEvents;uploaders;constructor(e,t){super(e,{...$,uploadPartBytes:j.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.#eo(t);let i={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t?.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t?.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(let e of Object.keys(i))null==this.opts[e]&&(this.opts[e]=i[e].bind(this));this.requests=this.opts.rateLimitedQueue??new F(this.opts.limit),this.#ea=new B(this.requests,this.opts,this.#et,this.#er),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}[Symbol.for("uppy test: getClient")](){return this.#e}#eo(e){null!=e&&("endpoint"in e||"companionUrl"in e||"headers"in e||"companionHeaders"in e||"cookiesRule"in e||"companionCookiesRule"in e)&&("companionUrl"in e&&!("endpoint"in e)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in e&&!("headers"in e)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in e&&!("cookiesRule"in e)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in e?this.#e=new v(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in e&&this.#el(),"cookiesRule"in e&&(this.#e.opts.companionCookiesRule=e.cookiesRule)))}setOptions(e){this.#ea.setOptions(e),super.setOptions(e),this.#eo(e)}resetUploaderReferences(e,t){this.uploaders[e]&&(this.uploaders[e].abort({really:t?.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}#eu(e){if(!this.#e)throw Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${e}\` implementation.`)}createMultipartUpload(e,t){this.#eu("createMultipartUpload"),L(t);let i=S(this.opts.allowedMetaFields,e.meta),r=H({meta:e.meta,allowedMetaFields:i});return this.#e.post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(z)}listParts(e,{key:t,uploadId:i,signal:r},n){r??=n,this.#eu("listParts"),L(r);let s=encodeURIComponent(t);return this.#e.get(`s3/multipart/${encodeURIComponent(i)}?key=${s}`,{signal:r}).then(z)}completeMultipartUpload(e,{key:t,uploadId:i,parts:r,signal:n},s){n??=s,this.#eu("completeMultipartUpload"),L(n);let a=encodeURIComponent(t),o=encodeURIComponent(i);return this.#e.post(`s3/multipart/${o}/complete?key=${a}`,{parts:r.map(({ETag:e,PartNumber:t})=>({ETag:e,PartNumber:t}))},{signal:n}).then(z)}#ep;async #ed(e){if(L(e?.signal),null==this.#ep){let{getTemporarySecurityCredentials:t}=this.opts;!0===t?(this.#eu("getTemporarySecurityCredentials"),this.#ep=this.#e.get("s3/sts",e).then(z)):this.#ep=t(e),this.#ep=await this.#ep,setTimeout(()=>{this.#ep=null},500*(q(this.#ep.credentials)||0))}return this.#ep}async createSignedURL(e,t){let i=await this.#ed(t),r=q(i.credentials)||604800,{uploadId:n,key:s,partNumber:a}=t;return{method:"PUT",expires:r,fields:{},url:`${await N({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:r,bucketName:i.bucket,Region:i.region,Key:s??`${crypto.randomUUID()}-${e.name}`,uploadId:n,partNumber:a})}`,headers:{"Content-Type":e.type}}}signPart(e,{uploadId:t,key:i,partNumber:r,signal:n}){if(this.#eu("signPart"),L(n),null==t||null==i||null==r)throw Error("Cannot sign without a key, an uploadId, and a partNumber");let s=encodeURIComponent(i);return this.#e.get(`s3/multipart/${encodeURIComponent(t)}/${r}?key=${s}`,{signal:n}).then(z)}abortMultipartUpload(e,{key:t,uploadId:i,signal:r}){this.#eu("abortMultipartUpload");let n=encodeURIComponent(t),s=encodeURIComponent(i);return this.#e.delete(`s3/multipart/${s}?key=${n}`,void 0,{signal:r}).then(z)}getUploadParameters(e,t){this.#eu("getUploadParameters");let{meta:i}=e,{type:r,name:n}=i,s=new URLSearchParams({filename:n,type:r,...H({meta:i,allowedMetaFields:S(this.opts.allowedMetaFields,e.meta),querify:!0})});return this.#e.get(`s3/params?${s}`,t)}static async uploadPartBytes({signature:{url:e,expires:t,headers:i,method:r="PUT"},body:n,size:s=n.size,onProgress:a,onComplete:o,signal:l}){if(L(l),null==e)throw Error("Cannot upload to an undefined URL");return new Promise((u,p)=>{let d=new XMLHttpRequest;function h(){d.abort()}function c(){l?.removeEventListener("abort",h)}d.open(r,e,!0),i&&Object.keys(i).forEach(e=>{d.setRequestHeader(e,i[e])}),d.responseType="text","number"==typeof t&&(d.timeout=1e3*t),l?.addEventListener("abort",h),d.upload.addEventListener("progress",e=>{a(e)}),d.addEventListener("abort",()=>{c(),p(P())}),d.addEventListener("timeout",()=>{c();let e=Error("Request has expired");e.source={status:403},p(e)}),d.addEventListener("load",()=>{if(c(),403===d.status&&d.responseText.includes("<Message>Request has expired</Message>")){let e=Error("Request has expired");e.source=d,p(e);return}if(d.status<200||d.status>=300){let e=Error("Non 2xx");e.source=d,p(e);return}a?.({loaded:s,lengthComputable:!0});let e=d.getAllResponseHeaders().trim().split(/[\r\n]+/),t={__proto__:null};for(let i of e){let e=i.split(": "),r=e.shift(),n=e.join(": ");t[r]=n}let{etag:i,location:n}=t;if("POST"===r.toUpperCase()&&null==n&&console.error("@uppy/aws-s3: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket"),null==i){console.error("@uppy/aws-s3: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket");return}o?.(i),u({...t,ETag:i})}),d.addEventListener("error",e=>{c();let t=Error("Unknown error");t.source=e.target,p(t)}),d.send(n)})}#et=(e,{key:t,uploadId:i})=>{let r=this.uppy.getFile(e.id);null!=r&&this.uppy.setFileState(e.id,{s3Multipart:{...r.s3Multipart,key:t,uploadId:i}})};#er=e=>this.uppy.getFile(e.id)||e;#eh(e){return new Promise((t,i)=>{let r=new R(e.data,{companionComm:this.#ea,log:(...e)=>this.uppy.log(...e),getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:(t,i)=>{let r=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",r,{uploadStarted:r.progress.uploadStarted??0,bytesUploaded:t,bytesTotal:i})},onError:t=>{this.uppy.log(t),this.uppy.emit("upload-error",e,t),this.resetUploaderReferences(e.id),i(t)},onSuccess:i=>{let r={body:{...i},status:200,uploadURL:i.location};this.resetUploaderReferences(e.id),this.uppy.emit("upload-success",this.#er(e),r),i.location&&this.uppy.log(`Download ${e.name} from ${i.location}`),t(void 0)},onPartComplete:t=>{this.uppy.emit("s3-multipart:part-uploaded",this.#er(e),t)},file:e,shouldUseMultipart:this.opts.shouldUseMultipart,...e.s3Multipart});this.uploaders[e.id]=r;let n=new _(this.uppy);this.uploaderEvents[e.id]=n,n.onFileRemove(e.id,i=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${i} was removed`)}),n.onCancelAll(e.id,()=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${e.id} was canceled`)}),n.onFilePause(e.id,e=>{e?r.pause():r.start()}),n.onPauseAll(e.id,()=>{r.pause()}),n.onResumeAll(e.id,()=>{r.start()}),r.start()})}#ec(e){return{...e.remote?.body,protocol:"s3-multipart",size:e.data.size,metadata:e.meta}}#ef=async e=>{if(0===e.length)return;let t=function(e){let t=e=>"error"in e&&!!e.error;return e.filter(e=>!t(e))}(this.uppy.getFilesByIds(e)),i=t.filter(e=>!e.progress?.uploadStarted||!e.isRestored);this.uppy.emit("upload-start",i);let r=t.map(e=>{if(e.isRemote){this.#em(!1);let t=new AbortController,i=i=>{i.id===e.id&&t.abort()};this.uppy.on("file-removed",i);let r=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,this.#ec(e),{signal:t.signal,getQueue:()=>this.requests});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",i)},{priority:-1})(),r}return this.#eh(e)}),n=await Promise.allSettled(r);return this.#em(!0),n};#el=()=>{this.#e?.setCompanionHeaders(this.opts.headers)};#em=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,resumableUploads:e}})};#eg=()=>{this.#em(!0)};install(){this.#em(!0),this.uppy.addPreProcessor(this.#el),this.uppy.addUploader(this.#ef),this.uppy.on("cancel-all",this.#eg)}uninstall(){this.uppy.removePreProcessor(this.#el),this.uppy.removeUploader(this.#ef),this.uppy.off("cancel-all",this.#eg)}}},81374:(e,t,i)=>{"use strict";function r(e,t){let i=/\$/g,r=[e];if(null==t)return r;for(let e of Object.keys(t))if("_"!==e){let n=t[e];"string"==typeof n&&(n=i[Symbol.replace](n,"$$$$")),r=function(e,t,i){let r=[];return e.forEach(e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,n)=>{""!==e&&r.push(e),t<n.length-1&&r.push(i)})),r}(r,RegExp(`%\\{${e}\\}`,"g"),n)}return r}i.d(t,{Z:()=>a});let n=e=>{throw Error(`missing string: ${e}`)};class s{locale;constructor(e,{onMissingKey:t=n}={}){this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(this.#ey,this):this.#ey(e),this.#ev=t}#ev;#ey(e){if(!e?.strings)return;let t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&(this.#ev(e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return r(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw Error("string was not a string");return r(i,t)}}class a{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new s([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 Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}},84714:(e,t,i)=>{"use strict";function r(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}i.d(t,{A:()=>ni});let n=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir};var s,a,o,l,u,p,d,h,c,f,m={},g=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function b(e,t){for(var i in t)e[i]=t[i];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,i){var r,n,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?s.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return C(e,o,r,n,null)}function C(e,t,i,r,n){var s={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++o:n,__i:-1,__u:0};return null==n&&null!=a.vnode&&a.vnode(s),s}function P(e){return e.children}function S(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?k(e):null}function F(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!T.__r++||u!==a.debounceRendering)&&((u=a.debounceRendering)||p)(T)}function T(){var e,t,i,r,n,s,o,u;for(l.sort(d);e=l.shift();)e.__d&&(t=l.length,r=void 0,s=(n=(i=e).__v).__e,o=[],u=[],i.__P&&((r=b({},n)).__v=n.__v+1,a.vnode&&a.vnode(r),O(i.__P,r,n,i.__n,i.__P.namespaceURI,32&n.__u?[s]:null,o,null==s?k(n):s,!!(32&n.__u),u),r.__v=n.__v,r.__.__k[r.__i]=r,N(o,r,u),r.__e!=s&&function e(t){var i,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(r=t.__k[i])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)),l.length>t&&l.sort(d));T.__r=0}function E(e,t,i,r,n,s,o,l,u,p,d){var h,c,f,y,b,w=r&&r.__k||g,S=t.length;for(i.__d=u,function(e,t,i){var r,n,s,o,l,u=t.length,p=i.length,d=p,h=0;for(e.__k=[],r=0;r<u;r++)null!=(n=t[r])&&"boolean"!=typeof n&&"function"!=typeof n?(o=r+h,(n=e.__k[r]="string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?C(null,n,null,null,null):v(n)?C(P,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?C(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n).__=e,n.__b=e.__b+1,s=null,-1!==(l=n.__i=function(e,t,i,r){var n=e.key,s=e.type,a=i-1,o=i+1,l=t[i];if(null===l||l&&n==l.key&&s===l.type&&0==(131072&l.__u))return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return a;a--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return o;o++}}return -1}(n,i,o,d))&&(d--,(s=i[l])&&(s.__u|=131072)),null==s||null===s.__v?(-1==l&&h--,"function"!=typeof n.type&&(n.__u|=65536)):l!==o&&(l==o-1?h--:l==o+1?h++:(l>o?h--:h++,n.__u|=65536))):n=e.__k[r]=null;if(d)for(r=0;r<p;r++)null!=(s=i[r])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=k(s)),function e(t,i,r){var n,s;if(a.unmount&&a.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||U(n,null,i)),null!=(n=t.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){a.__e(e,i)}n.base=n.__P=null}if(n=t.__k)for(s=0;s<n.length;s++)n[s]&&e(n[s],i,r||"function"!=typeof t.type);r||_(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(s,s))}(i,t,w),u=i.__d,h=0;h<S;h++)null!=(f=i.__k[h])&&(c=-1===f.__i?m:w[f.__i]||m,f.__i=h,O(e,f,c,n,s,o,l,u,p,d),y=f.__e,f.ref&&c.ref!=f.ref&&(c.ref&&U(c.ref,null,f),d.push(f.ref,f.__c||y,f)),null==b&&null!=y&&(b=y),65536&f.__u||c.__k===f.__k?u=function e(t,i,r){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=t,i=e(n[s],i,r));return i}t.__e!=i&&(i&&t.type&&!r.contains(i)&&(i=k(t)),r.insertBefore(t.__e,i||null),i=t.__e);do i=i&&i.nextSibling;while(null!=i&&8===i.nodeType);return i}(f,u,e):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:y&&(u=y.nextSibling),f.__d=void 0,f.__u&=-196609);i.__d=u,i.__e=b}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){x(e,t)}):t.push(e)),t}function I(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||y.test(t)?i:i+"px"}function D(e,t,i,r,n){var s;e:if("style"===t){if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||I(e.style,t,"");if(i)for(t in i)r&&i[t]===r[t]||I(e.style,t,i[t])}}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?r?i.u=r.u:(i.u=h,e.addEventListener(t,s?f:c,s)):e.removeEventListener(t,s?f:c,s);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function A(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=h++;else if(t.t<i.u)return;return i(a.event?a.event(t):t)}}}function O(e,t,i,r,n,o,l,u,p,d){var h,c,f,g,y,w,C,F,T,x,I,A,O,N,U,R,L=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(p=!!(32&i.__u),o=[u=t.__e=i.__e]),(h=a.__b)&&h(t);e:if("function"==typeof L)try{if(F=t.props,T="prototype"in L&&L.prototype.render,x=(h=L.contextType)&&r[h.__c],I=h?x?x.props.value:h.__:r,i.__c?C=(c=t.__c=i.__c).__=c.__E:(T?t.__c=c=new L(F,I):(t.__c=c=new S(F,I),c.constructor=L,c.render=M),x&&x.sub(c),c.props=F,c.state||(c.state={}),c.context=I,c.__n=r,f=c.__d=!0,c.__h=[],c._sb=[]),T&&null==c.__s&&(c.__s=c.state),T&&null!=L.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=b({},c.__s)),b(c.__s,L.getDerivedStateFromProps(F,c.__s))),g=c.props,y=c.state,c.__v=t,f)T&&null==L.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),T&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(T&&null==L.getDerivedStateFromProps&&F!==g&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(F,I),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(F,c.__s,I)||t.__v===i.__v)){for(t.__v!==i.__v&&(c.props=F,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),A=0;A<c._sb.length;A++)c.__h.push(c._sb[A]);c._sb=[],c.__h.length&&l.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(F,c.__s,I),T&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(g,y,w)})}if(c.context=I,c.props=F,c.__P=e,c.__e=!1,O=a.__r,N=0,T){for(c.state=c.__s,c.__d=!1,O&&O(t),h=c.render(c.props,c.state,c.context),U=0;U<c._sb.length;U++)c.__h.push(c._sb[U]);c._sb=[]}else do c.__d=!1,O&&O(t),h=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++N<25);c.state=c.__s,null!=c.getChildContext&&(r=b(b({},r),c.getChildContext())),T&&!f&&null!=c.getSnapshotBeforeUpdate&&(w=c.getSnapshotBeforeUpdate(g,y)),E(e,v(R=null!=h&&h.type===P&&null==h.key?h.props.children:h)?R:[R],t,i,r,n,o,l,u,p,d),c.base=t.__e,t.__u&=-161,c.__h.length&&l.push(c),C&&(c.__E=c.__=null)}catch(e){if(t.__v=null,p||null!=o){for(t.__u|=p?160:128;u&&8===u.nodeType&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u}else t.__e=i.__e,t.__k=i.__k;a.__e(e,t,i)}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,r,n,o,l,u,p){var d,h,c,f,g,y,b,w=i.props,C=t.props,P=t.type;if("svg"===P?n="http://www.w3.org/2000/svg":"math"===P?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=o){for(d=0;d<o.length;d++)if((g=o[d])&&"setAttribute"in g==!!P&&(P?g.localName===P:3===g.nodeType)){e=g,o[d]=null;break}}if(null==e){if(null===P)return document.createTextNode(C);e=document.createElementNS(n,P,C.is&&C),u&&(a.__m&&a.__m(t,o),u=!1),o=null}if(null===P)w===C||u&&e.data===C||(e.data=C);else{if(o=o&&s.call(e.childNodes),w=i.props||m,!u&&null!=o)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)if(g=w[d],"children"==d);else if("dangerouslySetInnerHTML"==d)c=g;else if(!(d in C)){if("value"==d&&"defaultValue"in C||"checked"==d&&"defaultChecked"in C)continue;D(e,d,null,g,n)}for(d in C)g=C[d],"children"==d?f=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?y=g:"checked"==d?b=g:u&&"function"!=typeof g||w[d]===g||D(e,d,g,w[d],n);if(h)u||c&&(h.__html===c.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),E(e,v(f)?f:[f],t,i,r,"foreignObject"===P?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:i.__k&&k(i,0),u,p),null!=o)for(d=o.length;d--;)_(o[d]);u||(d="value","progress"===P&&null==y?e.removeAttribute("value"):void 0===y||y===e[d]&&("progress"!==P||y)&&("option"!==P||y===w[d])||D(e,d,y,w[d],n),d="checked",void 0!==b&&b!==e[d]&&D(e,d,b,w[d],n))}return e}(i.__e,t,i,r,n,o,l,p,d);(h=a.diffed)&&h(t)}function N(e,t,i){t.__d=void 0;for(var r=0;r<i.length;r++)U(i[r],i[++r],i[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function U(e,t,i){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,i)}}function M(e,t,i){return this.constructor(e,i)}function R(e,t,i){var r,n,a,o,l=b({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?n=t[a]:l[a]=void 0===t[a]&&void 0!==o?o[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?s.call(arguments,2):i),C(e.type,l,r||e.key,n||e.ref,null)}s=g.slice,a={__e:function(e,t,i,r){for(var n,s,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,r||{}),a=n.__d),a)return n.__E=n}catch(t){e=t}throw e}},o=0,S.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=b({},this.state),"function"==typeof e&&(e=e(b({},i),this.props)),e&&b(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),F(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),F(this))},S.prototype.render=P,l=[],p="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},T.__r=0,h=0,c=A(!1),f=A(!0);var L,B,z,q,H=0,$=[],j=a,V=j.__b,W=j.__r,G=j.diffed,K=j.__c,X=j.unmount,Z=j.__;function Q(e,t){j.__h&&j.__h(B,e,H||t),H=0;var i=B.__H||(B.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Y(e){return H=1,function(e,t,i){var r=Q(L++,2);if(r.t=e,!r.__c&&(r.__=[el(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.u)){var n=function(e,t,i){if(!r.__c.__H)return!0;var n=r.__c.__H.__.filter(function(e){return!!e.__c});if(n.every(function(e){return!e.__N}))return!s||s.call(this,e,t,i);var a=!1;return n.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),!(!a&&r.__c.props===e)&&(!s||s.call(this,e,t,i))};B.u=!0;var s=B.shouldComponentUpdate,a=B.componentWillUpdate;B.componentWillUpdate=function(e,t,i){if(this.__e){var r=s;s=void 0,n(e,t,i),s=r}a&&a.call(this,e,t,i)},B.shouldComponentUpdate=n}return r.__N||r.__}(el,e)}function J(e,t){var i=Q(L++,3);!j.__s&&eo(i.__H,t)&&(i.__=e,i.i=t,B.__H.__h.push(i))}function ee(e){return H=5,et(function(){return{current:e}},[])}function et(e,t){var i=Q(L++,7);return eo(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function ei(e,t){return H=8,et(function(){return e},t)}function er(){for(var e;e=$.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(es),e.__H.__h.forEach(ea),e.__H.__h=[]}catch(t){e.__H.__h=[],j.__e(t,e.__v)}}j.__b=function(e){B=null,V&&V(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Z&&Z(e,t)},j.__r=function(e){W&&W(e),L=0;var t=(B=e.__c).__H;t&&(z===B?(t.__h=[],B.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(es),t.__h.forEach(ea),t.__h=[],L=0)),z=B},j.diffed=function(e){G&&G(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==$.push(t)&&q===j.requestAnimationFrame||((q=j.requestAnimationFrame)||function(e){var t,i=function(){clearTimeout(r),en&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,100);en&&(t=requestAnimationFrame(i))})(er)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),z=B=null},j.__c=function(e,t){t.some(function(e){try{e.__h.forEach(es),e.__h=e.__h.filter(function(e){return!e.__||ea(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],j.__e(i,e.__v)}}),K&&K(e,t)},j.unmount=function(e){X&&X(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(e){try{es(e)}catch(e){t=e}}),i.__H=void 0,t&&j.__e(t,i.__v))};var en="function"==typeof requestAnimationFrame;function es(e){var t=B,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),B=t}function ea(e){var t=B;e.__c=e.__(),B=t}function eo(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function el(e,t){return"function"==typeof t?t(e):t}function eu(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ep(e,t){this.props=e,this.context=t}(ep.prototype=new S).isPureReactComponent=!0,ep.prototype.shouldComponentUpdate=function(e,t){return eu(this.props,e)||eu(this.state,t)};var ed=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ed&&ed(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var eh=a.__e;a.__e=function(e,t,i,r){if(e.then){for(var n,s=t;s=s.__;)if((n=s.__c)&&n.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),n.__c(e,t)}eh(e,t,i,r)};var ec=a.unmount;function ef(){this.__u=0,this.t=null,this.__b=null}function em(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function eg(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ec&&ec(e)},(ef.prototype=new S).__c=function(e,t){var i=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(i);var n=em(r.__v),s=!1,a=function(){s||(s=!0,i.__R=null,n?n(o):o())};i.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e,t=r.state.__a;r.__v.__k[0]=function e(t,i,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)}),t.__c&&t.__c.__P===i&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}(t,t.__c.__P,t.__c.__O)}for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},ef.prototype.componentWillUnmount=function(){this.t=[]},ef.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,i,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var i in t)e[i]=t[i];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=i),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)})),t}(this.__b,i,r.__O=r.__P)}this.__b=null}var n=t.__a&&w(P,null,e.fallback);return n&&(n.__u&=-33),[w(P,null,t.__a?null:e.children),n]};var ey=function(e,t,i){if(++i[1]===i[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(i=e.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.u=i=i[2]}};(eg.prototype=new S).__a=function(e){var t=this,i=em(t.__v),r=t.o.get(e);return r[0]++,function(n){var s=function(){t.props.revealOrder?(r.push(n),ey(t,e,r)):n()};i?i(s):s()}},eg.prototype.render=function(e){this.u=null,this.o=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.o.set(t[i],this.u=[1,0,this.u]);return e.children},eg.prototype.componentDidUpdate=eg.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,i){ey(e,i,t)})};var ev="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,eb=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,e_=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ew=/[A-Z0-9]/g,eC="undefined"!=typeof document;function eP(e,t,i){var r,n,o,l,u,p,d;return null==t.__k&&(t.textContent=""),r=e,n=t,a.__&&a.__(r,n),u=(l=false,o&&o.__k||n.__k),p=[],d=[],O(n,r=(!l&&o||n).__k=w(P,null,[r]),u||m,m,n.namespaceURI,!l&&o?[o]:u?null:n.firstChild?s.call(n.childNodes):null,p,!l&&o?o:u?u.__e:n.firstChild,l,d),N(p,r,d),"function"==typeof i&&i(),e?e.__c:null}S.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var eS=a.event;function ek(){}function eF(){return this.cancelBubble}function eT(){return this.defaultPrevented}a.event=function(e){return eS&&(e=eS(e)),e.persist=ek,e.isPropagationStopped=eF,e.isDefaultPrevented=eT,e.nativeEvent=e};var eE={enumerable:!1,configurable:!0,get:function(){return this.class}},ex=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,i=e.type,r={},n=-1===i.indexOf("-");for(var s in t){var a=t[s];if(!("value"===s&&"defaultValue"in t&&null==a||eC&&"children"===s&&"noscript"===i||"class"===s||"className"===s)){var o,l=s.toLowerCase();"defaultValue"===s&&"value"in t&&null==t.value?s="value":"download"===s&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?s="ondblclick":"onchange"!==l||"input"!==i&&"textarea"!==i||(o=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(o))?"onfocus"===l?s="onfocusin":"onblur"===l?s="onfocusout":e_.test(s)&&(s=l):l=s="oninput":n&&eb.test(s)?s=s.replace(ew,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[s=l]&&(s="oninputCapture"),r[s]=a}}"select"==i&&r.multiple&&Array.isArray(r.value)&&(r.value=x(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==i&&null!=r.defaultValue&&(r.value=x(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",eE)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=ev,ex&&ex(e)};var eI=a.__r;a.__r=function(e){eI&&eI(e),e.__c};var eD=a.diffed;a.diffed=function(e){eD&&eD(e);var t=e.props,i=e.__e;null!=i&&"textarea"===e.type&&"value"in t&&t.value!==i.value&&(i.value=null==t.value?"":t.value)};var eA=i(81374);class eO extends eA.Z{#eb;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;return"function"==typeof e?.addTarget?(t=e)instanceof eO||console.warn(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:eO}})):"function"==typeof e&&this.uppy.iteratePlugins(i=>{i instanceof e&&(t=i)}),t}mount(e,t){let i=t.id,s=function(e,t=document){return"string"==typeof e?t.querySelector(e):r(e)?e:null}(e);if(s){var a;let t,r;this.isTargetDOMEl=!0;let o=document.createElement("div");return o.classList.add("uppy-Root"),this.#eb=(a=e=>{this.uppy.getPlugin(this.id)&&(eP(this.render(e,o),o),this.afterUpdate())},r=null,(...e)=>(t=e,r||(r=Promise.resolve().then(()=>(r=null,a(...t)))),r)),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),eP(this.render(this.uppy.getState(),o),o),this.el=o,s.appendChild(o),o.dir=this.opts.direction||n(o)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let l=`Invalid target option given to ${i}.`;throw"function"==typeof e?l+=" 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.":l+="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.",Error(l)}render(e,t){throw Error("Extend the render method to add your plugin to a DOM element")}update(e){null!=this.el&&this.#eb?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}let eN=eO;var eU=0;function eM(e,t,i,r,n,s){t||(t={});var o,l,u=t;"ref"in t&&(o=t.ref,delete t.ref);var p={type:e,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--eU,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===u[l]&&(u[l]=o[l]);return a.vnode&&a.vnode(p),p}let eR={i8:"4.3.1"};class eL extends S{ref={current:null};componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){let{children:e}=this.props;return eM("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function eB(e){let t={};for(let n=0;n<e.length;n++)if(null!=e[n]){var i,r;t[i=e[n],r=n.toString(36),i?.key??r]=e[n]}return t}class ez extends S{constructor(e,t){super(e,t),this.refs={},this.state={children:eB(x(x(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t;let i=eB(x(e.children)||[]),r=this.state.children;for(t in this.setState(e=>({children:function(e,t){e=e||{},t=t||{};let i=i=>Object.hasOwn(t,i)?t[i]:e[i],r={},n=[];for(let i in e)Object.hasOwn(t,i)?n.length&&(r[i]=n,n=[]):n.push(i);let s={};for(let e in t){if(Object.hasOwn(r,e))for(let t=0;t<r[e].length;t++){let n=r[e][t];s[r[e][t]]=i(n)}s[e]=i(e)}for(let e=0;e<n.length;e++)s[n[e]]=i(n[e]);return s}(e.children,i)})),i)if(Object.hasOwn(i,t)){let e=r&&Object.hasOwn(r,t);i[t]&&e&&this.currentlyTransitioningKeys[t]?(this.keysToEnter.push(t),this.keysToAbortLeave.push(t)):!i[t]||e||this.currentlyTransitioningKeys[t]||this.keysToEnter.push(t)}for(t in r)if(Object.hasOwn(r,t)){let e=i&&Object.hasOwn(i,t);!r[t]||e||this.currentlyTransitioningKeys[t]||this.keysToLeave.push(t)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eB(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eB(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;let t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let i=eB(x(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{let t=Object.assign({},this.state.children);delete t[e],this.setState({children:t})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:n,transitionLeaveTimeout:s,transitionEnterTimeout:a,transitionAppearTimeout:o,component:l,...u},{children:p}){return w(l,u,Object.entries(p).map(([t,i])=>{if(!i)return;let r=function(e,t){let i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return R(e(i),{ref:r,key:t})}).filter(Boolean))}}ez.defaultProps={component:"span",childFactory:e=>e};class eq extends eN{static VERSION=eR.i8;constructor(e,t){super(e,t),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}render=e=>eM("div",{className:"uppy uppy-Informer",children:eM(ez,{children:e.info.map(e=>eM(eL,{children:eM("p",{role:"alert",children:[e.message," ",e.details&&eM("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message}
2
2
 
3
- ${e.details}`),children:"?"})]})},e.message))})});install(){let{target:e}=this.opts;e&&this.mount(e,this)}}function eH(){return eM("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:eM("g",{fill:"none","fill-rule":"evenodd",children:[eM("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),eM("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),eM("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),eM("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),eM("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),eM("path",{d:"M4 4h18v18H4z"})]})})}function e$({pluginName:e,i18n:t,onAuth:i}){let r="Google Drive"===e;return eM("form",{onSubmit:ei(e=>{e.preventDefault(),i()},[i]),children:r?eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0,children:[eM(eH,{}),t("signInWithGoogle")]}):eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}let eV=({pluginName:e,i18n:t,onAuth:i})=>eM(e$,{pluginName:e,i18n:t,onAuth:i});function ej({loading:e,pluginName:t,pluginIcon:i,i18n:r,handleAuth:s,renderForm:n=eV}){return eM("div",{className:"uppy-Provider-auth",children:[eM("div",{className:"uppy-Provider-authIcon",children:i()}),eM("div",{className:"uppy-Provider-authTitle",children:r("authenticateWithTitle",{pluginName:t})}),n({pluginName:t,i18n:r,loading:e,onAuth:s})]})}function eW(e){let t=e.lastIndexOf(".");return -1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}function eG(e){return{...e,type:e.mimeType,extension:e.name?eW(e.name).extension:null}}var eK=i(48029);let eX={i8:"4.5.1"},eZ={position:"relative",width:"100%",minHeight:"100%"},eQ={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class eY extends S{constructor(e){super(e),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?.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}handleScroll=()=>{this.setState({offset:this.base.scrollTop})};handleResize=()=>{this.resize()};resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render({data:e,rowHeight:t,renderRow:i,overscanCount:r=10,...s}){let{offset:n,height:a}=this.state,o=Math.floor(n/t),l=Math.floor(a/t);r&&(o=Math.max(0,o-o%r),l+=r);let u=o+l+4,p=e.slice(o,u),h={...eZ,height:e.length*t},d={...eQ,top:o*t};return eM("div",{onScroll:this.handleScroll,...s,children:eM("div",{role:"presentation",style:h,children:eM("div",{role:"presentation",style:d,children:p.map(i)})})})}}function eJ(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:eM("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"})})}function e1(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:eM("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"})})}function e0(){return eM("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[eM("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),eM("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"})]})}function e5({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return eM(eJ,{});case"folder":return eM(e1,{});case"video":return eM(e0,{});default:return eM("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}let e2=function({file:e,toggleCheckbox:t,className:i,isDisabled:r,restrictionError:s,showTitles:n,children:a=null,i18n:o}){return eM("li",{className:i,title:r&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:r,"data-uppy-super-focusable":!0}),eM("label",{htmlFor:e.id,"aria-label":e.data.name??o("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM(e5,{itemIconString:e.data.thumbnail||e.data.icon}),n&&(e.data.name??o("unnamed")),a]})]})};function e3({file:e,openFolder:t,className:i,isDisabled:r,restrictionError:s,toggleCheckbox:n,showTitles:a,i18n:o}){return eM("li",{className:i,title:"checked"!==e.status&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:n,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?o("allFilesFromFolderNamed",{name:e.data.name??o("unnamed")}):null,disabled:r,"data-uppy-super-focusable":!0}),e.data.isFolder?eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":o("openFolderNamed",{name:e.data.name??o("unnamed")}),children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e5,{itemIconString:e.data.icon})}),a&&e.data.name?eM("span",{children:e.data.name}):o("unnamed")]}):eM("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e5,{itemIconString:e.data.icon})}),a&&(e.data.name??o("unnamed"))]})]})}function e8(e){let{viewType:t,toggleCheckbox:i,showTitles:r,i18n:s,openFolder:n,file:a,utmSource:o}=e,l="folder"===a.type?null:a.restrictionError,u=!!l&&"checked"!==a.status,p={file:a,openFolder:n,toggleCheckbox:i,utmSource:o,i18n:s,viewType:t,showTitles:r,className:eK("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":"video"===a.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===a.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===a.status}),isDisabled:u,restrictionError:l};switch(t){case"grid":return eM(e2,{...p});case"list":return eM(e3,{...p});case"unsplash":return eM(e2,{...p,children:eM("a",{href:`${a.data.author.url}?utm_source=${o}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,children:a.data.author.name})});default:throw Error(`There is no such type ${t}`)}}let e4=function(e){let{displayedPartialTree:t,viewType:i,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:a,isLoading:o,openFolder:l,noResultsLabel:u,virtualList:p,utmSource:h}=e,[d,c]=Y(!1);if(J(()=>{let e=e=>{"Shift"===e.key&&c(!1)},t=e=>{"Shift"===e.key&&c(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),o)return eM("div",{className:"uppy-Provider-loading",children:"string"==typeof o?o:a("loading")});if(0===t.length)return eM("div",{className:"uppy-Provider-empty",children:u});let f=e=>eM(e8,{viewType:i,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),r(e,d)},showTitles:n,i18n:a,openFolder:l,file:e,utmSource:h});return p?eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",children:eM(eY,{data:t,renderRow:f,rowHeight:31})})}):eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,tabIndex:-1,children:t.map(f)})})},e7=e=>e.filter(t=>"file"===t.type&&"checked"===t.status||"folder"===t.type&&"checked"===t.status&&!e.some(e=>"root"!==e.type&&e.parentId===t.id)).length;function e6({cancelSelection:e,donePicking:t,i18n:i,partialTree:r,validateAggregateRestrictions:s}){let n=et(()=>s(r),[r,s]),a=et(()=>e7(r),[r]);return 0===a?null:eM("div",{className:"uppy-ProviderBrowser-footer",children:[eM("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[eM("button",{className:eK("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":n}),disabled:!!n,onClick:t,type:"button",children:i("selectX",{smart_count:a})}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:i("cancel")})]}),n&&eM("div",{className:"uppy-ProviderBrowser-footer-error",children:n})]})}let e9=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},te=function({searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:r,inputClassName:s,inputLabel:n,clearSearchLabel:a="",showButton:o=!1,buttonLabel:l="",buttonCSSClassName:u=""}){let p=ei(e=>{e.preventDefault(),i()},[i]),[h]=Y(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=e9(),e});return J(()=>(document.body.appendChild(h),h.addEventListener("submit",p),()=>{h.removeEventListener("submit",p),document.body.removeChild(h)}),[h,p]),eM("section",{className:r,children:[eM("input",{className:`uppy-u-reset ${s}`,type:"search","aria-label":n,placeholder:n,value:e,onInput:e=>{t(e.target.value)},form:h.id,"data-uppy-super-focusable":!0}),!o&&eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:eM("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})}),!o&&e&&eM("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t(""),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:eM("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"})})}),o&&eM("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${u}`,type:"submit",form:h.id,children:l})]})},tt={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function ti(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${e.charCodeAt(0).toString(32)}`,"/"))+t}let tr=(e,t,i)=>({id:e.id,source:t.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath},body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${i.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:i.name,provider:i.provider,requestClientId:i.provider}}),ts=(e,t,i)=>{let r=e.map(e=>tr(e,t,i)),s=[],n=[];r.forEach(e=>{t.uppy.checkIfFileAlreadyExists(function(e,t){var i;let r;if(e.isRemote&&e.remote&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider))return e.id;let s=function(e){if(e.type)return e.type;let t=e.name?eW(e.name).extension?.toLowerCase():null;return t&&t in tt?tt[t]:"application/octet-stream"}(e);return i={...e,type:s},r=t||"uppy","string"==typeof i.name&&(r+=`-${ti(i.name.toLowerCase())}`),void 0!==i.type&&(r+=`-${i.type}`),i.meta&&"string"==typeof i.meta.relativePath&&(r+=`-${ti(i.meta.relativePath.toLowerCase())}`),void 0!==i.data.size&&(r+=`-${i.data.size}`),void 0!==i.data.lastModified&&(r+=`-${i.data.lastModified}`),r}(e,t.uppy.getID()))?n.push(e):s.push(e)}),s.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&t.uppy.info(`Not adding ${n.length} files because they already exist`),t.uppy.addFiles(s)},tn=(e,t,i,r)=>{let s=t.findIndex(e=>e.id===r);if(-1!==s&&i){let i=t.findIndex(t=>t.id===e);return t.slice(Math.min(s,i),Math.max(s,i)+1).map(e=>e.id)}return[e]},ta=e=>t=>{if(!t.isAuthError){if("AbortError"===t.name){e.log("Aborting request","warning");return}e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)}},to=(e,t)=>{let i=e.find(e=>e.id===t),r=[];for(;r=[i,...r],"root"!==i.type;){let t=i.parentId;i=e.find(e=>e.id===t)}return r},tl=(e,t,i)=>{let r=null===t?"null":t;if(i[r])return i[r];let s=e.find(e=>e.id===t);if("root"===s.type)return[];let n=[...tl(e,s.parentId,i),s];return i[r]=n,n},tu=e=>{let t=Object.create(null);return e.filter(e=>"file"===e.type&&"checked"===e.status).map(i=>{let r=tl(e,i.id,t),s=r.findIndex(e=>"folder"===e.type&&"checked"===e.status),n=r.slice(s),a=`/${r.map(e=>e.data.name).join("/")}`,o=1===n.length?void 0:n.map(e=>e.data.name).join("/");return{...i.data,absDirPath:a,relDirPath:o}})};var tp=i(37520);class th extends Error{constructor(e){super(e),this.name="TimeoutError"}}class td extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let tc=e=>void 0===globalThis.DOMException?new td(e):new DOMException(e),tf=e=>{let t=void 0===e.reason?tc("This operation was aborted."):e.reason;return t instanceof Error?t:tc(t)};class tm{#P=[];enqueue(e,t){let i={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||this.#P[this.size-1].priority>=t.priority){this.#P.push(i);return}let r=function(e,t,i){let r=0,s=e.length;for(;s>0;){let n=Math.trunc(s/2),a=r+n;0>=i(e[a],t)?(r=++a,s-=n+1):s=n}return r}(this.#P,i,(e,t)=>t.priority-e.priority);this.#P.splice(r,0,i)}setPriority(e,t){let i=this.#P.findIndex(t=>t.id===e);if(-1===i)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#P.splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){let e=this.#P.shift();return e?.run}filter(e){return this.#P.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#P.length}}class tg extends tp{#e_;#ew;#eP=0;#eC;#eS;#ek=0;#eF;#eT;#P;#eE;#ex=0;#eI;#eD;#eA;#eO=1n;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tm,...e}).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e_=e.carryoverConcurrencyCount,this.#ew=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#eC=e.intervalCap,this.#eS=e.interval,this.#P=new e.queueClass,this.#eE=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#eA=!0===e.throwOnTimeout,this.#eD=!1===e.autoStart}get #eU(){return this.#ew||this.#eP<this.#eC}get #eN(){return this.#ex<this.#eI}#w(){this.#ex--,this.#eM(),this.emit("next")}#eR(){this.#eB(),this.#eL(),this.#eT=void 0}get #ez(){let e=Date.now();if(void 0===this.#eF){let t=this.#ek-e;if(!(t<0))return void 0===this.#eT&&(this.#eT=setTimeout(()=>{this.#eR()},t)),!0;this.#eP=this.#e_?this.#ex:0}return!1}#eM(){if(0===this.#P.size)return this.#eF&&clearInterval(this.#eF),this.#eF=void 0,this.emit("empty"),0===this.#ex&&this.emit("idle"),!1;if(!this.#eD){let e=!this.#ez;if(this.#eU&&this.#eN){let t=this.#P.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#eL(),!0)}}return!1}#eL(){this.#ew||void 0!==this.#eF||(this.#eF=setInterval(()=>{this.#eB()},this.#eS),this.#ek=Date.now()+this.#eS)}#eB(){0===this.#eP&&0===this.#ex&&this.#eF&&(clearInterval(this.#eF),this.#eF=void 0),this.#eP=this.#e_?this.#ex:0,this.#eq()}#eq(){for(;this.#eM(););}get concurrency(){return this.#eI}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#eI=e,this.#eq()}async #eH(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}setPriority(e,t){this.#P.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#eO++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#eA,...t},new Promise((i,r)=>{this.#P.enqueue(async()=>{this.#ex++,this.#eP++;try{t.signal?.throwIfAborted();let r=e({signal:t.signal});t.timeout&&(r=function(e,t){let i,r;let{milliseconds:s,fallback:n,message:a,customTimers:o={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof s||1!==Math.sign(s))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${s}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(tf(e)),r=()=>{u(tf(e))},e.addEventListener("abort",r,{once:!0})}if(s===Number.POSITIVE_INFINITY){e.then(l,u);return}let p=new th;i=o.setTimeout.call(void 0,()=>{if(n){try{l(n())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===a?l():a instanceof Error?u(a):(p.message=a??`Promise timed out after ${s} milliseconds`,u(p))},s),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),r&&t.signal&&t.signal.removeEventListener("abort",r)});return l.clear=()=>{o.clearTimeout.call(void 0,i),i=void 0},l}(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#eH(t.signal)]));let s=await r;i(s),this.emit("completed",s)}catch(e){if(e instanceof th&&!t.throwOnTimeout){i();return}r(e),this.emit("error",e)}finally{this.#w()}},t),this.emit("add"),this.#eM()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#eD&&(this.#eD=!1,this.#eq()),this}pause(){this.#eD=!0}clear(){this.#P=new this.#eE}async onEmpty(){0!==this.#P.size&&await this.#e$("empty")}async onSizeLessThan(e){this.#P.size<e||await this.#e$("next",()=>this.#P.size<e)}async onIdle(){(0!==this.#ex||0!==this.#P.size)&&await this.#e$("idle")}async #e$(e,t){return new Promise(i=>{let r=()=>{(!t||t())&&(this.off(e,r),i())};this.on(e,r)})}get size(){return this.#P.size}sizeBy(e){return this.#P.filter(e).length}get pending(){return this.#ex}get isPaused(){return this.#eD}}let ty=e=>e.map(e=>({...e})),tv=async(e,t,i,r,s)=>{let n=[],a=i.cached?i.nextPagePath:i.id;for(;a;){let e=await r(a);n=n.concat(e.items),a=e.nextPagePath}let o=n.filter(e=>!0===e.isFolder),l=n.filter(e=>!1===e.isFolder),u=o.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:i.id,data:e})),p=l.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:i.id,data:e}});i.cached=!0,i.nextPagePath=null,t.push(...p,...u),u.forEach(async i=>{e.add(()=>tv(e,t,i,r,s))})},tb=(e,t,i)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=i&&!("file"===t.type&&t.restrictionError)?"checked":"unchecked",tb(e,t.id,i)})},t_=(e,t)=>{let i=e.find(e=>e.id===t);if("root"===i.type)return;let r=e.filter(e=>"root"!==e.type&&e.parentId===i.id&&!("file"===e.type&&e.restrictionError)),s=r.every(e=>"checked"===e.status),n=r.every(e=>"unchecked"===e.status);s?i.status="checked":n?i.status="unchecked":i.status="partial",t_(e,i.parentId)},tw={afterOpenFolder:(e,t,i,r,s)=>{let n=t.filter(e=>!0===e.isFolder),a=t.filter(e=>!1===e.isFolder),o="folder"===i.type&&"checked"===i.status,l=n.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:o?"checked":"unchecked",parentId:i.id,data:e})),u=a.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:o&&!t?"checked":"unchecked",parentId:i.id,data:e}}),p={...i,cached:!0,nextPagePath:r};return[...e.map(e=>e.id===p.id?p:e),...l,...u]},afterScrollFolder:(e,t,i,r,s)=>{let n=e.find(e=>e.id===t),a=i.filter(e=>!0===e.isFolder),o=i.filter(e=>!1===e.isFolder),l={...n,nextPagePath:r},u=e.map(e=>e.id===l.id?l:e),p="folder"===l.type&&"checked"===l.status;return[...u,...a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:p?"checked":"unchecked",parentId:l.id,data:e})),...o.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:p&&!t?"checked":"unchecked",parentId:l.id,data:e}})]},afterToggleCheckbox:(e,t)=>{let i=ty(e);if(t.length>=2){let e=i.filter(e=>"root"!==e.type&&t.includes(e.id));e.forEach(e=>{"file"===e.type?e.status=e.restrictionError?"unchecked":"checked":e.status="checked"}),e.forEach(e=>{tb(i,e.id,!0)}),t_(i,e[0].parentId)}else{let e=i.find(e=>e.id===t[0]);e.status="checked"===e.status?"unchecked":"checked",tb(i,e.id,"checked"===e.status),t_(i,e.parentId)}return i},afterFill:async(e,t,i,r)=>{let s=new tg({concurrency:6}),n=ty(e);return n.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{s.add(()=>tv(s,n,e,t,i))}),s.on("completed",()=>{r(n.filter(e=>"file"===e.type&&"checked"===e.status).length)}),await s.onIdle(),n}},tP=e=>{let{scrollHeight:t,scrollTop:i,offsetHeight:r}=e.target;return t-(i+r)<50};function tC(e){let{openFolder:t,title:i,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=e;return eM("div",{className:"uppy-Provider-breadcrumbs",children:[eM("div",{className:"uppy-Provider-breadcrumbsIcon",children:r}),s.map((e,r)=>eM(C,{children:[eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?i:e.data.name??n("unnamed")},e.id),s.length===r+1?"":" / "]}))]})}function tS({i18n:e,logout:t,username:i}){return eM(C,{children:[i&&eM("span",{className:"uppy-ProviderBrowser-user",children:i},"username"),eM("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",children:e("logOut")},"logout")]})}function tk(e){return eM("div",{className:"uppy-ProviderBrowser-header",children:eM("div",{className:eK("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&eM(tC,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),eM(tS,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function tF(){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:eM("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"})})}let tT=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});class tE{static VERSION=eX.i8;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(tT(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}#F;async #eV(e){this.#F?.abort();let t=new AbortController;this.#F=t;let i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),this.#F=void 0}}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(t=>t.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await this.#eV(async r=>{let s=e,n=[];do{let{username:e,nextPagePath:t,items:i}=await this.provider.list(s,{signal:r});this.plugin.setPluginState({username:e}),s=t,n=n.concat(i),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length}))}while(this.opts.loadAllFiles&&s);let a=tw.afterOpenFolder(t,n,i,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}async logout(){await this.#eV(async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...tT(this.plugin.rootFolderId),authenticated:!1})}}).catch(ta(this.plugin.uppy))}async handleAuth(e){await this.#eV(async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),r=t.find(e=>e.id===i);tP(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,await this.#eV(async e=>{let{nextPagePath:s,items:n}=await this.provider.list(r.nextPagePath,{signal:e}),a=tw.afterScrollFolder(t,i,n,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a})}).catch(ta(this.plugin.uppy)),this.isHandlingScroll=!1)}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await this.#eV(async t=>{let i=await tw.afterFill(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}ts(tu(i),this.plugin,this.provider),this.resetPluginState()}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=tn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}getDisplayedPartialTree=()=>{let{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),r=e.filter(e=>"root"!==e.type&&e.parentId===t);return""===i?r:r.filter(e=>-1!==(e.data.name??this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(i.toLowerCase()))};getBreadcrumbs=()=>{let{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return to(e,t)};getSelectedAmount=()=>{let{partialTree:e}=this.plugin.getPluginState();return e7(e)};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let s={...this.opts,...t},{authenticated:n,loading:a}=this.plugin.getPluginState(),o=this.plugin.icon||tF;if(!1===n)return eM(ej,{pluginName:this.plugin.title,pluginIcon:o,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:s.renderAuthForm,loading:a});let{partialTree:l,username:u,searchString:p}=this.plugin.getPluginState(),h=this.getBreadcrumbs();return eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s.viewType}`),children:[eM(tk,{showBreadcrumbs:s.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:o,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),s.showFilter&&eM(te,{searchString:p,setSearchString:e=>{this.plugin.setPluginState({searchString:e})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:s.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:s.viewType,showTitles:s.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),eM(e6,{partialTree:l,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}let tx={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},tI={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"};class tD{static VERSION=eX.i8;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={...tI,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(tx)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(""!==e){this.setLoading(!0);try{let t=await this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(e){ta(this.plugin.uppy)(e)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),r=t.find(e=>"root"===e.type);if(tP(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let e=await this.provider.search(i,r.nextPagePath),s={...r,nextPagePath:e.nextPageQuery},n=t.filter(e=>"root"!==e.type),a=[s,...n,...e.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:a})}catch(e){ta(this.plugin.uppy)(e)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();ts(tu(e),this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=tn(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};getDisplayedPartialTree=()=>{let{partialTree:e}=this.plugin.getPluginState();return e.filter(e=>"root"!==e.type)};setSearchString=e=>{this.plugin.setPluginState({searchString:e}),""===e&&this.plugin.setPluginState({partialTree:[]})};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{isInputMode:i,searchString:r,loading:s,partialTree:n}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,o={...this.opts,...t};return i?eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`),children:[o.showFilter&&eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:o.viewType,showTitles:o.showTitles,isLoading:s,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),eM(e6,{partialTree:n,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}function tA(e,t,i,r){return 0===i||e===t?e:0===r?t:e+(t-e)*2**(-r/i)}let tO={i8:"4.2.1"},tU={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"}},tN={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var tM=i(4354);let tR=`\u00B7`,tB=()=>` ${tR} `;function tL(e){let{newFiles:t,isUploadStarted:i,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:a,startUpload:o}=e,l=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===tN.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=s(t&&i&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return eM("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:u})}function tz(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:eM("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})}),t("retry")]})}function tq(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("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 tH(e){let{isAllPaused:t,i18n:i,isAllComplete:r,resumableUploads:s,uppy:n}=e,a=i(t?"resume":"pause");return eM("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){if(!r){if(!s){n.cancelAll();return}if(t){n.resumeAll();return}n.pauseAll()}},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function t$(e){let{i18n:t,doneButtonHandler:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function tV(){return eM("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:eM("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 tj(e){let{progress:t}=e,{value:i,mode:r,message:s}=t,n=`\u00B7`;return eM("div",{className:"uppy-StatusBar-content",children:[eM(tV,{}),"determinate"===r?`${Math.round(100*i)}% ${n} `:"",s]})}function tW(e){let{numUploads:t,complete:i,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:a}=e,o=t>1,l=tM(r);return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),eM("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&tB(),null!=s?a("dataUploadedOfTotal",{complete:l,total:tM(s)}):a("dataUploadedOfUnknown",{complete:l}),tB(),null!=n&&a("xTimeLeft",{time:function(e){let t={hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)},i=0===t.hours?"":`${t.hours}h`,r=0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,s=0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${i}${r}${s}`}(n)})]})]})}function tG(e){let{i18n:t,complete:i,numUploads:r}=e;return eM("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:r})})}function tK(e){let{i18n:t,newFiles:i,startUpload:r}=e,s=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[eM("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),eM("button",{type:"button",className:s,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:r,children:t("upload")})]})}function tX(e){let{i18n:t,supportsUploadProgress:i,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:u,complete:p,totalUploadedSize:h,totalSize:d,totalETA:c,startUpload:f}=e,m=l&&n;if(!n||a)return null;let g=t(o?"paused":"uploading");return eM("div",{className:"uppy-StatusBar-content",title:g,children:[o?null:eM(tV,{}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==r?`${g}: ${r}%`:g}),o||m||!s?null:i?eM(tW,{numUploads:u,complete:p,totalUploadedSize:h,totalSize:d,totalETA:c,i18n:t}):eM(tG,{i18n:t,complete:p,numUploads:u}),m?eM(tK,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function tZ(e){let{i18n:t}=e;return eM("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:eM("div",{className:"uppy-StatusBar-status",children:eM("div",{className:"uppy-StatusBar-statusPrimary",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:eM("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function tQ(e){let{error:t,i18n:i,complete:r,numUploads:s}=e;return eM("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("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"})}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),eM("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){alert(`${i("uploadFailed")}
3
+ ${e.details}`),children:"?"})]})},e.message))})});install(){let{target:e}=this.opts;e&&this.mount(e,this)}}function eH(){return eM("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:eM("g",{fill:"none","fill-rule":"evenodd",children:[eM("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),eM("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),eM("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),eM("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),eM("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),eM("path",{d:"M4 4h18v18H4z"})]})})}function e$({pluginName:e,i18n:t,onAuth:i}){let r="Google Drive"===e;return eM("form",{onSubmit:ei(e=>{e.preventDefault(),i()},[i]),children:r?eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0,children:[eM(eH,{}),t("signInWithGoogle")]}):eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}let ej=({pluginName:e,i18n:t,onAuth:i})=>eM(e$,{pluginName:e,i18n:t,onAuth:i});function eV({loading:e,pluginName:t,pluginIcon:i,i18n:r,handleAuth:n,renderForm:s=ej}){return eM("div",{className:"uppy-Provider-auth",children:[eM("div",{className:"uppy-Provider-authIcon",children:i()}),eM("div",{className:"uppy-Provider-authTitle",children:r("authenticateWithTitle",{pluginName:t})}),s({pluginName:t,i18n:r,loading:e,onAuth:n})]})}function eW(e){let t=e.lastIndexOf(".");return -1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}function eG(e){return{...e,type:e.mimeType,extension:e.name?eW(e.name).extension:null}}var eK=i(48029);let eX={i8:"4.5.1"},eZ={position:"relative",width:"100%",minHeight:"100%"},eQ={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class eY extends S{constructor(e){super(e),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?.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}handleScroll=()=>{this.setState({offset:this.base.scrollTop})};handleResize=()=>{this.resize()};resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render({data:e,rowHeight:t,renderRow:i,overscanCount:r=10,...n}){let{offset:s,height:a}=this.state,o=Math.floor(s/t),l=Math.floor(a/t);r&&(o=Math.max(0,o-o%r),l+=r);let u=o+l+4,p=e.slice(o,u),d={...eZ,height:e.length*t},h={...eQ,top:o*t};return eM("div",{onScroll:this.handleScroll,...n,children:eM("div",{role:"presentation",style:d,children:eM("div",{role:"presentation",style:h,children:p.map(i)})})})}}function eJ(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:eM("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"})})}function e1(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:eM("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"})})}function e0(){return eM("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[eM("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),eM("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"})]})}function e5({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return eM(eJ,{});case"folder":return eM(e1,{});case"video":return eM(e0,{});default:return eM("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}let e2=function({file:e,toggleCheckbox:t,className:i,isDisabled:r,restrictionError:n,showTitles:s,children:a=null,i18n:o}){return eM("li",{className:i,title:r&&n?n:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:r,"data-uppy-super-focusable":!0}),eM("label",{htmlFor:e.id,"aria-label":e.data.name??o("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM(e5,{itemIconString:e.data.thumbnail||e.data.icon}),s&&(e.data.name??o("unnamed")),a]})]})};function e3({file:e,openFolder:t,className:i,isDisabled:r,restrictionError:n,toggleCheckbox:s,showTitles:a,i18n:o}){return eM("li",{className:i,title:"checked"!==e.status&&n?n:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:s,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?o("allFilesFromFolderNamed",{name:e.data.name??o("unnamed")}):null,disabled:r,"data-uppy-super-focusable":!0}),e.data.isFolder?eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":o("openFolderNamed",{name:e.data.name??o("unnamed")}),children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e5,{itemIconString:e.data.icon})}),a&&e.data.name?eM("span",{children:e.data.name}):o("unnamed")]}):eM("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e5,{itemIconString:e.data.icon})}),a&&(e.data.name??o("unnamed"))]})]})}function e8(e){let{viewType:t,toggleCheckbox:i,showTitles:r,i18n:n,openFolder:s,file:a,utmSource:o}=e,l="folder"===a.type?null:a.restrictionError,u=!!l&&"checked"!==a.status,p={file:a,openFolder:s,toggleCheckbox:i,utmSource:o,i18n:n,viewType:t,showTitles:r,className:eK("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":"video"===a.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===a.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===a.status}),isDisabled:u,restrictionError:l};switch(t){case"grid":return eM(e2,{...p});case"list":return eM(e3,{...p});case"unsplash":return eM(e2,{...p,children:eM("a",{href:`${a.data.author.url}?utm_source=${o}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,children:a.data.author.name})});default:throw Error(`There is no such type ${t}`)}}let e4=function(e){let{displayedPartialTree:t,viewType:i,toggleCheckbox:r,handleScroll:n,showTitles:s,i18n:a,isLoading:o,openFolder:l,noResultsLabel:u,virtualList:p,utmSource:d}=e,[h,c]=Y(!1);if(J(()=>{let e=e=>{"Shift"===e.key&&c(!1)},t=e=>{"Shift"===e.key&&c(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),o)return eM("div",{className:"uppy-Provider-loading",children:"string"==typeof o?o:a("loading")});if(0===t.length)return eM("div",{className:"uppy-Provider-empty",children:u});let f=e=>eM(e8,{viewType:i,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),r(e,h)},showTitles:s,i18n:a,openFolder:l,file:e,utmSource:d});return p?eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",children:eM(eY,{data:t,renderRow:f,rowHeight:31})})}):eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",onScroll:n,tabIndex:-1,children:t.map(f)})})},e7=e=>e.filter(t=>"file"===t.type&&"checked"===t.status||"folder"===t.type&&"checked"===t.status&&!e.some(e=>"root"!==e.type&&e.parentId===t.id)).length;function e6({cancelSelection:e,donePicking:t,i18n:i,partialTree:r,validateAggregateRestrictions:n}){let s=et(()=>n(r),[r,n]),a=et(()=>e7(r),[r]);return 0===a?null:eM("div",{className:"uppy-ProviderBrowser-footer",children:[eM("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[eM("button",{className:eK("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":s}),disabled:!!s,onClick:t,type:"button",children:i("selectX",{smart_count:a})}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:i("cancel")})]}),s&&eM("div",{className:"uppy-ProviderBrowser-footer-error",children:s})]})}let e9=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},te=function({searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:r,inputClassName:n,inputLabel:s,clearSearchLabel:a="",showButton:o=!1,buttonLabel:l="",buttonCSSClassName:u=""}){let p=ei(e=>{e.preventDefault(),i()},[i]),[d]=Y(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=e9(),e});return J(()=>(document.body.appendChild(d),d.addEventListener("submit",p),()=>{d.removeEventListener("submit",p),document.body.removeChild(d)}),[d,p]),eM("section",{className:r,children:[eM("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":s,placeholder:s,value:e,onInput:e=>{t(e.target.value)},form:d.id,"data-uppy-super-focusable":!0}),!o&&eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:eM("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})}),!o&&e&&eM("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t(""),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:eM("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"})})}),o&&eM("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${u}`,type:"submit",form:d.id,children:l})]})},tt={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function ti(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${e.charCodeAt(0).toString(32)}`,"/"))+t}let tr=(e,t,i)=>({id:e.id,source:t.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath},body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${i.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:i.name,provider:i.provider,requestClientId:i.provider}}),tn=(e,t,i)=>{let r=e.map(e=>tr(e,t,i)),n=[],s=[];r.forEach(e=>{t.uppy.checkIfFileAlreadyExists(function(e,t){var i;let r;if(e.isRemote&&e.remote&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider))return e.id;let n=function(e){if(e.type)return e.type;let t=e.name?eW(e.name).extension?.toLowerCase():null;return t&&t in tt?tt[t]:"application/octet-stream"}(e);return i={...e,type:n},r=t||"uppy","string"==typeof i.name&&(r+=`-${ti(i.name.toLowerCase())}`),void 0!==i.type&&(r+=`-${i.type}`),i.meta&&"string"==typeof i.meta.relativePath&&(r+=`-${ti(i.meta.relativePath.toLowerCase())}`),void 0!==i.data.size&&(r+=`-${i.data.size}`),void 0!==i.data.lastModified&&(r+=`-${i.data.lastModified}`),r}(e,t.uppy.getID()))?s.push(e):n.push(e)}),n.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:n.length})),s.length>0&&t.uppy.info(`Not adding ${s.length} files because they already exist`),t.uppy.addFiles(n)},ts=(e,t,i,r)=>{let n=t.findIndex(e=>e.id===r);if(-1!==n&&i){let i=t.findIndex(t=>t.id===e);return t.slice(Math.min(n,i),Math.max(n,i)+1).map(e=>e.id)}return[e]},ta=e=>t=>{if(!t.isAuthError){if("AbortError"===t.name){e.log("Aborting request","warning");return}e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)}},to=(e,t)=>{let i=e.find(e=>e.id===t),r=[];for(;r=[i,...r],"root"!==i.type;){let t=i.parentId;i=e.find(e=>e.id===t)}return r},tl=(e,t,i)=>{let r=null===t?"null":t;if(i[r])return i[r];let n=e.find(e=>e.id===t);if("root"===n.type)return[];let s=[...tl(e,n.parentId,i),n];return i[r]=s,s},tu=e=>{let t=Object.create(null);return e.filter(e=>"file"===e.type&&"checked"===e.status).map(i=>{let r=tl(e,i.id,t),n=r.findIndex(e=>"folder"===e.type&&"checked"===e.status),s=r.slice(n),a=`/${r.map(e=>e.data.name).join("/")}`,o=1===s.length?void 0:s.map(e=>e.data.name).join("/");return{...i.data,absDirPath:a,relDirPath:o}})};var tp=i(37520);class td extends Error{constructor(e){super(e),this.name="TimeoutError"}}class th extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let tc=e=>void 0===globalThis.DOMException?new th(e):new DOMException(e),tf=e=>{let t=void 0===e.reason?tc("This operation was aborted."):e.reason;return t instanceof Error?t:tc(t)};class tm{#C=[];enqueue(e,t){let i={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||this.#C[this.size-1].priority>=t.priority){this.#C.push(i);return}let r=function(e,t,i){let r=0,n=e.length;for(;n>0;){let s=Math.trunc(n/2),a=r+s;0>=i(e[a],t)?(r=++a,n-=s+1):n=s}return r}(this.#C,i,(e,t)=>t.priority-e.priority);this.#C.splice(r,0,i)}setPriority(e,t){let i=this.#C.findIndex(t=>t.id===e);if(-1===i)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#C.splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){let e=this.#C.shift();return e?.run}filter(e){return this.#C.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#C.length}}class tg extends tp{#e_;#ew;#eC=0;#eP;#eS;#ek=0;#eF;#eT;#C;#eE;#ex=0;#eI;#eD;#eA;#eO=1n;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tm,...e}).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e_=e.carryoverConcurrencyCount,this.#ew=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#eP=e.intervalCap,this.#eS=e.interval,this.#C=new e.queueClass,this.#eE=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#eA=!0===e.throwOnTimeout,this.#eD=!1===e.autoStart}get #eN(){return this.#ew||this.#eC<this.#eP}get #eU(){return this.#ex<this.#eI}#w(){this.#ex--,this.#eM(),this.emit("next")}#eR(){this.#eL(),this.#eB(),this.#eT=void 0}get #ez(){let e=Date.now();if(void 0===this.#eF){let t=this.#ek-e;if(!(t<0))return void 0===this.#eT&&(this.#eT=setTimeout(()=>{this.#eR()},t)),!0;this.#eC=this.#e_?this.#ex:0}return!1}#eM(){if(0===this.#C.size)return this.#eF&&clearInterval(this.#eF),this.#eF=void 0,this.emit("empty"),0===this.#ex&&this.emit("idle"),!1;if(!this.#eD){let e=!this.#ez;if(this.#eN&&this.#eU){let t=this.#C.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#eB(),!0)}}return!1}#eB(){this.#ew||void 0!==this.#eF||(this.#eF=setInterval(()=>{this.#eL()},this.#eS),this.#ek=Date.now()+this.#eS)}#eL(){0===this.#eC&&0===this.#ex&&this.#eF&&(clearInterval(this.#eF),this.#eF=void 0),this.#eC=this.#e_?this.#ex:0,this.#eq()}#eq(){for(;this.#eM(););}get concurrency(){return this.#eI}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#eI=e,this.#eq()}async #eH(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}setPriority(e,t){this.#C.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#eO++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#eA,...t},new Promise((i,r)=>{this.#C.enqueue(async()=>{this.#ex++,this.#eC++;try{t.signal?.throwIfAborted();let r=e({signal:t.signal});t.timeout&&(r=function(e,t){let i,r;let{milliseconds:n,fallback:s,message:a,customTimers:o={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof n||1!==Math.sign(n))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(tf(e)),r=()=>{u(tf(e))},e.addEventListener("abort",r,{once:!0})}if(n===Number.POSITIVE_INFINITY){e.then(l,u);return}let p=new td;i=o.setTimeout.call(void 0,()=>{if(s){try{l(s())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===a?l():a instanceof Error?u(a):(p.message=a??`Promise timed out after ${n} milliseconds`,u(p))},n),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),r&&t.signal&&t.signal.removeEventListener("abort",r)});return l.clear=()=>{o.clearTimeout.call(void 0,i),i=void 0},l}(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#eH(t.signal)]));let n=await r;i(n),this.emit("completed",n)}catch(e){if(e instanceof td&&!t.throwOnTimeout){i();return}r(e),this.emit("error",e)}finally{this.#w()}},t),this.emit("add"),this.#eM()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#eD&&(this.#eD=!1,this.#eq()),this}pause(){this.#eD=!0}clear(){this.#C=new this.#eE}async onEmpty(){0!==this.#C.size&&await this.#e$("empty")}async onSizeLessThan(e){this.#C.size<e||await this.#e$("next",()=>this.#C.size<e)}async onIdle(){(0!==this.#ex||0!==this.#C.size)&&await this.#e$("idle")}async #e$(e,t){return new Promise(i=>{let r=()=>{(!t||t())&&(this.off(e,r),i())};this.on(e,r)})}get size(){return this.#C.size}sizeBy(e){return this.#C.filter(e).length}get pending(){return this.#ex}get isPaused(){return this.#eD}}let ty=e=>e.map(e=>({...e})),tv=async(e,t,i,r,n)=>{let s=[],a=i.cached?i.nextPagePath:i.id;for(;a;){let e=await r(a);s=s.concat(e.items),a=e.nextPagePath}let o=s.filter(e=>!0===e.isFolder),l=s.filter(e=>!1===e.isFolder),u=o.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:i.id,data:e})),p=l.map(e=>{let t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:i.id,data:e}});i.cached=!0,i.nextPagePath=null,t.push(...p,...u),u.forEach(async i=>{e.add(()=>tv(e,t,i,r,n))})},tb=(e,t,i)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=i&&!("file"===t.type&&t.restrictionError)?"checked":"unchecked",tb(e,t.id,i)})},t_=(e,t)=>{let i=e.find(e=>e.id===t);if("root"===i.type)return;let r=e.filter(e=>"root"!==e.type&&e.parentId===i.id&&!("file"===e.type&&e.restrictionError)),n=r.every(e=>"checked"===e.status),s=r.every(e=>"unchecked"===e.status);n?i.status="checked":s?i.status="unchecked":i.status="partial",t_(e,i.parentId)},tw={afterOpenFolder:(e,t,i,r,n)=>{let s=t.filter(e=>!0===e.isFolder),a=t.filter(e=>!1===e.isFolder),o="folder"===i.type&&"checked"===i.status,l=s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:o?"checked":"unchecked",parentId:i.id,data:e})),u=a.map(e=>{let t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:o&&!t?"checked":"unchecked",parentId:i.id,data:e}}),p={...i,cached:!0,nextPagePath:r};return[...e.map(e=>e.id===p.id?p:e),...l,...u]},afterScrollFolder:(e,t,i,r,n)=>{let s=e.find(e=>e.id===t),a=i.filter(e=>!0===e.isFolder),o=i.filter(e=>!1===e.isFolder),l={...s,nextPagePath:r},u=e.map(e=>e.id===l.id?l:e),p="folder"===l.type&&"checked"===l.status;return[...u,...a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:p?"checked":"unchecked",parentId:l.id,data:e})),...o.map(e=>{let t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:p&&!t?"checked":"unchecked",parentId:l.id,data:e}})]},afterToggleCheckbox:(e,t)=>{let i=ty(e);if(t.length>=2){let e=i.filter(e=>"root"!==e.type&&t.includes(e.id));e.forEach(e=>{"file"===e.type?e.status=e.restrictionError?"unchecked":"checked":e.status="checked"}),e.forEach(e=>{tb(i,e.id,!0)}),t_(i,e[0].parentId)}else{let e=i.find(e=>e.id===t[0]);e.status="checked"===e.status?"unchecked":"checked",tb(i,e.id,"checked"===e.status),t_(i,e.parentId)}return i},afterFill:async(e,t,i,r)=>{let n=new tg({concurrency:6}),s=ty(e);return s.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{n.add(()=>tv(n,s,e,t,i))}),n.on("completed",()=>{r(s.filter(e=>"file"===e.type&&"checked"===e.status).length)}),await n.onIdle(),s}},tC=e=>{let{scrollHeight:t,scrollTop:i,offsetHeight:r}=e.target;return t-(i+r)<50};function tP(e){let{openFolder:t,title:i,breadcrumbsIcon:r,breadcrumbs:n,i18n:s}=e;return eM("div",{className:"uppy-Provider-breadcrumbs",children:[eM("div",{className:"uppy-Provider-breadcrumbsIcon",children:r}),n.map((e,r)=>eM(P,{children:[eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?i:e.data.name??s("unnamed")},e.id),n.length===r+1?"":" / "]}))]})}function tS({i18n:e,logout:t,username:i}){return eM(P,{children:[i&&eM("span",{className:"uppy-ProviderBrowser-user",children:i},"username"),eM("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",children:e("logOut")},"logout")]})}function tk(e){return eM("div",{className:"uppy-ProviderBrowser-header",children:eM("div",{className:eK("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&eM(tP,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),eM(tS,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function tF(){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:eM("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"})})}let tT=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});class tE{static VERSION=eX.i8;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(tT(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}#F;async #ej(e){this.#F?.abort();let t=new AbortController;this.#F=t;let i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),this.#F=void 0}}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(t=>t.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await this.#ej(async r=>{let n=e,s=[];do{let{username:e,nextPagePath:t,items:i}=await this.provider.list(n,{signal:r});this.plugin.setPluginState({username:e}),n=t,s=s.concat(i),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length}))}while(this.opts.loadAllFiles&&n);let a=tw.afterOpenFolder(t,s,i,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}async logout(){await this.#ej(async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...tT(this.plugin.rootFolderId),authenticated:!1})}}).catch(ta(this.plugin.uppy))}async handleAuth(e){await this.#ej(async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),r=t.find(e=>e.id===i);tC(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,await this.#ej(async e=>{let{nextPagePath:n,items:s}=await this.provider.list(r.nextPagePath,{signal:e}),a=tw.afterScrollFolder(t,i,s,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a})}).catch(ta(this.plugin.uppy)),this.isHandlingScroll=!1)}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await this.#ej(async t=>{let i=await tw.afterFill(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}tn(tu(i),this.plugin,this.provider),this.resetPluginState()}).catch(ta(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}getDisplayedPartialTree=()=>{let{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),r=e.filter(e=>"root"!==e.type&&e.parentId===t);return""===i?r:r.filter(e=>-1!==(e.data.name??this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(i.toLowerCase()))};getBreadcrumbs=()=>{let{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return to(e,t)};getSelectedAmount=()=>{let{partialTree:e}=this.plugin.getPluginState();return e7(e)};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:s,loading:a}=this.plugin.getPluginState(),o=this.plugin.icon||tF;if(!1===s)return eM(eV,{pluginName:this.plugin.title,pluginIcon:o,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:l,username:u,searchString:p}=this.plugin.getPluginState(),d=this.getBreadcrumbs();return eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`),children:[eM(tk,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:d,pluginIcon:o,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),n.showFilter&&eM(te,{searchString:p,setSearchString:e=>{this.plugin.setPluginState({searchString:e})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),eM(e6,{partialTree:l,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}let tx={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},tI={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"};class tD{static VERSION=eX.i8;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={...tI,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(tx)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(""!==e){this.setLoading(!0);try{let t=await this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(e){ta(this.plugin.uppy)(e)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),r=t.find(e=>"root"===e.type);if(tC(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let e=await this.provider.search(i,r.nextPagePath),n={...r,nextPagePath:e.nextPageQuery},s=t.filter(e=>"root"!==e.type),a=[n,...s,...e.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:a})}catch(e){ta(this.plugin.uppy)(e)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();tn(tu(e),this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};getDisplayedPartialTree=()=>{let{partialTree:e}=this.plugin.getPluginState();return e.filter(e=>"root"!==e.type)};setSearchString=e=>{this.plugin.setPluginState({searchString:e}),""===e&&this.plugin.setPluginState({partialTree:[]})};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{isInputMode:i,searchString:r,loading:n,partialTree:s}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,o={...this.opts,...t};return i?eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`),children:[o.showFilter&&eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:o.viewType,showTitles:o.showTitles,isLoading:n,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),eM(e6,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}function tA(e,t,i,r){return 0===i||e===t?e:0===r?t:e+(t-e)*2**(-r/i)}let tO={i8:"4.2.1"},tN={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"}},tU={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var tM=i(4354);let tR=`\u00B7`,tL=()=>` ${tR} `;function tB(e){let{newFiles:t,isUploadStarted:i,recoveredState:r,i18n:n,uploadState:s,isSomeGhost:a,startUpload:o}=e,l=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===tU.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=n(t&&i&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return eM("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:u})}function tz(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:eM("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})}),t("retry")]})}function tq(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("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 tH(e){let{isAllPaused:t,i18n:i,isAllComplete:r,resumableUploads:n,uppy:s}=e,a=i(t?"resume":"pause");return eM("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){if(!r){if(!n){s.cancelAll();return}if(t){s.resumeAll();return}s.pauseAll()}},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function t$(e){let{i18n:t,doneButtonHandler:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function tj(){return eM("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:eM("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 tV(e){let{progress:t}=e,{value:i,mode:r,message:n}=t,s=`\u00B7`;return eM("div",{className:"uppy-StatusBar-content",children:[eM(tj,{}),"determinate"===r?`${Math.round(100*i)}% ${s} `:"",n]})}function tW(e){let{numUploads:t,complete:i,totalUploadedSize:r,totalSize:n,totalETA:s,i18n:a}=e,o=t>1,l=tM(r);return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),eM("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&tL(),null!=n?a("dataUploadedOfTotal",{complete:l,total:tM(n)}):a("dataUploadedOfUnknown",{complete:l}),tL(),null!=s&&a("xTimeLeft",{time:function(e){let t={hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)},i=0===t.hours?"":`${t.hours}h`,r=0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,n=0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${i}${r}${n}`}(s)})]})]})}function tG(e){let{i18n:t,complete:i,numUploads:r}=e;return eM("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:r})})}function tK(e){let{i18n:t,newFiles:i,startUpload:r}=e,n=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[eM("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),eM("button",{type:"button",className:n,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:r,children:t("upload")})]})}function tX(e){let{i18n:t,supportsUploadProgress:i,totalProgress:r,showProgressDetails:n,isUploadStarted:s,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:u,complete:p,totalUploadedSize:d,totalSize:h,totalETA:c,startUpload:f}=e,m=l&&s;if(!s||a)return null;let g=t(o?"paused":"uploading");return eM("div",{className:"uppy-StatusBar-content",title:g,children:[o?null:eM(tj,{}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==r?`${g}: ${r}%`:g}),o||m||!n?null:i?eM(tW,{numUploads:u,complete:p,totalUploadedSize:d,totalSize:h,totalETA:c,i18n:t}):eM(tG,{i18n:t,complete:p,numUploads:u}),m?eM(tK,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function tZ(e){let{i18n:t}=e;return eM("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:eM("div",{className:"uppy-StatusBar-status",children:eM("div",{className:"uppy-StatusBar-statusPrimary",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:eM("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function tQ(e){let{error:t,i18n:i,complete:r,numUploads:n}=e;return eM("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("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"})}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),eM("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){alert(`${i("uploadFailed")}
4
4
 
5
- ${t}`)},type:"button",children:"?"})]}),eM(tG,{i18n:i,complete:r,numUploads:s})]})]})}function tY(e){let t;let i=[],r="indeterminate";for(let{progress:s}of Object.values(e)){let{preprocess:e,postprocess:n}=s;null==t&&(e||n)&&({mode:r,message:t}=e||n),e?.mode==="determinate"&&i.push(e.value),n?.mode==="determinate"&&i.push(n.value)}return{mode:r,message:t,value:i.reduce((e,t)=>e+t/i.length,0)}}let{STATE_ERROR:tJ,STATE_WAITING:t1,STATE_PREPROCESSING:t0,STATE_UPLOADING:t5,STATE_POSTPROCESSING:t2,STATE_COMPLETE:t3}=tN,t8={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};class t4 extends eU{static VERSION=tO.i8;#ej;#eW;#eG;#eK;constructor(e,t){super(e,{...t8,...t}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=tU,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}#eX(e){if(null==e.total||0===e.total)return null;let t=e.total-e.uploaded;if(t<=0)return null;this.#ej??=performance.now();let i=performance.now()-this.#ej;if(0===i)return Math.round((this.#eK??0)/100)/10;let r=e.uploaded-this.#eW;if(this.#eW=e.uploaded,r<=0)return Math.round((this.#eK??0)/100)/10;let s=r/i,n=null==this.#eG?s:tA(s,this.#eG,2e3,i);this.#eG=n;let a=t/n,o=Math.max(this.#eK-i,0),l=null==this.#eK?a:tA(a,o,2e3,i);return this.#eK=l,this.#ej=performance.now(),Math.round(l/100)/10}startUpload=()=>this.uppy.upload().catch(()=>{});render(e){let{capabilities:t,files:i,allowNewUpload:r,totalProgress:s,error:n,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:u,isUploadStarted:p,isAllComplete:h,isAllPaused:d,isUploadInProgress:c,isSomeGhost:f}=this.uppy.getObjectOfFilesPerState(),m=a?Object.values(i):o,g=!!t.resumableUploads,y=!1!==t.uploadProgress,v=null,b=0;l.every(e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal)?(v=0,l.forEach(e=>{v+=e.progress.bytesTotal||0,b+=e.progress.bytesUploaded||0})):l.forEach(e=>{b+=e.progress.bytesUploaded||0});let _=this.#eX({uploaded:b,total:v});return function({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:r,resumableUploads:s,error:n,hideUploadButton:a,hidePauseResumeButton:o=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:p,uploadState:h,totalProgress:d,files:c,supportsUploadProgress:f,hideAfterFinish:m=!1,isSomeGhost:g,doneButtonHandler:y,isUploadStarted:v,i18n:b,startUpload:_,uppy:w,isAllComplete:P,showProgressDetails:C,numUploads:S,complete:k,totalSize:F,totalETA:T,totalUploadedSize:E}){let x=function(){switch(h){case t2:case t0:{let e=tY(c);if("determinate"===e.mode)return 100*e.value;return d}case tJ:return null;case t5:if(!f)return null;return d;default:return d}}(),I=x??100,D=!n&&e&&(!i&&!r||p)&&t&&!a,A=!l&&h!==t1&&h!==t3,O=s&&!o&&h===t5,U=n&&!P&&!u,N=y&&h===t3,M=eK("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(h){case t2:case t0:{let{mode:e}=tY(c);return"indeterminate"===e}case t5:if(!f)return!0;return!1;default:return!1}}()}),R=eK("uppy-StatusBar",`is-${h}`,{"has-ghosts":g}),B=(()=>{switch(h){case t0:case t2:return eM(tj,{progress:tY(c)});case t3:return eM(tZ,{i18n:b});case tJ:return eM(tQ,{error:n,i18n:b,numUploads:S,complete:k});case t5:return eM(tX,{i18n:b,supportsUploadProgress:f,totalProgress:d,showProgressDetails:C,isUploadStarted:v,isAllComplete:P,isAllPaused:r,newFiles:e,numUploads:S,complete:k,totalUploadedSize:E,totalSize:F,totalETA:T,startUpload:_});default:return null}})();return(D||U||O||A||N||B)&&(h!==t3||!m)?eM("div",{className:R,children:[eM("div",{className:M,style:{width:`${I}%`},role:"progressbar","aria-label":`${I}%`,"aria-valuetext":`${I}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x}),B,eM("div",{className:"uppy-StatusBar-actions",children:[D?eM(tL,{newFiles:e,isUploadStarted:v,recoveredState:p,i18n:b,isSomeGhost:g,startUpload:_,uploadState:h}):null,U?eM(tz,{i18n:b,uppy:w}):null,O?eM(tH,{isAllPaused:r,i18n:b,isAllComplete:P,resumableUploads:s,uppy:w}):null,A?eM(tq,{i18n:b,uppy:w}):null,N?eM(t$,{i18n:b,doneButtonHandler:y}):null]})]}):null}({error:n,uploadState:function(e,t,i,r){if(e)return tN.STATE_ERROR;if(t)return tN.STATE_COMPLETE;if(i)return tN.STATE_WAITING;let s=tN.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return tN.STATE_UPLOADING;t.preprocess&&(s=tN.STATE_PREPROCESSING),t.postprocess&&s!==tN.STATE_PREPROCESSING&&(s=tN.STATE_POSTPROCESSING)}return s}(n,h,a,e.files||{}),allowNewUpload:r,totalProgress:s,totalSize:v,totalUploadedSize:b,isAllComplete:!1,isAllPaused:d,isUploadStarted:p,isUploadInProgress:c,isSomeGhost:f,recoveredState:a,complete:u.length,newFiles:m.length,numUploads:l.length,totalETA:_,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:g,supportsUploadProgress:y,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;s(e)||(e.dir="ltr")}#eZ=()=>{let{recoveredState:e}=this.uppy.getState();if(this.#eG=null,this.#eK=null,e){this.#eW=Object.values(e.files).reduce((e,{progress:t})=>e+t.bytesUploaded,0),this.uppy.emit("restore-confirmed");return}this.#ej=performance.now(),this.#eW=0};install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",this.#eZ),this.#ej=performance.now(),this.#eW=this.uppy.getFiles().reduce((e,t)=>e+t.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",this.#eZ)}}let t7=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/,t6=function(e,t,i){let r;let s=t7.exec(e),n=t.mimeType??s?.[1]??"plain/text";if(s?.[2]!=null){let e=atob(decodeURIComponent(s[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);r=[t]}else s?.[3]!=null&&(r=[decodeURIComponent(s[3])]);return i?new File(r,t.name||"",{type:n}):new Blob(r,{type:n})};function t9(e){return e.startsWith("blob:")}function ie(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function it(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ii="undefined"!=typeof self?self:global;let ir="undefined"!=typeof navigator,is=ir&&"undefined"==typeof HTMLImageElement,ia=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),io=ii.Buffer,il=!!io,iu=e=>void 0!==e;function ip(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(iu).length)}function ih(e){let t=Error(e);throw delete t.stack,t}function id(e){let t;let i=(t=0,e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048);return e.jfif.enabled&&(i+=50),e.xmp.enabled&&(i+=2e4),e.iptc.enabled&&(i+=14e3),e.icc.enabled&&(i+=6e3),i}let ic=e=>String.fromCharCode.apply(null,e),im="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class ig{static from(e,t){return e instanceof this&&e.le===t?e:new ig(e,void 0,void 0,t)}constructor(e,t=0,i,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let r=new DataView(e,t,i);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof ig){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&ih("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,i);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else ih("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=ig){return e instanceof DataView||e instanceof ig?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ih("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new ig(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){let i=this.getUint8Array(e,t);return im?im.decode(i):il?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(ic(i)))}getLatin1String(e=0,t=this.byteLength){return ic(this.getUint8Array(e,t))}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return ic(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}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,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function iy(e,t){ih(`${e} '${t}' was not loaded, try using full build of exifr.`)}class iv extends Map{constructor(e){super(),this.kind=e}get(e,t){var i;return this.has(e)||iy(this.kind,e),t&&(e in t||(i=this.kind,ih(`Unknown ${i} '${e}'.`)),t[e].enabled||iy(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ib=new iv("file parser"),i_=new iv("segment parser"),iw=new iv("file reader");let iP=ii.fetch;function iC(e,t){return e.startsWith("data:")||e.length>1e4?ik(e,t,"base64"):ia&&e.includes("://")?iS(e,t,"url",iF):ia?ik(e,t,"fs"):ir?iS(e,t,"url",iF):void ih("Invalid input argument")}async function iS(e,t,i,r){return iw.has(i)?ik(e,t,i):r?async function(e,t){return new ig(await t(e))}(e,r):void ih(`Parser ${i} is not loaded`)}async function ik(e,t,i){let r=new(iw.get(i))(e,t);return await r.read(),r}let iF=e=>iP(e).then(e=>e.arrayBuffer()),iT=e=>new Promise((t,i)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=i,r.readAsArrayBuffer(e)});class iE extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function ix(e,t,i){let r=new iE;for(let[e,t]of i)r.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,r);else e.set(t,r);return r}function iI(e,t,i){let r,s=e.get(t);for(r of i)s.set(r[0],r[1])}let iD=new Map,iA=new Map,iO=new Map,iU=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],iN=["jfif","xmp","icc","iptc","ihdr"],iM=["tiff",...iN],iR=["ifd0","ifd1","exif","gps","interop"],iB=[...iM,...iR],iL=["makerNote","userComment"],iz=["translateKeys","translateValues","reviveValues","multiSegment"],iq=[...iz,"sanitize","mergeOutput","silentErrors"];class iH{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class i$ extends iH{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),it(this,"enabled",!1),it(this,"skip",new Set),it(this,"pick",new Set),it(this,"deps",new Set),it(this,"translateKeys",!1),it(this,"translateValues",!1),it(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=iR.includes(e),this.canBeFiltered&&(this.dict=iD.get(e)),void 0!==i){if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:ih(`Invalid options argument: ${i}`)}}applyInheritables(e){let t,i;for(t of iz)void 0!==(i=e[t])&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:s,tagValues:n}=this.dict;for(i of e)"string"==typeof i?(-1===(r=n.indexOf(i))&&(r=s.indexOf(Number(i))),-1!==r&&t.add(Number(s[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,iX(this.pick,this.deps)):this.enabled&&this.pick.size>0&&iX(this.pick,this.deps)}}var iV={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},ij=new Map;class iW extends iH{static useCached(e){let t=ij.get(e);return void 0!==t||(t=new this(e),ij.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):ih(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=ir?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of iU)this[e]=iV[e];for(e of iq)this[e]=iV[e];for(e of iL)this[e]=iV[e];for(e of iB)this[e]=new i$(e,iV[e],void 0,this)}setupFromTrue(){let e;for(e of iU)this[e]=iV[e];for(e of iq)this[e]=iV[e];for(e of iL)this[e]=!0;for(e of iB)this[e]=new i$(e,!0,void 0,this)}setupFromArray(e){let t;for(t of iU)this[t]=iV[t];for(t of iq)this[t]=iV[t];for(t of iL)this[t]=iV[t];for(t of iB)this[t]=new i$(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,iR)}setupFromObject(e){let t;for(t of(iR.ifd0=iR.ifd0||iR.image,iR.ifd1=iR.ifd1||iR.thumbnail,Object.assign(this,e),iU))this[t]=iK(e[t],iV[t]);for(t of iq)this[t]=iK(e[t],iV[t]);for(t of iL)this[t]=iK(e[t],iV[t]);for(t of iM)this[t]=new i$(t,iV[t],e[t],this);for(t of iR)this[t]=new i$(t,iV[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,iR,iB),!0===e.tiff?this.batchEnableWithBool(iR,!0):!1===e.tiff?this.batchEnableWithUserValue(iR,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,iR):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,iR)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let e of r)this[e].enabled=!1;for(let[t,r]of iG(e,i))iX(this[t].pick,r),this[t].enabled=!0}else if(t&&t.length)for(let[e,r]of iG(t,i))iX(this[e].skip,r)}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:r,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;for(let s of(r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=iR.some(e=>!0===this[e].enabled)||this.makerNote||this.userComment,iR))this[s].finalizeFilters()}get onlyTiff(){return!iN.map(e=>this[e].enabled).some(e=>!0===e)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of iM)this[e].enabled&&!i_.has(e)&&iy("segment parser",e)}}function iG(e,t){let i,r,s,n,a=[];for(s of t){for(n of(i=iD.get(s),r=[],i))(e.includes(n[0])||e.includes(n[1]))&&r.push(n[0]);r.length&&a.push([s,r])}return a}function iK(e,t){return void 0!==e?e:void 0!==t?t:void 0}function iX(e,t){for(let i of t)e.add(i)}it(iW,"default",iV);class iZ{constructor(e){it(this,"parsers",{}),it(this,"output",{}),it(this,"errors",[]),it(this,"pushToErrors",e=>this.errors.push(e)),this.options=iW.useCached(e)}async read(e){var t;this.file=await (t=this.options,"string"==typeof e?iC(e,t):ir&&!is&&e instanceof HTMLImageElement?iC(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new ig(e):ir&&e instanceof Blob?iS(e,t,"blob",iT):void ih("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of ib)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),ih("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),ip(e)?void 0:e}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async t=>{let i=await t.parse();t.assignToOutput(e,i)});this.options.silentErrors&&(t=t.map(e=>e.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){var e;this.setup();let{options:t,file:i}=this,r=i_.get("tiff",t);if(i.tiff?e={start:0,type:"tiff"}:i.jpeg&&(e=await this.fileParser.getOrFindSegment("tiff")),void 0===e)return;let s=await this.fileParser.ensureSegmentChunk(e),n=this.parsers.tiff=new r(s,t,i),a=await n.extractThumbnail();return i.close&&i.close(),a}}async function iQ(e,t){let i=new iZ(t);return await i.read(e),i.parse()}var iY=Object.freeze({__proto__:null,parse:iQ,Exifr:iZ,fileParsers:ib,segmentParsers:i_,fileReaders:iw,tagKeys:iD,tagValues:iA,tagRevivers:iO,createDictionary:ix,extendDictionary:iI,fetchUrlAsArrayBuffer:iF,readBlobAsArrayBuffer:iT,chunkedProps:iU,otherSegments:iN,segments:iM,tiffBlocks:iR,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:iq,Options:iW});class iJ{static findPosition(e,t){let i=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,s=t+r,n=i-r;return{offset:t,length:i,headerLength:r,start:s,size:n,end:s+n}}static parse(e,t={}){return new this(e,new iW({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof ig?e:new ig(e)}constructor(e,t={},i){it(this,"errors",[]),it(this,"raw",new Map),it(this,"handleError",e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=iO.get(t),r=iA.get(t),s=iD.get(t),n=this.options[t],a=n.reviveValues&&!!i,o=n.translateValues&&!!r,l=n.translateKeys&&!!s,u={};for(let[t,n]of e)a&&i.has(t)?n=i.get(t)(n):o&&r.has(t)&&(n=this.translateValue(n,r.get(t))),l&&s.has(t)&&(t=s.get(t)||t),u[t]=n;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}it(iJ,"headerLength",4),it(iJ,"type",void 0),it(iJ,"multiSegment",!1),it(iJ,"canHandle",()=>!1);class i1 extends class{constructor(e,t,i){it(this,"errors",[]),it(this,"ensureSegmentChunk",async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked){if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){ih(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):ih("Segment unreachable: "+JSON.stringify(e));return e.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(i_.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),it(this,"appSegments",[]),it(this,"jpegSegments",[]),it(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(i_.keyList())):(e=void 0===e?i_.keyList().filter(e=>this.options[e].enabled):e.filter(e=>this.options[e].enabled&&i_.has(e)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:s,remaining:n}=this;if(!r&&this.file.chunked&&(r=Array.from(s).some(e=>{let t=i_.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment}))&&await this.file.readWhole(),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;n.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=i,s=this.appSegments.some(e=>!this.file.available(e.offset||e.start,e.length||e.size));if(t=e>r&&!s?!await i.readNextChunk(e):!await i.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,s,n,a,o,{file:l,findAll:u,wanted:p,remaining:h,options:d}=this;for(;e<t;e++)if(255===l.getUint8(e)){var c;if((c=i=l.getUint8(e+1))>=224&&c<=239){if(r=l.getUint16(e+2),(s=function(e,t,i){for(let[r,s]of i_)if(s.canHandle(e,t,i))return r}(l,e,r))&&p.has(s)&&(a=(n=i_.get(s)).findPosition(l,e),o=d[s],a.type=s,this.appSegments.push(a),!u&&(n.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||h.delete(s)):h.delete(s),0===h.size)))break;d.recordUnknownSegments&&((a=iJ.findPosition(l,e)).marker=i,this.unknownSegments.push(a)),e+=r+1}else if(192===i||194===i||196===i||219===i||221===i||218===i||254===i){if(r=l.getUint16(e+2),218===i&&!1!==d.stopAfterSos)return;d.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let e=function(e,t){let i,r,s,n=new Map;for(let a=0;a<e.length;a++)r=(i=e[a])[t],n.has(r)?s=n.get(r):n.set(r,s=[]),s.push(i);return Array.from(n)}(this.appSegments,"type");this.mergedAppSegments=e.map(([e,t])=>{let i=i_.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}it(i1,"type","jpeg"),ib.set("jpeg",i1);let i0=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class i5 extends iJ{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:s}=this.options[t],n=(r=new Set(r)).size>0,a=0===s.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(n){if(r.has(o)&&(i.set(o,this.parseTag(e,o,t)),r.delete(o),0===r.size))break}else!a&&s.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){var r;let{chunk:s}=this,n=s.getUint16(e+2),a=s.getUint32(e+4),o=i0[n];if(o*a<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&ih(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&ih(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),1===n)return s.getUint8Array(e,a);if(2===n)return""===(r=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(r=s.getString(e,a)).trim())?void 0:r;if(7===n)return s.getUint8Array(e,a);if(1===a)return this.parseTagValue(n,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(n))(a);for(let i=0;i<a;i++)t[i]=this.parseTagValue(n,e),e+=o;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);default:ih(`Invalid tiff type ${e}`)}}}class i2 extends i5{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ih("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ih(`IFD0 offset points to outside of file.
6
- this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,id(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,id(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",i3(...e.get(2),e.get(1))),e.set("longitude",i3(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,r={};for(t of iR)if(!ip(e=this[t])){if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,i)}else r[t]=i}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[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function i3(e,t,i,r){var s=e+t/60+i/3600;return"S"!==r&&"W"!==r||(s*=-1),s}it(i2,"type","tiff"),it(i2,"headerLength",10),i_.set("tiff",i2),Object.freeze({__proto__:null,default:iY,Exifr:iZ,fileParsers:ib,segmentParsers:i_,fileReaders:iw,tagKeys:iD,tagValues:iA,tagRevivers:iO,createDictionary:ix,extendDictionary:iI,fetchUrlAsArrayBuffer:iF,readBlobAsArrayBuffer:iT,chunkedProps:iU,otherSegments:iN,segments:iM,tiffBlocks:iR,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:iq,Options:iW,parse:iQ});let i8={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},i4=(Object.assign({},i8,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},i8,{tiff:!1,ifd1:!0,mergeOutput:!1}),Object.assign({},i8,{firstChunkSize:4e4,ifd0:[274]}));async function i7(e){let t=new iZ(i4);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}let i6=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}}),i9=!0,re=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t;i9=Number(e)+.1*Number(i)<13.4,re=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);i9=re=15>Number(t)}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);i9=re=81>Number(t)}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);i9=re=77>Number(t)}}async function rt(e){let t=await i7(e);return Object.assign({canvas:i9,css:re},i6[t])}class ri extends ig{constructor(...e){super(...e),it(this,"ranges",new rr),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;let i=new DataView((t=il?io.allocUnsafe(e):new Uint8Array(e)).buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let 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 rr{constructor(){it(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,s=this.list.filter(t=>{var i,s,n,a,o,l;return i=e,s=t.offset,n=r,i<=s&&s<=n||(a=e,o=t.end,l=r,a<=o&&o<=l)});if(s.length>0){e=Math.min(e,...s.map(e=>e.offset)),t=(r=Math.max(r,...s.map(e=>e.end)))-e;let i=s.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter(e=>!s.includes(e))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some(t=>t.offset<=e&&i<=t.end)}}class rs extends ri{constructor(e,t){super(0),it(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}iw.set("blob",class extends rs{async readWhole(){this.chunked=!1;let e=await iT(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,r=this.input.slice(e,i),s=await iT(r);return this.set(s,e,!0)}});let rn={i8:"4.2.1"},ra={strings:{generatingThumbnails:"Generating thumbnails..."}},ro={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class rl extends eU{static VERSION=rn.i8;queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...ro,...t}),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=ra,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,i){let r=URL.createObjectURL(e.data);return Promise.all([new Promise((e,t)=>{let i=new Image;i.src=r,i.addEventListener("load",()=>{URL.revokeObjectURL(r),e(i)}),i.addEventListener("error",e=>{URL.revokeObjectURL(r),t(e.error||Error("Could not create thumbnail"))})}),rt(e.data).catch(()=>1)]).then(([e,r])=>{let s=this.getProportionalDimensions(e,t,i,r.deg),n=function(e,t){let i=e.width,r=e.height;(90===t.deg||270===t.deg)&&(i=e.height,r=e.width);let s=document.createElement("canvas");s.width=i,s.height=r;let n=s.getContext("2d");return n.translate(i/2,r/2),t.canvas&&(n.rotate(t.rad),n.scale(t.scaleX,t.scaleY)),n.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),s}(e,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(i=>{e.toBlob(i,t,80)}).then(e=>{if(null===e)throw Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(()=>t6(e.toDataURL(t,80),{})).then(e=>{if(null===e)throw Error("could not extract blob, probably an old browser");return e})}(this.resizeImage(n,s.width,s.height),this.thumbnailType,0)}).then(e=>URL.createObjectURL(e))}getProportionalDimensions(e,t,i,r){let s=e.width/e.height;return((90===r||270===r)&&(s=e.height/e.width),null!=t)?{width:t,height:Math.round(t/s)}:null!=i?{width:Math.round(i*s),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,i){let r=function(e){let t=e.width/e.height,i=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(i>4096&&(r=Math.round((i=4096)/t)),r>4096&&(i=Math.round(t*(r=4096))),e.width>i){let t=document.createElement("canvas");return t.width=i,t.height=r,t.getContext("2d").drawImage(e,0,0,i,r),t}return e}(e),s=Math.ceil(Math.log2(r.width/t));s<1&&(s=1);let n=t*2**(s-1),a=i*2**(s-1);for(;s--;){let e=document.createElement("canvas");e.width=n,e.height=a,e.getContext("2d").drawImage(r,0,0,n,a),r=e,n=Math.round(n/2),a=Math.round(a/2)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return ie(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()}onFileAdded=e=>{!e.preview&&e.data&&ie(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)};onFileRemoved=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&t9(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(e=>e.isRestored).forEach(e=>{(!e.preview||t9(e.preview))&&this.addToQueue(e.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let t=()=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)})};return new Promise(e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),e()}):(t(),e())})};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)}}let ru=function(e){if("string"==typeof e){let t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&r(e)?[e]:null},rp=Array.from;async function*rh(e,t,i){let r=()=>`${t}/${e.name}`;if("file"===e.kind){let s=await e.getFile();null!=s?(s.relativePath=t?r():null,yield s):null!=i&&(yield i)}else if("directory"===e.kind)for await(let i of e.values())yield*rh(i,t?r():e.name);else null!=i&&(yield i)}async function*rd(e,t){for(let{lastResortFile:i,fileSystemHandle:r}of(await Promise.all(Array.from(e.items,async e=>{let i;return{fileSystemHandle:i??=function e(t,i){return null==t?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile:()=>new Promise((e,i)=>t.file(e,i)),async *values(){let r=t.createReader(),s=await new Promise(t=>{!function e(t,i,r,{onSuccess:s}){t.readEntries(n=>{let a=[...i,...n];n.length?queueMicrotask(()=>{e(t,a,r,{onSuccess:s})}):s(a)},e=>{r(e),s(i)})}(r,[],i,{onSuccess:r=>t(r.map(t=>e(t,i)))})});yield*s},isSameEntry:void 0}}("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),lastResortFile:e.getAsFile()}}))))if(null!=r)try{yield*rh(r,"",i)}catch(e){null!=i?yield i:t(e)}else null!=i&&(yield i)}async function rc(e,t){let i=t?.logDropError??Function.prototype;try{let t=[];for await(let r of rd(e,i))t.push(r);return t}catch{return Promise.resolve(rp(e.files))}}let rf=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},rm={i8:"4.4.1"};function rg(){let e=document.body;return!!("draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window)}class ry extends S{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,i)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:""===t?"environment":t,accept:{photo:"image/*",video:"video/*"}[e],ref:i});renderMyDeviceAcquirer=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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 "})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length,children:e});renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,s=r.charAt(0).toUpperCase()+r.slice(1);return eM("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${s}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${s}`,{browseFiles:t,browseFolders:i,browse:t})})};[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")}renderAcquirer=e=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:eM("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":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[eM("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),eM("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return eM(C,{children:[t.map(e=>this.renderAcquirer(e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:i.map(e=>this.renderAcquirer(e))})]})};renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,s=[],n="myDevice";t||s.push({key:n,elements:this.renderMyDeviceAcquirer()}),i&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(e=>({key:e.id,elements:this.renderAcquirer(e)}))),1===s.length&&s[0].key===n&&(s=[]);let a=[...s],o=a.splice(s.length-2,s.length);return eM(C,{children:[this.renderDropPasteBrowseTagline(s.length),eM("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[a.map(({key:e,elements:t})=>eM(C,{children:t},e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:o.map(({key:e,elements:t})=>eM(C,{children:t},e))})]})]})};renderPoweredByUppy(){let{i18nArray:e}=this.props,t=e("poweredBy",{uppy:eM("span",{children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),eM("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]})});return eM("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:t})}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return eM("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,e=>{this.fileInput=e}),this.renderHiddenInput(!0,e=>{this.folderInput=e}),e&&this.renderHiddenCameraInput("photo",i,e=>{this.mobilePhotoFileInput=e}),t&&this.renderHiddenCameraInput("video",i,e=>{this.mobileVideoFileInput=e}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),eM("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&eM("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}let rv=e=>eM("div",{className:eK("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),eM(ry,{...e})]}),rb=function(e){let t=e.files[e.fileCardFor];return eM("div",{className:eK("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()},children:e.i18n("cancel")}),eM("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),eM("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})};function r_(e){let t={color:"#838999",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[eM("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"}),eM("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;let i=e.split("/")[0],r=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"})})}:"image"===i?{color:"#686de0",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#686DE0",fillRule:"evenodd",children:[eM("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"}),eM("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"}),eM("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"})})}:"video"===i?{color:"#19af67",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}:"application"===i&&"pdf"===r?{color:"#e25149",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"})})}:t}let rw=function(e){let{tagName:t}=e.target;if("INPUT"===t||"TEXTAREA"===t){e.stopPropagation();return}e.preventDefault(),e.stopPropagation()};function rP(e){let{file:t}=e;if(t.preview)return eM("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:i,icon:r}=r_(t.type);return eM("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[eM("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:r}),eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:eM("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function rC(e){let{computedMetaFields:t,requiredMetaFields:i,updateMeta:r,form:s,formState:n}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(e=>{let t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return eM("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[eM("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:n[e.id],onChange:t=>r(t,e.id),fieldCSSClasses:a,required:o,form:s.id},w):eM("input",{className:a.text,id:t,form:s.id,type:e.type||"text",required:o,value:n[e.id],placeholder:e.placeholder,onInput:t=>r(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)})}function rS(e){let{files:t,fileCardFor:i,toggleFileCard:r,saveFileCard:s,metaFields:n,requiredMetaFields:a,openFileEditor:o,i18n:l,i18nArray:u,className:p,canEditFile:h}=e,d=t[i],c=("function"==typeof n?n(t[i]):n)??[],f=h(d),m={};c.forEach(e=>{m[e.id]=d.meta[e.id]??""});let[g,y]=Y(m),v=ei(e=>{e.preventDefault(),s(g,i)},[s,g,i]),b=()=>{r(!1)},[_]=Y(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=rf(),e});return J(()=>(document.body.appendChild(_),_.addEventListener("submit",v),()=>{_.removeEventListener("submit",v),document.body.removeChild(_)}),[_,v]),eM("div",{className:eK("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:rw,onDragLeave:rw,onDrop:rw,onPaste:rw,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:d.meta?d.meta.name:d.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",form:_.id,title:l("finishEditingFile"),onClick:b,children:l("cancel")})]}),eM("div",{className:"uppy-Dashboard-FileCard-inner",children:[eM("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:r_(d.type).color},children:[eM(rP,{file:d}),f&&eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{v(e),o(d)},children:l("editImage")})]}),eM("div",{className:"uppy-Dashboard-FileCard-info",children:eM(rC,{computedMetaFields:c,requiredMetaFields:a,updateMeta:(e,t)=>{y({...g,[t]:e})},form:_,formState:g})}),eM("div",{className:"uppy-Dashboard-FileCard-actions",children:[eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:_.id,children:l("saveChanges")}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:_.id,children:l("cancel")})]})]})]})}function rk({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:r,i18n:s,onClick:n}){return!t&&i&&i.length>0||!t&&r(e)?eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":s("editFileWithFilename",{file:e.meta.name}),title:s("editFileWithFilename",{file:e.meta.name}),onClick:()=>n(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:eM("g",{fillRule:"evenodd",children:[eM("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"}),eM("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),eM("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function rF({i18n:e,onClick:t,file:i}){return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>t(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[eM("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"}),eM("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 rT({file:e,uppy:t,i18n:i}){let r=r=>{(function(e,t="Copy the URL below"){return new Promise(i=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(t,e),i()};try{if(!document.execCommand("copy"))return s();return document.body.removeChild(r),i()}catch(e){return document.body.removeChild(r),s()}})})(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>r.target.focus({preventScroll:!0}))};return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:e=>r(e),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:eM("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 rE(e){let{uppy:t,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:p}=e;return eM("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[eM(rk,{i18n:l,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,i.id):p(i)}}),a&&i.uploadURL?eM(rT,{file:i,uppy:t,i18n:l}):null,o?eM(rF,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function rx(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;let i=t-3;return e.slice(0,Math.ceil(i/2))+"..."+e.slice(-Math.floor(i/2))}let rI=(e,t)=>("function"==typeof t?t():t).filter(t=>t.id===e)[0].name;function rD(e){let{file:t,toggleFileCard:i,i18n:r,metaFields:s}=e,{missingRequiredMetaFields:n}=t;if(!n?.length)return null;let a=n.map(e=>rI(e,s)).join(", ");return eM("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",eM("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:r("editFile")})]})}let rA=e=>{let{author:t,name:i}=e.file.meta;return eM("div",{className:"uppy-Dashboard-Item-name",title:i,children:rx(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},rO=e=>{let{author:t}=e.file.meta,i=e.file.remote?.providerName,r=`\u00B7`;return t?eM("div",{className:"uppy-Dashboard-Item-author",children:[eM("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:rx(t.name,13)}),i?eM(C,{children:[` ${r} `,i,` ${r} `]}):null]}):null},rU=e=>e.file.size&&eM("div",{className:"uppy-Dashboard-Item-statusSize",children:tM(e.file.size)}),rN=e=>e.file.isGhost&&eM("span",{children:[" • ",eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),rM=({file:e,onClick:t})=>e.error?eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button",children:"?"}):null;function rR(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:o,containerWidth:l}=e;return eM("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[eM("div",{className:"uppy-Dashboard-Item-fileName",children:[rA({file:t,isSingleFile:a,containerHeight:o,containerWidth:l}),eM(rM,{file:t,onClick:()=>alert(t.error)})]}),eM("div",{className:"uppy-Dashboard-Item-status",children:[rO({file:t}),rU({file:t}),rN({file:t,toggleAddFilesPanel:n,i18n:i})]}),eM(rD,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rB(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=e;return eM("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":r_(t.type).color},children:[n&&t.uploadURL&&eM("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:eM("span",{hidden:!0,children:t.meta.name})}),eM(rP,{file:t}),eM(rD,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rL(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function rz(e){return eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":rL(e),title:rL(e),onClick:()=>(function(e){if(!e.isUploaded){if(e.error&&!e.hideRetryButton){e.uppy.retryUpload(e.file.id);return}e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id)}})(e),children:e.children})})}function rq({children:e}){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function rH({progress:e}){let t=2*Math.PI*15;return eM("g",{children:[eM("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),eM("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 r$(e){return e.file.progress.uploadStarted&&void 0!==e.file.progress.percentage?e.isUploaded?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rq,{children:[eM("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?eM(rz,{...e,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[eM("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),eM("path",{d:"M7.9 3H10v2H7.9z"}),eM("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),eM("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?eM(rz,{...e,children:eM(rq,{children:[eM(rH,{progress:e.file.progress.percentage}),e.file.isPaused?eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):eM("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[eM("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),eM("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rq,{children:eM(rH,{progress:e.file.progress.percentage})})})}):eM(rz,{...e,children:eM(rq,{children:[eM(rH,{progress:e.file.progress.percentage}),eM("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})]})}):null}class rV extends S{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;let i=Object.keys(e),r=Object.keys(t),s=i.length;if(r.length!==s)return!1;for(let r=0;r<s;r++){let s=i[r];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:a}=e,o=this.props.individualCancellation?!i:!s&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(o=!0),eM("div",{className:eK({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role,children:[eM("div",{className:"uppy-Dashboard-Item-preview",children:[eM(rB,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),eM(r$,{uppy:this.props.uppy,file:e,error:n,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),eM("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[eM(rR,{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}),eM(rE,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function rj({id:e,i18n:t,uppy:i,files:r,resumableUploads:s,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:p,isSingleFile:h,toggleFileCard:d,handleRequestThumbnail:c,handleCancelThumbnail:f,recoveredState:m,individualCancellation:g,itemsPerRow:y,openFileEditor:v,canEditFile:b,toggleAddFilesPanel:_,containerWidth:w,containerHeight:P}){let C=1===y?71:200,S=et(()=>{let e=Object.keys(r);return m&&e.sort((e,t)=>Number(r[t].isGhost)-Number(r[e].isGhost)),function(e,t){let i=[],r=[];return e.forEach(e=>{r.length<t?r.push(e):(i.push(r),r=[e])}),r.length&&i.push(r),i}(e,y)},[r,y,m]),k=y=>eM("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map(y=>eM(rV,{uppy:i,id:e,i18n:t,resumableUploads:s,individualCancellation:g,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:p,recoveredState:m,isSingleFile:h,containerWidth:w,containerHeight:P,toggleFileCard:d,handleRequestThumbnail:c,handleCancelThumbnail:f,role:"listitem",openFileEditor:v,canEditFile:b,toggleAddFilesPanel:_,file:r[y]},y))},y[0]);return h?eM("div",{class:"uppy-Dashboard-files",children:k(S[0])}):eM(eY,{class:"uppy-Dashboard-files",role:"list",data:S,renderRow:k,rowHeight:C})}let rW=function({activePickerPanel:e,className:t,hideAllPanels:i,i18n:r,state:s,uppy:n}){let a=ee(null);return eM("div",{className:eK("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:rw,onDragLeave:rw,onDrop:rw,onPaste:rw,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:e.name})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:r("cancel")})]}),eM("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:n.getPlugin(e.id).render(s,a.current)})]})},rG={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function rK({files:e,i18n:t,isAllComplete:i,isAllErrored:r,isAllPaused:s,inProgressNotPausedFiles:n,newFiles:a,processingFiles:o}){switch(function(e,t,i,r={}){if(e)return rG.STATE_ERROR;if(t)return rG.STATE_COMPLETE;if(i)return rG.STATE_PAUSED;let s=rG.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return rG.STATE_UPLOADING;t.preprocess&&s!==rG.STATE_UPLOADING&&(s=rG.STATE_PREPROCESSING),t.postprocess&&s!==rG.STATE_UPLOADING&&s!==rG.STATE_PREPROCESSING&&(s=rG.STATE_POSTPROCESSING)}return s}(r,i,s,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:o.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}let rX=function(e){let{i18n:t,isAllComplete:i,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=e,{allowNewUpload:o}=e;return o&&s&&(o=e.totalFileCount<e.maxNumberOfFiles),eM("div",{className:"uppy-DashboardContent-bar",children:[i||r?eM("div",{}):eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:t("cancel")}),eM("div",{className:"uppy-DashboardContent-title",children:eM(rK,{...e})}),o?eM("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>n(!0),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:eM("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"})}),eM("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):eM("div",{})]})},rZ="uppy-transition-slideDownUp",rQ=function({children:e}){let[t,i]=Y(null),[r,s]=Y(""),n=ee(),a=ee(),o=ee(),l=()=>{s(`${rZ}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rZ}-enter ${rZ}-enter-active`),n.current=setTimeout(()=>{s("")},250)})},u=()=>{s(`${rZ}-leave`),cancelAnimationFrame(o.current),clearTimeout(n.current),n.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rZ}-leave ${rZ}-leave-active`),a.current=setTimeout(()=>{i(null),s("")},250)})};return(J(()=>{let r=x(e)[0];t!==r&&(r&&!t?l():!t||r||a.current||u(),i(r))},[e,t]),J(()=>()=>{clearTimeout(n.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),t)?R(t,{className:eK(r,t.props.className)}):null},rY={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"}},rJ=['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])'];var r1=i(19788);function r0(e,t){if(t){let i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function r5(e,t){let i=t[0];i&&(i.focus(),e.preventDefault())}function r2(e,t,i){let r=r0(i,t),s=rp(r.querySelectorAll(rJ)),n=s.indexOf(document.activeElement);r.contains(document.activeElement)?e.shiftKey&&0===n?function(e,t){let i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,s):e.shiftKey||n!==s.length-1||r5(e,s):r5(e,s)}function r3(){let e={};return e.promise=new Promise((t,i)=>{e.resolve=t,e.reject=i}),e}let r8={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:tF,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};class r4 extends eU{static VERSION=rm.i8;#eQ;modalName=`uppy-Dashboard-${rf()}`;superFocus=(function(){let e=!1;return r1((t,i)=>{let r=r0(t,i),s=r.contains(document.activeElement);if(s&&e)return;let n=r.querySelector("[data-uppy-super-focusable]");if(!s||n){if(n)n.focus({preventScroll:!0}),e=!0;else{let t=r.querySelector(rJ);t?.focus({preventScroll:!0}),e=!1}}},260)})();ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){super(e,{...r8,...t,autoOpen:t?.autoOpen??null}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=rY,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{let t=this.getPluginState().targets.filter(t=>t.id!==e.id);this.setPluginState({targets:t})};addTarget=e=>{let t=e.id||e.constructor.name,i=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r)return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let s=this.getPluginState().targets.slice();return s.push({id:t,name:i,type:r}),this.setPluginState({targets:s}),this.el};hideAllPanels=()=>{let e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};(e.activePickerPanel!==t.activePickerPanel||e.showAddFilesPanel!==t.showAddFilesPanel||e.showFileEditor!==t.showFileEditor||e.activeOverlayType!==t.activeOverlayType)&&(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{let{targets:t}=this.getPluginState(),i=t.find(t=>"acquirer"===t.type&&t.id===e);this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{let{targets:t}=this.getPluginState();return this.#eY(t).some(t=>this.uppy.getPlugin(t.id).canEditFile(e))};openFileEditor=e=>{let{targets:t}=this.getPluginState(),i=this.#eY(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach(t=>{this.uppy.getPlugin(t.id).selectFile(e)})};closeFileEditor=()=>{let{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{let{targets:e}=this.getPluginState();this.#eY(e).forEach(e=>{this.uppy.getPlugin(e.id).save()}),this.closeFileEditor()};openModal=()=>{let{promise:e,resolve:t}=r3();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e};closeModal=e=>{let t=e?.manualClose??!0,{isHidden:i,isClosing:r}=this.getPluginState();if(i||r)return;let{promise:s,resolve:n}=r3();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),n()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),n();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),s};isModalOpen=()=>!this.getPluginState().isHidden;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{let t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{let i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{let{width:t,height:i}=e[0].contentRect;this.setPluginState({containerWidth:t,containerHeight:i,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{let t=this.#eQ??rp(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter(e=>!e.classList.contains("uppy-Dashboard-close"));for(let i of t)"A"===i.tagName?i.setAttribute("aria-disabled",e):i.disabled=e;e?this.#eQ=t:this.#eQ=null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&r2(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)});let t=rp(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();let t=rp(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let t=(()=>{let t=!0;return this.uppy.iteratePlugins(i=>{i.canHandleRootDrop?.(e)&&(t=!0)}),t})(),i=(()=>{let{types:t}=e.dataTransfer;return t.some(e=>"Files"===e)})();if(!t&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!t)||!this.uppy.getState().allowNewUpload){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)});let t=!1;this.uppy.log("[Dashboard] Processing dropped files");let i=await rc(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),t||(this.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||r2(e,t,i)}(e,this.getPluginState().activeOverlayType,this.el)};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};handleCancelRestore=()=>{this.uppy.emit("restore-canceled")};#eJ=()=>{if(this.opts.disableThumbnailGenerator)return;let e=this.uppy.getFiles();if(1===e.length){let t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});let i={...e[0],preview:void 0};t?.requestThumbnail(i).then(()=>{t?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#e1=e=>{let t=e[0],{metaFields:i}=this.getPluginState(),r=i&&i.length>0,s=this.canEditFile(t);r&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):s&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let e=ru(this.opts.trigger);e?e.forEach(e=>e.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",this.#e0),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",this.#eJ),this.uppy.on("file-removed",this.#eJ),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",this.#e1)};removeEvents=()=>{let e=ru(this.opts.trigger);!this.opts.inline&&e&&e.forEach(e=>e.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#e0),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",this.#eJ),this.uppy.off("file-removed",this.#eJ),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",this.#e1)};superFocusOnEachUpdate=()=>{let e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,r=!this.opts.inline;i&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#e5=e=>{let t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#e2=e=>{let t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()};#e3=e=>e.filter(e=>"acquirer"===e.type&&this.#e2(e)).map(this.#e5);#e8=e=>e.filter(e=>"progressindicator"===e.type).map(this.#e5);#eY=e=>e.filter(e=>"editor"===e.type).map(this.#e5);render=e=>{let t;let i=this.getPluginState(),{files:r,capabilities:s,allowNewUpload:n}=e,{newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:p,inProgressNotPausedFiles:h,processingFiles:d,isUploadStarted:c,isAllComplete:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=this.#e3(i.targets),y=this.#e8(i.targets),v=this.#eY(i.targets);return t="auto"===this.opts.theme?s.darkMode?"dark":"light":this.opts.theme,0>["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),function(e){let t=0===e.totalFileCount,i=1===e.totalFileCount,r=e.containerWidth>576,s=e.containerHeight>330,n=eK({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&s}),a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);let o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter(t=>e.files[t].isGhost).length:0;return eM("div",{className:n,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&rg(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[eM("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),eM("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:eM("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:eM("span",{"aria-hidden":"true",children:"\xd7"})}),eM("div",{className:"uppy-Dashboard-innerWrap",children:[eM("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),o&&eM(rX,{...e}),l&&eM("div",{className:"uppy-Dashboard-serviceMsg",children:[eM("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:eM("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[eM("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"}),eM("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),eM("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),eM("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),eM("div",{className:"uppy-Dashboard-serviceMsg-text",children:u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles")})]}),o?eM(rj,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:a,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):eM(ry,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),eM(rQ,{children:e.showAddFilesPanel?eM(rv,{...e,isSizeMD:r},"AddFiles"):null}),eM(rQ,{children:e.fileCardFor?eM(rS,{...e},"FileCard"):null}),eM(rQ,{children:e.activePickerPanel?eM(rW,{...e},"Picker"):null}),eM(rQ,{children:e.showFileEditor?eM(rb,{...e},"Editor"):null}),eM("div",{className:"uppy-Dashboard-progressindicators",children:e.progressindicators.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})]})]})}({state:e,isHidden:i.isHidden,files:r,newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:p,inProgressNotPausedFiles:h,processingFiles:d,isUploadStarted:c,isAllComplete:f,isAllPaused:m,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:n,acquirers:g,theme:t,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:i.activePickerPanel,showFileEditor:i.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:i.isClosing,progressindicators:y,editors:v,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:e.recoveredState,metaFields:i.metaFields,resumableUploads:s.resumableUploads||!1,individualCancellation:s.individualCancellation,isMobileDevice:s.isMobileDevice,fileCardFor:i.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:i.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:i.containerWidth,containerHeight:i.containerHeight,areInsidesReadyToBeVisible:i.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:i.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})};#e4=()=>{let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#e7=()=>{this.uppy.iteratePlugins(this.#e0)};#e0=e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&!this.getPluginState().targets.some(t=>e.id===t.id)&&e.mount(this,e)};#e6(){let{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:a,doneButtonHandler:o}=this.opts;return{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:a,doneButtonHandler:o}}#e9(){let{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r,lazy:!r}}#te(){return{}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#tt())?.setOptions(this.#e6()),this.uppy.getPlugin(this.#ti())?.setOptions(this.#e9())}#tt(){return`${this.id}:StatusBar`}#ti(){return`${this.id}:ThumbnailGenerator`}#tr(){return`${this.id}:Informer`}install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:i,allowMultipleUploadBatches:r}=this.uppy.opts;(i||r)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:s}=this.opts;s&&this.mount(s,this),this.opts.disableStatusBar||this.uppy.use(t4,{id:this.#tt(),target:this,...this.#e6()}),this.opts.disableInformer||this.uppy.use(eq,{id:this.#tr(),target:this,...this.#te()}),this.opts.disableThumbnailGenerator||this.uppy.use(rl,{id:this.#ti(),...this.#e9()}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let n=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${n?"on":"off"}`),this.setDarkModeCapability(n),"auto"===this.opts.theme&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#e4(),this.#e7(),this.initEvents()};uninstall=()=>{if(!this.opts.disableInformer){let e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){let e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){let e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t&&t.unmount()}),"auto"===this.opts.theme&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}var r7=i(17577);let r6=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],r9=/^(aria-|data-)/,se=e=>Object.fromEntries(Object.entries(e).filter(([e])=>r9.test(e)||r6.includes(e)));class st extends r7.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(function(e,t){let i=se(e);return Object.keys(e).some(r=>!Object.hasOwn(i,r)&&e[r]!==t[r])}(this.props,e)){let{uppy:e,...t}={...this.props,target:this.container};this.plugin.setOptions(t)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){let{uppy:e,...t}={id:"Dashboard",...this.props,inline:!0,target:this.container};e.use(r4,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e=this.props){let{uppy:t}=e;t.removePlugin(this.plugin)}render(){return(0,r7.createElement)("div",{className:"uppy-Container",ref:e=>{this.container=e},...se(this.props)})}}let si=st,sr={i8:"4.2.1"},ss={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},sn={inputName:"files[]",width:"100%",height:"100%"};class sa extends eU{static VERSION=sr.i8;isDragDropSupported=rg();fileInputRef;constructor(e,t){super(e,{...sn,...t}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=ss,this.i18nInit()}addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};onInputChange=e=>{let t=rp(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.currentTarget.value=""};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let{types:t}=e.dataTransfer,i=t.some(e=>"Files"===e),{allowNewUpload:r}=this.uppy.getState();if(!i||!r){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1});let t=await rc(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});t.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(t)),this.opts.onDrop?.(e)};renderHiddenFileInput(){let{restrictions:e}=this.uppy.opts;return eM("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"})})}renderLabel(){return eM("div",{className:"uppy-DragDrop-label",children:this.i18nArray("dropHereOr",{browse:eM("span",{className:"uppy-DragDrop-browse",children:this.i18n("browse")})})})}renderNote(){return eM("span",{className:"uppy-DragDrop-note",children:this.opts.note})}render(){return eM("button",{type:"button",className:`uppy-u-reset
5
+ ${t}`)},type:"button",children:"?"})]}),eM(tG,{i18n:i,complete:r,numUploads:n})]})]})}function tY(e){let t;let i=[],r="indeterminate";for(let{progress:n}of Object.values(e)){let{preprocess:e,postprocess:s}=n;null==t&&(e||s)&&({mode:r,message:t}=e||s),e?.mode==="determinate"&&i.push(e.value),s?.mode==="determinate"&&i.push(s.value)}return{mode:r,message:t,value:i.reduce((e,t)=>e+t/i.length,0)}}let{STATE_ERROR:tJ,STATE_WAITING:t1,STATE_PREPROCESSING:t0,STATE_UPLOADING:t5,STATE_POSTPROCESSING:t2,STATE_COMPLETE:t3}=tU,t8={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};class t4 extends eN{static VERSION=tO.i8;#eV;#eW;#eG;#eK;constructor(e,t){super(e,{...t8,...t}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=tN,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}#eX(e){if(null==e.total||0===e.total)return null;let t=e.total-e.uploaded;if(t<=0)return null;this.#eV??=performance.now();let i=performance.now()-this.#eV;if(0===i)return Math.round((this.#eK??0)/100)/10;let r=e.uploaded-this.#eW;if(this.#eW=e.uploaded,r<=0)return Math.round((this.#eK??0)/100)/10;let n=r/i,s=null==this.#eG?n:tA(n,this.#eG,2e3,i);this.#eG=s;let a=t/s,o=Math.max(this.#eK-i,0),l=null==this.#eK?a:tA(a,o,2e3,i);return this.#eK=l,this.#eV=performance.now(),Math.round(l/100)/10}startUpload=()=>this.uppy.upload().catch(()=>{});render(e){let{capabilities:t,files:i,allowNewUpload:r,totalProgress:n,error:s,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:u,isUploadStarted:p,isAllComplete:d,isAllPaused:h,isUploadInProgress:c,isSomeGhost:f}=this.uppy.getObjectOfFilesPerState(),m=a?Object.values(i):o,g=!!t.resumableUploads,y=!1!==t.uploadProgress,v=null,b=0;l.every(e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal)?(v=0,l.forEach(e=>{v+=e.progress.bytesTotal||0,b+=e.progress.bytesUploaded||0})):l.forEach(e=>{b+=e.progress.bytesUploaded||0});let _=this.#eX({uploaded:b,total:v});return function({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:r,resumableUploads:n,error:s,hideUploadButton:a,hidePauseResumeButton:o=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:p,uploadState:d,totalProgress:h,files:c,supportsUploadProgress:f,hideAfterFinish:m=!1,isSomeGhost:g,doneButtonHandler:y,isUploadStarted:v,i18n:b,startUpload:_,uppy:w,isAllComplete:C,showProgressDetails:P,numUploads:S,complete:k,totalSize:F,totalETA:T,totalUploadedSize:E}){let x=function(){switch(d){case t2:case t0:{let e=tY(c);if("determinate"===e.mode)return 100*e.value;return h}case tJ:return null;case t5:if(!f)return null;return h;default:return h}}(),I=x??100,D=!s&&e&&(!i&&!r||p)&&t&&!a,A=!l&&d!==t1&&d!==t3,O=n&&!o&&d===t5,N=s&&!C&&!u,U=y&&d===t3,M=eK("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(d){case t2:case t0:{let{mode:e}=tY(c);return"indeterminate"===e}case t5:if(!f)return!0;return!1;default:return!1}}()}),R=eK("uppy-StatusBar",`is-${d}`,{"has-ghosts":g}),L=(()=>{switch(d){case t0:case t2:return eM(tV,{progress:tY(c)});case t3:return eM(tZ,{i18n:b});case tJ:return eM(tQ,{error:s,i18n:b,numUploads:S,complete:k});case t5:return eM(tX,{i18n:b,supportsUploadProgress:f,totalProgress:h,showProgressDetails:P,isUploadStarted:v,isAllComplete:C,isAllPaused:r,newFiles:e,numUploads:S,complete:k,totalUploadedSize:E,totalSize:F,totalETA:T,startUpload:_});default:return null}})();return(D||N||O||A||U||L)&&(d!==t3||!m)?eM("div",{className:R,children:[eM("div",{className:M,style:{width:`${I}%`},role:"progressbar","aria-label":`${I}%`,"aria-valuetext":`${I}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x}),L,eM("div",{className:"uppy-StatusBar-actions",children:[D?eM(tB,{newFiles:e,isUploadStarted:v,recoveredState:p,i18n:b,isSomeGhost:g,startUpload:_,uploadState:d}):null,N?eM(tz,{i18n:b,uppy:w}):null,O?eM(tH,{isAllPaused:r,i18n:b,isAllComplete:C,resumableUploads:n,uppy:w}):null,A?eM(tq,{i18n:b,uppy:w}):null,U?eM(t$,{i18n:b,doneButtonHandler:y}):null]})]}):null}({error:s,uploadState:function(e,t,i,r){if(e)return tU.STATE_ERROR;if(t)return tU.STATE_COMPLETE;if(i)return tU.STATE_WAITING;let n=tU.STATE_WAITING,s=Object.keys(r);for(let e=0;e<s.length;e++){let{progress:t}=r[s[e]];if(t.uploadStarted&&!t.uploadComplete)return tU.STATE_UPLOADING;t.preprocess&&(n=tU.STATE_PREPROCESSING),t.postprocess&&n!==tU.STATE_PREPROCESSING&&(n=tU.STATE_POSTPROCESSING)}return n}(s,d,a,e.files||{}),allowNewUpload:r,totalProgress:n,totalSize:v,totalUploadedSize:b,isAllComplete:!1,isAllPaused:h,isUploadStarted:p,isUploadInProgress:c,isSomeGhost:f,recoveredState:a,complete:u.length,newFiles:m.length,numUploads:l.length,totalETA:_,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:g,supportsUploadProgress:y,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;n(e)||(e.dir="ltr")}#eZ=()=>{let{recoveredState:e}=this.uppy.getState();if(this.#eG=null,this.#eK=null,e){this.#eW=Object.values(e.files).reduce((e,{progress:t})=>e+t.bytesUploaded,0),this.uppy.emit("restore-confirmed");return}this.#eV=performance.now(),this.#eW=0};install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",this.#eZ),this.#eV=performance.now(),this.#eW=this.uppy.getFiles().reduce((e,t)=>e+t.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",this.#eZ)}}let t7=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/,t6=function(e,t,i){let r;let n=t7.exec(e),s=t.mimeType??n?.[1]??"plain/text";if(n?.[2]!=null){let e=atob(decodeURIComponent(n[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);r=[t]}else n?.[3]!=null&&(r=[decodeURIComponent(n[3])]);return i?new File(r,t.name||"",{type:s}):new Blob(r,{type:s})};function t9(e){return e.startsWith("blob:")}function ie(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function it(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ii="undefined"!=typeof self?self:global;let ir="undefined"!=typeof navigator,is=ir&&"undefined"==typeof HTMLImageElement,ia=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),io=ii.Buffer,il=!!io,iu=e=>void 0!==e;function ip(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(iu).length)}function id(e){let t=Error(e);throw delete t.stack,t}function ih(e){let t;let i=(t=0,e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048);return e.jfif.enabled&&(i+=50),e.xmp.enabled&&(i+=2e4),e.iptc.enabled&&(i+=14e3),e.icc.enabled&&(i+=6e3),i}let ic=e=>String.fromCharCode.apply(null,e),im="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class ig{static from(e,t){return e instanceof this&&e.le===t?e:new ig(e,void 0,void 0,t)}constructor(e,t=0,i,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let r=new DataView(e,t,i);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof ig){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&id("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,i);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else id("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=ig){return e instanceof DataView||e instanceof ig?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||id("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new ig(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){let i=this.getUint8Array(e,t);return im?im.decode(i):il?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(ic(i)))}getLatin1String(e=0,t=this.byteLength){return ic(this.getUint8Array(e,t))}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return ic(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}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,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function iy(e,t){id(`${e} '${t}' was not loaded, try using full build of exifr.`)}class iv extends Map{constructor(e){super(),this.kind=e}get(e,t){var i;return this.has(e)||iy(this.kind,e),t&&(e in t||(i=this.kind,id(`Unknown ${i} '${e}'.`)),t[e].enabled||iy(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ib=new iv("file parser"),i_=new iv("segment parser"),iw=new iv("file reader");let iC=ii.fetch;function iP(e,t){return e.startsWith("data:")||e.length>1e4?ik(e,t,"base64"):ia&&e.includes("://")?iS(e,t,"url",iF):ia?ik(e,t,"fs"):ir?iS(e,t,"url",iF):void id("Invalid input argument")}async function iS(e,t,i,r){return iw.has(i)?ik(e,t,i):r?async function(e,t){return new ig(await t(e))}(e,r):void id(`Parser ${i} is not loaded`)}async function ik(e,t,i){let r=new(iw.get(i))(e,t);return await r.read(),r}let iF=e=>iC(e).then(e=>e.arrayBuffer()),iT=e=>new Promise((t,i)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=i,r.readAsArrayBuffer(e)});class iE extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function ix(e,t,i){let r=new iE;for(let[e,t]of i)r.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,r);else e.set(t,r);return r}function iI(e,t,i){let r,n=e.get(t);for(r of i)n.set(r[0],r[1])}let iD=new Map,iA=new Map,iO=new Map,iN=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],iU=["jfif","xmp","icc","iptc","ihdr"],iM=["tiff",...iU],iR=["ifd0","ifd1","exif","gps","interop"],iL=[...iM,...iR],iB=["makerNote","userComment"],iz=["translateKeys","translateValues","reviveValues","multiSegment"],iq=[...iz,"sanitize","mergeOutput","silentErrors"];class iH{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class i$ extends iH{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),it(this,"enabled",!1),it(this,"skip",new Set),it(this,"pick",new Set),it(this,"deps",new Set),it(this,"translateKeys",!1),it(this,"translateValues",!1),it(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=iR.includes(e),this.canBeFiltered&&(this.dict=iD.get(e)),void 0!==i){if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:id(`Invalid options argument: ${i}`)}}applyInheritables(e){let t,i;for(t of iz)void 0!==(i=e[t])&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:n,tagValues:s}=this.dict;for(i of e)"string"==typeof i?(-1===(r=s.indexOf(i))&&(r=n.indexOf(Number(i))),-1!==r&&t.add(Number(n[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,iX(this.pick,this.deps)):this.enabled&&this.pick.size>0&&iX(this.pick,this.deps)}}var ij={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},iV=new Map;class iW extends iH{static useCached(e){let t=iV.get(e);return void 0!==t||(t=new this(e),iV.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):id(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=ir?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of iN)this[e]=ij[e];for(e of iq)this[e]=ij[e];for(e of iB)this[e]=ij[e];for(e of iL)this[e]=new i$(e,ij[e],void 0,this)}setupFromTrue(){let e;for(e of iN)this[e]=ij[e];for(e of iq)this[e]=ij[e];for(e of iB)this[e]=!0;for(e of iL)this[e]=new i$(e,!0,void 0,this)}setupFromArray(e){let t;for(t of iN)this[t]=ij[t];for(t of iq)this[t]=ij[t];for(t of iB)this[t]=ij[t];for(t of iL)this[t]=new i$(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,iR)}setupFromObject(e){let t;for(t of(iR.ifd0=iR.ifd0||iR.image,iR.ifd1=iR.ifd1||iR.thumbnail,Object.assign(this,e),iN))this[t]=iK(e[t],ij[t]);for(t of iq)this[t]=iK(e[t],ij[t]);for(t of iB)this[t]=iK(e[t],ij[t]);for(t of iM)this[t]=new i$(t,ij[t],e[t],this);for(t of iR)this[t]=new i$(t,ij[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,iR,iL),!0===e.tiff?this.batchEnableWithBool(iR,!0):!1===e.tiff?this.batchEnableWithUserValue(iR,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,iR):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,iR)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let e of r)this[e].enabled=!1;for(let[t,r]of iG(e,i))iX(this[t].pick,r),this[t].enabled=!0}else if(t&&t.length)for(let[e,r]of iG(t,i))iX(this[e].skip,r)}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,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),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;for(let n of(r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=iR.some(e=>!0===this[e].enabled)||this.makerNote||this.userComment,iR))this[n].finalizeFilters()}get onlyTiff(){return!iU.map(e=>this[e].enabled).some(e=>!0===e)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of iM)this[e].enabled&&!i_.has(e)&&iy("segment parser",e)}}function iG(e,t){let i,r,n,s,a=[];for(n of t){for(s of(i=iD.get(n),r=[],i))(e.includes(s[0])||e.includes(s[1]))&&r.push(s[0]);r.length&&a.push([n,r])}return a}function iK(e,t){return void 0!==e?e:void 0!==t?t:void 0}function iX(e,t){for(let i of t)e.add(i)}it(iW,"default",ij);class iZ{constructor(e){it(this,"parsers",{}),it(this,"output",{}),it(this,"errors",[]),it(this,"pushToErrors",e=>this.errors.push(e)),this.options=iW.useCached(e)}async read(e){var t;this.file=await (t=this.options,"string"==typeof e?iP(e,t):ir&&!is&&e instanceof HTMLImageElement?iP(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new ig(e):ir&&e instanceof Blob?iS(e,t,"blob",iT):void id("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of ib)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),id("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),ip(e)?void 0:e}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async t=>{let i=await t.parse();t.assignToOutput(e,i)});this.options.silentErrors&&(t=t.map(e=>e.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){var e;this.setup();let{options:t,file:i}=this,r=i_.get("tiff",t);if(i.tiff?e={start:0,type:"tiff"}:i.jpeg&&(e=await this.fileParser.getOrFindSegment("tiff")),void 0===e)return;let n=await this.fileParser.ensureSegmentChunk(e),s=this.parsers.tiff=new r(n,t,i),a=await s.extractThumbnail();return i.close&&i.close(),a}}async function iQ(e,t){let i=new iZ(t);return await i.read(e),i.parse()}var iY=Object.freeze({__proto__:null,parse:iQ,Exifr:iZ,fileParsers:ib,segmentParsers:i_,fileReaders:iw,tagKeys:iD,tagValues:iA,tagRevivers:iO,createDictionary:ix,extendDictionary:iI,fetchUrlAsArrayBuffer:iF,readBlobAsArrayBuffer:iT,chunkedProps:iN,otherSegments:iU,segments:iM,tiffBlocks:iR,segmentsAndBlocks:iL,tiffExtractables:iB,inheritables:iz,allFormatters:iq,Options:iW});class iJ{static findPosition(e,t){let i=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,n=t+r,s=i-r;return{offset:t,length:i,headerLength:r,start:n,size:s,end:n+s}}static parse(e,t={}){return new this(e,new iW({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof ig?e:new ig(e)}constructor(e,t={},i){it(this,"errors",[]),it(this,"raw",new Map),it(this,"handleError",e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=iO.get(t),r=iA.get(t),n=iD.get(t),s=this.options[t],a=s.reviveValues&&!!i,o=s.translateValues&&!!r,l=s.translateKeys&&!!n,u={};for(let[t,s]of e)a&&i.has(t)?s=i.get(t)(s):o&&r.has(t)&&(s=this.translateValue(s,r.get(t))),l&&n.has(t)&&(t=n.get(t)||t),u[t]=s;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}it(iJ,"headerLength",4),it(iJ,"type",void 0),it(iJ,"multiSegment",!1),it(iJ,"canHandle",()=>!1);class i1 extends class{constructor(e,t,i){it(this,"errors",[]),it(this,"ensureSegmentChunk",async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked){if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){id(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):id("Segment unreachable: "+JSON.stringify(e));return e.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(i_.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),it(this,"appSegments",[]),it(this,"jpegSegments",[]),it(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(i_.keyList())):(e=void 0===e?i_.keyList().filter(e=>this.options[e].enabled):e.filter(e=>this.options[e].enabled&&i_.has(e)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:n,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(n).some(e=>{let t=i_.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment}))&&await this.file.readWhole(),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;s.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=i,n=this.appSegments.some(e=>!this.file.available(e.offset||e.start,e.length||e.size));if(t=e>r&&!n?!await i.readNextChunk(e):!await i.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,n,s,a,o,{file:l,findAll:u,wanted:p,remaining:d,options:h}=this;for(;e<t;e++)if(255===l.getUint8(e)){var c;if((c=i=l.getUint8(e+1))>=224&&c<=239){if(r=l.getUint16(e+2),(n=function(e,t,i){for(let[r,n]of i_)if(n.canHandle(e,t,i))return r}(l,e,r))&&p.has(n)&&(a=(s=i_.get(n)).findPosition(l,e),o=h[n],a.type=n,this.appSegments.push(a),!u&&(s.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||d.delete(n)):d.delete(n),0===d.size)))break;h.recordUnknownSegments&&((a=iJ.findPosition(l,e)).marker=i,this.unknownSegments.push(a)),e+=r+1}else if(192===i||194===i||196===i||219===i||221===i||218===i||254===i){if(r=l.getUint16(e+2),218===i&&!1!==h.stopAfterSos)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let e=function(e,t){let i,r,n,s=new Map;for(let a=0;a<e.length;a++)r=(i=e[a])[t],s.has(r)?n=s.get(r):s.set(r,n=[]),n.push(i);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=e.map(([e,t])=>{let i=i_.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}it(i1,"type","jpeg"),ib.set("jpeg",i1);let i0=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class i5 extends iJ{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:n}=this.options[t],s=(r=new Set(r)).size>0,a=0===n.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(s){if(r.has(o)&&(i.set(o,this.parseTag(e,o,t)),r.delete(o),0===r.size))break}else!a&&n.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){var r;let{chunk:n}=this,s=n.getUint16(e+2),a=n.getUint32(e+4),o=i0[s];if(o*a<=4?e+=8:e=n.getUint32(e+8),(s<1||s>13)&&id(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>n.byteLength&&id(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`),1===s)return n.getUint8Array(e,a);if(2===s)return""===(r=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(r=n.getString(e,a)).trim())?void 0:r;if(7===s)return n.getUint8Array(e,a);if(1===a)return this.parseTagValue(s,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(s))(a);for(let i=0;i<a;i++)t[i]=this.parseTagValue(s,e),e+=o;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);default:id(`Invalid tiff type ${e}`)}}}class i2 extends i5{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&id("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&id(`IFD0 offset points to outside of file.
6
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ih(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,ih(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",i3(...e.get(2),e.get(1))),e.set("longitude",i3(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,r={};for(t of iR)if(!ip(e=this[t])){if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,i)}else r[t]=i}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[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function i3(e,t,i,r){var n=e+t/60+i/3600;return"S"!==r&&"W"!==r||(n*=-1),n}it(i2,"type","tiff"),it(i2,"headerLength",10),i_.set("tiff",i2),Object.freeze({__proto__:null,default:iY,Exifr:iZ,fileParsers:ib,segmentParsers:i_,fileReaders:iw,tagKeys:iD,tagValues:iA,tagRevivers:iO,createDictionary:ix,extendDictionary:iI,fetchUrlAsArrayBuffer:iF,readBlobAsArrayBuffer:iT,chunkedProps:iN,otherSegments:iU,segments:iM,tiffBlocks:iR,segmentsAndBlocks:iL,tiffExtractables:iB,inheritables:iz,allFormatters:iq,Options:iW,parse:iQ});let i8={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},i4=(Object.assign({},i8,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},i8,{tiff:!1,ifd1:!0,mergeOutput:!1}),Object.assign({},i8,{firstChunkSize:4e4,ifd0:[274]}));async function i7(e){let t=new iZ(i4);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}let i6=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}}),i9=!0,re=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t;i9=Number(e)+.1*Number(i)<13.4,re=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);i9=re=15>Number(t)}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);i9=re=81>Number(t)}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);i9=re=77>Number(t)}}async function rt(e){let t=await i7(e);return Object.assign({canvas:i9,css:re},i6[t])}class ri extends ig{constructor(...e){super(...e),it(this,"ranges",new rr),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;let i=new DataView((t=il?io.allocUnsafe(e):new Uint8Array(e)).buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let 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 rr{constructor(){it(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,n=this.list.filter(t=>{var i,n,s,a,o,l;return i=e,n=t.offset,s=r,i<=n&&n<=s||(a=e,o=t.end,l=r,a<=o&&o<=l)});if(n.length>0){e=Math.min(e,...n.map(e=>e.offset)),t=(r=Math.max(r,...n.map(e=>e.end)))-e;let i=n.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter(e=>!n.includes(e))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some(t=>t.offset<=e&&i<=t.end)}}class rn extends ri{constructor(e,t){super(0),it(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}iw.set("blob",class extends rn{async readWhole(){this.chunked=!1;let e=await iT(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,r=this.input.slice(e,i),n=await iT(r);return this.set(n,e,!0)}});let rs={i8:"4.2.1"},ra={strings:{generatingThumbnails:"Generating thumbnails..."}},ro={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class rl extends eN{static VERSION=rs.i8;queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...ro,...t}),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=ra,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,i){let r=URL.createObjectURL(e.data);return Promise.all([new Promise((e,t)=>{let i=new Image;i.src=r,i.addEventListener("load",()=>{URL.revokeObjectURL(r),e(i)}),i.addEventListener("error",e=>{URL.revokeObjectURL(r),t(e.error||Error("Could not create thumbnail"))})}),rt(e.data).catch(()=>1)]).then(([e,r])=>{let n=this.getProportionalDimensions(e,t,i,r.deg),s=function(e,t){let i=e.width,r=e.height;(90===t.deg||270===t.deg)&&(i=e.height,r=e.width);let n=document.createElement("canvas");n.width=i,n.height=r;let s=n.getContext("2d");return s.translate(i/2,r/2),t.canvas&&(s.rotate(t.rad),s.scale(t.scaleX,t.scaleY)),s.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),n}(e,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(i=>{e.toBlob(i,t,80)}).then(e=>{if(null===e)throw Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(()=>t6(e.toDataURL(t,80),{})).then(e=>{if(null===e)throw Error("could not extract blob, probably an old browser");return e})}(this.resizeImage(s,n.width,n.height),this.thumbnailType,0)}).then(e=>URL.createObjectURL(e))}getProportionalDimensions(e,t,i,r){let n=e.width/e.height;return((90===r||270===r)&&(n=e.height/e.width),null!=t)?{width:t,height:Math.round(t/n)}:null!=i?{width:Math.round(i*n),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,i){let r=function(e){let t=e.width/e.height,i=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(i>4096&&(r=Math.round((i=4096)/t)),r>4096&&(i=Math.round(t*(r=4096))),e.width>i){let t=document.createElement("canvas");return t.width=i,t.height=r,t.getContext("2d").drawImage(e,0,0,i,r),t}return e}(e),n=Math.ceil(Math.log2(r.width/t));n<1&&(n=1);let s=t*2**(n-1),a=i*2**(n-1);for(;n--;){let e=document.createElement("canvas");e.width=s,e.height=a,e.getContext("2d").drawImage(r,0,0,s,a),r=e,s=Math.round(s/2),a=Math.round(a/2)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return ie(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()}onFileAdded=e=>{!e.preview&&e.data&&ie(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)};onFileRemoved=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&t9(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(e=>e.isRestored).forEach(e=>{(!e.preview||t9(e.preview))&&this.addToQueue(e.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let t=()=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)})};return new Promise(e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),e()}):(t(),e())})};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)}}let ru=function(e){if("string"==typeof e){let t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&r(e)?[e]:null},rp=Array.from;async function*rd(e,t,i){let r=()=>`${t}/${e.name}`;if("file"===e.kind){let n=await e.getFile();null!=n?(n.relativePath=t?r():null,yield n):null!=i&&(yield i)}else if("directory"===e.kind)for await(let i of e.values())yield*rd(i,t?r():e.name);else null!=i&&(yield i)}async function*rh(e,t){for(let{lastResortFile:i,fileSystemHandle:r}of(await Promise.all(Array.from(e.items,async e=>{let i;return{fileSystemHandle:i??=function e(t,i){return null==t?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile:()=>new Promise((e,i)=>t.file(e,i)),async *values(){let r=t.createReader(),n=await new Promise(t=>{!function e(t,i,r,{onSuccess:n}){t.readEntries(s=>{let a=[...i,...s];s.length?queueMicrotask(()=>{e(t,a,r,{onSuccess:n})}):n(a)},e=>{r(e),n(i)})}(r,[],i,{onSuccess:r=>t(r.map(t=>e(t,i)))})});yield*n},isSameEntry:void 0}}("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),lastResortFile:e.getAsFile()}}))))if(null!=r)try{yield*rd(r,"",i)}catch(e){null!=i?yield i:t(e)}else null!=i&&(yield i)}async function rc(e,t){let i=t?.logDropError??Function.prototype;try{let t=[];for await(let r of rh(e,i))t.push(r);return t}catch{return Promise.resolve(rp(e.files))}}let rf=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},rm={i8:"4.4.1"};function rg(){let e=document.body;return!!("draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window)}class ry extends S{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,i)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:""===t?"environment":t,accept:{photo:"image/*",video:"video/*"}[e],ref:i});renderMyDeviceAcquirer=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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 "})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length,children:e});renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,n=r.charAt(0).toUpperCase()+r.slice(1);return eM("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:i,browse:t})})};[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")}renderAcquirer=e=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:eM("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":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[eM("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),eM("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return eM(P,{children:[t.map(e=>this.renderAcquirer(e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:i.map(e=>this.renderAcquirer(e))})]})};renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,n=[],s="myDevice";t||n.push({key:s,elements:this.renderMyDeviceAcquirer()}),i&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(e=>({key:e.id,elements:this.renderAcquirer(e)}))),1===n.length&&n[0].key===s&&(n=[]);let a=[...n],o=a.splice(n.length-2,n.length);return eM(P,{children:[this.renderDropPasteBrowseTagline(n.length),eM("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[a.map(({key:e,elements:t})=>eM(P,{children:t},e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:o.map(({key:e,elements:t})=>eM(P,{children:t},e))})]})]})};renderPoweredByUppy(){let{i18nArray:e}=this.props,t=e("poweredBy",{uppy:eM("span",{children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),eM("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]})});return eM("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:t})}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return eM("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,e=>{this.fileInput=e}),this.renderHiddenInput(!0,e=>{this.folderInput=e}),e&&this.renderHiddenCameraInput("photo",i,e=>{this.mobilePhotoFileInput=e}),t&&this.renderHiddenCameraInput("video",i,e=>{this.mobileVideoFileInput=e}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),eM("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&eM("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}let rv=e=>eM("div",{className:eK("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),eM(ry,{...e})]}),rb=function(e){let t=e.files[e.fileCardFor];return eM("div",{className:eK("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()},children:e.i18n("cancel")}),eM("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),eM("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})};function r_(e){let t={color:"#838999",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[eM("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"}),eM("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;let i=e.split("/")[0],r=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"})})}:"image"===i?{color:"#686de0",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#686DE0",fillRule:"evenodd",children:[eM("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"}),eM("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"}),eM("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"})})}:"video"===i?{color:"#19af67",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}:"application"===i&&"pdf"===r?{color:"#e25149",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"})})}:t}let rw=function(e){let{tagName:t}=e.target;if("INPUT"===t||"TEXTAREA"===t){e.stopPropagation();return}e.preventDefault(),e.stopPropagation()};function rC(e){let{file:t}=e;if(t.preview)return eM("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:i,icon:r}=r_(t.type);return eM("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[eM("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:r}),eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:eM("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function rP(e){let{computedMetaFields:t,requiredMetaFields:i,updateMeta:r,form:n,formState:s}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(e=>{let t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return eM("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[eM("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:s[e.id],onChange:t=>r(t,e.id),fieldCSSClasses:a,required:o,form:n.id},w):eM("input",{className:a.text,id:t,form:n.id,type:e.type||"text",required:o,value:s[e.id],placeholder:e.placeholder,onInput:t=>r(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)})}function rS(e){let{files:t,fileCardFor:i,toggleFileCard:r,saveFileCard:n,metaFields:s,requiredMetaFields:a,openFileEditor:o,i18n:l,i18nArray:u,className:p,canEditFile:d}=e,h=t[i],c=("function"==typeof s?s(t[i]):s)??[],f=d(h),m={};c.forEach(e=>{m[e.id]=h.meta[e.id]??""});let[g,y]=Y(m),v=ei(e=>{e.preventDefault(),n(g,i)},[n,g,i]),b=()=>{r(!1)},[_]=Y(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=rf(),e});return J(()=>(document.body.appendChild(_),_.addEventListener("submit",v),()=>{_.removeEventListener("submit",v),document.body.removeChild(_)}),[_,v]),eM("div",{className:eK("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:rw,onDragLeave:rw,onDrop:rw,onPaste:rw,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:h.meta?h.meta.name:h.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",form:_.id,title:l("finishEditingFile"),onClick:b,children:l("cancel")})]}),eM("div",{className:"uppy-Dashboard-FileCard-inner",children:[eM("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:r_(h.type).color},children:[eM(rC,{file:h}),f&&eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{v(e),o(h)},children:l("editImage")})]}),eM("div",{className:"uppy-Dashboard-FileCard-info",children:eM(rP,{computedMetaFields:c,requiredMetaFields:a,updateMeta:(e,t)=>{y({...g,[t]:e})},form:_,formState:g})}),eM("div",{className:"uppy-Dashboard-FileCard-actions",children:[eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:_.id,children:l("saveChanges")}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:_.id,children:l("cancel")})]})]})]})}function rk({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:r,i18n:n,onClick:s}){return!t&&i&&i.length>0||!t&&r(e)?eM("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:()=>s(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:eM("g",{fillRule:"evenodd",children:[eM("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"}),eM("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),eM("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function rF({i18n:e,onClick:t,file:i}){return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>t(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[eM("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"}),eM("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 rT({file:e,uppy:t,i18n:i}){let r=r=>{(function(e,t="Copy the URL below"){return new Promise(i=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();let n=()=>{document.body.removeChild(r),window.prompt(t,e),i()};try{if(!document.execCommand("copy"))return n();return document.body.removeChild(r),i()}catch(e){return document.body.removeChild(r),n()}})})(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>r.target.focus({preventScroll:!0}))};return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:e=>r(e),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:eM("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 rE(e){let{uppy:t,file:i,uploadInProgressOrComplete:r,canEditFile:n,metaFields:s,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:p}=e;return eM("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[eM(rk,{i18n:l,file:i,uploadInProgressOrComplete:r,canEditFile:n,metaFields:s,onClick:()=>{s&&s.length>0?u(!0,i.id):p(i)}}),a&&i.uploadURL?eM(rT,{file:i,uppy:t,i18n:l}):null,o?eM(rF,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function rx(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;let i=t-3;return e.slice(0,Math.ceil(i/2))+"..."+e.slice(-Math.floor(i/2))}let rI=(e,t)=>("function"==typeof t?t():t).filter(t=>t.id===e)[0].name;function rD(e){let{file:t,toggleFileCard:i,i18n:r,metaFields:n}=e,{missingRequiredMetaFields:s}=t;if(!s?.length)return null;let a=s.map(e=>rI(e,n)).join(", ");return eM("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:s.length,fields:a})," ",eM("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:r("editFile")})]})}let rA=e=>{let{author:t,name:i}=e.file.meta;return eM("div",{className:"uppy-Dashboard-Item-name",title:i,children:rx(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},rO=e=>{let{author:t}=e.file.meta,i=e.file.remote?.providerName,r=`\u00B7`;return t?eM("div",{className:"uppy-Dashboard-Item-author",children:[eM("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:rx(t.name,13)}),i?eM(P,{children:[` ${r} `,i,` ${r} `]}):null]}):null},rN=e=>e.file.size&&eM("div",{className:"uppy-Dashboard-Item-statusSize",children:tM(e.file.size)}),rU=e=>e.file.isGhost&&eM("span",{children:[" • ",eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),rM=({file:e,onClick:t})=>e.error?eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button",children:"?"}):null;function rR(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:n,toggleAddFilesPanel:s,isSingleFile:a,containerHeight:o,containerWidth:l}=e;return eM("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[eM("div",{className:"uppy-Dashboard-Item-fileName",children:[rA({file:t,isSingleFile:a,containerHeight:o,containerWidth:l}),eM(rM,{file:t,onClick:()=>alert(t.error)})]}),eM("div",{className:"uppy-Dashboard-Item-status",children:[rO({file:t}),rN({file:t}),rU({file:t,toggleAddFilesPanel:s,i18n:i})]}),eM(rD,{file:t,i18n:i,toggleFileCard:r,metaFields:n})]})}function rL(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:n,showLinkToFileUploadResult:s}=e;return eM("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":r_(t.type).color},children:[s&&t.uploadURL&&eM("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:eM("span",{hidden:!0,children:t.meta.name})}),eM(rC,{file:t}),eM(rD,{file:t,i18n:i,toggleFileCard:r,metaFields:n})]})}function rB(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function rz(e){return eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":rB(e),title:rB(e),onClick:()=>(function(e){if(!e.isUploaded){if(e.error&&!e.hideRetryButton){e.uppy.retryUpload(e.file.id);return}e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id)}})(e),children:e.children})})}function rq({children:e}){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function rH({progress:e}){let t=2*Math.PI*15;return eM("g",{children:[eM("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),eM("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 r$(e){return e.file.progress.uploadStarted&&void 0!==e.file.progress.percentage?e.isUploaded?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rq,{children:[eM("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?eM(rz,{...e,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[eM("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),eM("path",{d:"M7.9 3H10v2H7.9z"}),eM("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),eM("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?eM(rz,{...e,children:eM(rq,{children:[eM(rH,{progress:e.file.progress.percentage}),e.file.isPaused?eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):eM("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[eM("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),eM("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rq,{children:eM(rH,{progress:e.file.progress.percentage})})})}):eM(rz,{...e,children:eM(rq,{children:[eM(rH,{progress:e.file.progress.percentage}),eM("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})]})}):null}class rj extends S{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;let i=Object.keys(e),r=Object.keys(t),n=i.length;if(r.length!==n)return!1;for(let r=0;r<n;r++){let n=i[r];if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1}return!0}(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,s=e.error||!1,{isGhost:a}=e,o=this.props.individualCancellation?!i:!n&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(o=!0),eM("div",{className:eK({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role,children:[eM("div",{className:"uppy-Dashboard-Item-preview",children:[eM(rL,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),eM(r$,{uppy:this.props.uppy,file:e,error:s,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),eM("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[eM(rR,{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}),eM(rE,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function rV({id:e,i18n:t,uppy:i,files:r,resumableUploads:n,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:p,isSingleFile:d,toggleFileCard:h,handleRequestThumbnail:c,handleCancelThumbnail:f,recoveredState:m,individualCancellation:g,itemsPerRow:y,openFileEditor:v,canEditFile:b,toggleAddFilesPanel:_,containerWidth:w,containerHeight:C}){let P=1===y?71:200,S=et(()=>{let e=Object.keys(r);return m&&e.sort((e,t)=>Number(r[t].isGhost)-Number(r[e].isGhost)),function(e,t){let i=[],r=[];return e.forEach(e=>{r.length<t?r.push(e):(i.push(r),r=[e])}),r.length&&i.push(r),i}(e,y)},[r,y,m]),k=y=>eM("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map(y=>eM(rj,{uppy:i,id:e,i18n:t,resumableUploads:n,individualCancellation:g,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:p,recoveredState:m,isSingleFile:d,containerWidth:w,containerHeight:C,toggleFileCard:h,handleRequestThumbnail:c,handleCancelThumbnail:f,role:"listitem",openFileEditor:v,canEditFile:b,toggleAddFilesPanel:_,file:r[y]},y))},y[0]);return d?eM("div",{class:"uppy-Dashboard-files",children:k(S[0])}):eM(eY,{class:"uppy-Dashboard-files",role:"list",data:S,renderRow:k,rowHeight:P})}let rW=function({activePickerPanel:e,className:t,hideAllPanels:i,i18n:r,state:n,uppy:s}){let a=ee(null);return eM("div",{className:eK("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:rw,onDragLeave:rw,onDrop:rw,onPaste:rw,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:e.name})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:r("cancel")})]}),eM("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:s.getPlugin(e.id).render(n,a.current)})]})},rG={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function rK({files:e,i18n:t,isAllComplete:i,isAllErrored:r,isAllPaused:n,inProgressNotPausedFiles:s,newFiles:a,processingFiles:o}){switch(function(e,t,i,r={}){if(e)return rG.STATE_ERROR;if(t)return rG.STATE_COMPLETE;if(i)return rG.STATE_PAUSED;let n=rG.STATE_WAITING,s=Object.keys(r);for(let e=0;e<s.length;e++){let{progress:t}=r[s[e]];if(t.uploadStarted&&!t.uploadComplete)return rG.STATE_UPLOADING;t.preprocess&&n!==rG.STATE_UPLOADING&&(n=rG.STATE_PREPROCESSING),t.postprocess&&n!==rG.STATE_UPLOADING&&n!==rG.STATE_PREPROCESSING&&(n=rG.STATE_POSTPROCESSING)}return n}(r,i,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:o.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}let rX=function(e){let{i18n:t,isAllComplete:i,hideCancelButton:r,maxNumberOfFiles:n,toggleAddFilesPanel:s,uppy:a}=e,{allowNewUpload:o}=e;return o&&n&&(o=e.totalFileCount<e.maxNumberOfFiles),eM("div",{className:"uppy-DashboardContent-bar",children:[i||r?eM("div",{}):eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:t("cancel")}),eM("div",{className:"uppy-DashboardContent-title",children:eM(rK,{...e})}),o?eM("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>s(!0),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:eM("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"})}),eM("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):eM("div",{})]})},rZ="uppy-transition-slideDownUp",rQ=function({children:e}){let[t,i]=Y(null),[r,n]=Y(""),s=ee(),a=ee(),o=ee(),l=()=>{n(`${rZ}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{n(`${rZ}-enter ${rZ}-enter-active`),s.current=setTimeout(()=>{n("")},250)})},u=()=>{n(`${rZ}-leave`),cancelAnimationFrame(o.current),clearTimeout(s.current),s.current=void 0,o.current=requestAnimationFrame(()=>{n(`${rZ}-leave ${rZ}-leave-active`),a.current=setTimeout(()=>{i(null),n("")},250)})};return(J(()=>{let r=x(e)[0];t!==r&&(r&&!t?l():!t||r||a.current||u(),i(r))},[e,t]),J(()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),t)?R(t,{className:eK(r,t.props.className)}):null},rY={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"}},rJ=['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])'];var r1=i(19788);function r0(e,t){if(t){let i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function r5(e,t){let i=t[0];i&&(i.focus(),e.preventDefault())}function r2(e,t,i){let r=r0(i,t),n=rp(r.querySelectorAll(rJ)),s=n.indexOf(document.activeElement);r.contains(document.activeElement)?e.shiftKey&&0===s?function(e,t){let i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,n):e.shiftKey||s!==n.length-1||r5(e,n):r5(e,n)}function r3(){let e={};return e.promise=new Promise((t,i)=>{e.resolve=t,e.reject=i}),e}let r8={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:tF,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};class r4 extends eN{static VERSION=rm.i8;#eQ;modalName=`uppy-Dashboard-${rf()}`;superFocus=(function(){let e=!1;return r1((t,i)=>{let r=r0(t,i),n=r.contains(document.activeElement);if(n&&e)return;let s=r.querySelector("[data-uppy-super-focusable]");if(!n||s){if(s)s.focus({preventScroll:!0}),e=!0;else{let t=r.querySelector(rJ);t?.focus({preventScroll:!0}),e=!1}}},260)})();ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){super(e,{...r8,...t,autoOpen:t?.autoOpen??null}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=rY,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{let t=this.getPluginState().targets.filter(t=>t.id!==e.id);this.setPluginState({targets:t})};addTarget=e=>{let t=e.id||e.constructor.name,i=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r)return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let n=this.getPluginState().targets.slice();return n.push({id:t,name:i,type:r}),this.setPluginState({targets:n}),this.el};hideAllPanels=()=>{let e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};(e.activePickerPanel!==t.activePickerPanel||e.showAddFilesPanel!==t.showAddFilesPanel||e.showFileEditor!==t.showFileEditor||e.activeOverlayType!==t.activeOverlayType)&&(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{let{targets:t}=this.getPluginState(),i=t.find(t=>"acquirer"===t.type&&t.id===e);this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{let{targets:t}=this.getPluginState();return this.#eY(t).some(t=>this.uppy.getPlugin(t.id).canEditFile(e))};openFileEditor=e=>{let{targets:t}=this.getPluginState(),i=this.#eY(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach(t=>{this.uppy.getPlugin(t.id).selectFile(e)})};closeFileEditor=()=>{let{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{let{targets:e}=this.getPluginState();this.#eY(e).forEach(e=>{this.uppy.getPlugin(e.id).save()}),this.closeFileEditor()};openModal=()=>{let{promise:e,resolve:t}=r3();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e};closeModal=e=>{let t=e?.manualClose??!0,{isHidden:i,isClosing:r}=this.getPluginState();if(i||r)return;let{promise:n,resolve:s}=r3();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),s()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),s();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),n};isModalOpen=()=>!this.getPluginState().isHidden;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{let t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{let i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{let{width:t,height:i}=e[0].contentRect;this.setPluginState({containerWidth:t,containerHeight:i,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{let t=this.#eQ??rp(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter(e=>!e.classList.contains("uppy-Dashboard-close"));for(let i of t)"A"===i.tagName?i.setAttribute("aria-disabled",e):i.disabled=e;e?this.#eQ=t:this.#eQ=null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&r2(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)});let t=rp(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();let t=rp(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let t=(()=>{let t=!0;return this.uppy.iteratePlugins(i=>{i.canHandleRootDrop?.(e)&&(t=!0)}),t})(),i=(()=>{let{types:t}=e.dataTransfer;return t.some(e=>"Files"===e)})();if(!t&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!t)||!this.uppy.getState().allowNewUpload){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)});let t=!1;this.uppy.log("[Dashboard] Processing dropped files");let i=await rc(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),t||(this.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||r2(e,t,i)}(e,this.getPluginState().activeOverlayType,this.el)};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};handleCancelRestore=()=>{this.uppy.emit("restore-canceled")};#eJ=()=>{if(this.opts.disableThumbnailGenerator)return;let e=this.uppy.getFiles();if(1===e.length){let t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});let i={...e[0],preview:void 0};t?.requestThumbnail(i).then(()=>{t?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#e1=e=>{let t=e[0],{metaFields:i}=this.getPluginState(),r=i&&i.length>0,n=this.canEditFile(t);r&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):n&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let e=ru(this.opts.trigger);e?e.forEach(e=>e.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",this.#e0),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",this.#eJ),this.uppy.on("file-removed",this.#eJ),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",this.#e1)};removeEvents=()=>{let e=ru(this.opts.trigger);!this.opts.inline&&e&&e.forEach(e=>e.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#e0),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",this.#eJ),this.uppy.off("file-removed",this.#eJ),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",this.#e1)};superFocusOnEachUpdate=()=>{let e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,r=!this.opts.inline;i&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#e5=e=>{let t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#e2=e=>{let t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()};#e3=e=>e.filter(e=>"acquirer"===e.type&&this.#e2(e)).map(this.#e5);#e8=e=>e.filter(e=>"progressindicator"===e.type).map(this.#e5);#eY=e=>e.filter(e=>"editor"===e.type).map(this.#e5);render=e=>{let t;let i=this.getPluginState(),{files:r,capabilities:n,allowNewUpload:s}=e,{newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:p,inProgressNotPausedFiles:d,processingFiles:h,isUploadStarted:c,isAllComplete:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=this.#e3(i.targets),y=this.#e8(i.targets),v=this.#eY(i.targets);return t="auto"===this.opts.theme?n.darkMode?"dark":"light":this.opts.theme,0>["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),function(e){let t=0===e.totalFileCount,i=1===e.totalFileCount,r=e.containerWidth>576,n=e.containerHeight>330,s=eK({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&n}),a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);let o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter(t=>e.files[t].isGhost).length:0;return eM("div",{className:s,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&rg(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[eM("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),eM("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:eM("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:eM("span",{"aria-hidden":"true",children:"\xd7"})}),eM("div",{className:"uppy-Dashboard-innerWrap",children:[eM("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),o&&eM(rX,{...e}),l&&eM("div",{className:"uppy-Dashboard-serviceMsg",children:[eM("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:eM("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[eM("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"}),eM("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),eM("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),eM("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),eM("div",{className:"uppy-Dashboard-serviceMsg-text",children:u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles")})]}),o?eM(rV,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:a,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):eM(ry,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),eM(rQ,{children:e.showAddFilesPanel?eM(rv,{...e,isSizeMD:r},"AddFiles"):null}),eM(rQ,{children:e.fileCardFor?eM(rS,{...e},"FileCard"):null}),eM(rQ,{children:e.activePickerPanel?eM(rW,{...e},"Picker"):null}),eM(rQ,{children:e.showFileEditor?eM(rb,{...e},"Editor"):null}),eM("div",{className:"uppy-Dashboard-progressindicators",children:e.progressindicators.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})]})]})}({state:e,isHidden:i.isHidden,files:r,newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:p,inProgressNotPausedFiles:d,processingFiles:h,isUploadStarted:c,isAllComplete:f,isAllPaused:m,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:s,acquirers:g,theme:t,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:i.activePickerPanel,showFileEditor:i.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:i.isClosing,progressindicators:y,editors:v,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:e.recoveredState,metaFields:i.metaFields,resumableUploads:n.resumableUploads||!1,individualCancellation:n.individualCancellation,isMobileDevice:n.isMobileDevice,fileCardFor:i.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:i.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:i.containerWidth,containerHeight:i.containerHeight,areInsidesReadyToBeVisible:i.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:i.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})};#e4=()=>{let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#e7=()=>{this.uppy.iteratePlugins(this.#e0)};#e0=e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&!this.getPluginState().targets.some(t=>e.id===t.id)&&e.mount(this,e)};#e6(){let{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:n,hideProgressAfterFinish:s,locale:a,doneButtonHandler:o}=this.opts;return{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:n,hideAfterFinish:s,locale:a,doneButtonHandler:o}}#e9(){let{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r,lazy:!r}}#te(){return{}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#tt())?.setOptions(this.#e6()),this.uppy.getPlugin(this.#ti())?.setOptions(this.#e9())}#tt(){return`${this.id}:StatusBar`}#ti(){return`${this.id}:ThumbnailGenerator`}#tr(){return`${this.id}:Informer`}install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:i,allowMultipleUploadBatches:r}=this.uppy.opts;(i||r)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:n}=this.opts;n&&this.mount(n,this),this.opts.disableStatusBar||this.uppy.use(t4,{id:this.#tt(),target:this,...this.#e6()}),this.opts.disableInformer||this.uppy.use(eq,{id:this.#tr(),target:this,...this.#te()}),this.opts.disableThumbnailGenerator||this.uppy.use(rl,{id:this.#ti(),...this.#e9()}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let s=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${s?"on":"off"}`),this.setDarkModeCapability(s),"auto"===this.opts.theme&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#e4(),this.#e7(),this.initEvents()};uninstall=()=>{if(!this.opts.disableInformer){let e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){let e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){let e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t&&t.unmount()}),"auto"===this.opts.theme&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}var r7=i(17577);let r6=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],r9=/^(aria-|data-)/,ne=e=>Object.fromEntries(Object.entries(e).filter(([e])=>r9.test(e)||r6.includes(e)));class nt extends r7.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(function(e,t){let i=ne(e);return Object.keys(e).some(r=>!Object.hasOwn(i,r)&&e[r]!==t[r])}(this.props,e)){let{uppy:e,...t}={...this.props,target:this.container};this.plugin.setOptions(t)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){let{uppy:e,...t}={id:"Dashboard",...this.props,inline:!0,target:this.container};e.use(r4,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e=this.props){let{uppy:t}=e;t.removePlugin(this.plugin)}render(){return(0,r7.createElement)("div",{className:"uppy-Container",ref:e=>{this.container=e},...ne(this.props)})}}let ni=nt,nr={i8:"4.2.1"},nn={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},ns={inputName:"files[]",width:"100%",height:"100%"};class na extends eN{static VERSION=nr.i8;isDragDropSupported=rg();fileInputRef;constructor(e,t){super(e,{...ns,...t}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=nn,this.i18nInit()}addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};onInputChange=e=>{let t=rp(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.currentTarget.value=""};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let{types:t}=e.dataTransfer,i=t.some(e=>"Files"===e),{allowNewUpload:r}=this.uppy.getState();if(!i||!r){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1});let t=await rc(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});t.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(t)),this.opts.onDrop?.(e)};renderHiddenFileInput(){let{restrictions:e}=this.uppy.opts;return eM("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"})})}renderLabel(){return eM("div",{className:"uppy-DragDrop-label",children:this.i18nArray("dropHereOr",{browse:eM("span",{className:"uppy-DragDrop-browse",children:this.i18n("browse")})})})}renderNote(){return eM("span",{className:"uppy-DragDrop-note",children:this.opts.note})}render(){return eM("button",{type:"button",className:`uppy-u-reset
7
7
  uppy-DragDrop-container
8
8
  ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
9
9
  ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
10
- `,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,children:[this.renderHiddenFileInput(),eM("div",{className:"uppy-DragDrop-inner",children:[sa.renderArrowSvg(),this.renderLabel(),this.renderNote()]})]})}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}let so={i8:"4.2.1"},sl={strings:{chooseFiles:"Choose files"}},su={pretty:!0,inputName:"files[]"};class sp extends eU{static VERSION=so.i8;input=null;constructor(e,t){super(e,{...su,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=sl,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");let t=rp(e.currentTarget.files||[]);this.addFiles(t),e.currentTarget.value=""}handleClick(){this.input.click()}render(){let{restrictions:e}=this.uppy.opts;return eM("div",{className:"uppy-FileInput-container",children:[eM("input",{className:"uppy-FileInput-input",style:this.opts.pretty?{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1}:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),ref:e=>{this.input=e}}),this.opts.pretty&&eM("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick,children:this.i18n("chooseFiles")})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(10326),Object.prototype.hasOwnProperty,(0,r7.createContext)({uppy:void 0,status:"init",progress:0});let sh={i8:"4.3.1"},sd={fixed:!1,hideAfterFinish:!0};class sc extends eU{static VERSION=sh.i8;constructor(e,t){super(e,{...sd,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,i=(0===t||100===t)&&this.opts.hideAfterFinish;return eM("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i,children:[eM("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),eM("div",{className:"uppy-ProgressBar-percentage",children:t})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(94095),i(9911)}};
10
+ `,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,children:[this.renderHiddenFileInput(),eM("div",{className:"uppy-DragDrop-inner",children:[na.renderArrowSvg(),this.renderLabel(),this.renderNote()]})]})}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}let no={i8:"4.2.1"},nl={strings:{chooseFiles:"Choose files"}},nu={pretty:!0,inputName:"files[]"};class np extends eN{static VERSION=no.i8;input=null;constructor(e,t){super(e,{...nu,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=nl,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");let t=rp(e.currentTarget.files||[]);this.addFiles(t),e.currentTarget.value=""}handleClick(){this.input.click()}render(){let{restrictions:e}=this.uppy.opts;return eM("div",{className:"uppy-FileInput-container",children:[eM("input",{className:"uppy-FileInput-input",style:this.opts.pretty?{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1}:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),ref:e=>{this.input=e}}),this.opts.pretty&&eM("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick,children:this.i18n("chooseFiles")})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(10326),Object.prototype.hasOwnProperty,(0,r7.createContext)({uppy:void 0,status:"init",progress:0});let nd={i8:"4.3.1"},nh={fixed:!1,hideAfterFinish:!0};class nc extends eN{static VERSION=nd.i8;constructor(e,t){super(e,{...nh,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,i=(0===t||100===t)&&this.opts.hideAfterFinish;return eM("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i,children:[eM("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),eM("div",{className:"uppy-ProgressBar-percentage",children:t})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(94095),i(9911)}};