import { jsx as o } from "react/jsx-runtime";
import { forwardRef as i } from "react";
import { IMaskMixin as p } from "react-imask";
import { Input as d } from "@headlessui/react";
import { cn as f } from "../utils/cn.js";
const n = i(({ state: t, className: r, rawValue: e, onFocus: s, ...u }, m) => /* @__PURE__ */ o(
  d,
  {
    ref: m,
    type: "text",
    autoComplete: "off",
    "data-lpignore": "true",
    disabled: t === "disabled",
    className: f(
      "font-suisse h-[36px] w-full font-medium text-sw-gray-50 data-focus:outline-none",
      { "text-sw-gray-400": t === "disabled" },
      { "text-sw-status-error": t === "error" },
      r
    ),
    style: {
      fontSize: e && e.length > 15 ? "24px" : "32px"
    },
    readOnly: !0,
    onFocus: (a) => {
      a.target.removeAttribute("readOnly"), s?.(a);
    },
    ...u
  }
));
n.displayName = "RawInputAmount";
const l = p(({ inputRef: t, ...r }) => /* @__PURE__ */ o(n, { ref: t, ...r })), I = ({
  value: t,
  setValue: r,
  ...e
}) => (
  // @ts-expect-error Use Number instead of MaskedNumber
  /* @__PURE__ */ o(
    l,
    {
      scale: 18,
      value: t,
      rawValue: t,
      mask: Number,
      onAccept: r,
      padFractionalZeros: !1,
      normalizeZeros: !0,
      thousandsSeparator: "",
      mapToRadix: [","],
      radix: ".",
      autofix: !0,
      unmask: !0,
      ...e
    }
  )
);
export {
  I as InputAmount,
  l as MaskedInputAmount
};
//# sourceMappingURL=InputAmount.js.map
