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