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] = "dd8dadee-0f30-4f52-932c-d7a60a01c2b6", e._sentryDebugIdIdentifier = "sentry-dbid-dd8dadee-0f30-4f52-932c-d7a60a01c2b6");
} catch (e) {}
import { t as LegalEntityTypes } from "./legal-entity-type-VIfNYnJP.js";
import { s as getOwnEntityAssociations } from "./entityAssociationUtil-C0gX4Ewv.js";
//#region src/utils/getName.ts
var getIndividualLegalEntityName = (legalEntityResponse) => {
	if (!legalEntityResponse || !legalEntityResponse?.individual) return "";
	return `${legalEntityResponse.individual?.name?.firstName ?? ""} ${legalEntityResponse.individual?.name?.lastName ?? ""}`;
};
var getLegalEntityNameBasedOnType = (legalEntityResponse) => {
	if (legalEntityResponse.type === LegalEntityTypes.INDIVIDUAL) return getIndividualLegalEntityName(legalEntityResponse);
	return legalEntityResponse.organization?.legalName ?? "";
};
/** *
* In payout account the account holder name is always the legal arrangement
* ie: trust, soleprops etc, if they exist otherwise the legal entity name is the account holder
*/
var getPayoutAccountHolderName = (legalEntity, t) => {
	const ownAssociations = getOwnEntityAssociations(legalEntity);
	const trustAssociation = ownAssociations.find(({ type }) => type === LegalEntityTypes.TRUST);
	if (trustAssociation?.name) {
		const trustName = trustAssociation.name;
		return t(($) => $["trusteeAsTrusteeForTrust"], {
			trustName,
			trusteeName: getLegalEntityNameBasedOnType(legalEntity)
		});
	}
	const solePropAssociation = ownAssociations.find(({ type }) => type === LegalEntityTypes.SOLE_PROPRIETORSHIP);
	if (solePropAssociation?.name) return solePropAssociation.name;
	return getLegalEntityNameBasedOnType(legalEntity);
};
//#endregion
export { getLegalEntityNameBasedOnType as n, getPayoutAccountHolderName as r, getIndividualLegalEntityName as t };
