@abtnode/webapp 1.16.28 → 1.16.29-beta-e04c6f40

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 (205) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-B8Ae2MjM.js → Add-xExgHDod.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-BNt-WuI3.js → ArrowDropDown-KUzipi3t.js} +1 -1
  5. package/dist/assets/{Autocomplete-Bo6UH2XL.js → Autocomplete-Er311sva.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-CkmMkQDW.js → Breadcrumbs-Pqx4il3S.js} +1 -1
  7. package/dist/assets/{ButtonGroup-OcQcEz6r.js → ButtonGroup-BcupcRIM.js} +1 -1
  8. package/dist/assets/{CheckCircle-BnRenrK4.js → CheckCircle-zUiCwNZs.js} +1 -1
  9. package/dist/assets/{ChevronLeft-Dp9aa91c.js → ChevronLeft-Bet4yQzf.js} +1 -1
  10. package/dist/assets/{ChevronRight-C3NPaw6o.js → ChevronRight-DVus-Y96.js} +1 -1
  11. package/dist/assets/{Close-Cbaq-RRq.js → Close-O3YNtovt.js} +1 -1
  12. package/dist/assets/Delete-DOCRW1Ln.js +1 -0
  13. package/dist/assets/{DeleteOutline-B4LqoCK2.js → DeleteOutline-CUojn4xn.js} +1 -1
  14. package/dist/assets/{Done-BCLH1e-Y.js → Done-BbWcazKr.js} +1 -1
  15. package/dist/assets/{Edit-i_Bman7K.js → Edit-BhCFwv7o.js} +1 -1
  16. package/dist/assets/{EditIcon-DmNEjmIQ.js → EditIcon-CERx0ivQ.js} +1 -1
  17. package/dist/assets/{FilterList-fpG1-3KQ.js → FilterList-BRYDdfFq.js} +4 -4
  18. package/dist/assets/{Google-DLkd6TAZ.js → Google-CdmAvvA5.js} +3 -3
  19. package/dist/assets/{Https-amCzjB1a.js → Https-D3zQe1g3.js} +1 -1
  20. package/dist/assets/{InputAdornment-C6LFxcti.js → InputAdornment-CiVUPEjM.js} +1 -1
  21. package/dist/assets/{InputLabel-avYwCvJM.js → InputLabel-Cl0jKlH9.js} +1 -1
  22. package/dist/assets/{LastPage-DnBOlrut.js → LastPage-DIXa5YVo.js} +1 -1
  23. package/dist/assets/{Launch-DPclIZbd.js → Launch-u57ssxVt.js} +1 -1
  24. package/dist/assets/{Link-DfSEdivF.js → Link-8ntBDNt-.js} +1 -1
  25. package/dist/assets/{LoadingButton-xveWP_M5.js → LoadingButton-BhxaC5Ed.js} +1 -1
  26. package/dist/assets/{LockIcon-9c7sG23a.js → LockIcon-CkFf2isB.js} +1 -1
  27. package/dist/assets/{Loop-DwAWKPvc.js → Loop-BnL-Vxc4.js} +1 -1
  28. package/dist/assets/{MoreVert-Nc1QBj2D.js → MoreVert-LBoMA9yq.js} +1 -1
  29. package/dist/assets/{Pagination-D5t0OCBH.js → Pagination-B0vuu0Jz.js} +1 -1
  30. package/dist/assets/{Public-BLh26Bb9.js → Public-BPRyPUP1.js} +1 -1
  31. package/dist/assets/{SchemaReference.es--oFfd0mm.js → SchemaReference.es-Cw9PnK9u.js} +1 -1
  32. package/dist/assets/{Search-DnnCUnjB.js → Search-DoXY8XQp.js} +1 -1
  33. package/dist/assets/{Select-CBA-xyOJ.js → Select-CSRNZbOq.js} +2 -2
  34. package/dist/assets/{Skeleton-CQPjJHp3.js → Skeleton-CZxXS4jE.js} +5 -5
  35. package/dist/assets/{Slider-Bdpm9oO4.js → Slider-BcITXKtu.js} +1 -1
  36. package/dist/assets/{Stepper-UEQaZPW7.js → Stepper-mccJibcr.js} +1 -1
  37. package/dist/assets/TextField-HCXJkIb-.js +1 -0
  38. package/dist/assets/{ToggleButtonGroup-Drarswgi.js → ToggleButtonGroup-DNi-APKM.js} +1 -1
  39. package/dist/assets/{ViewList-CoYI2XgO.js → ViewList-B0D9uEjF.js} +1 -1
  40. package/dist/assets/{actions-BAUfPsQv.js → actions-CAskIzvr.js} +1 -1
  41. package/dist/assets/actions-Cs-U54uv.js +11 -0
  42. package/dist/assets/{agreement-_qYynElX.js → agreement-Dqwk0Qk1.js} +3 -3
  43. package/dist/assets/api-UGqvGbaE.js +1 -0
  44. package/dist/assets/app-avatar-DnQtdz_O.js +1 -0
  45. package/dist/assets/ar-DDqDOM6_.js +1 -0
  46. package/dist/assets/{audit-logs-BqT_1MLt.js → audit-logs-elaTyIYr.js} +1 -1
  47. package/dist/assets/{brace-fold.es-CkrKXotH.js → brace-fold.es-CHAwFrP-.js} +1 -1
  48. package/dist/assets/{bundle-avatar-RiFaz1Hb.js → bundle-avatar-DQKqTcLf.js} +1 -1
  49. package/dist/assets/{chart-Cinf5zq_.js → chart-B4WtoTol.js} +1 -1
  50. package/dist/assets/{click-to-copy-Bj13kdln.js → click-to-copy-BxTGXnkW.js} +1 -1
  51. package/dist/assets/{closebrackets.es-C32XuxI5.js → closebrackets.es-Cowrx9Wh.js} +1 -1
  52. package/dist/assets/{codemirror.es-oms3GpFv.js → codemirror.es-DDaWBk7v.js} +1 -1
  53. package/dist/assets/{comment.es-AVZXTIDr.js → comment.es-BpMZ3nSF.js} +1 -1
  54. package/dist/assets/config-navigation-mgsMFCq0.js +25 -0
  55. package/dist/assets/de-Df9PmQSL.js +1 -0
  56. package/dist/assets/delete-confirm-G3-jMPGR.js +1 -0
  57. package/dist/assets/{detail-CHKmnQLc.js → detail-BBKDt7TH.js} +3 -3
  58. package/dist/assets/{dialog.es-DHZdXjGS.js → dialog.es-CRh6VOLz.js} +1 -1
  59. package/dist/assets/{download-DFPnF7mz.js → download-BK5ocL5s.js} +1 -1
  60. package/dist/assets/es-BQD9zWi-.js +1 -0
  61. package/dist/assets/{foldgutter.es-CSicbQSJ.js → foldgutter.es-CHLe3IFg.js} +1 -1
  62. package/dist/assets/fr-DNx2OQyQ.js +1 -0
  63. package/dist/assets/getValidReactChildren-C2KGwF2r.js +1 -0
  64. package/dist/assets/hi-BmEkoTIE.js +1 -0
  65. package/dist/assets/{hint.es-DAEQ9N76.js → hint.es-qHNwvQXY.js} +1 -1
  66. package/dist/assets/{hint.es2-DYXluLKu.js → hint.es2-DRHlNN6z.js} +1 -1
  67. package/dist/assets/id-DXu5sStK.js +1 -0
  68. package/dist/assets/{iframe-DwuYX0Xq.js → iframe-D-PNyLg3.js} +1 -1
  69. package/dist/assets/{index-B60jROHj.js → index-3ruoHhFa.js} +26 -26
  70. package/dist/assets/{index-zFXZLqso.js → index-3sl31tmo.js} +2 -2
  71. package/dist/assets/{index-CZKHzmkC.js → index-B1h0P1L0.js} +1 -1
  72. package/dist/assets/index-B1yKtvhn.js +54 -0
  73. package/dist/assets/{index-BbS1Wq4p.js → index-B6HWus5t.js} +1 -1
  74. package/dist/assets/{index-baq8DMtQ.js → index-BhwGm9ir.js} +9 -9
  75. package/dist/assets/{index-DKkTRBZn.js → index-BlSaylBC.js} +4 -4
  76. package/dist/assets/{index-DOsg2sHH.js → index-Boc7heJK.js} +1 -1
  77. package/dist/assets/{index-cmiUur_8.js → index-Boe-4fof.js} +1 -1
  78. package/dist/assets/{index-CiZAReVP.js → index-Br7MMAwb.js} +1 -1
  79. package/dist/assets/{index-ZQu91rXz.js → index-Bt8_a71i.js} +1 -1
  80. package/dist/assets/{index-BVznp3M0.js → index-C4esebAE.js} +1 -1
  81. package/dist/assets/{index-BbW2IRRR.js → index-C5c3sxc7.js} +3 -3
  82. package/dist/assets/{index-0RUAEm49.js → index-C7piHvhS.js} +2 -2
  83. package/dist/assets/{index-BKi0XLcv.js → index-C8OOX63T.js} +1 -1
  84. package/dist/assets/{index-DfNh08gP.js → index-CAP7ccf-.js} +3 -3
  85. package/dist/assets/{index-Cl2QG8J6.js → index-CCMFLAjE.js} +16 -16
  86. package/dist/assets/{index-CKOyruf_.js → index-CGedY69r.js} +2 -2
  87. package/dist/assets/{index-ByF3apMm.js → index-CI3-G8f5.js} +3 -3
  88. package/dist/assets/{index-9R6mPPbN.js → index-CMw6A55r.js} +1 -1
  89. package/dist/assets/index-COVe-oac.js +1 -0
  90. package/dist/assets/{index-D5MDxbqt.js → index-CTWxKp8R.js} +1 -1
  91. package/dist/assets/{index-DHYJxTcV.js → index-CU4Kco8M.js} +57 -57
  92. package/dist/assets/{index-DrWhB0MJ.js → index-CfjU2vkP.js} +1 -1
  93. package/dist/assets/{index-BBnT5XB9.js → index-Cjw9QiwF.js} +1 -1
  94. package/dist/assets/{index-CyYUysSv.js → index-CpWB9aT7.js} +1 -1
  95. package/dist/assets/{index-CIbzY-F7.js → index-CsGASsXO.js} +1 -1
  96. package/dist/assets/{index-v2cqn0eS.js → index-CuZgQfxG.js} +1 -1
  97. package/dist/assets/{index-BnFWpIPQ.js → index-Cx08Fq4-.js} +1 -1
  98. package/dist/assets/{index-CHjwpGia.js → index-D0mxQWU5.js} +7 -7
  99. package/dist/assets/{index-DSByvARI.js → index-DHWCojAQ.js} +1 -1
  100. package/dist/assets/{index-DcU_Cijj.js → index-DIJ53y8c.js} +1 -1
  101. package/dist/assets/index-DIbFXQTV.js +1 -0
  102. package/dist/assets/{index-7J6TijHC.js → index-Dkkm6kzm.js} +1 -1
  103. package/dist/assets/{index-rPqHtLu4.js → index-Dw9clXjq.js} +1 -1
  104. package/dist/assets/{index-CucnV9EX.js → index-DzW0Cxov.js} +25 -25
  105. package/dist/assets/index-LlxzMpy3.js +231 -0
  106. package/dist/assets/{index-DV2quTIn.js → index-M5WcRzZV.js} +1 -1
  107. package/dist/assets/index-P1GJ1Y4T.js +177 -0
  108. package/dist/assets/{index-CqcpZ8C3.js → index-Pf5VRxU2.js} +174 -210
  109. package/dist/assets/{index-CtzAe2AR.js → index-RQQsaMDK.js} +1 -1
  110. package/dist/assets/{index-DPx9NPlp.js → index-_RvLZsys.js} +1 -1
  111. package/dist/assets/index-hFhjFjqL.js +58 -0
  112. package/dist/assets/{index-ECk6dODK.js → index-y8_7sFXl.js} +10 -10
  113. package/dist/assets/{index.es-Dkh9ejMp.js → index.es-0GspS0hl.js} +1 -1
  114. package/dist/assets/{index.esm-Hqw0Nfnx.js → index.esm-CJT_Vb_Y.js} +1 -1
  115. package/dist/assets/{info-addon.es-5NmROke-.js → info-addon.es-BvWPiOWh.js} +1 -1
  116. package/dist/assets/{info.es-CsELEfUv.js → info.es-D6grONEz.js} +1 -1
  117. package/dist/assets/{install-from-url-DXGlT7R8.js → install-from-url-CLk48T0_.js} +1 -1
  118. package/dist/assets/invitation-4W3IOdXy.js +200 -0
  119. package/dist/assets/{is-path-prefix-equal-CoJozASB.js → is-path-prefix-equal-DQciVrFn.js} +1 -1
  120. package/dist/assets/{isEqual-BLnnfE4T.js → isEqual-C5Iu_kl-.js} +1 -1
  121. package/dist/assets/{item-tD3jAfba.js → item-C9bzNYRu.js} +31 -31
  122. package/dist/assets/ja-thyFR9rH.js +1 -0
  123. package/dist/assets/{javascript.es-BIUhEWTj.js → javascript.es-CWlPpygW.js} +1 -1
  124. package/dist/assets/{jump-to-line.es-BQjWkUgo.js → jump-to-line.es-D7dd2At6.js} +1 -1
  125. package/dist/assets/{jump.es-D8ZxFsmc.js → jump.es-WtAW-Ijf.js} +1 -1
  126. package/dist/assets/ko-BJSWgMML.js +1 -0
  127. package/dist/assets/{line-DW0juCGB.js → line-Cfyg0g9I.js} +4 -4
  128. package/dist/assets/{lint.es-Dv2pWRyz.js → lint.es-aUUps1ME.js} +1 -1
  129. package/dist/assets/{lint.es2-CqGQ_rnk.js → lint.es2-CDvv_d9A.js} +1 -1
  130. package/dist/assets/{lint.es3-g58ofVJA.js → lint.es3-DTrQmP6j.js} +1 -1
  131. package/dist/assets/{list-header-tjKXNgOR.js → list-header-BG2QMZZz.js} +1 -1
  132. package/dist/assets/{log-BFiA_Tyh.js → log-DIJPVIRP.js} +1 -1
  133. package/dist/assets/{lottie-yeTV0Y2m.js → lottie-BkwIvhEu.js} +1 -1
  134. package/dist/assets/{matchbrackets.es-B-Xj5H9Q.js → matchbrackets.es-CCjeMHPP.js} +1 -1
  135. package/dist/assets/{memory-C7a59RsU.js → memory-CYabGN8q.js} +1 -1
  136. package/dist/assets/{mode.es-BSNxo6gK.js → mode.es-kZQjUXx0.js} +1 -1
  137. package/dist/assets/{mode.es2-C1LDwVOl.js → mode.es2-hCaXf0ad.js} +1 -1
  138. package/dist/assets/{mode.es3-C6-ZTyOk.js → mode.es3-DlVh9_RV.js} +1 -1
  139. package/dist/assets/{onlineParser.es-BzK7GlZv.js → onlineParser.es-g03lcwfp.js} +1 -1
  140. package/dist/assets/overview-BFHUS9cz.js +23 -0
  141. package/dist/assets/{pt-fvVMjgC8.js → pt-D828CXoS.js} +1 -1
  142. package/dist/assets/{react-1fE0Sobf.js → react-DjQtZm70.js} +7 -7
  143. package/dist/assets/{redux-hfExDDyr.js → redux-0yltQfyb.js} +1 -1
  144. package/dist/assets/{resource-dialog-DinbvH2C.js → resource-dialog-B2vu5Of2.js} +2 -2
  145. package/dist/assets/ru-t_aX-wsm.js +1 -0
  146. package/dist/assets/{runtime-tAjj0dmb.js → runtime-C9hFU3Ij.js} +1 -1
  147. package/dist/assets/{search.es-DxfjuUNu.js → search.es-C20qP8Vq.js} +1 -1
  148. package/dist/assets/{searchcursor.es-C0Z2DY1c.js → searchcursor.es-Cy-3eaEN.js} +1 -1
  149. package/dist/assets/service-CkoGqY1V.js +1 -0
  150. package/dist/assets/{show-hint.es-q24U0q_A.js → show-hint.es-DAqKK5Qn.js} +1 -1
  151. package/dist/assets/{slicedToArray-CYGiqzmA.js → slicedToArray-Bl_ysqUF.js} +3 -3
  152. package/dist/assets/{spaces-C58gy1rM.js → spaces-CE3KwDvq.js} +1 -1
  153. package/dist/assets/{sublime.es-BffqyCoy.js → sublime.es-DPcVE8hJ.js} +1 -1
  154. package/dist/assets/{switch-control-CuPWIx6T.js → switch-control-CCSLs9W3.js} +1 -1
  155. package/dist/assets/{table-icons-DOOoyljy.js → table-icons-B9NLkXar.js} +10 -10
  156. package/dist/assets/{tag-Cxx1sXPF.js → tag-_nponNF2.js} +1 -1
  157. package/dist/assets/{team-BynFP1rM.js → team-wy2ENAAe.js} +1 -1
  158. package/dist/assets/th-DvaD_9E5.js +1 -0
  159. package/dist/assets/toUpper-D-lxmi1w.js +1 -0
  160. package/dist/assets/{traffic-D03HdfGL.js → traffic-BU3E2tw9.js} +5 -5
  161. package/dist/assets/{url-evaluation-dheoi_Nj.js → url-evaluation-CAG0Y4FK.js} +4 -4
  162. package/dist/assets/{url-join-DMIMYkEk.js → url-join-DMJmszyo.js} +1 -1
  163. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-DWywlTbc.js → use-blocklet-info-for-connect-did-spaces-Bc-o6Zkq.js} +1 -1
  164. package/dist/assets/{useLocalStorage-C3GQNaV2.js → useLocalStorage-D4xQyg06.js} +1 -1
  165. package/dist/assets/{util-cf4pvQDW.js → util-CuvemqGW.js} +1 -1
  166. package/dist/assets/vi-B4VdHKzm.js +1 -0
  167. package/dist/assets/{wait-container-BwlRhWl0.js → wait-container-CdR6E8LE.js} +4 -4
  168. package/dist/assets/{withStyles-BkcRLEgx.js → withStyles-Ct7uoTy7.js} +1 -1
  169. package/dist/assets/wrap-locale-C2k9YLGh.js +1 -0
  170. package/dist/assets/zh-D0ck6JaG.js +2 -0
  171. package/dist/assets/zh-tw-C19pg5Jo.js +1 -0
  172. package/dist/index.html +1 -1
  173. package/dist/service-worker.js +1 -1
  174. package/package.json +1 -1
  175. package/dist/assets/Delete-CnrKsAGC.js +0 -1
  176. package/dist/assets/TextField-DjRhIjo4.js +0 -1
  177. package/dist/assets/actions-C1t0ka-G.js +0 -11
  178. package/dist/assets/api-xvCGCwMn.js +0 -1
  179. package/dist/assets/app-avatar-DcgC0kB0.js +0 -1
  180. package/dist/assets/ar-B5gcsN0k.js +0 -1
  181. package/dist/assets/config-navigation-LFUjTzgk.js +0 -25
  182. package/dist/assets/de-WUCASh9G.js +0 -1
  183. package/dist/assets/delete-confirm-BoeDYrYX.js +0 -1
  184. package/dist/assets/es-DsRorAcf.js +0 -1
  185. package/dist/assets/fr-CUMFVKph.js +0 -1
  186. package/dist/assets/getValidReactChildren-GMOIXwRG.js +0 -1
  187. package/dist/assets/hi-BinC6-tx.js +0 -1
  188. package/dist/assets/id-BVFhYsL8.js +0 -1
  189. package/dist/assets/index-BKck0oIO.js +0 -234
  190. package/dist/assets/index-DU7hJgoO.js +0 -1
  191. package/dist/assets/index-DmPgcoiv.js +0 -150
  192. package/dist/assets/index-DsUZ7uiP.js +0 -58
  193. package/dist/assets/index-HOVCi07-.js +0 -54
  194. package/dist/assets/invitation-CSNEw5oM.js +0 -200
  195. package/dist/assets/ja-B1xj2XMp.js +0 -1
  196. package/dist/assets/ko-Buo9FEc0.js +0 -1
  197. package/dist/assets/overview-BlWFlRx2.js +0 -23
  198. package/dist/assets/ru-OQD02sOm.js +0 -1
  199. package/dist/assets/service-1GhnQw9a.js +0 -1
  200. package/dist/assets/th-DaDxf6qI.js +0 -1
  201. package/dist/assets/toUpper-mYvRPeiI.js +0 -1
  202. package/dist/assets/vi-D2hO2mdU.js +0 -1
  203. package/dist/assets/wrap-locale-BqGpRCMA.js +0 -1
  204. package/dist/assets/zh-OQY8LvIH.js +0 -2
  205. package/dist/assets/zh-tw-Dd8o0udA.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__fileDeps=["./index-DKkTRBZn.js","./index-CqcpZ8C3.js","./index-D7K8de1w.css","./TextField-DjRhIjo4.js","./Select-CBA-xyOJ.js","./InputLabel-avYwCvJM.js","./url-evaluation-dheoi_Nj.js","./Delete-CnrKsAGC.js","./tag-Cxx1sXPF.js","./Slider-Bdpm9oO4.js","./Skeleton-CQPjJHp3.js","./Close-Cbaq-RRq.js","./index-DU7hJgoO.js","./preact.module-B1z5cdvs.js","./index-rPqHtLu4.js","./index-v2cqn0eS.js","./memoize-one.esm-BdPwpGay.js","./index-ECk6dODK.js","./resource-dialog-DinbvH2C.js","./index-DSByvARI.js","./index-CIbzY-F7.js","./index-CtzAe2AR.js","./index-DcU_Cijj.js","./index-CZKHzmkC.js","./FilterList-fpG1-3KQ.js","./LastPage-DnBOlrut.js","./index-baq8DMtQ.js","./redux-hfExDDyr.js","./Search-DnnCUnjB.js","./MoreVert-Nc1QBj2D.js","./url-join-DMIMYkEk.js","./toUpper-mYvRPeiI.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- var su=Object.defineProperty;var ou=(i,e,t)=>e in i?su(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ke=(i,e,t)=>(ou(i,typeof e!="symbol"?e+"":e,t),t);import{bL as ru,j as Me,hE as lu,dq as cu,f7 as pu,g as tt,hF as uu,hG as Rl,hH as du,hI as hu,cN as Il,di as mn,dz as Ct,hJ as Zn,P as D,r as ee,cP as Eo,c7 as To,av as mu,hK as fu,bo as Ml,co as gu,H as vu,hL as Oo,h6 as bu,dH as yu,O as Nl,a2 as xu,hM as wu,fd as Su,dn as Pu}from"./index-CqcpZ8C3.js";import{p as Fu,u as Cu}from"./index-DU7hJgoO.js";import{N as Do,y as u,b as ft,l as es,g as Ft,$ as vt,_ as _u,B as Bl}from"./preact.module-B1z5cdvs.js";import{a as ku}from"./index-rPqHtLu4.js";import{c as Se}from"./index-v2cqn0eS.js";import{m as Ao}from"./memoize-one.esm-BdPwpGay.js";import"./index-ECk6dODK.js";import{W as Eu}from"./resource-dialog-DinbvH2C.js";import"./index-CIbzY-F7.js";import"./index-CtzAe2AR.js";import"./index-DcU_Cijj.js";import"./index-CZKHzmkC.js";import{j as $s}from"./url-join-DMIMYkEk.js";import{u as jl,t as Tu}from"./toUpper-mYvRPeiI.js";const Ou=ru(Me.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Du(i,e,t,a){for(var n=-1,s=i==null?0:i.length;++n<s;){var o=i[n];e(a,o,t(o),i)}return a}var Au=Du,Uu=lu;function Ru(i,e,t,a){return Uu(i,function(n,s,o){e(a,n,t(n),o)}),a}var Iu=Ru,Mu=Au,Nu=Iu,Bu=cu,ju=pu;function Lu(i,e){return function(t,a){var n=ju(t)?Mu:Nu,s=e?e():{};return n(t,i,Bu(a),s)}}var zu=Lu,$u=uu,qu=zu,Hu=qu(function(i,e,t){$u(i,t,e)}),Vu=Hu;const Ll=tt(Vu);function ba(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Wu=0;function zl(i){return"__private_"+Wu+++"_"+i}function Gu(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
1
+ const __vite__fileDeps=["./index-BlSaylBC.js","./index-Pf5VRxU2.js","./index-D7K8de1w.css","./TextField-HCXJkIb-.js","./Select-CSRNZbOq.js","./InputLabel-Cl0jKlH9.js","./url-evaluation-CAG0Y4FK.js","./Delete-DOCRW1Ln.js","./tag-_nponNF2.js","./Slider-BcITXKtu.js","./Skeleton-CZxXS4jE.js","./Close-O3YNtovt.js","./index-COVe-oac.js","./preact.module-B1z5cdvs.js","./index-Dw9clXjq.js","./index-CuZgQfxG.js","./memoize-one.esm-BdPwpGay.js","./index-y8_7sFXl.js","./resource-dialog-B2vu5Of2.js","./index-DHWCojAQ.js","./index-CsGASsXO.js","./index-RQQsaMDK.js","./index-DIJ53y8c.js","./index-B1h0P1L0.js","./FilterList-BRYDdfFq.js","./LastPage-DIXa5YVo.js","./index-BhwGm9ir.js","./redux-0yltQfyb.js","./Search-DoXY8XQp.js","./MoreVert-LBoMA9yq.js","./index-DIbFXQTV.js","./url-join-DMJmszyo.js","./toUpper-D-lxmi1w.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ var su=Object.defineProperty;var ou=(i,e,t)=>e in i?su(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var ke=(i,e,t)=>(ou(i,typeof e!="symbol"?e+"":e,t),t);import{bK as ru,j as Me,hD as lu,dv as cu,f9 as pu,g as tt,hE as uu,hF as Rl,hG as du,hH as hu,cU as Il,cu as mn,cw as Ct,hI as Zn,P as D,r as ee,cz as Eo,c6 as To,av as mu,hJ as fu,bn as Ml,cn as gu,H as vu,hK as Oo,h5 as bu,dJ as yu,O as Nl,a2 as xu,hL as wu,fe as Su,dt as Pu}from"./index-Pf5VRxU2.js";import{u as Fu}from"./index-COVe-oac.js";import{N as Do,y as u,b as ft,l as es,g as Ft,$ as vt,_ as Cu,B as Bl}from"./preact.module-B1z5cdvs.js";import{a as _u}from"./index-Dw9clXjq.js";import{c as Se}from"./index-CuZgQfxG.js";import{m as Ao}from"./memoize-one.esm-BdPwpGay.js";import"./index-y8_7sFXl.js";import{W as ku}from"./resource-dialog-B2vu5Of2.js";import"./index-CsGASsXO.js";import"./index-RQQsaMDK.js";import"./index-DIJ53y8c.js";import"./index-B1h0P1L0.js";import{p as Eu}from"./index-DIbFXQTV.js";import{j as $s}from"./url-join-DMJmszyo.js";import{u as jl,t as Tu}from"./toUpper-D-lxmi1w.js";const Ou=ru(Me.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Du(i,e,t,a){for(var n=-1,s=i==null?0:i.length;++n<s;){var o=i[n];e(a,o,t(o),i)}return a}var Au=Du,Uu=lu;function Ru(i,e,t,a){return Uu(i,function(n,s,o){e(a,n,t(n),o)}),a}var Iu=Ru,Mu=Au,Nu=Iu,Bu=cu,ju=pu;function Lu(i,e){return function(t,a){var n=ju(t)?Mu:Nu,s=e?e():{};return n(t,i,Bu(a),s)}}var zu=Lu,$u=uu,qu=zu,Hu=qu(function(i,e,t){$u(i,t,e)}),Vu=Hu;const Ll=tt(Vu);function ba(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Wu=0;function zl(i){return"__private_"+Wu+++"_"+i}function Gu(i,e,t){const a=[];return i.forEach(n=>typeof n!="string"?a.push(n):e[Symbol.split](n).forEach((s,o,r)=>{s!==""&&a.push(s),o<r.length-1&&a.push(t)})),a}/**
3
3
  * Takes a string with placeholder variables like `%{smart_count} file selected`
4
4
  * and replaces it with values from options `{smart_count: 5}`
5
5
  *
@@ -13,9 +13,9 @@ var su=Object.defineProperty;var ou=(i,e,t)=>e in i?su(i,e,{enumerable:!0,config
13
13
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:r},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,r);{const l=new Error(r);throw l.errors=o,l}}this.setState({files:t}),a.forEach(r=>{this.emit("file-added",r)}),this.emit("files-added",a),a.length>5?this.log(`Added batch of ${a.length} files`):Object.values(a).forEach(r=>{this.log(`Added file: ${r.name}
14
14
  id: ${r.id}
15
15
  type: ${r.type}`)}),a.length>0&&U(this,vi)[vi]()}removeFiles(e,t){const{files:a,currentUploads:n}=this.getState(),s={...a},o={...n},r=Object.create(null);e.forEach(p=>{a[p]&&(r[p]=a[p],delete s[p])});function l(p){return r[p]===void 0}Object.keys(o).forEach(p=>{const h=n[p].fileIDs.filter(l);if(h.length===0){delete o[p];return}const{capabilities:b}=this.getState();if(h.length!==n[p].fileIDs.length&&!b.individualCancellation)throw new Error("individualCancellation is disabled");o[p]={...n[p],fileIDs:h}});const c={currentUploads:o,files:s};Object.keys(s).length===0&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this.calculateTotalProgress();const d=Object.keys(r);d.forEach(p=>{this.emit("file-removed",r[p],t)}),d.length>5?this.log(`Removed ${d.length} files`):this.log(`Removed files: ${d.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const a=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:a}),this.emit("upload-pause",e,a),a}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(a=>!e[a].progress.uploadComplete&&e[a].progress.uploadStarted).forEach(a=>{const n={...e[a],isPaused:!0};e[a]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(a=>!e[a].progress.uploadComplete&&e[a].progress.uploadStarted).forEach(a=>{const n={...e[a],isPaused:!1,error:null};e[a]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(n=>e[n].error);if(t.forEach(n=>{const s={...e[n],isPaused:!1,error:null};e[n]=s}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});const a=U(this,at)[at](t,{forceAllowNewUpload:!0});return U(this,nt)[nt](a)}cancelAll(e){let{reason:t="user"}=e===void 0?{}:e;if(this.emit("cancel-all",{reason:t}),t==="user"){const{files:a}=this.getState(),n=Object.keys(a);n.length&&this.removeFiles(n,"cancel-all"),this.setState(ya)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=U(this,at)[at]([e],{forceAllowNewUpload:!0});return U(this,nt)[nt](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}calculateTotalProgress(){const t=this.getFiles().filter(c=>c.progress.uploadStarted||c.progress.preprocess||c.progress.postprocess);if(t.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}const a=t.filter(c=>c.progress.bytesTotal!=null),n=t.filter(c=>c.progress.bytesTotal==null);if(a.length===0){const c=t.length*100,d=n.reduce((h,b)=>h+b.progress.percentage,0),p=Math.round(d/c*100);this.setState({totalProgress:p});return}let s=a.reduce((c,d)=>{var p;return c+((p=d.progress.bytesTotal)!=null?p:0)},0);const o=s/a.length;s+=o*n.length;let r=0;a.forEach(c=>{r+=c.progress.bytesUploaded}),n.forEach(c=>{r+=o*(c.progress.percentage||0)/100});let l=s===0?0:Math.round(r/s*100);l>100&&(l=100),this.setState({totalProgress:l}),this.emit("progress",l)}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!="function"){const o=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(o)}const a=new e(this,t),n=a.id;if(!n)throw new Error("Your plugin must have an id");if(!a.type)throw new Error("Your plugin must have a type");const s=this.getPlugin(n);if(s){const o=`Already found a plugin named '${s.id}'. Tried to use: '${n}'.
16
- Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),a.type in U(this,me)[me]?U(this,me)[me][a.type].push(a):U(this,me)[me][a.type]=[a],a.install(),this.emit("plugin-added",a),this}getPlugin(e){for(const t of Object.values(U(this,me)[me])){const a=t.find(n=>n.id===e);if(a!=null)return a}}[Gl](e){return U(this,me)[me][e]}iteratePlugins(e){Object.values(U(this,me)[me]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=U(this,me)[me][e.type],a=t.findIndex(o=>o.id===e.id);a!==-1&&t.splice(a,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),U(this,fi)[fi](),this.iteratePlugins(a=>{this.removePlugin(a)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",U(this,Ve)[Ve]),window.removeEventListener("offline",U(this,Ve)[Ve]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,a){t===void 0&&(t="info"),a===void 0&&(a=3e3);const n=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:n?e.message:e,details:n?e.details:null}]}),setTimeout(()=>this.hideInfo(),a),this.emit("info-visible")}log(e,t){const{logger:a}=this.opts;switch(t){case"error":a.error(e);break;case"warning":a.warn(e);break;default:a.debug(e);break}}registerRequestClient(e,t){U(this,yi)[yi].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=U(this,yi)[yi].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?U(this,nt)[nt](e):(U(this,Lt)[Lt](e),Promise.reject(new Error("Nonexistent upload")))}[Kl](){return U(this,at)[at](...arguments)}addResultData(e,t){if(!U(this,yn)[yn](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:a}=this.getState(),n={...a[e],result:{...a[e].result,...t}};this.setState({currentUploads:{...a,[e]:n}})}upload(){var e;(e=U(this,me)[me].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const a=this.opts.onBeforeUpload(t);return a===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(a&&typeof a=="object"&&(t=a,this.setState({files:t})),Promise.resolve().then(()=>U(this,Ue)[Ue].validateMinNumberOfFiles(t)).catch(n=>{throw U(this,Re)[Re]([n]),n}).then(()=>{if(!U(this,vn)[vn](t))throw new $e(this.i18n("missingRequiredMetaField"))}).catch(n=>{throw n}).then(()=>{const{currentUploads:n}=this.getState(),s=Object.values(n).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{const c=this.getFile(l);!c.progress.uploadStarted&&s.indexOf(l)===-1&&o.push(c.id)});const r=U(this,at)[at](o);return U(this,nt)[nt](r)}).catch(n=>{throw this.emit("error",n),this.log(n,"error"),n}))}};function xd(i){for(const s of i)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const e=i.filter(s=>s.isUserFacing),t=4,a=e.slice(0,t),n=e.slice(t);a.forEach(s=>{let{message:o,details:r=""}=s;this.info({message:o,details:r},"error",this.opts.infoTimeout)}),n.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:n.length})})}function wd(i){const{missingFields:e,error:t}=U(this,Ue)[Ue].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Sd(i){let e=!0;for(const t of Object.values(i))U(this,Ji)[Ji](t)||(e=!1);return e}function Pd(i){const{allowNewUpload:e}=this.getState();if(e===!1){const t=new $e(this.i18n("noMoreFilesAllowed"),{file:i});throw U(this,Re)[Re]([t]),t}}function Fd(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Hs(e),a=od(t,e),n=qs(a).extension,s=Vl(e,this.getID()),o=e.meta||{};o.name=a,o.type=t;const r=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:s,name:a,extension:n||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:r,uploadComplete:!1,uploadStarted:null},size:r,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}function Cd(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function _d(i){const{files:e}=this.getState(),t={...e},a=[],n=[];for(const o of i)try{var s;let r=U(this,is)[is](o);const l=(s=e[r.id])==null?void 0:s.isGhost;l&&(r={...e[r.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`));const c=this.opts.onBeforeFileAdded(r,t);if(!c&&this.checkIfFileAlreadyExists(r.id))throw new $e(this.i18n("noDuplicates",{fileName:r.name}),{file:o});if(c===!1&&!l)throw new $e("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof c=="object"&&c!==null&&(r=c),U(this,Ue)[Ue].validateSingleFile(r),t[r.id]=r,a.push(r)}catch(r){n.push(r)}try{U(this,Ue)[Ue].validateAggregateRestrictions(Object.values(e),a)}catch(o){return n.push(o),{nextFilesState:e,validFilesToAdd:[],errors:n}}return{nextFilesState:t,validFilesToAdd:a,errors:n}}function kd(){const i=(a,n,s)=>{let o=a.message||"Unknown error";a.details&&(o+=` ${a.details}`),this.setState({error:o}),n!=null&&n.id in this.getState().files&&this.setFileState(n.id,{error:o,response:s})};this.on("error",i),this.on("upload-error",(a,n,s)=>{if(i(n,a,s),typeof n=="object"&&n.message){var o;this.log(n.message,"error");const r=new Error(this.i18n("failedToUpload",{file:(o=a==null?void 0:a.name)!=null?o:""}));r.isUserFacing=!0,r.details=n.message,n.details&&(r.details+=` ${n.details}`),U(this,Re)[Re]([r])}else U(this,Re)[Re]([n])});let e=null;this.on("upload-stalled",(a,n)=>{const{message:s}=a,o=n.map(r=>r.meta.name).join(", ");e||(this.info({message:s,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${s} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const t=a=>{const n=a.filter(o=>{const r=o!=null&&this.getFile(o.id);return r||this.log(`Not setting progress for a file that has been removed: ${o==null?void 0:o.id}`),r}),s=Object.fromEntries(n.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(s)};this.on("upload-start",a=>{a.forEach(n=>{this.emit("upload-started",n)}),t(a)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const s=this.getFile(a.id).progress;this.setFileState(a.id,{progress:{...s,postprocess:U(this,ht)[ht].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:s.bytesTotal},response:n,uploadURL:n.uploadURL,isPaused:!1}),a.size==null&&this.setFileState(a.id,{size:n.bytesUploaded||s.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}this.setFileState(a.id,{progress:{...this.getFile(a.id).progress,preprocess:n}})}),this.on("preprocess-complete",a=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const n={...this.getState().files};n[a.id]={...n[a.id],progress:{...n[a.id].progress}},delete n[a.id].progress.preprocess,this.setState({files:n})}),this.on("postprocess-progress",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}this.setFileState(a.id,{progress:{...this.getState().files[a.id].progress,postprocess:n}})}),this.on("postprocess-complete",a=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const n={...this.getState().files};n[a.id]={...n[a.id],progress:{...n[a.id].progress}},delete n[a.id].progress.postprocess,this.setState({files:n})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",a=>{a&&U(this,Ji)[Ji](a)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",U(this,Ve)[Ve]),window.addEventListener("offline",U(this,Ve)[Ve]),setTimeout(U(this,Ve)[Ve],3e3))}function Ed(i,e){e===void 0&&(e={});const{forceAllowNewUpload:t=!1}=e,{allowNewUpload:a,currentUploads:n}=this.getState();if(!a&&!t)throw new Error("Cannot create a new upload: already uploading.");const s=da();return this.emit("upload",{id:s,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...n,[s]:{fileIDs:i,step:0,result:{}}}}),s}function Td(i){const{currentUploads:e}=this.getState();return e[i]}function Od(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function Dd(i){const e=()=>{const{currentUploads:s}=this.getState();return s[i]};let t=e();const a=[...U(this,Nt)[Nt],...U(this,Bt)[Bt],...U(this,ht)[ht]];try{for(let s=t.step||0;s<a.length&&t;s++){const o=a[s];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:s}}});const{fileIDs:r}=t;await o(r,i),t=e()}}catch(s){throw U(this,Lt)[Lt](i),s}if(t){t.fileIDs.forEach(l=>{const c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});const s=t.fileIDs.map(l=>this.getFile(l)),o=s.filter(l=>!l.error),r=s.filter(l=>l.error);this.addResultData(i,{successful:o,failed:r,uploadID:i}),t=e()}let n;return t&&(n=t.result,this.emit("complete",n),U(this,Lt)[Lt](i)),n==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),n}Xl.VERSION=yd.version;const Ql=Xl;function Jl(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Ad(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Jl(i)?i:null}function Zl(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class Vs{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new $l([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function Io(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Ud=0;function Rd(i){return"__private_"+Ud+++"_"+i}function Id(i){let e=null,t;return function(){for(var a=arguments.length,n=new Array(a),s=0;s<a;s++)n[s]=arguments[s];return t=n,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var xi=Rd("updateUI");class he extends Vs{constructor(){super(...arguments),Object.defineProperty(this,xi,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof(e==null?void 0:e.addTarget)=="function")t=e,t instanceof he||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:he}}));else if(typeof e=="function"){const a=e;this.uppy.iteratePlugins(n=>{n instanceof a&&(t=n)})}return t}mount(e,t){const a=t.id,n=Ad(e);if(n){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),Io(this,xi)[xi]=Id(l=>{this.uppy.getPlugin(this.id)&&(Do(this.render(l),r),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),Do(this.render(this.uppy.getState()),r),this.el=r,n.appendChild(r),r.dir=this.opts.direction||Zl(r)||"ltr",this.onMount(),this.el}const s=this.getTargetPlugin(e);if(s)return this.uppy.log(`Installing ${a} to ${s.id}`),this.parent=s,this.el=s.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let o=`Invalid target option given to ${a}.`;throw typeof e=="function"?o+=" 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.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,a;(t=(a=Io(this,xi))[xi])==null||t.call(a,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}const Md={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function xn(i){return[i]=i.split(";",1),Md[i]||null}var on={exports:{}};on.exports=Ws;on.exports.isMobile=Ws;on.exports.default=Ws;const Nd=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,Bd=/CrOS/,jd=/android|ipad|playbook|silk/i;function Ws(i){i||(i={});let e=i.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=Nd.test(e)&&!Bd.test(e)||!!i.tablet&&jd.test(e);return!t&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}var Ld=on.exports;const zd=tt(Ld);function $d(i,e,t){return new Promise(a=>{i.toBlob(a,e,t)})}function qd(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function ec(){return u("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},u("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}function Hd(i){let{onSnapshot:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0},ec())}function Vd(i){let{recording:e,onStartRecording:t,onStopRecording:a,i18n:n}=i;return e?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("stopRecording"),"aria-label":n("stopRecording"),onClick:a,"data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},u("rect",{x:"15",y:"15",width:"70",height:"70"}))):u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("startRecording"),"aria-label":n("startRecording"),onClick:t,"data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},u("circle",{cx:"50",cy:"50",r:"40"})))}function Wd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}function Gd(i){let{recordingLengthSeconds:e,i18n:t}=i;const a=Wd(e);return u("span",{"aria-label":t("recordingLength",{recording_length:a})},a)}function Kd(i){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:a}=i;return u("div",{className:"uppy-Webcam-videoSource"},u("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:n=>{a(n.target.value)}},t.map(n=>u("option",{key:n.deviceId,value:n.deviceId,selected:n.deviceId===e},n.label))))}function Xd(i){let{onSubmit:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},u("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},u("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}function Yd(i){let{onDiscard:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},u("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},u("g",{fill:"#FFF",fillRule:"evenodd"},u("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),u("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}function as(){return as=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},as.apply(this,arguments)}function xa(i,e){return i.includes(e)}class Qd extends ft{componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,recording:a,modes:n,supportsRecording:s,videoSources:o,showVideoSourceDropdown:r,showRecordingLength:l,onSubmit:c,i18n:d,mirror:p,onSnapshot:h,onStartRecording:b,onStopRecording:m,onDiscardRecordedVideo:P,recordingLengthSeconds:g}=this.props,y=!!t,F=!y&&s&&(xa(n,"video-only")||xa(n,"audio-only")||xa(n,"video-audio")),C=!y&&xa(n,"picture"),O=s&&l&&!y,A=r&&o&&o.length>1,v={playsInline:!0};return t?(v.muted=!1,v.controls=!0,v.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(v.muted=!0,v.autoPlay=!0,v.srcObject=e),u("div",{className:"uppy uppy-Webcam-container"},u("div",{className:"uppy-Webcam-videoContainer"},u("video",as({ref:S=>this.videoElement=S,className:`uppy-Webcam-video ${p?"uppy-Webcam-video--mirrored":""}`},v))),u("div",{className:"uppy-Webcam-footer"},u("div",{className:"uppy-Webcam-videoSourceContainer"},A?Kd(this.props):null),u("div",{className:"uppy-Webcam-buttonContainer"},C&&u(Hd,{onSnapshot:h,i18n:d}),F&&u(Vd,{recording:a,onStartRecording:b,onStopRecording:m,i18n:d}),y&&u(Xd,{onSubmit:c,i18n:d}),y&&u(Yd,{onDiscard:P,i18n:d})),u("div",{className:"uppy-Webcam-recordingLength"},O&&u(Gd,{recordingLengthSeconds:g,i18n:d}))))}}function Jd(i){let{icon:e,i18n:t,hasCamera:a}=i;return u("div",{className:"uppy-Webcam-permissons"},u("div",{className:"uppy-Webcam-permissonsIcon"},e()),u("h1",{className:"uppy-Webcam-title"},t(a?"allowAccessTitle":"noCameraTitle")),u("p",null,t(a?"allowAccessDescription":"noCameraDescription")))}const Zd={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function ns(){return ns=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},ns.apply(this,arguments)}function wi(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var eh=0;function th(i){return"__private_"+eh+++"_"+i}const ih={version:"3.4.1"};function Mo(i){return i[0]==="."?ts[i.slice(1)]:i}function ah(i){return/^video\/[^*]+$/.test(i)}function nh(i){return/^image\/[^*]+$/.test(i)}function sh(){return navigator.mediaDevices}function wn(i,e){return i.includes(e)}const oh={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:zd({tablet:!0})};var Be=th("enableMirror");class tc extends he{constructor(e,t){super(e,{...oh,...t}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),this.mediaDevices=sh(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})),this.defaultLocale=Zd,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),wi(this,Be)[Be]=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedVideo=this.discardRecordedVideo.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null})}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e==null?void 0:e.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(e=>e.some(t=>t.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(e){e===void 0&&(e=null);const t=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,a=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),n={...this.opts.videoConstraints||{facingMode:this.opts.facingMode},...e?{deviceId:e,facingMode:null}:{}};return{audio:t,video:a?n:!1}}start(e){var t;if(e===void 0&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(wi(this,Be)[Be]=!0);const a=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(n=>(this.setPluginState({hasCamera:n}),this.mediaDevices.getUserMedia(a).then(s=>{this.stream=s;let o=null;const r=this.isAudioOnly()?s.getAudioTracks():s.getVideoTracks();!e||!e.deviceId?o=r[0].getSettings().deviceId:r.forEach(l=>{l.getSettings().deviceId===e.deviceId&&(o=l.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:o,cameraReady:!0})}).catch(s=>{this.setPluginState({cameraReady:!1,cameraError:s}),this.uppy.info(s.message,"error")})))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let a=[];this.opts.preferredVideoMimeType?a=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(a=t.allowedFileTypes.map(Mo).filter(ah));const n=o=>MediaRecorder.isTypeSupported(o)&&xn(o),s=a.filter(n);s.length>0&&(e.mimeType=s[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);const{restrictions:a}=this.uppy.opts;if(this.recordingChunks.length>1&&a.maxFileSize!=null&&!e){const n=this.recordingChunks.reduce((l,c)=>l+c.size,0),o=(n-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,r=Math.max(0,a.maxFileSize-o);n>r&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const t=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(t=>{try{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),wi(this,Be)[Be]=!1}catch(a){a.isRestriction||this.uppy.log(a)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(wi(this,Be)[Be]=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach(a=>a.stop())}this.recorder&&await new Promise(e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((e,t)=>{let a=this.opts.countdown;const n=setInterval(()=>{if(!this.webcamActive)return clearInterval(n),this.captureInProgress=!1,t(new Error("Webcam is not active"));a?(this.uppy.info(`${a}...`,"warning",800),a--):(clearInterval(n),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}takeSnapshot(){this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(e=>{const t=typeof e=="object"?e.message:e;return this.uppy.info(t,"error",5e3),Promise.reject(new Error(`onBeforeSnapshot: ${t}`))}).then(()=>this.getImage()).then(e=>{this.captureInProgress=!1;try{this.uppy.addFile(e)}catch(t){t.isRestriction||this.uppy.log(t)}},e=>{throw this.captureInProgress=!1,e}))}getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,a=e.videoHeight,n=document.createElement("canvas");n.width=t,n.height=a,n.getContext("2d").drawImage(e,0,0);const{restrictions:o}=this.uppy.opts;let r=[];this.opts.preferredImageMimeType?r=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(r=o.allowedFileTypes.map(Mo).filter(nh));const l=r[0]||"image/jpeg",c=xn(l)||"jpg",d=`cam-${Date.now()}.${c}`;return $d(n,l).then(p=>({source:this.id,name:d,data:new Blob([p],{type:l}),type:l}))}getVideo(){const e=this.recordingChunks.find(o=>{var r;return((r=o.type)==null?void 0:r.length)>0}).type,t=xn(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const a=`webcam-${Date.now()}.${t}`,n=new Blob(this.recordingChunks,{type:e}),s={source:this.id,name:a,data:new Blob([n],{type:e}),type:e};return Promise.resolve(s)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(t=>t.kind==="videoinput")})})}render(){this.webcamActive||this.start();const e=this.getPluginState();return!e.cameraReady||!e.hasCamera?u(Jd,{icon:ec,i18n:this.i18n,hasCamera:e.hasCamera}):u(Qd,ns({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:qd(),recording:e.isRecording,mirror:wi(this,Be)[Be],src:this.stream}))}install(){const{mobileNativeCamera:e,modes:t,facingMode:a,videoConstraints:n}=this.opts,{target:s}=this.opts;if(e&&s){var o;(o=this.getTargetPlugin(s))==null||o.setOptions({showNativeVideoCameraButton:wn(t,"video-only")||wn(t,"video-audio"),showNativePhotoCameraButton:wn(t,"picture"),nativeCameraFacingMode:(n==null?void 0:n.facingMode)||a});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),s&&this.mount(s,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let r=!0;const{videoSources:l,currentDeviceId:c}=this.getPluginState();l.forEach(d=>{c===d.deviceId&&(r=!1)}),r&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}tc.VERSION=ih.version;class rh extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}const lh=Object.prototype.toString,ch=i=>lh.call(i)==="[object Error]",ph=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function uh(i){return i&&ch(i)&&i.name==="TypeError"&&typeof i.message=="string"?i.message==="Load failed"?i.stack===void 0:ph.has(i.message):!1}let ss=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};const No=(i,e,t)=>{const a=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=a,i};async function ic(i,e){return new Promise((t,a)=>{e={onFailedAttempt(){},retries:10,...e};const n=ku.operation(e),s=()=>{var r;n.stop(),a((r=e.signal)==null?void 0:r.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",s,{once:!0});const o=()=>{var r;(r=e.signal)==null||r.removeEventListener("abort",s),n.stop()};n.attempt(async r=>{try{const l=await i(r);o(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof ss)throw l.originalError;if(l instanceof TypeError&&!uh(l))throw l;if(await e.onFailedAttempt(No(l,r,e)),!n.retry(l))throw n.mainError()}catch(c){No(c,r,e),o(),a(c)}}})})}class ac extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}function dh(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new ac(i)})}function Na(i,e){return Object.prototype.hasOwnProperty.call(i,e)}class hh extends Error{constructor(e,t){super(e),this.cause=t==null?void 0:t.cause,this.cause&&Na(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function mh(i,e,t){const{progress:a,bytesUploaded:n,bytesTotal:s}=e;a&&(i.uppy.log(`Upload progress: ${a}`),i.uppy.emit("upload-progress",t,{uploader:i,bytesUploaded:n,bytesTotal:s}))}const fh=Rl(mh,300,{leading:!0,trailing:!0});function gh(i){var e;const a=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${a}`}class vh extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let nc;function st(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var bh=0;function rn(i){return"__private_"+bh+++"_"+i}const yh={version:"3.8.1"};function xh(i){return i.replace(/\/$/,"")}const sc=10,wh=5*60*1e3,Sh=401;class Ph extends Error{constructor(e){let{statusCode:t,message:a}=e;super(a),this.name="HttpError",this.statusCode=t}}async function Fh(i){if(i.status===Sh)throw new vh;if(i.ok)return i.json();let e=`Failed request with status: ${i.status}. ${i.statusText}`,t;try{t=await i.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(a){throw new Error(e,{cause:a})}throw i.status>=400&&i.status<=499&&t.message?new rh(t.message):new Ph({statusCode:i.status,message:e})}var ot=rn("companionHeaders"),Si=rn("getUrl"),Sn=rn("requestSocketToken"),Pi=rn("awaitRemoteFileUpload");nc=Symbol.for("uppy test: getCompanionHeaders");class Gs{constructor(e,t){Object.defineProperty(this,Pi,{value:_h}),Object.defineProperty(this,Si,{value:Ch}),Object.defineProperty(this,ot,{writable:!0,value:void 0}),Object.defineProperty(this,Sn,{writable:!0,value:async a=>{var n;let{file:s,postBody:o,signal:r}=a;if(((n=s.remote)==null?void 0:n.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(s.remote.url,{...s.remote.body,...o},{signal:r})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),st(this,ot)[ot]=t==null?void 0:t.companionHeaders}setCompanionHeaders(e){st(this,ot)[ot]=e}[nc](){return st(this,ot)[ot]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return xh(e&&e[t]?e[t]:t)}async headers(e){return e===void 0&&(e=!1),{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...st(this,ot)[ot]}}onReceiveResponse(e){const{headers:t}=e,n=this.uppy.getState().companion||{},s=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==n[s]&&this.uppy.setState({companion:{...n,[s]:t.get("i-am")}})}async request(e){let{path:t,method:a="GET",data:n,skipPostResponse:s,signal:o}=e;try{const r=await this.headers(!n),l=await dh(st(this,Si)[Si](t),{method:a,signal:o,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null});return s||this.onReceiveResponse(l),await Fh(l)}catch(r){throw r.isAuthError||r.name==="UserFacingApiError"||r.name==="AbortError"?r:new hh(`Could not ${a} ${st(this,Si)[Si](t)}`,{cause:r})}}async get(e,t){return typeof t=="boolean"&&(t={skipPostResponse:t}),this.request({...t,path:e})}async post(e,t,a){return typeof a=="boolean"&&(a={skipPostResponse:a}),this.request({...a,path:e,method:"POST",data:t})}async delete(e,t,a){return typeof a=="boolean"&&(a={skipPostResponse:a}),this.request({...a,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,a){var n=this;try{const{signal:s,getQueue:o}=a||{};return await ic(async()=>{var r;const l=(r=this.uppy.getFile(e.id))==null?void 0:r.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),st(this,Pi)[Pi]({file:e,queue:o(),signal:s});const d=await o().wrapPromiseFunction(async function(){try{return await st(n,Sn)[Sn](...arguments)}catch(p){if(p.isAuthError)throw new ss(p);if(p.cause==null)throw p;const h=p.cause,b=()=>[408,409,429,418,423].includes(h.statusCode)||h.statusCode>=500&&h.statusCode<=599&&![501,505].includes(h.statusCode);throw h.name==="HttpError"&&!b()?new ss(h):h}},{priority:-1})({file:e,postBody:t,signal:s}).abortOn(s);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:d}),st(this,Pi)[Pi]({file:this.uppy.getFile(e.id),queue:o(),signal:s})},{retries:sc,signal:s,onFailedAttempt:r=>this.uppy.log(`Retrying upload due to: ${r.message}`,"warning")})}catch(s){if(s.name==="AbortError")return;throw this.uppy.emit("upload-error",e,s),s}}}function Ch(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}async function _h(i){let{file:e,queue:t,signal:a}=i,n;const{capabilities:s}=this.uppy.getState();try{return await new Promise((o,r)=>{const l=e.serverToken,c=gh(e.remote.companionUrl);let d,p,h,{isPaused:b}=e;const m=(S,k)=>{if(d==null||d.readyState!==d.OPEN){var I;this.uppy.log(`Cannot send "${S}" to socket ${e.id} because the socket state was ${String((I=d)==null?void 0:I.readyState)}`,"warning");return}d.send(JSON.stringify({action:S,payload:k??{}}))};function P(){s.resumableUploads&&m(b?"pause":"resume")}const g=async()=>{p&&p.abort(),p=new AbortController;const S=I=>{var B;this.uppy.setFileState(e.id,{serverToken:null}),(B=p)==null||B.abort==null||B.abort(),r(I)};function k(){clearTimeout(h),!b&&(h=setTimeout(()=>S(new Error("Timeout waiting for message from Companion socket")),wh))}try{await t.wrapPromiseFunction(async()=>{await ic(async()=>new Promise((B,V)=>{d=new WebSocket(`${c}/api/${l}`),k(),d.addEventListener("close",()=>{d=void 0,V(new Error("Socket closed unexpectedly"))}),d.addEventListener("error",$=>{var z;this.uppy.log(`Companion socket error ${JSON.stringify($)}, closing socket`,"warning"),(z=d)==null||z.close()}),d.addEventListener("open",()=>{P()}),d.addEventListener("message",$=>{k();try{const{action:x,payload:_}=JSON.parse($.data);switch(x){case"progress":{fh(this,_,this.uppy.getFile(e.id));break}case"success":{var z,q,w,f;const T=(z=_.response)==null?void 0:z.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:_.url,status:(q=(w=_.response)==null?void 0:w.status)!=null?q:200,body:T?JSON.parse(T):void 0}),(f=p)==null||f.abort==null||f.abort(),o();break}case"error":{const{message:T}=_.error;throw Object.assign(new Error(T),{cause:_.error})}default:this.uppy.log(`Companion socket unknown action ${x}`,"warning")}}catch(x){S(x)}});const K=()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(h),d&&d.close(),d=void 0};p.signal.addEventListener("abort",()=>{K()})}),{retries:sc,signal:p.signal,onFailedAttempt:()=>{p.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`,"info")}})})().abortOn(p.signal)}catch(I){if(p.signal.aborted)return;S(I)}},y=S=>{if(s.resumableUploads)if(b=S,d&&P(),S){var k;(k=p)==null||k.abort==null||k.abort()}else g()},F=S=>{var k;s.individualCancellation&&S.id===e.id&&(m("cancel"),(k=p)==null||k.abort==null||k.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),o())},C=S=>{var k;let{reason:I}=S;I==="user"&&m("cancel"),(k=p)==null||k.abort==null||k.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),o()},O=(S,k)=>{S===e.id&&y(k)},A=()=>y(!0),v=()=>y(!1);this.uppy.on("file-removed",F),this.uppy.on("cancel-all",C),this.uppy.on("upload-pause",O),this.uppy.on("pause-all",A),this.uppy.on("resume-all",v),n=()=>{this.uppy.off("file-removed",F),this.uppy.off("cancel-all",C),this.uppy.off("upload-pause",O),this.uppy.off("pause-all",A),this.uppy.off("resume-all",v)},a.addEventListener("abort",()=>{var S;(S=p)==null||S.abort()}),g()})}finally{n==null||n()}}Gs.VERSION=yh.version;const kh=i=>i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");class Eh extends Gs{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||kh(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}}function Th(i,e){if(i){if(typeof i!="string"&&!Array.isArray(i)&&!(i instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp');return i}return/^(?!https?:\/\/).*$/i.test(e)?`https://${e.replace(/^\/\//,"")}`:new URL(e).origin}function Oh(i,e){return new Promise(t=>{localStorage.setItem(i,e),t()})}function Dh(i){return Promise.resolve(localStorage.getItem(i))}function Ah(i){return new Promise(e=>{localStorage.removeItem(i),e()})}const Uh=Object.freeze(Object.defineProperty({__proto__:null,getItem:Dh,removeItem:Ah,setItem:Oh},Symbol.toStringTag,{value:"Module"})),Ye=Array.from;function Bo(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Rh=0;function Ih(i){return"__private_"+Rh+++"_"+i}var Fi=Ih("handleSubmit");class Mh extends ft{constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,Fi,{writable:!0,value:t=>{t.preventDefault();const{addFile:a}=this.props,n=this.input.value.trim();a(n)}}),this.form.id=da()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",Bo(this,Fi)[Fi]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",Bo(this,Fi)[Fi]),document.body.removeChild(this.form)}render(){const{i18n:e}=this.props;return u("div",{className:"uppy-Url"},u("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":e("enterUrlToImport"),placeholder:e("enterUrlToImport"),ref:t=>{this.input=t},"data-uppy-super-focusable":!0,form:this.form.id}),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id},e("import")))}}function jo(i,e,t){const a=Ye(i.items);let n;switch(e){case"paste":{if(a.some(o=>o.kind==="file"))return;n=a.filter(o=>o.kind==="string"&&o.type==="text/plain");break}case"drop":{n=a.filter(s=>s.kind==="string"&&s.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}n.forEach(s=>{s.getAsString(o=>t(o))})}const Nh={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}};var oc;const Bh={version:"3.6.1"};function jh(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.637 15.312l-2.474 2.464a3.582 3.582 0 01-.577.491c-.907.657-1.897.986-2.968.986a4.925 4.925 0 01-3.959-1.971c-.248-.329-.164-.902.165-1.149.33-.247.907-.164 1.155.164 1.072 1.478 3.133 1.724 4.618.656a.642.642 0 00.33-.328l2.473-2.463c1.238-1.313 1.238-3.366-.082-4.597a3.348 3.348 0 00-4.618 0l-1.402 1.395a.799.799 0 01-1.154 0 .79.79 0 010-1.15l1.402-1.394a4.843 4.843 0 016.843 0c2.062 1.805 2.144 5.007.248 6.896zm-8.081 5.664l-1.402 1.395a3.348 3.348 0 01-4.618 0c-1.319-1.23-1.319-3.365-.082-4.596l2.475-2.464.328-.328c.743-.492 1.567-.739 2.475-.657.906.165 1.648.574 2.143 1.314.248.329.825.411 1.155.165.33-.248.412-.822.165-1.15-.825-1.068-1.98-1.724-3.216-1.888-1.238-.247-2.556.082-3.628.902l-.495.493-2.474 2.464c-1.897 1.969-1.814 5.09.083 6.977.99.904 2.226 1.396 3.463 1.396s2.473-.492 3.463-1.395l1.402-1.396a.79.79 0 000-1.15c-.33-.328-.908-.41-1.237-.082z",fill:"#FF753E","fill-rule":"nonzero"}))}function Lh(i){const e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}function zh(i){return Ye(i.dataTransfer.items).filter(a=>a.kind==="string"&&a.type==="text/uri-list").length>0}function $h(i){return(i==null?void 0:i.startsWith("http://"))||(i==null?void 0:i.startsWith("https://"))}function qh(i){const{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}let ha=class os extends he{constructor(e,t){if(super(e,t),this.getMeta=a=>this.client.post("url/meta",{url:a}).then(n=>{if(n.error)throw this.uppy.log("[URL] Error:"),this.uppy.log(n.error),new Error("Failed to fetch the file");return n}),this.addFile=async(a,n)=>{const s=Lh(a);if(!$h(s)){this.uppy.log(`[URL] Incorrect URL entered: ${s}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}try{const o=await this.getMeta(s),r={meta:n,source:this.id,name:o.name||qh(s),type:o.type,data:{size:o.size},isRemote:!0,body:{url:s},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:s,url:s},requestClientId:os.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(r)}catch(l){return l.isRestriction||this.uppy.log(l),l}}catch(o){return this.uppy.log(o),this.uppy.info({message:this.i18n("failedToFetch"),details:o},"error",4e3),o}},this.handleRootDrop=a=>{jo(a.dataTransfer,"drop",n=>{this.uppy.log(`[URL] Adding file from dropped url: ${n}`),this.addFile(n)})},this.handleRootPaste=a=>{jo(a.clipboardData,"paste",n=>{this.uppy.log(`[URL] Adding file from pasted url: ${n}`),this.addFile(n)})},this.id=this.opts.id||"Url",this.title=this.opts.title||"Link",this.type="acquirer",this.icon=()=>u(jh,null),this.defaultLocale=Nh,this.i18nInit(),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new Gs(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(os.requestClientId,this.client)}render(){return u(Mh,{i18n:this.i18n,addFile:this.addFile})}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};oc=ha;ha.VERSION=Bh.version;ha.requestClientId=oc.name;ha.prototype.canHandleRootDrop=zh;var rc={exports:{}};(function(i){var e=Object.prototype.hasOwnProperty,t="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(t=!1));function n(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function s(l,c,d,p,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new n(d,p||l,h),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],b]:l._events[m].push(b):(l._events[m]=b,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new a:delete l._events[c]}function r(){this._events=new a,this._eventsCount=0}r.prototype.eventNames=function(){var c=[],d,p;if(this._eventsCount===0)return c;for(p in d=this._events)e.call(d,p)&&c.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},r.prototype.listeners=function(c){var d=t?t+c:c,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,b=p.length,m=new Array(b);h<b;h++)m[h]=p[h].fn;return m},r.prototype.listenerCount=function(c){var d=t?t+c:c,p=this._events[d];return p?p.fn?1:p.length:0},r.prototype.emit=function(c,d,p,h,b,m){var P=t?t+c:c;if(!this._events[P])return!1;var g=this._events[P],y=arguments.length,F,C;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,p),!0;case 4:return g.fn.call(g.context,d,p,h),!0;case 5:return g.fn.call(g.context,d,p,h,b),!0;case 6:return g.fn.call(g.context,d,p,h,b,m),!0}for(C=1,F=new Array(y-1);C<y;C++)F[C-1]=arguments[C];g.fn.apply(g.context,F)}else{var O=g.length,A;for(C=0;C<O;C++)switch(g[C].once&&this.removeListener(c,g[C].fn,void 0,!0),y){case 1:g[C].fn.call(g[C].context);break;case 2:g[C].fn.call(g[C].context,d);break;case 3:g[C].fn.call(g[C].context,d,p);break;case 4:g[C].fn.call(g[C].context,d,p,h);break;default:if(!F)for(A=1,F=new Array(y-1);A<y;A++)F[A-1]=arguments[A];g[C].fn.apply(g[C].context,F)}}return!0},r.prototype.on=function(c,d,p){return s(this,c,d,p,!1)},r.prototype.once=function(c,d,p){return s(this,c,d,p,!0)},r.prototype.removeListener=function(c,d,p,h){var b=t?t+c:c;if(!this._events[b])return this;if(!d)return o(this,b),this;var m=this._events[b];if(m.fn)m.fn===d&&(!h||m.once)&&(!p||m.context===p)&&o(this,b);else{for(var P=0,g=[],y=m.length;P<y;P++)(m[P].fn!==d||h&&!m[P].once||p&&m[P].context!==p)&&g.push(m[P]);g.length?this._events[b]=g.length===1?g[0]:g:o(this,b)}return this},r.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&o(this,d)):(this._events=new a,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=t,r.EventEmitter=r,i.exports=r})(rc);var Hh=rc.exports;const Vh=tt(Hh);function Wh(i,e,t){let a=0,n=i.length;for(;n>0;){const s=Math.trunc(n/2);let o=a+s;t(i[o],e)<=0?(a=++o,n-=s+1):n=s}return a}var _t=function(i,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(i):a?a.value:e.get(i)},ut;class Gh{constructor(){ut.set(this,[])}enqueue(e,t){t={priority:0,...t};const a={priority:t.priority,run:e};if(this.size&&_t(this,ut,"f")[this.size-1].priority>=t.priority){_t(this,ut,"f").push(a);return}const n=Wh(_t(this,ut,"f"),a,(s,o)=>o.priority-s.priority);_t(this,ut,"f").splice(n,0,a)}dequeue(){const e=_t(this,ut,"f").shift();return e==null?void 0:e.run}filter(e){return _t(this,ut,"f").filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return _t(this,ut,"f").length}}ut=new WeakMap;var J=function(i,e,t,a,n){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},R=function(i,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(i):a?a.value:e.get(i)},te,$i,qi,yt,Ka,Hi,Ba,ze,Ni,Te,ja,De,Vi,bt,La,Lo,zo,lc,$o,qo,za,Pn,Fn,Xa,cc,$a;class pc extends Error{}class Kh extends Vh{constructor(e){var t,a,n,s;if(super(),te.add(this),$i.set(this,void 0),qi.set(this,void 0),yt.set(this,0),Ka.set(this,void 0),Hi.set(this,void 0),Ba.set(this,0),ze.set(this,void 0),Ni.set(this,void 0),Te.set(this,void 0),ja.set(this,void 0),De.set(this,0),Vi.set(this,void 0),bt.set(this,void 0),La.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Gh,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(a=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&a!==void 0?a:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(n=e.interval)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);J(this,$i,e.carryoverConcurrencyCount,"f"),J(this,qi,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),J(this,Ka,e.intervalCap,"f"),J(this,Hi,e.interval,"f"),J(this,Te,new e.queueClass,"f"),J(this,ja,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,J(this,La,e.throwOnTimeout===!0,"f"),J(this,bt,e.autoStart===!1,"f")}get concurrency(){return R(this,Vi,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);J(this,Vi,e,"f"),R(this,te,"m",Xa).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:R(this,La,"f"),...t},new Promise((a,n)=>{R(this,Te,"f").enqueue(async()=>{var s,o,r;J(this,De,(o=R(this,De,"f"),o++,o),"f"),J(this,yt,(r=R(this,yt,"f"),r++,r),"f");try{if(!((s=t.signal)===null||s===void 0)&&s.aborted)throw new pc("The task was aborted.");let l=e({signal:t.signal});t.timeout&&(l=du(Promise.resolve(l),t.timeout)),t.signal&&(l=Promise.race([l,R(this,te,"m",cc).call(this,t.signal)]));const c=await l;a(c),this.emit("completed",c)}catch(l){if(l instanceof hu&&!t.throwOnTimeout){a();return}n(l),this.emit("error",l)}finally{R(this,te,"m",lc).call(this)}},t),this.emit("add"),R(this,te,"m",za).call(this)})}async addAll(e,t){return Promise.all(e.map(async a=>this.add(a,t)))}start(){return R(this,bt,"f")?(J(this,bt,!1,"f"),R(this,te,"m",Xa).call(this),this):this}pause(){J(this,bt,!0,"f")}clear(){J(this,Te,new(R(this,ja,"f")),"f")}async onEmpty(){R(this,Te,"f").size!==0&&await R(this,te,"m",$a).call(this,"empty")}async onSizeLessThan(e){R(this,Te,"f").size<e||await R(this,te,"m",$a).call(this,"next",()=>R(this,Te,"f").size<e)}async onIdle(){R(this,De,"f")===0&&R(this,Te,"f").size===0||await R(this,te,"m",$a).call(this,"idle")}get size(){return R(this,Te,"f").size}sizeBy(e){return R(this,Te,"f").filter(e).length}get pending(){return R(this,De,"f")}get isPaused(){return R(this,bt,"f")}}$i=new WeakMap,qi=new WeakMap,yt=new WeakMap,Ka=new WeakMap,Hi=new WeakMap,Ba=new WeakMap,ze=new WeakMap,Ni=new WeakMap,Te=new WeakMap,ja=new WeakMap,De=new WeakMap,Vi=new WeakMap,bt=new WeakMap,La=new WeakMap,te=new WeakSet,Lo=function(){return R(this,qi,"f")||R(this,yt,"f")<R(this,Ka,"f")},zo=function(){return R(this,De,"f")<R(this,Vi,"f")},lc=function(){var e;J(this,De,(e=R(this,De,"f"),e--,e),"f"),R(this,te,"m",za).call(this),this.emit("next")},$o=function(){R(this,te,"m",Fn).call(this),R(this,te,"m",Pn).call(this),J(this,Ni,void 0,"f")},qo=function(){const e=Date.now();if(R(this,ze,"f")===void 0){const t=R(this,Ba,"f")-e;if(t<0)J(this,yt,R(this,$i,"f")?R(this,De,"f"):0,"f");else return R(this,Ni,"f")===void 0&&J(this,Ni,setTimeout(()=>{R(this,te,"m",$o).call(this)},t),"f"),!0}return!1},za=function(){if(R(this,Te,"f").size===0)return R(this,ze,"f")&&clearInterval(R(this,ze,"f")),J(this,ze,void 0,"f"),this.emit("empty"),R(this,De,"f")===0&&this.emit("idle"),!1;if(!R(this,bt,"f")){const e=!R(this,te,"a",qo);if(R(this,te,"a",Lo)&&R(this,te,"a",zo)){const t=R(this,Te,"f").dequeue();return t?(this.emit("active"),t(),e&&R(this,te,"m",Pn).call(this),!0):!1}}return!1},Pn=function(){R(this,qi,"f")||R(this,ze,"f")!==void 0||(J(this,ze,setInterval(()=>{R(this,te,"m",Fn).call(this)},R(this,Hi,"f")),"f"),J(this,Ba,Date.now()+R(this,Hi,"f"),"f"))},Fn=function(){R(this,yt,"f")===0&&R(this,De,"f")===0&&R(this,ze,"f")&&(clearInterval(R(this,ze,"f")),J(this,ze,void 0,"f")),J(this,yt,R(this,$i,"f")?R(this,De,"f"):0,"f"),R(this,te,"m",Xa).call(this)},Xa=function(){for(;R(this,te,"m",za).call(this););},cc=async function(e){return new Promise((t,a)=>{e.addEventListener("abort",()=>{a(new pc("The task was aborted."))},{once:!0})})},$a=async function(e,t){return new Promise(a=>{const n=()=>{t&&!t()||(this.off(e,n),a())};this.on(e,n)})};var Zi,ie,Cn,Ho,ea=0,uc=[],qa=[],se=es,Vo=se.__b,Wo=se.__r,Go=se.diffed,Ko=se.__c,Xo=se.unmount,Yo=se.__;function Ks(i,e){se.__h&&se.__h(ie,i,ea||e),ea=0;var t=ie.__H||(ie.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:qa}),t.__[i]}function ni(i){return ea=1,Xh(hc,i)}function Xh(i,e,t){var a=Ks(Zi++,2);if(a.t=i,!a.__c&&(a.__=[t?t(e):hc(void 0,e),function(r){var l=a.__N?a.__N[0]:a.__[0],c=a.t(l,r);l!==c&&(a.__N=[c,a.__[1]],a.__c.setState({}))}],a.__c=ie,!ie.u)){var n=function(r,l,c){if(!a.__c.__H)return!0;var d=a.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!s||s.call(this,r,l,c);var p=!1;return d.forEach(function(h){if(h.__N){var b=h.__[0];h.__=h.__N,h.__N=void 0,b!==h.__[0]&&(p=!0)}}),!(!p&&a.__c.props===r)&&(!s||s.call(this,r,l,c))};ie.u=!0;var s=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.componentWillUpdate=function(r,l,c){if(this.__e){var d=s;s=void 0,n(r,l,c),s=d}o&&o.call(this,r,l,c)},ie.shouldComponentUpdate=n}return a.__N||a.__}function Ya(i,e){var t=Ks(Zi++,3);!se.__s&&dc(t.__H,e)&&(t.__=i,t.i=e,ie.__H.__h.push(t))}function _n(i){return ea=5,ln(function(){return{current:i}},[])}function ln(i,e){var t=Ks(Zi++,7);return dc(t.__H,e)?(t.__V=i(),t.i=e,t.__h=i,t.__V):t.__}function Qa(i,e){return ea=8,ln(function(){return i},e)}function Yh(){for(var i;i=uc.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ha),i.__H.__h.forEach(rs),i.__H.__h=[]}catch(e){i.__H.__h=[],se.__e(e,i.__v)}}se.__b=function(i){ie=null,Vo&&Vo(i)},se.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Yo&&Yo(i,e)},se.__r=function(i){Wo&&Wo(i),Zi=0;var e=(ie=i.__c).__H;e&&(Cn===ie?(e.__h=[],ie.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=qa,t.__N=t.i=void 0})):(e.__h.forEach(Ha),e.__h.forEach(rs),e.__h=[],Zi=0)),Cn=ie},se.diffed=function(i){Go&&Go(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(uc.push(e)!==1&&Ho===se.requestAnimationFrame||((Ho=se.requestAnimationFrame)||Qh)(Yh)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==qa&&(t.__=t.__V),t.i=void 0,t.__V=qa})),Cn=ie=null},se.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ha),t.__h=t.__h.filter(function(a){return!a.__||rs(a)})}catch(a){e.some(function(n){n.__h&&(n.__h=[])}),e=[],se.__e(a,t.__v)}}),Ko&&Ko(i,e)},se.unmount=function(i){Xo&&Xo(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(a){try{Ha(a)}catch(n){e=n}}),t.__H=void 0,e&&se.__e(e,t.__v))};var Qo=typeof requestAnimationFrame=="function";function Qh(i){var e,t=function(){clearTimeout(a),Qo&&cancelAnimationFrame(e),setTimeout(i)},a=setTimeout(t,100);Qo&&(e=requestAnimationFrame(t))}function Ha(i){var e=ie,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ie=e}function rs(i){var e=ie;i.__c=i.__(),ie=e}function dc(i,e){return!i||i.length!==e.length||e.some(function(t,a){return t!==i[a]})}function hc(i,e){return typeof e=="function"?e(i):e}function Jh(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function Zh(i){let{pluginName:e,i18n:t,onAuth:a}=i;const n=e==="Google Drive",s=Qa(o=>{o.preventDefault(),a()},[a]);return u("form",{onSubmit:s},n?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(Jh,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}const em=i=>{let{pluginName:e,i18n:t,onAuth:a}=i;return u(Zh,{pluginName:e,i18n:t,onAuth:a})};function tm(i){const{loading:e,pluginName:t,pluginIcon:a,i18n:n,handleAuth:s,renderForm:o=em}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},a()),u("div",{className:"uppy-Provider-authTitle"},n("authenticateWithTitle",{pluginName:t})),u("div",{className:"uppy-Provider-authForm"},o({pluginName:t,i18n:n,loading:e,onAuth:s})))}function im(i){let{i18n:e,logout:t,username:a}=i;return u(Ft,null,u("span",{className:"uppy-ProviderBrowser-user",key:"username"},a),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}const am=i=>{const{getFolder:e,title:t,isLast:a}=i;return u(Ft,null,u("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:e},t),a?"":" / ")};function nm(i){const{getFolder:e,title:t,breadcrumbsIcon:a,breadcrumbs:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},a),n.map((s,o)=>u(am,{key:s.id,getFolder:()=>e(s.requestPath,s.name),title:o===0?t:s.name,isLast:o+1===n.length})))}function sm(i){return u(Ft,null,i.showBreadcrumbs&&u(nm,{getFolder:i.getFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title}),u(im,{logout:i.logout,username:i.username,i18n:i.i18n}))}function mc(i){return{...i,type:i.mimeType,extension:i.name?qs(i.name).extension:null}}function ls(){return ls=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},ls.apply(this,arguments)}const om={position:"relative",width:"100%",minHeight:"100%"},rm={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class fc extends ft{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:a,renderRow:n,overscanCount:s=10,...o}=e;const{offset:r,height:l}=this.state;let c=Math.floor(r/a),d=Math.floor(l/a);s&&(c=Math.max(0,c-c%s),d+=s);const p=c+d+4,h=t.slice(c,p),b={...om,height:t.length*a},m={...rm,top:c*a};return u("div",ls({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:b},u("div",{role:"presentation",style:m},h.map(n))))}}function gc(i){const{search:e,searchOnInput:t,searchTerm:a,showButton:n,inputLabel:s,clearSearchLabel:o,buttonLabel:r,clearSearch:l,inputClassName:c,buttonCSSClassName:d}=i,[p,h]=ni(a??""),b=Qa(y=>{y.preventDefault(),e(p)},[e,p]),m=Qa(y=>{const F=y.target.value;h(F),t&&e(F)},[h,t,e]),P=()=>{h(""),l&&l()},[g]=ni(()=>{const y=document.createElement("form");return y.setAttribute("tabindex","-1"),y.id=da(),y});return Ya(()=>(document.body.appendChild(g),g.addEventListener("submit",b),()=>{g.removeEventListener("submit",b),document.body.removeChild(g)}),[g,b]),u(Ft,null,u("input",{className:`uppy-u-reset ${c}`,type:"search","aria-label":s,placeholder:s,value:p,onInput:m,form:g.id,"data-uppy-super-focusable":!0}),!n&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!n&&p&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":o,title:o,onClick:P},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),n&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:g.id},r))}function lm(i){let{cancel:e,done:t,i18n:a,selected:n}=i;return u("div",{className:"uppy-ProviderBrowser-footer"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:t,type:"button"},a("selectX",{smart_count:n})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},a("cancel")))}function cm(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function pm(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function um(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function dm(i){const{itemIconString:e}=i;if(e===null)return null;switch(e){case"file":return u(cm,null);case"folder":return u(pm,null);case"video":return u(um,null);default:{const{alt:t}=i;return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}function Jo(i){const{className:e,isDisabled:t,restrictionError:a,isChecked:n,title:s,itemIconEl:o,showTitles:r,toggleCheckbox:l,recordShiftKeyPress:c,id:d,children:p}=i,h=Se("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":n});return u("li",{className:e,title:t?a==null?void 0:a.message:void 0},u("input",{type:"checkbox",className:h,onChange:l,onKeyDown:c,onMouseDown:c,name:"listitem",id:d,checked:n,disabled:t,"data-uppy-super-focusable":!0}),u("label",{htmlFor:d,"aria-label":s,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},o,r&&s,p))}function hm(i){const{className:e,isDisabled:t,restrictionError:a,isCheckboxDisabled:n,isChecked:s,toggleCheckbox:o,recordShiftKeyPress:r,type:l,id:c,itemIconEl:d,title:p,handleFolderClick:h,showTitles:b,i18n:m}=i;return u("li",{className:e,title:t?a==null?void 0:a.message:void 0},n?null:u("input",{type:"checkbox",className:`uppy-u-reset uppy-ProviderBrowserItem-checkbox ${s?"uppy-ProviderBrowserItem-checkbox--is-checked":""}`,onChange:o,onKeyDown:r,onMouseDown:r,name:"listitem",id:c,checked:s,"aria-label":l==="file"?null:m("allFilesFromFolderNamed",{name:p}),disabled:t,"data-uppy-super-focusable":!0}),l==="file"?u("label",{htmlFor:c,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),b&&p):u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:h,"aria-label":m("openFolderNamed",{name:p})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),b&&u("span",null,p)))}function Wi(){return Wi=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},Wi.apply(this,arguments)}function Zo(i){const{author:e,getItemIcon:t,isChecked:a,isDisabled:n,viewType:s}=i,o=t(),r=Se("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":a},{"uppy-ProviderBrowserItem--disabled":n},{"uppy-ProviderBrowserItem--noPreview":o==="video"}),l=u(dm,{itemIconString:o});switch(s){case"grid":return u(Jo,Wi({},i,{className:r,itemIconEl:l}));case"list":return u(hm,Wi({},i,{className:r,itemIconEl:l}));case"unsplash":return u(Jo,Wi({},i,{className:r,itemIconEl:l}),u("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},e.name));default:throw new Error(`There is no such type ${s}`)}}const mm="shared-with-me";function er(i){const{currentSelection:e,uppyFiles:t,viewType:a,isChecked:n,toggleCheckbox:s,recordShiftKeyPress:o,showTitles:r,i18n:l,validateRestrictions:c,getNextFolder:d,f:p}=i;if(p.isFolder)return Zo({showTitles:r,viewType:a,i18n:l,id:p.id,title:p.name,getItemIcon:()=>p.icon,isChecked:n(p),toggleCheckbox:b=>s(b,p),recordShiftKeyPress:o,type:"folder",isDisabled:!1,isCheckboxDisabled:p.id===mm,handleFolderClick:()=>d(p)});const h=c(mc(p),[...t,...e]);return Zo({id:p.id,title:p.name,author:p.author,getItemIcon:()=>p.icon,isChecked:n(p),toggleCheckbox:b=>s(b,p),isCheckboxDisabled:!1,recordShiftKeyPress:o,showTitles:r,viewType:a,i18n:l,type:"file",isDisabled:!!h&&!n(p),restrictionError:h})}function vc(i){const{currentSelection:e,folders:t,files:a,uppyFiles:n,viewType:s,headerComponent:o,showBreadcrumbs:r,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,handleScroll:p,showTitles:h,i18n:b,validateRestrictions:m,isLoading:P,showSearchFilter:g,search:y,searchTerm:F,clearSearch:C,searchOnInput:O,searchInputLabel:A,clearSearchLabel:v,getNextFolder:S,cancel:k,done:I,noResultsLabel:B,loadAllFiles:V}=i,K=e.length,$=ln(()=>[...t,...a],[t,a]);return u("div",{className:Se("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s}`)},o&&u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:Se("uppy-ProviderBrowser-headerBar",!r&&"uppy-ProviderBrowser-headerBar--simple")},o)),g&&u("div",{class:"uppy-ProviderBrowser-searchFilter"},u(gc,{search:y,searchTerm:F,clearSearch:C,inputLabel:A,clearSearchLabel:v,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:O})),P?u("div",{className:"uppy-Provider-loading"},u("span",null,typeof P=="string"?P:b("loading"))):!t.length&&!a.length?u("div",{className:"uppy-Provider-empty"},B):V?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(fc,{data:$,renderRow:z=>u(er,{currentSelection:e,uppyFiles:n,viewType:s,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,showTitles:h,i18n:b,validateRestrictions:m,getNextFolder:S,f:z}),rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:p,role:"listbox",tabIndex:-1},$.map(z=>u(er,{currentSelection:e,uppyFiles:n,viewType:s,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,showTitles:h,i18n:b,validateRestrictions:m,getNextFolder:S,f:z})))),K>0&&u(lm,{selected:K,done:I,cancel:k,i18n:b}))}class Ja extends ft{componentWillUnmount(){const{onUnmount:e}=this.props;e()}render(){const{children:e}=this.props;return vt(e)[0]}}function cs(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}class bc{constructor(e,t){this.filterItems=a=>{const n=this.plugin.getPluginState();return!n.filterInput||n.filterInput===""?a:a.filter(s=>s.name.toLowerCase().indexOf(n.filterInput.toLowerCase())!==-1)},this.recordShiftKeyPress=a=>{this.isShiftKeyPressed=a.shiftKey},this.isChecked=a=>{const{currentSelection:n}=this.plugin.getPluginState();return n.some(s=>s.id===a.id)},this.plugin=e,this.provider=t.provider,this.opts=t,this.isHandlingScroll=!1,this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.clearSelection=this.clearSelection.bind(this),this.cancelPicking=this.cancelPicking.bind(this)}preFirstRender(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()}shouldHandleScroll(e){const{scrollHeight:t,scrollTop:a,offsetHeight:n}=e.target;return t-(a+n)<50&&!this.isHandlingScroll}clearSelection(){this.plugin.setPluginState({currentSelection:[],filterInput:""})}cancelPicking(){this.clearSelection();const e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()}handleError(e){var t;const{uppy:a}=this.plugin,n=a.i18n("companionError");a.log(e.toString()),!(e.isAuthError||((t=e.cause)==null?void 0:t.name)==="AbortError")&&a.info({message:n,details:e.toString()},"error",5e3)}registerRequestClient(){this.requestClientId=this.provider.provider,this.plugin.uppy.registerRequestClient(this.requestClientId,this.provider)}getTagFile(e){const t={id:e.id,source:this.plugin.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,meta:{},body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:`${this.provider.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:this.provider.name,provider:this.provider.provider,requestClientId:this.requestClientId}},a=Hs(t);return a&&cs(a)&&(t.preview=e.thumbnail),e.author&&(e.author.name!=null&&(t.meta.authorName=String(e.author.name)),e.author.url&&(t.meta.authorUrl=e.author.url)),e.relDirPath!=null&&(t.meta.relativePath=e.relDirPath?`${e.relDirPath}/${t.name}`:null),e.absDirPath!=null&&(t.meta.absolutePath=e.absDirPath?`/${e.absDirPath}/${t.name}`:`/${t.name}`),t}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();const{folders:a,files:n}=this.plugin.getPluginState(),s=this.filterItems(a.concat(n));if(this.lastCheckbox&&this.isShiftKeyPressed){const{currentSelection:r}=this.plugin.getPluginState(),l=s.indexOf(this.lastCheckbox),c=s.indexOf(t),d=l<c?s.slice(l,c+1):s.slice(c,l+1),p=[];for(const h of d){const{uppy:b}=this.plugin,m=b.validateRestrictions(mc(h),[...b.getFiles(),...p]);m?b.info({message:m.message},"error",b.opts.infoTimeout):p.push(h)}this.plugin.setPluginState({currentSelection:[...new Set([...r,...p])]});return}this.lastCheckbox=t;const{currentSelection:o}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:o.filter(r=>r.id!==t.id)}):this.plugin.setPluginState({currentSelection:o.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}}function Fe(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var fm=0;function ma(i){return"__private_"+fm+++"_"+i}const gm={version:"3.12.0"};function vm(i){return i.slice(1).map(e=>e.name).join("/")}function ps(i,e){return i?`${i}/${e}`:e}function yc(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}const bm={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1};var It=ma("abortController"),je=ma("withAbort"),ta=ma("list"),Ci=ma("listFilesAndFolders"),Gi=ma("recursivelyListAllFiles");class Xs extends bc{constructor(e,t){super(e,{...bm,...t}),Object.defineProperty(this,Gi,{value:Sm}),Object.defineProperty(this,Ci,{value:wm}),Object.defineProperty(this,ta,{value:xm}),Object.defineProperty(this,je,{value:ym}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.filterQuery=this.filterQuery.bind(this),this.clearFilter=this.clearFilter.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState({authenticated:void 0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[]}),this.registerRequestClient()}tearDown(){}async getFolder(e,t){this.setLoading(!0);try{await Fe(this,je)[je](async a=>{this.lastCheckbox=void 0;let{breadcrumbs:n}=this.plugin.getPluginState();const s=n.findIndex(l=>e===l.requestPath);s!==-1?n=n.slice(0,s+1):n=[...n,{requestPath:e,name:t}],this.nextPagePath=e;let o=[],r=[];do{const{files:l,folders:c}=await Fe(this,Ci)[Ci]({breadcrumbs:n,signal:a});o=o.concat(l),r=r.concat(c),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length+r.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:r,files:o,breadcrumbs:n,filterInput:""})})}catch(a){if((a==null?void 0:a.name)==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(a.message)},"warning",5e3);return}this.handleError(a)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await Fe(this,je)[je](async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}const a={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(a)}})}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await Fe(this,je)[je](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),this.preFirstRender()})}catch(t){if(t.name==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(t.message)},"warning",5e3);return}this.plugin.uppy.log(`login failed: ${t.message}`)}finally{this.setLoading(!1)}}async handleScroll(e){if(this.shouldHandleScroll(e)&&this.nextPagePath){this.isHandlingScroll=!0;try{await Fe(this,je)[je](async t=>{const{files:a,folders:n,breadcrumbs:s}=this.plugin.getPluginState(),{files:o,folders:r}=await Fe(this,Ci)[Ci]({breadcrumbs:s,signal:t}),l=a.concat(o),c=n.concat(r);this.plugin.setPluginState({folders:c,files:l})})}catch(t){this.handleError(t)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await Fe(this,je)[je](async e=>{const{currentSelection:t}=this.plugin.getPluginState(),a=[],n=[];for(const s of t){const{requestPath:o}=s,r=l=>({...l,relDirPath:l.absDirPath.replace(s.absDirPath,"").replace(/^\//,"")});if(s.isFolder){let l=!0,c=0;const d=new Kh({concurrency:6}),p=b=>{for(const m of b){const P=this.getTagFile(m),g=Vl(P,this.plugin.uppy.getID());this.plugin.uppy.checkIfFileAlreadyExists(g)||(n.push(r(m)),c++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:c}))),l=!1}};await Fe(this,Gi)[Gi]({requestPath:o,absDirPath:ps(s.absDirPath,s.name),relDirPath:s.name,queue:d,onFiles:p,signal:e}),await d.onIdle();let h;l?h=this.plugin.uppy.i18n("emptyFolderAdded"):c===0?h=this.plugin.uppy.i18n("folderAlreadyAdded",{folder:s.name}):h=this.plugin.uppy.i18n("folderAdded",{smart_count:c,folder:s.name}),a.push(h)}else n.push(r(s))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(n.map(s=>this.getTagFile(s,this.requestClientId))),this.plugin.setPluginState({filterInput:""}),a.forEach(s=>this.plugin.uppy.info(s)),this.clearSelection()})}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var a=this;t===void 0&&(t={});const{authenticated:n,didFirstRender:s}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;s||this.preFirstRender();const r={...this.opts,...t},{files:l,folders:c,filterInput:d,loading:p,currentSelection:h}=this.plugin.getPluginState(),{isChecked:b,recordShiftKeyPress:m,filterItems:P}=this,g=d!=="",y=this.plugin.icon||yc,F={showBreadcrumbs:r.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:y,title:this.plugin.title,logout:this.logout,username:this.username,i18n:o},C={isChecked:b,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:m,currentSelection:h,files:g?P(l):l,folders:g?P(c):c,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,showSearchFilter:r.showFilter,search:this.filterQuery,clearSearch:this.clearFilter,searchTerm:d,searchOnInput:!0,searchInputLabel:o("filter"),clearSearchLabel:o("resetFilter"),noResultsLabel:o("noFilesFound"),logout:this.logout,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:u(sm,F),title:this.plugin.title,viewType:r.viewType,showTitles:r.showTitles,showBreadcrumbs:r.showBreadcrumbs,pluginIcon:y,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return a.plugin.uppy.validateRestrictions(...arguments)},isLoading:p};return n===!1?u(Ja,{onUnmount:this.clearSelection},u(tm,{pluginName:this.plugin.title,pluginIcon:y,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:p})):u(Ja,{onUnmount:this.clearSelection},u(vc,C))}}async function ym(i){var e;(e=Fe(this,It)[It])==null||e.abort();const t=new AbortController;Fe(this,It)[It]=t;const a=()=>{t.abort(),this.clearSelection()};try{this.plugin.uppy.on("dashboard:close-panel",a),this.plugin.uppy.on("cancel-all",a),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",a),this.plugin.uppy.off("cancel-all",a),Fe(this,It)[It]=void 0}}async function xm(i){let{requestPath:e,absDirPath:t,signal:a}=i;const{username:n,nextPagePath:s,items:o}=await this.provider.list(e,{signal:a});return this.username=n||this.username,{items:o.map(r=>({...r,absDirPath:t})),nextPagePath:s}}async function wm(i){let{breadcrumbs:e,signal:t}=i;const a=vm(e),{items:n,nextPagePath:s}=await Fe(this,ta)[ta]({requestPath:this.nextPagePath,absDirPath:a,signal:t});this.nextPagePath=s;const o=[],r=[];return n.forEach(l=>{l.isFolder?r.push(l):o.push(l)}),{files:o,folders:r}}async function Sm(i){let{requestPath:e,absDirPath:t,relDirPath:a,queue:n,onFiles:s,signal:o}=i,r=e;for(;r;){const l=await Fe(this,ta)[ta]({requestPath:r,absDirPath:t,signal:o});r=l.nextPagePath;const c=l.items.filter(h=>!h.isFolder),d=l.items.filter(h=>h.isFolder);s(c);const p=d.map(async h=>n.add(async()=>Fe(this,Gi)[Gi]({requestPath:h.requestPath,absDirPath:ps(t,h.name),relDirPath:ps(a,h.name),queue:n,onFiles:s,signal:o})));await Promise.all(p)}}Xs.VERSION=gm.version;function tr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Pm=0;function Fm(i){return"__private_"+Pm+++"_"+i}const Cm={version:"3.12.0"},ir={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},_m={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0};var _i=Fm("updateFilesAndInputMode");class xc extends bc{constructor(e,t){super(e,{..._m,...t}),Object.defineProperty(this,_i,{value:km}),this.nextPageQuery=null,this.search=this.search.bind(this),this.clearSearch=this.clearSearch.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState(ir),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(ir)}async search(e){const{searchTerm:t}=this.plugin.getPluginState();if(!(e&&e===t)){this.setLoading(!0);try{const a=await this.provider.search(e);tr(this,_i)[_i](a,[])}catch(a){this.handleError(a)}finally{this.setLoading(!1)}}}clearSearch(){this.plugin.setPluginState({currentSelection:[],files:[],searchTerm:null})}async handleScroll(e){const t=this.nextPageQuery||null;if(this.shouldHandleScroll(e)&&t){this.isHandlingScroll=!0;try{const{files:a,searchTerm:n}=this.plugin.getPluginState(),s=await this.provider.search(n,t);tr(this,_i)[_i](s,a)}catch(a){this.handleError(a)}finally{this.isHandlingScroll=!1}}}donePicking(){const{currentSelection:e}=this.plugin.getPluginState();this.plugin.uppy.log("Adding remote search provider files"),this.plugin.uppy.addFiles(e.map(t=>this.getTagFile(t))),this.resetPluginState()}render(e,t){var a=this;t===void 0&&(t={});const{didFirstRender:n,isInputMode:s,searchTerm:o}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||this.preFirstRender();const l={...this.opts,...t},{files:c,folders:d,filterInput:p,loading:h,currentSelection:b}=this.plugin.getPluginState(),{isChecked:m,filterItems:P,recordShiftKeyPress:g}=this,y=p!=="",F={isChecked:m,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:g,currentSelection:b,files:y?P(c):c,folders:y?P(d):d,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:l.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:o,searchOnInput:!1,searchInputLabel:r("search"),clearSearchLabel:r("resetSearch"),noResultsLabel:r("noSearchResults"),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showFilter:l.showFilter,isLoading:h,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:r,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return a.plugin.uppy.validateRestrictions(...arguments)}};return s?u(Ja,{onUnmount:this.resetPluginState},u("div",{className:"uppy-SearchProvider"},u(gc,{search:this.search,inputLabel:r("enterTextToSearch"),buttonLabel:r("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):u(Ja,{onUnmount:this.resetPluginState},u(vc,F))}}function km(i,e){this.nextPageQuery=i.nextPageQuery,i.items.forEach(t=>{e.push(t)}),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:e,searchTerm:i.searchedFor})}xc.VERSION=Cm.version;const Em={version:"3.3.1"};class wc extends he{constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Uh,this.id=this.opts.id||"Unsplash",this.title=this.opts.title||"Unsplash",this.icon=()=>u("svg",{className:"uppy-DashboardTab-iconUnsplash",viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},u("g",{fill:"currentcolor"},u("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z"}),u("path",{d:"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z"}))),!this.opts.companionUrl)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.hostname=this.opts.companionUrl,this.opts.companionAllowedHosts=Th(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Eh(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule,provider:"unsplash",pluginId:this.id})}install(){this.view=new xc(this,{provider:this.provider,viewType:"unsplash",showFilter:!0});const{target:e}=this.opts;e&&this.mount(e,this)}async onFirstRender(){}render(e){return this.view.render(e)}uninstall(){this.unmount()}}wc.VERSION=Em.version;function ar(i,e,t,a){return t===0||i===e?i:a===0?e:i+(e-i)*2**(-a/t)}const Xe={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};function kn(i){const e=[];let t="indeterminate",a;for(const{progress:s}of Object.values(i)){const{preprocess:o,postprocess:r}=s;a==null&&(o||r)&&({mode:t,message:a}=o||r),(o==null?void 0:o.mode)==="determinate"&&e.push(o.value),(r==null?void 0:r.mode)==="determinate"&&e.push(r.value)}const n=e.reduce((s,o)=>s+o/e.length,0);return{mode:t,message:a,value:n}}function Tm(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,a=Math.floor(i%60);return{hours:e,minutes:t,seconds:a}}function Om(i){const e=Tm(i),t=e.hours===0?"":`${e.hours}h`,a=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,n=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${a}${n}`}const Dm="·",nr=()=>` ${Dm} `;function Am(i){const{newFiles:e,isUploadStarted:t,recoveredState:a,i18n:n,uploadState:s,isSomeGhost:o,startUpload:r}=i,l=Se("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===Xe.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),c=e&&t&&!a?n("uploadXNewFiles",{smart_count:e}):n("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:e}),onClick:r,disabled:o,"data-uppy-super-focusable":!0},c)}function Um(i){const{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function Rm(i){const{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("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 Im(i){const{isAllPaused:e,i18n:t,isAllComplete:a,resumableUploads:n,uppy:s}=i,o=t(e?"resume":"pause");function r(){if(!a){if(!n){s.cancelAll();return}if(e){s.resumeAll();return}s.pauseAll()}}return u("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:r,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Mm(i){const{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Sc(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("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 Nm(i){const{progress:e}=i,{value:t,mode:a,message:n}=e;return u("div",{className:"uppy-StatusBar-content"},u(Sc,null),a==="determinate"?`${Math.round(t*100)}% · `:"",n)}function Bm(i){const{numUploads:e,complete:t,totalUploadedSize:a,totalSize:n,totalETA:s,i18n:o}=i,r=e>1;return u("div",{className:"uppy-StatusBar-statusSecondary"},r&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},r&&nr(),o("dataUploadedOfTotal",{complete:ei(a),total:ei(n)}),nr(),o("xTimeLeft",{time:Om(s)})))}function Pc(i){const{i18n:e,complete:t,numUploads:a}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:a}))}function jm(i){const{i18n:e,newFiles:t,startUpload:a}=i,n=Se("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:n,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:a},e("upload")))}function Lm(i){const{i18n:e,supportsUploadProgress:t,totalProgress:a,showProgressDetails:n,isUploadStarted:s,isAllComplete:o,isAllPaused:r,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:h,totalETA:b,startUpload:m}=i,P=l&&s;if(!s||o)return null;const g=e(r?"paused":"uploading");function y(){return!r&&!P&&n?t?u(Bm,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:h,totalETA:b,i18n:e}):u(Pc,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},r?null:u(Sc,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t?`${g}: ${a}%`:g),y(),P?u(jm,{i18n:e,newFiles:l,startUpload:m}):null))}function zm(i){const{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function $m(i){const{error:e,i18n:t,complete:a,numUploads:n}=i;function s(){const o=`${t("uploadFailed")}
16
+ Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),a.type in U(this,me)[me]?U(this,me)[me][a.type].push(a):U(this,me)[me][a.type]=[a],a.install(),this.emit("plugin-added",a),this}getPlugin(e){for(const t of Object.values(U(this,me)[me])){const a=t.find(n=>n.id===e);if(a!=null)return a}}[Gl](e){return U(this,me)[me][e]}iteratePlugins(e){Object.values(U(this,me)[me]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=U(this,me)[me][e.type],a=t.findIndex(o=>o.id===e.id);a!==-1&&t.splice(a,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),U(this,fi)[fi](),this.iteratePlugins(a=>{this.removePlugin(a)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",U(this,Ve)[Ve]),window.removeEventListener("offline",U(this,Ve)[Ve]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,a){t===void 0&&(t="info"),a===void 0&&(a=3e3);const n=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:n?e.message:e,details:n?e.details:null}]}),setTimeout(()=>this.hideInfo(),a),this.emit("info-visible")}log(e,t){const{logger:a}=this.opts;switch(t){case"error":a.error(e);break;case"warning":a.warn(e);break;default:a.debug(e);break}}registerRequestClient(e,t){U(this,yi)[yi].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=U(this,yi)[yi].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?U(this,nt)[nt](e):(U(this,Lt)[Lt](e),Promise.reject(new Error("Nonexistent upload")))}[Kl](){return U(this,at)[at](...arguments)}addResultData(e,t){if(!U(this,yn)[yn](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:a}=this.getState(),n={...a[e],result:{...a[e].result,...t}};this.setState({currentUploads:{...a,[e]:n}})}upload(){var e;(e=U(this,me)[me].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const a=this.opts.onBeforeUpload(t);return a===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(a&&typeof a=="object"&&(t=a,this.setState({files:t})),Promise.resolve().then(()=>U(this,Ue)[Ue].validateMinNumberOfFiles(t)).catch(n=>{throw U(this,Re)[Re]([n]),n}).then(()=>{if(!U(this,vn)[vn](t))throw new $e(this.i18n("missingRequiredMetaField"))}).catch(n=>{throw n}).then(()=>{const{currentUploads:n}=this.getState(),s=Object.values(n).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{const c=this.getFile(l);!c.progress.uploadStarted&&s.indexOf(l)===-1&&o.push(c.id)});const r=U(this,at)[at](o);return U(this,nt)[nt](r)}).catch(n=>{throw this.emit("error",n),this.log(n,"error"),n}))}};function xd(i){for(const s of i)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");const e=i.filter(s=>s.isUserFacing),t=4,a=e.slice(0,t),n=e.slice(t);a.forEach(s=>{let{message:o,details:r=""}=s;this.info({message:o,details:r},"error",this.opts.infoTimeout)}),n.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:n.length})})}function wd(i){const{missingFields:e,error:t}=U(this,Ue)[Ue].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Sd(i){let e=!0;for(const t of Object.values(i))U(this,Ji)[Ji](t)||(e=!1);return e}function Pd(i){const{allowNewUpload:e}=this.getState();if(e===!1){const t=new $e(this.i18n("noMoreFilesAllowed"),{file:i});throw U(this,Re)[Re]([t]),t}}function Fd(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Hs(e),a=od(t,e),n=qs(a).extension,s=Vl(e,this.getID()),o=e.meta||{};o.name=a,o.type=t;const r=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:s,name:a,extension:n||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:r,uploadComplete:!1,uploadStarted:null},size:r,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}function Cd(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function _d(i){const{files:e}=this.getState(),t={...e},a=[],n=[];for(const o of i)try{var s;let r=U(this,is)[is](o);const l=(s=e[r.id])==null?void 0:s.isGhost;l&&(r={...e[r.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${r.name}, ${r.id}`));const c=this.opts.onBeforeFileAdded(r,t);if(!c&&this.checkIfFileAlreadyExists(r.id))throw new $e(this.i18n("noDuplicates",{fileName:r.name}),{file:o});if(c===!1&&!l)throw new $e("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof c=="object"&&c!==null&&(r=c),U(this,Ue)[Ue].validateSingleFile(r),t[r.id]=r,a.push(r)}catch(r){n.push(r)}try{U(this,Ue)[Ue].validateAggregateRestrictions(Object.values(e),a)}catch(o){return n.push(o),{nextFilesState:e,validFilesToAdd:[],errors:n}}return{nextFilesState:t,validFilesToAdd:a,errors:n}}function kd(){const i=(a,n,s)=>{let o=a.message||"Unknown error";a.details&&(o+=` ${a.details}`),this.setState({error:o}),n!=null&&n.id in this.getState().files&&this.setFileState(n.id,{error:o,response:s})};this.on("error",i),this.on("upload-error",(a,n,s)=>{if(i(n,a,s),typeof n=="object"&&n.message){var o;this.log(n.message,"error");const r=new Error(this.i18n("failedToUpload",{file:(o=a==null?void 0:a.name)!=null?o:""}));r.isUserFacing=!0,r.details=n.message,n.details&&(r.details+=` ${n.details}`),U(this,Re)[Re]([r])}else U(this,Re)[Re]([n])});let e=null;this.on("upload-stalled",(a,n)=>{const{message:s}=a,o=n.map(r=>r.meta.name).join(", ");e||(this.info({message:s,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${s} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const t=a=>{const n=a.filter(o=>{const r=o!=null&&this.getFile(o.id);return r||this.log(`Not setting progress for a file that has been removed: ${o==null?void 0:o.id}`),r}),s=Object.fromEntries(n.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(s)};this.on("upload-start",a=>{a.forEach(n=>{this.emit("upload-started",n)}),t(a)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const s=this.getFile(a.id).progress;this.setFileState(a.id,{progress:{...s,postprocess:U(this,ht)[ht].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:s.bytesTotal},response:n,uploadURL:n.uploadURL,isPaused:!1}),a.size==null&&this.setFileState(a.id,{size:n.bytesUploaded||s.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}this.setFileState(a.id,{progress:{...this.getFile(a.id).progress,preprocess:n}})}),this.on("preprocess-complete",a=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const n={...this.getState().files};n[a.id]={...n[a.id],progress:{...n[a.id].progress}},delete n[a.id].progress.preprocess,this.setState({files:n})}),this.on("postprocess-progress",(a,n)=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}this.setFileState(a.id,{progress:{...this.getState().files[a.id].progress,postprocess:n}})}),this.on("postprocess-complete",a=>{if(a==null||!this.getFile(a.id)){this.log(`Not setting progress for a file that has been removed: ${a==null?void 0:a.id}`);return}const n={...this.getState().files};n[a.id]={...n[a.id],progress:{...n[a.id].progress}},delete n[a.id].progress.postprocess,this.setState({files:n})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",a=>{a&&U(this,Ji)[Ji](a)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",U(this,Ve)[Ve]),window.addEventListener("offline",U(this,Ve)[Ve]),setTimeout(U(this,Ve)[Ve],3e3))}function Ed(i,e){e===void 0&&(e={});const{forceAllowNewUpload:t=!1}=e,{allowNewUpload:a,currentUploads:n}=this.getState();if(!a&&!t)throw new Error("Cannot create a new upload: already uploading.");const s=da();return this.emit("upload",{id:s,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...n,[s]:{fileIDs:i,step:0,result:{}}}}),s}function Td(i){const{currentUploads:e}=this.getState();return e[i]}function Od(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function Dd(i){const e=()=>{const{currentUploads:s}=this.getState();return s[i]};let t=e();const a=[...U(this,Nt)[Nt],...U(this,Bt)[Bt],...U(this,ht)[ht]];try{for(let s=t.step||0;s<a.length&&t;s++){const o=a[s];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:s}}});const{fileIDs:r}=t;await o(r,i),t=e()}}catch(s){throw U(this,Lt)[Lt](i),s}if(t){t.fileIDs.forEach(l=>{const c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});const s=t.fileIDs.map(l=>this.getFile(l)),o=s.filter(l=>!l.error),r=s.filter(l=>l.error);this.addResultData(i,{successful:o,failed:r,uploadID:i}),t=e()}let n;return t&&(n=t.result,this.emit("complete",n),U(this,Lt)[Lt](i)),n==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),n}Xl.VERSION=yd.version;const Ql=Xl;function Jl(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Ad(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Jl(i)?i:null}function Zl(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class Vs{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(e==null?void 0:e[this.id])||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new $l([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}function Io(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Ud=0;function Rd(i){return"__private_"+Ud+++"_"+i}function Id(i){let e=null,t;return function(){for(var a=arguments.length,n=new Array(a),s=0;s<a;s++)n[s]=arguments[s];return t=n,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var xi=Rd("updateUI");class he extends Vs{constructor(){super(...arguments),Object.defineProperty(this,xi,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof(e==null?void 0:e.addTarget)=="function")t=e,t instanceof he||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:he}}));else if(typeof e=="function"){const a=e;this.uppy.iteratePlugins(n=>{n instanceof a&&(t=n)})}return t}mount(e,t){const a=t.id,n=Ad(e);if(n){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),Io(this,xi)[xi]=Id(l=>{this.uppy.getPlugin(this.id)&&(Do(this.render(l),r),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),Do(this.render(this.uppy.getState()),r),this.el=r,n.appendChild(r),r.dir=this.opts.direction||Zl(r)||"ltr",this.onMount(),this.el}const s=this.getTargetPlugin(e);if(s)return this.uppy.log(`Installing ${a} to ${s.id}`),this.parent=s,this.el=s.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let o=`Invalid target option given to ${a}.`;throw typeof e=="function"?o+=" 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.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,a;(t=(a=Io(this,xi))[xi])==null||t.call(a,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}const Md={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function xn(i){return[i]=i.split(";",1),Md[i]||null}var on={exports:{}};on.exports=Ws;on.exports.isMobile=Ws;on.exports.default=Ws;const Nd=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,Bd=/CrOS/,jd=/android|ipad|playbook|silk/i;function Ws(i){i||(i={});let e=i.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=Nd.test(e)&&!Bd.test(e)||!!i.tablet&&jd.test(e);return!t&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}var Ld=on.exports;const zd=tt(Ld);function $d(i,e,t){return new Promise(a=>{i.toBlob(a,e,t)})}function qd(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function ec(){return u("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},u("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}function Hd(i){let{onSnapshot:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0},ec())}function Vd(i){let{recording:e,onStartRecording:t,onStopRecording:a,i18n:n}=i;return e?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("stopRecording"),"aria-label":n("stopRecording"),onClick:a,"data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},u("rect",{x:"15",y:"15",width:"70",height:"70"}))):u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("startRecording"),"aria-label":n("startRecording"),onClick:t,"data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},u("circle",{cx:"50",cy:"50",r:"40"})))}function Wd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}function Gd(i){let{recordingLengthSeconds:e,i18n:t}=i;const a=Wd(e);return u("span",{"aria-label":t("recordingLength",{recording_length:a})},a)}function Kd(i){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:a}=i;return u("div",{className:"uppy-Webcam-videoSource"},u("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:n=>{a(n.target.value)}},t.map(n=>u("option",{key:n.deviceId,value:n.deviceId,selected:n.deviceId===e},n.label))))}function Xd(i){let{onSubmit:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},u("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},u("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}function Yd(i){let{onDiscard:e,i18n:t}=i;return u("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},u("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},u("g",{fill:"#FFF",fillRule:"evenodd"},u("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),u("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}function as(){return as=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},as.apply(this,arguments)}function xa(i,e){return i.includes(e)}class Qd extends ft{componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,recording:a,modes:n,supportsRecording:s,videoSources:o,showVideoSourceDropdown:r,showRecordingLength:l,onSubmit:c,i18n:d,mirror:p,onSnapshot:h,onStartRecording:b,onStopRecording:m,onDiscardRecordedVideo:P,recordingLengthSeconds:g}=this.props,y=!!t,F=!y&&s&&(xa(n,"video-only")||xa(n,"audio-only")||xa(n,"video-audio")),C=!y&&xa(n,"picture"),O=s&&l&&!y,A=r&&o&&o.length>1,v={playsInline:!0};return t?(v.muted=!1,v.controls=!0,v.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(v.muted=!0,v.autoPlay=!0,v.srcObject=e),u("div",{className:"uppy uppy-Webcam-container"},u("div",{className:"uppy-Webcam-videoContainer"},u("video",as({ref:S=>this.videoElement=S,className:`uppy-Webcam-video ${p?"uppy-Webcam-video--mirrored":""}`},v))),u("div",{className:"uppy-Webcam-footer"},u("div",{className:"uppy-Webcam-videoSourceContainer"},A?Kd(this.props):null),u("div",{className:"uppy-Webcam-buttonContainer"},C&&u(Hd,{onSnapshot:h,i18n:d}),F&&u(Vd,{recording:a,onStartRecording:b,onStopRecording:m,i18n:d}),y&&u(Xd,{onSubmit:c,i18n:d}),y&&u(Yd,{onDiscard:P,i18n:d})),u("div",{className:"uppy-Webcam-recordingLength"},O&&u(Gd,{recordingLengthSeconds:g,i18n:d}))))}}function Jd(i){let{icon:e,i18n:t,hasCamera:a}=i;return u("div",{className:"uppy-Webcam-permissons"},u("div",{className:"uppy-Webcam-permissonsIcon"},e()),u("h1",{className:"uppy-Webcam-title"},t(a?"allowAccessTitle":"noCameraTitle")),u("p",null,t(a?"allowAccessDescription":"noCameraDescription")))}const Zd={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function ns(){return ns=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},ns.apply(this,arguments)}function wi(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var eh=0;function th(i){return"__private_"+eh+++"_"+i}const ih={version:"3.4.1"};function Mo(i){return i[0]==="."?ts[i.slice(1)]:i}function ah(i){return/^video\/[^*]+$/.test(i)}function nh(i){return/^image\/[^*]+$/.test(i)}function sh(){return navigator.mediaDevices}function wn(i,e){return i.includes(e)}const oh={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:zd({tablet:!0})};var Be=th("enableMirror");class tc extends he{constructor(e,t){super(e,{...oh,...t}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),this.mediaDevices=sh(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})),this.defaultLocale=Zd,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),wi(this,Be)[Be]=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedVideo=this.discardRecordedVideo.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null})}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e==null?void 0:e.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(e=>e.some(t=>t.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(e){e===void 0&&(e=null);const t=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,a=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),n={...this.opts.videoConstraints||{facingMode:this.opts.facingMode},...e?{deviceId:e,facingMode:null}:{}};return{audio:t,video:a?n:!1}}start(e){var t;if(e===void 0&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(wi(this,Be)[Be]=!0);const a=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(n=>(this.setPluginState({hasCamera:n}),this.mediaDevices.getUserMedia(a).then(s=>{this.stream=s;let o=null;const r=this.isAudioOnly()?s.getAudioTracks():s.getVideoTracks();!e||!e.deviceId?o=r[0].getSettings().deviceId:r.forEach(l=>{l.getSettings().deviceId===e.deviceId&&(o=l.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:o,cameraReady:!0})}).catch(s=>{this.setPluginState({cameraReady:!1,cameraError:s}),this.uppy.info(s.message,"error")})))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let a=[];this.opts.preferredVideoMimeType?a=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(a=t.allowedFileTypes.map(Mo).filter(ah));const n=o=>MediaRecorder.isTypeSupported(o)&&xn(o),s=a.filter(n);s.length>0&&(e.mimeType=s[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);const{restrictions:a}=this.uppy.opts;if(this.recordingChunks.length>1&&a.maxFileSize!=null&&!e){const n=this.recordingChunks.reduce((l,c)=>l+c.size,0),o=(n-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,r=Math.max(0,a.maxFileSize-o);n>r&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const t=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(t=>{try{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),wi(this,Be)[Be]=!1}catch(a){a.isRestriction||this.uppy.log(a)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(wi(this,Be)[Be]=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach(a=>a.stop())}this.recorder&&await new Promise(e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((e,t)=>{let a=this.opts.countdown;const n=setInterval(()=>{if(!this.webcamActive)return clearInterval(n),this.captureInProgress=!1,t(new Error("Webcam is not active"));a?(this.uppy.info(`${a}...`,"warning",800),a--):(clearInterval(n),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}takeSnapshot(){this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(e=>{const t=typeof e=="object"?e.message:e;return this.uppy.info(t,"error",5e3),Promise.reject(new Error(`onBeforeSnapshot: ${t}`))}).then(()=>this.getImage()).then(e=>{this.captureInProgress=!1;try{this.uppy.addFile(e)}catch(t){t.isRestriction||this.uppy.log(t)}},e=>{throw this.captureInProgress=!1,e}))}getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,a=e.videoHeight,n=document.createElement("canvas");n.width=t,n.height=a,n.getContext("2d").drawImage(e,0,0);const{restrictions:o}=this.uppy.opts;let r=[];this.opts.preferredImageMimeType?r=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(r=o.allowedFileTypes.map(Mo).filter(nh));const l=r[0]||"image/jpeg",c=xn(l)||"jpg",d=`cam-${Date.now()}.${c}`;return $d(n,l).then(p=>({source:this.id,name:d,data:new Blob([p],{type:l}),type:l}))}getVideo(){const e=this.recordingChunks.find(o=>{var r;return((r=o.type)==null?void 0:r.length)>0}).type,t=xn(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const a=`webcam-${Date.now()}.${t}`,n=new Blob(this.recordingChunks,{type:e}),s={source:this.id,name:a,data:new Blob([n],{type:e}),type:e};return Promise.resolve(s)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(t=>t.kind==="videoinput")})})}render(){this.webcamActive||this.start();const e=this.getPluginState();return!e.cameraReady||!e.hasCamera?u(Jd,{icon:ec,i18n:this.i18n,hasCamera:e.hasCamera}):u(Qd,ns({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:qd(),recording:e.isRecording,mirror:wi(this,Be)[Be],src:this.stream}))}install(){const{mobileNativeCamera:e,modes:t,facingMode:a,videoConstraints:n}=this.opts,{target:s}=this.opts;if(e&&s){var o;(o=this.getTargetPlugin(s))==null||o.setOptions({showNativeVideoCameraButton:wn(t,"video-only")||wn(t,"video-audio"),showNativePhotoCameraButton:wn(t,"picture"),nativeCameraFacingMode:(n==null?void 0:n.facingMode)||a});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),s&&this.mount(s,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let r=!0;const{videoSources:l,currentDeviceId:c}=this.getPluginState();l.forEach(d=>{c===d.deviceId&&(r=!1)}),r&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}tc.VERSION=ih.version;class rh extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}const lh=Object.prototype.toString,ch=i=>lh.call(i)==="[object Error]",ph=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function uh(i){return i&&ch(i)&&i.name==="TypeError"&&typeof i.message=="string"?i.message==="Load failed"?i.stack===void 0:ph.has(i.message):!1}let ss=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};const No=(i,e,t)=>{const a=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=a,i};async function ic(i,e){return new Promise((t,a)=>{e={onFailedAttempt(){},retries:10,...e};const n=_u.operation(e),s=()=>{var r;n.stop(),a((r=e.signal)==null?void 0:r.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",s,{once:!0});const o=()=>{var r;(r=e.signal)==null||r.removeEventListener("abort",s),n.stop()};n.attempt(async r=>{try{const l=await i(r);o(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof ss)throw l.originalError;if(l instanceof TypeError&&!uh(l))throw l;if(await e.onFailedAttempt(No(l,r,e)),!n.retry(l))throw n.mainError()}catch(c){No(c,r,e),o(),a(c)}}})})}class ac extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}function dh(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new ac(i)})}function Na(i,e){return Object.prototype.hasOwnProperty.call(i,e)}class hh extends Error{constructor(e,t){super(e),this.cause=t==null?void 0:t.cause,this.cause&&Na(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function mh(i,e,t){const{progress:a,bytesUploaded:n,bytesTotal:s}=e;a&&(i.uppy.log(`Upload progress: ${a}`),i.uppy.emit("upload-progress",t,{uploader:i,bytesUploaded:n,bytesTotal:s}))}const fh=Rl(mh,300,{leading:!0,trailing:!0});function gh(i){var e;const a=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${a}`}class vh extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let nc;function st(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var bh=0;function rn(i){return"__private_"+bh+++"_"+i}const yh={version:"3.8.1"};function xh(i){return i.replace(/\/$/,"")}const sc=10,wh=5*60*1e3,Sh=401;class Ph extends Error{constructor(e){let{statusCode:t,message:a}=e;super(a),this.name="HttpError",this.statusCode=t}}async function Fh(i){if(i.status===Sh)throw new vh;if(i.ok)return i.json();let e=`Failed request with status: ${i.status}. ${i.statusText}`,t;try{t=await i.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(a){throw new Error(e,{cause:a})}throw i.status>=400&&i.status<=499&&t.message?new rh(t.message):new Ph({statusCode:i.status,message:e})}var ot=rn("companionHeaders"),Si=rn("getUrl"),Sn=rn("requestSocketToken"),Pi=rn("awaitRemoteFileUpload");nc=Symbol.for("uppy test: getCompanionHeaders");class Gs{constructor(e,t){Object.defineProperty(this,Pi,{value:_h}),Object.defineProperty(this,Si,{value:Ch}),Object.defineProperty(this,ot,{writable:!0,value:void 0}),Object.defineProperty(this,Sn,{writable:!0,value:async a=>{var n;let{file:s,postBody:o,signal:r}=a;if(((n=s.remote)==null?void 0:n.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(s.remote.url,{...s.remote.body,...o},{signal:r})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),st(this,ot)[ot]=t==null?void 0:t.companionHeaders}setCompanionHeaders(e){st(this,ot)[ot]=e}[nc](){return st(this,ot)[ot]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return xh(e&&e[t]?e[t]:t)}async headers(e){return e===void 0&&(e=!1),{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...st(this,ot)[ot]}}onReceiveResponse(e){const{headers:t}=e,n=this.uppy.getState().companion||{},s=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==n[s]&&this.uppy.setState({companion:{...n,[s]:t.get("i-am")}})}async request(e){let{path:t,method:a="GET",data:n,skipPostResponse:s,signal:o}=e;try{const r=await this.headers(!n),l=await dh(st(this,Si)[Si](t),{method:a,signal:o,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null});return s||this.onReceiveResponse(l),await Fh(l)}catch(r){throw r.isAuthError||r.name==="UserFacingApiError"||r.name==="AbortError"?r:new hh(`Could not ${a} ${st(this,Si)[Si](t)}`,{cause:r})}}async get(e,t){return typeof t=="boolean"&&(t={skipPostResponse:t}),this.request({...t,path:e})}async post(e,t,a){return typeof a=="boolean"&&(a={skipPostResponse:a}),this.request({...a,path:e,method:"POST",data:t})}async delete(e,t,a){return typeof a=="boolean"&&(a={skipPostResponse:a}),this.request({...a,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,a){var n=this;try{const{signal:s,getQueue:o}=a||{};return await ic(async()=>{var r;const l=(r=this.uppy.getFile(e.id))==null?void 0:r.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),st(this,Pi)[Pi]({file:e,queue:o(),signal:s});const d=await o().wrapPromiseFunction(async function(){try{return await st(n,Sn)[Sn](...arguments)}catch(p){if(p.isAuthError)throw new ss(p);if(p.cause==null)throw p;const h=p.cause,b=()=>[408,409,429,418,423].includes(h.statusCode)||h.statusCode>=500&&h.statusCode<=599&&![501,505].includes(h.statusCode);throw h.name==="HttpError"&&!b()?new ss(h):h}},{priority:-1})({file:e,postBody:t,signal:s}).abortOn(s);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:d}),st(this,Pi)[Pi]({file:this.uppy.getFile(e.id),queue:o(),signal:s})},{retries:sc,signal:s,onFailedAttempt:r=>this.uppy.log(`Retrying upload due to: ${r.message}`,"warning")})}catch(s){if(s.name==="AbortError")return;throw this.uppy.emit("upload-error",e,s),s}}}function Ch(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}async function _h(i){let{file:e,queue:t,signal:a}=i,n;const{capabilities:s}=this.uppy.getState();try{return await new Promise((o,r)=>{const l=e.serverToken,c=gh(e.remote.companionUrl);let d,p,h,{isPaused:b}=e;const m=(S,k)=>{if(d==null||d.readyState!==d.OPEN){var I;this.uppy.log(`Cannot send "${S}" to socket ${e.id} because the socket state was ${String((I=d)==null?void 0:I.readyState)}`,"warning");return}d.send(JSON.stringify({action:S,payload:k??{}}))};function P(){s.resumableUploads&&m(b?"pause":"resume")}const g=async()=>{p&&p.abort(),p=new AbortController;const S=I=>{var B;this.uppy.setFileState(e.id,{serverToken:null}),(B=p)==null||B.abort==null||B.abort(),r(I)};function k(){clearTimeout(h),!b&&(h=setTimeout(()=>S(new Error("Timeout waiting for message from Companion socket")),wh))}try{await t.wrapPromiseFunction(async()=>{await ic(async()=>new Promise((B,V)=>{d=new WebSocket(`${c}/api/${l}`),k(),d.addEventListener("close",()=>{d=void 0,V(new Error("Socket closed unexpectedly"))}),d.addEventListener("error",$=>{var z;this.uppy.log(`Companion socket error ${JSON.stringify($)}, closing socket`,"warning"),(z=d)==null||z.close()}),d.addEventListener("open",()=>{P()}),d.addEventListener("message",$=>{k();try{const{action:x,payload:_}=JSON.parse($.data);switch(x){case"progress":{fh(this,_,this.uppy.getFile(e.id));break}case"success":{var z,q,w,f;const T=(z=_.response)==null?void 0:z.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:_.url,status:(q=(w=_.response)==null?void 0:w.status)!=null?q:200,body:T?JSON.parse(T):void 0}),(f=p)==null||f.abort==null||f.abort(),o();break}case"error":{const{message:T}=_.error;throw Object.assign(new Error(T),{cause:_.error})}default:this.uppy.log(`Companion socket unknown action ${x}`,"warning")}}catch(x){S(x)}});const K=()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(h),d&&d.close(),d=void 0};p.signal.addEventListener("abort",()=>{K()})}),{retries:sc,signal:p.signal,onFailedAttempt:()=>{p.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`,"info")}})})().abortOn(p.signal)}catch(I){if(p.signal.aborted)return;S(I)}},y=S=>{if(s.resumableUploads)if(b=S,d&&P(),S){var k;(k=p)==null||k.abort==null||k.abort()}else g()},F=S=>{var k;s.individualCancellation&&S.id===e.id&&(m("cancel"),(k=p)==null||k.abort==null||k.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),o())},C=S=>{var k;let{reason:I}=S;I==="user"&&m("cancel"),(k=p)==null||k.abort==null||k.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),o()},O=(S,k)=>{S===e.id&&y(k)},A=()=>y(!0),v=()=>y(!1);this.uppy.on("file-removed",F),this.uppy.on("cancel-all",C),this.uppy.on("upload-pause",O),this.uppy.on("pause-all",A),this.uppy.on("resume-all",v),n=()=>{this.uppy.off("file-removed",F),this.uppy.off("cancel-all",C),this.uppy.off("upload-pause",O),this.uppy.off("pause-all",A),this.uppy.off("resume-all",v)},a.addEventListener("abort",()=>{var S;(S=p)==null||S.abort()}),g()})}finally{n==null||n()}}Gs.VERSION=yh.version;const kh=i=>i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");class Eh extends Gs{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||kh(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}}function Th(i,e){if(i){if(typeof i!="string"&&!Array.isArray(i)&&!(i instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp');return i}return/^(?!https?:\/\/).*$/i.test(e)?`https://${e.replace(/^\/\//,"")}`:new URL(e).origin}function Oh(i,e){return new Promise(t=>{localStorage.setItem(i,e),t()})}function Dh(i){return Promise.resolve(localStorage.getItem(i))}function Ah(i){return new Promise(e=>{localStorage.removeItem(i),e()})}const Uh=Object.freeze(Object.defineProperty({__proto__:null,getItem:Dh,removeItem:Ah,setItem:Oh},Symbol.toStringTag,{value:"Module"})),Ye=Array.from;function Bo(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Rh=0;function Ih(i){return"__private_"+Rh+++"_"+i}var Fi=Ih("handleSubmit");class Mh extends ft{constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,Fi,{writable:!0,value:t=>{t.preventDefault();const{addFile:a}=this.props,n=this.input.value.trim();a(n)}}),this.form.id=da()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",Bo(this,Fi)[Fi]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",Bo(this,Fi)[Fi]),document.body.removeChild(this.form)}render(){const{i18n:e}=this.props;return u("div",{className:"uppy-Url"},u("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":e("enterUrlToImport"),placeholder:e("enterUrlToImport"),ref:t=>{this.input=t},"data-uppy-super-focusable":!0,form:this.form.id}),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id},e("import")))}}function jo(i,e,t){const a=Ye(i.items);let n;switch(e){case"paste":{if(a.some(o=>o.kind==="file"))return;n=a.filter(o=>o.kind==="string"&&o.type==="text/plain");break}case"drop":{n=a.filter(s=>s.kind==="string"&&s.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}n.forEach(s=>{s.getAsString(o=>t(o))})}const Nh={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}};var oc;const Bh={version:"3.6.1"};function jh(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.637 15.312l-2.474 2.464a3.582 3.582 0 01-.577.491c-.907.657-1.897.986-2.968.986a4.925 4.925 0 01-3.959-1.971c-.248-.329-.164-.902.165-1.149.33-.247.907-.164 1.155.164 1.072 1.478 3.133 1.724 4.618.656a.642.642 0 00.33-.328l2.473-2.463c1.238-1.313 1.238-3.366-.082-4.597a3.348 3.348 0 00-4.618 0l-1.402 1.395a.799.799 0 01-1.154 0 .79.79 0 010-1.15l1.402-1.394a4.843 4.843 0 016.843 0c2.062 1.805 2.144 5.007.248 6.896zm-8.081 5.664l-1.402 1.395a3.348 3.348 0 01-4.618 0c-1.319-1.23-1.319-3.365-.082-4.596l2.475-2.464.328-.328c.743-.492 1.567-.739 2.475-.657.906.165 1.648.574 2.143 1.314.248.329.825.411 1.155.165.33-.248.412-.822.165-1.15-.825-1.068-1.98-1.724-3.216-1.888-1.238-.247-2.556.082-3.628.902l-.495.493-2.474 2.464c-1.897 1.969-1.814 5.09.083 6.977.99.904 2.226 1.396 3.463 1.396s2.473-.492 3.463-1.395l1.402-1.396a.79.79 0 000-1.15c-.33-.328-.908-.41-1.237-.082z",fill:"#FF753E","fill-rule":"nonzero"}))}function Lh(i){const e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}function zh(i){return Ye(i.dataTransfer.items).filter(a=>a.kind==="string"&&a.type==="text/uri-list").length>0}function $h(i){return(i==null?void 0:i.startsWith("http://"))||(i==null?void 0:i.startsWith("https://"))}function qh(i){const{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}let ha=class os extends he{constructor(e,t){if(super(e,t),this.getMeta=a=>this.client.post("url/meta",{url:a}).then(n=>{if(n.error)throw this.uppy.log("[URL] Error:"),this.uppy.log(n.error),new Error("Failed to fetch the file");return n}),this.addFile=async(a,n)=>{const s=Lh(a);if(!$h(s)){this.uppy.log(`[URL] Incorrect URL entered: ${s}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}try{const o=await this.getMeta(s),r={meta:n,source:this.id,name:o.name||qh(s),type:o.type,data:{size:o.size},isRemote:!0,body:{url:s},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:s,url:s},requestClientId:os.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(r)}catch(l){return l.isRestriction||this.uppy.log(l),l}}catch(o){return this.uppy.log(o),this.uppy.info({message:this.i18n("failedToFetch"),details:o},"error",4e3),o}},this.handleRootDrop=a=>{jo(a.dataTransfer,"drop",n=>{this.uppy.log(`[URL] Adding file from dropped url: ${n}`),this.addFile(n)})},this.handleRootPaste=a=>{jo(a.clipboardData,"paste",n=>{this.uppy.log(`[URL] Adding file from pasted url: ${n}`),this.addFile(n)})},this.id=this.opts.id||"Url",this.title=this.opts.title||"Link",this.type="acquirer",this.icon=()=>u(jh,null),this.defaultLocale=Nh,this.i18nInit(),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new Gs(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(os.requestClientId,this.client)}render(){return u(Mh,{i18n:this.i18n,addFile:this.addFile})}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};oc=ha;ha.VERSION=Bh.version;ha.requestClientId=oc.name;ha.prototype.canHandleRootDrop=zh;var rc={exports:{}};(function(i){var e=Object.prototype.hasOwnProperty,t="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(t=!1));function n(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function s(l,c,d,p,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var b=new n(d,p||l,h),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],b]:l._events[m].push(b):(l._events[m]=b,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new a:delete l._events[c]}function r(){this._events=new a,this._eventsCount=0}r.prototype.eventNames=function(){var c=[],d,p;if(this._eventsCount===0)return c;for(p in d=this._events)e.call(d,p)&&c.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},r.prototype.listeners=function(c){var d=t?t+c:c,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,b=p.length,m=new Array(b);h<b;h++)m[h]=p[h].fn;return m},r.prototype.listenerCount=function(c){var d=t?t+c:c,p=this._events[d];return p?p.fn?1:p.length:0},r.prototype.emit=function(c,d,p,h,b,m){var P=t?t+c:c;if(!this._events[P])return!1;var g=this._events[P],y=arguments.length,F,C;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,p),!0;case 4:return g.fn.call(g.context,d,p,h),!0;case 5:return g.fn.call(g.context,d,p,h,b),!0;case 6:return g.fn.call(g.context,d,p,h,b,m),!0}for(C=1,F=new Array(y-1);C<y;C++)F[C-1]=arguments[C];g.fn.apply(g.context,F)}else{var O=g.length,A;for(C=0;C<O;C++)switch(g[C].once&&this.removeListener(c,g[C].fn,void 0,!0),y){case 1:g[C].fn.call(g[C].context);break;case 2:g[C].fn.call(g[C].context,d);break;case 3:g[C].fn.call(g[C].context,d,p);break;case 4:g[C].fn.call(g[C].context,d,p,h);break;default:if(!F)for(A=1,F=new Array(y-1);A<y;A++)F[A-1]=arguments[A];g[C].fn.apply(g[C].context,F)}}return!0},r.prototype.on=function(c,d,p){return s(this,c,d,p,!1)},r.prototype.once=function(c,d,p){return s(this,c,d,p,!0)},r.prototype.removeListener=function(c,d,p,h){var b=t?t+c:c;if(!this._events[b])return this;if(!d)return o(this,b),this;var m=this._events[b];if(m.fn)m.fn===d&&(!h||m.once)&&(!p||m.context===p)&&o(this,b);else{for(var P=0,g=[],y=m.length;P<y;P++)(m[P].fn!==d||h&&!m[P].once||p&&m[P].context!==p)&&g.push(m[P]);g.length?this._events[b]=g.length===1?g[0]:g:o(this,b)}return this},r.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&o(this,d)):(this._events=new a,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=t,r.EventEmitter=r,i.exports=r})(rc);var Hh=rc.exports;const Vh=tt(Hh);function Wh(i,e,t){let a=0,n=i.length;for(;n>0;){const s=Math.trunc(n/2);let o=a+s;t(i[o],e)<=0?(a=++o,n-=s+1):n=s}return a}var _t=function(i,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(i):a?a.value:e.get(i)},ut;class Gh{constructor(){ut.set(this,[])}enqueue(e,t){t={priority:0,...t};const a={priority:t.priority,run:e};if(this.size&&_t(this,ut,"f")[this.size-1].priority>=t.priority){_t(this,ut,"f").push(a);return}const n=Wh(_t(this,ut,"f"),a,(s,o)=>o.priority-s.priority);_t(this,ut,"f").splice(n,0,a)}dequeue(){const e=_t(this,ut,"f").shift();return e==null?void 0:e.run}filter(e){return _t(this,ut,"f").filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return _t(this,ut,"f").length}}ut=new WeakMap;var J=function(i,e,t,a,n){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},R=function(i,e,t,a){if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!a:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?a:t==="a"?a.call(i):a?a.value:e.get(i)},te,$i,qi,yt,Ka,Hi,Ba,ze,Ni,Te,ja,De,Vi,bt,La,Lo,zo,lc,$o,qo,za,Pn,Fn,Xa,cc,$a;class pc extends Error{}class Kh extends Vh{constructor(e){var t,a,n,s;if(super(),te.add(this),$i.set(this,void 0),qi.set(this,void 0),yt.set(this,0),Ka.set(this,void 0),Hi.set(this,void 0),Ba.set(this,0),ze.set(this,void 0),Ni.set(this,void 0),Te.set(this,void 0),ja.set(this,void 0),De.set(this,0),Vi.set(this,void 0),bt.set(this,void 0),La.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Gh,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(a=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&a!==void 0?a:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(s=(n=e.interval)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""}\` (${typeof e.interval})`);J(this,$i,e.carryoverConcurrencyCount,"f"),J(this,qi,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),J(this,Ka,e.intervalCap,"f"),J(this,Hi,e.interval,"f"),J(this,Te,new e.queueClass,"f"),J(this,ja,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,J(this,La,e.throwOnTimeout===!0,"f"),J(this,bt,e.autoStart===!1,"f")}get concurrency(){return R(this,Vi,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);J(this,Vi,e,"f"),R(this,te,"m",Xa).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:R(this,La,"f"),...t},new Promise((a,n)=>{R(this,Te,"f").enqueue(async()=>{var s,o,r;J(this,De,(o=R(this,De,"f"),o++,o),"f"),J(this,yt,(r=R(this,yt,"f"),r++,r),"f");try{if(!((s=t.signal)===null||s===void 0)&&s.aborted)throw new pc("The task was aborted.");let l=e({signal:t.signal});t.timeout&&(l=du(Promise.resolve(l),t.timeout)),t.signal&&(l=Promise.race([l,R(this,te,"m",cc).call(this,t.signal)]));const c=await l;a(c),this.emit("completed",c)}catch(l){if(l instanceof hu&&!t.throwOnTimeout){a();return}n(l),this.emit("error",l)}finally{R(this,te,"m",lc).call(this)}},t),this.emit("add"),R(this,te,"m",za).call(this)})}async addAll(e,t){return Promise.all(e.map(async a=>this.add(a,t)))}start(){return R(this,bt,"f")?(J(this,bt,!1,"f"),R(this,te,"m",Xa).call(this),this):this}pause(){J(this,bt,!0,"f")}clear(){J(this,Te,new(R(this,ja,"f")),"f")}async onEmpty(){R(this,Te,"f").size!==0&&await R(this,te,"m",$a).call(this,"empty")}async onSizeLessThan(e){R(this,Te,"f").size<e||await R(this,te,"m",$a).call(this,"next",()=>R(this,Te,"f").size<e)}async onIdle(){R(this,De,"f")===0&&R(this,Te,"f").size===0||await R(this,te,"m",$a).call(this,"idle")}get size(){return R(this,Te,"f").size}sizeBy(e){return R(this,Te,"f").filter(e).length}get pending(){return R(this,De,"f")}get isPaused(){return R(this,bt,"f")}}$i=new WeakMap,qi=new WeakMap,yt=new WeakMap,Ka=new WeakMap,Hi=new WeakMap,Ba=new WeakMap,ze=new WeakMap,Ni=new WeakMap,Te=new WeakMap,ja=new WeakMap,De=new WeakMap,Vi=new WeakMap,bt=new WeakMap,La=new WeakMap,te=new WeakSet,Lo=function(){return R(this,qi,"f")||R(this,yt,"f")<R(this,Ka,"f")},zo=function(){return R(this,De,"f")<R(this,Vi,"f")},lc=function(){var e;J(this,De,(e=R(this,De,"f"),e--,e),"f"),R(this,te,"m",za).call(this),this.emit("next")},$o=function(){R(this,te,"m",Fn).call(this),R(this,te,"m",Pn).call(this),J(this,Ni,void 0,"f")},qo=function(){const e=Date.now();if(R(this,ze,"f")===void 0){const t=R(this,Ba,"f")-e;if(t<0)J(this,yt,R(this,$i,"f")?R(this,De,"f"):0,"f");else return R(this,Ni,"f")===void 0&&J(this,Ni,setTimeout(()=>{R(this,te,"m",$o).call(this)},t),"f"),!0}return!1},za=function(){if(R(this,Te,"f").size===0)return R(this,ze,"f")&&clearInterval(R(this,ze,"f")),J(this,ze,void 0,"f"),this.emit("empty"),R(this,De,"f")===0&&this.emit("idle"),!1;if(!R(this,bt,"f")){const e=!R(this,te,"a",qo);if(R(this,te,"a",Lo)&&R(this,te,"a",zo)){const t=R(this,Te,"f").dequeue();return t?(this.emit("active"),t(),e&&R(this,te,"m",Pn).call(this),!0):!1}}return!1},Pn=function(){R(this,qi,"f")||R(this,ze,"f")!==void 0||(J(this,ze,setInterval(()=>{R(this,te,"m",Fn).call(this)},R(this,Hi,"f")),"f"),J(this,Ba,Date.now()+R(this,Hi,"f"),"f"))},Fn=function(){R(this,yt,"f")===0&&R(this,De,"f")===0&&R(this,ze,"f")&&(clearInterval(R(this,ze,"f")),J(this,ze,void 0,"f")),J(this,yt,R(this,$i,"f")?R(this,De,"f"):0,"f"),R(this,te,"m",Xa).call(this)},Xa=function(){for(;R(this,te,"m",za).call(this););},cc=async function(e){return new Promise((t,a)=>{e.addEventListener("abort",()=>{a(new pc("The task was aborted."))},{once:!0})})},$a=async function(e,t){return new Promise(a=>{const n=()=>{t&&!t()||(this.off(e,n),a())};this.on(e,n)})};var Zi,ie,Cn,Ho,ea=0,uc=[],qa=[],se=es,Vo=se.__b,Wo=se.__r,Go=se.diffed,Ko=se.__c,Xo=se.unmount,Yo=se.__;function Ks(i,e){se.__h&&se.__h(ie,i,ea||e),ea=0;var t=ie.__H||(ie.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:qa}),t.__[i]}function ni(i){return ea=1,Xh(hc,i)}function Xh(i,e,t){var a=Ks(Zi++,2);if(a.t=i,!a.__c&&(a.__=[t?t(e):hc(void 0,e),function(r){var l=a.__N?a.__N[0]:a.__[0],c=a.t(l,r);l!==c&&(a.__N=[c,a.__[1]],a.__c.setState({}))}],a.__c=ie,!ie.u)){var n=function(r,l,c){if(!a.__c.__H)return!0;var d=a.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!s||s.call(this,r,l,c);var p=!1;return d.forEach(function(h){if(h.__N){var b=h.__[0];h.__=h.__N,h.__N=void 0,b!==h.__[0]&&(p=!0)}}),!(!p&&a.__c.props===r)&&(!s||s.call(this,r,l,c))};ie.u=!0;var s=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.componentWillUpdate=function(r,l,c){if(this.__e){var d=s;s=void 0,n(r,l,c),s=d}o&&o.call(this,r,l,c)},ie.shouldComponentUpdate=n}return a.__N||a.__}function Ya(i,e){var t=Ks(Zi++,3);!se.__s&&dc(t.__H,e)&&(t.__=i,t.i=e,ie.__H.__h.push(t))}function _n(i){return ea=5,ln(function(){return{current:i}},[])}function ln(i,e){var t=Ks(Zi++,7);return dc(t.__H,e)?(t.__V=i(),t.i=e,t.__h=i,t.__V):t.__}function Qa(i,e){return ea=8,ln(function(){return i},e)}function Yh(){for(var i;i=uc.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ha),i.__H.__h.forEach(rs),i.__H.__h=[]}catch(e){i.__H.__h=[],se.__e(e,i.__v)}}se.__b=function(i){ie=null,Vo&&Vo(i)},se.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Yo&&Yo(i,e)},se.__r=function(i){Wo&&Wo(i),Zi=0;var e=(ie=i.__c).__H;e&&(Cn===ie?(e.__h=[],ie.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=qa,t.__N=t.i=void 0})):(e.__h.forEach(Ha),e.__h.forEach(rs),e.__h=[],Zi=0)),Cn=ie},se.diffed=function(i){Go&&Go(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(uc.push(e)!==1&&Ho===se.requestAnimationFrame||((Ho=se.requestAnimationFrame)||Qh)(Yh)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==qa&&(t.__=t.__V),t.i=void 0,t.__V=qa})),Cn=ie=null},se.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ha),t.__h=t.__h.filter(function(a){return!a.__||rs(a)})}catch(a){e.some(function(n){n.__h&&(n.__h=[])}),e=[],se.__e(a,t.__v)}}),Ko&&Ko(i,e)},se.unmount=function(i){Xo&&Xo(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(a){try{Ha(a)}catch(n){e=n}}),t.__H=void 0,e&&se.__e(e,t.__v))};var Qo=typeof requestAnimationFrame=="function";function Qh(i){var e,t=function(){clearTimeout(a),Qo&&cancelAnimationFrame(e),setTimeout(i)},a=setTimeout(t,100);Qo&&(e=requestAnimationFrame(t))}function Ha(i){var e=ie,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ie=e}function rs(i){var e=ie;i.__c=i.__(),ie=e}function dc(i,e){return!i||i.length!==e.length||e.some(function(t,a){return t!==i[a]})}function hc(i,e){return typeof e=="function"?e(i):e}function Jh(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function Zh(i){let{pluginName:e,i18n:t,onAuth:a}=i;const n=e==="Google Drive",s=Qa(o=>{o.preventDefault(),a()},[a]);return u("form",{onSubmit:s},n?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(Jh,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}const em=i=>{let{pluginName:e,i18n:t,onAuth:a}=i;return u(Zh,{pluginName:e,i18n:t,onAuth:a})};function tm(i){const{loading:e,pluginName:t,pluginIcon:a,i18n:n,handleAuth:s,renderForm:o=em}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},a()),u("div",{className:"uppy-Provider-authTitle"},n("authenticateWithTitle",{pluginName:t})),u("div",{className:"uppy-Provider-authForm"},o({pluginName:t,i18n:n,loading:e,onAuth:s})))}function im(i){let{i18n:e,logout:t,username:a}=i;return u(Ft,null,u("span",{className:"uppy-ProviderBrowser-user",key:"username"},a),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}const am=i=>{const{getFolder:e,title:t,isLast:a}=i;return u(Ft,null,u("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:e},t),a?"":" / ")};function nm(i){const{getFolder:e,title:t,breadcrumbsIcon:a,breadcrumbs:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},a),n.map((s,o)=>u(am,{key:s.id,getFolder:()=>e(s.requestPath,s.name),title:o===0?t:s.name,isLast:o+1===n.length})))}function sm(i){return u(Ft,null,i.showBreadcrumbs&&u(nm,{getFolder:i.getFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title}),u(im,{logout:i.logout,username:i.username,i18n:i.i18n}))}function mc(i){return{...i,type:i.mimeType,extension:i.name?qs(i.name).extension:null}}function ls(){return ls=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},ls.apply(this,arguments)}const om={position:"relative",width:"100%",minHeight:"100%"},rm={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class fc extends ft{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:a,renderRow:n,overscanCount:s=10,...o}=e;const{offset:r,height:l}=this.state;let c=Math.floor(r/a),d=Math.floor(l/a);s&&(c=Math.max(0,c-c%s),d+=s);const p=c+d+4,h=t.slice(c,p),b={...om,height:t.length*a},m={...rm,top:c*a};return u("div",ls({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:b},u("div",{role:"presentation",style:m},h.map(n))))}}function gc(i){const{search:e,searchOnInput:t,searchTerm:a,showButton:n,inputLabel:s,clearSearchLabel:o,buttonLabel:r,clearSearch:l,inputClassName:c,buttonCSSClassName:d}=i,[p,h]=ni(a??""),b=Qa(y=>{y.preventDefault(),e(p)},[e,p]),m=Qa(y=>{const F=y.target.value;h(F),t&&e(F)},[h,t,e]),P=()=>{h(""),l&&l()},[g]=ni(()=>{const y=document.createElement("form");return y.setAttribute("tabindex","-1"),y.id=da(),y});return Ya(()=>(document.body.appendChild(g),g.addEventListener("submit",b),()=>{g.removeEventListener("submit",b),document.body.removeChild(g)}),[g,b]),u(Ft,null,u("input",{className:`uppy-u-reset ${c}`,type:"search","aria-label":s,placeholder:s,value:p,onInput:m,form:g.id,"data-uppy-super-focusable":!0}),!n&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!n&&p&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":o,title:o,onClick:P},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),n&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:g.id},r))}function lm(i){let{cancel:e,done:t,i18n:a,selected:n}=i;return u("div",{className:"uppy-ProviderBrowser-footer"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:t,type:"button"},a("selectX",{smart_count:n})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},a("cancel")))}function cm(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function pm(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function um(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function dm(i){const{itemIconString:e}=i;if(e===null)return null;switch(e){case"file":return u(cm,null);case"folder":return u(pm,null);case"video":return u(um,null);default:{const{alt:t}=i;return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}function Jo(i){const{className:e,isDisabled:t,restrictionError:a,isChecked:n,title:s,itemIconEl:o,showTitles:r,toggleCheckbox:l,recordShiftKeyPress:c,id:d,children:p}=i,h=Se("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":n});return u("li",{className:e,title:t?a==null?void 0:a.message:void 0},u("input",{type:"checkbox",className:h,onChange:l,onKeyDown:c,onMouseDown:c,name:"listitem",id:d,checked:n,disabled:t,"data-uppy-super-focusable":!0}),u("label",{htmlFor:d,"aria-label":s,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},o,r&&s,p))}function hm(i){const{className:e,isDisabled:t,restrictionError:a,isCheckboxDisabled:n,isChecked:s,toggleCheckbox:o,recordShiftKeyPress:r,type:l,id:c,itemIconEl:d,title:p,handleFolderClick:h,showTitles:b,i18n:m}=i;return u("li",{className:e,title:t?a==null?void 0:a.message:void 0},n?null:u("input",{type:"checkbox",className:`uppy-u-reset uppy-ProviderBrowserItem-checkbox ${s?"uppy-ProviderBrowserItem-checkbox--is-checked":""}`,onChange:o,onKeyDown:r,onMouseDown:r,name:"listitem",id:c,checked:s,"aria-label":l==="file"?null:m("allFilesFromFolderNamed",{name:p}),disabled:t,"data-uppy-super-focusable":!0}),l==="file"?u("label",{htmlFor:c,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),b&&p):u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:h,"aria-label":m("openFolderNamed",{name:p})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),b&&u("span",null,p)))}function Wi(){return Wi=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},Wi.apply(this,arguments)}function Zo(i){const{author:e,getItemIcon:t,isChecked:a,isDisabled:n,viewType:s}=i,o=t(),r=Se("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":a},{"uppy-ProviderBrowserItem--disabled":n},{"uppy-ProviderBrowserItem--noPreview":o==="video"}),l=u(dm,{itemIconString:o});switch(s){case"grid":return u(Jo,Wi({},i,{className:r,itemIconEl:l}));case"list":return u(hm,Wi({},i,{className:r,itemIconEl:l}));case"unsplash":return u(Jo,Wi({},i,{className:r,itemIconEl:l}),u("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},e.name));default:throw new Error(`There is no such type ${s}`)}}const mm="shared-with-me";function er(i){const{currentSelection:e,uppyFiles:t,viewType:a,isChecked:n,toggleCheckbox:s,recordShiftKeyPress:o,showTitles:r,i18n:l,validateRestrictions:c,getNextFolder:d,f:p}=i;if(p.isFolder)return Zo({showTitles:r,viewType:a,i18n:l,id:p.id,title:p.name,getItemIcon:()=>p.icon,isChecked:n(p),toggleCheckbox:b=>s(b,p),recordShiftKeyPress:o,type:"folder",isDisabled:!1,isCheckboxDisabled:p.id===mm,handleFolderClick:()=>d(p)});const h=c(mc(p),[...t,...e]);return Zo({id:p.id,title:p.name,author:p.author,getItemIcon:()=>p.icon,isChecked:n(p),toggleCheckbox:b=>s(b,p),isCheckboxDisabled:!1,recordShiftKeyPress:o,showTitles:r,viewType:a,i18n:l,type:"file",isDisabled:!!h&&!n(p),restrictionError:h})}function vc(i){const{currentSelection:e,folders:t,files:a,uppyFiles:n,viewType:s,headerComponent:o,showBreadcrumbs:r,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,handleScroll:p,showTitles:h,i18n:b,validateRestrictions:m,isLoading:P,showSearchFilter:g,search:y,searchTerm:F,clearSearch:C,searchOnInput:O,searchInputLabel:A,clearSearchLabel:v,getNextFolder:S,cancel:k,done:I,noResultsLabel:B,loadAllFiles:V}=i,K=e.length,$=ln(()=>[...t,...a],[t,a]);return u("div",{className:Se("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s}`)},o&&u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:Se("uppy-ProviderBrowser-headerBar",!r&&"uppy-ProviderBrowser-headerBar--simple")},o)),g&&u("div",{class:"uppy-ProviderBrowser-searchFilter"},u(gc,{search:y,searchTerm:F,clearSearch:C,inputLabel:A,clearSearchLabel:v,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:O})),P?u("div",{className:"uppy-Provider-loading"},u("span",null,typeof P=="string"?P:b("loading"))):!t.length&&!a.length?u("div",{className:"uppy-Provider-empty"},B):V?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(fc,{data:$,renderRow:z=>u(er,{currentSelection:e,uppyFiles:n,viewType:s,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,showTitles:h,i18n:b,validateRestrictions:m,getNextFolder:S,f:z}),rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:p,role:"listbox",tabIndex:-1},$.map(z=>u(er,{currentSelection:e,uppyFiles:n,viewType:s,isChecked:l,toggleCheckbox:c,recordShiftKeyPress:d,showTitles:h,i18n:b,validateRestrictions:m,getNextFolder:S,f:z})))),K>0&&u(lm,{selected:K,done:I,cancel:k,i18n:b}))}class Ja extends ft{componentWillUnmount(){const{onUnmount:e}=this.props;e()}render(){const{children:e}=this.props;return vt(e)[0]}}function cs(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}class bc{constructor(e,t){this.filterItems=a=>{const n=this.plugin.getPluginState();return!n.filterInput||n.filterInput===""?a:a.filter(s=>s.name.toLowerCase().indexOf(n.filterInput.toLowerCase())!==-1)},this.recordShiftKeyPress=a=>{this.isShiftKeyPressed=a.shiftKey},this.isChecked=a=>{const{currentSelection:n}=this.plugin.getPluginState();return n.some(s=>s.id===a.id)},this.plugin=e,this.provider=t.provider,this.opts=t,this.isHandlingScroll=!1,this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.clearSelection=this.clearSelection.bind(this),this.cancelPicking=this.cancelPicking.bind(this)}preFirstRender(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()}shouldHandleScroll(e){const{scrollHeight:t,scrollTop:a,offsetHeight:n}=e.target;return t-(a+n)<50&&!this.isHandlingScroll}clearSelection(){this.plugin.setPluginState({currentSelection:[],filterInput:""})}cancelPicking(){this.clearSelection();const e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()}handleError(e){var t;const{uppy:a}=this.plugin,n=a.i18n("companionError");a.log(e.toString()),!(e.isAuthError||((t=e.cause)==null?void 0:t.name)==="AbortError")&&a.info({message:n,details:e.toString()},"error",5e3)}registerRequestClient(){this.requestClientId=this.provider.provider,this.plugin.uppy.registerRequestClient(this.requestClientId,this.provider)}getTagFile(e){const t={id:e.id,source:this.plugin.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,meta:{},body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:`${this.provider.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:this.provider.name,provider:this.provider.provider,requestClientId:this.requestClientId}},a=Hs(t);return a&&cs(a)&&(t.preview=e.thumbnail),e.author&&(e.author.name!=null&&(t.meta.authorName=String(e.author.name)),e.author.url&&(t.meta.authorUrl=e.author.url)),e.relDirPath!=null&&(t.meta.relativePath=e.relDirPath?`${e.relDirPath}/${t.name}`:null),e.absDirPath!=null&&(t.meta.absolutePath=e.absDirPath?`/${e.absDirPath}/${t.name}`:`/${t.name}`),t}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();const{folders:a,files:n}=this.plugin.getPluginState(),s=this.filterItems(a.concat(n));if(this.lastCheckbox&&this.isShiftKeyPressed){const{currentSelection:r}=this.plugin.getPluginState(),l=s.indexOf(this.lastCheckbox),c=s.indexOf(t),d=l<c?s.slice(l,c+1):s.slice(c,l+1),p=[];for(const h of d){const{uppy:b}=this.plugin,m=b.validateRestrictions(mc(h),[...b.getFiles(),...p]);m?b.info({message:m.message},"error",b.opts.infoTimeout):p.push(h)}this.plugin.setPluginState({currentSelection:[...new Set([...r,...p])]});return}this.lastCheckbox=t;const{currentSelection:o}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:o.filter(r=>r.id!==t.id)}):this.plugin.setPluginState({currentSelection:o.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}}function Fe(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var fm=0;function ma(i){return"__private_"+fm+++"_"+i}const gm={version:"3.12.0"};function vm(i){return i.slice(1).map(e=>e.name).join("/")}function ps(i,e){return i?`${i}/${e}`:e}function yc(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}const bm={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1};var It=ma("abortController"),je=ma("withAbort"),ta=ma("list"),Ci=ma("listFilesAndFolders"),Gi=ma("recursivelyListAllFiles");class Xs extends bc{constructor(e,t){super(e,{...bm,...t}),Object.defineProperty(this,Gi,{value:Sm}),Object.defineProperty(this,Ci,{value:wm}),Object.defineProperty(this,ta,{value:xm}),Object.defineProperty(this,je,{value:ym}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.filterQuery=this.filterQuery.bind(this),this.clearFilter=this.clearFilter.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState({authenticated:void 0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[]}),this.registerRequestClient()}tearDown(){}async getFolder(e,t){this.setLoading(!0);try{await Fe(this,je)[je](async a=>{this.lastCheckbox=void 0;let{breadcrumbs:n}=this.plugin.getPluginState();const s=n.findIndex(l=>e===l.requestPath);s!==-1?n=n.slice(0,s+1):n=[...n,{requestPath:e,name:t}],this.nextPagePath=e;let o=[],r=[];do{const{files:l,folders:c}=await Fe(this,Ci)[Ci]({breadcrumbs:n,signal:a});o=o.concat(l),r=r.concat(c),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length+r.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:r,files:o,breadcrumbs:n,filterInput:""})})}catch(a){if((a==null?void 0:a.name)==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(a.message)},"warning",5e3);return}this.handleError(a)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await Fe(this,je)[je](async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}const a={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(a)}})}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await Fe(this,je)[je](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),this.preFirstRender()})}catch(t){if(t.name==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(t.message)},"warning",5e3);return}this.plugin.uppy.log(`login failed: ${t.message}`)}finally{this.setLoading(!1)}}async handleScroll(e){if(this.shouldHandleScroll(e)&&this.nextPagePath){this.isHandlingScroll=!0;try{await Fe(this,je)[je](async t=>{const{files:a,folders:n,breadcrumbs:s}=this.plugin.getPluginState(),{files:o,folders:r}=await Fe(this,Ci)[Ci]({breadcrumbs:s,signal:t}),l=a.concat(o),c=n.concat(r);this.plugin.setPluginState({folders:c,files:l})})}catch(t){this.handleError(t)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await Fe(this,je)[je](async e=>{const{currentSelection:t}=this.plugin.getPluginState(),a=[],n=[];for(const s of t){const{requestPath:o}=s,r=l=>({...l,relDirPath:l.absDirPath.replace(s.absDirPath,"").replace(/^\//,"")});if(s.isFolder){let l=!0,c=0;const d=new Kh({concurrency:6}),p=b=>{for(const m of b){const P=this.getTagFile(m),g=Vl(P,this.plugin.uppy.getID());this.plugin.uppy.checkIfFileAlreadyExists(g)||(n.push(r(m)),c++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:c}))),l=!1}};await Fe(this,Gi)[Gi]({requestPath:o,absDirPath:ps(s.absDirPath,s.name),relDirPath:s.name,queue:d,onFiles:p,signal:e}),await d.onIdle();let h;l?h=this.plugin.uppy.i18n("emptyFolderAdded"):c===0?h=this.plugin.uppy.i18n("folderAlreadyAdded",{folder:s.name}):h=this.plugin.uppy.i18n("folderAdded",{smart_count:c,folder:s.name}),a.push(h)}else n.push(r(s))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(n.map(s=>this.getTagFile(s,this.requestClientId))),this.plugin.setPluginState({filterInput:""}),a.forEach(s=>this.plugin.uppy.info(s)),this.clearSelection()})}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var a=this;t===void 0&&(t={});const{authenticated:n,didFirstRender:s}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;s||this.preFirstRender();const r={...this.opts,...t},{files:l,folders:c,filterInput:d,loading:p,currentSelection:h}=this.plugin.getPluginState(),{isChecked:b,recordShiftKeyPress:m,filterItems:P}=this,g=d!=="",y=this.plugin.icon||yc,F={showBreadcrumbs:r.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:y,title:this.plugin.title,logout:this.logout,username:this.username,i18n:o},C={isChecked:b,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:m,currentSelection:h,files:g?P(l):l,folders:g?P(c):c,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,showSearchFilter:r.showFilter,search:this.filterQuery,clearSearch:this.clearFilter,searchTerm:d,searchOnInput:!0,searchInputLabel:o("filter"),clearSearchLabel:o("resetFilter"),noResultsLabel:o("noFilesFound"),logout:this.logout,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:u(sm,F),title:this.plugin.title,viewType:r.viewType,showTitles:r.showTitles,showBreadcrumbs:r.showBreadcrumbs,pluginIcon:y,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return a.plugin.uppy.validateRestrictions(...arguments)},isLoading:p};return n===!1?u(Ja,{onUnmount:this.clearSelection},u(tm,{pluginName:this.plugin.title,pluginIcon:y,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:p})):u(Ja,{onUnmount:this.clearSelection},u(vc,C))}}async function ym(i){var e;(e=Fe(this,It)[It])==null||e.abort();const t=new AbortController;Fe(this,It)[It]=t;const a=()=>{t.abort(),this.clearSelection()};try{this.plugin.uppy.on("dashboard:close-panel",a),this.plugin.uppy.on("cancel-all",a),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",a),this.plugin.uppy.off("cancel-all",a),Fe(this,It)[It]=void 0}}async function xm(i){let{requestPath:e,absDirPath:t,signal:a}=i;const{username:n,nextPagePath:s,items:o}=await this.provider.list(e,{signal:a});return this.username=n||this.username,{items:o.map(r=>({...r,absDirPath:t})),nextPagePath:s}}async function wm(i){let{breadcrumbs:e,signal:t}=i;const a=vm(e),{items:n,nextPagePath:s}=await Fe(this,ta)[ta]({requestPath:this.nextPagePath,absDirPath:a,signal:t});this.nextPagePath=s;const o=[],r=[];return n.forEach(l=>{l.isFolder?r.push(l):o.push(l)}),{files:o,folders:r}}async function Sm(i){let{requestPath:e,absDirPath:t,relDirPath:a,queue:n,onFiles:s,signal:o}=i,r=e;for(;r;){const l=await Fe(this,ta)[ta]({requestPath:r,absDirPath:t,signal:o});r=l.nextPagePath;const c=l.items.filter(h=>!h.isFolder),d=l.items.filter(h=>h.isFolder);s(c);const p=d.map(async h=>n.add(async()=>Fe(this,Gi)[Gi]({requestPath:h.requestPath,absDirPath:ps(t,h.name),relDirPath:ps(a,h.name),queue:n,onFiles:s,signal:o})));await Promise.all(p)}}Xs.VERSION=gm.version;function tr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Pm=0;function Fm(i){return"__private_"+Pm+++"_"+i}const Cm={version:"3.12.0"},ir={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},_m={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0};var _i=Fm("updateFilesAndInputMode");class xc extends bc{constructor(e,t){super(e,{..._m,...t}),Object.defineProperty(this,_i,{value:km}),this.nextPageQuery=null,this.search=this.search.bind(this),this.clearSearch=this.clearSearch.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState(ir),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(ir)}async search(e){const{searchTerm:t}=this.plugin.getPluginState();if(!(e&&e===t)){this.setLoading(!0);try{const a=await this.provider.search(e);tr(this,_i)[_i](a,[])}catch(a){this.handleError(a)}finally{this.setLoading(!1)}}}clearSearch(){this.plugin.setPluginState({currentSelection:[],files:[],searchTerm:null})}async handleScroll(e){const t=this.nextPageQuery||null;if(this.shouldHandleScroll(e)&&t){this.isHandlingScroll=!0;try{const{files:a,searchTerm:n}=this.plugin.getPluginState(),s=await this.provider.search(n,t);tr(this,_i)[_i](s,a)}catch(a){this.handleError(a)}finally{this.isHandlingScroll=!1}}}donePicking(){const{currentSelection:e}=this.plugin.getPluginState();this.plugin.uppy.log("Adding remote search provider files"),this.plugin.uppy.addFiles(e.map(t=>this.getTagFile(t))),this.resetPluginState()}render(e,t){var a=this;t===void 0&&(t={});const{didFirstRender:n,isInputMode:s,searchTerm:o}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||this.preFirstRender();const l={...this.opts,...t},{files:c,folders:d,filterInput:p,loading:h,currentSelection:b}=this.plugin.getPluginState(),{isChecked:m,filterItems:P,recordShiftKeyPress:g}=this,y=p!=="",F={isChecked:m,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:g,currentSelection:b,files:y?P(c):c,folders:y?P(d):d,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:l.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:o,searchOnInput:!1,searchInputLabel:r("search"),clearSearchLabel:r("resetSearch"),noResultsLabel:r("noSearchResults"),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showFilter:l.showFilter,isLoading:h,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:r,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return a.plugin.uppy.validateRestrictions(...arguments)}};return s?u(Ja,{onUnmount:this.resetPluginState},u("div",{className:"uppy-SearchProvider"},u(gc,{search:this.search,inputLabel:r("enterTextToSearch"),buttonLabel:r("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):u(Ja,{onUnmount:this.resetPluginState},u(vc,F))}}function km(i,e){this.nextPageQuery=i.nextPageQuery,i.items.forEach(t=>{e.push(t)}),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:e,searchTerm:i.searchedFor})}xc.VERSION=Cm.version;const Em={version:"3.3.1"};class wc extends he{constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Uh,this.id=this.opts.id||"Unsplash",this.title=this.opts.title||"Unsplash",this.icon=()=>u("svg",{className:"uppy-DashboardTab-iconUnsplash",viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},u("g",{fill:"currentcolor"},u("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z"}),u("path",{d:"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z"}))),!this.opts.companionUrl)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.hostname=this.opts.companionUrl,this.opts.companionAllowedHosts=Th(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Eh(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule,provider:"unsplash",pluginId:this.id})}install(){this.view=new xc(this,{provider:this.provider,viewType:"unsplash",showFilter:!0});const{target:e}=this.opts;e&&this.mount(e,this)}async onFirstRender(){}render(e){return this.view.render(e)}uninstall(){this.unmount()}}wc.VERSION=Em.version;function ar(i,e,t,a){return t===0||i===e?i:a===0?e:i+(e-i)*2**(-a/t)}const Xe={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};function kn(i){const e=[];let t="indeterminate",a;for(const{progress:s}of Object.values(i)){const{preprocess:o,postprocess:r}=s;a==null&&(o||r)&&({mode:t,message:a}=o||r),(o==null?void 0:o.mode)==="determinate"&&e.push(o.value),(r==null?void 0:r.mode)==="determinate"&&e.push(r.value)}const n=e.reduce((s,o)=>s+o/e.length,0);return{mode:t,message:a,value:n}}function Tm(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,a=Math.floor(i%60);return{hours:e,minutes:t,seconds:a}}function Om(i){const e=Tm(i),t=e.hours===0?"":`${e.hours}h`,a=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,n=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${a}${n}`}const Dm="·",nr=()=>` ${Dm} `;function Am(i){const{newFiles:e,isUploadStarted:t,recoveredState:a,i18n:n,uploadState:s,isSomeGhost:o,startUpload:r}=i,l=Se("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===Xe.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),c=e&&t&&!a?n("uploadXNewFiles",{smart_count:e}):n("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:e}),onClick:r,disabled:o,"data-uppy-super-focusable":!0},c)}function Um(i){const{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function Rm(i){const{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("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 Im(i){const{isAllPaused:e,i18n:t,isAllComplete:a,resumableUploads:n,uppy:s}=i,o=t(e?"resume":"pause");function r(){if(!a){if(!n){s.cancelAll();return}if(e){s.resumeAll();return}s.pauseAll()}}return u("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:r,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Mm(i){const{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Sc(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("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 Nm(i){const{progress:e}=i,{value:t,mode:a,message:n}=e;return u("div",{className:"uppy-StatusBar-content"},u(Sc,null),a==="determinate"?`${Math.round(t*100)}% · `:"",n)}function Bm(i){const{numUploads:e,complete:t,totalUploadedSize:a,totalSize:n,totalETA:s,i18n:o}=i,r=e>1;return u("div",{className:"uppy-StatusBar-statusSecondary"},r&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},r&&nr(),o("dataUploadedOfTotal",{complete:ei(a),total:ei(n)}),nr(),o("xTimeLeft",{time:Om(s)})))}function Pc(i){const{i18n:e,complete:t,numUploads:a}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:a}))}function jm(i){const{i18n:e,newFiles:t,startUpload:a}=i,n=Se("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:n,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:a},e("upload")))}function Lm(i){const{i18n:e,supportsUploadProgress:t,totalProgress:a,showProgressDetails:n,isUploadStarted:s,isAllComplete:o,isAllPaused:r,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:h,totalETA:b,startUpload:m}=i,P=l&&s;if(!s||o)return null;const g=e(r?"paused":"uploading");function y(){return!r&&!P&&n?t?u(Bm,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:h,totalETA:b,i18n:e}):u(Pc,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},r?null:u(Sc,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t?`${g}: ${a}%`:g),y(),P?u(jm,{i18n:e,newFiles:l,startUpload:m}):null))}function zm(i){const{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function $m(i){const{error:e,i18n:t,complete:a,numUploads:n}=i;function s(){const o=`${t("uploadFailed")}
17
17
 
18
- ${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:s,type:"button"},"?")),u(Pc,{i18n:t,complete:a,numUploads:n})))}const{STATE_ERROR:sr,STATE_WAITING:or,STATE_PREPROCESSING:En,STATE_UPLOADING:wa,STATE_POSTPROCESSING:Tn,STATE_COMPLETE:Sa}=Xe;function Fc(i){const{newFiles:e,allowNewUpload:t,isUploadInProgress:a,isAllPaused:n,resumableUploads:s,error:o,hideUploadButton:r,hidePauseResumeButton:l,hideCancelButton:c,hideRetryButton:d,recoveredState:p,uploadState:h,totalProgress:b,files:m,supportsUploadProgress:P,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:F,isUploadStarted:C,i18n:O,startUpload:A,uppy:v,isAllComplete:S,showProgressDetails:k,numUploads:I,complete:B,totalSize:V,totalETA:K,totalUploadedSize:$}=i;function z(){switch(h){case Tn:case En:{const ne=kn(m);return ne.mode==="determinate"?ne.value*100:b}case sr:return null;case wa:return P?b:null;default:return b}}function q(){switch(h){case Tn:case En:{const{mode:ne}=kn(m);return ne==="indeterminate"}case wa:return!P;default:return!1}}function w(){if(p)return!1;switch(h){case or:return r||e===0;case Sa:return g;default:return!1}}const f=z(),x=w(),_=f??100,T=!o&&e&&!a&&!n&&t&&!r,E=!c&&h!==or&&h!==Sa,N=s&&!l&&h===wa,j=o&&!S&&!d,H=F&&h===Sa,re=Se("uppy-StatusBar-progress",{"is-indeterminate":q()}),le=Se("uppy-StatusBar",`is-${h}`,{"has-ghosts":y});return u("div",{className:le,"aria-hidden":x},u("div",{className:re,style:{width:`${_}%`},role:"progressbar","aria-label":`${_}%`,"aria-valuetext":`${_}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f}),(()=>{switch(h){case En:case Tn:return u(Nm,{progress:kn(m)});case Sa:return u(zm,{i18n:O});case sr:return u($m,{error:o,i18n:O,numUploads:I,complete:B});case wa:return u(Lm,{i18n:O,supportsUploadProgress:P,totalProgress:b,showProgressDetails:k,isUploadStarted:C,isAllComplete:S,isAllPaused:n,newFiles:e,numUploads:I,complete:B,totalUploadedSize:$,totalSize:V,totalETA:K,startUpload:A});default:return null}})(),u("div",{className:"uppy-StatusBar-actions"},p||T?u(Am,{newFiles:e,isUploadStarted:C,recoveredState:p,i18n:O,isSomeGhost:y,startUpload:A,uploadState:h}):null,j?u(Um,{i18n:O,uppy:v}):null,N?u(Im,{isAllPaused:n,i18n:O,isAllComplete:S,resumableUploads:s,uppy:v}):null,E?u(Rm,{i18n:O,uppy:v}):null,H?u(Mm,{i18n:O,doneButtonHandler:F}):null))}Fc.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};const qm={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}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Z(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Hm=0;function li(i){return"__private_"+Hm+++"_"+i}const Vm={version:"3.3.3"},Wm=2e3,Gm=2e3;function Km(i,e,t,a){if(i)return Xe.STATE_ERROR;if(e)return Xe.STATE_COMPLETE;if(t)return Xe.STATE_WAITING;let n=Xe.STATE_WAITING;const s=Object.keys(a);for(let o=0;o<s.length;o++){const{progress:r}=a[s[o]];if(r.uploadStarted&&!r.uploadComplete)return Xe.STATE_UPLOADING;r.preprocess&&(n=Xe.STATE_PREPROCESSING),r.postprocess&&n!==Xe.STATE_PREPROCESSING&&(n=Xe.STATE_POSTPROCESSING)}return n}const Xm={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Ne=li("lastUpdateTime"),qe=li("previousUploadedBytes"),dt=li("previousSpeed"),Oe=li("previousETA"),On=li("computeSmoothETA"),ki=li("onUploadStart");let Ys=class extends he{constructor(e,t){super(e,{...Xm,...t}),Object.defineProperty(this,On,{value:Ym}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,Oe,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,ki,{writable:!0,value:()=>{const{recoveredState:a}=this.uppy.getState();if(Z(this,dt)[dt]=null,Z(this,Oe)[Oe]=null,a){Z(this,qe)[qe]=Object.values(a.files).reduce((n,s)=>{let{progress:o}=s;return n+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Z(this,Ne)[Ne]=performance.now(),Z(this,qe)[qe]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=qm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:a,allowNewUpload:n,totalProgress:s,error:o,recoveredState:r}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:b,isAllPaused:m,isUploadInProgress:P,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),y=r?Object.values(a):l,F=!!t.resumableUploads,C=t.uploadProgress!==!1;let O=0,A=0;c.forEach(S=>{O+=S.progress.bytesTotal||0,A+=S.progress.bytesUploaded||0});const v=Z(this,On)[On]({uploaded:A,total:O,remaining:O-A});return Fc({error:o,uploadState:Km(o,h,r,e.files||{}),allowNewUpload:n,totalProgress:s,totalSize:O,totalUploadedSize:A,isAllComplete:!1,isAllPaused:m,isAllErrored:b,isUploadStarted:p,isUploadInProgress:P,isSomeGhost:g,recoveredState:r,complete:d.length,newFiles:y.length,numUploads:c.length,totalETA:v,files:a,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:F,supportsUploadProgress:C,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;Zl(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Z(this,ki)[ki]),Z(this,Ne)[Ne]=performance.now(),Z(this,qe)[qe]=this.uppy.getFiles().reduce((t,a)=>t+a.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Z(this,ki)[ki])}};function Ym(i){var e,t;if(i.total===0||i.remaining===0)return 0;(t=(e=Z(this,Ne))[Ne])!=null||(e[Ne]=performance.now());const a=performance.now()-Z(this,Ne)[Ne];if(a===0){var n;return Math.round(((n=Z(this,Oe)[Oe])!=null?n:0)/100)/10}const s=i.uploaded-Z(this,qe)[qe];if(Z(this,qe)[qe]=i.uploaded,s<=0){var o;return Math.round(((o=Z(this,Oe)[Oe])!=null?o:0)/100)/10}const r=s/a,l=Z(this,dt)[dt]==null?r:ar(r,Z(this,dt)[dt],Wm,a);Z(this,dt)[dt]=l;const c=i.remaining/l,d=Math.max(Z(this,Oe)[Oe]-a,0),p=Z(this,Oe)[Oe]==null?c:ar(c,d,Gm,a);return Z(this,Oe)[Oe]=p,Z(this,Ne)[Ne]=performance.now(),Math.round(p/100)/10}Ys.VERSION=Vm.version;const rr=300;class Qm extends ft{constructor(){super(...arguments),this.ref=_u()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,rr)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,rr)}render(){const{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function Jm(i,e){return Object.assign(i,e)}function Zm(i,e){var t;return(t=i==null?void 0:i.key)!=null?t:e}function ef(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=a=>{i.refs[e]=a})}function Ei(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const a=Zm(i[t],t.toString(36));e[a]=i[t]}return e}function tf(i,e){i=i||{},e=e||{};const t=o=>e.hasOwnProperty(o)?e[o]:i[o],a={};let n=[];for(const o in i)e.hasOwnProperty(o)?n.length&&(a[o]=n,n=[]):n.push(o);const s={};for(const o in e){if(a.hasOwnProperty(o))for(let r=0;r<a[o].length;r++){const l=a[o][r];s[a[o][r]]=t(l)}s[o]=t(o)}for(let o=0;o<n.length;o++)s[n[o]]=t(n[o]);return s}const af=i=>i;class Cc extends ft{constructor(e,t){super(e,t),this.refs={},this.state={children:Ei(vt(vt(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Ei(vt(e.children)||[]),a=this.state.children;this.setState(s=>({children:tf(s.children,t)}));let n;for(n in t)if(t.hasOwnProperty(n)){const s=a&&a.hasOwnProperty(n);t[n]&&s&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):t[n]&&!s&&!this.currentlyTransitioningKeys[n]&&this.keysToEnter.push(n)}for(n in a)if(a.hasOwnProperty(n)){const s=t&&t.hasOwnProperty(n);a[n]&&!s&&!this.currentlyTransitioningKeys[n]&&this.keysToLeave.push(n)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const a=Ei(vt(this.props.children)||[]);(!a||!a.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const a=Ei(vt(this.props.children)||[]);(!a||!a.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const a=this.refs[e];a!=null&&a.componentWillLeave?a.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const a=this.refs[e];a!=null&&a.componentDidLeave&&a.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=Ei(vt(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const s=Jm({},this.state.children);delete s[e],this.setState({children:s})}}render(e,t){let{childFactory:a,transitionLeave:n,transitionName:s,transitionAppear:o,transitionEnter:r,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:p,...h}=e,{children:b}=t;const m=Object.entries(b).map(P=>{let[g,y]=P;if(!y)return;const F=ef(this,g);return Bl(a(y),{ref:F,key:g})}).filter(Boolean);return u(p,h,m)}}Cc.defaultProps={component:"span",childFactory:af};const nf={version:"3.1.0"};class _c extends he{constructor(e,t){super(e,t),this.render=a=>u("div",{className:"uppy uppy-Informer"},u(Cc,null,a.info.map(n=>u(Qm,{key:n.message},u("p",{role:"alert"},n.message," ",n.details&&u("span",{"aria-label":n.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${n.message}
18
+ ${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:s,type:"button"},"?")),u(Pc,{i18n:t,complete:a,numUploads:n})))}const{STATE_ERROR:sr,STATE_WAITING:or,STATE_PREPROCESSING:En,STATE_UPLOADING:wa,STATE_POSTPROCESSING:Tn,STATE_COMPLETE:Sa}=Xe;function Fc(i){const{newFiles:e,allowNewUpload:t,isUploadInProgress:a,isAllPaused:n,resumableUploads:s,error:o,hideUploadButton:r,hidePauseResumeButton:l,hideCancelButton:c,hideRetryButton:d,recoveredState:p,uploadState:h,totalProgress:b,files:m,supportsUploadProgress:P,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:F,isUploadStarted:C,i18n:O,startUpload:A,uppy:v,isAllComplete:S,showProgressDetails:k,numUploads:I,complete:B,totalSize:V,totalETA:K,totalUploadedSize:$}=i;function z(){switch(h){case Tn:case En:{const ne=kn(m);return ne.mode==="determinate"?ne.value*100:b}case sr:return null;case wa:return P?b:null;default:return b}}function q(){switch(h){case Tn:case En:{const{mode:ne}=kn(m);return ne==="indeterminate"}case wa:return!P;default:return!1}}function w(){if(p)return!1;switch(h){case or:return r||e===0;case Sa:return g;default:return!1}}const f=z(),x=w(),_=f??100,T=!o&&e&&!a&&!n&&t&&!r,E=!c&&h!==or&&h!==Sa,N=s&&!l&&h===wa,j=o&&!S&&!d,H=F&&h===Sa,re=Se("uppy-StatusBar-progress",{"is-indeterminate":q()}),le=Se("uppy-StatusBar",`is-${h}`,{"has-ghosts":y});return u("div",{className:le,"aria-hidden":x},u("div",{className:re,style:{width:`${_}%`},role:"progressbar","aria-label":`${_}%`,"aria-valuetext":`${_}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":f}),(()=>{switch(h){case En:case Tn:return u(Nm,{progress:kn(m)});case Sa:return u(zm,{i18n:O});case sr:return u($m,{error:o,i18n:O,numUploads:I,complete:B});case wa:return u(Lm,{i18n:O,supportsUploadProgress:P,totalProgress:b,showProgressDetails:k,isUploadStarted:C,isAllComplete:S,isAllPaused:n,newFiles:e,numUploads:I,complete:B,totalUploadedSize:$,totalSize:V,totalETA:K,startUpload:A});default:return null}})(),u("div",{className:"uppy-StatusBar-actions"},p||T?u(Am,{newFiles:e,isUploadStarted:C,recoveredState:p,i18n:O,isSomeGhost:y,startUpload:A,uploadState:h}):null,j?u(Um,{i18n:O,uppy:v}):null,N?u(Im,{isAllPaused:n,i18n:O,isAllComplete:S,resumableUploads:s,uppy:v}):null,E?u(Rm,{i18n:O,uppy:v}):null,H?u(Mm,{i18n:O,doneButtonHandler:F}):null))}Fc.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};const qm={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}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Z(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Hm=0;function li(i){return"__private_"+Hm+++"_"+i}const Vm={version:"3.3.3"},Wm=2e3,Gm=2e3;function Km(i,e,t,a){if(i)return Xe.STATE_ERROR;if(e)return Xe.STATE_COMPLETE;if(t)return Xe.STATE_WAITING;let n=Xe.STATE_WAITING;const s=Object.keys(a);for(let o=0;o<s.length;o++){const{progress:r}=a[s[o]];if(r.uploadStarted&&!r.uploadComplete)return Xe.STATE_UPLOADING;r.preprocess&&(n=Xe.STATE_PREPROCESSING),r.postprocess&&n!==Xe.STATE_PREPROCESSING&&(n=Xe.STATE_POSTPROCESSING)}return n}const Xm={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Ne=li("lastUpdateTime"),qe=li("previousUploadedBytes"),dt=li("previousSpeed"),Oe=li("previousETA"),On=li("computeSmoothETA"),ki=li("onUploadStart");let Ys=class extends he{constructor(e,t){super(e,{...Xm,...t}),Object.defineProperty(this,On,{value:Ym}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,Oe,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,ki,{writable:!0,value:()=>{const{recoveredState:a}=this.uppy.getState();if(Z(this,dt)[dt]=null,Z(this,Oe)[Oe]=null,a){Z(this,qe)[qe]=Object.values(a.files).reduce((n,s)=>{let{progress:o}=s;return n+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Z(this,Ne)[Ne]=performance.now(),Z(this,qe)[qe]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=qm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:a,allowNewUpload:n,totalProgress:s,error:o,recoveredState:r}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:h,isAllErrored:b,isAllPaused:m,isUploadInProgress:P,isSomeGhost:g}=this.uppy.getObjectOfFilesPerState(),y=r?Object.values(a):l,F=!!t.resumableUploads,C=t.uploadProgress!==!1;let O=0,A=0;c.forEach(S=>{O+=S.progress.bytesTotal||0,A+=S.progress.bytesUploaded||0});const v=Z(this,On)[On]({uploaded:A,total:O,remaining:O-A});return Fc({error:o,uploadState:Km(o,h,r,e.files||{}),allowNewUpload:n,totalProgress:s,totalSize:O,totalUploadedSize:A,isAllComplete:!1,isAllPaused:m,isAllErrored:b,isUploadStarted:p,isUploadInProgress:P,isSomeGhost:g,recoveredState:r,complete:d.length,newFiles:y.length,numUploads:c.length,totalETA:v,files:a,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:F,supportsUploadProgress:C,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;Zl(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Z(this,ki)[ki]),Z(this,Ne)[Ne]=performance.now(),Z(this,qe)[qe]=this.uppy.getFiles().reduce((t,a)=>t+a.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Z(this,ki)[ki])}};function Ym(i){var e,t;if(i.total===0||i.remaining===0)return 0;(t=(e=Z(this,Ne))[Ne])!=null||(e[Ne]=performance.now());const a=performance.now()-Z(this,Ne)[Ne];if(a===0){var n;return Math.round(((n=Z(this,Oe)[Oe])!=null?n:0)/100)/10}const s=i.uploaded-Z(this,qe)[qe];if(Z(this,qe)[qe]=i.uploaded,s<=0){var o;return Math.round(((o=Z(this,Oe)[Oe])!=null?o:0)/100)/10}const r=s/a,l=Z(this,dt)[dt]==null?r:ar(r,Z(this,dt)[dt],Wm,a);Z(this,dt)[dt]=l;const c=i.remaining/l,d=Math.max(Z(this,Oe)[Oe]-a,0),p=Z(this,Oe)[Oe]==null?c:ar(c,d,Gm,a);return Z(this,Oe)[Oe]=p,Z(this,Ne)[Ne]=performance.now(),Math.round(p/100)/10}Ys.VERSION=Vm.version;const rr=300;class Qm extends ft{constructor(){super(...arguments),this.ref=Cu()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,rr)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,rr)}render(){const{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function Jm(i,e){return Object.assign(i,e)}function Zm(i,e){var t;return(t=i==null?void 0:i.key)!=null?t:e}function ef(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=a=>{i.refs[e]=a})}function Ei(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const a=Zm(i[t],t.toString(36));e[a]=i[t]}return e}function tf(i,e){i=i||{},e=e||{};const t=o=>e.hasOwnProperty(o)?e[o]:i[o],a={};let n=[];for(const o in i)e.hasOwnProperty(o)?n.length&&(a[o]=n,n=[]):n.push(o);const s={};for(const o in e){if(a.hasOwnProperty(o))for(let r=0;r<a[o].length;r++){const l=a[o][r];s[a[o][r]]=t(l)}s[o]=t(o)}for(let o=0;o<n.length;o++)s[n[o]]=t(n[o]);return s}const af=i=>i;class Cc extends ft{constructor(e,t){super(e,t),this.refs={},this.state={children:Ei(vt(vt(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Ei(vt(e.children)||[]),a=this.state.children;this.setState(s=>({children:tf(s.children,t)}));let n;for(n in t)if(t.hasOwnProperty(n)){const s=a&&a.hasOwnProperty(n);t[n]&&s&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):t[n]&&!s&&!this.currentlyTransitioningKeys[n]&&this.keysToEnter.push(n)}for(n in a)if(a.hasOwnProperty(n)){const s=t&&t.hasOwnProperty(n);a[n]&&!s&&!this.currentlyTransitioningKeys[n]&&this.keysToLeave.push(n)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const a=Ei(vt(this.props.children)||[]);(!a||!a.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const a=Ei(vt(this.props.children)||[]);(!a||!a.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const a=this.refs[e];a!=null&&a.componentWillLeave?a.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const a=this.refs[e];a!=null&&a.componentDidLeave&&a.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=Ei(vt(this.props.children)||[]);if(n&&n.hasOwnProperty(e))this.performEnter(e);else{const s=Jm({},this.state.children);delete s[e],this.setState({children:s})}}render(e,t){let{childFactory:a,transitionLeave:n,transitionName:s,transitionAppear:o,transitionEnter:r,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:p,...h}=e,{children:b}=t;const m=Object.entries(b).map(P=>{let[g,y]=P;if(!y)return;const F=ef(this,g);return Bl(a(y),{ref:F,key:g})}).filter(Boolean);return u(p,h,m)}}Cc.defaultProps={component:"span",childFactory:af};const nf={version:"3.1.0"};class _c extends he{constructor(e,t){super(e,t),this.render=a=>u("div",{className:"uppy uppy-Informer"},u(Cc,null,a.info.map(n=>u(Qm,{key:n.message},u("p",{role:"alert"},n.message," ",n.details&&u("span",{"aria-label":n.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${n.message}
19
19
 
20
20
  ${n.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}_c.VERSION=nf.version;const sf=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function of(i,e,t){var a,n;const s=sf.exec(i),o=(a=(n=e.mimeType)!=null?n:s==null?void 0:s[1])!=null?a:"plain/text";let r;if((s==null?void 0:s[2])!=null){const l=atob(decodeURIComponent(s[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);r=[c]}else(s==null?void 0:s[3])!=null&&(r=[decodeURIComponent(s[3])]);return t?new File(r,e.name||"",{type:o}):new Blob(r,{type:o})}function lr(i){return i.startsWith("blob:")}function W(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var kc=typeof self<"u"?self:Il;const ia=typeof navigator<"u",rf=ia&&typeof HTMLImageElement>"u",cr=!(typeof Il>"u"||typeof mn>"u"||!mn.versions||!mn.versions.node),Ec=kc.Buffer,Tc=!!Ec,lf=i=>i!==void 0;function Oc(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(lf).length===0)}function de(i){let e=new Error(i);throw delete e.stack,e}function pr(i){let e=function(t){let a=0;return t.ifd0.enabled&&(a+=1024),t.exif.enabled&&(a+=2048),t.makerNote&&(a+=2048),t.userComment&&(a+=1024),t.gps.enabled&&(a+=512),t.interop.enabled&&(a+=100),t.ifd1.enabled&&(a+=1024),a+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const Dn=i=>String.fromCharCode.apply(null,i),ur=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;class We{static from(e,t){return e instanceof this&&e.le===t?e:new We(e,void 0,void 0,t)}constructor(e,t=0,a,n){if(typeof n=="boolean"&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){a===void 0&&(a=e.byteLength-t);let s=new DataView(e,t,a);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof We){a===void 0&&(a=e.byteLength-t),(t+=e.byteOffset)+a>e.byteOffset+e.byteLength&&de("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,a);this._swapDataView(s)}else if(typeof e=="number"){let s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}else de("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,a=We){return e instanceof DataView||e instanceof We?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||de("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new a(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new We(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),ur?ur.decode(n):Tc?Ct.from(n).toString("utf8"):decodeURIComponent(escape(Dn(n)));var n}getLatin1String(e=0,t=this.byteLength){let a=this.getUint8Array(e,t);return Dn(a)}getUnicodeString(e=0,t=this.byteLength){const a=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)a.push(this.getUint16(e+n));return Dn(a)}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,a){switch(t){case 1:return this.getUint8(e,a);case 2:return this.getUint16(e,a);case 4:return this.getUint32(e,a);case 8:return this.getUint64&&this.getUint64(e,a)}}getUint(e,t,a){switch(t){case 8:return this.getUint8(e,a);case 16:return this.getUint16(e,a);case 32:return this.getUint32(e,a);case 64:return this.getUint64&&this.getUint64(e,a)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function us(i,e){de(`${i} '${e}' was not loaded, try using full build of exifr.`)}class Qs extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||us(this.kind,e),t&&(e in t||function(a,n){de(`Unknown ${a} '${n}'.`)}(this.kind,e),t[e].enabled||us(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Dc=new Qs("file parser"),He=new Qs("segment parser"),Js=new Qs("file reader");let cf=kc.fetch;function dr(i,e){return(t=i).startsWith("data:")||t.length>1e4?hs(i,e,"base64"):cr&&i.includes("://")?ds(i,e,"url",hr):cr?hs(i,e,"fs"):ia?ds(i,e,"url",hr):void de("Invalid input argument");var t}async function ds(i,e,t,a){return Js.has(t)?hs(i,e,t):a?async function(n,s){let o=await s(n);return new We(o)}(i,a):void de(`Parser ${t} is not loaded`)}async function hs(i,e,t){let a=new(Js.get(t))(i,e);return await a.read(),a}const hr=i=>cf(i).then(e=>e.arrayBuffer()),ms=i=>new Promise((e,t)=>{let a=new FileReader;a.onloadend=()=>e(a.result||new ArrayBuffer),a.onerror=t,a.readAsArrayBuffer(i)}),Zs=new Map,pf=new Map,uf=new Map,Pa=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Ac=["jfif","xmp","icc","iptc","ihdr"],fs=["tiff",...Ac],pe=["ifd0","ifd1","exif","gps","interop"],Fa=[...fs,...pe],Ca=["makerNote","userComment"],Uc=["translateKeys","translateValues","reviveValues","multiSegment"],_a=[...Uc,"sanitize","mergeOutput","silentErrors"];class Rc{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Ti extends Rc{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,a,n){if(super(),W(this,"enabled",!1),W(this,"skip",new Set),W(this,"pick",new Set),W(this,"deps",new Set),W(this,"translateKeys",!1),W(this,"translateValues",!1),W(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=pe.includes(e),this.canBeFiltered&&(this.dict=Zs.get(e)),a!==void 0)if(Array.isArray(a))this.parse=this.enabled=!0,this.canBeFiltered&&a.length>0&&this.translateTagSet(a,this.pick);else if(typeof a=="object"){if(this.enabled=!0,this.parse=a.parse!==!1,this.canBeFiltered){let{pick:s,skip:o}=a;s&&s.length>0&&this.translateTagSet(s,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(a)}else a===!0||a===!1?this.parse=this.enabled=a:de(`Invalid options argument: ${a}`)}applyInheritables(e){let t,a;for(t of Uc)a=e[t],a!==void 0&&(this[t]=a)}translateTagSet(e,t){if(this.dict){let a,n,{tagKeys:s,tagValues:o}=this.dict;for(a of e)typeof a=="string"?(n=o.indexOf(a),n===-1&&(n=s.indexOf(Number(a))),n!==-1&&t.add(Number(s[n]))):t.add(a)}else for(let a of e)t.add(a)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Za(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Za(this.pick,this.deps)}}var xe={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},mr=new Map;class eo extends Rc{static useCached(e){let t=mr.get(e);return t!==void 0||(t=new this(e),mr.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):de(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ia?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Pa)this[e]=xe[e];for(e of _a)this[e]=xe[e];for(e of Ca)this[e]=xe[e];for(e of Fa)this[e]=new Ti(e,xe[e],void 0,this)}setupFromTrue(){let e;for(e of Pa)this[e]=xe[e];for(e of _a)this[e]=xe[e];for(e of Ca)this[e]=!0;for(e of Fa)this[e]=new Ti(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Pa)this[t]=xe[t];for(t of _a)this[t]=xe[t];for(t of Ca)this[t]=xe[t];for(t of Fa)this[t]=new Ti(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,pe)}setupFromObject(e){let t;for(t of(pe.ifd0=pe.ifd0||pe.image,pe.ifd1=pe.ifd1||pe.thumbnail,Object.assign(this,e),Pa))this[t]=An(e[t],xe[t]);for(t of _a)this[t]=An(e[t],xe[t]);for(t of Ca)this[t]=An(e[t],xe[t]);for(t of fs)this[t]=new Ti(t,xe[t],e[t],this);for(t of pe)this[t]=new Ti(t,xe[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,pe,Fa),e.tiff===!0?this.batchEnableWithBool(pe,!0):e.tiff===!1?this.batchEnableWithUserValue(pe,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,pe):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,pe)}batchEnableWithBool(e,t){for(let a of e)this[a].enabled=t}batchEnableWithUserValue(e,t){for(let a of e){let n=t[a];this[a].enabled=n!==!1&&n!==void 0}}setupGlobalFilters(e,t,a,n=a){if(e&&e.length){for(let o of n)this[o].enabled=!1;let s=fr(e,a);for(let[o,r]of s)Za(this[o].pick,r),this[o].enabled=!0}else if(t&&t.length){let s=fr(t,a);for(let[o,r]of s)Za(this[o].skip,r)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:a,iptc:n,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),a.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:a,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),a.needed&&e.deps.add(34853),this.tiff.enabled=pe.some(s=>this[s].enabled===!0)||this.makerNote||this.userComment;for(let s of pe)this[s].finalizeFilters()}get onlyTiff(){return!Ac.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of fs)this[e].enabled&&!He.has(e)&&us("segment parser",e)}}function fr(i,e){let t,a,n,s,o=[];for(n of e){for(s of(t=Zs.get(n),a=[],t))(i.includes(s[0])||i.includes(s[1]))&&a.push(s[0]);a.length&&o.push([n,a])}return o}function An(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Za(i,e){for(let t of e)i.add(t)}W(eo,"default",xe);class df{constructor(e){W(this,"parsers",{}),W(this,"output",{}),W(this,"errors",[]),W(this,"pushToErrors",t=>this.errors.push(t)),this.options=eo.useCached(e)}async read(e){this.file=await function(t,a){return typeof t=="string"?dr(t,a):ia&&!rf&&t instanceof HTMLImageElement?dr(t.src,a):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new We(t):ia&&t instanceof Blob?ds(t,a,"blob",ms):void de("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[a,n]of Dc)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[a]=!0;this.file.close&&this.file.close(),de("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),Oc(a=e)?void 0:a;var a}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async a=>{let n=await a.parse();a.assignToOutput(e,n)});this.options.silentErrors&&(t=t.map(a=>a.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,a=He.get("tiff",e);var n;if(t.tiff?n={start:0,type:"tiff"}:t.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),n===void 0)return;let s=await this.fileParser.ensureSegmentChunk(n),o=this.parsers.tiff=new a(s,e,t),r=await o.extractThumbnail();return t.close&&t.close(),r}}class Yt{static findPosition(e,t){let a=e.getUint16(t+2)+2,n=typeof this.headerLength=="function"?this.headerLength(e,t,a):this.headerLength,s=t+n,o=a-n;return{offset:t,length:a,headerLength:n,start:s,size:o,end:s+o}}static parse(e,t={}){return new this(e,new eo({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof We?e:new We(e)}constructor(e,t={},a){W(this,"errors",[]),W(this,"raw",new Map),W(this,"handleError",n=>{if(!this.options.silentErrors)throw n;this.errors.push(n.message)}),this.chunk=this.normalizeInput(e),this.file=a,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 a=uf.get(t),n=pf.get(t),s=Zs.get(t),o=this.options[t],r=o.reviveValues&&!!a,l=o.translateValues&&!!n,c=o.translateKeys&&!!s,d={};for(let[p,h]of e)r&&a.has(p)?h=a.get(p)(h):l&&n.has(p)&&(h=this.translateValue(h,n.get(p))),c&&s.has(p)&&(p=s.get(p)||p),d[p]=h;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,a){if(this.globalOptions.mergeOutput)return Object.assign(e,a);e[t]?Object.assign(e[t],a):e[t]=a}}W(Yt,"headerLength",4),W(Yt,"type",void 0),W(Yt,"multiSegment",!1),W(Yt,"canHandle",()=>!1);function hf(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function mf(i){return i>=224&&i<=239}function ff(i,e,t){for(let[a,n]of He)if(n.canHandle(i,e,t))return a}class gr extends class{constructor(e,t,a){W(this,"errors",[]),W(this,"ensureSegmentChunk",async n=>{let s=n.start,o=n.size||65536;if(this.file.chunked)if(this.file.available(s,o))n.chunk=this.file.subarray(s,o);else try{n.chunk=await this.file.readChunk(s,o)}catch(r){de(`Couldn't read segment: ${JSON.stringify(n)}. ${r.message}`)}else this.file.byteLength>s+o?n.chunk=this.file.subarray(s,o):n.size===void 0?n.chunk=this.file.subarray(s):de("Segment unreachable: "+JSON.stringify(n));return n.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=a}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let a=new(He.get(e))(t,this.options,this.file);return this.parsers[e]=a}createParsers(e){for(let t of e){let{type:a,chunk:n}=t,s=this.options[a];if(s&&s.enabled){let o=this.parsers[a];o&&o.append||o||this.createParser(a,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),W(this,"appSegments",[]),W(this,"jpegSegments",[]),W(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(He.keyList())):(e=e===void 0?He.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&He.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:a,findAll:n,wanted:s,remaining:o}=this;if(!n&&this.file.chunked&&(n=Array.from(s).some(r=>{let l=He.get(r),c=this.options[r];return l.multiSegment&&c.multiSegment}),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,a.byteLength),!this.options.onlyTiff&&a.chunked){let r=!1;for(;o.size>0&&!r&&(a.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=a,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(r=e>l&&!c?!await a.readNextChunk(e):!await a.readNextChunk(l),(e=this.findAppSegmentsInRange(e,a.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let a,n,s,o,r,l,{file:c,findAll:d,wanted:p,remaining:h,options:b}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(a=c.getUint8(e+1),mf(a)){if(n=c.getUint16(e+2),s=ff(c,e,n),s&&p.has(s)&&(o=He.get(s),r=o.findPosition(c,e),l=b[s],r.type=s,this.appSegments.push(r),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=r.chunkNumber<r.chunkCount,this.unfinishedMultiSegment||h.delete(s)):h.delete(s),h.size===0)))break;b.recordUnknownSegments&&(r=Yt.findPosition(c,e),r.marker=a,this.unknownSegments.push(r)),e+=n+1}else if(hf(a)){if(n=c.getUint16(e+2),a===218&&b.stopAfterSos!==!1)return;b.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:a}),e+=n+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,a){let n,s,o,r=new Map;for(let l=0;l<t.length;l++)n=t[l],s=n[a],r.has(s)?o=r.get(s):r.set(s,o=[]),o.push(n);return Array.from(r)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,a])=>{let n=He.get(t,this.options);return n.handleMultiSegments?{type:t,chunk:n.handleMultiSegments(a)}:a[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}W(gr,"type","jpeg"),Dc.set("jpeg",gr);const gf=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class vf extends Yt{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,a=new Map){let{pick:n,skip:s}=this.options[t];n=new Set(n);let o=n.size>0,r=s.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(o){if(n.has(d)&&(a.set(d,this.parseTag(e,d,t)),n.delete(d),n.size===0))break}else!r&&s.has(d)||a.set(d,this.parseTag(e,d,t));e+=12}return a}parseTag(e,t,a){let{chunk:n}=this,s=n.getUint16(e+2),o=n.getUint32(e+4),r=gf[s];if(r*o<=4?e+=8:e=n.getUint32(e+8),(s<1||s>13)&&de(`Invalid TIFF value type. block: ${a.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>n.byteLength&&de(`Invalid TIFF value offset. block: ${a.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`),s===1)return n.getUint8Array(e,o);if(s===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=n.getString(e,o)).trim())===""?void 0:l;var l;if(s===7)return n.getUint8Array(e,o);if(o===1)return this.parseTagValue(s,e);{let c=new(function(p){switch(p){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(s))(o),d=r;for(let p=0;p<o;p++)c[p]=this.parseTagValue(s,e),e+=d;return c}}parseTagValue(e,t){let{chunk:a}=this;switch(e){case 1:return a.getUint8(t);case 3:return a.getUint16(t);case 4:return a.getUint32(t);case 5:return a.getUint32(t)/a.getUint32(t+4);case 6:return a.getInt8(t);case 8:return a.getInt16(t);case 9:return a.getInt32(t);case 10:return a.getInt32(t)/a.getInt32(t+4);case 11:return a.getFloat(t);case 12:return a.getDouble(t);case 13:return a.getUint32(t);default:de(`Invalid tiff type ${e}`)}}}class Un extends vf{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let a=new Map;return this[t]=a,this.parseTags(e,t,a),a}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&de("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&de(`IFD0 offset points to outside of file.
21
21
  this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,pr(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,pr(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 a=e.get(t);a&&a.length===1&&e.set(t,a[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",vr(...e.get(2),e.get(1))),e.set("longitude",vr(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,a,n={};for(t of pe)if(e=this[t],!Oc(e))if(a=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(n,a)}else n[t]=a;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[a,n]of Object.entries(t))this.assignObjectToOutput(e,a,n)}}function vr(i,e,t,a){var n=i+e/60+t/3600;return a!=="S"&&a!=="W"||(n*=-1),n}W(Un,"type","tiff"),W(Un,"headerLength",10),He.set("tiff",Un);const to={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},to,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},to,{tiff:!1,ifd1:!0,mergeOutput:!1});const bf=Object.assign({},to,{firstChunkSize:4e4,ifd0:[274]});async function yf(i){let e=new df(bf);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const xf=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let Bi=!0,ji=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,a]=e;Bi=Number(t)+.1*Number(a)<13.4,ji=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Bi=ji=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Bi=ji=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Bi=ji=Number(e)<77}}async function wf(i){let e=await yf(i);return Object.assign({canvas:Bi,css:ji},xf[e])}class Sf extends We{constructor(...e){super(...e),W(this,"ranges",new Pf),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,a){if(e===0&&this.byteLength===0&&a){let n=new DataView(a.buffer||a,a.byteOffset,a.byteLength);this._swapDataView(n)}else{let n=e+t;if(n>this.byteLength){let{dataView:s}=this._extend(n);this._swapDataView(s)}}}_extend(e){let t;t=Tc?Ec.allocUnsafe(e):new Uint8Array(e);let a=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:a}}subarray(e,t,a=!1){return t=t||this._lengthToEnd(e),a&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,a=!1){a&&this._tryExtend(t,e.byteLength,e);let n=super.set(e,t);return this.ranges.add(t,n.byteLength),n}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 Pf{constructor(){W(this,"list",[])}get length(){return this.list.length}add(e,t,a=0){let n=e+t,s=this.list.filter(o=>br(e,o.offset,n)||br(e,o.end,n));if(s.length>0){e=Math.min(e,...s.map(r=>r.offset)),n=Math.max(n,...s.map(r=>r.end)),t=n-e;let o=s.shift();o.offset=e,o.length=t,o.end=n,this.list=this.list.filter(r=>!s.includes(r))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let a=e+t;return this.list.some(n=>n.offset<=e&&a<=n.end)}}function br(i,e,t){return i<=e&&e<=t}class Ff extends Sf{constructor(e,t){super(0),W(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,a=await this.readChunk(e,t);return!!a&&a.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Js.set("blob",class extends Ff{async readWhole(){this.chunked=!1;let i=await ms(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,a=this.input.slice(i,t),n=await ms(a);return this.set(n,i,!0)}});const Cf={strings:{generatingThumbnails:"Generating thumbnails..."}},_f={version:"3.1.0"};function kf(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(a){if(a.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(a=>{i.toBlob(a,e,t)}).then(a=>{if(a===null)throw new Error("cannot read image, probably an svg with external resources");return a}):Promise.resolve().then(()=>of(i.toDataURL(e,t),{})).then(a=>{if(a===null)throw new Error("could not extract blob, probably an old browser");return a})}function Ef(i,e){let t=i.width,a=i.height;(e.deg===90||e.deg===270)&&(t=i.height,a=i.width);const n=document.createElement("canvas");n.width=t,n.height=a;const s=n.getContext("2d");return s.translate(t/2,a/2),e.canvas&&(s.rotate(e.rad),s.scale(e.scaleX,e.scaleY)),s.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),n}function Tf(i){const e=i.width/i.height,t=5e6,a=4096;let n=Math.floor(Math.sqrt(t*e)),s=Math.floor(t/Math.sqrt(t*e));if(n>a&&(n=a,s=Math.round(n/e)),s>a&&(s=a,n=Math.round(e*s)),i.width>n){const o=document.createElement("canvas");return o.width=n,o.height=s,o.getContext("2d").drawImage(i,0,0,n,s),o}return i}const Of={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class io extends he{constructor(e,t){if(super(e,{...Of,...t}),this.onFileAdded=a=>{!a.preview&&a.data&&cs(a.type)&&!a.isRemote&&this.addToQueue(a.id)},this.onCancelRequest=a=>{const n=this.queue.indexOf(a.id);n!==-1&&this.queue.splice(n,1)},this.onFileRemoved=a=>{const n=this.queue.indexOf(a.id);n!==-1&&this.queue.splice(n,1),a.preview&&lr(a.preview)&&URL.revokeObjectURL(a.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(n=>n.isRestored).forEach(n=>{(!n.preview||lr(n.preview))&&this.addToQueue(n.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=a=>{a.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const n=()=>{a.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return new Promise(s=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{n(),s()}):(n(),s())})},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=Cf,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,a){const n=URL.createObjectURL(e.data),s=new Promise((r,l)=>{const c=new Image;c.src=n,c.addEventListener("load",()=>{URL.revokeObjectURL(n),r(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(n),l(d.error||new Error("Could not create thumbnail"))})}),o=wf(e.data).catch(()=>1);return Promise.all([s,o]).then(r=>{let[l,c]=r;const d=this.getProportionalDimensions(l,t,a,c.deg),p=Ef(l,c),h=this.resizeImage(p,d.width,d.height);return kf(h,this.thumbnailType,80)}).then(r=>URL.createObjectURL(r))}getProportionalDimensions(e,t,a,n){let s=e.width/e.height;return(n===90||n===270)&&(s=e.height/e.width),t!=null?{width:t,height:Math.round(t/s)}:a!=null?{width:Math.round(a*s),height:a}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,a){let n=Tf(e),s=Math.ceil(Math.log2(n.width/t));s<1&&(s=1);let o=t*2**(s-1),r=a*2**(s-1);const l=2;for(;s--;){const c=document.createElement("canvas");c.width=o,c.height=r,c.getContext("2d").drawImage(n,0,0,o,r),n=c,o=Math.round(o/l),r=Math.round(r/l)}return n}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return cs(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}io.VERSION=_f.version;function yr(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Jl(i)?[i]:null}function Ic(i,e,t,a){let{onSuccess:n}=a;i.readEntries(s=>{const o=[...e,...s];s.length?queueMicrotask(()=>{Ic(i,o,t,{onSuccess:n})}):n(o)},s=>{t(s),n(e)})}function Mc(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,a)=>i.file(t,a))},async*values(){const t=i.createReader();yield*await new Promise(n=>{Ic(t,[],e,{onSuccess:s=>n(s.map(o=>Mc(o,e)))})})},isSameEntry:void 0}}function Nc(i,e,t){try{return t===void 0&&(t=void 0),async function*(){const a=()=>`${e}/${i.name}`;if(i.kind==="file"){const n=await i.getFile();n!=null?(n.relativePath=e?a():null,yield n):t!=null&&(yield t)}else if(i.kind==="directory")for await(const n of i.values())yield*Nc(n,e?a():i.name);else t!=null&&(yield t)}()}catch(a){return Promise.reject(a)}}async function*Df(i,e){const t=await Promise.all(Array.from(i.items,async a=>{var n;let s;const o=()=>typeof a.getAsEntry=="function"?a.getAsEntry():a.webkitGetAsEntry();return(n=s)!=null||(s=Mc(o(),e)),{fileSystemHandle:s,lastResortFile:a.getAsFile()}}));for(const{lastResortFile:a,fileSystemHandle:n}of t)if(n!=null)try{yield*Nc(n,"",a)}catch(s){a!=null?yield a:e(s)}else a!=null&&(yield a)}function Af(i){const e=Ye(i.files);return Promise.resolve(e)}async function ao(i,e){var t;const a=(t=e==null?void 0:e.logDropError)!=null?t:Function.prototype;try{const n=[];for await(const s of Df(i,a))n.push(s);return n}catch{return Af(i)}}const Bc=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function jc(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function xr(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function Uf(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Rf(i){return i.contains(document.activeElement)}function Lc(i,e,t){const a=jc(t,e),n=Ye(a.querySelectorAll(Bc)),s=n.indexOf(document.activeElement);Rf(a)?i.shiftKey&&s===0?Uf(i,n):!i.shiftKey&&s===n.length-1&&xr(i,n):xr(i,n)}function If(i,e,t){e===null||Lc(i,e,t)}function Mf(){let i=!1;return Zn((t,a)=>{const n=jc(t,a),s=n.contains(document.activeElement);if(s&&i)return;const o=n.querySelector("[data-uppy-super-focusable]");if(!(s&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{const r=n.querySelector(Bc);r==null||r.focus({preventScroll:!0}),i=!1}},260)}function zc(){const i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Nf=function(e,t){if(e===t)return!0;for(var a in e)if(!(a in t))return!1;for(var a in t)if(e[a]!==t[a])return!1;return!0};const Bf=tt(Nf);function jf(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function Lf(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function zf(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function $f(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function qf(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function Hf(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function Vf(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function no(i){const e={color:"#838999",icon:Hf()};if(!i)return e;const t=i.split("/")[0],a=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:Vf()}:t==="image"?{color:"#686de0",icon:jf()}:t==="audio"?{color:"#068dbb",icon:Lf()}:t==="video"?{color:"#19af67",icon:zf()}:t==="application"&&a==="pdf"?{color:"#e25149",icon:$f()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(a)!==-1?{color:"#00C469",icon:qf()}:e}function $c(i){const{file:e}=i;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:a}=no(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},a),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}const Wf=(i,e)=>(typeof e=="function"?e():e).filter(n=>n.id===i)[0].name;function qc(i){const{file:e,toggleFileCard:t,i18n:a,metaFields:n}=i,{missingRequiredMetaFields:s}=e;if(!(s!=null&&s.length))return null;const o=s.map(r=>Wf(r,n)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},a("missingRequiredMetaFields",{smart_count:s.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},a("editFile")))}function Gf(i){const{file:e,i18n:t,toggleFileCard:a,metaFields:n,showLinkToFileUploadResult:s}=i,r=e.preview?"rgba(255, 255, 255, 0.5)":no(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:r}},s&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u($c,{file:e}),u(qc,{file:e,i18n:t,toggleFileCard:a,metaFields:n}))}function Kf(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function wr(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function Rn(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":wr(i),title:wr(i),onClick:()=>Kf(i)},i.children))}function ka(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function In(i){let{progress:e}=i;const t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function Xf(i){if(!i.file.progress.uploadStarted)return null;if(i.isUploaded)return u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(ka,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"}))));if(!i.recoveredState)return i.error&&!i.hideRetryButton?u(Rn,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(Rn,i,u(ka,null,u(In,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(Rn,i,u(ka,null,u(In,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(ka,null,u(In,{progress:i.file.progress.percentage}))))}const Mn="...";function Hc(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Mn.length+1)return`${i.slice(0,e-1)}…`;const t=e-Mn.length,a=Math.ceil(t/2),n=Math.floor(t/2);return i.slice(0,a)+Mn+i.slice(-n)}const Yf=i=>{const{author:e,name:t}=i.file.meta;function a(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},Hc(t,a()))},Qf=i=>{var e;const{author:t}=i.file.meta,a=(e=i.file.remote)==null?void 0:e.providerName,n="·";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Hc(t.name,13)),a?u(Ft,null,` ${n} `,a,` ${n} `):null):null},Jf=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},ei(i.file.size)),Zf=i=>i.file.isGhost&&u("span",null," • ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:i.toggleAddFilesPanel},i.i18n("reSelect"))),eg=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function tg(i){const{file:e}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},Yf(i),u(eg,{file:i.file,onClick:()=>alert(i.file.error)})),u("div",{className:"uppy-Dashboard-Item-status"},Qf(i),Jf(i),Zf(i)),u(qc,{file:i.file,i18n:i.i18n,toggleFileCard:i.toggleFileCard,metaFields:i.metaFields}))}function ig(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{const a=document.createElement("textarea");a.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),a.value=i,document.body.appendChild(a),a.select();const n=s=>{document.body.removeChild(a),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(a),t()):n("copy command unavailable")}catch{return document.body.removeChild(a),n()}})}function ag(i){let{file:e,uploadInProgressOrComplete:t,metaFields:a,canEditFile:n,i18n:s,onClick:o}=i;return!t&&a&&a.length>0||!t&&n(e)?u("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:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function ng(i){let{i18n:e,onClick:t,file:a}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:a.meta.name}),title:e("removeFile",{file:a.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}const sg=(i,e)=>{ig(e.file.uploadURL,e.i18n("copyLinkToClipboardFallback")).then(()=>{e.uppy.log("Link copied to clipboard."),e.uppy.info(e.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.uppy.log).then(()=>i.target.focus({preventScroll:!0}))};function og(i){const{i18n:e}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e("copyLink"),title:e("copyLink"),onClick:t=>sg(t,i)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function rg(i){const{uppy:e,file:t,uploadInProgressOrComplete:a,canEditFile:n,metaFields:s,showLinkToFileUploadResult:o,showRemoveButton:r,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(ag,{i18n:l,file:t,uploadInProgressOrComplete:a,canEditFile:n,metaFields:s,onClick:()=>{s&&s.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(og,{file:t,uppy:e,i18n:l}):null,r?u(ng,{i18n:l,file:t,uppy:e,onClick:()=>e.removeFile(t.id,"removed-by-user")}):null)}class lg extends ft{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Bf(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,a=e.progress.uploadComplete&&!t&&!e.error,n=e.progress.uploadStarted||t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:r}=e;let l=(this.props.individualCancellation||!s)&&!a;a&&this.props.showRemoveButtonAfterComplete&&(l=!0);const c=Se({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":a,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":r});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(Gf,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(Xf,{uppy:this.props.uppy,file:e,error:o,isUploaded:a,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(tg,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(rg,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function cg(i,e){const t=[];let a=[];return i.forEach(n=>{a.length<e?a.push(n):(t.push(a),a=[n])}),a.length&&t.push(a),t}function pg(i){let{id:e,error:t,i18n:a,uppy:n,files:s,acquirers:o,resumableUploads:r,hideRetryButton:l,hidePauseResumeButton:c,hideCancelButton:d,showLinkToFileUploadResult:p,showRemoveButtonAfterComplete:h,isWide:b,metaFields:m,isSingleFile:P,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:F,recoveredState:C,individualCancellation:O,itemsPerRow:A,openFileEditor:v,canEditFile:S,toggleAddFilesPanel:k,containerWidth:I,containerHeight:B}=i;const V=A===1?71:200,K=ln(()=>{const z=(w,f)=>s[f].isGhost-s[w].isGhost,q=Object.keys(s);return C&&q.sort(z),cg(q,A)},[s,A,C]),$=z=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:z[0]},z.map(q=>u(lg,{key:q,uppy:n,id:e,error:t,i18n:a,acquirers:o,resumableUploads:r,individualCancellation:O,hideRetryButton:l,hidePauseResumeButton:c,hideCancelButton:d,showLinkToFileUploadResult:p,showRemoveButtonAfterComplete:h,isWide:b,metaFields:m,recoveredState:C,isSingleFile:P,containerWidth:I,containerHeight:B,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:F,role:"listitem",openFileEditor:v,canEditFile:S,toggleAddFilesPanel:k,file:s[q]})));return P?u("div",{class:"uppy-Dashboard-files"},$(K[0])):u(fc,{class:"uppy-Dashboard-files",role:"list",data:K,renderRow:$,rowHeight:V})}let Vc;Vc=Symbol.for("uppy test: disable unused locale key warning");class Wc extends ft{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderHiddenCameraInput=(e,t,a)=>{const s={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:s,ref:a})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{const a=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":a===0},e)},this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),a=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),n=this.props.fileManagerSelectionType,s=n.charAt(0).toUpperCase()+n.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${s}`,{browseFiles:t,browseFolders:a,browse:t}):this.props.i18nArray(`dropPaste${s}`,{browseFiles:t,browseFolders:a,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],a=t.splice(e.length-2,e.length);return u(Ft,null,t.map(n=>this.renderAcquirer(n)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},a.map(n=>this.renderAcquirer(n))))},this.renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:a,showNativeVideoCameraButton:n}=this.props;let s=[];const o="myDevice";t||s.push({key:o,elements:this.renderMyDeviceAcquirer()}),a&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),n&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(p=>({key:p.id,elements:this.renderAcquirer(p)}))),s.length===1&&s[0].key===o&&(s=[]);const l=[...s],c=l.splice(s.length-2,s.length),d=p=>p.map(h=>{let{key:b,elements:m}=h;return u(Ft,{key:b},m)});return u(Ft,null,this.renderDropPasteBrowseTagline(s.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(l),u("span",{role:"presentation",style:{"white-space":"nowrap"}},d(c))))}}[Vc](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),a=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},a)}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:a}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,n=>{this.fileInput=n}),this.renderHiddenInput(!0,n=>{this.folderInput=n}),e&&this.renderHiddenCameraInput("photo",a,n=>{this.mobilePhotoFileInput=n}),t&&this.renderHiddenCameraInput("video",a,n=>{this.mobileVideoFileInput=n}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}const ug=i=>u("div",{className:Se("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(Wc,i));function wt(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function dg(i){let{activePickerPanel:e,className:t,hideAllPanels:a,i18n:n,state:s,uppy:o}=i;return u("div",{className:Se("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:wt,onDragLeave:wt,onDrop:wt,onPaste:wt},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},n("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:a},n("cancel"))),u("div",{className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(s)))}function hg(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:Se("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(a=>i.uppy.getPlugin(a.id).render(i.state))))}const Ke={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function mg(i,e,t,a){if(a===void 0&&(a={}),i)return Ke.STATE_ERROR;if(e)return Ke.STATE_COMPLETE;if(t)return Ke.STATE_PAUSED;let n=Ke.STATE_WAITING;const s=Object.keys(a);for(let o=0;o<s.length;o++){const{progress:r}=a[s[o]];if(r.uploadStarted&&!r.uploadComplete)return Ke.STATE_UPLOADING;r.preprocess&&n!==Ke.STATE_UPLOADING&&(n=Ke.STATE_PREPROCESSING),r.postprocess&&n!==Ke.STATE_UPLOADING&&n!==Ke.STATE_PREPROCESSING&&(n=Ke.STATE_POSTPROCESSING)}return n}function fg(i){let{files:e,i18n:t,isAllComplete:a,isAllErrored:n,isAllPaused:s,inProgressNotPausedFiles:o,newFiles:r,processingFiles:l}=i;switch(mg(n,a,s,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:r.length});case"complete":return t("uploadComplete");case"error":return t("error")}}function gg(i){const{i18n:e,isAllComplete:t,hideCancelButton:a,maxNumberOfFiles:n,toggleAddFilesPanel:s,uppy:o}=i;let{allowNewUpload:r}=i;return r&&n&&(r=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!a?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(fg,i)),r?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>s(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}function vg(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:a,form:n,formState:s}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(r=>{const l=`uppy-Dashboard-FileCard-input-${r.id}`,c=t.includes(r.id);return u("fieldset",{key:r.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},r.name),r.render!==void 0?r.render({value:s[r.id],onChange:d=>a(d,r.id),fieldCSSClasses:o,required:c,form:n.id},u):u("input",{className:o.text,id:l,form:n.id,type:r.type||"text",required:c,value:s[r.id],placeholder:r.placeholder,onInput:d=>a(d.target.value,r.id),"data-uppy-super-focusable":!0}))})}function bg(i){var e;const{files:t,fileCardFor:a,toggleFileCard:n,saveFileCard:s,metaFields:o,requiredMetaFields:r,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:h}=i,b=()=>typeof o=="function"?o(t[a]):o,m=t[a],P=(e=b())!=null?e:[],g=h(m),y={};P.forEach(k=>{var I;y[k.id]=(I=m.meta[k.id])!=null?I:""});const[F,C]=ni(y),O=Qa(k=>{k.preventDefault(),s(F,a)},[s,F,a]),A=(k,I)=>{C({...F,[I]:k})},v=()=>{n(!1)},[S]=ni(()=>{const k=document.createElement("form");return k.setAttribute("tabindex","-1"),k.id=da(),k});return Ya(()=>(document.body.appendChild(S),S.addEventListener("submit",O),()=>{S.removeEventListener("submit",O),document.body.removeChild(S)}),[S,O]),u("div",{className:Se("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:wt,onDragLeave:wt,onDrop:wt,onPaste:wt},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},m.meta?m.meta.name:m.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:S.id,title:c("finishEditingFile"),onClick:v},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:no(m.type).color}},u($c,{file:m}),g&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:k=>{O(k),l(m)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(vg,{computedMetaFields:P,requiredMetaFields:r,updateMeta:A,form:S,formState:F})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:S.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:v,form:S.id},c("cancel")))))}const Wt="uppy-transition-slideDownUp",Sr=250;function Ea(i){let{children:e}=i;const[t,a]=ni(null),[n,s]=ni(""),o=_n(),r=_n(),l=_n(),c=()=>{s(`${Wt}-enter`),cancelAnimationFrame(l.current),clearTimeout(r.current),r.current=void 0,l.current=requestAnimationFrame(()=>{s(`${Wt}-enter ${Wt}-enter-active`),o.current=setTimeout(()=>{s("")},Sr)})},d=()=>{s(`${Wt}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{s(`${Wt}-leave ${Wt}-leave-active`),r.current=setTimeout(()=>{a(null),s("")},Sr)})};return Ya(()=>{const p=vt(e)[0];t!==p&&(p&&!t?c():t&&!p&&!r.current&&d(),a(p))},[e,t]),Ya(()=>()=>{clearTimeout(o.current),clearTimeout(r.current),cancelAnimationFrame(l.current)},[]),t?Bl(t,{className:Se(n,t.props.className)}):null}function jt(){return jt=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a])}return i},jt.apply(this,arguments)}const Pr=900,Fr=700,Nn=576,Cr=330;function yg(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,a=i.containerWidth>Nn,n=i.containerHeight>Cr,s=Se({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>Nn,"uppy-size--lg":i.containerWidth>Fr,"uppy-size--xl":i.containerWidth>Pr,"uppy-size--height-md":i.containerHeight>Cr,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&n});let o=1;i.containerWidth>Pr?o=5:i.containerWidth>Fr?o=4:i.containerWidth>Nn&&(o=3);const r=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(h=>i.files[h].isGhost).length:null,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:s,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&zc(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"×")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),r&&u(gg,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),r?u(pg,{id:i.id,error:i.error,i18n:i.i18n,uppy:i.uppy,files:i.files,acquirers:i.acquirers,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,isWide:i.isWide,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o}):u(Wc,jt({},i,{isSizeMD:a})),u(Ea,null,i.showAddFilesPanel?u(ug,jt({key:"AddFiles"},i,{isSizeMD:a})):null),u(Ea,null,i.fileCardFor?u(bg,jt({key:"FileCard"},i)):null),u(Ea,null,i.activePickerPanel?u(dg,jt({key:"Picker"},i)):null),u(Ea,null,i.showFileEditor?u(hg,jt({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(h=>i.uppy.getPlugin(h.id).render(i.state))))))}const xg={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function X(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var wg=0;function Ge(i){return"__private_"+wg+++"_"+i}const Sg={version:"3.8.3"},Bn=Ao.default||Ao,_r=9,Pg=27;function kr(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const Fg={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:yc,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,doneButtonHandler:null,onRequestCloseModal:null};var kt=Ge("disabledNodes"),rt=Ge("generateLargeThumbnailIfSingleFile"),Oi=Ge("openFileEditorWhenFilesAdded"),Et=Ge("attachRenderFunctionToTarget"),jn=Ge("isTargetSupported"),Ln=Ge("getAcquirers"),zn=Ge("getProgressIndicators"),lt=Ge("getEditors"),$n=Ge("addSpecifiedPluginsFromOptions"),qn=Ge("autoDiscoverPlugins"),Tt=Ge("addSupportedPluginIfNoTarget");let so=class extends he{constructor(e,t){var a,n,s,o;let r;t?t.autoOpen===void 0?r=t.autoOpenFileEditor?"imageEditor":null:r=t.autoOpen:r=null,super(e,{...Fg,...t,autoOpen:r}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${da()}`,this.superFocus=Mf(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=l=>{const d=this.getPluginState().targets.filter(p=>p.id!==l.id);this.setPluginState({targets:d})},this.addTarget=l=>{const c=l.id||l.constructor.name,d=l.title||c,p=l.type;if(p!=="acquirer"&&p!=="progressindicator"&&p!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const h={id:c,name:d,type:p},m=this.getPluginState().targets.slice();return m.push(h),this.setPluginState({targets:m}),this.el},this.hideAllPanels=()=>{var l;const c=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};c.activePickerPanel===d.activePickerPanel&&c.showAddFilesPanel===d.showAddFilesPanel&&c.showFileEditor===d.showFileEditor&&c.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(l=c.activePickerPanel)==null?void 0:l.id))},this.showPanel=l=>{const{targets:c}=this.getPluginState(),d=c.find(p=>p.type==="acquirer"&&p.id===l);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",l)},this.canEditFile=l=>{const{targets:c}=this.getPluginState();return X(this,lt)[lt](c).some(p=>this.uppy.getPlugin(p.id).canEditFile(l))},this.openFileEditor=l=>{const{targets:c}=this.getPluginState(),d=X(this,lt)[lt](c);this.setPluginState({showFileEditor:!0,fileCardFor:l.id||null,activeOverlayType:"FileEditor"}),d.forEach(p=>{this.uppy.getPlugin(p.id).selectFile(l)})},this.closeFileEditor=()=>{const{metaFields:l}=this.getPluginState();l&&l.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:l}=this.getPluginState();X(this,lt)[lt](l).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{const{promise:l,resolve:c}=kr();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const d=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",d,!1),c()};this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),c();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),l},this.closeModal=l=>{var c;const d=(c=l==null?void 0:l.manualClose)!=null?c:!0,{isHidden:p,isClosing:h}=this.getPluginState();if(p||h)return;const{promise:b,resolve:m}=kr();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const g=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",g,!1),m()};this.el.addEventListener("animationend",g,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),m();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var P;(P=history.state)!=null&&P[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),b},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=l=>{const{capabilities:c}=this.uppy.getState();this.uppy.setState({capabilities:{...c,darkMode:l}})},this.handleSystemDarkModeChange=l=>{const c=l.matches;this.uppy.log(`[Dashboard] Dark mode is ${c?"on":"off"}`),this.setDarkModeCapability(c)},this.toggleFileCard=(l,c)=>{const d=this.uppy.getFile(c);l?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:l?c:null,activeOverlayType:l?"FileCard":null})},this.toggleAddFilesPanel=l=>{this.setPluginState({showAddFilesPanel:l,activeOverlayType:l?"AddFiles":null})},this.addFiles=l=>{const c=l.map(d=>({source:this.id,name:d.name,type:d.type,data:d,meta:{relativePath:d.relativePath||d.webkitRelativePath||null}}));try{this.uppy.addFiles(c)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(l=>{const c=l[0],{width:d,height:p}=c.contentRect;this.setPluginState({containerWidth:d,containerHeight:p,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const l=this.getPluginState(),c=!this.opts.inline&&l.isHidden;!l.areInsidesReadyToBeVisible&&!c&&(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=l=>{this.el.contains(l.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=l=>{var c;const d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],p=(c=X(this,kt)[kt])!=null?c:Ye(this.el.querySelectorAll(d)).filter(h=>!h.classList.contains("uppy-Dashboard-close"));for(const h of p)h.tagName==="A"?h.setAttribute("aria-disabled",l):h.disabled=l;l?X(this,kt)[kt]=p:X(this,kt)[kt]=null,this.dashboardIsDisabled=l},this.updateBrowserHistory=()=>{var l;(l=history.state)!=null&&l[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=l=>{var c;this.isModalOpen()&&(!l.state||!l.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(c=l.state)!=null&&c[this.modalName]&&history.back()},this.handleKeyDownInModal=l=>{l.keyCode===Pg&&this.requestCloseModal(),l.keyCode===_r&&Lc(l,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=l=>{this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootPaste==null||d.handleRootPaste(l))});const c=Ye(l.clipboardData.files);c.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(c))},this.handleInputChange=l=>{l.preventDefault();const c=Ye(l.target.files);c.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(c))},this.handleDragOver=l=>{var c,d;l.preventDefault(),l.stopPropagation();const p=()=>{let P=!0;return this.uppy.iteratePlugins(g=>{g.canHandleRootDrop!=null&&g.canHandleRootDrop(l)&&(P=!0)}),P},h=()=>{const{types:P}=l.dataTransfer;return P.some(g=>g==="Files")},b=p(),m=h();if(!b&&!m||this.opts.disabled||this.opts.disableLocalFiles&&(m||!b)||!this.uppy.getState().allowNewUpload){l.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}l.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(c=(d=this.opts).onDragOver)==null||c.call(d,l)},this.handleDragLeave=l=>{var c,d;l.preventDefault(),l.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(c=(d=this.opts).onDragLeave)==null||c.call(d,l)},this.handleDrop=async l=>{var c,d;l.preventDefault(),l.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(m=>{m.type==="acquirer"&&(m.handleRootDrop==null||m.handleRootDrop(l))});let p=!1;const h=m=>{this.uppy.log(m,"error"),p||(this.uppy.info(m.message,"error"),p=!0)};this.uppy.log("[Dashboard] Processing dropped files");const b=await ao(l.dataTransfer,{logDropError:h});b.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(b)),(c=(d=this.opts).onDrop)==null||c.call(d,l)},this.handleRequestThumbnail=l=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",l)},this.handleCancelThumbnail=l=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",l)},this.handleKeyDownInInline=l=>{l.keyCode===_r&&If(l,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=l=>{this.el.contains(document.activeElement)&&this.handlePaste(l)},this.handleComplete=l=>{let{failed:c}=l;this.opts.closeAfterFinish&&!(c!=null&&c.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,rt,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const l=600,c=this.uppy.getFiles();if(c.length===1){const d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d==null||d.setOptions({thumbnailWidth:l});const p={...c[0],preview:void 0};d==null||d.requestThumbnail(p).then(()=>{d==null||d.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Oi,{writable:!0,value:l=>{const c=l[0],{metaFields:d}=this.getPluginState(),p=d&&d.length>0,h=this.canEditFile(c);p&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,c.id):h&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(c)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const l=yr(this.opts.trigger);l?l.forEach(c=>c.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",X(this,Tt)[Tt]),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",X(this,rt)[rt]),this.uppy.on("file-removed",X(this,rt)[rt]),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",X(this,Oi)[Oi])},this.removeEvents=()=>{const l=yr(this.opts.trigger);!this.opts.inline&&l&&l.forEach(c=>c.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",X(this,Tt)[Tt]),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",X(this,rt)[rt]),this.uppy.off("file-removed",X(this,rt)[rt]),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",X(this,Oi)[Oi])},this.superFocusOnEachUpdate=()=>{const l=this.el.contains(document.activeElement),c=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,p=!this.opts.inline;d&&(p||l||c&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(l,c)=>{this.uppy.setFileMeta(c,l),this.toggleFileCard(!1,c)},Object.defineProperty(this,Et,{writable:!0,value:l=>{const c=this.uppy.getPlugin(l.id);return{...l,icon:c.icon||this.opts.defaultPickerIcon,render:c.render}}}),Object.defineProperty(this,jn,{writable:!0,value:l=>{const c=this.uppy.getPlugin(l.id);return typeof c.isSupported!="function"?!0:c.isSupported()}}),Object.defineProperty(this,Ln,{writable:!0,value:Bn(l=>l.filter(c=>c.type==="acquirer"&&X(this,jn)[jn](c)).map(X(this,Et)[Et]))}),Object.defineProperty(this,zn,{writable:!0,value:Bn(l=>l.filter(c=>c.type==="progressindicator").map(X(this,Et)[Et]))}),Object.defineProperty(this,lt,{writable:!0,value:Bn(l=>l.filter(c=>c.type==="editor").map(X(this,Et)[Et]))}),this.render=l=>{const c=this.getPluginState(),{files:d,capabilities:p,allowNewUpload:h}=l,{newFiles:b,uploadStartedFiles:m,completeFiles:P,erroredFiles:g,inProgressFiles:y,inProgressNotPausedFiles:F,processingFiles:C,isUploadStarted:O,isAllComplete:A,isAllErrored:v,isAllPaused:S}=this.uppy.getObjectOfFilesPerState(),k=X(this,Ln)[Ln](c.targets),I=X(this,zn)[zn](c.targets),B=X(this,lt)[lt](c.targets);let V;return this.opts.theme==="auto"?V=p.darkMode?"dark":"light":V=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),yg({state:l,isHidden:c.isHidden,files:d,newFiles:b,uploadStartedFiles:m,completeFiles:P,erroredFiles:g,inProgressFiles:y,inProgressNotPausedFiles:F,processingFiles:C,isUploadStarted:O,isAllComplete:A,isAllErrored:v,isAllPaused:S,totalFileCount:Object.keys(d).length,totalProgress:l.totalProgress,allowNewUpload:h,acquirers:k,theme:V,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:c.activePickerPanel,showFileEditor:c.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:c.isClosing,progressindicators:I,editors:B,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:l.recoveredState,metaFields:c.metaFields,resumableUploads:p.resumableUploads||!1,individualCancellation:p.individualCancellation,isMobileDevice:p.isMobileDevice,fileCardFor:c.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:c.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:c.containerWidth,containerHeight:c.containerHeight,areInsidesReadyToBeVisible:c.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,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:c.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,$n,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach(c=>{const d=this.uppy.getPlugin(c);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${c}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,qn,{writable:!0,value:()=>{this.uppy.iteratePlugins(X(this,Tt)[Tt])}}),Object.defineProperty(this,Tt,{writable:!0,value:l=>{var c;const d=["acquirer","editor"];l&&!((c=l.opts)!=null&&c.target)&&d.includes(l.type)&&(this.getPluginState().targets.some(h=>l.id===h.id)||l.mount(this,l))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:l,closeAfterFinish:c}=this.opts;if(l&&c)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:d,allowMultipleUploadBatches:p}=this.uppy.opts;(d||p)&&c&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:h}=this.opts;h&&this.mount(h,this),this.opts.disableStatusBar||this.uppy.use(Ys,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(_c,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(io,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const b=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${b?"on":"off"}`),this.setDarkModeCapability(b),this.opts.theme==="auto"){var m;(m=this.darkModeMediaQuery)==null||m.addListener(this.handleSystemDarkModeChange)}X(this,$n)[$n](),X(this,qn)[qn](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const d=this.uppy.getPlugin(`${this.id}:Informer`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableStatusBar){const d=this.uppy.getPlugin(`${this.id}:StatusBar`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableThumbnailGenerator){const d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d&&this.uppy.removePlugin(d)}if((this.opts.plugins||[]).forEach(d=>{const p=this.uppy.getPlugin(d);p&&p.unmount()}),this.opts.theme==="auto"){var c;(c=this.darkModeMediaQuery)==null||c.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=xg,(n=(a=this.opts).doneButtonHandler)!=null||(a.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),(o=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}};so.VERSION=Sg.version;const ci=D.instanceOf(Ql),Gc=D.arrayOf(D.string),cn=D.shape({strings:D.object,pluralize:D.func}),Cg=D.shape({id:D.string.isRequired,name:D.string.isRequired,placeholder:D.string}),Kc=D.oneOfType([D.arrayOf(Cg),D.func]),en=D.oneOfType([D.string,D.number]),_g=["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"],kg=/^(aria-|data-)/,fa=i=>Object.fromEntries(Object.entries(i).filter(e=>{let[t]=e;return kg.test(t)||_g.includes(t)}));function ga(i,e){return Object.keys(i).some(t=>!Object.hasOwn(i,t)&&i[t]!==e[t])}class Xc extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(ga(this.props,e)){const{uppy:t,...a}={...this.props,target:this.container};this.plugin.setOptions(a)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,...t}={id:"react:Dashboard",inline:!0,...this.props,target:this.container};e.use(so,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){e===void 0&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return ee.createElement("div",{className:"uppy-Container",ref:e=>{this.container=e},...fa(this.props)})}}Xc.propsTypes={uppy:ci,disableInformer:D.bool,disableStatusBar:D.bool,disableThumbnailGenerator:D.bool,height:en,hideProgressAfterFinish:D.bool,hideUploadButton:D.bool,locale:cn,metaFields:Kc,note:D.string,plugins:Gc,proudlyDisplayPoweredByUppy:D.bool,showProgressDetails:D.bool,width:en,thumbnailType:D.string,thumbnailWidth:D.number};class Yc extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){const{uppy:t,open:a,onRequestClose:n}=this.props;if(e.uppy!==t)this.uninstallPlugin(e),this.installPlugin();else if(ga(this.props,e)){const{uppy:s,...o}={...this.props,inline:!1,onRequestCloseModal:n};this.plugin.setOptions(o)}e.open&&!a?this.plugin.closeModal():!e.open&&a&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{target:e=this.container,open:t,onRequestClose:a,uppy:n,...s}=this.props,o={...s,id:"react:DashboardModal",inline:!1,target:e,open:t,onRequestCloseModal:a};n.use(so,o),this.plugin=n.getPlugin(o.id),t&&this.plugin.openModal()}uninstallPlugin(e){e===void 0&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return ee.createElement("div",{className:"uppy-Container",ref:e=>{this.container=e},...fa(this.props)})}}Yc.propTypes={uppy:ci.isRequired,target:typeof window<"u"?D.instanceOf(window.HTMLElement):D.any,open:D.bool,onRequestClose:D.func,closeModalOnClickOutside:D.bool,disablePageScrollWhenModalOpen:D.bool,plugins:Gc,width:en,height:en,showProgressDetails:D.bool,note:D.string,metaFields:Kc,proudlyDisplayPoweredByUppy:D.bool,autoOpenFileEditor:D.bool,animateOpenClose:D.bool,browserBackButtonClose:D.bool,closeAfterFinish:D.bool,disableStatusBar:D.bool,disableInformer:D.bool,disableThumbnailGenerator:D.bool,disableLocalFiles:D.bool,disabled:D.bool,hideCancelButton:D.bool,hidePauseResumeButton:D.bool,hideProgressAfterFinish:D.bool,hideRetryButton:D.bool,hideUploadButton:D.bool,showLinkToFileUploadResult:D.bool,showRemoveButtonAfterComplete:D.bool,showSelectedFiles:D.bool,waitForThumbnailsBeforeUpload:D.bool,fileManagerSelectionType:D.string,theme:D.string,thumbnailType:D.string,thumbnailWidth:D.number,locale:cn};Yc.defaultProps={metaFields:[],plugins:[],width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,open:void 0,target:void 0,locale:null,onRequestClose:void 0};const Eg={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},Tg={version:"3.1.0"},Og={inputName:"files[]",width:"100%",height:"100%"};let Qc=class Jc extends he{constructor(e,t){super(e,{...Og,...t}),this.isDragDropSupported=zc(),this.addFiles=a=>{const n=a.map(s=>({source:this.id,name:s.name,type:s.type,data:s,meta:{relativePath:s.relativePath||null}}));try{this.uppy.addFiles(n)}catch(s){this.uppy.log(s)}},this.onInputChange=a=>{const n=Ye(a.target.files);n.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(n)),a.target.value=null},this.handleDragOver=a=>{var n,s;a.preventDefault(),a.stopPropagation();const{types:o}=a.dataTransfer,r=o.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!r||!l){a.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}a.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(n=(s=this.opts).onDragOver)==null||n.call(s,a)},this.handleDragLeave=a=>{var n,s;a.preventDefault(),a.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(n=(s=this.opts).onDragLeave)==null||n.call(s,a)},this.handleDrop=async a=>{var n,s;a.preventDefault(),a.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const o=l=>{this.uppy.log(l,"error")},r=await ao(a.dataTransfer,{logDropError:o});r.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(r)),(n=(s=this.opts).onDrop)==null||n.call(s,a)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=Eg,this.i18nInit()}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:t=>{this.fileInputRef=t},name:this.opts.inputName,multiple:e.maxNumberOfFiles!==1,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},u("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return u("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:u("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return u("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset
@@ -42,7 +42,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
42
42
  * Copyright(c) 2014 Jonathan Ong
43
43
  * Copyright(c) 2015 Douglas Christopher Wilson
44
44
  * MIT Licensed
45
- */(function(i){var e=Yy,t=Fu.extname,a=/^\s*([^;\s]*)(?:;|\s|$)/,n=/^text\//i;i.charset=s,i.charsets={lookup:s},i.contentType=o,i.extension=r,i.extensions=Object.create(null),i.lookup=l,i.types=Object.create(null),c(i.extensions,i.types);function s(d){if(!d||typeof d!="string")return!1;var p=a.exec(d),h=p&&e[p[1].toLowerCase()];return h&&h.charset?h.charset:p&&n.test(p[1])?"UTF-8":!1}function o(d){if(!d||typeof d!="string")return!1;var p=d.indexOf("/")===-1?i.lookup(d):d;if(!p)return!1;if(p.indexOf("charset")===-1){var h=i.charset(p);h&&(p+="; charset="+h.toLowerCase())}return p}function r(d){if(!d||typeof d!="string")return!1;var p=a.exec(d),h=p&&i.extensions[p[1].toLowerCase()];return!h||!h.length?!1:h[0]}function l(d){if(!d||typeof d!="string")return!1;var p=t("x."+d).toLowerCase().substr(1);return p&&i.types[p]||!1}function c(d,p){var h=["nginx","apache",void 0,"iana"];Object.keys(e).forEach(function(m){var P=e[m],g=P.extensions;if(!(!g||!g.length)){d[m]=g;for(var y=0;y<g.length;y++){var F=g[y];if(p[F]){var C=h.indexOf(e[p[F]].source),O=h.indexOf(P.source);if(p[F]!=="application/octet-stream"&&(C>O||C===O&&p[F].substr(0,12)==="application/"))continue}p[F]=m}}})}})(Xp);const zi=tt(Xp);function Qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function wl(i,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,Yp(a.key),a)}}function Jy(i,e,t){return e&&wl(i.prototype,e),t&&wl(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Vt(i){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(i)}function Sl(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,a)}return t}function ge(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sl(Object(t),!0).forEach(function(a){Zy(i,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Sl(Object(t)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(t,a))})}return i}function Zy(i,e,t){return e=Yp(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Yp(i){var e=ex(i,"string");return Vt(e)=="symbol"?e:e+""}function ex(i,e){if(Vt(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var a=t.call(i,e||"default");if(Vt(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Qp(i,e){return nx(i)||ax(i,e)||ix(i,e)||tx()}function tx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
45
+ */(function(i){var e=Yy,t=Eu.extname,a=/^\s*([^;\s]*)(?:;|\s|$)/,n=/^text\//i;i.charset=s,i.charsets={lookup:s},i.contentType=o,i.extension=r,i.extensions=Object.create(null),i.lookup=l,i.types=Object.create(null),c(i.extensions,i.types);function s(d){if(!d||typeof d!="string")return!1;var p=a.exec(d),h=p&&e[p[1].toLowerCase()];return h&&h.charset?h.charset:p&&n.test(p[1])?"UTF-8":!1}function o(d){if(!d||typeof d!="string")return!1;var p=d.indexOf("/")===-1?i.lookup(d):d;if(!p)return!1;if(p.indexOf("charset")===-1){var h=i.charset(p);h&&(p+="; charset="+h.toLowerCase())}return p}function r(d){if(!d||typeof d!="string")return!1;var p=a.exec(d),h=p&&i.extensions[p[1].toLowerCase()];return!h||!h.length?!1:h[0]}function l(d){if(!d||typeof d!="string")return!1;var p=t("x."+d).toLowerCase().substr(1);return p&&i.types[p]||!1}function c(d,p){var h=["nginx","apache",void 0,"iana"];Object.keys(e).forEach(function(m){var P=e[m],g=P.extensions;if(!(!g||!g.length)){d[m]=g;for(var y=0;y<g.length;y++){var F=g[y];if(p[F]){var C=h.indexOf(e[p[F]].source),O=h.indexOf(P.source);if(p[F]!=="application/octet-stream"&&(C>O||C===O&&p[F].substr(0,12)==="application/"))continue}p[F]=m}}})}})(Xp);const zi=tt(Xp);function Qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function wl(i,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,Yp(a.key),a)}}function Jy(i,e,t){return e&&wl(i.prototype,e),t&&wl(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Vt(i){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vt(i)}function Sl(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,a)}return t}function ge(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sl(Object(t),!0).forEach(function(a){Zy(i,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Sl(Object(t)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(t,a))})}return i}function Zy(i,e,t){return e=Yp(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Yp(i){var e=ex(i,"string");return Vt(e)=="symbol"?e:e+""}function ex(i,e){if(Vt(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var a=t.call(i,e||"default");if(Vt(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function Qp(i,e){return nx(i)||ax(i,e)||ix(i,e)||tx()}function tx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46
46
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ix(i,e){if(i){if(typeof i=="string")return Pl(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Pl(i,e)}}function Pl(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=i[t];return a}function ax(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var a,n,s,o,r=[],l=!0,c=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(a=s.call(t)).done)&&(r.push(a.value),r.length!==e);l=!0);}catch(d){c=!0,n=d}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw n}}return r}}function nx(i){if(Array.isArray(i))return i}/**
47
47
  * @module xbytes
48
48
  * @license Apache-2.0
@@ -52,5 +52,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
52
52
  <div class="uppy-ProviderBrowserItem-inner uploaded-add-item">
53
53
  <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="#ffffff"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>
54
54
  </div>
55
- `,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));ke(this,"convertImgToObject",Zn(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(c=>c.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=yx(s.originalname),[".mp4",".webm"].find(c=>{var d;return((d=a.src)==null?void 0:d.indexOf(c))>-1})){const c=document.createElement("video");c.src=a.src,c.width=a.width,c.height=a.height,c.autoplay=!0,c.setAttribute("playsinline","playsinline"),c.muted=!0,c.loop=!0,c.style="pointer-events: none;",o.appendChild(c)}else{const c=document.createElement("object");c.data=n,c.type=s.mimetype||"image/png",c.alt=s.originalname,c.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",c.loading="lazy",o.appendChild(c)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));ke(this,"resetState",()=>{this.uploadedAPIData={...kl},this.uploaded.setPluginState({...El}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...kl},this.addUploadItemFlag=!0,this.icon=()=>ce("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[ce("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),ce("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),ce("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),ce("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),ce("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new Xs(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...El}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const Sx=wx,Tl={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,folderId:"",componentDid:"",components:[]},Ol={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},au={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},Px={...au,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class Fx extends he{constructor(t,a){super(t,a);ke(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await di.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=jl([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=sn(s);return n=sn(s,400),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});ke(this,"resetState",()=>{this.apiData={...Tl},this.resources.setPluginState({...Ol})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Tl},this.icon=()=>ce("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[ce("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),ce("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),ce("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),ce("div",{id:"resources",className:"uploaded",children:[ce("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>ce("button",{style:this.apiData.componentDid===a.did?Px:au,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Tu(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new Xs(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...Ol}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("uploaded:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}const Cx=Fx;var _x=fu();const kx=tt(_x);class Ex extends he{constructor(t,a){super(t,{...{},...a});ke(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=kx.createHash("md5").update(await r.text()).digest("hex"),c=js(n),d=`${l}${c?`.${c}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});ke(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});ke(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.setMetaData(t)});ke(this,"tryDownloadRemoteFile",async t=>{var O,A;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:c,isLoading:d,remote:p,meta:h,errorCount:b=0}=t,m=!d&&r,P=`uploader:${c}:downloaded`,g=js(t),y=(O=n==null?void 0:n.split("?"))==null?void 0:O[0],C=(()=>{const v=["jpg","jpeg"];return v.includes(g)&&v.some(S=>y==null?void 0:y.endsWith(S))?!0:y==null?void 0:y.endsWith(g)})()?y:`${y}${g?`.${g}`:""}`;if(m){const v=mx(s||((A=p==null?void 0:p.body)==null?void 0:A.url));if(b>=3)throw new Error("Download remote file failure");this.uppy.setFileState(c,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await di.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:v}}).then(S=>S==null?void 0:S.data).then(async S=>{const k=dx(S,C);this.uppy.setFileState(c,{name:C,extension:g,type:a,data:k,preview:s||Fl(k),source:o,size:k.size,isDownloading:!1,isRemote:!1,meta:{...h,name:C,filename:C}}),this.uppy.getFile(c),this.uppy.emit(P,c)}).catch(async S=>{console.error("Axios download remote file error: ",S),this.uppy.setFileState(c,{isRemote:!0,isLoading:!1,errorCount:b+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(c))})}else l&&await(async()=>new Promise(S=>{this.uppy.once(P,async()=>{S()})}))()});ke(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Fl(s)})},o.indexOf("gif")>-1?1e3:0)}});ke(this,"prepareUpload",t=>{const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"DownloadRemoteFiles",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}const Tx=Ex;class Ox extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>ce("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:ce("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[ce("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),ce("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return ce("div",{id:"ai-image",className:"ai-image",children:ce("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const Dx=Ox,Ax="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Ux=ee.lazy(()=>Ml(()=>import("./index-DKkTRBZn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url)),Dl="uploader-container",Ra="uploader-dashboard",Ls=localStorage.getItem("uppy_debug"),Rx=i=>{var r;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a}=i,n=iu(e==null?void 0:e.companion),s=async l=>(await di.post("/api/image/generations",l)).data,o={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:wp,options:{quality:1},alwayUse:!0},(Ls||Qi()&&!Cl())&&{id:"Uploaded",plugin:Sx,options:{params:a==null?void 0:a.params}},(Ls||Qi()&&!Cl())&&{id:"Resources",plugin:Cx,options:{params:a==null?void 0:a.params}},Qi()&&fx()&&t.AIImage&&{id:"AIImage",plugin:Dx,options:{companionUrl:n},onShowPanel:l=>{function c(){setTimeout(()=>{var p,h;const d=document.getElementById("ai-image");d?Su(d).render(Me.jsx(Ux,{api:s,restrictions:o,i18n:(h=(p=l.current)==null?void 0:p.getUploader())==null?void 0:h.i18n,onSelect:b=>{const m=l.current.getUploader();m==null||m.emit("ai-image:selected",b),b.forEach((P,g)=>{const y=`AI Image [${g+1}].png`,F={name:y,type:"image/png",data:hx(P,y),source:"AIImage",isRemote:!1};m==null||m.addFile(F)})}})):c()},100)}c()}},{id:"Url",plugin:ha,options:{companionUrl:n}},{id:"Webcam",plugin:tc,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((r=window==null?void 0:window.blocklet)!=null&&r.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:wc,options:{companionUrl:n,companionHeaders:{},companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:Tx,options:{companionUrl:n},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:io,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function _o(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:c,pluginList:d,restrictions:p}=i,h=Ll(d,"id"),b=iu(r==null?void 0:r.uploader);let m=new Ql({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Ls||""),locale:Ky[a||"en"],...o,restrictions:p}).use(Kp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:b,async onBeforeRequest(P,g){var v;const{hashFileName:y,id:F,meta:C}=g,O=js(g);P.setHeader("x-uploader-file-name",`${y}`),P.setHeader("x-uploader-file-id",`${F}`),P.setHeader("x-uploader-file-ext",`${O}`),P.setHeader("x-uploader-base-url",new URL(P.getURL()).pathname),P.setHeader("x-uploader-endpoint-url",b),P.setHeader("x-uploader-metadata",JSON.stringify(C,(S,k)=>typeof k=="string"?encodeURIComponent(k):k));const A=(window==null?void 0:window.uploaderComponentId)||((v=window==null?void 0:window.blocklet)==null?void 0:v.componentId);A&&P.setHeader("x-component-did",(A||"").split("/").pop())},onAfterResponse:async(P,g)=>{const y={},F=P.getUnderlyingObject();try{F.response&&(y.data=JSON.parse(F.response))}catch{y.data={}}y.method=P.getMethod().toUpperCase(),y.url=P.getURL(),y.status=F.status,y.headers={...P._headers};const C=F.getAllResponseHeaders();if(C&&C.split(`\r
56
- `).forEach(S=>{const[k,I]=S.split(": ");k&&I&&(y.headers[k]=I)}),["PATCH","POST"].includes(y.method)&&[200,500].includes(y.status)){const v=[!0,"true"].includes(y.headers["x-uploader-file-exist"]),S=vx(y.url,y.headers["x-uploader-file-name"]),k=m.getFile(y.headers["x-uploader-file-id"]);y.file=k,y.uploadURL=S,v&&k&&(y.method==="POST"&&m.pauseResume(k.id),m.emit("upload-success",k,{uploadURL:S}),m.calculateTotalProgress()),y.status===200&&(await(s==null?void 0:s(y)),m.emitUploadSuccess(k,y))}n&&await(n==null?void 0:n(F));const O=m.getState().totalProgress===100,A=m.getFiles().every(v=>v.source==="DropTarget");O&&A&&m.close()},...l});return c&&m.use(sp,{target:document.body,onDrop:P=>{var g;(g=m==null?void 0:m.open)==null||g.call(m)},...c}),t==null||t.forEach(P=>{if(P){const{plugin:g,options:y}=h[P]||{};g&&m.use(g,y)}}),bx(m),m}const zs=ee.forwardRef((i,e)=>{const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,...i==null?void 0:i.apiPathProps},a=gu({open:!1,uppy:null,availablePluginMap:{},restrictions:{}}),n=Rx({...i,apiPathProps:t,availablePluginMap:a.availablePluginMap,restrictions:a.restrictions}),{plugins:s=n.map(v=>v.id),id:o="Uploader",popup:r=!1,uploadedProps:l,onOpen:c,onClose:d,locale:p,installerProps:h}=i,b=Ll(n,"id"),m=vu(v=>{var S;return(S=v==null?void 0:v.breakpoints)==null?void 0:S.down("md")}),P=Oo([...s,...n.filter(v=>v.alwayUse).map(v=>v.id)]);ee.useLayoutEffect(()=>{Qi()&&!t.disableMediaKitPrefix&&di.get("/api/uploader/status").then(({data:v})=>{var k,I,B,V,K;a.availablePluginMap=v.availablePluginMap;const S=(bu((k=i==null?void 0:i.coreProps)==null?void 0:k.restrictions)?v.restrictions:(I=i==null?void 0:i.coreProps)==null?void 0:I.restrictions)||{};!((B=S==null?void 0:S.allowedFileTypes)!=null&&B.length)&&(S!=null&&S.allowedFileExts)&&(S.allowedFileTypes=Oo((K=(V=(typeof(S==null?void 0:S.allowedFileExts)=="string"?S==null?void 0:S.allowedFileExts.split(","):S==null?void 0:S.allowedFileExts)||[])==null?void 0:V.map($=>zi.lookup(($==null?void 0:$.replaceAll(" ",""))||"")))==null?void 0:K.filter($=>$)),delete S.allowedFileExts),S.maxFileSize&&typeof S.maxFileSize=="string"&&(S.maxFileSize=G.parseSize(S.maxFileSize,{iec:!1})||void 0),a.restrictions=S})},[]),Cu("esc",v=>{a.open&&(v.stopPropagation(),v.preventDefault(),F())},{useCapture:!0}),ee.useEffect(()=>{a.uppy=_o({...i,id:o,plugins:P,apiPathProps:t,pluginList:n,restrictions:a.restrictions}),a.uppy.open=y,a.uppy.close=F,a.uppy.openPlugin=g,a.uppy.on("dashboard:show-panel",v=>{const{onShowPanel:S}=b[v];S==null||S(e)}),(P.includes("Uploaded")||P.includes("Resources"))&&(a.uppy.off("uploaded:selected"),a.uppy.on("uploaded:selected",v=>{var S;v.forEach(k=>{a.uppy.emitUploadSuccess({id:k._id},{data:k,isMock:!0})}),(S=l==null?void 0:l.onSelectedFiles)==null||S.call(l,v),F()}))},[JSON.stringify({id:o,plugins:P,apiPathProps:t,locale:p,restrictions:a.restrictions})]);function g(v){var S,k,I;if(v=v.replace(/\s/g,""),["MyDevice",...P].map(B=>B.toLowerCase()).includes(v.toLowerCase())){let B=`div[data-uppy-acquirer-id="${v}"] > button`;(I=(k=(S=document==null?void 0:document.getElementById(Ra))==null?void 0:S.querySelector(B))==null?void 0:k.click)==null||I.call(k)}}function y(v){var k,I,B,V;a.open=!0,v&&setTimeout(()=>{g(v)},200),a.uppy.emitOpen(),c==null||c(),(I=(k=document.activeElement)==null?void 0:k.blur)==null||I.call(k);const S=a.uppy.getPlugin(Ra).el;(B=S==null?void 0:S.focus)==null||B.call(S),(V=S==null?void 0:S.click)==null||V.call(S)}function F(){var v;(v=a.uppy.getPlugin(Ra))==null||v.hideAllPanels(),a.open=!1,a.uppy.emitClose(),d==null||d(),setTimeout(()=>{a.uppy.getState().totalProgress===100&&(a.uppy.setState({files:{},currentUploads:{}}),a.uppy.calculateTotalProgress())},500)}ee.useImperativeHandle(e,()=>({getUploader:()=>a.uppy,open:y,close:F})),ee.useEffect(()=>{gx(t.disableMediaKitPrefix)},[t.disableMediaKitPrefix]);const C=r?wu:ee.Fragment,O=r?{sx:{zIndex:99999999999,background:"rgba(0,0,0,0.5)","& > *":{display:a.open?"block":"none"}},invisible:!0,open:a.open,onClick:v=>{document.activeElement===document.body&&(v.stopPropagation(),F())},...i.wrapperProps}:{...i.wrapperProps},A=m?"42px":"40px";return Me.jsx(C,{...O,children:Me.jsxs(Eu,{onClose:F,did:Ax,...h,children:[Me.jsx(yu,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),Me.jsxs(Nl,{id:Dl,onClick:v=>v.stopPropagation(),sx:{position:"relative",width:m?"90vw":720,".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{background:"repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px !important"},".uploaded-add-item":{background:"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:"rgba(0,0,0,0.13)"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{background:"#fff",height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}}},children:[Me.jsx(xu,{"aria-label":"close",onClick:F,sx:{color:"#fafafa",position:"absolute",...m?{bottom:`calc(0px - ${A} - 16px)`,left:`calc(50vw - ${A} - 8px)`}:{right:`calc(0px - ${A} - 16px)`,top:-12}},children:Me.jsx(Ou,{sx:{fontSize:A}})}),a.uppy&&Me.jsx(Xc,{inline:!0,target:`#${Dl}`,id:Ra,uppy:a.uppy,plugins:P,fileManagerSelectionType:"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,note:"",doneButtonHandler:F,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),Ix=Object.freeze(Object.defineProperty({__proto__:null,Uploader:zs,default:zs,initUploader:_o},Symbol.toStringTag,{value:"Module"})),Mx=ee.lazy(()=>Ml(()=>Promise.resolve().then(()=>Ix),void 0,import.meta.url).then(i=>({default:i.Uploader}))),ko=ee.createContext(null);function nu(){const i=ee.useContext(ko);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function Nx({onChange:i,children:e,...t}){const a=nu(),n=()=>{var o;const s=(o=a==null?void 0:a.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return Me.jsx(Nl,{onClick:n,...t,children:e})}function Bx({children:i,...e}){const t=ee.useRef(null);return Me.jsxs(ko.Provider,{value:t,children:[i,Pu.createPortal(Me.jsx(Mx,{ref:t,popup:!0,...e},"uploader"),document.body)]})}const s0=Object.freeze(Object.defineProperty({__proto__:null,Uploader:zs,UploaderContext:ko,UploaderProvider:Bx,UploaderTrigger:Nx,initUploader:_o,useUploaderContext:nu},Symbol.toStringTag,{value:"Module"}));export{fx as g,s0 as r};
55
+ `,a.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),t.insertBefore(a,t.firstChild),this.addUploadItemFlag=!1}}},{wait:200}));ke(this,"convertImgToObject",Zn(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(a=>{var l;if(!(a!=null&&a.src))return;const{src:n}=a,s=(l=this.uploadedAPIData.files)==null?void 0:l.find(c=>c.previewUrl===n),o=document.createElement("div");o.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const r=document.createElement("div");if(r.className="uppy-ProviderBrowserItem-name",r.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",r.innerHTML=yx(s.originalname),[".mp4",".webm"].find(c=>{var d;return((d=a.src)==null?void 0:d.indexOf(c))>-1})){const c=document.createElement("video");c.src=a.src,c.width=a.width,c.height=a.height,c.autoplay=!0,c.setAttribute("playsinline","playsinline"),c.muted=!0,c.loop=!0,c.style="pointer-events: none;",o.appendChild(c)}else{const c=document.createElement("object");c.data=n,c.type=s.mimetype||"image/png",c.alt=s.originalname,c.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",c.loading="lazy",o.appendChild(c)}o.appendChild(r),a.parentNode.replaceChild(o,a)}),this.canConvertImgToObject=!1)},{wait:200}));ke(this,"resetState",()=>{this.uploadedAPIData={...kl},this.uploaded.setPluginState({...El}),this.addUploadItemFlag=!0});this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.uploadedAPIData={...kl},this.addUploadItemFlag=!0,this.icon=()=>ce("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[ce("path",{d:"M145.6 0c-44.8 0-80 36.8-80 81.6V944c0 44.8 35.2 80 80 80h732.8c44.8 0 81.6-35.2 81.6-80V326.4L657.6 0h-512z",fill:"#49C9A7"}),ce("path",{d:"M960 326.4v16H755.2s-100.8-20.8-99.2-108.8c0 0 4.8 92.8 97.6 92.8H960z",fill:"#49C9A7"}),ce("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),ce("path",{d:"M225.6 859.2V524.8H560v334.4H225.6z m300.8-300.8H259.2v201.6h267.2V558.4z m-153.6 134.4l62.4-84.8 20.8 33.6 20.8-6.4 16 89.6H283.2l56-52.8 33.6 20.8z m-60.8-59.2c-14.4 0-27.2-9.6-27.2-24 0-12.8 12.8-24 27.2-24 14.4 0 25.6 11.2 25.6 24 0 14.4-11.2 24-25.6 24z",fill:"#FFFFFF"})]})}render(t){var a;return!this.uploadedAPIData.loading&&((a=this.uploadedAPIData.files)==null?void 0:a.length)===0&&this.queryUploadedFromMediaKit(),ce("div",{id:"uploaded",className:"uploaded",children:this.view.render(t)})}update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}install(){this.view=new Xs(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...El}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.uploaded.getPluginState(),o=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l._id===n._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(l=>l._id!==n._id)]}):(r||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,n]}))},this.view.donePicking=()=>{const{currentSelection:a}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",a),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=a=>{const{scrollHeight:n,scrollTop:s,offsetHeight:o}=a.target;n-(s+o)<30&&this.queryUploadedFromMediaKit()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}const Sx=wx,Tl={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,folderId:"",componentDid:"",components:[]},Ol={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},au={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",border:"1px solid rgb(29, 193, 199)",color:"rgb(29, 193, 199)",backgroundColor:"transparent",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"},Px={...au,color:"#fff",backgroundColor:"rgb(29, 193, 199)"};class Fx extends he{constructor(t,a){super(t,a);ke(this,"queryResources",async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:t}=await di.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=t.components||[],this.apiData.componentDid=t.componentDid||"",this.apiData.files=jl([...t.resources.map(a=>{let n="file";const{filename:s}=a,o=sn(s);return n=sn(s,400),{filename:s,_id:s,id:s,name:s,icon:n,previewUrl:n,fileUrl:o}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}});ke(this,"resetState",()=>{this.apiData={...Tl},this.resources.setPluginState({...Ol})});this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=t,this.componentDid="",this.apiData={...Tl},this.icon=()=>ce("svg",{t:"1700146012231",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15673",width:"200",height:"200",children:[ce("path",{d:"M403.2 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-187.733333c0-49.066667-38.4-85.333333-85.333333-85.333334zM426.666667 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-21.333333 0-38.4-17.066667-38.4-36.266667v-162.133333c0-19.2 17.066667-36.266667 36.266667-36.266667h160c19.2 0 36.266667 17.066667 36.266666 36.266667v162.133333z",fill:"#0171F1","p-id":"15674"}),ce("path",{d:"M808.533333 130.133333h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333334v187.733333c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-187.733333c0-49.066667-36.266667-85.333333-85.333334-85.333334zM832 390.4c0 19.2-17.066667 36.266667-36.266667 36.266667h-160c-19.2 0-36.266667-17.066667-36.266666-36.266667v-162.133333c-2.133333-19.2 14.933333-36.266667 34.133333-36.266667h160c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333zM403.2 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333334 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333333-85.333333v-189.866667c0-46.933333-38.4-85.333333-85.333333-85.333333zM426.666667 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-21.333333 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c19.2 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#55ABE5","p-id":"15675"}),ce("path",{d:"M808.533333 535.466667h-187.733333c-46.933333 0-85.333333 38.4-85.333333 85.333333V810.666667c0 46.933333 38.4 85.333333 85.333333 85.333333h187.733333c46.933333 0 85.333333-38.4 85.333334-85.333333v-189.866667c0-46.933333-36.266667-85.333333-85.333334-85.333333zM832 795.733333c0 21.333333-17.066667 36.266667-36.266667 36.266667h-162.133333c-19.2 0-36.266667-17.066667-36.266667-36.266667v-162.133333c0-21.333333 17.066667-36.266667 36.266667-36.266667h162.133333c21.333333 0 36.266667 17.066667 36.266667 36.266667v162.133333z",fill:"#0171F1","p-id":"15676"})]})}render(t){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),ce("div",{id:"resources",className:"uploaded",children:[ce("div",{style:{padding:this.apiData.components.length?"12px":"0",backgroundColor:"#fff",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(a=>ce("button",{style:this.apiData.componentDid===a.did?Px:au,id:a.componentDid,onClick:()=>{this.apiData.componentDid!==a.did&&(this.apiData.componentDid=a.did,this.queryResources())},children:Tu(a.name)}))}),this.view.render(t)]})}update(){}onFirstRender(){}install(){this.view=new Xs(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...Ol}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(a,n)=>{const{currentSelection:s}=this.resources.getPluginState(),o=this.resources.uppy.opts.restrictions.maxNumberOfFiles,r=o?s.length<o:!0;s.find(l=>l.id===n.id)?this.resources.setPluginState({currentSelection:[...s.filter(l=>l.id!==n.id)]}):(r||s.pop(),this.resources.setPluginState({currentSelection:[...s,n]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:a}=this.resources.getPluginState();this.uppy.emit("uploaded:selected",a),this.resources.parent.hideAllPanels()};const{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}const Cx=Fx;var _x=fu();const kx=tt(_x);class Ex extends he{constructor(t,a){super(t,{...{},...a});ke(this,"setHashFileName",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s}=n,o=1024*1024*5,r=s.slice(0,o),l=kx.createHash("md5").update(await r.text()).digest("hex"),c=js(n),d=`${l}${c?`.${c}`:""}`;this.uppy.setFileState(a,{hashFileName:d})}});ke(this,"setMetaData",async t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:{relativePath:s,name:o},hashFileName:r}=n,l=s||o||r;this.uppy.setFileMeta(a,{relativePath:l,name:l})}});ke(this,"prepareUploadWrapper",async t=>{await this.tryDownloadRemoteFile(t),await this.getPreviewFromData(t),await this.setHashFileName(t),await this.setMetaData(t)});ke(this,"tryDownloadRemoteFile",async t=>{var O,A;const{type:a,name:n,preview:s,source:o,isRemote:r,isDownloading:l,id:c,isLoading:d,remote:p,meta:h,errorCount:b=0}=t,m=!d&&r,P=`uploader:${c}:downloaded`,g=js(t),y=(O=n==null?void 0:n.split("?"))==null?void 0:O[0],C=(()=>{const v=["jpg","jpeg"];return v.includes(g)&&v.some(S=>y==null?void 0:y.endsWith(S))?!0:y==null?void 0:y.endsWith(g)})()?y:`${y}${g?`.${g}`:""}`;if(m){const v=mx(s||((A=p==null?void 0:p.body)==null?void 0:A.url));if(b>=3)throw new Error("Download remote file failure");this.uppy.setFileState(c,{isLoading:!0,isDownloading:!0,size:null,meta:{...h,name:this.i18n("loading")}}),await di.get(`${this.opts.companionUrl}/proxy`,{responseType:"blob",params:{url:v}}).then(S=>S==null?void 0:S.data).then(async S=>{const k=dx(S,C);this.uppy.setFileState(c,{name:C,extension:g,type:a,data:k,preview:s||Fl(k),source:o,size:k.size,isDownloading:!1,isRemote:!1,meta:{...h,name:C,filename:C}}),this.uppy.getFile(c),this.uppy.emit(P,c)}).catch(async S=>{console.error("Axios download remote file error: ",S),this.uppy.setFileState(c,{isRemote:!0,isLoading:!1,errorCount:b+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(c))})}else l&&await(async()=>new Promise(S=>{this.uppy.once(P,async()=>{S()})}))()});ke(this,"getPreviewFromData",t=>{const{id:a}=t,n=this.uppy.getFile(a);if(n){const{data:s,type:o,preview:r}=n;(o.indexOf("gif")>-1||!r)&&s&&o.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(a,{preview:Fl(s)})},o.indexOf("gif")>-1?1e3:0)}});ke(this,"prepareUpload",t=>{const a=t.map(async s=>{const o=this.uppy.getFile(s);o.isDownloading&&this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(o)}),n=()=>{t.forEach(s=>{const o=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",o)})};return Promise.all(a).then(n)});this.id=this.opts.id||"DownloadRemoteFiles",this.type="modifier",this.i18nInit()}install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async t=>{setTimeout(()=>{this.prepareUploadWrapper(t)},200)}),this.uppy.on("file-editor:complete",t=>{this.getPreviewFromData(t)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}const Tx=Ex;class Ox extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"AIImage",this.title=this.opts.title||"AI Image",this.type="acquirer",this.uppy=e,this.i18nInit(),this.icon=()=>ce("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:ce("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[ce("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),ce("path",{d:"m3 16l5-5c.928-.893 2.072-.893 3 0l1 1m2 9v-4a2 2 0 1 1 4 0v4m-4-2h4m3-4v6"})]})})}render(){return ce("div",{id:"ai-image",className:"ai-image",children:ce("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:this.i18n("loading")})})}update(){}onFirstRender(){}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}const Dx=Ox,Ax="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",Ux=ee.lazy(()=>Ml(()=>import("./index-BlSaylBC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]),import.meta.url)),Dl="uploader-container",Ra="uploader-dashboard",Ls=localStorage.getItem("uppy_debug"),Rx=i=>{var r;const{apiPathProps:e,availablePluginMap:t={},uploadedProps:a}=i,n=iu(e==null?void 0:e.companion),s=async l=>(await di.post("/api/image/generations",l)).data,o={...i==null?void 0:i.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:wp,options:{quality:1},alwayUse:!0},(Ls||Qi()&&!Cl())&&{id:"Uploaded",plugin:Sx,options:{params:a==null?void 0:a.params}},(Ls||Qi()&&!Cl())&&{id:"Resources",plugin:Cx,options:{params:a==null?void 0:a.params}},Qi()&&fx()&&t.AIImage&&{id:"AIImage",plugin:Dx,options:{companionUrl:n},onShowPanel:l=>{function c(){setTimeout(()=>{var p,h;const d=document.getElementById("ai-image");d?Su(d).render(Me.jsx(Ux,{api:s,restrictions:o,i18n:(h=(p=l.current)==null?void 0:p.getUploader())==null?void 0:h.i18n,onSelect:b=>{const m=l.current.getUploader();m==null||m.emit("ai-image:selected",b),b.forEach((P,g)=>{const y=`AI Image [${g+1}].png`,F={name:y,type:"image/png",data:hx(P,y),source:"AIImage",isRemote:!1};m==null||m.addFile(F)})}})):c()},100)}c()}},{id:"Url",plugin:ha,options:{companionUrl:n}},{id:"Webcam",plugin:tc,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!((r=window==null?void 0:window.blocklet)!=null&&r.UNSPLASH_KEY)&&t.Unsplash&&{id:"Unsplash",plugin:wc,options:{companionUrl:n,companionHeaders:{},companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:Tx,options:{companionUrl:n},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:io,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0}].filter(Boolean)};function _o(i){const{id:e,plugins:t,locale:a,onAfterResponse:n,onUploadFinish:s,coreProps:o,apiPathProps:r,tusProps:l,dropTargetProps:c,pluginList:d,restrictions:p}=i,h=Ll(d,"id"),b=iu(r==null?void 0:r.uploader);let m=new Ql({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Ls||""),locale:Ky[a||"en"],...o,restrictions:p}).use(Kp,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:b,async onBeforeRequest(P,g){var v;const{hashFileName:y,id:F,meta:C}=g,O=js(g);P.setHeader("x-uploader-file-name",`${y}`),P.setHeader("x-uploader-file-id",`${F}`),P.setHeader("x-uploader-file-ext",`${O}`),P.setHeader("x-uploader-base-url",new URL(P.getURL()).pathname),P.setHeader("x-uploader-endpoint-url",b),P.setHeader("x-uploader-metadata",JSON.stringify(C,(S,k)=>typeof k=="string"?encodeURIComponent(k):k));const A=(window==null?void 0:window.uploaderComponentId)||((v=window==null?void 0:window.blocklet)==null?void 0:v.componentId);A&&P.setHeader("x-component-did",(A||"").split("/").pop())},onAfterResponse:async(P,g)=>{const y={},F=P.getUnderlyingObject();try{F.response&&(y.data=JSON.parse(F.response))}catch{y.data={}}y.method=P.getMethod().toUpperCase(),y.url=P.getURL(),y.status=F.status,y.headers={...P._headers};const C=F.getAllResponseHeaders();if(C&&C.split(`\r
56
+ `).forEach(S=>{const[k,I]=S.split(": ");k&&I&&(y.headers[k]=I)}),["PATCH","POST"].includes(y.method)&&[200,500].includes(y.status)){const v=[!0,"true"].includes(y.headers["x-uploader-file-exist"]),S=vx(y.url,y.headers["x-uploader-file-name"]),k=m.getFile(y.headers["x-uploader-file-id"]);y.file=k,y.uploadURL=S,v&&k&&(y.method==="POST"&&m.pauseResume(k.id),m.emit("upload-success",k,{uploadURL:S}),m.calculateTotalProgress()),y.status===200&&(await(s==null?void 0:s(y)),m.emitUploadSuccess(k,y))}n&&await(n==null?void 0:n(F));const O=m.getState().totalProgress===100,A=m.getFiles().every(v=>v.source==="DropTarget");O&&A&&m.close()},...l});return c&&m.use(sp,{target:document.body,onDrop:P=>{var g;(g=m==null?void 0:m.open)==null||g.call(m)},...c}),t==null||t.forEach(P=>{if(P){const{plugin:g,options:y}=h[P]||{};g&&m.use(g,y)}}),bx(m),m}const zs=ee.forwardRef((i,e)=>{const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,...i==null?void 0:i.apiPathProps},a=gu({open:!1,uppy:null,availablePluginMap:{},restrictions:{}}),n=Rx({...i,apiPathProps:t,availablePluginMap:a.availablePluginMap,restrictions:a.restrictions}),{plugins:s=n.map(v=>v.id),id:o="Uploader",popup:r=!1,uploadedProps:l,onOpen:c,onClose:d,locale:p,installerProps:h}=i,b=Ll(n,"id"),m=vu(v=>{var S;return(S=v==null?void 0:v.breakpoints)==null?void 0:S.down("md")}),P=Oo([...s,...n.filter(v=>v.alwayUse).map(v=>v.id)]);ee.useLayoutEffect(()=>{Qi()&&!t.disableMediaKitPrefix&&di.get("/api/uploader/status").then(({data:v})=>{var k,I,B,V,K;a.availablePluginMap=v.availablePluginMap;const S=(bu((k=i==null?void 0:i.coreProps)==null?void 0:k.restrictions)?v.restrictions:(I=i==null?void 0:i.coreProps)==null?void 0:I.restrictions)||{};!((B=S==null?void 0:S.allowedFileTypes)!=null&&B.length)&&(S!=null&&S.allowedFileExts)&&(S.allowedFileTypes=Oo((K=(V=(typeof(S==null?void 0:S.allowedFileExts)=="string"?S==null?void 0:S.allowedFileExts.split(","):S==null?void 0:S.allowedFileExts)||[])==null?void 0:V.map($=>zi.lookup(($==null?void 0:$.replaceAll(" ",""))||"")))==null?void 0:K.filter($=>$)),delete S.allowedFileExts),S.maxFileSize&&typeof S.maxFileSize=="string"&&(S.maxFileSize=G.parseSize(S.maxFileSize,{iec:!1})||void 0),a.restrictions=S})},[]),Fu("esc",v=>{a.open&&(v.stopPropagation(),v.preventDefault(),F())},{useCapture:!0}),ee.useEffect(()=>{a.uppy=_o({...i,id:o,plugins:P,apiPathProps:t,pluginList:n,restrictions:a.restrictions}),a.uppy.open=y,a.uppy.close=F,a.uppy.openPlugin=g,a.uppy.on("dashboard:show-panel",v=>{const{onShowPanel:S}=b[v];S==null||S(e)}),(P.includes("Uploaded")||P.includes("Resources"))&&(a.uppy.off("uploaded:selected"),a.uppy.on("uploaded:selected",v=>{var S;v.forEach(k=>{a.uppy.emitUploadSuccess({id:k._id},{data:k,isMock:!0})}),(S=l==null?void 0:l.onSelectedFiles)==null||S.call(l,v),F()}))},[JSON.stringify({id:o,plugins:P,apiPathProps:t,locale:p,restrictions:a.restrictions})]);function g(v){var S,k,I;if(v=v.replace(/\s/g,""),["MyDevice",...P].map(B=>B.toLowerCase()).includes(v.toLowerCase())){let B=`div[data-uppy-acquirer-id="${v}"] > button`;(I=(k=(S=document==null?void 0:document.getElementById(Ra))==null?void 0:S.querySelector(B))==null?void 0:k.click)==null||I.call(k)}}function y(v){var k,I,B,V;a.open=!0,v&&setTimeout(()=>{g(v)},200),a.uppy.emitOpen(),c==null||c(),(I=(k=document.activeElement)==null?void 0:k.blur)==null||I.call(k);const S=a.uppy.getPlugin(Ra).el;(B=S==null?void 0:S.focus)==null||B.call(S),(V=S==null?void 0:S.click)==null||V.call(S)}function F(){var v;(v=a.uppy.getPlugin(Ra))==null||v.hideAllPanels(),a.open=!1,a.uppy.emitClose(),d==null||d(),setTimeout(()=>{a.uppy.getState().totalProgress===100&&(a.uppy.setState({files:{},currentUploads:{}}),a.uppy.calculateTotalProgress())},500)}ee.useImperativeHandle(e,()=>({getUploader:()=>a.uppy,open:y,close:F})),ee.useEffect(()=>{gx(t.disableMediaKitPrefix)},[t.disableMediaKitPrefix]);const C=r?wu:ee.Fragment,O=r?{sx:{zIndex:99999999999,background:"rgba(0,0,0,0.5)","& > *":{display:a.open?"block":"none"}},invisible:!0,open:a.open,onClick:v=>{document.activeElement===document.body&&(v.stopPropagation(),F())},...i.wrapperProps}:{...i.wrapperProps},A=m?"42px":"40px";return Me.jsx(C,{...O,children:Me.jsxs(ku,{onClose:F,did:Ax,...h,children:[Me.jsx(yu,{styles:()=>({".uppy-is-drag-over":{"&::after":{transition:"all 0.3s ease-in-out",border:"2px dashed #bbb !important",borderRadius:4,background:"rgba(234, 234, 234, 0.5)"}}})}),Me.jsxs(Nl,{id:Dl,onClick:v=>v.stopPropagation(),sx:{position:"relative",width:m?"90vw":720,".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{background:"repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px !important"},".uploaded-add-item":{background:"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:"rgba(0,0,0,0.13)"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{background:"#fff",height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}}},children:[Me.jsx(xu,{"aria-label":"close",onClick:F,sx:{color:"#fafafa",position:"absolute",...m?{bottom:`calc(0px - ${A} - 16px)`,left:`calc(50vw - ${A} - 8px)`}:{right:`calc(0px - ${A} - 16px)`,top:-12}},children:Me.jsx(Ou,{sx:{fontSize:A}})}),a.uppy&&Me.jsx(Xc,{inline:!0,target:`#${Dl}`,id:Ra,uppy:a.uppy,plugins:P,fileManagerSelectionType:"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,note:"",doneButtonHandler:F,...i.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}),Ix=Object.freeze(Object.defineProperty({__proto__:null,Uploader:zs,default:zs,initUploader:_o},Symbol.toStringTag,{value:"Module"})),Mx=ee.lazy(()=>Ml(()=>Promise.resolve().then(()=>Ix),void 0,import.meta.url).then(i=>({default:i.Uploader}))),ko=ee.createContext(null);function nu(){const i=ee.useContext(ko);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function Nx({onChange:i,children:e,...t}){const a=nu(),n=()=>{var o;const s=(o=a==null?void 0:a.current)==null?void 0:o.getUploader();s==null||s.open(),i&&s.onceUploadSuccess((...r)=>{i(...r)})};return Me.jsx(Nl,{onClick:n,...t,children:e})}function Bx({children:i,...e}){const t=ee.useRef(null);return Me.jsxs(ko.Provider,{value:t,children:[i,Pu.createPortal(Me.jsx(Mx,{ref:t,popup:!0,...e},"uploader"),document.body)]})}const o0=Object.freeze(Object.defineProperty({__proto__:null,Uploader:zs,UploaderContext:ko,UploaderProvider:Bx,UploaderTrigger:Nx,initUploader:_o,useUploaderContext:nu},Symbol.toStringTag,{value:"Module"}));export{fx as g,o0 as r};