"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormMobilePhoneField = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const MaskField_1 = require("../../components/MaskField");
const personalDataSecurity_1 = require("../../components/personalDataSecurity");
const classNames_1 = require("../../components/utils/classNames");
const useFormFieldProps_1 = require("../useFormFieldProps");
const MOBILE_PHONE_MASK = '+{7} (000) 000-00-00';
/**
 * Поле для ввода личного мобильного номера телефона, начинающего на 79
 */
const FormMobilePhoneField = ({ isHidePersonalData, inputProps, ...props }) => {
    const fieldProps = (0, useFormFieldProps_1.useFormFieldProps)({
        ...props,
        defaultValue: props.defaultValue || null,
    });
    const hidePersonalDataClassname = (0, personalDataSecurity_1.useHidePersonalData)({
        isEnabled: isHidePersonalData,
        type: 'input',
    });
    return ((0, jsx_runtime_1.jsx)(MaskField_1.MaskField, { inputProps: {
            ...inputProps,
            className: (0, classNames_1.classNames)(inputProps?.className, hidePersonalDataClassname),
        }, placeholder: "+7 (9**) ***-**-**", ...fieldProps, mask: MOBILE_PHONE_MASK, autoComplete: "tel" }));
};
exports.FormMobilePhoneField = FormMobilePhoneField;
