import { jsx as r } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useEffect as n } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { classes as m } from "../../constants.js";
import { popoverUtil as p } from "../../../../internal/Popover/utils/popoverUtil.js";
import d from "../../../../../core/Context/preact/useCoreContext.js";
import f from "../../../../internal/Modal/Modal.js";
import { TransactionData as c } from "../../../TransactionDetails/components/TransactionData/TransactionData.js";
const g = ({
  children: s,
  dataCustomization: t,
  onContactSupport: a,
  selectedDetail: o,
  resetDetails: e
}) => {
  const { i18n: l } = d(), i = !!o;
  return n(() => {
    i && p.closeAll();
  }, [i]), /* @__PURE__ */ r("div", { className: m.details, children: [
    s,
    o && /* @__PURE__ */ r(
      f,
      {
        isOpen: i,
        "aria-label": l.get("transactions.details.title"),
        onClose: e,
        isDismissible: !0,
        headerWithBorder: !1,
        size: o.modalSize || "large",
        children: /* @__PURE__ */ r(
          c,
          {
            id: o.selection.data,
            dataCustomization: t,
            onContactSupport: a,
            hideTitle: !0
          }
        )
      }
    )
  ] });
};
export {
  g as TransactionDetailsModal
};
