function a(e) {
  return !e || !Object.keys(e).length ? "" : `?${Object.entries(e).map((r) => r.map((n) => encodeURIComponent(n)).join("=")).join("&")}`;
}
function o(e, t) {
  try {
    const r = new URL(e);
    return t.forEach((n) => {
      r.searchParams.delete(n);
    }), r.hash === "#." && (r.hash = ""), r.href;
  } catch {
    return e;
  }
}
function s(e) {
  return new URLSearchParams(window.location.search).get(e);
}
function c(e, t = window.location.href) {
  const r = o(t, e);
  window.history.replaceState(null, "", r), window.seamlessRouter && (window.seamlessRouter.currentUrl = new URL(r));
}
function u(e) {
  return /^(?:[a-z]+:)?\/\//i.test(e);
}
export {
  a as generateQueryParams,
  s as getQueryParameter,
  u as isAbsoluteUrl,
  c as removeQueryParametersForSeamlessRouter,
  o as removeQueryParametersFromUrl
};
//# sourceMappingURL=url.mjs.map
