import { X as f, _ as $, F as a, jE as I, jF as v, N as E, O as T, w as b, Z as p, c2 as N, c3 as B, dA as D, az as H, U as M, a6 as y, G as S, af as w, a7 as r, a8 as s, Y as V, a9 as _, dB as R, dC as U, cd as j, cP as W, d8 as q, cR as L, aa as O, ac as z, dD as G, dE as k, aA as X, bS as Y } from "./603b75d9.js";
import Z, { useState as J, useRef as h, useEffect as K, useContext as x } from "react";
import { FormDataPropertyView as Q } from "./f9847c56.js";
import { getStyle as ee, textInputChildren as te, useTextInputProps as ae, TextInputBasicSection as le, TextInputInteractionSection as oe, TextInputValidationSection as ie, TextInputConfigs as ne, fixOldInputCompData as re } from "./41aba172.js";
import "react-dom";
const se = f(I)``;
function ue(t, e) {
  const {
    onChange: i,
    value: u,
    debounce: g = v,
    ...A
  } = t, [P, C] = J(u), d = h(0), n = h(i);
  n.current = i;
  const m = h(g > 0 ? $.debounce((l) => {
    var o;
    window.clearTimeout(d.current), d.current = window.setTimeout(() => d.current = 0, 100), (o = n.current) == null || o.call(n, l);
  }, g) : (l) => {
    var o;
    return (o = n.current) == null ? void 0 : o.call(n, l);
  }), F = (l) => {
    var o;
    C(l.target.value), (o = m.current) == null || o.call(m, l);
  };
  return K(() => {
    d.current || C(u);
  }, [u]), /* @__PURE__ */ a(se, {
    ref: e,
    value: P,
    placeholder: t.placeholder,
    onChange: (l) => F(l),
    ...A
  });
}
const ye = Z.forwardRef(ue), ce = f(ye)`
  box-shadow: ${(t) => {
  var e, i;
  return `${(e = t.$style) == null ? void 0 : e.boxShadow} ${(i = t.$style) == null ? void 0 : i.boxShadowColor}`;
}};
  ${(t) => t.$style && ee(t.$style)}
`, de = f.div`
  height: 100% !important;
  
  .ant-input { 
    height:100% !important;
  }

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

    &:hover {
      opacity: 0.9;
      color: ${(t) => t.$style.text};
    }
  }
`;
let c = function() {
  const t = {
    ...te,
    viewRef: E,
    allowClear: T,
    autoHeight: b(X, "fixed"),
    style: p(N, "style"),
    labelStyle: p(B, "labelStyle"),
    textAreaScrollBar: b(T, !1),
    inputFieldStyle: p(D, "inputFieldStyle"),
    animationStyle: p(H, "animationStyle")
  };
  return new M(t, (e) => {
    const [i, u] = ae(e);
    return e.label({
      required: e.required,
      inputFieldStyle: e.inputFieldStyle,
      children: /* @__PURE__ */ a(de, {
        $style: e.inputFieldStyle,
        children: /* @__PURE__ */ a(ce, {
          ...i,
          ref: e.viewRef,
          allowClear: e.allowClear,
          style: {
            height: "100% !important",
            resize: "vertical"
          },
          $style: e.inputFieldStyle
        })
      }),
      style: e.style,
      labelStyle: e.labelStyle,
      animationStyle: e.animationStyle,
      showValidationWhenEmpty: e.showValidationWhenEmpty,
      ...u
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ y(S, {
    children: [/* @__PURE__ */ a(le, {
      ...e
    }), /* @__PURE__ */ a(Q, {
      ...e
    }), ["layout", "both"].includes(x(w).editorModeStatus) && e.label.getPropertyView(), ["logic", "both"].includes(x(w).editorModeStatus) && /* @__PURE__ */ y(S, {
      children: [/* @__PURE__ */ a(oe, {
        ...e
      }), /* @__PURE__ */ y(r, {
        name: s.layout,
        children: [e.autoHeight.getPropertyView(), !e.autoHeight.getView() && e.textAreaScrollBar.propertyView({
          label: V("prop.textAreaScrollBar")
        }), _(e)]
      }), /* @__PURE__ */ y(r, {
        name: s.advanced,
        children: [R(e), U(e)]
      }), /* @__PURE__ */ a(ie, {
        ...e
      })]
    }), ["layout", "both"].includes(x(w).editorModeStatus) && /* @__PURE__ */ y(S, {
      children: [/* @__PURE__ */ a(r, {
        name: s.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: s.labelStyle,
        children: e.labelStyle.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: s.inputFieldStyle,
        children: e.inputFieldStyle.getPropertyView()
      }), /* @__PURE__ */ a(r, {
        name: s.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).build();
}();
c = class extends c {
  autoHeight() {
    return this.children.autoHeight.getView();
  }
};
c = Y(c, re);
const pe = j(c, W([q, L])), fe = O(pe, [new z("value", V("export.inputValueDesc")), G, k, ...ne]);
export {
  fe as TextAreaComp
};
