import { a3 as u, w as b, a4 as a, X as h, bY as w, bX as y, c3 as C, a5 as f, c4 as S, aG as I, P as x, S as k, U as v, c5 as s, H as n, b_ as V, ad as i, I as d, ae as o, af as l, am as r, c0 as P, ag as E, c6 as M, c7 as T, ah as B, aj as m, c1 as j, c8 as D } from "./56c67d3b.js";
import { useContext as c } from "react";
import "react-dom";
const F = u(D)`
  ${(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 L(t) {
  return t && t.hasOwnProperty("color") ? {
    text: t.color
  } : t;
}
const R = function() {
  const t = {
    text: b(h, a("link.link")),
    onEvent: w,
    disabled: y,
    loading: y,
    style: C(f(S, "style"), L),
    animationStyle: f(I, "animationStyle"),
    prefixIcon: x,
    suffixIcon: x,
    viewRef: k
  };
  return new v(t, (e) => {
    const g = s(e.prefixIcon) || !!e.text || s(e.suffixIcon);
    return /* @__PURE__ */ n(V, {
      $disabled: e.disabled,
      children: /* @__PURE__ */ n(F, {
        $animationStyle: e.animationStyle,
        ref: e.viewRef,
        $style: e.style,
        loading: e.loading,
        disabled: e.disabled,
        onClick: () => e.onEvent("click"),
        type: "link",
        children: g && /* @__PURE__ */ i("span", {
          children: [s(e.prefixIcon) && /* @__PURE__ */ n($, {
            children: e.prefixIcon
          }), !!e.text && e.text, s(e.suffixIcon) && /* @__PURE__ */ n($, {
            children: e.suffixIcon
          })]
        })
      })
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ i(d, {
    children: [/* @__PURE__ */ n(o, {
      name: l.basic,
      children: e.text.propertyView({
        label: a("text")
      })
    }), (c(r).editorModeStatus === "logic" || c(r).editorModeStatus === "both") && /* @__PURE__ */ i(d, {
      children: [/* @__PURE__ */ i(o, {
        name: l.interaction,
        children: [e.onEvent.getPropertyView(), P(e), E(e), M(e)]
      }), /* @__PURE__ */ i(o, {
        name: l.advanced,
        children: [e.prefixIcon.propertyView({
          label: a("button.prefixIcon")
        }), e.suffixIcon.propertyView({
          label: a("button.suffixIcon")
        })]
      })]
    }), (c(r).editorModeStatus === "layout" || c(r).editorModeStatus === "both") && /* @__PURE__ */ i(d, {
      children: [/* @__PURE__ */ n(o, {
        name: l.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ n(o, {
        name: l.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).setExposeMethodConfigs(T).build();
}(), z = B(R, [new m("text", a("link.textDesc")), new m("loading", a("link.loadingDesc")), ...j]);
export {
  z as LinkComp
};
