var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
import React, { useContext } from "react";
import classnames from "classnames";
import Popup from "../popup";
import ConfigProviderContext from "../config-provider/ConfigProviderContext";
const Notify = (_a) => {
  var _b = _a, {
    children
  } = _b, props = __objRest(_b, [
    "children"
  ]);
  const {
    prefixCls,
    createNamespace
  } = useContext(ConfigProviderContext);
  const [bem] = createNamespace("notify", prefixCls);
  const style = {
    color: props.color,
    background: props.background
  };
  return /* @__PURE__ */ React.createElement(Popup, {
    visible: props.visible,
    className: classnames(bem([props.type]), props.className),
    style,
    overlay: false,
    position: "top",
    lockScroll: props.lockScroll,
    onClick: props.onClick,
    onClose: props.onClose,
    onClosed: props.onClosed,
    teleport: props.teleport
  }, children || props.message);
};
Notify.defaultProps = {
  type: "danger",
  duration: 3e3,
  color: "white",
  lockScroll: false
};
var stdin_default = Notify;
export {
  stdin_default as default
};
