import { jsx as s } from "../../../../../preact@10.29.0/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useRef as m } from "../../../../../preact@10.29.0/node_modules/preact/hooks/dist/hooks.module.js";
import u from "../../../../../preact-custom-element@4.6.0_preact@10.29.0/node_modules/preact-custom-element/dist/preact-custom-element.esm.js";
import { s as y, E as p, r as b } from "./resolveEnvironment-C5RkjL5E.js";
import { B as g } from "./BusinessFinancingComponent-BfmzIskz.js";
import { e as o } from "./emitEvent-CzZf80Am.js";
try {
  let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, n = new e.Error().stack;
  n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9065f7ea-956e-481a-9b33-9668c9a83416", e._sentryDebugIdIdentifier = "sentry-dbid-9065f7ea-956e-481a-9b33-9668c9a83416");
} catch {
}
const h = ({
  rootlegalentityid: e,
  fetchToken: n,
  environment: i,
  locale: r,
  settings: d = {},
  experiments: l = {}
}) => {
  const t = m(null), a = (c) => {
    o(t, "complete", c);
  }, f = () => {
    o(t, "close");
  };
  return /* @__PURE__ */ s("div", { ref: t, style: "width:100%;", children: /* @__PURE__ */ s(
    p,
    {
      componentName: "adyen-business-financing",
      rootLegalEntityId: e,
      settings: d,
      experiments: l,
      getSdkToken: n,
      locale: r,
      baseUrl: b(i),
      children: /* @__PURE__ */ s(
        g,
        {
          legalEntityId: e,
          onSubmitSuccess: a,
          handleCloseClick: f
        }
      )
    }
  ) });
};
u(
  h,
  "adyen-business-financing",
  [
    "rootlegalentityid",
    "fetchToken",
    "environment",
    "locale",
    "settings",
    "experiments"
    // 'view',
  ],
  { shadow: !0, adoptedStyleSheets: y }
);
export {
  h as AdyenBusinessFinancing
};
