import { X as u, w as g, Y as a, S as h, bH as w, bI as c, bS as C, Z as f, bT as S, az as I, L as m, N as k, U as v, bU as r, F as n, a6 as i, G as y, a7 as o, a8 as l, af as s, bJ as V, a9 as P, bK as E, aa as M, ac as x, bL as T, bV as L } from "./603b75d9.js";
import { ButtonCompWrapper as B, buttonRefMethods as F } from "./26dac75c.js";
import { useContext as d } from "react";
import "react-dom";
const D = u(L)`
  ${(t) => t.$animationStyle}
  ${(t) => `
    color: ${t.$style.text};
    rotate: ${t.$style.rotation};
    margin: ${t.$style.margin};
    padding: ${t.$style.padding};
    font-size: ${t.$style.textSize};
    font-style:${t.$style.fontStyle};
    ${t.$style.fontFamily && `font-family: ${t.$style.fontFamily}`};
    font-weight:${t.$style.textWeight};
    border: ${t.$style.borderWidth} ${t.$style.borderStyle} ${t.$style.border};
    border-radius:${t.$style.radius ? t.$style.radius : "0px"};
    text-transform:${t.$style.textTransform ? t.$style.textTransform : ""};
    text-decoration:${t.$style.textDecoration ? t.$style.textDecoration : ""} !important;
    background: ${t.$style.background};
    &:hover {
      color: ${t.$style.hoverText} !important;
    }
    &:active {
      color: ${t.$style.activeText} !important;
    }
  `}

  &.ant-btn { 
    display: inline-flex;
    align-items: center;
    > span {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 1px;
    }
  }
`, $ = u.span`
  display: flex;
`;
function N(t) {
  return t && t.hasOwnProperty("color") ? {
    text: t.color
  } : t;
}
const R = function() {
  const t = {
    text: g(h, a("link.link")),
    onEvent: w,
    disabled: c,
    loading: c,
    style: C(f(S, "style"), N),
    animationStyle: f(I, "animationStyle"),
    prefixIcon: m,
    suffixIcon: m,
    viewRef: k
  };
  return new v(t, (e) => {
    const b = r(e.prefixIcon) || !!e.text || r(e.suffixIcon);
    return /* @__PURE__ */ n(B, {
      $disabled: e.disabled,
      children: /* @__PURE__ */ n(D, {
        $animationStyle: e.animationStyle,
        ref: e.viewRef,
        $style: e.style,
        loading: e.loading,
        disabled: e.disabled,
        onClick: () => e.onEvent("click"),
        type: "link",
        children: b && /* @__PURE__ */ i("span", {
          children: [r(e.prefixIcon) && /* @__PURE__ */ n($, {
            children: e.prefixIcon
          }), !!e.text && e.text, r(e.suffixIcon) && /* @__PURE__ */ n($, {
            children: e.suffixIcon
          })]
        })
      })
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ i(y, {
    children: [/* @__PURE__ */ n(o, {
      name: l.basic,
      children: e.text.propertyView({
        label: a("text")
      })
    }), (d(s).editorModeStatus === "logic" || d(s).editorModeStatus === "both") && /* @__PURE__ */ i(y, {
      children: [/* @__PURE__ */ i(o, {
        name: l.interaction,
        children: [e.onEvent.getPropertyView(), V(e), P(e), E(e)]
      }), /* @__PURE__ */ i(o, {
        name: l.advanced,
        children: [e.prefixIcon.propertyView({
          label: a("button.prefixIcon")
        }), e.suffixIcon.propertyView({
          label: a("button.suffixIcon")
        })]
      })]
    }), (d(s).editorModeStatus === "layout" || d(s).editorModeStatus === "both") && /* @__PURE__ */ i(y, {
      children: [/* @__PURE__ */ n(o, {
        name: l.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ n(o, {
        name: l.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).setExposeMethodConfigs(F).build();
}(), U = M(R, [new x("text", a("link.textDesc")), new x("loading", a("link.loadingDesc")), ...T]);
export {
  U as LinkComp
};
