import e from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/objectWithoutProperties";import{jsx as r}from"react/jsx-runtime";import{Modal as t}from"@material-ui/core";import{useCallback as n}from"react";import{useDelayedDcFullscreenElemOpen as s}from"../../effects/useDelayedDcFullscreenElemOpen.js";import{useIsInsideDcFullscreenElem as c,IsInsideDcFullscreenElemProvider as i}from"../../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import{useIsInsideIsolatedDcApp as p}from"../../components/DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import{ModalWindow as l}from"../ModalWindow/ModalWindow.js";import a from"./Modal.scss.js";var m=["open","onClose","size","showCloseButton","closeOnBackdropClick","closeOnEscape"],u=["open"];function d(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function f(o){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){e(o,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}var O=function(e){var s=e.open,c=e.onClose,i=e.size,p=void 0===i?"medium":i,u=e.showCloseButton,d=void 0===u||u,O=e.closeOnBackdropClick,b=void 0===O||O,v=e.closeOnEscape,C=void 0===v||v,j=o(e,m),y=n((function(e,o){c&&("backdropClick"===o&&b&&c("backdropClick"),"escapeKeyDown"===o&&C&&c("escapeKey"))}),[c,b,C]),D=n((function(){null==c||c("closeButtonClick")}),[c]);return r(t,{open:s,className:a.root,onClose:y,children:r(l,f(f({},j),{},{onClose:D,showCloseButton:d,size:p}))})},b=function(e){var t=e.open,n=o(e,u),c=s({isOpen:t},!0).delayedIsOpen;return r(i,{children:r(O,f({open:c},n))})},v=function(e){var o=p(),t=c();return r(o&&!t?b:O,f({},e))};export{v as Modal};
//# sourceMappingURL=Modal.js.map
