import { Component, ViewEncapsulation, Input, HostBinding, ContentChild } from '@angular/core';
import { trigger, style, transition, animate } from '@angular/animations';
var NzBadgeComponent = (function () {
    function NzBadgeComponent() {
        this._showZero = false;
        this.countArray = [];
        this.countSingleArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
        this._nzBadge = true;
        this.nzOverflowCount = 99;
        this.nzDot = false;
    }
    Object.defineProperty(NzBadgeComponent.prototype, "setNoWrapper", {
        get: function () {
            return !this.content;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NzBadgeComponent.prototype, "nzShowZero", {
        get: function () {
            return this._showZero;
        },
        set: function (value) {
            if (value === '') {
                this._showZero = true;
            }
            else {
                this._showZero = value;
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(NzBadgeComponent.prototype, "nzCount", {
        get: function () {
            return this.count;
        },
        set: function (value) {
            if (value < 0) {
                this.count = 0;
            }
            else {
                this.count = value;
            }
            this.countArray = this.count.toString().split('');
        },
        enumerable: true,
        configurable: true
    });
    NzBadgeComponent.prototype.ngOnInit = function () {
        this.maxNumberArray = this.nzOverflowCount.toString().split('');
    };
    return NzBadgeComponent;
}());
export { NzBadgeComponent };
NzBadgeComponent.decorators = [
    { type: Component, args: [{
                selector: 'nz-badge',
                encapsulation: ViewEncapsulation.None,
                animations: [
                    trigger('enterLeave', [
                        transition('void => *', [
                            style({ opacity: 0 }),
                            animate('0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46)')
                        ]),
                        transition('* => void', [
                            style({ opacity: 1 }),
                            animate('0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46)')
                        ])
                    ])
                ],
                template: "<ng-template *ngIf=\"content\" [ngTemplateOutlet]=\"content\"></ng-template><span class=\"ant-badge-status-dot ant-badge-status-{{nzStatus}}\" *ngIf=\"nzStatus\"></span><span class=\"ant-badge-status-text\" *ngIf=\"nzText\">{{nzText}}</span><sup [@enterLeave] [ngStyle]=\"nzStyle\" *ngIf=\"(nzDot)||(nzCount>0)||((nzCount==0)&&nzShowZero)\" data-show=\"true\" class=\"ant-scroll-number\" [class.ant-badge-count]=\"!nzDot\" [class.ant-badge-dot]=\"nzDot\"><ng-template ngFor let-number [ngForOf]=\"maxNumberArray\" let-i=\"index\"><span *ngIf=\"nzCount<=nzOverflowCount\" class=\"ant-scroll-number-only\" [style.transform]=\"'translateY('+((-countArray[i]*100))+'%)'\"><ng-template [ngIf]=\"(!nzDot)&&(countArray[i]!=null)\"><p *ngFor=\"let p of countSingleArray\" [class.current]=\"p==countArray[i]\">{{p}}</p></ng-template></span></ng-template><ng-template [ngIf]=\"nzCount>nzOverflowCount\">{{nzOverflowCount}}+</ng-template></sup>",
                styles: [
                    "/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable declaration-bang-space-before */\n/* stylelint-disable declaration-bang-space-before */\n.ant-badge {\n  position: relative;\n  display: inline-block;\n  line-height: 1;\n  vertical-align: middle;\n}\n.ant-badge-count {\n  position: absolute;\n  transform: translateX(-50%);\n  top: -10px;\n  height: 20px;\n  border-radius: 10px;\n  min-width: 20px;\n  background: #f04134;\n  color: #fff;\n  line-height: 20px;\n  text-align: center;\n  padding: 0 6px;\n  font-size: 12px;\n  white-space: nowrap;\n  transform-origin: -10% center;\n  font-family: tahoma;\n}\n.ant-badge-count a,\n.ant-badge-count a:hover {\n  color: #fff;\n}\n.ant-badge-dot {\n  position: absolute;\n  transform: translateX(-50%);\n  transform-origin: 0 center;\n  top: -4px;\n  height: 8px;\n  width: 8px;\n  border-radius: 100%;\n  background: #f04134;\n  z-index: 10;\n  box-shadow: 0 0 0 1px #fff;\n}\n.ant-badge-status {\n  line-height: inherit;\n  vertical-align: baseline;\n}\n.ant-badge-status-dot {\n  width: 8px;\n  height: 8px;\n  display: inline-block;\n  border-radius: 50%;\n}\n.ant-badge-status-success {\n  background-color: #00a854;\n}\n.ant-badge-status-processing {\n  background-color: #108ee9;\n  position: relative;\n}\n.ant-badge-status-processing:after {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  border-radius: 50%;\n  border: 1px solid #108ee9;\n  content: '';\n  animation: antStatusProcessing 1.2s infinite ease-in-out;\n}\n.ant-badge-status-default {\n  background-color: #d9d9d9;\n}\n.ant-badge-status-error {\n  background-color: #f04134;\n}\n.ant-badge-status-warning {\n  background-color: #ffbf00;\n}\n.ant-badge-status-text {\n  color: rgba(0, 0, 0, 0.65);\n  font-size: 12px;\n  margin-left: 8px;\n}\n.ant-badge-zoom-appear,\n.ant-badge-zoom-enter {\n  animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46);\n  animation-fill-mode: both;\n}\n.ant-badge-zoom-leave {\n  animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6);\n  animation-fill-mode: both;\n}\n.ant-badge-not-a-wrapper .ant-badge-count {\n  top: auto;\n  display: block;\n  position: relative;\n  transform: none !important;\n}\n@keyframes antStatusProcessing {\n  0% {\n    transform: scale(0.8);\n    opacity: 0.5;\n  }\n  100% {\n    transform: scale(2.4);\n    opacity: 0;\n  }\n}\n.ant-scroll-number {\n  overflow: hidden;\n}\n.ant-scroll-number-only {\n  display: inline-block;\n  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n  height: 20px;\n}\n.ant-scroll-number-only > p {\n  height: 20px;\n}\n@keyframes antZoomBadgeIn {\n  0% {\n    opacity: 0;\n    transform: scale(0) translateX(-50%);\n  }\n  100% {\n    transform: scale(1) translateX(-50%);\n  }\n}\n@keyframes antZoomBadgeOut {\n  0% {\n    transform: scale(1) translateX(-50%);\n  }\n  100% {\n    opacity: 0;\n    transform: scale(0) translateX(-50%);\n  }\n}\n",
                    "/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\n/* stylelint-disable declaration-bang-space-before */\n/* stylelint-disable declaration-bang-space-before */\n.ant-badge {\n  position: relative;\n  display: inline-block;\n  line-height: 1;\n  vertical-align: middle;\n}\n.ant-badge-count {\n  position: absolute;\n  transform: translateX(-50%);\n  top: -10px;\n  height: 20px;\n  border-radius: 10px;\n  min-width: 20px;\n  background: #f04134;\n  color: #fff;\n  line-height: 20px;\n  text-align: center;\n  padding: 0 6px;\n  font-size: 12px;\n  white-space: nowrap;\n  transform-origin: -10% center;\n  font-family: tahoma;\n}\n.ant-badge-count a,\n.ant-badge-count a:hover {\n  color: #fff;\n}\n.ant-badge-dot {\n  position: absolute;\n  transform: translateX(-50%);\n  transform-origin: 0 center;\n  top: -4px;\n  height: 8px;\n  width: 8px;\n  border-radius: 100%;\n  background: #f04134;\n  z-index: 10;\n  box-shadow: 0 0 0 1px #fff;\n}\n.ant-badge-status {\n  line-height: inherit;\n  vertical-align: baseline;\n}\n.ant-badge-status-dot {\n  width: 8px;\n  height: 8px;\n  display: inline-block;\n  border-radius: 50%;\n}\n.ant-badge-status-success {\n  background-color: #00a854;\n}\n.ant-badge-status-processing {\n  background-color: #108ee9;\n  position: relative;\n}\n.ant-badge-status-processing:after {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  border-radius: 50%;\n  border: 1px solid #108ee9;\n  content: '';\n  animation: antStatusProcessing 1.2s infinite ease-in-out;\n}\n.ant-badge-status-default {\n  background-color: #d9d9d9;\n}\n.ant-badge-status-error {\n  background-color: #f04134;\n}\n.ant-badge-status-warning {\n  background-color: #ffbf00;\n}\n.ant-badge-status-text {\n  color: rgba(0, 0, 0, 0.65);\n  font-size: 12px;\n  margin-left: 8px;\n}\n.ant-badge-zoom-appear,\n.ant-badge-zoom-enter {\n  animation: antZoomBadgeIn 0.3s cubic-bezier(0.12, 0.4, 0.29, 1.46);\n  animation-fill-mode: both;\n}\n.ant-badge-zoom-leave {\n  animation: antZoomBadgeOut 0.3s cubic-bezier(0.71, -0.46, 0.88, 0.6);\n  animation-fill-mode: both;\n}\n.ant-badge-not-a-wrapper .ant-badge-count {\n  top: auto;\n  display: block;\n  position: relative;\n  transform: none !important;\n}\n@keyframes antStatusProcessing {\n  0% {\n    transform: scale(0.8);\n    opacity: 0.5;\n  }\n  100% {\n    transform: scale(2.4);\n    opacity: 0;\n  }\n}\n.ant-scroll-number {\n  overflow: hidden;\n}\n.ant-scroll-number-only {\n  display: inline-block;\n  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n  height: 20px;\n}\n.ant-scroll-number-only > p {\n  height: 20px;\n}\n@keyframes antZoomBadgeIn {\n  0% {\n    opacity: 0;\n    transform: scale(0) translateX(-50%);\n  }\n  100% {\n    transform: scale(1) translateX(-50%);\n  }\n}\n@keyframes antZoomBadgeOut {\n  0% {\n    transform: scale(1) translateX(-50%);\n  }\n  100% {\n    opacity: 0;\n    transform: scale(0) translateX(-50%);\n  }\n}\n.ant-badge-count {\n  position: absolute;\n  transform: translateX(50%);\n  right: 0;\n}\n.ant-badge-dot {\n  position: absolute;\n  transform: translateX(50%);\n  right: 0;\n}\n"
                ]
            },] },
];
/** @nocollapse */
NzBadgeComponent.ctorParameters = function () { return []; };
NzBadgeComponent.propDecorators = {
    'content': [{ type: ContentChild, args: ['content',] },],
    '_nzBadge': [{ type: HostBinding, args: ['class.ant-badge',] },],
    'setNoWrapper': [{ type: HostBinding, args: ['class.ant-badge-not-a-wrapper',] },],
    'nzOverflowCount': [{ type: Input },],
    'nzShowZero': [{ type: Input },],
    'nzDot': [{ type: Input },],
    'nzText': [{ type: Input },],
    'nzStyle': [{ type: Input },],
    'nzStatus': [{ type: Input }, { type: HostBinding, args: ['class.ant-badge-status',] },],
    'nzCount': [{ type: Input },],
};
