;
{
  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] = "e6f9ba7a-1bf8-4e1f-97d8-0224dd9cc0f6", e._sentryDebugIdIdentifier = "sentry-dbid-e6f9ba7a-1bf8-4e1f-97d8-0224dd9cc0f6");
  } catch (e) {
  }
}
;
import { useQueryClient } from "@tanstack/preact-query";
import { useCallback, useContext } from "preact/hooks";
import { a3 as createLogger, b as useApiContext, af as ToastContext } from "./StoreProvider-CqQrndhS.js";
const logger = createLogger();
const QUERIES_TO_INVALIDATE_WHEN_ROOT_LE_IS_INVALIDATED = [
  "businessLines",
  "onboardingStatus",
  "pciStatus",
  "pciQuestionnaireList",
  "scenarios",
  "taskStatus",
  "taskTypes",
  "taxClassification",
  "termsOfServiceAcceptanceInfos",
  "termsOfServiceStatus",
  "transferInstruments"
];
const useInvalidateRootLegalEntity = () => {
  const queryClient = useQueryClient();
  const { rootLegalEntityId } = useApiContext();
  return useCallback(
    () => Promise.all([
      queryClient.invalidateQueries({
        queryKey: ["legalEntity", rootLegalEntityId.value]
      }),
      queryClient.invalidateQueries({
        predicate: ({ queryKey }) => QUERIES_TO_INVALIDATE_WHEN_ROOT_LE_IS_INVALIDATED.includes(queryKey[0])
      })
    ]).catch(logger.error),
    [rootLegalEntityId.value, queryClient]
  );
};
function useToastContext() {
  const context = useContext(ToastContext);
  return context;
}
export {
  useInvalidateRootLegalEntity as a,
  useToastContext as u
};
