@bigbinary/neeto-image-uploader-frontend 2.3.11 → 2.3.15

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 (44) hide show
  1. package/README.md +1 -0
  2. package/app/javascript/src/translations/en.json +2 -1
  3. package/dist/AssetLibrary.js +2 -2
  4. package/dist/BasicImageUploader.js +1 -1
  5. package/dist/BasicImageUploader.js.map +1 -1
  6. package/dist/ImageUploader.js +7 -3
  7. package/dist/ImageUploader.js.map +1 -1
  8. package/dist/ImageWithFallback-Csv6Oivd.js.map +1 -1
  9. package/dist/{ImageWithFallback-DeznMgbx.js → ImageWithFallback-DzT_N2Su.js} +4 -4
  10. package/dist/{ImageWithFallback-DeznMgbx.js.map → ImageWithFallback-DzT_N2Su.js.map} +1 -1
  11. package/dist/cjs/AssetLibrary.js +2 -2
  12. package/dist/cjs/BasicImageUploader.js +2 -2
  13. package/dist/cjs/BasicImageUploader.js.map +1 -1
  14. package/dist/cjs/ImageUploader.js +12 -8
  15. package/dist/cjs/ImageUploader.js.map +1 -1
  16. package/dist/cjs/hooks.js +1 -1
  17. package/dist/cjs/index.js +4 -4
  18. package/dist/cjs/utils.js.map +1 -1
  19. package/dist/{index-FbPHXCzL.js → index-BGcxuPcd.js} +726 -291
  20. package/dist/index-BGcxuPcd.js.map +1 -0
  21. package/dist/{index-BkKE5xo-.js → index-BXN-qII4.js} +734 -299
  22. package/dist/index-BXN-qII4.js.map +1 -0
  23. package/dist/index-BtHfh_eu.js.map +1 -1
  24. package/dist/index-CZjb2iXB.js.map +1 -1
  25. package/dist/index.js +2 -2
  26. package/dist/query-B0eDmse7.js.map +1 -1
  27. package/dist/query-B7ahlELA.js.map +1 -1
  28. package/dist/useImageUploader-Bm9TukCy.js.map +1 -1
  29. package/dist/useImageUploader-RX88_Cp-.js.map +1 -1
  30. package/dist/{useProfileImageUpload-UUrg2Lkw.js → useProfileImageUpload-C6Gat9NR.js} +6 -6
  31. package/dist/useProfileImageUpload-C6Gat9NR.js.map +1 -0
  32. package/dist/useProfileImageUpload-KpvcwEqx.js.map +1 -1
  33. package/dist/{utils-BxC_k1lu.js → utils-C58No1u2.js} +108 -62
  34. package/dist/utils-C58No1u2.js.map +1 -0
  35. package/dist/{utils-WEbpTEyB.js → utils-CFUW0P-E.js} +102 -61
  36. package/dist/utils-CFUW0P-E.js.map +1 -0
  37. package/dist/utils.js.map +1 -1
  38. package/package.json +57 -54
  39. package/types.d.ts +1 -0
  40. package/dist/index-BkKE5xo-.js.map +0 -1
  41. package/dist/index-FbPHXCzL.js.map +0 -1
  42. package/dist/useProfileImageUpload-UUrg2Lkw.js.map +0 -1
  43. package/dist/utils-BxC_k1lu.js.map +0 -1
  44. package/dist/utils-WEbpTEyB.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
4
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
- var require$$0 = require('react');
5
+ var g = require('react');
6
6
  var neetoCist = require('@bigbinary/neeto-cist');
7
7
  var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
8
8
  var NeetoUIModal = require('@bigbinary/neetoui/Modal');
@@ -12,7 +12,7 @@ var Toastr = require('@bigbinary/neetoui/Toastr');
12
12
  var Typography = require('@bigbinary/neetoui/Typography');
13
13
  var ramda = require('ramda');
14
14
  var reactI18next = require('react-i18next');
15
- var utils$1 = require('./utils-BxC_k1lu.js');
15
+ var utils$1 = require('./utils-C58No1u2.js');
16
16
  var useImageUploader = require('./useImageUploader-Bm9TukCy.js');
17
17
  var index = require('./index-BtHfh_eu.js');
18
18
  var classnames = require('classnames');
