var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef } from "react";
import { cl } from "../../../utils/helpers/index.js";
import { useControllableState } from "../../../utils/hooks/index.js";
import { useI18n } from "../../../utils/i18n/i18n.hooks.js";
import { DateTranslationContextProvider, getTranslations, } from "../../Date.locale.js";
import { ReactDayPicker } from "./DatePicker.RDP.js";
export const DatePickerStandalone = forwardRef((_a, ref) => {
    var { className, locale, translations, selected, defaultSelected, onSelect, mode } = _a, rest = __rest(_a, ["className", "locale", "translations", "selected", "defaultSelected", "onSelect", "mode"]);
    const translate = useI18n("DatePicker", translations, getTranslations(locale));
    const [value, setValue] = useControllableState({
        defaultValue: defaultSelected,
        value: selected,
        onChange: (newValue) => onSelect === null || onSelect === void 0 ? void 0 : onSelect(newValue),
    });
    return (React.createElement(DateTranslationContextProvider, { translate: translate },
        React.createElement("div", { ref: ref, className: cl("aksel-date__standalone-wrapper", className) },
            React.createElement(ReactDayPicker, Object.assign({}, rest, { locale: locale, handleSelect: setValue, selected: value, mode: mode })))));
});
export default DatePickerStandalone;
//# sourceMappingURL=DatePicker.Standalone.js.map