import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
export class FrequencyDialogDueDateComponent {
    constructor() {
        this.defaultWindow = 1;
        this.defaultFailed = 0;
        this.defaultDeactivate = 0;
        this.mode = '';
        this.completedValue = 5; // take input for completed
        this.deactivateValue = 15;
        this.isDeactivated = false;
        this.id = 0;
        this.pageName = '';
        this.windowCloses = 2;
        this.valueChange = new EventEmitter();
        this.windowOpenChange = new EventEmitter();
        this.extensionValueChange = new EventEmitter();
    }
    ngOnInit() { }
    onValueChange(event, actionType) {
        if (!Number.isNaN(Number(event?.target?.value)) &&
            parseInt(event?.target?.value) > 0) {
            this.valueChange.emit({
                type: actionType,
                value: Number(event?.target?.value),
                pageName: this.pageName,
            });
        }
        else {
            if (actionType === 'completed') {
                this.completedValue = this.defaultWindow;
                this.valueChange.emit({
                    type: actionType,
                    value: this.defaultWindow,
                    pageName: this.pageName,
                });
            }
        }
    }
    onWindowOpenChange(event, actionType) {
        if (!Number.isNaN(Number(event?.target?.value)) &&
            parseInt(event?.target?.value) > 0) {
            this.windowOpenChange.emit({
                type: actionType,
                value: Number(event?.target?.value),
                pageName: this.pageName,
            });
        }
        else {
            if (actionType === 'window open') {
                this.completedValue = this.defaultWindow;
                this.windowOpenChange.emit({
                    type: actionType,
                    value: this.defaultWindow,
                    pageName: this.pageName,
                });
            }
        }
    }
    onExtensionValueChange(event, actionType) {
        if (!Number.isNaN(Number(event?.target?.value)) &&
            parseInt(event?.target?.value) > 0) {
            this.extensionValueChange.emit({
                type: actionType,
                value: Number(event?.target?.value),
                pageName: this.pageName,
            });
        }
        else {
            if (actionType === 'extension') {
                this.completedValue = this.defaultWindow;
                this.extensionValueChange.emit({
                    type: actionType,
                    value: this.defaultWindow,
                    pageName: this.pageName,
                });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyDialogDueDateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FrequencyDialogDueDateComponent, selector: "app-frequency-dialog-due-date", inputs: { mode: "mode", completedValue: "completedValue", deactivateValue: "deactivateValue", isDeactivated: "isDeactivated", id: "id", pageName: "pageName", windowCloses: "windowCloses", assessWindowOpen: "assessWindowOpen" }, outputs: { valueChange: "valueChange", windowOpenChange: "windowOpenChange", extensionValueChange: "extensionValueChange" }, ngImport: i0, template: "<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Assessment window opens\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    The risk can be assessed on the assessment due date and\n    <input\n      class=\"countNum\"\n      [id]=\"'complete-' + id\"\n      type=\"number\"\n      [(ngModel)]=\"assessWindowOpen\"\n      (change)=\"onWindowOpenChange($event, 'window open')\"\n      onkeydown=\"return event.keyCode !== 190\"\n      min=\"0\"\n      oninput=\"this.value = Math.abs(this.value)\"\n    />\n    {{ assessWindowOpen < 2 ? 'day' : 'days' }} before the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Extension\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n  The risk can be assessed\n    <input\n      class=\"countNum\"\n      type=\"number\"\n      [id]=\"'not-completed-' + id\"\n      [(ngModel)]=\"windowCloses\"\n      (change)=\"onExtensionValueChange($event, 'extension')\"\n      onkeydown=\"return event.keyCode !== 190\"\n      min=\"0\"\n      oninput=\"this.value = Math.abs(this.value)\"\n    />\n    {{ windowCloses < 2 ? 'day' : 'days' }} after the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Assessment window closes:\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    The risk cannot be assessed\n    <span class=\"vx-fw-500 vx-label-txt\">{{windowCloses}}</span>\n    {{ windowCloses < 2 ? 'day' : 'days' }} after the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    REASSESSMENT EMAIL NOTIFICATION:\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    VComply will send an email reminder\n    <input\n      class=\"countNum\"\n      [id]=\"'complete-' + id\"\n      type=\"number\"\n      [(ngModel)]=\"completedValue\"\n      (change)=\"onValueChange($event, 'completed')\"\n      onkeydown=\"return event.keyCode !== 190\" min=\"0\" oninput=\"this.value = Math.abs(this.value)\" />\n      {{ completedValue < 2 ? 'day' : 'days' }} before the risk assessment due date if it is not done.\n  </div>\n</div>\n\n", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.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-top.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/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.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\";::ng-deep .frequency-bottom-item-box{border-radius:.25rem;border:1px solid #f1f1f1}::ng-deep .frequency-bottom-item-box input.countNum{-moz-appearance:textfield;border:none;border-bottom:1px solid #DBDBDB;color:#161b2f;display:inline-block;font-size:13px;text-align:center;width:2.75rem;padding:.125rem;margin:0 .5rem;outline:none}::ng-deep .frequency-bottom-item-box input.countNum::-webkit-inner-spin-button,::ng-deep .frequency-bottom-item-box input.countNum::-webkit-outer-spin-button{-webkit-appearance:none}::ng-deep .frequency-bottom-item-box .completed-text{color:#34aa44}::ng-deep .frequency-bottom-item-box .delay-text{color:#f0b819}::ng-deep .frequency-bottom-item-box .notcompleted-text{color:#d93b41}::ng-deep .frequency-dialog-due-date-item{border-top:1px solid #f1f1f1;height:3.5rem}::ng-deep .frequency-dialog-due-date-item:first-of-type,::ng-deep .frequency-dialog-due-date-item:only-child{border-top:none}::ng-deep .frequency-dialog-due-date-item input[type=number]{background:transparent;border-radius:0;border:none;border-bottom:1px solid #dbdbdb;color:#161b2f;font-size:13px;height:1.5rem;width:3rem;text-align:center;outline:none}::ng-deep .frequency-dialog-due-date-item input[type=number]::-webkit-outer-spin-button,::ng-deep .frequency-dialog-due-date-item input[type=number]::-webkit-inner-spin-button{-moz-appearance:none;-webkit-appearance:none;margin:0}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyDialogDueDateComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-frequency-dialog-due-date', template: "<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Assessment window opens\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    The risk can be assessed on the assessment due date and\n    <input\n      class=\"countNum\"\n      [id]=\"'complete-' + id\"\n      type=\"number\"\n      [(ngModel)]=\"assessWindowOpen\"\n      (change)=\"onWindowOpenChange($event, 'window open')\"\n      onkeydown=\"return event.keyCode !== 190\"\n      min=\"0\"\n      oninput=\"this.value = Math.abs(this.value)\"\n    />\n    {{ assessWindowOpen < 2 ? 'day' : 'days' }} before the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Extension\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n  The risk can be assessed\n    <input\n      class=\"countNum\"\n      type=\"number\"\n      [id]=\"'not-completed-' + id\"\n      [(ngModel)]=\"windowCloses\"\n      (change)=\"onExtensionValueChange($event, 'extension')\"\n      onkeydown=\"return event.keyCode !== 190\"\n      min=\"0\"\n      oninput=\"this.value = Math.abs(this.value)\"\n    />\n    {{ windowCloses < 2 ? 'day' : 'days' }} after the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    Assessment window closes:\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    The risk cannot be assessed\n    <span class=\"vx-fw-500 vx-label-txt\">{{windowCloses}}</span>\n    {{ windowCloses < 2 ? 'day' : 'days' }} after the assessment due date.\n  </div>\n</div>\n\n<div class=\"frequency-bottom-item vx-mt-5\">\n  <div class=\"vx-fs-11 vx-fw-500 vx-label-txt vx-tt-uppercase vx-mb-1\">\n    REASSESSMENT EMAIL NOTIFICATION:\n  </div>\n  <div\n    class=\"frequency-bottom-item-box vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\"\n  >\n    VComply will send an email reminder\n    <input\n      class=\"countNum\"\n      [id]=\"'complete-' + id\"\n      type=\"number\"\n      [(ngModel)]=\"completedValue\"\n      (change)=\"onValueChange($event, 'completed')\"\n      onkeydown=\"return event.keyCode !== 190\" min=\"0\" oninput=\"this.value = Math.abs(this.value)\" />\n      {{ completedValue < 2 ? 'day' : 'days' }} before the risk assessment due date if it is not done.\n  </div>\n</div>\n\n", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.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-top.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/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.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\";::ng-deep .frequency-bottom-item-box{border-radius:.25rem;border:1px solid #f1f1f1}::ng-deep .frequency-bottom-item-box input.countNum{-moz-appearance:textfield;border:none;border-bottom:1px solid #DBDBDB;color:#161b2f;display:inline-block;font-size:13px;text-align:center;width:2.75rem;padding:.125rem;margin:0 .5rem;outline:none}::ng-deep .frequency-bottom-item-box input.countNum::-webkit-inner-spin-button,::ng-deep .frequency-bottom-item-box input.countNum::-webkit-outer-spin-button{-webkit-appearance:none}::ng-deep .frequency-bottom-item-box .completed-text{color:#34aa44}::ng-deep .frequency-bottom-item-box .delay-text{color:#f0b819}::ng-deep .frequency-bottom-item-box .notcompleted-text{color:#d93b41}::ng-deep .frequency-dialog-due-date-item{border-top:1px solid #f1f1f1;height:3.5rem}::ng-deep .frequency-dialog-due-date-item:first-of-type,::ng-deep .frequency-dialog-due-date-item:only-child{border-top:none}::ng-deep .frequency-dialog-due-date-item input[type=number]{background:transparent;border-radius:0;border:none;border-bottom:1px solid #dbdbdb;color:#161b2f;font-size:13px;height:1.5rem;width:3rem;text-align:center;outline:none}::ng-deep .frequency-dialog-due-date-item input[type=number]::-webkit-outer-spin-button,::ng-deep .frequency-dialog-due-date-item input[type=number]::-webkit-inner-spin-button{-moz-appearance:none;-webkit-appearance:none;margin:0}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { mode: [{
                type: Input
            }], completedValue: [{
                type: Input
            }], deactivateValue: [{
                type: Input
            }], isDeactivated: [{
                type: Input
            }], id: [{
                type: Input
            }], pageName: [{
                type: Input
            }], windowCloses: [{
                type: Input
            }], assessWindowOpen: [{
                type: Input
            }], valueChange: [{
                type: Output
            }], windowOpenChange: [{
                type: Output
            }], extensionValueChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 