'use strict';

var tslib_es6 = require('./tslib.es6-2c2ed574.js');
var React = require('react');
var core = require('@mantine/core');
var dates = require('@mantine/dates');
var index = require('./index-6ce6e395.js');
require('./index-da3b86cd.js');
var index$2 = require('./index-b0ce6f8f.js');
var index$1 = require('./index-024542ed.js');
var Locale = require('./Locale-fbe01177.js');

function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

// Omit<MantineDatePickerInputProps, 'value'>
const DatePicker = (_a) => {
    var _b;
    var { value, fullWidth = true } = _a, rest = tslib_es6.__rest(_a, ["value", "fullWidth"]);
    const theme = core.useMantineTheme();
    const isMarryBaby = theme.other.template === 'mb';
    const valueFormat = (_b = index.ISO_FORMAT[process.env.UNIFY_LOCALE || Locale.LOCALE.Vietnam]) === null || _b === void 0 ? void 0 : _b.dateFormat;
    return (React__default["default"].createElement(dates.DatePickerInput, Object.assign({ locale: index$1.MAPPED_LOCALE[process.env.UNIFY_LOCALE || 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["default"].createElement(core.Image, { src: index$2.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) || ''}` })));
};

exports.DatePicker = DatePicker;
