"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get SOURCE_DATA_WARNING_MESSAGE () {
        return SOURCE_DATA_WARNING_MESSAGE;
    },
    get VALIDATOR_TYPE () {
        return VALIDATOR_TYPE;
    },
    get intlDateValidator () {
        return intlDateValidator;
    },
    get sourceDataValidator () {
        return sourceDataValidator;
    }
});
const _dateTime = require("../../helpers/dateTime");
const _mixed = require("../../helpers/mixed");
const VALIDATOR_TYPE = 'intl-date';
const SOURCE_DATA_WARNING_MESSAGE = 'Source data warning ([itemsCount]). ' + 'Invalid value for "intl-date" cell type.\n\n' + '[affectedCells]\n\n' + 'Expected a value compatible with the ISO 8601 date format ("YYYY-MM-DD").';
function sourceDataValidator(value, cellMeta) {
    if (cellMeta.allowEmpty && (0, _mixed.isEmpty)(value)) {
        return true;
    }
    return (0, _dateTime.isValidISODate)(value);
}
function intlDateValidator(value, callback) {
    if (this.allowEmpty && (0, _mixed.isEmpty)(value)) {
        callback(true);
        return;
    }
    callback((0, _dateTime.isValidISODate)(value));
}
intlDateValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;
