import { b9 as m, w as $, a0 as i, ba as g, bc as h, bd as f, bA as C, bB as w, bC as I, be as x, bf as k, U as v, bD as a, V as n, P as o, bh as c, bi as l, bj as r, bg as s, bk as V, bl as S, bm as E, bn as P, bo as y, bp as M, bE as B } from "./684d2f28.js";
import { ButtonCompWrapper as D, buttonRefMethods as T } from "./926d8ea1.js";
import { useContext as d } from "react";
import "react-dom";
import "./d6402597.js";
const j = m(B)`
  ${(t) => `
    color: ${t.$style.text};
    margin: ${t.$style.margin};
    padding: ${t.$style.padding};
    font-size: ${t.$style.textSize};
    font-style:${t.$style.fontStyle};
    font-family:${t.$style.fontFamily};
    font-weight:${t.$style.textWeight};
    border: ${t.$style.borderWidth} solid ${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-color: ${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;
    }
  }
`, b = m.span`
  display: flex;
`;
function L(t) {
  return t && t.hasOwnProperty("color") ? {
    text: t.color
  } : t;
}
const R = function() {
  const t = {
    text: $(g, i("link.link")),
    onEvent: h,
    disabled: f,
    loading: f,
    style: C(w(I), L),
    prefixIcon: x,
    suffixIcon: x,
    viewRef: k
  };
  return new v(t, (e) => {
    const u = a(e.prefixIcon) || !!e.text || a(e.suffixIcon);
    return /* @__PURE__ */ n(D, {
      disabled: e.disabled,
      children: /* @__PURE__ */ n(j, {
        ref: e.viewRef,
        $style: e.style,
        loading: e.loading,
        disabled: e.disabled,
        onClick: () => e.onEvent("click"),
        type: "link",
        children: u && /* @__PURE__ */ o("span", {
          children: [a(e.prefixIcon) && /* @__PURE__ */ n(b, {
            children: e.prefixIcon
          }), !!e.text && e.text, a(e.suffixIcon) && /* @__PURE__ */ n(b, {
            children: e.suffixIcon
          })]
        })
      })
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ o(c, {
    children: [/* @__PURE__ */ n(l, {
      name: r.basic,
      children: e.text.propertyView({
        label: i("text")
      })
    }), (d(s).editorModeStatus === "logic" || d(s).editorModeStatus === "both") && /* @__PURE__ */ o(c, {
      children: [/* @__PURE__ */ o(l, {
        name: r.interaction,
        children: [e.onEvent.getPropertyView(), V(e), S(e), E(e)]
      }), /* @__PURE__ */ o(l, {
        name: r.advanced,
        children: [e.prefixIcon.propertyView({
          label: i("button.prefixIcon")
        }), e.suffixIcon.propertyView({
          label: i("button.suffixIcon")
        })]
      })]
    }), (d(s).editorModeStatus === "layout" || d(s).editorModeStatus === "both") && /* @__PURE__ */ n(c, {
      children: /* @__PURE__ */ n(l, {
        name: r.style,
        children: e.style.getPropertyView()
      })
    })]
  })).setExposeMethodConfigs(T).build();
}(), U = P(R, [new y("text", i("link.textDesc")), new y("loading", i("link.loadingDesc")), ...M]);
export {
  U as LinkComp
};
