UNPKG

@spartacus/cart

Version:

`@spartacus/cart` is a package that you can include in your application, which allows you to use various cart features.

1,144 lines 87 kB
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@spartacus/core'), require('@spartacus/storefront'), require('@angular/common'), require('@angular/router'), require('@spartacus/cart/saved-cart/root'), require('@angular/forms')) :
    typeof define === 'function' && define.amd ? define('@spartacus/cart/saved-cart/components', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@spartacus/core', '@spartacus/storefront', '@angular/common', '@angular/router', '@spartacus/cart/saved-cart/root', '@angular/forms'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.spartacus = global.spartacus || {}, global.spartacus.cart = global.spartacus.cart || {}, global.spartacus.cart['saved-cart'] = global.spartacus.cart['saved-cart'] || {}, global.spartacus.cart['saved-cart'].components = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.core, global.storefront, global.ng.common, global.ng.router, global.spartacus.cart['saved-cart'].root, global.ng.forms));
}(this, (function (exports, i0, rxjs, operators, i1, i3, i4, i4$1, i2, i5) { 'use strict';

    function _interopNamespace(e) {
        if (e && e.__esModule) return e;
        var n = Object.create(null);
        if (e) {
            Object.keys(e).forEach(function (k) {
                if (k !== 'default') {
                    var d = Object.getOwnPropertyDescriptor(e, k);
                    Object.defineProperty(n, k, d.get ? d : {
                        enumerable: true,
                        get: function () {
                            return e[k];
                        }
                    });
                }
            });
        }
        n['default'] = e;
        return Object.freeze(n);
    }

    var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
    var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
    var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
    var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
    var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
    var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
    var i5__namespace = /*#__PURE__*/_interopNamespace(i5);

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
    /* 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 (Object.prototype.hasOwnProperty.call(b, p))
                    d[p] = b[p]; };
        return extendStatics(d, b);
    };
    function __extends(d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        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 };
        }
    }
    var __createBinding = Object.create ? (function (o, m, k, k2) {
        if (k2 === undefined)
            k2 = k;
        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
    }) : (function (o, m, k, k2) {
        if (k2 === undefined)
            k2 = k;
        o[k2] = m[k];
    });
    function __exportStar(m, o) {
        for (var p in m)
            if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
                __createBinding(o, 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;
    }
    /** @deprecated */
    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }
    /** @deprecated */
    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 __spreadArray(to, from, pack) {
        if (pack || arguments.length === 2)
            for (var i = 0, l = from.length, ar; i < l; i++) {
                if (ar || !(i in from)) {
                    if (!ar)
                        ar = Array.prototype.slice.call(from, 0, i);
                    ar[i] = from[i];
                }
            }
        return to.concat(ar || from);
    }
    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;
    }
    ;
    var __setModuleDefault = Object.create ? (function (o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function (o, v) {
        o["default"] = v;
    };
    function __importStar(mod) {
        if (mod && mod.__esModule)
            return mod;
        var result = {};
        if (mod != null)
            for (var k in mod)
                if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
                    __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
    }
    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }
    function __classPrivateFieldGet(receiver, state, kind, f) {
        if (kind === "a" && !f)
            throw new TypeError("Private accessor was defined without a getter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
            throw new TypeError("Cannot read private member from an object whose class did not declare it");
        return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
    }
    function __classPrivateFieldSet(receiver, state, value, kind, f) {
        if (kind === "m")
            throw new TypeError("Private method is not writable");
        if (kind === "a" && !f)
            throw new TypeError("Private accessor was defined without a setter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
            throw new TypeError("Cannot write private member to an object whose class did not declare it");
        return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
    }

    var AddToSavedCartComponent = /** @class */ (function () {
        function AddToSavedCartComponent(activeCartService, authService, routingService, vcr, launchDialogService) {
            this.activeCartService = activeCartService;
            this.authService = authService;
            this.routingService = routingService;
            this.vcr = vcr;
            this.launchDialogService = launchDialogService;
            this.subscription = new rxjs.Subscription();
            this.loggedIn = false;
        }
        AddToSavedCartComponent.prototype.ngOnInit = function () {
            var _this = this;
            this.cart$ = rxjs.combineLatest([
                this.activeCartService.getActive(),
                this.authService.isUserLoggedIn(),
            ]).pipe(operators.tap(function (_b) {
                var _c = __read(_b, 2), _ = _c[0], loggedIn = _c[1];
                return (_this.loggedIn = loggedIn);
            }), operators.map(function (_b) {
                var _c = __read(_b, 1), activeCart = _c[0];
                return activeCart;
            }));
        };
        AddToSavedCartComponent.prototype.saveCart = function (cart) {
            if (this.loggedIn) {
                this.openDialog(cart);
            }
            else {
                this.routingService.go({ cxRoute: 'login' });
            }
        };
        AddToSavedCartComponent.prototype.openDialog = function (cart) {
            var dialog = this.launchDialogService.openDialog("SAVED_CART" /* SAVED_CART */, this.element, this.vcr, { cart: cart, layoutOption: 'save' });
            if (dialog) {
                this.subscription.add(dialog.pipe(operators.take(1)).subscribe());
            }
        };
        AddToSavedCartComponent.prototype.ngOnDestroy = function () {
            var _a;
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        };
        return AddToSavedCartComponent;
    }());
    AddToSavedCartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartComponent, deps: [{ token: i1__namespace.ActiveCartService }, { token: i1__namespace.AuthService }, { token: i1__namespace.RoutingService }, { token: i0__namespace.ViewContainerRef }, { token: i3__namespace.LaunchDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    AddToSavedCartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: AddToSavedCartComponent, selector: "cx-add-to-saved-cart", viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"cart$ | async as cart\">\n  <div class=\"cx-add-to-saved-cart-container\">\n    <button\n      class=\"link cx-action-link\"\n      [routerLink]=\"\n        {\n          cxRoute: 'savedCarts'\n        } | cxUrl\n      \"\n      cxAutoFocus\n    >\n      <span>{{ 'addToSavedCart.savedCarts' | cxTranslate }}</span>\n    </button>\n    <button\n      #element\n      class=\"link cx-action-link\"\n      (click)=\"saveCart(cart)\"\n      cxAutoFocus\n    >\n      <span>{{ 'addToSavedCart.saveCartForLater' | cxTranslate }}</span>\n    </button>\n  </div>\n</ng-container>\n", directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["routerLink", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "async": i4__namespace.AsyncPipe, "cxUrl": i1__namespace.UrlPipe, "cxTranslate": i1__namespace.TranslatePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-add-to-saved-cart',
                        templateUrl: './add-to-saved-cart.component.html',
                        changeDetection: i0.ChangeDetectionStrategy.OnPush,
                    }]
            }], ctorParameters: function () { return [{ type: i1__namespace.ActiveCartService }, { type: i1__namespace.AuthService }, { type: i1__namespace.RoutingService }, { type: i0__namespace.ViewContainerRef }, { type: i3__namespace.LaunchDialogService }]; }, propDecorators: { element: [{
                    type: i0.ViewChild,
                    args: ['element']
                }] } });

    var AddToSavedCartModule = /** @class */ (function () {
        function AddToSavedCartModule() {
        }
        return AddToSavedCartModule;
    }());
    AddToSavedCartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
    AddToSavedCartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartModule, declarations: [AddToSavedCartComponent], imports: [i4.CommonModule,
            i4$1.RouterModule, i1__namespace.ConfigModule, i1.I18nModule,
            i1.UrlModule], exports: [AddToSavedCartComponent] });
    AddToSavedCartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartModule, imports: [[
                i4.CommonModule,
                i4$1.RouterModule,
                i1.ConfigModule.withConfig({
                    cmsComponents: {
                        AddToSavedCartsComponent: {
                            component: AddToSavedCartComponent,
                        },
                    },
                }),
                i1.I18nModule,
                i1.UrlModule,
            ]] });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: AddToSavedCartModule, decorators: [{
                type: i0.NgModule,
                args: [{
                        imports: [
                            i4.CommonModule,
                            i4$1.RouterModule,
                            i1.ConfigModule.withConfig({
                                cmsComponents: {
                                    AddToSavedCartsComponent: {
                                        component: AddToSavedCartComponent,
                                    },
                                },
                            }),
                            i1.I18nModule,
                            i1.UrlModule,
                        ],
                        exports: [AddToSavedCartComponent],
                        declarations: [AddToSavedCartComponent],
                    }]
            }] });

    var SavedCartDetailsService = /** @class */ (function () {
        function SavedCartDetailsService(routingService, savedCartService) {
            var _this = this;
            this.routingService = routingService;
            this.savedCartService = savedCartService;
            this.savedCartId$ = this.routingService.getRouterState().pipe(operators.map(function (routingData) { return routingData.state.params.savedCartId; }), operators.distinctUntilChanged());
            this.savedCart$ = this.savedCartId$.pipe(operators.filter(function (cartId) { return Boolean(cartId); }), operators.tap(function (savedCartId) { return _this.savedCartService.loadSavedCart(savedCartId); }), operators.switchMap(function (savedCartId) { return _this.savedCartService.get(savedCartId); }), operators.shareReplay({ bufferSize: 1, refCount: true }));
        }
        SavedCartDetailsService.prototype.getSavedCartId = function () {
            return this.savedCartId$;
        };
        SavedCartDetailsService.prototype.getCartDetails = function () {
            return this.savedCart$;
        };
        return SavedCartDetailsService;
    }());
    SavedCartDetailsService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsService, deps: [{ token: i1__namespace.RoutingService }, { token: i2__namespace.SavedCartFacade }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
    SavedCartDetailsService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsService, providedIn: 'root' });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsService, decorators: [{
                type: i0.Injectable,
                args: [{
                        providedIn: 'root',
                    }]
            }], ctorParameters: function () { return [{ type: i1__namespace.RoutingService }, { type: i2__namespace.SavedCartFacade }]; } });

    var SavedCartDetailsActionComponent = /** @class */ (function () {
        function SavedCartDetailsActionComponent(savedCartDetailsService, vcr, launchDialogService) {
            this.savedCartDetailsService = savedCartDetailsService;
            this.vcr = vcr;
            this.launchDialogService = launchDialogService;
            this.subscription = new rxjs.Subscription();
            this.savedCartFormType = i2.SavedCartFormType;
            this.savedCart$ = this.savedCartDetailsService.getCartDetails();
        }
        SavedCartDetailsActionComponent.prototype.openDialog = function (cart, type) {
            var dialog = this.launchDialogService.openDialog("SAVED_CART" /* SAVED_CART */, this.element, this.vcr, { cart: cart, layoutOption: type });
            if (dialog) {
                this.subscription.add(dialog.pipe(operators.take(1)).subscribe());
            }
        };
        SavedCartDetailsActionComponent.prototype.ngOnDestroy = function () {
            var _a;
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        };
        return SavedCartDetailsActionComponent;
    }());
    SavedCartDetailsActionComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsActionComponent, deps: [{ token: SavedCartDetailsService }, { token: i0__namespace.ViewContainerRef }, { token: i3__namespace.LaunchDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    SavedCartDetailsActionComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SavedCartDetailsActionComponent, selector: "cx-saved-cart-details-action", viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"savedCart$ | async as cart\">\n  <div class=\"cx-saved-cart-restore-btns row\">\n    <div class=\"col-xs-12 col-md-5 col-lg-4\">\n      <button\n        #element\n        class=\"btn btn-block btn-action\"\n        (click)=\"openDialog(cart, savedCartFormType.DELETE)\"\n      >\n        {{ 'savedCartDetails.deleteSavedCart' | cxTranslate }}\n      </button>\n    </div>\n    <div class=\"col-xs-12 col-md-5 col-lg-4\">\n      <button\n        #element\n        class=\"btn btn-block btn-primary\"\n        (click)=\"openDialog(cart, savedCartFormType.RESTORE)\"\n      >\n        {{ 'savedCartList.makeCartActive' | cxTranslate }}\n      </button>\n    </div>\n  </div>\n</ng-container>\n", directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace.AsyncPipe, "cxTranslate": i1__namespace.TranslatePipe } });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsActionComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-saved-cart-details-action',
                        templateUrl: './saved-cart-details-action.component.html',
                    }]
            }], ctorParameters: function () { return [{ type: SavedCartDetailsService }, { type: i0__namespace.ViewContainerRef }, { type: i3__namespace.LaunchDialogService }]; }, propDecorators: { element: [{
                    type: i0.ViewChild,
                    args: ['element']
                }] } });

    var SavedCartDetailsItemsComponent = /** @class */ (function () {
        function SavedCartDetailsItemsComponent(savedCartDetailsService, savedCartService, eventSercvice, globalMessageService, routingService) {
            var _this = this;
            this.savedCartDetailsService = savedCartDetailsService;
            this.savedCartService = savedCartService;
            this.eventSercvice = eventSercvice;
            this.globalMessageService = globalMessageService;
            this.routingService = routingService;
            this.subscription = new rxjs.Subscription();
            this.CartLocation = i1.PromotionLocation;
            this.cartLoaded$ = this.savedCartDetailsService
                .getSavedCartId()
                .pipe(operators.switchMap(function (cartId) { return _this.savedCartService.isStable(cartId); }));
            this.savedCart$ = this.savedCartDetailsService
                .getCartDetails()
                .pipe(operators.tap(function (cart) {
                var _a;
                if (((_a = cart === null || cart === void 0 ? void 0 : cart.entries) !== null && _a !== void 0 ? _a : []).length <= 0 && !!(cart === null || cart === void 0 ? void 0 : cart.code)) {
                    _this.savedCartService.deleteSavedCart(cart.code);
                }
            }));
        }
        SavedCartDetailsItemsComponent.prototype.ngOnInit = function () {
            var _this = this;
            this.subscription.add(this.eventSercvice
                .get(i2.DeleteSavedCartSuccessEvent)
                .pipe(operators.take(1), operators.mapTo(true))
                .subscribe(function (success) { return _this.onDeleteComplete(success); }));
        };
        SavedCartDetailsItemsComponent.prototype.onDeleteComplete = function (success) {
            if (success) {
                this.routingService.go({ cxRoute: 'savedCarts' });
                this.globalMessageService.add({
                    key: 'savedCartDialog.deleteCartSuccess',
                }, i1.GlobalMessageType.MSG_TYPE_CONFIRMATION);
            }
        };
        SavedCartDetailsItemsComponent.prototype.ngOnDestroy = function () {
            var _a;
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        };
        return SavedCartDetailsItemsComponent;
    }());
    SavedCartDetailsItemsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsItemsComponent, deps: [{ token: SavedCartDetailsService }, { token: i2__namespace.SavedCartFacade }, { token: i1__namespace.EventService }, { token: i1__namespace.GlobalMessageService }, { token: i1__namespace.RoutingService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    SavedCartDetailsItemsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SavedCartDetailsItemsComponent, selector: "cx-saved-cart-details-items", ngImport: i0__namespace, template: "<ng-container *ngIf=\"savedCart$ | async as cart\">\n  <ng-container *ngIf=\"cart?.entries?.length > 0; else emptyCartItems\">\n    <div class=\"cart-details-wrapper\">\n      <cx-cart-item-list\n        [cartId]=\"cart.code\"\n        [cartIsLoading]=\"!(cartLoaded$ | async)\"\n        [items]=\"cart.entries\"\n        [promotionLocation]=\"CartLocation.SavedCart\"\n      ></cx-cart-item-list>\n    </div>\n  </ng-container>\n</ng-container>\n<ng-template #emptyCartItems>\n  <div class=\"cx-spinner\">\n    <cx-spinner></cx-spinner>\n  </div>\n</ng-template>\n", components: [{ type: i3__namespace.CartItemListComponent, selector: "cx-cart-item-list", inputs: ["readonly", "hasHeader", "options", "cartId", "items", "promotionLocation", "cartIsLoading"] }, { type: i3__namespace.SpinnerComponent, selector: "cx-spinner" }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsItemsComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-saved-cart-details-items',
                        templateUrl: './saved-cart-details-items.component.html',
                        changeDetection: i0.ChangeDetectionStrategy.OnPush,
                    }]
            }], ctorParameters: function () { return [{ type: SavedCartDetailsService }, { type: i2__namespace.SavedCartFacade }, { type: i1__namespace.EventService }, { type: i1__namespace.GlobalMessageService }, { type: i1__namespace.RoutingService }]; } });

    var SavedCartDetailsOverviewComponent = /** @class */ (function () {
        function SavedCartDetailsOverviewComponent(savedCartDetailsService, translation, vcr, launchDialogService) {
            this.savedCartDetailsService = savedCartDetailsService;
            this.translation = translation;
            this.vcr = vcr;
            this.launchDialogService = launchDialogService;
            this.subscription = new rxjs.Subscription();
            this.iconTypes = i3.ICON_TYPE;
            this.savedCart$ = this.savedCartDetailsService.getCartDetails();
        }
        SavedCartDetailsOverviewComponent.prototype.getCartName = function (cartName) {
            return this.translation.translate('savedCartDetails.cartName').pipe(operators.filter(function () { return Boolean(cartName); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [cartName],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.getCartDescription = function (cartDescription) {
            return this.translation.translate('savedCartDetails.cartDescription').pipe(operators.filter(function () { return Boolean(cartDescription); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [cartDescription],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.getCartId = function (cartId) {
            return this.translation.translate('savedCartDetails.cartId').pipe(operators.filter(function () { return Boolean(cartId); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [cartId],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.getDateSaved = function (saveTime) {
            return this.translation.translate('savedCartDetails.dateSaved').pipe(operators.filter(function () { return Boolean(saveTime); }), operators.map(function (textTitle) {
                return {
                    title: textTitle,
                    text: [saveTime !== null && saveTime !== void 0 ? saveTime : ''],
                };
            }));
        };
        SavedCartDetailsOverviewComponent.prototype.getCartItems = function (totalItems) {
            return this.translation.translate('savedCartDetails.items').pipe(operators.filter(function () { return Boolean(totalItems); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [totalItems.toString()],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.getCartQuantity = function (totalUnitCount) {
            return this.translation.translate('savedCartDetails.quantity').pipe(operators.filter(function () { return Boolean(totalUnitCount); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [totalUnitCount.toString()],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.getCartTotal = function (totalPriceWithTax) {
            return this.translation.translate('savedCartDetails.total').pipe(operators.filter(function () { return Boolean(totalPriceWithTax); }), operators.map(function (textTitle) { return ({
                title: textTitle,
                text: [totalPriceWithTax],
            }); }));
        };
        SavedCartDetailsOverviewComponent.prototype.openDialog = function (cart) {
            var dialog = this.launchDialogService.openDialog("SAVED_CART" /* SAVED_CART */, this.element, this.vcr, { cart: cart, layoutOption: 'edit' });
            if (dialog) {
                this.subscription.add(dialog.pipe(operators.take(1)).subscribe());
            }
        };
        SavedCartDetailsOverviewComponent.prototype.ngOnDestroy = function () {
            var _a;
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        };
        return SavedCartDetailsOverviewComponent;
    }());
    SavedCartDetailsOverviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsOverviewComponent, deps: [{ token: SavedCartDetailsService }, { token: i1__namespace.TranslationService }, { token: i0__namespace.ViewContainerRef }, { token: i3__namespace.LaunchDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    SavedCartDetailsOverviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SavedCartDetailsOverviewComponent, selector: "cx-saved-cart-details-overview", viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"savedCart$ | async as cart\">\n  <div class=\"cx-cart-summary\">\n    <div class=\"container\">\n      <div class=\"cx-summary-card\">\n        <div class=\"cx-edit-container\">\n          <cx-card [content]=\"getCartName(cart?.name) | async\"></cx-card>\n          <button class=\"cx-edit-cart\" #element (click)=\"openDialog(cart)\">\n            <cx-icon [type]=\"iconTypes.PENCIL\"></cx-icon>\n          </button>\n        </div>\n        <div class=\"cx-card-description\">\n          <cx-card\n            [content]=\"getCartDescription(cart?.description) | async\"\n            [truncateText]=\"true\"\n            [charactersLimit]=\"30\"\n          ></cx-card>\n        </div>\n      </div>\n      <div class=\"cx-summary-card\">\n        <cx-card [content]=\"getCartId(cart?.code) | async\"></cx-card>\n      </div>\n      <div class=\"cx-summary-card\">\n        <cx-card\n          [content]=\"getDateSaved(cart?.saveTime | cxDate) | async\"\n        ></cx-card>\n        <cx-card [content]=\"getCartItems(cart?.totalItems) | async\"></cx-card>\n      </div>\n      <div class=\"cx-summary-card\">\n        <cx-card\n          [content]=\"getCartQuantity(cart?.totalUnitCount) | async\"\n        ></cx-card>\n        <cx-card\n          [content]=\"\n            getCartTotal(cart?.totalPriceWithTax?.formattedValue) | async\n          \"\n        ></cx-card>\n      </div>\n    </div>\n  </div>\n</ng-container>\n", components: [{ type: i3__namespace.CardComponent, selector: "cx-card", inputs: ["border", "editMode", "isDefault", "content", "fitToContainer", "truncateText", "charactersLimit"], outputs: ["deleteCard", "setDefaultCard", "sendCard", "editCard", "cancelCard"] }, { type: i3__namespace.IconComponent, selector: "cx-icon,[cxIcon]", inputs: ["cxIcon", "type"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace.AsyncPipe, "cxDate": i1__namespace.CxDatePipe } });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsOverviewComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-saved-cart-details-overview',
                        templateUrl: './saved-cart-details-overview.component.html',
                    }]
            }], ctorParameters: function () { return [{ type: SavedCartDetailsService }, { type: i1__namespace.TranslationService }, { type: i0__namespace.ViewContainerRef }, { type: i3__namespace.LaunchDialogService }]; }, propDecorators: { element: [{
                    type: i0.ViewChild,
                    args: ['element']
                }] } });

    var SavedCartDetailsModule = /** @class */ (function () {
        function SavedCartDetailsModule() {
        }
        return SavedCartDetailsModule;
    }());
    SavedCartDetailsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
    SavedCartDetailsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsModule, declarations: [SavedCartDetailsOverviewComponent,
            SavedCartDetailsActionComponent,
            SavedCartDetailsItemsComponent], imports: [i3.CartSharedModule,
            i4.CommonModule,
            i1.I18nModule,
            i1.UrlModule,
            i4$1.RouterModule,
            i3.CardModule,
            i3.MediaModule,
            i3.AddToCartModule,
            i3.IconModule,
            i3.SpinnerModule, i1__namespace.ConfigModule], exports: [SavedCartDetailsOverviewComponent,
            SavedCartDetailsActionComponent,
            SavedCartDetailsItemsComponent] });
    SavedCartDetailsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsModule, imports: [[
                i3.CartSharedModule,
                i4.CommonModule,
                i1.I18nModule,
                i1.UrlModule,
                i4$1.RouterModule,
                i3.CardModule,
                i3.MediaModule,
                i3.AddToCartModule,
                i3.IconModule,
                i3.SpinnerModule,
                i1.ConfigModule.withConfig({
                    cmsComponents: {
                        SavedCartDetailsOverviewComponent: {
                            component: SavedCartDetailsOverviewComponent,
                            guards: [i1.AuthGuard],
                        },
                        SavedCartDetailsItemsComponent: {
                            component: SavedCartDetailsItemsComponent,
                            guards: [i1.AuthGuard],
                        },
                        SavedCartDetailsActionComponent: {
                            component: SavedCartDetailsActionComponent,
                            guards: [i1.AuthGuard],
                        },
                    },
                }),
            ]] });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartDetailsModule, decorators: [{
                type: i0.NgModule,
                args: [{
                        imports: [
                            i3.CartSharedModule,
                            i4.CommonModule,
                            i1.I18nModule,
                            i1.UrlModule,
                            i4$1.RouterModule,
                            i3.CardModule,
                            i3.MediaModule,
                            i3.AddToCartModule,
                            i3.IconModule,
                            i3.SpinnerModule,
                            i1.ConfigModule.withConfig({
                                cmsComponents: {
                                    SavedCartDetailsOverviewComponent: {
                                        component: SavedCartDetailsOverviewComponent,
                                        guards: [i1.AuthGuard],
                                    },
                                    SavedCartDetailsItemsComponent: {
                                        component: SavedCartDetailsItemsComponent,
                                        guards: [i1.AuthGuard],
                                    },
                                    SavedCartDetailsActionComponent: {
                                        component: SavedCartDetailsActionComponent,
                                        guards: [i1.AuthGuard],
                                    },
                                },
                            }),
                        ],
                        declarations: [
                            SavedCartDetailsOverviewComponent,
                            SavedCartDetailsActionComponent,
                            SavedCartDetailsItemsComponent,
                        ],
                        exports: [
                            SavedCartDetailsOverviewComponent,
                            SavedCartDetailsActionComponent,
                            SavedCartDetailsItemsComponent,
                        ],
                    }]
            }] });

    var SavedCartListComponent = /** @class */ (function () {
        function SavedCartListComponent(routing, savedCartService, vcr, launchDialogService) {
            this.routing = routing;
            this.savedCartService = savedCartService;
            this.vcr = vcr;
            this.launchDialogService = launchDialogService;
            this.subscription = new rxjs.Subscription();
            this.savedCarts$ = this.savedCartService.getList().pipe(operators.map(function (lists) { return lists.sort(function (a, b) {
                var date1 = a.saveTime
                    ? new Date(a.saveTime).getTime()
                    : new Date().getTime();
                var date2 = b.saveTime
                    ? new Date(b.saveTime).getTime()
                    : new Date().getTime();
                return date2 - date1;
            }); }));
        }
        SavedCartListComponent.prototype.ngOnInit = function () {
            this.isLoading$ = this.savedCartService.getSavedCartListProcessLoading();
            this.savedCartService.loadSavedCarts();
        };
        SavedCartListComponent.prototype.goToSavedCartDetails = function (cart) {
            this.routing.go({
                cxRoute: 'savedCartsDetails',
                params: { savedCartId: cart === null || cart === void 0 ? void 0 : cart.code },
            });
        };
        SavedCartListComponent.prototype.openDialog = function (event, cart) {
            var dialog = this.launchDialogService.openDialog("SAVED_CART" /* SAVED_CART */, this.restoreButton, this.vcr, { cart: cart, layoutOption: i2.SavedCartFormType.RESTORE });
            if (dialog) {
                this.subscription.add(dialog.pipe(operators.take(1)).subscribe());
            }
            event.stopPropagation();
        };
        SavedCartListComponent.prototype.ngOnDestroy = function () {
            var _a;
            this.savedCartService.clearSavedCarts();
            this.savedCartService.clearSaveCart();
            this.savedCartService.clearRestoreSavedCart();
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        };
        return SavedCartListComponent;
    }());
    SavedCartListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListComponent, deps: [{ token: i1__namespace.RoutingService }, { token: i2__namespace.SavedCartFacade }, { token: i0__namespace.ViewContainerRef }, { token: i3__namespace.LaunchDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    SavedCartListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SavedCartListComponent, selector: "cx-saved-cart-list", viewQueries: [{ propertyName: "restoreButton", first: true, predicate: ["element"], descendants: true }], ngImport: i0__namespace, template: "<ng-container *ngIf=\"savedCarts$ | async as savedCarts\">\n  <ng-container *ngIf=\"!(isLoading$ | async); else loading\">\n    <div class=\"cx-saved-cart-list-header\">\n      <h3>\n        {{\n          'savedCartList.savedCarts' | cxTranslate: { count: savedCarts.length }\n        }}\n      </h3>\n    </div>\n\n    <ng-container *ngIf=\"savedCarts?.length > 0; else noSavedCarts\">\n      <table class=\"table cx-saved-cart-list-table\">\n        <thead class=\"cx-saved-cart-list-thead-mobile\">\n          <th scope=\"col\">\n            {{ 'savedCartList.cartName' | cxTranslate }}\n          </th>\n          <th scope=\"col\">{{ 'savedCartList.cartId' | cxTranslate }}</th>\n          <th scope=\"col\">{{ 'savedCartList.dateSaved' | cxTranslate }}</th>\n          <th scope=\"col\">\n            {{ 'savedCartList.quantity' | cxTranslate }}\n          </th>\n          <th scope=\"col\">{{ 'savedCartList.total' | cxTranslate }}</th>\n          <th scope=\"col\">\n            {{ 'savedCartList.actions' | cxTranslate }}\n          </th>\n        </thead>\n        <tbody>\n          <tr\n            *ngFor=\"let savedCart of savedCarts\"\n            (click)=\"goToSavedCartDetails(savedCart)\"\n          >\n            <td class=\"cx-saved-cart-list-cart-name\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\">\n                {{ 'savedCartList.cartName' | cxTranslate }}\n              </div>\n              <a\n                [routerLink]=\"\n                  {\n                    cxRoute: 'savedCartsDetails',\n                    params: { savedCartId: savedCart?.code }\n                  } | cxUrl\n                \"\n                class=\"cx-saved-cart-list-value\"\n              >\n                {{ savedCart?.name }}</a\n              >\n            </td>\n            <td class=\"cx-saved-cart-list-cart-id\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\">\n                {{ 'savedCartList.cartId' | cxTranslate }}\n              </div>\n              <a\n                [routerLink]=\"\n                  {\n                    cxRoute: 'savedCartsDetails',\n                    params: { savedCartId: savedCart?.code }\n                  } | cxUrl\n                \"\n                class=\"cx-saved-cart-list-value\"\n                >{{ savedCart?.code }}</a\n              >\n            </td>\n            <td class=\"cx-saved-cart-list-date-saved\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\">\n                {{ 'savedCartList.dateSaved' | cxTranslate }}\n              </div>\n              <a\n                [routerLink]=\"\n                  {\n                    cxRoute: 'savedCartsDetails',\n                    params: { savedCartId: savedCart?.code }\n                  } | cxUrl\n                \"\n                class=\"cx-saved-cart-list-value\"\n                >{{ savedCart?.saveTime | cxDate: 'longDate' }}</a\n              >\n            </td>\n            <td class=\"cx-saved-cart-list-quantity\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\">\n                {{ 'savedCartList.quantity' | cxTranslate }}\n              </div>\n              <a\n                [routerLink]=\"\n                  {\n                    cxRoute: 'savedCartsDetails',\n                    params: { savedCartId: savedCart?.code }\n                  } | cxUrl\n                \"\n                class=\"cx-saved-cart-list-value\"\n              >\n                {{ savedCart?.totalUnitCount }}</a\n              >\n            </td>\n            <td class=\"cx-saved-cart-list-total\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\">\n                {{ 'savedCartList.total' | cxTranslate }}\n              </div>\n              <a\n                [routerLink]=\"\n                  {\n                    cxRoute: 'savedCartsDetails',\n                    params: { savedCartId: savedCart?.code }\n                  } | cxUrl\n                \"\n                class=\"cx-saved-cart-list-value\"\n              >\n                {{ savedCart?.totalPrice?.formattedValue }}</a\n              >\n            </td>\n            <td class=\"cx-saved-cart-list-make-cart-active\">\n              <div class=\"cx-table-label-mobile cx-saved-cart-list-label\"></div>\n              <button\n                #element\n                class=\"link cx-action-link cx-saved-cart-make-active\"\n                (click)=\"openDialog($event, savedCart)\"\n              >\n                {{ 'savedCartList.makeCartActive' | cxTranslate }}\n              </button>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </ng-container>\n\n    <!-- NO SAVED CART CONTAINER -->\n    <ng-template #noSavedCarts>\n      <div class=\"cx-saved-cart-list-no-saved-carts row\">\n        <div class=\"col-sm-12 col-md-6 col-lg-4\">\n          <div>{{ 'savedCartList.notFound' | cxTranslate }}</div>\n        </div>\n      </div>\n    </ng-template>\n  </ng-container>\n\n  <ng-template #loading>\n    <div class=\"cx-spinner\">\n      <cx-spinner></cx-spinner>\n    </div>\n  </ng-template>\n</ng-container>\n", components: [{ type: i3__namespace.SpinnerComponent, selector: "cx-spinner" }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4__namespace$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["routerLink", "target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo"] }], pipes: { "async": i4__namespace.AsyncPipe, "cxTranslate": i1__namespace.TranslatePipe, "cxUrl": i1__namespace.UrlPipe, "cxDate": i1__namespace.CxDatePipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-saved-cart-list',
                        templateUrl: './saved-cart-list.component.html',
                        changeDetection: i0.ChangeDetectionStrategy.OnPush,
                    }]
            }], ctorParameters: function () { return [{ type: i1__namespace.RoutingService }, { type: i2__namespace.SavedCartFacade }, { type: i0__namespace.ViewContainerRef }, { type: i3__namespace.LaunchDialogService }]; }, propDecorators: { restoreButton: [{
                    type: i0.ViewChild,
                    args: ['element']
                }] } });

    var SavedCartListModule = /** @class */ (function () {
        function SavedCartListModule() {
        }
        return SavedCartListModule;
    }());
    SavedCartListModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
    SavedCartListModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListModule, declarations: [SavedCartListComponent], imports: [i4.CommonModule,
            i1.UrlModule,
            i4$1.RouterModule,
            i3.ListNavigationModule,
            i1.I18nModule,
            i3.SpinnerModule], exports: [SavedCartListComponent] });
    SavedCartListModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListModule, providers: [
            i1.provideDefaultConfig({
                cmsComponents: {
                    AccountSavedCartHistoryComponent: {
                        component: SavedCartListComponent,
                        guards: [i1.AuthGuard],
                    },
                },
            }),
        ], imports: [[
                i4.CommonModule,
                i1.UrlModule,
                i4$1.RouterModule,
                i3.ListNavigationModule,
                i1.I18nModule,
                i3.SpinnerModule,
            ]] });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartListModule, decorators: [{
                type: i0.NgModule,
                args: [{
                        imports: [
                            i4.CommonModule,
                            i1.UrlModule,
                            i4$1.RouterModule,
                            i3.ListNavigationModule,
                            i1.I18nModule,
                            i3.SpinnerModule,
                        ],
                        providers: [
                            i1.provideDefaultConfig({
                                cmsComponents: {
                                    AccountSavedCartHistoryComponent: {
                                        component: SavedCartListComponent,
                                        guards: [i1.AuthGuard],
                                    },
                                },
                            }),
                        ],
                        declarations: [SavedCartListComponent],
                        exports: [SavedCartListComponent],
                    }]
            }] });

    var SavedCartFormDialogComponent = /** @class */ (function () {
        function SavedCartFormDialogComponent(launchDialogService, el, savedCartService, eventService, routingService, globalMessageService) {
            this.launchDialogService = launchDialogService;
            this.el = el;
            this.savedCartService = savedCartService;
            this.eventService = eventService;
            this.routingService = routingService;
            this.globalMessageService = globalMessageService;
            this.subscription = new rxjs.Subscription();
            this.savedCartFormType = i2.SavedCartFormType;
            this.iconTypes = i3.ICON_TYPE;
            this.descriptionMaxLength = 250;
            this.nameMaxLength = 50;
            this.isCloneSavedCart = false;
            this.focusConfig = {
                trap: true,
                block: true,
                autofocus: 'button',
                focusOnEscape: true,
            };
        }
        Object.defineProperty(SavedCartFormDialogComponent.prototype, "descriptionsCharacterLeft", {
            get: function () {
                var _a, _b;
                return (this.descriptionMaxLength -
                    (((_b = (_a = this.form.get('description')) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length) || 0));
            },
            enumerable: false,
            configurable: true
        });
        SavedCartFormDialogComponent.prototype.handleClick = function (event) {
            // Close on click outside the dialog window
            if (event.target.tagName === this.el.nativeElement.tagName) {
                this.close('Cross click');
            }
        };
        SavedCartFormDialogComponent.prototype.ngOnInit = function () {
            var _this = this;
            this.resetSavedCartStates();
            this.isLoading$ = this.savedCartService.getSaveCartProcessLoading();
            this.isDisableDeleteButton$ = rxjs.merge(this.eventService.get(i2.DeleteSavedCartEvent).pipe(operators.take(1), operators.mapTo(true)), this.eventService
                .get(i2.DeleteSavedCartFailEvent)
                .pipe(operators.take(1), operators.mapTo(false)));
            this.isDisableRestoreButton$ = rxjs.combineLatest([
                this.savedCartService.getCloneSavedCartProcessLoading(),
                this.savedCartService.getRestoreSavedCartProcessLoading(),
            ]).pipe(operators.map(function (_e) {
                var _f = __read(_e, 2), isCloneLoading = _f[0], isRestoreLoading = _f[1];
                return isCloneLoading || isRestoreLoading;
            }));
            this.subscription.add(this.launchDialogService.data$.subscribe(function (data) {
                _this.cart = data.cart;
                _this.layoutOption = data.layoutOption;
                _this.build(_this.cart);
            }));
            this.subscription.add(this.savedCartService
                .getSaveCartProcessSuccess()
                .subscribe(function (success) { return _this.onComplete(success); }));
            this.subscription.add(this.eventService
                .get(i2.DeleteSavedCartSuccessEvent)
                .pipe(operators.take(1), operators.mapTo(true))
                .subscribe(function (success) { return _this.onComplete(success); }));
            this.subscription.add(this.savedCartService
                .getRestoreSavedCartProcessSuccess()
                .subscribe(function (success) { return _this.onComplete(success); }));
        };
        SavedCartFormDialogComponent.prototype.saveOrEditCart = function (cartId) {
            var _a, _b;
            var name = (_a = this.form.get('name')) === null || _a === void 0 ? void 0 : _a.value;
            // TODO(#12660): Remove default value once backend is updated
            var description = ((_b = this.form.get('description')) === null || _b === void 0 ? void 0 : _b.value) || '-';
            switch (this.layoutOption) {
                case i2.SavedCartFormType.SAVE: {
                    this.savedCartService.saveCart({
                        cartId: cartId,
                        saveCartName: name,
                        saveCartDescription: description,
                    });
                    break;
                }
                case i2.SavedCartFormType.EDIT: {
                    this.savedCartService.editSavedCart({
                        cartId: cartId,
                        saveCartName: name,
                        saveCartDescription: description,
                    });
                    break;
                }
            }
        };
        SavedCartFormDialogComponent.prototype.deleteCart = function (cartId) {
            this.savedCartService.deleteSavedCart(cartId);
        };
        SavedCartFormDialogComponent.prototype.restoreSavedCart = function (cartId) {
            var _a;
            if (this.isCloneSavedCart) {
                this.savedCartService.cloneSavedCart(cartId, (_a = this.form.get('cloneName')) === null || _a === void 0 ? void 0 : _a.value);
            }
            else {
                this.savedCartService.restoreSavedCart(cartId);
            }
        };
        SavedCartFormDialogComponent.prototype.close = function (reason) {
            this.launchDialogService.closeDialog(reason);
        };
        SavedCartFormDialogComponent.prototype.onComplete = function (success) {
            var _a, _b, _c, _d;
            if (success) {
                switch (this.layoutOption) {
                    case i2.SavedCartFormType.DELETE: {
                        this.routingService.go({ cxRoute: 'savedCarts' });
                        this.globalMessageService.add({
                            key: 'savedCartDialog.deleteCartSuccess',
                        }, i1.GlobalMessageType.MSG_TYPE_CONFIRMATION);
                        this.close('Successfully deleted a saved cart');
                        break;
                    }
                    case i2.SavedCartFormType.SAVE: {
                        this.close('Successfully saved cart');
                        this.savedCartService.clearSaveCart();
                        this.globalMessageService.add({
                            key: 'savedCartCartPage.messages.cartSaved',
                            params: {
                                cartName: ((_a = this.form.get('name')) === null || _a === void 0 ? void 0 : _a.value) || ((_b = this.cart) === null || _b === void 0 ? void 0 : _b.code),
                            },
                        }, i1.GlobalMessageType.MSG_TYPE_CONFIRMATION);
                        break;
                    }
                    case i2.SavedCartFormType.EDIT: {
                        this.close('Successfully edited saved cart');
                        this.savedCartService.clearSaveCart();
                        this.globalMessageService.add({
                            key: 'savedCartDialog.editCartSuccess',
                            params: {
                                cartName: ((_c = this.form.get('name')) === null || _c === void 0 ? void 0 : _c.value) || ((_d = this.cart) === null || _d === void 0 ? void 0 : _d.code),
                            },
                        }, i1.GlobalMessageType.MSG_TYPE_CONFIRMATION);
                        break;
                    }
                    case i2.SavedCartFormType.RESTORE: {
                        this.close('Successfully restored saved cart');
                        this.routingService.go({ cxRoute: 'savedCarts' });
                        this.resetSavedCartStates();
                        break;
                    }
                }
            }
        };
        SavedCartFormDialogComponent.prototype.toggleIsCloneSavedCart = function () {
            return (this.isCloneSavedCart = !this.isCloneSavedCart);
        };
        SavedCartFormDialogComponent.prototype.build = function (cart) {
            var form = new i5.FormGroup({});
            form.setControl('name', new i5.FormControl('', [
                i5.Validators.required,
                i5.Validators.maxLength(this.nameMaxLength),
            ]));
            form.setControl('description', new i5.FormControl('', [i5.Validators.maxLength(this.descriptionMaxLength)]));
            form.setControl('isCloneSavedCart', new i5.FormControl(''));
            form.setControl('cloneName', new i5.FormControl(''));
            this.form = form;
            this.patchData(cart);
        };
        SavedCartFormDialogComponent.prototype.patchData = function (item) {
            this.form.patchValue(Object.assign({}, item));
        };
        SavedCartFormDialogComponent.prototype.resetSavedCartStates = function () {
            this.savedCartService.clearCloneSavedCart();
            this.savedCartService.clearSaveCart();
            this.savedCartService.clearRestoreSavedCart();
        };
        SavedCartFormDialogComponent.prototype.ngOnDestroy = function () {
            var _a;
            (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
            this.close('close dialog');
        };
        return SavedCartFormDialogComponent;
    }());
    SavedCartFormDialogComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogComponent, deps: [{ token: i3__namespace.LaunchDialogService }, { token: i0__namespace.ElementRef }, { token: i2__namespace.SavedCartFacade }, { token: i1__namespace.EventService }, { token: i1__namespace.RoutingService }, { token: i1__namespace.GlobalMessageService }], target: i0__namespace.ɵɵFactoryTarget.Component });
    SavedCartFormDialogComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: SavedCartFormDialogComponent, selector: "cx-saved-cart-form-dialog", host: { listeners: { "click": "handleClick($event)" } }, ngImport: i0__namespace, template: "<ng-container *ngIf=\"cart\">\n  <div\n    [cxFocus]=\"focusConfig\"\n    (esc)=\"close('Escape clicked')\"\n    class=\"cx-saved-cart-form-dialog\"\n  >\n    <form [formGroup]=\"form\" class=\"cx-saved-cart-form-container\">\n      <!-- Modal Header -->\n      <div class=\"modal-header cx-saved-cart-form-header\">\n        <ng-container [ngSwitch]=\"layoutOption\">\n          <div class=\"cx-saved-cart-form-title modal-title\">\n            <ng-container *ngSwitchCase=\"savedCartFormType.EDIT\">\n              {{ 'savedCartDialog.editSavedCart' | cxTranslate }}\n            </ng-container>\n            <ng-container *ngSwitchCase=\"savedCartFormType.DELETE\">\n              {{ 'savedCartDialog.deleteSavedCart' | cxTranslate }}\n            </ng-container>\n            <ng-container *ngSwitchCase=\"savedCartFormType.SAVE\">\n              {{ 'savedCartDialog.saveForLater' | cxTranslate }}\n            </ng-container>\n            <ng-container *ngSwitchCase=\"savedCartFormType.RESTORE\">\n              {{ 'savedCartDialog.restoreSavedCart' | cxTranslate }}\n            </ng-container>\n          </div>\n        </ng-container>\n\n        <button\n          (click)=\"close('Close Save Cart Dialog')\"\n          [disabled]=\"isLoading$ | async\"\n          [attr.aria-label]=\"'common.close' | cxTranslate\"\n          class=\"cx-saved-cart-form-close close\"\n          type=\"button\"\n        >\n          <span aria-hidden=\"true\">\n            <cx-icon [type]=\"iconTypes.CLOSE\"></cx-icon>\n          </span>\n        </button>\n      </div>\n\n      <!-- Modal Body -->\n      <div class=\"cx-saved-cart-form-body\">\n        <!-- start DELETE and RESTORE form -->\n        <ng-container\n          *ngIf=\"\n            layoutOption === savedCartFormType.DELETE ||\n              layoutOption === savedCartFormType.RESTORE;\n            else saveAndEditCart\n          \"\n        >\n          <p class=\"cx-saved-cart-form-subtitle\">\n            {{\n              (layoutOption === savedCartFormType.DELETE\n                ? 'savedCartDialog.followingCartDelete'\n                : 'savedCartDialog.followingCartRestore'\n              ) | cxTranslate\n            }}\n          </p>\n\n          <div class=\"cx-saved-cart-form-row\">\n            <div class=\"cx-saved-cart-values-container\">\n              <div class=\"cx-saved-cart-label\">\n                {{ 'savedCartDialog.name' | cxTranslate }}\n              </div>\n              <div class=\"cx-saved-cart-value\">\n                {{ cart?.name }}\n              </div>\n            </div>\n\n            <div class=\"cx-saved-cart-values-container\">\n              <div class=\"cx-saved-cart-label\">\n                {{ 'savedCartDialog.id' | cxTranslate }}\n              </div>\n              <div class=\"cx-saved-cart-value\">\n                {{ cart?.code }}\n              </div>\n            </div>\n\n            <div class=\"cx-saved-cart-values-container\">\n              <div class=\"cx-saved-cart-label\">\n                {{ 'savedCartDialog.description' | cxTranslate }}\n              </div>\n              <div class=\"cx-saved-cart-value\">\n                {{ cart?.description }}\n              </div>\n            </div>\n\n            <div class=\"cx-saved-cart-values-container\">\n              <div class=\"cx-saved-cart-label\">\n                {{ 'savedCartDialog.quantity' | cxTranslate }}\n              </div>\n              <div class=\"cx-saved-cart-value\">\n                {{ cart?.totalItems }}\n              </div>\n            </div>\n\n            <div class=\"cx-saved-cart-values-container\">\n              <div class=\"cx-saved-cart-label\">\n                {{ 'savedCartDialog.total' | cxTranslate }}\n              </div>\n              <div class=\"cx-saved-cart-value\">\n                {{ cart?.totalPriceWithTax?.formattedValue }}\n              </div>\n            </div>\n          </div>\n\n          <ng-container *ngIf=\"layoutOption === savedCartFormType.RESTORE\">\n            <div class=\"cx-copy-saved-cart-row form-check\">\n              <input\n                id=\"cx-copy-saved-cart\"\n                type=\"checkbox\"\n                class=\"cx-copy-saved-cart-input\"\n                [checked]=\"isCloneSavedCart\"\n                (change)=\"toggleIsCloneSavedCart()\"\n              />\n              <label\n                for=\"cx-copy-saved-cart\"\n                class=\"cx-copy-saved-cart-label\"\n                >{{ 'savedCartDialog.keepCopySavedCart' | cxTranslate }}</label\n              >\n            </div>\n\n            <div *ngIf=\"isCloneSavedCart\" class=\"cx-copy-saved-cart-row\">\n              <label>\n                <span class=\"label-content\">\n                  {{ 'savedCartDialog.nameOfCloneCart' | cxTranslate }}\n                </span>\n\n                <input\n                  [maxLength]=\"nameMaxLength\"\n                  class=\"form-control\"\n                  formControlName=\"cloneName\"\n                  type=\"text\"\n                  placeholder=\"{{\n                    'savedCartDialog.defaultCloneCartName'\n                      | cxTranslate: { name: form.get('name')?.value }\n                  }}\"\n                />\n              </label>\n            </div>\n          </ng-container>\n\n          <div class=\"cx-saved-cart-form-footer\">\n            <button\n              (click)=\"close('Close Save Cart Dialog')\"\n              [attr.aria-label]=\"'common.close' | cxTranslate\"\n              class=\"mr-2 btn btn-action\"\n              type=\"button\"\n            >\n              {{ 'savedCartDialog.cancel' | cxTranslate }}\n            </button>\n\n            <ng-container\n              *ngIf=\"\n                layoutOption === savedCartFormType.DELETE;\n                else isRestoreSavedCart\n              \"\n            >\n              <button\n                *ngIf=\"cart.code\"\n                (click)=\"deleteCart(cart.code)\"\n                [attr.aria-label]=\"'common.delete' | cxTranslate\"\n                [disabled]=\"isDisableDeleteButton$ | async\"\n                class=\"ml-2 btn btn-primary\"\n                type=\"button\"\n              >\n                {{ 'savedCartDialog.delete' | cxTranslate }}\n              </button>\n            </ng-container>\n\n            <ng-template #isRestoreSavedCart>\n              <button\n                *ngIf=\"cart.code\"\n                (click)=\"restoreSavedCart(cart.code)\"\n                [disabled]=\"isDisableRestoreButton$ | async\"\n                [attr.aria-label]=\"'common.restore' | cxTranslate\"\n                class=\"ml-2 btn btn-primary\"\n                type=\"button\"\n              >\n                {{ 'savedCartDialog.restore' | cxTranslate }}\n              </button>\n            </ng-template>\n          </div>\n        </ng-container>\n        <!-- end DELETE form -->\n\n        <!-- start SAVE and EDIT form -->\n        <ng-template #saveAndEditCart>\n          <ng-container *ngIf=\"layoutOption === savedCartFormType.SAVE\">\n            <p class=\"cx-saved-cart-form-subtitle\">\n              {{ 'savedCartDialog.itemsSavedForLater' | cxTranslate }}\n            </p>\n          </ng-container>\n\n          <div class=\"cx-saved-cart-form-row\">\n            <ng-container>\n              <label>\n                <span class=\"cx-saved-carts-label label-content\">{{\n                  'savedCartDialog.savedCartName' | cxTranslate\n                }}</span>\n                <input\n                  aria-required=\"true\"\n                  [maxLength]=\"nameMaxLength\"\n                  class=\"form-control\"\n                  formControlName=\"name\"\n                  required\n                  type=\"text\"\n                />\n                <cx-form-errors\n                  aria-live=\"assertive\"\n                  aria-atomic=\"true\"\n                  [control]=\"form.get('name')\"\n                ></cx-form-errors>\n              </label>\n            </ng-container>\n          </div>\n\n          <div class=\"cx-saved-cart-form-row\">\n            <label>\n              <span class=\"cx-saved-carts-label label-content\"\n                >{{ 'savedCartDialog.savedCartDescription' | cxTranslate }}\n                <span class=\"cx-saved-carts-label-optional\">\n                  ({{ 'savedCartDialog.optional' | cxTranslate }})\n                </span></span\n              >\n              <textarea\n                [maxLength]=\"descriptionMaxLength\"\n                class=\"form-control\"\n                formControlName=\"description\"\n                rows=\"5\"\n              ></textarea>\n              <cx-form-errors\n                aria-live=\"assertive\"\n                aria-atomic=\"true\"\n                [control]=\"form.get('description')\"\n              ></cx-form-errors>\n\n              <p class=\"cx-saved-carts-input-hint\">\n                {{\n                  'savedCartDialog.charactersLeft'\n                    | cxTranslate: { count: descriptionsCharacterLeft }\n                }}\n              </p>\n            </label>\n          </div>\n          <div class=\"cx-saved-cart-form-footer\">\n            <button\n              (click)=\"close('Close Save Cart Dialog')\"\n              [attr.aria-label]=\"'common.close' | cxTranslate\"\n              [disabled]=\"isLoading$ | async\"\n              class=\"btn btn-action\"\n              type=\"button\"\n            >\n              {{ 'savedCartDialog.cancel' | cxTranslate }}\n            </button>\n            <button\n              (click)=\"saveOrEditCart(cart?.code)\"\n              [attr.aria-label]=\"'common.save' | cxTranslate\"\n              [disabled]=\"form.invalid || (isLoading$ | async)\"\n              class=\"btn btn-primary\"\n              type=\"button\"\n            >\n              {{ 'savedCartDialog.save' | cxTranslate }}\n            </button>\n          </div>\n        </ng-template>\n        <!-- end SAVE and EDIT form -->\n      </div>\n    </form>\n  </div>\n</ng-container>\n", components: [{ type: i3__namespace.IconComponent, selector: "cx-icon,[cxIcon]", inputs: ["cxIcon", "type"] }, { type: i3__namespace.FormErrorsComponent, selector: "cx-form-errors", inputs: ["prefix", "translationParams", "control"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3__namespace.FocusDirective, selector: "[cxFocus]", inputs: ["cxFocus"] }, { type: i5__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i4__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], pipes: { "cxTranslate": i1__namespace.TranslatePipe, "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogComponent, decorators: [{
                type: i0.Component,
                args: [{
                        selector: 'cx-saved-cart-form-dialog',
                        templateUrl: './saved-cart-form-dialog.component.html',
                        changeDetection: i0.ChangeDetectionStrategy.OnPush,
                    }]
            }], ctorParameters: function () { return [{ type: i3__namespace.LaunchDialogService }, { type: i0__namespace.ElementRef }, { type: i2__namespace.SavedCartFacade }, { type: i1__namespace.EventService }, { type: i1__namespace.RoutingService }, { type: i1__namespace.GlobalMessageService }]; }, propDecorators: { handleClick: [{
                    type: i0.HostListener,
                    args: ['click', ['$event']]
                }] } });

    var defaultSavedCartFormLayoutConfig = {
        launch: {
            SAVED_CART: {
                inline: true,
                component: SavedCartFormDialogComponent,
                dialogType: i3.DIALOG_TYPE.DIALOG,
            },
        },
    };

    var SavedCartFormDialogModule = /** @class */ (function () {
        function SavedCartFormDialogModule() {
        }
        return SavedCartFormDialogModule;
    }());
    SavedCartFormDialogModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
    SavedCartFormDialogModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogModule, declarations: [SavedCartFormDialogComponent], imports: [i4.CommonModule,
            i5.FormsModule,
            i5.ReactiveFormsModule,
            i3.FormErrorsModule,
            i1.I18nModule,
            i3.IconModule,
            i3.KeyboardFocusModule], exports: [SavedCartFormDialogComponent] });
    SavedCartFormDialogModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogModule, imports: [[
                i4.CommonModule,
                i5.FormsModule,
                i5.ReactiveFormsModule,
                i3.FormErrorsModule,
                i1.I18nModule,
                i3.IconModule,
                i3.KeyboardFocusModule,
            ]] });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartFormDialogModule, decorators: [{
                type: i0.NgModule,
                args: [{
                        imports: [
                            i4.CommonModule,
                            i5.FormsModule,
                            i5.ReactiveFormsModule,
                            i3.FormErrorsModule,
                            i1.I18nModule,
                            i3.IconModule,
                            i3.KeyboardFocusModule,
                        ],
                        declarations: [SavedCartFormDialogComponent],
                        exports: [SavedCartFormDialogComponent],
                    }]
            }] });

    var SavedCartComponentsModule = /** @class */ (function () {
        function SavedCartComponentsModule() {
        }
        return SavedCartComponentsModule;
    }());
    SavedCartComponentsModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartComponentsModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
    SavedCartComponentsModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartComponentsModule, imports: [i4$1.RouterModule,
            AddToSavedCartModule,
            SavedCartFormDialogModule,
            SavedCartListModule,
            SavedCartDetailsModule] });
    SavedCartComponentsModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartComponentsModule, providers: [i1.provideConfig(defaultSavedCartFormLayoutConfig)], imports: [[
                i4$1.RouterModule,
                AddToSavedCartModule,
                SavedCartFormDialogModule,
                SavedCartListModule,
                SavedCartDetailsModule,
            ]] });
    i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: SavedCartComponentsModule, decorators: [{
                type: i0.NgModule,
                args: [{
                        imports: [
                            i4$1.RouterModule,
                            AddToSavedCartModule,
                            SavedCartFormDialogModule,
                            SavedCartListModule,
                            SavedCartDetailsModule,
                        ],
                        providers: [i1.provideConfig(defaultSavedCartFormLayoutConfig)],
                    }]
            }] });

    /**
     * Generated bundle index. Do not edit.
     */

    exports.AddToSavedCartComponent = AddToSavedCartComponent;
    exports.AddToSavedCartModule = AddToSavedCartModule;
    exports.SavedCartComponentsModule = SavedCartComponentsModule;
    exports.SavedCartDetailsActionComponent = SavedCartDetailsActionComponent;
    exports.SavedCartDetailsItemsComponent = SavedCartDetailsItemsComponent;
    exports.SavedCartDetailsModule = SavedCartDetailsModule;
    exports.SavedCartDetailsOverviewComponent = SavedCartDetailsOverviewComponent;
    exports.SavedCartDetailsService = SavedCartDetailsService;
    exports.SavedCartFormDialogComponent = SavedCartFormDialogComponent;
    exports.SavedCartFormDialogModule = SavedCartFormDialogModule;
    exports.SavedCartListComponent = SavedCartListComponent;
    exports.SavedCartListModule = SavedCartListModule;
    exports.defaultSavedCartFormLayoutConfig = defaultSavedCartFormLayoutConfig;

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

})));
//# sourceMappingURL=spartacus-cart-saved-cart-components.umd.js.map