import { ref as o, computed as s, openBlock as i, createElementBlock as c, createBaseVNode as n, toDisplayString as u, createCommentVNode as d } from "./composables-Ci32s3jE.js";
const m = ["href"], p = { class: "mr-1px ml-8px" }, h = /* @__PURE__ */ n("div", { class: "i-la-external-link-alt mx-1" }, null, -1), g = {
  __name: "UiLink",
  props: {
    url: { type: [String, Object], default: "" },
    icon: { type: [Boolean, String], default: !0 }
  },
  setup(a) {
    const r = a, e = o(!1), l = s(() => {
      if (r.url)
        try {
          let t = new URL(r.url);
          return e.value = t, t.hostname;
        } catch {
          return e.value = null, "incorrect link";
        }
      else
        return "";
    });
    return (t, _) => l.value ? (i(), c("a", {
      key: 0,
      class: "underline flex items-center bg-light-300 dark-bg-dark-300 rounded-xl p-1 shadow-sm hover-shadow-lg transition duration-200ms hover-bg-light-5",
      href: e.value,
      target: "_blank"
    }, [
      n("div", p, u(l.value), 1),
      h
    ], 8, m)) : d("", !0);
  }
};
export {
  g as default
};
//# sourceMappingURL=UiLink-Br7HNMD9.js.map
