"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactHookForm = require("react-hook-form");
const index = require("../TimeRangePicker/index.cjs");
const FormTimeRangePicker = ({ name, rules, onChange, ...rest }) => {
  const { control } = reactHookForm.useFormContext();
  return /* @__PURE__ */ jsxRuntime.jsx(
    reactHookForm.Controller,
    {
      control,
      name,
      rules,
      render: ({ field }) => {
        const { onChange: handleChange, ...restField } = field;
        return /* @__PURE__ */ jsxRuntime.jsx(
          index.TimeRangePicker,
          {
            onChange: (e) => {
              handleChange(e);
              onChange == null ? void 0 : onChange(e);
            },
            ...restField,
            ...rest
          }
        );
      }
    }
  );
};
exports.FormTimeRangePicker = FormTimeRangePicker;
