@arcblock/payment-service 1.29.7 → 1.29.9

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 (180) hide show
  1. package/dist/cf.d.ts +31 -0
  2. package/dist/cf.js +79 -60
  3. package/dist/index.d.ts +17 -0
  4. package/dist/index.js +264 -73
  5. package/package.json +4 -4
  6. package/web/assets/{account-DETfFe4_.js → account-Clbqiiw3.js} +1 -1
  7. package/web/assets/{action-B_DQJlip.js → action-DENqSeOa.js} +1 -1
  8. package/web/assets/{actions-BtaoyTWt.js → actions-0iWP2mcx.js} +1 -1
  9. package/web/assets/{actions-QPa-8lfB.js → actions-BD9BAp3M.js} +1 -1
  10. package/web/assets/{actions-jxGAdGfb.js → actions-BJDN6Op2.js} +1 -1
  11. package/web/assets/{actions-DJyfN5OU.js → actions-BSNy5bOd.js} +1 -1
  12. package/web/assets/{actions-Bt_jST94.js → actions-CDsj5j8l.js} +1 -1
  13. package/web/assets/{actions-D9MHLBFH.js → actions-CSpJGOX7.js} +1 -1
  14. package/web/assets/{actions-BknL4OyZ.js → actions-CZL47E9r.js} +1 -1
  15. package/web/assets/{actions-EPYeS5p4.js → actions-D3tJgrUn.js} +1 -1
  16. package/web/assets/{actions-BaDh4xWX.js → actions-DGQs8fFF.js} +1 -1
  17. package/web/assets/{add-price-CD-utowo.js → add-price-BpnICuHO.js} +1 -1
  18. package/web/assets/{admin-_nEB-lHn.js → admin-CD8ViZ7D.js} +1 -1
  19. package/web/assets/{assign-CkV5Q2LP.js → assign-0vMUDW_C.js} +1 -1
  20. package/web/assets/{attempts-DySeqBYU.js → attempts-CKlxkJuE.js} +1 -1
  21. package/web/assets/browser-DDv4_sgY.js +1 -0
  22. package/web/assets/{change-payment-CPUCUEER.js → change-payment-gAlRmJpv.js} +1 -1
  23. package/web/assets/{change-plan-CxE-XfWc.js → change-plan-C47wfWH8.js} +1 -1
  24. package/web/assets/{click-boundary-y8dVA_tr.js → click-boundary-CafubiPp.js} +1 -1
  25. package/web/assets/{connect-CC_l_f6Q.js → connect-BHHzrwLA.js} +1 -1
  26. package/web/assets/{copyable-DpX04wZz.js → copyable-QrCyyiou.js} +1 -1
  27. package/web/assets/{create-3SsWCAOC.js → create-0PUtkJZY.js} +1 -1
  28. package/web/assets/{create-BkQAaSvD.js → create-BJ1asdcy.js} +1 -1
  29. package/web/assets/{create-kG09X9gl.js → create-Bgv5ux17.js} +1 -1
  30. package/web/assets/{create-BmcRybZ5.js → create-C7GOgZZM.js} +1 -1
  31. package/web/assets/{create-tYebjhr9.js → create-DNar5UQD.js} +1 -1
  32. package/web/assets/{create-Bs65p5Ne.js → create-ke4FrPx1.js} +1 -1
  33. package/web/assets/{credit-grant-item-list-Bk27jIc7.js → credit-grant-item-list-CeDAM3qV.js} +1 -1
  34. package/web/assets/{credit-overview-DmMSEs14.js → credit-overview-4zh0H02x.js} +2 -2
  35. package/web/assets/{currency-restrictions-DYLv4YyW.js → currency-restrictions-BcEm8W45.js} +1 -1
  36. package/web/assets/{currency-select-DGS-62-L.js → currency-select-B4ieQBvv.js} +1 -1
  37. package/web/assets/{dayjs-B9tvQIKg.js → dayjs-DUTDpcNU.js} +1 -1
  38. package/web/assets/{description-Ym17DL48.js → description-SnR5WxWT.js} +1 -1
  39. package/web/assets/detail-46aLUdJj.js +1 -0
  40. package/web/assets/{detail-Cr2wG4Th.js → detail-B-ceWfZr.js} +1 -1
  41. package/web/assets/detail-B0IHl4MI.js +1 -0
  42. package/web/assets/detail-B8eOBVSQ.js +15 -0
  43. package/web/assets/{detail-DE3OOC5M.js → detail-BO3zglCn.js} +1 -1
  44. package/web/assets/{detail-DG4l2CqN.js → detail-BQpDGZJQ.js} +1 -1
  45. package/web/assets/{detail-CxYQYu_l.js → detail-BXTsnQny.js} +1 -1
  46. package/web/assets/{detail-CT9Unyrf.js → detail-B_lpOomD.js} +1 -1
  47. package/web/assets/{detail-Do9QO5L2.js → detail-Bfnkg0A1.js} +1 -1
  48. package/web/assets/detail-BwH0DwAi.js +1 -0
  49. package/web/assets/{detail-OZeeKI69.js → detail-C1FupF1D.js} +2 -2
  50. package/web/assets/{detail-cwHZbY62.js → detail-CMBRd4Ct.js} +1 -1
  51. package/web/assets/detail-C_Zdfa0y.js +1 -0
  52. package/web/assets/{detail-Cb9HBSMw.js → detail-Cg505nKX.js} +1 -1
  53. package/web/assets/{detail-DB56SG-k.js → detail-CsGZMimg.js} +1 -1
  54. package/web/assets/{detail-K9EVY3r2.js → detail-Ct5QNBqu.js} +1 -1
  55. package/web/assets/{detail-DuO_Jn5X.js → detail-CyMhK5K_.js} +1 -1
  56. package/web/assets/{detail-DuWdZIyp.js → detail-DACnmls3.js} +1 -1
  57. package/web/assets/{detail-BJTcK7mx.js → detail-DCTb8R7F.js} +1 -1
  58. package/web/assets/{detail-DPCTQLOx.js → detail-DNcp_u5S.js} +1 -1
  59. package/web/assets/detail-DbU3p040.js +1 -0
  60. package/web/assets/{detail-D5KRrQDx.js → detail-Tn2R5C8i.js} +1 -1
  61. package/web/assets/{detail-15zxCbV9.js → detail-wU4wNf4s.js} +1 -1
  62. package/web/assets/{drawer-form-Cl0T1Yyt.js → drawer-form-DspWWj3x.js} +1 -1
  63. package/web/assets/{edit-3HUAnaXW.js → edit-Bkj-OTJh.js} +1 -1
  64. package/web/assets/{editor-BF5I0siU.js → editor-AmthipP2.js} +1 -1
  65. package/web/assets/{embed-CsNqeCd0.js → embed-rRKjDoHi.js} +1 -1
  66. package/web/assets/{filter-toolbar-BydfQ-79.js → filter-toolbar-DXGSTq57.js} +1 -1
  67. package/web/assets/{form-DSzMo9UD.js → form-B5WW-lS5.js} +1 -1
  68. package/web/assets/form-BmQlJZ84.js +9 -0
  69. package/web/assets/{form-BGm5NPDn.js → form-CAPjlw7l.js} +1 -1
  70. package/web/assets/{form-CKfKLGXP.js → form-DD-EiA7W.js} +3 -3
  71. package/web/assets/{form-P4luyUpY.js → form-cX026J4G.js} +1 -1
  72. package/web/assets/{gas-Qf0SSUfS.js → gas-nyR96dB0.js} +1 -1
  73. package/web/assets/{generateCategoricalChart-BaWwaXky.js → generateCategoricalChart-BadryV3H.js} +1 -1
  74. package/web/assets/{home-HbrLyxJL.js → home-_eX1aim8.js} +1 -1
  75. package/web/assets/index-BBHMsIxJ.js +1 -0
  76. package/web/assets/{index-Dr_MwbKt.js → index-BQjlhCSt.js} +1 -1
  77. package/web/assets/{index-DPodCQ9c.js → index-BRENdB5m.js} +1 -1
  78. package/web/assets/{index-9xBRL_33.js → index-BTfJ08JU.js} +1 -1
  79. package/web/assets/{index-DgSc1Qy8.js → index-BarN7DfU.js} +17 -17
  80. package/web/assets/index-BhcoukR2.js +1 -0
  81. package/web/assets/index-BturOfxo.js +1 -0
  82. package/web/assets/{index-SYTpMMMH.js → index-BzABukCz.js} +1 -1
  83. package/web/assets/{index-2l22EYw9.js → index-C-RT84yb.js} +1 -1
  84. package/web/assets/{index-C0JaS08f.js → index-C136x0O2.js} +1 -1
  85. package/web/assets/{index-Cw0ugaQL.js → index-CCVDDX0c.js} +1 -1
  86. package/web/assets/index-CDVogp6E.js +1 -0
  87. package/web/assets/{index-Br7_mvEw.js → index-CW8VfoJO.js} +1 -1
  88. package/web/assets/{index-BIoSdRvX.js → index-CbSXdD6E.js} +3 -3
  89. package/web/assets/{index-CdkYrABk.js → index-Cd_BD9TM.js} +1 -1
  90. package/web/assets/index-D-bx9Kam.js +1 -0
  91. package/web/assets/index-D0mynT6_.js +1 -0
  92. package/web/assets/index-DEiuhiEo.js +14 -0
  93. package/web/assets/{index-DE2KzqXl.js → index-DNGmCIRP.js} +1 -1
  94. package/web/assets/{index-CI_EY4YS.js → index-DSe7Dot_.js} +1 -1
  95. package/web/assets/{index-BFML4-2u.js → index-DcddP3R9.js} +1 -1
  96. package/web/assets/index-DcrGSDby.js +1 -0
  97. package/web/assets/{index-fByZjxLy.js → index-DeK5Pqjv.js} +1 -1
  98. package/web/assets/{index-Clbt8nRm.js → index-DoX0A-rP.js} +1 -1
  99. package/web/assets/index-Du0Ieh1F.js +49 -0
  100. package/web/assets/index-Dybqd298.js +1 -0
  101. package/web/assets/index-EXZPddtw.js +1 -0
  102. package/web/assets/{index-Drav4oDH.js → index-Kd_qCyRG.js} +2 -2
  103. package/web/assets/{index-Dc954mDP.js → index-SOzRg0yJ.js} +1 -1
  104. package/web/assets/{index-BMKZToMM.js → index-UYeD8rTJ.js} +2 -2
  105. package/web/assets/{index-DZpJPE1Z.js → index-W2uZUlFs.js} +1 -1
  106. package/web/assets/{index-1y9kjPIr.js → index-XaFn2ySq.js} +1 -1
  107. package/web/assets/{index-fswPX_qe.js → index-YG5oc8O3.js} +1 -1
  108. package/web/assets/{index-B1pTTyGZ.js → index-ajD9Iotk.js} +1 -1
  109. package/web/assets/index-brUCsnBA.js +1 -0
  110. package/web/assets/{index-BP53rZV9.js → index-mn5Zdrtn.js} +1 -1
  111. package/web/assets/index-qulrJQ4J.js +1 -0
  112. package/web/assets/{index.es-BWnfUzLb.js → index.es-C8dcCHdW.js} +1 -1
  113. package/web/assets/{info-card-C1yxhxJG.js → info-card-BvIMFQo5.js} +1 -1
  114. package/web/assets/{info-metric-CNse3r66.js → info-metric-Dl4ZDm0Z.js} +1 -1
  115. package/web/assets/{info-row-group-BeUhWnnY.js → info-row-group-CFuMWJf1.js} +1 -1
  116. package/web/assets/{info-row-DOK2whMn.js → info-row-jI0h_hv4.js} +1 -1
  117. package/web/assets/{libphonenumber-CyphiuxQ.js → libphonenumber-Qs8PCdM-.js} +1 -1
  118. package/web/assets/{link-3eeclTeS.js → link-CmPoIweR.js} +1 -1
  119. package/web/assets/{list-DnePqZ2K.js → list-BdSkPjIa.js} +1 -1
  120. package/web/assets/{list-jHj_5yy3.js → list-CWMEf-_C.js} +1 -1
  121. package/web/assets/{list-C521zE_7.js → list-CkHExntK.js} +1 -1
  122. package/web/assets/{list-CO0X4L3-.js → list-DLB_hd0Q.js} +1 -1
  123. package/web/assets/{list-D-I0msRW.js → list-DVFJwd_I.js} +2 -2
  124. package/web/assets/{list-D1aevUOI.js → list-DaK9287Y.js} +2 -2
  125. package/web/assets/{list-1OG83xc4.js → list-DghnUOc4.js} +1 -1
  126. package/web/assets/{list-CNmzJKIQ.js → list-eFkvVlp5.js} +1 -1
  127. package/web/assets/metadata-BmQTVFku.js +55 -0
  128. package/web/assets/{meter-event-lmNMgmIu.js → meter-event-B1JIhVpb.js} +1 -1
  129. package/web/assets/{metrics-C7U41HWk.js → metrics-UvxyQbUF.js} +1 -1
  130. package/web/assets/{overview-Cs3-8n4e.js → overview-Cxc6WKba.js} +1 -1
  131. package/web/assets/{overview-CH1HnSP-.js → overview-DrMaIptb.js} +1 -1
  132. package/web/assets/{past-due-CGGRZmXY.js → past-due-CUXkxns0.js} +1 -1
  133. package/web/assets/pay-omLYkqRA.js +4 -0
  134. package/web/assets/{payment-method-info-BsOBbA3m.js → payment-method-info-Bsf89VxV.js} +2 -2
  135. package/web/assets/{preview-DjYRpRA8.js → preview-BifsgUGT.js} +1 -1
  136. package/web/assets/{preview-CjYh9dTg.js → preview-C-H8pGVw.js} +1 -1
  137. package/web/assets/{pricing-table-C3Lkhq46.js → pricing-table-B3QOaAB5.js} +2 -2
  138. package/web/assets/{pricing-table-edE6TJGX.js → pricing-table-BUJdtkMq.js} +1 -1
  139. package/web/assets/{product-select-0ScZE2e8.js → product-select-ChEyoJqJ.js} +1 -1
  140. package/web/assets/{recharge-DcPtT8vt.js → recharge-BVT4USAO.js} +1 -1
  141. package/web/assets/{related-credit-grants-BygNGPfb.js → related-credit-grants-JV2ICsR5.js} +22 -22
  142. package/web/assets/{safe-did-address-B0fFbUph.js → safe-did-address-CiG_V6Gy.js} +1 -1
  143. package/web/assets/{source-data-viewer-By_Utay-.js → source-data-viewer-i1q9wNIG.js} +1 -1
  144. package/web/assets/{status-l6pD08fw.js → status-CUVYrUIG.js} +1 -1
  145. package/web/assets/subscription-BYz_k9dq.js +1 -0
  146. package/web/assets/{subscription-Dq22e3D1.js → subscription-DrnSPIfs.js} +1 -1
  147. package/web/assets/table-BrtHemkA.js +1 -0
  148. package/web/assets/{tax-code-select-CWhIIiXi.js → tax-code-select-TS07I0rB.js} +1 -1
  149. package/web/assets/{tax-utils-DqNX34-r.js → tax-utils-bPjALcVG.js} +1 -1
  150. package/web/assets/{uploader-DRXDz_r0.js → uploader-CsQNHG4I.js} +1 -1
  151. package/web/assets/{usage-records-jjJMZ6DI.js → usage-records-DAUQMJAW.js} +1 -1
  152. package/web/assets/{util-mDHAL0lx.js → util-DxXTXkeY.js} +1 -1
  153. package/web/assets/{vendor-arcblock-ChFCRdyx.js → vendor-arcblock-BTCAQSUK.js} +1 -1
  154. package/web/assets/{vendor-blocklet-D_i_QeSo.js → vendor-blocklet-DcLR2Cyf.js} +43 -43
  155. package/web/index.html +1 -1
  156. package/web/assets/browser-DSLTxXlL.js +0 -1
  157. package/web/assets/detail-ASPdMJoW.js +0 -1
  158. package/web/assets/detail-CIx9vkir.js +0 -1
  159. package/web/assets/detail-D5NbV29V.js +0 -1
  160. package/web/assets/detail-DVVzYhdV.js +0 -1
  161. package/web/assets/detail-Dqc0OfCQ.js +0 -1
  162. package/web/assets/detail-uhlID8jD.js +0 -15
  163. package/web/assets/form-BXAuSawq.js +0 -9
  164. package/web/assets/index-0HK7CYm4.js +0 -1
  165. package/web/assets/index-BJ_E6bEO.js +0 -1
  166. package/web/assets/index-Bnyh4rlV.js +0 -1
  167. package/web/assets/index-BoQ7wf3O.js +0 -1
  168. package/web/assets/index-C68x-aau.js +0 -1
  169. package/web/assets/index-C8s2QKoe.js +0 -1
  170. package/web/assets/index-Cn7O-OP7.js +0 -49
  171. package/web/assets/index-DU39aG5u.js +0 -1
  172. package/web/assets/index-DtbqgSK4.js +0 -1
  173. package/web/assets/index-DuRu9NWB.js +0 -14
  174. package/web/assets/index-WMKOiUez.js +0 -1
  175. package/web/assets/index-dmHgoplS.js +0 -1
  176. package/web/assets/index-txVTkoDD.js +0 -1
  177. package/web/assets/metadata-CMSHcSXi.js +0 -55
  178. package/web/assets/pay-CSpHBUh_.js +0 -4
  179. package/web/assets/subscription-DcwhSOpa.js +0 -1
  180. package/web/assets/table-BRU4Enia.js +0 -1
@@ -0,0 +1,49 @@
1
+ import{cl as Pp,ce as Fp,cg as Cp,cn as _p,cs as Lc,cA as Nc,cB as al,cC as Ee,cD as Tp,a1 as $s,M as zc,ca as $c,f as Ep,cE as oi,aH as Dp,aI as vn,P as xp,bp as bn,cF as Ap,S as Gr,cG as Ip,cH as Op,A as kp}from"./vendor-blocklet-DcLR2Cyf.js";import{g as Ve,P as R,r as ee,u as Rp,p as Up,j as _e,b5 as Mp,G as Bp,B as To,I as Lp,cC as Np,w as zp,q as $p,f as jp}from"./vendor-mui-BXZut9Pz.js";import{bi as Xr,bj as Hp}from"./index-BarN7DfU.js";import{d as wn,u as qp}from"./browser-Bb9g-cvG.js";var Sn,ll;function Vp(){if(ll)return Sn;ll=1;function i(e,t,r,s){for(var n=-1,o=e==null?0:e.length;++n<o;){var a=e[n];t(s,a,r(a),e)}return s}return Sn=i,Sn}var Pn,ul;function Wp(){if(ul)return Pn;ul=1;var i=Pp();function e(t,r,s,n){return i(t,function(o,a,l){r(n,o,s(o),l)}),n}return Pn=e,Pn}var Fn,cl;function Gp(){if(cl)return Fn;cl=1;var i=Vp(),e=Wp(),t=Fp(),r=Cp();function s(n,o){return function(a,l){var u=r(a)?i:e,d=o?o():{};return u(a,n,t(l,2),d)}}return Fn=s,Fn}var Cn,dl;function Xp(){if(dl)return Cn;dl=1;var i=_p(),e=Gp(),t=e(function(r,s,n){i(r,n,s)});return Cn=t,Cn}var Kp=Xp();const jc=Ve(Kp);function Kr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Yp=0;function Hc(i){return"__private_"+Yp+++"_"+i}function Qp(i,e,t){const r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function hl(i,e){const t=/\$/g,r="$$$$";let s=[i];if(e==null)return s;for(const n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=Qp(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}const Jp=i=>{throw new Error(`missing string: ${i}`)};var Ai=Hc("onMissingKey"),Ii=Hc("apply");class qc{constructor(e,t){let{onMissingKey:r=Jp}=t===void 0?{}:t;Object.defineProperty(this,Ii,{value:Zp}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Kr(this,Ii)[Ii],this):Kr(this,Ii)[Ii](e),Kr(this,Ai)[Ai]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Kr(this,Ai)[Ai](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){const n=this.locale.pluralize(t.smart_count);return hl(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return hl(r,t)}}function Zp(i){if(!(i!=null&&i.strings))return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var _n,pl;function ef(){return pl||(pl=1,_n=function(){var e={},t=e._fns={};e.emit=function(o,a,l,u,d,c,m){var w=r(o);w.length&&s(o,w,[a,l,u,d,c,m])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var u=this._fns[o],d=0,c=u?u.length:0;for(d;d<c;d++)u[d]!==a&&l.push(u[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],u=Object.keys(t),d=0,c=u.length;for(d;d<c;d++){var m=u[d];if(m==="*"&&(o=o.concat(t[m])),l.length===2&&l[0]===m){o=o.concat(t[m]);break}}return o}function s(n,o,a){var l=0,u=o.length;for(l;l<u&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}),_n}var tf=ef();const rf=Ve(tf);let sf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zr=(i=21)=>{let e="",t=i;for(;t--;)e+=sf[Math.random()*64|0];return e};function Ss(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var nf=0;function Vc(i){return"__private_"+nf+++"_"+i}const of={version:"3.2.2"};var qt=Vc("callbacks"),Tn=Vc("publish");class Wc{constructor(){Object.defineProperty(this,Tn,{value:af}),this.state={},Object.defineProperty(this,qt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,Ss(this,Tn)[Tn](t,r,e)}subscribe(e){return Ss(this,qt)[qt].add(e),()=>{Ss(this,qt)[qt].delete(e)}}}function af(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ss(this,qt)[qt].forEach(r=>{r(...e)})}Wc.VERSION=of.version;function Fa(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const js={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Gc(i){var e;if(i.type)return i.type;const t=i.name?(e=Fa(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in js?js[t]:"application/octet-stream"}function lf(i){return i.charCodeAt(0).toString(32)}function fl(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${lf(t)}`,"/"))+e}function uf(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${fl(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${fl(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function cf(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Xc(i,e){if(cf(i))return i.id;const t=Gc(i);return uf({...i,type:t},e)}function df(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function hf(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function En(i){return i<10?`0${i}`:i.toString()}function Ps(){const i=new Date,e=En(i.getHours()),t=En(i.getMinutes()),r=En(i.getSeconds());return`${e}:${t}:${r}`}const pf={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}},ff={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ps()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ps()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}};var Dn,gl;function gf(){return gl||(gl=1,Dn=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}),Dn}var mf=gf();const Kt=Ve(mf);var xn,ml;function yf(){if(ml)return xn;ml=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,r=this.parts,s,n=r.length,o;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(o=(e||"").split(this.separator),s=0;t&&s<n;s++)r[s]!=="*"&&(s<o.length?t=r[s]===o[s]:t=!1);t=t&&o}else if(typeof e.splice=="function")for(t=[],s=e.length;s--;)this.match(e[s])&&(t[t.length]=e[s]);else if(typeof e=="object"){t={};for(var a in e)this.match(a)&&(t[a]=e[a])}return t},xn=function(e,t,r){var s=new i(e,r||/[\/\.]/);return typeof t<"u"?s.match(t):s},xn}var An,yl;function vf(){if(yl)return An;yl=1;var i=yf(),e=/[\/\+\.]/;return An=function(t,r){function s(n){var o=i(n,t,e);return o&&o.length>=2}return r?s(r.split(";")[0]):s},An}var bf=vf();const wf=Ve(bf),Sf={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Ye extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}}class Pf{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;const s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ye(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){const n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ye(this.getI18n()("aggregateExceedsSize",{sizeAllowed:Kt(r),size:Kt(n)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(o=>o.includes("/")?e.type?wf(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=s.join(", ");throw new Ye(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Ye(this.getI18n()("exceedsSize",{size:Kt(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Ye(this.getI18n()("inferiorSize",{size:Kt(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ye(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Ye(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:r}=this.getOpts().restrictions,s=[];for(const n of r)(!Object.hasOwn(e.meta,n)||e.meta[n]==="")&&s.push(n);return{missingFields:s,error:t}}}const Ff={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};let Kc,Yc;function U(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cf=0;function le(i){return"__private_"+Cf+++"_"+i}const _f={version:"3.13.1"},Yr={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var ye=le("plugins"),Ne=le("restricter"),Oi=le("storeUnsubscribe"),lt=le("emitter"),Vt=le("preProcessors"),Wt=le("uploaders"),St=le("postProcessors"),ze=le("informAndEmit"),Pr=le("checkRequiredMetaFieldsOnFile"),In=le("checkRequiredMetaFields"),ki=le("assertNewUploadAllowed"),Eo=le("transformFile"),Ri=le("startIfAutoProceed"),Ui=le("checkAndUpdateFileState"),On=le("addListeners"),Ze=le("updateOnlineStatus"),Mi=le("requestClientById"),ut=le("createUpload"),kn=le("getUpload"),Yt=le("removeUpload"),ct=le("runUpload");Kc=Symbol.for("uppy test: getPlugins");Yc=Symbol.for("uppy test: createUpload");let Ca=class Qc{constructor(e){Object.defineProperty(this,ct,{value:Bf}),Object.defineProperty(this,Yt,{value:Mf}),Object.defineProperty(this,kn,{value:Uf}),Object.defineProperty(this,ut,{value:Rf}),Object.defineProperty(this,On,{value:kf}),Object.defineProperty(this,Ui,{value:Of}),Object.defineProperty(this,Ri,{value:If}),Object.defineProperty(this,Eo,{value:Af}),Object.defineProperty(this,ki,{value:xf}),Object.defineProperty(this,In,{value:Df}),Object.defineProperty(this,Pr,{value:Ef}),Object.defineProperty(this,ze,{value:Tf}),Object.defineProperty(this,ye,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Oi,{writable:!0,value:void 0}),Object.defineProperty(this,lt,{writable:!0,value:rf()}),Object.defineProperty(this,Vt,{writable:!0,value:new Set}),Object.defineProperty(this,Wt,{writable:!0,value:new Set}),Object.defineProperty(this,St,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=Lc((s,n)=>{const o=this.getFile(s?.id);if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}const a=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...o.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:a?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ze,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Mi,{writable:!0,value:new Map}),this.defaultLocale=Ff;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Sf,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Wc,logger:pf,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=ff),this.log(`Using Core v${Qc.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Yr,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:df(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),U(this,Ne)[Ne]=new Pf(()=>this.opts,()=>this.i18n),U(this,Oi)[Oi]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),U(this,On)[On]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];U(this,lt)[lt].emit(e,...r)}on(e,t){return U(this,lt)[lt].on(e,t),this}once(e,t){return U(this,lt)[lt].once(e,t),this}off(e,t){return U(this,lt)[lt].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new qc([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r={};Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e}}}),this.setState({files:r,...Yr}),this.emit("reset-progress")}clearUploadedFiles(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Yr,files:{}})}addPreProcessor(e){U(this,Vt)[Vt].add(e)}removePreProcessor(e){return U(this,Vt)[Vt].delete(e)}addPostProcessor(e){U(this,St)[St].add(e)}removePostProcessor(e){return U(this,St)[St].delete(e)}addUploader(e){U(this,Wt)[Wt].add(e)}removeUploader(e){return U(this,Wt)[Wt].delete(e)}setMeta(e){const t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r={...this.getState().files};if(!r[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}const s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],u=[],d=[],c=[],m=[],w=[];for(const F of s){const{progress:T}=F;!T.uploadComplete&&T.uploadStarted&&(n.push(F),F.isPaused||m.push(F)),T.uploadStarted||o.push(F),(T.uploadStarted||T.preprocess||T.postprocess)&&a.push(F),T.uploadStarted&&l.push(F),F.isPaused&&u.push(F),T.uploadComplete&&d.push(F),F.error&&c.push(F),(T.preprocess||T.postprocess)&&w.push(F)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:u,completeFiles:d,erroredFiles:c,inProgressFiles:n,inProgressNotPausedFiles:m,processingFiles:w,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&w.length===0,isAllErrored:!!r&&c.length===s.length,isAllPaused:n.length!==0&&u.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(F=>F.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{U(this,Ne)[Ne].validate(t,[e])}catch(r){return r}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){U(this,ki)[ki](e);const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui]([e]),n=s.filter(a=>a.isRestriction);if(U(this,ze)[ze](n),s.length>0)throw s[0];this.setState({files:t});const[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),U(this,Ri)[Ri](),o.id}addFiles(e){U(this,ki)[ki]();const{nextFilesState:t,validFilesToAdd:r,errors:s}=U(this,Ui)[Ui](e),n=s.filter(a=>a.isRestriction);U(this,ze)[ze](n);const o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
2
+ `;if(o.forEach(l=>{a+=`
3
+ * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{const l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name}
4
+ id: ${a.id}
5
+ type: ${a.type}`)}),r.length>0&&U(this,Ri)[Ri]()}removeFiles(e,t){const{files:r,currentUploads:s}=this.getState(),n={...r},o={...s},a=Object.create(null);e.forEach(c=>{r[c]&&(a[c]=r[c],delete n[c])});function l(c){return a[c]===void 0}Object.keys(o).forEach(c=>{const m=s[c].fileIDs.filter(l);if(m.length===0){delete o[c];return}const{capabilities:w}=this.getState();if(m.length!==s[c].fileIDs.length&&!w.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[c]={...s[c],fileIDs:m}});const u={currentUploads:o,files:n};Object.keys(n).length===0&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const d=Object.keys(a);d.forEach(c=>{this.emit("file-removed",a[c],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 r=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",e,r),r}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{const n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});const r=U(this,ut)[ut](t,{forceAllowNewUpload:!0});return U(this,ct)[ct](r)}cancelAll(e){let{reason:t="user"}=e===void 0?{}:e;if(this.emit("cancel-all",{reason:t}),t==="user"){const{files:r}=this.getState(),s=Object.keys(r);s.length&&this.removeFiles(s,"cancel-all"),this.setState(Yr)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=U(this,ut)[ut]([e],{forceAllowNewUpload:!0});return U(this,ct)[ct](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}calculateTotalProgress(){const t=this.getFiles().filter(u=>u.progress.uploadStarted||u.progress.preprocess||u.progress.postprocess);if(t.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}const r=t.filter(u=>u.progress.bytesTotal!=null),s=t.filter(u=>u.progress.bytesTotal==null);if(r.length===0){const u=t.length*100,d=s.reduce((m,w)=>m+w.progress.percentage,0),c=Math.round(d/u*100);this.setState({totalProgress:c});return}let n=r.reduce((u,d)=>{var c;return u+((c=d.progress.bytesTotal)!=null?c:0)},0);const o=n/r.length;n+=o*s.length;let a=0;r.forEach(u=>{a+=u.progress.bytesUploaded}),s.forEach(u=>{a+=o*(u.progress.percentage||0)/100});let l=n===0?0:Math.round(a/n*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 r=new e(this,t),s=r.id;if(!s)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const n=this.getPlugin(s);if(n){const o=`Already found a plugin named '${n.id}'. Tried to use: '${s}'.
6
+ Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),r.type in U(this,ye)[ye]?U(this,ye)[ye][r.type].push(r):U(this,ye)[ye][r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(const t of Object.values(U(this,ye)[ye])){const r=t.find(s=>s.id===e);if(r!=null)return r}}[Kc](e){return U(this,ye)[ye][e]}iteratePlugins(e){Object.values(U(this,ye)[ye]).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,ye)[ye][e.type],r=t.findIndex(o=>o.id===e.id);r!==-1&&t.splice(r,1);const n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}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,Oi)[Oi](),this.iteratePlugins(r=>{this.removePlugin(r)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",U(this,Ze)[Ze]),window.removeEventListener("offline",U(this,Ze)[Ze]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);const s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){const{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){U(this,Mi)[Mi].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,Mi)[Mi].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,ct)[ct](e):(U(this,Yt)[Yt](e),Promise.reject(new Error("Nonexistent upload")))}[Yc](){return U(this,ut)[ut](...arguments)}addResultData(e,t){if(!U(this,kn)[kn](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=U(this,ye)[ye].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>U(this,Ne)[Ne].validateMinNumberOfFiles(t)).catch(s=>{throw U(this,ze)[ze]([s]),s}).then(()=>{if(!U(this,In)[In](t))throw new Ye(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{const{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{const u=this.getFile(l);!u.progress.uploadStarted&&n.indexOf(l)===-1&&o.push(u.id)});const a=U(this,ut)[ut](o);return U(this,ct)[ct](a)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Tf(i){for(const n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");const e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:o,details:a=""}=n;this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function Ef(i){const{missingFields:e,error:t}=U(this,Ne)[Ne].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 Df(i){let e=!0;for(const t of Object.values(i))U(this,Pr)[Pr](t)||(e=!1);return e}function xf(i){const{allowNewUpload:e}=this.getState();if(e===!1){const t=new Ye(this.i18n("noMoreFilesAllowed"),{file:i});throw U(this,ze)[ze]([t]),t}}function Af(i){const e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Gc(e),r=hf(t,e),s=Fa(r).extension,n=Xc(e,this.getID()),o=e.meta||{};o.name=r,o.type=t;const a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}function If(){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 Of(i){const{files:e}=this.getState(),t={...e},r=[],s=[];for(const o of i)try{var n;let a=U(this,Eo)[Eo](o);const l=(n=e[a.id])==null?void 0:n.isGhost;l&&(a={...e[a.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`));const u=this.opts.onBeforeFileAdded(a,t);if(!u&&this.checkIfFileAlreadyExists(a.id))throw new Ye(this.i18n("noDuplicates",{fileName:a.name}),{file:o});if(u===!1&&!l)throw new Ye("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof u=="object"&&u!==null&&(a=u),U(this,Ne)[Ne].validateSingleFile(a),t[a.id]=a,r.push(a)}catch(a){s.push(a)}try{U(this,Ne)[Ne].validateAggregateRestrictions(Object.values(e),r)}catch(o){return s.push(o),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}function kf(){const i=(r,s,n)=>{let o=r.message||"Unknown error";r.details&&(o+=` ${r.details}`),this.setState({error:o}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:o,response:n})};this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var o;this.log(s.message,"error");const a=new Error(this.i18n("failedToUpload",{file:(o=r?.name)!=null?o:""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),U(this,ze)[ze]([a])}else U(this,ze)[ze]([s])});let e=null;this.on("upload-stalled",(r,s)=>{const{message:n}=r,o=s.map(a=>a.meta.name).join(", ");e||(this.info({message:n,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const t=r=>{const s=r.filter(o=>{const a=o!=null&&this.getFile(o.id);return a||this.log(`Not setting progress for a file that has been removed: ${o?.id}`),a}),n=Object.fromEntries(s.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(n)};this.on("upload-start",r=>{r.forEach(s=>{this.emit("upload-started",s)}),t(r)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}const n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:U(this,St)[St].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}const s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",r=>{r&&U(this,Pr)[Pr](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",U(this,Ze)[Ze]),window.addEventListener("offline",U(this,Ze)[Ze]),setTimeout(U(this,Ze)[Ze],3e3))}function Rf(i,e){e===void 0&&(e={});const{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");const n=zr();return this.emit("upload",{id:n,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}function Uf(i){const{currentUploads:e}=this.getState();return e[i]}function Mf(i){const e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function Bf(i){const e=()=>{const{currentUploads:n}=this.getState();return n[i]};let t=e();const r=[...U(this,Vt)[Vt],...U(this,Wt)[Wt],...U(this,St)[St]];try{for(let n=t.step||0;n<r.length&&t;n++){const o=r[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});const{fileIDs:a}=t;await o(a,i),t=e()}}catch(n){throw U(this,Yt)[Yt](i),n}if(t){t.fileIDs.forEach(l=>{const u=this.getFile(l);u&&u.progress.postprocess&&this.emit("postprocess-complete",u)});const n=t.fileIDs.map(l=>this.getFile(l)),o=n.filter(l=>!l.error),a=n.filter(l=>l.error);this.addResultData(i,{successful:o,failed:a,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),U(this,Yt)[Yt](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Ca.VERSION=_f.version;var $r,K,Jc,Gt,vl,Zc,Do,Fr={},ed=[],Lf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ln=Array.isArray;function Ft(i,e){for(var t in e)i[t]=e[t];return i}function td(i){var e=i.parentNode;e&&e.removeChild(i)}function h(i,e,t){var r,s,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?$r.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)o[n]===void 0&&(o[n]=i.defaultProps[n]);return dr(i,o,r,s,null)}function dr(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Jc,__i:-1,__u:0};return s==null&&K.vnode!=null&&K.vnode(n),n}function Nf(){return{current:null}}function $e(i){return i.children}function je(i,e){this.props=i,this.context=e}function ei(i,e){if(e==null)return i.__?ei(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?ei(i):null}function id(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return id(i)}}function bl(i){(!i.__d&&(i.__d=!0)&&Gt.push(i)&&!Hs.__r++||vl!==K.debounceRendering)&&((vl=K.debounceRendering)||Zc)(Hs)}function Hs(){var i,e,t,r,s,n,o,a,l;for(Gt.sort(Do);i=Gt.shift();)i.__d&&(e=Gt.length,r=void 0,n=(s=(t=i).__v).__e,a=[],l=[],(o=t.__P)&&((r=Ft({},s)).__v=s.__v+1,K.vnode&&K.vnode(r),_a(o,r,s,t.__n,o.ownerSVGElement!==void 0,32&s.__u?[n]:null,a,n??ei(s),!!(32&s.__u),l),r.__v=s.__v,r.__.__k[r.__i]=r,nd(a,r,l),r.__e!=n&&id(r)),Gt.length>e&&Gt.sort(Do));Hs.__r=0}function rd(i,e,t,r,s,n,o,a,l,u,d){var c,m,w,F,T,P=r&&r.__k||ed,b=e.length;for(t.__d=l,zf(t,e,P),l=t.__d,c=0;c<b;c++)(w=t.__k[c])!=null&&typeof w!="boolean"&&typeof w!="function"&&(m=w.__i===-1?Fr:P[w.__i]||Fr,w.__i=c,_a(i,w,m,s,n,o,a,l,u,d),F=w.__e,w.ref&&m.ref!=w.ref&&(m.ref&&Ta(m.ref,null,w),d.push(w.ref,w.__c||F,w)),T==null&&F!=null&&(T=F),65536&w.__u||m.__k===w.__k?(F||m.__e!=l||(l=ei(m)),l=sd(w,l,i)):typeof w.type=="function"&&w.__d!==void 0?l=w.__d:F&&(l=F.nextSibling),w.__d=void 0,w.__u&=-196609);t.__d=l,t.__e=T}function zf(i,e,t){var r,s,n,o,a,l=e.length,u=t.length,d=u,c=0;for(i.__k=[],r=0;r<l;r++)o=r+c,(s=i.__k[r]=(s=e[r])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?dr(null,s,null,null,null):ln(s)?dr($e,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?dr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=i,s.__b=i.__b+1,a=$f(s,t,o,d),s.__i=a,n=null,a!==-1&&(d--,(n=t[a])&&(n.__u|=131072)),n==null||n.__v===null?(a==-1&&c--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a===o+1?c++:a>o?d>l-o?c+=a-o:c--:a<o?a==o-1&&(c=a-o):c=0,a!==r+c&&(s.__u|=65536))):(n=t[o])&&n.key==null&&n.__e&&(131072&n.__u)==0&&(n.__e==i.__d&&(i.__d=ei(n)),xo(n,n,!1),t[o]=null,d--);if(d)for(r=0;r<u;r++)(n=t[r])!=null&&(131072&n.__u)==0&&(n.__e==i.__d&&(i.__d=ei(n)),xo(n,n))}function sd(i,e,t){var r,s;if(typeof i.type=="function"){for(r=i.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=i,e=sd(r[s],e,t));return e}i.__e!=e&&(t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function bt(i,e){return e=e||[],i==null||typeof i=="boolean"||(ln(i)?i.some(function(t){bt(t,e)}):e.push(i)),e}function $f(i,e,t,r){var s=i.key,n=i.type,o=t-1,a=t+1,l=e[t];if(l===null||l&&s==l.key&&n===l.type&&(131072&l.__u)==0)return t;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&(131072&l.__u)==0&&s==l.key&&n===l.type)return o;o--}if(a<e.length){if((l=e[a])&&(131072&l.__u)==0&&s==l.key&&n===l.type)return a;a++}}return-1}function wl(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Lf.test(e)?t:t+"px"}function Qr(i,e,t,r,s){var n;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||wl(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||wl(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")n=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in i||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?r?t.u=r.u:(t.u=Date.now(),i.addEventListener(e,n?Pl:Sl,n)):i.removeEventListener(e,n?Pl:Sl,n);else{if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,t))}}function Sl(i){if(this.l){var e=this.l[i.type+!1];if(i.t){if(i.t<=e.u)return}else i.t=Date.now();return e(K.event?K.event(i):i)}}function Pl(i){if(this.l)return this.l[i.type+!0](K.event?K.event(i):i)}function _a(i,e,t,r,s,n,o,a,l,u){var d,c,m,w,F,T,P,b,y,f,p,v,g,_,A,I=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),n=[a=e.__e=t.__e]),(d=K.__b)&&d(e);e:if(typeof I=="function")try{if(b=e.props,y=(d=I.contextType)&&r[d.__c],f=d?y?y.props.value:d.__:r,t.__c?P=(c=e.__c=t.__c).__=c.__E:("prototype"in I&&I.prototype.render?e.__c=c=new I(b,f):(e.__c=c=new je(b,f),c.constructor=I,c.render=Hf),y&&y.sub(c),c.props=b,c.state||(c.state={}),c.context=f,c.__n=r,m=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),I.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=Ft({},c.__s)),Ft(c.__s,I.getDerivedStateFromProps(b,c.__s))),w=c.props,F=c.state,c.__v=e,m)I.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(I.getDerivedStateFromProps==null&&b!==w&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(b,f),!c.__e&&(c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(b,c.__s,f)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(c.props=b,c.state=c.__s,c.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(N){N&&(N.__=e)}),p=0;p<c._sb.length;p++)c.__h.push(c._sb[p]);c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(b,c.__s,f),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(w,F,T)})}if(c.context=f,c.props=b,c.__P=i,c.__e=!1,v=K.__r,g=0,"prototype"in I&&I.prototype.render){for(c.state=c.__s,c.__d=!1,v&&v(e),d=c.render(c.props,c.state,c.context),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[]}else do c.__d=!1,v&&v(e),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++g<25);c.state=c.__s,c.getChildContext!=null&&(r=Ft(Ft({},r),c.getChildContext())),m||c.getSnapshotBeforeUpdate==null||(T=c.getSnapshotBeforeUpdate(w,F)),rd(i,ln(A=d!=null&&d.type===$e&&d.key==null?d.props.children:d)?A:[A],e,t,r,s,n,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),P&&(c.__E=c.__=null)}catch(N){e.__v=null,l||n!=null?(e.__e=a,e.__u|=l?160:32,n[n.indexOf(a)]=null):(e.__e=t.__e,e.__k=t.__k),K.__e(N,e,t)}else n==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=jf(t.__e,e,t,r,s,n,o,l,u);(d=K.diffed)&&d(e)}function nd(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)Ta(t[r],t[++r],t[++r]);K.__c&&K.__c(e,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(n){n.call(s)})}catch(n){K.__e(n,s.__v)}})}function jf(i,e,t,r,s,n,o,a,l){var u,d,c,m,w,F,T,P=t.props,b=e.props,y=e.type;if(y==="svg"&&(s=!0),n!=null){for(u=0;u<n.length;u++)if((w=n[u])&&"setAttribute"in w==!!y&&(y?w.localName===y:w.nodeType===3)){i=w,n[u]=null;break}}if(i==null){if(y===null)return document.createTextNode(b);i=s?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,b.is&&b),n=null,a=!1}if(y===null)P===b||a&&i.data===b||(i.data=b);else{if(n=n&&$r.call(i.childNodes),P=t.props||Fr,!a&&n!=null)for(P={},u=0;u<i.attributes.length;u++)P[(w=i.attributes[u]).name]=w.value;for(u in P)w=P[u],u=="children"||(u=="dangerouslySetInnerHTML"?c=w:u==="key"||u in b||Qr(i,u,null,w,s));for(u in b)w=b[u],u=="children"?m=w:u=="dangerouslySetInnerHTML"?d=w:u=="value"?F=w:u=="checked"?T=w:u==="key"||a&&typeof w!="function"||P[u]===w||Qr(i,u,w,P[u],s);if(d)a||c&&(d.__html===c.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(c&&(i.innerHTML=""),rd(i,ln(m)?m:[m],e,t,r,s&&y!=="foreignObject",n,o,n?n[0]:t.__k&&ei(t,0),a,l),n!=null)for(u=n.length;u--;)n[u]!=null&&td(n[u]);a||(u="value",F!==void 0&&(F!==i[u]||y==="progress"&&!F||y==="option"&&F!==P[u])&&Qr(i,u,F,P[u],!1),u="checked",T!==void 0&&T!==i[u]&&Qr(i,u,T,P[u],!1))}return i}function Ta(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){K.__e(r,t)}}function xo(i,e,t){var r,s;if(K.unmount&&K.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||Ta(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){K.__e(n,e)}r.base=r.__P=null,i.__c=void 0}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&xo(r[s],e,t||typeof i.type!="function");t||i.__e==null||td(i.__e),i.__=i.__e=i.__d=void 0}function Hf(i,e,t){return this.constructor(i,t)}function Fl(i,e,t){var r,s,n,o;K.__&&K.__(i,e),s=(r=!1)?null:e.__k,n=[],o=[],_a(e,i=e.__k=h($e,null,[i]),s||Fr,Fr,e.ownerSVGElement!==void 0,s?null:e.firstChild?$r.call(e.childNodes):null,n,s?s.__e:e.firstChild,r,o),nd(n,i,o)}function od(i,e,t){var r,s,n,o,a=Ft({},i.props);for(n in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n]===void 0&&o!==void 0?o[n]:e[n];return arguments.length>2&&(a.children=arguments.length>3?$r.call(arguments,2):t),dr(i.type,a,r||i.key,s||i.ref,null)}$r=ed.slice,K={__e:function(i,e,t,r){for(var s,n,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},Jc=0,je.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ft({},this.state),typeof i=="function"&&(i=i(Ft({},t),this.props)),i&&Ft(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),bl(this))},je.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),bl(this))},je.prototype.render=$e,Gt=[],Zc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Do=function(i,e){return i.__v.__b-e.__v.__b},Hs.__r=0;function ad(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function qf(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):ad(i)?i:null}function ld(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}class un{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return 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 qc([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 Cl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Vf=0;function Wf(i){return"__private_"+Vf+++"_"+i}function Gf(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var Bi=Wf("updateUI");class he extends un{constructor(){super(...arguments),Object.defineProperty(this,Bi,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof 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 r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){const r=t.id,s=qf(e);if(s){this.isTargetDOMEl=!0;const a=document.createElement("div");return a.classList.add("uppy-Root"),Cl(this,Bi)[Bi]=Gf(l=>{this.uppy.getPlugin(this.id)&&(Fl(this.render(l),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Fl(this.render(this.uppy.getState()),a),this.el=a,s.appendChild(a),a.dir=this.opts.direction||ld(a)||"ltr",this.onMount(),this.el}const n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;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,r;(t=(r=Cl(this,Bi))[Bi])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}const Xf={__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 Fs(i){return[i]=i.split(";",1),Xf[i]||null}var Li={exports:{}},_l;function Kf(){if(_l)return Li.exports;_l=1,Li.exports=r,Li.exports.isMobile=r,Li.exports.default=r;const i=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,e=/CrOS/,t=/android|ipad|playbook|silk/i;function r(s){s||(s={});let n=s.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;let o=i.test(n)&&!e.test(n)||!!s.tablet&&t.test(n);return!o&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(o=!0),o}return Li.exports}var Yf=Kf();const Qf=Ve(Yf);function Jf(i,e,t){return new Promise(r=>{i.toBlob(r,e,t)})}function Zf(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}function ud(){return h("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},h("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 eg(i){let{onSnapshot:e,i18n:t}=i;return h("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},ud())}function tg(i){let{recording:e,onStartRecording:t,onStopRecording:r,i18n:s}=i;return e?h("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:s("stopRecording"),"aria-label":s("stopRecording"),onClick:r,"data-uppy-super-focusable":!0},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},h("rect",{x:"15",y:"15",width:"70",height:"70"}))):h("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:s("startRecording"),"aria-label":s("startRecording"),onClick:t,"data-uppy-super-focusable":!0},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},h("circle",{cx:"50",cy:"50",r:"40"})))}function ig(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}function rg(i){let{recordingLengthSeconds:e,i18n:t}=i;const r=ig(e);return h("span",{"aria-label":t("recordingLength",{recording_length:r})},r)}function sg(i){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:r}=i;return h("div",{className:"uppy-Webcam-videoSource"},h("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:s=>{r(s.target.value)}},t.map(s=>h("option",{key:s.deviceId,value:s.deviceId,selected:s.deviceId===e},s.label))))}function ng(i){let{onSubmit:e,i18n:t}=i;return h("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},h("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"},h("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}function og(i){let{onDiscard:e,i18n:t}=i;return h("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},h("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"},h("g",{fill:"#FFF",fillRule:"evenodd"},h("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),h("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}function Ao(){return Ao=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Ao.apply(this,arguments)}function Jr(i,e){return i.includes(e)}class ag extends je{componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,recording:r,modes:s,supportsRecording:n,videoSources:o,showVideoSourceDropdown:a,showRecordingLength:l,onSubmit:u,i18n:d,mirror:c,onSnapshot:m,onStartRecording:w,onStopRecording:F,onDiscardRecordedVideo:T,recordingLengthSeconds:P}=this.props,b=!!t,y=!b&&n&&(Jr(s,"video-only")||Jr(s,"audio-only")||Jr(s,"video-audio")),f=!b&&Jr(s,"picture"),p=n&&l&&!b,v=a&&o&&o.length>1,g={playsInline:!0};return t?(g.muted=!1,g.controls=!0,g.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(g.muted=!0,g.autoPlay=!0,g.srcObject=e),h("div",{className:"uppy uppy-Webcam-container"},h("div",{className:"uppy-Webcam-videoContainer"},h("video",Ao({ref:_=>this.videoElement=_,className:`uppy-Webcam-video ${c?"uppy-Webcam-video--mirrored":""}`},g))),h("div",{className:"uppy-Webcam-footer"},h("div",{className:"uppy-Webcam-videoSourceContainer"},v?sg(this.props):null),h("div",{className:"uppy-Webcam-buttonContainer"},f&&h(eg,{onSnapshot:m,i18n:d}),y&&h(tg,{recording:r,onStartRecording:w,onStopRecording:F,i18n:d}),b&&h(ng,{onSubmit:u,i18n:d}),b&&h(og,{onDiscard:T,i18n:d})),h("div",{className:"uppy-Webcam-recordingLength"},p&&h(rg,{recordingLengthSeconds:P,i18n:d}))))}}function lg(i){let{icon:e,i18n:t,hasCamera:r}=i;return h("div",{className:"uppy-Webcam-permissons"},h("div",{className:"uppy-Webcam-permissonsIcon"},e()),h("h1",{className:"uppy-Webcam-title"},t(r?"allowAccessTitle":"noCameraTitle")),h("p",null,t(r?"allowAccessDescription":"noCameraDescription")))}const ug={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 Io(){return Io=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Io.apply(this,arguments)}function Ni(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var cg=0;function dg(i){return"__private_"+cg+++"_"+i}const hg={version:"3.4.2"};function Tl(i){return i[0]==="."?js[i.slice(1)]:i}function pg(i){return/^video\/[^*]+$/.test(i)}function fg(i){return/^image\/[^*]+$/.test(i)}function gg(){return navigator.mediaDevices}function Rn(i,e){return i.includes(e)}const mg={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:Qf({tablet:!0})};var We=dg("enableMirror");class cd extends he{constructor(e,t){super(e,{...mg,...t}),Object.defineProperty(this,We,{writable:!0,value:void 0}),this.mediaDevices=gg(),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=()=>h("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},h("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=ug,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),Ni(this,We)[We]=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?.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,r=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),s={...this.opts.videoConstraints||{facingMode:this.opts.facingMode},...e?{deviceId:e,facingMode:null}:{}};return{audio:t,video:r?s:!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&&(Ni(this,We)[We]=!0);const r=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(s=>(this.setPluginState({hasCamera:s}),this.mediaDevices.getUserMedia(r).then(n=>{this.stream=n;let o=null;const a=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!e||!e.deviceId?o=a[0].getSettings().deviceId:a.forEach(l=>{l.getSettings().deviceId===e.deviceId&&(o=l.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:o,cameraReady:!0})}).catch(n=>{this.setPluginState({cameraReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let r=[];this.opts.preferredVideoMimeType?r=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(r=t.allowedFileTypes.map(Tl).filter(pg));const s=o=>MediaRecorder.isTypeSupported(o)&&Fs(o),n=r.filter(s);n.length>0&&(e.mimeType=n[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);const{restrictions:r}=this.uppy.opts;if(this.recordingChunks.length>1&&r.maxFileSize!=null&&!e){const s=this.recordingChunks.reduce((l,u)=>l+u.size,0),o=(s-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,a=Math.max(0,r.maxFileSize-o);s>a&&(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)}),Ni(this,We)[We]=!1}catch(r){r.isRestriction||this.uppy.log(r)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(Ni(this,We)[We]=!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(r=>r.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 r=this.opts.countdown;const s=setInterval(()=>{if(!this.webcamActive)return clearInterval(s),this.captureInProgress=!1,t(new Error("Webcam is not active"));r?(this.uppy.info(`${r}...`,"warning",800),r--):(clearInterval(s),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,r=e.videoHeight,s=document.createElement("canvas");s.width=t,s.height=r,s.getContext("2d").drawImage(e,0,0);const{restrictions:o}=this.uppy.opts;let a=[];this.opts.preferredImageMimeType?a=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(a=o.allowedFileTypes.map(Tl).filter(fg));const l=a[0]||"image/jpeg",u=Fs(l)||"jpg",d=`cam-${Date.now()}.${u}`;return Jf(s,l).then(c=>({source:this.id,name:d,data:new Blob([c],{type:l}),type:l}))}getVideo(){const e=this.recordingChunks.find(o=>{var a;return((a=o.type)==null?void 0:a.length)>0}).type,t=Fs(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const r=`webcam-${Date.now()}.${t}`,s=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:r,data:new Blob([s],{type:e}),type:e};return Promise.resolve(n)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(t=>t.kind==="videoinput")})})}render(){this.webcamActive||this.start();const e=this.getPluginState();return!e.cameraReady||!e.hasCamera?h(lg,{icon:ud,i18n:this.i18n,hasCamera:e.hasCamera}):h(ag,Io({},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:Zf(),recording:e.isRecording,mirror:Ni(this,We)[We],src:this.stream}))}install(){const{mobileNativeCamera:e,modes:t,facingMode:r,videoConstraints:s}=this.opts,{target:n}=this.opts;if(e&&n){var o;(o=this.getTargetPlugin(n))==null||o.setOptions({showNativeVideoCameraButton:Rn(t,"video-only")||Rn(t,"video-audio"),showNativePhotoCameraButton:Rn(t,"picture"),nativeCameraFacingMode:s?.facingMode||r});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),n&&this.mount(n,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let a=!0;const{videoSources:l,currentDeviceId:u}=this.getPluginState();l.forEach(d=>{u===d.deviceId&&(a=!1)}),a&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}cd.VERSION=hg.version;class yg extends Error{constructor(){super(...arguments),this.name="UserFacingApiError"}}class dd 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 vg(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new dd(i)})}function Cs(i,e){return Object.prototype.hasOwnProperty.call(i,e)}class bg extends Error{constructor(e,t){super(e),this.cause=t?.cause,this.cause&&Cs(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}function wg(i,e,t){const{progress:r,bytesUploaded:s,bytesTotal:n}=e;r&&(i.uppy.log(`Upload progress: ${r}`),i.uppy.emit("upload-progress",t,{uploader:i,bytesUploaded:s,bytesTotal:n}))}const Sg=Lc(wg,300,{leading:!0,trailing:!0});function Pg(i){var e;const r=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${r}`}class Fg extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}let hd;function dt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cg=0;function cn(i){return"__private_"+Cg+++"_"+i}const _g={version:"3.8.2"};function Tg(i){return i.replace(/\/$/,"")}const pd=10,Eg=300*1e3,Dg=401;class xg extends Error{constructor(e){let{statusCode:t,message:r}=e;super(r),this.name="HttpError",this.statusCode=t}}async function Ag(i){if(i.status===Dg)throw new Fg;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(r){throw new Error(e,{cause:r})}throw i.status>=400&&i.status<=499&&t.message?new yg(t.message):new xg({statusCode:i.status,message:e})}var ht=cn("companionHeaders"),zi=cn("getUrl"),Un=cn("requestSocketToken"),$i=cn("awaitRemoteFileUpload");hd=Symbol.for("uppy test: getCompanionHeaders");class Ea{constructor(e,t){Object.defineProperty(this,$i,{value:Og}),Object.defineProperty(this,zi,{value:Ig}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,Un,{writable:!0,value:async r=>{var s;let{file:n,postBody:o,signal:a}=r;if(((s=n.remote)==null?void 0:s.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(n.remote.url,{...n.remote.body,...o},{signal:a})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),dt(this,ht)[ht]=t?.companionHeaders}setCompanionHeaders(e){dt(this,ht)[ht]=e}[hd](){return dt(this,ht)[ht]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return Tg(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"}},...dt(this,ht)[ht]}}onReceiveResponse(e){const{headers:t}=e,s=this.uppy.getState().companion||{},n=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==s[n]&&this.uppy.setState({companion:{...s,[n]:t.get("i-am")}})}async request(e){let{path:t,method:r="GET",data:s,skipPostResponse:n,signal:o}=e;try{const a=await this.headers(!s),l=await vg(dt(this,zi)[zi](t),{method:r,signal:o,headers:a,credentials:this.opts.companionCookiesRule||"same-origin",body:s?JSON.stringify(s):null});return n||this.onReceiveResponse(l),await Ag(l)}catch(a){throw a.isAuthError||a.name==="UserFacingApiError"||a.name==="AbortError"?a:new bg(`Could not ${r} ${dt(this,zi)[zi](t)}`,{cause:a})}}async get(e,t){return typeof t=="boolean"&&(t={skipPostResponse:t}),this.request({...t,path:e})}async post(e,t,r){return typeof r=="boolean"&&(r={skipPostResponse:r}),this.request({...r,path:e,method:"POST",data:t})}async delete(e,t,r){return typeof r=="boolean"&&(r={skipPostResponse:r}),this.request({...r,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,r){var s=this;try{const{signal:n,getQueue:o}=r||{};return await Nc(async()=>{var a;const l=(a=this.uppy.getFile(e.id))==null?void 0:a.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),dt(this,$i)[$i]({file:e,queue:o(),signal:n});const d=await o().wrapPromiseFunction(async function(){try{return await dt(s,Un)[Un](...arguments)}catch(c){if(c.isAuthError)throw new al(c);if(c.cause==null)throw c;const m=c.cause,w=()=>[408,409,429,418,423].includes(m.statusCode)||m.statusCode>=500&&m.statusCode<=599&&![501,505].includes(m.statusCode);throw m.name==="HttpError"&&!w()?new al(m):m}},{priority:-1})({file:e,postBody:t,signal:n}).abortOn(n);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:d}),dt(this,$i)[$i]({file:this.uppy.getFile(e.id),queue:o(),signal:n})},{retries:pd,signal:n,onFailedAttempt:a=>this.uppy.log(`Retrying upload due to: ${a.message}`,"warning")})}catch(n){if(n.name==="AbortError")return;throw this.uppy.emit("upload-error",e,n),n}}}function Ig(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}async function Og(i){let{file:e,queue:t,signal:r}=i,s;const{capabilities:n}=this.uppy.getState();try{return await new Promise((o,a)=>{const l=e.serverToken,u=Pg(e.remote.companionUrl);let d,c,m,{isPaused:w}=e;const F=(_,A)=>{if(d==null||d.readyState!==d.OPEN){var I;this.uppy.log(`Cannot send "${_}" to socket ${e.id} because the socket state was ${String((I=d)==null?void 0:I.readyState)}`,"warning");return}d.send(JSON.stringify({action:_,payload:A??{}}))};function T(){n.resumableUploads&&F(w?"pause":"resume")}const P=async()=>{c&&c.abort(),c=new AbortController;const _=I=>{var N;this.uppy.setFileState(e.id,{serverToken:null}),(N=c)==null||N.abort==null||N.abort(),a(I)};function A(){clearTimeout(m),!w&&(m=setTimeout(()=>_(new Error("Timeout waiting for message from Companion socket")),Eg))}try{await t.wrapPromiseFunction(async()=>{await Nc(async()=>new Promise((N,H)=>{d=new WebSocket(`${u}/api/${l}`),A(),d.addEventListener("close",()=>{d=void 0,H(new Error("Socket closed unexpectedly"))}),d.addEventListener("error",k=>{var L;this.uppy.log(`Companion socket error ${JSON.stringify(k)}, closing socket`,"warning"),(L=d)==null||L.close()}),d.addEventListener("open",()=>{T()}),d.addEventListener("message",k=>{A();try{const{action:S,payload:D}=JSON.parse(k.data);switch(S){case"progress":{Sg(this,D,this.uppy.getFile(e.id));break}case"success":{var L,V,E,C;const O=(L=D.response)==null?void 0:L.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:D.url,status:(V=(E=D.response)==null?void 0:E.status)!=null?V:200,body:O?JSON.parse(O):void 0}),(C=c)==null||C.abort==null||C.abort(),o();break}case"error":{const{message:O}=D.error;throw Object.assign(new Error(O),{cause:D.error})}default:this.uppy.log(`Companion socket unknown action ${S}`,"warning")}}catch(S){_(S)}});const z=()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(m),d&&d.close(),d=void 0};c.signal.addEventListener("abort",()=>{z()})}),{retries:pd,signal:c.signal,onFailedAttempt:()=>{c.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`,"info")}})})().abortOn(c.signal)}catch(I){if(c.signal.aborted)return;_(I)}},b=_=>{if(n.resumableUploads)if(w=_,d&&T(),_){var A;(A=c)==null||A.abort==null||A.abort()}else P()},y=_=>{var A;n.individualCancellation&&_.id===e.id&&(F("cancel"),(A=c)==null||A.abort==null||A.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),o())},f=_=>{var A;let{reason:I}=_;I==="user"&&F("cancel"),(A=c)==null||A.abort==null||A.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),o()},p=(_,A)=>{_===e.id&&b(A)},v=()=>b(!0),g=()=>b(!1);this.uppy.on("file-removed",y),this.uppy.on("cancel-all",f),this.uppy.on("upload-pause",p),this.uppy.on("pause-all",v),this.uppy.on("resume-all",g),s=()=>{this.uppy.off("file-removed",y),this.uppy.off("cancel-all",f),this.uppy.off("upload-pause",p),this.uppy.off("pause-all",v),this.uppy.off("resume-all",g)},r.addEventListener("abort",()=>{var _;(_=c)==null||_.abort()}),P()})}finally{s?.()}}Ea.VERSION=_g.version;const kg=i=>i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");class Rg extends Ea{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||kg(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 Ug(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 Mg(i,e){return new Promise(t=>{localStorage.setItem(i,e),t()})}function Bg(i){return Promise.resolve(localStorage.getItem(i))}function Lg(i){return new Promise(e=>{localStorage.removeItem(i),e()})}const Ng=Object.freeze(Object.defineProperty({__proto__:null,getItem:Bg,removeItem:Lg,setItem:Mg},Symbol.toStringTag,{value:"Module"})),st=Array.from;function El(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var zg=0;function $g(i){return"__private_"+zg+++"_"+i}var ji=$g("handleSubmit");class jg extends je{constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,ji,{writable:!0,value:t=>{t.preventDefault();const{addFile:r}=this.props,s=this.input.value.trim();r(s)}}),this.form.id=zr()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",El(this,ji)[ji]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",El(this,ji)[ji]),document.body.removeChild(this.form)}render(){const{i18n:e}=this.props;return h("div",{className:"uppy-Url"},h("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}),h("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id},e("import")))}}function Dl(i,e,t){const r=st(i.items);let s;switch(e){case"paste":{if(r.some(o=>o.kind==="file"))return;s=r.filter(o=>o.kind==="string"&&o.type==="text/plain");break}case"drop":{s=r.filter(n=>n.kind==="string"&&n.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}s.forEach(n=>{n.getAsString(o=>t(o))})}const Hg={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 fd;const qg={version:"3.6.1"};function Vg(){return h("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},h("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 Wg(i){const e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}function Gg(i){return st(i.dataTransfer.items).filter(r=>r.kind==="string"&&r.type==="text/uri-list").length>0}function Xg(i){return i?.startsWith("http://")||i?.startsWith("https://")}function Kg(i){const{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}class Ot extends he{constructor(e,t){if(super(e,t),this.getMeta=r=>this.client.post("url/meta",{url:r}).then(s=>{if(s.error)throw this.uppy.log("[URL] Error:"),this.uppy.log(s.error),new Error("Failed to fetch the file");return s}),this.addFile=async(r,s)=>{const n=Wg(r);if(!Xg(n)){this.uppy.log(`[URL] Incorrect URL entered: ${n}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}try{const o=await this.getMeta(n),a={meta:s,source:this.id,name:o.name||Kg(n),type:o.type,data:{size:o.size},isRemote:!0,body:{url:n},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:n,url:n},requestClientId:Ot.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(a)}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=r=>{Dl(r.dataTransfer,"drop",s=>{this.uppy.log(`[URL] Adding file from dropped url: ${s}`),this.addFile(s)})},this.handleRootPaste=r=>{Dl(r.clipboardData,"paste",s=>{this.uppy.log(`[URL] Adding file from pasted url: ${s}`),this.addFile(s)})},this.id=this.opts.id||"Url",this.title=this.opts.title||"Link",this.type="acquirer",this.icon=()=>h(Vg,null),this.defaultLocale=Hg,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 Ea(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(Ot.requestClientId,this.client)}render(){return h(jg,{i18n:this.i18n,addFile:this.addFile})}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}fd=Ot;Ot.VERSION=qg.version;Ot.requestClientId=fd.name;Ot.prototype.canHandleRootDrop=Gg;var Mn={exports:{}},xl;function Yg(){return xl||(xl=1,(function(i){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(l,u,d){this.fn=l,this.context=u,this.once=d||!1}function n(l,u,d,c,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var w=new s(d,c||l,m),F=t?t+u:u;return l._events[F]?l._events[F].fn?l._events[F]=[l._events[F],w]:l._events[F].push(w):(l._events[F]=w,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],d,c;if(this._eventsCount===0)return u;for(c in d=this._events)e.call(d,c)&&u.push(t?c.slice(1):c);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},a.prototype.listeners=function(u){var d=t?t+u:u,c=this._events[d];if(!c)return[];if(c.fn)return[c.fn];for(var m=0,w=c.length,F=new Array(w);m<w;m++)F[m]=c[m].fn;return F},a.prototype.listenerCount=function(u){var d=t?t+u:u,c=this._events[d];return c?c.fn?1:c.length:0},a.prototype.emit=function(u,d,c,m,w,F){var T=t?t+u:u;if(!this._events[T])return!1;var P=this._events[T],b=arguments.length,y,f;if(P.fn){switch(P.once&&this.removeListener(u,P.fn,void 0,!0),b){case 1:return P.fn.call(P.context),!0;case 2:return P.fn.call(P.context,d),!0;case 3:return P.fn.call(P.context,d,c),!0;case 4:return P.fn.call(P.context,d,c,m),!0;case 5:return P.fn.call(P.context,d,c,m,w),!0;case 6:return P.fn.call(P.context,d,c,m,w,F),!0}for(f=1,y=new Array(b-1);f<b;f++)y[f-1]=arguments[f];P.fn.apply(P.context,y)}else{var p=P.length,v;for(f=0;f<p;f++)switch(P[f].once&&this.removeListener(u,P[f].fn,void 0,!0),b){case 1:P[f].fn.call(P[f].context);break;case 2:P[f].fn.call(P[f].context,d);break;case 3:P[f].fn.call(P[f].context,d,c);break;case 4:P[f].fn.call(P[f].context,d,c,m);break;default:if(!y)for(v=1,y=new Array(b-1);v<b;v++)y[v-1]=arguments[v];P[f].fn.apply(P[f].context,y)}}return!0},a.prototype.on=function(u,d,c){return n(this,u,d,c,!1)},a.prototype.once=function(u,d,c){return n(this,u,d,c,!0)},a.prototype.removeListener=function(u,d,c,m){var w=t?t+u:u;if(!this._events[w])return this;if(!d)return o(this,w),this;var F=this._events[w];if(F.fn)F.fn===d&&(!m||F.once)&&(!c||F.context===c)&&o(this,w);else{for(var T=0,P=[],b=F.length;T<b;T++)(F[T].fn!==d||m&&!F[T].once||c&&F[T].context!==c)&&P.push(F[T]);P.length?this._events[w]=P.length===1?P[0]:P:o(this,w)}return this},a.prototype.removeAllListeners=function(u){var d;return u?(d=t?t+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,i.exports=a})(Mn)),Mn.exports}var Qg=Yg();const Jg=Ve(Qg);class gd extends Error{constructor(e){super(e),this.name="TimeoutError"}}let Zg=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}};const Al=i=>globalThis.DOMException===void 0?new Zg(i):new DOMException(i),Il=i=>{const e=i.reason===void 0?Al("This operation was aborted."):i.reason;return e instanceof Error?e:Al(e)};function em(i,e,t,r){let s;const n=new Promise((o,a)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){o(i);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){const{signal:l}=r;l.aborted&&a(Il(l)),l.addEventListener("abort",()=>{a(Il(l))})}s=r.customTimers.setTimeout.call(void 0,()=>{const l=`Promise timed out after ${e} milliseconds`,u=t instanceof Error?t:new gd(l);typeof i.cancel=="function"&&i.cancel(),a(u)},e),(async()=>{try{o(await i)}catch(l){a(l)}finally{r.customTimers.clearTimeout.call(void 0,s)}})()});return n.clear=()=>{clearTimeout(s),s=void 0},n}function tm(i,e,t){let r=0,s=i.length;for(;s>0;){const n=Math.trunc(s/2);let o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var Rt=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},vt;class im{constructor(){vt.set(this,[])}enqueue(e,t){t={priority:0,...t};const r={priority:t.priority,run:e};if(this.size&&Rt(this,vt,"f")[this.size-1].priority>=t.priority){Rt(this,vt,"f").push(r);return}const s=tm(Rt(this,vt,"f"),r,(n,o)=>o.priority-n.priority);Rt(this,vt,"f").splice(s,0,r)}dequeue(){const e=Rt(this,vt,"f").shift();return e?.run}filter(e){return Rt(this,vt,"f").filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return Rt(this,vt,"f").length}}vt=new WeakMap;var te=function(i,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},B=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},oe,hr,pr,Dt,qs,fr,_s,Ke,rr,Ue,Ts,Be,gr,Et,Es,Ol,kl,md,Rl,Ul,Ds,Bn,Ln,Vs,yd,xs;class vd extends Error{}class rm extends Jg{constructor(e){var t,r,s,n;if(super(),oe.add(this),hr.set(this,void 0),pr.set(this,void 0),Dt.set(this,0),qs.set(this,void 0),fr.set(this,void 0),_s.set(this,0),Ke.set(this,void 0),rr.set(this,void 0),Ue.set(this,void 0),Ts.set(this,void 0),Be.set(this,0),gr.set(this,void 0),Et.set(this,void 0),Es.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:im,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:""}\` (${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 \`${(n=(s=e.interval)===null||s===void 0?void 0:s.toString())!==null&&n!==void 0?n:""}\` (${typeof e.interval})`);te(this,hr,e.carryoverConcurrencyCount,"f"),te(this,pr,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),te(this,qs,e.intervalCap,"f"),te(this,fr,e.interval,"f"),te(this,Ue,new e.queueClass,"f"),te(this,Ts,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,te(this,Es,e.throwOnTimeout===!0,"f"),te(this,Et,e.autoStart===!1,"f")}get concurrency(){return B(this,gr,"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})`);te(this,gr,e,"f"),B(this,oe,"m",Vs).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:B(this,Es,"f"),...t},new Promise((r,s)=>{B(this,Ue,"f").enqueue(async()=>{var n,o,a;te(this,Be,(o=B(this,Be,"f"),o++,o),"f"),te(this,Dt,(a=B(this,Dt,"f"),a++,a),"f");try{if(!((n=t.signal)===null||n===void 0)&&n.aborted)throw new vd("The task was aborted.");let l=e({signal:t.signal});t.timeout&&(l=em(Promise.resolve(l),t.timeout)),t.signal&&(l=Promise.race([l,B(this,oe,"m",yd).call(this,t.signal)]));const u=await l;r(u),this.emit("completed",u)}catch(l){if(l instanceof gd&&!t.throwOnTimeout){r();return}s(l),this.emit("error",l)}finally{B(this,oe,"m",md).call(this)}},t),this.emit("add"),B(this,oe,"m",Ds).call(this)})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return B(this,Et,"f")?(te(this,Et,!1,"f"),B(this,oe,"m",Vs).call(this),this):this}pause(){te(this,Et,!0,"f")}clear(){te(this,Ue,new(B(this,Ts,"f")),"f")}async onEmpty(){B(this,Ue,"f").size!==0&&await B(this,oe,"m",xs).call(this,"empty")}async onSizeLessThan(e){B(this,Ue,"f").size<e||await B(this,oe,"m",xs).call(this,"next",()=>B(this,Ue,"f").size<e)}async onIdle(){B(this,Be,"f")===0&&B(this,Ue,"f").size===0||await B(this,oe,"m",xs).call(this,"idle")}get size(){return B(this,Ue,"f").size}sizeBy(e){return B(this,Ue,"f").filter(e).length}get pending(){return B(this,Be,"f")}get isPaused(){return B(this,Et,"f")}}hr=new WeakMap,pr=new WeakMap,Dt=new WeakMap,qs=new WeakMap,fr=new WeakMap,_s=new WeakMap,Ke=new WeakMap,rr=new WeakMap,Ue=new WeakMap,Ts=new WeakMap,Be=new WeakMap,gr=new WeakMap,Et=new WeakMap,Es=new WeakMap,oe=new WeakSet,Ol=function(){return B(this,pr,"f")||B(this,Dt,"f")<B(this,qs,"f")},kl=function(){return B(this,Be,"f")<B(this,gr,"f")},md=function(){var e;te(this,Be,(e=B(this,Be,"f"),e--,e),"f"),B(this,oe,"m",Ds).call(this),this.emit("next")},Rl=function(){B(this,oe,"m",Ln).call(this),B(this,oe,"m",Bn).call(this),te(this,rr,void 0,"f")},Ul=function(){const e=Date.now();if(B(this,Ke,"f")===void 0){const t=B(this,_s,"f")-e;if(t<0)te(this,Dt,B(this,hr,"f")?B(this,Be,"f"):0,"f");else return B(this,rr,"f")===void 0&&te(this,rr,setTimeout(()=>{B(this,oe,"m",Rl).call(this)},t),"f"),!0}return!1},Ds=function(){if(B(this,Ue,"f").size===0)return B(this,Ke,"f")&&clearInterval(B(this,Ke,"f")),te(this,Ke,void 0,"f"),this.emit("empty"),B(this,Be,"f")===0&&this.emit("idle"),!1;if(!B(this,Et,"f")){const e=!B(this,oe,"a",Ul);if(B(this,oe,"a",Ol)&&B(this,oe,"a",kl)){const t=B(this,Ue,"f").dequeue();return t?(this.emit("active"),t(),e&&B(this,oe,"m",Bn).call(this),!0):!1}}return!1},Bn=function(){B(this,pr,"f")||B(this,Ke,"f")!==void 0||(te(this,Ke,setInterval(()=>{B(this,oe,"m",Ln).call(this)},B(this,fr,"f")),"f"),te(this,_s,Date.now()+B(this,fr,"f"),"f"))},Ln=function(){B(this,Dt,"f")===0&&B(this,Be,"f")===0&&B(this,Ke,"f")&&(clearInterval(B(this,Ke,"f")),te(this,Ke,void 0,"f")),te(this,Dt,B(this,hr,"f")?B(this,Be,"f"):0,"f"),B(this,oe,"m",Vs).call(this)},Vs=function(){for(;B(this,oe,"m",Ds).call(this););},yd=async function(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(new vd("The task was aborted."))},{once:!0})})},xs=async function(e,t){return new Promise(r=>{const s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})};var Cr,ae,Nn,Ml,_r=0,bd=[],As=[],ue=K,Bl=ue.__b,Ll=ue.__r,Nl=ue.diffed,zl=ue.__c,$l=ue.unmount,jl=ue.__;function Da(i,e){ue.__h&&ue.__h(ae,i,_r||e),_r=0;var t=ae.__H||(ae.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:As}),t.__[i]}function Si(i){return _r=1,sm(Sd,i)}function sm(i,e,t){var r=Da(Cr++,2);if(r.t=i,!r.__c&&(r.__=[Sd(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,a);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ae,!ae.u)){var s=function(a,l,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!n||n.call(this,a,l,u);var c=!1;return d.forEach(function(m){if(m.__N){var w=m.__[0];m.__=m.__N,m.__N=void 0,w!==m.__[0]&&(c=!0)}}),!(!c&&r.__c.props===a)&&(!n||n.call(this,a,l,u))};ae.u=!0;var n=ae.shouldComponentUpdate,o=ae.componentWillUpdate;ae.componentWillUpdate=function(a,l,u){if(this.__e){var d=n;n=void 0,s(a,l,u),n=d}o&&o.call(this,a,l,u)},ae.shouldComponentUpdate=s}return r.__N||r.__}function Ws(i,e){var t=Da(Cr++,3);!ue.__s&&wd(t.__H,e)&&(t.__=i,t.i=e,ae.__H.__h.push(t))}function zn(i){return _r=5,dn(function(){return{current:i}},[])}function dn(i,e){var t=Da(Cr++,7);return wd(t.__H,e)?(t.__V=i(),t.i=e,t.__h=i,t.__V):t.__}function Gs(i,e){return _r=8,dn(function(){return i},e)}function nm(){for(var i;i=bd.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Is),i.__H.__h.forEach(Oo),i.__H.__h=[]}catch(e){i.__H.__h=[],ue.__e(e,i.__v)}}ue.__b=function(i){ae=null,Bl&&Bl(i)},ue.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),jl&&jl(i,e)},ue.__r=function(i){Ll&&Ll(i),Cr=0;var e=(ae=i.__c).__H;e&&(Nn===ae?(e.__h=[],ae.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=As,t.__N=t.i=void 0})):(e.__h.forEach(Is),e.__h.forEach(Oo),e.__h=[],Cr=0)),Nn=ae},ue.diffed=function(i){Nl&&Nl(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(bd.push(e)!==1&&Ml===ue.requestAnimationFrame||((Ml=ue.requestAnimationFrame)||om)(nm)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==As&&(t.__=t.__V),t.i=void 0,t.__V=As})),Nn=ae=null},ue.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Is),t.__h=t.__h.filter(function(r){return!r.__||Oo(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],ue.__e(r,t.__v)}}),zl&&zl(i,e)},ue.unmount=function(i){$l&&$l(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Is(r)}catch(s){e=s}}),t.__H=void 0,e&&ue.__e(e,t.__v))};var Hl=typeof requestAnimationFrame=="function";function om(i){var e,t=function(){clearTimeout(r),Hl&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Hl&&(e=requestAnimationFrame(t))}function Is(i){var e=ae,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ae=e}function Oo(i){var e=ae;i.__c=i.__(),ae=e}function wd(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function Sd(i,e){return typeof e=="function"?e(i):e}function am(){return h("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},h("g",{fill:"none","fill-rule":"evenodd"},h("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),h("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"}),h("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"}),h("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"}),h("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"}),h("path",{d:"M4 4h18v18H4z"})))}function lm(i){let{pluginName:e,i18n:t,onAuth:r}=i;const s=e==="Google Drive",n=Gs(o=>{o.preventDefault(),r()},[r]);return h("form",{onSubmit:n},s?h("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},h(am,null),t("signInWithGoogle")):h("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 um=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return h(lm,{pluginName:e,i18n:t,onAuth:r})};function cm(i){const{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=um}=i;return h("div",{className:"uppy-Provider-auth"},h("div",{className:"uppy-Provider-authIcon"},r()),h("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),h("div",{className:"uppy-Provider-authForm"},o({pluginName:t,i18n:s,loading:e,onAuth:n})))}function dm(i){let{i18n:e,logout:t,username:r}=i;return h($e,null,h("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),h("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}const hm=i=>{const{getFolder:e,title:t,isLast:r}=i;return h($e,null,h("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:e},t),r?"":" / ")};function pm(i){const{getFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s}=i;return h("div",{className:"uppy-Provider-breadcrumbs"},h("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((n,o)=>h(hm,{key:n.id,getFolder:()=>e(n.requestPath,n.name),title:o===0?t:n.name,isLast:o+1===s.length})))}function fm(i){return h($e,null,i.showBreadcrumbs&&h(pm,{getFolder:i.getFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title}),h(dm,{logout:i.logout,username:i.username,i18n:i.i18n}))}function Pd(i){return{...i,type:i.mimeType,extension:i.name?Fa(i.name).extension:null}}function ko(){return ko=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},ko.apply(this,arguments)}const gm={position:"relative",width:"100%",minHeight:"100%"},mm={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class Fd extends je{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:r,renderRow:s,overscanCount:n=10,...o}=e;const{offset:a,height:l}=this.state;let u=Math.floor(a/r),d=Math.floor(l/r);n&&(u=Math.max(0,u-u%n),d+=n);const c=u+d+4,m=t.slice(u,c),w={...gm,height:t.length*r},F={...mm,top:u*r};return h("div",ko({onScroll:this.handleScroll},o),h("div",{role:"presentation",style:w},h("div",{role:"presentation",style:F},m.map(s))))}}function Cd(i){const{search:e,searchOnInput:t,searchTerm:r,showButton:s,inputLabel:n,clearSearchLabel:o,buttonLabel:a,clearSearch:l,inputClassName:u,buttonCSSClassName:d}=i,[c,m]=Si(r??""),w=Gs(b=>{b.preventDefault(),e(c)},[e,c]),F=Gs(b=>{const y=b.target.value;m(y),t&&e(y)},[m,t,e]),T=()=>{m(""),l&&l()},[P]=Si(()=>{const b=document.createElement("form");return b.setAttribute("tabindex","-1"),b.id=zr(),b});return Ws(()=>(document.body.appendChild(P),P.addEventListener("submit",w),()=>{P.removeEventListener("submit",w),document.body.removeChild(P)}),[P,w]),h($e,null,h("input",{className:`uppy-u-reset ${u}`,type:"search","aria-label":n,placeholder:n,value:c,onInput:F,form:P.id,"data-uppy-super-focusable":!0}),!s&&h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},h("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"})),!s&&c&&h("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":o,title:o,onClick:T},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},h("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"}))),s&&h("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:P.id},a))}function ym(i){let{cancel:e,done:t,i18n:r,selected:s}=i;return h("div",{className:"uppy-ProviderBrowser-footer"},h("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:t,type:"button"},r("selectX",{smart_count:s})),h("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel")))}function vm(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},h("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 bm(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},h("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 wm(){return h("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},h("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"}),h("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 Sm(i){const{itemIconString:e}=i;if(e===null)return null;switch(e){case"file":return h(vm,null);case"folder":return h(bm,null);case"video":return h(wm,null);default:{const{alt:t}=i;return h("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}function ql(i){const{className:e,isDisabled:t,restrictionError:r,isChecked:s,title:n,itemIconEl:o,showTitles:a,toggleCheckbox:l,recordShiftKeyPress:u,id:d,children:c}=i,m=Ee("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":s});return h("li",{className:e,title:t?r?.message:void 0},h("input",{type:"checkbox",className:m,onChange:l,onKeyDown:u,onMouseDown:u,name:"listitem",id:d,checked:s,disabled:t,"data-uppy-super-focusable":!0}),h("label",{htmlFor:d,"aria-label":n,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},o,a&&n,c))}function Pm(i){const{className:e,isDisabled:t,restrictionError:r,isCheckboxDisabled:s,isChecked:n,toggleCheckbox:o,recordShiftKeyPress:a,type:l,id:u,itemIconEl:d,title:c,handleFolderClick:m,showTitles:w,i18n:F}=i;return h("li",{className:e,title:t?r?.message:void 0},s?null:h("input",{type:"checkbox",className:`uppy-u-reset uppy-ProviderBrowserItem-checkbox ${n?"uppy-ProviderBrowserItem-checkbox--is-checked":""}`,onChange:o,onKeyDown:a,onMouseDown:a,name:"listitem",id:u,checked:n,"aria-label":l==="file"?null:F("allFilesFromFolderNamed",{name:c}),disabled:t,"data-uppy-super-focusable":!0}),l==="file"?h("label",{htmlFor:u,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},h("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),w&&c):h("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:m,"aria-label":F("openFolderNamed",{name:c})},h("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),w&&c?h("span",null,c):F("unnamed")))}function mr(){return mr=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},mr.apply(this,arguments)}function Vl(i){const{author:e,getItemIcon:t,isChecked:r,isDisabled:s,viewType:n}=i,o=t(),a=Ee("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":r},{"uppy-ProviderBrowserItem--disabled":s},{"uppy-ProviderBrowserItem--noPreview":o==="video"}),l=h(Sm,{itemIconString:o});switch(n){case"grid":return h(ql,mr({},i,{className:a,itemIconEl:l}));case"list":return h(Pm,mr({},i,{className:a,itemIconEl:l}));case"unsplash":return h(ql,mr({},i,{className:a,itemIconEl:l}),h("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 ${n}`)}}const Fm="shared-with-me";function Wl(i){const{currentSelection:e,uppyFiles:t,viewType:r,isChecked:s,toggleCheckbox:n,recordShiftKeyPress:o,showTitles:a,i18n:l,validateRestrictions:u,getNextFolder:d,f:c}=i;if(c.isFolder)return Vl({showTitles:a,viewType:r,i18n:l,id:c.id,title:c.name,getItemIcon:()=>c.icon,isChecked:s(c),toggleCheckbox:w=>n(w,c),recordShiftKeyPress:o,type:"folder",isDisabled:!1,isCheckboxDisabled:c.id===Fm,handleFolderClick:()=>d(c)});const m=u(Pd(c),[...t,...e]);return Vl({id:c.id,title:c.name,author:c.author,getItemIcon:()=>r==="grid"&&c.thumbnail?c.thumbnail:c.icon,isChecked:s(c),toggleCheckbox:w=>n(w,c),isCheckboxDisabled:!1,recordShiftKeyPress:o,showTitles:a,viewType:r,i18n:l,type:"file",isDisabled:!!m&&!s(c),restrictionError:m})}function _d(i){const{currentSelection:e,folders:t,files:r,uppyFiles:s,viewType:n,headerComponent:o,showBreadcrumbs:a,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,handleScroll:c,showTitles:m,i18n:w,validateRestrictions:F,isLoading:T,showSearchFilter:P,search:b,searchTerm:y,clearSearch:f,searchOnInput:p,searchInputLabel:v,clearSearchLabel:g,getNextFolder:_,cancel:A,done:I,noResultsLabel:N,virtualList:H}=i,z=e.length,k=dn(()=>[...t,...r],[t,r]);return h("div",{className:Ee("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n}`)},o&&h("div",{className:"uppy-ProviderBrowser-header"},h("div",{className:Ee("uppy-ProviderBrowser-headerBar",!a&&"uppy-ProviderBrowser-headerBar--simple")},o)),P&&h("div",{class:"uppy-ProviderBrowser-searchFilter"},h(Cd,{search:b,searchTerm:y,clearSearch:f,inputLabel:v,clearSearchLabel:g,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:p})),T?h("div",{className:"uppy-Provider-loading"},h("span",null,typeof T=="string"?T:w("loading"))):!t.length&&!r.length?h("div",{className:"uppy-Provider-empty"},N):H?h("div",{className:"uppy-ProviderBrowser-body"},h("ul",{className:"uppy-ProviderBrowser-list"},h(Fd,{data:k,renderRow:L=>h(Wl,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,showTitles:m,i18n:w,validateRestrictions:F,getNextFolder:_,f:L}),rowHeight:31}))):h("div",{className:"uppy-ProviderBrowser-body"},h("ul",{className:"uppy-ProviderBrowser-list",onScroll:c,role:"listbox",tabIndex:-1},k.map(L=>h(Wl,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,showTitles:m,i18n:w,validateRestrictions:F,getNextFolder:_,f:L})))),z>0&&h(ym,{selected:z,done:I,cancel:A,i18n:w}))}class Xs extends je{componentWillUnmount(){const{onUnmount:e}=this.props;e()}render(){const{children:e}=this.props;return bt(e)[0]}}class Td{constructor(e,t){this.filterItems=r=>{const s=this.plugin.getPluginState();return!s.filterInput||s.filterInput===""?r:r.filter(n=>n.name.toLowerCase().indexOf(s.filterInput.toLowerCase())!==-1)},this.recordShiftKeyPress=r=>{this.isShiftKeyPressed=r.shiftKey},this.isChecked=r=>{const{currentSelection:s}=this.plugin.getPluginState();return s.some(n=>n.id===r.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:r,offsetHeight:s}=e.target;return t-(r+s)<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:r}=this.plugin,s=r.i18n("companionError");r.log(e.toString()),!(e.isAuthError||((t=e.cause)==null?void 0:t.name)==="AbortError")&&r.info({message:s,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}};return e.thumbnail&&(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:r,files:s}=this.plugin.getPluginState(),n=this.filterItems(r.concat(s));if(this.lastCheckbox&&this.isShiftKeyPressed){const{currentSelection:a}=this.plugin.getPluginState(),l=n.indexOf(this.lastCheckbox),u=n.indexOf(t),d=l<u?n.slice(l,u+1):n.slice(u,l+1),c=[];for(const m of d){const{uppy:w}=this.plugin,F=w.validateRestrictions(Pd(m),[...w.getFiles(),...c]);F?w.info({message:F.message},"error",w.opts.infoTimeout):c.push(m)}this.plugin.setPluginState({currentSelection:[...new Set([...a,...c])]});return}this.lastCheckbox=t;const{currentSelection:o}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:o.filter(a=>a.id!==t.id)}):this.plugin.setPluginState({currentSelection:o.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}}function xe(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Cm=0;function jr(i){return"__private_"+Cm+++"_"+i}const _m={version:"3.13.0"};function Tm(i){return i.slice(1).map(e=>e.name).join("/")}function Ro(i,e){return i?`${i}/${e}`:e}function Ed(){return h("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},h("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 Em={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};var Ht=jr("abortController"),Ge=jr("withAbort"),Tr=jr("list"),Hi=jr("listFilesAndFolders"),yr=jr("recursivelyListAllFiles");class xa extends Td{constructor(e,t){super(e,{...Em,...t}),Object.defineProperty(this,yr,{value:Im}),Object.defineProperty(this,Hi,{value:Am}),Object.defineProperty(this,Tr,{value:xm}),Object.defineProperty(this,Ge,{value:Dm}),Object.defineProperty(this,Ht,{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 xe(this,Ge)[Ge](async r=>{this.lastCheckbox=void 0;let{breadcrumbs:s}=this.plugin.getPluginState();const n=s.findIndex(l=>e===l.requestPath);n!==-1?s=s.slice(0,n+1):s=[...s,{requestPath:e,name:t}],this.nextPagePath=e;let o=[],a=[];do{const{files:l,folders:u}=await xe(this,Hi)[Hi]({breadcrumbs:s,signal:r});o=o.concat(l),a=a.concat(u),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length+a.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:a,files:o,breadcrumbs:s,filterInput:""})})}catch(r){if(r?.name==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(r.message)},"warning",5e3);return}this.handleError(r)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await xe(this,Ge)[Ge](async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const s=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(s,"info",7e3)}const r={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(r)}})}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await xe(this,Ge)[Ge](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 xe(this,Ge)[Ge](async t=>{const{files:r,folders:s,breadcrumbs:n}=this.plugin.getPluginState(),{files:o,folders:a}=await xe(this,Hi)[Hi]({breadcrumbs:n,signal:t}),l=r.concat(o),u=s.concat(a);this.plugin.setPluginState({folders:u,files:l})})}catch(t){this.handleError(t)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await xe(this,Ge)[Ge](async e=>{const{currentSelection:t}=this.plugin.getPluginState(),r=[],s=[];for(const n of t){const{requestPath:o}=n,a=l=>({...l,relDirPath:l.absDirPath.replace(n.absDirPath,"").replace(/^\//,"")});if(n.isFolder){let l=!0,u=0;const d=new rm({concurrency:6}),c=w=>{for(const F of w){const T=this.getTagFile(F),P=Xc(T,this.plugin.uppy.getID());this.plugin.uppy.checkIfFileAlreadyExists(P)||(s.push(a(F)),u++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:u}))),l=!1}};await xe(this,yr)[yr]({requestPath:o,absDirPath:Ro(n.absDirPath,n.name),relDirPath:n.name,queue:d,onFiles:c,signal:e}),await d.onIdle();let m;l?m=this.plugin.uppy.i18n("emptyFolderAdded"):u===0?m=this.plugin.uppy.i18n("folderAlreadyAdded",{folder:n.name}):m=this.plugin.uppy.i18n("folderAdded",{smart_count:u,folder:n.name}),r.push(m)}else s.push(a(n))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(s.map(n=>this.getTagFile(n,this.requestClientId))),this.plugin.setPluginState({filterInput:""}),r.forEach(n=>this.plugin.uppy.info(n)),this.clearSelection()})}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var r=this;t===void 0&&(t={});const{authenticated:s,didFirstRender:n}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;n||this.preFirstRender();const a={...this.opts,...t},{files:l,folders:u,filterInput:d,loading:c,currentSelection:m}=this.plugin.getPluginState(),{isChecked:w,recordShiftKeyPress:F,filterItems:T}=this,P=d!=="",b=this.plugin.icon||Ed,y={showBreadcrumbs:a.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:b,title:this.plugin.title,logout:this.logout,username:this.username,i18n:o},f={isChecked:w,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:F,currentSelection:m,files:P?T(l):l,folders:P?T(u):u,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,virtualList:this.opts.virtualList,showSearchFilter:a.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:h(fm,y),title:this.plugin.title,viewType:a.viewType,showTitles:a.showTitles,showBreadcrumbs:a.showBreadcrumbs,pluginIcon:b,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return r.plugin.uppy.validateRestrictions(...arguments)},isLoading:c};return s===!1?h(Xs,{onUnmount:this.clearSelection},h(cm,{pluginName:this.plugin.title,pluginIcon:b,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:c})):h(Xs,{onUnmount:this.clearSelection},h(_d,f))}}async function Dm(i){var e;(e=xe(this,Ht)[Ht])==null||e.abort();const t=new AbortController;xe(this,Ht)[Ht]=t;const r=()=>{t.abort(),this.clearSelection()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),xe(this,Ht)[Ht]=void 0}}async function xm(i){let{requestPath:e,absDirPath:t,signal:r}=i;const{username:s,nextPagePath:n,items:o}=await this.provider.list(e,{signal:r});return this.username=s||this.username,{items:o.map(a=>({...a,absDirPath:t})),nextPagePath:n}}async function Am(i){let{breadcrumbs:e,signal:t}=i;const r=Tm(e),{items:s,nextPagePath:n}=await xe(this,Tr)[Tr]({requestPath:this.nextPagePath,absDirPath:r,signal:t});this.nextPagePath=n;const o=[],a=[];return s.forEach(l=>{l.isFolder?a.push(l):o.push(l)}),{files:o,folders:a}}async function Im(i){let{requestPath:e,absDirPath:t,relDirPath:r,queue:s,onFiles:n,signal:o}=i,a=e;for(;a;){const l=await xe(this,Tr)[Tr]({requestPath:a,absDirPath:t,signal:o});a=l.nextPagePath;const u=l.items.filter(m=>!m.isFolder),d=l.items.filter(m=>m.isFolder);n(u);const c=d.map(async m=>s.add(async()=>xe(this,yr)[yr]({requestPath:m.requestPath,absDirPath:Ro(t,m.name),relDirPath:Ro(r,m.name),queue:s,onFiles:n,signal:o})));await Promise.all(c)}}xa.VERSION=_m.version;function Gl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Om=0;function km(i){return"__private_"+Om+++"_"+i}const Rm={version:"3.13.0"},Xl={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},Um={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0};var qi=km("updateFilesAndInputMode");class Dd extends Td{constructor(e,t){super(e,{...Um,...t}),Object.defineProperty(this,qi,{value:Mm}),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(Xl),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(Xl)}async search(e){const{searchTerm:t}=this.plugin.getPluginState();if(!(e&&e===t)){this.setLoading(!0);try{const r=await this.provider.search(e);Gl(this,qi)[qi](r,[])}catch(r){this.handleError(r)}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:r,searchTerm:s}=this.plugin.getPluginState(),n=await this.provider.search(s,t);Gl(this,qi)[qi](n,r)}catch(r){this.handleError(r)}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 r=this;t===void 0&&(t={});const{didFirstRender:s,isInputMode:n,searchTerm:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy;s||this.preFirstRender();const l={...this.opts,...t},{files:u,folders:d,filterInput:c,loading:m,currentSelection:w}=this.plugin.getPluginState(),{isChecked:F,filterItems:T,recordShiftKeyPress:P}=this,b=c!=="",y={isChecked:F,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:P,currentSelection:w,files:b?T(u):u,folders:b?T(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:a("search"),clearSearchLabel:a("resetSearch"),noResultsLabel:a("noSearchResults"),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showFilter:l.showFilter,isLoading:m,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:a,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return r.plugin.uppy.validateRestrictions(...arguments)}};return n?h(Xs,{onUnmount:this.resetPluginState},h("div",{className:"uppy-SearchProvider"},h(Cd,{search:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):h(Xs,{onUnmount:this.resetPluginState},h(_d,y))}}function Mm(i,e){this.nextPageQuery=i.nextPageQuery,i.items.forEach(t=>{e.push(t)}),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:e,searchTerm:i.searchedFor})}Dd.VERSION=Rm.version;const Bm={version:"3.3.1"};class xd extends he{constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Ng,this.id=this.opts.id||"Unsplash",this.title=this.opts.title||"Unsplash",this.icon=()=>h("svg",{className:"uppy-DashboardTab-iconUnsplash",viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},h("g",{fill:"currentcolor"},h("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z"}),h("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=Ug(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Rg(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule,provider:"unsplash",pluginId:this.id})}install(){this.view=new Dd(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()}}xd.VERSION=Bm.version;var $n,Kl;function Lm(){if(Kl)return $n;Kl=1;var i=Tp();function e(t){return t&&t.length?i(t):[]}return $n=e,$n}var Nm=Lm();const jn=Ve(Nm);function Yl(i,e,t,r){return i===e?i:r===0?e:i+(e-i)*2**(-r/t)}const rt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};function Hn(i){const e=[];let t="indeterminate",r;for(const{progress:n}of Object.values(i)){const{preprocess:o,postprocess:a}=n;r==null&&(o||a)&&({mode:t,message:r}=o||a),o?.mode==="determinate"&&e.push(o.value),a?.mode==="determinate"&&e.push(a.value)}const s=e.reduce((n,o)=>n+o/e.length,0);return{mode:t,message:r,value:s}}function zm(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}function $m(i){const e=zm(i),t=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${r}${s}`}const jm="·",Ql=()=>` ${jm} `;function Hm(i){const{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:o,startUpload:a}=i,l=Ee("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===rt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),u=e&&t&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return h("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:a,disabled:o,"data-uppy-super-focusable":!0},u)}function qm(i){const{i18n:e,uppy:t}=i;return h("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"},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},h("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 Vm(i){const{i18n:e,uppy:t}=i;return h("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},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},h("g",{fill:"none",fillRule:"evenodd"},h("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),h("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 Wm(i){const{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,o=t(e?"resume":"pause");function a(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return h("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},h("g",{fill:"none",fillRule:"evenodd"},h("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),h("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Gm(i){const{i18n:e,doneButtonHandler:t}=i;return h("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 Ad(){return h("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},h("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 Xm(i){const{progress:e}=i,{value:t,mode:r,message:s}=e;return h("div",{className:"uppy-StatusBar-content"},h(Ad,null),r==="determinate"?`${Math.round(t*100)}% · `:"",s)}function Km(i){const{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:o}=i,a=e>1;return h("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),h("span",{className:"uppy-StatusBar-additionalInfo"},a&&Ql(),o("dataUploadedOfTotal",{complete:Kt(r),total:Kt(s)}),Ql(),o("xTimeLeft",{time:$m(n)})))}function Id(i){const{i18n:e,complete:t,numUploads:r}=i;return h("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}function Ym(i){const{i18n:e,newFiles:t,startUpload:r}=i,s=Ee("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return h("div",{className:"uppy-StatusBar-statusSecondary"},h("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),h("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r},e("upload")))}function Qm(i){const{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:u,complete:d,totalUploadedSize:c,totalSize:m,totalETA:w,startUpload:F}=i,T=l&&n;if(!n||o)return null;const P=e(a?"paused":"uploading");function b(){return!a&&!T&&s?t?h(Km,{numUploads:u,complete:d,totalUploadedSize:c,totalSize:m,totalETA:w,i18n:e}):h(Id,{i18n:e,complete:d,numUploads:u}):null}return h("div",{className:"uppy-StatusBar-content","aria-label":P,title:P},a?null:h(Ad,null),h("div",{className:"uppy-StatusBar-status"},h("div",{className:"uppy-StatusBar-statusPrimary"},t?`${P}: ${r}%`:P),b(),T?h(Ym,{i18n:e,newFiles:l,startUpload:F}):null))}function Jm(i){const{i18n:e}=i;return h("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},h("div",{className:"uppy-StatusBar-status"},h("div",{className:"uppy-StatusBar-statusPrimary"},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},h("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function Zm(i){const{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){const o=`${t("uploadFailed")}
7
+
8
+ ${e}`;alert(o)}return h("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},h("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"})),h("div",{className:"uppy-StatusBar-status"},h("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),h("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),h(Id,{i18n:t,complete:r,numUploads:s})))}const{STATE_ERROR:Jl,STATE_WAITING:Zl,STATE_PREPROCESSING:qn,STATE_UPLOADING:Zr,STATE_POSTPROCESSING:Vn,STATE_COMPLETE:es}=rt;function Od(i){const{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:o,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:u,hideRetryButton:d,recoveredState:c,uploadState:m,totalProgress:w,files:F,supportsUploadProgress:T,hideAfterFinish:P,isSomeGhost:b,doneButtonHandler:y,isUploadStarted:f,i18n:p,startUpload:v,uppy:g,isAllComplete:_,showProgressDetails:A,numUploads:I,complete:N,totalSize:H,totalETA:z,totalUploadedSize:k}=i;function L(){switch(m){case Vn:case qn:{const Y=Hn(F);return Y.mode==="determinate"?Y.value*100:w}case Jl:return null;case Zr:return T?w:null;default:return w}}function V(){switch(m){case Vn:case qn:{const{mode:Y}=Hn(F);return Y==="indeterminate"}case Zr:return!T;default:return!1}}function E(){if(c)return!1;switch(m){case Zl:return a||e===0;case es:return P;default:return!1}}const C=L(),S=E(),D=C??100,O=!o&&e&&!r&&!s&&t&&!a,x=!u&&m!==Zl&&m!==es,M=n&&!l&&m===Zr,q=o&&!_&&!d,W=y&&m===es,ne=Ee("uppy-StatusBar-progress",{"is-indeterminate":V()}),re=Ee("uppy-StatusBar",`is-${m}`,{"has-ghosts":b});return h("div",{className:re,"aria-hidden":S},h("div",{className:ne,style:{width:`${D}%`},role:"progressbar","aria-label":`${D}%`,"aria-valuetext":`${D}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C}),(()=>{switch(m){case qn:case Vn:return h(Xm,{progress:Hn(F)});case es:return h(Jm,{i18n:p});case Jl:return h(Zm,{error:o,i18n:p,numUploads:I,complete:N});case Zr:return h(Qm,{i18n:p,supportsUploadProgress:T,totalProgress:w,showProgressDetails:A,isUploadStarted:f,isAllComplete:_,isAllPaused:s,newFiles:e,numUploads:I,complete:N,totalUploadedSize:k,totalSize:H,totalETA:z,startUpload:v});default:return null}})(),h("div",{className:"uppy-StatusBar-actions"},c||O?h(Hm,{newFiles:e,isUploadStarted:f,recoveredState:c,i18n:p,isSomeGhost:b,startUpload:v,uploadState:m}):null,q?h(qm,{i18n:p,uppy:g}):null,M?h(Wm,{isAllPaused:s,i18n:p,isAllComplete:_,resumableUploads:n,uppy:g}):null,x?h(Vm,{i18n:p,uppy:g}):null,W?h(Gm,{i18n:p,doneButtonHandler:y}):null))}Od.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};const e0={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 ie(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var t0=0;function _i(i){return"__private_"+t0+++"_"+i}const i0={version:"3.3.3"},r0=2e3,s0=2e3;function n0(i,e,t,r){if(i)return rt.STATE_ERROR;if(e)return rt.STATE_COMPLETE;if(t)return rt.STATE_WAITING;let s=rt.STATE_WAITING;const n=Object.keys(r);for(let o=0;o<n.length;o++){const{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return rt.STATE_UPLOADING;a.preprocess&&(s=rt.STATE_PREPROCESSING),a.postprocess&&s!==rt.STATE_PREPROCESSING&&(s=rt.STATE_POSTPROCESSING)}return s}const o0={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var qe=_i("lastUpdateTime"),Qe=_i("previousUploadedBytes"),wt=_i("previousSpeed"),Me=_i("previousETA"),Wn=_i("computeSmoothETA"),Vi=_i("onUploadStart");let Aa=class extends he{constructor(e,t){super(e,{...o0,...t}),Object.defineProperty(this,Wn,{value:a0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),Object.defineProperty(this,Qe,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Me,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Vi,{writable:!0,value:()=>{const{recoveredState:r}=this.uppy.getState();if(ie(this,wt)[wt]=null,ie(this,Me)[Me]=null,r){ie(this,Qe)[Qe]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}ie(this,qe)[qe]=performance.now(),ie(this,Qe)[Qe]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=e0,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:o,recoveredState:a}=e,{newFiles:l,startedFiles:u,completeFiles:d,isUploadStarted:c,isAllComplete:m,isAllErrored:w,isAllPaused:F,isUploadInProgress:T,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),b=a?Object.values(r):l,y=!!t.resumableUploads,f=t.uploadProgress!==!1;let p=0,v=0;u.forEach(_=>{p+=_.progress.bytesTotal||0,v+=_.progress.bytesUploaded||0});const g=ie(this,Wn)[Wn]({uploaded:v,total:p,remaining:p-v});return Od({error:o,uploadState:n0(o,m,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:p,totalUploadedSize:v,isAllComplete:!1,isAllPaused:F,isUploadStarted:c,isUploadInProgress:T,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:b.length,numUploads:u.length,totalETA:g,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:y,supportsUploadProgress:f,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;ld(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",ie(this,Vi)[Vi]),ie(this,qe)[qe]=performance.now(),ie(this,Qe)[Qe]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",ie(this,Vi)[Vi])}};function a0(i){var e,t;if(i.total===0||i.remaining===0)return 0;(t=(e=ie(this,qe))[qe])!=null||(e[qe]=performance.now());const r=performance.now()-ie(this,qe)[qe];if(r===0){var s;return Math.round(((s=ie(this,Me)[Me])!=null?s:0)/100)/10}const n=i.uploaded-ie(this,Qe)[Qe];if(ie(this,Qe)[Qe]=i.uploaded,n<=0){var o;return Math.round(((o=ie(this,Me)[Me])!=null?o:0)/100)/10}const a=n/r,l=ie(this,wt)[wt]==null?a:Yl(a,ie(this,wt)[wt],r0,r);ie(this,wt)[wt]=l;const u=i.remaining/l,d=Math.max(ie(this,Me)[Me]-r,0),c=ie(this,Me)[Me]==null?u:Yl(u,d,s0,r);return ie(this,Me)[Me]=c,ie(this,qe)[qe]=performance.now(),Math.round(c/100)/10}Aa.VERSION=i0.version;const eu=300;class l0 extends je{constructor(){super(...arguments),this.ref=Nf()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,eu)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,eu)}render(){const{children:e}=this.props;return h("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function u0(i,e){return Object.assign(i,e)}function c0(i,e){var t;return(t=i?.key)!=null?t:e}function d0(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function Wi(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const r=c0(i[t],t.toString(36));e[r]=i[t]}return e}function h0(i,e){i=i||{},e=e||{};const t=o=>e.hasOwnProperty(o)?e[o]:i[o],r={};let s=[];for(const o in i)e.hasOwnProperty(o)?s.length&&(r[o]=s,s=[]):s.push(o);const n={};for(const o in e){if(r.hasOwnProperty(o))for(let a=0;a<r[o].length;a++){const l=r[o][a];n[r[o][a]]=t(l)}n[o]=t(o)}for(let o=0;o<s.length;o++)n[s[o]]=t(s[o]);return n}const p0=i=>i;class kd extends je{constructor(e,t){super(e,t),this.refs={},this.state={children:Wi(bt(bt(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=Wi(bt(e.children)||[]),r=this.state.children;this.setState(n=>({children:h0(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){const n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){const n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}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 r=Wi(bt(this.props.children)||[]);(!r||!r.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 r=Wi(bt(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const s=Wi(bt(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{const n=u0({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:l,transitionEnterTimeout:u,transitionAppearTimeout:d,component:c,...m}=e,{children:w}=t;const F=Object.entries(w).map(T=>{let[P,b]=T;if(!b)return;const y=d0(this,P);return od(r(b),{ref:y,key:P})}).filter(Boolean);return h(c,m,F)}}kd.defaultProps={component:"span",childFactory:p0};const f0={version:"3.1.0"};class Rd extends he{constructor(e,t){super(e,t),this.render=r=>h("div",{className:"uppy uppy-Informer"},h(kd,null,r.info.map(s=>h(l0,{key:s.message},h("p",{role:"alert"},s.message," ",s.details&&h("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
9
+
10
+ ${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}Rd.VERSION=f0.version;const g0=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function m0(i,e,t){var r,s;const n=g0.exec(i),o=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text";let a;if(n?.[2]!=null){const l=atob(decodeURIComponent(n[3])),u=new Uint8Array(l.length);for(let d=0;d<l.length;d++)u[d]=l.charCodeAt(d);a=[u]}else n?.[3]!=null&&(a=[decodeURIComponent(n[3])]);return new Blob(a,{type:o})}function tu(i){return i.startsWith("blob:")}function iu(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function X(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Ud=typeof self<"u"?self:globalThis;const Er=typeof navigator<"u",y0=Er&&typeof HTMLImageElement>"u",ru=!(typeof globalThis>"u"||typeof process>"u"||!process.versions||!process.versions.node),Md=Ud.Buffer,Bd=!!Md,v0=i=>i!==void 0;function Ld(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(v0).length===0)}function me(i){let e=new Error(i);throw delete e.stack,e}function su(i){let e=(function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+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 Gn=i=>String.fromCharCode.apply(null,i),nu=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;let Dr=class ci{static from(e,t){return e instanceof this&&e.le===t?e:new ci(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof ci){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&me("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else me("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,r=ci){return e instanceof DataView||e instanceof ci?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||me("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new ci(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 s=this.getUint8Array(e,t),nu?nu.decode(s):Bd?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(Gn(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return Gn(r)}getUnicodeString(e=0,t=this.byteLength){const r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return Gn(r)}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,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Uo(i,e){me(`${i} '${e}' was not loaded, try using full build of exifr.`)}let Ia=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Uo(this.kind,e),t&&(e in t||(function(r,s){me(`Unknown ${r} '${s}'.`)})(this.kind,e),t[e].enabled||Uo(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}};var Nd=new Ia("file parser"),Je=new Ia("segment parser"),Oa=new Ia("file reader");let b0=Ud.fetch;function ou(i,e){return(t=i).startsWith("data:")||t.length>1e4?Bo(i,e,"base64"):ru&&i.includes("://")?Mo(i,e,"url",au):ru?Bo(i,e,"fs"):Er?Mo(i,e,"url",au):void me("Invalid input argument");var t}async function Mo(i,e,t,r){return Oa.has(t)?Bo(i,e,t):r?(async function(s,n){let o=await n(s);return new Dr(o)})(i,r):void me(`Parser ${t} is not loaded`)}async function Bo(i,e,t){let r=new(Oa.get(t))(i,e);return await r.read(),r}const au=i=>b0(i).then((e=>e.arrayBuffer())),Lo=i=>new Promise(((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)})),ka=new Map,w0=new Map,S0=new Map,ts=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],zd=["jfif","xmp","icc","iptc","ihdr"],No=["tiff",...zd],pe=["ifd0","ifd1","exif","gps","interop"],is=[...No,...pe],rs=["makerNote","userComment"],$d=["translateKeys","translateValues","reviveValues","multiSegment"],ss=[...$d,"sanitize","mergeOutput","silentErrors"];let jd=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Gi=class extends jd{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),X(this,"enabled",!1),X(this,"skip",new Set),X(this,"pick",new Set),X(this,"deps",new Set),X(this,"translateKeys",!1),X(this,"translateValues",!1),X(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=pe.includes(e),this.canBeFiltered&&(this.dict=ka.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:me(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of $d)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ks(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ks(this.pick,this.deps)}};var Fe={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},lu=new Map;let Ra=class extends jd{static useCached(e){let t=lu.get(e);return t!==void 0||(t=new this(e),lu.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):me(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Er?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of ts)this[e]=Fe[e];for(e of ss)this[e]=Fe[e];for(e of rs)this[e]=Fe[e];for(e of is)this[e]=new Gi(e,Fe[e],void 0,this)}setupFromTrue(){let e;for(e of ts)this[e]=Fe[e];for(e of ss)this[e]=Fe[e];for(e of rs)this[e]=!0;for(e of is)this[e]=new Gi(e,!0,void 0,this)}setupFromArray(e){let t;for(t of ts)this[t]=Fe[t];for(t of ss)this[t]=Fe[t];for(t of rs)this[t]=Fe[t];for(t of is)this[t]=new Gi(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),ts))this[t]=Xn(e[t],Fe[t]);for(t of ss)this[t]=Xn(e[t],Fe[t]);for(t of rs)this[t]=Xn(e[t],Fe[t]);for(t of No)this[t]=new Gi(t,Fe[t],e[t],this);for(t of pe)this[t]=new Gi(t,Fe[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,pe,is),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 r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=uu(e,r);for(let[o,a]of n)Ks(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=uu(t,r);for(let[o,a]of n)Ks(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=pe.some((n=>this[n].enabled===!0))||this.makerNote||this.userComment;for(let n of pe)this[n].finalizeFilters()}get onlyTiff(){return!zd.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of No)this[e].enabled&&!Je.has(e)&&Uo("segment parser",e)}};function uu(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=ka.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function Xn(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Ks(i,e){for(let t of e)i.add(t)}X(Ra,"default",Fe);let P0=class{constructor(e){X(this,"parsers",{}),X(this,"output",{}),X(this,"errors",[]),X(this,"pushToErrors",(t=>this.errors.push(t))),this.options=Ra.useCached(e)}async read(e){this.file=await(function(t,r){return typeof t=="string"?ou(t,r):Er&&!y0&&t instanceof HTMLImageElement?ou(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Dr(t):Er&&t instanceof Blob?Mo(t,r,"blob",Lo):void me("Invalid input argument")})(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of Nd)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),me("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),Ld(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async r=>{let s=await r.parse();r.assignToOutput(e,s)}));this.options.silentErrors&&(t=t.map((r=>r.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=Je.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}},hi=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new Ra({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Dr?e:new Dr(e)}constructor(e,t={},r){X(this,"errors",[]),X(this,"raw",new Map),X(this,"handleError",(s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)})),this.chunk=this.normalizeInput(e),this.file=r,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 r=S0.get(t),s=w0.get(t),n=ka.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,u=o.translateKeys&&!!n,d={};for(let[c,m]of e)a&&r.has(c)?m=r.get(c)(m):l&&s.has(c)&&(m=this.translateValue(m,s.get(c))),u&&n.has(c)&&(c=n.get(c)||c),d[c]=m;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};X(hi,"headerLength",4),X(hi,"type",void 0),X(hi,"multiSegment",!1),X(hi,"canHandle",(()=>!1));function F0(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function C0(i){return i>=224&&i<=239}function _0(i,e,t){for(let[r,s]of Je)if(s.canHandle(i,e,t))return r}let cu=class extends class{constructor(e,t,r){X(this,"errors",[]),X(this,"ensureSegmentChunk",(async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){me(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):me("Segment unreachable: "+JSON.stringify(s));return s.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(Je.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),X(this,"appSegments",[]),X(this,"jpegSegments",[]),X(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(Je.keyList())):(e=e===void 0?Je.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&Je.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:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some((a=>{let l=Je.get(a),u=this.options[a];return l.multiSegment&&u.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,u=this.appSegments.some((d=>!this.file.available(d.offset||d.start,d.length||d.size)));if(a=e>l&&!u?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:u,findAll:d,wanted:c,remaining:m,options:w}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(r=u.getUint8(e+1),C0(r)){if(s=u.getUint16(e+2),n=_0(u,e,s),n&&c.has(n)&&(o=Je.get(n),a=o.findPosition(u,e),l=w[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||m.delete(n)):m.delete(n),m.size===0)))break;w.recordUnknownSegments&&(a=hi.findPosition(u,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(F0(r)){if(s=u.getUint16(e+2),r===218&&w.stopAfterSos!==!1)return;w.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,r])=>{let s=Je.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[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}};X(cu,"type","jpeg"),Nd.set("jpeg",cu);const T0=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];let E0=class extends hi{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,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=T0[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&me(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&me(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return(l=(function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u})(l=s.getString(e,o)).trim())===""?void 0:l;var l;if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let u=new((function(c){switch(c){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(n))(o),d=a;for(let c=0;c<o;c++)u[c]=this.parseTagValue(n,e),e+=d;return u}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:me(`Invalid tiff type ${e}`)}}};class Kn extends E0{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 r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&me("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&me(`IFD0 offset points to outside of file.
11
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,su(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,su(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 r=e.get(t);r&&r.length===1&&e.set(t,r[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",du(...e.get(2),e.get(1))),e.set("longitude",du(...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,r,s={};for(t of pe)if(e=this[t],!Ld(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}}function du(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}X(Kn,"type","tiff"),X(Kn,"headerLength",10),Je.set("tiff",Kn);const Ua={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Ua,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Ua,{tiff:!1,ifd1:!0,mergeOutput:!1});const D0=Object.assign({},Ua,{firstChunkSize:4e4,ifd0:[274]});async function x0(i){let e=new P0(D0);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const A0=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 sr=!0,nr=!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,r]=e;sr=Number(t)+.1*Number(r)<13.4,nr=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);sr=nr=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);sr=nr=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);sr=nr=Number(e)<77}}async function I0(i){let e=await x0(i);return Object.assign({canvas:sr,css:nr},A0[e])}class O0 extends Dr{constructor(...e){super(...e),X(this,"ranges",new k0),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=Bd?Md.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}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)}}let k0=class{constructor(){X(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter((o=>hu(e,o.offset,s)||hu(e,o.end,s)));if(n.length>0){e=Math.min(e,...n.map((a=>a.offset))),s=Math.max(s,...n.map((a=>a.end))),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter((a=>!n.includes(a)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some((s=>s.offset<=e&&r<=s.end))}};function hu(i,e,t){return i<=e&&e<=t}let R0=class extends O0{constructor(e,t){super(0),X(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,r=await this.readChunk(e,t);return!!r&&r.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(){}};Oa.set("blob",class extends R0{async readWhole(){this.chunked=!1;let i=await Lo(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,r=this.input.slice(i,t),s=await Lo(r);return this.set(s,i,!0)}});const U0={strings:{generatingThumbnails:"Generating thumbnails..."}},M0={version:"3.1.0"};function B0(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>m0(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function L0(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);const s=document.createElement("canvas");s.width=t,s.height=r;const n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function N0(i){const e=i.width/i.height,t=5e6,r=4096;let s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){const o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}const z0={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Ma extends he{constructor(e,t){if(super(e,{...z0,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&iu(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{const s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{const s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&tu(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||tu(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{const o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const s=()=>{r.forEach(n=>{const o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=U0,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,r){const s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{const u=new Image;u.src=s,u.addEventListener("load",()=>{URL.revokeObjectURL(s),a(u)}),u.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=I0(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,u]=a;const d=this.getProportionalDimensions(l,t,r,u.deg),c=L0(l,u),m=this.resizeImage(c,d.width,d.height);return B0(m,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=N0(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1);const l=2;for(;n--;){const u=document.createElement("canvas");u.width=o,u.height=a,u.getContext("2d").drawImage(s,0,0,o,a),s=u,o=Math.round(o/l),a=Math.round(a/l)}return s}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 iu(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)}}Ma.VERSION=M0.version;function pu(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&ad(i)?[i]:null}function Hd(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{const o=[...e,...n];n.length?queueMicrotask(()=>{Hd(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function qd(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){const t=i.createReader();yield*await new Promise(s=>{Hd(t,[],e,{onSuccess:n=>s(n.map(o=>qd(o,e)))})})},isSameEntry:void 0}}function Vd(i,e,t){try{return t===void 0&&(t=void 0),(async function*(){const r=()=>`${e}/${i.name}`;if(i.kind==="file"){const s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(const s of i.values())yield*Vd(s,e?r():i.name);else t!=null&&(yield t)})()}catch(r){return Promise.reject(r)}}async function*$0(i,e){const t=await Promise.all(Array.from(i.items,async r=>{var s;let n;const o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=qd(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(const{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Vd(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function j0(i){const e=st(i.files);return Promise.resolve(e)}async function Ba(i,e){var t;const r=(t=e?.logDropError)!=null?t:Function.prototype;try{const s=[];for await(const n of $0(i,r))s.push(n);return s}catch{return j0(i)}}var fu=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function H0(i,e){return!!(i===e||fu(i)&&fu(e))}function q0(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!H0(i[t],e[t]))return!1;return!0}function gu(i,e){e===void 0&&(e=q0);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}const Wd=['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 Gd(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function mu(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function V0(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function W0(i){return i.contains(document.activeElement)}function Xd(i,e,t){const r=Gd(t,e),s=st(r.querySelectorAll(Wd)),n=s.indexOf(document.activeElement);W0(r)?i.shiftKey&&n===0?V0(i,s):!i.shiftKey&&n===s.length-1&&mu(i,s):mu(i,s)}function G0(i,e,t){e===null||Xd(i,e,t)}function X0(){let i=!1;return $s((t,r)=>{const s=Gd(t,r),n=s.contains(document.activeElement);if(n&&i)return;const o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{const a=s.querySelector(Wd);a?.focus({preventScroll:!0}),i=!1}},260)}function Kd(){const i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Yn,yu;function K0(){return yu||(yu=1,Yn=function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0}),Yn}var Y0=K0();const Q0=Ve(Y0);function J0(){return h("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},h("g",{fill:"#686DE0",fillRule:"evenodd"},h("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"}),h("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"}),h("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function Z0(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},h("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 ey(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},h("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 ty(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},h("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 iy(){return h("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},h("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 ry(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},h("g",{fill:"#A7AFB7",fillRule:"nonzero"},h("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"}),h("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function sy(){return h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},h("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 La(i){const e={color:"#838999",icon:ry()};if(!i)return e;const t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:sy()}:t==="image"?{color:"#686de0",icon:J0()}:t==="audio"?{color:"#068dbb",icon:Z0()}:t==="video"?{color:"#19af67",icon:ey()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:ty()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:iy()}:e}function Yd(i){const{file:e}=i;if(e.preview)return h("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:r}=La(e.type);return h("div",{className:"uppy-Dashboard-Item-previewIconWrap"},h("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},h("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}const ny=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function Qd(i){const{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;const o=n.map(a=>ny(a,s)).join(", ");return h("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",h("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function oy(i){const{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":La(e.type).color;return h("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&h("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},h("span",{hidden:!0},e.meta.name)),h(Yd,{file:e}),h(Qd,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function ay(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 vu(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 Qn(i){return h("div",{className:"uppy-Dashboard-Item-progress"},h("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":vu(i),title:vu(i),onClick:()=>ay(i)},i.children))}function ns(i){let{children:e}=i;return h("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 Jn(i){let{progress:e}=i;const t=2*Math.PI*15;return h("g",null,h("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),h("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 ly(i){if(!i.file.progress.uploadStarted)return null;if(i.isUploaded)return h("div",{className:"uppy-Dashboard-Item-progress"},h("div",{className:"uppy-Dashboard-Item-progressIndicator"},h(ns,null,h("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),h("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?h(Qn,i,h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},h("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),h("path",{d:"M7.9 3H10v2H7.9z"}),h("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),h("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?h(Qn,i,h(ns,null,h(Jn,{progress:i.file.progress.percentage}),i.file.isPaused?h("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):h("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},h("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),h("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?h(Qn,i,h(ns,null,h(Jn,{progress:i.file.progress.percentage}),h("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"}))):h("div",{className:"uppy-Dashboard-Item-progress"},h("div",{className:"uppy-Dashboard-Item-progressIndicator"},h(ns,null,h(Jn,{progress:i.file.progress.percentage}))))}const Zn="...";function Jd(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Zn.length+1)return`${i.slice(0,e-1)}…`;const t=e-Zn.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Zn+i.slice(-s)}const uy=i=>{const{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return h("div",{className:"uppy-Dashboard-Item-name",title:t},Jd(t,r()))},cy=i=>{var e;const{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="·";return t?h("div",{className:"uppy-Dashboard-Item-author"},h("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Jd(t.name,13)),r?h($e,null,` ${s} `,r,` ${s} `):null):null},dy=i=>i.file.size&&h("div",{className:"uppy-Dashboard-Item-statusSize"},Kt(i.file.size)),hy=i=>i.file.isGhost&&h("span",null," • ",h("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:i.toggleAddFilesPanel},i.i18n("reSelect"))),py=i=>{let{file:e,onClick:t}=i;return e.error?h("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 fy(i){const{file:e}=i;return h("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},h("div",{className:"uppy-Dashboard-Item-fileName"},uy(i),h(py,{file:i.file,onClick:()=>alert(i.file.error)})),h("div",{className:"uppy-Dashboard-Item-status"},cy(i),dy(i),hy(i)),h(Qd,{file:i.file,i18n:i.i18n,toggleFileCard:i.toggleFileCard,metaFields:i.metaFields}))}function gy(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{const r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();const s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function my(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?h("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},h("g",{fillRule:"evenodd"},h("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"}),h("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),h("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function yy(i){let{i18n:e,onClick:t,file:r}=i;return h("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},h("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"}),h("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 vy=(i,e)=>{gy(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 by(i){const{i18n:e}=i;return h("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=>vy(t,i)},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},h("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 wy(i){const{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:d}=i;return h("div",{className:"uppy-Dashboard-Item-actionWrapper"},h(my,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,t.id):d(t)}}),o&&t.uploadURL?h(by,{file:t,uppy:e,i18n:l}):null,a?h(yy,{i18n:l,file:t,uppy:e,onClick:()=>e.removeFile(t.id,"removed-by-user")}):null)}class Sy extends je{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Q0(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,r=e.progress.uploadComplete&&!t&&!e.error,s=e.progress.uploadStarted||t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e;let l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);const u=Ee({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return h("div",{className:u,id:`uppy_${e.id}`,role:this.props.role},h("div",{className:"uppy-Dashboard-Item-preview"},h(oy,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),h(ly,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,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})),h("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},h(fy,{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}),h(wy,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function Py(i,e){const t=[];let r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function Fy(i){let{id:e,error:t,i18n:r,uppy:s,files:n,acquirers:o,resumableUploads:a,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:d,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:m,isWide:w,metaFields:F,isSingleFile:T,toggleFileCard:P,handleRequestThumbnail:b,handleCancelThumbnail:y,recoveredState:f,individualCancellation:p,itemsPerRow:v,openFileEditor:g,canEditFile:_,toggleAddFilesPanel:A,containerWidth:I,containerHeight:N}=i;const H=v===1?71:200,z=dn(()=>{const L=(E,C)=>n[C].isGhost-n[E].isGhost,V=Object.keys(n);return f&&V.sort(L),Py(V,v)},[n,v,f]),k=L=>h("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:L[0]},L.map(V=>h(Sy,{key:V,uppy:s,id:e,error:t,i18n:r,acquirers:o,resumableUploads:a,individualCancellation:p,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:d,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:m,isWide:w,metaFields:F,recoveredState:f,isSingleFile:T,containerWidth:I,containerHeight:N,toggleFileCard:P,handleRequestThumbnail:b,handleCancelThumbnail:y,role:"listitem",openFileEditor:g,canEditFile:_,toggleAddFilesPanel:A,file:n[V]})));return T?h("div",{class:"uppy-Dashboard-files"},k(z[0])):h(Fd,{class:"uppy-Dashboard-files",role:"list",data:z,renderRow:k,rowHeight:H})}let Zd;Zd=Symbol.for("uppy test: disable unused locale key warning");class eh extends je{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)=>h("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,r)=>{const n={photo:"image/*",video:"video/*"}[e];return h("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>h("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},h("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},h("div",{className:"uppy-DashboardTab-inner"},h("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},h("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"}))),h("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>h("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},h("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},h("div",{className:"uppy-DashboardTab-inner"},h("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},h("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"}))),h("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>h("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},h("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},h("div",{className:"uppy-DashboardTab-inner"},h("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},h("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 "}))),h("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{const r=this.props.acquirers.length;return h("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return h("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return h("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},h("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)},h("div",{className:"uppy-DashboardTab-inner"},e.icon()),h("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],r=t.splice(e.length-2,e.length);return h($e,null,t.map(s=>this.renderAcquirer(s)),h("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props;let n=[];const o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(c=>({key:c.id,elements:this.renderAcquirer(c)}))),n.length===1&&n[0].key===o&&(n=[]);const l=[...n],u=l.splice(n.length-2,n.length),d=c=>c.map(m=>{let{key:w,elements:F}=m;return h($e,{key:w},F)});return h($e,null,this.renderDropPasteBrowseTagline(n.length),h("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(l),h("span",{role:"presentation",style:{"white-space":"nowrap"}},d(u))))}}[Zd](){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=h("span",null,h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},h("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),h("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return h("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return h("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),h("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&h("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}const Cy=i=>h("div",{className:Ee("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},h("div",{className:"uppy-DashboardContent-bar"},h("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),h("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),h(eh,i));function xt(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function _y(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i;return h("div",{className:Ee("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:xt,onDragLeave:xt,onDrop:xt,onPaste:xt},h("div",{className:"uppy-DashboardContent-bar"},h("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),h("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),h("div",{className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n)))}function Ty(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return h("div",{className:Ee("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},h("div",{className:"uppy-DashboardContent-bar"},h("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:h("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),h("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),h("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),h("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}const it={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Ey(i,e,t,r){if(r===void 0&&(r={}),i)return it.STATE_ERROR;if(e)return it.STATE_COMPLETE;if(t)return it.STATE_PAUSED;let s=it.STATE_WAITING;const n=Object.keys(r);for(let o=0;o<n.length;o++){const{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return it.STATE_UPLOADING;a.preprocess&&s!==it.STATE_UPLOADING&&(s=it.STATE_PREPROCESSING),a.postprocess&&s!==it.STATE_UPLOADING&&s!==it.STATE_PREPROCESSING&&(s=it.STATE_POSTPROCESSING)}return s}function Dy(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(Ey(s,r,n,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:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}function xy(i){const{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i;let{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),h("div",{className:"uppy-DashboardContent-bar"},!t&&!r?h("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):h("div",null),h("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},h(Dy,i)),a?h("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},h("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"})),h("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):h("div",null))}function Ay(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{const l=`uppy-Dashboard-FileCard-input-${a.id}`,u=t.includes(a.id);return h("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},h("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:u,form:s.id},h):h("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:u,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Iy(i){var e;const{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:u,i18nArray:d,className:c,canEditFile:m}=i,w=()=>typeof o=="function"?o(t[r]):o,F=t[r],T=(e=w())!=null?e:[],P=m(F),b={};T.forEach(A=>{var I;b[A.id]=(I=F.meta[A.id])!=null?I:""});const[y,f]=Si(b),p=Gs(A=>{A.preventDefault(),n(y,r)},[n,y,r]),v=(A,I)=>{f({...y,[I]:A})},g=()=>{s(!1)},[_]=Si(()=>{const A=document.createElement("form");return A.setAttribute("tabindex","-1"),A.id=zr(),A});return Ws(()=>(document.body.appendChild(_),_.addEventListener("submit",p),()=>{_.removeEventListener("submit",p),document.body.removeChild(_)}),[_,p]),h("div",{className:Ee("uppy-Dashboard-FileCard",c),"data-uppy-panelType":"FileCard",onDragOver:xt,onDragLeave:xt,onDrop:xt,onPaste:xt},h("div",{className:"uppy-DashboardContent-bar"},h("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:h("span",{className:"uppy-DashboardContent-titleFile"},F.meta?F.meta.name:F.name)})),h("button",{className:"uppy-DashboardContent-back",type:"button",form:_.id,title:u("finishEditingFile"),onClick:g},u("cancel"))),h("div",{className:"uppy-Dashboard-FileCard-inner"},h("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:La(F.type).color}},h(Yd,{file:F}),P&&h("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:A=>{p(A),l(F)}},u("editImage"))),h("div",{className:"uppy-Dashboard-FileCard-info"},h(Ay,{computedMetaFields:T,requiredMetaFields:a,updateMeta:v,form:_,formState:y})),h("div",{className:"uppy-Dashboard-FileCard-actions"},h("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:_.id},u("saveChanges")),h("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:g,form:_.id},u("cancel")))))}const ai="uppy-transition-slideDownUp",bu=250;function os(i){let{children:e}=i;const[t,r]=Si(null),[s,n]=Si(""),o=zn(),a=zn(),l=zn(),u=()=>{n(`${ai}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${ai}-enter ${ai}-enter-active`),o.current=setTimeout(()=>{n("")},bu)})},d=()=>{n(`${ai}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${ai}-leave ${ai}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},bu)})};return Ws(()=>{const c=bt(e)[0];t!==c&&(c&&!t?u():t&&!c&&!a.current&&d(),r(c))},[e,t]),Ws(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?od(t,{className:Ee(s,t.props.className)}):null}function Xt(){return Xt=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Xt.apply(this,arguments)}const wu=900,Su=700,eo=576,Pu=330;function Oy(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>eo,s=i.containerHeight>Pu,n=Ee({"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>eo,"uppy-size--lg":i.containerWidth>Su,"uppy-size--xl":i.containerWidth>wu,"uppy-size--height-md":i.containerHeight>Pu,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s});let o=1;i.containerWidth>wu?o=5:i.containerWidth>Su?o=4:i.containerWidth>eo&&(o=3);const a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(m=>i.files[m].isGhost).length:null,d=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return h("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Kd(),"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},h("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),h("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:h("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},h("span",{"aria-hidden":"true"},"×")),h("div",{className:"uppy-Dashboard-innerWrap"},h("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&h(xy,i),l&&h("div",{className:"uppy-Dashboard-serviceMsg"},h("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},h("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},h("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"}),h("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),h("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),h("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),h("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?h(Fy,{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}):h(eh,Xt({},i,{isSizeMD:r})),h(os,null,i.showAddFilesPanel?h(Cy,Xt({key:"AddFiles"},i,{isSizeMD:r})):null),h(os,null,i.fileCardFor?h(Iy,Xt({key:"FileCard"},i)):null),h(os,null,i.activePickerPanel?h(_y,Xt({key:"Picker"},i)):null),h(os,null,i.showFileEditor?h(Ty,Xt({key:"Editor"},i)):null),h("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(m=>i.uppy.getPlugin(m.id).render(i.state))))))}const ky={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 Q(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Ry=0;function tt(i){return"__private_"+Ry+++"_"+i}const Uy={version:"3.9.1"},to=gu.default||gu,Fu=9,My=27;function Cu(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const By={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Ed,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:void 0,onRequestCloseModal:null};var Ut=tt("disabledNodes"),pt=tt("generateLargeThumbnailIfSingleFile"),Xi=tt("openFileEditorWhenFilesAdded"),Mt=tt("attachRenderFunctionToTarget"),io=tt("isTargetSupported"),ro=tt("getAcquirers"),so=tt("getProgressIndicators"),ft=tt("getEditors"),no=tt("addSpecifiedPluginsFromOptions"),oo=tt("autoDiscoverPlugins"),Bt=tt("addSupportedPluginIfNoTarget");let Na=class extends he{constructor(e,t){var r,s;let n;t?t.autoOpen===void 0?n=t.autoOpenFileEditor?"imageEditor":null:n=t.autoOpen:n=null,super(e,{...By,...t,autoOpen:n}),Object.defineProperty(this,Ut,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${zr()}`,this.superFocus=X0(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=o=>{const l=this.getPluginState().targets.filter(u=>u.id!==o.id);this.setPluginState({targets:l})},this.addTarget=o=>{const a=o.id||o.constructor.name,l=o.title||a,u=o.type;if(u!=="acquirer"&&u!=="progressindicator"&&u!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const d={id:a,name:l,type:u},m=this.getPluginState().targets.slice();return m.push(d),this.setPluginState({targets:m}),this.el},this.hideAllPanels=()=>{var o;const a=this.getPluginState(),l={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};a.activePickerPanel===l.activePickerPanel&&a.showAddFilesPanel===l.showAddFilesPanel&&a.showFileEditor===l.showFileEditor&&a.activeOverlayType===l.activeOverlayType||(this.setPluginState(l),this.uppy.emit("dashboard:close-panel",(o=a.activePickerPanel)==null?void 0:o.id))},this.showPanel=o=>{const{targets:a}=this.getPluginState(),l=a.find(u=>u.type==="acquirer"&&u.id===o);this.setPluginState({activePickerPanel:l,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",o)},this.canEditFile=o=>{const{targets:a}=this.getPluginState();return Q(this,ft)[ft](a).some(u=>this.uppy.getPlugin(u.id).canEditFile(o))},this.openFileEditor=o=>{const{targets:a}=this.getPluginState(),l=Q(this,ft)[ft](a);this.setPluginState({showFileEditor:!0,fileCardFor:o.id||null,activeOverlayType:"FileEditor"}),l.forEach(u=>{this.uppy.getPlugin(u.id).selectFile(o)})},this.closeFileEditor=()=>{const{metaFields:o}=this.getPluginState();o&&o.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:o}=this.getPluginState();Q(this,ft)[ft](o).forEach(l=>{this.uppy.getPlugin(l.id).save()}),this.closeFileEditor()},this.openModal=()=>{const{promise:o,resolve:a}=Cu();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 l=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",l,!1),a()};this.el.addEventListener("animationend",l,!1)}else this.setPluginState({isHidden:!1}),a();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),o},this.closeModal=o=>{var a;const l=(a=o?.manualClose)!=null?a:!0,{isHidden:u,isClosing:d}=this.getPluginState();if(u||d)return;const{promise:c,resolve:m}=Cu();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const F=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",F,!1),m()};this.el.addEventListener("animationend",F,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),m();if(document.removeEventListener("keydown",this.handleKeyDownInModal),l&&this.opts.browserBackButtonClose){var w;(w=history.state)!=null&&w[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),c},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=o=>{const{capabilities:a}=this.uppy.getState();this.uppy.setState({capabilities:{...a,darkMode:o}})},this.handleSystemDarkModeChange=o=>{const a=o.matches;this.uppy.log(`[Dashboard] Dark mode is ${a?"on":"off"}`),this.setDarkModeCapability(a)},this.toggleFileCard=(o,a)=>{const l=this.uppy.getFile(a);o?this.uppy.emit("dashboard:file-edit-start",l):this.uppy.emit("dashboard:file-edit-complete",l),this.setPluginState({fileCardFor:o?a:null,activeOverlayType:o?"FileCard":null})},this.toggleAddFilesPanel=o=>{this.setPluginState({showAddFilesPanel:o,activeOverlayType:o?"AddFiles":null})},this.addFiles=o=>{const a=o.map(l=>({source:this.id,name:l.name,type:l.type,data:l,meta:{relativePath:l.relativePath||l.webkitRelativePath||null}}));try{this.uppy.addFiles(a)}catch(l){this.uppy.log(l)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(o=>{const a=o[0],{width:l,height:u}=a.contentRect;this.setPluginState({containerWidth:l,containerHeight:u,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{const o=this.getPluginState(),a=!this.opts.inline&&o.isHidden;!o.areInsidesReadyToBeVisible&&!a&&(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=o=>{this.el.contains(o.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=o=>{var a;const l=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],u=(a=Q(this,Ut)[Ut])!=null?a:st(this.el.querySelectorAll(l)).filter(d=>!d.classList.contains("uppy-Dashboard-close"));for(const d of u)d.tagName==="A"?d.setAttribute("aria-disabled",o):d.disabled=o;o?Q(this,Ut)[Ut]=u:Q(this,Ut)[Ut]=null,this.dashboardIsDisabled=o},this.updateBrowserHistory=()=>{var o;(o=history.state)!=null&&o[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=o=>{var a;this.isModalOpen()&&(!o.state||!o.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(a=o.state)!=null&&a[this.modalName]&&history.back()},this.handleKeyDownInModal=o=>{o.keyCode===My&&this.requestCloseModal(),o.keyCode===Fu&&Xd(o,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=o=>{this.uppy.iteratePlugins(l=>{l.type==="acquirer"&&(l.handleRootPaste==null||l.handleRootPaste(o))});const a=st(o.clipboardData.files);a.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(a))},this.handleInputChange=o=>{o.preventDefault();const a=st(o.target.files);a.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(a))},this.handleDragOver=o=>{var a,l;o.preventDefault(),o.stopPropagation();const u=()=>{let w=!0;return this.uppy.iteratePlugins(F=>{F.canHandleRootDrop!=null&&F.canHandleRootDrop(o)&&(w=!0)}),w},d=()=>{const{types:w}=o.dataTransfer;return w.some(F=>F==="Files")},c=u(),m=d();if(!c&&!m||this.opts.disabled||this.opts.disableLocalFiles&&(m||!c)||!this.uppy.getState().allowNewUpload){o.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}o.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(a=(l=this.opts).onDragOver)==null||a.call(l,o)},this.handleDragLeave=o=>{var a,l;o.preventDefault(),o.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(a=(l=this.opts).onDragLeave)==null||a.call(l,o)},this.handleDrop=async o=>{var a,l;o.preventDefault(),o.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(m=>{m.type==="acquirer"&&(m.handleRootDrop==null||m.handleRootDrop(o))});let u=!1;const d=m=>{this.uppy.log(m,"error"),u||(this.uppy.info(m.message,"error"),u=!0)};this.uppy.log("[Dashboard] Processing dropped files");const c=await Ba(o.dataTransfer,{logDropError:d});c.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(c)),(a=(l=this.opts).onDrop)==null||a.call(l,o)},this.handleRequestThumbnail=o=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",o)},this.handleCancelThumbnail=o=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",o)},this.handleKeyDownInInline=o=>{o.keyCode===Fu&&G0(o,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=o=>{this.el.contains(document.activeElement)&&this.handlePaste(o)},this.handleComplete=o=>{let{failed:a}=o;this.opts.closeAfterFinish&&!(a!=null&&a.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,pt,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const o=600,a=this.uppy.getFiles();if(a.length===1){const l=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);l?.setOptions({thumbnailWidth:o});const u={...a[0],preview:void 0};l?.requestThumbnail(u).then(()=>{l?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Xi,{writable:!0,value:o=>{const a=o[0],{metaFields:l}=this.getPluginState(),u=l&&l.length>0,d=this.canEditFile(a);u&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,a.id):d&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(a)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const o=pu(this.opts.trigger);o?o.forEach(a=>a.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",Q(this,Bt)[Bt]),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",Q(this,pt)[pt]),this.uppy.on("file-removed",Q(this,pt)[pt]),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",Q(this,Xi)[Xi])},this.removeEvents=()=>{const o=pu(this.opts.trigger);!this.opts.inline&&o&&o.forEach(a=>a.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Q(this,Bt)[Bt]),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",Q(this,pt)[pt]),this.uppy.off("file-removed",Q(this,pt)[pt]),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",Q(this,Xi)[Xi])},this.superFocusOnEachUpdate=()=>{const o=this.el.contains(document.activeElement),a=document.activeElement===document.body||document.activeElement===null,l=this.uppy.getState().info.length===0,u=!this.opts.inline;l&&(u||o||a&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(o,a)=>{this.uppy.setFileMeta(a,o),this.toggleFileCard(!1,a)},Object.defineProperty(this,Mt,{writable:!0,value:o=>{const a=this.uppy.getPlugin(o.id);return{...o,icon:a.icon||this.opts.defaultPickerIcon,render:a.render}}}),Object.defineProperty(this,io,{writable:!0,value:o=>{const a=this.uppy.getPlugin(o.id);return typeof a.isSupported!="function"?!0:a.isSupported()}}),Object.defineProperty(this,ro,{writable:!0,value:to(o=>o.filter(a=>a.type==="acquirer"&&Q(this,io)[io](a)).map(Q(this,Mt)[Mt]))}),Object.defineProperty(this,so,{writable:!0,value:to(o=>o.filter(a=>a.type==="progressindicator").map(Q(this,Mt)[Mt]))}),Object.defineProperty(this,ft,{writable:!0,value:to(o=>o.filter(a=>a.type==="editor").map(Q(this,Mt)[Mt]))}),this.render=o=>{const a=this.getPluginState(),{files:l,capabilities:u,allowNewUpload:d}=o,{newFiles:c,uploadStartedFiles:m,completeFiles:w,erroredFiles:F,inProgressFiles:T,inProgressNotPausedFiles:P,processingFiles:b,isUploadStarted:y,isAllComplete:f,isAllErrored:p,isAllPaused:v}=this.uppy.getObjectOfFilesPerState(),g=Q(this,ro)[ro](a.targets),_=Q(this,so)[so](a.targets),A=Q(this,ft)[ft](a.targets);let I;return this.opts.theme==="auto"?I=u.darkMode?"dark":"light":I=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}".`)),Oy({state:o,isHidden:a.isHidden,files:l,newFiles:c,uploadStartedFiles:m,completeFiles:w,erroredFiles:F,inProgressFiles:T,inProgressNotPausedFiles:P,processingFiles:b,isUploadStarted:y,isAllComplete:f,isAllErrored:p,isAllPaused:v,totalFileCount:Object.keys(l).length,totalProgress:o.totalProgress,allowNewUpload:d,acquirers:g,theme:I,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:a.activePickerPanel,showFileEditor:a.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:a.isClosing,progressindicators:_,editors:A,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:o.recoveredState,metaFields:a.metaFields,resumableUploads:u.resumableUploads||!1,individualCancellation:u.individualCancellation,isMobileDevice:u.isMobileDevice,fileCardFor:a.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:a.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:a.containerWidth,containerHeight:a.containerHeight,areInsidesReadyToBeVisible:a.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:a.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,no,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach(a=>{const l=this.uppy.getPlugin(a);l?l.mount(this,l):this.uppy.log(`[Uppy] Dashboard could not find plugin '${a}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,oo,{writable:!0,value:()=>{this.uppy.iteratePlugins(Q(this,Bt)[Bt])}}),Object.defineProperty(this,Bt,{writable:!0,value:o=>{var a;const l=["acquirer","editor"];o&&!((a=o.opts)!=null&&a.target)&&l.includes(o.type)&&(this.getPluginState().targets.some(d=>o.id===d.id)||o.mount(this,o))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:o,closeAfterFinish:a}=this.opts;if(o&&a)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:l,allowMultipleUploadBatches:u}=this.uppy.opts;(l||u)&&a&&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:d}=this.opts;d&&this.mount(d,this),this.opts.disableStatusBar||this.uppy.use(Aa,{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(Rd,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(Ma,{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 c=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${c?"on":"off"}`),this.setDarkModeCapability(c),this.opts.theme==="auto"){var m;(m=this.darkModeMediaQuery)==null||m.addListener(this.handleSystemDarkModeChange)}Q(this,no)[no](),Q(this,oo)[oo](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const l=this.uppy.getPlugin(`${this.id}:Informer`);l&&this.uppy.removePlugin(l)}if(!this.opts.disableStatusBar){const l=this.uppy.getPlugin(`${this.id}:StatusBar`);l&&this.uppy.removePlugin(l)}if(!this.opts.disableThumbnailGenerator){const l=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);l&&this.uppy.removePlugin(l)}if((this.opts.plugins||[]).forEach(l=>{const u=this.uppy.getPlugin(l);u&&u.unmount()}),this.opts.theme==="auto"){var a;(a=this.darkModeMediaQuery)==null||a.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=ky,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),(s=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}};Na.VERSION=Uy.version;const Ti=R.instanceOf(Ca),th=R.arrayOf(R.string),hn=R.shape({strings:R.object,pluralize:R.func}),Ly=R.shape({id:R.string.isRequired,name:R.string.isRequired,placeholder:R.string}),ih=R.oneOfType([R.arrayOf(Ly),R.func]),Ys=R.oneOfType([R.string,R.number]),Ny=["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"],zy=/^(aria-|data-)/,Hr=i=>Object.fromEntries(Object.entries(i).filter(e=>{let[t]=e;return zy.test(t)||Ny.includes(t)}));function qr(i,e){return Object.keys(i).some(t=>!Object.hasOwn(i,t)&&i[t]!==e[t])}class rh extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(qr(this.props,e)){const{uppy:t,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,...t}={id:"react:Dashboard",inline:!0,...this.props,target:this.container};e.use(Na,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},...Hr(this.props)})}}rh.propsTypes={uppy:Ti,disableInformer:R.bool,disableStatusBar:R.bool,disableThumbnailGenerator:R.bool,height:Ys,hideProgressAfterFinish:R.bool,hideUploadButton:R.bool,locale:hn,metaFields:ih,note:R.string,plugins:th,proudlyDisplayPoweredByUppy:R.bool,showProgressDetails:R.bool,width:Ys,thumbnailType:R.string,thumbnailWidth:R.number};class sh extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){const{uppy:t,open:r,onRequestClose:s}=this.props;if(e.uppy!==t)this.uninstallPlugin(e),this.installPlugin();else if(qr(this.props,e)){const{uppy:n,...o}={...this.props,inline:!1,onRequestCloseModal:s};this.plugin.setOptions(o)}e.open&&!r?this.plugin.closeModal():!e.open&&r&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{target:e=this.container,open:t,onRequestClose:r,uppy:s,...n}=this.props,o={...n,id:"react:DashboardModal",inline:!1,target:e,open:t,onRequestCloseModal:r};s.use(Na,o),this.plugin=s.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},...Hr(this.props)})}}sh.propTypes={uppy:Ti.isRequired,target:typeof window<"u"?R.instanceOf(window.HTMLElement):R.any,open:R.bool,onRequestClose:R.func,closeModalOnClickOutside:R.bool,disablePageScrollWhenModalOpen:R.bool,plugins:th,width:Ys,height:Ys,showProgressDetails:R.bool,note:R.string,metaFields:ih,proudlyDisplayPoweredByUppy:R.bool,autoOpenFileEditor:R.bool,animateOpenClose:R.bool,browserBackButtonClose:R.bool,closeAfterFinish:R.bool,disableStatusBar:R.bool,disableInformer:R.bool,disableThumbnailGenerator:R.bool,disableLocalFiles:R.bool,disabled:R.bool,hideCancelButton:R.bool,hidePauseResumeButton:R.bool,hideProgressAfterFinish:R.bool,hideRetryButton:R.bool,hideUploadButton:R.bool,showLinkToFileUploadResult:R.bool,showRemoveButtonAfterComplete:R.bool,showSelectedFiles:R.bool,waitForThumbnailsBeforeUpload:R.bool,fileManagerSelectionType:R.string,theme:R.string,thumbnailType:R.string,thumbnailWidth:R.number,locale:hn};sh.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 $y={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}},jy={version:"3.1.1"},Hy={inputName:"files[]",width:"100%",height:"100%"};let nh=class oh extends he{constructor(e,t){super(e,{...Hy,...t}),this.isDragDropSupported=Kd(),this.addFiles=r=>{const s=r.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(s)}catch(n){this.uppy.log(n)}},this.onInputChange=r=>{const s=st(r.target.files);s.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(s)),r.target.value=null},this.handleDragOver=r=>{var s,n;r.preventDefault(),r.stopPropagation();const{types:o}=r.dataTransfer,a=o.some(u=>u==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!a||!l){r.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}r.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,r)},this.handleDragLeave=r=>{var s,n;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(s=(n=this.opts).onDragLeave)==null||s.call(n,r)},this.handleDrop=async r=>{var s,n;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const o=l=>{this.uppy.log(l,"error")},a=await Ba(r.dataTransfer,{logDropError:o});a.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(a)),(s=(n=this.opts).onDrop)==null||s.call(n,r)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=$y,this.i18nInit()}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return h("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 h("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},h("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return h("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:h("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return h("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){const e=`uppy-u-reset
12
+ uppy-DragDrop-container
13
+ ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
14
+ ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
15
+ `,t={width:this.opts.width,height:this.opts.height};return h("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),h("div",{className:"uppy-DragDrop-inner"},oh.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};nh.VERSION=jy.version;class ah extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(qr(this.props,e)){const{uppy:t,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,locale:t,inputName:r,width:s,height:n,note:o}=this.props,a={id:"react:DragDrop",locale:t,inputName:r,width:s,height:n,note:o,target:this.container};e.use(nh,a),this.plugin=e.getPlugin(a.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},...Hr(this.props)})}}ah.propTypes={uppy:Ti.isRequired,locale:hn,inputName:R.string,width:R.string,height:R.string,note:R.string};ah.defaultProps={locale:null,inputName:"files[]",width:"100%",height:"100%",note:null};const qy={version:"3.1.1"},Vy={target:"body",fixed:!1,hideAfterFinish:!0};let lh=class extends he{constructor(e,t){super(e,{...Vy,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,r=(t===0||t===100)&&this.opts.hideAfterFinish;return h("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":r},h("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),h("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};lh.VERSION=qy.version;class uh extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(qr(this.props,e)){const{uppy:t,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,fixed:t,hideAfterFinish:r}=this.props,s={id:"react:ProgressBar",fixed:t,hideAfterFinish:r,target:this.container};e.use(lh,s),this.plugin=e.getPlugin(s.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},...Hr(this.props)})}}uh.propTypes={uppy:Ti.isRequired,fixed:R.bool,hideAfterFinish:R.bool};uh.defaultProps={fixed:!1,hideAfterFinish:!0};class ch extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(qr(this.props,e)){const{uppy:t,...r}={...this.props,target:this.container};this.plugin.setOptions(r)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,hideUploadButton:t,hideRetryButton:r,hidePauseResumeButton:s,hideCancelButton:n,showProgressDetails:o,hideAfterFinish:a,doneButtonHandler:l}=this.props,u={id:"react:StatusBar",hideUploadButton:t,hideRetryButton:r,hidePauseResumeButton:s,hideCancelButton:n,showProgressDetails:o,hideAfterFinish:a,doneButtonHandler:l,target:this.container};e.use(Aa,u),this.plugin=e.getPlugin(u.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},...Hr(this.props)})}}ch.propTypes={uppy:Ti.isRequired,hideUploadButton:R.bool,hideRetryButton:R.bool,hidePauseResumeButton:R.bool,hideCancelButton:R.bool,showProgressDetails:R.bool,hideAfterFinish:R.bool,doneButtonHandler:R.func};ch.defaultProps={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};const Wy={strings:{chooseFiles:"Choose files"}},Gy={version:"3.1.2"},Xy={pretty:!0,inputName:"files[]"};let dh=class extends he{constructor(e,t){super(e,{...Xy,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=Wy,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map(r=>({source:this.id,name:r.name,type:r.type,data:r}));try{this.uppy.addFiles(t)}catch(r){this.uppy.log(r)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=st(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const e={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},{restrictions:t}=this.uppy.opts,r=t.allowedFileTypes?t.allowedFileTypes.join(","):void 0;return h("div",{className:"uppy-FileInput-container"},h("input",{className:"uppy-FileInput-input",style:this.opts.pretty?e:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:t.maxNumberOfFiles!==1,accept:r,ref:s=>{this.input=s}}),this.opts.pretty&&h("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};dh.VERSION=Gy.version;class hh extends ee.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e,locale:t,pretty:r,inputName:s}=this.props,n={id:"react:FileInput",locale:t,pretty:r,inputName:s,target:this.container};e.use(dh,n),this.plugin=e.getPlugin(n.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}})}}hh.propTypes={uppy:Ti.isRequired,locale:hn,pretty:R.bool,inputName:R.string};hh.defaultProps={locale:void 0,pretty:!0,inputName:"files[]"};const Ky={version:"2.1.0"},Yy={target:null};function ao(i){var e,t;return(e=(t=i.dataTransfer)==null||(t=t.types)==null?void 0:t.some(r=>r==="Files"))!=null?e:!1}class ph extends un{constructor(e,t){super(e,{...Yy,...t}),this.addFiles=r=>{const s=r.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(s)}catch(n){this.uppy.log(n)}},this.handleDrop=async r=>{var s,n,o;if(!ao(r))return;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),(s=r.currentTarget)==null||s.classList.remove("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootDrop==null||d.handleRootDrop(r))});let a=!1;const l=d=>{this.uppy.log(d,"error"),a||(this.uppy.info(d.message,"error"),a=!0)},u=await Ba(r.dataTransfer,{logDropError:l});u.length>0&&(this.uppy.log("[DropTarget] Files were dropped"),this.addFiles(u)),(n=(o=this.opts).onDrop)==null||n.call(o,r)},this.handleDragOver=r=>{var s,n;ao(r)&&(r.preventDefault(),r.stopPropagation(),r.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),r.currentTarget.classList.add("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,r))},this.handleDragLeave=r=>{var s,n;if(!ao(r))return;r.preventDefault(),r.stopPropagation();const{currentTarget:o}=r;clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{o.classList.remove("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!1})},50),(s=(n=this.opts).onDragLeave)==null||s.call(n,r)},this.addListeners=()=>{const{target:r}=this.opts;if(r instanceof Element?this.nodes=[r]:typeof r=="string"&&(this.nodes=st(document.querySelectorAll(r))),!this.nodes||this.nodes.length===0)throw new Error(`"${r}" does not match any HTML elements`);this.nodes.forEach(s=>{s.addEventListener("dragover",this.handleDragOver,!1),s.addEventListener("dragleave",this.handleDragLeave,!1),s.addEventListener("drop",this.handleDrop,!1)})},this.removeListeners=()=>{this.nodes&&this.nodes.forEach(r=>{r.removeEventListener("dragover",this.handleDragOver,!1),r.removeEventListener("dragleave",this.handleDragLeave,!1),r.removeEventListener("drop",this.handleDrop,!1)})},this.type="acquirer",this.id=this.opts.id||"DropTarget",this.title="Drop Target"}install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}}ph.VERSION=Ky.version;function Os(i){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Os=function(e){return typeof e}:Os=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Os(i)}function Qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _u(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function Jy(i,e,t){return e&&_u(i.prototype,e),t&&_u(i,t),i}function Zy(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Tu(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}function fh(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tu(Object(t),!0).forEach(function(r){Zy(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Tu(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function gh(i){return e1(i)||t1(i)||i1(i)||r1()}function e1(i){if(Array.isArray(i))return zo(i)}function t1(i){if(typeof Symbol<"u"&&Symbol.iterator in Object(i))return Array.from(i)}function i1(i,e){if(i){if(typeof i=="string")return zo(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 zo(i,e)}}function zo(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function r1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var pn=typeof window<"u"&&typeof window.document<"u",ot=pn?window:{},za=pn&&ot.document.documentElement?"ontouchstart"in ot.document.documentElement:!1,$a=pn?"PointerEvent"in ot:!1,J="cropper",ja="all",mh="crop",yh="move",vh="zoom",Lt="e",Nt="w",li="s",Tt="n",Ki="ne",Yi="nw",Qi="se",Ji="sw",$o="".concat(J,"-crop"),Eu="".concat(J,"-disabled"),Ae="".concat(J,"-hidden"),Du="".concat(J,"-hide"),s1="".concat(J,"-invisible"),Qs="".concat(J,"-modal"),jo="".concat(J,"-move"),xr="".concat(J,"Action"),as="".concat(J,"Preview"),Ha="crop",bh="move",wh="none",Ho="crop",qo="cropend",Vo="cropmove",Wo="cropstart",xu="dblclick",n1=za?"touchstart":"mousedown",o1=za?"touchmove":"mousemove",a1=za?"touchend touchcancel":"mouseup",Au=$a?"pointerdown":n1,Iu=$a?"pointermove":o1,Ou=$a?"pointerup pointercancel":a1,ku="ready",Ru="resize",Uu="wheel",Go="zoom",Mu="image/jpeg",l1=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,u1=/^data:/,c1=/^data:image\/jpeg;base64,/,d1=/^img|canvas$/i,Bu={viewMode:0,dragMode:Ha,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},h1='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',p1=Number.isNaN||ot.isNaN;function G(i){return typeof i=="number"&&!p1(i)}var Lu=function(e){return e>0&&e<1/0};function lo(i){return typeof i>"u"}function ti(i){return Os(i)==="object"&&i!==null}var f1=Object.prototype.hasOwnProperty;function pi(i){if(!ti(i))return!1;try{var e=i.constructor,t=e.prototype;return e&&t&&f1.call(t,"isPrototypeOf")}catch{return!1}}function De(i){return typeof i=="function"}var g1=Array.prototype.slice;function Sh(i){return Array.from?Array.from(i):g1.call(i)}function ce(i,e){return i&&De(e)&&(Array.isArray(i)||G(i.length)?Sh(i).forEach(function(t,r){e.call(i,t,r,i)}):ti(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)})),i}var Z=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return ti(e)&&r.length>0&&r.forEach(function(n){ti(n)&&Object.keys(n).forEach(function(o){e[o]=n[o]})}),e},m1=/\.\d*(?:0|9){12}\d*$/;function mi(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return m1.test(i)?Math.round(i*e)/e:i}var y1=/^width|height|left|top|marginLeft|marginTop$/;function At(i,e){var t=i.style;ce(e,function(r,s){y1.test(s)&&G(r)&&(r="".concat(r,"px")),t[s]=r})}function v1(i,e){return i.classList?i.classList.contains(e):i.className.indexOf(e)>-1}function ge(i,e){if(e){if(G(i.length)){ce(i,function(r){ge(r,e)});return}if(i.classList){i.classList.add(e);return}var t=i.className.trim();t?t.indexOf(e)<0&&(i.className="".concat(t," ").concat(e)):i.className=e}}function nt(i,e){if(e){if(G(i.length)){ce(i,function(t){nt(t,e)});return}if(i.classList){i.classList.remove(e);return}i.className.indexOf(e)>=0&&(i.className=i.className.replace(e,""))}}function fi(i,e,t){if(e){if(G(i.length)){ce(i,function(r){fi(r,e,t)});return}t?ge(i,e):nt(i,e)}}var b1=/([a-z\d])([A-Z])/g;function qa(i){return i.replace(b1,"$1-$2").toLowerCase()}function Xo(i,e){return ti(i[e])?i[e]:i.dataset?i.dataset[e]:i.getAttribute("data-".concat(qa(e)))}function Ar(i,e,t){ti(t)?i[e]=t:i.dataset?i.dataset[e]=t:i.setAttribute("data-".concat(qa(e)),t)}function w1(i,e){if(ti(i[e]))try{delete i[e]}catch{i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch{i.dataset[e]=void 0}else i.removeAttribute("data-".concat(qa(e)))}var Ph=/\s\s*/,Fh=(function(){var i=!1;if(pn){var e=!1,t=function(){},r=Object.defineProperty({},"once",{get:function(){return i=!0,e},set:function(n){e=n}});ot.addEventListener("test",t,r),ot.removeEventListener("test",t,r)}return i})();function Xe(i,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=t;e.trim().split(Ph).forEach(function(n){if(!Fh){var o=i.listeners;o&&o[n]&&o[n][t]&&(s=o[n][t],delete o[n][t],Object.keys(o[n]).length===0&&delete o[n],Object.keys(o).length===0&&delete i.listeners)}i.removeEventListener(n,s,r)})}function He(i,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},s=t;e.trim().split(Ph).forEach(function(n){if(r.once&&!Fh){var o=i.listeners,a=o===void 0?{}:o;s=function(){delete a[n][t],i.removeEventListener(n,s,r);for(var u=arguments.length,d=new Array(u),c=0;c<u;c++)d[c]=arguments[c];t.apply(i,d)},a[n]||(a[n]={}),a[n][t]&&i.removeEventListener(n,a[n][t],r),a[n][t]=s,i.listeners=a}i.addEventListener(n,s,r)})}function yi(i,e,t){var r;return De(Event)&&De(CustomEvent)?r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,t)),i.dispatchEvent(r)}function Ch(i){var e=i.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var uo=ot.location,S1=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Nu(i){var e=i.match(S1);return e!==null&&(e[1]!==uo.protocol||e[2]!==uo.hostname||e[3]!==uo.port)}function zu(i){var e="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+e}function vr(i){var e=i.rotate,t=i.scaleX,r=i.scaleY,s=i.translateX,n=i.translateY,o=[];G(s)&&s!==0&&o.push("translateX(".concat(s,"px)")),G(n)&&n!==0&&o.push("translateY(".concat(n,"px)")),G(e)&&e!==0&&o.push("rotate(".concat(e,"deg)")),G(t)&&t!==1&&o.push("scaleX(".concat(t,")")),G(r)&&r!==1&&o.push("scaleY(".concat(r,")"));var a=o.length?o.join(" "):"none";return{WebkitTransform:a,msTransform:a,transform:a}}function P1(i){var e=fh({},i),t=[];return ce(i,function(r,s){delete e[s],ce(e,function(n){var o=Math.abs(r.startX-n.startX),a=Math.abs(r.startY-n.startY),l=Math.abs(r.endX-n.endX),u=Math.abs(r.endY-n.endY),d=Math.sqrt(o*o+a*a),c=Math.sqrt(l*l+u*u),m=(c-d)/d;t.push(m)})}),t.sort(function(r,s){return Math.abs(r)<Math.abs(s)}),t[0]}function ls(i,e){var t=i.pageX,r=i.pageY,s={endX:t,endY:r};return e?s:fh({startX:t,startY:r},s)}function F1(i){var e=0,t=0,r=0;return ce(i,function(s){var n=s.startX,o=s.startY;e+=n,t+=o,r+=1}),e/=r,t/=r,{pageX:e,pageY:t}}function It(i){var e=i.aspectRatio,t=i.height,r=i.width,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",n=Lu(r),o=Lu(t);if(n&&o){var a=t*e;s==="contain"&&a>r||s==="cover"&&a<r?t=r/e:r=t*e}else n?t=r/e:o&&(r=t*e);return{width:r,height:t}}function C1(i){var e=i.width,t=i.height,r=i.degree;if(r=Math.abs(r)%180,r===90)return{width:t,height:e};var s=r%90*Math.PI/180,n=Math.sin(s),o=Math.cos(s),a=e*o+t*n,l=e*n+t*o;return r>90?{width:l,height:a}:{width:a,height:l}}function _1(i,e,t,r){var s=e.aspectRatio,n=e.naturalWidth,o=e.naturalHeight,a=e.rotate,l=a===void 0?0:a,u=e.scaleX,d=u===void 0?1:u,c=e.scaleY,m=c===void 0?1:c,w=t.aspectRatio,F=t.naturalWidth,T=t.naturalHeight,P=r.fillColor,b=P===void 0?"transparent":P,y=r.imageSmoothingEnabled,f=y===void 0?!0:y,p=r.imageSmoothingQuality,v=p===void 0?"low":p,g=r.maxWidth,_=g===void 0?1/0:g,A=r.maxHeight,I=A===void 0?1/0:A,N=r.minWidth,H=N===void 0?0:N,z=r.minHeight,k=z===void 0?0:z,L=document.createElement("canvas"),V=L.getContext("2d"),E=It({aspectRatio:w,width:_,height:I}),C=It({aspectRatio:w,width:H,height:k},"cover"),S=Math.min(E.width,Math.max(C.width,F)),D=Math.min(E.height,Math.max(C.height,T)),O=It({aspectRatio:s,width:_,height:I}),x=It({aspectRatio:s,width:H,height:k},"cover"),M=Math.min(O.width,Math.max(x.width,n)),q=Math.min(O.height,Math.max(x.height,o)),W=[-M/2,-q/2,M,q];return L.width=mi(S),L.height=mi(D),V.fillStyle=b,V.fillRect(0,0,S,D),V.save(),V.translate(S/2,D/2),V.rotate(l*Math.PI/180),V.scale(d,m),V.imageSmoothingEnabled=f,V.imageSmoothingQuality=v,V.drawImage.apply(V,[i].concat(gh(W.map(function(ne){return Math.floor(mi(ne))})))),V.restore(),L}var _h=String.fromCharCode;function T1(i,e,t){var r="";t+=e;for(var s=e;s<t;s+=1)r+=_h(i.getUint8(s));return r}var E1=/^data:.*,/;function D1(i){var e=i.replace(E1,""),t=atob(e),r=new ArrayBuffer(t.length),s=new Uint8Array(r);return ce(s,function(n,o){s[o]=t.charCodeAt(o)}),r}function x1(i,e){for(var t=[],r=8192,s=new Uint8Array(i);s.length>0;)t.push(_h.apply(null,Sh(s.subarray(0,r)))),s=s.subarray(r);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function A1(i){var e=new DataView(i),t;try{var r,s,n;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var o=e.byteLength,a=2;a+1<o;){if(e.getUint8(a)===255&&e.getUint8(a+1)===225){s=a;break}a+=1}if(s){var l=s+4,u=s+10;if(T1(e,l,4)==="Exif"){var d=e.getUint16(u);if(r=d===18761,(r||d===19789)&&e.getUint16(u+2,r)===42){var c=e.getUint32(u+4,r);c>=8&&(n=u+c)}}}if(n){var m=e.getUint16(n,r),w,F;for(F=0;F<m;F+=1)if(w=n+F*12+2,e.getUint16(w,r)===274){w+=8,t=e.getUint16(w,r),e.setUint16(w,1,r);break}}}catch{t=1}return t}function I1(i){var e=0,t=1,r=1;switch(i){case 2:t=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:r}}var O1={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,s=this.cropper;ge(s,Ae),nt(e,Ae);var n={width:Math.max(r.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(r.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=n,At(s,{width:n.width,height:n.height}),ge(e,Ae),nt(s,Ae)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,s=Math.abs(t.rotate)%180===90,n=s?t.naturalHeight:t.naturalWidth,o=s?t.naturalWidth:t.naturalHeight,a=n/o,l=e.width,u=e.height;e.height*a>e.width?r===3?l=e.height*a:u=e.width/a:r===3?u=e.width/a:l=e.height*a;var d={aspectRatio:a,naturalWidth:n,naturalHeight:o,width:l,height:u};d.left=(e.width-l)/2,d.top=(e.height-u)/2,d.oldLeft=d.left,d.oldTop=d.top,this.canvasData=d,this.limited=r===1||r===2,this.limitCanvas(!0,!0),this.initialImageData=Z({},t),this.initialCanvasData=Z({},d)},limitCanvas:function(e,t){var r=this.options,s=this.containerData,n=this.canvasData,o=this.cropBoxData,a=r.viewMode,l=n.aspectRatio,u=this.cropped&&o;if(e){var d=Number(r.minCanvasWidth)||0,c=Number(r.minCanvasHeight)||0;a>1?(d=Math.max(d,s.width),c=Math.max(c,s.height),a===3&&(c*l>d?d=c*l:c=d/l)):a>0&&(d?d=Math.max(d,u?o.width:0):c?c=Math.max(c,u?o.height:0):u&&(d=o.width,c=o.height,c*l>d?d=c*l:c=d/l));var m=It({aspectRatio:l,width:d,height:c});d=m.width,c=m.height,n.minWidth=d,n.minHeight=c,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(a>(u?0:1)){var w=s.width-n.width,F=s.height-n.height;n.minLeft=Math.min(0,w),n.minTop=Math.min(0,F),n.maxLeft=Math.max(0,w),n.maxTop=Math.max(0,F),u&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,a===2&&(n.width>=s.width&&(n.minLeft=Math.min(0,w),n.maxLeft=Math.max(0,w)),n.height>=s.height&&(n.minTop=Math.min(0,F),n.maxTop=Math.max(0,F))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=s.width,n.maxTop=s.height},renderCanvas:function(e,t){var r=this.canvasData,s=this.imageData;if(t){var n=C1({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),o=n.width,a=n.height,l=r.width*(o/r.naturalWidth),u=r.height*(a/r.naturalHeight);r.left-=(l-r.width)/2,r.top-=(u-r.height)/2,r.width=l,r.height=u,r.aspectRatio=o/a,r.naturalWidth=o,r.naturalHeight=a,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,At(this.canvas,Z({width:r.width,height:r.height},vr({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,s=r.naturalWidth*(t.width/t.naturalWidth),n=r.naturalHeight*(t.height/t.naturalHeight);Z(r,{width:s,height:n,left:(t.width-s)/2,top:(t.height-n)/2}),At(this.image,Z({width:r.width,height:r.height},vr(Z({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,s=Number(e.autoCropArea)||.8,n={width:t.width,height:t.height};r&&(t.height*r>t.width?n.height=n.width/r:n.width=n.height*r),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*s),n.height=Math.max(n.minHeight,n.height*s),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=Z({},n)},limitCropBox:function(e,t){var r=this.options,s=this.containerData,n=this.canvasData,o=this.cropBoxData,a=this.limited,l=r.aspectRatio;if(e){var u=Number(r.minCropBoxWidth)||0,d=Number(r.minCropBoxHeight)||0,c=a?Math.min(s.width,n.width,n.width+n.left,s.width-n.left):s.width,m=a?Math.min(s.height,n.height,n.height+n.top,s.height-n.top):s.height;u=Math.min(u,s.width),d=Math.min(d,s.height),l&&(u&&d?d*l>u?d=u/l:u=d*l:u?d=u/l:d&&(u=d*l),m*l>c?m=c/l:c=m*l),o.minWidth=Math.min(u,c),o.minHeight=Math.min(d,m),o.maxWidth=c,o.maxHeight=m}t&&(a?(o.minLeft=Math.max(0,n.left),o.minTop=Math.max(0,n.top),o.maxLeft=Math.min(s.width,n.left+n.width)-o.width,o.maxTop=Math.min(s.height,n.top+n.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=s.width-o.width,o.maxTop=s.height-o.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&Ar(this.face,xr,r.width>=t.width&&r.height>=t.height?yh:ja),At(this.cropBox,Z({width:r.width,height:r.height},vr({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),yi(this.element,Ho,this.getData())}},k1={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,s=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",o=document.createElement("img");if(t&&(o.crossOrigin=t),o.src=s,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,!!r){var a=r;typeof r=="string"?a=e.ownerDocument.querySelectorAll(r):r.querySelector&&(a=[r]),this.previews=a,ce(a,function(l){var u=document.createElement("img");Ar(l,as,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),t&&(u.crossOrigin=t),u.src=s,u.alt=n,u.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',l.innerHTML="",l.appendChild(u)})}},resetPreview:function(){ce(this.previews,function(e){var t=Xo(e,as);At(e,{width:t.width,height:t.height}),e.innerHTML=t.html,w1(e,as)})},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,s=r.width,n=r.height,o=e.width,a=e.height,l=r.left-t.left-e.left,u=r.top-t.top-e.top;!this.cropped||this.disabled||(At(this.viewBoxImage,Z({width:o,height:a},vr(Z({translateX:-l,translateY:-u},e)))),ce(this.previews,function(d){var c=Xo(d,as),m=c.width,w=c.height,F=m,T=w,P=1;s&&(P=m/s,T=n*P),n&&T>w&&(P=w/n,F=s*P,T=w),At(d,{width:F,height:T}),At(d.getElementsByTagName("img")[0],Z({width:o*P,height:a*P},vr(Z({translateX:-l*P,translateY:-u*P},e))))}))}},R1={bind:function(){var e=this.element,t=this.options,r=this.cropper;De(t.cropstart)&&He(e,Wo,t.cropstart),De(t.cropmove)&&He(e,Vo,t.cropmove),De(t.cropend)&&He(e,qo,t.cropend),De(t.crop)&&He(e,Ho,t.crop),De(t.zoom)&&He(e,Go,t.zoom),He(r,Au,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&He(r,Uu,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&He(r,xu,this.onDblclick=this.dblclick.bind(this)),He(e.ownerDocument,Iu,this.onCropMove=this.cropMove.bind(this)),He(e.ownerDocument,Ou,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&He(window,Ru,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;De(t.cropstart)&&Xe(e,Wo,t.cropstart),De(t.cropmove)&&Xe(e,Vo,t.cropmove),De(t.cropend)&&Xe(e,qo,t.cropend),De(t.crop)&&Xe(e,Ho,t.crop),De(t.zoom)&&Xe(e,Go,t.zoom),Xe(r,Au,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Xe(r,Uu,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Xe(r,xu,this.onDblclick),Xe(e.ownerDocument,Iu,this.onCropMove),Xe(e.ownerDocument,Ou,this.onCropEnd),t.responsive&&Xe(window,Ru,this.onResize)}},U1={resize:function(){if(!this.disabled){var e=this.options,t=this.container,r=this.containerData,s=t.offsetWidth/r.width;if(s!==1||t.offsetHeight!==r.height){var n,o;e.restore&&(n=this.getCanvasData(),o=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(ce(n,function(a,l){n[l]=a*s})),this.setCropBoxData(ce(o,function(a,l){o[l]=a*s})))}}},dblclick:function(){this.disabled||this.options.dragMode===wh||this.setDragMode(v1(this.dragBox,$o)?bh:Ha)},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?s=e.deltaY>0?1:-1:e.wheelDelta?s=-e.wheelDelta/120:e.detail&&(s=e.detail>0?1:-1),this.zoom(-s*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(G(t)&&t!==1||G(r)&&r!==0||e.ctrlKey))){var s=this.options,n=this.pointers,o;e.changedTouches?ce(e.changedTouches,function(a){n[a.identifier]=ls(a)}):n[e.pointerId||0]=ls(e),Object.keys(n).length>1&&s.zoomable&&s.zoomOnTouch?o=vh:o=Xo(e.target,xr),l1.test(o)&&yi(this.element,Wo,{originalEvent:e,action:o})!==!1&&(e.preventDefault(),this.action=o,this.cropping=!1,o===mh&&(this.cropping=!0,ge(this.dragBox,Qs)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var r=this.pointers;e.preventDefault(),yi(this.element,Vo,{originalEvent:e,action:t})!==!1&&(e.changedTouches?ce(e.changedTouches,function(s){Z(r[s.identifier]||{},ls(s,!0))}):Z(r[e.pointerId||0]||{},ls(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?ce(e.changedTouches,function(s){delete r[s.identifier]}):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,fi(this.dragBox,Qs,this.cropped&&this.options.modal)),yi(this.element,qo,{originalEvent:e,action:t}))}}},M1={change:function(e){var t=this.options,r=this.canvasData,s=this.containerData,n=this.cropBoxData,o=this.pointers,a=this.action,l=t.aspectRatio,u=n.left,d=n.top,c=n.width,m=n.height,w=u+c,F=d+m,T=0,P=0,b=s.width,y=s.height,f=!0,p;!l&&e.shiftKey&&(l=c&&m?c/m:1),this.limited&&(T=n.minLeft,P=n.minTop,b=T+Math.min(s.width,r.width,r.left+r.width),y=P+Math.min(s.height,r.height,r.top+r.height));var v=o[Object.keys(o)[0]],g={x:v.endX-v.startX,y:v.endY-v.startY},_=function(I){switch(I){case Lt:w+g.x>b&&(g.x=b-w);break;case Nt:u+g.x<T&&(g.x=T-u);break;case Tt:d+g.y<P&&(g.y=P-d);break;case li:F+g.y>y&&(g.y=y-F);break}};switch(a){case ja:u+=g.x,d+=g.y;break;case Lt:if(g.x>=0&&(w>=b||l&&(d<=P||F>=y))){f=!1;break}_(Lt),c+=g.x,c<0&&(a=Nt,c=-c,u-=c),l&&(m=c/l,d+=(n.height-m)/2);break;case Tt:if(g.y<=0&&(d<=P||l&&(u<=T||w>=b))){f=!1;break}_(Tt),m-=g.y,d+=g.y,m<0&&(a=li,m=-m,d-=m),l&&(c=m*l,u+=(n.width-c)/2);break;case Nt:if(g.x<=0&&(u<=T||l&&(d<=P||F>=y))){f=!1;break}_(Nt),c-=g.x,u+=g.x,c<0&&(a=Lt,c=-c,u-=c),l&&(m=c/l,d+=(n.height-m)/2);break;case li:if(g.y>=0&&(F>=y||l&&(u<=T||w>=b))){f=!1;break}_(li),m+=g.y,m<0&&(a=Tt,m=-m,d-=m),l&&(c=m*l,u+=(n.width-c)/2);break;case Ki:if(l){if(g.y<=0&&(d<=P||w>=b)){f=!1;break}_(Tt),m-=g.y,d+=g.y,c=m*l}else _(Tt),_(Lt),g.x>=0?w<b?c+=g.x:g.y<=0&&d<=P&&(f=!1):c+=g.x,g.y<=0?d>P&&(m-=g.y,d+=g.y):(m-=g.y,d+=g.y);c<0&&m<0?(a=Ji,m=-m,c=-c,d-=m,u-=c):c<0?(a=Yi,c=-c,u-=c):m<0&&(a=Qi,m=-m,d-=m);break;case Yi:if(l){if(g.y<=0&&(d<=P||u<=T)){f=!1;break}_(Tt),m-=g.y,d+=g.y,c=m*l,u+=n.width-c}else _(Tt),_(Nt),g.x<=0?u>T?(c-=g.x,u+=g.x):g.y<=0&&d<=P&&(f=!1):(c-=g.x,u+=g.x),g.y<=0?d>P&&(m-=g.y,d+=g.y):(m-=g.y,d+=g.y);c<0&&m<0?(a=Qi,m=-m,c=-c,d-=m,u-=c):c<0?(a=Ki,c=-c,u-=c):m<0&&(a=Ji,m=-m,d-=m);break;case Ji:if(l){if(g.x<=0&&(u<=T||F>=y)){f=!1;break}_(Nt),c-=g.x,u+=g.x,m=c/l}else _(li),_(Nt),g.x<=0?u>T?(c-=g.x,u+=g.x):g.y>=0&&F>=y&&(f=!1):(c-=g.x,u+=g.x),g.y>=0?F<y&&(m+=g.y):m+=g.y;c<0&&m<0?(a=Ki,m=-m,c=-c,d-=m,u-=c):c<0?(a=Qi,c=-c,u-=c):m<0&&(a=Yi,m=-m,d-=m);break;case Qi:if(l){if(g.x>=0&&(w>=b||F>=y)){f=!1;break}_(Lt),c+=g.x,m=c/l}else _(li),_(Lt),g.x>=0?w<b?c+=g.x:g.y>=0&&F>=y&&(f=!1):c+=g.x,g.y>=0?F<y&&(m+=g.y):m+=g.y;c<0&&m<0?(a=Yi,m=-m,c=-c,d-=m,u-=c):c<0?(a=Ji,c=-c,u-=c):m<0&&(a=Ki,m=-m,d-=m);break;case yh:this.move(g.x,g.y),f=!1;break;case vh:this.zoom(P1(o),e),f=!1;break;case mh:if(!g.x||!g.y){f=!1;break}p=Ch(this.cropper),u=v.startX-p.left,d=v.startY-p.top,c=n.minWidth,m=n.minHeight,g.x>0?a=g.y>0?Qi:Ki:g.x<0&&(u-=c,a=g.y>0?Ji:Yi),g.y<0&&(d-=m),this.cropped||(nt(this.cropBox,Ae),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}f&&(n.width=c,n.height=m,n.left=u,n.top=d,this.action=a,this.renderCropBox()),ce(o,function(A){A.startX=A.endX,A.startY=A.endY})}},B1={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&ge(this.dragBox,Qs),nt(this.cropBox,Ae),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Z({},this.initialImageData),this.canvasData=Z({},this.initialCanvasData),this.cropBoxData=Z({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Z(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),nt(this.dragBox,Qs),ge(this.cropBox,Ae)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,ce(this.previews,function(r){r.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,nt(this.cropper,Eu)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,ge(this.cropper,Eu)),this},destroy:function(){var e=this.element;return e[J]?(e[J]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,s=r.left,n=r.top;return this.moveTo(lo(e)?e:s+Number(e),lo(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(G(e)&&(r.left=e,s=!0),G(t)&&(r.top=t,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var s=this.options,n=this.canvasData,o=n.width,a=n.height,l=n.naturalWidth,u=n.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&s.zoomable){var d=l*e,c=u*e;if(yi(this.element,Go,{ratio:e,oldRatio:o/l,originalEvent:r})===!1)return this;if(r){var m=this.pointers,w=Ch(this.cropper),F=m&&Object.keys(m).length?F1(m):{pageX:r.pageX,pageY:r.pageY};n.left-=(d-o)*((F.pageX-w.left-n.left)/o),n.top-=(c-a)*((F.pageY-w.top-n.top)/a)}else pi(t)&&G(t.x)&&G(t.y)?(n.left-=(d-o)*((t.x-n.left)/o),n.top-=(c-a)*((t.y-n.top)/a)):(n.left-=(d-o)/2,n.top-=(c-a)/2);n.width=d,n.height=c,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),G(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,G(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(G(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.imageData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(G(e)&&(r.scaleX=e,s=!0),G(t)&&(r.scaleY=t,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,r=this.imageData,s=this.canvasData,n=this.cropBoxData,o;if(this.ready&&this.cropped){o={x:n.left-s.left,y:n.top-s.top,width:n.width,height:n.height};var a=r.width/r.naturalWidth;if(ce(o,function(d,c){o[c]=d/a}),e){var l=Math.round(o.y+o.height),u=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=u-o.x,o.height=l-o.y}}else o={x:0,y:0,width:0,height:0};return t.rotatable&&(o.rotate=r.rotate||0),t.scalable&&(o.scaleX=r.scaleX||1,o.scaleY=r.scaleY||1),o},setData:function(e){var t=this.options,r=this.imageData,s=this.canvasData,n={};if(this.ready&&!this.disabled&&pi(e)){var o=!1;t.rotatable&&G(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,o=!0),t.scalable&&(G(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,o=!0),G(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var a=r.width/r.naturalWidth;G(e.x)&&(n.left=e.x*a+s.left),G(e.y)&&(n.top=e.y*a+s.top),G(e.width)&&(n.width=e.width*a),G(e.height)&&(n.height=e.height*a),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?Z({},this.containerData):{}},getImageData:function(){return this.sized?Z({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&ce(["left","top","width","height","naturalWidth","naturalHeight"],function(r){t[r]=e[r]}),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&pi(e)&&(G(e.left)&&(t.left=e.left),G(e.top)&&(t.top=e.top),G(e.width)?(t.width=e.width,t.height=e.width/r):G(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,r=this.options.aspectRatio,s,n;return this.ready&&this.cropped&&!this.disabled&&pi(e)&&(G(e.left)&&(t.left=e.left),G(e.top)&&(t.top=e.top),G(e.width)&&e.width!==t.width&&(s=!0,t.width=e.width),G(e.height)&&e.height!==t.height&&(n=!0,t.height=e.height),r&&(s?t.height=t.width/r:n&&(t.width=t.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=_1(this.image,this.imageData,t,e);if(!this.cropped)return r;var s=this.getData(),n=s.x,o=s.y,a=s.width,l=s.height,u=r.width/Math.floor(t.naturalWidth);u!==1&&(n*=u,o*=u,a*=u,l*=u);var d=a/l,c=It({aspectRatio:d,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),m=It({aspectRatio:d,width:e.minWidth||0,height:e.minHeight||0},"cover"),w=It({aspectRatio:d,width:e.width||(u!==1?r.width:a),height:e.height||(u!==1?r.height:l)}),F=w.width,T=w.height;F=Math.min(c.width,Math.max(m.width,F)),T=Math.min(c.height,Math.max(m.height,T));var P=document.createElement("canvas"),b=P.getContext("2d");P.width=mi(F),P.height=mi(T),b.fillStyle=e.fillColor||"transparent",b.fillRect(0,0,F,T);var y=e.imageSmoothingEnabled,f=y===void 0?!0:y,p=e.imageSmoothingQuality;b.imageSmoothingEnabled=f,p&&(b.imageSmoothingQuality=p);var v=r.width,g=r.height,_=n,A=o,I,N,H,z,k,L;_<=-a||_>v?(_=0,I=0,H=0,k=0):_<=0?(H=-_,_=0,I=Math.min(v,a+_),k=I):_<=v&&(H=0,I=Math.min(a,v-_),k=I),I<=0||A<=-l||A>g?(A=0,N=0,z=0,L=0):A<=0?(z=-A,A=0,N=Math.min(g,l+A),L=N):A<=g&&(z=0,N=Math.min(l,g-A),L=N);var V=[_,A,I,N];if(k>0&&L>0){var E=F/a;V.push(H*E,z*E,k*E,L*E)}return b.drawImage.apply(b,[r].concat(gh(V.map(function(C){return Math.floor(mi(C))})))),P},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!lo(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var n=e===Ha,o=t.movable&&e===bh;e=n||o?e:wh,t.dragMode=e,Ar(r,xr,e),fi(r,$o,n),fi(r,jo,o),t.cropBoxMovable||(Ar(s,xr,e),fi(s,$o,n),fi(s,jo,o))}return this}},L1=ot.Cropper,Th=(function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Qy(this,i),!e||!d1.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Z({},Bu,pi(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Jy(i,[{key:"init",value:function(){var t=this.element,r=t.tagName.toLowerCase(),s;if(!t[J]){if(t[J]=this,r==="img"){if(this.isImg=!0,s=t.getAttribute("src")||"",this.originalUrl=s,!s)return;s=t.src}else r==="canvas"&&window.HTMLCanvasElement&&(s=t.toDataURL());this.load(s)}}},{key:"load",value:function(t){var r=this;if(t){this.url=t,this.imageData={};var s=this.element,n=this.options;if(!n.rotatable&&!n.scalable&&(n.checkOrientation=!1),!n.checkOrientation||!window.ArrayBuffer){this.clone();return}if(u1.test(t)){c1.test(t)?this.read(D1(t)):this.clone();return}var o=new XMLHttpRequest,a=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=a,o.onerror=a,o.ontimeout=a,o.onprogress=function(){o.getResponseHeader("content-type")!==Mu&&o.abort()},o.onload=function(){r.read(o.response)},o.onloadend=function(){r.reloading=!1,r.xhr=null},n.checkCrossOrigin&&Nu(t)&&s.crossOrigin&&(t=zu(t)),o.open("GET",t),o.responseType="arraybuffer",o.withCredentials=s.crossOrigin==="use-credentials",o.send()}}},{key:"read",value:function(t){var r=this.options,s=this.imageData,n=A1(t),o=0,a=1,l=1;if(n>1){this.url=x1(t,Mu);var u=I1(n);o=u.rotate,a=u.scaleX,l=u.scaleY}r.rotatable&&(s.rotate=o),r.scalable&&(s.scaleX=a,s.scaleY=l),this.clone()}},{key:"clone",value:function(){var t=this.element,r=this.url,s=t.crossOrigin,n=r;this.options.checkCrossOrigin&&Nu(r)&&(s||(s="anonymous"),n=zu(r)),this.crossOrigin=s,this.crossOriginUrl=n;var o=document.createElement("img");s&&(o.crossOrigin=s),o.src=n||r,o.alt=t.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),ge(o,Du),t.parentNode.insertBefore(o,t.nextSibling)}},{key:"start",value:function(){var t=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var s=ot.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ot.navigator.userAgent),n=function(u,d){Z(t.imageData,{naturalWidth:u,naturalHeight:d,aspectRatio:u/d}),t.sizing=!1,t.sized=!0,t.build()};if(r.naturalWidth&&!s){n(r.naturalWidth,r.naturalHeight);return}var o=document.createElement("img"),a=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){n(o.width,o.height),s||a.removeChild(o)},o.src=r.src,s||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(o))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,r=this.options,s=this.image,n=t.parentNode,o=document.createElement("div");o.innerHTML=h1;var a=o.querySelector(".".concat(J,"-container")),l=a.querySelector(".".concat(J,"-canvas")),u=a.querySelector(".".concat(J,"-drag-box")),d=a.querySelector(".".concat(J,"-crop-box")),c=d.querySelector(".".concat(J,"-face"));this.container=n,this.cropper=a,this.canvas=l,this.dragBox=u,this.cropBox=d,this.viewBox=a.querySelector(".".concat(J,"-view-box")),this.face=c,l.appendChild(s),ge(t,Ae),n.insertBefore(a,t.nextSibling),this.isImg||nt(s,Du),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,ge(d,Ae),r.guides||ge(d.getElementsByClassName("".concat(J,"-dashed")),Ae),r.center||ge(d.getElementsByClassName("".concat(J,"-center")),Ae),r.background&&ge(a,"".concat(J,"-bg")),r.highlight||ge(c,s1),r.cropBoxMovable&&(ge(c,jo),Ar(c,xr,ja)),r.cropBoxResizable||(ge(d.getElementsByClassName("".concat(J,"-line")),Ae),ge(d.getElementsByClassName("".concat(J,"-point")),Ae)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),De(r.ready)&&He(t,ku,r.ready,{once:!0}),yi(t,ku)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),nt(this.element,Ae))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=L1,i}},{key:"setDefaults",value:function(t){Z(Bu,pi(t)&&t)}}]),i})();Z(Th.prototype,O1,k1,R1,U1,M1,B1);function N1(i,e){const t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}function z1(i){return i*(Math.PI/180)}function $1(i,e,t){const r=Math.abs(z1(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}function j1(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}function H1(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}class q1 extends je{constructor(e){super(e),this.onRotate90Deg=()=>{const{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);const s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=N1(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{const r=Number(t.target.value);this.setState({angleGranular:r});const{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);const o=this.cropper.getImageData(),a=$1(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Th(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){const t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){const n=j1(t,r,s);n&&this.cropper.setCropBoxData(n)}else{const n=H1(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.state;return h("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},h("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){const{i18n:e,opts:t}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),h("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),h("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0V0z",fill:"none"}),h("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),h("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){const{i18n:e}=this.props;return h("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},h("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},h("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),h("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){const{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return h("div",{className:"uppy-ImageCropper"},h("div",{className:"uppy-ImageCropper-container"},h("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),h("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}}const V1={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},W1={version:"2.4.6"},Eh={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Dh={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},G1={quality:.8,actions:Dh,cropperOptions:Eh};class xh extends he{constructor(e,t){super(e,{...G1,...t,actions:{...Dh,...t?.actions},cropperOptions:{...Eh,...t?.cropperOptions}}),this.save=()=>{const r=o=>{const{currentImage:a}=this.getPluginState();this.uppy.setFileState(a.id,{data:new File([o],a.name,{type:o.type}),size:o.size,preview:void 0});const l=this.uppy.getFile(a.id);this.uppy.emit("thumbnail:request",l),this.setPluginState({currentImage:l}),this.uppy.emit("file-editor:complete",l)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=V1,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){const{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:h(q1,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}xh.VERSION=W1.version;const Ah="3.7.8",X1=Ah,Ei=typeof Buffer=="function",$u=typeof TextDecoder=="function"?new TextDecoder:void 0,ju=typeof TextEncoder=="function"?new TextEncoder:void 0,K1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",or=Array.prototype.slice.call(K1),us=(i=>{let e={};return i.forEach((t,r)=>e[t]=r),e})(or),Y1=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ve=String.fromCharCode.bind(String),Hu=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):i=>new Uint8Array(Array.prototype.slice.call(i,0)),Ih=i=>i.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),Oh=i=>i.replace(/[^A-Za-z0-9\+\/]/g,""),kh=i=>{let e,t,r,s,n="";const o=i.length%3;for(let a=0;a<i.length;){if((t=i.charCodeAt(a++))>255||(r=i.charCodeAt(a++))>255||(s=i.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=t<<16|r<<8|s,n+=or[e>>18&63]+or[e>>12&63]+or[e>>6&63]+or[e&63]}return o?n.slice(0,o-3)+"===".substring(o):n},Va=typeof btoa=="function"?i=>btoa(i):Ei?i=>Buffer.from(i,"binary").toString("base64"):kh,Ko=Ei?i=>Buffer.from(i).toString("base64"):i=>{let t=[];for(let r=0,s=i.length;r<s;r+=4096)t.push(ve.apply(null,i.subarray(r,r+4096)));return Va(t.join(""))},ks=(i,e=!1)=>e?Ih(Ko(i)):Ko(i),Q1=i=>{if(i.length<2){var e=i.charCodeAt(0);return e<128?i:e<2048?ve(192|e>>>6)+ve(128|e&63):ve(224|e>>>12&15)+ve(128|e>>>6&63)+ve(128|e&63)}else{var e=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return ve(240|e>>>18&7)+ve(128|e>>>12&63)+ve(128|e>>>6&63)+ve(128|e&63)}},J1=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Rh=i=>i.replace(J1,Q1),qu=Ei?i=>Buffer.from(i,"utf8").toString("base64"):ju?i=>Ko(ju.encode(i)):i=>Va(Rh(i)),vi=(i,e=!1)=>e?Ih(qu(i)):qu(i),Vu=i=>vi(i,!0),Z1=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ev=i=>{switch(i.length){case 4:var e=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),t=e-65536;return ve((t>>>10)+55296)+ve((t&1023)+56320);case 3:return ve((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return ve((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},Uh=i=>i.replace(Z1,ev),Mh=i=>{if(i=i.replace(/\s+/g,""),!Y1.test(i))throw new TypeError("malformed base64.");i+="==".slice(2-(i.length&3));let e,t,r,s=[];for(let n=0;n<i.length;)e=us[i.charAt(n++)]<<18|us[i.charAt(n++)]<<12|(t=us[i.charAt(n++)])<<6|(r=us[i.charAt(n++)]),t===64?s.push(ve(e>>16&255)):r===64?s.push(ve(e>>16&255,e>>8&255)):s.push(ve(e>>16&255,e>>8&255,e&255));return s.join("")},Wa=typeof atob=="function"?i=>atob(Oh(i)):Ei?i=>Buffer.from(i,"base64").toString("binary"):Mh,Bh=Ei?i=>Hu(Buffer.from(i,"base64")):i=>Hu(Wa(i).split("").map(e=>e.charCodeAt(0))),Lh=i=>Bh(Nh(i)),tv=Ei?i=>Buffer.from(i,"base64").toString("utf8"):$u?i=>$u.decode(Bh(i)):i=>Uh(Wa(i)),Nh=i=>Oh(i.replace(/[-_]/g,e=>e=="-"?"+":"/")),Yo=i=>tv(Nh(i)),iv=i=>{if(typeof i!="string")return!1;const e=i.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},zh=i=>({value:i,enumerable:!1,writable:!0,configurable:!0}),$h=function(){const i=(e,t)=>Object.defineProperty(String.prototype,e,zh(t));i("fromBase64",function(){return Yo(this)}),i("toBase64",function(e){return vi(this,e)}),i("toBase64URI",function(){return vi(this,!0)}),i("toBase64URL",function(){return vi(this,!0)}),i("toUint8Array",function(){return Lh(this)})},jh=function(){const i=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,zh(t));i("toBase64",function(e){return ks(this,e)}),i("toBase64URI",function(){return ks(this,!0)}),i("toBase64URL",function(){return ks(this,!0)})},rv=()=>{$h(),jh()},sv={version:Ah,VERSION:X1,atob:Wa,atobPolyfill:Mh,btoa:Va,btoaPolyfill:kh,fromBase64:Yo,toBase64:vi,encode:vi,encodeURI:Vu,encodeURL:Vu,utob:Rh,btou:Uh,decode:Yo,isValid:iv,fromUint8Array:ks,toUint8Array:Lh,extendString:$h,extendUint8Array:jh,extendBuiltins:rv};var co,Wu;function nv(){return Wu||(Wu=1,co=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}),co}var cs={},Gu;function ov(){if(Gu)return cs;Gu=1;var i=Object.prototype.hasOwnProperty,e;function t(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function r(o){try{return encodeURIComponent(o)}catch{return null}}function s(o){for(var a=/([^=?#&]+)=?([^&]*)/g,l={},u;u=a.exec(o);){var d=t(u[1]),c=t(u[2]);d===null||c===null||d in l||(l[d]=c)}return l}function n(o,a){a=a||"";var l=[],u,d;typeof a!="string"&&(a="?");for(d in o)if(i.call(o,d)){if(u=o[d],!u&&(u===null||u===e||isNaN(u))&&(u=""),d=r(d),u=r(u),d===null||u===null)continue;l.push(d+"="+u)}return l.length?a+l.join("&"):""}return cs.stringify=n,cs.parse=s,cs}var ho,Xu;function av(){if(Xu)return ho;Xu=1;var i=nv(),e=ov(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,n=/:\d+$/,o=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function l(y){return(y||"").toString().replace(t,"")}var u=[["#","hash"],["?","query"],function(f,p){return m(p.protocol)?f.replace(/\\/g,"/"):f},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function c(y){var f;typeof window<"u"?f=window:typeof globalThis<"u"?f=globalThis:typeof self<"u"?f=self:f={};var p=f.location||{};y=y||p;var v={},g=typeof y,_;if(y.protocol==="blob:")v=new T(unescape(y.pathname),{});else if(g==="string"){v=new T(y,{});for(_ in d)delete v[_]}else if(g==="object"){for(_ in y)_ in d||(v[_]=y[_]);v.slashes===void 0&&(v.slashes=s.test(y.href))}return v}function m(y){return y==="file:"||y==="ftp:"||y==="http:"||y==="https:"||y==="ws:"||y==="wss:"}function w(y,f){y=l(y),y=y.replace(r,""),f=f||{};var p=o.exec(y),v=p[1]?p[1].toLowerCase():"",g=!!p[2],_=!!p[3],A=0,I;return g?_?(I=p[2]+p[3]+p[4],A=p[2].length+p[3].length):(I=p[2]+p[4],A=p[2].length):_?(I=p[3]+p[4],A=p[3].length):I=p[4],v==="file:"?A>=2&&(I=I.slice(2)):m(v)?I=p[4]:v?g&&(I=I.slice(2)):A>=2&&m(f.protocol)&&(I=p[4]),{protocol:v,slashes:g||m(v),slashesCount:A,rest:I}}function F(y,f){if(y==="")return f;for(var p=(f||"/").split("/").slice(0,-1).concat(y.split("/")),v=p.length,g=p[v-1],_=!1,A=0;v--;)p[v]==="."?p.splice(v,1):p[v]===".."?(p.splice(v,1),A++):A&&(v===0&&(_=!0),p.splice(v,1),A--);return _&&p.unshift(""),(g==="."||g==="..")&&p.push(""),p.join("/")}function T(y,f,p){if(y=l(y),y=y.replace(r,""),!(this instanceof T))return new T(y,f,p);var v,g,_,A,I,N,H=u.slice(),z=typeof f,k=this,L=0;for(z!=="object"&&z!=="string"&&(p=f,f=null),p&&typeof p!="function"&&(p=e.parse),f=c(f),g=w(y||"",f),v=!g.protocol&&!g.slashes,k.slashes=g.slashes||v&&f.slashes,k.protocol=g.protocol||f.protocol||"",y=g.rest,(g.protocol==="file:"&&(g.slashesCount!==2||a.test(y))||!g.slashes&&(g.protocol||g.slashesCount<2||!m(k.protocol)))&&(H[3]=[/(.*)/,"pathname"]);L<H.length;L++){if(A=H[L],typeof A=="function"){y=A(y,k);continue}_=A[0],N=A[1],_!==_?k[N]=y:typeof _=="string"?(I=_==="@"?y.lastIndexOf(_):y.indexOf(_),~I&&(typeof A[2]=="number"?(k[N]=y.slice(0,I),y=y.slice(I+A[2])):(k[N]=y.slice(I),y=y.slice(0,I)))):(I=_.exec(y))&&(k[N]=I[1],y=y.slice(0,I.index)),k[N]=k[N]||v&&A[3]&&f[N]||"",A[4]&&(k[N]=k[N].toLowerCase())}p&&(k.query=p(k.query)),v&&f.slashes&&k.pathname.charAt(0)!=="/"&&(k.pathname!==""||f.pathname!=="")&&(k.pathname=F(k.pathname,f.pathname)),k.pathname.charAt(0)!=="/"&&m(k.protocol)&&(k.pathname="/"+k.pathname),i(k.port,k.protocol)||(k.host=k.hostname,k.port=""),k.username=k.password="",k.auth&&(I=k.auth.indexOf(":"),~I?(k.username=k.auth.slice(0,I),k.username=encodeURIComponent(decodeURIComponent(k.username)),k.password=k.auth.slice(I+1),k.password=encodeURIComponent(decodeURIComponent(k.password))):k.username=encodeURIComponent(decodeURIComponent(k.auth)),k.auth=k.password?k.username+":"+k.password:k.username),k.origin=k.protocol!=="file:"&&m(k.protocol)&&k.host?k.protocol+"//"+k.host:"null",k.href=k.toString()}function P(y,f,p){var v=this;switch(y){case"query":typeof f=="string"&&f.length&&(f=(p||e.parse)(f)),v[y]=f;break;case"port":v[y]=f,i(f,v.protocol)?f&&(v.host=v.hostname+":"+f):(v.host=v.hostname,v[y]="");break;case"hostname":v[y]=f,v.port&&(f+=":"+v.port),v.host=f;break;case"host":v[y]=f,n.test(f)?(f=f.split(":"),v.port=f.pop(),v.hostname=f.join(":")):(v.hostname=f,v.port="");break;case"protocol":v.protocol=f.toLowerCase(),v.slashes=!p;break;case"pathname":case"hash":if(f){var g=y==="pathname"?"/":"#";v[y]=f.charAt(0)!==g?g+f:f}else v[y]=f;break;case"username":case"password":v[y]=encodeURIComponent(f);break;case"auth":var _=f.indexOf(":");~_?(v.username=f.slice(0,_),v.username=encodeURIComponent(decodeURIComponent(v.username)),v.password=f.slice(_+1),v.password=encodeURIComponent(decodeURIComponent(v.password))):v.username=encodeURIComponent(decodeURIComponent(f))}for(var A=0;A<u.length;A++){var I=u[A];I[4]&&(v[I[1]]=v[I[1]].toLowerCase())}return v.auth=v.password?v.username+":"+v.password:v.username,v.origin=v.protocol!=="file:"&&m(v.protocol)&&v.host?v.protocol+"//"+v.host:"null",v.href=v.toString(),v}function b(y){(!y||typeof y!="function")&&(y=e.stringify);var f,p=this,v=p.host,g=p.protocol;g&&g.charAt(g.length-1)!==":"&&(g+=":");var _=g+(p.protocol&&p.slashes||m(p.protocol)?"//":"");return p.username?(_+=p.username,p.password&&(_+=":"+p.password),_+="@"):p.password?(_+=":"+p.password,_+="@"):p.protocol!=="file:"&&m(p.protocol)&&!v&&p.pathname!=="/"&&(_+="@"),(v[v.length-1]===":"||n.test(p.hostname)&&!p.port)&&(v+=":"),_+=v+p.pathname,f=typeof p.query=="object"?y(p.query):p.query,f&&(_+=f.charAt(0)!=="?"?"?"+f:f),p.hash&&(_+=p.hash),_}return T.prototype={set:P,toString:b},T.extractProtocol=w,T.location=c,T.trimLeft=l,T.qs=e,ho=T,ho}var lv=av();const uv=Ve(lv);function Qo(i){"@babel/helpers - typeof";return Qo=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},Qo(i)}function cv(i,e,t){return Object.defineProperty(i,"prototype",{writable:!1}),i}function dv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function hv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Ir(i,e)}function pv(i){var e=Hh();return function(){var r=Or(i),s;if(e){var n=Or(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return fv(this,s)}}function fv(i,e){if(e&&(Qo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gv(i)}function gv(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Jo(i){var e=typeof Map=="function"?new Map:void 0;return Jo=function(r){if(r===null||!mv(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,s)}function s(){return Rs(r,arguments,Or(this).constructor)}return s.prototype=Object.create(r.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),Ir(s,r)},Jo(i)}function Rs(i,e,t){return Hh()?Rs=Reflect.construct.bind():Rs=function(s,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(s,a),u=new l;return o&&Ir(u,o.prototype),u},Rs.apply(null,arguments)}function Hh(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function mv(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}function Ir(i,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Ir(i,e)}function Or(i){return Or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Or(i)}var ds=(function(i){hv(t,i);var e=pv(t);function t(r){var s,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(dv(this,t),s=e.call(this,r),s.originalRequest=o,s.originalResponse=a,s.causingError=n,n!=null&&(r+=", caused by ".concat(n.toString())),o!=null){var l=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),d=o.getURL(),c=a?a.getStatus():"n/a",m=a?a.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(d,", response code: ").concat(c,", response text: ").concat(m,", request id: ").concat(l,")")}return s.message=r,s}return cv(t)})(Jo(Error));function yv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function Zo(){Zo=function(){return e};var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(E,C,S){E[C]=S.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function u(E,C,S){return Object.defineProperty(E,C,{value:S,enumerable:!0,configurable:!0,writable:!0}),E[C]}try{u({},"")}catch{u=function(S,D,O){return S[D]=O}}function d(E,C,S,D){var O=C&&C.prototype instanceof b?C:b,x=Object.create(O.prototype),M=new L(D||[]);return s(x,"_invoke",{value:N(E,S,M)}),x}function c(E,C,S){try{return{type:"normal",arg:E.call(C,S)}}catch(D){return{type:"throw",arg:D}}}e.wrap=d;var m="suspendedStart",w="suspendedYield",F="executing",T="completed",P={};function b(){}function y(){}function f(){}var p={};u(p,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(V([])));g&&g!==t&&r.call(g,o)&&(p=g);var _=f.prototype=b.prototype=Object.create(p);function A(E){["next","throw","return"].forEach(function(C){u(E,C,function(S){return this._invoke(C,S)})})}function I(E,C){function S(O,x,M,q){var W=c(E[O],E,x);if(W.type!=="throw"){var ne=W.arg,re=ne.value;return re&&ii(re)=="object"&&r.call(re,"__await")?C.resolve(re.__await).then(function(Y){S("next",Y,M,q)},function(Y){S("throw",Y,M,q)}):C.resolve(re).then(function(Y){ne.value=Y,M(ne)},function(Y){return S("throw",Y,M,q)})}q(W.arg)}var D;s(this,"_invoke",{value:function(x,M){function q(){return new C(function(W,ne){S(x,M,W,ne)})}return D=D?D.then(q,q):q()}})}function N(E,C,S){var D=m;return function(O,x){if(D===F)throw new Error("Generator is already running");if(D===T){if(O==="throw")throw x;return{value:i,done:!0}}for(S.method=O,S.arg=x;;){var M=S.delegate;if(M){var q=H(M,S);if(q){if(q===P)continue;return q}}if(S.method==="next")S.sent=S._sent=S.arg;else if(S.method==="throw"){if(D===m)throw D=T,S.arg;S.dispatchException(S.arg)}else S.method==="return"&&S.abrupt("return",S.arg);D=F;var W=c(E,C,S);if(W.type==="normal"){if(D=S.done?T:w,W.arg===P)continue;return{value:W.arg,done:S.done}}W.type==="throw"&&(D=T,S.method="throw",S.arg=W.arg)}}}function H(E,C){var S=C.method,D=E.iterator[S];if(D===i)return C.delegate=null,S==="throw"&&E.iterator.return&&(C.method="return",C.arg=i,H(E,C),C.method==="throw")||S!=="return"&&(C.method="throw",C.arg=new TypeError("The iterator does not provide a '"+S+"' method")),P;var O=c(D,E.iterator,C.arg);if(O.type==="throw")return C.method="throw",C.arg=O.arg,C.delegate=null,P;var x=O.arg;return x?x.done?(C[E.resultName]=x.value,C.next=E.nextLoc,C.method!=="return"&&(C.method="next",C.arg=i),C.delegate=null,P):x:(C.method="throw",C.arg=new TypeError("iterator result is not an object"),C.delegate=null,P)}function z(E){var C={tryLoc:E[0]};1 in E&&(C.catchLoc=E[1]),2 in E&&(C.finallyLoc=E[2],C.afterLoc=E[3]),this.tryEntries.push(C)}function k(E){var C=E.completion||{};C.type="normal",delete C.arg,E.completion=C}function L(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(z,this),this.reset(!0)}function V(E){if(E||E===""){var C=E[o];if(C)return C.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var S=-1,D=function O(){for(;++S<E.length;)if(r.call(E,S))return O.value=E[S],O.done=!1,O;return O.value=i,O.done=!0,O};return D.next=D}}throw new TypeError(ii(E)+" is not iterable")}return y.prototype=f,s(_,"constructor",{value:f,configurable:!0}),s(f,"constructor",{value:y,configurable:!0}),y.displayName=u(f,l,"GeneratorFunction"),e.isGeneratorFunction=function(E){var C=typeof E=="function"&&E.constructor;return!!C&&(C===y||(C.displayName||C.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,f):(E.__proto__=f,u(E,l,"GeneratorFunction")),E.prototype=Object.create(_),E},e.awrap=function(E){return{__await:E}},A(I.prototype),u(I.prototype,a,function(){return this}),e.AsyncIterator=I,e.async=function(E,C,S,D,O){O===void 0&&(O=Promise);var x=new I(d(E,C,S,D),O);return e.isGeneratorFunction(C)?x:x.next().then(function(M){return M.done?M.value:x.next()})},A(_),u(_,l,"Generator"),u(_,o,function(){return this}),u(_,"toString",function(){return"[object Generator]"}),e.keys=function(E){var C=Object(E),S=[];for(var D in C)S.push(D);return S.reverse(),function O(){for(;S.length;){var x=S.pop();if(x in C)return O.value=x,O.done=!1,O}return O.done=!0,O}},e.values=V,L.prototype={constructor:L,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(k),!C)for(var S in this)S.charAt(0)==="t"&&r.call(this,S)&&!isNaN(+S.slice(1))&&(this[S]=i)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var S=this;function D(ne,re){return M.type="throw",M.arg=C,S.next=ne,re&&(S.method="next",S.arg=i),!!re}for(var O=this.tryEntries.length-1;O>=0;--O){var x=this.tryEntries[O],M=x.completion;if(x.tryLoc==="root")return D("end");if(x.tryLoc<=this.prev){var q=r.call(x,"catchLoc"),W=r.call(x,"finallyLoc");if(q&&W){if(this.prev<x.catchLoc)return D(x.catchLoc,!0);if(this.prev<x.finallyLoc)return D(x.finallyLoc)}else if(q){if(this.prev<x.catchLoc)return D(x.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return D(x.finallyLoc)}}}},abrupt:function(C,S){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var x=O;break}}x&&(C==="break"||C==="continue")&&x.tryLoc<=S&&S<=x.finallyLoc&&(x=null);var M=x?x.completion:{};return M.type=C,M.arg=S,x?(this.method="next",this.next=x.finallyLoc,P):this.complete(M)},complete:function(C,S){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&S&&(this.next=S),P},finish:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.finallyLoc===C)return this.complete(D.completion,D.afterLoc),k(D),P}},catch:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.tryLoc===C){var O=D.completion;if(O.type==="throw"){var x=O.arg;k(D)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(C,S,D){return this.delegate={iterator:V(C),resultName:S,nextLoc:D},this.method==="next"&&(this.arg=i),P}},e}function Ku(i,e,t,r,s,n,o){try{var a=i[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(r,s)}function vv(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(l){Ku(n,r,s,o,a,"next",l)}function a(l){Ku(n,r,s,o,a,"throw",l)}o(void 0)})}}function qh(i,e){return Pv(i)||Sv(i,e)||wv(i,e)||bv()}function bv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wv(i,e){if(i){if(typeof i=="string")return Yu(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 Yu(i,e)}}function Yu(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function Sv(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,s,n,o,a=[],l=!0,u=!1;try{if(n=(t=t.call(i)).next,e!==0)for(;!(l=(r=n.call(t)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){u=!0,s=d}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw s}}return a}}function Pv(i){if(Array.isArray(i))return i}function ii(i){"@babel/helpers - typeof";return ii=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},ii(i)}function Qu(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}function ui(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qu(Object(t),!0).forEach(function(r){Fv(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Qu(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Fv(i,e,t){return e=Vh(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Cv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ju(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Vh(r.key),r)}}function _v(i,e,t){return e&&Ju(i.prototype,e),t&&Ju(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Vh(i){var e=Tv(i,"string");return ii(e)==="symbol"?e:String(e)}function Tv(i,e){if(ii(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(ii(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var Ev={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Wh,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null},Js=(function(){function i(e,t){Cv(this,i),"resume"in t&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=t,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return _v(i,[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(r){return t._urlStorage.findUploadsByFingerprint(r)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,r=this.file;if(!r){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var s=this.options.retryDelays;if(s!=null&&Object.prototype.toString.call(s)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var n=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];n<o.length;n++){var a=o[n];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(r,this.options).then(function(l){return t._fingerprint=l,t._source?t._source:t.options.fileReader.openFile(r,t.options.chunkSize)}).then(function(l){if(t._source=l,t.options.uploadLengthDeferred)t._size=null;else if(t.options.uploadSize!=null){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size)){t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(t._size=t._source.size,t._size==null){t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}t.options.parallelUploads>1||t._parallelUploadUrls!=null?t._startParallelUpload():t._startSingleUpload()}).catch(function(l){t._emitError(l)})}},{key:"_startParallelUpload",value:function(){var t,r=this,s=this._size,n=0;this._parallelUploads=[];var o=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:xv(this._source.size,o);this._parallelUploadUrls&&a.forEach(function(d,c){d.uploadUrl=r._parallelUploadUrls[c]||null}),this._parallelUploadUrls=new Array(a.length);var l=a.map(function(d,c){var m=0;return r._source.slice(d.start,d.end).then(function(w){var F=w.value;return new Promise(function(T,P){var b=ui(ui({},r.options),{},{uploadUrl:d.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:ui(ui({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:T,onError:P,onProgress:function(p){n=n-m+p,m=p,r._emitProgress(n,s)},onUploadUrlAvailable:function(){r._parallelUploadUrls[c]=y.url,r._parallelUploadUrls.filter(function(p){return!!p}).length===a.length&&r._saveUploadInUrlStorage()}}),y=new i(F,b);y.start(),r._parallelUploads.push(y)})})}),u;Promise.all(l).then(function(){u=r._openRequest("POST",r.options.endpoint),u.setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var d=Zu(r.options.metadata);return d!==""&&u.setHeader("Upload-Metadata",d),r._sendRequest(u,null)}).then(function(d){if(!di(d.getStatus(),200)){r._emitHttpError(u,d,"tus: unexpected response while creating upload");return}var c=d.getHeader("Location");if(c==null){r._emitHttpError(u,d,"tus: invalid or missing Location header");return}r.url=rc(r.options.endpoint,c),"Created upload at ".concat(r.url),r._emitSuccess()}).catch(function(d){r._emitError(d)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(t){var r=this;return this._parallelUploads!=null&&this._parallelUploads.forEach(function(s){s.abort(t)}),this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():i.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(t,r,s,n){this._emitError(new ds(s,n,t,r))}},{key:"_emitError",value:function(t){var r=this;if(!this._aborted){if(this.options.retryDelays!=null){var s=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(s&&(this._retryAttempt=0),ic(t,this._retryAttempt,this.options)){var n=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){r.start()},n);return}}if(typeof this.options.onError=="function")this.options.onError(t);else throw t}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess()}},{key:"_emitProgress",value:function(t,r){typeof this.options.onProgress=="function"&&this.options.onProgress(t,r)}},{key:"_emitChunkComplete",value:function(t,r,s){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(t,r,s)}},{key:"_createUpload",value:function(){var t=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var r=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?r.setHeader("Upload-Defer-Length",1):r.setHeader("Upload-Length",this._size);var s=Zu(this.options.metadata);s!==""&&r.setHeader("Upload-Metadata",s);var n;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,n=this._addChunkToRequest(r)):n=this._sendRequest(r,null),n.then(function(o){if(!di(o.getStatus(),200)){t._emitHttpError(r,o,"tus: unexpected response while creating upload");return}var a=o.getHeader("Location");if(a==null){t._emitHttpError(r,o,"tus: invalid or missing Location header");return}if(t.url=rc(t.options.endpoint,a),"Created upload at ".concat(t.url),typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._size===0){t._emitSuccess(),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(r,o):(t._offset=0,t._performUpload())})}).catch(function(o){t._emitHttpError(r,null,"tus: failed to create upload",o)})}},{key:"_resumeUpload",value:function(){var t=this,r=this._openRequest("HEAD",this.url),s=this._sendRequest(r,null);s.then(function(n){var o=n.getStatus();if(!di(o,200)){if(o===423){t._emitHttpError(r,n,"tus: upload is currently locked; retry later");return}if(di(o,400)&&t._removeFromUrlStorage(),!t.options.endpoint){t._emitHttpError(r,n,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}t.url=null,t._createUpload();return}var a=parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){t._emitHttpError(r,n,"tus: invalid or missing offset value");return}var l=parseInt(n.getHeader("Upload-Length"),10);if(Number.isNaN(l)&&!t.options.uploadLengthDeferred){t._emitHttpError(r,n,"tus: invalid or missing length value");return}typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(a===l){t._emitProgress(l,l),t._emitSuccess();return}t._offset=a,t._performUpload()})}).catch(function(n){t._emitHttpError(r,null,"tus: failed to resume upload",n)})}},{key:"_performUpload",value:function(){var t=this;if(!this._aborted){var r;this.options.overridePatchMethod?(r=this._openRequest("POST",this.url),r.setHeader("X-HTTP-Method-Override","PATCH")):r=this._openRequest("PATCH",this.url),r.setHeader("Upload-Offset",this._offset);var s=this._addChunkToRequest(r);s.then(function(n){if(!di(n.getStatus(),200)){t._emitHttpError(r,n,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(r,n)}).catch(function(n){t._aborted||t._emitHttpError(r,null,"tus: failed to upload chunk at offset ".concat(t._offset),n)})}}},{key:"_addChunkToRequest",value:function(t){var r=this,s=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(o){r._emitProgress(s+o,r._size)}),t.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(s,n).then(function(o){var a=o.value,l=o.done,u=a&&a.size?a.size:0;r.options.uploadLengthDeferred&&l&&(r._size=r._offset+u,t.setHeader("Upload-Length",r._size));var d=r._offset+u;return!r.options.uploadLengthDeferred&&l&&d!==r._size?Promise.reject(new Error("upload was configured with a size of ".concat(r._size," bytes, but the source is done after ").concat(d," bytes"))):a===null?r._sendRequest(t):(r._emitProgress(r._offset,r._size),r._sendRequest(t,a))})}},{key:"_handleUploadResponse",value:function(t,r){var s=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){this._emitHttpError(t,r,"tus: invalid or missing offset value");return}if(this._emitProgress(s,this._size),this._emitChunkComplete(s-this._offset,s,this._size),this._offset=s,s===this._size){this._emitSuccess(),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(t,r){var s=ec(t,r,this.options);return this._req=s,s}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(r){t._emitError(r)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var r={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?r.parallelUploadUrls=this._parallelUploadUrls:r.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,r).then(function(s){t._urlStorageKey=s})}},{key:"_sendRequest",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return tc(t,r,this.options)}}],[{key:"terminate",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=ec("DELETE",t,r);return tc(s,null,r).then(function(n){if(n.getStatus()!==204)throw new ds("tus: unexpected response while terminating upload",null,s,n)}).catch(function(n){if(n instanceof ds||(n=new ds("tus: failed to terminate upload",n,s,null)),!ic(n,0,r))throw n;var o=r.retryDelays[0],a=r.retryDelays.slice(1),l=ui(ui({},r),{},{retryDelays:a});return new Promise(function(u){return setTimeout(u,o)}).then(function(){return i.terminate(t,l)})})}}]),i})();function Zu(i){return Object.entries(i).map(function(e){var t=qh(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(sv.encode(String(s)))}).join(",")}function di(i,e){return i>=e&&i<e+100}function ec(i,e,t){var r=t.httpStack.createRequest(i,e);r.setHeader("Tus-Resumable","1.0.0");var s=t.headers||{};if(Object.entries(s).forEach(function(o){var a=qh(o,2),l=a[0],u=a[1];r.setHeader(l,u)}),t.addRequestId){var n=yv();r.setHeader("X-Request-ID",n)}return r}function tc(i,e,t){return ea.apply(this,arguments)}function ea(){return ea=vv(Zo().mark(function i(e,t,r){var s;return Zo().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof r.onBeforeRequest!="function"){o.next=3;break}return o.next=3,r.onBeforeRequest(e);case 3:return o.next=5,e.send(t);case 5:if(s=o.sent,typeof r.onAfterResponse!="function"){o.next=9;break}return o.next=9,r.onAfterResponse(e,s);case 9:return o.abrupt("return",s);case 10:case"end":return o.stop()}},i)})),ea.apply(this,arguments)}function Dv(){var i=!0;return typeof window<"u"&&"navigator"in window&&window.navigator.onLine===!1&&(i=!1),i}function ic(i,e,t){return t.retryDelays==null||e>=t.retryDelays.length||i.originalRequest==null?!1:t&&typeof t.onShouldRetry=="function"?t.onShouldRetry(i,e,t):Wh(i)}function Wh(i){var e=i.originalResponse?i.originalResponse.getStatus():0;return(!di(e,400)||e===409||e===423)&&Dv()}function rc(i,e){return new uv(e,i).toString()}function xv(i,e){for(var t=Math.floor(i/e),r=[],s=0;s<e;s++)r.push({start:t*s,end:t*(s+1)});return r[e-1].end=i,r}Js.defaultOptions=Ev;function kr(i){"@babel/helpers - typeof";return kr=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},kr(i)}function Av(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Iv(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,kv(r.key),r)}}function Ov(i,e,t){return e&&Iv(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function kv(i){var e=Rv(i,"string");return kr(e)==="symbol"?e:String(e)}function Rv(i,e){if(kr(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(kr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var Uv=(function(){function i(){Av(this,i)}return Ov(i,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,r){return Promise.resolve(null)}}]),i})();function Rr(i){"@babel/helpers - typeof";return Rr=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},Rr(i)}function Mv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Bv(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Nv(r.key),r)}}function Lv(i,e,t){return e&&Bv(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Nv(i){var e=zv(i,"string");return Rr(e)==="symbol"?e:String(e)}function zv(i,e){if(Rr(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Rr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var ta=!1;try{ta="localStorage"in window;var po="tusSupport",sc=localStorage.getItem(po);localStorage.setItem(po,sc),sc===null&&localStorage.removeItem(po)}catch(i){if(i.code===i.SECURITY_ERR||i.code===i.QUOTA_EXCEEDED_ERR)ta=!1;else throw i}var $v=ta,jv=(function(){function i(){Mv(this,i)}return Lv(i,[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var r=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(r)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,r){var s=Math.round(Math.random()*1e12),n="tus::".concat(t,"::").concat(s);return localStorage.setItem(n,JSON.stringify(r)),Promise.resolve(n)}},{key:"_findEntries",value:function(t){for(var r=[],s=0;s<localStorage.length;s++){var n=localStorage.key(s);if(n.indexOf(t)===0)try{var o=JSON.parse(localStorage.getItem(n));o.urlStorageKey=n,r.push(o)}catch{}}return r}}]),i})();function Ur(i){"@babel/helpers - typeof";return Ur=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},Ur(i)}function Ga(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Hv(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,qv(r.key),r)}}function Xa(i,e,t){return e&&Hv(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function qv(i){var e=Vv(i,"string");return Ur(e)==="symbol"?e:String(e)}function Vv(i,e){if(Ur(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Ur(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var Wv=(function(){function i(){Ga(this,i)}return Xa(i,[{key:"createRequest",value:function(t,r){return new Gv(t,r)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),i})(),Gv=(function(){function i(e,t){Ga(this,i),this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}return Xa(i,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,r){this._xhr.setRequestHeader(t,r),this._headers[t]=r}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(r){r.lengthComputable&&t(r.loaded)})}},{key:"send",value:function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(s,n){t._xhr.onload=function(){s(new Xv(t._xhr))},t._xhr.onerror=function(o){n(o)},t._xhr.send(r)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),i})(),Xv=(function(){function i(e){Ga(this,i),this._xhr=e}return Xa(i,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),i})(),Gh=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function Kv(i){return new Promise(function(e,t){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var s=r.response;e(s)},r.onerror=function(s){t(s)},r.open("GET",i),r.send()})}var Yv=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function Qv(i){return new Promise(function(e,t){var r=new FileReader;r.onload=function(){var s=new Uint8Array(r.result);e({value:s})},r.onerror=function(s){t(s)},r.readAsArrayBuffer(i)})}function Mr(i){"@babel/helpers - typeof";return Mr=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},Mr(i)}function Jv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Zv(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,tb(r.key),r)}}function eb(i,e,t){return e&&Zv(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function tb(i){var e=ib(i,"string");return Mr(e)==="symbol"?e:String(e)}function ib(i,e){if(Mr(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Mr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var nc=(function(){function i(e){Jv(this,i),this._file=e,this.size=e.size}return eb(i,[{key:"slice",value:function(t,r){if(Yv())return Qv(this._file.slice(t,r));var s=this._file.slice(t,r),n=r>=this.size;return Promise.resolve({value:s,done:n})}},{key:"close",value:function(){}}]),i})();function Br(i){"@babel/helpers - typeof";return Br=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},Br(i)}function rb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function sb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,ob(r.key),r)}}function nb(i,e,t){return e&&sb(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function ob(i){var e=ab(i,"string");return Br(e)==="symbol"?e:String(e)}function ab(i,e){if(Br(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Br(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function oc(i){return i===void 0?0:i.size!==void 0?i.size:i.length}function lb(i,e){if(i.concat)return i.concat(e);if(i instanceof Blob)return new Blob([i,e],{type:i.type});if(i.set){var t=new i.constructor(i.length+e.length);return t.set(i),t.set(e,i.length),t}throw new Error("Unknown data type")}var ub=(function(){function i(e){rb(this,i),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return nb(i,[{key:"slice",value:function(t,r){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,r)}},{key:"_readUntilEnoughDataOrDone",value:function(t,r){var s=this,n=r<=this._bufferOffset+oc(this._buffer);if(this._done||n){var o=this._getDataFromBuffer(t,r),a=o==null?this._done:!1;return Promise.resolve({value:o,done:a})}return this._reader.read().then(function(l){var u=l.value,d=l.done;return d?s._done=!0:s._buffer===void 0?s._buffer=u:s._buffer=lb(s._buffer,u),s._readUntilEnoughDataOrDone(t,r)})}},{key:"_getDataFromBuffer",value:function(t,r){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var s=oc(this._buffer)===0;return this._done&&s?null:this._buffer.slice(0,r-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),i})();function ri(i){"@babel/helpers - typeof";return ri=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},ri(i)}function ia(){ia=function(){return e};var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(E,C,S){E[C]=S.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function u(E,C,S){return Object.defineProperty(E,C,{value:S,enumerable:!0,configurable:!0,writable:!0}),E[C]}try{u({},"")}catch{u=function(S,D,O){return S[D]=O}}function d(E,C,S,D){var O=C&&C.prototype instanceof b?C:b,x=Object.create(O.prototype),M=new L(D||[]);return s(x,"_invoke",{value:N(E,S,M)}),x}function c(E,C,S){try{return{type:"normal",arg:E.call(C,S)}}catch(D){return{type:"throw",arg:D}}}e.wrap=d;var m="suspendedStart",w="suspendedYield",F="executing",T="completed",P={};function b(){}function y(){}function f(){}var p={};u(p,o,function(){return this});var v=Object.getPrototypeOf,g=v&&v(v(V([])));g&&g!==t&&r.call(g,o)&&(p=g);var _=f.prototype=b.prototype=Object.create(p);function A(E){["next","throw","return"].forEach(function(C){u(E,C,function(S){return this._invoke(C,S)})})}function I(E,C){function S(O,x,M,q){var W=c(E[O],E,x);if(W.type!=="throw"){var ne=W.arg,re=ne.value;return re&&ri(re)=="object"&&r.call(re,"__await")?C.resolve(re.__await).then(function(Y){S("next",Y,M,q)},function(Y){S("throw",Y,M,q)}):C.resolve(re).then(function(Y){ne.value=Y,M(ne)},function(Y){return S("throw",Y,M,q)})}q(W.arg)}var D;s(this,"_invoke",{value:function(x,M){function q(){return new C(function(W,ne){S(x,M,W,ne)})}return D=D?D.then(q,q):q()}})}function N(E,C,S){var D=m;return function(O,x){if(D===F)throw new Error("Generator is already running");if(D===T){if(O==="throw")throw x;return{value:i,done:!0}}for(S.method=O,S.arg=x;;){var M=S.delegate;if(M){var q=H(M,S);if(q){if(q===P)continue;return q}}if(S.method==="next")S.sent=S._sent=S.arg;else if(S.method==="throw"){if(D===m)throw D=T,S.arg;S.dispatchException(S.arg)}else S.method==="return"&&S.abrupt("return",S.arg);D=F;var W=c(E,C,S);if(W.type==="normal"){if(D=S.done?T:w,W.arg===P)continue;return{value:W.arg,done:S.done}}W.type==="throw"&&(D=T,S.method="throw",S.arg=W.arg)}}}function H(E,C){var S=C.method,D=E.iterator[S];if(D===i)return C.delegate=null,S==="throw"&&E.iterator.return&&(C.method="return",C.arg=i,H(E,C),C.method==="throw")||S!=="return"&&(C.method="throw",C.arg=new TypeError("The iterator does not provide a '"+S+"' method")),P;var O=c(D,E.iterator,C.arg);if(O.type==="throw")return C.method="throw",C.arg=O.arg,C.delegate=null,P;var x=O.arg;return x?x.done?(C[E.resultName]=x.value,C.next=E.nextLoc,C.method!=="return"&&(C.method="next",C.arg=i),C.delegate=null,P):x:(C.method="throw",C.arg=new TypeError("iterator result is not an object"),C.delegate=null,P)}function z(E){var C={tryLoc:E[0]};1 in E&&(C.catchLoc=E[1]),2 in E&&(C.finallyLoc=E[2],C.afterLoc=E[3]),this.tryEntries.push(C)}function k(E){var C=E.completion||{};C.type="normal",delete C.arg,E.completion=C}function L(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(z,this),this.reset(!0)}function V(E){if(E||E===""){var C=E[o];if(C)return C.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var S=-1,D=function O(){for(;++S<E.length;)if(r.call(E,S))return O.value=E[S],O.done=!1,O;return O.value=i,O.done=!0,O};return D.next=D}}throw new TypeError(ri(E)+" is not iterable")}return y.prototype=f,s(_,"constructor",{value:f,configurable:!0}),s(f,"constructor",{value:y,configurable:!0}),y.displayName=u(f,l,"GeneratorFunction"),e.isGeneratorFunction=function(E){var C=typeof E=="function"&&E.constructor;return!!C&&(C===y||(C.displayName||C.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,f):(E.__proto__=f,u(E,l,"GeneratorFunction")),E.prototype=Object.create(_),E},e.awrap=function(E){return{__await:E}},A(I.prototype),u(I.prototype,a,function(){return this}),e.AsyncIterator=I,e.async=function(E,C,S,D,O){O===void 0&&(O=Promise);var x=new I(d(E,C,S,D),O);return e.isGeneratorFunction(C)?x:x.next().then(function(M){return M.done?M.value:x.next()})},A(_),u(_,l,"Generator"),u(_,o,function(){return this}),u(_,"toString",function(){return"[object Generator]"}),e.keys=function(E){var C=Object(E),S=[];for(var D in C)S.push(D);return S.reverse(),function O(){for(;S.length;){var x=S.pop();if(x in C)return O.value=x,O.done=!1,O}return O.done=!0,O}},e.values=V,L.prototype={constructor:L,reset:function(C){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(k),!C)for(var S in this)S.charAt(0)==="t"&&r.call(this,S)&&!isNaN(+S.slice(1))&&(this[S]=i)},stop:function(){this.done=!0;var C=this.tryEntries[0].completion;if(C.type==="throw")throw C.arg;return this.rval},dispatchException:function(C){if(this.done)throw C;var S=this;function D(ne,re){return M.type="throw",M.arg=C,S.next=ne,re&&(S.method="next",S.arg=i),!!re}for(var O=this.tryEntries.length-1;O>=0;--O){var x=this.tryEntries[O],M=x.completion;if(x.tryLoc==="root")return D("end");if(x.tryLoc<=this.prev){var q=r.call(x,"catchLoc"),W=r.call(x,"finallyLoc");if(q&&W){if(this.prev<x.catchLoc)return D(x.catchLoc,!0);if(this.prev<x.finallyLoc)return D(x.finallyLoc)}else if(q){if(this.prev<x.catchLoc)return D(x.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return D(x.finallyLoc)}}}},abrupt:function(C,S){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.tryLoc<=this.prev&&r.call(O,"finallyLoc")&&this.prev<O.finallyLoc){var x=O;break}}x&&(C==="break"||C==="continue")&&x.tryLoc<=S&&S<=x.finallyLoc&&(x=null);var M=x?x.completion:{};return M.type=C,M.arg=S,x?(this.method="next",this.next=x.finallyLoc,P):this.complete(M)},complete:function(C,S){if(C.type==="throw")throw C.arg;return C.type==="break"||C.type==="continue"?this.next=C.arg:C.type==="return"?(this.rval=this.arg=C.arg,this.method="return",this.next="end"):C.type==="normal"&&S&&(this.next=S),P},finish:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.finallyLoc===C)return this.complete(D.completion,D.afterLoc),k(D),P}},catch:function(C){for(var S=this.tryEntries.length-1;S>=0;--S){var D=this.tryEntries[S];if(D.tryLoc===C){var O=D.completion;if(O.type==="throw"){var x=O.arg;k(D)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(C,S,D){return this.delegate={iterator:V(C),resultName:S,nextLoc:D},this.method==="next"&&(this.arg=i),P}},e}function ac(i,e,t,r,s,n,o){try{var a=i[n](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(r,s)}function cb(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function o(l){ac(n,r,s,o,a,"next",l)}function a(l){ac(n,r,s,o,a,"throw",l)}o(void 0)})}}function db(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function hb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,fb(r.key),r)}}function pb(i,e,t){return e&&hb(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function fb(i){var e=gb(i,"string");return ri(e)==="symbol"?e:String(e)}function gb(i,e){if(ri(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(ri(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var mb=(function(){function i(){db(this,i)}return pb(i,[{key:"openFile",value:(function(){var e=cb(ia().mark(function r(s,n){var o;return ia().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(Gh()&&s&&typeof s.uri<"u")){l.next=11;break}return l.prev=1,l.next=4,Kv(s.uri);case 4:return o=l.sent,l.abrupt("return",new nc(o));case 8:throw l.prev=8,l.t0=l.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(l.t0));case 11:if(!(typeof s.slice=="function"&&typeof s.size<"u")){l.next=13;break}return l.abrupt("return",Promise.resolve(new nc(s)));case 13:if(typeof s.read!="function"){l.next=18;break}if(n=Number(n),Number.isFinite(n)){l.next=17;break}return l.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return l.abrupt("return",Promise.resolve(new ub(s,n)));case 18:return l.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return l.stop()}},r,null,[[1,8]])}));function t(r,s){return e.apply(this,arguments)}return t})()}]),i})();function yb(i,e){return Gh()?Promise.resolve(vb(i,e)):Promise.resolve(["tus-br",i.name,i.type,i.size,i.lastModified,e.endpoint].join("-"))}function vb(i,e){var t=i.exif?bb(JSON.stringify(i.exif)):"noexif";return["tus-rn",i.name||"noname",i.size||"nosize",t,e.endpoint].join("/")}function bb(i){var e=0;if(i.length===0)return e;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);e=(e<<5)-e+r,e&=e}return e}function Pi(i){"@babel/helpers - typeof";return Pi=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},Pi(i)}function wb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Sb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Xh(r.key),r)}}function Pb(i,e,t){return t&&Sb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Fb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&ra(i,e)}function ra(i,e){return ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},ra(i,e)}function Cb(i){var e=Eb();return function(){var r=Zs(i),s;if(e){var n=Zs(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return _b(this,s)}}function _b(i,e){if(e&&(Pi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tb(i)}function Tb(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Eb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Zs(i){return Zs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zs(i)}function lc(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}function gi(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lc(Object(t),!0).forEach(function(r){Db(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):lc(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Db(i,e,t){return e=Xh(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Xh(i){var e=xb(i,"string");return Pi(e)==="symbol"?e:String(e)}function xb(i,e){if(Pi(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Pi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var sa=gi(gi({},Js.defaultOptions),{},{httpStack:new Wv,fileReader:new mb,urlStorage:$v?new jv:new Uv,fingerprint:yb}),Ab=(function(i){Fb(t,i);var e=Cb(t);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wb(this,t),s=gi(gi({},sa),s),e.call(this,r,s)}return Pb(t,null,[{key:"terminate",value:function(s){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=gi(gi({},sa),n),Js.terminate(s,n)}}]),t})(Js);function gt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Ib=0;function Kh(i){return"__private_"+Ib+++"_"+i}var Se=Kh("uppy"),Zi=Kh("events");class Ob{constructor(e){Object.defineProperty(this,Se,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:[]}),gt(this,Se)[Se]=e}on(e,t){return gt(this,Zi)[Zi].push([e,t]),gt(this,Se)[Se].on(e,t)}remove(){for(const[e,t]of gt(this,Zi)[Zi].splice(0))gt(this,Se)[Se].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{gt(this,Se)[Se].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{gt(this,Se)[Se].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){gt(r,Se)[Se].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{gt(this,Se)[Se].getFile(e)&&t()})}}function kb(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}function $(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Rb=0;function ke(i){return"__private_"+Rb+++"_"+i}function Ub(i){return new Error("Cancelled",{cause:i})}function uc(i){if(i!=null){var e;const t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});const r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Le=ke("activeRequests"),Te=ke("queuedHandlers"),Re=ke("paused"),zt=ke("pauseTimer"),Pe=ke("downLimit"),$t=ke("upperLimit"),mt=ke("rateLimitingTimer"),br=ke("call"),Pt=ke("queueNext"),na=ke("next"),fo=ke("queue"),oa=ke("dequeue"),go=ke("resume"),jt=ke("increaseLimit");class Mb{constructor(e){Object.defineProperty(this,oa,{value:$b}),Object.defineProperty(this,fo,{value:zb}),Object.defineProperty(this,na,{value:Nb}),Object.defineProperty(this,Pt,{value:Lb}),Object.defineProperty(this,br,{value:Bb}),Object.defineProperty(this,Le,{writable:!0,value:0}),Object.defineProperty(this,Te,{writable:!0,value:[]}),Object.defineProperty(this,Re,{writable:!0,value:!1}),Object.defineProperty(this,zt,{writable:!0,value:void 0}),Object.defineProperty(this,Pe,{writable:!0,value:1}),Object.defineProperty(this,$t,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,go,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,jt,{writable:!0,value:()=>{if($(this,Re)[Re]){$(this,mt)[mt]=setTimeout($(this,jt)[jt],0);return}$(this,Pe)[Pe]=this.limit,this.limit=Math.ceil(($(this,$t)[$t]+$(this,Pe)[Pe])/2);for(let t=$(this,Pe)[Pe];t<=this.limit;t++)$(this,Pt)[Pt]();$(this,$t)[$t]-$(this,Pe)[Pe]>3?$(this,mt)[mt]=setTimeout($(this,jt)[jt],2e3):$(this,Pe)[Pe]=Math.floor($(this,Pe)[Pe]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!$(this,Re)[Re]&&$(this,Le)[Le]<this.limit?$(this,br)[br](e):$(this,fo)[fo](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];const a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:uc,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a;const l=new Promise((u,d)=>{a=r.run(()=>{let c,m;try{m=Promise.resolve(e(...n))}catch(w){m=Promise.reject(w)}return m.then(w=>{c?d(c):(a.done(),u(w))},w=>{c?d(c):(a.done(),d(w))}),w=>{c=Ub(w)}},t)});return l.abort=u=>{a.abort(u)},l.abortOn=uc,l}}resume(){$(this,Re)[Re]=!1,clearTimeout($(this,zt)[zt]);for(let e=0;e<this.limit;e++)$(this,Pt)[Pt]()}pause(e){e===void 0&&(e=null),$(this,Re)[Re]=!0,clearTimeout($(this,zt)[zt]),e!=null&&($(this,zt)[zt]=setTimeout($(this,go)[go],e))}rateLimit(e){clearTimeout($(this,mt)[mt]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&($(this,$t)[$t]=this.limit-1,this.limit=$(this,Pe)[Pe],$(this,mt)[mt]=setTimeout($(this,jt)[jt],e))}get isPaused(){return $(this,Re)[Re]}}function Bb(i){$(this,Le)[Le]+=1;let e=!1,t;try{t=i()}catch(r){throw $(this,Le)[Le]-=1,r}return{abort:r=>{e||(e=!0,$(this,Le)[Le]-=1,t?.(r),$(this,Pt)[Pt]())},done:()=>{e||(e=!0,$(this,Le)[Le]-=1,$(this,Pt)[Pt]())}}}function Lb(){queueMicrotask(()=>$(this,na)[na]())}function Nb(){if($(this,Re)[Re]||$(this,Le)[Le]>=this.limit||$(this,Te)[Te].length===0)return;const i=$(this,Te)[Te].shift();if(i==null)throw new Error("Invariant violation: next is null");const e=$(this,br)[br](i.fn);i.abort=e.abort,i.done=e.done}function zb(i,e){const t={fn:i,priority:e?.priority||0,abort:()=>{$(this,oa)[oa](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=$(this,Te)[Te].findIndex(s=>t.priority>s.priority);return r===-1?$(this,Te)[Te].push(t):$(this,Te)[Te].splice(r,0,t),t}function $b(i){const e=$(this,Te)[Te].indexOf(i);e!==-1&&$(this,Te)[Te].splice(e,1)}function jb(i){const e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Hb(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function qb(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}function Vb(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}function Wb(i){return(e,t)=>{if(qb()||Vb())return sa.fingerprint(e,t);const r=["tus",i.id,t.endpoint].join("-");return Promise.resolve(r)}}function Qt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Gb=0;function Vr(i){return"__private_"+Gb+++"_"+i}const Xb={version:"3.5.5"},Yh={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},Kb={limit:20,retryDelays:Yh.retryDelays,withCredentials:!1};var wr=Vr("retryDelayIterator"),aa=Vr("uploadLocalFile"),la=Vr("getCompanionClientArgs"),mo=Vr("uploadFiles"),er=Vr("handleUpload");class Qh extends un{constructor(e,t){var r,s;if(super(e,{...Kb,...t}),Object.defineProperty(this,mo,{value:Jb}),Object.defineProperty(this,la,{value:Qb}),Object.defineProperty(this,aa,{value:Yb}),Object.defineProperty(this,wr,{writable:!0,value:void 0}),Object.defineProperty(this,er,{writable:!0,value:async n=>{if(n.length===0){this.uppy.log("[Tus] No files to upload");return}this.opts.limit===0&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");const o=this.uppy.getFilesByIds(n);await Qt(this,mo)[mo](o)}}),this.type="uploader",this.id=this.opts.id||"Tus",t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in t)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=(r=this.opts.rateLimitedQueue)!=null?r:new Mb(this.opts.limit),Qt(this,wr)[wr]=(s=this.opts.retryDelays)==null?void 0:s.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.handleResetProgress=this.handleResetProgress.bind(this)}handleResetProgress(){const e={...this.uppy.getState().files};Object.keys(e).forEach(t=>{var r;if((r=e[t])!=null&&(r=r.tus)!=null&&r.uploadUrl){const s={...e[t].tus};delete s.uploadUrl,e[t]={...e[t],tus:s}}}),this.uppy.setState({files:e})}resetUploaderReferences(e,t){const r=this.uploaders[e];r&&(r.abort(),t!=null&&t.abort&&r.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}onReceiveUploadUrl(e,t){const r=this.uppy.getFile(e.id);r&&(!r.tus||r.tus.uploadUrl!==t)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:{...r.tus,uploadUrl:t}}))}install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(Qt(this,er)[er]),this.uppy.on("reset-progress",this.handleResetProgress)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(Qt(this,er)[er])}}function Yb(i){var e=this;return this.resetUploaderReferences(i.id),new Promise((t,r)=>{let s,n,o;const a={...this.opts,...i.tus||{}};typeof a.headers=="function"&&(a.headers=a.headers(i));const{onShouldRetry:l,onBeforeRequest:u,...d}=a,c={...Yh,...d};c.fingerprint=Wb(i),c.onBeforeRequest=async b=>{const y=b.getUnderlyingObject();y.withCredentials=!!a.withCredentials;let f;if(typeof u=="function"&&(f=u(b,i)),Cs(s,"shouldBeRequeued")){if(!s.shouldBeRequeued)return Promise.reject();let p;const v=new Promise(g=>{p=g});s=this.requests.run(()=>(i.isPaused&&s.abort(),p(),()=>{})),await Promise.all([v,f]);return}return f},c.onError=b=>{var y;this.uppy.log(b);const f=b.originalRequest!=null?b.originalRequest.getUnderlyingObject():null;kb(f)&&(b=new dd(b,f)),this.resetUploaderReferences(i.id),(y=s)==null||y.abort(),this.uppy.emit("upload-error",i,b),typeof a.onError=="function"&&a.onError(b),r(b)},c.onProgress=(b,y)=>{this.onReceiveUploadUrl(i,o.url),typeof a.onProgress=="function"&&a.onProgress(b,y),this.uppy.emit("upload-progress",this.uppy.getFile(i.id),{uploader:this,bytesUploaded:b,bytesTotal:y})},c.onSuccess=()=>{var b;const y={uploadURL:(b=o.url)!=null?b:void 0,status:200,body:{}};if(this.resetUploaderReferences(i.id),s.done(),this.uppy.emit("upload-success",this.uppy.getFile(i.id),y),o.url){const{name:f}=o.file;this.uppy.log(`Download ${f} from ${o.url}`)}typeof a.onSuccess=="function"&&a.onSuccess(),t(o)};const m=b=>{var y;const f=b==null||(y=b.originalResponse)==null?void 0:y.getStatus();if(f===429){if(!this.requests.isPaused){var p;const v=(p=Qt(this,wr)[wr])==null?void 0:p.next();if(v==null||v.done)return!1;this.requests.rateLimit(v.value)}}else{if(f!=null&&f>400&&f<500&&f!==409&&f!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return s.abort(),s={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};l!=null?c.onShouldRetry=(b,y)=>l(b,y,a,m):c.onShouldRetry=m;const w=(b,y,f)=>{Cs(b,y)&&!Cs(b,f)&&(b[f]=b[y])},F={};(Array.isArray(a.allowedMetaFields)?a.allowedMetaFields:Object.keys(i.meta)).forEach(b=>{F[b]=String(i.meta[b])}),w(F,"type","filetype"),w(F,"name","filename"),c.metadata=F,o=new Ab(i.data,c),this.uploaders[i.id]=o;const P=new Ob(this.uppy);this.uploaderEvents[i.id]=P,n=()=>(i.isPaused||o.start(),()=>{}),o.findPreviousUploads().then(b=>{const y=b[0];y&&(this.uppy.log(`[Tus] Resuming upload of ${i.id} started at ${y.creationTime}`),o.resumeFromPreviousUpload(y))}),s=this.requests.run(n),P.onFileRemove(i.id,b=>{s.abort(),this.resetUploaderReferences(i.id,{abort:!!o.url}),t(`upload ${b} was removed`)}),P.onPause(i.id,b=>{s.abort(),b?o.abort():s=this.requests.run(n)}),P.onPauseAll(i.id,()=>{s.abort(),o.abort()}),P.onCancelAll(i.id,function(b){let{reason:y}=b===void 0?{}:b;y==="user"&&(s.abort(),e.resetUploaderReferences(i.id,{abort:!!o.url})),t(`upload ${i.id} was canceled`)}),P.onResumeAll(i.id,()=>{s.abort(),i.error&&o.abort(),s=this.requests.run(n)})}).catch(t=>{throw this.uppy.emit("upload-error",i,t),t})}function Qb(i){var e;const t={...this.opts};return i.tus&&Object.assign(t,i.tus),typeof t.headers=="function"&&(t.headers=t.headers(i)),{...(e=i.remote)==null?void 0:e.body,endpoint:t.endpoint,uploadUrl:t.uploadUrl,protocol:"tus",size:i.data.size,headers:t.headers,metadata:i.meta}}async function Jb(i){const e=jb(i),t=Hb(e);this.uppy.emit("upload-start",t),await Promise.allSettled(e.map(r=>{if(r.isRemote){const s=()=>this.requests,n=new AbortController,o=l=>{l.id===r.id&&n.abort()};this.uppy.on("file-removed",o);const a=this.uppy.getRequestClientForFile(r).uploadRemoteFile(r,Qt(this,la)[la](r),{signal:n.signal,getQueue:s});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",o)},{priority:-1})(),a}return Qt(this,aa)[aa](r)}))}Qh.VERSION=Xb.version;function hs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)i[r]=t[r]}return i}var Zb={read:function(i){return i[0]==='"'&&(i=i.slice(1,-1)),i.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(i){return encodeURIComponent(i).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function ua(i,e){function t(s,n,o){if(!(typeof document>"u")){o=hs({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in o)o[l]&&(a+="; "+l,o[l]!==!0&&(a+="="+o[l].split(";")[0]));return document.cookie=s+"="+i.write(n,s)+a}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var n=document.cookie?document.cookie.split("; "):[],o={},a=0;a<n.length;a++){var l=n[a].split("="),u=l.slice(1).join("=");try{var d=decodeURIComponent(l[0]);if(o[d]=i.read(u,d),s===d)break}catch{}}return s?o[s]:o}}return Object.create({set:t,get:r,remove:function(s,n){t(s,"",hs({},n,{expires:-1}))},withAttributes:function(s){return ua(this.converter,hs({},this.attributes,s))},withConverter:function(s){return ua(hs({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(i)}})}var en=ua(Zb,{path:"/"}),Us={exports:{}},e3=Us.exports,cc;function t3(){return cc||(cc=1,(function(i){(function(e,t,r){i.exports?i.exports=r():t[e]=r()})("urljoin",e3,function(){function e(t){var r=[];if(t.length===0)return"";if(typeof t[0]!="string")throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var s=t.shift();t[0]=s+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if(typeof o!="string")throw new TypeError("Url must be a string. Received "+o);o!==""&&(n>0&&(o=o.replace(/^[\/]+/,"")),n<t.length-1?o=o.replace(/[\/]+$/,""):o=o.replace(/[\/]+$/,"/"),r.push(o))}var a=r.join("/");a=a.replace(/\/(\?|&|#[^!])/g,"$1");var l=a.split("?");return a=l.shift()+(l.length>0?"?":"")+l.join("&"),a}return function(){var t;return typeof arguments[0]=="object"?t=arguments[0]:t=[].slice.call(arguments),e(t)}})})(Us)),Us.exports}var i3=t3();const tn=Ve(i3),r3={"3gp":"video/3gpp",aac:"audio/aac",apng:"image/apng",avif:"image/avif",bmp:"image/bmp",css:"text/css",eot:"application/vnd.ms-fontobject",exe:"application/vnd.microsoft.portable-executable",flac:"audio/flac",glb:"model/gltf-binary",gltf:"model/gltf+json",htm:"text/html",html:"text/html",ico:"image/x-icon",iso:"application/x-iso9660-image",jpeg:"image/jpeg",js:"text/javascript",json:"application/json",m4a:"audio/mp4",m4v:"video/x-m4v",m2ts:"video/mp2t",mid:"audio/midi",midi:"audio/midi",mpg:"video/mpeg",mpeg:"video/mpeg",msi:"application/x-msdownload",ogg:"audio/ogg",otf:"font/otf",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rtf:"application/rtf",ts:"video/mp2t",tiff:"image/tiff",tif:"image/tiff",ttf:"font/ttf",wasm:"application/wasm",wav:"audio/wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",woff:"font/woff",woff2:"font/woff2",xml:"application/xml"},Jh={...js,...r3},s3=Object.entries(Jh).reduce((i,[e,t])=>(i[t]=i[t]||e,i),{}),n3=i=>{const e=i.split(/[?#]/)[0]||"",t=e.split(/[\\/]/).pop()||e,r=t.lastIndexOf(".");return r===-1||r===t.length-1?"":t.slice(r+1).toLowerCase()},Ct=i=>{if(!i||typeof i!="string")return!1;const e=i.trim();if(!e)return!1;const t=e.split(";")[0].toLowerCase();if(!t.includes("://")&&/^[a-z0-9.+-]+\/[a-z0-9.+-]+$/i.test(t))return t;const r=n3(e);return Jh[r]||!1},Fi=i=>{const e=Ct(i);return e&&(s3[e]||Fs(e))||!1},ar=i=>{let e=null;return!i||!Zh(i)?null:(window?.createObjectURL?e=window.createObjectURL(i):window?.URL?.createObjectURL?e=window.URL.createObjectURL(i):window?.webkitURL?.createObjectURL&&(e=window.webkitURL.createObjectURL(i)),e)},Zt=i=>{const{type:e,name:t}=i;if(t.startsWith(".")&&!Ct(t))return!1;const r=Ct(t);return r?Fi(r)||"":Fi(e)};function Zh(i){return i instanceof Blob}function Ms(i,e){return new File([i],e,{type:i.type})}function ep(i,e){let t=i.split(","),r=t[0].match(/:(.*?);/)?.[1],s=atob(t[1]),n=s.length,o=new Uint8Array(n);for(;n--;)o[n]=s.charCodeAt(n);return new File([o],e,{type:r})}function tp(i){const e=new URL(i);return e.searchParams.delete("w"),e.searchParams.delete("h"),e.searchParams.delete("q"),e.href}const bi=()=>window?.blocklet?.componentMountPoints?.find(i=>i.did==="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9"),ca=()=>window?.blocklet?.componentId.indexOf("z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9")>-1,at=bi()?.mountPoint||"/";let kt=at;const ip=i=>{if(i.disableMediaKitPrefix){kt=window?.blocklet?.prefix||"/";return}kt=at},rp=zc({timeout:2e5});rp.interceptors.request.use(i=>(i.baseURL=kt||"/",i.timeout=2e5,i),i=>Promise.reject(i));const Di=zc({timeout:2e5});Di.interceptors.request.use(i=>{i.baseURL=at;const e=window?.uploaderComponentId||(window?.blocklet?.componentId||"").split("/").pop();return i.headers["x-component-did"]=e,i},i=>Promise.reject(i));function Ka(i){const e=tn(window.location.origin,kt==="/"||i.disableAutoPrefix?"":kt,i.uploader||""),t=tn(window.location.origin,at==="/"||i.disableAutoPrefix?"":at,i.companion||"");return{uploaderUrl:e,companionUrl:t}}function sp(...i){const e=i.filter(Boolean).map(t=>t==="/"?"":t);return tn(...e)}function Lr(i,e=0,t=0,r=""){const{CDN_HOST:s=""}=window?.blocklet||{},n=new URL(s||window.location.origin);let o=kt==="/"?"":kt;r&&(o=r),n.pathname=tn(o,"/uploads/",i);const a=i.split(".").pop()||"";return["png","jpg","jpeg","webp"].includes(a)&&(e&&(n.searchParams.set("imageFilter","resize"),n.searchParams.set("w",e.toString())),t&&(n.searchParams.set("imageFilter","resize"),n.searchParams.set("h",t.toString()))),n.href}const da="uploader-upload-success",Bs="uploader-open",Ls="uploader-close";function np(i){i.getUploadSuccessKey=r=>r?.id?`${da}:${r.id}`:da,i.offUploadSuccess=r=>{i.off(i.getUploadSuccessKey(r))},i.uploadSuccessHandler=(r,s,n)=>{typeof r=="function"&&(s=r,r={});const o=i.getUploadSuccessKey(r);i.offUploadSuccess(r),n?i.once(o,(a,l)=>{s({file:a,response:l})}):i.on(o,(a,l)=>{s({file:a,response:l})})},i.onceUploadSuccess=(r,s)=>{i.uploadSuccessHandler(r,s,!0)},i.onUploadSuccess=(r,s)=>{i.uploadSuccessHandler(r,s,!1)},i.emitUploadSuccess=(r,s)=>{const n=i.getUploadSuccessKey(r);i.emit(n,r,s)};const e=$s(i.addFiles,50);i.addFiles=r=>{e.call(i,r)},i.uploadFile=async r=>new Promise((s,n)=>{const{name:o,type:a}=r,l=i.addFile({name:`${new Date().valueOf()}-${o}`,type:a,data:r,source:"function-upload-file",isRemote:!1}),u=i.getFile(l);i.onceUploadSuccess(u,d=>{i.removeFiles([l]),s(d)}),i.once("error",d=>{i.offUploadSuccess(u),i.removeFiles([l]),n(d)}),i.upload()}),i.removeFiles=r=>{const{files:s,currentUploads:n}=i.getState(),o={...s},a={...n},l=Object.create(null);r.forEach(m=>{s[m]&&(l[m]=s[m],delete o[m])});function u(m){return l[m]===void 0}Object.keys(a).forEach(m=>{const w=n[m].fileIDs.filter(u);if(w.length===0){delete a[m];return}const{capabilities:F}=i.getState();if(w.length!==n[m].fileIDs.length&&!F.individualCancellation)throw new Error("individualCancellation is disabled");a[m]={...n[m],fileIDs:w}});const d={currentUploads:a,files:o};Object.keys(o).length===0&&(d.allowNewUpload=!0,d.error=null,d.recoveredState=null),i.setState(d),i.calculateTotalProgress();const c=Object.keys(l);c.forEach(m=>{i.emit("file-removed-success",l[m])}),c.length>5?i.log(`Removed ${c.length} files`):i.log(`Removed files: ${c.join(", ")}`)},i.emitOpen=(...r)=>{i.emit(Bs,...r)},i.onOpen=r=>{i.off(Bs),i.once(Bs,r)},i.emitClose=(...r)=>{i.emit(Ls,...r)},i.onClose=r=>{i.off(Ls),i.once(Ls,r)},i.calculateTotalProgress=()=>{const r=i.getFiles(),s=r.filter(w=>w.progress.uploadStarted||w.progress.preprocess||w.progress.postprocess);if(s.length===0){i.emit("progress",0),i.setState({totalProgress:0});return}const n=s.filter(w=>w.progress.bytesTotal!=null),o=s.filter(w=>w.progress.bytesTotal==null);if(n.length===0){const w=s.length*100,F=o.reduce((P,b)=>P+b.progress.percentage,0),T=Math.round(F/w*100);i.setState({totalProgress:T});return}let a=n.reduce((w,F)=>w+F.progress.bytesTotal,0);const l=a/n.length;a+=l*o.length;let u=0;n.forEach(w=>{u+=w.progress.bytesUploaded}),o.forEach(w=>{u+=l*(w.progress.percentage||0)/100});const c=r.filter(w=>w.progress.uploadComplete).length===r.length;let m=a===0?c?100:0:Math.round(u/a*100);m>100&&(m=100),i.setState({totalProgress:m}),i.emit("progress",m)};const t=i.upload.bind(i);return i.upload=async()=>(i.getFiles().forEach(s=>{i.setFileState(s.id,{progress:{uploadComplete:!1,uploadStarted:!1},error:null})}),await t()),i}function op(i){return typeof i!="string"?"":i&&i.length>12?i.substring(0,7)+"..."+i.substring(i.length-5):i}const ap=async i=>{if(i.type?.toLowerCase().includes("svg")||i.name?.toLowerCase().endsWith(".svg"))return!0;try{const t=i.data?.slice(0,524288);if(!t)return!1;const r=await t.text();return r?/<svg[^>]*?(?:>|\/>)|<\?xml[^>]*>\s*<svg[^>]*?(?:>|\/?>)/i.test(r):!1}catch{return!1}},lp=i=>{if(!i)return null;try{const e={fileUrl:i.fileUrl||i.icon||"",mimetype:i.mimetype||Ct(i.fileUrl),originalname:i.originalname||i.name||"unknown",filename:i.filename||i._id||`${Date.now()}.unknown`,size:i.size||0,remark:i.remark||"",tags:Array.isArray(i.tags)?i.tags:[],folderId:i.folderId||"",createdAt:i.createdAt||new Date().toISOString(),updatedAt:i.updatedAt||new Date().toISOString(),createdBy:i.createdBy||"",updatedBy:i.updatedBy||"",_id:i._id||i.id||`${Date.now()}`,previewUrl:i.previewUrl||i.icon||i.fileUrl||""};let t="";try{t=new URL(e.fileUrl).origin}catch{t=window.location.origin}const r=`Uploader-${e.originalname.toLowerCase().replace(/[^a-z0-9]/g,"")}-${Date.now()}`,s=`Mock-${Math.random().toString(36).substring(2,15)}`,n={url:e.fileUrl,mimetype:e.mimetype,originalname:e.originalname,filename:e.filename,size:e.size,remark:e.remark,tags:e.tags,folderId:e.folderId,createdAt:e.createdAt,updatedAt:e.updatedAt,createdBy:e.createdBy,updatedBy:e.updatedBy,_id:e._id},o=`${t}/image-bin/api/uploads/${e.filename}`,a={"Tus-Resumable":"1.0.0","Upload-Length":String(e.size),"x-uploader-file-name":e.filename,"x-uploader-file-id":r,"x-uploader-file-ext":e.filename.split(".").pop()||"unknown","x-uploader-base-url":"/image-bin/api/uploads","x-uploader-endpoint-url":t+"/image-bin/api/uploads","x-uploader-metadata":JSON.stringify({uploaderId:"Uploader",relativePath:e.originalname,name:e.originalname,type:e.mimetype}),"x-component-did":e.folderId,"x-uploader-file-exist":"true"},l={uploadStarted:Date.now(),uploadComplete:!0,percentage:100,bytesUploaded:e.size,bytesTotal:e.size},u={source:"uploader-dashboard",id:r,name:e.originalname,extension:e.filename.split(".").pop()||"unknown",meta:{uploaderId:"Uploader",relativePath:e.originalname,name:e.originalname,type:e.mimetype},type:e.mimetype,data:n,progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size},size:e.size,isGhost:!1,isRemote:!1,remote:"",preview:e.previewUrl,hashFileName:e.filename,error:null,uploadID:s,tus:{uploadUrl:o}};return{data:n,method:"POST",url:t+"/image-bin/api/uploads",status:200,headers:a,source:"uploader-dashboard",id:r,name:e.originalname,extension:e.filename.split(".").pop()||"unknown",file:u,meta:{uploaderId:"Uploader",relativePath:e.originalname,name:e.originalname,type:e.mimetype},type:e.mimetype,progress:l,size:e.size,isGhost:!1,isRemote:!1,remote:"",preview:e.previewUrl,hashFileName:e.filename,error:null,uploadID:s,tus:{uploadUrl:o},responseResult:{uploadURL:o,data:n,method:"POST",url:t+"/image-bin/api/uploads",status:200,headers:a,file:u},response:{uploadURL:o,status:200,body:{}},uploadURL:o,isPaused:!1}}catch(e){return console.error("Error in mockResponse:",e),null}};class o3 extends un{boundHandleUpload;constructor(e,t){super(e,t),this.id=t.id||"PresignedUpload",this.type="uploader",this.opts=t,this.boundHandleUpload=this.handleUpload.bind(this)}install(){this.uppy.addUploader(this.boundHandleUpload)}uninstall(){this.uppy.removeUploader(this.boundHandleUpload)}getHeaders(){const e={"Content-Type":"application/json",...this.opts.headers||{}},t=en.get("x-csrf-token");t&&(e["x-csrf-token"]=t);const r=window?.uploaderComponentId||window?.blocklet?.componentId;return r&&(e["x-component-did"]=(r||"").split("/").pop()||""),e}async apiCall(e,t){const r=`${this.opts.apiBase}${e}`,s=await fetch(r,{method:"POST",headers:this.getHeaders(),body:JSON.stringify(t),credentials:"include"});if(!s.ok){const n=await s.json().catch(()=>({error:s.statusText}));throw new Error(n.error||`Upload failed: ${s.status}`)}return s.json()}async handleUpload(e){const t=e.map(r=>this.uppy.getFile(r));for(const r of t)try{await this.uploadFile(r)}catch(s){this.uppy.log(`[PresignedUpload] Error uploading ${r.name}: ${s.message}`,"error"),this.uppy.emit("upload-error",r,s)}}async uploadFile(e){const t=Zt(e)||e.name.split(".").pop()||"",r=e.size||e.data?.size||0,s=e.meta?.folderId||"",n=e.meta?.tags||"",o=await this.apiCall("/uploads/check",{size:r,ext:`.${t}`});let a;if(o.exists)a=await this.apiCall("/uploads/confirm",{existingUploadId:o.uploadId,originalname:e.name,mimetype:e.type,folderId:s,tags:n});else{const d=await this.apiCall("/uploads/presign",{originalname:e.name,mimetype:e.type,size:r,ext:`.${t}`,folderId:s});try{d.multipart?await this.uploadMultipart(e,d):await this.uploadDirect(e,d.presignedUrl)}catch(c){throw d.multipart&&await this.apiCall("/uploads/multipart/abort",{sessionId:d.sessionId}).catch(()=>{}),c}a=await this.apiCall("/uploads/confirm",{sessionId:d.sessionId,originalname:e.name,mimetype:e.type,folderId:s,tags:n})}let l=a.url||`/uploads/${a.filename}`;l.startsWith("/")&&(l=`${this.opts.apiBase||window.location.origin}${l}`);const u={data:a,method:"POST",url:l,status:200,headers:{},file:e,uploadURL:l};this.uppy.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!0,percentage:100,bytesUploaded:e.size||e.data?.size||0,bytesTotal:e.size||e.data?.size||0},responseResult:u}),this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:l,status:200,body:a})}async uploadDirect(e,t){const r=new XMLHttpRequest;await new Promise((s,n)=>{r.open("PUT",t,!0),e.type&&r.setRequestHeader("Content-Type",e.type),r.upload.onprogress=o=>{if(o.lengthComputable){const a=Math.round(o.loaded/o.total*100);this.uppy.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:a,bytesUploaded:o.loaded,bytesTotal:o.total}}),this.uppy.calculateTotalProgress?.(),this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,bytesUploaded:o.loaded,bytesTotal:o.total})}},r.onload=()=>{r.status>=200&&r.status<300?s():n(new Error(`Direct upload failed: ${r.status} ${r.statusText}`))},r.onerror=()=>n(new Error("Network error during upload")),r.onabort=()=>n(new Error("Upload aborted")),r.send(e.data)})}async uploadMultipart(e,t){const{sessionId:r,partSize:s,partCount:n}=t,o=e.size||e.data?.size||0,a=[];let l=0;for(let u=0;u<n;u++){const d=u+1,c=u*s,m=Math.min(c+s,o),w=e.data.slice(c,m),{presignedUrl:F}=await this.apiCall("/uploads/multipart/part-url",{sessionId:r,partNumber:d}),T=await fetch(F,{method:"PUT",body:w});if(!T.ok)throw new Error(`Part ${d} upload failed: ${T.status}`);const P=T.headers.get("ETag")||"";a.push({partNumber:d,etag:P.replace(/"/g,"")}),l+=m-c;const b=Math.round(l/o*100);this.uppy.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:b,bytesUploaded:l,bytesTotal:o}}),this.uppy.calculateTotalProgress?.(),this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,bytesUploaded:l,bytesTotal:o})}await this.apiCall("/uploads/multipart/complete",{sessionId:r,parts:a})}}const Ya={strings:{},pluralize(){return 0}};Ya.strings={addBulkFilesFailed:"内部错误导致添加 %{smart_count} 个文件失败",addMore:"添加更多文件",addMoreFiles:"添加更多文件",addingMoreFiles:"添加更多文件",allowAccessDescription:"为了通过您的相机进行拍照或录像,请给网站相机的访问权限",allowAccessTitle:"请允许对相机的访问权限",authenticateWith:"连接到 %{pluginName}",authenticateWithTitle:"请使用 %{pluginName} 进行认证以选择文件",back:"返回",browse:"浏览",browseFiles:"浏览",cancel:"取消",cancelUpload:"取消上传",chooseFiles:"选择文件",closeModal:"关闭窗口",companionError:"和 Companion 连接失败了",companionUnauthorizeHint:"请访问 %{url} 以认证您的 %{provider} 账户",complete:"上传完毕",connectedToInternet:"连接至网络",copyLink:"复制链接",copyLinkToClipboardFallback:"复制以下网址",copyLinkToClipboardSuccess:"链接已复制到剪贴板",creatingAssembly:"正在准备上传…",creatingAssemblyFailed:"Transloadit:无法创建程序集",dashboardTitle:"文件上传工具",dashboardWindowTitle:"文件上传工具窗口(点击离开以关闭)",dataUploadedOfTotal:"%{total} / %{complete}",done:"完成",dropHereOr:"拖拽文件到这里,或%{browse}",dropHint:"拖拽文件到这里",dropPasteBoth:"拖拽文件到这里,或者%{browse}文件",dropPasteFiles:"拖拽文件到这里,或者%{browse}文件",dropPasteFolders:"拖拽文件到这里,或者%{browse}文件",dropPasteImportBoth:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFiles:"拖拽文件到这里,粘贴、%{browse}或者导入",dropPasteImportFolders:"拖拽文件到这里,粘贴、%{browse}或者导入",editFile:"编辑文件",editImage:"编辑图片",editing:"正在编辑 %{file}",emptyFolderAdded:"无法从空文件夹添加文件",encoding:"正在编码…",enterCorrectUrl:"错误链接: 请确认您输入的是文件的链接",enterUrlToImport:"输入链接或者导入文件",exceedsSize:"文件超过了最大尺寸限制 %{size}",failedToFetch:"Companion 无法抓取此链接,请确保它是正确的",failedToUpload:"上传 %{file} 失败",fileSource:"文件源:%{name}",filesUploadedOfTotal:"已上传 %{smart_count} 个文件中的 %{complete} 个",filter:"筛选器",finishEditingFile:"完成文件编辑",folderAdded:"从 %{folder} 添加了 %{smart_count} 个文件",generatingThumbnails:"正在生成缩略图…",import:"导入",importFrom:"从 %{name} 导入",inferiorSize:"文件大小必须超过 %{size}",loading:"正在载入…",logOut:"登出",micDisabled:"麦克风的权限访问被用户拒绝",myDevice:"我的设备",noCameraDescription:"为了拍摄照片或录制视频,请连接一个摄像设备",noCameraTitle:"摄像头不可用",noDuplicates:"无法添加重复文件 %{fileName},该文件已存在",noFilesFound:"这里空空如也",noInternetConnection:"无法连接到网络",noMoreFilesAllowed:"无法添加新文件:已正在上传文件",openFolderNamed:"打开文件夹 %{name}",pause:"暂停",pauseUpload:"暂停上传",paused:"已暂停",poweredBy:"强力驱动于 %{uppy}",processingXFiles:"正在处理 %{smart_count} 个文件",recording:"正在录制",recordingLength:"录制长度 %{recording_length}",recordingStoppedMaxSize:"录像已停止,文件大小即将超过限制",removeFile:"删除文件",resetFilter:"重置筛选器",resume:"恢复",resumeUpload:"恢复上传",retry:"重试",retryUpload:"重试",saveChanges:"保存变更",selectFileNamed:"选择文件 %{name}",selectX:"选择 %{smart_count}",smile:"笑一笑!",startCapturing:"开始屏幕录制",startRecording:"开始视频录制",stopCapturing:"停止屏幕录制",stopRecording:"停止视频录制",streamActive:"视频流已激活",streamPassive:"视频流未激活",submitRecordedFile:"提交已录制视频",takePicture:"拍照",timedOut:"上传已超时 %{seconds} 秒,中止上传",unselectFileNamed:"取消选择文件 %{name}",upload:"上传",uploadComplete:"上传完成",uploadFailed:"上传失败",uploadPaused:"上传暂停",uploadXFiles:"上传 %{smart_count} 个文件",uploadXNewFiles:"新上传了 %{smart_count} 个文件",uploading:"正在上传",uploadingXFiles:"正在上传 %{smart_count} 个文件",xFilesSelected:"%{smart_count} 个文件待上传",xMoreFilesAdded:"又有 %{smart_count} 个文件被添加",xTimeLeft:"剩余 %{time}",youCanOnlyUploadFileTypes:"您只能上传这些文件类型:%{types}",youCanOnlyUploadX:"您只能上传 %{smart_count} 个文件",youHaveToAtLeastSelectX:"您至少要选择 %{smart_count} 个文件"};typeof Uppy<"u"&&(globalThis.Uppy.locales.zh_CN=Ya);const Qa={strings:{},pluralize(i){return i===1?0:1}};Qa.strings={addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},addedNumFiles:"Added %{numFiles} file(s)",addingMoreFiles:"Adding more files",additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",addMore:"Add more",addMoreFiles:"Add more files",allFilesFromFolderNamed:"All files from folder %{name}",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",allowAccessTitle:"Please allow access to your camera",allowAudioAccessDescription:"In order to record audio, please allow microphone access for this site.",allowAudioAccessTitle:"Please allow access to your microphone",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)",aspectRatioSquare:"Crop square",authAborted:"Authentication aborted",authenticateWith:"Connect to %{pluginName}",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",back:"Back",browse:"browse",browseFiles:"browse files",browseFolders:"browse folders",cancel:"Cancel",cancelUpload:"Cancel upload",chooseFiles:"Choose files",closeModal:"Close Modal",companionError:"Connection with Companion failed",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",complete:"Complete",compressedX:"Saved %{size} by compressing images",compressingImages:"Compressing images...",connectedToInternet:"Connected to the Internet",copyLink:"Copy link",copyLinkToClipboardFallback:"Copy the URL below",copyLinkToClipboardSuccess:"Link copied to clipboard.",creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",dashboardTitle:"Uppy Dashboard",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dataUploadedOfTotal:"%{complete} of %{total}",discardRecordedFile:"Discard recorded file",done:"Done",dropHereOr:"Drop here or %{browse}",dropHint:"Drop your files here",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",editFile:"Edit file",editImage:"Edit image",editFileWithFilename:"Edit file %{file}",editing:"Editing %{file}",emptyFolderAdded:"No files were added from empty folder",encoding:"Encoding...",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file",enterTextToSearch:"Enter text to search for images",enterUrlToImport:"Enter URL to import a file",error:"Error",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",failedToUpload:"Failed to upload %{file}",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},filter:"Filter",finishEditingFile:"Finish editing file",flipHorizontal:"Flip horizontal",folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},folderAlreadyAdded:'The folder "%{folder}" was already added',generatingThumbnails:"Generating thumbnails...",import:"Import",importFiles:"Import files from:",importFrom:"Import from %{name}",inferiorSize:"This file is smaller than the allowed size of %{size}",loadedXFiles:"Loaded %{numFiles} files",loading:"Loading...",logOut:"Log out",micDisabled:"Microphone access denied by user",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},myDevice:"My Device",noAudioDescription:"In order to record audio, please connect a microphone or another audio input device",noAudioTitle:"Microphone Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",noCameraTitle:"Camera Not Available",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",noFilesFound:"You have no files or folders here",noInternetConnection:"No Internet connection",noMoreFilesAllowed:"Cannot add more files",noSearchResults:"Unfortunately, there are no results for this search",openFolderNamed:"Open folder %{name}",pause:"Pause",paused:"Paused",pauseUpload:"Pause upload",pluginNameAudio:"Audio",pluginNameBox:"Box",pluginNameCamera:"Camera",pluginNameDropbox:"Dropbox",pluginNameFacebook:"Facebook",pluginNameGoogleDrive:"Google Drive",pluginNameInstagram:"Instagram",pluginNameOneDrive:"OneDrive",pluginNameZoom:"Zoom",poweredBy:"Powered by %{uppy}",processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},recording:"Recording",recordingLength:"Recording length %{recording_length}",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordVideoBtn:"Record Video",recoveredAllFiles:"We restored all files. You can now resume the upload.",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."},removeFile:"Remove file",reSelect:"Re-select",resetFilter:"Reset filter",resetSearch:"Reset search",resume:"Resume",resumeUpload:"Resume upload",retry:"Retry",retryUpload:"Retry upload",revert:"Revert",rotate:"Rotate",save:"Save",saveChanges:"Save changes",search:"Search",searchImages:"Search for images",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},sessionRestored:"Session restored",showErrorDetails:"Show error details",signInWithGoogle:"Sign in with Google",smile:"Smile!",startAudioRecording:"Begin audio recording",startCapturing:"Begin screen capturing",startRecording:"Begin video recording",stopAudioRecording:"Stop audio recording",stopCapturing:"Stop screen capturing",stopRecording:"Stop video recording",streamActive:"Stream active",streamPassive:"Stream passive",submitRecordedFile:"Submit recorded file",takePicture:"Take a picture",takePictureBtn:"Take Picture",timedOut:"Upload stalled for %{seconds} seconds, aborting.",upload:"Upload",uploadComplete:"Upload complete",uploadFailed:"Upload failed",uploading:"Uploading",uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},uploadPaused:"Upload paused",uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it.",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},xTimeLeft:"%{time} left",youCanOnlyUploadFileTypes:"You can only upload: %{types}",youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},zoomIn:"Zoom in",zoomOut:"Zoom out"};typeof Uppy<"u"&&(globalThis.Uppy.locales.en_US=Qa);const Ja={strings:{},pluralize(i){return i===1?0:1}};Ja.strings={addMore:"さらに追加",addMoreFiles:"ファイルを追加",addingMoreFiles:"ファイルを追加しています",allowAccessDescription:"カメラやビデオの機能を使用するには、カメラへのアクセスを許可してください。",allowAccessTitle:"カメラへのアクセスを許可してください",authenticateWith:"%{pluginName}に接続します",authenticateWithTitle:"ファイルを選択するには%{pluginName}で認証してください",back:"戻る",browse:"参照",browseFiles:"参照",cancel:"キャンセル",cancelUpload:"アップロードをキャンセル",chooseFiles:"ファイルを選択",closeModal:"モーダルを閉じる",companionError:"Companionとの接続に失敗しました",complete:"完了しました",compressingImages:"画像を圧縮中...",compressedX:"画像圧縮により%{size}を節約しました",connectedToInternet:"インターネットに接続しました",copyLink:"リンクをコピー",copyLinkToClipboardFallback:"以下のURLをコピー",copyLinkToClipboardSuccess:"リンクをクリップボードにコピーしました",creatingAssembly:"アップロードの準備をしています...",creatingAssemblyFailed:"Transloadit: アセンブリを作成できませんでした",dashboardTitle:"ファイルアップローダー",dashboardWindowTitle:"ファイルアップローダーウィンドウ(閉じるにはEscapeキーを押してください)",dataUploadedOfTotal:"%{total} %{complete}",done:"完了しました",dropHereOr:"ここにファイルをドロップするか%{browse}してください",dropHint:"ここにファイルをドロップしてください",dropPasteBoth:"ここにファイルをドロップするか、貼り付けるか、%{browse}してください",dropPasteFiles:"ここにファイルをドロップするか、貼り付けるか、%{browse}してください",dropPasteFolders:"ここにファイルをドロップするか、貼り付けるか、%{browse}してください",dropPasteImportBoth:"ここにファイルをドロップするか、貼り付けるか、%{browse}するか、以下からインポートしてください",dropPasteImportFiles:"ここにファイルをドロップするか、貼り付けるか、%{browse}するか、以下からインポートしてください",dropPasteImportFolders:"ここにファイルをドロップするか、貼り付けるか、%{browse}するか、以下からインポートしてください",editFile:"ファイルを編集",editImage:"画像を編集",editing:"%{file}を編集しています",emptyFolderAdded:"フォルダが空なためファイルが追加されませんでした",encoding:"エンコードしています...",enterCorrectUrl:"不正なURL: ファイルへの直接リンクが入力されていることを確認してください",enterUrlToImport:"ファイルをインポートするためのURLを入力してください",exceedsSize:"ファイルサイズが大きすぎます %{size}",failedToFetch:"CompanionがURLを取得できませんでした。URLが正しいか確認してください",failedToUpload:"%{file}のアップロードに失敗しました",fileSource:"元ファイル:%{name}",filesUploadedOfTotal:{0:"%{smart_count} 個のファイルのアップロードが%{complete}",1:"%{smart_count} 個のファイルのアップロードが%{complete}"},filter:"フィルタ",finishEditingFile:"ファイルの編集を終了",folderAdded:{0:"%{folder} から% {smart_count} 個のファイルを追加しました",1:"%{folder} から% {smart_count} 個のファイルを追加しました"},import:"インポート",importFrom:"%{name}からインポート",loading:"ロード中...",logOut:"ログアウト",myDevice:"マイデバイス",noFilesFound:"ファイルやフォルダがありません",noInternetConnection:"インターネット接続がありません",pause:"一時停止",pauseUpload:"アップロードを一時停止",paused:"停止中",poweredBy:"Powered by %{uppy}",processingXFiles:{0:"%{smart_count} ファイル処理中",1:"%{smart_count} ファイル処理中"},removeFile:"ファイルを消す",resetFilter:"フィルタをリセット",resume:"再開",resumeUpload:"アップロードを再開",retry:"リトライ",retryUpload:"アップロードをリトライ",saveChanges:"変更を保存",selectX:{0:"%{smart_count} を選択",1:"%{smart_count} を選択"},smile:"スマイル〜!",startRecording:"録画開始",stopRecording:"録画停止",takePicture:"写真を撮る",timedOut:"アップロードが %{seconds} 秒間止まった為中断しました",upload:"アップロード",uploadComplete:"アップロード完了",uploadFailed:"アップロード失敗",uploadPaused:"アップロード一時停止",uploadXFiles:{0:"%{smart_count} ファイルをアップロード",1:"%{smart_count} ファイルをアップロード"},uploadXNewFiles:{0:"+%{smart_count} ファイルをアップロード",1:"+%{smart_count} ファイルをアップロード"},uploading:"アップロード中",uploadingXFiles:{0:"%{smart_count} ファイルアップロード中",1:"%{smart_count} ファイルアップロード中"},xFilesSelected:{0:"%{smart_count} ファイルを選択",1:"%{smart_count} ファイルを選択"},xMoreFilesAdded:{0:"%{smart_count} ファイルを追加",1:"%{smart_count} ファイルを追加"},xTimeLeft:"残り %{time}",youCanOnlyUploadFileTypes:"許可されているファイル形式は次の物です: %{types}",youCanOnlyUploadX:{0:"%{smart_count} ファイル数のみアップロード可能です",1:"%{smart_count} ファイル数のみアップロード可能です"},youHaveToAtLeastSelectX:{0:"最低でも %{smart_count} ファイル選択してください",1:"最低でも %{smart_count} ファイル選択してください"},selectFileNamed:"ファイルを選ぶ %{name}",unselectFileNamed:"ファイルの選択を解除 %{name}",openFolderNamed:"開いたフォルダ %{name}"};typeof Uppy<"u"&&(globalThis.Uppy.locales.ja_JP=Ja);const Za={strings:{},pluralize(){return 0}};Za.strings={addBulkFilesFailed:"因伺服器錯誤,無法新增 %{smart_count} 個檔案",addedNumFiles:"已新增 %{numFiles} 個檔案",addingMoreFiles:"正在新增更多檔案",additionalRestrictionsFailed:"尚未滿足 %{count} 個額外限制",addMore:"新增更多",addMoreFiles:"新增更多檔案",allFilesFromFolderNamed:"資料夾 %{name} 中的所有檔案",allowAccessDescription:"請允許本網站存取相機以拍照或錄影。",allowAccessTitle:"請允許對相機的存取權限",allowAudioAccessDescription:"請允許本網站存取麥克風以錄製音訊。",allowAudioAccessTitle:"請允許對麥克風的存取權限",aspectRatioLandscape:"裁切成橫向 (16:9)",aspectRatioPortrait:"裁切成直向 (9:16)",aspectRatioSquare:"裁切成方形",authAborted:"驗證已中止",authenticateWith:"連接到 %{pluginName}",authenticateWithTitle:"請使用 %{pluginName} 進行身份驗證以選擇檔案",back:"返回",browse:"瀏覽",browseFiles:"瀏覽檔案",browseFolders:"瀏覽資料夾",cancel:"取消",cancelUpload:"取消上傳",chooseFiles:"選擇檔案",closeModal:"關閉視窗",companionError:"與 Companion 的連接失敗",companionUnauthorizeHint:"若要取消 %{provider} 帳號認證,請前往 %{url}",complete:"完成",compressedX:"圖片壓縮後,省下了 %{size}",compressingImages:"正在壓縮圖片...",connectedToInternet:"連線至網路",copyLink:"複製連結",copyLinkToClipboardFallback:"複製以下網址",copyLinkToClipboardSuccess:"連結已複製到剪貼簿",creatingAssembly:"正在準備上傳...",creatingAssemblyFailed:"Transloadit:無法建立程序集",dashboardTitle:"Uppy 儀表板",dashboardWindowTitle:"Uppy 儀表板視窗(按下 Esc 以關閉)",dataUploadedOfTotal:"%{complete}/%{total}",discardRecordedFile:"捨棄錄影檔",done:"完成",dropHereOr:"拖曳至此處,或%{browse}",dropHint:"將檔案拖曳至此處",dropPasteBoth:"將檔案拖曳至此處、%{browseFiles},或%{browseFolders}",dropPasteFiles:"將檔案拖曳至此處,或%{browseFiles}",dropPasteFolders:"將檔案拖曳至此處,或%{browseFolders}",dropPasteImportBoth:"將檔案拖曳至此處、%{browseFiles},或匯入",dropPasteImportFiles:"將檔案拖曳至此處、%{browseFiles},或匯入",dropPasteImportFolders:"將檔案拖曳至此處、%{browseFolders},或匯入",editFile:"編輯檔案",editImage:"編輯圖片",editFileWithFilename:"編輯檔案 %{file}",editing:"編輯 %{file}",emptyFolderAdded:"未從空資料夾新增任何檔案",encoding:"編碼中...",enterCorrectUrl:"錯誤連結:請確認您輸入的是檔案連結",enterTextToSearch:"輸入文字以搜尋圖片",enterUrlToImport:"輸入連結以匯入檔案",error:"錯誤",exceedsSize:"此檔案大小超出允許的最大值 %{size}",failedToFetch:"Companion 無法抓取此連結,請確認它是正確的",failedToUpload:"%{file} 上傳失敗",filesUploadedOfTotal:"已上傳 %{complete} 個檔案中的 %{smart_count} 個檔案",filter:"篩選器",finishEditingFile:"完成檔案編輯",flipHorizontal:"水平翻轉",folderAdded:"從 %{folder} 新增了 %{smart_count} 個檔案",folderAlreadyAdded:'資料夾 "%{folder}" 已新增',generatingThumbnails:"正在產生縮圖...",import:"匯入",importFiles:"檔案匯入來源:",importFrom:"從 %{name} 匯入",inferiorSize:"此檔案小於允許的大小:%{size}",loading:"正在載入...",logOut:"登出",micDisabled:"使用者拒絕麥克風存取權限",missingRequiredMetaField:"遺漏中繼資料必要欄位",missingRequiredMetaFieldOnFile:"%{fileName} 遺漏中繼資料必要欄位",missingRequiredMetaFields:"遺漏中繼資料必要欄位:%{fields}。",myDevice:"我的裝置",noAudioDescription:"請連接麥克風或其他音訊輸入裝置以錄製音訊",noAudioTitle:"無法使用麥克風",noCameraDescription:"請連接相機以拍照或錄影",noCameraTitle:"無法使用相機",noDuplicates:"無法新增重複檔案,'%{fileName}' 已存在",noFilesFound:"這裡空空如也",noInternetConnection:"無網路連線",noMoreFilesAllowed:"無法新增更多檔案",noSearchResults:"抱歉,找不到符合此搜尋條件的結果",openFolderNamed:"開啟資料夾 %{name}",pause:"暫停",paused:"已暫停",pauseUpload:"暫停上傳",pluginNameAudio:"音訊",pluginNameBox:"Box",pluginNameCamera:"相機",pluginNameDropbox:"Dropbox",pluginNameFacebook:"Facebook",pluginNameGoogleDrive:"Google 雲端硬碟",pluginNameInstagram:"Instagram",pluginNameOneDrive:"OneDrive",pluginNameZoom:"Zoom",poweredBy:"技術提供者 %{uppy}",processingXFiles:"正在處理 %{smart_count} 個檔案",recording:"正在錄製",recordingLength:"錄製時長 %{recording_length}",recordingStoppedMaxSize:"因檔案大小即將超出限制而停止錄製",recordVideoBtn:"錄影",recoveredAllFiles:"我們還原了所有檔案。您現在可以繼續上傳了。",recoveredXFiles:"我們無法完全復原 %{smart_count} 個檔案。請重新選擇檔案並繼續上傳。",removeFile:"移除檔案",reSelect:"重新選擇",resetFilter:"重設篩選器",resetSearch:"重設搜尋",resume:"繼續",resumeUpload:"繼續上傳",retry:"重試",retryUpload:"重試上傳",revert:"還原",rotate:"旋轉",save:"儲存",saveChanges:"儲存變更",search:"搜尋",searchImages:"搜尋圖片",selectX:"選擇 %{smart_count}",sessionRestored:"已復原工作階段",showErrorDetails:"顯示錯誤詳細資訊",signInWithGoogle:"透過 Google 登入",smile:"請微笑!",startAudioRecording:"開始錄音",startCapturing:"開始畫面擷取",startRecording:"開始錄影",stopAudioRecording:"停止錄音",stopCapturing:"停止畫面擷取",stopRecording:"停止錄影",streamActive:"主動串流",streamPassive:"被動串流",submitRecordedFile:"提交錄影檔",takePicture:"拍照",takePictureBtn:"拍照",timedOut:"上傳已停滯 %{seconds} 秒,正在中止上傳。",upload:"上傳",uploadComplete:"上傳完成",uploadFailed:"上傳失敗",uploading:"正在上傳",uploadingXFiles:"正在上傳 %{smart_count} 個檔案",uploadPaused:"暫停上傳",uploadStalled:"上傳已停滯 %{seconds} 秒。請考慮重試。",uploadXFiles:"上傳 %{smart_count} 個檔案",uploadXNewFiles:"上傳 +%{smart_count} 個檔案",xFilesSelected:"已選擇 %{smart_count} 個檔案",xMoreFilesAdded:"又新增 %{smart_count} 個檔案",xTimeLeft:"還剩下 %{time}",youCanOnlyUploadFileTypes:"您只能上傳這些檔案類型:%{types}",youCanOnlyUploadX:"您只能上傳 %{smart_count} 個檔案",youHaveToAtLeastSelectX:"您至少要選擇 %{smart_count} 個檔案",zoomIn:"放大",zoomOut:"縮小"};typeof Uppy<"u"&&(globalThis.Uppy.locales.zh_TW=Za);const lr={zh:Xr({...Ya},{strings:{aiKitRequired:"请先安装并配置 AI Kit",aiImageSelectedUse:"使用已选择的图片",aiImageSelectedTip:"请选择心仪的图片",aiImagePrompt:"提示词",aiImagePromptTip:"请输入提示词",aiImageSize:"图片尺寸",aiImageModel:"图片模型",aiImageNumber:"生成数量",aiImageGenerate:"生成图片",aiImageGenerating:"正在生成图片...",browse:"浏览",browseFiles:"浏览文件",browseFolders:"浏览文件夹",dropHereOr:"拖拽文件到这里,或%{browse}",dropHint:"拖拽文件到这里",dropPasteBoth:"拖拽文件到这里、%{browseFiles}或者%{browseFolders}",dropPasteFiles:"拖拽文件到这里或者%{browseFiles}",dropPasteFolders:"拖拽文件到这里或者%{browseFolders}",dropPasteImportBoth:"拖拽文件到这里、粘贴、%{browseFiles}、%{browseFolders}或者通过下方导入:",dropPasteImportFiles:"拖拽文件到这里、粘贴、%{browseFiles}或者通过下方导入:",dropPasteImportFolders:"拖拽文件到这里、粘贴、%{browseFolders}或者通过下方导入:",cancel:"返回",loadingStatus:"正在获取状态...",aspectRatioMessage:"请编辑图片适配所需比例,目前图片比例为 %{imageAspectRatio},需要 %{aspectRatio}",editorLoading:"等待图片编辑...",downloadRemoteFileFailure:"获取远程文件失败 ❌",noAllowedFileTypes:"不允许上传任何文件类型",allowedFileTypes:"允许上传的文件类型:",error:"初始化失败,请检查相关服务(Media Kit)运行状态是否正常"}}),en:Xr({...Qa},{strings:{aiKitRequired:"Install and config the AI Kit component first",aiImageSelectedUse:"Use selected images",aiImageSelectedTip:"Please select images",aiImagePrompt:"Prompt",aiImagePromptTip:"Please enter the prompt",aiImageSize:"Size",aiImageModel:"Model",aiImageNumber:"Number of images",aiImageGenerate:"Generate",aiImageGenerating:"Generating...",browse:"browse",browseFiles:"browse files",browseFolders:"browse folders",dropHint:"Drop your files here",dropPasteBoth:"Drop files here, paste, %{browseFiles} or %{browseFolders}",dropPasteFiles:"Drop files here, paste or %{browseFiles}",dropPasteFolders:"Drop files here, paste or %{browseFolders}",dropPasteImportBoth:"Drop files here, paste, %{browseFiles}, %{browseFolders} or import from:",dropPasteImportFiles:"Drop files here, paste, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, paste, %{browseFolders} or import from:",cancel:"Back",loadingStatus:"Getting status...",aspectRatioMessage:"Please edit the required ratio for image, currently the image ratio is %{imageAspectRatio}, need %{aspectRatio}",editorLoading:"Waiting for image editor...",downloadRemoteFileFailure:"Failure to get remote file ❌",noAllowedFileTypes:"No allowed any file types",allowedFileTypes:"Allowed file types: ",error:"Failed to initialize, please check if the related service (Media Kit) is running normally"}}),ja:Xr({...Ja},{strings:{aiKitRequired:"まず AI Kit コンポーネントをインストールして設定してください",aiImageSelectedUse:"選択した画像を使用",aiImageSelectedTip:"画像を選択してください",aiImagePrompt:"プロンプト",aiImagePromptTip:"プロンプトを入力してください",aiImageSize:"サイズ",aiImageModel:"モデル",aiImageNumber:"画像数",aiImageGenerate:"生成",aiImageGenerating:"生成中...",browse:"ブラウズ",browseFiles:"ファイルをブラウズ",browseFolders:"フォルダをブラウズ",dropHint:"ファイルをここにドロップ",dropPasteBoth:"ファイルをここにドロップ、貼り付け、%{browseFiles} または %{browseFolders}",dropPasteFiles:"ファイルをここにドロップ、貼り付け、または %{browseFiles}",dropPasteFolders:"ファイルをここにドロップ、貼り付け、または %{browseFolders}",dropPasteImportBoth:"ファイルをここにドロップ、貼り付け、%{browseFiles}、%{browseFolders} または以下からインポート:",dropPasteImportFiles:"ファイルをここにドロップ、貼り付け、%{browseFiles} または以下からインポート:",dropPasteImportFolders:"ファイルをここにドロップ、貼り付け、%{browseFolders} または以下からインポート:",cancel:"戻る",loadingStatus:"ステータスを取得中...",aspectRatioMessage:"画像の必要な比率を編集してください。現在の画像比率は %{imageAspectRatio} で、%{aspectRatio} が必要です",editorLoading:"画像エディターを待機中...",downloadRemoteFileFailure:"リモートファイルの取得に失敗しました ❌",noAllowedFileTypes:"許可されたファイルタイプがありません",allowedFileTypes:"許可されたファイルタイプ:",error:"初期化に失敗しました。関連サービス(Media Kit)が正常に実行されているか確認してください"}}),"zh-TW":Xr({...Za},{strings:{aiKitRequired:"請先安裝並配置 AI Kit",aiImageSelectedUse:"使用已選擇的圖片",aiImageSelectedTip:"請選擇心儀的圖片",aiImagePrompt:"提示詞",aiImagePromptTip:"請輸入提示詞",aiImageSize:"圖片尺寸",aiImageModel:"圖片模型",aiImageNumber:"生成數量",aiImageGenerate:"生成圖片",aiImageGenerating:"正在生成圖片...",browse:"瀏覽",browseFiles:"瀏覽檔案",browseFolders:"瀏覽資料夾",dropHereOr:"拖拽檔案到這裡,或%{browse}",dropHint:"拖拽檔案到這裡",dropPasteBoth:"拖拽檔案到這裡、%{browseFiles}或者%{browseFolders}",dropPasteFiles:"拖拽檔案到這裡或者%{browseFiles}",dropPasteFolders:"拖拽檔案到這裡或者%{browseFolders}",dropPasteImportBoth:"拖拽檔案到這裡、貼上、%{browseFiles}、%{browseFolders}或者透過下方匯入:",dropPasteImportFiles:"拖拽檔案到這裡、貼上、%{browseFiles}或者透過下方匯入:",dropPasteImportFolders:"拖拽檔案到這裡、貼上、%{browseFolders}或者透過下方匯入:",cancel:"返回",loadingStatus:"正在獲取狀態...",aspectRatioMessage:"請編輯圖片適配所需比例,目前圖片比例為 %{imageAspectRatio},需要 %{aspectRatio}",editorLoading:"等待圖片編輯...",downloadRemoteFileFailure:"獲取遠端檔案失敗 ❌",noAllowedFileTypes:"不允許上傳任何檔案類型",allowedFileTypes:"允許上傳的檔案類型:",error:"初始化失敗,請檢查相關服務(Media Kit)執行狀態是否正常"}})};var a3=0;function se(i,e,t,r,s,n){var o,a,l={};for(a in e)a=="ref"?o=e[a]:l[a]=e[a];var u={type:i,props:l,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--a3,__i:-1,__u:0,__source:s,__self:n};if(typeof i=="function"&&(o=i.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return K.vnode&&K.vnode(u),u}const dc={data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,folderId:""},hc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},l3=`
18
+ <svg
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ xmlns:xlink="http://www.w3.org/1999/xlink"
21
+ aria-hidden="true"
22
+ role="img"
23
+ class="iconify iconify--vscode-icons MuiBox-root css-cv9zqr"
24
+ width="1em"
25
+ height="1em"
26
+ viewBox="0 0 32 32">
27
+ <path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945z"></path>
28
+ <path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873z"></path>
29
+ <path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5z"></path>
30
+ <path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077z"></path>
31
+ <path
32
+ fill="#464648"
33
+ d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .335-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.409-.104a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"></path>
34
+ <path
35
+ fill="#dd2025"
36
+ d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511m-2.357.083a7.5 7.5 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14 14 0 0 0 1.658 2.252a13 13 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.8 10.8 0 0 1-.517 2.434a4.4 4.4 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444M25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14 14 0 0 0-2.453.173a12.5 12.5 0 0 1-2.012-2.655a11.8 11.8 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.3 9.3 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.6 9.6 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a23 23 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"></path>
37
+ <path fill="#909090" d="M23.954 2.077V7.95h5.633z"></path>
38
+ <path fill="#f4f4f4" d="M24.031 2v5.873h5.633z"></path>
39
+ <path
40
+ fill="#fff"
41
+ d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2 2 0 0 0 .647-.117a1.4 1.4 0 0 0 .493-.291a1.2 1.2 0 0 0 .332-.454a2.1 2.1 0 0 0 .105-.908a2.2 2.2 0 0 0-.114-.644a1.17 1.17 0 0 0-.687-.65a2 2 0 0 0-.411-.105a2 2 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.94.94 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.7 2.7 0 0 0 1.028-.175a1.7 1.7 0 0 0 .68-.491a1.9 1.9 0 0 0 .373-.749a3.7 3.7 0 0 0 .114-.949a4.4 4.4 0 0 0-.087-1.127a1.8 1.8 0 0 0-.4-.733a1.6 1.6 0 0 0-.535-.4a2.4 2.4 0 0 0-.549-.178a1.3 1.3 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.06 1.06 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a3 3 0 0 1-.033.513a1.8 1.8 0 0 1-.169.5a1.1 1.1 0 0 1-.363.36a.67.67 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"></path>
42
+ </svg>`;class u3 extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"Uploaded",this.title=this.opts.title||"Uploaded",this.params=this.opts.params||{},this.type="acquirer",this.uppy=e,this.uploadedAPIData={...dc},this.addUploadItemFlag=!0,this.icon=()=>se("svg",{"aria-hidden":"true",focusable:"false",width:"18",height:"18",viewBox:"0 0 1024 1024",children:[se("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"}),se("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"}),se("path",{d:"M657.6 0v233.6c0 25.6 17.6 92.8 97.6 92.8H960L657.6 0z",fill:"#37BB91"}),se("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(e){return!this.uploadedAPIData.loading&&this.uploadedAPIData.files?.length===0&&this.queryUploadedFromMediaKit(),se("div",{id:"uploaded",className:"uploaded",children:this.view.render(e)})}queryUploadedFromMediaKit=async()=>{const{pageSize:e,page:t,files:r,hasMore:s,loading:n}=this.uploadedAPIData;if(s&&!n){this.uploadedAPIData.loading=!0,this.uploadedAPIData.page+=1;const{data:o}=await Di.get("/api/uploads",{params:{page:t,pageSize:e,...this.params}});this.uploadedAPIData.loading=!1,this.uploadedAPIData.hasMore=this.uploadedAPIData.page<=o.pageCount,this.uploadedAPIData.files=$c([...r,...o.uploads.map(a=>{let l="file";const{filename:u,_id:d,originalname:c}=a,m=Lr(u,0,0,at);return l=Lr(u,400,0,at),{...a,id:d,icon:l,previewUrl:l,fileUrl:m}})],"_id"),this.uploaded.setPluginState({files:this.uploadedAPIData.files,loading:!1}),this.canConvertImgToObject=!0}};addUploadItem=$s(()=>{if(this.addUploadItemFlag){const e=document.querySelector("#uploaded .uppy-ProviderBrowser-list");if(e){const t=document.createElement("li");t.className="uppy-ProviderBrowserItem",t.innerHTML=`
43
+ <div class="uppy-ProviderBrowserItem-inner uploaded-add-item">
44
+ <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>
45
+ </div>
46
+ `,t.addEventListener("click",async()=>{await this.uppy.openPlugin("My Device")}),e.insertBefore(t,e.firstChild),this.addUploadItemFlag=!1}}},{wait:200});convertImgToObject=$s(()=>{this.canConvertImgToObject&&(document.querySelectorAll("#uploaded img").forEach(t=>{if(!t?.src)return;const{src:r}=t,s=this.uploadedAPIData.files?.find(a=>a.previewUrl===r),n=document.createElement("div");n.style="width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; ";const o=document.createElement("div");if(o.className="uppy-ProviderBrowserItem-name",o.style="pointer-events: none; position: absolute; bottom: 0; left: 0; right: 0; padding: 5px; background: #0000004d; color: #fff; ",o.innerHTML=op(s.originalname),[".mp4",".webm"].find(a=>t.src?.endsWith(a))){const a=document.createElement("video");a.src=t.src,a.width=t.width,a.height=t.height,a.autoplay=!0,a.setAttribute("playsinline","playsinline"),a.muted=!0,a.loop=!0,a.style="pointer-events: none;",n.appendChild(a)}else if([".pdf"].find(a=>t.src?.endsWith(a))){const a=document.createElement("div");a.className="pdf-icon",a.innerHTML=l3,n.appendChild(a)}else{const a=document.createElement("object");a.data=r,a.type=s.mimetype||"image/png",a.alt=s.originalname,a.style="pointer-events: none; max-width: 100%; max-height: 100%; webkit-user-drag: none; object-fit: contain;",a.loading="lazy",n.appendChild(a)}n.appendChild(o),t.parentNode.replaceChild(n,t)}),this.canConvertImgToObject=!1)},{wait:200});update(){this.convertImgToObject(),this.addUploadItem()}onFirstRender(){}resetState=()=>{this.uploadedAPIData={...dc},this.uploaded.setPluginState({...hc}),this.addUploadItemFlag=!0};install(){this.view=new xa(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.uploaded=this.view.plugin,this.uploaded.setPluginState({...hc}),this.uploaded.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(t,r)=>{const{currentSelection:s}=this.uploaded.getPluginState(),n=this.uploaded.uppy.opts.restrictions.maxNumberOfFiles,o=n?s.length<n:!0;s.find(a=>a._id===r._id)?this.uploaded.setPluginState({currentSelection:[...s.filter(a=>a._id!==r._id)]}):(o||s.pop(),this.uploaded.setPluginState({currentSelection:[...s,r]}))},this.view.donePicking=()=>{const{currentSelection:t}=this.uploaded.getPluginState();this.uppy.emit("uploaded:selected",t),this.uploaded.parent.hideAllPanels()},this.uploaded.uppy.validateRestrictions=()=>!1,this.view.handleScroll=t=>{const{scrollHeight:r,scrollTop:s,offsetHeight:n}=t.target;r-(s+n)<30&&this.queryUploadedFromMediaKit()};const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount(),this.uploaded.uppy.off("dashboard:show-panel",this.resetState)}}var yo,pc;function c3(){if(pc)return yo;pc=1;var i=Ep();function e(t){return i(t).toUpperCase()}return yo=e,yo}var d3=c3();const h3=Ve(d3),fc={initialized:!1,data:[],files:[],pageSize:16,page:1,loading:!1,hasMore:!0,componentDid:"",components:[]},gc={authenticated:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[],loading:!0,loadAllFiles:!0},p3={padding:"5px 15px",marginRight:"8px",marginTop:"8px",borderRadius:"4px",cursor:"pointer",fontSize:"14px",lineHeight:"24.5px",fontWeight:"bold"};class f3 extends he{constructor(e,t){super(e,t),this.id=this.opts.id||"Resources",this.title=this.opts.title||"Resources",this.params=this.opts.params||{},this.type="acquirer",this.uppy=e,this.componentDid="",this.apiData={...fc},this.icon=()=>se("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:[se("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"}),se("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"}),se("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(e){return!this.apiData.loading&&!this.apiData.initialized&&this.queryResources(),se("div",{id:"resources",className:"uploaded",children:[se("div",{style:{padding:this.apiData.components.length?"12px":"0",display:"flex",flexWrap:"wrap",marginTop:"-8px"},children:this.apiData.components.map(t=>se("button",{className:this.apiData.componentDid===t.did?"button-color-style button-color-style-active":"button-color-style",style:p3,id:t.componentDid,onClick:()=>{this.apiData.componentDid!==t.did&&(this.apiData.componentDid=t.did,this.queryResources())},children:h3(t.name)}))}),this.view.render(e)]})}queryResources=async()=>{if(!this.apiData.loading){this.apiData.loading=!0;const{data:e}=await Di.get("/api/resources",{params:{componentDid:this.apiData.componentDid}});this.apiData.loading=!1,this.apiData.initialized=!0,this.apiData.components=e.components||[],this.apiData.componentDid=e.componentDid||"",this.apiData.files=$c([...e.resources.map(t=>{let r="file";const{filename:s}=t,n=Lr(s,0,0,at);return r=Lr(s,400,0,at),{filename:s,_id:s,id:s,name:s,icon:r,previewUrl:r,fileUrl:n}})],"id"),this.resources.setPluginState({files:this.apiData.files,loading:!1})}};update(){}onFirstRender(){}resetState=()=>{this.apiData={...fc},this.resources.setPluginState({...gc})};install(){this.view=new xa(this,{provider:{},viewType:"grid",showBreadcrumbs:!1,showFilter:!1}),this.resources=this.view.plugin,this.resources.setPluginState({...gc}),this.resources.uppy.on("dashboard:show-panel",this.resetState),this.view.toggleCheckbox=(t,r)=>{const{currentSelection:s}=this.resources.getPluginState(),n=this.resources.uppy.opts.restrictions.maxNumberOfFiles,o=n?s.length<n:!0;s.find(a=>a.id===r.id)?this.resources.setPluginState({currentSelection:[...s.filter(a=>a.id!==r.id)]}):(o||s.pop(),this.resources.setPluginState({currentSelection:[...s,r]}))},this.resources.uppy.validateRestrictions=()=>!1,this.view.donePicking=()=>{const{currentSelection:t}=this.resources.getPluginState();this.uppy.emit("resources:selected",t),this.resources.parent.hideAllPanels()};const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount(),this.resources.uppy.off("dashboard:show-panel",this.resetState)}}var vo={exports:{}},mc;function g3(){return mc||(mc=1,(function(i,e){(function(t){i.exports=t()})(function(t){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function s(b,y){var f=b[0],p=b[1],v=b[2],g=b[3];f+=(p&v|~p&g)+y[0]-680876936|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[1]-389564586|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[2]+606105819|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[3]-1044525330|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[4]-176418897|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[5]+1200080426|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[6]-1473231341|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[7]-45705983|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[8]+1770035416|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[9]-1958414417|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[10]-42063|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[11]-1990404162|0,p=(p<<22|p>>>10)+v|0,f+=(p&v|~p&g)+y[12]+1804603682|0,f=(f<<7|f>>>25)+p|0,g+=(f&p|~f&v)+y[13]-40341101|0,g=(g<<12|g>>>20)+f|0,v+=(g&f|~g&p)+y[14]-1502002290|0,v=(v<<17|v>>>15)+g|0,p+=(v&g|~v&f)+y[15]+1236535329|0,p=(p<<22|p>>>10)+v|0,f+=(p&g|v&~g)+y[1]-165796510|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[6]-1069501632|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[11]+643717713|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[0]-373897302|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[5]-701558691|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[10]+38016083|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[15]-660478335|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[4]-405537848|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[9]+568446438|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[14]-1019803690|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[3]-187363961|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[8]+1163531501|0,p=(p<<20|p>>>12)+v|0,f+=(p&g|v&~g)+y[13]-1444681467|0,f=(f<<5|f>>>27)+p|0,g+=(f&v|p&~v)+y[2]-51403784|0,g=(g<<9|g>>>23)+f|0,v+=(g&p|f&~p)+y[7]+1735328473|0,v=(v<<14|v>>>18)+g|0,p+=(v&f|g&~f)+y[12]-1926607734|0,p=(p<<20|p>>>12)+v|0,f+=(p^v^g)+y[5]-378558|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[8]-2022574463|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[11]+1839030562|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[14]-35309556|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[1]-1530992060|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[4]+1272893353|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[7]-155497632|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[10]-1094730640|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[13]+681279174|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[0]-358537222|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[3]-722521979|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[6]+76029189|0,p=(p<<23|p>>>9)+v|0,f+=(p^v^g)+y[9]-640364487|0,f=(f<<4|f>>>28)+p|0,g+=(f^p^v)+y[12]-421815835|0,g=(g<<11|g>>>21)+f|0,v+=(g^f^p)+y[15]+530742520|0,v=(v<<16|v>>>16)+g|0,p+=(v^g^f)+y[2]-995338651|0,p=(p<<23|p>>>9)+v|0,f+=(v^(p|~g))+y[0]-198630844|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[7]+1126891415|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[14]-1416354905|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[5]-57434055|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[12]+1700485571|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[3]-1894986606|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[10]-1051523|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[1]-2054922799|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[8]+1873313359|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[15]-30611744|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[6]-1560198380|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[13]+1309151649|0,p=(p<<21|p>>>11)+v|0,f+=(v^(p|~g))+y[4]-145523070|0,f=(f<<6|f>>>26)+p|0,g+=(p^(f|~v))+y[11]-1120210379|0,g=(g<<10|g>>>22)+f|0,v+=(f^(g|~p))+y[2]+718787259|0,v=(v<<15|v>>>17)+g|0,p+=(g^(v|~f))+y[9]-343485551|0,p=(p<<21|p>>>11)+v|0,b[0]=f+b[0]|0,b[1]=p+b[1]|0,b[2]=v+b[2]|0,b[3]=g+b[3]|0}function n(b){var y=[],f;for(f=0;f<64;f+=4)y[f>>2]=b.charCodeAt(f)+(b.charCodeAt(f+1)<<8)+(b.charCodeAt(f+2)<<16)+(b.charCodeAt(f+3)<<24);return y}function o(b){var y=[],f;for(f=0;f<64;f+=4)y[f>>2]=b[f]+(b[f+1]<<8)+(b[f+2]<<16)+(b[f+3]<<24);return y}function a(b){var y=b.length,f=[1732584193,-271733879,-1732584194,271733878],p,v,g,_,A,I;for(p=64;p<=y;p+=64)s(f,n(b.substring(p-64,p)));for(b=b.substring(p-64),v=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<v;p+=1)g[p>>2]|=b.charCodeAt(p)<<(p%4<<3);if(g[p>>2]|=128<<(p%4<<3),p>55)for(s(f,g),p=0;p<16;p+=1)g[p]=0;return _=y*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(_[2],16),I=parseInt(_[1],16)||0,g[14]=A,g[15]=I,s(f,g),f}function l(b){var y=b.length,f=[1732584193,-271733879,-1732584194,271733878],p,v,g,_,A,I;for(p=64;p<=y;p+=64)s(f,o(b.subarray(p-64,p)));for(b=p-64<y?b.subarray(p-64):new Uint8Array(0),v=b.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],p=0;p<v;p+=1)g[p>>2]|=b[p]<<(p%4<<3);if(g[p>>2]|=128<<(p%4<<3),p>55)for(s(f,g),p=0;p<16;p+=1)g[p]=0;return _=y*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),A=parseInt(_[2],16),I=parseInt(_[1],16)||0,g[14]=A,g[15]=I,s(f,g),f}function u(b){var y="",f;for(f=0;f<4;f+=1)y+=r[b>>f*8+4&15]+r[b>>f*8&15];return y}function d(b){var y;for(y=0;y<b.length;y+=1)b[y]=u(b[y]);return b.join("")}d(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function b(y,f){return y=y|0||0,y<0?Math.max(y+f,0):Math.min(y,f)}ArrayBuffer.prototype.slice=function(y,f){var p=this.byteLength,v=b(y,p),g=p,_,A,I,N;return f!==t&&(g=b(f,p)),v>g?new ArrayBuffer(0):(_=g-v,A=new ArrayBuffer(_),I=new Uint8Array(A),N=new Uint8Array(this,v,_),I.set(N),A)}})();function c(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function m(b,y){var f=b.length,p=new ArrayBuffer(f),v=new Uint8Array(p),g;for(g=0;g<f;g+=1)v[g]=b.charCodeAt(g);return y?v:p}function w(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function F(b,y,f){var p=new Uint8Array(b.byteLength+y.byteLength);return p.set(new Uint8Array(b)),p.set(new Uint8Array(y),b.byteLength),p}function T(b){var y=[],f=b.length,p;for(p=0;p<f-1;p+=2)y.push(parseInt(b.substr(p,2),16));return String.fromCharCode.apply(String,y)}function P(){this.reset()}return P.prototype.append=function(b){return this.appendBinary(c(b)),this},P.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var y=this._buff.length,f;for(f=64;f<=y;f+=64)s(this._hash,n(this._buff.substring(f-64,f)));return this._buff=this._buff.substring(f-64),this},P.prototype.end=function(b){var y=this._buff,f=y.length,p,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g;for(p=0;p<f;p+=1)v[p>>2]|=y.charCodeAt(p)<<(p%4<<3);return this._finish(v,f),g=d(this._hash),b&&(g=T(g)),this.reset(),g},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(b,y){var f=y,p,v,g;if(b[f>>2]|=128<<(f%4<<3),f>55)for(s(this._hash,b),f=0;f<16;f+=1)b[f]=0;p=this._length*8,p=p.toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(p[2],16),g=parseInt(p[1],16)||0,b[14]=v,b[15]=g,s(this._hash,b)},P.hash=function(b,y){return P.hashBinary(c(b),y)},P.hashBinary=function(b,y){var f=a(b),p=d(f);return y?T(p):p},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(b){var y=F(this._buff.buffer,b),f=y.length,p;for(this._length+=b.byteLength,p=64;p<=f;p+=64)s(this._hash,o(y.subarray(p-64,p)));return this._buff=p-64<f?new Uint8Array(y.buffer.slice(p-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(b){var y=this._buff,f=y.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v,g;for(v=0;v<f;v+=1)p[v>>2]|=y[v]<<(v%4<<3);return this._finish(p,f),g=d(this._hash),b&&(g=T(g)),this.reset(),g},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var b=P.prototype.getState.call(this);return b.buff=w(b.buff),b},P.ArrayBuffer.prototype.setState=function(b){return b.buff=m(b.buff,!0),P.prototype.setState.call(this,b)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(b,y){var f=l(new Uint8Array(b)),p=d(f);return y?T(p):p},P})})(vo)),vo.exports}var m3=g3();const y3=Ve(m3);var fn=typeof self<"u"?self:globalThis;const Nr=typeof navigator<"u",v3=Nr&&typeof HTMLImageElement>"u",rn=!(typeof globalThis>"u"||typeof process>"u"||!process.versions||!process.versions.node),el=fn.Buffer,ps=fn.BigInt,tl=!!el,b3=i=>i;function sn(i,e=b3){if(rn)try{return typeof require=="function"?Promise.resolve(e(require(i))):import(i).then(e)}catch{console.warn(`Couldn't load ${i}`)}}let il=fn.fetch;const w3=i=>il=i;if(!fn.fetch){const i=sn("http",(r=>r)),e=sn("https",(r=>r)),t=(r,{headers:s}={})=>new Promise((async(n,o)=>{let{port:a,hostname:l,pathname:u,protocol:d,search:c}=new URL(r);const m={method:"GET",hostname:l,path:encodeURI(u)+c,headers:s};a!==""&&(m.port=Number(a));const w=(d==="https:"?await e:await i).request(m,(F=>{if(F.statusCode===301||F.statusCode===302){let T=new URL(F.headers.location,r).toString();return t(T,{headers:s}).then(n).catch(o)}n({status:F.statusCode,arrayBuffer:()=>new Promise((T=>{let P=[];F.on("data",(b=>P.push(b))),F.on("end",(()=>T(Buffer.concat(P))))}))})}));w.on("error",o),w.end()}));w3(t)}function j(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}const nn=i=>up(i)?void 0:i,S3=i=>i!==void 0;function up(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(S3).length===0)}function de(i){let e=new Error(i);throw delete e.stack,e}function Jt(i){return(i=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(i).trim())===""?void 0:i}function ha(i){let e=(function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+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 pa=i=>String.fromCharCode.apply(null,i),yc=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;function cp(i){return yc?yc.decode(i):tl?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(pa(i)))}class Ie{static from(e,t){return e instanceof this&&e.le===t?e:new Ie(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof Ie){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&de("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}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,r=Ie){return e instanceof DataView||e instanceof Ie?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 r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new Ie(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 cp(this.getUint8Array(e,t))}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return pa(r)}getUnicodeString(e=0,t=this.byteLength){const r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return pa(r)}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,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function fa(i,e){de(`${i} '${e}' was not loaded, try using full build of exifr.`)}class rl extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||fa(this.kind,e),t&&(e in t||(function(r,s){de(`Unknown ${r} '${s}'.`)})(this.kind,e),t[e].enabled||fa(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Ci=new rl("file parser"),we=new rl("segment parser"),xi=new rl("file reader");function P3(i,e){return typeof i=="string"?vc(i,e):Nr&&!v3&&i instanceof HTMLImageElement?vc(i.src,e):i instanceof Uint8Array||i instanceof ArrayBuffer||i instanceof DataView?new Ie(i):Nr&&i instanceof Blob?ga(i,e,"blob",va):void de("Invalid input argument")}function vc(i,e){return(t=i).startsWith("data:")||t.length>1e4?ma(i,e,"base64"):rn&&i.includes("://")?ga(i,e,"url",ya):rn?ma(i,e,"fs"):Nr?ga(i,e,"url",ya):void de("Invalid input argument");var t}async function ga(i,e,t,r){return xi.has(t)?ma(i,e,t):r?(async function(s,n){let o=await n(s);return new Ie(o)})(i,r):void de(`Parser ${t} is not loaded`)}async function ma(i,e,t){let r=new(xi.get(t))(i,e);return await r.read(),r}const ya=i=>il(i).then((e=>e.arrayBuffer())),va=i=>new Promise(((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}));class F3 extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function be(i,e,t){let r=new F3;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function ba(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}const Oe=new Map,si=new Map,Ns=new Map,fs=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],dp=["jfif","xmp","icc","iptc","ihdr"],wa=["tiff",...dp],fe=["ifd0","ifd1","exif","gps","interop"],gs=[...wa,...fe],ms=["makerNote","userComment"],hp=["translateKeys","translateValues","reviveValues","multiSegment"],ys=[...hp,"sanitize","mergeOutput","silentErrors"];class pp{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class tr extends pp{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),j(this,"enabled",!1),j(this,"skip",new Set),j(this,"pick",new Set),j(this,"deps",new Set),j(this,"translateKeys",!1),j(this,"translateValues",!1),j(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=fe.includes(e),this.canBeFiltered&&(this.dict=Oe.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:de(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of hp)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,on(this.pick,this.deps)):this.enabled&&this.pick.size>0&&on(this.pick,this.deps)}}var Ce={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},bc=new Map;class sl extends pp{static useCached(e){let t=bc.get(e);return t!==void 0||(t=new this(e),bc.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=Nr?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of fs)this[e]=Ce[e];for(e of ys)this[e]=Ce[e];for(e of ms)this[e]=Ce[e];for(e of gs)this[e]=new tr(e,Ce[e],void 0,this)}setupFromTrue(){let e;for(e of fs)this[e]=Ce[e];for(e of ys)this[e]=Ce[e];for(e of ms)this[e]=!0;for(e of gs)this[e]=new tr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of fs)this[t]=Ce[t];for(t of ys)this[t]=Ce[t];for(t of ms)this[t]=Ce[t];for(t of gs)this[t]=new tr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,fe)}setupFromObject(e){let t;for(t of(fe.ifd0=fe.ifd0||fe.image,fe.ifd1=fe.ifd1||fe.thumbnail,Object.assign(this,e),fs))this[t]=bo(e[t],Ce[t]);for(t of ys)this[t]=bo(e[t],Ce[t]);for(t of ms)this[t]=bo(e[t],Ce[t]);for(t of wa)this[t]=new tr(t,Ce[t],e[t],this);for(t of fe)this[t]=new tr(t,Ce[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,fe,gs),e.tiff===!0?this.batchEnableWithBool(fe,!0):e.tiff===!1?this.batchEnableWithUserValue(fe,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,fe):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,fe)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=wc(e,r);for(let[o,a]of n)on(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=wc(t,r);for(let[o,a]of n)on(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=fe.some((n=>this[n].enabled===!0))||this.makerNote||this.userComment;for(let n of fe)this[n].finalizeFilters()}get onlyTiff(){return!dp.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of wa)this[e].enabled&&!we.has(e)&&fa("segment parser",e)}}function wc(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=Oe.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function bo(i,e){return i!==void 0?i:e!==void 0?e:void 0}function on(i,e){for(let t of e)i.add(t)}j(sl,"default",Ce);class C3{constructor(e){j(this,"parsers",{}),j(this,"output",{}),j(this,"errors",[]),j(this,"pushToErrors",(t=>this.errors.push(t))),this.options=sl.useCached(e)}async read(e){this.file=await P3(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of Ci)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!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),nn(e)}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async r=>{let s=await r.parse();r.assignToOutput(e,s)}));this.options.silentErrors&&(t=t.map((r=>r.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=we.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}}class gn{constructor(e,t,r){j(this,"errors",[]),j(this,"ensureSegmentChunk",(async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){de(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):de("Segment unreachable: "+JSON.stringify(s));return s.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(we.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}class et{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new sl({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Ie?e:new Ie(e)}constructor(e,t={},r){j(this,"errors",[]),j(this,"raw",new Map),j(this,"handleError",(s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)})),this.chunk=this.normalizeInput(e),this.file=r,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 r=Ns.get(t),s=si.get(t),n=Oe.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,u=o.translateKeys&&!!n,d={};for(let[c,m]of e)a&&r.has(c)?m=r.get(c)(m):l&&s.has(c)&&(m=this.translateValue(m,s.get(c))),u&&n.has(c)&&(c=n.get(c)||c),d[c]=m;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}}j(et,"headerLength",4),j(et,"type",void 0),j(et,"multiSegment",!1),j(et,"canHandle",(()=>!1));function _3(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function T3(i){return i>=224&&i<=239}function E3(i,e,t){for(let[r,s]of we)if(s.canHandle(i,e,t))return r}class Sc extends gn{constructor(...e){super(...e),j(this,"appSegments",[]),j(this,"jpegSegments",[]),j(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(we.keyList())):(e=e===void 0?we.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&we.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:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some((a=>{let l=we.get(a),u=this.options[a];return l.multiSegment&&u.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,u=this.appSegments.some((d=>!this.file.available(d.offset||d.start,d.length||d.size)));if(a=e>l&&!u?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:u,findAll:d,wanted:c,remaining:m,options:w}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(r=u.getUint8(e+1),T3(r)){if(s=u.getUint16(e+2),n=E3(u,e,s),n&&c.has(n)&&(o=we.get(n),a=o.findPosition(u,e),l=w[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||m.delete(n)):m.delete(n),m.size===0)))break;w.recordUnknownSegments&&(a=et.findPosition(u,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(_3(r)){if(s=u.getUint16(e+2),r===218&&w.stopAfterSos!==!1)return;w.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,r])=>{let s=we.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[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}}j(Sc,"type","jpeg"),Ci.set("jpeg",Sc);const D3=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class x3 extends et{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,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=D3[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&de(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&de(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return Jt(s.getString(e,o));if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let l=new((function(d){switch(d){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(n))(o),u=a;for(let d=0;d<o;d++)l[d]=this.parseTagValue(n,e),e+=u;return l}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:de(`Invalid tiff type ${e}`)}}}class wo extends x3{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 r=new Map;return this[t]=r,this.parseTags(e,t,r),r}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.
47
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ha(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,ha(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 r=e.get(t);r&&r.length===1&&e.set(t,r[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",Pc(...e.get(2),e.get(1))),e.set("longitude",Pc(...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,r,s={};for(t of fe)if(e=this[t],!up(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}}function Pc(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}j(wo,"type","tiff"),j(wo,"headerLength",10),we.set("tiff",wo);const nl={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},nl,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},nl,{tiff:!1,ifd1:!0,mergeOutput:!1});const A3=Object.assign({},nl,{firstChunkSize:4e4,ifd0:[274]});async function I3(i){let e=new C3(A3);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const O3=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 ur=!0,cr=!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,r]=e;ur=Number(t)+.1*Number(r)<13.4,cr=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);ur=cr=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);ur=cr=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);ur=cr=Number(e)<77}}async function k3(i){let e=await I3(i);return Object.assign({canvas:ur,css:cr},O3[e])}class R3 extends Ie{constructor(...e){super(...e),j(this,"ranges",new U3),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=tl?el.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}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 U3{constructor(){j(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter((o=>Fc(e,o.offset,s)||Fc(e,o.end,s)));if(n.length>0){e=Math.min(e,...n.map((a=>a.offset))),s=Math.max(s,...n.map((a=>a.end))),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter((a=>!n.includes(a)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some((s=>s.offset<=e&&r<=s.end))}}function Fc(i,e,t){return i<=e&&e<=t}class mn extends R3{constructor(e,t){super(0),j(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,r=await this.readChunk(e,t);return!!r&&r.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(){}}xi.set("blob",class extends mn{async readWhole(){this.chunked=!1;let i=await va(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,r=this.input.slice(i,t),s=await va(r);return this.set(s,i,!0)}});xi.set("url",class extends mn{async readWhole(){this.chunked=!1;let i=await ya(this.input);i instanceof ArrayBuffer?this._swapArrayBuffer(i):i instanceof Uint8Array&&this._swapBuffer(i)}async _readChunk(i,e){let t=e?i+e-1:void 0,r=this.options.httpHeaders||{};(i||t)&&(r.range=`bytes=${[i,t].join("-")}`);let s=await il(this.input,{headers:r}),n=await s.arrayBuffer(),o=n.byteLength;if(s.status!==416)return o!==e&&(this.size=i+o),this.set(n,i,!0)}});Ie.prototype.getUint64=function(i){let e=this.getUint32(i),t=this.getUint32(i+4);return e<1048575?e<<32|t:typeof ps!==void 0?(console.warn("Using BigInt because of type 64uint but JS can only handle 53b numbers."),ps(e)<<ps(32)|ps(t)):void de("Trying to read 64b value but JS can only handle 53b numbers.")};class M3 extends gn{parseBoxes(e=0){let t=[];for(;e<this.file.byteLength-4;){let r=this.parseBoxHead(e);if(t.push(r),r.length===0)break;e+=r.length}return t}parseSubBoxes(e){e.boxes=this.parseBoxes(e.start)}findBox(e,t){return e.boxes===void 0&&this.parseSubBoxes(e),e.boxes.find((r=>r.kind===t))}parseBoxHead(e){let t=this.file.getUint32(e),r=this.file.getString(e+4,4),s=e+8;return t===1&&(t=this.file.getUint64(e+8),s+=8),{offset:e,length:t,kind:r,start:s}}parseBoxFullHead(e){if(e.version!==void 0)return;let t=this.file.getUint32(e.start);e.version=t>>24,e.start+=4}}class fp extends M3{static canHandle(e,t){if(t!==0)return!1;let r=e.getUint16(2);if(r>50)return!1;let s=16,n=[];for(;s<r;)n.push(e.getString(s,4)),s+=4;return n.includes(this.type)}async parse(){let e=this.file.getUint32(0),t=this.parseBoxHead(e);for(;t.kind!=="meta";)e+=t.length,await this.file.ensureChunk(e,16),t=this.parseBoxHead(e);await this.file.ensureChunk(t.offset,t.length),this.parseBoxFullHead(t),this.parseSubBoxes(t),this.options.icc.enabled&&await this.findIcc(t),this.options.tiff.enabled&&await this.findExif(t)}async registerSegment(e,t,r){await this.file.ensureChunk(t,r);let s=this.file.subarray(t,r);this.createParser(e,s)}async findIcc(e){let t=this.findBox(e,"iprp");if(t===void 0)return;let r=this.findBox(t,"ipco");if(r===void 0)return;let s=this.findBox(r,"colr");s!==void 0&&await this.registerSegment("icc",s.offset+12,s.length)}async findExif(e){let t=this.findBox(e,"iinf");if(t===void 0)return;let r=this.findBox(e,"iloc");if(r===void 0)return;let s=this.findExifLocIdInIinf(t),n=this.findExtentInIloc(r,s);if(n===void 0)return;let[o,a]=n;await this.file.ensureChunk(o,a);let l=4+this.file.getUint32(o);o+=l,a-=l,await this.registerSegment("tiff",o,a)}findExifLocIdInIinf(e){this.parseBoxFullHead(e);let t,r,s,n,o=e.start,a=this.file.getUint16(o);for(o+=2;a--;){if(t=this.parseBoxHead(o),this.parseBoxFullHead(t),r=t.start,t.version>=2&&(s=t.version===3?4:2,n=this.file.getString(r+s+2,4),n==="Exif"))return this.file.getUintBytes(r,s);o+=t.length}}get8bits(e){let t=this.file.getUint8(e);return[t>>4,15&t]}findExtentInIloc(e,t){this.parseBoxFullHead(e);let r=e.start,[s,n]=this.get8bits(r++),[o,a]=this.get8bits(r++),l=e.version===2?4:2,u=e.version===1||e.version===2?2:0,d=a+s+n,c=e.version===2?4:2,m=this.file.getUintBytes(r,c);for(r+=c;m--;){let w=this.file.getUintBytes(r,l);r+=l+u+2+o;let F=this.file.getUint16(r);if(r+=2,w===t)return F>1&&console.warn(`ILOC box has more than one extent but we're only processing one
48
+ Please create an issue at https://github.com/MikeKovarik/exifr with this file`),[this.file.getUintBytes(r+a,s),this.file.getUintBytes(r+a+s,n)];r+=F*d}}}class gp extends fp{}j(gp,"type","heic");class Cc extends fp{}j(Cc,"type","avif"),Ci.set("heic",gp),Ci.set("avif",Cc),be(Oe,["ifd0","ifd1"],[[256,"ImageWidth"],[257,"ImageHeight"],[258,"BitsPerSample"],[259,"Compression"],[262,"PhotometricInterpretation"],[270,"ImageDescription"],[271,"Make"],[272,"Model"],[273,"StripOffsets"],[274,"Orientation"],[277,"SamplesPerPixel"],[278,"RowsPerStrip"],[279,"StripByteCounts"],[282,"XResolution"],[283,"YResolution"],[284,"PlanarConfiguration"],[296,"ResolutionUnit"],[301,"TransferFunction"],[305,"Software"],[306,"ModifyDate"],[315,"Artist"],[316,"HostComputer"],[317,"Predictor"],[318,"WhitePoint"],[319,"PrimaryChromaticities"],[513,"ThumbnailOffset"],[514,"ThumbnailLength"],[529,"YCbCrCoefficients"],[530,"YCbCrSubSampling"],[531,"YCbCrPositioning"],[532,"ReferenceBlackWhite"],[700,"ApplicationNotes"],[33432,"Copyright"],[33723,"IPTC"],[34665,"ExifIFD"],[34675,"ICC"],[34853,"GpsIFD"],[330,"SubIFD"],[40965,"InteropIFD"],[40091,"XPTitle"],[40092,"XPComment"],[40093,"XPAuthor"],[40094,"XPKeywords"],[40095,"XPSubject"]]),be(Oe,"exif",[[33434,"ExposureTime"],[33437,"FNumber"],[34850,"ExposureProgram"],[34852,"SpectralSensitivity"],[34855,"ISO"],[34858,"TimeZoneOffset"],[34859,"SelfTimerMode"],[34864,"SensitivityType"],[34865,"StandardOutputSensitivity"],[34866,"RecommendedExposureIndex"],[34867,"ISOSpeed"],[34868,"ISOSpeedLatitudeyyy"],[34869,"ISOSpeedLatitudezzz"],[36864,"ExifVersion"],[36867,"DateTimeOriginal"],[36868,"CreateDate"],[36873,"GooglePlusUploadCode"],[36880,"OffsetTime"],[36881,"OffsetTimeOriginal"],[36882,"OffsetTimeDigitized"],[37121,"ComponentsConfiguration"],[37122,"CompressedBitsPerPixel"],[37377,"ShutterSpeedValue"],[37378,"ApertureValue"],[37379,"BrightnessValue"],[37380,"ExposureCompensation"],[37381,"MaxApertureValue"],[37382,"SubjectDistance"],[37383,"MeteringMode"],[37384,"LightSource"],[37385,"Flash"],[37386,"FocalLength"],[37393,"ImageNumber"],[37394,"SecurityClassification"],[37395,"ImageHistory"],[37396,"SubjectArea"],[37500,"MakerNote"],[37510,"UserComment"],[37520,"SubSecTime"],[37521,"SubSecTimeOriginal"],[37522,"SubSecTimeDigitized"],[37888,"AmbientTemperature"],[37889,"Humidity"],[37890,"Pressure"],[37891,"WaterDepth"],[37892,"Acceleration"],[37893,"CameraElevationAngle"],[40960,"FlashpixVersion"],[40961,"ColorSpace"],[40962,"ExifImageWidth"],[40963,"ExifImageHeight"],[40964,"RelatedSoundFile"],[41483,"FlashEnergy"],[41486,"FocalPlaneXResolution"],[41487,"FocalPlaneYResolution"],[41488,"FocalPlaneResolutionUnit"],[41492,"SubjectLocation"],[41493,"ExposureIndex"],[41495,"SensingMethod"],[41728,"FileSource"],[41729,"SceneType"],[41730,"CFAPattern"],[41985,"CustomRendered"],[41986,"ExposureMode"],[41987,"WhiteBalance"],[41988,"DigitalZoomRatio"],[41989,"FocalLengthIn35mmFormat"],[41990,"SceneCaptureType"],[41991,"GainControl"],[41992,"Contrast"],[41993,"Saturation"],[41994,"Sharpness"],[41996,"SubjectDistanceRange"],[42016,"ImageUniqueID"],[42032,"OwnerName"],[42033,"SerialNumber"],[42034,"LensInfo"],[42035,"LensMake"],[42036,"LensModel"],[42037,"LensSerialNumber"],[42080,"CompositeImage"],[42081,"CompositeImageCount"],[42082,"CompositeImageExposureTimes"],[42240,"Gamma"],[59932,"Padding"],[59933,"OffsetSchema"],[65e3,"OwnerName"],[65001,"SerialNumber"],[65002,"Lens"],[65100,"RawFile"],[65101,"Converter"],[65102,"WhiteBalance"],[65105,"Exposure"],[65106,"Shadows"],[65107,"Brightness"],[65108,"Contrast"],[65109,"Saturation"],[65110,"Sharpness"],[65111,"Smoothness"],[65112,"MoireFilter"],[40965,"InteropIFD"]]),be(Oe,"gps",[[0,"GPSVersionID"],[1,"GPSLatitudeRef"],[2,"GPSLatitude"],[3,"GPSLongitudeRef"],[4,"GPSLongitude"],[5,"GPSAltitudeRef"],[6,"GPSAltitude"],[7,"GPSTimeStamp"],[8,"GPSSatellites"],[9,"GPSStatus"],[10,"GPSMeasureMode"],[11,"GPSDOP"],[12,"GPSSpeedRef"],[13,"GPSSpeed"],[14,"GPSTrackRef"],[15,"GPSTrack"],[16,"GPSImgDirectionRef"],[17,"GPSImgDirection"],[18,"GPSMapDatum"],[19,"GPSDestLatitudeRef"],[20,"GPSDestLatitude"],[21,"GPSDestLongitudeRef"],[22,"GPSDestLongitude"],[23,"GPSDestBearingRef"],[24,"GPSDestBearing"],[25,"GPSDestDistanceRef"],[26,"GPSDestDistance"],[27,"GPSProcessingMethod"],[28,"GPSAreaInformation"],[29,"GPSDateStamp"],[30,"GPSDifferential"],[31,"GPSHPositioningError"]]),be(si,["ifd0","ifd1"],[[274,{1:"Horizontal (normal)",2:"Mirror horizontal",3:"Rotate 180",4:"Mirror vertical",5:"Mirror horizontal and rotate 270 CW",6:"Rotate 90 CW",7:"Mirror horizontal and rotate 90 CW",8:"Rotate 270 CW"}],[296,{1:"None",2:"inches",3:"cm"}]]);let Sr=be(si,"exif",[[34850,{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"}],[37121,{0:"-",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}],[37383,{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"}],[37384,{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"}],[37385,{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"}],[41495,{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"}],[41728,{1:"Film Scanner",2:"Reflection Print Scanner",3:"Digital Camera"}],[41729,{1:"Directly photographed"}],[41985,{0:"Normal",1:"Custom",2:"HDR (no original saved)",3:"HDR (original saved)",4:"Original (for HDR)",6:"Panorama",7:"Portrait HDR",8:"Portrait"}],[41986,{0:"Auto",1:"Manual",2:"Auto bracket"}],[41987,{0:"Auto",1:"Manual"}],[41990,{0:"Standard",1:"Landscape",2:"Portrait",3:"Night",4:"Other"}],[41991,{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"}],[41996,{0:"Unknown",1:"Macro",2:"Close",3:"Distant"}],[42080,{0:"Unknown",1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}]]);const _c={1:"No absolute unit of measurement",2:"Inch",3:"Centimeter"};Sr.set(37392,_c),Sr.set(41488,_c);const So={0:"Normal",1:"Low",2:"High"};function Tc(i){return typeof i=="object"&&i.length!==void 0?i[0]:i}function Ec(i){let e=Array.from(i).slice(1);return e[1]>15&&(e=e.map((t=>String.fromCharCode(t)))),e[2]!=="0"&&e[2]!==0||e.pop(),e.join(".")}function Po(i){if(typeof i=="string"){var[e,t,r,s,n,o]=i.trim().split(/[-: ]/g).map(Number),a=new Date(e,t-1,r);return Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(o)||(a.setHours(s),a.setMinutes(n),a.setSeconds(o)),Number.isNaN(+a)?i:a}}function ir(i){if(typeof i=="string")return i;let e=[];if(i[1]===0&&i[i.length-1]===0)for(let t=0;t<i.length;t+=2)e.push(Dc(i[t+1],i[t]));else for(let t=0;t<i.length;t+=2)e.push(Dc(i[t],i[t+1]));return Jt(String.fromCodePoint(...e))}function Dc(i,e){return i<<8|e}Sr.set(41992,So),Sr.set(41993,So),Sr.set(41994,So),be(Ns,["ifd0","ifd1"],[[50827,function(i){return typeof i!="string"?cp(i):i}],[306,Po],[40091,ir],[40092,ir],[40093,ir],[40094,ir],[40095,ir]]),be(Ns,"exif",[[40960,Ec],[36864,Ec],[36867,Po],[36868,Po],[40962,Tc],[40963,Tc]]),be(Ns,"gps",[[0,i=>Array.from(i).join(".")],[7,i=>Array.from(i).join(":")]]);class Fo extends et{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1752462448&&e.getString(t+4,20)==="http://ns.adobe.com/"}static headerLength(e,t){return e.getString(t+4,34)==="http://ns.adobe.com/xmp/extension/"?79:33}static findPosition(e,t){let r=super.findPosition(e,t);return r.multiSegment=r.extended=r.headerLength===79,r.multiSegment?(r.chunkCount=e.getUint8(t+72),r.chunkNumber=e.getUint8(t+76),e.getUint8(t+77)!==0&&r.chunkNumber++):(r.chunkCount=1/0,r.chunkNumber=-1),r}static handleMultiSegments(e){return e.map((t=>t.chunk.getString())).join("")}normalizeInput(e){return typeof e=="string"?e:Ie.from(e).getString()}parse(e=this.chunk){if(!this.localOptions.parse)return e;e=(function(n){let o={},a={};for(let l of bp)o[l]=[],a[l]=0;return n.replace(z3,((l,u,d)=>{if(u==="<"){let c=++a[d];return o[d].push(c),`${l}#${c}`}return`${l}#${o[d].pop()}`}))})(e);let t=wi.findAll(e,"rdf","Description");t.length===0&&t.push(new wi("rdf","Description",void 0,e));let r,s={};for(let n of t)for(let o of n.properties)r=N3(o.ns,s),mp(o,r);return(function(n){let o;for(let a in n)o=n[a]=nn(n[a]),o===void 0&&delete n[a];return nn(n)})(s)}assignToOutput(e,t){if(this.localOptions.parse)for(let[r,s]of Object.entries(t))switch(r){case"tiff":this.assignObjectToOutput(e,"ifd0",s);break;case"exif":this.assignObjectToOutput(e,"exif",s);break;case"xmlns":break;default:this.assignObjectToOutput(e,r,s)}else e.xmp=t}}j(Fo,"type","xmp"),j(Fo,"multiSegment",!0),we.set("xmp",Fo);class an{static findAll(e){return yp(e,/([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(an.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[3].slice(1,-1);return s=vp(s),new an(t,r,s)}constructor(e,t,r){this.ns=e,this.name=t,this.value=r}serialize(){return this.value}}class wi{static findAll(e,t,r){if(t!==void 0||r!==void 0){t=t||"[\\w\\d-]+",r=r||"[\\w\\d-]+";var s=new RegExp(`<(${t}):(${r})(#\\d+)?((\\s+?[\\w\\d-:]+=("[^"]*"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)`,"gm")}else s=/<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;return yp(e,s).map(wi.unpackMatch)}static unpackMatch(e){let t=e[1],r=e[2],s=e[4],n=e[8];return new wi(t,r,s,n)}constructor(e,t,r,s){this.ns=e,this.name=t,this.attrString=r,this.innerXml=s,this.attrs=an.findAll(r),this.children=wi.findAll(s),this.value=this.children.length===0?vp(s):void 0,this.properties=[...this.attrs,...this.children]}get isPrimitive(){return this.value!==void 0&&this.attrs.length===0&&this.children.length===0}get isListContainer(){return this.children.length===1&&this.children[0].isList}get isList(){let{ns:e,name:t}=this;return e==="rdf"&&(t==="Seq"||t==="Bag"||t==="Alt")}get isListItem(){return this.ns==="rdf"&&this.name==="li"}serialize(){if(this.properties.length===0&&this.value===void 0)return;if(this.isPrimitive)return this.value;if(this.isListContainer)return this.children[0].serialize();if(this.isList)return L3(this.children.map(B3));if(this.isListItem&&this.children.length===1&&this.attrs.length===0)return this.children[0].serialize();let e={};for(let t of this.properties)mp(t,e);return this.value!==void 0&&(e.value=this.value),nn(e)}}function mp(i,e){let t=i.serialize();t!==void 0&&(e[i.name]=t)}var B3=i=>i.serialize(),L3=i=>i.length===1?i[0]:i,N3=(i,e)=>e[i]?e[i]:e[i]={};function yp(i,e){let t,r=[];if(!i)return r;for(;(t=e.exec(i))!==null;)r.push(t);return r}function vp(i){if((function(r){return r==null||r==="null"||r==="undefined"||r===""||r.trim()===""})(i))return;let e=Number(i);if(!Number.isNaN(e))return e;let t=i.toLowerCase();return t==="true"||t!=="false"&&i.trim()}const bp=["rdf:li","rdf:Seq","rdf:Bag","rdf:Alt","rdf:Description"],z3=new RegExp(`(<|\\/)(${bp.join("|")})`,"g");let xc=sn("fs",(i=>i.promises));xi.set("fs",class extends mn{async readWhole(){this.chunked=!1,this.fs=await xc;let i=await this.fs.readFile(this.input);this._swapBuffer(i)}async readChunked(){this.chunked=!0,this.fs=await xc,await this.open(),await this.readChunk(0,this.options.firstChunkSize)}async open(){this.fh===void 0&&(this.fh=await this.fs.open(this.input,"r"),this.size=(await this.fh.stat(this.input)).size)}async _readChunk(i,e){this.fh===void 0&&await this.open(),i+e>this.size&&(e=this.size-i);var t=this.subarray(i,e,!0);return await this.fh.read(t.dataView,0,e,i),t}async close(){if(this.fh){let i=this.fh;this.fh=void 0,await i.close()}}});xi.set("base64",class extends mn{constructor(...i){super(...i),this.input=this.input.replace(/^data:([^;]+);base64,/gim,""),this.size=this.input.length/4*3,this.input.endsWith("==")?this.size-=2:this.input.endsWith("=")&&(this.size-=1)}async _readChunk(i,e){let t,r,s=this.input;i===void 0?(i=0,t=0,r=0):(t=4*Math.floor(i/3),r=i-t/4*3),e===void 0&&(e=this.size);let n=i+e,o=t+4*Math.ceil(n/3);s=s.slice(t,o);let a=Math.min(e,this.size-i);if(tl){let l=el.from(s,"base64").slice(r,r+a);return this.set(l,i,!0)}{let l=this.subarray(i,a,!0),u=atob(s),d=l.toUint8();for(let c=0;c<a;c++)d[c]=u.charCodeAt(r+c);return l}}});class Ac extends gn{static canHandle(e,t){return t===18761||t===19789}extendOptions(e){let{ifd0:t,xmp:r,iptc:s,icc:n}=e;r.enabled&&t.deps.add(700),s.enabled&&t.deps.add(33723),n.enabled&&t.deps.add(34675),t.finalizeFilters()}async parse(){let{tiff:e,xmp:t,iptc:r,icc:s}=this.options;if(e.enabled||t.enabled||r.enabled||s.enabled){let n=Math.max(ha(this.options),this.options.chunkSize);await this.file.ensureChunk(0,n),this.createParser("tiff",this.file),this.parsers.tiff.parseHeader(),await this.parsers.tiff.parseIfd0Block(),this.adaptTiffPropAsSegment("xmp"),this.adaptTiffPropAsSegment("iptc"),this.adaptTiffPropAsSegment("icc")}}adaptTiffPropAsSegment(e){if(this.parsers.tiff[e]){let t=this.parsers.tiff[e];this.injectSegment(e,t)}}}j(Ac,"type","tiff"),Ci.set("tiff",Ac);let $3=sn("zlib");const j3=["ihdr","iccp","text","itxt","exif"];class Ic extends gn{constructor(...e){super(...e),j(this,"catchError",(t=>this.errors.push(t))),j(this,"metaChunks",[]),j(this,"unknownChunks",[])}static canHandle(e,t){return t===35152&&e.getUint32(0)===2303741511&&e.getUint32(4)===218765834}async parse(){let{file:e}=this;await this.findPngChunksInRange(8,e.byteLength),await this.readSegments(this.metaChunks),this.findIhdr(),this.parseTextChunks(),await this.findExif().catch(this.catchError),await this.findXmp().catch(this.catchError),await this.findIcc().catch(this.catchError)}async findPngChunksInRange(e,t){let{file:r}=this;for(;e<t;){let s=r.getUint32(e),n=r.getUint32(e+4),o=r.getString(e+4,4).toLowerCase(),a=s+4+4+4,l={type:o,offset:e,length:a,start:e+4+4,size:s,marker:n};j3.includes(o)?this.metaChunks.push(l):this.unknownChunks.push(l),e+=a}}parseTextChunks(){let e=this.metaChunks.filter((t=>t.type==="text"));for(let t of e){let[r,s]=this.file.getString(t.start,t.size).split("\0");this.injectKeyValToIhdr(r,s)}}injectKeyValToIhdr(e,t){let r=this.parsers.ihdr;r&&r.raw.set(e,t)}findIhdr(){let e=this.metaChunks.find((t=>t.type==="ihdr"));e&&this.options.ihdr.enabled!==!1&&this.createParser("ihdr",e.chunk)}async findExif(){let e=this.metaChunks.find((t=>t.type==="exif"));e&&this.injectSegment("tiff",e.chunk)}async findXmp(){let e=this.metaChunks.filter((t=>t.type==="itxt"));for(let t of e)t.chunk.getString(0,17)==="XML:com.adobe.xmp"&&this.injectSegment("xmp",t.chunk)}async findIcc(){let e=this.metaChunks.find((a=>a.type==="iccp"));if(!e)return;let{chunk:t}=e,r=t.getUint8Array(0,81),s=0;for(;s<80&&r[s]!==0;)s++;let n=s+2,o=t.getString(0,s);if(this.injectKeyValToIhdr("ProfileName",o),rn){let a=await $3,l=t.getUint8Array(n);l=a.inflateSync(l),this.injectSegment("icc",l)}}}j(Ic,"type","png"),Ci.set("png",Ic),be(Oe,"interop",[[1,"InteropIndex"],[2,"InteropVersion"],[4096,"RelatedImageFileFormat"],[4097,"RelatedImageWidth"],[4098,"RelatedImageHeight"]]),ba(Oe,"ifd0",[[11,"ProcessingSoftware"],[254,"SubfileType"],[255,"OldSubfileType"],[263,"Thresholding"],[264,"CellWidth"],[265,"CellLength"],[266,"FillOrder"],[269,"DocumentName"],[280,"MinSampleValue"],[281,"MaxSampleValue"],[285,"PageName"],[286,"XPosition"],[287,"YPosition"],[290,"GrayResponseUnit"],[297,"PageNumber"],[321,"HalftoneHints"],[322,"TileWidth"],[323,"TileLength"],[332,"InkSet"],[337,"TargetPrinter"],[18246,"Rating"],[18249,"RatingPercent"],[33550,"PixelScale"],[34264,"ModelTransform"],[34377,"PhotoshopSettings"],[50706,"DNGVersion"],[50707,"DNGBackwardVersion"],[50708,"UniqueCameraModel"],[50709,"LocalizedCameraModel"],[50736,"DNGLensInfo"],[50739,"ShadowScale"],[50740,"DNGPrivateData"],[33920,"IntergraphMatrix"],[33922,"ModelTiePoint"],[34118,"SEMInfo"],[34735,"GeoTiffDirectory"],[34736,"GeoTiffDoubleParams"],[34737,"GeoTiffAsciiParams"],[50341,"PrintIM"],[50721,"ColorMatrix1"],[50722,"ColorMatrix2"],[50723,"CameraCalibration1"],[50724,"CameraCalibration2"],[50725,"ReductionMatrix1"],[50726,"ReductionMatrix2"],[50727,"AnalogBalance"],[50728,"AsShotNeutral"],[50729,"AsShotWhiteXY"],[50730,"BaselineExposure"],[50731,"BaselineNoise"],[50732,"BaselineSharpness"],[50734,"LinearResponseLimit"],[50735,"CameraSerialNumber"],[50741,"MakerNoteSafety"],[50778,"CalibrationIlluminant1"],[50779,"CalibrationIlluminant2"],[50781,"RawDataUniqueID"],[50827,"OriginalRawFileName"],[50828,"OriginalRawFileData"],[50831,"AsShotICCProfile"],[50832,"AsShotPreProfileMatrix"],[50833,"CurrentICCProfile"],[50834,"CurrentPreProfileMatrix"],[50879,"ColorimetricReference"],[50885,"SRawType"],[50898,"PanasonicTitle"],[50899,"PanasonicTitle2"],[50931,"CameraCalibrationSig"],[50932,"ProfileCalibrationSig"],[50933,"ProfileIFD"],[50934,"AsShotProfileName"],[50936,"ProfileName"],[50937,"ProfileHueSatMapDims"],[50938,"ProfileHueSatMapData1"],[50939,"ProfileHueSatMapData2"],[50940,"ProfileToneCurve"],[50941,"ProfileEmbedPolicy"],[50942,"ProfileCopyright"],[50964,"ForwardMatrix1"],[50965,"ForwardMatrix2"],[50966,"PreviewApplicationName"],[50967,"PreviewApplicationVersion"],[50968,"PreviewSettingsName"],[50969,"PreviewSettingsDigest"],[50970,"PreviewColorSpace"],[50971,"PreviewDateTime"],[50972,"RawImageDigest"],[50973,"OriginalRawFileDigest"],[50981,"ProfileLookTableDims"],[50982,"ProfileLookTableData"],[51043,"TimeCodes"],[51044,"FrameRate"],[51058,"TStop"],[51081,"ReelName"],[51089,"OriginalDefaultFinalSize"],[51090,"OriginalBestQualitySize"],[51091,"OriginalDefaultCropSize"],[51105,"CameraLabel"],[51107,"ProfileHueSatMapEncoding"],[51108,"ProfileLookTableEncoding"],[51109,"BaselineExposureOffset"],[51110,"DefaultBlackRender"],[51111,"NewRawImageDigest"],[51112,"RawToPreviewGain"]]);let Oc=[[273,"StripOffsets"],[279,"StripByteCounts"],[288,"FreeOffsets"],[289,"FreeByteCounts"],[291,"GrayResponseCurve"],[292,"T4Options"],[293,"T6Options"],[300,"ColorResponseUnit"],[320,"ColorMap"],[324,"TileOffsets"],[325,"TileByteCounts"],[326,"BadFaxLines"],[327,"CleanFaxData"],[328,"ConsecutiveBadFaxLines"],[330,"SubIFD"],[333,"InkNames"],[334,"NumberofInks"],[336,"DotRange"],[338,"ExtraSamples"],[339,"SampleFormat"],[340,"SMinSampleValue"],[341,"SMaxSampleValue"],[342,"TransferRange"],[343,"ClipPath"],[344,"XClipPathUnits"],[345,"YClipPathUnits"],[346,"Indexed"],[347,"JPEGTables"],[351,"OPIProxy"],[400,"GlobalParametersIFD"],[401,"ProfileType"],[402,"FaxProfile"],[403,"CodingMethods"],[404,"VersionYear"],[405,"ModeNumber"],[433,"Decode"],[434,"DefaultImageColor"],[435,"T82Options"],[437,"JPEGTables"],[512,"JPEGProc"],[515,"JPEGRestartInterval"],[517,"JPEGLosslessPredictors"],[518,"JPEGPointTransforms"],[519,"JPEGQTables"],[520,"JPEGDCTables"],[521,"JPEGACTables"],[559,"StripRowCounts"],[999,"USPTOMiscellaneous"],[18247,"XP_DIP_XML"],[18248,"StitchInfo"],[28672,"SonyRawFileType"],[28688,"SonyToneCurve"],[28721,"VignettingCorrection"],[28722,"VignettingCorrParams"],[28724,"ChromaticAberrationCorrection"],[28725,"ChromaticAberrationCorrParams"],[28726,"DistortionCorrection"],[28727,"DistortionCorrParams"],[29895,"SonyCropTopLeft"],[29896,"SonyCropSize"],[32781,"ImageID"],[32931,"WangTag1"],[32932,"WangAnnotation"],[32933,"WangTag3"],[32934,"WangTag4"],[32953,"ImageReferencePoints"],[32954,"RegionXformTackPoint"],[32955,"WarpQuadrilateral"],[32956,"AffineTransformMat"],[32995,"Matteing"],[32996,"DataType"],[32997,"ImageDepth"],[32998,"TileDepth"],[33300,"ImageFullWidth"],[33301,"ImageFullHeight"],[33302,"TextureFormat"],[33303,"WrapModes"],[33304,"FovCot"],[33305,"MatrixWorldToScreen"],[33306,"MatrixWorldToCamera"],[33405,"Model2"],[33421,"CFARepeatPatternDim"],[33422,"CFAPattern2"],[33423,"BatteryLevel"],[33424,"KodakIFD"],[33445,"MDFileTag"],[33446,"MDScalePixel"],[33447,"MDColorTable"],[33448,"MDLabName"],[33449,"MDSampleInfo"],[33450,"MDPrepDate"],[33451,"MDPrepTime"],[33452,"MDFileUnits"],[33589,"AdventScale"],[33590,"AdventRevision"],[33628,"UIC1Tag"],[33629,"UIC2Tag"],[33630,"UIC3Tag"],[33631,"UIC4Tag"],[33918,"IntergraphPacketData"],[33919,"IntergraphFlagRegisters"],[33921,"INGRReserved"],[34016,"Site"],[34017,"ColorSequence"],[34018,"IT8Header"],[34019,"RasterPadding"],[34020,"BitsPerRunLength"],[34021,"BitsPerExtendedRunLength"],[34022,"ColorTable"],[34023,"ImageColorIndicator"],[34024,"BackgroundColorIndicator"],[34025,"ImageColorValue"],[34026,"BackgroundColorValue"],[34027,"PixelIntensityRange"],[34028,"TransparencyIndicator"],[34029,"ColorCharacterization"],[34030,"HCUsage"],[34031,"TrapIndicator"],[34032,"CMYKEquivalent"],[34152,"AFCP_IPTC"],[34232,"PixelMagicJBIGOptions"],[34263,"JPLCartoIFD"],[34306,"WB_GRGBLevels"],[34310,"LeafData"],[34687,"TIFF_FXExtensions"],[34688,"MultiProfiles"],[34689,"SharedData"],[34690,"T88Options"],[34732,"ImageLayer"],[34750,"JBIGOptions"],[34856,"Opto-ElectricConvFactor"],[34857,"Interlace"],[34908,"FaxRecvParams"],[34909,"FaxSubAddress"],[34910,"FaxRecvTime"],[34929,"FedexEDR"],[34954,"LeafSubIFD"],[37387,"FlashEnergy"],[37388,"SpatialFrequencyResponse"],[37389,"Noise"],[37390,"FocalPlaneXResolution"],[37391,"FocalPlaneYResolution"],[37392,"FocalPlaneResolutionUnit"],[37397,"ExposureIndex"],[37398,"TIFF-EPStandardID"],[37399,"SensingMethod"],[37434,"CIP3DataFile"],[37435,"CIP3Sheet"],[37436,"CIP3Side"],[37439,"StoNits"],[37679,"MSDocumentText"],[37680,"MSPropertySetStorage"],[37681,"MSDocumentTextPosition"],[37724,"ImageSourceData"],[40965,"InteropIFD"],[40976,"SamsungRawPointersOffset"],[40977,"SamsungRawPointersLength"],[41217,"SamsungRawByteOrder"],[41218,"SamsungRawUnknown"],[41484,"SpatialFrequencyResponse"],[41485,"Noise"],[41489,"ImageNumber"],[41490,"SecurityClassification"],[41491,"ImageHistory"],[41494,"TIFF-EPStandardID"],[41995,"DeviceSettingDescription"],[42112,"GDALMetadata"],[42113,"GDALNoData"],[44992,"ExpandSoftware"],[44993,"ExpandLens"],[44994,"ExpandFilm"],[44995,"ExpandFilterLens"],[44996,"ExpandScanner"],[44997,"ExpandFlashLamp"],[46275,"HasselbladRawImage"],[48129,"PixelFormat"],[48130,"Transformation"],[48131,"Uncompressed"],[48132,"ImageType"],[48256,"ImageWidth"],[48257,"ImageHeight"],[48258,"WidthResolution"],[48259,"HeightResolution"],[48320,"ImageOffset"],[48321,"ImageByteCount"],[48322,"AlphaOffset"],[48323,"AlphaByteCount"],[48324,"ImageDataDiscard"],[48325,"AlphaDataDiscard"],[50215,"OceScanjobDesc"],[50216,"OceApplicationSelector"],[50217,"OceIDNumber"],[50218,"OceImageLogic"],[50255,"Annotations"],[50459,"HasselbladExif"],[50547,"OriginalFileName"],[50560,"USPTOOriginalContentType"],[50656,"CR2CFAPattern"],[50710,"CFAPlaneColor"],[50711,"CFALayout"],[50712,"LinearizationTable"],[50713,"BlackLevelRepeatDim"],[50714,"BlackLevel"],[50715,"BlackLevelDeltaH"],[50716,"BlackLevelDeltaV"],[50717,"WhiteLevel"],[50718,"DefaultScale"],[50719,"DefaultCropOrigin"],[50720,"DefaultCropSize"],[50733,"BayerGreenSplit"],[50737,"ChromaBlurRadius"],[50738,"AntiAliasStrength"],[50752,"RawImageSegmentation"],[50780,"BestQualityScale"],[50784,"AliasLayerMetadata"],[50829,"ActiveArea"],[50830,"MaskedAreas"],[50935,"NoiseReductionApplied"],[50974,"SubTileBlockSize"],[50975,"RowInterleaveFactor"],[51008,"OpcodeList1"],[51009,"OpcodeList2"],[51022,"OpcodeList3"],[51041,"NoiseProfile"],[51114,"CacheVersion"],[51125,"DefaultUserCrop"],[51157,"NikonNEFInfo"],[65024,"KdcIFD"]];ba(Oe,"ifd0",Oc),ba(Oe,"exif",Oc),be(si,"gps",[[23,{M:"Magnetic North",T:"True North"}],[25,{K:"Kilometers",M:"Miles",N:"Nautical Miles"}]]);class Co extends et{static canHandle(e,t){return e.getUint8(t+1)===224&&e.getUint32(t+4)===1246120262&&e.getUint8(t+8)===0}parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint16(0)],[2,this.chunk.getUint8(2)],[3,this.chunk.getUint16(3)],[5,this.chunk.getUint16(5)],[7,this.chunk.getUint8(7)],[8,this.chunk.getUint8(8)]])}}j(Co,"type","jfif"),j(Co,"headerLength",9),we.set("jfif",Co),be(Oe,"jfif",[[0,"JFIFVersion"],[2,"ResolutionUnit"],[3,"XResolution"],[5,"YResolution"],[7,"ThumbnailWidth"],[8,"ThumbnailHeight"]]);class kc extends et{parse(){return this.parseTags(),this.translate(),this.output}parseTags(){this.raw=new Map([[0,this.chunk.getUint32(0)],[4,this.chunk.getUint32(4)],[8,this.chunk.getUint8(8)],[9,this.chunk.getUint8(9)],[10,this.chunk.getUint8(10)],[11,this.chunk.getUint8(11)],[12,this.chunk.getUint8(12)],...Array.from(this.raw)])}}j(kc,"type","ihdr"),we.set("ihdr",kc),be(Oe,"ihdr",[[0,"ImageWidth"],[4,"ImageHeight"],[8,"BitDepth"],[9,"ColorType"],[10,"Compression"],[11,"Filter"],[12,"Interlace"]]),be(si,"ihdr",[[9,{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha",DEFAULT:"Unknown"}],[10,{0:"Deflate/Inflate",DEFAULT:"Unknown"}],[11,{0:"Adaptive",DEFAULT:"Unknown"}],[12,{0:"Noninterlaced",1:"Adam7 Interlace",DEFAULT:"Unknown"}]]);class zs extends et{static canHandle(e,t){return e.getUint8(t+1)===226&&e.getUint32(t+4)===1229144927}static findPosition(e,t){let r=super.findPosition(e,t);return r.chunkNumber=e.getUint8(t+16),r.chunkCount=e.getUint8(t+17),r.multiSegment=r.chunkCount>1,r}static handleMultiSegments(e){return(function(t){let r=(function(s){let n=s[0].constructor,o=0;for(let u of s)o+=u.length;let a=new n(o),l=0;for(let u of s)a.set(u,l),l+=u.length;return a})(t.map((s=>s.chunk.toUint8())));return new Ie(r)})(e)}parse(){return this.raw=new Map,this.parseHeader(),this.parseTags(),this.translate(),this.output}parseHeader(){let{raw:e}=this;this.chunk.byteLength<84&&de("ICC header is too short");for(let[t,r]of Object.entries(H3)){t=parseInt(t,10);let s=r(this.chunk,t);s!=="\0\0\0\0"&&e.set(t,s)}}parseTags(){let e,t,r,s,n,{raw:o}=this,a=this.chunk.getUint32(128),l=132,u=this.chunk.byteLength;for(;a--;){if(e=this.chunk.getString(l,4),t=this.chunk.getUint32(l+4),r=this.chunk.getUint32(l+8),s=this.chunk.getString(t,4),t+r>u)return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");n=this.parseTag(s,t,r),n!==void 0&&n!=="\0\0\0\0"&&o.set(e,n),l+=12}}parseTag(e,t,r){switch(e){case"desc":return this.parseDesc(t);case"mluc":return this.parseMluc(t);case"text":return this.parseText(t,r);case"sig ":return this.parseSig(t)}if(!(t+r>this.chunk.byteLength))return this.chunk.getUint8Array(t,r)}parseDesc(e){let t=this.chunk.getUint32(e+8)-1;return Jt(this.chunk.getString(e+12,t))}parseText(e,t){return Jt(this.chunk.getString(e+8,t-8))}parseSig(e){return Jt(this.chunk.getString(e+8,4))}parseMluc(e){let{chunk:t}=this,r=t.getUint32(e+8),s=t.getUint32(e+12),n=e+16,o=[];for(let a=0;a<r;a++){let l=t.getString(n+0,2),u=t.getString(n+2,2),d=t.getUint32(n+4),c=t.getUint32(n+8)+e,m=Jt(t.getUnicodeString(c,d));o.push({lang:l,country:u,text:m}),n+=s}return r===1?o[0].text:o}translateValue(e,t){return typeof e=="string"?t[e]||t[e.toLowerCase()]||e:t[e]||e}}j(zs,"type","icc"),j(zs,"multiSegment",!0),j(zs,"headerLength",18);const H3={4:yt,8:function(i,e){return[i.getUint8(e),i.getUint8(e+1)>>4,i.getUint8(e+1)%16].map((t=>t.toString(10))).join(".")},12:yt,16:yt,20:yt,24:function(i,e){const t=i.getUint16(e),r=i.getUint16(e+2)-1,s=i.getUint16(e+4),n=i.getUint16(e+6),o=i.getUint16(e+8),a=i.getUint16(e+10);return new Date(Date.UTC(t,r,s,n,o,a))},36:yt,40:yt,48:yt,52:yt,64:(i,e)=>i.getUint32(e),80:yt};function yt(i,e){return Jt(i.getString(e,4))}we.set("icc",zs),be(Oe,"icc",[[4,"ProfileCMMType"],[8,"ProfileVersion"],[12,"ProfileClass"],[16,"ColorSpaceData"],[20,"ProfileConnectionSpace"],[24,"ProfileDateTime"],[36,"ProfileFileSignature"],[40,"PrimaryPlatform"],[44,"CMMFlags"],[48,"DeviceManufacturer"],[52,"DeviceModel"],[56,"DeviceAttributes"],[64,"RenderingIntent"],[68,"ConnectionSpaceIlluminant"],[80,"ProfileCreator"],[84,"ProfileID"],["Header","ProfileHeader"],["MS00","WCSProfiles"],["bTRC","BlueTRC"],["bXYZ","BlueMatrixColumn"],["bfd","UCRBG"],["bkpt","MediaBlackPoint"],["calt","CalibrationDateTime"],["chad","ChromaticAdaptation"],["chrm","Chromaticity"],["ciis","ColorimetricIntentImageState"],["clot","ColorantTableOut"],["clro","ColorantOrder"],["clrt","ColorantTable"],["cprt","ProfileCopyright"],["crdi","CRDInfo"],["desc","ProfileDescription"],["devs","DeviceSettings"],["dmdd","DeviceModelDesc"],["dmnd","DeviceMfgDesc"],["dscm","ProfileDescriptionML"],["fpce","FocalPlaneColorimetryEstimates"],["gTRC","GreenTRC"],["gXYZ","GreenMatrixColumn"],["gamt","Gamut"],["kTRC","GrayTRC"],["lumi","Luminance"],["meas","Measurement"],["meta","Metadata"],["mmod","MakeAndModel"],["ncl2","NamedColor2"],["ncol","NamedColor"],["ndin","NativeDisplayInfo"],["pre0","Preview0"],["pre1","Preview1"],["pre2","Preview2"],["ps2i","PS2RenderingIntent"],["ps2s","PostScript2CSA"],["psd0","PostScript2CRD0"],["psd1","PostScript2CRD1"],["psd2","PostScript2CRD2"],["psd3","PostScript2CRD3"],["pseq","ProfileSequenceDesc"],["psid","ProfileSequenceIdentifier"],["psvm","PS2CRDVMSize"],["rTRC","RedTRC"],["rXYZ","RedMatrixColumn"],["resp","OutputResponse"],["rhoc","ReflectionHardcopyOrigColorimetry"],["rig0","PerceptualRenderingIntentGamut"],["rig2","SaturationRenderingIntentGamut"],["rpoc","ReflectionPrintOutputColorimetry"],["sape","SceneAppearanceEstimates"],["scoe","SceneColorimetryEstimates"],["scrd","ScreeningDesc"],["scrn","Screening"],["targ","CharTarget"],["tech","Technology"],["vcgt","VideoCardGamma"],["view","ViewingConditions"],["vued","ViewingCondDesc"],["wtpt","MediaWhitePoint"]]);const vs={"4d2p":"Erdt Systems",AAMA:"Aamazing Technologies",ACER:"Acer",ACLT:"Acolyte Color Research",ACTI:"Actix Sytems",ADAR:"Adara Technology",ADBE:"Adobe",ADI:"ADI Systems",AGFA:"Agfa Graphics",ALMD:"Alps Electric",ALPS:"Alps Electric",ALWN:"Alwan Color Expertise",AMTI:"Amiable Technologies",AOC:"AOC International",APAG:"Apago",APPL:"Apple Computer",AST:"AST","AT&T":"AT&T",BAEL:"BARBIERI electronic",BRCO:"Barco NV",BRKP:"Breakpoint",BROT:"Brother",BULL:"Bull",BUS:"Bus Computer Systems","C-IT":"C-Itoh",CAMR:"Intel",CANO:"Canon",CARR:"Carroll Touch",CASI:"Casio",CBUS:"Colorbus PL",CEL:"Crossfield",CELx:"Crossfield",CGS:"CGS Publishing Technologies International",CHM:"Rochester Robotics",CIGL:"Colour Imaging Group, London",CITI:"Citizen",CL00:"Candela",CLIQ:"Color IQ",CMCO:"Chromaco",CMiX:"CHROMiX",COLO:"Colorgraphic Communications",COMP:"Compaq",COMp:"Compeq/Focus Technology",CONR:"Conrac Display Products",CORD:"Cordata Technologies",CPQ:"Compaq",CPRO:"ColorPro",CRN:"Cornerstone",CTX:"CTX International",CVIS:"ColorVision",CWC:"Fujitsu Laboratories",DARI:"Darius Technology",DATA:"Dataproducts",DCP:"Dry Creek Photo",DCRC:"Digital Contents Resource Center, Chung-Ang University",DELL:"Dell Computer",DIC:"Dainippon Ink and Chemicals",DICO:"Diconix",DIGI:"Digital","DL&C":"Digital Light & Color",DPLG:"Doppelganger",DS:"Dainippon Screen",DSOL:"DOOSOL",DUPN:"DuPont",EPSO:"Epson",ESKO:"Esko-Graphics",ETRI:"Electronics and Telecommunications Research Institute",EVER:"Everex Systems",EXAC:"ExactCODE",Eizo:"Eizo",FALC:"Falco Data Products",FF:"Fuji Photo Film",FFEI:"FujiFilm Electronic Imaging",FNRD:"Fnord Software",FORA:"Fora",FORE:"Forefront Technology",FP:"Fujitsu",FPA:"WayTech Development",FUJI:"Fujitsu",FX:"Fuji Xerox",GCC:"GCC Technologies",GGSL:"Global Graphics Software",GMB:"Gretagmacbeth",GMG:"GMG",GOLD:"GoldStar Technology",GOOG:"Google",GPRT:"Giantprint",GTMB:"Gretagmacbeth",GVC:"WayTech Development",GW2K:"Sony",HCI:"HCI",HDM:"Heidelberger Druckmaschinen",HERM:"Hermes",HITA:"Hitachi America",HP:"Hewlett-Packard",HTC:"Hitachi",HiTi:"HiTi Digital",IBM:"IBM",IDNT:"Scitex",IEC:"Hewlett-Packard",IIYA:"Iiyama North America",IKEG:"Ikegami Electronics",IMAG:"Image Systems",IMI:"Ingram Micro",INTC:"Intel",INTL:"N/A (INTL)",INTR:"Intra Electronics",IOCO:"Iocomm International Technology",IPS:"InfoPrint Solutions Company",IRIS:"Scitex",ISL:"Ichikawa Soft Laboratory",ITNL:"N/A (ITNL)",IVM:"IVM",IWAT:"Iwatsu Electric",Idnt:"Scitex",Inca:"Inca Digital Printers",Iris:"Scitex",JPEG:"Joint Photographic Experts Group",JSFT:"Jetsoft Development",JVC:"JVC Information Products",KART:"Scitex",KFC:"KFC Computek Components",KLH:"KLH Computers",KMHD:"Konica Minolta",KNCA:"Konica",KODA:"Kodak",KYOC:"Kyocera",Kart:"Scitex",LCAG:"Leica",LCCD:"Leeds Colour",LDAK:"Left Dakota",LEAD:"Leading Technology",LEXM:"Lexmark International",LINK:"Link Computer",LINO:"Linotronic",LITE:"Lite-On",Leaf:"Leaf",Lino:"Linotronic",MAGC:"Mag Computronic",MAGI:"MAG Innovision",MANN:"Mannesmann",MICN:"Micron Technology",MICR:"Microtek",MICV:"Microvitec",MINO:"Minolta",MITS:"Mitsubishi Electronics America",MITs:"Mitsuba",MNLT:"Minolta",MODG:"Modgraph",MONI:"Monitronix",MONS:"Monaco Systems",MORS:"Morse Technology",MOTI:"Motive Systems",MSFT:"Microsoft",MUTO:"MUTOH INDUSTRIES",Mits:"Mitsubishi Electric",NANA:"NANAO",NEC:"NEC",NEXP:"NexPress Solutions",NISS:"Nissei Sangyo America",NKON:"Nikon",NONE:"none",OCE:"Oce Technologies",OCEC:"OceColor",OKI:"Oki",OKID:"Okidata",OKIP:"Okidata",OLIV:"Olivetti",OLYM:"Olympus",ONYX:"Onyx Graphics",OPTI:"Optiquest",PACK:"Packard Bell",PANA:"Matsushita Electric Industrial",PANT:"Pantone",PBN:"Packard Bell",PFU:"PFU",PHIL:"Philips Consumer Electronics",PNTX:"HOYA",POne:"Phase One A/S",PREM:"Premier Computer Innovations",PRIN:"Princeton Graphic Systems",PRIP:"Princeton Publishing Labs",QLUX:"Hong Kong",QMS:"QMS",QPCD:"QPcard AB",QUAD:"QuadLaser",QUME:"Qume",RADI:"Radius",RDDx:"Integrated Color Solutions",RDG:"Roland DG",REDM:"REDMS Group",RELI:"Relisys",RGMS:"Rolf Gierling Multitools",RICO:"Ricoh",RNLD:"Edmund Ronald",ROYA:"Royal",RPC:"Ricoh Printing Systems",RTL:"Royal Information Electronics",SAMP:"Sampo",SAMS:"Samsung",SANT:"Jaime Santana Pomares",SCIT:"Scitex",SCRN:"Dainippon Screen",SDP:"Scitex",SEC:"Samsung",SEIK:"Seiko Instruments",SEIk:"Seikosha",SGUY:"ScanGuy.com",SHAR:"Sharp Laboratories",SICC:"International Color Consortium",SONY:"Sony",SPCL:"SpectraCal",STAR:"Star",STC:"Sampo Technology",Scit:"Scitex",Sdp:"Scitex",Sony:"Sony",TALO:"Talon Technology",TAND:"Tandy",TATU:"Tatung",TAXA:"TAXAN America",TDS:"Tokyo Denshi Sekei",TECO:"TECO Information Systems",TEGR:"Tegra",TEKT:"Tektronix",TI:"Texas Instruments",TMKR:"TypeMaker",TOSB:"Toshiba",TOSH:"Toshiba",TOTK:"TOTOKU ELECTRIC",TRIU:"Triumph",TSBT:"Toshiba",TTX:"TTX Computer Products",TVM:"TVM Professional Monitor",TW:"TW Casper",ULSX:"Ulead Systems",UNIS:"Unisys",UTZF:"Utz Fehlau & Sohn",VARI:"Varityper",VIEW:"Viewsonic",VISL:"Visual communication",VIVO:"Vivo Mobile Communication",WANG:"Wang",WLBR:"Wilbur Imaging",WTG2:"Ware To Go",WYSE:"WYSE Technology",XERX:"Xerox",XRIT:"X-Rite",ZRAN:"Zoran",Zebr:"Zebra Technologies",appl:"Apple Computer",bICC:"basICColor",berg:"bergdesign",ceyd:"Integrated Color Solutions",clsp:"MacDermid ColorSpan",ds:"Dainippon Screen",dupn:"DuPont",ffei:"FujiFilm Electronic Imaging",flux:"FluxData",iris:"Scitex",kart:"Scitex",lcms:"Little CMS",lino:"Linotronic",none:"none",ob4d:"Erdt Systems",obic:"Medigraph",quby:"Qubyx Sarl",scit:"Scitex",scrn:"Dainippon Screen",sdp:"Scitex",siwi:"SIWI GRAFIKA",yxym:"YxyMaster"},Rc={scnr:"Scanner",mntr:"Monitor",prtr:"Printer",link:"Device Link",abst:"Abstract",spac:"Color Space Conversion Profile",nmcl:"Named Color",cenc:"ColorEncodingSpace profile",mid:"MultiplexIdentification profile",mlnk:"MultiplexLink profile",mvis:"MultiplexVisualization profile",nkpf:"Nikon Input Device Profile (NON-STANDARD!)"};be(si,"icc",[[4,vs],[12,Rc],[40,Object.assign({},vs,Rc)],[48,vs],[80,vs],[64,{0:"Perceptual",1:"Relative Colorimetric",2:"Saturation",3:"Absolute Colorimetric"}],["tech",{amd:"Active Matrix Display",crt:"Cathode Ray Tube Display",kpcd:"Photo CD",pmd:"Passive Matrix Display",dcam:"Digital Camera",dcpj:"Digital Cinema Projector",dmpc:"Digital Motion Picture Camera",dsub:"Dye Sublimation Printer",epho:"Electrophotographic Printer",esta:"Electrostatic Printer",flex:"Flexography",fprn:"Film Writer",fscn:"Film Scanner",grav:"Gravure",ijet:"Ink Jet Printer",imgs:"Photo Image Setter",mpfr:"Motion Picture Film Recorder",mpfs:"Motion Picture Film Scanner",offs:"Offset Lithography",pjtv:"Projection Television",rpho:"Photographic Paper Printer",rscn:"Reflective Scanner",silk:"Silkscreen",twax:"Thermal Wax Printer",vidc:"Video Camera",vidm:"Video Monitor"}]]);class bs extends et{static canHandle(e,t,r){return e.getUint8(t+1)===237&&e.getString(t+4,9)==="Photoshop"&&this.containsIptc8bim(e,t,r)!==void 0}static headerLength(e,t,r){let s,n=this.containsIptc8bim(e,t,r);if(n!==void 0)return s=e.getUint8(t+n+7),s%2!=0&&(s+=1),s===0&&(s=4),n+8+s}static containsIptc8bim(e,t,r){for(let s=0;s<r;s++)if(this.isIptcSegmentHead(e,t+s))return s}static isIptcSegmentHead(e,t){return e.getUint8(t)===56&&e.getUint32(t)===943868237&&e.getUint16(t+4)===1028}parse(){let{raw:e}=this,t=this.chunk.byteLength-1,r=!1;for(let s=0;s<t;s++)if(this.chunk.getUint8(s)===28&&this.chunk.getUint8(s+1)===2){r=!0;let n=this.chunk.getUint16(s+3),o=this.chunk.getUint8(s+2),a=this.chunk.getLatin1String(s+5,n);e.set(o,this.pluralizeValue(e.get(o),a)),s+=4+n}else if(r)break;return this.translate(),this.output}pluralizeValue(e,t){return e!==void 0?e instanceof Array?(e.push(t),e):[e,t]:t}}j(bs,"type","iptc"),j(bs,"translateValues",!1),j(bs,"reviveValues",!1),we.set("iptc",bs),be(Oe,"iptc",[[0,"ApplicationRecordVersion"],[3,"ObjectTypeReference"],[4,"ObjectAttributeReference"],[5,"ObjectName"],[7,"EditStatus"],[8,"EditorialUpdate"],[10,"Urgency"],[12,"SubjectReference"],[15,"Category"],[20,"SupplementalCategories"],[22,"FixtureIdentifier"],[25,"Keywords"],[26,"ContentLocationCode"],[27,"ContentLocationName"],[30,"ReleaseDate"],[35,"ReleaseTime"],[37,"ExpirationDate"],[38,"ExpirationTime"],[40,"SpecialInstructions"],[42,"ActionAdvised"],[45,"ReferenceService"],[47,"ReferenceDate"],[50,"ReferenceNumber"],[55,"DateCreated"],[60,"TimeCreated"],[62,"DigitalCreationDate"],[63,"DigitalCreationTime"],[65,"OriginatingProgram"],[70,"ProgramVersion"],[75,"ObjectCycle"],[80,"Byline"],[85,"BylineTitle"],[90,"City"],[92,"Sublocation"],[95,"State"],[100,"CountryCode"],[101,"Country"],[103,"OriginalTransmissionReference"],[105,"Headline"],[110,"Credit"],[115,"Source"],[116,"CopyrightNotice"],[118,"Contact"],[120,"Caption"],[121,"LocalCaption"],[122,"Writer"],[125,"RasterizedCaption"],[130,"ImageType"],[131,"ImageOrientation"],[135,"LanguageIdentifier"],[150,"AudioType"],[151,"AudioSamplingRate"],[152,"AudioSamplingResolution"],[153,"AudioDuration"],[154,"AudioOutcue"],[184,"JobID"],[185,"MasterDocumentID"],[186,"ShortDocumentID"],[187,"UniqueDocumentID"],[188,"OwnerID"],[200,"ObjectPreviewFileFormat"],[201,"ObjectPreviewFileVersion"],[202,"ObjectPreviewData"],[221,"Prefs"],[225,"ClassifyState"],[228,"SimilarityIndex"],[230,"DocumentNotes"],[231,"DocumentHistory"],[232,"ExifCameraInfo"],[255,"CatalogSets"]]),be(si,"iptc",[[10,{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"}],[75,{a:"Morning",b:"Both Morning and Evening",p:"Evening"}],[131,{L:"Landscape",P:"Portrait",S:"Square"}]]);const ws={zip:qp,gz:wn,tgz:wn,deflate:wn};class q3 extends he{constructor(e,t){const r={};super(e,{...r,...t}),this.id=this.opts.id||"PrepareUpload",this.type="progressindicator",this.i18nInit()}setHashFileName=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s}=r,n=1024*1024*5,a=await s.slice(0,n).text(),l=new y3;l.append(a);const u=l.end(),d=Zt(r),c=`${u}${d?`.${d}`:""}`;this.uppy.setFileState(t,{hashFileName:c})}};setMetaData=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:{webkitRelativePath:s,relativePath:n,name:o},hashFileName:a,size:l}=r,u=n||s||o||a;this.uppy.setFileMeta(t,{relativePath:u,name:u})}};preventXssAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{name:s,meta:n}=this.uppy.getFile(t),o=oi.sanitize(s);if(s!==o){const l=Zt(r),u=o.endsWith(`.${l}`)?o:`${o}.${l}`;this.uppy.setFileState(t,{name:u,meta:{...n,name:u,filename:u}})}if(await ap(r)){const{data:l,name:u,type:d}=this.uppy.getFile(t),c=await l.text(),m=new Set;new DOMParser().parseFromString(c,"image/svg+xml").querySelectorAll("[id]").forEach(P=>m.add(P.id)),oi.addHook("uponSanitizeElement",(P,b)=>{if(b.tagName==="use"){const y=P.getAttribute("xlink:href")||P.getAttribute("href");if(y&&y.startsWith("#")){const f=y.substring(1);m.has(f)&&(b.allowedTags.use=!0,b.forceKeepNode=!0)}}}),oi.addHook("uponSanitizeAttribute",(P,b)=>{if(b.attrName==="xlink:href"&&b.attrValue){if(b.attrValue.startsWith("#")){const y=b.attrValue.substring(1);if(m.has(y)){b.forceKeepAttr=!0;return}}b.keepAttr=!1}["width","height"].includes(b.attrName)&&b.attrValue==="100%"&&(b.forceKeepAttr=!0),b.attrName==="style"&&b.attrValue==="overflow:visible"&&(b.forceKeepAttr=!0)});const T=oi.sanitize(c,{USE_PROFILES:{svg:!0,svgFilters:!0},ALLOWED_TAGS:["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","use","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop"],ALLOWED_ATTR:["d","points","x","y","width","height","r","cx","cy","rx","ry","x1","y1","x2","y2","transform","fill","stroke","stroke-width","viewBox","xmlns","xmlns:xlink","xml:space","style","id","class","offset","stop-color","stop-opacity","clip-path","mask","fill-opacity","stroke-opacity","gradientTransform","gradientUnits","xlink:href"],FORBID_TAGS:["a","script","iframe","image","foreignObject"],FORBID_ATTR:["href","onclick","onload","onerror"]});if(oi.removeHook("uponSanitizeElement"),oi.removeHook("uponSanitizeAttribute"),c!==T){const P=new Blob([T],{type:d}),b=Ms(P,u);this.uppy.setFileState(t,{...this.uppy.getFile(t),data:b,preview:ar(b)}),console.info("clean svg file xss attack",{name:u,originalFile:r.data.text(),cleanFile:T})}}}};preventZipBombAttack=async e=>{const{id:t}=e,r=this.uppy.getFile(t);try{if(r&&ws[r.extension]){const{data:s}=r,n=ws[r.extension](new Uint8Array(await s.arrayBuffer())),o=(l,u,d=0)=>Object.entries(l instanceof Uint8Array?{[u||r.name]:l}:l).reduce((c,[m,w])=>{if(!w||w.byteLength===0)return console.warn("Invalid or empty item in unzipped content",{name:m,item:w}),c;const F=c+w.byteLength;if(d>=5||F>r.size*100)throw console.error("Zip bomb detected, please check your file",{depth:d,baseAcc:F,fileSize:r.size}),new Error("Zip bomb detected, please check your file");const T=Fi(Ct(m));if(ws[T]){const P=ws[T](w);return F+o(P,m,d+1)}return F},0);if(o(n)>r.size*100)throw new Error("Zip bomb detected, please check your file")}}catch(s){if(s.message.includes("Zip bomb detected"))throw s}};validateImagesRespectCropperOptions=async()=>this.uppy.getFiles().reduce(async(e,t)=>{await e;const{id:r}=t;let s=this.uppy.getFile(r);if(s.isRemote&&(await this.tryDownloadRemoteFile(s),s=this.uppy.getFile(r)),!this.opts.cropperOptions?.aspectRatio||!s?.type?.includes("image")||s.type?.includes("image/svg"))return Promise.resolve();const{aspectRatio:n}=this.opts.cropperOptions,o=this.uppy.getPlugin("ImageEditor"),a=document.querySelector(`[src="${s.preview}"]`)||document.getElementById("uppy_"+r).querySelector("img"),l=a?.naturalWidth,u=a?.naturalHeight,d=Number(l/u).toFixed(2),c=Number(n).toFixed(2);if(d===c)return Promise.resolve();this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("editorLoading")}),o.parent.openFileEditor(s);const w=this.i18n("aspectRatioMessage",{imageAspectRatio:d,aspectRatio:c});return this.uppy.info({message:w,details:w}),new Promise((F,T)=>{this.uppy.once("file-editor:complete",()=>{setTimeout(()=>{F()},200)}),this.uppy.once("file-editor:cancel",()=>{})})},Promise.resolve());checkImageOrientation=async e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r?.type?.startsWith("image/"))try{if(!(await k3(r.data).catch(()=>({deg:0}))).deg)return;const n=r.data.size*.98,o=await new Promise((T,P)=>{const b=new Image;let y=URL.createObjectURL(r.data);b.src=y,b.onload=()=>{URL.revokeObjectURL(y),y=null,T(b)},b.onerror=f=>{y&&(URL.revokeObjectURL(y),y=null),P(new Error(`Image load failed: ${f.message}`))}}),a=o.width/o.height;let l=Math.sqrt(n*a),u=l/a;const d=8096;if(l>d||u>d){const T=d/Math.max(l,u);l*=T,u*=T}const c=document.createElement("canvas");c.width=l,c.height=u;const m=c.getContext("2d",{willReadFrequently:!0,alpha:r.type==="image/png"});m.imageSmoothingEnabled=!0,m.imageSmoothingQuality="high",m.translate(c.width/2,c.height/2),m.drawImage(o,-l/2,-u/2,l,u);const w=1,F=await new Promise(T=>{c.toBlob(T,r.type,w)});this.uppy.setFileState(t,{data:F,size:F.size})}catch(s){console.error("Image rotation processing failed:",s);return}};prepareUploadWrapper=async e=>{await this.tryDownloadRemoteFile(e),await this.checkImageOrientation(e),await this.getPreviewFromData(e),await this.setHashFileName(e),this.opts.disableXssAttack||await this.preventXssAttack(e),await this.preventZipBombAttack(e),await this.setMetaData(e)};tryDownloadRemoteFile=async e=>{const{type:t,name:r,preview:s,source:n,isRemote:o,isDownloading:a,id:l,isLoading:u,remote:d,meta:c,errorCount:m=0}=e,w=!u&&o,F=`uploader:${l}:downloaded`,T=Zt(e),P=r?.split("?")?.[0],y=(()=>{const f=["jpg","jpeg"];return f.includes(T)&&f.some(p=>P?.endsWith(p))?!0:P?.endsWith(T)})()?P:`${P}${T?`.${T}`:""}`;if(w){const f=tp(s||d?.body?.url);if(m>=3)throw this.uppy.setFileState(l,{error:this.i18n("downloadRemoteFileFailure"),meta:{...c,name:this.i18n("downloadRemoteFileFailure")}}),new Error("Download remote file failure");this.uppy.setFileState(l,{isLoading:!0,isDownloading:!0,size:null,meta:{...c,name:this.i18n("loading")}}),await fetch(f).then(async p=>await p.blob()).then(async p=>{const v=Ms(p,y);this.uppy.setFileState(l,{name:y,extension:T,type:t,data:v,preview:s||ar(v),source:n,size:v.size,isDownloading:!1,isRemote:!1,meta:{...c,name:y,filename:y}}),this.uppy.getFile(l),this.uppy.emit(F,l)}).catch(async p=>{if(console.error("Axios download remote file error: ",p),t.startsWith("image/")){const v=t.includes("svg")?"image/png":t,g=y.endsWith(".svg")?y.replace(".svg",".png"):y;try{const _=await new Promise((N,H)=>{const z=new Image;z.crossOrigin="anonymous",z.onload=()=>{const k=document.createElement("canvas");k.width=z.width,k.height=z.height;const L=k.getContext("2d");L.translate(k.width/2,k.height/2),L.drawImage(z,-z.width/2,-z.height/2,z.width,z.height),k.toBlob(N,v)},z.onerror=H,z.src=f});let A=Ms(_,g);this.uppy.setFileState(l,{name:g,extension:T,type:v,data:A,preview:s||ar(A),source:n,size:A.size,isDownloading:!1,isRemote:!1,meta:{...c,name:g,filename:g}});const I=this.uppy.getFile(l);this.uppy.emit(F,l);return}catch{}}this.uppy.setFileState(l,{isRemote:!0,isLoading:!1,errorCount:m+1}),await this.tryDownloadRemoteFile(this.uppy.getFile(l))})}else a&&await(async()=>new Promise(p=>{this.uppy.once(F,async()=>{p()})}))()};getPreviewFromData=e=>{const{id:t}=e,r=this.uppy.getFile(t);if(r){const{data:s,type:n,preview:o}=r;(n.indexOf("gif")>-1||!o)&&s&&n.indexOf("image")>-1&&setTimeout(()=>{this.uppy.setFileState(t,{preview:ar(s)})},n.indexOf("gif")>-1?1e3:0)}};prepareUpload=async e=>{await this.validateImagesRespectCropperOptions();const t=e.map(async s=>{const n=this.uppy.getFile(s);n.isDownloading&&this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("loading")}),await this.prepareUploadWrapper(n)}),r=()=>{e.forEach(s=>{const n=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",n)})};return Promise.all(t).then(r)};install(){this.uppy.addPreProcessor(this.prepareUpload),this.uppy.on("file-added",async e=>{setTimeout(()=>{this.prepareUploadWrapper(e)},200)}),this.uppy.on("file-editor:complete",e=>{this.getPreviewFromData(e)})}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}render(){return se($e,{})}}class V3 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=()=>se("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:se("g",{fill:"none",stroke:"#a482fe","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",children:[se("path",{d:"M15 8h.01M10 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5"}),se("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 se("div",{id:"ai-image",className:"ai-image",children:se("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()}}class W3 extends he{constructor(e,t){super(e,t),this.id=t.id,this.title=t.title,this.type="acquirer",this.uppy=e,this.i18nInit(),this.autoHide=t.autoHide??!0,typeof t.icon=="string"&&(this.icon=()=>se("div",{dangerouslySetInnerHTML:{__html:t.icon},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}))}getDashboard(){return this.uppy.getPlugin(this.id)?.parent}render(){return this.autoHide&&this.getDashboard()?.hideAllPanels&&this.getDashboard().hideAllPanels(),se("div",{id:this.id,className:"uppy-VirtualPlugin"})}update(){}onFirstRender(){}uninstall(){this.unmount()}}const Uc=()=>navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome");class G3 extends he{constructor(e,t){super(e,t),this.id=t?.id||"safari-paste",this.type="modifier"}onMount(){Uc()&&this.parent?.handlePaste&&document.addEventListener("paste",this.parent.handlePaste)}onUnmount(){Uc()&&this.parent?.handlePaste&&document.removeEventListener("paste",this.parent.handlePaste)}}const X3="z8ia1mAXo8ZE7ytGF36L5uBf9kD2kenhqFGp9",K3=ee.lazy(()=>kp(()=>import("./index-DcddP3R9.js"),[])),Mc="uploader-container",_o="uploader-dashboard",Y3='div[tabindex="-1"]',Bc=50,Q3=10,Sa=localStorage.getItem("uppy_debug"),J3=()=>en.get("x-csrf-token")?{"x-csrf-token":en.get("x-csrf-token")}:{},Z3=i=>{const{apiPathProps:e,availablePluginMap:t={},uploadedProps:r,resourcesProps:s,imageEditorProps:n={},theme:o,plugins:a,disableXssAttack:l}=i,{companionUrl:u}=Ka(e),d=J3(),c=async w=>(await Di.post("/api/image/generations",w)).data,m={...i?.restrictions,maxFileSize:1/0};return[{id:"ImageEditor",plugin:xh,options:{quality:1,...n},alwayUse:!0},(Sa||bi()&&t.Uploaded&&!ca())&&{id:"Uploaded",plugin:u3,options:{params:r?.params}},(Sa||bi()&&t.Resources&&!ca())&&{id:"Resources",plugin:f3,options:{params:s?.params}},bi()&&(window.blocklet?.preferences?.useAiImage||t.AIImage)&&{id:"AIImage",plugin:V3,options:{companionUrl:u,companionHeaders:d},onShowPanel:w=>{function F(){setTimeout(()=>{const T=document.getElementById("ai-image");T?Hp.createRoot(T).render(_e.jsx(K3,{theme:o,api:c,restrictions:m,i18n:w.current?.getUploader()?.i18n,onSelect:P=>{const b=w.current.getUploader();b?.emit("ai-image:selected",P),P.forEach(({src:y,alt:f},p)=>{const g=`${(_=>_?.length>16?`${_?.slice(0,8)}...${_?.slice(-4)}`:_)(f)||"ai-image"}.png`;if(y&&!y.startsWith("data:"))fetch(y).then(_=>_.blob()).then(_=>{const A=new File([_],g,{type:"image/png"});b?.addFile({name:g,type:"image/png",data:A,source:"AIImage",isRemote:!1})}).catch(_=>{b?.log(`[AIImage] Failed to fetch image: ${_.message}`,"error")});else{const _={name:g,type:"image/png",data:ep(y,g),source:"AIImage",isRemote:!1};b?.addFile(_)}})}})):F()},100)}F()}},{id:"Url",plugin:Ot,options:{companionUrl:u,companionHeaders:d}},{id:"Webcam",plugin:cd,options:{showVideoSourceDropdown:!0,showRecordingLength:!0,mirror:!1,videoConstraints:{facingMode:"environment"}}},!!window?.blocklet?.UNSPLASH_KEY&&t.Unsplash&&{id:"Unsplash",plugin:xd,options:{companionUrl:u,companionHeaders:d,companionCookiesRule:"same-origin"}},{id:"PrepareUpload",plugin:q3,options:{companionUrl:u,companionHeaders:d,cropperOptions:n?.cropperOptions||null,disableXssAttack:l},alwayUse:!0},{id:"ThumbnailGeneratorNext",plugin:Ma,options:{thumbnailType:"image/png",thumbnailWidth:"100%"},alwayUse:!0},...(a||[]).filter(w=>w?.id).map(w=>{const{id:F,options:T,onShowPanel:P}=w;return{id:F,plugin:W3,options:T,onShowPanel:P}}),{id:"safari-paste",plugin:G3,alwayUse:!0}].filter(Boolean)};function wp(i){const{id:e,plugins:t,locale:r="en",onAfterResponse:s,onUploadFinish:n,coreProps:o,apiPathProps:a,tusProps:l,dropTargetProps:u,pluginList:d,restrictions:c,onChange:m,initialFiles:w,uploadMode:F="tus"}=i,T=jc(d,"id"),{uploaderUrl:P}=Ka(a);let b=new Ca({id:e,meta:{uploaderId:e},debug:["true",!0].includes(Sa||""),locale:lr[r],onBeforeFileAdded:(p,v)=>{if(Object.hasOwn(v,p.id))return!1;const g=!!Fi(p.type),_=Ct(p.name)||"";if(!g&&_&&_!==p.type){const A=Zt(p);A&&(p.extension=A),p.type=_}return p},...o,restrictions:c});if(F==="presigned"){const p=P.replace(/\/uploads\/?$/,"");b.use(o3,{apiBase:p}),b.on("upload-success",async(v,g)=>{if(!g.body)return;const _={data:g.body,method:"POST",url:g.uploadURL||"",status:200,headers:{},file:v,uploadURL:g.uploadURL||""};await n?.(_),b.emitUploadSuccess(v,_)})}else b.use(Qh,{chunkSize:1024*1024*10,removeFingerprintOnSuccess:!0,withCredentials:!0,endpoint:P,async onBeforeRequest(p,v){const{hashFileName:g,id:_,meta:A}=v,I=b.getFile(_)?.mockResponse||null;p.getMethod()==="PATCH"&&I&&(p.send=()=>I);const N=Zt(v);p.setHeader("x-uploader-file-name",`${g}`),p.setHeader("x-uploader-file-id",`${_}`),p.setHeader("x-uploader-file-ext",`${N}`),p.setHeader("x-uploader-base-url",new URL(p.getURL()).pathname),p.setHeader("x-uploader-endpoint-url",P),p.setHeader("x-uploader-metadata",JSON.stringify(A,(k,L)=>typeof L=="string"?encodeURIComponent(L):L));const H=en.get("x-csrf-token");H&&p.setHeader("x-csrf-token",H);const z=window?.uploaderComponentId||window?.blocklet?.componentId;z&&p.setHeader("x-component-did",(z||"").split("/").pop())},onAfterResponse:async(p,v)=>{const g={},_=p.getUnderlyingObject();try{_.response&&(g.data=JSON.parse(_.response))}catch{g.data={}}g.method=p.getMethod().toUpperCase(),g.url=p.getURL(),g.status=_.status,g.headers={...p._headers};const A=_.getAllResponseHeaders();A&&A.split(`\r
49
+ `).forEach(k=>{const[L,V]=k.split(": ");L&&V&&(g.headers[L]=V)});const I=b.getFile(g.headers["x-uploader-file-id"]);if(p.getMethod()==="PATCH"&&I.mockResponse)return;if(["PATCH","POST"].includes(g.method)&&[200,500].includes(g.status)){const z=[!0,"true"].includes(g.headers["x-uploader-file-exist"]),k=sp(g.url,g.headers["x-uploader-file-name"]);g.file=I,g.uploadURL=k;const L={uploadURL:k,...g};b.setFileState(I.id,{responseResult:L}),z&&I&&(g.method==="POST"&&b.setFileState(I.id,{mockResponse:v}),b.emit("upload-success",b.getFile(I.id),{...L,body:g.data}),b.emit("postprocess-complete",b.getFile(I.id)),b.calculateTotalProgress()),g.status===200&&(await n?.(g),b.emitUploadSuccess(I,g))}s&&await s?.(_);const N=b.getState().totalProgress===100,H=b.getFiles().every(z=>z.source==="DropTarget");N&&H&&b.close()},...l});const y=({fileIDs:p,id:v})=>{p.forEach(g=>{b.setFileState(g,{uploadID:v})})};b.off("upload",y),b.on("upload",y);const f=p=>{typeof m=="function"&&m(p,b.getFiles())};return b.off("file-added",f),b.on("file-added",f),b.off("file-removed-success",f),b.on("file-removed-success",f),u&&b.use(ph,{target:document.body,onDrop:p=>{b?.open?.()},...u}),t?.forEach(p=>{if(p?.id||p){const{plugin:v,options:g}=T[p?.id||p]||{};v&&b.use(v,g)}}),np(b),w&&w?.length>0&&b.addFiles(w),b}function Pa({ref:i=void 0,...e}){const t={uploader:"/api/uploads",companion:"/api/companion",disableMediaKitPrefix:!1,disableMediaKitStatus:!1,...e?.apiPathProps},r=ee.useRef(null),s=ee.useRef(null),n=ee.useRef(0),o=Dp({open:!1,uppy:null,availablePluginMap:{},restrictions:vn(e?.coreProps?.restrictions)||{},isError:!1,uploadMode:"tus"}),a=Rp(),l=a?.palette?.mode,u=Z3({...e,apiPathProps:t,availablePluginMap:o.availablePluginMap,restrictions:o.restrictions,theme:a}),{plugins:d=u.map(S=>S.id),id:c="Uploader",popup:m=!1,onUploadFinish:w,onOpen:F,onClose:T,locale:P="en",installerProps:b}=e,y=jc(u,"id"),f=Up(S=>S?.breakpoints?.down("md")),p=jn([...d,...u.filter(S=>S.alwayUse).map(S=>S.id)]),{loading:v}=xp(async()=>{let S=bn(e?.coreProps?.restrictions)?{}:vn(e?.coreProps?.restrictions);if(!t.disableMediaKitStatus&&bi())try{await Di.get("/api/uploader/status").then(({data:D})=>{o.availablePluginMap=D.availablePluginMap,o.uploadMode=D.uploadMode||"tus",!t.disableMediaKitPrefix&&bn(e?.coreProps?.restrictions)&&(S=D.restrictions||{})}),o.isError=!1}catch{o.isError=!0}!S?.allowedFileTypes?.length&&S?.allowedFileExts&&(S.allowedFileTypes=jn(((typeof S?.allowedFileExts=="string"?S?.allowedFileExts.split(","):S?.allowedFileExts)||[])?.map(D=>Ct(D?.replaceAll(" ","")||""))?.filter(D=>D)),delete S.allowedFileExts),S.maxFileSize&&typeof S.maxFileSize=="string"&&(S.maxFileSize=Ap.parseSize(S.maxFileSize,{iec:!1})||void 0),o.restrictions=vn(S)},{refreshDeps:[JSON.stringify({apiPathProps:t,restrictionsProps:e?.coreProps?.restrictions})]}),g=typeof o.restrictions?.allowedFileTypes=="object"&&o.restrictions?.allowedFileTypes?.length===0,_=ee.useMemo(()=>jn(o.restrictions?.allowedFileTypes?.flatMap(S=>{if(S.endsWith("/*")){const D=S.split("/")?.[0];switch(D){case"image":return["jpg","jpeg","png","gif","svg","webp","bmp","tiff","avif","heic","ico","apng"];case"video":return["mp4","webm","mov","avi","wmv","flv","mkv","mpg","mpeg","3gp","m4v","ts","m2ts"];case"audio":return["mp3","wav","ogg","aac","flac","m4a","wma","opus","mid","midi","amr"];case"text":return["txt","html","htm","css","csv","md","rtf","xml","json","js","ts","jsx","tsx"];case"application":return["pdf","doc","docx","xls","xlsx","ppt","pptx","zip","rar","7z","tar","gz","exe","msi","apk","dmg","iso"];case"font":return["ttf","otf","woff","woff2","eot"];case"chemical":return["mol","pdb","cml","xyz"];case"model":return["obj","stl","gltf","glb","fbx","3ds","dae"];case"message":return["eml","msg","vcf","ics"];default:return D}}return Fi(S)})||[])?.filter(Boolean)?.join(", ")||"",[o.restrictions?.allowedFileTypes]);let A="";g?A=Gr(lr,`${P}.strings.noAllowedFileTypes`,"No allowed file types"):o.restrictions?.allowedFileTypes?.length&&_&&(A=Gr(lr,`${P}.strings.allowedFileTypes`,"Allowed file types: ")+_),(bn(A)||["undefined","null",void 0,null].includes(A))&&(A=""),Ip("esc",S=>{o.open&&(S.stopPropagation(),S.preventDefault(),H())},{useCapture:!0}),ee.useEffect(()=>{ip(t),o.uppy=wp({...e,id:c,plugins:p,apiPathProps:t,pluginList:u,restrictions:o.restrictions,uploadMode:o.uploadMode}),o.uppy.open=N,o.uppy.close=H,o.uppy.openPlugin=I;const S=x=>{const{onShowPanel:M}=y[x];M?.(i)};o.uppy.off("dashboard:show-panel",S),o.uppy.on("dashboard:show-panel",S);const D=(x,M,q,W)=>{const ne=`${W.toLowerCase()}Props`,re=q[ne]?.onSelectedFiles;if(typeof re=="function"){const Y=x.map(_t=>{const Wr={name:_t.id||_t.fileUrl?.split("/")?.slice(-1)?.[0],type:_t.mimetype||Ct(_t.fileUrl)||"",data:"",preview:_t.fileUrl,source:W,isRemote:!0},yn=M.uppy.addFile(Wr);return{..._t,uppyFile:M.uppy.getFile(yn)}});re?.(Y)}else{const Y=[],_t=[],Wr=`Mock-${Math.random().toString(36).substring(2,15)}`;Promise.all(x.map(async yn=>{const ni=lp(yn);ni&&(ni.uploadID=Wr,Y.push(ni)),await w?.(ni),M.uppy.emitUploadSuccess(ni.file,ni)})).then(()=>{M.uppy.close()}).finally(()=>{M.uppy.emit("complete",{failed:_t,successful:Y,uploadID:Wr})})}};[{name:"Uploaded",event:"uploaded:selected"},{name:"Resources",event:"resources:selected"}].forEach(({name:x,event:M})=>{p.includes(x)&&(o.uppy.off(M),o.uppy.on(M,q=>D(q,o,e,x)))})},[JSON.stringify({id:c,plugins:p,apiPathProps:t,locale:P,restrictions:o.restrictions,theme:a,uploadMode:o.uploadMode})]);function I(S){if(S=S.replace(/\s/g,""),["MyDevice",...p.map(O=>O.id||O)].map(O=>O.toLowerCase()).includes(S.toLowerCase())){let O=`div[data-uppy-acquirer-id="${S}"] > button`;document?.getElementById(_o)?.querySelector(O)?.click?.()}}function N(S){o.open=!0,S&&setTimeout(()=>{I(S)},200),o.uppy.emitOpen(),F?.(),s.current&&(clearInterval(s.current),s.current=null),n.current=0,s.current=setInterval(()=>{const D=r.current?.querySelector(Y3);n.current+=1,(n.current>Bc||D&&D!==document.activeElement)&&(D&&D!==document.activeElement?(D.focus?.(),console.info("[Uploader] Trigger auto focus overlay success")):n.current>Bc&&console.info("[Uploader] Auto focus overlay failed after maximum attempts"),clearInterval(s.current),s.current=null)},Q3)}function H(){s.current&&(clearInterval(s.current),s.current=null),o.uppy.getPlugin(_o)?.hideAllPanels(),o.open=!1,o.uppy.emitClose(),T?.(),setTimeout(()=>{o.uppy.getState().totalProgress===100&&(o.uppy.setState({files:{},currentUploads:{}}),o.uppy.calculateTotalProgress())},500)}const z=(S,D,O)=>{S.forEach(x=>{o.uppy.addFile({name:x.name,type:x.type,data:x,source:D})}),O&&o.uppy.upload()},k=S=>{const D=document.createElement("input");D.type="file",D.style.display="none",D.accept=S?.accept??o.restrictions?.allowedFileTypes?.join(",")??"",D.multiple=S?.multiple??o.restrictions?.maxNumberOfFiles!==1,D.onchange=O=>{const x=O.target,M=Array.from(x.files||[]);z(M,"local",S?.autoUpload!==!1),document.body.removeChild(D)},document.body.appendChild(D),D.click()},L=S=>{const D=S?.autoUpload!==!1;let O=0;return{onDragEnter:x=>{x.preventDefault(),x.stopPropagation(),O++,x.dataTransfer?.items?.length&&x.currentTarget.setAttribute("data-dragging","true")},onDragLeave:x=>{x.preventDefault(),x.stopPropagation(),O--,O===0&&x.currentTarget.removeAttribute("data-dragging")},onDragOver:x=>{x.preventDefault(),x.stopPropagation()},onDrop:x=>{x.preventDefault(),x.stopPropagation(),x.currentTarget.removeAttribute("data-dragging"),O=0;const M=Array.from(x.dataTransfer?.files||[]);M.length&&z(M,"drop",D)},onClick:S?.noClick?void 0:()=>{k({autoUpload:D})}}};ee.useImperativeHandle(i,()=>({getUploader:()=>o.uppy,open:N,close:H,triggerFileInput:k,getDropzoneProps:L,addFilesToUppy:z}));const V=m?Mp:ee.Fragment,E=m?{sx:{zIndex:99999999999,"& > *":{display:o.open?"block":"none"},display:"flex",justifyContent:"center",alignItems:"center",...e?.wrapperProps?.sx},invisible:!0,open:o.open,onClick:S=>{document.activeElement===document.body&&(S.stopPropagation(),H())},...e.wrapperProps}:{...e.wrapperProps},C=f?"42px":"40px";return _e.jsx(V,{...E,children:_e.jsxs(Op,{onClose:H,did:X3,disabled:!o.open,...b,children:[_e.jsx(Bp,{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)"}}})}),_e.jsxs(To,{className:"uploader-container",ref:r,id:Mc,onClick:S=>S.stopPropagation(),sx:{position:"relative",width:f?"90vw":720,animation:o.open?"uppy-Dashboard-fadeIn 150ms ease-in-out":"none","@keyframes uppy-Dashboard-fadeIn":{from:{opacity:0},to:{opacity:1}},".uppy-Dashboard-inner":{borderColor:"divider"},".uppy-ProviderBrowserItem > *":{transition:"all 0.3s ease-in-out"},".uppy-ProviderBrowserItem-inner":{flex:1,color:"transparent","img, object":{objectFit:"contain !important"}},".uppy-ProviderBrowserItem-checkbox":{backgroundColor:`${a?.palette?.primary?.main} !important`},".uppy-Dashboard-Item-previewInnerWrap, .uppy-ProviderBrowserItem-inner":{boxShadow:"none !important",background:"repeating-conic-gradient(#e0e0e0 0 25%,#fff 0 50%) 50%/18px 18px !important"},".uppy-ProviderBrowserItem--selected .uppy-ProviderBrowserItem-inner":{boxShadow:S=>`0 0 0 3px ${S.palette.primary.main} !important`},".uploaded-add-item":{background:a.palette.mode==="dark"?"rgba(255,255,255,0.1) !important":"rgba(0,0,0,0.1) !important",display:"flex",justifyContent:"center",alignItems:"center",transition:"all 0.3s ease-in-out","&:hover":{background:a.palette.mode==="dark"?"rgba(255,255,255,0.13) !important":"rgba(0,0,0,0.13) !important"}},".uppy-StatusBar-actions, .uppy-ProviderBrowser-footer":{justifyContent:"flex-end"},".uppy-ProviderBrowser-footer":{button:{marginRight:"0 !important","&:last-child":{display:"none"}}},".uppy-DashboardContent-panelBody":{height:0},".uppy-Dashboard-AddFiles-title":{whiteSpace:"normal"},".uppy-ProviderBrowser-body":{height:"100%"},".uppy-ProviderBrowser-list":{height:"fit-content",maxHeight:"100%",bgcolor:"background.paper"},".uploaded, .ai-image":{width:"100%",height:"100%",display:"flex",alignItems:"center",flexDirection:"column","& > div":{width:"100%",bgcolor:"background.paper"},"& .uppy-ProviderBrowser-header":{display:"none"}},"& .uppy-Url":{width:"100% !important",display:"flex",justifyContent:"center","& input":{width:"70%"}},"& .uppy-Dashboard-browse, & .uppy-DashboardContent-addMore, & .uppy-DashboardContent-back, & .uppy-StatusBar-actionBtn--done, & .uppy-DashboardContent-save, & .uppy-StatusBar-actionBtn--upload":{color:`${a?.palette?.primary?.main}`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{color:`${a?.palette?.primary?.main}`,filter:"brightness(1.2)"}},"& .uppy-Dashboard-browse":{textDecoration:"underline !important"},"& .uppy-c-btn-primary":{backgroundColor:`${a?.palette?.primary?.main} !important`,transition:"all 0.3s ease-in-out","&:hover, &:focus":{backgroundColor:`${a?.palette?.primary?.main} !important`,filter:"brightness(1.2)"}},"& .button-color-style":{border:"1px solid",borderColor:"primary.main",color:"primary.main",backgroundColor:"transparent",transition:"all 0.3s ease-in-out","&:hover":{filter:"brightness(1.2)"}},"& .button-color-style-active":{backgroundColor:"primary.main",color:"white"}},children:[m&&_e.jsx(Lp,{"aria-label":"close",onClick:H,sx:{color:l==="dark"?"#ddd":"#fafafa",position:"absolute",...f?{bottom:`calc(0px - ${C} - 16px)`,left:`calc(50vw - ${C} - 8px)`}:{right:`calc(0px - ${C} - 16px)`,top:-12}},children:_e.jsx(Np,{sx:{fontSize:C}})}),v&&_e.jsxs(To,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",zIndex:99999999999,flexDirection:"column",background:"rgba(256, 256, 256, 0.2)",backdropFilter:"blur(4px)",borderRadius:1,pointerEvents:"none"},children:[_e.jsx(zp,{size:32}),_e.jsx($p,{variant:"body2",color:"primary",sx:{mt:1.5,fontWeight:"bold"},children:Gr(lr,`${P}.strings.loadingStatus`,"Loading...")})]}),o.uppy&&_e.jsx(rh,{inline:!0,target:`#${Mc}`,id:_o,disabled:g||o.isError,uppy:o.uppy,plugins:p,fileManagerSelectionType:o.restrictions?.maxNumberOfFiles===1?"files":"both",proudlyDisplayPoweredByUppy:!1,showProgressDetails:!0,disableThumbnailGenerator:!0,theme:l==="dark"?"dark":"light",note:o.isError?Gr(lr,`${P}.strings.error`,"Error"):A,doneButtonHandler:H,...e.dashboardProps})]},"uploader-container")]})},"uploader-wrapper")}const ol=ee.createContext(null);function Sp(){const i=ee.useContext(ol);if(!i)throw new Error("useUploaderContext must be used within an UploaderProvider");return i}function ew({onChange:i,children:e,...t}){const r=Sp(),s=()=>{const n=r?.current?.getUploader();n?.open(),i&&n.onceUploadSuccess((...o)=>{i(...o)})};return _e.jsx(To,{onClick:s,...t,children:e})}function tw({children:i,popup:e,...t}){const r=ee.useRef(null),s=ee.useMemo(()=>e?jp.createPortal(_e.jsx(Pa,{ref:r,popup:!0,...t},"uploader"),document.body):_e.jsx(Pa,{ref:r,popup:!1,...t},"uploader"),[r,e,t]);return _e.jsxs(ol.Provider,{value:r,children:[i,s]})}const Sw=Object.freeze(Object.defineProperty({__proto__:null,CLOSE:Ls,OPEN:Bs,UPLOADER_UPLOAD_SUCCESS:da,Uploader:Pa,UploaderContext:ol,UploaderProvider:tw,UploaderTrigger:ew,api:rp,base64ToFile:ep,blobToFile:Ms,createImageUrl:Lr,getDownloadUrl:tp,getExt:Zt,getMediaKitComponent:bi,getMimeExtension:Fi,getObjectURL:ar,getUploaderEndpoint:Ka,getUrl:sp,initUploader:wp,initUppy:np,isBlob:Zh,isMediaKit:ca,isSvgFile:ap,lookupMimeType:Ct,mediaKitApi:Di,mediaKitMountPoint:at,mockUploaderFileResponse:lp,parseStringToDot:op,get prefixPath(){return kt},setPrefixPath:ip,useUploaderContext:Sp},Symbol.toStringTag,{value:"Module"}));export{Sw as i,jc as k,Di as m};