import { useCallback as n } from "react";
const f = () => {
  const o = n(
    (e, s, t = "*") => {
      s?.postMessage(e, t);
    },
    []
  ), a = n((e, s = "*") => {
    parent !== window && o(e, parent, s);
  }, []), r = n((e, s = "*") => {
    top !== window && o(e, top, s);
  }, []), c = n((e, s = "*") => {
    for (const t of document.querySelectorAll("iframe"))
      o(e, t.contentWindow, s);
  }, []);
  return { sendMessage: o, sendMessageToParent: a, sendMessageToTop: r, sendMessageToAllIframes: c };
};
export {
  f as default
};
//# sourceMappingURL=usePostMessageSender.js.map
