import { removeEvent } from "../host-binding-events/index.js";
const getHostAppData = (action, resolve) => (event) => {
  if (event.data.id === "host-app-data") {
    action(event.data);
    removeEvent(window, "message", getHostAppData());
  }
  resolve();
};
const sendMessageToHost = (message, hostedAppUrl = document.referrer) => {
  window.parent.postMessage(message, hostedAppUrl);
};
export {
  getHostAppData,
  sendMessageToHost
};
