import { b9 as w, iB as V, c1 as v, V as a, iC as A, bf as I, bv as $, w as E, cv as N, bB as C, dl as D, bO as H, U as M, P as i, bh as m, bg as h, bi as d, bj as y, bl as B, dm as _, dn as U, bY as q, cG as F, bn as R, bo as j, a0 as L, dp as O, dq as G, bA as W } from "./684d2f28.js";
import k, { useState as z, useRef as b, useEffect as Y, useContext as x } from "react";
import { FormDataPropertyView as J } from "./00dac55d.js";
import { getStyle as K, textInputChildren as Q, useTextInputProps as X, TextInputBasicSection as Z, TextInputInteractionSection as ee, TextInputValidationSection as te, TextInputConfigs as ae, fixOldInputCompData as oe } from "./0c4ef413.js";
import { focusWithOptions as re, blurMethod as le } from "./d6402597.js";
import "react-dom";
const ne = w(V)``;
function ie(t, e) {
  const {
    onChange: u,
    value: n,
    debounce: f = A,
    ...T
  } = t, [S, g] = z(n), c = b(0), l = b(u);
  l.current = u;
  const p = b(f > 0 ? v.debounce((o) => {
    var r;
    window.clearTimeout(c.current), c.current = window.setTimeout(() => c.current = 0, 100), (r = l.current) == null || r.call(l, o);
  }, f) : (o) => {
    var r;
    return (r = l.current) == null ? void 0 : r.call(l, o);
  }), P = (o) => {
    var r;
    g(o.target.value), (r = p.current) == null || r.call(p, o);
  };
  return Y(() => {
    c.current || g(n);
  }, [n]), /* @__PURE__ */ a(ne, {
    ref: e,
    value: S,
    placeholder: t.placeholder,
    onChange: (o) => P(o),
    ...T
  });
}
const se = k.forwardRef(ie), ue = w(se)`
  ${(t) => t.$style && K(t.$style)}
`, ce = w.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 s = function() {
  const t = {
    ...Q,
    viewRef: I,
    allowClear: $,
    autoHeight: E(N, "fixed"),
    style: C(D),
    labelStyle: C(H)
  };
  return new M(t, (e) => {
    const [u, n] = X(e);
    return e.label({
      required: e.required,
      children: /* @__PURE__ */ a(ce, {
        $style: e.style,
        children: /* @__PURE__ */ a(ue, {
          ...u,
          ref: e.viewRef,
          allowClear: e.allowClear,
          style: {
            height: "100% !important",
            resize: "vertical"
          },
          $style: e.style
        })
      }),
      style: e.style,
      labelStyle: e.labelStyle,
      ...n
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ i(m, {
    children: [/* @__PURE__ */ a(Z, {
      ...e
    }), /* @__PURE__ */ a(J, {
      ...e
    }), ["layout", "both"].includes(x(h).editorModeStatus) && e.label.getPropertyView(), ["logic", "both"].includes(x(h).editorModeStatus) && /* @__PURE__ */ i(m, {
      children: [/* @__PURE__ */ a(ee, {
        ...e
      }), /* @__PURE__ */ i(d, {
        name: y.layout,
        children: [e.autoHeight.getPropertyView(), B(e)]
      }), /* @__PURE__ */ i(d, {
        name: y.advanced,
        children: [_(e), U(e)]
      }), /* @__PURE__ */ a(te, {
        ...e
      })]
    }), ["layout", "both"].includes(x(h).editorModeStatus) && /* @__PURE__ */ i(m, {
      children: [/* @__PURE__ */ a(d, {
        name: y.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ a(d, {
        name: y.labelStyle,
        children: e.labelStyle.getPropertyView()
      })]
    })]
  })).build();
}();
s = class extends s {
  autoHeight() {
    return this.children.autoHeight.getView();
  }
};
s = W(s, oe);
const de = q(s, F([re, le])), we = R(de, [new j("value", L("export.inputValueDesc")), O, G, ...ae]);
export {
  we as TextAreaComp
};
