import { _ as __rest } from './tslib.es6-ab63fd84.js';
import React__default from 'react';
import { useMantineTheme, Image } from '@mantine/core';
import { DatePickerInput } from '@mantine/dates';
import { I as ISO_FORMAT } from './index-a8162282.js';
import './index-91c6a49c.js';
import { C as CommonGAssets } from './index-43584299.js';
import { M as MAPPED_LOCALE } from './index-4e6b8a2b.js';
import { L as LOCALE } from './Locale-87b46912.js';

// Omit<MantineDatePickerInputProps, 'value'>
const DatePicker = (_a) => {
    var _b;
    var { value, fullWidth = true } = _a, rest = __rest(_a, ["value", "fullWidth"]);
    const theme = useMantineTheme();
    const isMarryBaby = theme.other.template === 'mb';
    const valueFormat = (_b = ISO_FORMAT[process.env.UNIFY_LOCALE || LOCALE.Vietnam]) === null || _b === void 0 ? void 0 : _b.dateFormat;
    return (React__default.createElement(DatePickerInput, Object.assign({ locale: MAPPED_LOCALE[process.env.UNIFY_LOCALE || LOCALE.Vietnam], valueFormat: valueFormat, size: "md", clearable: false, popoverProps: fullWidth
            ? {
                styles: {
                    dropdown: {
                        minWidth: '100%',
                        display: 'flex',
                        justifyContent: 'center',
                        alignItems: 'center',
                    },
                },
            }
            : {}, styles: {
            root: {
                position: 'relative',
            },
            rightSection: { pointerEvents: 'none', cursor: 'default' },
        }, rightSection: React__default.createElement(Image, { src: CommonGAssets.getAssetPath(isMarryBaby ? 'MB-calendar.svg' : 'OutlineCalendar.svg'), width: 18, height: 18 }), value: value, placeholder: valueFormat }, rest, { className: `input-control ${(rest === null || rest === void 0 ? void 0 : rest.className) || ''}` })));
};

export { DatePicker as D };
