"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Primitive_1 = require("../../../../Primitive");
const _ids_1 = require("../../../_ids");
class Constant extends Primitive_1.Primitive {
    constructor(system) {
        super({
            i: ['a'],
            o: ['a'],
        }, {}, system, _ids_1.ID_CONSTANT);
        this._current = undefined;
        this.addListener('reset', () => {
            this._current = undefined;
        });
    }
    onDataInputData(name, data) {
        this._current = data;
        this._output.a.push(data);
    }
    onDataInputDrop(name) {
        if (!this._backwarding) {
            this._forward_all_empty();
            this._current = undefined;
        }
    }
    onDataOutputDrop(name) {
        if (!this._forwarding_empty) {
            this._output.a.push(this._current);
        }
    }
    onDataInputInvalid(name) {
        this._invalidate();
    }
}
exports.default = Constant;
//# sourceMappingURL=index.js.map