import { useState as y, useEffect as $, useContext as s } from "react";
import { a3 as T, dE as F, S as H, V as O, aH as k, a5 as v, dF as R, aG as I, eM as W, eZ as q, a9 as B, dx as J, U as j, e_ as z, H as n, e$ as N, eU as A, ad as r, I as m, ae as o, af as l, a4 as i, am as c, co as U, c0 as _, ag as G, dJ as K, cp as X, dL as Z, dM as Q, ct as Y, d6 as p, dA as ee, d8 as te, ah as ae, aj as u, dN as ne, dO as ie, c3 as oe, cr as le, cE as re, cF as de, cD as se, eX as ce, eV as ue } from "./56c67d3b.js";
import "react-dom";
const ye = T.div`
  box-sizing:border-box;
  .rc-textarea {
    background-color:${(a) => a.$style.background};
    padding:${(a) => a.$style.padding};
    text-transform:${(a) => a.$style.textTransform};
    text-decoration:${(a) => a.$style.textDecoration};
    margin: 0px 3px 0px 3px !important;
  }

  .ant-input-clear-icon {
    opacity: 0.45;
    color: ${(a) => a.$style.text};
    top: 10px;

    &:hover {
      opacity: 0.65;
      color: ${(a) => a.$style.text};
    }
  }
`, me = [re, de, se, ce, ue];
let d = function() {
  const a = {
    ...F,
    viewRef: H,
    allowClear: O,
    autoHeight: k,
    style: v(R, "style"),
    animationStyle: v(I, "animationStyle"),
    mentionList: W(q, {
      "@": ["John Doe", "Jane Doe", "Michael Smith", "Emily Davis", "Robert Johnson", "Patricia Brown", "William Jones", "Jennifer Miller", "David Wilson", "Linda Moore"],
      "#": ["#lowcode", "#automation", "#appbuilder", "#nocode", "#workflow", "#draganddrop", "#rapiddevelopment", "#digitaltransformation", "#integration", "#api"]
    }),
    onEvent: B(me),
    invalid: J("invalid")
  };
  return new j(a, (e) => {
    const {
      mentionList: g
    } = e, [h, x] = y({}), [f, b] = y(!1), [w, S] = y("@"), C = (t, D) => {
      S(D);
    }, V = (t) => {
      e.value.onChange(t), e.onEvent("change");
    }, E = (t) => {
      t.shiftKey && (t.preventDefault(), e.onEvent("submit"));
    }, P = (t) => {
      e.onEvent("mention");
    }, M = (t) => t.hasOwnProperty("validateStatus") && t.validateStatus === "error" ? "error" : "", L = () => ({
      value: {
        value: e.value.value
      },
      required: e.required,
      minLength: (e == null ? void 0 : e.minLength) ?? 0,
      maxLength: (e == null ? void 0 : e.maxLength) ?? 0,
      validationType: e.validationType,
      regex: e.regex,
      customRule: e.customRule
    });
    return $(() => {
      if (f) {
        const t = z(L());
        x(t), e.invalid.onChange(t.validateStatus !== "");
      }
    }, [e.value.value, e.required, e == null ? void 0 : e.minLength, e == null ? void 0 : e.maxLength, e.validationType, e.regex, e.customRule]), e.label({
      required: e.required,
      children: /* @__PURE__ */ n(ye, {
        $style: e.style,
        children: /* @__PURE__ */ n(N, {
          theme: {
            token: {
              colorBgContainer: e.style.background,
              colorBorder: e.style.border,
              borderRadius: parseInt(e.style.radius),
              colorText: e.style.text,
              colorPrimary: e.style.accent
            }
          },
          children: /* @__PURE__ */ n(A, {
            prefix: Object.keys(g),
            onFocus: () => {
              b(!0), e.onEvent("focus");
            },
            onBlur: () => e.onEvent("blur"),
            onPressEnter: E,
            onSearch: C,
            onChange: V,
            onSelect: P,
            placeholder: e.placeholder,
            value: e.value.value,
            disabled: e.disabled,
            status: M(h),
            options: (g[w] || []).map((t) => ({
              key: t,
              value: t,
              label: t
            })),
            autoSize: e.autoHeight,
            style: {
              height: "100%",
              maxHeight: "100%",
              resize: "none",
              // padding: props.style.padding,
              fontStyle: e.style.fontStyle,
              fontFamily: e.style.fontFamily,
              borderWidth: e.style.borderWidth,
              fontWeight: e.style.textWeight,
              fontSize: e.style.textSize
            },
            readOnly: e.readOnly
          })
        })
      }),
      style: e.style,
      animationStyle: e.animationStyle,
      ...h
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ r(m, {
    children: [/* @__PURE__ */ r(o, {
      name: l.basic,
      children: [e.value.propertyView({
        label: i("prop.defaultValue")
      }), e.placeholder.propertyView({
        label: i("prop.placeholder")
      }), ["logic", "both"].includes(s(c).editorModeStatus) && e.mentionList.propertyView({
        label: i("mention.mentionList")
      })]
    }), /* @__PURE__ */ n(U, {
      ...e
    }), ["layout", "both"].includes(s(c).editorModeStatus) && e.label.getPropertyView(), ["logic", "both"].includes(s(c).editorModeStatus) && /* @__PURE__ */ r(m, {
      children: [/* @__PURE__ */ r(o, {
        name: l.interaction,
        children: [e.onEvent.getPropertyView(), _(e)]
      }), /* @__PURE__ */ n(o, {
        name: l.layout,
        children: G(e)
      }), /* @__PURE__ */ n(o, {
        name: l.advanced,
        children: K(e)
      }), /* @__PURE__ */ r(o, {
        name: l.validation,
        children: [X(e), e.validationType.propertyView({
          label: i("prop.textType")
        }), Z(e), Q(e), e.customRule.propertyView({})]
      })]
    }), ["layout", "both"].includes(s(c).editorModeStatus) && /* @__PURE__ */ r(m, {
      children: [/* @__PURE__ */ n(o, {
        name: l.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ n(o, {
        name: l.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).build();
}();
d = class extends d {
  autoHeight() {
    return this.children.autoHeight.getView();
  }
};
d = oe(d, le);
const ge = Y(d, p([ee, te])), fe = ae(ge, [new u("value", i("export.inputValueDesc")), ne, ie, new u("invalid", i("export.invalidDesc")), new u("hidden", i("export.hiddenDesc")), new u("disabled", i("export.disabledDesc"))]);
export {
  fe as MentionComp
};
