import { a as __rest, _ as __assign } from '../tslib.es6-faad35dc.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import { forwardRef, useCallback } from 'react';
import { styled } from '@mui/material/styles';
import MuiBox from '@mui/material/Box';
import MuiSnackbar from '@mui/material/Snackbar';
import Alert from './Alert.js';
import IconButton from './IconButton.js';
import '@mui/material/Alert';
import '../theme/colors.js';
import '@mui/material/IconButton';
import './Icon.js';
import '../icons/ArrowLeft.js';
import '../icons/ArrowRight.js';
import '../icons/CloseCircle.js';
import '../icons/InfoCircle.js';
import '../icons/ErrorCircle.js';
import '../icons/Attention.js';
import '../icons/HelpCircle.js';
import '../icons/Document.js';
import '../icons/DocumentText.js';
import '../icons/Lock.js';
import '../icons/Delete.js';
import '../icons/Users.js';
import '../icons/Stakefish.js';
import '../icons/Sound.js';
import '../icons/Beacon.js';
import '../icons/TriangleRight.js';
import '../icons/TriangleLeft.js';
import '../icons/TriangleUp.js';
import '../icons/TriangleDown.js';
import '../icons/Sent.js';
import '../icons/Download.js';
import '../icons/Faster.js';
import '../icons/Slower.js';
import '../icons/Usb.js';
import '../icons/Key.js';
import '../icons/Edit.js';
import '../icons/Expand.js';
import '../icons/Collapse.js';
import '../icons/Success.js';
import '../icons/SuccessCircle.js';
import '../icons/Fail.js';
import '../icons/Desktop.js';
import '../icons/Mobile.js';
import '../icons/Loading.js';
import '../icons/Upload.js';
import '../icons/Check.js';
import '../icons/ChevronLeft.js';
import '../icons/ChevronRight.js';
import '../icons/Plus.js';
import '../icons/Minus.js';
import '../icons/Globe.js';
import '../icons/Link.js';
import '../icons/Copy.js';
import '../icons/Medium.js';
import '../icons/Twitter.js';
import '../icons/Telegram.js';
import '../icons/Eth.js';
import '../icons/Sort.js';
import '../icons/Close.js';
import '../icons/DollarSign.js';
import '../icons/Search.js';
import '../icons/Range.js';
import '../icons/Instagram.js';
import '../icons/LinkedIn.js';
import '../icons/Reddit.js';
import '../icons/YouTube.js';
import '../icons/Chrome.js';
import '../icons/CloudConnect.js';
import '../icons/Update.js';
import '../icons/Menu.js';
import '../icons/Settings.js';

var AlertBox = styled(MuiBox)({
    display: "flex",
    alignItems: "center",
    justifyContent: "space-between",
    gap: 16
});
var Snackbar = forwardRef(function (_a, ref) {
    var open = _a.open, onClose = _a.onClose, alertProps = _a.alertProps, children = _a.children, action = _a.action, props = __rest(_a, ["open", "onClose", "alertProps", "children", "action"]);
    var handleClose = useCallback(function (event, reason) {
        if (onClose)
            onClose(event, reason);
    }, [onClose]);
    var ActionElement = function () {
        if (action && action !== "close")
            return action;
        return (jsx(IconButton, { iconProps: { iconKey: "close" }, sx: { padding: 0 }, onClick: function (event) { return handleClose(event, "closeAction"); } }, void 0));
    };
    return (jsx(MuiSnackbar, __assign({ open: open, anchorOrigin: { vertical: "bottom", horizontal: "right" } }, props, { onClose: onClose, ref: ref }, { children: jsx(Alert, __assign({}, alertProps, { children: jsxs(AlertBox, { children: [jsx(MuiBox, __assign({ flexGrow: 1 }, { children: children }), void 0), action && (jsx(MuiBox, __assign({ display: "flex", alignItems: "center" }, { children: jsx(ActionElement, {}, void 0) }), void 0))] }, void 0) }), void 0) }), void 0));
});

export { Snackbar as default };
