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] = "d9e78876-5dae-4cde-818a-26de281da764", e._sentryDebugIdIdentifier = "sentry-dbid-d9e78876-5dae-4cde-818a-26de281da764");
} catch (e) {}
import { r as useTranslation } from "./translation-Br5wIPO-.js";
import { C as EntityTypes, T as DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING } from "./processCapabilities-CDSEJpB8.js";
import { t as TaskTypes } from "./taskTypes-DWaxzvnQ.js";
import { useMemo } from "preact/hooks";
//#region src/hooks/useDataMissingRemediations.ts
/**
* @description A hook that parses a legal entities capability problems and maps its verification error codes to task specific remediation messages
*
* @param legalEntityId - ID of an exisiting LegalEntity
* @param problems - Capability problems on exisiting LegalEntity
* @returns A record of TaskTypes to a remediation message
*/
function useDataMissingRemediations({ legalEntityId, problems }) {
	const { t } = useTranslation("common");
	const decisionMakersRemediationMessage = useMemo(() => {
		const remediationCodes = problems[EntityTypes.LEGAL_ENTITY]?.[legalEntityId]?.missingData?.reduce((remediations, error) => {
			const remediation = DATA_MISSING_DECISION_MAKER_ERROR_CODE_MAPPING[error.code];
			return remediation ? [...remediations, remediation] : remediations;
		}, []);
		const uniqueRemediations = [...new Set(remediationCodes)];
		switch (uniqueRemediations?.length) {
			case void 0:
			case 0: return;
			case 1: return uniqueRemediations[0] ? t(($) => $[`remediationMessage_${uniqueRemediations[0]}`]) : t(($) => $["missingMultipleDecisionMakers"]);
			default: return t(($) => $["missingMultipleDecisionMakers"]);
		}
	}, [
		problems,
		t,
		legalEntityId
	]);
	return { remediationMessages: { [TaskTypes.DECISION_MAKER]: decisionMakersRemediationMessage } };
}
//#endregion
export { useDataMissingRemediations as t };
