(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/keycodes'), require('@angular/cdk/platform'), require('@angular/core'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('ng-zorro-antd/core'), require('ng-zorro-antd/tooltip'), require('@angular/common')) :
    typeof define === 'function' && define.amd ? define('ng-zorro-antd/slider', ['exports', '@angular/cdk/keycodes', '@angular/cdk/platform', '@angular/core', '@angular/forms', 'rxjs', 'rxjs/operators', 'ng-zorro-antd/core', 'ng-zorro-antd/tooltip', '@angular/common'], factory) :
    (global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].slider = {}), global.ng.cdk.keycodes, global.ng.cdk.platform, global.ng.core, global.ng.forms, global.rxjs, global.rxjs.operators, global['ng-zorro-antd'].core, global['ng-zorro-antd'].tooltip, global.ng.common));
}(this, (function (exports, keycodes, platform, core, forms, rxjs, operators, core$1, tooltip, common) { '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
     */
    var NzSliderService = /** @class */ (function () {
        function NzSliderService() {
            this.isDragging = false;
        }
        /** @nocollapse */ NzSliderService.ɵfac = function NzSliderService_Factory(t) { return new (t || NzSliderService)(); };
        /** @nocollapse */ NzSliderService.ɵprov = core["ɵɵdefineInjectable"]({ token: NzSliderService, factory: NzSliderService.ɵfac });
        return NzSliderService;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderService, [{
            type: core.Injectable
        }], null, null); })();

    var _c0 = ["handle"];
    var NzSliderHandleComponent = /** @class */ (function () {
        function NzSliderHandleComponent(sliderService, cdr) {
            var _this = this;
            this.sliderService = sliderService;
            this.cdr = cdr;
            this.tooltipVisible = 'default';
            this.active = false;
            this.style = {};
            this.enterHandle = function () {
                if (!_this.sliderService.isDragging) {
                    _this.toggleTooltip(true);
                    _this.updateTooltipPosition();
                    _this.cdr.detectChanges();
                }
            };
            this.leaveHandle = function () {
                if (!_this.sliderService.isDragging) {
                    _this.toggleTooltip(false);
                    _this.cdr.detectChanges();
                }
            };
        }
        NzSliderHandleComponent.prototype.ngOnChanges = function (changes) {
            var _this = this;
            var offset = changes.offset, value = changes.value, active = changes.active, tooltipVisible = changes.tooltipVisible;
            if (offset) {
                this.updateStyle();
            }
            if (value) {
                this.updateTooltipTitle();
                this.updateTooltipPosition();
            }
            if (active) {
                if (active.currentValue) {
                    this.toggleTooltip(true);
                }
                else {
                    this.toggleTooltip(false);
                }
            }
            if (tooltipVisible && tooltipVisible.currentValue === 'always') {
                Promise.resolve().then(function () { return _this.toggleTooltip(true, true); });
            }
        };
        NzSliderHandleComponent.prototype.focus = function () {
            this.handleEl.nativeElement.focus();
        };
        NzSliderHandleComponent.prototype.toggleTooltip = function (show, force) {
            if (force === void 0) { force = false; }
            if (!force && (this.tooltipVisible !== 'default' || !this.tooltip)) {
                return;
            }
            if (show) {
                this.tooltip.show();
            }
            else {
                this.tooltip.hide();
            }
        };
        NzSliderHandleComponent.prototype.updateTooltipTitle = function () {
            this.tooltipTitle = this.tooltipFormatter ? this.tooltipFormatter(this.value) : "" + this.value;
        };
        NzSliderHandleComponent.prototype.updateTooltipPosition = function () {
            var _this = this;
            if (this.tooltip) {
                Promise.resolve().then(function () { return _this.tooltip.updatePosition(); });
            }
        };
        NzSliderHandleComponent.prototype.updateStyle = function () {
            var _a;
            this.style = (_a = {},
                _a[this.vertical ? 'bottom' : 'left'] = this.offset + "%",
                _a.transform = this.vertical ? null : 'translateX(-50%)',
                _a);
            this.cdr.markForCheck();
        };
        /** @nocollapse */ NzSliderHandleComponent.ɵfac = function NzSliderHandleComponent_Factory(t) { return new (t || NzSliderHandleComponent)(core["ɵɵdirectiveInject"](NzSliderService), core["ɵɵdirectiveInject"](core.ChangeDetectorRef)); };
        /** @nocollapse */ NzSliderHandleComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSliderHandleComponent, selectors: [["nz-slider-handle"]], viewQuery: function NzSliderHandleComponent_Query(rf, ctx) { if (rf & 1) {
                core["ɵɵviewQuery"](_c0, true);
                core["ɵɵviewQuery"](tooltip.NzTooltipDirective, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.handleEl = _t.first);
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.tooltip = _t.first);
            } }, hostBindings: function NzSliderHandleComponent_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵlistener"]("mouseenter", function NzSliderHandleComponent_mouseenter_HostBindingHandler() { return ctx.enterHandle(); })("mouseleave", function NzSliderHandleComponent_mouseleave_HostBindingHandler() { return ctx.leaveHandle(); });
            } }, inputs: { vertical: "vertical", offset: "offset", value: "value", tooltipVisible: "tooltipVisible", tooltipPlacement: "tooltipPlacement", tooltipFormatter: "tooltipFormatter", active: "active" }, exportAs: ["nzSliderHandle"], features: [core["ɵɵNgOnChangesFeature"]], decls: 2, vars: 4, consts: [["tabindex", "0", "nz-tooltip", "", 1, "ant-slider-handle", 3, "ngStyle", "nzTooltipTitle", "nzTooltipTrigger", "nzTooltipPlacement"], ["handle", ""]], template: function NzSliderHandleComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelement"](0, "div", 0, 1);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngStyle", ctx.style)("nzTooltipTitle", ctx.tooltipFormatter === null || ctx.tooltipVisible === "never" ? null : ctx.tooltipTitle)("nzTooltipTrigger", null)("nzTooltipPlacement", ctx.tooltipPlacement);
            } }, directives: [tooltip.NzTooltipDirective, common.NgStyle], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderHandleComponent.prototype, "active", void 0);
        return NzSliderHandleComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderHandleComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-slider-handle',
                    exportAs: 'nzSliderHandle',
                    preserveWhitespaces: false,
                    template: "\n    <div\n      #handle\n      class=\"ant-slider-handle\"\n      tabindex=\"0\"\n      nz-tooltip\n      [ngStyle]=\"style\"\n      [nzTooltipTitle]=\"tooltipFormatter === null || tooltipVisible === 'never' ? null : tooltipTitle\"\n      [nzTooltipTrigger]=\"null\"\n      [nzTooltipPlacement]=\"tooltipPlacement\"\n    ></div>\n  ",
                    host: {
                        '(mouseenter)': 'enterHandle()',
                        '(mouseleave)': 'leaveHandle()'
                    }
                }]
        }], function () { return [{ type: NzSliderService }, { type: core.ChangeDetectorRef }]; }, { handleEl: [{
                type: core.ViewChild,
                args: ['handle', { static: false }]
            }], tooltip: [{
                type: core.ViewChild,
                args: [tooltip.NzTooltipDirective, { static: false }]
            }], vertical: [{
                type: core.Input
            }], offset: [{
                type: core.Input
            }], value: [{
                type: core.Input
            }], tooltipVisible: [{
                type: core.Input
            }], tooltipPlacement: [{
                type: core.Input
            }], tooltipFormatter: [{
                type: core.Input
            }], active: [{
                type: core.Input
            }] }); })();

    var NzSliderTrackComponent = /** @class */ (function () {
        function NzSliderTrackComponent() {
            this.vertical = false;
            this.included = false;
            this.style = {};
        }
        NzSliderTrackComponent.prototype.ngOnChanges = function (changes) {
            if (changes.included) {
                this.style.visibility = this.included ? 'visible' : 'hidden';
            }
            if (changes.vertical || changes.offset || changes.length) {
                if (this.vertical) {
                    this.style.bottom = this.offset + "%";
                    this.style.height = this.length + "%";
                    this.style.left = null;
                    this.style.width = null;
                }
                else {
                    this.style.left = this.offset + "%";
                    this.style.width = this.length + "%";
                    this.style.bottom = null;
                    this.style.height = null;
                }
            }
        };
        /** @nocollapse */ NzSliderTrackComponent.ɵfac = function NzSliderTrackComponent_Factory(t) { return new (t || NzSliderTrackComponent)(); };
        /** @nocollapse */ NzSliderTrackComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSliderTrackComponent, selectors: [["nz-slider-track"]], inputs: { offset: "offset", length: "length", vertical: "vertical", included: "included" }, exportAs: ["nzSliderTrack"], features: [core["ɵɵNgOnChangesFeature"]], decls: 1, vars: 1, consts: [[1, "ant-slider-track", 3, "ngStyle"]], template: function NzSliderTrackComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelement"](0, "div", 0);
            } if (rf & 2) {
                core["ɵɵproperty"]("ngStyle", ctx.style);
            } }, directives: [common.NgStyle], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Number)
        ], NzSliderTrackComponent.prototype, "offset", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Number)
        ], NzSliderTrackComponent.prototype, "length", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderTrackComponent.prototype, "vertical", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderTrackComponent.prototype, "included", void 0);
        return NzSliderTrackComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderTrackComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-slider-track',
                    exportAs: 'nzSliderTrack',
                    preserveWhitespaces: false,
                    template: "\n    <div class=\"ant-slider-track\" [ngStyle]=\"style\"></div>\n  "
                }]
        }], null, { offset: [{
                type: core.Input
            }], length: [{
                type: core.Input
            }], vertical: [{
                type: core.Input
            }], included: [{
                type: core.Input
            }] }); })();

    function NzSliderStepComponent_span_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "span", 2);
    } if (rf & 2) {
        var mark_r875 = ctx.$implicit;
        core["ɵɵclassProp"]("ant-slider-dot-active", mark_r875.active);
        core["ɵɵproperty"]("ngStyle", mark_r875.style);
    } }
    var NzSliderStepComponent = /** @class */ (function () {
        function NzSliderStepComponent() {
            this.lowerBound = null;
            this.upperBound = null;
            this.vertical = false;
            this.included = false;
        }
        NzSliderStepComponent.prototype.ngOnChanges = function (changes) {
            if (changes.marksArray) {
                this.buildSteps();
            }
            if (changes.marksArray || changes.lowerBound || changes.upperBound) {
                this.togglePointActive();
            }
        };
        NzSliderStepComponent.prototype.trackById = function (_index, step) {
            return step.value;
        };
        NzSliderStepComponent.prototype.buildSteps = function () {
            var orient = this.vertical ? 'bottom' : 'left';
            this.steps = this.marksArray.map(function (mark) {
                var _a;
                var value = mark.value, offset = mark.offset, config = mark.config;
                return {
                    value: value,
                    offset: offset,
                    config: config,
                    active: false,
                    style: (_a = {},
                        _a[orient] = offset + "%",
                        _a)
                };
            });
        };
        NzSliderStepComponent.prototype.togglePointActive = function () {
            var _this = this;
            if (this.steps && this.lowerBound !== null && this.upperBound !== null) {
                this.steps.forEach(function (step) {
                    var value = step.value;
                    var isActive = (!_this.included && value === _this.upperBound) || (_this.included && value <= _this.upperBound && value >= _this.lowerBound);
                    step.active = isActive;
                });
            }
        };
        /** @nocollapse */ NzSliderStepComponent.ɵfac = function NzSliderStepComponent_Factory(t) { return new (t || NzSliderStepComponent)(); };
        /** @nocollapse */ NzSliderStepComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSliderStepComponent, selectors: [["nz-slider-step"]], inputs: { lowerBound: "lowerBound", upperBound: "upperBound", marksArray: "marksArray", vertical: "vertical", included: "included" }, exportAs: ["nzSliderStep"], features: [core["ɵɵNgOnChangesFeature"]], decls: 2, vars: 2, consts: [[1, "ant-slider-step"], ["class", "ant-slider-dot", 3, "ant-slider-dot-active", "ngStyle", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "ant-slider-dot", 3, "ngStyle"]], template: function NzSliderStepComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div", 0);
                core["ɵɵtemplate"](1, NzSliderStepComponent_span_1_Template, 1, 3, "span", 1);
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.steps)("ngForTrackBy", ctx.trackById);
            } }, directives: [common.NgForOf, common.NgStyle], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderStepComponent.prototype, "vertical", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderStepComponent.prototype, "included", void 0);
        return NzSliderStepComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderStepComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-slider-step',
                    exportAs: 'nzSliderStep',
                    preserveWhitespaces: false,
                    template: "\n    <div class=\"ant-slider-step\">\n      <span\n        class=\"ant-slider-dot\"\n        *ngFor=\"let mark of steps; trackBy: trackById\"\n        [class.ant-slider-dot-active]=\"mark.active\"\n        [ngStyle]=\"mark.style\"\n      >\n      </span>\n    </div>\n  "
                }]
        }], null, { lowerBound: [{
                type: core.Input
            }], upperBound: [{
                type: core.Input
            }], marksArray: [{
                type: core.Input
            }], vertical: [{
                type: core.Input
            }], included: [{
                type: core.Input
            }] }); })();

    function NzSliderMarksComponent_span_1_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "span", 2);
    } if (rf & 2) {
        var attr_r873 = ctx.$implicit;
        core["ɵɵclassProp"]("ant-slider-mark-active", attr_r873.active);
        core["ɵɵproperty"]("ngStyle", attr_r873.style)("innerHTML", attr_r873.label, core["ɵɵsanitizeHtml"]);
    } }
    var NzSliderMarksComponent = /** @class */ (function () {
        function NzSliderMarksComponent() {
            this.lowerBound = null;
            this.upperBound = null;
            this.vertical = false;
            this.included = false;
        }
        NzSliderMarksComponent.prototype.ngOnChanges = function (changes) {
            var marksArray = changes.marksArray, lowerBound = changes.lowerBound, upperBound = changes.upperBound;
            if (marksArray) {
                this.buildMarks();
            }
            if (marksArray || lowerBound || upperBound) {
                this.togglePointActive();
            }
        };
        NzSliderMarksComponent.prototype.trackById = function (_index, mark) {
            return mark.value;
        };
        NzSliderMarksComponent.prototype.buildMarks = function () {
            var _this = this;
            var range = this.max - this.min;
            this.marks = this.marksArray.map(function (mark) {
                var value = mark.value, offset = mark.offset, config = mark.config;
                var style = _this.getMarkStyles(value, range, config);
                var label = isConfigObject(config) ? config.label : config;
                return {
                    label: label,
                    offset: offset,
                    style: style,
                    value: value,
                    config: config,
                    active: false
                };
            });
        };
        NzSliderMarksComponent.prototype.getMarkStyles = function (value, range, config) {
            var style;
            if (this.vertical) {
                style = {
                    marginBottom: '-50%',
                    bottom: ((value - this.min) / range) * 100 + "%"
                };
            }
            else {
                style = {
                    transform: "translate3d(-50%, 0, 0)",
                    left: ((value - this.min) / range) * 100 + "%"
                };
            }
            if (isConfigObject(config) && config.style) {
                style = __assign(__assign({}, style), config.style);
            }
            return style;
        };
        NzSliderMarksComponent.prototype.togglePointActive = function () {
            var _this = this;
            if (this.marks && this.lowerBound !== null && this.upperBound !== null) {
                this.marks.forEach(function (mark) {
                    var value = mark.value;
                    var isActive = (!_this.included && value === _this.upperBound) || (_this.included && value <= _this.upperBound && value >= _this.lowerBound);
                    mark.active = isActive;
                });
            }
        };
        /** @nocollapse */ NzSliderMarksComponent.ɵfac = function NzSliderMarksComponent_Factory(t) { return new (t || NzSliderMarksComponent)(); };
        /** @nocollapse */ NzSliderMarksComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSliderMarksComponent, selectors: [["nz-slider-marks"]], inputs: { lowerBound: "lowerBound", upperBound: "upperBound", marksArray: "marksArray", min: "min", max: "max", vertical: "vertical", included: "included" }, exportAs: ["nzSliderMarks"], features: [core["ɵɵNgOnChangesFeature"]], decls: 2, vars: 2, consts: [[1, "ant-slider-mark"], ["class", "ant-slider-mark-text", 3, "ant-slider-mark-active", "ngStyle", "innerHTML", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "ant-slider-mark-text", 3, "ngStyle", "innerHTML"]], template: function NzSliderMarksComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div", 0);
                core["ɵɵtemplate"](1, NzSliderMarksComponent_span_1_Template, 1, 4, "span", 1);
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.marks)("ngForTrackBy", ctx.trackById);
            } }, directives: [common.NgForOf, common.NgStyle], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderMarksComponent.prototype, "vertical", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderMarksComponent.prototype, "included", void 0);
        return NzSliderMarksComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderMarksComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    preserveWhitespaces: false,
                    selector: 'nz-slider-marks',
                    exportAs: 'nzSliderMarks',
                    template: "\n    <div class=\"ant-slider-mark\">\n      <span\n        class=\"ant-slider-mark-text\"\n        *ngFor=\"let attr of marks; trackBy: trackById\"\n        [class.ant-slider-mark-active]=\"attr.active\"\n        [ngStyle]=\"attr.style\"\n        [innerHTML]=\"attr.label\"\n      >\n      </span>\n    </div>\n  "
                }]
        }], null, { lowerBound: [{
                type: core.Input
            }], upperBound: [{
                type: core.Input
            }], marksArray: [{
                type: core.Input
            }], min: [{
                type: core.Input
            }], max: [{
                type: core.Input
            }], vertical: [{
                type: core.Input
            }], included: [{
                type: core.Input
            }] }); })();
    function isConfigObject(config) {
        return typeof config !== 'string';
    }

    var _c0$1 = ["slider"];
    function NzSliderComponent_nz_slider_step_4_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "nz-slider-step", 7);
    } if (rf & 2) {
        var ctx_r868 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("vertical", ctx_r868.nzVertical)("lowerBound", ctx_r868.bounds.lower)("upperBound", ctx_r868.bounds.upper)("marksArray", ctx_r868.marksArray)("included", ctx_r868.nzIncluded);
    } }
    function NzSliderComponent_nz_slider_handle_5_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "nz-slider-handle", 8);
    } if (rf & 2) {
        var handle_r871 = ctx.$implicit;
        var ctx_r869 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("vertical", ctx_r869.nzVertical)("offset", handle_r871.offset)("value", handle_r871.value)("active", handle_r871.active)("tooltipFormatter", ctx_r869.nzTipFormatter)("tooltipVisible", ctx_r869.nzTooltipVisible)("tooltipPlacement", ctx_r869.nzTooltipPlacement);
    } }
    function NzSliderComponent_nz_slider_marks_6_Template(rf, ctx) { if (rf & 1) {
        core["ɵɵelement"](0, "nz-slider-marks", 9);
    } if (rf & 2) {
        var ctx_r870 = core["ɵɵnextContext"]();
        core["ɵɵproperty"]("vertical", ctx_r870.nzVertical)("min", ctx_r870.nzMin)("max", ctx_r870.nzMax)("lowerBound", ctx_r870.bounds.lower)("upperBound", ctx_r870.bounds.upper)("marksArray", ctx_r870.marksArray)("included", ctx_r870.nzIncluded);
    } }
    var NzSliderComponent = /** @class */ (function () {
        function NzSliderComponent(sliderService, cdr, platform) {
            this.sliderService = sliderService;
            this.cdr = cdr;
            this.platform = platform;
            this.nzDisabled = false;
            this.nzDots = false;
            this.nzIncluded = true;
            this.nzRange = false;
            this.nzVertical = false;
            this.nzMarks = null;
            this.nzMax = 100;
            this.nzMin = 0;
            this.nzStep = 1;
            this.nzTooltipVisible = 'default';
            this.nzTooltipPlacement = 'top';
            this.nzOnAfterChange = new core.EventEmitter();
            this.value = null;
            this.cacheSliderStart = null;
            this.cacheSliderLength = null;
            this.activeValueIndex = undefined; // Current activated handle's index ONLY for range=true
            this.track = { offset: null, length: null }; // Track's offset and length
            this.bounds = { lower: null, upper: null }; // now for nz-slider-step
        }
        NzSliderComponent.prototype.ngOnInit = function () {
            this.handles = generateHandlers(this.nzRange ? 2 : 1);
            this.marksArray = this.nzMarks ? this.generateMarkItems(this.nzMarks) : null;
            this.bindDraggingHandlers();
            this.toggleDragDisabled(this.nzDisabled);
            if (this.getValue() === null) {
                this.setValue(this.formatValue(null));
            }
        };
        NzSliderComponent.prototype.ngOnChanges = function (changes) {
            var nzDisabled = changes.nzDisabled, nzMarks = changes.nzMarks, nzRange = changes.nzRange;
            if (nzDisabled && !nzDisabled.firstChange) {
                this.toggleDragDisabled(nzDisabled.currentValue);
            }
            else if (nzMarks && !nzMarks.firstChange) {
                this.marksArray = this.nzMarks ? this.generateMarkItems(this.nzMarks) : null;
            }
            else if (nzRange && !nzRange.firstChange) {
                this.setValue(this.formatValue(null));
            }
        };
        NzSliderComponent.prototype.ngOnDestroy = function () {
            this.unsubscribeDrag();
        };
        NzSliderComponent.prototype.writeValue = function (val) {
            this.setValue(val, true);
        };
        NzSliderComponent.prototype.onValueChange = function (_value) { };
        NzSliderComponent.prototype.onTouched = function () { };
        NzSliderComponent.prototype.registerOnChange = function (fn) {
            this.onValueChange = fn;
        };
        NzSliderComponent.prototype.registerOnTouched = function (fn) {
            this.onTouched = fn;
        };
        NzSliderComponent.prototype.setDisabledState = function (isDisabled) {
            this.nzDisabled = isDisabled;
            this.toggleDragDisabled(isDisabled);
        };
        /**
         * Event handler is only triggered when a slider handler is focused.
         */
        NzSliderComponent.prototype.onKeyDown = function (e) {
            var code = e.keyCode;
            var isIncrease = code === keycodes.RIGHT_ARROW || code === keycodes.UP_ARROW;
            var isDecrease = code === keycodes.LEFT_ARROW || code === keycodes.DOWN_ARROW;
            if (!(isIncrease || isDecrease)) {
                return;
            }
            e.preventDefault();
            var step = isDecrease ? -this.nzStep : this.nzStep;
            var newVal = this.nzRange ? this.value[this.activeValueIndex] + step : this.value + step;
            this.setActiveValue(core$1.ensureNumberInRange(newVal, this.nzMin, this.nzMax));
        };
        NzSliderComponent.prototype.setValue = function (value, isWriteValue) {
            if (isWriteValue === void 0) { isWriteValue = false; }
            if (isWriteValue) {
                this.value = this.formatValue(value);
                this.updateTrackAndHandles();
            }
            else if (!valuesEqual(this.value, value)) {
                this.value = value;
                this.updateTrackAndHandles();
                this.onValueChange(this.getValue(true));
            }
        };
        NzSliderComponent.prototype.getValue = function (cloneAndSort) {
            if (cloneAndSort === void 0) { cloneAndSort = false; }
            if (cloneAndSort && this.value && isValueRange(this.value)) {
                return __spread(this.value).sort(function (a, b) { return a - b; });
            }
            return this.value;
        };
        /**
         * Clone & sort current value and convert them to offsets, then return the new one.
         */
        NzSliderComponent.prototype.getValueToOffset = function (value) {
            var _this = this;
            var normalizedValue = value;
            if (typeof normalizedValue === 'undefined') {
                normalizedValue = this.getValue(true);
            }
            return isValueRange(normalizedValue) ? normalizedValue.map(function (val) { return _this.valueToOffset(val); }) : this.valueToOffset(normalizedValue);
        };
        /**
         * Find the closest value to be activated.
         */
        NzSliderComponent.prototype.setActiveValueIndex = function (pointerValue) {
            var value = this.getValue();
            if (isValueRange(value)) {
                var minimal_1 = null;
                var gap_1;
                var activeIndex_1 = -1;
                value.forEach(function (val, index) {
                    gap_1 = Math.abs(pointerValue - val);
                    if (minimal_1 === null || gap_1 < minimal_1) {
                        minimal_1 = gap_1;
                        activeIndex_1 = index;
                    }
                });
                this.activeValueIndex = activeIndex_1;
                this.handlerComponents.toArray()[activeIndex_1].focus();
            }
            else {
                this.handlerComponents.toArray()[0].focus();
            }
        };
        NzSliderComponent.prototype.setActiveValue = function (pointerValue) {
            if (isValueRange(this.value)) {
                var newValue = __spread(this.value);
                newValue[this.activeValueIndex] = pointerValue;
                this.setValue(newValue);
            }
            else {
                this.setValue(pointerValue);
            }
        };
        /**
         * Update track and handles' position and length.
         */
        NzSliderComponent.prototype.updateTrackAndHandles = function () {
            var _a, _b;
            var value = this.getValue();
            var offset = this.getValueToOffset(value);
            var valueSorted = this.getValue(true);
            var offsetSorted = this.getValueToOffset(valueSorted);
            var boundParts = isValueRange(valueSorted) ? valueSorted : [0, valueSorted];
            var trackParts = isValueRange(offsetSorted) ? [offsetSorted[0], offsetSorted[1] - offsetSorted[0]] : [0, offsetSorted];
            this.handles.forEach(function (handle, index) {
                handle.offset = isValueRange(offset) ? offset[index] : offset;
                handle.value = isValueRange(value) ? value[index] : value || 0;
            });
            _a = __read(boundParts, 2), this.bounds.lower = _a[0], this.bounds.upper = _a[1];
            _b = __read(trackParts, 2), this.track.offset = _b[0], this.track.length = _b[1];
            this.cdr.markForCheck();
        };
        NzSliderComponent.prototype.onDragStart = function (value) {
            this.toggleDragMoving(true);
            this.cacheSliderProperty();
            this.setActiveValueIndex(value);
            this.setActiveValue(value);
            this.showHandleTooltip(this.nzRange ? this.activeValueIndex : 0);
        };
        NzSliderComponent.prototype.onDragMove = function (value) {
            this.setActiveValue(value);
            this.cdr.markForCheck();
        };
        NzSliderComponent.prototype.onDragEnd = function () {
            this.nzOnAfterChange.emit(this.getValue(true));
            this.toggleDragMoving(false);
            this.cacheSliderProperty(true);
            this.hideAllHandleTooltip();
            this.cdr.markForCheck();
        };
        /**
         * Create user interactions handles.
         */
        NzSliderComponent.prototype.bindDraggingHandlers = function () {
            var _this = this;
            if (!this.platform.isBrowser) {
                return;
            }
            var sliderDOM = this.slider.nativeElement;
            var orientField = this.nzVertical ? 'pageY' : 'pageX';
            var mouse = {
                start: 'mousedown',
                move: 'mousemove',
                end: 'mouseup',
                pluckKey: [orientField]
            };
            var touch = {
                start: 'touchstart',
                move: 'touchmove',
                end: 'touchend',
                pluckKey: ['touches', '0', orientField],
                filter: function (e) { return e instanceof TouchEvent; }
            };
            [mouse, touch].forEach(function (source) {
                var start = source.start, move = source.move, end = source.end, pluckKey = source.pluckKey, _a = source.filter, filterFunc = _a === void 0 ? function () { return true; } : _a;
                source.startPlucked$ = rxjs.fromEvent(sliderDOM, start).pipe(operators.filter(filterFunc), operators.tap(core$1.silentEvent), operators.pluck.apply(void 0, __spread(pluckKey)), operators.map(function (position) { return _this.findClosestValue(position); }));
                source.end$ = rxjs.fromEvent(document, end);
                source.moveResolved$ = rxjs.fromEvent(document, move).pipe(operators.filter(filterFunc), operators.tap(core$1.silentEvent), operators.pluck.apply(void 0, __spread(pluckKey)), operators.distinctUntilChanged(), operators.map(function (position) { return _this.findClosestValue(position); }), operators.distinctUntilChanged(), operators.takeUntil(source.end$));
            });
            this.dragStart$ = rxjs.merge(mouse.startPlucked$, touch.startPlucked$);
            this.dragMove$ = rxjs.merge(mouse.moveResolved$, touch.moveResolved$);
            this.dragEnd$ = rxjs.merge(mouse.end$, touch.end$);
        };
        NzSliderComponent.prototype.subscribeDrag = function (periods) {
            if (periods === void 0) { periods = ['start', 'move', 'end']; }
            if (periods.indexOf('start') !== -1 && this.dragStart$ && !this.dragStart_) {
                this.dragStart_ = this.dragStart$.subscribe(this.onDragStart.bind(this));
            }
            if (periods.indexOf('move') !== -1 && this.dragMove$ && !this.dragMove_) {
                this.dragMove_ = this.dragMove$.subscribe(this.onDragMove.bind(this));
            }
            if (periods.indexOf('end') !== -1 && this.dragEnd$ && !this.dragEnd_) {
                this.dragEnd_ = this.dragEnd$.subscribe(this.onDragEnd.bind(this));
            }
        };
        NzSliderComponent.prototype.unsubscribeDrag = function (periods) {
            if (periods === void 0) { periods = ['start', 'move', 'end']; }
            if (periods.indexOf('start') !== -1 && this.dragStart_) {
                this.dragStart_.unsubscribe();
                this.dragStart_ = null;
            }
            if (periods.indexOf('move') !== -1 && this.dragMove_) {
                this.dragMove_.unsubscribe();
                this.dragMove_ = null;
            }
            if (periods.indexOf('end') !== -1 && this.dragEnd_) {
                this.dragEnd_.unsubscribe();
                this.dragEnd_ = null;
            }
        };
        NzSliderComponent.prototype.toggleDragMoving = function (movable) {
            var periods = ['move', 'end'];
            if (movable) {
                this.sliderService.isDragging = true;
                this.subscribeDrag(periods);
            }
            else {
                this.sliderService.isDragging = false;
                this.unsubscribeDrag(periods);
            }
        };
        NzSliderComponent.prototype.toggleDragDisabled = function (disabled) {
            if (disabled) {
                this.unsubscribeDrag();
            }
            else {
                this.subscribeDrag(['start']);
            }
        };
        NzSliderComponent.prototype.findClosestValue = function (position) {
            var sliderStart = this.getSliderStartPosition();
            var sliderLength = this.getSliderLength();
            var ratio = core$1.ensureNumberInRange((position - sliderStart) / sliderLength, 0, 1);
            var val = (this.nzMax - this.nzMin) * (this.nzVertical ? 1 - ratio : ratio) + this.nzMin;
            var points = this.nzMarks === null ? [] : Object.keys(this.nzMarks).map(parseFloat);
            if (this.nzStep !== 0 && !this.nzDots) {
                var closestOne = Math.round(val / this.nzStep) * this.nzStep;
                points.push(closestOne);
            }
            var gaps = points.map(function (point) { return Math.abs(val - point); });
            var closest = points[gaps.indexOf(Math.min.apply(Math, __spread(gaps)))];
            return this.nzStep === null ? closest : parseFloat(closest.toFixed(core$1.getPrecision(this.nzStep)));
        };
        NzSliderComponent.prototype.valueToOffset = function (value) {
            return core$1.getPercent(this.nzMin, this.nzMax, value);
        };
        NzSliderComponent.prototype.getSliderStartPosition = function () {
            if (this.cacheSliderStart !== null) {
                return this.cacheSliderStart;
            }
            var offset = core$1.getElementOffset(this.slider.nativeElement);
            return this.nzVertical ? offset.top : offset.left;
        };
        NzSliderComponent.prototype.getSliderLength = function () {
            if (this.cacheSliderLength !== null) {
                return this.cacheSliderLength;
            }
            var sliderDOM = this.slider.nativeElement;
            return this.nzVertical ? sliderDOM.clientHeight : sliderDOM.clientWidth;
        };
        /**
         * Cache DOM layout/reflow operations for performance (may not necessary?)
         */
        NzSliderComponent.prototype.cacheSliderProperty = function (remove) {
            if (remove === void 0) { remove = false; }
            this.cacheSliderStart = remove ? null : this.getSliderStartPosition();
            this.cacheSliderLength = remove ? null : this.getSliderLength();
        };
        NzSliderComponent.prototype.formatValue = function (value) {
            var _this = this;
            if (!value) {
                return this.nzRange ? [this.nzMin, this.nzMax] : this.nzMin;
            }
            else if (assertValueValid(value, this.nzRange)) {
                return isValueRange(value)
                    ? value.map(function (val) { return core$1.ensureNumberInRange(val, _this.nzMin, _this.nzMax); })
                    : core$1.ensureNumberInRange(value, this.nzMin, this.nzMax);
            }
            else {
                return this.nzDefaultValue ? this.nzDefaultValue : this.nzRange ? [this.nzMin, this.nzMax] : this.nzMin;
            }
        };
        /**
         * Show one handle's tooltip and hide others'.
         */
        NzSliderComponent.prototype.showHandleTooltip = function (handleIndex) {
            if (handleIndex === void 0) { handleIndex = 0; }
            this.handles.forEach(function (handle, index) {
                handle.active = index === handleIndex;
            });
        };
        NzSliderComponent.prototype.hideAllHandleTooltip = function () {
            this.handles.forEach(function (handle) { return (handle.active = false); });
        };
        NzSliderComponent.prototype.generateMarkItems = function (marks) {
            var marksArray = [];
            for (var key in marks) {
                var mark = marks[key];
                var val = typeof key === 'number' ? key : parseFloat(key);
                if (val >= this.nzMin && val <= this.nzMax) {
                    marksArray.push({ value: val, offset: this.valueToOffset(val), config: mark });
                }
            }
            return marksArray.length ? marksArray : null;
        };
        /** @nocollapse */ NzSliderComponent.ɵfac = function NzSliderComponent_Factory(t) { return new (t || NzSliderComponent)(core["ɵɵdirectiveInject"](NzSliderService), core["ɵɵdirectiveInject"](core.ChangeDetectorRef), core["ɵɵdirectiveInject"](platform.Platform)); };
        /** @nocollapse */ NzSliderComponent.ɵcmp = core["ɵɵdefineComponent"]({ type: NzSliderComponent, selectors: [["nz-slider"]], viewQuery: function NzSliderComponent_Query(rf, ctx) { if (rf & 1) {
                core["ɵɵstaticViewQuery"](_c0$1, true);
                core["ɵɵviewQuery"](NzSliderHandleComponent, true);
            } if (rf & 2) {
                var _t;
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.slider = _t.first);
                core["ɵɵqueryRefresh"](_t = core["ɵɵloadQuery"]()) && (ctx.handlerComponents = _t);
            } }, hostBindings: function NzSliderComponent_HostBindings(rf, ctx) { if (rf & 1) {
                core["ɵɵlistener"]("keydown", function NzSliderComponent_keydown_HostBindingHandler($event) { return ctx.onKeyDown($event); });
            } }, inputs: { nzDisabled: "nzDisabled", nzDots: "nzDots", nzIncluded: "nzIncluded", nzRange: "nzRange", nzVertical: "nzVertical", nzDefaultValue: "nzDefaultValue", nzMarks: "nzMarks", nzMax: "nzMax", nzMin: "nzMin", nzStep: "nzStep", nzTooltipVisible: "nzTooltipVisible", nzTooltipPlacement: "nzTooltipPlacement", nzTipFormatter: "nzTipFormatter" }, outputs: { nzOnAfterChange: "nzOnAfterChange" }, exportAs: ["nzSlider"], features: [core["ɵɵProvidersFeature"]([
                    {
                        provide: forms.NG_VALUE_ACCESSOR,
                        useExisting: core.forwardRef((function () { return NzSliderComponent; })),
                        multi: true
                    },
                    NzSliderService
                ]), core["ɵɵNgOnChangesFeature"]], decls: 7, vars: 13, consts: [[1, "ant-slider"], ["slider", ""], [1, "ant-slider-rail"], [3, "vertical", "included", "offset", "length"], [3, "vertical", "lowerBound", "upperBound", "marksArray", "included", 4, "ngIf"], [3, "vertical", "offset", "value", "active", "tooltipFormatter", "tooltipVisible", "tooltipPlacement", 4, "ngFor", "ngForOf"], [3, "vertical", "min", "max", "lowerBound", "upperBound", "marksArray", "included", 4, "ngIf"], [3, "vertical", "lowerBound", "upperBound", "marksArray", "included"], [3, "vertical", "offset", "value", "active", "tooltipFormatter", "tooltipVisible", "tooltipPlacement"], [3, "vertical", "min", "max", "lowerBound", "upperBound", "marksArray", "included"]], template: function NzSliderComponent_Template(rf, ctx) { if (rf & 1) {
                core["ɵɵelementStart"](0, "div", 0, 1);
                core["ɵɵelement"](2, "div", 2);
                core["ɵɵelement"](3, "nz-slider-track", 3);
                core["ɵɵtemplate"](4, NzSliderComponent_nz_slider_step_4_Template, 1, 5, "nz-slider-step", 4);
                core["ɵɵtemplate"](5, NzSliderComponent_nz_slider_handle_5_Template, 1, 7, "nz-slider-handle", 5);
                core["ɵɵtemplate"](6, NzSliderComponent_nz_slider_marks_6_Template, 1, 7, "nz-slider-marks", 6);
                core["ɵɵelementEnd"]();
            } if (rf & 2) {
                core["ɵɵclassProp"]("ant-slider-disabled", ctx.nzDisabled)("ant-slider-vertical", ctx.nzVertical)("ant-slider-with-marks", ctx.marksArray);
                core["ɵɵadvance"](3);
                core["ɵɵproperty"]("vertical", ctx.nzVertical)("included", ctx.nzIncluded)("offset", ctx.track.offset)("length", ctx.track.length);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.marksArray);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngForOf", ctx.handles);
                core["ɵɵadvance"](1);
                core["ɵɵproperty"]("ngIf", ctx.marksArray);
            } }, directives: [NzSliderTrackComponent, common.NgIf, common.NgForOf, NzSliderStepComponent, NzSliderHandleComponent, NzSliderMarksComponent], encapsulation: 2, changeDetection: 0 });
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Object)
        ], NzSliderComponent.prototype, "nzDisabled", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Boolean)
        ], NzSliderComponent.prototype, "nzDots", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Boolean)
        ], NzSliderComponent.prototype, "nzIncluded", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Boolean)
        ], NzSliderComponent.prototype, "nzRange", void 0);
        __decorate([
            core$1.InputBoolean(),
            __metadata("design:type", Boolean)
        ], NzSliderComponent.prototype, "nzVertical", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzSliderComponent.prototype, "nzMax", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzSliderComponent.prototype, "nzMin", void 0);
        __decorate([
            core$1.InputNumber(),
            __metadata("design:type", Object)
        ], NzSliderComponent.prototype, "nzStep", void 0);
        return NzSliderComponent;
    }());
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderComponent, [{
            type: core.Component,
            args: [{
                    changeDetection: core.ChangeDetectionStrategy.OnPush,
                    encapsulation: core.ViewEncapsulation.None,
                    selector: 'nz-slider',
                    exportAs: 'nzSlider',
                    preserveWhitespaces: false,
                    providers: [
                        {
                            provide: forms.NG_VALUE_ACCESSOR,
                            useExisting: core.forwardRef((function () { return NzSliderComponent; })),
                            multi: true
                        },
                        NzSliderService
                    ],
                    host: {
                        '(keydown)': 'onKeyDown($event)'
                    },
                    template: "\n    <div\n      #slider\n      class=\"ant-slider\"\n      [class.ant-slider-disabled]=\"nzDisabled\"\n      [class.ant-slider-vertical]=\"nzVertical\"\n      [class.ant-slider-with-marks]=\"marksArray\"\n    >\n      <div class=\"ant-slider-rail\"></div>\n      <nz-slider-track [vertical]=\"nzVertical\" [included]=\"nzIncluded\" [offset]=\"track.offset\" [length]=\"track.length\"></nz-slider-track>\n      <nz-slider-step\n        *ngIf=\"marksArray\"\n        [vertical]=\"nzVertical\"\n        [lowerBound]=\"bounds.lower\"\n        [upperBound]=\"bounds.upper\"\n        [marksArray]=\"marksArray\"\n        [included]=\"nzIncluded\"\n      ></nz-slider-step>\n      <nz-slider-handle\n        *ngFor=\"let handle of handles\"\n        [vertical]=\"nzVertical\"\n        [offset]=\"handle.offset\"\n        [value]=\"handle.value\"\n        [active]=\"handle.active\"\n        [tooltipFormatter]=\"nzTipFormatter\"\n        [tooltipVisible]=\"nzTooltipVisible\"\n        [tooltipPlacement]=\"nzTooltipPlacement\"\n      ></nz-slider-handle>\n      <nz-slider-marks\n        *ngIf=\"marksArray\"\n        [vertical]=\"nzVertical\"\n        [min]=\"nzMin\"\n        [max]=\"nzMax\"\n        [lowerBound]=\"bounds.lower\"\n        [upperBound]=\"bounds.upper\"\n        [marksArray]=\"marksArray\"\n        [included]=\"nzIncluded\"\n      ></nz-slider-marks>\n    </div>\n  "
                }]
        }], function () { return [{ type: NzSliderService }, { type: core.ChangeDetectorRef }, { type: platform.Platform }]; }, { slider: [{
                type: core.ViewChild,
                args: ['slider', { static: true }]
            }], handlerComponents: [{
                type: core.ViewChildren,
                args: [NzSliderHandleComponent]
            }], nzDisabled: [{
                type: core.Input
            }], nzDots: [{
                type: core.Input
            }], nzIncluded: [{
                type: core.Input
            }], nzRange: [{
                type: core.Input
            }], nzVertical: [{
                type: core.Input
            }], nzDefaultValue: [{
                type: core.Input
            }], nzMarks: [{
                type: core.Input
            }], nzMax: [{
                type: core.Input
            }], nzMin: [{
                type: core.Input
            }], nzStep: [{
                type: core.Input
            }], nzTooltipVisible: [{
                type: core.Input
            }], nzTooltipPlacement: [{
                type: core.Input
            }], nzTipFormatter: [{
                type: core.Input
            }], nzOnAfterChange: [{
                type: core.Output
            }] }); })();
    function getValueTypeNotMatchError() {
        return new Error("The \"nzRange\" can't match the \"ngModel\"'s type, please check these properties: \"nzRange\", \"ngModel\", \"nzDefaultValue\".");
    }
    function isValueRange(value) {
        if (value instanceof Array) {
            return value.length === 2;
        }
        else {
            return false;
        }
    }
    function generateHandlers(amount) {
        return Array(amount)
            .fill(0)
            .map(function () { return ({ offset: null, value: null, active: false }); });
    }
    /**
     * Check if value is valid and throw error if value-type/range not match.
     */
    function assertValueValid(value, isRange) {
        if ((!isValueRange(value) && isNaN(value)) || (isValueRange(value) && value.some(function (v) { return isNaN(v); }))) {
            return false;
        }
        return assertValueTypeMatch(value, isRange);
    }
    /**
     * Assert that if `this.nzRange` is `true`, value is also a range, vice versa.
     */
    function assertValueTypeMatch(value, isRange) {
        if (isRange === void 0) { isRange = false; }
        if (isValueRange(value) !== isRange) {
            throw getValueTypeNotMatchError();
        }
        return true;
    }
    function valuesEqual(valA, valB) {
        if (typeof valA !== typeof valB) {
            return false;
        }
        return isValueRange(valA) && isValueRange(valB) ? core$1.arraysEqual(valA, valB) : valA === valB;
    }

    /**
     * @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 NzSliderModule = /** @class */ (function () {
        function NzSliderModule() {
        }
        /** @nocollapse */ NzSliderModule.ɵmod = core["ɵɵdefineNgModule"]({ type: NzSliderModule });
        /** @nocollapse */ NzSliderModule.ɵinj = core["ɵɵdefineInjector"]({ factory: function NzSliderModule_Factory(t) { return new (t || NzSliderModule)(); }, imports: [[common.CommonModule, platform.PlatformModule, tooltip.NzToolTipModule]] });
        return NzSliderModule;
    }());
    (function () { (typeof ngJitMode === "undefined" || ngJitMode) && core["ɵɵsetNgModuleScope"](NzSliderModule, { declarations: [NzSliderComponent, NzSliderTrackComponent, NzSliderHandleComponent, NzSliderStepComponent, NzSliderMarksComponent], imports: [common.CommonModule, platform.PlatformModule, tooltip.NzToolTipModule], exports: [NzSliderComponent, NzSliderTrackComponent, NzSliderHandleComponent, NzSliderStepComponent, NzSliderMarksComponent] }); })();
    /*@__PURE__*/ (function () { core["ɵsetClassMetadata"](NzSliderModule, [{
            type: core.NgModule,
            args: [{
                    exports: [NzSliderComponent, NzSliderTrackComponent, NzSliderHandleComponent, NzSliderStepComponent, NzSliderMarksComponent],
                    declarations: [NzSliderComponent, NzSliderTrackComponent, NzSliderHandleComponent, NzSliderStepComponent, NzSliderMarksComponent],
                    imports: [common.CommonModule, platform.PlatformModule, tooltip.NzToolTipModule]
                }]
        }], 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 NzMarks = /** @class */ (function () {
        function NzMarks() {
        }
        return NzMarks;
    }());

    exports.NzMarks = NzMarks;
    exports.NzSliderComponent = NzSliderComponent;
    exports.NzSliderModule = NzSliderModule;
    exports.ɵNzSliderHandleComponent = NzSliderHandleComponent;
    exports.ɵNzSliderMarksComponent = NzSliderMarksComponent;
    exports.ɵNzSliderService = NzSliderService;
    exports.ɵNzSliderStepComponent = NzSliderStepComponent;
    exports.ɵNzSliderTrackComponent = NzSliderTrackComponent;

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

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