import t from "./index-extends.js";
import * as p from "react";
import { onSpaceOrEnter as T } from "./index-utils11.js";
import { useLocaleText as b, useUtils as C } from "./index-useUtils.js";
import { getDisplayDate as v } from "./index-text-field-helper.js";
import w from "./index-useEventCallback2.js";
const K = /* @__PURE__ */ p.forwardRef(function(e, s) {
  const {
    disabled: r,
    getOpenDialogAriaText: o,
    inputFormat: c,
    InputProps: n,
    inputRef: d,
    label: m,
    openPicker: a,
    rawValue: l,
    renderInput: P,
    TextFieldProps: D = {},
    validationError: f,
    className: O
  } = e, g = b(), x = o ?? g.openDatePickerDialogue, i = C(), y = p.useMemo(() => t({}, n, {
    readOnly: !0
  }), [n]), k = v(i, l, c), u = w((I) => {
    I.stopPropagation(), a();
  });
  return P(t({
    label: m,
    disabled: r,
    ref: s,
    inputRef: d,
    error: f,
    InputProps: y,
    className: O
  }, !e.readOnly && !e.disabled && {
    onClick: u
  }, {
    inputProps: t({
      disabled: r,
      readOnly: !0,
      "aria-readonly": !0,
      "aria-label": x(l, i),
      value: k
    }, !e.readOnly && {
      onClick: u
    }, {
      onKeyDown: T(a)
    })
  }, D));
});
export {
  K as PureDateInput
};
