@covet-pics/covet-pics-widget 0.96.2 → 0.97.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cjs/covet-pics-direct-buy_5.cjs.entry.js +463 -242
  2. package/dist/cjs/covet-pics-gallery-grid_3.cjs.entry.js +1 -1
  3. package/dist/cjs/covet-pics-highlighted-hotspots_2.cjs.entry.js +1 -1
  4. package/dist/cjs/covet-pics-widget.cjs.js +1 -1
  5. package/dist/cjs/{lazy-7a84175a.js → lazy-6938bff5.js} +47 -23
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +1 -1
  8. package/dist/covet-pics-widget/covet-pics-widget.esm.js +1 -1
  9. package/dist/covet-pics-widget/covet-pics-widget.js +1 -1
  10. package/dist/covet-pics-widget/p-23bcb3b7.system.entry.js +34 -0
  11. package/dist/covet-pics-widget/p-5dcc5117.system.js +4 -0
  12. package/dist/covet-pics-widget/p-6a0254ad.js +4 -0
  13. package/dist/covet-pics-widget/{p-19038aed.entry.js → p-7004078e.entry.js} +1 -1
  14. package/dist/covet-pics-widget/{p-3aa8564c.system.entry.js → p-b712096f.system.entry.js} +1 -1
  15. package/dist/covet-pics-widget/{p-43c4bc55.system.entry.js → p-c00f33f8.system.entry.js} +1 -1
  16. package/dist/covet-pics-widget/{p-de97c06c.system.js → p-f7c1a8c3.system.js} +1 -1
  17. package/dist/covet-pics-widget/p-f8a365a0.entry.js +29 -0
  18. package/dist/covet-pics-widget/{p-5fd90189.entry.js → p-fb8a470e.entry.js} +1 -1
  19. package/dist/esm/covet-pics-direct-buy_5.entry.js +463 -242
  20. package/dist/esm/covet-pics-gallery-grid_3.entry.js +1 -1
  21. package/dist/esm/covet-pics-highlighted-hotspots_2.entry.js +1 -1
  22. package/dist/esm/covet-pics-widget.js +1 -1
  23. package/dist/esm/{lazy-753ea216.js → lazy-af14efc1.js} +47 -23
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm-es5/covet-pics-direct-buy_5.entry.js +4 -4
  26. package/dist/esm-es5/covet-pics-gallery-grid_3.entry.js +1 -1
  27. package/dist/esm-es5/covet-pics-highlighted-hotspots_2.entry.js +1 -1
  28. package/dist/esm-es5/lazy-af14efc1.js +4 -0
  29. package/dist/types/stencil-public-runtime.d.ts +6 -4
  30. package/package.json +1 -1
  31. package/dist/covet-pics-widget/p-3860db4a.entry.js +0 -29
  32. package/dist/covet-pics-widget/p-927c59e8.js +0 -4
  33. package/dist/covet-pics-widget/p-98793225.system.entry.js +0 -34
  34. package/dist/covet-pics-widget/p-f5e5c71a.system.js +0 -4
  35. package/dist/esm-es5/lazy-753ea216.js +0 -4
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-3863feda.js');
9
9
  const utils = require('./utils-50212cd5.js');
10
- const lazy = require('./lazy-7a84175a.js');
10
+ const lazy = require('./lazy-6938bff5.js');
11
11
  const evEmitter = require('./ev-emitter-92552a48.js');
12
12
 
13
13
  const covetPicsDirectBuyCss = "@font-face{font-family:\"swiper-icons\";src:url(\"data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA\") format(\"woff\");font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-pointer-events.swiper-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-backface-hidden .swiper-slide{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d,.swiper-3d.swiper-css-mode .swiper-wrapper{-webkit-perspective:1200px;perspective:1200px}.swiper-3d .swiper-wrapper,.swiper-3d .swiper-slide,.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0, 0, 0, 0.15)}.swiper-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none;}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-horizontal.swiper-css-mode>.swiper-wrapper{-ms-scroll-snap-type:x mandatory;-webkit-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-vertical.swiper-css-mode>.swiper-wrapper{-ms-scroll-snap-type:y mandatory;-webkit-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}.swiper-centered>.swiper-wrapper::before{content:\"\";-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:9999;order:9999}.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-start:var(--swiper-centered-offset-before);margin-inline-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-horizontal>.swiper-wrapper::before{height:100%;width:var(--swiper-centered-offset-after)}.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{-webkit-margin-before:var(--swiper-centered-offset-before);margin-block-start:var(--swiper-centered-offset-before)}.swiper-centered.swiper-vertical>.swiper-wrapper::before{width:100%;height:var(--swiper-centered-offset-after)}.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center}:host{z-index:1;background-color:#ffffff;--covet-pics-button-size:40px;--covet-pics-padding-size:40px;--covet-pics-font-color:#101010;--covet-pics-background-color:#fcfbfc}:host{position:fixed;bottom:0;overflow:scroll;width:100%;max-height:0;-webkit-box-shadow:0 -8px 16px 0 rgba(0, 0, 0, 0.05);box-shadow:0 -8px 16px 0 rgba(0, 0, 0, 0.05);-webkit-transition:max-height 0.35s ease-in-out;transition:max-height 0.35s ease-in-out;min-width:auto}:host(.open){max-height:100%}.main{margin:0 var(--covet-pics-padding-size);padding-bottom:150px;position:relative}.close{background:none;border:none;position:absolute;top:0;padding:0;cursor:pointer;right:0;-webkit-transform:rotate(270deg);transform:rotate(270deg);outline:none !important}.close:hover svg .icon-arrow-path,.close:active svg .icon-arrow-path,.close:focus svg .icon-arrow-path{stroke:#000000}.close svg{width:var(--covet-pics-button-size);height:var(--covet-pics-button-size)}.close svg .icon-arrow-path{-webkit-transition:all 0.25s ease;transition:all 0.25s ease}.title{font-size:14px;font-weight:400;line-height:var(--covet-pics-button-size);width:calc(100% - var(--covet-pics-button-size));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.title a{text-decoration:none;color:var(--covet-pics-font-color)}.price-wrap{display:-ms-flexbox;display:flex;height:32px;background:var(--covet-pics-background-color);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;text-transform:uppercase}.price-wrap label{color:var(--covet-pics-font-color);font-weight:300;max-width:80px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.price-wrap .price{font-weight:600}.btn-buy{border:none;background-color:var(--covet-pics-button-color);color:var(--covet-pics-button-text-color);font-family:inherit;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;text-transform:uppercase;text-align:center;cursor:pointer;font-size:14px;line-height:1;padding:17px 17px max(17px, env(safe-area-inset-bottom, 25px)) 17px;margin-bottom:0}.btn-buy:hover,.btn-buy:active,.btn-buy:focus{background-color:var(--covet-pics-button-hover-color)}.btn-buy.style-1:hover,.btn-buy.style-1:active,.btn-buy.style-1:focus{background-color:var(--covet-pics-button-text-hover-color)}.btn-buy.style-2:hover,.btn-buy.style-2:active,.btn-buy.style-2:focus{background-color:var(--covet-pics-button-color);color:var(--covet-pics-button-text-hover-color)}.btn-buy:disabled{background:#EEEEEE;color:#808080;pointer-events:none}.options{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-bottom-color:#EEE;height:48px;padding:0 8px 0 12px;-moz-text-align-last:right;text-align-last:right;font-weight:300;color:var(--covet-pics-font-color);text-transform:uppercase;position:relative;cursor:pointer;outline:none !important;-webkit-transition:border 0.25s ease;transition:border 0.25s ease}.options.opened{border-left:1px solid #EEE;border-right:1px solid #EEE}.options.opened .options-container{display:block}.options:hover,.options:active,.options:focus,.options:focus-within{border-bottom-color:#000000}.options label{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;outline:none !important}.options label .option-name{margin:auto 0}.options label .selected-option{margin:auto 0;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M0 0h24v24H0z'%3E%3C/path%3E%3Cpath stroke='%23A0A0A0' d='M16.95 10.25L12 15.2l-4.95-4.95'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right 50%;background-size:24px;padding-right:26px;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:50%;font-family:inherit;cursor:pointer}.options .options-container{display:none;position:absolute;top:48px;left:-1px;background:#FFF;z-index:2;width:100%;border:1px solid #eee;border-top:0;max-height:114px;overflow:auto;cursor:pointer}.options .options-container .option-value{min-height:32px;font-size:12px;color:#101010;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;outline:none !important}.options .options-container .option-value.selected .selected-indic{height:24px;border-left:2px solid #101010}.options .options-container .option-value .value-text{margin-left:4px;margin-right:4px;padding:0 10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%;font-size:12px;min-height:32px}.options .options-container .option-value:hover .value-text,.options .options-container .option-value:active .value-text,.options .options-container .option-value:focus .value-text{background:#F7F7F7}.main-gallery{overflow:hidden;width:100%}.main-gallery .swiper-slide{width:200px;height:200px;-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.main-gallery .swiper-slide img{max-width:100%;max-height:100%}.main-gallery .swiper-wrapper{max-height:200px}.footer{background-color:var(--covet-pics-background-color);position:absolute;width:100%;bottom:0;z-index:1}.footer .price-wrap{padding:0 var(--covet-pics-padding-size);width:calc(100% - var(--covet-pics-padding-size) * 2)}.swiper-pagination-bullets{padding:10px 0;border-bottom:1px solid var(--covet-pics-font-color);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;-ms-flex:none;flex:none;border-radius:100%;background:var(--covet-pics-font-color);opacity:0.2;margin:0 4px}.swiper-pagination-bullet.swiper-pagination-bullet-active{opacity:1;background:var(--covet-pics-font-color)}@media only screen and (min-width: 801px){:host{display:none;height:100%;z-index:1;position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden}:host(.open){display:block}.title a{padding:0 var(--covet-pics-button-size)}.close{left:calc(var(--covet-pics-button-size) / -2);right:unset;-webkit-transform:unset;transform:unset}.wrap{height:100%;overflow:scroll}.footer{position:absolute}}";
@@ -378,29 +378,32 @@ function getBasePlacement$1(placement) {
378
378
  return placement.split('-')[0];
379
379
  }
380
380
 
