;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9ae0e8d6-6a48-4553-9899-ca57921625f3", e._sentryDebugIdIdentifier = "sentry-dbid-9ae0e8d6-6a48-4553-9899-ca57921625f3");
  } catch (e) {
  }
}
;
import { jsx } from "preact/jsx-runtime";
import { useRef } from "preact/hooks";
import register from "preact-custom-element";
import { s as stylesheets, E as EmbedShell, r as resolveEnvironment } from "./resolveEnvironment-cyRWc5YB.js";
import { C as CreateTransferInstrumentComponent } from "./CreateTransferInstrumentComponent-DKe2lIAb.js";
import { e as emitAdyenSdkEvent } from "./emitEvent-CzZf80Am.js";
const AdyenTransferInstrument = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {},
  transferinstrumentid,
  view,
  openbankingpartnerconfigid
}) => {
  const eventEmitterRef = useRef(null);
  const handleOnComplete = (data) => {
    emitAdyenSdkEvent(eventEmitterRef, "complete", data);
  };
  const handleOnClose = () => {
    emitAdyenSdkEvent(eventEmitterRef, "close");
  };
  return /* @__PURE__ */ jsx("div", { ref: eventEmitterRef, style: "width:100%;", children: /* @__PURE__ */ jsx(
    EmbedShell,
    {
      componentName: "adyen-transfer-instrument-configuration",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(
        CreateTransferInstrumentComponent,
        {
          legalEntityId: rootlegalentityid,
          transferInstrumentId: transferinstrumentid,
          modalView: view === "modal",
          openBankingPartnerConfigId: openbankingpartnerconfigid,
          onSubmitSuccess: handleOnComplete,
          onClose: handleOnClose
        }
      )
    }
  ) });
};
register(
  AdyenTransferInstrument,
  "adyen-transfer-instrument-configuration",
  [
    "rootlegalentityid",
    "fetchToken",
    "environment",
    "locale",
    "settings",
    "experiments",
    "transferinstrumentid",
    "view",
    "openbankingpartnerconfigid"
  ],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
export {
  AdyenTransferInstrument
};
