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] = "5a88cef6-0cac-47c6-b334-b4c0a380a8e5", e._sentryDebugIdIdentifier = "sentry-dbid-5a88cef6-0cac-47c6-b334-b4c0a380a8e5");
} catch (e) {}
import { n as httpGet, s as useApiContext } from "./http-CHTzpXCd.js";
import { b as crossBorderMapping, x as payoutComponentKeyMapping } from "./processCapabilities-CDSEJpB8.js";
import { a as mapWith } from "./utils--gwzjjeS.js";
import { skipToken, useQuery } from "@tanstack/preact-query";
//#region src/api/transferInstruments/useTransferInstrument.ts
var getTransferInstrument = async (legalEntityId, baseUrl, transferInstrumentId) => {
	return httpGet({
		baseUrl,
		path: `legalEntities/${legalEntityId}/transferInstruments/${transferInstrumentId}`
	});
};
/**
* Gets a single transfer instrument associated with a legal entity
* @param transferInstrumentId ID of transfer instrument
* @param options additional options passed to Tanstack Query, eg; refetchInterval for polling
*/
var useTransferInstrument = (transferInstrumentId, options) => {
	const { rootLegalEntityId, baseUrl } = useApiContext();
	return useQuery({
		queryKey: transferInstrumentId === skipToken ? [] : ["transferInstrument", transferInstrumentId],
		queryFn: transferInstrumentId === skipToken ? skipToken : () => getTransferInstrument(rootLegalEntityId.value, baseUrl.value, transferInstrumentId),
		...options
	});
};
//#endregion
//#region src/components/BankAccount/mapping/mapTransferInstrumentToPayoutAccount.ts
/**
* Easy to use function for mapping transferInstrument response to payout account details component data
* @param transferInstrument - a transferInstrument the same as found in API response
* @returns a Payout Details person data
*/
var mapTransferInstrumentToPayoutAccount = (transferInstrument, enabledCrossBorderPayouts) => {
	const mappingOverride = enabledCrossBorderPayouts ? crossBorderMapping : {};
	return mapWith(transferInstrument, {
		...payoutComponentKeyMapping,
		...mappingOverride
	});
};
//#endregion
export { useTransferInstrument as n, mapTransferInstrumentToPayoutAccount as t };