381
- // import { isHTMLElement } from './instanceOf';
382
- function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars
383
- includeScale) {
381
+ var max = Math.max;
382
+ var min = Math.min;
383
+ var round = Math.round;
384
+
385
+ function getBoundingClientRect(element, includeScale) {
386
+ if (includeScale === void 0) {
387
+ includeScale = false;
388
+ }
384
389
 
385
390
  var rect = element.getBoundingClientRect();
386
391
  var scaleX = 1;
387
- var scaleY = 1; // FIXME:
388
- // `offsetWidth` returns an integer while `getBoundingClientRect`
389
- // returns a float. This results in `scaleX` or `scaleY` being
390
- // non-1 when it should be for elements that aren't a full pixel in
391
- // width or height.
392
- // if (isHTMLElement(element) && includeScale) {
393
- // const offsetHeight = element.offsetHeight;
394
- // const offsetWidth = element.offsetWidth;
395
- // // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
396
- // // Fallback to 1 in case both values are `0`
397
- // if (offsetWidth > 0) {
398
- // scaleX = rect.width / offsetWidth || 1;
399
- // }
400
- // if (offsetHeight > 0) {
401
- // scaleY = rect.height / offsetHeight || 1;
402
- // }
403
- // }
392
+ var scaleY = 1;
393
+
394
+ if (isHTMLElement(element) && includeScale) {
395
+ var offsetHeight = element.offsetHeight;
396
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
397
+ // Fallback to 1 in case both values are `0`
398
+
399
+ if (offsetWidth > 0) {
400
+ scaleX = round(rect.width) / offsetWidth || 1;
401
+ }
402
+
403
+ if (offsetHeight > 0) {
404
+ scaleY = round(rect.height) / offsetHeight || 1;
405
+ }
406
+ }
404
407
 
405
408
  return {
406
409
  width: rect.width / scaleX,
@@ -555,13 +558,13 @@ function getMainAxisFromPlacement(placement) {
555
558
  return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
556
559
  }
557
560
 
558
- var max = Math.max;
559
- var min = Math.min;
560
- var round = Math.round;
561
-
562
561
  function within(min$1, value, max$1) {
563
562
  return max(min$1, min(value, max$1));
564
563
  }
564
+ function withinMaxClamp(min, value, max) {
565
+ var v = within(min, value, max);
566
+ return v > max ? max : v;
567
+ }
565
568
 
566
569
  function getFreshSideObject() {
567
570
  return {
@@ -684,8 +687,8 @@ function roundOffsetsByDPR(_ref) {
684
687
  var win = window;
685
688
  var dpr = win.devicePixelRatio || 1;
686
689
  return {
687
- x: round(round(x * dpr) / dpr) || 0,
688
- y: round(round(y * dpr) / dpr) || 0
690
+ x: round(x * dpr) / dpr || 0,
691
+ y: round(y * dpr) / dpr || 0
689
692
  };
690
693
  }
691
694
 
@@ -700,14 +703,23 @@ function mapToStyles(_ref2) {
700
703
  position = _ref2.position,
701
704
  gpuAcceleration = _ref2.gpuAcceleration,
702
705
  adaptive = _ref2.adaptive,
703
- roundOffsets = _ref2.roundOffsets;
704
-
705
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
706
- _ref3$x = _ref3.x,
707
- x = _ref3$x === void 0 ? 0 : _ref3$x,
708
- _ref3$y = _ref3.y,
709
- y = _ref3$y === void 0 ? 0 : _ref3$y;
706
+ roundOffsets = _ref2.roundOffsets,
707
+ isFixed = _ref2.isFixed;
708
+ var _offsets$x = offsets.x,
709
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
710
+ _offsets$y = offsets.y,
711
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
712
+
713
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
714
+ x: x,
715
+ y: y
716
+ }) : {
717
+ x: x,
718
+ y: y
719
+ };
710
720
 
721
+ x = _ref3.x;
722
+ y = _ref3.y;
711
723
  var hasX = offsets.hasOwnProperty('x');
712
724
  var hasY = offsets.hasOwnProperty('y');
713
725
  var sideX = left;
@@ -732,16 +744,18 @@ function mapToStyles(_ref2) {
732
744
  offsetParent = offsetParent;
733
745
 
734
746
  if (placement === top || (placement === left || placement === right) && variation === end) {
735
- sideY = bottom; // $FlowFixMe[prop-missing]
736
-
737
- y -= offsetParent[heightProp] - popperRect.height;
747
+ sideY = bottom;
748
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
749
+ offsetParent[heightProp];
750
+ y -= offsetY - popperRect.height;
738
751
  y *= gpuAcceleration ? 1 : -1;
739
752
  }
740
753
 
741
754
  if (placement === left || (placement === top || placement === bottom) && variation === end) {
742
- sideX = right; // $FlowFixMe[prop-missing]
743
-
744
- x -= offsetParent[widthProp] - popperRect.width;
755
+ sideX = right;
756
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
757
+ offsetParent[widthProp];
758
+ x -= offsetX - popperRect.width;
745
759
  x *= gpuAcceleration ? 1 : -1;
746
760
  }
747
761
  }
@@ -750,6 +764,17 @@ function mapToStyles(_ref2) {
750
764
  position: position
751
765
  }, adaptive && unsetSides);
752
766
 
767
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
768
+ x: x,
769
+ y: y
770
+ }) : {
771
+ x: x,
772
+ y: y
773
+ };
774
+
775
+ x = _ref4.x;
776
+ y = _ref4.y;
777
+
753
778
  if (gpuAcceleration) {
754
779
  var _Object$assign;
755
780
 
@@ -759,9 +784,9 @@ function mapToStyles(_ref2) {
759
784
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
760
785
  }
761
786
 
762
- function computeStyles(_ref4) {
763
- var state = _ref4.state,
764
- options = _ref4.options;
787
+ function computeStyles(_ref5) {
788
+ var state = _ref5.state,
789
+ options = _ref5.options;
765
790
  var _options$gpuAccelerat = options.gpuAcceleration,
766
791
  gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
767
792
  _options$adaptive = options.adaptive,
@@ -774,7 +799,8 @@ function computeStyles(_ref4) {
774
799
  variation: getVariation(state.placement),
775
800
  popper: state.elements.popper,
776
801
  popperRect: state.rects.popper,
777
- gpuAcceleration: gpuAcceleration
802
+ gpuAcceleration: gpuAcceleration,
803
+ isFixed: state.options.strategy === 'fixed'
778
804
  };
779
805
 
780
806
  if (state.modifiersData.popperOffsets != null) {
@@ -1032,7 +1058,7 @@ function getInnerBoundingClientRect(element) {
1032
1058
  }
1033
1059
 
1034
1060
  function getClientRectFromMixedType(element, clippingParent) {
1035
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
1061
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement$1(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
1036
1062
  } // A "clipping parent" is an overflowable container with the characteristic of
1037
1063
  // clipping (or hiding) overflowing elements with a position different from
1038
1064
  // `initial`
@@ -1545,6 +1571,14 @@ function preventOverflow(_ref) {
1545
1571
  var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1546
1572
  placement: state.placement
1547
1573
  })) : tetherOffset;
1574
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1575
+ mainAxis: tetherOffsetValue,
1576
+ altAxis: tetherOffsetValue
1577
+ } : Object.assign({
1578
+ mainAxis: 0,
1579
+ altAxis: 0
1580
+ }, tetherOffsetValue);
1581
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1548
1582
  var data = {
1549
1583
  x: 0,
1550
1584
  y: 0
@@ -1554,13 +1588,15 @@ function preventOverflow(_ref) {
1554
1588
  return;
1555
1589
  }
1556
1590
 
1557
- if (checkMainAxis || checkAltAxis) {
1591
+ if (checkMainAxis) {
1592
+ var _offsetModifierState$;
1593
+
1558
1594
  var mainSide = mainAxis === 'y' ? top : left;
1559
1595
  var altSide = mainAxis === 'y' ? bottom : right;
1560
1596
  var len = mainAxis === 'y' ? 'height' : 'width';
1561
1597
  var offset = popperOffsets[mainAxis];
1562
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
1563
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
1598
+ var min$1 = offset + overflow[mainSide];
1599
+ var max$1 = offset - overflow[altSide];
1564
1600
  var additive = tether ? -popperRect[len] / 2 : 0;
1565
1601
  var minLen = variation === start ? referenceRect[len] : popperRect[len];
1566
1602
  var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
@@ -1580,36 +1616,45 @@ function preventOverflow(_ref) {
1580
1616
  // width or height)
1581
1617
 
1582
1618
  var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1583
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1584
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1619
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1620
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1585
1621
  var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1586
1622
  var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1587
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1588
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1589
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1623
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1624
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1625
+ var tetherMax = offset + maxOffset - offsetModifierValue;
1626
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1627
+ popperOffsets[mainAxis] = preventedOffset;
1628
+ data[mainAxis] = preventedOffset - offset;
1629
+ }
1590
1630
 
1591
- if (checkMainAxis) {
1592
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1593
- popperOffsets[mainAxis] = preventedOffset;
1594
- data[mainAxis] = preventedOffset - offset;
1595
- }
1631
+ if (checkAltAxis) {
1632
+ var _offsetModifierState$2;
1596
1633
 
1597
- if (checkAltAxis) {
1598
- var _mainSide = mainAxis === 'x' ? top : left;
1634
+ var _mainSide = mainAxis === 'x' ? top : left;
1599
1635
 
1600
- var _altSide = mainAxis === 'x' ? bottom : right;
1636
+ var _altSide = mainAxis === 'x' ? bottom : right;
1601
1637
 
1602
- var _offset = popperOffsets[altAxis];
1638
+ var _offset = popperOffsets[altAxis];
1603
1639
 
1604
- var _min = _offset + overflow[_mainSide];
1640
+ var _len = altAxis === 'y' ? 'height' : 'width';
1605
1641
 
1606
- var _max = _offset - overflow[_altSide];
1642
+ var _min = _offset + overflow[_mainSide];
1607
1643
 
1608
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
1644
+ var _max = _offset - overflow[_altSide];
1609
1645
 
1610
- popperOffsets[altAxis] = _preventedOffset;
1611
- data[altAxis] = _preventedOffset - _offset;
1612
- }
1646
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1647
+
1648
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1649
+
1650
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1651
+
1652
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1653
+
1654
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1655
+
1656
+ popperOffsets[altAxis] = _preventedOffset;
1657
+ data[altAxis] = _preventedOffset - _offset;
1613
1658
  }
1614
1659
 
1615
1660
  state.modifiersData[name] = data;
@@ -1641,8 +1686,8 @@ function getNodeScroll(node) {
1641
1686
 
1642
1687
  function isElementScaled(element) {
1643
1688
  var rect = element.getBoundingClientRect();
1644
- var scaleX = rect.width / element.offsetWidth || 1;
1645
- var scaleY = rect.height / element.offsetHeight || 1;
1689
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
1690
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
1646
1691
  return scaleX !== 1 || scaleY !== 1;
1647
1692
  } // Returns the composite rect of an element relative to its offsetParent.
1648
1693
  // Composite means it takes into account transforms as well as layout.
@@ -1654,9 +1699,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1654
1699
  }
1655
1700
 
1656
1701
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
1657
- isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1702
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1658
1703
  var documentElement = getDocumentElement(offsetParent);
1659
- var rect = getBoundingClientRect(elementOrVirtualElement);
1704
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1660
1705
  var scroll = {
1661
1706
  scrollLeft: 0,
1662
1707
  scrollTop: 0
@@ -1673,7 +1718,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1673
1718
  }
1674
1719
 
1675
1720
  if (isHTMLElement(offsetParent)) {
1676
- offsets = getBoundingClientRect(offsetParent);
1721
+ offsets = getBoundingClientRect(offsetParent, true);
1677
1722
  offsets.x += offsetParent.clientLeft;
1678
1723
  offsets.y += offsetParent.clientTop;
1679
1724
  } else if (documentElement) {
@@ -5665,49 +5710,29 @@ var namespaceEmitter = function createNamespaceEmitter () {
5665
5710
 
5666
5711
  let urlAlphabet =
5667
5712
  'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
5668
-
5669
- let random = bytes => crypto.getRandomValues(new Uint8Array(bytes));
5670
- let customRandom = (alphabet, size, getRandom) => {
5671
- let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1;
5672
- let step = -~((1.6 * mask * size) / alphabet.length);
5713
+ let customAlphabet = (alphabet, size) => {
5673
5714
  return () => {
5674
5715
  let id = '';
5675
- while (true) {
5676
- let bytes = getRandom(step);
5677
- let j = step;
5678
- while (j--) {
5679
- id += alphabet[bytes[j] & mask] || '';
5680
- if (id.length === size) return id
5681
- }
5716
+ let i = size;
5717
+ while (i--) {
5718
+ id += alphabet[(Math.random() * alphabet.length) | 0];
5682
5719
  }
5720
+ return id
5683
5721
  }
5684
5722
  };
5685
- let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random);
5686
5723
  let nanoid$2 = (size = 21) => {
5687
5724
  let id = '';
5688
- let bytes = crypto.getRandomValues(new Uint8Array(size));
5689
- while (size--) {
5690
- let byte = bytes[size] & 63;
5691
- if (byte < 36) {
5692
- id += byte.toString(36);
5693
- } else if (byte < 62) {
5694
- id += (byte - 26).toString(36).toUpperCase();
5695
- } else if (byte < 63) {
5696
- id += '_';
5697
- } else {
5698
- id += '-';
5699
- }
5725
+ let i = size;
5726
+ while (i--) {
5727
+ id += urlAlphabet[(Math.random() * 64) | 0];
5700
5728
  }
5701
5729
  return id
5702
5730
  };
5703
5731
 
5704
- const index_browser = /*#__PURE__*/Object.freeze({
5732
+ const nonSecure = /*#__PURE__*/Object.freeze({
5705
5733
  __proto__: null,
5706
5734
  nanoid: nanoid$2,
5707
- customAlphabet: customAlphabet,
5708
- customRandom: customRandom,
5709
- urlAlphabet: urlAlphabet,
5710
- random: random
5735
+ customAlphabet: customAlphabet
5711
5736
  });
5712
5737
 
5713
5738
  /**
@@ -6344,13 +6369,17 @@ class DefaultStore {
6344
6369
 
6345
6370
  }
6346
6371
 
6347
- function _publish2(...args) {
6372
+ function _publish2() {
6373
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6374
+ args[_key] = arguments[_key];
6375
+ }
6376
+
6348
6377
  this.callbacks.forEach(listener => {
6349
6378
  listener(...args);
6350
6379
  });
6351
6380
  }
6352
6381
 
6353
- DefaultStore.VERSION = "2.0.2";
6382
+ DefaultStore.VERSION = "2.0.3";
6354
6383
 
6355
6384
  var lib$5 = function defaultStore() {
6356
6385
  return new DefaultStore();
@@ -6573,21 +6602,100 @@ var getTimeStamp = function getTimeStamp() {
6573
6602
  const justErrorsLogger$1 = {
6574
6603
  debug: () => {},
6575
6604
  warn: () => {},
6576
- error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args)
6605
+ error: function () {
6606
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6607
+ args[_key] = arguments[_key];
6608
+ }
6609
+
6610
+ return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);
6611
+ }
6577
6612
  }; // Print logs to console with namespace + timestamp,
6578
6613
  // set by logger: Uppy.debugLogger or debug: true
6579
6614
 
6580
6615
  const debugLogger$2 = {
6581
- debug: (...args) => console.debug(`[Uppy] [${getTimeStamp()}]`, ...args),
6582
- warn: (...args) => console.warn(`[Uppy] [${getTimeStamp()}]`, ...args),
6583
- error: (...args) => console.error(`[Uppy] [${getTimeStamp()}]`, ...args)
6616
+ debug: function () {
6617
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6618
+ args[_key2] = arguments[_key2];
6619
+ }
6620
+
6621
+ return console.debug(`[Uppy] [${getTimeStamp()}]`, ...args);
6622
+ },
6623
+ warn: function () {
6624
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
6625
+ args[_key3] = arguments[_key3];
6626
+ }
6627
+
6628
+ return console.warn(`[Uppy] [${getTimeStamp()}]`, ...args);
6629
+ },
6630
+ error: function () {
6631
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
6632
+ args[_key4] = arguments[_key4];
6633
+ }
6634
+
6635
+ return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);
6636
+ }
6584
6637
  };
6585
6638
  var loggers = {
6586
6639
  justErrorsLogger: justErrorsLogger$1,
6587
6640
  debugLogger: debugLogger$2
6588
6641
  };
6589
6642
 
6590
- const require$$0 = /*@__PURE__*/evEmitter.getAugmentedNamespace(index_browser);
6643
+ var locale$2 = {
6644
+ strings: {
6645
+ addBulkFilesFailed: {
6646
+ 0: 'Failed to add %{smart_count} file due to an internal error',
6647
+ 1: 'Failed to add %{smart_count} files due to internal errors'
6648
+ },
6649
+ youCanOnlyUploadX: {
6650
+ 0: 'You can only upload %{smart_count} file',
6651
+ 1: 'You can only upload %{smart_count} files'
6652
+ },
6653
+ youHaveToAtLeastSelectX: {
6654
+ 0: 'You have to select at least %{smart_count} file',
6655
+ 1: 'You have to select at least %{smart_count} files'
6656
+ },
6657
+ exceedsSize: '%{file} exceeds maximum allowed size of %{size}',
6658
+ missingRequiredMetaField: 'Missing required meta fields',
6659
+ missingRequiredMetaFieldOnFile: 'Missing required meta fields in %{fileName}',
6660
+ inferiorSize: 'This file is smaller than the allowed size of %{size}',
6661
+ youCanOnlyUploadFileTypes: 'You can only upload: %{types}',
6662
+ noMoreFilesAllowed: 'Cannot add more files',
6663
+ noDuplicates: "Cannot add the duplicate file '%{fileName}', it already exists",
6664
+ companionError: 'Connection with Companion failed',
6665
+ authAborted: 'Authentication aborted',
6666
+ companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}',
6667
+ failedToUpload: 'Failed to upload %{file}',
6668
+ noInternetConnection: 'No Internet connection',
6669
+ connectedToInternet: 'Connected to the Internet',
6670
+ // Strings for remote providers
6671
+ noFilesFound: 'You have no files or folders here',
6672
+ selectX: {
6673
+ 0: 'Select %{smart_count}',
6674
+ 1: 'Select %{smart_count}'
6675
+ },
6676
+ allFilesFromFolderNamed: 'All files from folder %{name}',
6677
+ openFolderNamed: 'Open folder %{name}',
6678
+ cancel: 'Cancel',
6679
+ logOut: 'Log out',
6680
+ filter: 'Filter',
6681
+ resetFilter: 'Reset filter',
6682
+ loading: 'Loading...',
6683
+ authenticateWithTitle: 'Please authenticate with %{pluginName} to select files',
6684
+ authenticateWith: 'Connect to %{pluginName}',
6685
+ signInWithGoogle: 'Sign in with Google',
6686
+ searchImages: 'Search for images',
6687
+ enterTextToSearch: 'Enter text to search for images',
6688
+ backToSearch: 'Back to Search',
6689
+ emptyFolderAdded: 'No files were added from empty folder',
6690
+ folderAlreadyAdded: 'The folder "%{folder}" was already added',
6691
+ folderAdded: {
6692
+ 0: 'Added %{smart_count} file from %{folder}',
6693
+ 1: 'Added %{smart_count} files from %{folder}'
6694
+ }
6695
+ }
6696
+ };
6697
+
6698
+ const require$$0 = /*@__PURE__*/evEmitter.getAugmentedNamespace(nonSecure);
6591
6699
 
6592
6700
  let _Symbol$for$1, _Symbol$for2$1;
6593
6701
 
@@ -6626,12 +6734,14 @@ const {
6626
6734
  const {
6627
6735
  justErrorsLogger,
6628
6736
  debugLogger: debugLogger$1
6629
- } = loggers; // Exported from here.
6737
+ } = loggers;
6738
+
6739
+ // Exported from here.
6630
6740
 
6631
6741
 
6632
6742
  class RestrictionError extends Error {
6633
- constructor(...args) {
6634
- super(...args);
6743
+ constructor() {
6744
+ super(...arguments);
6635
6745
  this.isRestriction = true;
6636
6746
  }
6637
6747
 
@@ -6649,8 +6759,8 @@ if (typeof AggregateError === 'undefined') {
6649
6759
  }
6650
6760
 
6651
6761
  class AggregateRestrictionError extends AggregateError {
6652
- constructor(...args) {
6653
- super(...args);
6762
+ constructor() {
6763
+ super(...arguments);
6654
6764
  this.isRestriction = true;
6655
6765
  }
6656
6766
 
@@ -6783,60 +6893,7 @@ class Uppy {
6783
6893
  writable: true,
6784
6894
  value: this.updateOnlineStatus.bind(this)
6785
6895
  });
6786
- this.defaultLocale = {
6787
- strings: {
6788
- addBulkFilesFailed: {
6789
- 0: 'Failed to add %{smart_count} file due to an internal error',
6790
- 1: 'Failed to add %{smart_count} files due to internal errors'
6791
- },
6792
- youCanOnlyUploadX: {
6793
- 0: 'You can only upload %{smart_count} file',
6794
- 1: 'You can only upload %{smart_count} files'
6795
- },
6796
- youHaveToAtLeastSelectX: {
6797
- 0: 'You have to select at least %{smart_count} file',
6798
- 1: 'You have to select at least %{smart_count} files'
6799
- },
6800
- exceedsSize: '%{file} exceeds maximum allowed size of %{size}',
6801
- missingRequiredMetaField: 'Missing required meta fields',
6802
- missingRequiredMetaFieldOnFile: 'Missing required meta fields in %{fileName}',
6803
- inferiorSize: 'This file is smaller than the allowed size of %{size}',
6804
- youCanOnlyUploadFileTypes: 'You can only upload: %{types}',
6805
- noMoreFilesAllowed: 'Cannot add more files',
6806
- noDuplicates: 'Cannot add the duplicate file \'%{fileName}\', it already exists',
6807
- companionError: 'Connection with Companion failed',
6808
- authAborted: 'Authentication aborted',
6809
- companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}',
6810
- failedToUpload: 'Failed to upload %{file}',
6811
- noInternetConnection: 'No Internet connection',
6812
- connectedToInternet: 'Connected to the Internet',
6813
- // Strings for remote providers
6814
- noFilesFound: 'You have no files or folders here',
6815
- selectX: {
6816
- 0: 'Select %{smart_count}',
6817
- 1: 'Select %{smart_count}'
6818
- },
6819
- allFilesFromFolderNamed: 'All files from folder %{name}',
6820
- openFolderNamed: 'Open folder %{name}',
6821
- cancel: 'Cancel',
6822
- logOut: 'Log out',
6823
- filter: 'Filter',
6824
- resetFilter: 'Reset filter',
6825
- loading: 'Loading...',
6826
- authenticateWithTitle: 'Please authenticate with %{pluginName} to select files',
6827
- authenticateWith: 'Connect to %{pluginName}',
6828
- signInWithGoogle: 'Sign in with Google',
6829
- searchImages: 'Search for images',
6830
- enterTextToSearch: 'Enter text to search for images',
6831
- backToSearch: 'Back to Search',
6832
- emptyFolderAdded: 'No files were added from empty folder',
6833
- folderAlreadyAdded: 'The folder "%{folder}" was already added',
6834
- folderAdded: {
6835
- 0: 'Added %{smart_count} file from %{folder}',
6836
- 1: 'Added %{smart_count} files from %{folder}'
6837
- }
6838
- }
6839
- };
6896
+ this.defaultLocale = locale$2;
6840
6897
  const defaultOptions = {
6841
6898
  id: 'uppy',
6842
6899
  autoProceed: false,
@@ -6926,7 +6983,11 @@ class Uppy {
6926
6983
  _classPrivateFieldLooseBase$8(this, _addListeners)[_addListeners]();
6927
6984
  }
6928
6985
 
6929
- emit(event, ...args) {
6986
+ emit(event) {
6987
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6988
+ args[_key - 1] = arguments[_key];
6989
+ }
6990
+
6930
6991
  _classPrivateFieldLooseBase$8(this, _emitter$2)[_emitter$2].emit(event, ...args);
6931
6992
  }
6932
6993
 
@@ -7158,9 +7219,12 @@ class Uppy {
7158
7219
  error
7159
7220
  } = this.getState();
7160
7221
  const files = Object.values(filesObject);
7161
- const inProgressFiles = files.filter(({
7162
- progress
7163
- }) => !progress.uploadComplete && progress.uploadStarted);
7222
+ const inProgressFiles = files.filter(_ref => {
7223
+ let {
7224
+ progress
7225
+ } = _ref;
7226
+ return !progress.uploadComplete && progress.uploadStarted;
7227
+ });
7164
7228
  const newFiles = files.filter(file => !file.progress.uploadStarted);
7165
7229
  const startedFiles = files.filter(file => file.progress.uploadStarted || file.progress.preprocess || file.progress.postprocess);
7166
7230
  const uploadStartedFiles = files.filter(file => file.progress.uploadStarted);
@@ -7424,7 +7488,11 @@ class Uppy {
7424
7488
  }
7425
7489
  }
7426
7490
 
7427
- removeFile(fileID, reason = null) {
7491
+ removeFile(fileID, reason) {
7492
+ if (reason === void 0) {
7493
+ reason = null;
7494
+ }
7495
+
7428
7496
  this.removeFiles([fileID], reason);
7429
7497
  }
7430
7498
 
@@ -7810,7 +7878,15 @@ class Uppy {
7810
7878
  */
7811
7879
 
7812
7880
 
7813
- info(message, type = 'info', duration = 3000) {
7881
+ info(message, type, duration) {
7882
+ if (type === void 0) {
7883
+ type = 'info';
7884
+ }
7885
+
7886
+ if (duration === void 0) {
7887
+ duration = 3000;
7888
+ }
7889
+
7814
7890
  const isComplexMessage = typeof message === 'object';
7815
7891
  this.setState({
7816
7892
  info: [...this.getState().info, {
@@ -7874,8 +7950,8 @@ class Uppy {
7874
7950
  */
7875
7951
 
7876
7952
 
7877
- [_Symbol$for2$1](...args) {
7878
- return _classPrivateFieldLooseBase$8(this, _createUpload)[_createUpload](...args);
7953
+ [_Symbol$for2$1]() {
7954
+ return _classPrivateFieldLooseBase$8(this, _createUpload)[_createUpload](...arguments);
7879
7955
  }
7880
7956
 
7881
7957
  /**
@@ -7974,7 +8050,11 @@ class Uppy {
7974
8050
 
7975
8051
  }
7976
8052
 
7977
- function _checkRestrictions2(file, files = this.getFiles()) {
8053
+ function _checkRestrictions2(file, files) {
8054
+ if (files === void 0) {
8055
+ files = this.getFiles();
8056
+ }
8057
+
7978
8058
  const {
7979
8059
  maxFileSize,
7980
8060
  minFileSize,
@@ -8106,11 +8186,12 @@ function _checkRequiredMetaFields2(files) {
8106
8186
  }
8107
8187
  }
8108
8188
 
8109
- function _showOrLogErrorAndThrow2(err, {
8110
- showInformer = true,
8111
- file = null,
8112
- throwErr = true
8113
- } = {}) {
8189
+ function _showOrLogErrorAndThrow2(err, _temp) {
8190
+ let {
8191
+ showInformer = true,
8192
+ file = null,
8193
+ throwErr = true
8194
+ } = _temp === void 0 ? {} : _temp;
8114
8195
  const message = typeof err === 'object' ? err.message : err;
8115
8196
  const details = typeof err === 'object' && err.details ? err.details : ''; // Restriction errors should be logged, but not as errors,
8116
8197
  // as they are expected and shown in the UI.
@@ -8415,7 +8496,11 @@ function _addListeners2() {
8415
8496
  }
8416
8497
  }
8417
8498
 
8418
- function _createUpload2(fileIDs, opts = {}) {
8499
+ function _createUpload2(fileIDs, opts) {
8500
+ if (opts === void 0) {
8501
+ opts = {};
8502
+ }
8503
+
8419
8504
  // uppy.retryAll sets this to true — when retrying we want to ignore `allowNewUpload: false`
8420
8505
  const {
8421
8506
  forceAllowNewUpload = false
@@ -8469,7 +8554,7 @@ async function _runUpload2(uploadID) {
8469
8554
  } = this.getState();
8470
8555
  let currentUpload = currentUploads[uploadID];
8471
8556
  const restoreStep = currentUpload.step || 0;
8472
- const steps = [...Array.from(_classPrivateFieldLooseBase$8(this, _preProcessors)[_preProcessors]), ...Array.from(_classPrivateFieldLooseBase$8(this, _uploaders)[_uploaders]), ...Array.from(_classPrivateFieldLooseBase$8(this, _postProcessors)[_postProcessors])];
8557
+ const steps = [..._classPrivateFieldLooseBase$8(this, _preProcessors)[_preProcessors], ..._classPrivateFieldLooseBase$8(this, _uploaders)[_uploaders], ..._classPrivateFieldLooseBase$8(this, _postProcessors)[_postProcessors]];
8473
8558
 
8474
8559
  try {
8475
8560
  for (let step = restoreStep; step < steps.length; step++) {
@@ -8553,10 +8638,10 @@ async function _runUpload2(uploadID) {
8553
8638
  return result;
8554
8639
  }
8555
8640
 
8556
- Uppy.VERSION = "2.1.2";
8641
+ Uppy.VERSION = "2.1.4";
8557
8642
  var Uppy_1$1 = Uppy;
8558
8643
 
8559
- var n,l,u,i,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h$1(n){var l=n.parentNode;l&&l.removeChild(n);}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function p(){return {current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)));});}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h]);}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l);}):l.push(n)),l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else {for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r;}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&(s===l||(d?s.localName==d:3==s.nodeType))){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h$1(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u);}function q(n,l){S(n,l,q);}function B(l,u,i){var t,r,o,f=a({},l.props);for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,r||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
8644
+ var n,l,u,i,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h$1(n){var l=n.parentNode;l&&l.removeChild(n);}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function p(){return {current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)));});}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h]);}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function A(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A(n,l);}):l.push(n)),l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else {for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r;}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h$1(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==y.value||_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h$1(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u);}function q(n,l){S(n,l,q);}function B(l,u,i){var t,r,o,f=a({},l.props);for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),y(l.type,f,t||l.key,r||l.ref,null)}function D(n,l){var u={__c:l="__cC"+f++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n}},u=0,i=function(n){return null!=n&&void 0===n.constructor},_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
8560
8645
 
8561
8646
  const preact_module = /*#__PURE__*/Object.freeze({
8562
8647
  __proto__: null,
@@ -8591,7 +8676,11 @@ var isDOMElement = function isDOMElement(obj) {
8591
8676
  */
8592
8677
 
8593
8678
 
8594
- var findDOMElement = function findDOMElement(element, context = document) {
8679
+ var findDOMElement = function findDOMElement(element, context) {
8680
+ if (context === void 0) {
8681
+ context = document;
8682
+ }
8683
+
8595
8684
  if (typeof element === 'string') {
8596
8685
  return context.querySelector(element);
8597
8686
  }
@@ -8614,7 +8703,11 @@ var findDOMElement = function findDOMElement(element, context = document) {
8614
8703
 
8615
8704
 
8616
8705
  var BasePlugin_1$1 = class BasePlugin {
8617
- constructor(uppy, opts = {}) {
8706
+ constructor(uppy, opts) {
8707
+ if (opts === void 0) {
8708
+ opts = {};
8709
+ }
8710
+
8618
8711
  this.uppy = uppy;
8619
8712
  this.opts = opts;
8620
8713
  }
@@ -8719,7 +8812,11 @@ const {
8719
8812
  function debounce(fn) {
8720
8813
  let calling = null;
8721
8814
  let latestArgs = null;
8722
- return (...args) => {
8815
+ return function () {
8816
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8817
+ args[_key] = arguments[_key];
8818
+ }
8819
+
8723
8820
  latestArgs = args;
8724
8821
 
8725
8822
  if (!calling) {
@@ -8747,8 +8844,8 @@ function debounce(fn) {
8747
8844
  var _updateUI = /*#__PURE__*/_classPrivateFieldLooseKey$7("updateUI");
8748
8845
 
8749
8846
  class UIPlugin$2 extends BasePlugin_1$1 {
8750
- constructor(...args) {
8751
- super(...args);
8847
+ constructor() {
8848
+ super(...arguments);
8752
8849
  Object.defineProperty(this, _updateUI, {
8753
8850
  writable: true,
8754
8851
  value: void 0
@@ -9000,6 +9097,12 @@ var mini_legacy_umd = evEmitter.createCommonjsModule(function (module, exports)
9000
9097
  !function(e,t){t(exports);}(evEmitter.commonjsGlobal,(function(e){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});var n=["prototype","__proto__","caller","arguments","length","name"];Object.getOwnPropertyNames(t).forEach((function(r){-1===n.indexOf(r)&&e[r]!==t[r]&&(e[r]=t[r]);})),t&&u(e,t);}function s(e){return (s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return (u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return !1}}function f(e,t,n){return (f=o()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function c(e){var t="function"==typeof Map?new Map:void 0;return (c=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r);}function r(){return f(e,arguments,s(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return !t||"object"!=typeof t&&"function"!=typeof t?h(e):t}function d(e){var t=o();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i);}else n=r.apply(this,arguments);return l(this,n)}}function v(e,t,n){return (v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var p=Object.values||function(e){var t=[];for(var n in e)t.push(e[n]);return t},y=Object.entries||function(e){var t=[];for(var n in e)t.push([n,e[n]]);return t},g=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){for(var n in t)e[n]=t[n];})),e},k=Object.fromEntries||function(e){var t={};return m(e).forEach((function(e){var n=e[0],r=e[1];t[n]=r;})),t},m=Array.from||function(e){if(e instanceof P){var t=[];return e.forEach((function(e,n){return t.push([n,e])})),t}return Array.prototype.slice.call(e)};function b(e){return -1!==this.indexOf(e)}Array.prototype.includes||(Array.prototype.includes=b),String.prototype.includes||(String.prototype.includes=b),String.prototype.startsWith||(String.prototype.startsWith=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.substring(t,t+e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return this.substring(t-e.length,t)===e});var A="undefined"!=typeof self?self:evEmitter.commonjsGlobal,w=A.fetch||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var i=new XMLHttpRequest;if(i.open("get",e,!0),i.responseType="arraybuffer",i.onerror=r,t.headers)for(var a in t.headers)i.setRequestHeader(a,t.headers[a]);i.onload=function(){n({ok:i.status>=200&&i.status<300,status:i.status,arrayBuffer:function(){return Promise.resolve(i.response)}});},i.send(null);}))},O=function(e){var t=[];if(Object.defineProperties(t,{size:{get:function(){return this.length}},has:{value:function(e){return -1!==this.indexOf(e)}},add:{value:function(e){this.has(e)||this.push(e);}},delete:{value:function(e){if(this.has(e)){var t=this.indexOf(e);this.splice(t,1);}}}}),Array.isArray(e))for(var n=0;n<e.length;n++)t.add(e[n]);return t},S=function(e){return new P(e)},P=void 0!==A.Map&&void 0!==A.Map.prototype.keys?A.Map:function(){function e(n){if(t(this,e),this.clear(),n)for(var r=0;r<n.length;r++)this.set(n[r][0],n[r][1]);}return r(e,[{key:"clear",value:function(){this._map={},this._keys=[];}},{key:"size",get:function(){return this._keys.length}},{key:"get",value:function(e){return this._map["map_"+e]}},{key:"set",value:function(e,t){return this._map["map_"+e]=t,this._keys.indexOf(e)<0&&this._keys.push(e),this}},{key:"has",value:function(e){return this._keys.indexOf(e)>=0}},{key:"delete",value:function(e){var t=this._keys.indexOf(e);return !(t<0)&&(delete this._map["map_"+e],this._keys.splice(t,1),!0)}},{key:"keys",value:function(){return this._keys.slice(0)}},{key:"values",value:function(){var e=this;return this._keys.map((function(t){return e.get(t)}))}},{key:"entries",value:function(){var e=this;return this._keys.map((function(t){return [t,e.get(t)]}))}},{key:"forEach",value:function(e,t){for(var n=0;n<this._keys.length;n++)e.call(t,this._map["map_"+this._keys[n]],this._keys[n],this);}}]),e}(),U="undefined"!=typeof self?self:evEmitter.commonjsGlobal,x="undefined"!=typeof navigator,C=x&&"undefined"==typeof HTMLImageElement,B=!("undefined"==typeof evEmitter.commonjsGlobal||"undefined"==typeof process||!process.versions||!process.versions.node),j=U.Buffer,_=!!j;var V=function(e){return void 0!==e};function I(e){return void 0===e||(e instanceof P?0===e.size:0===p(e).filter(V).length)}function L(e){var t=new Error(e);throw delete t.stack,t}function T(e){var t=function(e){var t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}var z=function(e){return String.fromCharCode.apply(null,e)},F="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;function E(e){return F?F.decode(e):_?Buffer.from(e).toString("utf8"):decodeURIComponent(escape(z(e)))}var D=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if(t(this,e),"boolean"==typeof a&&(this.le=a),Array.isArray(n)&&(n=new Uint8Array(n)),0===n)this.byteOffset=0,this.byteLength=0;else if(n instanceof ArrayBuffer){void 0===i&&(i=n.byteLength-r);var s=new DataView(n,r,i);this._swapDataView(s);}else if(n instanceof Uint8Array||n instanceof DataView||n instanceof e){void 0===i&&(i=n.byteLength-r),(r+=n.byteOffset)+i>n.byteOffset+n.byteLength&&L("Creating view outside of available memory in ArrayBuffer");var u=new DataView(n.buffer,r,i);this._swapDataView(u);}else if("number"==typeof n){var o=new DataView(new ArrayBuffer(n));this._swapDataView(o);}else L("Invalid input argument for BufferView: "+n);}return r(e,[{key:"_swapArrayBuffer",value:function(e){this._swapDataView(new DataView(e));}},{key:"_swapBuffer",value:function(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength));}},{key:"_swapDataView",value:function(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength;}},{key:"_lengthToEnd",value:function(e){return this.byteLength-e}},{key:"set",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;t instanceof DataView||t instanceof e?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||L("BufferView.set(): Invalid data argument.");var i=this.toUint8();return i.set(t,n),new r(this,n,t.byteLength)}},{key:"subarray",value:function(t,n){return new e(this,t,n=n||this._lengthToEnd(t))}},{key:"toUint8",value:function(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}},{key:"getUint8Array",value:function(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}},{key:"getString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,n=this.getUint8Array(e,t);return E(n)}},{key:"getLatin1String",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,n=this.getUint8Array(e,t);return z(n)}},{key:"getUnicodeString",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,n=[],r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return z(n)}},{key:"getInt8",value:function(e){return this.dataView.getInt8(e)}},{key:"getUint8",value:function(e){return this.dataView.getUint8(e)}},{key:"getInt16",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt16(e,t)}},{key:"getInt32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt32(e,t)}},{key:"getUint16",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint16(e,t)}},{key:"getUint32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint32(e,t)}},{key:"getFloat32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getDouble",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getUintBytes",value:function(e,t,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}},{key:"getUint",value:function(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}},{key:"toString",value:function(e){return this.dataView.toString(e,this.constructor.name)}},{key:"ensureChunk",value:function(){}}],[{key:"from",value:function(t,n){return t instanceof this&&t.le===n?t:new e(t,void 0,void 0,n)}}]),e}();function R(e,t){L("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."));}var N=function(e){a(i,e);var n=d(i);function i(e){var r;return t(this,i),(r=n.call(this)).kind=e,r}return r(i,[{key:"get",value:function(e,t){return this.has(e)||R(this.kind,e),t&&(e in t||function(e,t){L("Unknown ".concat(e," '").concat(t,"'."));}(this.kind,e),t[e].enabled||R(this.kind,e)),v(s(i.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return m(this.keys())}}]),i}(c(P)),M=new N("file parser"),W=new N("segment parser"),K=new N("file reader");function H(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function X(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Y=H((function(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){return t(r.result||new ArrayBuffer)},r.onerror=n,r.readAsArrayBuffer(e);}))})),G=H((function(e){return w(e).then((function(e){return e.arrayBuffer()}))})),J=H((function(e,t){return X(t(e),(function(e){return new D(e)}))})),q=H((function(e,t,n){var r=new(K.get(n))(e,t);return X(r.read(),(function(){return r}))})),Q=H((function(e,t,n,r){return K.has(n)?q(e,t,n):r?J(e,r):(L("Parser ".concat(n," is not loaded")),X())})),Z="Invalid input argument";function $(e,t){return (n=e).startsWith("data:")||n.length>1e4?q(e,t,"base64"):x?Q(e,t,"url",G):B?q(e,t,"fs"):void L(Z);var n;}var ee=function(e){a(i,e);var n=d(i);function i(){return t(this,i),n.apply(this,arguments)}return r(i,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=m(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=m(this.values())),this.allValues}}]),i}(c(P));function te(e,t,n){var r=new ee,i=n;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++){var s=i[a],u=s[0],o=s[1];r.set(u,o);}if(Array.isArray(t)){var f=t;Array.isArray(f)||("function"==typeof f.entries&&(f=f.entries()),f=m(f));for(var c=0;c<f.length;c++){var h=f[c];e.set(h,r);}}else e.set(t,r);return r}function ne(e,t,n){var r,i=e.get(t),a=n;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=m(a));for(var s=0;s<a.length;s++)r=a[s],i.set(r[0],r[1]);}var re=S(),ie=S(),ae=S(),se=37500,ue=37510,oe=33723,fe=34675,ce=34665,he=34853,le=40965,de=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ve=["jfif","xmp","icc","iptc","ihdr"],pe=["tiff"].concat(ve),ye=["ifd0","ifd1","exif","gps","interop"],ge=[].concat(pe,ye),ke=["makerNote","userComment"],me=["translateKeys","translateValues","reviveValues","multiSegment"],be=[].concat(me,["sanitize","mergeOutput","silentErrors"]),Ae=function(){function e(){t(this,e);}return r(e,[{key:"translate",get:function(){return this.translateKeys||this.translateValues||this.reviveValues}}]),e}(),we=function(e){a(s,e);var n=d(s);function s(e,r,a,u){var o;if(t(this,s),i(h(o=n.call(this)),"enabled",!1),i(h(o),"skip",O()),i(h(o),"pick",O()),i(h(o),"deps",O()),i(h(o),"translateKeys",!1),i(h(o),"translateValues",!1),i(h(o),"reviveValues",!1),o.key=e,o.enabled=r,o.parse=o.enabled,o.applyInheritables(u),o.canBeFiltered=ye.includes(e),o.canBeFiltered&&(o.dict=re.get(e)),void 0!==a)if(Array.isArray(a))o.parse=o.enabled=!0,o.canBeFiltered&&a.length>0&&o.translateTagSet(a,o.pick);else if("object"==typeof a){if(o.enabled=!0,o.parse=!1!==a.parse,o.canBeFiltered){var f=a.pick,c=a.skip;f&&f.length>0&&o.translateTagSet(f,o.pick),c&&c.length>0&&o.translateTagSet(c,o.skip);}o.applyInheritables(a);}else !0===a||!1===a?o.parse=o.enabled=a:L("Invalid options argument: ".concat(a));return o}return r(s,[{key:"needed",get:function(){return this.enabled||this.deps.size>0}},{key:"applyInheritables",value:function(e){var t,n,r=me;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=m(r));for(var i=0;i<r.length;i++)void 0!==(n=e[t=r[i]])&&(this[t]=n);}},{key:"translateTagSet",value:function(e,t){if(this.dict){var n,r,i=this.dict,a=i.tagKeys,s=i.tagValues,u=e;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=m(u));for(var o=0;o<u.length;o++)"string"==typeof(n=u[o])?(-1===(r=s.indexOf(n))&&(r=a.indexOf(Number(n))),-1!==r&&t.add(Number(a[r]))):t.add(n);}else {var f=e;Array.isArray(f)||("function"==typeof f.entries&&(f=f.entries()),f=m(f));for(var c=0;c<f.length;c++){var h=f[c];t.add(h);}}}},{key:"finalizeFilters",value:function(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ce(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ce(this.pick,this.deps);}}]),s}(Ae),Oe={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},Se=S(),Pe=function(e){a(i,e);var n=d(i);function i(e){var r;return t(this,i),r=n.call(this),!0===e?r.setupFromTrue():void 0===e?r.setupFromUndefined():Array.isArray(e)?r.setupFromArray(e):"object"==typeof e?r.setupFromObject(e):L("Invalid options argument ".concat(e)),void 0===r.firstChunkSize&&(r.firstChunkSize=x?r.firstChunkSizeBrowser:r.firstChunkSizeNode),r.mergeOutput&&(r.ifd1.enabled=!1),r.filterNestedSegmentTags(),r.traverseTiffDependencyTree(),r.checkLoadedPlugins(),r}return r(i,[{key:"setupFromUndefined",value:function(){var e,t=de;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=m(t));for(var n=0;n<t.length;n++)this[e=t[n]]=Oe[e];var r=be;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=m(r));for(var i=0;i<r.length;i++)this[e=r[i]]=Oe[e];var a=ke;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=m(a));for(var s=0;s<a.length;s++)this[e=a[s]]=Oe[e];var u=ge;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=m(u));for(var o=0;o<u.length;o++)this[e=u[o]]=new we(e,Oe[e],void 0,this);}},{key:"setupFromTrue",value:function(){var e,t=de;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=m(t));for(var n=0;n<t.length;n++)this[e=t[n]]=Oe[e];var r=be;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=m(r));for(var i=0;i<r.length;i++)this[e=r[i]]=Oe[e];var a=ke;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=m(a));for(var s=0;s<a.length;s++)this[e=a[s]]=!0;var u=ge;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=m(u));for(var o=0;o<u.length;o++)this[e=u[o]]=new we(e,!0,void 0,this);}},{key:"setupFromArray",value:function(e){var t,n=de;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++)this[t=n[r]]=Oe[t];var i=be;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++)this[t=i[a]]=Oe[t];var s=ke;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=m(s));for(var u=0;u<s.length;u++)this[t=s[u]]=Oe[t];var o=ge;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=m(o));for(var f=0;f<o.length;f++)this[t=o[f]]=new we(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,ye);}},{key:"setupFromObject",value:function(e){var t;ye.ifd0=ye.ifd0||ye.image,ye.ifd1=ye.ifd1||ye.thumbnail,g(this,e);var n=de;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++)this[t=n[r]]=xe(e[t],Oe[t]);var i=be;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++)this[t=i[a]]=xe(e[t],Oe[t]);var s=ke;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=m(s));for(var u=0;u<s.length;u++)this[t=s[u]]=xe(e[t],Oe[t]);var o=pe;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=m(o));for(var f=0;f<o.length;f++)this[t=o[f]]=new we(t,Oe[t],e[t],this);var c=ye;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=m(c));for(var h=0;h<c.length;h++)this[t=c[h]]=new we(t,Oe[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,ye,ge),!0===e.tiff?this.batchEnableWithBool(ye,!0):!1===e.tiff?this.batchEnableWithUserValue(ye,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,ye):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,ye);}},{key:"batchEnableWithBool",value:function(e,t){var n=e;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++){this[n[r]].enabled=t;}}},{key:"batchEnableWithUserValue",value:function(e,t){var n=e;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++){var i=n[r],a=t[i];this[i].enabled=!1!==a&&void 0!==a;}}},{key:"setupGlobalFilters",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(e&&e.length){var i=r;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++){var s=i[a];this[s].enabled=!1;}var u=Ue(e,n),o=u;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=m(o));for(var f=0;f<o.length;f++){var c=o[f],h=c[0],l=c[1];Ce(this[h].pick,l),this[h].enabled=!0;}}else if(t&&t.length){var d=Ue(t,n),v=d;Array.isArray(v)||("function"==typeof v.entries&&(v=v.entries()),v=m(v));for(var p=0;p<v.length;p++){var y=v[p],g=y[0],k=y[1];Ce(this[g].skip,k);}}}},{key:"filterNestedSegmentTags",value:function(){var e=this.ifd0,t=this.exif,n=this.xmp,r=this.iptc,i=this.icc;this.makerNote?t.deps.add(se):t.skip.add(se),this.userComment?t.deps.add(ue):t.skip.add(ue),n.enabled||e.skip.add(700),r.enabled||e.skip.add(oe),i.enabled||e.skip.add(fe);}},{key:"traverseTiffDependencyTree",value:function(){var e=this,t=this.ifd0,n=this.exif,r=this.gps;this.interop.needed&&(n.deps.add(le),t.deps.add(le)),n.needed&&t.deps.add(ce),r.needed&&t.deps.add(he),this.tiff.enabled=ye.some((function(t){return !0===e[t].enabled}))||this.makerNote||this.userComment;var i=ye;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++){this[i[a]].finalizeFilters();}}},{key:"onlyTiff",get:function(){var e=this;return !ve.map((function(t){return e[t].enabled})).some((function(e){return !0===e}))&&this.tiff.enabled}},{key:"checkLoadedPlugins",value:function(){var e=pe;Array.isArray(e)||("function"==typeof e.entries&&(e=e.entries()),e=m(e));for(var t=0;t<e.length;t++){var n=e[t];this[n].enabled&&!W.has(n)&&R("segment parser",n);}}}],[{key:"useCached",value:function(e){var t=Se.get(e);return void 0!==t||(t=new this(e),Se.set(e,t)),t}}]),i}(Ae);function Ue(e,t){var n,r,i,a=[],s=t;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=m(s));for(var u=0;u<s.length;u++){r=s[u],n=[];var o=re.get(r);Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=m(o));for(var f=0;f<o.length;f++)i=o[f],(e.includes(i[0])||e.includes(i[1]))&&n.push(i[0]);n.length&&a.push([r,n]);}return a}function xe(e,t){return void 0!==e?e:void 0!==t?t:void 0}function Ce(e,t){var n=t;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++){var i=n[r];e.add(i);}}function Be(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function je(){}function _e(e,t){if(!t)return e&&e.then?e.then(je):Promise.resolve()}function Ve(e,t){var n=e();return n&&n.then?n.then(t):t(n)}i(Pe,"default",Oe);var Ie=function(){function e(n){t(this,e),i(this,"parsers",{}),this.options=Pe.useCached(n);}return r(e,[{key:"setup",value:function(){if(!this.fileParser){var e=this.file,t=e.getUint16(0),n=M;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++){var i=n[r],a=i[0],s=i[1];if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[a]=!0}L("Unknown file format");}}},{key:"read",value:function(e){try{var t=this;return Be(function(e,t){return "string"==typeof e?$(e,t):x&&!C&&e instanceof HTMLImageElement?$(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new D(e):x&&e instanceof Blob?Q(e,t,"blob",Y):void L(Z)}(e,t.options),(function(e){t.file=e;}))}catch(e){return Promise.reject(e)}}},{key:"parse",value:function(){try{var e=this;e.setup();var t={},n=[];return Ve((function(){return e.options.silentErrors?Be(e.doParse(t,n).catch((function(e){return n.push(e)})),(function(){n.push.apply(n,e.fileParser.errors);})):_e(e.doParse(t,n))}),(function(){return e.file.close&&e.file.close(),e.options.silentErrors&&n.length>0&&(t.errors=n),I(r=t)?void 0:r;var r;}))}catch(e){return Promise.reject(e)}}},{key:"doParse",value:function(e,t){try{var n=this;return Be(n.fileParser.parse(),(function(){var r,i=p(n.parsers).map((r=function(t){return Be(t.parse(),(function(n){t.assignToOutput(e,n);}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}));if(n.options.silentErrors){var a=function(e){return t.push(e)};i=i.map((function(e){return e.catch(a)}));}return _e(Promise.all(i))}))}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;e.setup();var t,n=e.options,r=e.file,i=W.get("tiff",n);return Ve((function(){if(!r.tiff)return function(e){var t=e();if(t&&t.then)return t.then(je)}((function(){if(r.jpeg)return Be(e.fileParser.getOrFindSegment("tiff"),(function(e){t=e;}))}));t={start:0,type:"tiff"};}),(function(){if(void 0!==t)return Be(e.fileParser.ensureSegmentChunk(t),(function(t){return Be((e.parsers.tiff=new i(t,n,r)).extractThumbnail(),(function(e){return r.close&&r.close(),e}))}))}))}catch(e){return Promise.reject(e)}}}]),e}();var Le,Te=(Le=function(e,t){var n,r,a=new Ie(t);return n=a.read(e),r=function(){return a.parse()},(n&&n.then||(n=Promise.resolve(n)),r?n.then(r):n)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Le.apply(this,e))}catch(e){return Promise.reject(e)}}),ze=Object.freeze({__proto__:null,parse:Te,Exifr:Ie,fileParsers:M,segmentParsers:W,fileReaders:K,tagKeys:re,tagValues:ie,tagRevivers:ae,createDictionary:te,extendDictionary:ne,fetchUrlAsArrayBuffer:G,readBlobAsArrayBuffer:Y,chunkedProps:de,otherSegments:ve,segments:pe,tiffBlocks:ye,segmentsAndBlocks:ge,tiffExtractables:ke,inheritables:me,allFormatters:be,Options:Pe});function Fe(){}var Ee=function(){function e(n,r,a){var s=this;t(this,e),i(this,"errors",[]),i(this,"ensureSegmentChunk",function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(e){var t,n,r,i=e.start,a=e.size||65536;return t=function(){if(s.file.chunked)return function(e){var t=e();if(t&&t.then)return t.then(Fe)}((function(){if(!s.file.available(i,a))return function(e){if(e&&e.then)return e.then(Fe)}(function(e,t){try{var n=e();}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return t=s.file.readChunk(i,a),n=function(t){e.chunk=t;},(t&&t.then||(t=Promise.resolve(t)),n?t.then(n):t);var t,n;}),(function(t){L("Couldn't read segment: ".concat(JSON.stringify(e),". ").concat(t.message));})));e.chunk=s.file.subarray(i,a);}));s.file.byteLength>i+a?e.chunk=s.file.subarray(i,a):void 0===e.size?e.chunk=s.file.subarray(i):L("Segment unreachable: "+JSON.stringify(e));},n=function(){return e.chunk},(r=t())&&r.then?r.then(n):n(r)}))),this.extendOptions&&this.extendOptions(n),this.options=n,this.file=r,this.parsers=a;}return r(e,[{key:"injectSegment",value:function(e,t){this.options[e].enabled&&this.createParser(e,t);}},{key:"createParser",value:function(e,t){var n=new(W.get(e))(t,this.options,this.file);return this.parsers[e]=n}},{key:"createParsers",value:function(e){var t=e;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=m(t));for(var n=0;n<t.length;n++){var r=t[n],i=r.type,a=r.chunk,s=this.options[i];if(s&&s.enabled){var u=this.parsers[i];u&&u.append||u||this.createParser(i,a);}}}},{key:"readSegments",value:function(e){try{var t=e.map(this.ensureSegmentChunk);return function(e,t){if(!t)return e&&e.then?e.then(Fe):Promise.resolve()}(Promise.all(t))}catch(e){return Promise.reject(e)}}}]),e}(),De=function(){function e(n){var r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;t(this,e),i(this,"errors",[]),i(this,"raw",S()),i(this,"handleError",(function(e){if(!r.options.silentErrors)throw e;r.errors.push(e.message);})),this.chunk=this.normalizeInput(n),this.file=s,this.type=this.constructor.type,this.globalOptions=this.options=a,this.localOptions=a[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate;}return r(e,[{key:"normalizeInput",value:function(e){return e instanceof D?e:new D(e)}},{key:"translate",value:function(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type));}},{key:"output",get:function(){return this.translated?this.translated:this.raw?k(this.raw):void 0}},{key:"translateBlock",value:function(e,t){var n=ae.get(t),r=ie.get(t),i=re.get(t),a=this.options[t],s=a.reviveValues&&!!n,u=a.translateValues&&!!r,o=a.translateKeys&&!!i,f={},c=e;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=m(c));for(var h=0;h<c.length;h++){var l=c[h],d=l[0],v=l[1];s&&n.has(d)?v=n.get(d)(v):u&&r.has(d)&&(v=this.translateValue(v,r.get(d))),o&&i.has(d)&&(d=i.get(d)||d),f[d]=v;}return f}},{key:"translateValue",value:function(e,t){return t[e]||t.DEFAULT||e}},{key:"assignToOutput",value:function(e,t){this.assignObjectToOutput(e,this.constructor.type,t);}},{key:"assignObjectToOutput",value:function(e,t,n){if(this.globalOptions.mergeOutput)return g(e,n);e[t]?g(e[t],n):e[t]=n;}}],[{key:"findPosition",value:function(e,t){var n=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,i=t+r,a=n-r;return {offset:t,length:n,headerLength:r,start:i,size:a,end:i+a}}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Pe(i({},this.type,t)),r=new this(e,n);return r.parse()}}]),e}();function Re(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}i(De,"headerLength",4),i(De,"type",void 0),i(De,"multiSegment",!1),i(De,"canHandle",(function(){return !1}));function Ne(){}function Me(e,t){if(!t)return e&&e.then?e.then(Ne):Promise.resolve()}function We(e){var t=e();if(t&&t.then)return t.then(Ne)}function Ke(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function He(e,t,n){if(!e.s){if(n instanceof Xe){if(!n.s)return void(n.o=He.bind(null,e,t));1&t&&(t=n.s),n=n.v;}if(n&&n.then)return void n.then(He.bind(null,e,t),He.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e);}}var Xe=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{He(r,1,a(this.v));}catch(e){He(r,2,e);}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?He(r,1,t?t(i):i):n?He(r,1,n(i)):He(r,2,i);}catch(e){He(r,2,e);}},r},e}();function Ye(e){return e instanceof Xe&&1&e.s}function Ge(e,t,n){for(var r;;){var i=e();if(Ye(i)&&(i=i.v),!i)return a;if(i.then){r=0;break}var a=n();if(a&&a.then){if(!Ye(a)){r=1;break}a=a.s;}if(t){var s=t();if(s&&s.then&&!Ye(s)){r=2;break}}}var u=new Xe,o=He.bind(null,u,2);return (0===r?i.then(c):1===r?a.then(f):s.then(h)).then(void 0,o),u;function f(r){a=r;do{if(t&&(s=t())&&s.then&&!Ye(s))return void s.then(h).then(void 0,o);if(!(i=e())||Ye(i)&&!i.v)return void He(u,1,a);if(i.then)return void i.then(c).then(void 0,o);Ye(a=n())&&(a=a.v);}while(!a||!a.then);a.then(f).then(void 0,o);}function c(e){e?(a=n())&&a.then?a.then(f).then(void 0,o):f(a):He(u,1,a);}function h(){(i=e())?i.then?i.then(c).then(void 0,o):c(i):He(u,1,a);}}function Je(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function qe(e){return e>=224&&e<=239}function Qe(e,t,n){var r=W;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=m(r));for(var i=0;i<r.length;i++){var a=r[i],s=a[0];if(a[1].canHandle(e,t,n))return s}}var Ze=function(e){a(s,e);var n=d(s);function s(){var e;t(this,s);for(var r=arguments.length,a=new Array(r),u=0;u<r;u++)a[u]=arguments[u];return i(h(e=n.call.apply(n,[this].concat(a))),"appSegments",[]),i(h(e),"jpegSegments",[]),i(h(e),"unknownSegments",[]),e}return r(s,[{key:"parse",value:function(){try{var e=this;return Re(e.findAppSegments(),(function(){return Re(e.readSegments(e.appSegments),(function(){e.mergeMultiSegments(),e.createParsers(e.mergedAppSegments||e.appSegments);}))}))}catch(e){return Promise.reject(e)}}},{key:"setupSegmentFinderArgs",value:function(e){var t=this;!0===e?(this.findAll=!0,this.wanted=O(W.keyList())):(e=void 0===e?W.keyList().filter((function(e){return t.options[e].enabled})):e.filter((function(e){return t.options[e].enabled&&W.has(e)})),this.findAll=!1,this.remaining=O(e),this.wanted=O(e)),this.unfinishedMultiSegment=!1;}},{key:"findAppSegments",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{var n=this;n.setupSegmentFinderArgs(t);var r=n.file,i=n.findAll,a=n.wanted,s=n.remaining;return Ke((function(){if(!i&&n.file.chunked)return i=m(a).some((function(e){var t=W.get(e),r=n.options[e];return t.multiSegment&&r.multiSegment})),We((function(){if(i)return Me(n.file.readWhole())}))}),(function(){var t=!1;if(e=n.findAppSegmentsInRange(e,r.byteLength),!n.options.onlyTiff)return function(){if(r.chunked){var i=!1;return Ge((function(){return !t&&s.size>0&&!i&&(!!r.canReadNextChunk||!!n.unfinishedMultiSegment)}),void 0,(function(){var a=r.nextChunkOffset,s=n.appSegments.some((function(e){return !n.file.available(e.offset||e.start,e.length||e.size)}));return Ke((function(){return e>a&&!s?Re(r.readNextChunk(e),(function(e){i=!e;})):Re(r.readNextChunk(a),(function(e){i=!e;}))}),(function(){void 0===(e=n.findAppSegmentsInRange(e,r.byteLength))&&(t=!0);}))}))}}()}))}catch(e){return Promise.reject(e)}}},{key:"findAppSegmentsInRange",value:function(e,t){t-=2;for(var n,r,i,a,s,u,o=this.file,f=this.findAll,c=this.wanted,h=this.remaining,l=this.options;e<t;e++)if(255===o.getUint8(e))if(qe(n=o.getUint8(e+1))){if(r=o.getUint16(e+2),(i=Qe(o,e,r))&&c.has(i)&&(s=(a=W.get(i)).findPosition(o,e),u=l[i],s.type=i,this.appSegments.push(s),!f&&(a.multiSegment&&u.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||h.delete(i)):h.delete(i),0===h.size)))break;l.recordUnknownSegments&&((s=De.findPosition(o,e)).marker=n,this.unknownSegments.push(s)),e+=r+1;}else if(Je(n)){if(r=o.getUint16(e+2),218===n&&!1!==l.stopAfterSos)return;l.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1;}return e}},{key:"mergeMultiSegments",value:function(){var e=this;if(this.appSegments.some((function(e){return e.multiSegment}))){var t=function(e,t){for(var n,r,i,a=S(),s=0;s<e.length;s++)r=(n=e[s])[t],a.has(r)?i=a.get(r):a.set(r,i=[]),i.push(n);return m(a)}(this.appSegments,"type");this.mergedAppSegments=t.map((function(t){var n=t[0],r=t[1],i=W.get(n,e.options);return i.handleMultiSegments?{type:n,chunk:i.handleMultiSegments(r)}:r[0]}));}}},{key:"getSegment",value:function(e){return this.appSegments.find((function(t){return t.type===e}))}},{key:"getOrFindSegment",value:function(e){try{var t=this,n=t.getSegment(e);return Ke((function(){if(void 0===n)return Re(t.findAppSegments(0,[e]),(function(){n=t.getSegment(e);}))}),(function(){return n}))}catch(e){return Promise.reject(e)}}}],[{key:"canHandle",value:function(e,t){return 65496===t}}]),s}(Ee);function $e(){}i(Ze,"type","jpeg"),M.set("jpeg",Ze);function et(e,t){if(!t)return e&&e.then?e.then($e):Promise.resolve()}function tt(e,t){var n=e();return n&&n.then?n.then(t):t(n)}var nt=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];var rt=function(e){a(i,e);var n=d(i);function i(){return t(this,i),n.apply(this,arguments)}return r(i,[{key:"parse",value:function(){try{var e=this;e.parseHeader();var t=e.options;return tt((function(){if(t.ifd0.enabled)return et(e.parseIfd0Block())}),(function(){return tt((function(){if(t.exif.enabled)return et(e.safeParse("parseExifBlock"))}),(function(){return tt((function(){if(t.gps.enabled)return et(e.safeParse("parseGpsBlock"))}),(function(){return tt((function(){if(t.interop.enabled)return et(e.safeParse("parseInteropBlock"))}),(function(){return tt((function(){if(t.ifd1.enabled)return et(e.safeParse("parseThumbnailBlock"))}),(function(){return e.createOutput()}))}))}))}))}))}catch(e){return Promise.reject(e)}}},{key:"safeParse",value:function(e){var t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}},{key:"findIfd0Offset",value:function(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4));}},{key:"findIfd1Offset",value:function(){if(void 0===this.ifd1Offset){this.findIfd0Offset();var e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t);}}},{key:"parseBlock",value:function(e,t){var n=S();return this[t]=n,this.parseTags(e,t,n),n}},{key:"parseIfd0Block",value:function(){try{var e=this;if(e.ifd0)return;var t=e.file;return e.findIfd0Offset(),e.ifd0Offset<8&&L("Malformed EXIF data"),!t.chunked&&e.ifd0Offset>t.byteLength&&L("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(e.ifd0Offset,", file.byteLength: ").concat(t.byteLength)),tt((function(){if(t.tiff)return et(t.ensureChunk(e.ifd0Offset,T(e.options)))}),(function(){var t=e.parseBlock(e.ifd0Offset,"ifd0");if(0!==t.size)return e.exifOffset=t.get(ce),e.interopOffset=t.get(le),e.gpsOffset=t.get(he),e.xmp=t.get(700),e.iptc=t.get(oe),e.icc=t.get(fe),e.options.sanitize&&(t.delete(ce),t.delete(le),t.delete(he),t.delete(700),t.delete(oe),t.delete(fe)),t}))}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var e=this;if(e.exif)return;return tt((function(){if(!e.ifd0)return et(e.parseIfd0Block())}),(function(){if(void 0!==e.exifOffset)return tt((function(){if(e.file.tiff)return et(e.file.ensureChunk(e.exifOffset,T(e.options)))}),(function(){var t=e.parseBlock(e.exifOffset,"exif");return e.interopOffset||(e.interopOffset=t.get(le)),e.makerNote=t.get(se),e.userComment=t.get(ue),e.options.sanitize&&(t.delete(le),t.delete(se),t.delete(ue)),e.unpack(t,41728),e.unpack(t,41729),t}))}))}catch(e){return Promise.reject(e)}}},{key:"unpack",value:function(e,t){var n=e.get(t);n&&1===n.length&&e.set(t,n[0]);}},{key:"parseGpsBlock",value:function(){try{var e=this;if(e.gps)return;return tt((function(){if(!e.ifd0)return et(e.parseIfd0Block())}),(function(){if(void 0!==e.gpsOffset){var t=e.parseBlock(e.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",it.apply(void 0,t.get(2).concat([t.get(1)]))),t.set("longitude",it.apply(void 0,t.get(4).concat([t.get(3)])))),t}}))}catch(e){return Promise.reject(e)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return tt((function(){if(!e.ifd0)return et(e.parseIfd0Block())}),(function(){return tt((function(){if(void 0===e.interopOffset&&!e.exif)return et(e.parseExifBlock())}),(function(){if(void 0!==e.interopOffset)return e.parseBlock(e.interopOffset,"interop")}))}))}catch(e){return Promise.reject(e)}}},{key:"parseThumbnailBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{var t=this;if(t.ifd1||t.ifd1Parsed)return;if(t.options.mergeOutput&&!e)return;return t.findIfd1Offset(),t.ifd1Offset>0&&(t.parseBlock(t.ifd1Offset,"ifd1"),t.ifd1Parsed=!0),t.ifd1}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;return e.headerParsed||e.parseHeader(),tt((function(){if(!e.ifd1Parsed)return et(e.parseThumbnailBlock(!0))}),(function(){if(void 0!==e.ifd1){var t=e.ifd1.get(513),n=e.ifd1.get(514);return e.chunk.getUint8Array(t,n)}}))}catch(e){return Promise.reject(e)}}},{key:"image",get:function(){return this.ifd0}},{key:"thumbnail",get:function(){return this.ifd1}},{key:"createOutput",value:function(){var e,t,n,r={},i=ye;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=m(i));for(var a=0;a<i.length;a++)if(!I(e=this[t=i[a]]))if(n=this.canTranslate?this.translateBlock(e,t):k(e),this.options.mergeOutput){if("ifd1"===t)continue;g(r,n);}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}},{key:"assignToOutput",value:function(e,t){if(this.globalOptions.mergeOutput)g(e,t);else {var n=y(t);Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=m(n));for(var r=0;r<n.length;r++){var i=n[r],a=i[0],s=i[1];this.assignObjectToOutput(e,a,s);}}}}],[{key:"canHandle",value:function(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}}]),i}(function(e){a(i,e);var n=d(i);function i(){return t(this,i),n.apply(this,arguments)}return r(i,[{key:"parseHeader",value:function(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0;}},{key:"parseTags",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S(),r=this.options[t],i=r.pick,a=r.skip,s=(i=O(i)).size>0,u=0===a.size,o=this.chunk.getUint16(e);e+=2;for(var f=0;f<o;f++){var c=this.chunk.getUint16(e);if(s){if(i.has(c)&&(n.set(c,this.parseTag(e,c,t)),i.delete(c),0===i.size))break}else !u&&a.has(c)||n.set(c,this.parseTag(e,c,t));e+=12;}return n}},{key:"parseTag",value:function(e,t,n){var r,i=this.chunk,a=i.getUint16(e+2),s=i.getUint32(e+4),u=nt[a];if(u*s<=4?e+=8:e=i.getUint32(e+8),(a<1||a>13)&&L("Invalid TIFF value type. block: ".concat(n.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(a,", offset ").concat(e)),e>i.byteLength&&L("Invalid TIFF value offset. block: ".concat(n.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(a,", offset ").concat(e," is outside of chunk size ").concat(i.byteLength)),1===a)return i.getUint8Array(e,s);if(2===a)return ""===(r=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(r=i.getString(e,s)).trim())?void 0:r;if(7===a)return i.getUint8Array(e,s);if(1===s)return this.parseTagValue(a,e);for(var o=new(function(e){switch(e){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}}(a))(s),f=u,c=0;c<s;c++)o[c]=this.parseTagValue(a,e),e+=f;return o}},{key:"parseTagValue",value:function(e,t){var n=this.chunk;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);case 13:return n.getUint32(t);default:L("Invalid tiff type ".concat(e));}}}]),i}(De));function it(e,t,n,r){var i=e+t/60+n/3600;return "S"!==r&&"W"!==r||(i*=-1),i}i(rt,"type","tiff"),i(rt,"headerLength",10),W.set("tiff",rt);var at=Object.freeze({__proto__:null,default:ze,Exifr:Ie,fileParsers:M,segmentParsers:W,fileReaders:K,tagKeys:re,tagValues:ie,tagRevivers:ae,createDictionary:te,extendDictionary:ne,fetchUrlAsArrayBuffer:G,readBlobAsArrayBuffer:Y,chunkedProps:de,otherSegments:ve,segments:pe,tiffBlocks:ye,segmentsAndBlocks:ge,tiffExtractables:ke,inheritables:me,allFormatters:be,Options:Pe,parse:Te});function st(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ut(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}var ot=ut((function(e){var t=new Ie(vt);return st(t.read(e),(function(){return st(t.parse(),(function(e){if(e&&e.ifd0)return e.ifd0[274]}))}))})),ft=ut((function(e){var t=new Ie(dt);return st(t.read(e),(function(){return st(t.parse(),(function(e){if(e&&e.gps){var t=e.gps;return {latitude:t.latitude,longitude:t.longitude}}}))}))})),ct=ut((function(e){return st(this.thumbnail(e),(function(e){if(void 0!==e){var t=new Blob([e]);return URL.createObjectURL(t)}}))})),ht=ut((function(e){var t=new Ie(pt);return st(t.read(e),(function(){return st(t.extractThumbnail(),(function(e){return e&&_?j.from(e):e}))}))})),lt={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},dt=g({},lt,{firstChunkSize:4e4,gps:[1,2,3,4]}),vt=g({},lt,{firstChunkSize:4e4,ifd0:[274]}),pt=g({},lt,{tiff:!1,ifd1:!0,mergeOutput:!1}),yt=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}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){var gt=navigator.userAgent;if(gt.includes("iPad")||gt.includes("iPhone")){var kt=gt.match(/OS (\d+)_(\d+)/);if(kt){var mt=kt[1],bt=kt[2],At=Number(mt)+.1*Number(bt);e.rotateCanvas=At<13.4,e.rotateCss=!1;}}else if(gt.includes("OS X 10")){var wt=gt.match(/OS X 10[_.](\d+)/)[1];e.rotateCanvas=e.rotateCss=Number(wt)<15;}if(gt.includes("Chrome/")){var Ot=gt.match(/Chrome\/(\d+)/)[1];e.rotateCanvas=e.rotateCss=Number(Ot)<81;}else if(gt.includes("Firefox/")){var St=gt.match(/Firefox\/(\d+)/)[1];e.rotateCanvas=e.rotateCss=Number(St)<77;}}function Pt(){}var Ut=function(e){a(u,e);var n=d(u);function u(){var e;t(this,u);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i(h(e=n.call.apply(n,[this].concat(a))),"ranges",new xt),0!==e.byteLength&&e.ranges.add(0,e.byteLength),e}return r(u,[{key:"_tryExtend",value:function(e,t,n){if(0===e&&0===this.byteLength&&n){var r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r);}else {var i=e+t;if(i>this.byteLength){var a=this._extend(i).dataView;this._swapDataView(a);}}}},{key:"_extend",value:function(e){var t;t=_?j.allocUnsafe(e):new Uint8Array(e);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}},{key:"subarray",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),v(s(u.prototype),"subarray",this).call(this,e,t)}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n&&this._tryExtend(t,e.byteLength,e);var r=v(s(u.prototype),"set",this).call(this,e,t);return this.ranges.add(t,r.byteLength),r}},{key:"ensureChunk",value:function(e,t){try{var n=this;if(!n.chunked)return;if(n.ranges.available(e,t))return;return function(e,t){if(!t)return e&&e.then?e.then(Pt):Promise.resolve()}(n.readChunk(e,t))}catch(e){return Promise.reject(e)}}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),u}(D),xt=function(){function e(){t(this,e),i(this,"list",[]);}return r(e,[{key:"length",get:function(){return this.list.length}},{key:"add",value:function(e,t){var n=e+t,r=this.list.filter((function(t){return Ct(e,t.offset,n)||Ct(e,t.end,n)}));if(r.length>0){e=Math.min.apply(Math,[e].concat(r.map((function(e){return e.offset})))),t=(n=Math.max.apply(Math,[n].concat(r.map((function(e){return e.end})))))-e;var i=r.shift();i.offset=e,i.length=t,i.end=n,this.list=this.list.filter((function(e){return !r.includes(e)}));}else this.list.push({offset:e,length:t,end:n});}},{key:"available",value:function(e,t){var n=e+t;return this.list.some((function(t){return t.offset<=e&&n<=t.end}))}}]),e}();function Ct(e,t,n){return e<=t&&t<=n}function Bt(){}function jt(e,t){if(!t)return e&&e.then?e.then(Bt):Promise.resolve()}function _t(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Vt=function(e){a(i,e);var n=d(i);function i(){return t(this,i),n.apply(this,arguments)}return r(i,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,_t(Y(e.input),(function(t){e._swapArrayBuffer(t);}))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){return this.chunked=!0,this.size=this.input.size,v(s(i.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(e,t){try{var n=this,r=t?e+t:void 0,i=n.input.slice(e,r);return _t(Y(i),(function(t){return n.set(t,e,!0)}))}catch(e){return Promise.reject(e)}}}]),i}(function(e){a(s,e);var n=d(s);function s(e,r){var a;return t(this,s),i(h(a=n.call(this,0)),"chunksRead",0),a.input=e,a.options=r,a}return r(s,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,jt(e.readChunk(e.nextChunkOffset))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){try{var e=this;return e.chunked=!0,jt(e.readChunk(0,e.options.firstChunkSize))}catch(e){return Promise.reject(e)}}},{key:"readNextChunk",value:function(e){try{var t=this;if(void 0===e&&(e=t.nextChunkOffset),t.fullyRead)return t.chunksRead++,!1;var n=t.options.chunkSize;return r=t.readChunk(e,n),i=function(e){return !!e&&e.byteLength===n},(r&&r.then||(r=Promise.resolve(r)),i?r.then(i):r)}catch(e){return Promise.reject(e)}var r,i;}},{key:"readChunk",value:function(e,t){try{var n=this;if(n.chunksRead++,0===(t=n.safeWrapAddress(e,t)))return;return n._readChunk(e,t)}catch(e){return Promise.reject(e)}}},{key:"safeWrapAddress",value:function(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}},{key:"nextChunkOffset",get:function(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}},{key:"canReadNextChunk",get:function(){return this.chunksRead<this.options.chunkLimit}},{key:"fullyRead",get:function(){return void 0!==this.size&&this.nextChunkOffset===this.size}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}}]),s}(Ut));K.set("blob",Vt),e.Exifr=Ie,e.Options=Pe,e.allFormatters=be,e.chunkedProps=de,e.createDictionary=te,e.default=at,e.disableAllOptions=lt,e.extendDictionary=ne,e.fetchUrlAsArrayBuffer=G,e.fileParsers=M,e.fileReaders=K,e.gps=ft,e.gpsOnlyOptions=dt,e.inheritables=me,e.orientation=ot,e.orientationOnlyOptions=vt,e.otherSegments=ve,e.parse=Te,e.readBlobAsArrayBuffer=Y,e.rotation=function(t){return st(ot(t),(function(t){return g({canvas:e.rotateCanvas,css:e.rotateCss},yt[t])}))},e.rotations=yt,e.segmentParsers=W,e.segments=pe,e.segmentsAndBlocks=ge,e.tagKeys=re,e.tagRevivers=ae,e.tagValues=ie,e.thumbnail=ht,e.thumbnailOnlyOptions=pt,e.thumbnailUrl=ct,e.tiffBlocks=ye,e.tiffExtractables=ke,Object.defineProperty(e,"__esModule",{value:!0});}));
9001
9098
  });
9002
9099
 
9100
+ var locale$1 = {
9101
+ strings: {
9102
+ generatingThumbnails: 'Generating thumbnails...'
9103
+ }
9104
+ };
9105
+
9003
9106
  var _class$2, _temp$2;
9004
9107
 
9005
9108
  const {
@@ -9013,6 +9116,8 @@ const {
9013
9116
 
9014
9117
 
9015
9118
 
9119
+
9120
+
9016
9121
  /**
9017
9122
  * The Thumbnail Generator plugin
9018
9123
  */
@@ -9095,11 +9200,7 @@ var lib$2 = (_temp$2 = _class$2 = class ThumbnailGenerator extends UIPlugin {
9095
9200
  this.queueProcessing = false;
9096
9201
  this.defaultThumbnailDimension = 200;
9097
9202
  this.thumbnailType = this.opts.thumbnailType || 'image/jpeg';
9098
- this.defaultLocale = {
9099
- strings: {
9100
- generatingThumbnails: 'Generating thumbnails...'
9101
- }
9102
- };
9203
+ this.defaultLocale = locale$1;
9103
9204
  const defaultOptions = {
9104
9205
  thumbnailWidth: null,
9105
9206
  thumbnailHeight: null,
@@ -9140,7 +9241,8 @@ var lib$2 = (_temp$2 = _class$2 = class ThumbnailGenerator extends UIPlugin {
9140
9241
  });
9141
9242
  });
9142
9243
  const orientationPromise = mini_legacy_umd.rotation(file.data).catch(() => 1);
9143
- return Promise.all([onload, orientationPromise]).then(([image, orientation]) => {
9244
+ return Promise.all([onload, orientationPromise]).then(_ref => {
9245
+ let [image, orientation] = _ref;
9144
9246
  const dimensions = this.getProportionalDimensions(image, targetWidth, targetHeight, orientation.deg);
9145
9247
  const rotatedImage = this.rotateImage(image, orientation);
9146
9248
  const resizedImage = this.resizeImage(rotatedImage, dimensions.width, dimensions.height);
@@ -9402,7 +9504,7 @@ var lib$2 = (_temp$2 = _class$2 = class ThumbnailGenerator extends UIPlugin {
9402
9504
  }
9403
9505
  }
9404
9506
 
9405
- }, _class$2.VERSION = "2.0.5", _temp$2);
9507
+ }, _class$2.VERSION = "2.0.6", _temp$2);
9406
9508
 
9407
9509
  function _classPrivateFieldLooseBase$6(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
9408
9510
 
@@ -9418,6 +9520,16 @@ var _activeRequests = /*#__PURE__*/_classPrivateFieldLooseKey$6("activeRequests"
9418
9520
 
9419
9521
  var _queuedHandlers = /*#__PURE__*/_classPrivateFieldLooseKey$6("queuedHandlers");
9420
9522
 
9523
+ var _paused = /*#__PURE__*/_classPrivateFieldLooseKey$6("paused");
9524
+
9525
+ var _pauseTimer = /*#__PURE__*/_classPrivateFieldLooseKey$6("pauseTimer");
9526
+
9527
+ var _downLimit = /*#__PURE__*/_classPrivateFieldLooseKey$6("downLimit");
9528
+
9529
+ var _upperLimit = /*#__PURE__*/_classPrivateFieldLooseKey$6("upperLimit");
9530
+
9531
+ var _rateLimitingTimer = /*#__PURE__*/_classPrivateFieldLooseKey$6("rateLimitingTimer");
9532
+
9421
9533
  var _call = /*#__PURE__*/_classPrivateFieldLooseKey$6("call");
9422
9534
 
9423
9535
  var _queueNext = /*#__PURE__*/_classPrivateFieldLooseKey$6("queueNext");
@@ -9428,6 +9540,10 @@ var _queue = /*#__PURE__*/_classPrivateFieldLooseKey$6("queue");
9428
9540
 
9429
9541
  var _dequeue = /*#__PURE__*/_classPrivateFieldLooseKey$6("dequeue");
9430
9542
 
9543
+ var _resume = /*#__PURE__*/_classPrivateFieldLooseKey$6("resume");
9544
+
9545
+ var _increaseLimit = /*#__PURE__*/_classPrivateFieldLooseKey$6("increaseLimit");
9546
+
9431
9547
  class RateLimitedQueue$1 {
9432
9548
  constructor(limit) {
9433
9549
  Object.defineProperty(this, _dequeue, {
@@ -9453,6 +9569,52 @@ class RateLimitedQueue$1 {
9453
9569
  writable: true,
9454
9570
  value: []
9455
9571
  });
9572
+ Object.defineProperty(this, _paused, {
9573
+ writable: true,
9574
+ value: false
9575
+ });
9576
+ Object.defineProperty(this, _pauseTimer, {
9577
+ writable: true,
9578
+ value: void 0
9579
+ });
9580
+ Object.defineProperty(this, _downLimit, {
9581
+ writable: true,
9582
+ value: 1
9583
+ });
9584
+ Object.defineProperty(this, _upperLimit, {
9585
+ writable: true,
9586
+ value: void 0
9587
+ });
9588
+ Object.defineProperty(this, _rateLimitingTimer, {
9589
+ writable: true,
9590
+ value: void 0
9591
+ });
9592
+ Object.defineProperty(this, _resume, {
9593
+ writable: true,
9594
+ value: () => this.resume()
9595
+ });
9596
+ Object.defineProperty(this, _increaseLimit, {
9597
+ writable: true,
9598
+ value: () => {
9599
+ if (_classPrivateFieldLooseBase$6(this, _paused)[_paused]) {
9600
+ _classPrivateFieldLooseBase$6(this, _rateLimitingTimer)[_rateLimitingTimer] = setTimeout(_classPrivateFieldLooseBase$6(this, _increaseLimit)[_increaseLimit], 0);
9601
+ return;
9602
+ }
9603
+
9604
+ _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit] = this.limit;
9605
+ this.limit = Math.ceil((_classPrivateFieldLooseBase$6(this, _upperLimit)[_upperLimit] + _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit]) / 2);
9606
+
9607
+ for (let i = _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit]; i <= this.limit; i++) {
9608
+ _classPrivateFieldLooseBase$6(this, _queueNext)[_queueNext]();
9609
+ }
9610
+
9611
+ if (_classPrivateFieldLooseBase$6(this, _upperLimit)[_upperLimit] - _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit] > 3) {
9612
+ _classPrivateFieldLooseBase$6(this, _rateLimitingTimer)[_rateLimitingTimer] = setTimeout(_classPrivateFieldLooseBase$6(this, _increaseLimit)[_increaseLimit], 2000);
9613
+ } else {
9614
+ _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit] = Math.floor(_classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit] / 2);
9615
+ }
9616
+ }
9617
+ });
9456
9618
 
9457
9619
  if (typeof limit !== 'number' || limit === 0) {
9458
9620
  this.limit = Infinity;
@@ -9462,7 +9624,7 @@ class RateLimitedQueue$1 {
9462
9624
  }
9463
9625
 
9464
9626
  run(fn, queueOptions) {
9465
- if (_classPrivateFieldLooseBase$6(this, _activeRequests)[_activeRequests] < this.limit) {
9627
+ if (!_classPrivateFieldLooseBase$6(this, _paused)[_paused] && _classPrivateFieldLooseBase$6(this, _activeRequests)[_activeRequests] < this.limit) {
9466
9628
  return _classPrivateFieldLooseBase$6(this, _call)[_call](fn);
9467
9629
  }
9468
9630
 
@@ -9470,10 +9632,16 @@ class RateLimitedQueue$1 {
9470
9632
  }
9471
9633
 
9472
9634
  wrapPromiseFunction(fn, queueOptions) {
9473
- return (...args) => {
9635
+ var _this = this;
9636
+
9637
+ return function () {
9638
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9639
+ args[_key] = arguments[_key];
9640
+ }
9641
+
9474
9642
  let queuedRequest;
9475
9643
  const outerPromise = new Promise((resolve, reject) => {
9476
- queuedRequest = this.run(() => {
9644
+ queuedRequest = _this.run(() => {
9477
9645
  let cancelError;
9478
9646
  let innerPromise;
9479
9647
 
@@ -9512,6 +9680,60 @@ class RateLimitedQueue$1 {
9512
9680
  };
9513
9681
  }
9514
9682
 
9683
+ resume() {
9684
+ _classPrivateFieldLooseBase$6(this, _paused)[_paused] = false;
9685
+ clearTimeout(_classPrivateFieldLooseBase$6(this, _pauseTimer)[_pauseTimer]);
9686
+
9687
+ for (let i = 0; i < this.limit; i++) {
9688
+ _classPrivateFieldLooseBase$6(this, _queueNext)[_queueNext]();
9689
+ }
9690
+ }
9691
+
9692
+ /**
9693
+ * Freezes the queue for a while or indefinitely.
9694
+ *
9695
+ * @param {number | null } [duration] Duration for the pause to happen, in milliseconds.
9696
+ * If omitted, the queue won't resume automatically.
9697
+ */
9698
+ pause(duration) {
9699
+ if (duration === void 0) {
9700
+ duration = null;
9701
+ }
9702
+
9703
+ _classPrivateFieldLooseBase$6(this, _paused)[_paused] = true;
9704
+ clearTimeout(_classPrivateFieldLooseBase$6(this, _pauseTimer)[_pauseTimer]);
9705
+
9706
+ if (duration != null) {
9707
+ _classPrivateFieldLooseBase$6(this, _pauseTimer)[_pauseTimer] = setTimeout(_classPrivateFieldLooseBase$6(this, _resume)[_resume], duration);
9708
+ }
9709
+ }
9710
+ /**
9711
+ * Pauses the queue for a duration, and lower the limit of concurrent requests
9712
+ * when the queue resumes. When the queue resumes, it tries to progressively
9713
+ * increase the limit in `this.#increaseLimit` until another call is made to
9714
+ * `this.rateLimit`.
9715
+ * Call this function when using the RateLimitedQueue for network requests and
9716
+ * the remote server responds with 429 HTTP code.
9717
+ *
9718
+ * @param {number} duration in milliseconds.
9719
+ */
9720
+
9721
+
9722
+ rateLimit(duration) {
9723
+ clearTimeout(_classPrivateFieldLooseBase$6(this, _rateLimitingTimer)[_rateLimitingTimer]);
9724
+ this.pause(duration);
9725
+
9726
+ if (this.limit > 1 && Number.isFinite(this.limit)) {
9727
+ _classPrivateFieldLooseBase$6(this, _upperLimit)[_upperLimit] = this.limit - 1;
9728
+ this.limit = _classPrivateFieldLooseBase$6(this, _downLimit)[_downLimit];
9729
+ _classPrivateFieldLooseBase$6(this, _rateLimitingTimer)[_rateLimitingTimer] = setTimeout(_classPrivateFieldLooseBase$6(this, _increaseLimit)[_increaseLimit], duration);
9730
+ }
9731
+ }
9732
+
9733
+ get isPaused() {
9734
+ return _classPrivateFieldLooseBase$6(this, _paused)[_paused];
9735
+ }
9736
+
9515
9737
  }
9516
9738
 
9517
9739
  function _call2(fn) {
@@ -9553,7 +9775,7 @@ function _queueNext2() {
9553
9775
  }
9554
9776
 
9555
9777
  function _next2() {
9556
- if (_classPrivateFieldLooseBase$6(this, _activeRequests)[_activeRequests] >= this.limit) {
9778
+ if (_classPrivateFieldLooseBase$6(this, _paused)[_paused] || _classPrivateFieldLooseBase$6(this, _activeRequests)[_activeRequests] >= this.limit) {
9557
9779
  return;
9558
9780
  }
9559
9781
 
@@ -9572,7 +9794,11 @@ function _next2() {
9572
9794
  next.done = handler.done;
9573
9795
  }
9574
9796
 
9575
- function _queue2(fn, options = {}) {
9797
+ function _queue2(fn, options) {
9798
+ if (options === void 0) {
9799
+ options = {};
9800
+ }
9801
+
9576
9802
  const handler = {
9577
9803
  fn,
9578
9804
  priority: options.priority || 0,
@@ -9610,29 +9836,12 @@ var RateLimitedQueue_1 = {
9610
9836
  internalRateLimitedQueue: Symbol('__queue')
9611
9837
  };
9612
9838
 
9613
- var settle = function settle(promises) {
9614
- const resolutions = [];
9615
- const rejections = [];
9616
-
9617
- function resolved(value) {
9618
- resolutions.push(value);
9619
- }
9620
-
9621
- function rejected(error) {
9622
- rejections.push(error);
9623
- }
9624
-
9625
- const wait = Promise.all(promises.map(promise => promise.then(resolved, rejected)));
9626
- return wait.then(() => {
9627
- return {
9628
- successful: resolutions,
9629
- failed: rejections
9630
- };
9631
- });
9632
- };
9633
-
9634
9839
  class NetworkError extends Error {
9635
- constructor(error, xhr = null) {
9840
+ constructor(error, xhr) {
9841
+ if (xhr === void 0) {
9842
+ xhr = null;
9843
+ }
9844
+
9636
9845
  super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`);
9637
9846
  this.cause = error;
9638
9847
  this.isNetworkError = true;
@@ -9648,8 +9857,8 @@ var NetworkError_1 = NetworkError;
9648
9857
  */
9649
9858
 
9650
9859
 
9651
- var fetchWithNetworkError = function fetchWithNetworkError(...options) {
9652
- return fetch(...options).catch(err => {
9860
+ var fetchWithNetworkError = function fetchWithNetworkError() {
9861
+ return fetch(...arguments).catch(err => {
9653
9862
  if (err.name === 'AbortError') {
9654
9863
  throw err;
9655
9864
  } else {
@@ -9785,7 +9994,8 @@ var RequestClient_1 = (_temp$1 = (_getPostResponseFunc = /*#__PURE__*/_classPriv
9785
9994
  }
9786
9995
 
9787
9996
  preflightAndHeaders(path) {
9788
- return Promise.all([this.preflight(path), this.headers()]).then(([allowedHeaders, headers]) => {
9997
+ return Promise.all([this.preflight(path), this.headers()]).then(_ref => {
9998
+ let [allowedHeaders, headers] = _ref;
9789
9999
  // filter to keep only allowed Headers
9790
10000
  Object.keys(headers).forEach(header => {
9791
10001
  if (!allowedHeaders.includes(header.toLowerCase())) {
@@ -9826,7 +10036,7 @@ var RequestClient_1 = (_temp$1 = (_getPostResponseFunc = /*#__PURE__*/_classPriv
9826
10036
  })).then(_classPrivateFieldLooseBase$5(this, _getPostResponseFunc)[_getPostResponseFunc](skipPostResponse)).then(handleJSONResponse).catch(_classPrivateFieldLooseBase$5(this, _errorHandler)[_errorHandler](method, path));
9827
10037
  }
9828
10038
 
9829
- }), _class$1.VERSION = "2.0.3", _class$1.defaultHeaders = {
10039
+ }), _class$1.VERSION = "2.0.4", _class$1.defaultHeaders = {
9830
10040
  Accept: 'application/json',
9831
10041
  'Content-Type': 'application/json',
9832
10042
  'Uppy-Versions': `@uppy/companion-client=${_class$1.VERSION}`
@@ -9899,7 +10109,8 @@ var Provider_1 = class Provider extends RequestClient_1 {
9899
10109
  }
9900
10110
 
9901
10111
  headers() {
9902
- return Promise.all([super.headers(), this.getAuthToken()]).then(([headers, token]) => {
10112
+ return Promise.all([super.headers(), this.getAuthToken()]).then(_ref => {
10113
+ let [headers, token] = _ref;
9903
10114
  const authHeaders = {};
9904
10115
 
9905
10116
  if (token) {
@@ -9937,7 +10148,11 @@ var Provider_1 = class Provider extends RequestClient_1 {
9937
10148
  return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey);
9938
10149
  }
9939
10150
 
9940
- authUrl(queries = {}) {
10151
+ authUrl(queries) {
10152
+ if (queries === void 0) {
10153
+ queries = {};
10154
+ }
10155
+
9941
10156
  if (this.preAuthToken) {
9942
10157
  queries.uppyPreAuthToken = this.preAuthToken;
9943
10158
  }
@@ -9968,7 +10183,10 @@ var Provider_1 = class Provider extends RequestClient_1 {
9968
10183
  }
9969
10184
 
9970
10185
  logout() {
9971
- return this.get(`${this.id}/logout`).then(response => Promise.all([response, this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(([response]) => response);
10186
+ return this.get(`${this.id}/logout`).then(response => Promise.all([response, this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(_ref2 => {
10187
+ let [response] = _ref2;
10188
+ return response;
10189
+ });
9972
10190
  }
9973
10191
 
9974
10192
  static initPlugin(plugin, opts, defaultOpts) {
@@ -10726,6 +10944,12 @@ function isXml(content, xhr) {
10726
10944
 
10727
10945
  var isXml_1 = isXml;
10728
10946
 
10947
+ var locale = {
10948
+ strings: {
10949
+ timedOut: 'Upload stalled for %{seconds} seconds, aborting.'
10950
+ }
10951
+ };
10952
+
10729
10953
  var _class, _client, _requests, _uploader, _handleUpload, _temp;
10730
10954
 
10731
10955
  function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
@@ -10767,8 +10991,6 @@ const {
10767
10991
  internalRateLimitedQueue
10768
10992
  } = RateLimitedQueue_1;
10769
10993
 
10770
-
10771
-
10772
10994
  const {
10773
10995
  RequestClient
10774
10996
  } = lib$1;
@@ -10777,6 +10999,8 @@ const {
10777
10999
 
10778
11000
 
10779
11001
 
11002
+
11003
+
10780
11004
  function resolveUrl(origin, link) {
10781
11005
  return new URL(link, origin || undefined).toString();
10782
11006
  }
@@ -10883,7 +11107,7 @@ var lib = (_temp = (_client = /*#__PURE__*/_classPrivateFieldLooseKey("client"),
10883
11107
  });
10884
11108
 
10885
11109
  const numberOfFiles = fileIDs.length;
10886
- return settle(fileIDs.map((id, index) => {
11110
+ return Promise.allSettled(fileIDs.map((id, index) => {
10887
11111
  paramsPromises[id] = getUploadParameters(this.uppy.getFile(id));
10888
11112
  return paramsPromises[id].then(params => {
10889
11113
  delete paramsPromises[id];
@@ -10917,6 +11141,7 @@ var lib = (_temp = (_client = /*#__PURE__*/_classPrivateFieldLooseKey("client"),
10917
11141
  delete paramsPromises[id];
10918
11142
  const file = this.uppy.getFile(id);
10919
11143
  this.uppy.emit('upload-error', file, error);
11144
+ return Promise.reject(error);
10920
11145
  });
10921
11146
  })).finally(() => {
10922
11147
  // cleanup.
@@ -10927,11 +11152,7 @@ var lib = (_temp = (_client = /*#__PURE__*/_classPrivateFieldLooseKey("client"),
10927
11152
  this.type = 'uploader';
10928
11153
  this.id = this.opts.id || 'AwsS3';
10929
11154
  this.title = 'AWS S3';
10930
- this.defaultLocale = {
10931
- strings: {
10932
- timedOut: 'Upload stalled for %{seconds} seconds, aborting.'
10933
- }
10934
- };
11155
+ this.defaultLocale = locale;
10935
11156
  const defaultOptions = {
10936
11157
  timeout: 30 * 1000,
10937
11158
  limit: 0,
@@ -11037,7 +11258,7 @@ var lib = (_temp = (_client = /*#__PURE__*/_classPrivateFieldLooseKey("client"),
11037
11258
  this.uppy.removeUploader(_classPrivateFieldLooseBase(this, _handleUpload)[_handleUpload]);
11038
11259
  }
11039
11260
 
11040
- }), _class.VERSION = "2.0.5", _temp);
11261
+ }), _class.VERSION = "2.0.7", _temp);
11041
11262
 
11042
11263
  const SVGDropdown = () => {
11043
11264
  return (index.h("svg", { class: "svg-drop-files", width: "120px", height: "98px", viewBox: "0 0 120 98", version: "1.1", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" },