import { jsx as e } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useMemo as y } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import o from "../../../../../hooks/useUniqueId.js";
import t from "../../../../internal/Typography/Typography.js";
import { TypographyVariant as r, TypographyElement as n } from "../../../../internal/Typography/types.js";
import { AccountDetails as A } from "../AccountDetails/AccountDetails.js";
import { GrantAdjustmentDetails as h } from "../GrantAdjustmentDetails/GrantAdjustmentDetails.js";
/* empty css                           */
import { Divider as f } from "../../../../internal/Divider/Divider.js";
import N from "../../../../../core/Context/preact/useCoreContext.js";
import { Fragment as I } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
import { Translation as P } from "../../../../internal/Translation/Translation.js";
const i = "adyen-pe-grant-repayment-details", s = {
  instructionList: `${i}__instruction-list`,
  notice: `${i}__notice`,
  repaymentAccount: `${i}__repayment-account`,
  transferInstrumentItem: `${i}__transfer-instrument-item`,
  transferInstrumentList: `${i}__transfer-instrument-list`,
  verifiedBankAccountDetails: `${i}__verified-bank-account-details`
}, k = ({ grant: l, onDetailsClose: v }) => {
  const { i18n: a } = N(), m = `list-${o()}`, d = `list-${o()}`, u = `list-${o()}`, c = y(() => l.unscheduledRepaymentAccounts?.[0], [l.unscheduledRepaymentAccounts]);
  return c ? /* @__PURE__ */ e(
    h,
    {
      className: i,
      onDetailsClose: v,
      headerTitleKey: "capital.overview.repayment.title",
      headerSubtitleKey: "capital.overview.repayment.subtitle",
      children: [
        /* @__PURE__ */ e("div", { className: s.repaymentAccount, children: [
          /* @__PURE__ */ e(t, { id: m, el: n.SPAN, variant: r.BODY, stronger: !0, children: a.get("capital.overview.repayment.accountDetails.title") }),
          /* @__PURE__ */ e(A, { bankAccount: c, "aria-labelledby": m })
        ] }),
        /* @__PURE__ */ e("div", { className: s.notice, children: [
          !!l.transferInstruments?.length && /* @__PURE__ */ e(I, { children: [
            /* @__PURE__ */ e("div", { children: [
              /* @__PURE__ */ e(t, { id: u, el: n.SPAN, variant: r.CAPTION, stronger: !0, children: a.get("capital.overview.repayment.transferInstruments") }),
              /* @__PURE__ */ e("ul", { className: s.transferInstrumentList, "aria-labelledby": u, children: l.transferInstruments?.map(({ accountIdentifier: p }) => /* @__PURE__ */ e("li", { className: s.transferInstrumentItem, children: /* @__PURE__ */ e(t, { el: n.SPAN, variant: r.CAPTION, children: p }) }, p)) })
            ] }),
            /* @__PURE__ */ e(f, {})
          ] }),
          /* @__PURE__ */ e("div", { children: [
            /* @__PURE__ */ e(t, { id: d, el: n.SPAN, variant: r.CAPTION, stronger: !0, children: a.get("capital.overview.repayment.instructions.title") }),
            /* @__PURE__ */ e("ol", { className: s.instructionList, "aria-labelledby": d, children: [
              /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(t, { el: n.SPAN, variant: r.CAPTION, children: /* @__PURE__ */ e(
                P,
                {
                  translationKey: "capital.overview.repayment.instructions.addingBeneficiary",
                  fills: {
                    beneficiaryName: /* @__PURE__ */ e(t, { el: n.SPAN, variant: r.CAPTION, stronger: !0, children: c.beneficiaryName })
                  }
                }
              ) }) }),
              /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(t, { el: n.SPAN, variant: r.CAPTION, children: a.get("capital.overview.repayment.instructions.sendingPayment") }) }),
              /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(t, { el: n.SPAN, variant: r.CAPTION, children: a.get("capital.overview.repayment.instructions.waiting") }) })
            ] })
          ] }),
          /* @__PURE__ */ e(t, { className: s.verifiedBankAccountDetails, el: n.SPAN, variant: r.CAPTION, children: a.get("capital.overview.repayment.instructions.verifiedAccount") })
        ] })
      ]
    }
  ) : null;
};
export {
  k as GrantRepaymentDetails
};
