import e from"@babel/runtime/helpers/defineProperty";import n from"prop-types";import r from"react-image-lightbox";import o from"@material-ui/icons/SaveAlt";import t from"@material-ui/icons/ArrowBack";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import{jsx as i,jsxs as p}from"react/jsx-runtime";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import{useIsInsideDcApp as s}from"../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js";import a from"./styles.css.js";function c(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,o)}return r}function l(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?c(Object(o),!0).forEach((function(r){e(n,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var m=function(e){return i("div",{className:a.cImageViewerToolbar,children:i("button",{type:"button","aria-label":"Close",className:a.cImageViewerToolbarButton,onClick:e.onCloseRequest,children:i(t,{className:a.cImageViewerToolbarIcon,htmlColor:"#fff"})})})},u=function(e){var n=s();return i("div",{className:a.cImageViewer,children:i(r,{mainSrc:e.mainSrc,imagePadding:e.imagePadding,toolbarButtons:[i("button",{"data-testid":"".concat("ImageViewer","_download"),type:"button","aria-label":"Download",className:a.cImageViewerToolbarButton,children:i("a",{href:e.mainSrc,download:"image",target:"_blank",rel:"noopener noreferrer",children:i(o,{className:a.cImageViewerToolbarIcon,htmlColor:"#fff"})})})],onAfterOpen:e.onAfterOpen,onCloseRequest:e.onCloseRequest,reactModalStyle:{overlay:{zIndex:1500}},reactModalProps:{parentSelector:function(){return n?parent.document.body:document.body},overlayElement:function(e,n){return p("div",l(l({},e),{},{children:[i(m,{onCloseRequest:e.onCloseRequest}),n]}))}},wrapperClassName:a.cImageViewerWrapper})})};u.propTypes={mainSrc:n.string.isRequired,imagePadding:n.number,onAfterOpen:n.func,onCloseRequest:n.func},m.propTypes={onCloseRequest:n.func.isRequired},u.defaultProps={imagePadding:50,onAfterOpen:void 0,onCloseRequest:void 0};export{u as default};
