;
{
  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] = "f8a93941-6b00-4dc4-9737-c9cd77959afb", e._sentryDebugIdIdentifier = "sentry-dbid-f8a93941-6b00-4dc4-9737-c9cd77959afb");
  } catch (e) {
  }
}
;
import { useQuery, skipToken } from "@tanstack/preact-query";
import { b as useApiContext, k as httpGet, bf as crossBorderMapping, bg as payoutComponentKeyMapping } from "./StoreProvider-CqQrndhS.js";
import { m as mapWith } from "./utils-DNSfZiio.js";
const getTransferInstrument = async (legalEntityId, baseUrl, transferInstrumentId) => {
  return httpGet({
    baseUrl,
    path: `legalEntities/${legalEntityId}/transferInstruments/${transferInstrumentId}`
  });
};
const 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
  });
};
const mapTransferInstrumentToPayoutAccount = (transferInstrument, enabledCrossBorderPayouts) => {
  const mappingOverride = enabledCrossBorderPayouts ? crossBorderMapping : {};
  return mapWith(transferInstrument, { ...payoutComponentKeyMapping, ...mappingOverride });
};
export {
  mapTransferInstrumentToPayoutAccount as m,
  useTransferInstrument as u
};
