import { Component } from '@angular/core';
import { NavigationEnd } from '@angular/router';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@angular/common";
export class ChecklistlayoutComponent {
    router;
    currentRoute;
    routerSub;
    constructor(router) {
        this.router = router;
    }
    ngOnDestroy() {
        this.routerSub.unsubscribe();
    }
    ngOnInit() {
        this.currentRoute = this.router.url.split('?')[0];
        if (this.currentRoute === '/manage/trax/checklist') {
            this.type = 'Checklist';
        }
        else if (this.currentRoute === '/manage/trax/checklist/managetask') {
            this.type = 'Task';
        }
        this.routerSub = this.router.events.subscribe((event) => {
            if (event instanceof NavigationEnd) {
                this.currentRoute = event.urlAfterRedirects.split('?')[0];
                if (this.currentRoute === '/manage/trax/checklist') {
                    this.type = 'Checklist';
                }
                else if (this.currentRoute === '/manage/trax/checklist/managetask') {
                    this.type = 'Task';
                }
            }
        });
    }
    type = 'Checklist';
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChecklistlayoutComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ChecklistlayoutComponent, selector: "lib-checklistlayout", ngImport: i0, template: "<div class=\"d-flex justify-content-between mb-4 mt-4\" *ngIf=\"!currentRoute.split('/').includes('managechecklist')\">\r\n    <div class=\"\">\r\n        <h1 class=\" my-0 checklistTitle\">\r\n            Manage Your {{type === 'Checklist' ? 'Checklist' : 'Task'}}\r\n        </h1>\r\n        <div class=\"mt-1 checklistHead\">You can create and manage your {{type === 'Checklist' ? 'checklist' : 'task'}} here</div>\r\n    </div>\r\n    <div class=\"nav-group nav-group-outline border-1 btn-group p-0\">\r\n        <button (click)=\"type = 'Checklist'\" class=\"btn btn-outline\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Checklist',\r\n            'inactivePlanBtn': type !== 'Checklist',\r\n        }\"\r\n            [routerLink]=\"'/manage/trax/checklist'\"\r\n           >\r\n           Checklist\r\n        </button>\r\n        <button (click)=\"type = 'Task'\" class=\"btn btn-outline px-6 py-3\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Task',\r\n            'inactivePlanBtn': type !== 'Task',\r\n        }\"\r\n            [routerLink]=\"'/manage/trax/checklist/managetask'\"\r\n    \r\n           >\r\n           Task\r\n        </button>\r\n    </div>\r\n</div>\r\n<router-outlet></router-outlet>\r\n", styles: [".nav-group-outline{border-radius:8px;border:1px solid var(--Primary-300, #6BCAFF);box-shadow:0 1px 2px #1018280d}.nav-group .btn.activePlanBtn{border-right:1px solid var(--Primary-300, #6BCAFF);background:var(--Primary-600, #00A3FF);color:#fff}.nav-group .btn.inactivePlanBtn{background-color:#fff;color:#333;border:1px solid #dcdcdc}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ChecklistlayoutComponent, decorators: [{
            type: Component,
            args: [{ selector: 'lib-checklistlayout', template: "<div class=\"d-flex justify-content-between mb-4 mt-4\" *ngIf=\"!currentRoute.split('/').includes('managechecklist')\">\r\n    <div class=\"\">\r\n        <h1 class=\" my-0 checklistTitle\">\r\n            Manage Your {{type === 'Checklist' ? 'Checklist' : 'Task'}}\r\n        </h1>\r\n        <div class=\"mt-1 checklistHead\">You can create and manage your {{type === 'Checklist' ? 'checklist' : 'task'}} here</div>\r\n    </div>\r\n    <div class=\"nav-group nav-group-outline border-1 btn-group p-0\">\r\n        <button (click)=\"type = 'Checklist'\" class=\"btn btn-outline\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Checklist',\r\n            'inactivePlanBtn': type !== 'Checklist',\r\n        }\"\r\n            [routerLink]=\"'/manage/trax/checklist'\"\r\n           >\r\n           Checklist\r\n        </button>\r\n        <button (click)=\"type = 'Task'\" class=\"btn btn-outline px-6 py-3\"\r\n        [ngClass]=\"{\r\n            'activePlanBtn': type === 'Task',\r\n            'inactivePlanBtn': type !== 'Task',\r\n        }\"\r\n            [routerLink]=\"'/manage/trax/checklist/managetask'\"\r\n    \r\n           >\r\n           Task\r\n        </button>\r\n    </div>\r\n</div>\r\n<router-outlet></router-outlet>\r\n", styles: [".nav-group-outline{border-radius:8px;border:1px solid var(--Primary-300, #6BCAFF);box-shadow:0 1px 2px #1018280d}.nav-group .btn.activePlanBtn{border-right:1px solid var(--Primary-300, #6BCAFF);background:var(--Primary-600, #00A3FF);color:#fff}.nav-group .btn.inactivePlanBtn{background-color:#fff;color:#333;border:1px solid #dcdcdc}\n"] }]
        }], ctorParameters: () => [{ type: i1.Router }] });
//# sourceMappingURL=data:application/json;base64, 