import { getQueryParam as c } from "./index-url-params.js";
const i = (e, t) => {
  if (!t)
    return;
  const n = c(t);
  return n && n && (e || (e = {}), e = {
    ...e
  }, n.toLowerCase() === "true" && (e[t] = !0), n.toLowerCase() === "1" && (e[t] = 1)), e;
}, y = (e) => {
  var f;
  if (e = i(e, "noCache"), e = i(e, "debug"), !e)
    return "";
  let t = "";
  const n = (f = Object.keys(e)) == null ? void 0 : f.length;
  if (!e || !n)
    return "";
  const u = Object.keys(e);
  for (const o of u)
    e[o] !== void 0 && (t && (t += "&"), t = t ? `${t + o}=${e[o]}` : `${o}=${encodeURIComponent(e[o] ?? "")}`);
  return t ? `?${t}` : "";
};
export {
  y as parseParams
};
