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] = "7fb8a2fb-fa91-46d7-b070-8849d0d9ab95", e._sentryDebugIdIdentifier = "sentry-dbid-7fb8a2fb-fa91-46d7-b070-8849d0d9ab95");
} catch (e) {}
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
import { d as hasOwnEntityAssociationOfType } from "./entityAssociationUtil-C0gX4Ewv.js";
import { t as isEmptyEntity } from "./isEmptyEntity-BBazi0Go.js";
//#region src/utils/accountHolderUtils.ts
var capabilitiesToPreventTypeChange = [
	"receivePayments",
	"issueCard",
	"useCard",
	"withdrawFromAtm",
	"withdrawFromAtmInRestrictedCountries",
	"useCardInRestrictedCountries",
	"useCardInRestrictedIndustries",
	"issueBankAccount",
	"sendToThirdParty",
	"receiveFromThirdParty",
	"getGrantOffers",
	"receiveGrants"
];
var entityTypeToCorrespondingAccountHolderOption = {
	[LegalEntityTypes.INDIVIDUAL]: "myName",
	[LegalEntityTypes.ORGANIZATION]: "theCompanyIWorkFor",
	[LegalEntityTypes.SOLE_PROPRIETORSHIP]: "mySoleProprietorName",
	[LegalEntityTypes.TRUST]: "aTrust",
	[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: "anUnincorporatedPartnership"
};
/**
** Account holder option is not stored in backend as it does not effect any check evaluations.
** The value is computed in the front end based on the associations and current flow of the legalEntity
* */
var getDefaultAccountHolderType = (legalEntityResponse, isTypeChanging = false, accountHolder) => {
	if (!legalEntityResponse?.type) return void 0;
	if (hasOwnEntityAssociationOfType(LegalEntityTypes.SOLE_PROPRIETORSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) return "mySoleProprietorName";
	if (hasOwnEntityAssociationOfType(LegalEntityTypes.TRUST, legalEntityResponse.entityAssociations, legalEntityResponse.id)) return "aTrust";
	if (hasOwnEntityAssociationOfType(LegalEntityTypes.UNINCORPORATED_PARTNERSHIP, legalEntityResponse.entityAssociations, legalEntityResponse.id)) return "anUnincorporatedPartnership";
	if (accountHolder) return accountHolder;
	if (isTypeChanging || !isEmptyEntity(legalEntityResponse)) return entityTypeToCorrespondingAccountHolderOption[legalEntityResponse.type];
};
var allowIndividualWithoutSoleProp = (capabilities) => !capabilities?.map((c) => c.replace("Commercial", "").replace("Consumer", "")).some((c) => capabilitiesToPreventTypeChange.includes(c));
//#endregion
export { getDefaultAccountHolderType as n, allowIndividualWithoutSoleProp as t };
