;
{
  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] = "03ea7627-ee5e-417f-814b-4e60ef53184e", e._sentryDebugIdIdentifier = "sentry-dbid-03ea7627-ee5e-417f-814b-4e60ef53184e");
  } catch (e) {
  }
}
;
import { u as useTranslation, c as useLegalEntity, a as addResourceBundles, L as Loader, g as getLegalEntityCountry, j as TaskTypes, a8 as EntityTypes, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-CqQrndhS.js";
import { jsx } from "preact/jsx-runtime";
import { skipToken } from "@tanstack/preact-query";
import { useParams } from "wouter-preact";
import { u as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-B2WglS12.js";
import { u as useCapabilityProblems, g as getProblemsForEntity } from "./getProblemsForEntity-C1PgQbDM.js";
import { u as useBusinessDetailsData, B as BusinessDetailsDropin } from "./useBusinessDetailsData-CoYJKPS2.js";
function UnincorporatedPartnershipMemberCompanyPage({
  partnershipId,
  partnershipMemberCompanyId: partnershipMemberCompanyIdProp,
  newMember,
  onSubmit,
  handleHomeClick
}) {
  const routeParams = useParams();
  const partnershipMemberCompanyId = partnershipMemberCompanyIdProp ?? routeParams.memberId;
  const { i18n } = useTranslation();
  const { data: partnershipLe } = useLegalEntity(partnershipId || skipToken);
  const { data: partnershipMemberCompanyLe } = useLegalEntity(
    partnershipMemberCompanyId || skipToken
  );
  const partnershipMembers = useUnincorporatedPartnershipMembers();
  const capabilityProblems = useCapabilityProblems();
  const { data, isLoading } = useBusinessDetailsData(
    TaskTypes.TRUST_MEMBER_COMPANY,
    partnershipLe,
    partnershipMemberCompanyLe
  );
  addResourceBundles(i18n, [
    { ns: "business", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../../Business/language/bg-BG.json": () => import("./bg-BG-CFuVZnaC.js"), "../../Business/language/cs-CZ.json": () => import("./cs-CZ-CYsR__kj.js"), "../../Business/language/da-DK.json": () => import("./da-DK-B3Pg-MWO.js"), "../../Business/language/de-DE.json": () => import("./de-DE-S6qDey1L.js"), "../../Business/language/el-GR.json": () => import("./el-GR-DoS_Va-n.js"), "../../Business/language/en-US.json": () => import("./en-US-DLY20x1O.js"), "../../Business/language/es-ES.json": () => import("./es-ES-BYl5-PFR.js"), "../../Business/language/et-EE.json": () => import("./et-EE-4fHYOoff.js"), "../../Business/language/fi-FI.json": () => import("./fi-FI-DFxljML-.js"), "../../Business/language/fr-FR.json": () => import("./fr-FR-DPehHVb6.js"), "../../Business/language/hr-HR.json": () => import("./hr-HR-Bjx-KdVs.js"), "../../Business/language/hu-HU.json": () => import("./hu-HU-B-lUkFnQ.js"), "../../Business/language/it-IT.json": () => import("./it-IT-DOBp2-MP.js"), "../../Business/language/ja-JP.json": () => import("./ja-JP-Bv3ru9Xq.js"), "../../Business/language/lt-LT.json": () => import("./lt-LT-WRulV980.js"), "../../Business/language/lv-LV.json": () => import("./lv-LV-C9Dhkruv.js"), "../../Business/language/nl-NL.json": () => import("./nl-NL-SjOGmGk5.js"), "../../Business/language/no-NO.json": () => import("./no-NO-BAWVf0GX.js"), "../../Business/language/pl-PL.json": () => import("./pl-PL-DEMxxz7h.js"), "../../Business/language/pt-BR.json": () => import("./pt-BR-BfDe_8iW.js"), "../../Business/language/pt-PT.json": () => import("./pt-PT-F1qPZJ2c.js"), "../../Business/language/ro-RO.json": () => import("./ro-RO-0vx6ZLWV.js"), "../../Business/language/sk-SK.json": () => import("./sk-SK-DuLm2CVx.js"), "../../Business/language/sl-SI.json": () => import("./sl-SI-BAIm-qBe.js"), "../../Business/language/sv-SE.json": () => import("./sv-SE-BZNey_8S.js") }), `../../Business/language/${lang}.json`, 5) }
  ]);
  if (isLoading || !partnershipLe || partnershipMemberCompanyId && !partnershipMemberCompanyLe) {
    return /* @__PURE__ */ jsx(Loader, {});
  }
  const { rootLe, efpBusinessLines, documents } = data;
  const problems = capabilityProblems && partnershipMemberCompanyId ? getProblemsForEntity(
    capabilityProblems,
    EntityTypes.LEGAL_ENTITY,
    partnershipMemberCompanyId
  ) : void 0;
  const country = getLegalEntityCountry(partnershipMemberCompanyLe ?? partnershipLe);
  const partnershipMember = newMember ?? partnershipMembers.find((member) => member.legalEntityId === partnershipMemberCompanyId);
  return /* @__PURE__ */ jsx(
    BusinessDetailsDropin,
    {
      taskType: TaskTypes.UNINCORPORATED_PARTNERSHIP_MEMBER_COMPANY,
      legalEntityResponse: rootLe,
      efpBusinessLines,
      documents,
      associatedLegalArrangement: partnershipLe,
      nestedLegalEntity: partnershipMemberCompanyLe,
      nestedLegalEntityDetails: partnershipMember,
      problems,
      country,
      onSubmit,
      handleHomeClick
    }
  );
}
export {
  UnincorporatedPartnershipMemberCompanyPage
};
