import { __decorate, __metadata } from "tslib";
import { Input } from '@angular/core';
import { DynamicOutput, PureRelationsComponent } from '@anglr/dynamic/relations';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { isPresent, nameof } from '@jscrpt/common';
import { MathPowerRelationsMetadataLoader } from './power.metadata';
let MathPowerRelations = class MathPowerRelations {
    //######################### public methods #########################
    invalidateVisuals() {
    }
    ngOnChanges(changes) {
        if (nameof('input') in changes ||
            nameof('exponent') in changes) {
            if (!isPresent(this.input) ||
                !this.relationsOptions?.exponent) {
                this.result = null;
                return;
            }
            this.result = Math.pow(this.input, this.relationsOptions?.exponent);
        }
    }
};
__decorate([
    Input(),
    __metadata("design:type", Object)
], MathPowerRelations.prototype, "input", void 0);
__decorate([
    DynamicOutput(),
    __metadata("design:type", Object)
], MathPowerRelations.prototype, "result", void 0);
MathPowerRelations = __decorate([
    PureRelationsComponent(),
    RelationsEditorMetadata(MathPowerRelationsMetadataLoader)
], MathPowerRelations);
export { MathPowerRelations };
//# sourceMappingURL=power.relations.js.map