@@ -41,48 +41,418 @@ var constructCloudflareImageURL = function constructCloudflareImageURL(url) {
41
41
 
42
42
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
43
43
 
44
- var css$2 = ".niu-modal {\n width: 95vw !important;\n height: 75vh !important;\n max-width: 1152px !important;\n max-height: 576px !important;\n position: relative !important;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX21vZGFsLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0E7RUFDRSxzQkFBQTtFQUNBLHVCQUFBO0VBQ0EsNEJBQUE7RUFDQSw0QkFBQTtFQUNBLDZCQUFBO0FBRkYiLCJzb3VyY2VzQ29udGVudCI6WyIvL0Fic3RyYWN0c1xuQGltcG9ydCBcIi4uL2Fic3RyYWN0cy92YXJpYWJsZXNcIjtcblxuLm5pdS1tb2RhbCB7XG4gIHdpZHRoOiAkbml1LW1vZGFsLXdpZHRoICFpbXBvcnRhbnQ7XG4gIGhlaWdodDogJG5pdS1tb2RhbC1oZWlnaHQgIWltcG9ydGFudDtcbiAgbWF4LXdpZHRoOiAkbml1LW1vZGFsLW1heC13aWR0aCAhaW1wb3J0YW50O1xuICBtYXgtaGVpZ2h0OiAkbml1LW1vZGFsLW1heC1oZWlnaHQgIWltcG9ydGFudDtcbiAgcG9zaXRpb246IHJlbGF0aXZlICFpbXBvcnRhbnQ7XG59XG4iXX0= */";
44
+ var css$2 = ".niu-modal {\n width: 95vw !important;\n height: 75vh !important;\n max-width: 1152px !important;\n max-height: 36rem !important;\n position: relative !important;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX21vZGFsLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0E7RUFDRSxzQkFBQTtFQUNBLHVCQUFBO0VBQ0EsNEJBQUE7RUFDQSw0QkFBQTtFQUNBLDZCQUFBO0FBRkYiLCJzb3VyY2VzQ29udGVudCI6WyIvL0Fic3RyYWN0c1xuQGltcG9ydCBcIi4uL2Fic3RyYWN0cy92YXJpYWJsZXNcIjtcblxuLm5pdS1tb2RhbCB7XG4gIHdpZHRoOiAkbml1LW1vZGFsLXdpZHRoICFpbXBvcnRhbnQ7XG4gIGhlaWdodDogJG5pdS1tb2RhbC1oZWlnaHQgIWltcG9ydGFudDtcbiAgbWF4LXdpZHRoOiAkbml1LW1vZGFsLW1heC13aWR0aCAhaW1wb3J0YW50O1xuICBtYXgtaGVpZ2h0OiAkbml1LW1vZGFsLW1heC1oZWlnaHQgIWltcG9ydGFudDtcbiAgcG9zaXRpb246IHJlbGF0aXZlICFpbXBvcnRhbnQ7XG59XG4iXX0= */";
45
45
  n(css$2,{});
46
46
 
47
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
48
-
49
- function getDefaultExportFromCjs (x) {
50
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
47
+ const M = {
48
+ x: 0,
49
+ y: 0,
50
+ width: 0,
51
+ height: 0,
52
+ unit: "px"
53
+ }, f = (s, t, e) => Math.min(Math.max(s, t), e), S = (...s) => s.filter((t) => t && typeof t == "string").join(" "), P = (s, t) => s === t || s.width === t.width && s.height === t.height && s.x === t.x && s.y === t.y && s.unit === t.unit;
54
+ function H(s, t, e, o) {
55
+ const i = y(s, e, o);
56
+ return s.width && (i.height = i.width / t), s.height && (i.width = i.height * t), i.y + i.height > o && (i.height = o - i.y, i.width = i.height * t), i.x + i.width > e && (i.width = e - i.x, i.height = i.width / t), s.unit === "%" ? D(i, e, o) : i;
51
57
  }
52
-
53
- function getAugmentedNamespace(n) {
54
- if (n.__esModule) return n;
55
- var f = n.default;
56
- if (typeof f == "function") {
57
- var a = function a () {
58
- if (this instanceof a) {
59
- return Reflect.construct(f, arguments, this.constructor);
60
- }
61
- return f.apply(this, arguments);
62
- };
63
- a.prototype = f.prototype;
64
- } else a = {};
65
- Object.defineProperty(a, '__esModule', {value: true});
66
- Object.keys(n).forEach(function (k) {
67
- var d = Object.getOwnPropertyDescriptor(n, k);
68
- Object.defineProperty(a, k, d.get ? d : {
69
- enumerable: true,
70
- get: function () {
71
- return n[k];
72
- }
73
- });
74
- });
75
- return a;
58
+ function N(s, t, e) {
59
+ const o = y(s, t, e);
60
+ return o.x = (t - o.width) / 2, o.y = (e - o.height) / 2, s.unit === "%" ? D(o, t, e) : o;
76
61
  }
77
-
78
- var ReactCrop_min = {exports: {}};
79
-
80
- (function (module, exports) {
81
- !function(e,t){module.exports=t(require$$0);}(commonjsGlobal,(e=>(()=>{var t={899:t=>{t.exports=e;}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]});},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});};var r={};return (()=>{o.r(r),o.d(r,{Component:()=>u,areCropsEqual:()=>h,centerCrop:()=>d,clamp:()=>a,containCrop:()=>p,convertToPercentCrop:()=>c,convertToPixelCrop:()=>l,default:()=>u,defaultCrop:()=>i,makeAspectCrop:()=>s,nudgeCrop:()=>g});var e=o(899),t=o.n(e);function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const i={x:0,y:0,width:0,height:0,unit:"px"};function a(e,t,n){return Math.min(Math.max(e,t),n)}function h(e,t){return e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit}function s(e,t,n,o){const r=l(e,n,o);return e.width&&(r.height=r.width/t),e.height&&(r.width=r.height*t),r.y+r.height>o&&(r.height=o-r.y,r.width=r.height*t),r.x+r.width>n&&(r.width=n-r.x,r.height=r.width/t),"%"===e.unit?c(r,n,o):r}function d(e,t,n){const o=l(e,t,n);return o.x=(t-o.width)/2,o.y=(n-o.height)/2,"%"===e.unit?c(o,t,n):o}function c(e,t,n){return "%"===e.unit?{...i,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function l(e,t,n){return e.unit?"px"===e.unit?{...i,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...i,...e,unit:"px"}}function p(e,t,n,o,r,i=0,a=0,h=o,s=r){const d={...e};let c=Math.min(i,o),l=Math.min(a,r),p=Math.min(h,o),g=Math.min(s,r);t&&(t>1?(c=a?a*t:c,l=c/t,p=h*t):(l=i?i/t:l,c=l*t,g=s/t)),d.y<0&&(d.height=Math.max(d.height+d.y,l),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,c),d.x=0);const w=o-(d.x+d.width);w<0&&(d.x=Math.min(d.x,o-c),d.width+=w);const u=r-(d.y+d.height);if(u<0&&(d.y=Math.min(d.y,r-l),d.height+=u),d.width<c&&("sw"!==n&&"nw"!=n||(d.x-=c-d.width),d.width=c),d.height<l&&("nw"!==n&&"ne"!=n||(d.y-=l-d.height),d.height=l),d.width>p&&("sw"!==n&&"nw"!=n||(d.x-=p-d.width),d.width=p),d.height>g&&("nw"!==n&&"ne"!=n||(d.y-=g-d.height),d.height=g),t){const e=d.width/d.height;if(e<t){const e=Math.max(d.width/t,l);"nw"!==n&&"ne"!=n||(d.y-=e-d.height),d.height=e;}else if(e>t){const e=Math.max(d.height*t,c);"sw"!==n&&"nw"!=n||(d.x-=e-d.width),d.width=e;}}return d}function g(e,t,n,o){const r={...e};return "ArrowLeft"===t?"nw"===o?(r.x-=n,r.y-=n,r.width+=n,r.height+=n):"w"===o?(r.x-=n,r.width+=n):"sw"===o?(r.x-=n,r.width+=n,r.height+=n):"ne"===o?(r.y+=n,r.width-=n,r.height-=n):"e"===o?r.width-=n:"se"===o&&(r.width-=n,r.height-=n):"ArrowRight"===t&&("nw"===o?(r.x+=n,r.y+=n,r.width-=n,r.height-=n):"w"===o?(r.x+=n,r.width-=n):"sw"===o?(r.x+=n,r.width-=n,r.height-=n):"ne"===o?(r.y-=n,r.width+=n,r.height+=n):"e"===o?r.width+=n:"se"===o&&(r.width+=n,r.height+=n)),"ArrowUp"===t?"nw"===o?(r.x-=n,r.y-=n,r.width+=n,r.height+=n):"n"===o?(r.y-=n,r.height+=n):"ne"===o?(r.y-=n,r.width+=n,r.height+=n):"sw"===o?(r.x+=n,r.width-=n,r.height-=n):"s"===o?r.height-=n:"se"===o&&(r.width-=n,r.height-=n):"ArrowDown"===t&&("nw"===o?(r.x+=n,r.y+=n,r.width-=n,r.height-=n):"n"===o?(r.y+=n,r.height-=n):"ne"===o?(r.y+=n,r.width-=n,r.height-=n):"sw"===o?(r.x-=n,r.width+=n,r.height+=n):"s"===o?r.height+=n:"se"===o&&(r.width+=n,r.height+=n)),r}const w={capture:!0,passive:!1};class u extends e.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=(0, e.createRef)(),this.mediaRef=(0, e.createRef)(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{const{crop:t,disabled:n}=this.props,o=this.getBox();if(!t)return;const r=l(t,o.width,o.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const i=e.target.dataset.ord,a=Boolean(i);let h=e.clientX,s=e.clientY,d=r.x,c=r.y;if(i){const t=e.clientX-o.x,n=e.clientY-o.y;let a=0,l=0;"ne"===i||"e"==i?(a=t-(r.x+r.width),l=n-r.y,d=r.x,c=r.y+r.height):"se"===i||"s"===i?(a=t-(r.x+r.width),l=n-(r.y+r.height),d=r.x,c=r.y):"sw"===i||"w"==i?(a=t-r.x,l=n-(r.y+r.height),d=r.x+r.width,c=r.y):"nw"!==i&&"n"!=i||(a=t-r.x,l=n-r.y,d=r.x+r.width,c=r.y+r.height),h=d+o.x+a,s=c+o.y+l;}this.evData={startClientX:h,startClientY:s,startCropX:d,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:a,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0});},this.onComponentPointerDown=e=>{const{crop:t,disabled:n,locked:o,keepSelection:r,onChange:i}=this.props,a=this.getBox();if(n||o||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const h=e.clientX-a.x,s=e.clientY-a.y,d={unit:"px",x:h,y:s,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:s,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(l(d,a.width,a.height),c(d,a.width,a.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0});},this.onDocPointerMove=e=>{const{crop:t,disabled:n,onChange:o,onDragStart:r}=this.props,i=this.getBox();if(n||!t||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,r&&r(e));const{evData:a}=this;let s;a.clientX=e.clientX,a.clientY=e.clientY,s=a.isResize?this.resizeCrop():this.dragCrop(),h(t,s)||o(l(s,i.width,i.height),c(s,i.width,i.height));},this.onComponentKeyDown=e=>{const{crop:t,disabled:n,onChange:o,onComplete:r}=this.props,i=this.getBox();if(n)return;const h=e.key;let s=!1;if(!t)return;const d=this.makePixelCrop(),p=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?u.nudgeStepLarge:e.shiftKey?u.nudgeStepMedium:u.nudgeStep;if("ArrowLeft"===h?(d.x-=p,s=!0):"ArrowRight"===h?(d.x+=p,s=!0):"ArrowUp"===h?(d.y-=p,s=!0):"ArrowDown"===h&&(d.y+=p,s=!0),s){e.cancelable&&e.preventDefault(),d.x=a(d.x,0,i.width-d.width),d.y=a(d.y,0,i.height-d.height);const t=l(d,i.width,i.height),n=c(d,i.width,i.height);o(t,n),r&&r(t,n);}},this.onHandlerKeyDown=(e,t)=>{const{aspect:n=0,crop:o,disabled:r,minWidth:i=0,minHeight:a=0,maxWidth:s,maxHeight:d,onChange:w,onComplete:m}=this.props,y=this.getBox();if(r||!o)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.stopPropagation(),e.preventDefault();const x=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?u.nudgeStepLarge:e.shiftKey?u.nudgeStepMedium:u.nudgeStep,C=p(g(l(o,y.width,y.height),e.key,x,t),n,t,y.width,y.height,i,a,s,d);if(!h(o,C)){const e=c(C,y.width,y.height);w(C,e),m&&m(C,e);}},this.onDocPointerDone=e=>{const{crop:t,disabled:n,onComplete:o,onDragEnd:r}=this.props,i=this.getBox();this.unbindDocMove(),!n&&t&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),o&&o(l(t,i.width,i.height),c(t,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}));},this.onDragFocus=e=>{var t;null===(t=this.componentRef.current)||void 0===t||t.scrollTo(0,0);};}get document(){return document}getBox(){const e=this.mediaRef.current;if(!e)return {x:0,y:0,width:0,height:0};const{x:t,y:n,width:o,height:r}=e.getBoundingClientRect();return {x:t,y:n,width:o,height:r}}componentDidUpdate(e){const{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){const{width:e,height:o}=this.getBox();e&&o&&n(l(t,e,o),c(t,e,o));}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect();}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,w),this.document.addEventListener("pointerup",this.onDocPointerDone,w),this.document.addEventListener("pointercancel",this.onDocPointerDone,w),this.docMoveBound=!0);}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,w),this.document.removeEventListener("pointerup",this.onDocPointerDone,w),this.document.removeEventListener("pointercancel",this.onDocPointerDone,w),this.docMoveBound=!1);}getCropStyle(){const{crop:e}=this.props;if(e)return {top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){const{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(),o=e.clientX-e.startClientX,r=e.clientY-e.startClientY;return n.x=a(e.startCropX+o,0,t.width-n.width),n.y=a(e.startCropY+r,0,t.height-n.height),n}getPointRegion(e){const{evData:t}=this,n=t.clientX-e.x,o=t.clientY-e.y<t.startCropY;return n<t.startCropX?o?"nw":"sw":o?"ne":"se"}resizeCrop(){const{evData:e}=this,t=this.getBox(),{aspect:n=0,minWidth:o=0,minHeight:r=0,maxWidth:i,maxHeight:a}=this.props,h=this.getPointRegion(t),s=this.makePixelCrop(),d=e.ord?e.ord:h,c=e.clientX-e.startClientX,l=e.clientY-e.startClientY,g={unit:"px",x:0,y:0,width:0,height:0};"ne"===h?(g.x=e.startCropX,g.width=c,n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(l),g.y=e.startCropY-g.height)):"se"===h?(g.x=e.startCropX,g.y=e.startCropY,g.width=c,g.height=n?g.width/n:l):"sw"===h?(g.x=e.startCropX+c,g.y=e.startCropY,g.width=Math.abs(c),g.height=n?g.width/n:l):"nw"===h&&(g.x=e.startCropX+c,g.width=Math.abs(c),n?(g.height=g.width/n,g.y=e.startCropY-g.height):(g.height=Math.abs(l),g.y=e.startCropY+l));const w=p(g,n,h,t.width,t.height,o,r,i,a);return n||u.xyOrds.indexOf(d)>-1?(s.x=w.x,s.y=w.y,s.width=w.width,s.height=w.height):u.xOrds.indexOf(d)>-1?(s.x=w.x,s.width=w.width):u.yOrds.indexOf(d)>-1&&(s.y=w.y,s.height=w.height),s}createCropSelection(){const{ariaLabels:e=u.defaultProps.ariaLabels,disabled:n,locked:o,renderSelectionAddon:r,ruleOfThirds:i,crop:a}=this.props,h=this.getCropStyle();if(a)return t().createElement("div",{style:h,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!o&&t().createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t().createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t().createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t().createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),r&&t().createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:e=>e.stopPropagation()},r(this.state)),i&&t().createElement(t().Fragment,null,t().createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t().createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(){const e={...i,...this.props.crop||{}},t=this.getBox();return l(e,t.width,t.height)}render(){const{aspect:e,children:o,circularCrop:r,className:i,crop:a,disabled:h,locked:s,style:d,ruleOfThirds:c}=this.props,{cropIsActive:l,newCropIsBeingDrawn:p}=this.state,g=a?this.createCropSelection():null,w=function(){for(var e,t,o=0,r="";o<arguments.length;)(e=arguments[o++])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}("ReactCrop",i,{"ReactCrop--active":l,"ReactCrop--disabled":h,"ReactCrop--locked":s,"ReactCrop--new-crop":p,"ReactCrop--fixed-aspect":a&&e,"ReactCrop--circular-crop":a&&r,"ReactCrop--rule-of-thirds":a&&c,"ReactCrop--invisible-crop":!this.dragStarted&&a&&!a.width&&!a.height});return t().createElement("div",{ref:this.componentRef,className:w,style:d},t().createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),g)}}u.xOrds=["e","w"],u.yOrds=["n","s"],u.xyOrds=["nw","ne","se","sw"],u.nudgeStep=1,u.nudgeStepMedium=10,u.nudgeStepLarge=100,u.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};})(),r})()));
82
- } (ReactCrop_min));
83
-
84
- var ReactCrop_minExports = ReactCrop_min.exports;
85
- var ReactCrop = /*@__PURE__*/getDefaultExportFromCjs(ReactCrop_minExports);
62
+ function D(s, t, e) {
63
+ return s.unit === "%" ? { ...M, ...s, unit: "%" } : {
64
+ unit: "%",
65
+ x: s.x ? s.x / t * 100 : 0,
66
+ y: s.y ? s.y / e * 100 : 0,
67
+ width: s.width ? s.width / t * 100 : 0,
68
+ height: s.height ? s.height / e * 100 : 0
69
+ };
70
+ }
71
+ function y(s, t, e) {
72
+ return s.unit ? s.unit === "px" ? { ...M, ...s, unit: "px" } : {
73
+ unit: "px",
74
+ x: s.x ? s.x * t / 100 : 0,
75
+ y: s.y ? s.y * e / 100 : 0,
76
+ width: s.width ? s.width * t / 100 : 0,
77
+ height: s.height ? s.height * e / 100 : 0
78
+ } : { ...M, ...s, unit: "px" };
79
+ }
80
+ function X(s, t, e, o, i, n = 0, a = 0, w = o, h = i) {
81
+ const r = { ...s };
82
+ let c = Math.min(n, o), d = Math.min(a, i), p = Math.min(w, o), l = Math.min(h, i);
83
+ t && (t > 1 ? (c = a ? a * t : c, d = c / t, p = w * t) : (d = n ? n / t : d, c = d * t, l = h / t)), r.y < 0 && (r.height = Math.max(r.height + r.y, d), r.y = 0), r.x < 0 && (r.width = Math.max(r.width + r.x, c), r.x = 0);
84
+ const u = o - (r.x + r.width);
85
+ u < 0 && (r.x = Math.min(r.x, o - c), r.width += u);
86
+ const C = i - (r.y + r.height);
87
+ if (C < 0 && (r.y = Math.min(r.y, i - d), r.height += C), r.width < c && ((e === "sw" || e == "nw") && (r.x -= c - r.width), r.width = c), r.height < d && ((e === "nw" || e == "ne") && (r.y -= d - r.height), r.height = d), r.width > p && ((e === "sw" || e == "nw") && (r.x -= p - r.width), r.width = p), r.height > l && ((e === "nw" || e == "ne") && (r.y -= l - r.height), r.height = l), t) {
88
+ const R = r.width / r.height;
89
+ if (R < t) {
90
+ const x = Math.max(r.width / t, d);
91
+ (e === "nw" || e == "ne") && (r.y -= x - r.height), r.height = x;
92
+ } else if (R > t) {
93
+ const x = Math.max(r.height * t, c);
94
+ (e === "sw" || e == "nw") && (r.x -= x - r.width), r.width = x;
95
+ }
96
+ }
97
+ return r;
98
+ }
99
+ function K(s, t, e, o) {
100
+ const i = { ...s };
101
+ return t === "ArrowLeft" ? o === "nw" ? (i.x -= e, i.y -= e, i.width += e, i.height += e) : o === "w" ? (i.x -= e, i.width += e) : o === "sw" ? (i.x -= e, i.width += e, i.height += e) : o === "ne" ? (i.y += e, i.width -= e, i.height -= e) : o === "e" ? i.width -= e : o === "se" && (i.width -= e, i.height -= e) : t === "ArrowRight" && (o === "nw" ? (i.x += e, i.y += e, i.width -= e, i.height -= e) : o === "w" ? (i.x += e, i.width -= e) : o === "sw" ? (i.x += e, i.width -= e, i.height -= e) : o === "ne" ? (i.y -= e, i.width += e, i.height += e) : o === "e" ? i.width += e : o === "se" && (i.width += e, i.height += e)), t === "ArrowUp" ? o === "nw" ? (i.x -= e, i.y -= e, i.width += e, i.height += e) : o === "n" ? (i.y -= e, i.height += e) : o === "ne" ? (i.y -= e, i.width += e, i.height += e) : o === "sw" ? (i.x += e, i.width -= e, i.height -= e) : o === "s" ? i.height -= e : o === "se" && (i.width -= e, i.height -= e) : t === "ArrowDown" && (o === "nw" ? (i.x += e, i.y += e, i.width -= e, i.height -= e) : o === "n" ? (i.y += e, i.height -= e) : o === "ne" ? (i.y += e, i.width -= e, i.height -= e) : o === "sw" ? (i.x -= e, i.width += e, i.height += e) : o === "s" ? i.height += e : o === "se" && (i.width += e, i.height += e)), i;
102
+ }
103
+ const b = { capture: !0, passive: !1 }, v = class m extends g.PureComponent {
104
+ constructor() {
105
+ super(...arguments), this.docMoveBound = !1, this.mouseDownOnCrop = !1, this.dragStarted = !1, this.evData = {
106
+ startClientX: 0,
107
+ startClientY: 0,
108
+ startCropX: 0,
109
+ startCropY: 0,
110
+ clientX: 0,
111
+ clientY: 0,
112
+ isResize: !0
113
+ }, this.componentRef = g.createRef(), this.mediaRef = g.createRef(), this.initChangeCalled = !1, this.state = {
114
+ cropIsActive: !1,
115
+ newCropIsBeingDrawn: !1
116
+ }, this.onCropPointerDown = (t) => {
117
+ const { crop: e, disabled: o } = this.props, i = this.getBox();
118
+ if (!e)
119
+ return;
120
+ const n = y(e, i.width, i.height);
121
+ if (o)
122
+ return;
123
+ t.cancelable && t.preventDefault(), this.bindDocMove(), this.componentRef.current.focus({ preventScroll: !0 });
124
+ const a = t.target.dataset.ord, w = !!a;
125
+ let h = t.clientX, r = t.clientY, c = n.x, d = n.y;
126
+ if (a) {
127
+ const p = t.clientX - i.x, l = t.clientY - i.y;
128
+ let u = 0, C = 0;
129
+ a === "ne" || a == "e" ? (u = p - (n.x + n.width), C = l - n.y, c = n.x, d = n.y + n.height) : a === "se" || a === "s" ? (u = p - (n.x + n.width), C = l - (n.y + n.height), c = n.x, d = n.y) : a === "sw" || a == "w" ? (u = p - n.x, C = l - (n.y + n.height), c = n.x + n.width, d = n.y) : (a === "nw" || a == "n") && (u = p - n.x, C = l - n.y, c = n.x + n.width, d = n.y + n.height), h = c + i.x + u, r = d + i.y + C;
130
+ }
131
+ this.evData = {
132
+ startClientX: h,
133
+ startClientY: r,
134
+ startCropX: c,
135
+ startCropY: d,
136
+ clientX: t.clientX,
137
+ clientY: t.clientY,
138
+ isResize: w,
139
+ ord: a
140
+ }, this.mouseDownOnCrop = !0, this.setState({ cropIsActive: !0 });
141
+ }, this.onComponentPointerDown = (t) => {
142
+ const { crop: e, disabled: o, locked: i, keepSelection: n, onChange: a } = this.props, w = this.getBox();
143
+ if (o || i || n && e)
144
+ return;
145
+ t.cancelable && t.preventDefault(), this.bindDocMove(), this.componentRef.current.focus({ preventScroll: !0 });
146
+ const h = t.clientX - w.x, r = t.clientY - w.y, c = {
147
+ unit: "px",
148
+ x: h,
149
+ y: r,
150
+ width: 0,
151
+ height: 0
152
+ };
153
+ this.evData = {
154
+ startClientX: t.clientX,
155
+ startClientY: t.clientY,
156
+ startCropX: h,
157
+ startCropY: r,
158
+ clientX: t.clientX,
159
+ clientY: t.clientY,
160
+ isResize: !0
161
+ }, this.mouseDownOnCrop = !0, a(y(c, w.width, w.height), D(c, w.width, w.height)), this.setState({ cropIsActive: !0, newCropIsBeingDrawn: !0 });
162
+ }, this.onDocPointerMove = (t) => {
163
+ const { crop: e, disabled: o, onChange: i, onDragStart: n } = this.props, a = this.getBox();
164
+ if (o || !e || !this.mouseDownOnCrop)
165
+ return;
166
+ t.cancelable && t.preventDefault(), this.dragStarted || (this.dragStarted = !0, n && n(t));
167
+ const { evData: w } = this;
168
+ w.clientX = t.clientX, w.clientY = t.clientY;
169
+ let h;
170
+ w.isResize ? h = this.resizeCrop() : h = this.dragCrop(), P(e, h) || i(
171
+ y(h, a.width, a.height),
172
+ D(h, a.width, a.height)
173
+ );
174
+ }, this.onComponentKeyDown = (t) => {
175
+ const { crop: e, disabled: o, onChange: i, onComplete: n } = this.props;
176
+ if (o)
177
+ return;
178
+ const a = t.key;
179
+ let w = !1;
180
+ if (!e)
181
+ return;
182
+ const h = this.getBox(), r = this.makePixelCrop(h), d = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? m.nudgeStepLarge : t.shiftKey ? m.nudgeStepMedium : m.nudgeStep;
183
+ if (a === "ArrowLeft" ? (r.x -= d, w = !0) : a === "ArrowRight" ? (r.x += d, w = !0) : a === "ArrowUp" ? (r.y -= d, w = !0) : a === "ArrowDown" && (r.y += d, w = !0), w) {
184
+ t.cancelable && t.preventDefault(), r.x = f(r.x, 0, h.width - r.width), r.y = f(r.y, 0, h.height - r.height);
185
+ const p = y(r, h.width, h.height), l = D(r, h.width, h.height);
186
+ i(p, l), n && n(p, l);
187
+ }
188
+ }, this.onHandlerKeyDown = (t, e) => {
189
+ const {
190
+ aspect: o = 0,
191
+ crop: i,
192
+ disabled: n,
193
+ minWidth: a = 0,
194
+ minHeight: w = 0,
195
+ maxWidth: h,
196
+ maxHeight: r,
197
+ onChange: c,
198
+ onComplete: d
199
+ } = this.props, p = this.getBox();
200
+ if (n || !i)
201
+ return;
202
+ if (t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "ArrowLeft" || t.key === "ArrowRight")
203
+ t.stopPropagation(), t.preventDefault();
204
+ else
205
+ return;
206
+ const u = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? m.nudgeStepLarge : t.shiftKey ? m.nudgeStepMedium : m.nudgeStep, C = y(i, p.width, p.height), R = K(C, t.key, u, e), x = X(
207
+ R,
208
+ o,
209
+ e,
210
+ p.width,
211
+ p.height,
212
+ a,
213
+ w,
214
+ h,
215
+ r
216
+ );
217
+ if (!P(i, x)) {
218
+ const Y = D(x, p.width, p.height);
219
+ c(x, Y), d && d(x, Y);
220
+ }
221
+ }, this.onDocPointerDone = (t) => {
222
+ const { crop: e, disabled: o, onComplete: i, onDragEnd: n } = this.props, a = this.getBox();
223
+ this.unbindDocMove(), !(o || !e) && this.mouseDownOnCrop && (this.mouseDownOnCrop = !1, this.dragStarted = !1, n && n(t), i && i(y(e, a.width, a.height), D(e, a.width, a.height)), this.setState({ cropIsActive: !1, newCropIsBeingDrawn: !1 }));
224
+ }, this.onDragFocus = (t) => {
225
+ var e;
226
+ (e = this.componentRef.current) == null || e.scrollTo(0, 0);
227
+ };
228
+ }
229
+ get document() {
230
+ return document;
231
+ }
232
+ // We unfortunately get the bounding box every time as x+y changes
233
+ // due to scrolling.
234
+ getBox() {
235
+ const t = this.mediaRef.current;
236
+ if (!t)
237
+ return { x: 0, y: 0, width: 0, height: 0 };
238
+ const { x: e, y: o, width: i, height: n } = t.getBoundingClientRect();
239
+ return { x: e, y: o, width: i, height: n };
240
+ }
241
+ componentDidUpdate(t) {
242
+ const { crop: e, onComplete: o } = this.props;
243
+ if (o && !t.crop && e) {
244
+ const { width: i, height: n } = this.getBox();
245
+ i && n && o(y(e, i, n), D(e, i, n));
246
+ }
247
+ }
248
+ componentWillUnmount() {
249
+ this.resizeObserver && this.resizeObserver.disconnect();
250
+ }
251
+ bindDocMove() {
252
+ this.docMoveBound || (this.document.addEventListener("pointermove", this.onDocPointerMove, b), this.document.addEventListener("pointerup", this.onDocPointerDone, b), this.document.addEventListener("pointercancel", this.onDocPointerDone, b), this.docMoveBound = !0);
253
+ }
254
+ unbindDocMove() {
255
+ this.docMoveBound && (this.document.removeEventListener("pointermove", this.onDocPointerMove, b), this.document.removeEventListener("pointerup", this.onDocPointerDone, b), this.document.removeEventListener("pointercancel", this.onDocPointerDone, b), this.docMoveBound = !1);
256
+ }
257
+ getCropStyle() {
258
+ const { crop: t } = this.props;
259
+ if (t)
260
+ return {
261
+ top: `${t.y}${t.unit}`,
262
+ left: `${t.x}${t.unit}`,
263
+ width: `${t.width}${t.unit}`,
264
+ height: `${t.height}${t.unit}`
265
+ };
266
+ }
267
+ dragCrop() {
268
+ const { evData: t } = this, e = this.getBox(), o = this.makePixelCrop(e), i = t.clientX - t.startClientX, n = t.clientY - t.startClientY;
269
+ return o.x = f(t.startCropX + i, 0, e.width - o.width), o.y = f(t.startCropY + n, 0, e.height - o.height), o;
270
+ }
271
+ getPointRegion(t, e, o, i) {
272
+ const { evData: n } = this, a = n.clientX - t.x, w = n.clientY - t.y;
273
+ let h;
274
+ i && e ? h = e === "nw" || e === "n" || e === "ne" : h = w < n.startCropY;
275
+ let r;
276
+ return o && e ? r = e === "nw" || e === "w" || e === "sw" : r = a < n.startCropX, r ? h ? "nw" : "sw" : h ? "ne" : "se";
277
+ }
278
+ resolveMinDimensions(t, e, o = 0, i = 0) {
279
+ let n = Math.min(o, t.width), a = Math.min(i, t.height);
280
+ return !e || !n && !a ? [n, a] : e > 1 ? n ? [n, n / e] : [a * e, a] : a ? [a * e, a] : [n, n / e];
281
+ }
282
+ resizeCrop() {
283
+ const { evData: t } = this, { aspect: e = 0, maxWidth: o, maxHeight: i } = this.props, n = this.getBox(), [a, w] = this.resolveMinDimensions(n, e, this.props.minWidth, this.props.minHeight);
284
+ let h = this.makePixelCrop(n), r = this.getPointRegion(n, t.ord, a, w);
285
+ const c = t.ord || r;
286
+ let d = t.clientX - t.startClientX, p = t.clientY - t.startClientY;
287
+ (a && c === "nw" || c === "w" || c === "sw") && (d = Math.min(d, -a)), (w && c === "nw" || c === "n" || c === "ne") && (p = Math.min(p, -w));
288
+ const l = {
289
+ unit: "px",
290
+ x: 0,
291
+ y: 0,
292
+ width: 0,
293
+ height: 0
294
+ };
295
+ r === "ne" ? (l.x = t.startCropX, l.width = d, e ? (l.height = l.width / e, l.y = t.startCropY - l.height) : (l.height = Math.abs(p), l.y = t.startCropY - l.height)) : r === "se" ? (l.x = t.startCropX, l.y = t.startCropY, l.width = d, e ? l.height = l.width / e : l.height = p) : r === "sw" ? (l.x = t.startCropX + d, l.y = t.startCropY, l.width = Math.abs(d), e ? l.height = l.width / e : l.height = p) : r === "nw" && (l.x = t.startCropX + d, l.width = Math.abs(d), e ? (l.height = l.width / e, l.y = t.startCropY - l.height) : (l.height = Math.abs(p), l.y = t.startCropY + p));
296
+ const u = X(
297
+ l,
298
+ e,
299
+ r,
300
+ n.width,
301
+ n.height,
302
+ a,
303
+ w,
304
+ o,
305
+ i
306
+ );
307
+ return e || m.xyOrds.indexOf(c) > -1 ? h = u : m.xOrds.indexOf(c) > -1 ? (h.x = u.x, h.width = u.width) : m.yOrds.indexOf(c) > -1 && (h.y = u.y, h.height = u.height), h.x = f(h.x, 0, n.width - h.width), h.y = f(h.y, 0, n.height - h.height), h;
308
+ }
309
+ createCropSelection() {
310
+ const {
311
+ ariaLabels: t = m.defaultProps.ariaLabels,
312
+ disabled: e,
313
+ locked: o,
314
+ renderSelectionAddon: i,
315
+ ruleOfThirds: n,
316
+ crop: a
317
+ } = this.props, w = this.getCropStyle();
318
+ if (a)
319
+ return /* @__PURE__ */ g.createElement(
320
+ "div",
321
+ {
322
+ style: w,
323
+ className: "ReactCrop__crop-selection",
324
+ onPointerDown: this.onCropPointerDown,
325
+ "aria-label": t.cropArea,
326
+ tabIndex: 0,
327
+ onKeyDown: this.onComponentKeyDown,
328
+ role: "group"
329
+ },
330
+ !e && !o && /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__drag-elements", onFocus: this.onDragFocus }, /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__drag-bar ord-n", "data-ord": "n" }), /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__drag-bar ord-e", "data-ord": "e" }), /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__drag-bar ord-s", "data-ord": "s" }), /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__drag-bar ord-w", "data-ord": "w" }), /* @__PURE__ */ g.createElement(
331
+ "div",
332
+ {
333
+ className: "ReactCrop__drag-handle ord-nw",
334
+ "data-ord": "nw",
335
+ tabIndex: 0,
336
+ "aria-label": t.nwDragHandle,
337
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "nw"),
338
+ role: "button"
339
+ }
340
+ ), /* @__PURE__ */ g.createElement(
341
+ "div",
342
+ {
343
+ className: "ReactCrop__drag-handle ord-n",
344
+ "data-ord": "n",
345
+ tabIndex: 0,
346
+ "aria-label": t.nDragHandle,
347
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "n"),
348
+ role: "button"
349
+ }
350
+ ), /* @__PURE__ */ g.createElement(
351
+ "div",
352
+ {
353
+ className: "ReactCrop__drag-handle ord-ne",
354
+ "data-ord": "ne",
355
+ tabIndex: 0,
356
+ "aria-label": t.neDragHandle,
357
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "ne"),
358
+ role: "button"
359
+ }
360
+ ), /* @__PURE__ */ g.createElement(
361
+ "div",
362
+ {
363
+ className: "ReactCrop__drag-handle ord-e",
364
+ "data-ord": "e",
365
+ tabIndex: 0,
366
+ "aria-label": t.eDragHandle,
367
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "e"),
368
+ role: "button"
369
+ }
370
+ ), /* @__PURE__ */ g.createElement(
371
+ "div",
372
+ {
373
+ className: "ReactCrop__drag-handle ord-se",
374
+ "data-ord": "se",
375
+ tabIndex: 0,
376
+ "aria-label": t.seDragHandle,
377
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "se"),
378
+ role: "button"
379
+ }
380
+ ), /* @__PURE__ */ g.createElement(
381
+ "div",
382
+ {
383
+ className: "ReactCrop__drag-handle ord-s",
384
+ "data-ord": "s",
385
+ tabIndex: 0,
386
+ "aria-label": t.sDragHandle,
387
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "s"),
388
+ role: "button"
389
+ }
390
+ ), /* @__PURE__ */ g.createElement(
391
+ "div",
392
+ {
393
+ className: "ReactCrop__drag-handle ord-sw",
394
+ "data-ord": "sw",
395
+ tabIndex: 0,
396
+ "aria-label": t.swDragHandle,
397
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "sw"),
398
+ role: "button"
399
+ }
400
+ ), /* @__PURE__ */ g.createElement(
401
+ "div",
402
+ {
403
+ className: "ReactCrop__drag-handle ord-w",
404
+ "data-ord": "w",
405
+ tabIndex: 0,
406
+ "aria-label": t.wDragHandle,
407
+ onKeyDown: (h) => this.onHandlerKeyDown(h, "w"),
408
+ role: "button"
409
+ }
410
+ )),
411
+ i && /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__selection-addon", onMouseDown: (h) => h.stopPropagation() }, i(this.state)),
412
+ n && /* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__rule-of-thirds-hz" }), /* @__PURE__ */ g.createElement("div", { className: "ReactCrop__rule-of-thirds-vt" }))
413
+ );
414
+ }
415
+ makePixelCrop(t) {
416
+ const e = { ...M, ...this.props.crop || {} };
417
+ return y(e, t.width, t.height);
418
+ }
419
+ render() {
420
+ const { aspect: t, children: e, circularCrop: o, className: i, crop: n, disabled: a, locked: w, style: h, ruleOfThirds: r } = this.props, { cropIsActive: c, newCropIsBeingDrawn: d } = this.state, p = n ? this.createCropSelection() : null, l = S(
421
+ "ReactCrop",
422
+ i,
423
+ c && "ReactCrop--active",
424
+ a && "ReactCrop--disabled",
425
+ w && "ReactCrop--locked",
426
+ d && "ReactCrop--new-crop",
427
+ n && t && "ReactCrop--fixed-aspect",
428
+ n && o && "ReactCrop--circular-crop",
429
+ n && r && "ReactCrop--rule-of-thirds",
430
+ !this.dragStarted && n && !n.width && !n.height && "ReactCrop--invisible-crop",
431
+ o && "ReactCrop--no-animate"
432
+ );
433
+ return /* @__PURE__ */ g.createElement("div", { ref: this.componentRef, className: l, style: h }, /* @__PURE__ */ g.createElement("div", { ref: this.mediaRef, className: "ReactCrop__child-wrapper", onPointerDown: this.onComponentPointerDown }, e), p);
434
+ }
435
+ };
436
+ v.xOrds = ["e", "w"];
437
+ v.yOrds = ["n", "s"];
438
+ v.xyOrds = ["nw", "ne", "se", "sw"];
439
+ v.nudgeStep = 1;
440
+ v.nudgeStepMedium = 10;
441
+ v.nudgeStepLarge = 100;
442
+ v.defaultProps = {
443
+ ariaLabels: {
444
+ cropArea: "Use the arrow keys to move the crop selection area",
445
+ nwDragHandle: "Use the arrow keys to move the north west drag handle to change the crop selection area",
446
+ nDragHandle: "Use the up and down arrow keys to move the north drag handle to change the crop selection area",
447
+ neDragHandle: "Use the arrow keys to move the north east drag handle to change the crop selection area",
448
+ eDragHandle: "Use the up and down arrow keys to move the east drag handle to change the crop selection area",
449
+ seDragHandle: "Use the arrow keys to move the south east drag handle to change the crop selection area",
450
+ sDragHandle: "Use the up and down arrow keys to move the south drag handle to change the crop selection area",
451
+ swDragHandle: "Use the arrow keys to move the south west drag handle to change the crop selection area",
452
+ wDragHandle: "Use the up and down arrow keys to move the west drag handle to change the crop selection area"
453
+ }
454
+ };
455
+ let I = v;
86
456
 
