import { jsx as r } from "react/jsx-runtime";
/* empty css                 */
import { classNames as t } from "./index-classNames.js";
import { deviceService as N } from "./index-device.service.js";
import "react";
const O = (n) => {
  const {
    children: c,
    className: m,
    modalPosition: C = "top",
    testId: u,
    onOutsideClick: i,
    onContentClick: s,
    modalContentClassName: f,
    disableOutsideClick: p,
    backgroundColor: h
  } = n;
  let {
    fullscreen: o,
    width: l,
    maxWidth: d,
    minHeight: a
  } = n;
  o === void 0 && (o = N.isMobile()), o && (l = void 0, a = void 0, d = void 0);
  const k = () => {
    const e = `modal-position-${C}`;
    return t(e, o ? "modal-fullscreen" : "", m);
  }, g = () => ({
    width: l,
    maxWidth: d,
    backgroundColor: h,
    minHeight: a
  });
  return r("div", {
    onClick: (e) => {
      i && i(e);
    },
    "data-testid": u,
    className: t("rc-modal", k()),
    children: r("div", {
      onClick: (e) => {
        p || (e.stopPropagation(), s && s(e));
      },
      className: t("modal-content", f),
      style: g(),
      children: c
    })
  });
};
export {
  O as Modal
};
