;
{
  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] = "14393fc5-1aee-4aa8-a310-8b7f8a3729db", e._sentryDebugIdIdentifier = "sentry-dbid-14393fc5-1aee-4aa8-a310-8b7f8a3729db");
  } 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 { B as BusinessFinancingComponent } from "./BusinessFinancingComponent-CX33V7nQ.js";
import { e as emitAdyenSdkEvent } from "./emitEvent-CzZf80Am.js";
const AdyenBusinessFinancing = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {}
}) => {
  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-business-financing",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(
        BusinessFinancingComponent,
        {
          legalEntityId: rootlegalentityid,
          onSubmitSuccess: handleOnComplete,
          handleCloseClick: handleOnClose
        }
      )
    }
  ) });
};
register(
  AdyenBusinessFinancing,
  "adyen-business-financing",
  [
    "rootlegalentityid",
    "fetchToken",
    "environment",
    "locale",
    "settings",
    "experiments"
    // 'view',
  ],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
export {
  AdyenBusinessFinancing
};
