import { __decorate } from "tslib";
import { Component, Input } from '@angular/core';
var AmountComponent = /** @class */ (function () {
    function AmountComponent() {
        this.currencyPosition = 'start';
    }
    Object.defineProperty(AmountComponent.prototype, "precision", {
        get: function () {
            if (this.currency) {
                switch (this.currency.toUpperCase()) {
                    case 'BTC':
                    case 'LTC':
                    case 'XRP':
                    case 'ETH':
                        return 4;
                }
            }
            return 2;
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        Input()
    ], AmountComponent.prototype, "amount", void 0);
    __decorate([
        Input()
    ], AmountComponent.prototype, "currency", void 0);
    __decorate([
        Input()
    ], AmountComponent.prototype, "currencyPosition", void 0);
    __decorate([
        Input()
    ], AmountComponent.prototype, "positiveSigh", void 0);
    AmountComponent = __decorate([
        Component({
            selector: 'ui-amount',
            template: "<ng-container *ngIf=\"amount | amount:precision | amountSplit as amounts\">\n  <span *ngIf=\"amounts.sign else plus\">{{amounts.sign}}</span>\n  <span *ngIf=\"currencyPosition === 'start'\">{{currency | currencySymbol}}</span>\n  <span>{{amounts.int}}</span>\n  <span *ngIf=\"amounts.frac\">.{{amounts.frac}}</span>\n  <span *ngIf=\"currencyPosition === 'end'\">{{currency | currencySymbol}}</span>\n</ng-container>\n\n<ng-template #plus>\n  <span *ngIf=\"positiveSigh\">+</span>\n</ng-template>\n",
            styles: [":host{white-space:nowrap}span{display:inline-block}"]
        })
    ], AmountComponent);
    return AmountComponent;
}());
export { AmountComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1vdW50LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BjYmRldi91aS1raXQvIiwic291cmNlcyI6WyJsaWIvYW1vdW50L2Ftb3VudC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsS0FBSyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBTy9DO0lBQUE7UUFHV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