import { I as CONSOLE_URL, J as WEBAPP_URL, K as WEBSITE_URL } from "./user--mpkKOwW.js";
const getSafeRedirectUrl = (url = "") => {
  if (!url) {
    return null;
  }
  if (url.search(/^https?:\/\//) === -1) {
    throw new Error("Pass an absolute URL");
  }
  const urlParsed = new URL(url);
  if (![CONSOLE_URL, WEBAPP_URL, WEBSITE_URL].some((u) => new URL(u).origin === urlParsed.origin)) {
    url = `${WEBAPP_URL}/`;
  }
  return url;
};
export {
  getSafeRedirectUrl as g
};
