;
{
  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] = "acf98305-cea0-4f91-b4a6-353cf9f9987f", e._sentryDebugIdIdentifier = "sentry-dbid-acf98305-cea0-4f91-b4a6-353cf9f9987f");
  } catch (e) {
  }
}
;
import { jsx, jsxs } from "preact/jsx-runtime";
import register from "preact-custom-element";
import { s as stylesheets, E as EmbedShell, r as resolveEnvironment } from "./resolveEnvironment-cyRWc5YB.js";
import { u as useTranslation, a as addResourceBundles, _ as __variableDynamicImportRuntimeHelper, c as useLegalEntity, L as Loader, g as getLegalEntityCountry, a7 as noop, j as TaskTypes } from "./StoreProvider-CqQrndhS.js";
import { useState } from "preact/hooks";
import { I as IndividualOnfidoDropin } from "./IndividualDropin-Dc6nJvrr.js";
function InvitedDecisionMakerComponent({
  invitedIndividualId
}) {
  if (!invitedIndividualId) {
    throw new Error("Must provide `invitedIndividualEntityId`");
  }
  const { i18n } = useTranslation();
  addResourceBundles(i18n, [
    { ns: "common", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../../language/locales/bg-BG.json": () => import("./bg-BG-6XzbmxcW.js"), "../../../language/locales/cs-CZ.json": () => import("./cs-CZ-C6vEQ8P9.js"), "../../../language/locales/da-DK.json": () => import("./da-DK-DzcTI92X.js"), "../../../language/locales/de-DE.json": () => import("./de-DE-dPfrbCii.js"), "../../../language/locales/el-GR.json": () => import("./el-GR-Dazirlmt.js"), "../../../language/locales/en-US.instructions.json": () => import("./en-US.instructions-Ddr7AO05.js"), "../../../language/locales/en-US.json": () => import("./StoreProvider-CqQrndhS.js").then((n) => n.bF), "../../../language/locales/es-ES.json": () => import("./es-ES--IvNed_Q.js"), "../../../language/locales/et-EE.json": () => import("./et-EE-CsTXSlnY.js"), "../../../language/locales/fi-FI.json": () => import("./fi-FI-BUixKfXH.js"), "../../../language/locales/fr-FR.json": () => import("./fr-FR-BM-qNLci.js"), "../../../language/locales/hr-HR.json": () => import("./hr-HR-BF74vdPD.js"), "../../../language/locales/hu-HU.json": () => import("./hu-HU-DYhMVR_c.js"), "../../../language/locales/it-IT.json": () => import("./it-IT-D63gRTDc.js"), "../../../language/locales/ja-JP.json": () => import("./ja-JP-DL0IjTzn.js"), "../../../language/locales/lt-LT.json": () => import("./lt-LT-BX8dOAzK.js"), "../../../language/locales/lv-LV.json": () => import("./lv-LV-dA8yYdKe.js"), "../../../language/locales/nl-NL.json": () => import("./nl-NL-KQ6bciOb.js"), "../../../language/locales/no-NO.json": () => import("./no-NO-Ds3VioxT.js"), "../../../language/locales/pl-PL.json": () => import("./pl-PL-BgbxWHGE.js"), "../../../language/locales/pt-BR.json": () => import("./pt-BR-Ct4s4jXV.js"), "../../../language/locales/pt-PT.json": () => import("./pt-PT-DBEsmXQX.js"), "../../../language/locales/ro-RO.json": () => import("./ro-RO-C00Ig8CL.js"), "../../../language/locales/sk-SK.json": () => import("./sk-SK-BbJWayDh.js"), "../../../language/locales/sl-SI.json": () => import("./sl-SI-hxwQIw_i.js"), "../../../language/locales/sv-SE.json": () => import("./sv-SE-0PQ-U1u6.js") }), `../../../language/locales/${lang}.json`, 6) },
    { ns: "ui", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../ui/language/bg-BG.json": () => import("./bg-BG-zZhDshGi.js"), "../../ui/language/cs-CZ.json": () => import("./cs-CZ-Ck22NTT9.js"), "../../ui/language/da-DK.json": () => import("./da-DK-DQ4ZYSea.js"), "../../ui/language/de-DE.json": () => import("./de-DE-CkbOZ6S_.js"), "../../ui/language/el-GR.json": () => import("./el-GR-DudORw4U.js"), "../../ui/language/en-US.json": () => import("./en-US-CjjPhkB5.js"), "../../ui/language/es-ES.json": () => import("./es-ES-BAolMrZ0.js"), "../../ui/language/et-EE.json": () => import("./et-EE-BOIrYrz9.js"), "../../ui/language/fi-FI.json": () => import("./fi-FI-D8WrLxxq.js"), "../../ui/language/fr-FR.json": () => import("./fr-FR-Beljeilc.js"), "../../ui/language/hr-HR.json": () => import("./hr-HR-lIHN6Yl2.js"), "../../ui/language/hu-HU.json": () => import("./hu-HU-CWdwNCev.js"), "../../ui/language/it-IT.json": () => import("./it-IT-5a7NHVFo.js"), "../../ui/language/ja-JP.json": () => import("./ja-JP-DSvZhFNY.js"), "../../ui/language/lt-LT.json": () => import("./lt-LT-CgalYpUh.js"), "../../ui/language/lv-LV.json": () => import("./lv-LV-aAd9SEqx.js"), "../../ui/language/nl-NL.json": () => import("./nl-NL-CmURERx_.js"), "../../ui/language/no-NO.json": () => import("./no-NO-qyqWODMp.js"), "../../ui/language/pl-PL.json": () => import("./pl-PL-q9azN24o.js"), "../../ui/language/pt-BR.json": () => import("./pt-BR-BxoOF8jB.js"), "../../ui/language/pt-PT.json": () => import("./pt-PT-pIChDwiI.js"), "../../ui/language/ro-RO.json": () => import("./ro-RO-DRsaNX9j.js"), "../../ui/language/sk-SK.json": () => import("./sk-SK-7-enbO1N.js"), "../../ui/language/sl-SI.json": () => import("./sl-SI-DTvJT7fC.js"), "../../ui/language/sv-SE.json": () => import("./sv-SE-N-Hqwcjq.js") }), `../../ui/language/${lang}.json`, 5) },
    { ns: "individual", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../Individual/language/bg-BG.json": () => import("./bg-BG-wMYXZGDQ.js"), "../../Individual/language/cs-CZ.json": () => import("./cs-CZ-bkbdzIkF.js"), "../../Individual/language/da-DK.json": () => import("./da-DK-DvZ431fC.js"), "../../Individual/language/de-DE.json": () => import("./de-DE-0uSzhWg5.js"), "../../Individual/language/el-GR.json": () => import("./el-GR-CWWBcvDM.js"), "../../Individual/language/en-US.json": () => import("./en-US-cVpRgdC8.js"), "../../Individual/language/es-ES.json": () => import("./es-ES-B7dt4cn7.js"), "../../Individual/language/et-EE.json": () => import("./et-EE-D_3GB-yT.js"), "../../Individual/language/fi-FI.json": () => import("./fi-FI-REMsyTSr.js"), "../../Individual/language/fr-FR.json": () => import("./fr-FR-CvHWmim-.js"), "../../Individual/language/hr-HR.json": () => import("./hr-HR-LO3oO8yb.js"), "../../Individual/language/hu-HU.json": () => import("./hu-HU-DEKBPTur.js"), "../../Individual/language/it-IT.json": () => import("./it-IT-BeX7-OcD.js"), "../../Individual/language/ja-JP.json": () => import("./ja-JP-B3wVYIJU.js"), "../../Individual/language/lt-LT.json": () => import("./lt-LT-3niAR3rI.js"), "../../Individual/language/lv-LV.json": () => import("./lv-LV-K-KFPny2.js"), "../../Individual/language/nl-NL.json": () => import("./nl-NL-CM5U8ODq.js"), "../../Individual/language/no-NO.json": () => import("./no-NO-BQL_M1pn.js"), "../../Individual/language/pl-PL.json": () => import("./pl-PL-DC_lIAnp.js"), "../../Individual/language/pt-BR.json": () => import("./pt-BR-AZ3roErF.js"), "../../Individual/language/pt-PT.json": () => import("./pt-PT-DVKtHjIY.js"), "../../Individual/language/ro-RO.json": () => import("./ro-RO-CHcD-PGb.js"), "../../Individual/language/sk-SK.json": () => import("./sk-SK-s9Xm01UD.js"), "../../Individual/language/sl-SI.json": () => import("./sl-SI-C0wSbuau.js"), "../../Individual/language/sv-SE.json": () => import("./sv-SE-DtKjf4Go.js") }), `../../Individual/language/${lang}.json`, 5) }
  ]);
  const [step, setStep] = useState("landingStep");
  const { data: invitedIndividualLe } = useLegalEntity(invitedIndividualId);
  if (!invitedIndividualLe) {
    return /* @__PURE__ */ jsx(Loader, {});
  }
  const country = getLegalEntityCountry(invitedIndividualLe);
  switch (step) {
    case "landingStep":
      return (
        // TODO placeholder
        /* @__PURE__ */ jsxs("div", { children: [
          /* @__PURE__ */ jsx("span", { children: "Hey congrats, you got invited. You must be pretty special." }),
          /* @__PURE__ */ jsx("button", { onClick: () => setStep("provideDetailsStep"), children: "Click here to continue" })
        ] })
      );
    case "provideDetailsStep":
      return /* @__PURE__ */ jsx(
        IndividualOnfidoDropin,
        {
          taskType: TaskTypes.DECISION_MAKER,
          taskName: "decisionMakerDetails",
          legalEntityResponse: invitedIndividualLe,
          problems: void 0,
          country,
          handleHomeClick: noop
        }
      );
  }
}
const AdyenInvitedDecisionMaker = ({
  rootlegalentityid,
  fetchToken,
  environment,
  locale,
  settings = {},
  experiments = {}
}) => {
  return /* @__PURE__ */ jsx("div", { style: "width:100%;", children: /* @__PURE__ */ jsx(
    EmbedShell,
    {
      componentName: "adyen-invited-decision-maker",
      rootLegalEntityId: rootlegalentityid,
      settings,
      experiments,
      getSdkToken: fetchToken,
      locale,
      baseUrl: resolveEnvironment(environment),
      children: /* @__PURE__ */ jsx(InvitedDecisionMakerComponent, { invitedIndividualId: rootlegalentityid })
    }
  ) });
};
register(
  AdyenInvitedDecisionMaker,
  "adyen-invited-decision-maker",
  ["rootlegalentityid", "environment", "locale", "fetchToken", "settings", "experiments"],
  { shadow: true, adoptedStyleSheets: stylesheets }
);
export {
  AdyenInvitedDecisionMaker
};
