import { defineComponent as H, computed as v, resolveComponent as O, openBlock as a, createElementBlock as l, Fragment as m, normalizeClass as s, renderSlot as i, createElementVNode as c, withModifiers as y, createBlock as S, withCtx as E } from "vue";
import { C as p } from "./base-PQGakkrl.js";
const I = ["href", "target"], w = ["href"], N = /* @__PURE__ */ H({
  name: "ClLink",
  __name: "Index",
  props: {
    wavesColor: {
      type: String,
      default: "black",
      validator: (t) => ["black", "white"].indexOf(t) !== -1
    },
    url: {
      type: [String, Object],
      default: ""
    },
    className: {
      type: String,
      default: ""
    },
    disabled: {
      type: Boolean,
      default: !1
    },
    isUnderline: {
      type: Boolean,
      default: !1
    },
    isLight: {
      type: Boolean,
      default: !1
    },
    isWaves: {
      type: Boolean,
      default: !1
    },
    isTargetBlank: {
      type: Boolean,
      default: !1
    },
    isOutside: {
      type: Boolean,
      default: !1
    },
    isStopPropagation: {
      type: Boolean,
      default: !1
    }
  },
  emits: ["onClick", "onHoverIn", "onHoverOut"],
  setup(t, { emit: g }) {
    const o = t, f = g, h = v(() => !p.isEmpty(o.url)), n = v(() => {
      const e = {
        "btn-link": !0,
        "btn-link-disabled": o.disabled,
        "always-light": o.isLight,
        "underline-none": !o.isUnderline
      };
      return p.isEmpty(o.className) || o.className?.split(" ").forEach((k) => {
        p.isEmpty(k) || (e[k] = !0);
      }), e;
    }), b = (e) => {
      f("onClick", e);
    }, B = (e) => {
      f("onHoverIn", e);
    }, C = (e) => {
      f("onHoverOut", e);
    }, r = (e) => {
      o.disabled || (b(e), o.isStopPropagation && (e.preventDefault(), e.stopPropagation()));
    }, u = (e) => {
      o.disabled || B(e);
    }, d = (e) => {
      o.disabled || C(e);
    };
    return (e, k) => {
      const M = O("router-link");
      return t.url && h.value ? (a(), l(m, { key: 0 }, [
        t.disabled ? (a(), l("span", {
          key: 0,
          class: s(n.value)
        }, [
          i(e.$slots, "default")
        ], 2)) : (a(), l(m, { key: 1 }, [
          t.isOutside ? (a(), l("a", {
            key: 0,
            class: s(n.value),
            href: t.url.toString(),
            target: t.isTargetBlank ? "_blank" : "",
            onClick: r,
            onMouseenter: u,
            onMouseleave: d
          }, [
            c("span", null, [
              i(e.$slots, "default")
            ])
          ], 42, I)) : (a(), l(m, { key: 1 }, [
            t.isTargetBlank ? (a(), l("a", {
              key: 0,
              class: s(n.value),
              href: t.url.toString(),
              target: "_blank",
              onClick: y(r, ["stop"]),
              onMouseenter: u,
              onMouseleave: d
            }, [
              c("span", null, [
                i(e.$slots, "default")
              ])
            ], 42, w)) : (a(), S(M, {
              key: 1,
              class: s(n.value),
              to: t.url,
              onClick: y(r, ["stop"])
            }, {
              default: E(() => [
                c("span", {
                  onMouseenter: u,
                  onMouseleave: d
                }, [
                  i(e.$slots, "default")
                ], 32)
              ]),
              _: 3
            }, 8, ["class", "to"]))
          ], 64))
        ], 64))
      ], 64)) : (a(), l("a", {
        key: 1,
        class: s(n.value),
        href: "javascript:",
        onClick: r,
        onMouseenter: u,
        onMouseleave: d
      }, [
        c("span", null, [
          i(e.$slots, "default")
        ])
      ], 34));
    };
  }
});
export {
  N as _
};
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-inXYfqWx.js.map
