import { Component, Input } from '@angular/core';
import { shuffle } from 'lodash';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../../ui-kit/tooltip/tooltip.directive";
import * as i3 from "../../../formgroup/cs-radio/cs-radio.component";
import * as i4 from "../quick-settings/quick-settings.component";
import * as i5 from "../description-preview/description-preview.component";
export class RadioQuestionComponent {
    constructor() {
        this.choicesForPreviewMode = [];
    }
    ngOnInit() {
        this.choicesForPreviewMode = this.question.choices;
        if (this.question.randomize === true) {
            this.randomize();
        }
    }
    randomize() {
        this.choicesForPreviewMode = shuffle(this.choicesForPreviewMode);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RadioQuestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: RadioQuestionComponent, selector: "app-radio-question", inputs: { question: "question", questionIndex: "questionIndex" }, ngImport: i0, template: "<div class=\"question-block vx-mb-1 vx-p-4\">\n  <div class=\"question-heading vx-pb-3 vx-mb-3\">\n    <span\n      class=\"count vx-fs-13 vx-fw-400 vx-label-txt vx-d-flex vx-align-center vx-justify-center\"\n      >{{ questionIndex }}</span\n    >\n    <span class=\"heading\">\n      <span\n        class=\"vx-fs-16 vx-label-txt vx-lh-6\"\n        [innerHTML]=\"question?.title == '' ? 'Question' : question?.title\"\n      ></span>\n      <span\n        *ngIf=\"question?.isRequired\"\n        class=\"required vx-fs-20 vx-fw-300 vx-ml-1\"\n        >*</span\n      >\n    </span>\n  </div>\n  <div class=\"question-inner vx-d-flex vx-justify-between\">\n    <div class=\"question-inner-inside vx-w-100\">\n      <ng-container\n        *ngIf=\"\n          question?.hasDescription && question?.description?.trim().length > 0\n        \"\n      >\n        <app-description-preview\n          [questionIndex]=\"questionIndex\"\n          [description]=\"question?.description\"\n        ></app-description-preview>\n      </ng-container>\n      <div class=\"question-option vx-mt-3\">\n        <ul class=\"multiple-choice-list vx-p-0 vx-m-0\">\n          <li\n            class=\"vx-mt-1\"\n            *ngFor=\"\n              let choice of choicesForPreviewMode;\n              let choiceIndex = index\n            \"\n          >\n            <app-cs-radio [name]=\"question?.name\">\n              <span\n                class=\"radio-value vx-fs-13 vx-label-txt vx-fw-400 vx-lh-5\"\n                [appTooltip]=\"choice?.title\"\n                placement=\"bottom-left\"\n                delay=\"0\"\n                type=\"black\"\n                [tooltipMandatory]=\"false\"\n              >\n                {{ choice?.title ? choice?.title : \"Option\" }}</span\n              >\n            </app-cs-radio>\n          </li>\n          <li class=\"vx-mt-1\" *ngIf=\"question?.hasOther\">\n            <app-cs-radio [name]=\"question?.name\">\n              <span\n                class=\"radio-value vx-fs-13 vx-label-txt vx-fw-400 vx-lh-5\"\n                [appTooltip]=\"question.otherValue\"\n                placement=\"bottom-left\"\n                delay=\"0\"\n                type=\"black\"\n                [tooltipMandatory]=\"false\"\n                >{{ question.otherValue }}</span\n              >\n            </app-cs-radio>\n          </li>\n        </ul>\n      </div>\n    </div>\n    <div class=\"question-quickSettings\">\n      <app-quick-settings [question]=\"question\"></app-quick-settings>\n    </div>\n  </div>\n</div>\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/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.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/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\";::ng-deep .question-block{background:#f8f8f8;border-radius:.25rem;position:relative;min-height:12.5rem}::ng-deep .question-heading{border-bottom:1px solid #dbdbdb;position:relative}::ng-deep .question-heading .count{background:#dbdbdb;border-radius:50%;border:.5rem solid #fff;min-width:2.75rem;height:2.75rem;position:absolute;top:-.625rem;left:-3.25rem}::ng-deep .question-heading .heading .required{color:#c7381b;position:relative;top:-.25rem}::ng-deep .question-inner{position:relative}::ng-deep .question-inner-inside{padding-right:4rem}@media screen and (max-width: 667px){::ng-deep .question-inner-inside{padding-right:2.5rem!important;width:100%!important}}::ng-deep .question-option ul.multiple-choice-list{list-style-type:none}::ng-deep .question-option ul.multiple-choice-list li{background:#74757610;border-radius:.25rem;height:2.75rem;padding:11px .75rem}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item{width:100%!important}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item .value{width:100%!important}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item .value .radio-value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}::ng-deep .question-quickSettings{position:absolute;top:0;right:0}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ToolTipDirective, selector: "[appTooltip]", inputs: ["appTooltip", "placement", "type", "tooltipMandatory", "showTooltip", "animate"] }, { kind: "component", type: i3.CsRadioComponent, selector: "app-cs-radio", inputs: ["disabled", "readonly", "name", "checked", "value", "oneLine"], outputs: ["checkedEvent"] }, { kind: "component", type: i4.QuickSettingsComponent, selector: "app-quick-settings", inputs: ["question"] }, { kind: "component", type: i5.DescriptionPreviewComponent, selector: "app-description-preview", inputs: ["questionIndex", "description"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RadioQuestionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-radio-question', template: "<div class=\"question-block vx-mb-1 vx-p-4\">\n  <div class=\"question-heading vx-pb-3 vx-mb-3\">\n    <span\n      class=\"count vx-fs-13 vx-fw-400 vx-label-txt vx-d-flex vx-align-center vx-justify-center\"\n      >{{ questionIndex }}</span\n    >\n    <span class=\"heading\">\n      <span\n        class=\"vx-fs-16 vx-label-txt vx-lh-6\"\n        [innerHTML]=\"question?.title == '' ? 'Question' : question?.title\"\n      ></span>\n      <span\n        *ngIf=\"question?.isRequired\"\n        class=\"required vx-fs-20 vx-fw-300 vx-ml-1\"\n        >*</span\n      >\n    </span>\n  </div>\n  <div class=\"question-inner vx-d-flex vx-justify-between\">\n    <div class=\"question-inner-inside vx-w-100\">\n      <ng-container\n        *ngIf=\"\n          question?.hasDescription && question?.description?.trim().length > 0\n        \"\n      >\n        <app-description-preview\n          [questionIndex]=\"questionIndex\"\n          [description]=\"question?.description\"\n        ></app-description-preview>\n      </ng-container>\n      <div class=\"question-option vx-mt-3\">\n        <ul class=\"multiple-choice-list vx-p-0 vx-m-0\">\n          <li\n            class=\"vx-mt-1\"\n            *ngFor=\"\n              let choice of choicesForPreviewMode;\n              let choiceIndex = index\n            \"\n          >\n            <app-cs-radio [name]=\"question?.name\">\n              <span\n                class=\"radio-value vx-fs-13 vx-label-txt vx-fw-400 vx-lh-5\"\n                [appTooltip]=\"choice?.title\"\n                placement=\"bottom-left\"\n                delay=\"0\"\n                type=\"black\"\n                [tooltipMandatory]=\"false\"\n              >\n                {{ choice?.title ? choice?.title : \"Option\" }}</span\n              >\n            </app-cs-radio>\n          </li>\n          <li class=\"vx-mt-1\" *ngIf=\"question?.hasOther\">\n            <app-cs-radio [name]=\"question?.name\">\n              <span\n                class=\"radio-value vx-fs-13 vx-label-txt vx-fw-400 vx-lh-5\"\n                [appTooltip]=\"question.otherValue\"\n                placement=\"bottom-left\"\n                delay=\"0\"\n                type=\"black\"\n                [tooltipMandatory]=\"false\"\n                >{{ question.otherValue }}</span\n              >\n            </app-cs-radio>\n          </li>\n        </ul>\n      </div>\n    </div>\n    <div class=\"question-quickSettings\">\n      <app-quick-settings [question]=\"question\"></app-quick-settings>\n    </div>\n  </div>\n</div>\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/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.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/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\";::ng-deep .question-block{background:#f8f8f8;border-radius:.25rem;position:relative;min-height:12.5rem}::ng-deep .question-heading{border-bottom:1px solid #dbdbdb;position:relative}::ng-deep .question-heading .count{background:#dbdbdb;border-radius:50%;border:.5rem solid #fff;min-width:2.75rem;height:2.75rem;position:absolute;top:-.625rem;left:-3.25rem}::ng-deep .question-heading .heading .required{color:#c7381b;position:relative;top:-.25rem}::ng-deep .question-inner{position:relative}::ng-deep .question-inner-inside{padding-right:4rem}@media screen and (max-width: 667px){::ng-deep .question-inner-inside{padding-right:2.5rem!important;width:100%!important}}::ng-deep .question-option ul.multiple-choice-list{list-style-type:none}::ng-deep .question-option ul.multiple-choice-list li{background:#74757610;border-radius:.25rem;height:2.75rem;padding:11px .75rem}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item{width:100%!important}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item .value{width:100%!important}::ng-deep .question-option ul.multiple-choice-list li app-cs-radio .radio-item .value .radio-value{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}::ng-deep .question-quickSettings{position:absolute;top:0;right:0}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { question: [{
                type: Input
            }], questionIndex: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 