import e from "../../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import * as u from "react";
import k from "../../../classnames/index.mjs";
import { composeRef as B } from "../../../rc-util/es/ref.mjs";
import { warning as q } from "../../../rc-util/es/warning.mjs";
var z = function(o, y) {
  var i, b = o.prefixCls, l = o.id, h = o.inputElement, x = o.disabled, D = o.tabIndex, f = o.autoFocus, v = o.autoComplete, s = o.editable, E = o.activeDescendantId, I = o.value, S = o.maxLength, N = o.onKeyDown, K = o.onMouseDown, M = o.onChange, O = o.onPaste, L = o.onCompositionStart, P = o.onCompositionEnd, r = o.open, R = o.attrs, a = h || /* @__PURE__ */ u.createElement("input", null), d = a, F = d.ref, t = d.props, m = t.onKeyDown, c = t.onChange, C = t.onMouseDown, g = t.onCompositionStart, w = t.onCompositionEnd, j = t.style;
  return q(!("maxLength" in a.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."), a = /* @__PURE__ */ u.cloneElement(a, e(e(e({
    type: "search"
  }, t), {}, {
    // Override over origin props
    id: l,
    ref: B(y, F),
    disabled: x,
    tabIndex: D,
    autoComplete: v || "off",
    autoFocus: f,
    className: k("".concat(b, "-selection-search-input"), (i = a) === null || i === void 0 || (i = i.props) === null || i === void 0 ? void 0 : i.className),
    role: "combobox",
    "aria-expanded": r || !1,
    "aria-haspopup": "listbox",
    "aria-owns": "".concat(l, "_list"),
    "aria-autocomplete": "list",
    "aria-controls": "".concat(l, "_list"),
    "aria-activedescendant": r ? E : void 0
  }, R), {}, {
    value: s ? I : "",
    maxLength: S,
    readOnly: !s,
    unselectable: s ? null : "on",
    style: e(e({}, j), {}, {
      opacity: s ? null : 0
    }),
    onKeyDown: function(n) {
      N(n), m && m(n);
    },
    onMouseDown: function(n) {
      K(n), C && C(n);
    },
    onChange: function(n) {
      M(n), c && c(n);
    },
    onCompositionStart: function(n) {
      L(n), g && g(n);
    },
    onCompositionEnd: function(n) {
      P(n), w && w(n);
    },
    onPaste: O
  })), a;
}, A = /* @__PURE__ */ u.forwardRef(z);
A.displayName = "Input";
export {
  A as default
};
