function s(r) {
  return r.trim().replace(/^(https?:\/\/)?(www\.)?/, "");
}
function a(r) {
  const t = s(r);
  return t ? `https://${t}` : "";
}
function l(r) {
  return r.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
}
function c(r) {
  const t = s(r);
  if (!t)
    return !1;
  const o = "https://" + t;
  try {
    const e = new URL(o), n = e.hostname.split(".");
    return n.length < 2 || n[n.length - 1].length < 2 ? !1 : (e.search = "", e);
  } catch {
    return !1;
  }
}
export {
  c as i,
  a as n,
  s,
  l as t
};