87
457
  var cropImage = function cropImage(payload) {
88
458
  return axios.post("neeto_image_uploader_engine/development/crop_image", payload);
@@ -91,188 +461,36 @@ var developmentApi = {
91
461
  cropImage: cropImage
92
462
  };
93
463
 
94
- function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
95
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
464
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
465
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
96
466
  var useCropImage = function useCropImage(options) {
97
- return reactQuery.useMutation(_objectSpread$4({
467
+ return reactQuery.useMutation(_objectSpread$3({
98
468
  mutationFn: developmentApi.cropImage
99
469
  }, options));
100
470
  };
101
471
 
102
- var css$1 = ".ReactCrop{position:relative;display:inline-block;cursor:crosshair;overflow:hidden;max-width:100%}.ReactCrop *,.ReactCrop *::before,.ReactCrop *::after{box-sizing:border-box}.ReactCrop--disabled,.ReactCrop--locked{cursor:inherit}.ReactCrop__child-wrapper{max-height:inherit}.ReactCrop__child-wrapper>img,.ReactCrop__child-wrapper>video{display:block;max-width:100%;max-height:inherit}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>img,.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>video{touch-action:none}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection{touch-action:none}.ReactCrop__crop-selection{position:absolute;top:0;left:0;transform:translate3d(0, 0, 0);cursor:move;box-shadow:0 0 0 9999em rgba(0,0,0,.5);border:1px dashed #fff}.ReactCrop--disabled .ReactCrop__crop-selection{cursor:inherit}.ReactCrop--circular-crop .ReactCrop__crop-selection{border-radius:50%;box-shadow:0px 0px 1px 1px #fff,0 0 0 9999em rgba(0,0,0,.5)}.ReactCrop__crop-selection:focus{outline:none;border-color:blue;border-style:solid}.ReactCrop--invisible-crop .ReactCrop__crop-selection{display:none}.ReactCrop__rule-of-thirds-vt::before,.ReactCrop__rule-of-thirds-vt::after,.ReactCrop__rule-of-thirds-hz::before,.ReactCrop__rule-of-thirds-hz::after{content:\"\";display:block;position:absolute;background-color:rgba(255,255,255,.4)}.ReactCrop__rule-of-thirds-vt::before,.ReactCrop__rule-of-thirds-vt::after{width:1px;height:100%}.ReactCrop__rule-of-thirds-vt::before{left:33.3333333333%}.ReactCrop__rule-of-thirds-vt::after{left:66.6666666667%}.ReactCrop__rule-of-thirds-hz::before,.ReactCrop__rule-of-thirds-hz::after{width:100%;height:1px}.ReactCrop__rule-of-thirds-hz::before{top:33.3333333333%}.ReactCrop__rule-of-thirds-hz::after{top:66.6666666667%}.ReactCrop__drag-handle{position:absolute}.ReactCrop__drag-handle::after{position:absolute;content:\"\";display:block;width:10px;height:10px;background-color:rgba(0,0,0,.2);border:1px solid rgba(255,255,255,.7);outline:1px solid rgba(0,0,0,0)}.ReactCrop__drag-handle:focus::after{border-color:blue;background:#2dbfff}.ReactCrop .ord-nw{top:0;left:0;margin-top:-5px;margin-left:-5px;cursor:nw-resize}.ReactCrop .ord-nw::after{top:0;left:0}.ReactCrop .ord-n{top:0;left:50%;margin-top:-5px;margin-left:-5px;cursor:n-resize}.ReactCrop .ord-n::after{top:0}.ReactCrop .ord-ne{top:0;right:0;margin-top:-5px;margin-right:-5px;cursor:ne-resize}.ReactCrop .ord-ne::after{top:0;right:0}.ReactCrop .ord-e{top:50%;right:0;margin-top:-5px;margin-right:-5px;cursor:e-resize}.ReactCrop .ord-e::after{right:0}.ReactCrop .ord-se{bottom:0;right:0;margin-bottom:-5px;margin-right:-5px;cursor:se-resize}.ReactCrop .ord-se::after{bottom:0;right:0}.ReactCrop .ord-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px;cursor:s-resize}.ReactCrop .ord-s::after{bottom:0}.ReactCrop .ord-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px;cursor:sw-resize}.ReactCrop .ord-sw::after{bottom:0;left:0}.ReactCrop .ord-w{top:50%;left:0;margin-top:-5px;margin-left:-5px;cursor:w-resize}.ReactCrop .ord-w::after{left:0}.ReactCrop__disabled .ReactCrop__drag-handle{cursor:inherit}.ReactCrop__drag-bar{position:absolute}.ReactCrop__drag-bar.ord-n{top:0;left:0;width:100%;height:6px;margin-top:-3px}.ReactCrop__drag-bar.ord-e{right:0;top:0;width:6px;height:100%;margin-right:-3px}.ReactCrop__drag-bar.ord-s{bottom:0;left:0;width:100%;height:6px;margin-bottom:-3px}.ReactCrop__drag-bar.ord-w{top:0;left:0;width:6px;height:100%;margin-left:-3px}.ReactCrop--new-crop .ReactCrop__drag-bar,.ReactCrop--new-crop .ReactCrop__drag-handle,.ReactCrop--fixed-aspect .ReactCrop__drag-bar{display:none}.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w{display:none}@media(pointer: coarse){.ReactCrop .ord-n,.ReactCrop .ord-e,.ReactCrop .ord-s,.ReactCrop .ord-w{display:none}.ReactCrop__drag-handle{width:24px;height:24px}}.ReactCrop .ReactCrop__child-wrapper {\n width: 100%;\n height: 100%;\n}.ReactCrop .ReactCrop__child-wrapper img {\n height: auto;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n display: block;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9yZWFjdC1pbWFnZS1jcm9wL2Rpc3QvUmVhY3RDcm9wLmNzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlYWN0LWNyb3Auc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLGlCQUFpQixDQUFDLG9CQUFvQixDQUFDL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FjdENyb3AtLWZpeGVkLWFzcGVjdCAuUmVhY3RDcm9wX19kcmFnLWhhbmRsZS5vcmQtbiwuUmVhY3RDcm9wLS1maXhlZC1hc3BlY3QgLlJlYWN0Q3JvcF9fZHJhZy1oYW5kbGUub3JkLWUsLlJlYWN0Q3JvcC0tZml4ZWQtYXNwZWN0IC5SZWFjdENyb3BfX2RyYWctaGFuZGxlLm9yZC1zLC5SZWFjdENyb3AtLWZpeGVkLWFzcGVjdCAuUmVhY3RDcm9wX19kcmFnLWhhbmRsZS5vcmQtd3tkaXNwbGF5Om5vbmV9QG1lZGlhKHBvaW50ZXI6IGNvYXJzZSl7LlJlYWN0Q3JvcCAub3JkLW4sLlJlYWN0Q3JvcCAub3JkLWUsLlJlYWN0Q3JvcCAub3JkLXMsLlJlYWN0Q3JvcCAub3JkLXd7ZGlzcGxheTpub25lfS5SZWFjdENyb3BfX2RyYWctaGFuZGxle3dpZHRoOjI0cHg7aGVpZ2h0OjI0cHh9fVxuIiwiQGltcG9ydCBcInJlYWN0LWltYWdlLWNyb3AvZGlzdC9SZWFjdENyb3AuY3NzXCI7XG5cbi5SZWFjdENyb3Age1xuICAuUmVhY3RDcm9wX19jaGlsZC13cmFwcGVyIHtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBoZWlnaHQ6IDEwMCU7XG5cbiAgICBpbWcge1xuICAgICAgaGVpZ2h0OiBhdXRvO1xuICAgICAgd2lkdGg6IGF1dG87XG4gICAgICBtYXgtd2lkdGg6IDEwMCU7XG4gICAgICBtYXgtaGVpZ2h0OiAxMDAlO1xuICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgfVxuICB9XG59XG4iXX0= */";
472
+ var css$1 = ".ReactCrop{position:relative;display:inline-block;cursor:crosshair;overflow:hidden;max-width:100%}.ReactCrop *,.ReactCrop *:before,.ReactCrop *:after{box-sizing:border-box}.ReactCrop--disabled,.ReactCrop--locked{cursor:inherit}.ReactCrop__child-wrapper{max-height:inherit}.ReactCrop__child-wrapper>img,.ReactCrop__child-wrapper>video{display:block;max-width:100%;max-height:inherit}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>img,.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>video{touch-action:none}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection{touch-action:none}.ReactCrop__crop-selection{position:absolute;top:0;left:0;transform:translateZ(0);cursor:move;box-shadow:0 0 0 9999em #00000080}.ReactCrop--disabled .ReactCrop__crop-selection{cursor:inherit}.ReactCrop--circular-crop .ReactCrop__crop-selection{border-radius:50%}.ReactCrop--no-animate .ReactCrop__crop-selection{outline:1px dashed white}.ReactCrop__crop-selection:not(.ReactCrop--no-animate .ReactCrop__crop-selection){animation:marching-ants 1s;background-image:linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%);background-size:10px 1px,10px 1px,1px 10px,1px 10px;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;color:#fff;animation-play-state:running;animation-timing-function:linear;animation-iteration-count:infinite}@keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0}to{background-position:20px 0,-20px 100%,0 -20px,100% 20px}}.ReactCrop__crop-selection:focus{outline:none;border-color:#00f;border-style:solid}.ReactCrop--invisible-crop .ReactCrop__crop-selection{display:none}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after,.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{content:\"\";display:block;position:absolute;background-color:#fff6}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after{width:1px;height:100%}.ReactCrop__rule-of-thirds-vt:before{left:33.3333333333%}.ReactCrop__rule-of-thirds-vt:after{left:66.6666666667%}.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{width:100%;height:1px}.ReactCrop__rule-of-thirds-hz:before{top:33.3333333333%}.ReactCrop__rule-of-thirds-hz:after{top:66.6666666667%}.ReactCrop__drag-handle{position:absolute}.ReactCrop__drag-handle:after{position:absolute;content:\"\";display:block;width:10px;height:10px;background-color:#0003;border:1px solid rgba(255,255,255,.7);outline:1px solid transparent}.ReactCrop__drag-handle:focus:after{border-color:#00f;background:#2dbfff}.ReactCrop .ord-nw{top:0;left:0;margin-top:-5px;margin-left:-5px;cursor:nw-resize}.ReactCrop .ord-nw:after{top:0;left:0}.ReactCrop .ord-n{top:0;left:50%;margin-top:-5px;margin-left:-5px;cursor:n-resize}.ReactCrop .ord-n:after{top:0}.ReactCrop .ord-ne{top:0;right:0;margin-top:-5px;margin-right:-5px;cursor:ne-resize}.ReactCrop .ord-ne:after{top:0;right:0}.ReactCrop .ord-e{top:50%;right:0;margin-top:-5px;margin-right:-5px;cursor:e-resize}.ReactCrop .ord-e:after{right:0}.ReactCrop .ord-se{bottom:0;right:0;margin-bottom:-5px;margin-right:-5px;cursor:se-resize}.ReactCrop .ord-se:after{bottom:0;right:0}.ReactCrop .ord-s{bottom:0;left:50%;margin-bottom:-5px;margin-left:-5px;cursor:s-resize}.ReactCrop .ord-s:after{bottom:0}.ReactCrop .ord-sw{bottom:0;left:0;margin-bottom:-5px;margin-left:-5px;cursor:sw-resize}.ReactCrop .ord-sw:after{bottom:0;left:0}.ReactCrop .ord-w{top:50%;left:0;margin-top:-5px;margin-left:-5px;cursor:w-resize}.ReactCrop .ord-w:after{left:0}.ReactCrop__disabled .ReactCrop__drag-handle{cursor:inherit}.ReactCrop__drag-bar{position:absolute}.ReactCrop__drag-bar.ord-n{top:0;left:0;width:100%;height:6px;margin-top:-3px}.ReactCrop__drag-bar.ord-e{right:0;top:0;width:6px;height:100%;margin-right:-3px}.ReactCrop__drag-bar.ord-s{bottom:0;left:0;width:100%;height:6px;margin-bottom:-3px}.ReactCrop__drag-bar.ord-w{top:0;left:0;width:6px;height:100%;margin-left:-3px}.ReactCrop--new-crop .ReactCrop__drag-bar,.ReactCrop--new-crop .ReactCrop__drag-handle,.ReactCrop--fixed-aspect .ReactCrop__drag-bar,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w{display:none}@media (pointer: coarse){.ReactCrop .ord-n,.ReactCrop .ord-e,.ReactCrop .ord-s,.ReactCrop .ord-w{display:none}.ReactCrop__drag-handle{width:24px;height:24px}}.ReactCrop .ReactCrop__child-wrapper {\n width: 100%;\n height: 100%;\n}.ReactCrop .ReactCrop__child-wrapper img {\n height: auto;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n display: block;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9yZWFjdC1pbWFnZS1jcm9wL2Rpc3QvUmVhY3RDcm9wLmNzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlYWN0LWNyb3Auc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLGlCQUFpQixDQUFDLG9CQUFvQixDQUFDLGdCQUFnQixDQUFDLGVBQWUsQ0FBQyxjQUFjLENBQUMsb0RBQW9ELHFCQUFxQixDQUFDLHdDQUF3QyxjQUFjLENBQUMsMEJBQTBCLGtCQUFrQixDQUFDLDhEQUE4RCxhQUFhLENBQUMsY0FBYyxDQUFDLGtCQUFrQixDQUFDLHdJQUF3SSxpQkFBaUIsQ0FBQyxnRUFBZ0UsaUJBQWlCLENBQUMsMkJBQTJCLGlCQUFpQixDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsdUJBQXVCLENBQUMsV0FBVyxDQUFDLGlDQUFpQyxDQUFDLGdEQUFnRCxjQUFjLENB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9wX19kcmFnLWhhbmRsZXt3aWR0aDoyNHB4O2hlaWdodDoyNHB4fX1cbiIsIkBpbXBvcnQgXCJyZWFjdC1pbWFnZS1jcm9wL2Rpc3QvUmVhY3RDcm9wLmNzc1wiO1xuXG4uUmVhY3RDcm9wIHtcbiAgLlJlYWN0Q3JvcF9fY2hpbGQtd3JhcHBlciB7XG4gICAgd2lkdGg6IDEwMCU7XG4gICAgaGVpZ2h0OiAxMDAlO1xuXG4gICAgaW1nIHtcbiAgICAgIGhlaWdodDogYXV0bztcbiAgICAgIHdpZHRoOiBhdXRvO1xuICAgICAgbWF4LXdpZHRoOiAxMDAlO1xuICAgICAgbWF4LWhlaWdodDogMTAwJTtcbiAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIH1cbiAgfVxufVxuIl19 */";
103
473
  n(css$1,{});
104
474
 
105
- var useImageControls = function useImageControls(_ref) {
106
- var isAspectRatioLocked = _ref.isAspectRatioLocked,
107
- setAspectRatioLocked = _ref.setAspectRatioLocked,
108
- setCrop = _ref.setCrop,
109
- _ref$crop = _ref.crop,
110
- crop = _ref$crop === void 0 ? {} : _ref$crop,
475
+ var Controls = reactUtils.withT(function (_ref) {
476
+ var _imageRef$current, _imageRef$current2;
477
+ var t = _ref.t,
111
478
  aspectRatio = _ref.aspectRatio,
112
- imageRef = _ref.imageRef,
113
- setAspectRatio = _ref.setAspectRatio,
114
- setHeight = _ref.setHeight,
115
- setWidth = _ref.setWidth;
116
- var onToggleAspectRatioLock = function onToggleAspectRatioLock() {
117
- setAspectRatioLocked(function (isAspectRatioLocked) {
118
- return !isAspectRatioLocked;
119
- });
120
- if (!isAspectRatioLocked) {
121
- var newHeight = crop.width / (aspectRatio.width / aspectRatio.height);
122
- var newWidth = crop.height * (aspectRatio.width / aspectRatio.height);
123
- newWidth + Math.trunc(crop.x) <= imageRef.current.width ? setCrop(ramda.mergeRight(crop, {
124
- width: newWidth
125
- })) : setCrop(ramda.mergeRight(crop, {
126
- height: newHeight
127
- }));
128
- }
129
- };
130
- var handleWidthChange = function handleWidthChange(width) {
131
- var cropWidth = Number(width);
132
- var displayWidth = cropWidth * imageRef.current.width / imageRef.current.naturalWidth;
133
- if (displayWidth > 0 && Math.trunc(crop.x) + displayWidth <= imageRef.current.width) {
134
- if (isAspectRatioLocked) {
135
- var displayHeight = displayWidth / (aspectRatio.width / aspectRatio.height);
136
- displayHeight + Math.trunc(crop.y) <= imageRef.current.height && setCrop(ramda.mergeRight(crop, {
137
- width: displayWidth,
138
- height: displayHeight
139
- }));
140
- } else {
141
- setCrop(ramda.mergeRight(crop, {
142
- width: displayWidth
143
- }));
144
- }
145
- } else {
146
- setWidth(crop.width.toFixed(2));
147
- }
148
- };
149
- var handleHeightChange = function handleHeightChange(height) {
150
- var cropHeight = Number(height);
151
- var displayHeight = cropHeight * imageRef.current.height / imageRef.current.naturalHeight;
152
- if (displayHeight > 0 && Math.trunc(crop.y) + displayHeight <= imageRef.current.height) {
153
- if (isAspectRatioLocked) {
154
- var displayWidth = displayHeight * aspectRatio.width / aspectRatio.height;
155
- displayWidth + Math.trunc(crop.x) <= imageRef.current.width && setCrop(ramda.mergeRight(crop, {
156
- height: displayHeight,
157
- width: displayWidth
158
- }));
159
- } else {
160
- setCrop(ramda.mergeRight(crop, {
161
- height: displayHeight
162
- }));
163
- }
164
- } else {
165
- setHeight(crop.height.toFixed(2));
166
- }
167
- };
168
- var handleAspectWidthChange = function handleAspectWidthChange(aspectWidth) {
169
- if (aspectWidth <= 0) {
170
- return;
171
- }
172
- if (!isAspectRatioLocked) {
173
- setAspectRatio(ramda.mergeRight(aspectRatio, {
174
- width: aspectWidth
175
- }));
176
- return;
177
- }
178
- var newWidth = crop.height * (aspectWidth / aspectRatio.height);
179
- if (newWidth + Math.trunc(crop.x) <= imageRef.current.width) {
180
- setCrop(ramda.mergeRight(crop, {
181
- width: newWidth
182
- }));
183
- setAspectRatio(ramda.mergeRight(aspectRatio, {
184
- width: aspectWidth
185
- }));
186
- }
187
- };
188
- var handleAspectHeightChange = function handleAspectHeightChange(aspectHeight) {
189
- if (aspectHeight <= 0) {
190
- return;
191
- }
192
- if (!isAspectRatioLocked) {
193
- setAspectRatio(ramda.mergeRight(aspectRatio, {
194
- height: aspectHeight
195
- }));
196
- return;
197
- }
198
- var newHeight = crop.width / (aspectRatio.width / aspectHeight);
199
- if (newHeight + Math.trunc(crop.y) <= imageRef.current.height) {
200
- setCrop(ramda.mergeRight(crop, {
201
- height: newHeight
202
- }));
203
- setAspectRatio(ramda.mergeRight(aspectRatio, {
204
- height: aspectHeight
205
- }));
206
- }
207
- };
208
- return {
209
- onToggleAspectRatioLock: onToggleAspectRatioLock,
210
- handleWidthChange: handleWidthChange,
211
- handleHeightChange: handleHeightChange,
212
- handleAspectWidthChange: handleAspectWidthChange,
213
- handleAspectHeightChange: handleAspectHeightChange
214
- };
215
- };
216
-
217
- var Controls = function Controls(_ref) {
218
- var aspectRatio = _ref.aspectRatio,
219
479
  isAspectRatioLocked = _ref.isAspectRatioLocked,
220
480
  crop = _ref.crop,
221
481
  handleSubmit = _ref.handleSubmit,
222
- setAspectRatio = _ref.setAspectRatio,
223
- setAspectRatioLocked = _ref.setAspectRatioLocked,
224
- setCrop = _ref.setCrop,
225
482
  imageRef = _ref.imageRef,
226
483
  isFullImage = _ref.isFullImage,
227
484
  setIsFullImage = _ref.setIsFullImage,
228
485
  _ref$hideControls = _ref.hideControls,
229
- hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls;
230
- var _useTranslation = reactI18next.useTranslation(),
231
- t = _useTranslation.t;
232
- var getActualCropHeight = function getActualCropHeight(cropHeight) {
233
- var _imageRef$current, _imageRef$current2;
234
- return cropHeight * (((_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalHeight) / ((_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.height));
235
- };
236
- var getActualCropWidth = function getActualCropWidth(cropHeight) {
237
- var _imageRef$current3, _imageRef$current4;
238
- return cropHeight * (((_imageRef$current3 = imageRef.current) === null || _imageRef$current3 === void 0 ? void 0 : _imageRef$current3.naturalWidth) / ((_imageRef$current4 = imageRef.current) === null || _imageRef$current4 === void 0 ? void 0 : _imageRef$current4.width));
239
- };
240
- var _useState = require$$0.useState(getActualCropHeight(crop.height)),
241
- _useState2 = _slicedToArray(_useState, 2),
242
- height = _useState2[0],
243
- setHeight = _useState2[1];
244
- var _useState3 = require$$0.useState(getActualCropWidth(crop.width)),
245
- _useState4 = _slicedToArray(_useState3, 2),
246
- width = _useState4[0],
247
- setWidth = _useState4[1];
248
- var _useImageControls = useImageControls({
249
- isAspectRatioLocked: isAspectRatioLocked,
250
- setAspectRatioLocked: setAspectRatioLocked,
251
- setCrop: setCrop,
252
- crop: crop,
253
- aspectRatio: aspectRatio,
254
- imageRef: imageRef,
255
- setAspectRatio: setAspectRatio,
256
- setHeight: setHeight,
257
- setWidth: setWidth
258
- }),
259
- onToggleAspectRatioLock = _useImageControls.onToggleAspectRatioLock,
260
- handleWidthChange = _useImageControls.handleWidthChange,
261
- handleHeightChange = _useImageControls.handleHeightChange,
262
- handleAspectWidthChange = _useImageControls.handleAspectWidthChange,
263
- handleAspectHeightChange = _useImageControls.handleAspectHeightChange;
264
- var debouncedHeight = reactUtils.useDebounce(height, 800);
265
- var debouncedWidth = reactUtils.useDebounce(width, 800);
266
- require$$0.useEffect(function () {
267
- handleHeightChange(debouncedHeight);
268
- }, [debouncedHeight]);
269
- require$$0.useEffect(function () {
270
- handleWidthChange(debouncedWidth);
271
- }, [debouncedWidth]);
272
- require$$0.useEffect(function () {
273
- setHeight(getActualCropHeight(crop.height));
274
- setWidth(getActualCropWidth(crop.width));
275
- }, [crop]);
486
+ hideControls = _ref$hideControls === void 0 ? false : _ref$hideControls,
487
+ onToggleAspectRatioLock = _ref.onToggleAspectRatioLock,
488
+ handleWidthChange = _ref.handleWidthChange,
489
+ handleHeightChange = _ref.handleHeightChange,
490
+ handleAspectWidthChange = _ref.handleAspectWidthChange,
491
+ handleAspectHeightChange = _ref.handleAspectHeightChange,
492
+ width = _ref.width,
493
+ height = _ref.height;
276
494
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
277
495
  className: "flex flex-col space-y-6 p-4 md:w-2/6",
278
496
  children: [!hideControls && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -325,9 +543,10 @@ var Controls = function Controls(_ref) {
325
543
  }), /*#__PURE__*/jsxRuntime.jsx(Input, {
326
544
  className: "w-32 flex-grow-0",
327
545
  disabled: isFullImage,
546
+ max: (_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.naturalWidth,
328
547
  type: "number",
329
- value: Math.round(width),
330
- onChange: utils.withEventTargetValue(setWidth)
548
+ value: width,
549
+ onChange: utils.withEventTargetValue(handleWidthChange)
331
550
  })]
332
551
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
333
552
  className: "flex w-full items-start gap-2",
@@ -337,9 +556,10 @@ var Controls = function Controls(_ref) {
337
556
  }), /*#__PURE__*/jsxRuntime.jsx(Input, {
338
557
  className: "w-32 flex-grow-0",
339
558
  disabled: isFullImage,
559
+ max: (_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 ? void 0 : _imageRef$current2.naturalHeight,
340
560
  type: "number",
341
- value: Math.round(height),
342
- onChange: utils.withEventTargetValue(setHeight)
561
+ value: height,
562
+ onChange: utils.withEventTargetValue(handleHeightChange)
343
563
  })]
344
564
  }), /*#__PURE__*/jsxRuntime.jsx(Button, {
345
565
  className: "mt-6 self-start",
@@ -349,9 +569,212 @@ var Controls = function Controls(_ref) {
349
569
  onClick: handleSubmit
350
570
  })]
351
571
  });
572
+ });
573
+
574
+ var useImageControls = function useImageControls(_ref) {
575
+ var _imageRef$current;
576
+ var imageRef = _ref.imageRef,
577
+ fixedAspectRatio = _ref.fixedAspectRatio,
578
+ defaultImageSize = _ref.defaultImageSize;
579
+ var _ref2 = (_imageRef$current = imageRef.current) !== null && _imageRef$current !== void 0 ? _imageRef$current : {},
580
+ imageWidth = _ref2.naturalWidth,
581
+ imageHeight = _ref2.naturalHeight;
582
+ var _useState = g.useState(true),
583
+ _useState2 = _slicedToArray(_useState, 2),
584
+ isAspectRatioLocked = _useState2[0],
585
+ setIsAspectRatioLocked = _useState2[1];
586
+ var _useState3 = g.useState(utils$1.DEFAULT_CROP_CONFIG),
587
+ _useState4 = _slicedToArray(_useState3, 2),
588
+ crop = _useState4[0],
589
+ setCrop = _useState4[1];
590
+ var _useState5 = g.useState(utils$1.getAspectRatio({
591
+ fixedAspectRatio: fixedAspectRatio,
592
+ imageSize: defaultImageSize
593
+ })),
594
+ _useState6 = _slicedToArray(_useState5, 2),
595
+ aspectRatio = _useState6[0],
596
+ setAspectRatio = _useState6[1];
597
+ var _useState7 = g.useState(utils$1.getPixels(crop.height, imageHeight)),
598
+ _useState8 = _slicedToArray(_useState7, 2),
599
+ height = _useState8[0],
600
+ setHeight = _useState8[1];
601
+ var _useState9 = g.useState(utils$1.getPixels(crop.width, imageWidth)),
602
+ _useState10 = _slicedToArray(_useState9, 2),
603
+ width = _useState10[0],
604
+ setWidth = _useState10[1];
605
+ var aspectRatioFactor = aspectRatio.width / aspectRatio.height;
606
+ var buildCropValues = function buildCropValues(_ref3) {
607
+ var cropWidth = _ref3.cropWidth,
608
+ cropHeight = _ref3.cropHeight,
609
+ _ref3$width = _ref3.width,
610
+ width = _ref3$width === void 0 ? imageWidth : _ref3$width,
611
+ _ref3$height = _ref3.height,
612
+ height = _ref3$height === void 0 ? imageHeight : _ref3$height,
613
+ _ref3$aspectRatio = _ref3.aspectRatio,
614
+ aspectRatio = _ref3$aspectRatio === void 0 ? aspectRatioFactor : _ref3$aspectRatio;
615
+ var aspectCrop = H({
616
+ unit: "%",
617
+ width: utils$1.getPercentage(cropWidth, width),
618
+ height: utils$1.getPercentage(cropHeight, height)
619
+ }, aspectRatio, width, height);
620
+ return N(aspectCrop, width, height);
621
+ };
622
+ var onToggleAspectRatioLock = function onToggleAspectRatioLock() {
623
+ setIsAspectRatioLocked(function (isAspectRatioLocked) {
624
+ return !isAspectRatioLocked;
625
+ });
626
+ };
627
+ var handleWidthChange = function handleWidthChange(width) {
628
+ var adjustedWidth = Math.min(width, imageWidth);
629
+ setWidth(adjustedWidth);
630
+ handleWidthResize(adjustedWidth);
631
+ };
632
+ var handleHeightChange = function handleHeightChange(height) {
633
+ var adjustedHeight = Math.min(height, imageHeight);
634
+ setHeight(adjustedHeight);
635
+ handleHeighthResize(height);
636
+ };
637
+ var handleResize = function handleResize(cropWidth, cropHeight) {
638
+ var aspectRatio = aspectRatioFactor;
639
+ if (!isAspectRatioLocked) {
640
+ var imageSize = {
641
+ width: cropWidth,
642
+ height: cropHeight
643
+ };
644
+ var newAspectRatio = utils$1.getAspectRatio({
645
+ imageSize: imageSize
646
+ });
647
+ aspectRatio = newAspectRatio.width / newAspectRatio.height;
648
+ setAspectRatio(newAspectRatio);
649
+ }
650
+ var newCrop = buildCropValues({
651
+ cropWidth: cropWidth,
652
+ cropHeight: cropHeight,
653
+ aspectRatio: aspectRatio
654
+ });
655
+ setCrop(newCrop);
656
+ setWidth(cropWidth);
657
+ setHeight(cropHeight);
658
+ };
659
+ var handleWidthResize = reactUtils.useFuncDebounce(function (width) {
660
+ var cropWidth = Number(width);
661
+ var cropHeight = Number(height);
662
+ if (isAspectRatioLocked) {
663
+ cropHeight = utils$1.getHeightFromAspectRatio(cropWidth, aspectRatio);
664
+ if (cropHeight > imageHeight) {
665
+ cropHeight = imageHeight;
666
+ cropWidth = utils$1.getWidthFromAspectRatio(cropHeight, aspectRatio);
667
+ }
668
+ }
669
+ handleResize(cropWidth, cropHeight);
670
+ }, 300);
671
+ var handleHeighthResize = reactUtils.useFuncDebounce(function (height) {
672
+ var cropWidth = Number(width);
673
+ var cropHeight = Number(height);
674
+ if (isAspectRatioLocked) {
675
+ cropWidth = utils$1.getWidthFromAspectRatio(cropHeight, aspectRatio);
676
+ if (cropWidth > imageWidth) {
677
+ cropWidth = imageWidth;
678
+ cropHeight = utils$1.getHeightFromAspectRatio(cropWidth, aspectRatio);
679
+ }
680
+ }
681
+ handleResize(cropWidth, cropHeight);
682
+ }, 300);
683
+ var handleAspectWidthChange = function handleAspectWidthChange(aspectWidth) {
684
+ if (aspectWidth <= 0) return;
685
+ var newWidth = crop.width * (aspectWidth / aspectRatio.width);
686
+ var updatedAspectWidth = aspectWidth;
687
+ if (newWidth > 100) {
688
+ newWidth = 100;
689
+ updatedAspectWidth = Math.round(newWidth / crop.width * aspectRatio.width);
690
+ }
691
+ var newWidthInPixels = utils$1.getPixels(newWidth, imageWidth);
692
+ var newCrop = buildCropValues({
693
+ cropWidth: newWidthInPixels,
694
+ cropHeight: height,
695
+ aspectRatio: updatedAspectWidth / aspectRatio.height
696
+ });
697
+ setCrop(newCrop);
698
+ setAspectRatio(ramda.mergeRight(aspectRatio, {
699
+ width: updatedAspectWidth
700
+ }));
701
+ setWidth(newWidthInPixels);
702
+ };
703
+ var handleAspectHeightChange = function handleAspectHeightChange(aspectHeight) {
704
+ if (aspectHeight <= 0) return;
705
+ var newHeight = crop.height * (aspectHeight / aspectRatio.height);
706
+ var updatedAspectHeight = aspectHeight;
707
+ if (newHeight > 100) {
708
+ newHeight = 100;
709
+ updatedAspectHeight = Math.round(newHeight / crop.height * aspectRatio.height);
710
+ }
711
+ var newHeightInPixels = utils$1.getPixels(newHeight, imageHeight);
712
+ var newCrop = buildCropValues({
713
+ cropWidth: width,
714
+ cropHeight: newHeightInPixels,
715
+ aspectRatio: aspectRatio.width / updatedAspectHeight
716
+ });
717
+ setCrop(newCrop);
718
+ setAspectRatio(ramda.mergeRight(aspectRatio, {
719
+ height: updatedAspectHeight
720
+ }));
721
+ setHeight(newHeightInPixels);
722
+ };
723
+ var handleCropChange = function handleCropChange(pixelCrop, percentageCrop) {
724
+ if (!isAspectRatioLocked) {
725
+ var _aspectRatio = utils$1.getAspectRatio({
726
+ imageSize: {
727
+ width: Math.round(pixelCrop.width),
728
+ height: Math.round(pixelCrop.height)
729
+ }
730
+ });
731
+ setAspectRatio(_aspectRatio);
732
+ }
733
+ setHeight(utils$1.getPixels(percentageCrop.height, imageHeight));
734
+ setWidth(utils$1.getPixels(percentageCrop.width, imageWidth));
735
+ setCrop(percentageCrop);
736
+ };
737
+ var handleImageLoad = function handleImageLoad(_ref4) {
738
+ var _defaultImageSize$wid;
739
+ var image = _ref4.target;
740
+ var imageWidth = image.naturalWidth,
741
+ imageHeight = image.naturalHeight;
742
+ var maxCropWidth = (_defaultImageSize$wid = defaultImageSize.width) !== null && _defaultImageSize$wid !== void 0 ? _defaultImageSize$wid : imageWidth;
743
+ var _getInitialCropSize = utils$1.getInitialCropSize({
744
+ image: image,
745
+ aspectRatioFactor: aspectRatioFactor,
746
+ maxCropWidth: maxCropWidth
747
+ }),
748
+ cropWidth = _getInitialCropSize.cropWidth,
749
+ cropHeight = _getInitialCropSize.cropHeight;
750
+ var crop = buildCropValues({
751
+ cropWidth: cropWidth,
752
+ cropHeight: cropHeight,
753
+ width: imageWidth,
754
+ height: imageHeight
755
+ });
756
+ setCrop(crop);
757
+ setHeight(utils$1.getPixels(crop.height, imageHeight));
758
+ setWidth(utils$1.getPixels(crop.width, imageWidth));
759
+ };
760
+ return {
761
+ onToggleAspectRatioLock: onToggleAspectRatioLock,
762
+ handleWidthChange: handleWidthChange,
763
+ handleHeightChange: handleHeightChange,
764
+ handleAspectWidthChange: handleAspectWidthChange,
765
+ handleAspectHeightChange: handleAspectHeightChange,
766
+ aspectRatio: aspectRatio,
767
+ width: width,
768
+ crop: crop,
769
+ height: height,
770
+ handleImageLoad: handleImageLoad,
771
+ handleCropChange: handleCropChange,
772
+ isAspectRatioLocked: isAspectRatioLocked
773
+ };
352
774
  };
353
775
 
354
776
  var ImageEditor = function ImageEditor(_ref) {
777
+ var _imageRef$current;
355
778
  var image = _ref.image,
356
779
  handleReset = _ref.handleReset,
357
780
  _ref$handleImageEditC = _ref.handleImageEditComplete,
@@ -359,33 +782,39 @@ var ImageEditor = function ImageEditor(_ref) {
359
782
  _ref$signedId = _ref.signedId,
360
783
  signedId = _ref$signedId === void 0 ? "" : _ref$signedId,
361
784
  _ref$fixedAspectRatio = _ref.fixedAspectRatio,
362
- fixedAspectRatio = _ref$fixedAspectRatio === void 0 ? {} : _ref$fixedAspectRatio;
363
- var _useState = require$$0.useState(true),
785
+ fixedAspectRatio = _ref$fixedAspectRatio === void 0 ? {} : _ref$fixedAspectRatio,
786
+ _ref$defaultImageSize = _ref.defaultImageSize,
787
+ defaultImageSize = _ref$defaultImageSize === void 0 ? {} : _ref$defaultImageSize;
788
+ var imageRef = g.useRef(null);
789
+ var wrapperRef = g.useRef(null);
790
+ var _ref2 = (_imageRef$current = imageRef.current) !== null && _imageRef$current !== void 0 ? _imageRef$current : {},
791
+ imageWidth = _ref2.naturalWidth,
792
+ imageHeight = _ref2.naturalHeight;
793
+ var _useState = g.useState(false),
364
794
  _useState2 = _slicedToArray(_useState, 2),
365
- isAspectRatioLocked = _useState2[0],
366
- setIsAspectRatioLocked = _useState2[1];
367
- var _useState3 = require$$0.useState(false),
368
- _useState4 = _slicedToArray(_useState3, 2),
369
- isFullImage = _useState4[0],
370
- setIsFullImage = _useState4[1];
371
- var _useState5 = require$$0.useState({
372
- width: (fixedAspectRatio === null || fixedAspectRatio === void 0 ? void 0 : fixedAspectRatio.width) || 16,
373
- height: (fixedAspectRatio === null || fixedAspectRatio === void 0 ? void 0 : fixedAspectRatio.height) || 9
374
- }),
375
- _useState6 = _slicedToArray(_useState5, 2),
376
- aspectRatio = _useState6[0],
377
- setAspectRatio = _useState6[1];
378
- var _useState7 = require$$0.useState(utils$1.DEFAULT_CROP_CONFIG),
379
- _useState8 = _slicedToArray(_useState7, 2),
380
- crop = _useState8[0],
381
- setCrop = _useState8[1];
795
+ isFullImage = _useState2[0],
796
+ setIsFullImage = _useState2[1];
382
797
  var _useTranslation = reactI18next.useTranslation(),
383
798
  t = _useTranslation.t;
384
799
  var _useCropImage = useCropImage(),
385
800
  cropImage = _useCropImage.mutate;
386
- var imageRef = require$$0.useRef(null);
387
- var wrapperRef = require$$0.useRef(null);
388
- var cropAspectRatio = neetoCist.isPresent(fixedAspectRatio === null || fixedAspectRatio === void 0 ? void 0 : fixedAspectRatio.width) && neetoCist.isPresent(fixedAspectRatio.height) ? (fixedAspectRatio === null || fixedAspectRatio === void 0 ? void 0 : fixedAspectRatio.width) / (fixedAspectRatio === null || fixedAspectRatio === void 0 ? void 0 : fixedAspectRatio.height) : 16 / 9;
801
+ var _useImageControls = useImageControls({
802
+ fixedAspectRatio: fixedAspectRatio,
803
+ defaultImageSize: defaultImageSize,
804
+ imageRef: imageRef
805
+ }),
806
+ onToggleAspectRatioLock = _useImageControls.onToggleAspectRatioLock,
807
+ handleWidthChange = _useImageControls.handleWidthChange,
808
+ handleHeightChange = _useImageControls.handleHeightChange,
809
+ handleAspectWidthChange = _useImageControls.handleAspectWidthChange,
810
+ handleAspectHeightChange = _useImageControls.handleAspectHeightChange,
811
+ aspectRatio = _useImageControls.aspectRatio,
812
+ width = _useImageControls.width,
813
+ height = _useImageControls.height,
814
+ handleImageLoad = _useImageControls.handleImageLoad,
815
+ handleCropChange = _useImageControls.handleCropChange,
816
+ crop = _useImageControls.crop,
817
+ isAspectRatioLocked = _useImageControls.isAspectRatioLocked;
389
818
  var processCrop = function processCrop() {
390
819
  if (isFullImage) {
391
820
  handleImageEditComplete(image);
@@ -411,7 +840,6 @@ var ImageEditor = function ImageEditor(_ref) {
411
840
  return;
412
841
  }
413
842
  var newURL = initializers.globalProps.assetsUploaderService === index.CLOUD_FLARE ? utils$1.getCloudFlareCroppedURL({
414
- imageRef: imageRef,
415
843
  image: image,
416
844
  crop: crop
417
845
  }) : utils$1.getImageKitCroppedURL({
@@ -437,44 +865,46 @@ var ImageEditor = function ImageEditor(_ref) {
437
865
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
438
866
  id: "imageEditor",
439
867
  ref: wrapperRef,
440
- className: classnames("flex", "h-full w-full md:w-4/6", "justify-around", "neeto-ui-bg-gray-200", {
868
+ className: classnames("flex", "h-full w-full md:w-4/6", "justify-around", "neeto-ui-bg-gray-200", "relative", {
441
869
  "items-center": utils$1.isItemsCenter({
442
870
  wrapperRef: wrapperRef,
443
871
  imageRef: imageRef
444
872
  })
445
873
  }),
446
- children: /*#__PURE__*/jsxRuntime.jsx(ReactCrop, {
874
+ children: /*#__PURE__*/jsxRuntime.jsxs(I, {
447
875
  crop: isFullImage ? null : crop,
448
876
  src: image === null || image === void 0 ? void 0 : image.url,
449
877
  aspect: isAspectRatioLocked ? aspectRatio.width / aspectRatio.height : 0,
450
- onChange: setCrop,
451
- onComplete: setCrop,
452
- children: /*#__PURE__*/jsxRuntime.jsx("img", {
878
+ onChange: handleCropChange,
879
+ onComplete: handleCropChange,
880
+ children: [/*#__PURE__*/jsxRuntime.jsx("img", {
453
881
  alt: t("neetoImageUploader.common.image"),
454
882
  "data-cy": "image-editor-uploaded-image",
455
883
  ref: imageRef,
456
884
  src: image === null || image === void 0 ? void 0 : image.url,
457
- onLoad: function onLoad(e) {
458
- return utils$1.onImageLoaded({
459
- image: e.target,
460
- setCrop: setCrop,
461
- cropAspectRatio: cropAspectRatio
462
- });
463
- }
464
- })
885
+ onLoad: handleImageLoad
886
+ }), /*#__PURE__*/jsxRuntime.jsxs(Typography, {
887
+ className: "neeto-ui-typography neeto-ui-text-nano neeto-ui-bg-gray-500 absolute bottom-0 right-0 z-10",
888
+ style: "nano",
889
+ children: [imageWidth, "x", imageHeight]
890
+ })]
465
891
  })
466
892
  }), /*#__PURE__*/jsxRuntime.jsx(Controls, {
467
893
  aspectRatio: aspectRatio,
468
894
  crop: crop,
895
+ handleAspectHeightChange: handleAspectHeightChange,
896
+ handleAspectWidthChange: handleAspectWidthChange,
897
+ handleHeightChange: handleHeightChange,
469
898
  handleSubmit: handleSubmit,
899
+ handleWidthChange: handleWidthChange,
900
+ height: height,
470
901
  imageRef: imageRef,
471
902
  isAspectRatioLocked: isAspectRatioLocked,
472
903
  isFullImage: isFullImage,
473
- setAspectRatio: setAspectRatio,
474
- setCrop: setCrop,
904
+ onToggleAspectRatioLock: onToggleAspectRatioLock,
475
905
  setIsFullImage: setIsFullImage,
476
- hideControls: neetoCist.isPresent(fixedAspectRatio),
477
- setAspectRatioLocked: setIsAspectRatioLocked
906
+ width: width,
907
+ hideControls: neetoCist.isPresent(fixedAspectRatio)
478
908
  })]
479
909
  })]
480
910
  });
@@ -505,14 +935,14 @@ var imagesApi = {
505
935
  bulkDestroy: bulkDestroy
506
936
  };
507
937
 
508
- function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
509
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
938
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
939
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
510
940
  var useFetchAssets = function useFetchAssets(_ref) {
511
941
  var searchTerm = _ref.searchTerm,
512
942
  url = _ref.url,
513
943
  per = _ref.per;
514
944
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
515
- return reactQuery.useInfiniteQuery(_objectSpread$3({
945
+ return reactQuery.useInfiniteQuery(_objectSpread$2({
516
946
  queryKey: [query.QUERY_KEYS.ASSETS_LIST, searchTerm],
517
947
  queryFn: function queryFn(_ref2) {
518
948
  var _ref2$pageParam = _ref2.pageParam,
@@ -560,6 +990,31 @@ var useBulkDestroyAssets = function useBulkDestroyAssets(url) {
560
990
  });
561
991
  };
562
992
 
993
+ function getAugmentedNamespace(n) {
994
+ if (n.__esModule) return n;
995
+ var f = n.default;
996
+ if (typeof f == "function") {
997
+ var a = function a () {
998
+ if (this instanceof a) {
999
+ return Reflect.construct(f, arguments, this.constructor);
1000
+ }
1001
+ return f.apply(this, arguments);
1002
+ };
1003
+ a.prototype = f.prototype;
1004
+ } else a = {};
1005
+ Object.defineProperty(a, '__esModule', {value: true});
1006
+ Object.keys(n).forEach(function (k) {
1007
+ var d = Object.getOwnPropertyDescriptor(n, k);
1008
+ Object.defineProperty(a, k, d.get ? d : {
1009
+ enumerable: true,
1010
+ get: function () {
1011
+ return n[k];
1012
+ }
1013
+ });
1014
+ });
1015
+ return a;
1016
+ }
1017
+
563
1018
  var lib = {};
564
1019
 
565
1020
  var propTypes = {exports: {}};
@@ -944,7 +1399,7 @@ var InfiniteScroll = {exports: {}};
944
1399
 
945
1400
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
946
1401
 
947
- var _react = require$$0;
1402
+ var _react = g;
948
1403
 
949
1404
  var _react2 = _interopRequireDefault(_react);
950
1405
 
@@ -1249,7 +1704,7 @@ var _createClass = function () { function defineProperties(target, props) { for
1249
1704
 
1250
1705
  var _class, _temp2;
1251
1706
 
1252
- var _react = require$$0;
1707
+ var _react = g;
1253
1708
 
1254
1709
  var _react2 = _interopRequireDefault(_react);
1255
1710
 
@@ -1406,7 +1861,7 @@ var MasonryInfiniteScroller = (_temp2 = _class = function (_Component) {
1406
1861
  }, _temp2);
1407
1862
  _default = lib.default = MasonryInfiniteScroller;
1408
1863
 
1409
- var css = ".niu-unsplash-container {\n height: calc(75vh - 220px) !important;\n max-height: 355px;\n}\n.niu-unsplash-container img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n cursor: pointer;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX2ltYWdlLWxpYnJhcnkuc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2Fic3RyYWN0cy9fdmFyaWFibGVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0E7RUFDRSxxQ0FBQTtFQUNBLGlCQ0NrQztBREhwQztBQUlFO0VBQ0UsWUFBQTtFQUNBLFdBQUE7RUFDQSxvQkFBQTtLQUFBLGlCQUFBO0VBQ0EsbUVBQUE7RUFDQSxzQ0FBQTtFQUNBLGtCQUFBO0VBQ0EsZUFBQTtBQUZKIiwic291cmNlc0NvbnRlbnQiOlsiLy9BYnN0cmFjdHNcbkBpbXBvcnQgXCIuLi9hYnN0cmFjdHMvdmFyaWFibGVzXCI7XG5cbi5uaXUtdW5zcGxhc2gtY29udGFpbmVyIHtcbiAgaGVpZ2h0OiBjYWxjKCN7JG5pdS1tb2RhbC1oZWlnaHR9IC0gI3skbml1LW1vZGFsLWhlYWRlci1oZWlnaHR9KSAhaW1wb3J0YW50O1xuICBtYXgtaGVpZ2h0OiAkbml1LXVuc3BsYXNoLWNvbnRhaW5lci1tYXgtaGVpZ2h0O1xuXG4gIGltZyB7XG4gICAgaGVpZ2h0OiAxMDAlO1xuICAgIHdpZHRoOiAxMDAlO1xuICAgIG9iamVjdC1maXQ6IGNvdmVyO1xuICAgIGFuaW1hdGlvbjogZmFkZS1pbiAxLjJzIDFzIGN1YmljLWJlemllcigwLjM5LCAwLjU3NSwgMC41NjUsIDEpIGJvdGg7XG4gICAgYm9yZGVyLXJhZGl1czogdmFyKC0tbmVldG8tdWktcm91bmRlZCk7XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgfVxufVxuIiwiJG5pdS1tb2RhbC13aWR0aDogOTV2dztcbiRuaXUtbW9kYWwtaGVpZ2h0OiA3NXZoO1xuJG5pdS1tb2RhbC1tYXgtd2lkdGg6IDExNTJweDtcbiRuaXUtbW9kYWwtbWF4LWhlaWdodDogNTc2cHg7XG4kbml1LW1vZGFsLWhlYWRlci1oZWlnaHQ6IDIyMHB4O1xuXG4kbml1LXVuc3BsYXNoLWNvbnRhaW5lci1tYXgtaGVpZ2h0OiAzNTVweDtcbiJdfQ== */";
1864
+ var css = ".niu-unsplash-container {\n height: calc(75vh - 13.75rem) !important;\n max-height: 22.1875rem;\n}\n.niu-unsplash-container img {\n height: 100%;\n width: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n animation: fade-in 1.2s 1s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n border-radius: var(--neeto-ui-rounded);\n position: relative;\n cursor: pointer;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL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weDtcbiRuaXUtbW9kYWwtbWF4LWhlaWdodDogMzZyZW07XG4kbml1LW1vZGFsLWhlYWRlci1oZWlnaHQ6IDEzLjc1cmVtO1xuXG4kbml1LXVuc3BsYXNoLWNvbnRhaW5lci1tYXgtaGVpZ2h0OiAyMi4xODc1cmVtO1xuIl19 */";
1410
1865
  n(css,{});
1411
1866
 
1412
1867
  var Menu = Dropdown.Menu,
@@ -1424,7 +1879,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
1424
1879
  handleUnsplashImageSelect = _ref$handleUnsplashIm === void 0 ? neetoCist.noop : _ref$handleUnsplashIm;
1425
1880
  var _useTranslation = reactI18next.useTranslation(),
1426
1881
  t = _useTranslation.t;
1427
- var _useState = require$$0.useState({
1882
+ var _useState = g.useState({
1428
1883
  isOpen: false,
1429
1884
  imageIds: []
1430
1885
  }),
@@ -1435,7 +1890,7 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
1435
1890
  var _useBulkDestroyAssets = useBulkDestroyAssets(utils$1.ASSETS_DESTROY_URL),
1436
1891
  isPending = _useBulkDestroyAssets.isPending,
1437
1892
  bulkDelete = _useBulkDestroyAssets.mutate;
1438
- var handleDelete = require$$0.useCallback(function () {
1893
+ var handleDelete = g.useCallback(function () {
1439
1894
  bulkDelete(deleteConfirmation.imageIds, {
1440
1895
  onSuccess: function onSuccess() {
1441
1896
  return setDeleteConfirmation({
@@ -1477,16 +1932,16 @@ var InfiniteScroller = function InfiniteScroller(_ref) {
1477
1932
  children: [tab === utils$1.TABS[2].key && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1478
1933
  children: [/*#__PURE__*/jsxRuntime.jsx("img", {
1479
1934
  "data-cy": "niu-unsplash-image-".concat(index),
1480
- src: image === null || image === void 0 ? void 0 : (_image$urls = image.urls) === null || _image$urls === void 0 ? void 0 : _image$urls.regular,
1935
+ src: image === null || image === void 0 || (_image$urls = image.urls) === null || _image$urls === void 0 ? void 0 : _image$urls.regular,
1481
1936
  onClick: function onClick() {
1482
1937
  return handleUnsplashImageSelect(image);
1483
1938
  }
1484
1939
  }), /*#__PURE__*/jsxRuntime.jsxs("a", {
1485
1940
  className: "neeto-ui-text-gray-100 absolute bottom-2 left-2 m-auto text-xs underline opacity-0 group-hover:opacity-100",
1486
- href: "https://unsplash.com/@".concat(image === null || image === void 0 ? void 0 : (_image$user = image.user) === null || _image$user === void 0 ? void 0 : _image$user.username),
1941
+ href: "https://unsplash.com/@".concat(image === null || image === void 0 || (_image$user = image.user) === null || _image$user === void 0 ? void 0 : _image$user.username),
1487
1942
  rel: "noreferrer",
1488
1943
  target: "_blank",
1489
- children: [image === null || image === void 0 ? void 0 : (_image$user2 = image.user) === null || _image$user2 === void 0 ? void 0 : _image$user2.name, " | ", " ", t("neetoImageUploader.labels.unsplash")]
1944
+ children: [image === null || image === void 0 || (_image$user2 = image.user) === null || _image$user2 === void 0 ? void 0 : _image$user2.name, " | ", " ", t("neetoImageUploader.labels.unsplash")]
1490
1945
  })]
1491
1946
  }), tab === utils$1.TABS[1].key && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1492
1947
  children: [utils.hasPermission(constants.VIEW_ROLES_PERMISSION) && isMenuButtonEnabled && /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
@@ -1571,7 +2026,7 @@ var Images = function Images(_ref) {
1571
2026
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
1572
2027
  });
1573
2028
  }
1574
- return /*#__PURE__*/require$$0.createElement(InfiniteScroller, {
2029
+ return /*#__PURE__*/g.createElement(InfiniteScroller, {
1575
2030
  setSelectedImage: setSelectedImage,
1576
2031
  hasMore: hasNextPage,
1577
2032
  images: results,
@@ -1602,13 +2057,13 @@ var unsplashApi = {
1602
2057
  getUnsplashImage: getUnsplashImage
1603
2058
  };
1604
2059
 
1605
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1606
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2060
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2061
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1607
2062
  var UNSPLASH_LIST = query.QUERY_KEYS.UNSPLASH_LIST;
1608
2063
  var useFetchUnsplashImages = function useFetchUnsplashImages(_ref) {
1609
2064
  var query$1 = _ref.query;
1610
2065
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1611
- return reactQuery.useInfiniteQuery(_objectSpread$2({
2066
+ return reactQuery.useInfiniteQuery(_objectSpread$1({
1612
2067
  queryKey: [UNSPLASH_LIST, {
1613
2068
  query: query$1
1614
2069
  }],
@@ -1635,35 +2090,13 @@ var useFetchUnsplashImages = function useFetchUnsplashImages(_ref) {
1635
2090
  }, options));
1636
2091
  };
1637
2092
 
1638
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1639
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1640
2093
  var UnsplashLibrary = function UnsplashLibrary(_ref) {
1641
2094
  var debouncedQuery = _ref.debouncedQuery,
1642
2095
  setSelectedImage = _ref.setSelectedImage,
1643
2096
  setIsUploading = _ref.setIsUploading,
1644
2097
  setActiveTab = _ref.setActiveTab;
1645
- var _useCreateBlob = useImageUploader.useCreateBlob(),
1646
- createBlob = _useCreateBlob.mutate;
1647
- var handleBlobCreation = function handleBlobCreation(image) {
1648
- var payload = {
1649
- filename: useImageUploader.generateASCIIFileName(image.filename),
1650
- content_type: image.contentType,
1651
- byte_size: image.byteSize,
1652
- checksum: image.checksum,
1653
- metadata: _objectSpread$1(_objectSpread$1({}, image.metadata), {}, {
1654
- url: constructCloudflareImageURL(image.url),
1655
- isCropped: false
1656
- }),
1657
- service_name: "cloudflare_image"
1658
- };
1659
- createBlob(payload);
1660
- };
1661
- var handleUploadComplete = function handleUploadComplete(image) {
1662
- initializers.globalProps.assetsUploaderService === index.CLOUD_FLARE && handleBlobCreation(image);
1663
- setSelectedImage(image);
1664
- };
1665
2098
  var _useImageUploader = useImageUploader.useImageUploader({
1666
- onUploadComplete: handleUploadComplete,
2099
+ onUploadComplete: setSelectedImage,
1667
2100
  setIsUploading: setIsUploading
1668
2101
  }),
1669
2102
  uploadFile = _useImageUploader.uploadFile;
@@ -1727,7 +2160,7 @@ var UnsplashLibrary = function UnsplashLibrary(_ref) {
1727
2160
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
1728
2161
  });
1729
2162
  }
1730
- return /*#__PURE__*/require$$0.createElement(InfiniteScroller, {
2163
+ return /*#__PURE__*/g.createElement(InfiniteScroller, {
1731
2164
  debouncedQuery: debouncedQuery,
1732
2165
  handleUnsplashImageSelect: handleUnsplashImageSelect,
1733
2166
  hasMore: hasNextPage,
@@ -1743,7 +2176,7 @@ var ImageLibrary = function ImageLibrary(_ref) {
1743
2176
  tab = _ref.tab,
1744
2177
  setIsUploading = _ref.setIsUploading,
1745
2178
  setActiveTab = _ref.setActiveTab;
1746
- var _useState = require$$0.useState(""),
2179
+ var _useState = g.useState(""),
1747
2180
  _useState2 = _slicedToArray(_useState, 2),
1748
2181
  query = _useState2[0],
1749
2182
  setQuery = _useState2[1];
@@ -1751,7 +2184,7 @@ var ImageLibrary = function ImageLibrary(_ref) {
1751
2184
  t = _useTranslation.t;
1752
2185
  var debouncedQuery = reactUtils.useDebounce(query, 400);
1753
2186
  var inputPlaceHolder = ramda.equals(tab, utils$1.TABS[2].key) ? t("neetoImageUploader.placeholders.searchImageFromWeb") : t("neetoImageUploader.placeholders.searchImage");
1754
- require$$0.useEffect(function () {
2187
+ g.useEffect(function () {
1755
2188
  setQuery("");
1756
2189
  }, [tab]);
1757
2190
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -1792,16 +2225,18 @@ var Modal = function Modal(_ref) {
1792
2225
  _ref$uploadConfig = _ref.uploadConfig,
1793
2226
  uploadConfig = _ref$uploadConfig === void 0 ? {} : _ref$uploadConfig,
1794
2227
  _ref$fixedAspectRatio = _ref.fixedAspectRatio,
1795
- fixedAspectRatio = _ref$fixedAspectRatio === void 0 ? {} : _ref$fixedAspectRatio;
1796
- var _useState = require$$0.useState(utils$1.TABS[0].key),
2228
+ fixedAspectRatio = _ref$fixedAspectRatio === void 0 ? {} : _ref$fixedAspectRatio,
2229
+ _ref$defaultImageSize = _ref.defaultImageSize,
2230
+ defaultImageSize = _ref$defaultImageSize === void 0 ? {} : _ref$defaultImageSize;
2231
+ var _useState = g.useState(utils$1.TABS[0].key),
1797
2232
  _useState2 = _slicedToArray(_useState, 2),
1798
2233
  activeTab = _useState2[0],
1799
2234
  setActiveTab = _useState2[1];
1800
- var _useState3 = require$$0.useState({}),
2235
+ var _useState3 = g.useState({}),
1801
2236
  _useState4 = _slicedToArray(_useState3, 2),
1802
2237
  selectedImage = _useState4[0],
1803
2238
  setSelectedImage = _useState4[1];
1804
- var _useState5 = require$$0.useState(false),
2239
+ var _useState5 = g.useState(false),
1805
2240
  _useState6 = _slicedToArray(_useState5, 2),
1806
2241
  isUploading = _useState6[0],
1807
2242
  setIsUploading = _useState6[1];
@@ -1878,7 +2313,7 @@ var Modal = function Modal(_ref) {
1878
2313
  getRootProps = _useUploadDropzone.getRootProps,
1879
2314
  getInputProps = _useUploadDropzone.getInputProps,
1880
2315
  isDragActive = _useUploadDropzone.isDragActive;
1881
- require$$0.useEffect(function () {
2316
+ g.useEffect(function () {
1882
2317
  setActiveTab(utils$1.TABS[0].key);
1883
2318
  }, [isOpen]);
1884
2319
  var renderContent = function renderContent() {
@@ -1888,7 +2323,6 @@ var Modal = function Modal(_ref) {
1888
2323
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
1889
2324
  className: "h-full w-full overflow-y-auto",
1890
2325
  children: /*#__PURE__*/jsxRuntime.jsx(utils$1.ImageDirectUpload, {
1891
- isDisabled: neetoCist.isPresent(fixedAspectRatio),
1892
2326
  uploadConfig: uploadConfigWithDefaults,
1893
2327
  onDrop: uploadFile
1894
2328
  })
@@ -1917,6 +2351,7 @@ var Modal = function Modal(_ref) {
1917
2351
  children: t("neetoImageUploader.common.dropHere")
1918
2352
  })
1919
2353
  })), !utils$1.isNilOrEmpty(selectedImage) ? /*#__PURE__*/jsxRuntime.jsx(ImageEditor, {
2354
+ defaultImageSize: defaultImageSize,
1920
2355
  fixedAspectRatio: fixedAspectRatio,
1921
2356
  handleImageEditComplete: handleImageEditComplete,
1922
2357
  handleReset: function handleReset() {
@@ -1973,4 +2408,4 @@ var Modal = function Modal(_ref) {
1973
2408
 
1974
2409
  exports.Modal = Modal;
1975
2410
  exports.constructCloudflareImageURL = constructCloudflareImageURL;
1976
- //# sourceMappingURL=index-BkKE5xo-.js.map
2411
+ //# sourceMappingURL=index-BXN-qII4.js.map