(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('ng-zorro-antd/core'), require('@angular/common'), require('ng-zorro-antd/icon'), require('@angular/cdk/overlay'), require('rxjs'), require('@angular/cdk/portal')) :
    typeof define === 'function' && define.amd ? define('ng-zorro-antd/notification', ['exports', '@angular/core', 'ng-zorro-antd/core', '@angular/common', 'ng-zorro-antd/icon', '@angular/cdk/overlay', 'rxjs', '@angular/cdk/portal'], factory) :
    (global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].notification = {}), global.ng.core, global['ng-zorro-antd'].core, global.ng.common, global['ng-zorro-antd'].icon, global.ng.cdk.overlay, global.rxjs, global.ng.cdk.portal));
}(this, (function (exports, core, core$1, common, icon, overlay, rxjs, portal) { 'use strict';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */
    /* global Reflect, Promise */

    var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };

    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    function __rest(s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    }

    function __decorate(decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    }

    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    }

    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    }

    function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }

    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    }

    function __exportStar(m, exports) {
        for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }

    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }

    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    }

    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }

    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }

    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    }

    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    }

    function __asyncValues(o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    }

    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    function __importStar(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
        result.default = mod;
        return result;
    }

    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }

    function __classPrivateFieldGet(receiver, privateMap) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to get private field on non-instance");
        }
        return privateMap.get(receiver);
    }

    function __classPrivateFieldSet(receiver, privateMap, value) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to set private field on non-instance");
        }
        privateMap.set(receiver, value);
        return value;
    }

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    function NzNotificationComponent_div_1_i_4_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 16);
    } }
    function NzNotificationComponent_div_1_i_5_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 17);
    } }
    function NzNotificationComponent_div_1_i_6_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 18);
    } }
    function NzNotificationComponent_div_1_i_7_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 19);
    } }
    var _c0 = function (a0) { return { "ant-notification-notice-with-icon": a0 }; };
    function NzNotificationComponent_div_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementStart"](0, "div", 7);
        core["ɵɵelementStart"](1, "div", 8);
        core["ɵɵelementStart"](2, "div");
        core["ɵɵelementContainerStart"](3, 9);
        core["ɵɵtemplate"](4, NzNotificationComponent_div_1_i_4_Template, 1, 0, "i", 10);
        core["ɵɵtemplate"](5, NzNotificationComponent_div_1_i_5_Template, 1, 0, "i", 11);
        core["ɵɵtemplate"](6, NzNotificationComponent_div_1_i_6_Template, 1, 0, "i", 12);
        core["ɵɵtemplate"](7, NzNotificationComponent_div_1_i_7_Template, 1, 0, "i", 13);
        core["ɵɵelementContainerEnd"]();
        core["ɵɵelement"](8, "div", 14);
        core["ɵɵelement"](9, "div", 15);
        core["ɵɵelementEnd"]();
        core["ɵɵelementEnd"]();
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var ctx_r692 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngClass", core["ɵɵpureFunction1"](10, _c0, ctx_r692.nzMessage.type !== "blank"));
        core["ɵɵadvance"](1);
        core["ɵɵclassProp"]("ant-notification-notice-with-icon", ctx_r692.nzMessage.type !== "blank");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitch", ctx_r692.nzMessage.type);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "success");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "info");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "warning");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("ngSwitchCase", "error");
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("innerHTML", ctx_r692.nzMessage.title, core["ɵɵsanitizeHtml"]);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("innerHTML", ctx_r692.nzMessage.content, core["ɵɵsanitizeHtml"]);
    } }
    function NzNotificationComponent_ng_template_2_Template(rf, ctx) { }
    function NzNotificationComponent_ng_container_5_ng_container_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵelement"](1, "i", 21);
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var ctx_r701 = core["ɵɵnextContext"](2);
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("nzType", ctx_r701.nzMessage.options == null ? null : ctx_r701.nzMessage.options.nzCloseIcon);
    } }
    function NzNotificationComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelementContainerStart"](0);
        core["ɵɵtemplate"](1, NzNotificationComponent_ng_container_5_ng_container_1_Template, 2, 1, "ng-container", 20);
        core["ɵɵelementContainerEnd"]();
    } if (rf & 2) {
        var ctx_r694 = core["ɵɵnextContext"]();
        core["ɵɵadvance"](1);
        core["ɵɵproperty"]("nzStringTemplateOutlet", ctx_r694.nzMessage.options == null ? null : ctx_r694.nzMessage.options.nzCloseIcon);
    } }
    function NzNotificationComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "i", 22);
    } }
    var _c1 = function (a0, a1) { return { $implicit: a0, data: a1 }; };
    var NzNotificationComponent = /** @class */ (function () {
        function NzNotificationComponent(cdr) {
            this.cdr = cdr;
            this.messageDestroy = new core.EventEmitter();
            this.eraseTimer = null;
        }
        NzNotificationComponent.prototype.ngOnInit = function () {
            // `NzMessageContainer` does its job so all properties cannot be undefined.
            this.options = this.nzMessage.options;
            if (this.options.nzAnimate) {
                this.nzMessage.state = 'enter';
            }
            this.autoClose = this.options.nzDuration > 0;
            if (this.autoClose) {
                this.initErase();
                this.startEraseTimeout();
            }
        };
        NzNotificationComponent.prototype.ngOnDestroy = function () {
            if (this.autoClose) {
                this.clearEraseTimeout();
            }
        };
        NzNotificationComponent.prototype.onEnter = function () {
            if (this.autoClose && this.options.nzPauseOnHover) {
                this.clearEraseTimeout();
                this.updateTTL();
            }
        };
        NzNotificationComponent.prototype.onLeave = function () {
            if (this.autoClose && this.options.nzPauseOnHover) {
                this.startEraseTimeout();
            }
        };
        // Remove self
        NzNotificationComponent.prototype.destroy = function (userAction) {
            var _this = this;
            if (userAction === void 0) { userAction = false; }
            if (this.options.nzAnimate) {
                this.nzMessage.state = 'leave';
                this.cdr.detectChanges();
                setTimeout(function () {
                    _this.messageDestroy.next({ id: _this.nzMessage.messageId, userAction: userAction });
                }, 200);
            }
            else {
                this.messageDestroy.next({ id: this.nzMessage.messageId, userAction: userAction });
            }
        };
        NzNotificationComponent.prototype.initErase = function () {
            this.eraseTTL = this.options.nzDuration;
            this.eraseTimingStart = Date.now();
        };
        NzNotificationComponent.prototype.updateTTL = function () {
            if (this.autoClose) {
                this.eraseTTL -= Date.now() - this.eraseTimingStart;
            }
        };
        NzNotificationComponent.prototype.startEraseTimeout = function () {
            var _this = this;
            if (this.eraseTTL > 0) {
                this.clearEraseTimeout();
                this.eraseTimer = setTimeout(function () { return _this.destroy(); }, this.eraseTTL);
                this.eraseTimingStart = Date.now();
            }
            else {
                this.destroy();
            }
        };
        NzNotificationComponent.prototype.clearEraseTimeout = function () {
            if (this.eraseTimer !== null) {
                clearTimeout(this.eraseTimer);
                this.eraseTimer = null;
            }
        };
        NzNotificationComponent.prototype.close = function () {
            this.destroy(true);
        };
        Object.defineProperty(NzNotificationComponent.prototype, "state", {
            get: function () {
                if (this.nzMessage.state === 'enter') {
                    if (this.nzPlacement === 'topLeft' || this.nzPlacement === 'bottomLeft') {
                        return 'enterLeft';
                    }
                    else {
                        return 'enterRight';
                    }
                }
                else {
                    return this.nzMessage.state;
                }
            },
            enumerable: true,
            configurable: true
        });
        /** @nocollapse */ NzNotificationComponent.ɵfac = function NzNotificationComponent_Factory(t) { return new (t || NzNotificationComponent)(core["ɵɵdirectiveInject"](core.ChangeDetectorRef)); };
        /** @nocollapse */ NzNotificationComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzNotificationComponent, selectors: [["nz-notification"]], inputs: { nzMessage: "nzMessage", nzIndex: "nzIndex", nzPlacement: "nzPlacement" }, outputs: { messageDestroy: "messageDestroy" }, exportAs: ["nzNotification"], decls: 8, vars: 12, consts: [[1, "ant-notification-notice", "ant-notification-notice-closable", 3, "ngStyle", "ngClass", "mouseenter", "mouseleave"], ["class", "ant-notification-notice-content", 4, "ngIf"], [3, "ngIf", "ngTemplateOutlet", "ngTemplateOutletContext"], ["tabindex", "0", 1, "ant-notification-notice-close", 3, "click"], [1, "ant-notification-notice-close-x"], [4, "ngIf", "ngIfElse"], ["iconTpl", ""], [1, "ant-notification-notice-content"], [1, "ant-notification-notice-content", 3, "ngClass"], [3, "ngSwitch"], ["nz-icon", "", "nzType", "check-circle", "class", "ant-notification-notice-icon ant-notification-notice-icon-success", 4, "ngSwitchCase"], ["nz-icon", "", "nzType", "info-circle", "class", "ant-notification-notice-icon ant-notification-notice-icon-info", 4, "ngSwitchCase"], ["nz-icon", "", "nzType", "exclamation-circle", "class", "ant-notification-notice-icon ant-notification-notice-icon-warning", 4, "ngSwitchCase"], ["nz-icon", "", "nzType", "close-circle", "class", "ant-notification-notice-icon ant-notification-notice-icon-error", 4, "ngSwitchCase"], [1, "ant-notification-notice-message", 3, "innerHTML"], [1, "ant-notification-notice-description", 3, "innerHTML"], ["nz-icon", "", "nzType", "check-circle", 1, "ant-notification-notice-icon", "ant-notification-notice-icon-success"], ["nz-icon", "", "nzType", "info-circle", 1, "ant-notification-notice-icon", "ant-notification-notice-icon-info"], ["nz-icon", "", "nzType", "exclamation-circle", 1, "ant-notification-notice-icon", "ant-notification-notice-icon-warning"], ["nz-icon", "", "nzType", "close-circle", 1, "ant-notification-notice-icon", "ant-notification-notice-icon-error"], [4, "nzStringTemplateOutlet"], ["nz-icon", "", 3, "nzType"], ["nz-icon", "", "nzType", "close", 1, "ant-notification-close-icon"]], template: function NzNotificationComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div", 0);
                core["ɵɵlistener"]("mouseenter", function NzNotificationComponent_Template_div_mouseenter_0_listener() { return ctx.onEnter(); })("mouseleave", function NzNotificationComponent_Template_div_mouseleave_0_listener() { return ctx.onLeave(); });
                core["ɵɵtemplate"](1, NzNotificationComponent_div_1_Template, 10, 12, "div", 1);
                core["ɵɵtemplate"](2, NzNotificationComponent_ng_template_2_Template, 0, 0, "ng-template", 2);
                core["ɵɵelementStart"](3, "a", 3);
                core["ɵɵlistener"]("click", function NzNotificationComponent_Template_a_click_3_listener() { return ctx.close(); });
                core["ɵɵelementStart"](4, "span", 4);
                core["ɵɵtemplate"](5, NzNotificationComponent_ng_container_5_Template, 2, 1, "ng-container", 5);
                core["ɵɵtemplate"](6, NzNotificationComponent_ng_template_6_Template, 1, 0, "ng-template", null, 6, core["ɵɵtemplateRefExtractor"]);
                core["ɵɵelementEnd"]();
                core["ɵɵelementEnd"]();
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                var _r695 = core["ɵɵreference"](7);
                core["ɵɵproperty"]("ngStyle", ctx.nzMessage.options == null ? null : ctx.nzMessage.options.nzStyle)("ngClass", ctx.nzMessage.options == null ? null : ctx.nzMessage.options.nzClass)("@notificationMotion", ctx.state);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", !ctx.nzMessage.template);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.nzMessage.template)("ngTemplateOutlet", ctx.nzMessage.template)("ngTemplateOutletContext", core["ɵɵpureFunction2"](9, _c1, ctx, ctx.nzMessage.options == null ? null : ctx.nzMessage.options.nzData));
                core["ɵɵadvance"](3);
                core["ɵɵproperty"]("ngIf", ctx.nzMessage.options == null ? null : ctx.nzMessage.options.nzCloseIcon)("ngIfElse", _r695);
            } }, directives: [common.NgStyle, common.NgClass, common.NgIf, common.NgTemplateOutlet, common.NgSwitch, common.NgSwitchCase, icon.NzIconDirective, core$1.NzStringTemplateOutletDirective], encapsulation: 2, data: { animation: [core$1.notificationMotion] } });
        return NzNotificationComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzNotificationComponent, [{
            type: core.Component,
            args: [{
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-notification',
                    exportAs: 'nzNotification',
                    preserveWhitespaces: false,
                    animations: [core$1.notificationMotion],
                    template: "\n    <div\n      class=\"ant-notification-notice ant-notification-notice-closable\"\n      [ngStyle]=\"nzMessage.options?.nzStyle\"\n      [ngClass]=\"nzMessage.options?.nzClass\"\n      [@notificationMotion]=\"state\"\n      (mouseenter)=\"onEnter()\"\n      (mouseleave)=\"onLeave()\"\n    >\n      <div *ngIf=\"!nzMessage.template\" class=\"ant-notification-notice-content\">\n        <div class=\"ant-notification-notice-content\" [ngClass]=\"{ 'ant-notification-notice-with-icon': nzMessage.type !== 'blank' }\">\n          <div [class.ant-notification-notice-with-icon]=\"nzMessage.type !== 'blank'\">\n            <ng-container [ngSwitch]=\"nzMessage.type\">\n              <i\n                *ngSwitchCase=\"'success'\"\n                nz-icon\n                nzType=\"check-circle\"\n                class=\"ant-notification-notice-icon ant-notification-notice-icon-success\"\n              ></i>\n              <i\n                *ngSwitchCase=\"'info'\"\n                nz-icon\n                nzType=\"info-circle\"\n                class=\"ant-notification-notice-icon ant-notification-notice-icon-info\"\n              ></i>\n              <i\n                *ngSwitchCase=\"'warning'\"\n                nz-icon\n                nzType=\"exclamation-circle\"\n                class=\"ant-notification-notice-icon ant-notification-notice-icon-warning\"\n              ></i>\n              <i\n                *ngSwitchCase=\"'error'\"\n                nz-icon\n                nzType=\"close-circle\"\n                class=\"ant-notification-notice-icon ant-notification-notice-icon-error\"\n              ></i>\n            </ng-container>\n            <div class=\"ant-notification-notice-message\" [innerHTML]=\"nzMessage.title\"></div>\n            <div class=\"ant-notification-notice-description\" [innerHTML]=\"nzMessage.content\"></div>\n          </div>\n        </div>\n      </div>\n      <ng-template\n        [ngIf]=\"nzMessage.template\"\n        [ngTemplateOutlet]=\"nzMessage.template\"\n        [ngTemplateOutletContext]=\"{ $implicit: this, data: nzMessage.options?.nzData }\"\n      >\n      </ng-template>\n      <a tabindex=\"0\" class=\"ant-notification-notice-close\" (click)=\"close()\">\n        <span class=\"ant-notification-notice-close-x\">\n          <ng-container *ngIf=\"nzMessage.options?.nzCloseIcon; else iconTpl\">\n            <ng-container *nzStringTemplateOutlet=\"nzMessage.options?.nzCloseIcon\">\n              <i nz-icon [nzType]=\"nzMessage.options?.nzCloseIcon\"></i>\n            </ng-container>\n          </ng-container>\n          <ng-template #iconTpl>\n            <i nz-icon nzType=\"close\" class=\"ant-notification-close-icon\"></i>\n          </ng-template>\n        </span>\n      </a>\n    </div>\n  "
                }]
        }], function () { return [{ type: core.ChangeDetectorRef }]; }, { nzMessage: [{
                type: core.Input
            }], nzIndex: [{
                type: core.Input
            }], nzPlacement: [{
                type: core.Input
            }], messageDestroy: [{
                type: core.Output
            }] }); })();

    function NzNotificationContainerComponent_nz_notification_1_Template(rf, ctx) { if (rf & 1) {
        var _r708 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "nz-notification", 5);
        core["ɵɵlistener"]("messageDestroy", function NzNotificationContainerComponent_nz_notification_1_Template_nz_notification_messageDestroy_0_listener($event) { core["ɵɵrestoreView"](_r708); var ctx_r707 = core["ɵɵnextContext"](); return ctx_r707.removeMessage($event.id, $event.userAction); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var message_r706 = ctx.$implicit;
        var ctx_r702 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzMessage", message_r706)("nzPlacement", ctx_r702.config.nzPlacement);
    } }
    function NzNotificationContainerComponent_nz_notification_3_Template(rf, ctx) { if (rf & 1) {
        var _r711 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "nz-notification", 5);
        core["ɵɵlistener"]("messageDestroy", function NzNotificationContainerComponent_nz_notification_3_Template_nz_notification_messageDestroy_0_listener($event) { core["ɵɵrestoreView"](_r711); var ctx_r710 = core["ɵɵnextContext"](); return ctx_r710.removeMessage($event.id, $event.userAction); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var message_r709 = ctx.$implicit;
        var ctx_r703 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzMessage", message_r709)("nzPlacement", ctx_r703.config.nzPlacement);
    } }
    function NzNotificationContainerComponent_nz_notification_5_Template(rf, ctx) { if (rf & 1) {
        var _r714 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "nz-notification", 5);
        core["ɵɵlistener"]("messageDestroy", function NzNotificationContainerComponent_nz_notification_5_Template_nz_notification_messageDestroy_0_listener($event) { core["ɵɵrestoreView"](_r714); var ctx_r713 = core["ɵɵnextContext"](); return ctx_r713.removeMessage($event.id, $event.userAction); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var message_r712 = ctx.$implicit;
        var ctx_r704 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzMessage", message_r712)("nzPlacement", ctx_r704.config.nzPlacement);
    } }
    function NzNotificationContainerComponent_nz_notification_7_Template(rf, ctx) { if (rf & 1) {
        var _r717 = core["ɵɵgetCurrentView"]();
        core["ɵɵelementStart"](0, "nz-notification", 5);
        core["ɵɵlistener"]("messageDestroy", function NzNotificationContainerComponent_nz_notification_7_Template_nz_notification_messageDestroy_0_listener($event) { core["ɵɵrestoreView"](_r717); var ctx_r716 = core["ɵɵnextContext"](); return ctx_r716.removeMessage($event.id, $event.userAction); });
        core["ɵɵelementEnd"]();
    } if (rf & 2) {
        var message_r715 = ctx.$implicit;
        var ctx_r705 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("nzMessage", message_r715)("nzPlacement", ctx_r705.config.nzPlacement);
    } }
    var NZ_CONFIG_COMPONENT_NAME = 'notification';
    var NZ_NOTIFICATION_DEFAULT_CONFIG = {
        nzTop: '24px',
        nzBottom: '24px',
        nzPlacement: 'topRight',
        nzDuration: 4500,
        nzMaxStack: 7,
        nzPauseOnHover: true,
        nzAnimate: true
    };
    var NzNotificationContainerComponent = /** @class */ (function () {
        function NzNotificationContainerComponent(cdr, nzConfigService) {
            this.cdr = cdr;
            this.nzConfigService = nzConfigService;
            this.messages = [];
            this.destroy$ = new rxjs.Subject();
            this.updateConfig();
        }
        Object.defineProperty(NzNotificationContainerComponent.prototype, "topLeftMessages", {
            get: function () {
                return this.messages.filter(function (m) { return m.options.nzPosition === 'topLeft'; });
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(NzNotificationContainerComponent.prototype, "topRightMessages", {
            get: function () {
                return this.messages.filter(function (m) { return m.options.nzPosition === 'topRight' || !m.options.nzPosition; });
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(NzNotificationContainerComponent.prototype, "bottomLeftMessages", {
            get: function () {
                return this.messages.filter(function (m) { return m.options.nzPosition === 'bottomLeft'; });
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(NzNotificationContainerComponent.prototype, "bottomRightMessages", {
            get: function () {
                return this.messages.filter(function (m) { return m.options.nzPosition === 'bottomRight'; });
            },
            enumerable: true,
            configurable: true
        });
        /**
         * Create a new notification.
         * If there's a notification whose `nzKey` is same with `nzKey` in `NzNotificationDataFilled`,
         * replace its content instead of create a new one.
         * @override
         * @param notification
         */
        NzNotificationContainerComponent.prototype.createMessage = function (notification) {
            notification.options = this.mergeMessageOptions(notification.options);
            notification.onClose = new rxjs.Subject();
            var key = notification.options.nzKey;
            var notificationWithSameKey = this.messages.find(function (msg) { return msg.options.nzKey === notification.options.nzKey; });
            if (key && notificationWithSameKey) {
                this.replaceNotification(notificationWithSameKey, notification);
            }
            else {
                if (this.messages.length >= this.config.nzMaxStack) {
                    this.messages.splice(0, 1);
                }
                this.messages.push(notification);
            }
            this.cdr.detectChanges();
        };
        NzNotificationContainerComponent.prototype.updateConfig = function () {
            var newConfig = (this.config = __assign(__assign(__assign({}, NZ_NOTIFICATION_DEFAULT_CONFIG), this.config), this.nzConfigService.getConfigForComponent(NZ_CONFIG_COMPONENT_NAME)));
            this.top = core$1.toCssPixel(newConfig.nzTop);
            this.bottom = core$1.toCssPixel(newConfig.nzBottom);
            this.cdr.markForCheck();
        };
        NzNotificationContainerComponent.prototype.subscribeConfigChange = function () {
            var _this = this;
            this.nzConfigService.getConfigChangeEventForComponent(NZ_CONFIG_COMPONENT_NAME).subscribe(function () { return _this.updateConfig(); });
        };
        NzNotificationContainerComponent.prototype.replaceNotification = function (old, _new) {
            old.title = _new.title;
            old.content = _new.content;
            old.template = _new.template;
            old.type = _new.type;
        };
        NzNotificationContainerComponent.prototype.ngOnInit = function () {
            this.subscribeConfigChange();
        };
        NzNotificationContainerComponent.prototype.ngOnDestroy = function () {
            this.destroy$.next();
            this.destroy$.complete();
        };
        /**
         * Remove a message by `messageId`.
         * @param messageId Id of the message to be removed.
         * @param userAction Whether this is closed by user interaction.
         */
        NzNotificationContainerComponent.prototype.removeMessage = function (messageId, userAction) {
            var _this = this;
            if (userAction === void 0) { userAction = false; }
            this.messages.some(function (message, index) {
                if (message.messageId === messageId) {
                    _this.messages.splice(index, 1);
                    _this.messages = __spread(_this.messages);
                    _this.cdr.detectChanges();
                    message.onClose.next(userAction);
                    message.onClose.complete();
                    return true;
                }
                return false;
            });
        };
        /**
         * Remove all messages.
         */
        NzNotificationContainerComponent.prototype.removeMessageAll = function () {
            this.messages = [];
            this.cdr.detectChanges();
        };
        /**
         * Merge default options and custom message options
         * @param options
         */
        NzNotificationContainerComponent.prototype.mergeMessageOptions = function (options) {
            var defaultOptions = {
                nzDuration: this.config.nzDuration,
                nzAnimate: this.config.nzAnimate,
                nzPauseOnHover: this.config.nzPauseOnHover
            };
            return __assign(__assign({}, defaultOptions), options);
        };
        /** @nocollapse */ NzNotificationContainerComponent.ɵfac = function NzNotificationContainerComponent_Factory(t) { return new (t || NzNotificationContainerComponent)(core["ɵɵdirectiveInject"](core.ChangeDetectorRef), core["ɵɵdirectiveInject"](core$1.NzConfigService)); };
        /** @nocollapse */ NzNotificationContainerComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzNotificationContainerComponent, selectors: [["nz-notification-container"]], exportAs: ["nzNotificationContainer"], decls: 8, vars: 20, consts: [[1, "ant-notification", "ant-notification-topLeft"], [3, "nzMessage", "nzPlacement", "messageDestroy", 4, "ngFor", "ngForOf"], [1, "ant-notification", "ant-notification-topRight"], [1, "ant-notification", "ant-notification-bottomLeft"], [1, "ant-notification", "ant-notification-bottomRight"], [3, "nzMessage", "nzPlacement", "messageDestroy"]], template: function NzNotificationContainerComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div", 0);
                core["ɵɵtemplate"](1, NzNotificationContainerComponent_nz_notification_1_Template, 1, 2, "nz-notification", 1);
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](2, "div", 2);
                core["ɵɵtemplate"](3, NzNotificationContainerComponent_nz_notification_3_Template, 1, 2, "nz-notification", 1);
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](4, "div", 3);
                core["ɵɵtemplate"](5, NzNotificationContainerComponent_nz_notification_5_Template, 1, 2, "nz-notification", 1);
                core["ɵɵelementEnd"]();
                core["ɵɵelementStart"](6, "div", 4);
                core["ɵɵtemplate"](7, NzNotificationContainerComponent_nz_notification_7_Template, 1, 2, "nz-notification", 1);
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵstyleProp"]("top", ctx.top)("left", "0px");
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.topLeftMessages);
                core["ɵɵadvance"](1);
                core["ɵɵstyleProp"]("top", ctx.top)("right", "0px");
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.topRightMessages);
                core["ɵɵadvance"](1);
                core["ɵɵstyleProp"]("bottom", ctx.bottom)("left", "0px");
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.bottomLeftMessages);
                core["ɵɵadvance"](1);
                core["ɵɵstyleProp"]("bottom", ctx.bottom)("right", "0px");
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.bottomRightMessages);
            } }, directives: [common.NgForOf, NzNotificationComponent], encapsulation: 2, changeDetection: 0 });
        return NzNotificationContainerComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzNotificationContainerComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-notification-container',
                    exportAs: 'nzNotificationContainer',
                    preserveWhitespaces: false,
                    template: "\n    <div class=\"ant-notification ant-notification-topLeft\" [style.top]=\"top\" [style.left]=\"'0px'\">\n      <nz-notification\n        *ngFor=\"let message of topLeftMessages\"\n        [nzMessage]=\"message\"\n        [nzPlacement]=\"config.nzPlacement\"\n        (messageDestroy)=\"removeMessage($event.id, $event.userAction)\"\n      ></nz-notification>\n    </div>\n    <div class=\"ant-notification ant-notification-topRight\" [style.top]=\"top\" [style.right]=\"'0px'\">\n      <nz-notification\n        *ngFor=\"let message of topRightMessages\"\n        [nzMessage]=\"message\"\n        [nzPlacement]=\"config.nzPlacement\"\n        (messageDestroy)=\"removeMessage($event.id, $event.userAction)\"\n      ></nz-notification>\n    </div>\n    <div class=\"ant-notification ant-notification-bottomLeft\" [style.bottom]=\"bottom\" [style.left]=\"'0px'\">\n      <nz-notification\n        *ngFor=\"let message of bottomLeftMessages\"\n        [nzMessage]=\"message\"\n        [nzPlacement]=\"config.nzPlacement\"\n        (messageDestroy)=\"removeMessage($event.id, $event.userAction)\"\n      ></nz-notification>\n    </div>\n    <div class=\"ant-notification ant-notification-bottomRight\" [style.bottom]=\"bottom\" [style.right]=\"'0px'\">\n      <nz-notification\n        *ngFor=\"let message of bottomRightMessages\"\n        [nzMessage]=\"message\"\n        [nzPlacement]=\"config.nzPlacement\"\n        (messageDestroy)=\"removeMessage($event.id, $event.userAction)\"\n      ></nz-notification>\n    </div>\n  "
                }]
        }], function () { return [{ type: core.ChangeDetectorRef }, { type: core$1.NzConfigService }]; }, null); })();

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    var NzNotificationServiceModule = /** @class */ (function () {
        function NzNotificationServiceModule() {
        }
        /** @nocollapse */ NzNotificationServiceModule.ɵmod = core["ɵɵdefineNgModule"]({ type: NzNotificationServiceModule });
        /** @nocollapse */ NzNotificationServiceModule.ɵinj = core["ɵɵdefineInjector"]({ factory: function NzNotificationServiceModule_Factory(t) { return new (t || NzNotificationServiceModule)(); } });
        return NzNotificationServiceModule;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzNotificationServiceModule, [{
            type: core.NgModule
        }], null, null); })();

    /**
     * @license
     * Copyright Alibaba.com All Rights Reserved.
     *
     * Use of this source code is governed by an MIT-style license that can be
     * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
     */
    var NzNotificationModule = /** @class */ (function () {
        function NzNotificationModule() {
        }
        /** @nocollapse */ NzNotificationModule.ɵmod = core["ɵɵdefineNgModule"]({ type: NzNotificationModule });
        /** @nocollapse */ NzNotificationModule.ɵinj = core["ɵɵdefineInjector"]({ factory: function NzNotificationModule_Factory(t) { return new (t || NzNotificationModule)(); }, imports: [[common.CommonModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzOutletModule, NzNotificationServiceModule]] });
        return NzNotificationModule;
    }());
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && core["ɵɵsetNgModuleScope"](NzNotificationModule, { declarations: [NzNotificationComponent, NzNotificationContainerComponent], imports: [common.CommonModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzOutletModule, NzNotificationServiceModule] }); })();
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzNotificationModule, [{
            type: core.NgModule,
            args: [{
                    imports: [common.CommonModule, overlay.OverlayModule, icon.NzIconModule, core$1.NzOutletModule, NzNotificationServiceModule],
                    declarations: [NzNotificationComponent, NzNotificationContainerComponent]
                }]
        }], null, null); })();

    var globalCounter = 0;
    var NzNotificationService = /** @class */ (function () {
        function NzNotificationService(nzSingletonService, overlay, injector) {
            this.nzSingletonService = nzSingletonService;
            this.overlay = overlay;
            this.injector = injector;
            this.name = 'notification-';
        }
        NzNotificationService.prototype.remove = function (messageId) {
            if (messageId) {
                this.container.removeMessage(messageId);
            }
            else {
                this.container.removeMessageAll();
            }
        };
        NzNotificationService.prototype.createMessage = function (message, options) {
            this.container = this.withContainer();
            this.nzSingletonService.registerSingletonWithKey(this.name, this.container);
            var resultMessage = __assign(__assign({}, message), {
                createdAt: new Date(),
                messageId: this.generateMessageId(),
                options: options
            });
            this.container.createMessage(resultMessage);
            return resultMessage;
        };
        NzNotificationService.prototype.generateMessageId = function () {
            return this.name + "-" + globalCounter++;
        };
        // Manually creating container for overlay to avoid multi-checking error, see: https://github.com/NG-ZORRO/ng-zorro-antd/issues/391
        // NOTE: we never clean up the container component and it's overlay resources, if we should, we need to do it by our own codes.
        NzNotificationService.prototype.withContainer = function () {
            var containerInstance = this.nzSingletonService.getSingletonWithKey(this.name);
            if (containerInstance) {
                return containerInstance;
            }
            var overlayRef = this.overlay.create({
                hasBackdrop: false,
                scrollStrategy: this.overlay.scrollStrategies.noop(),
                positionStrategy: this.overlay.position().global()
            });
            var componentPortal = new portal.ComponentPortal(NzNotificationContainerComponent, null, this.injector);
            var componentRef = overlayRef.attach(componentPortal);
            var overlayPane = overlayRef.overlayElement;
            overlayPane.style.zIndex = '1010'; // Patching: assign the same zIndex of ant-message to it's parent overlay panel, to the ant-message's zindex work.
            return componentRef.instance;
        };
        // Shortcut methods
        NzNotificationService.prototype.success = function (title, content, options) {
            return this.createMessage({ type: 'success', title: title, content: content }, options);
        };
        NzNotificationService.prototype.error = function (title, content, options) {
            return this.createMessage({ type: 'error', title: title, content: content }, options);
        };
        NzNotificationService.prototype.info = function (title, content, options) {
            return this.createMessage({ type: 'info', title: title, content: content }, options);
        };
        NzNotificationService.prototype.warning = function (title, content, options) {
            return this.createMessage({ type: 'warning', title: title, content: content }, options);
        };
        NzNotificationService.prototype.blank = function (title, content, options) {
            return this.createMessage({ type: 'blank', title: title, content: content }, options);
        };
        NzNotificationService.prototype.create = function (type, title, content, options) {
            return this.createMessage({ type: type, title: title, content: content }, options);
        };
        // For content with template
        NzNotificationService.prototype.template = function (template, options) {
            return this.createMessage({ template: template }, options);
        };
        /** @nocollapse */ NzNotificationService.ɵfac = function NzNotificationService_Factory(t) { return new (t || NzNotificationService)(core["ɵɵinject"](core$1.NzSingletonService), core["ɵɵinject"](overlay.Overlay), core["ɵɵinject"](core.Injector)); };
        /** @nocollapse */ NzNotificationService.ɵprov = core["ɵɵdefineInjectable"]({ token: NzNotificationService, factory: NzNotificationService.ɵfac, providedIn: NzNotificationServiceModule });
        return NzNotificationService;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzNotificationService, [{
            type: core.Injectable,
            args: [{
                    providedIn: NzNotificationServiceModule
                }]
        }], function () { return [{ type: core$1.NzSingletonService }, { type: overlay.Overlay }, { type: core.Injector }]; }, null); })();

    exports.NzNotificationComponent = NzNotificationComponent;
    exports.NzNotificationContainerComponent = NzNotificationContainerComponent;
    exports.NzNotificationModule = NzNotificationModule;
    exports.NzNotificationService = NzNotificationService;
    exports.NzNotificationServiceModule = NzNotificationServiceModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=ng-zorro-antd-notification.umd.js.map
