import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Optional, Output, } from '@angular/core';
import { FloatingBarModule } from '../../../../sharedComponents/floating-bar/floating-bar.module';
import { FormgroupModule } from '../../../../ui-kit/formgroup/formgroup.module';
import { PaginationModule } from '../../../../ui-kit/pagination/pagination.module';
import { PopoverModule } from '../../../../ui-kit/popover/popover.module';
import { TooltipModule } from '../../../../ui-kit/tooltip/tooltip.module';
import { WorkflowPipesModule } from '../../workflow-pipes/workflow-pipes.module';
import * as i0 from "@angular/core";
import * as i1 from "../../../../configurations";
import * as i2 from "@angular/common";
import * as i3 from "../../../../ui-kit/popover/popover.component";
import * as i4 from "../../../../ui-kit/popover/popover.directive";
import * as i5 from "../../../../ui-kit/formgroup/cs-checkbox/cs-checkbox.component";
import * as i6 from "../../../../ui-kit/formgroup/cs-checkbox-indeterminate/cs-checkbox-indeterminate.component";
import * as i7 from "../../../../ui-kit/tooltip/tooltip.directive";
import * as i8 from "../../../../ui-kit/pagination/pagination/pagination.component";
export class GrcResponsibilityListingComponent {
    set getResponsibilityList(value) {
        this.dataList = value;
    }
    set getSelectedProgramAndResp(value) {
        this.selectedProgramAndResp = value;
        this.getSelectedDataAndIds(value);
    }
    constructor(config) {
        this.profilePic = '';
        this.headerText = 'Name';
        this.selectedListData = [];
        this.selectedListDataIds = [];
        this.perPageLimit = 30;
        this.currentPage = 1;
        this.totalPages = 1;
        this.totalListData = 0;
        this.selectedProgramAndResp = [];
        this.activeProgram = {};
        this.calledFrom = '';
        this.MODE = 'CREATE';
        this.allSelectedResponsibilityIds = [];
        this.getUpdatedDataList = new EventEmitter();
        this.changeSelectedProgramAndResp = new EventEmitter();
        this.env = config?.envConfig;
        this.profilePic = this.env.s3Url + this.env.s3Bucket + this.env.profile;
    }
    ngOnInit() { }
    getSelectedData(responsibility, event) {
        if (event) {
            this.selectedListData.push(responsibility);
            this.selectedListDataIds.push(responsibility?._id);
        }
        else {
            this.deleteEvent(responsibility);
        }
        this.updateOrCreateCategory(this.activeProgram?.programId, this.activeProgram);
    }
    deleteEvent(responsibility) {
        this.selectedListData = this.selectedListData?.filter((selected) => selected?._id !== responsibility?._id);
        this.selectedListDataIds = this.selectedListDataIds?.filter((selectedListDataId) => selectedListDataId !== responsibility?._id);
    }
    selectAll(event) {
        this.dataList?.data?.forEach((data) => {
            if (event) {
                if (!this.selectedListDataIds.includes(data?._id)) {
                    this.selectedListData.push(data);
                    this.selectedListDataIds.push(data?._id);
                }
            }
            else {
                this.deleteEvent(data);
            }
        });
        this.updateOrCreateCategory(this.activeProgram?.programId, this.activeProgram);
    }
    isAllSelected() {
        if (this.selectedListDataIds &&
            this.selectedListDataIds.length >= this.selectedListData?.length &&
            this.selectedListDataIds.length > 0) {
            for (const grc of this.dataList?.data) {
                if (!this.selectedListDataIds.includes(grc?._id)) {
                    return false;
                }
            }
            return true;
        }
        else {
            return false;
        }
    }
    changePage(event) {
        this.currentPage = event;
        this.getUpdatedDataList.emit({
            pageNo: this.currentPage,
        });
    }
    updateOrCreateCategory(programId, program) {
        const programIndex = this.findCheckedProgramIndex(programId);
        if (programIndex !== -1) {
            // Category exists, update risk value
            this.selectedProgramAndResp[programIndex].responsibility =
                this.selectedListData ?? [];
            this.selectedProgramAndResp[programIndex].category =
                this.getSubCategoryIds(this.selectedListData ?? []);
            if (this.selectedListData.length === 0) {
                // Remove category if selectedListData is empty
                this.selectedProgramAndResp.splice(programIndex, 1);
            }
        }
        else if (this.selectedListData?.length > 0) {
            // Category doesn't exist, create new category with subcategory
            this.selectedProgramAndResp.push({
                program: program ?? {},
                category: this.getSubCategoryIds(this.selectedListData ?? []),
                responsibility: this.selectedListData ?? [],
            });
        }
        this.changeSelectedProgramAndResp.emit(this.selectedProgramAndResp);
    }
    getSelectedDataAndIds(selectedData) {
        const programIndex = this.findCheckedProgramIndex(this.activeProgram?.programId);
        this.selectedListData = [];
        this.selectedListDataIds = [];
        if (programIndex !== -1) {
            this.selectedListData = selectedData[programIndex]?.responsibility ?? [];
            this.selectedListData?.forEach((data) => {
                this.selectedListDataIds.push(data?._id);
            });
        }
    }
    findCheckedProgramIndex(categoryId) {
        let programIndex = -1;
        programIndex = this.selectedProgramAndResp.findIndex((cat) => cat?.program?.programId === categoryId);
        return programIndex;
    }
    deleteSelectedResponsibility(responsibility) {
        this.selectedProgramAndResp = this.selectedProgramAndResp?.map((data) => {
            let filteredResponsibility = data?.responsibility?.filter((resp) => resp?._id !== responsibility?._id);
            return {
                ...data,
                responsibility: filteredResponsibility,
                category: [
                    ...(new Set(filteredResponsibility
                        .map((obj) => [obj?.subCategoryId] || [])
                        ?.flat()) || []),
                ],
            };
        });
        this.selectedProgramAndResp = this.selectedProgramAndResp.filter((data) => {
            return data?.responsibility?.length > 0;
        });
        this.changeSelectedProgramAndResp.emit(this.selectedProgramAndResp);
    }
    getSubCategoryIds(selectedResponsibility) {
        let idSet = new Set(selectedResponsibility?.map((responsibility) => responsibility?.subCategoryId ?? []));
        if (this.MODE === 'EDIT') {
            const programIndex = this.findCheckedProgramIndex(this.activeProgram?.programId);
            if (programIndex !== -1) {
                const perviousSelectedIds = this.selectedProgramAndResp[programIndex]?.category ?? [];
                idSet = new Set([...idSet, ...perviousSelectedIds]);
            }
        }
        return [...Array.from(idSet)].filter((item) => Array.isArray(item) ? item.length > 0 : true);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GrcResponsibilityListingComponent, deps: [{ token: i1.Configurations, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: GrcResponsibilityListingComponent, isStandalone: true, selector: "app-grc-responsibility-listing", inputs: { tableCard: "tableCard", activeProgram: "activeProgram", headerText: "headerText", currentPage: "currentPage", perPageLimit: "perPageLimit", totalListData: "totalListData", totalPages: "totalPages", selectedListData: "selectedListData", selectedListDataIds: "selectedListDataIds", MODE: "MODE", allSelectedResponsibilityIds: "allSelectedResponsibilityIds", getResponsibilityList: ["responsibilityData", "getResponsibilityList"], getSelectedProgramAndResp: ["selectedProgramAndResp", "getSelectedProgramAndResp"] }, outputs: { getUpdatedDataList: "getUpdatedDataList", changeSelectedProgramAndResp: "changeSelectedProgramAndResp" }, ngImport: i0, template: "<div class=\"grc-responsibility-listing\">\n    <div class=\"top-heading vx-pl-2 vx-mb-2 vx-d-flex vx-align-center\">\n        <app-cs-checkbox *ngIf=\"isAllSelected() || selectedListDataIds?.length === 0\"  [ngValue]=\"isAllSelected()\" (ngValueChange)=\"selectAll($event)\"></app-cs-checkbox>\n        <app-cs-checkbox-indeterminate *ngIf=\"!isAllSelected() && selectedListDataIds?.length\" [ngValue]=\"true\" (ngValueChange)=\"selectAll(false)\"></app-cs-checkbox-indeterminate>\n        <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-ml-2 vx-lh-4\">{{headerText}}</div>\n    </div>\n    <div class=\"grc-responsibility-listing-inner\">\n        <div class=\"grc-responsibility-table-body\" [class.with-pagination]=\"dataList?.total_pages > 1\">\n            <div class=\"grc-responsibility-table-row\" *ngFor=\"let list of dataList?.data; let i = index\" [class.active]=\"allSelectedResponsibilityIds?.includes(list?._id)\">\n                <div class=\"grc-responsibility-table-column vx-pl-1 vx-pr-1 vx-d-flex vx-align-center serial\">\n                    <div class=\"sr-no\" [appTooltip]=\"(perPageLimit * (currentPage - 1)) + i + 1\" placement=\"bottom\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">{{(perPageLimit * (currentPage - 1)) + i + 1}}</div>\n                    <app-cs-checkbox [ngValue]=\"allSelectedResponsibilityIds?.includes(list?._id)\" (ngValueChange)=\"getSelectedData(list,$event)\"></app-cs-checkbox>\n                </div>\n                <div class=\"grc-responsibility-table-column vx-pr-1 vx-d-flex vx-align-center responsibility-name\">\n                    <div class=\"vx-avatar-group vx-mr-1\">\n                        <div class=\"vx-avatar md\" [appTooltip]=\"list?.entrustedBy?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">\n                            <span *ngIf=\"list?.entrustedBy?.profilePic === ''\" class=\"blue\">{{list.entrustedBy?.shortName}}</span>\n                            <img *ngIf=\"list?.entrustedBy?.profilePic !== ''\" src=\"{{profilePic + list?.entrustedBy?.profilePic}}\" alt=\"\">\n                        </div>\n                        <div *ngIf=\"list?.entrustedTo?.EntrustedToMembers?.length === 0\" class=\"vx-avatar md\" [appTooltip]=\"list?.entrustedTo?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">\n                            <span *ngIf=\"list?.entrustedTo?.profilePic === ''\" class=\"blue\">{{list?.entrustedTo?.shortName}}</span>\n                            <img *ngIf=\"list?.entrustedTo?.profilePic !== ''\" src=\"{{profilePic + list?.entrustedTo?.profilePic}}\" alt=\"\">\n                        </div>\n                        <div *ngIf=\"list?.entrustedTo?.EntrustedToMembers?.length\" class=\"vx-avatar md counter\" appPopover (click)=\"multiUser.popover()\" placement=\"left\">\n                            <span class=\"green\">+{{list?.entrustedTo?.EntrustedToMembers?.length}}</span>\n                        </div>\n                        <app-popover #multiUser>\n                            <div class=\"wf-action-list\">\n                                <ul class=\"action-item\">\n                                    <li *ngFor=\"let user of list?.entrustedTo?.EntrustedToMembers\">\n                                        <div class=\"avatar-card\">\n                                            <div *ngIf=\"user?.profile_pic === ''\" class=\"avatar\">{{user?.member_short_name}}</div>\n                                            <div *ngIf=\"user?.profile_pic !== ''\" class=\"avatar\"><img src=\"{{profilePic + user?.profile_pic}}\" alt=\"\"></div>\n                                            <span class=\"value\" [appTooltip]=\"user.member_name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{user?.member_name}}</span>\n                                        </div>\n                                    </li>\n                                </ul>\n                            </div>\n                        </app-popover>\n                    </div>\n                    <!-- <i class=\"icons star vx-fs-10 vx-mr-1\" [class.active]=\"true\">&#xea70;</i> -->\n                    <div class=\"name-inner\">\n                        <div class=\"vx-d-flex vx-align-center\">\n                            <div class=\"id vx-fs-10 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mr-1\">{{list?.controlId}}</div>\n                            <div class=\"name vx-fs-13 vx-label-txt\" [appTooltip]=\"list?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{list?.name}}</div>\n                        </div>\n                        <div class=\"vx-d-flex vx-align-center\" *ngIf=\"list?.withinData?.length\">\n                            <div class=\"vx-fs-10 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mr-1\">RESPONSIBILITY CENTER:</div>\n                            <div class=\"within-part vx-d-flex vx-align-center vx-pr-3\">\n                                <div class=\"within-box vx-fs-9 vx-fw-600 vx-tt-uppercase vx-pl-1 vx-pr-1 vx-mr-2 vx-lh-3\">Within</div>\n                                <div class=\"within-value vx-fs-11 vx-paragraph-txt\" ><span *ngFor=\"let parent of list?.withinData; let last = last\" [appTooltip]=\"parent?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{parent?.name}} \n                                    <span *ngIf=\"!last\"> <\n                                    </span>\n                                </span></div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <app-pagination *ngIf=\"dataList?.total_pages > 1\" [start]=\"dataList?.items_from\" [end]=\"dataList?.items_to\" [total]=\"dataList?.total_items\" [pageCount]=\"dataList?.total_pages\" [currentPage]=\"currentPage\" (selectedPage)=\"changePage($event)\"></app-pagination>\n    </div>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";@import\"https://cdn.v-comply.com/design-system/css/avatars/avatars.css\";::-webkit-scrollbar{width:3px;height:3px;background-color:transparent;position:absolute}::-webkit-scrollbar-thumb{border-radius:3px;background-color:#dbdbdb;position:absolute}::ng-deep .grc-responsibility-listing .top-heading{border-left:1px solid transparent}::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox,::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox-indeterminate{width:1rem;height:1rem;position:relative}::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox .checkbox-item,::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox-indeterminate .checkbox-item{position:absolute;top:0;left:0;width:1rem;height:1rem}::ng-deep .grc-responsibility-listing-inner{border-radius:.25rem;border:1px solid #f1f1f1;height:calc(100vh - 19rem);overflow:hidden}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body{overflow:hidden;overflow-y:auto;height:calc(100vh - 19rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body::-webkit-scrollbar-track{background-color:transparent}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row{border-bottom:1px solid #f1f1f1;display:flex;justify-content:space-between;position:relative}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row:hover .grc-responsibility-table-column.serial app-cs-checkbox,::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row.active .grc-responsibility-table-column.serial app-cs-checkbox{opacity:1}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column{min-height:3.25rem;position:relative;width:100%}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial{width:2rem;max-width:2rem;justify-content:center}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial .sr-no{width:1rem;background:#f8f8f8;writing-mode:vertical-lr;color:#747576;font-size:.625rem;font-weight:500;display:flex;height:3.25rem;align-items:center;justify-content:center;position:relative;transition:all .2s ease-in-out}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox{background:#fff;border-radius:.125rem;position:absolute;top:1.125rem;left:.5rem;width:1rem;height:1rem;opacity:0;transition:all .2s ease-in-out}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item{position:absolute!important}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item .checkbox,::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item .checkmark{position:absolute;top:0}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name{width:calc(100% - 2rem);min-width:calc(100% - 2rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .star{color:#f1f1f1}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .star.active{color:#f4c84a}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner{width:calc(100% - 5rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner .name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:calc(100% - 6rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner .within-part{width:calc(100% - 8rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body.with-pagination{height:calc(100vh - 21.5rem)}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds{background:#fff;border-radius:0;box-shadow:0 -10px 20px #1e5dd31a;padding:.5rem;justify-content:unset}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .right{order:1}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .right .goto-page{display:none!important}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .left{order:2;font-size:11px!important;color:#747576!important;text-transform:capitalize!important;margin-left:.75rem}.cursor-pointer{cursor:pointer}::ng-deep .wf-action-list{width:220px}::ng-deep .wf-action-list ul{padding:0;margin:0;animation:scale-up-center .2s cubic-bezier(.39,.575,.565,1) both;background:#fff;box-shadow:0 3px 6px #1c5bd140;border-radius:4px;max-height:220px;overflow:auto}::ng-deep .wf-action-list ul.action-item{display:block}::ng-deep .wf-action-list ul.action-item li{list-style:none;border:none;border-bottom:1px solid #f1f1f1;display:block;width:100%;padding:0;background:transparent;border-radius:0;margin:0;height:auto;justify-content:flex-start;box-shadow:none}::ng-deep .wf-action-list ul.action-item li button{color:#6e717e;text-align:left;text-decoration:none;cursor:pointer;background:transparent;font-size:12px;text-transform:capitalize;display:flex;width:100%;padding:7.5px 11px;border:none}::ng-deep .wf-action-list ul.action-item li button i{font-size:16px;margin-right:10px;color:#1e5dd3}::ng-deep .wf-action-list ul.action-item li button:hover{background:#f3f3f3}::ng-deep .wf-action-list ul.action-item li .avatar-card{display:flex;align-items:center;width:100%;padding:7.5px}::ng-deep .wf-action-list ul.action-item li .avatar-card.within-con{display:block}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar{height:24px;width:24px!important;overflow:hidden;background:#1e5dd3;color:#fff;font-size:10px;display:inline-flex;margin-right:5px;border-radius:50%;align-items:center;justify-content:center;text-transform:uppercase}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar img{width:100%}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar+span.value{width:calc(100% - 29px)}::ng-deep .wf-action-list ul.action-item li .avatar-card span.value{width:100%;color:#6e717e;text-decoration:none;background:transparent;font-size:12px;text-transform:capitalize;display:block;font-weight:400;text-align-last:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px}::ng-deep .wf-action-list ul.action-item li .avatar-card span.value i{font-size:8px;color:#747576;cursor:pointer;margin-right:5px}::ng-deep .wf-action-list ul.action-item li .avatar-card.no-image{display:block}::ng-deep .wf-action-list ul.action-item li .avatar-card.no-image span.value{width:100%;display:block}::ng-deep .wf-action-list ul.action-item li .chip-item{color:#1e5dd3;padding:10px;display:flex;align-items:center}::ng-deep .wf-action-list ul.action-item li .chip-item i{color:#747576;margin-right:7px;font-size:10px;cursor:pointer;display:inline-flex}::ng-deep .wf-action-list ul.action-item li .chip-item span{display:block;width:auto;max-width:calc(100% - 17px);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}::ng-deep .wf-action-list ul.action-item li .chip-item span.chip-block{display:block;width:100%}::ng-deep .wf-action-list ul.action-item li .chip-item span.id{font-size:9px}::ng-deep .wf-action-list ul.action-item li .within{display:flex;align-items:center;justify-content:flex-start}::ng-deep .wf-action-list ul.action-item li .within .block{background:#f1f1f1;border-radius:2px;padding:0 2px;line-height:14px;font-size:9px;font-weight:500;color:#042e7d;margin-right:6px;display:block;text-transform:uppercase}::ng-deep .wf-action-list ul.action-item li .within .data{width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#747576;font-size:11px;font-weight:400;line-height:17px}::ng-deep .wf-action-list ul.action-item li:first-child{animation:action-list-open .25s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(2){animation:action-list-open .35s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(3){animation:action-list-open .45s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(4){animation:action-list-open .55s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(5){animation:action-list-open .65s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(6){animation:action-list-open .75s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(7){animation:action-list-open .85s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(8){animation:action-list-open .95s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(9){animation:action-list-open 1.05s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(10){animation:action-list-open 1.15s cubic-bezier(.25,.46,.45,.94) both}@keyframes action-list-open{0%{transform:translateY(50px)}to{transform:translateY(0)}}@keyframes scale-up-center{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i3.PopoverComponent, selector: "app-popover", inputs: ["dontCloseonClick"] }, { kind: "directive", type: i4.PopoverDirective, selector: "[appPopover]", inputs: ["refrence", "placement"] }, { kind: "ngmodule", type: FormgroupModule }, { kind: "component", type: i5.CsCheckboxComponentUI, selector: "app-cs-checkbox", inputs: ["disabled", "ngValue", "value"], outputs: ["ngValueChange"] }, { kind: "component", type: i6.CsCheckboxIndeterminateComponentUI, selector: "app-cs-checkbox-indeterminate", inputs: ["disabled", "ngValue", "value"], outputs: ["ngValueChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i7.ToolTipDirective, selector: "[appTooltip]", inputs: ["appTooltip", "placement", "type", "tooltipMandatory", "showTooltip", "animate"] }, { kind: "ngmodule", type: FloatingBarModule }, { kind: "ngmodule", type: PaginationModule }, { kind: "component", type: i8.PaginationComponentUI, selector: "app-pagination", inputs: ["activeAlphabet", "pageCount", "start", "end", "total", "currentPage"], outputs: ["selectedPage", "selectedAlphabet"] }, { kind: "ngmodule", type: WorkflowPipesModule }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GrcResponsibilityListingComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-grc-responsibility-listing', standalone: true, imports: [
                        CommonModule,
                        PopoverModule,
                        FormgroupModule,
                        TooltipModule,
                        FloatingBarModule,
                        PaginationModule,
                        WorkflowPipesModule,
                    ], inputs: [
                        'tableCard',
                        'activeProgram',
                        'headerText',
                        'currentPage',
                        'perPageLimit',
                        'totalListData',
                        'totalPages',
                        'selectedListData',
                        'selectedListDataIds',
                        'MODE',
                        'allSelectedResponsibilityIds',
                    ], template: "<div class=\"grc-responsibility-listing\">\n    <div class=\"top-heading vx-pl-2 vx-mb-2 vx-d-flex vx-align-center\">\n        <app-cs-checkbox *ngIf=\"isAllSelected() || selectedListDataIds?.length === 0\"  [ngValue]=\"isAllSelected()\" (ngValueChange)=\"selectAll($event)\"></app-cs-checkbox>\n        <app-cs-checkbox-indeterminate *ngIf=\"!isAllSelected() && selectedListDataIds?.length\" [ngValue]=\"true\" (ngValueChange)=\"selectAll(false)\"></app-cs-checkbox-indeterminate>\n        <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-ml-2 vx-lh-4\">{{headerText}}</div>\n    </div>\n    <div class=\"grc-responsibility-listing-inner\">\n        <div class=\"grc-responsibility-table-body\" [class.with-pagination]=\"dataList?.total_pages > 1\">\n            <div class=\"grc-responsibility-table-row\" *ngFor=\"let list of dataList?.data; let i = index\" [class.active]=\"allSelectedResponsibilityIds?.includes(list?._id)\">\n                <div class=\"grc-responsibility-table-column vx-pl-1 vx-pr-1 vx-d-flex vx-align-center serial\">\n                    <div class=\"sr-no\" [appTooltip]=\"(perPageLimit * (currentPage - 1)) + i + 1\" placement=\"bottom\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">{{(perPageLimit * (currentPage - 1)) + i + 1}}</div>\n                    <app-cs-checkbox [ngValue]=\"allSelectedResponsibilityIds?.includes(list?._id)\" (ngValueChange)=\"getSelectedData(list,$event)\"></app-cs-checkbox>\n                </div>\n                <div class=\"grc-responsibility-table-column vx-pr-1 vx-d-flex vx-align-center responsibility-name\">\n                    <div class=\"vx-avatar-group vx-mr-1\">\n                        <div class=\"vx-avatar md\" [appTooltip]=\"list?.entrustedBy?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">\n                            <span *ngIf=\"list?.entrustedBy?.profilePic === ''\" class=\"blue\">{{list.entrustedBy?.shortName}}</span>\n                            <img *ngIf=\"list?.entrustedBy?.profilePic !== ''\" src=\"{{profilePic + list?.entrustedBy?.profilePic}}\" alt=\"\">\n                        </div>\n                        <div *ngIf=\"list?.entrustedTo?.EntrustedToMembers?.length === 0\" class=\"vx-avatar md\" [appTooltip]=\"list?.entrustedTo?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"true\">\n                            <span *ngIf=\"list?.entrustedTo?.profilePic === ''\" class=\"blue\">{{list?.entrustedTo?.shortName}}</span>\n                            <img *ngIf=\"list?.entrustedTo?.profilePic !== ''\" src=\"{{profilePic + list?.entrustedTo?.profilePic}}\" alt=\"\">\n                        </div>\n                        <div *ngIf=\"list?.entrustedTo?.EntrustedToMembers?.length\" class=\"vx-avatar md counter\" appPopover (click)=\"multiUser.popover()\" placement=\"left\">\n                            <span class=\"green\">+{{list?.entrustedTo?.EntrustedToMembers?.length}}</span>\n                        </div>\n                        <app-popover #multiUser>\n                            <div class=\"wf-action-list\">\n                                <ul class=\"action-item\">\n                                    <li *ngFor=\"let user of list?.entrustedTo?.EntrustedToMembers\">\n                                        <div class=\"avatar-card\">\n                                            <div *ngIf=\"user?.profile_pic === ''\" class=\"avatar\">{{user?.member_short_name}}</div>\n                                            <div *ngIf=\"user?.profile_pic !== ''\" class=\"avatar\"><img src=\"{{profilePic + user?.profile_pic}}\" alt=\"\"></div>\n                                            <span class=\"value\" [appTooltip]=\"user.member_name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{user?.member_name}}</span>\n                                        </div>\n                                    </li>\n                                </ul>\n                            </div>\n                        </app-popover>\n                    </div>\n                    <!-- <i class=\"icons star vx-fs-10 vx-mr-1\" [class.active]=\"true\">&#xea70;</i> -->\n                    <div class=\"name-inner\">\n                        <div class=\"vx-d-flex vx-align-center\">\n                            <div class=\"id vx-fs-10 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mr-1\">{{list?.controlId}}</div>\n                            <div class=\"name vx-fs-13 vx-label-txt\" [appTooltip]=\"list?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{list?.name}}</div>\n                        </div>\n                        <div class=\"vx-d-flex vx-align-center\" *ngIf=\"list?.withinData?.length\">\n                            <div class=\"vx-fs-10 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mr-1\">RESPONSIBILITY CENTER:</div>\n                            <div class=\"within-part vx-d-flex vx-align-center vx-pr-3\">\n                                <div class=\"within-box vx-fs-9 vx-fw-600 vx-tt-uppercase vx-pl-1 vx-pr-1 vx-mr-2 vx-lh-3\">Within</div>\n                                <div class=\"within-value vx-fs-11 vx-paragraph-txt\" ><span *ngFor=\"let parent of list?.withinData; let last = last\" [appTooltip]=\"parent?.name\" placement=\"bottom-left\" delay=\"0\" type=\"black\" [tooltipMandatory]=\"false\">{{parent?.name}} \n                                    <span *ngIf=\"!last\"> <\n                                    </span>\n                                </span></div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <app-pagination *ngIf=\"dataList?.total_pages > 1\" [start]=\"dataList?.items_from\" [end]=\"dataList?.items_to\" [total]=\"dataList?.total_items\" [pageCount]=\"dataList?.total_pages\" [currentPage]=\"currentPage\" (selectedPage)=\"changePage($event)\"></app-pagination>\n    </div>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";@import\"https://cdn.v-comply.com/design-system/css/avatars/avatars.css\";::-webkit-scrollbar{width:3px;height:3px;background-color:transparent;position:absolute}::-webkit-scrollbar-thumb{border-radius:3px;background-color:#dbdbdb;position:absolute}::ng-deep .grc-responsibility-listing .top-heading{border-left:1px solid transparent}::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox,::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox-indeterminate{width:1rem;height:1rem;position:relative}::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox .checkbox-item,::ng-deep .grc-responsibility-listing .top-heading app-cs-checkbox-indeterminate .checkbox-item{position:absolute;top:0;left:0;width:1rem;height:1rem}::ng-deep .grc-responsibility-listing-inner{border-radius:.25rem;border:1px solid #f1f1f1;height:calc(100vh - 19rem);overflow:hidden}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body{overflow:hidden;overflow-y:auto;height:calc(100vh - 19rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body::-webkit-scrollbar-track{background-color:transparent}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row{border-bottom:1px solid #f1f1f1;display:flex;justify-content:space-between;position:relative}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row:hover .grc-responsibility-table-column.serial app-cs-checkbox,::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row.active .grc-responsibility-table-column.serial app-cs-checkbox{opacity:1}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column{min-height:3.25rem;position:relative;width:100%}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial{width:2rem;max-width:2rem;justify-content:center}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial .sr-no{width:1rem;background:#f8f8f8;writing-mode:vertical-lr;color:#747576;font-size:.625rem;font-weight:500;display:flex;height:3.25rem;align-items:center;justify-content:center;position:relative;transition:all .2s ease-in-out}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox{background:#fff;border-radius:.125rem;position:absolute;top:1.125rem;left:.5rem;width:1rem;height:1rem;opacity:0;transition:all .2s ease-in-out}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item{position:absolute!important}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item .checkbox,::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.serial app-cs-checkbox .checkbox-item .checkmark{position:absolute;top:0}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name{width:calc(100% - 2rem);min-width:calc(100% - 2rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .star{color:#f1f1f1}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .star.active{color:#f4c84a}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner{width:calc(100% - 5rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner .name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;max-width:calc(100% - 6rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body .grc-responsibility-table-row .grc-responsibility-table-column.responsibility-name .name-inner .within-part{width:calc(100% - 8rem)}::ng-deep .grc-responsibility-listing-inner .grc-responsibility-table-body.with-pagination{height:calc(100vh - 21.5rem)}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds{background:#fff;border-radius:0;box-shadow:0 -10px 20px #1e5dd31a;padding:.5rem;justify-content:unset}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .right{order:1}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .right .goto-page{display:none!important}::ng-deep .grc-responsibility-listing-inner app-pagination .wk-pagination-sec-ds .left{order:2;font-size:11px!important;color:#747576!important;text-transform:capitalize!important;margin-left:.75rem}.cursor-pointer{cursor:pointer}::ng-deep .wf-action-list{width:220px}::ng-deep .wf-action-list ul{padding:0;margin:0;animation:scale-up-center .2s cubic-bezier(.39,.575,.565,1) both;background:#fff;box-shadow:0 3px 6px #1c5bd140;border-radius:4px;max-height:220px;overflow:auto}::ng-deep .wf-action-list ul.action-item{display:block}::ng-deep .wf-action-list ul.action-item li{list-style:none;border:none;border-bottom:1px solid #f1f1f1;display:block;width:100%;padding:0;background:transparent;border-radius:0;margin:0;height:auto;justify-content:flex-start;box-shadow:none}::ng-deep .wf-action-list ul.action-item li button{color:#6e717e;text-align:left;text-decoration:none;cursor:pointer;background:transparent;font-size:12px;text-transform:capitalize;display:flex;width:100%;padding:7.5px 11px;border:none}::ng-deep .wf-action-list ul.action-item li button i{font-size:16px;margin-right:10px;color:#1e5dd3}::ng-deep .wf-action-list ul.action-item li button:hover{background:#f3f3f3}::ng-deep .wf-action-list ul.action-item li .avatar-card{display:flex;align-items:center;width:100%;padding:7.5px}::ng-deep .wf-action-list ul.action-item li .avatar-card.within-con{display:block}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar{height:24px;width:24px!important;overflow:hidden;background:#1e5dd3;color:#fff;font-size:10px;display:inline-flex;margin-right:5px;border-radius:50%;align-items:center;justify-content:center;text-transform:uppercase}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar img{width:100%}::ng-deep .wf-action-list ul.action-item li .avatar-card .avatar+span.value{width:calc(100% - 29px)}::ng-deep .wf-action-list ul.action-item li .avatar-card span.value{width:100%;color:#6e717e;text-decoration:none;background:transparent;font-size:12px;text-transform:capitalize;display:block;font-weight:400;text-align-last:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px}::ng-deep .wf-action-list ul.action-item li .avatar-card span.value i{font-size:8px;color:#747576;cursor:pointer;margin-right:5px}::ng-deep .wf-action-list ul.action-item li .avatar-card.no-image{display:block}::ng-deep .wf-action-list ul.action-item li .avatar-card.no-image span.value{width:100%;display:block}::ng-deep .wf-action-list ul.action-item li .chip-item{color:#1e5dd3;padding:10px;display:flex;align-items:center}::ng-deep .wf-action-list ul.action-item li .chip-item i{color:#747576;margin-right:7px;font-size:10px;cursor:pointer;display:inline-flex}::ng-deep .wf-action-list ul.action-item li .chip-item span{display:block;width:auto;max-width:calc(100% - 17px);font-size:12px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}::ng-deep .wf-action-list ul.action-item li .chip-item span.chip-block{display:block;width:100%}::ng-deep .wf-action-list ul.action-item li .chip-item span.id{font-size:9px}::ng-deep .wf-action-list ul.action-item li .within{display:flex;align-items:center;justify-content:flex-start}::ng-deep .wf-action-list ul.action-item li .within .block{background:#f1f1f1;border-radius:2px;padding:0 2px;line-height:14px;font-size:9px;font-weight:500;color:#042e7d;margin-right:6px;display:block;text-transform:uppercase}::ng-deep .wf-action-list ul.action-item li .within .data{width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#747576;font-size:11px;font-weight:400;line-height:17px}::ng-deep .wf-action-list ul.action-item li:first-child{animation:action-list-open .25s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(2){animation:action-list-open .35s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(3){animation:action-list-open .45s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(4){animation:action-list-open .55s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(5){animation:action-list-open .65s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(6){animation:action-list-open .75s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(7){animation:action-list-open .85s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(8){animation:action-list-open .95s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(9){animation:action-list-open 1.05s cubic-bezier(.25,.46,.45,.94) both}::ng-deep .wf-action-list ul.action-item li:nth-child(10){animation:action-list-open 1.15s cubic-bezier(.25,.46,.45,.94) both}@keyframes action-list-open{0%{transform:translateY(50px)}to{transform:translateY(0)}}@keyframes scale-up-center{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.Configurations, decorators: [{
                    type: Optional
                }] }]; }, propDecorators: { getResponsibilityList: [{
                type: Input,
                args: ['responsibilityData']
            }], getSelectedProgramAndResp: [{
                type: Input,
                args: ['selectedProgramAndResp']
            }], getUpdatedDataList: [{
                type: Output
            }], changeSelectedProgramAndResp: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 