// #region Imports
import { ElementValidatorBase } from './Abstracts/ElementValidatorBase';
import { notEqualsToValidator } from './NotEqualsToElementValidatorFn';
/**
 * @public
 */
export class NotEqualsToElementValidator extends ElementValidatorBase {
    // #region Fields
    _other;
    // #endregion
    // #region Ctor
    constructor(host, other, messageResolver) {
        super(host, messageResolver ?? ((_params) => 'The value should not be equal to the other element\'s value.'));
        this._other = other;
    }
    // #endregion
    // #region Properties
    get attributes() {
        return ['value'];
    }
    // #endregion
    // #region Methods
    validate() {
        const otherElement = typeof this._other === 'function' ? this._other() : this._other;
        const errors = notEqualsToValidator(this.host, otherElement);
        return this.getMessage(errors);
    }
}
/**
 * A factory function for the `NotEqualsToElementValidator`.
 *
 * @public
 * @param resolver - An *optional* message resolver to get the error message that will be displayed. When not provided, a default message will be used.
 */
export function notEqualsToElementValidator(other, messageResolver) {
    return (host) => {
        return new NotEqualsToElementValidator(host, other, messageResolver);
    };
}
//# sourceMappingURL=NotEqualsToElementValidator.js.map