"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "createEvent", {
    enumerable: true,
    get: function() {
        return createEvent;
    }
});
var createEvent = function createEvent(ref) {
    if (ref.current) {
        var event = new Event('change', {
            bubbles: true
        });
        Object.defineProperty(event, 'target', {
            writable: false,
            value: ref.current
        });
        var syntheticEvent = createSyntheticEvent(event);
        return syntheticEvent;
    }
    return null;
};
var createSyntheticEvent = function createSyntheticEvent(event) {
    var isDefaultPrevented = false;
    var isPropagationStopped = false;
    var preventDefault = function preventDefault() {
        isDefaultPrevented = true;
        event.preventDefault();
    };
    var stopPropagation = function stopPropagation() {
        isPropagationStopped = true;
        event.stopPropagation();
    };
    return {
        nativeEvent: event,
        currentTarget: event.currentTarget,
        target: event.target,
        bubbles: event.bubbles,
        cancelable: event.cancelable,
        defaultPrevented: event.defaultPrevented,
        eventPhase: event.eventPhase,
        isTrusted: event.isTrusted,
        preventDefault: preventDefault,
        isDefaultPrevented: function isDefaultPrevented1() {
            return isDefaultPrevented;
        },
        stopPropagation: stopPropagation,
        isPropagationStopped: function isPropagationStopped1() {
            return isPropagationStopped;
        },
        persist: function persist() {},
        timeStamp: event.timeStamp,
        type: event.type
    };
};
