import { jsx as _jsx } from "react/jsx-runtime";
import { BaseExpression } from "../BaseExpression";
import { ExpressionValue } from "../ExpressionValue";
import { ExpressionValueRenderer } from "../ExpressionValueRenderer";
import { ExpressionValueType } from "../ExpressionValueType";
// this one should not be registered as it cannot be added
export class RootExpression extends BaseExpression {
    constructor() {
        super();
        this.__type = "__RootExpression";
        this.canSelect = false;
        this.expressionRoot = new ExpressionValue();
        this.expressionRoot.valueType = ExpressionValueType.UNSET;
    }
    getExpressionValues() {
        return [this.expressionRoot];
    }
    render() {
        return _jsx(ExpressionValueRenderer, { el: this.expressionRoot }, void 0);
    }
    setEditContext(selection, owner) {
        super.setEditContext(selection, owner);
        this.expressionRoot.setEditContext(selection, this);
    }
    evaluate(data, testContext) {
        if (!this.expressionRoot)
            return undefined;
        return this.expressionRoot.evaluate(data, testContext);
    }
}
//# sourceMappingURL=RootExpression.js.map