import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { RaiseQueryErrorMessage } from '../../../enums';
import { CaseEventTrigger, CaseView } from '../../../../../../../../lib/shared/domain';
import { QueryCreateContext, QueryListItem } from '../../../models';
import { QueryManagementService } from '../../../services';
import { ActivatedRoute } from '@angular/router';
import * as i0 from "@angular/core";
import * as i1 from "../../../services";
import * as i2 from "@angular/router";
const _c0 = a0 => ({ "govuk-form-group--error": a0 });
function QueryWriteRaiseQueryComponent_ccd_query_case_details_header_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-query-case-details-header", 5);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("caseDetails", ctx_r0.caseDetails);
} }
function QueryWriteRaiseQueryComponent_div_11_p_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 33)(1, "span", 11);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.getSubjectErrorMessage()), " ");
} }
function QueryWriteRaiseQueryComponent_div_11_p_29_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 34)(1, "span", 11);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(3, 2, "Error:"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(5, 4, ctx_r0.raiseQueryErrorMessage.QUERY_BODY), " ");
} }
function QueryWriteRaiseQueryComponent_div_11_p_38_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 35)(1, "span", 11);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(3, 2, "Error:"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(5, 4, ctx_r0.raiseQueryErrorMessage.QUERY_HEARING_RELATED), " ");
} }
function QueryWriteRaiseQueryComponent_div_11_ng_container_50_p_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 41)(1, "span", 11);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(3, 2, "Error:"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(5, 4, ctx_r0.raiseQueryErrorMessage.QUERY_HEARING_DATE), " ");
} }
function QueryWriteRaiseQueryComponent_div_11_ng_container_50_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 36)(2, "fieldset", 37)(3, "legend")(4, "label", 38);
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵtemplate(7, QueryWriteRaiseQueryComponent_div_11_ng_container_50_p_7_Template, 6, 6, "p", 39);
    i0.ɵɵelement(8, "ccd-query-write-date-input", 40);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0, ctx_r0.submitted && ctx_r0.formGroup.get("isHearingRelated").value === true && ctx_r0.formGroup.get("hearingDate").value === null));
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 3, "What is the date of the hearing?"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.submitted && ctx_r0.formGroup.get("isHearingRelated").value === true && ctx_r0.formGroup.get("hearingDate").value === null);
} }
function QueryWriteRaiseQueryComponent_div_11_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 6)(1, "div", 7)(2, "div")(3, "div", 8)(4, "span", 9);
    i0.ɵɵtext(5, "!");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "strong", 10)(7, "span", 11);
    i0.ɵɵtext(8, "Warning");
    i0.ɵɵelementEnd();
    i0.ɵɵelement(9, "ccd-markdown", 12);
    i0.ɵɵpipe(10, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "div", 13)(12, "div", 14)(13, "label", 15);
    i0.ɵɵtext(14);
    i0.ɵɵpipe(15, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(16, "div", 16);
    i0.ɵɵtext(17);
    i0.ɵɵpipe(18, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(19, QueryWriteRaiseQueryComponent_div_11_p_19_Template, 6, 6, "p", 17);
    i0.ɵɵelementStart(20, "input", 18);
    i0.ɵɵlistener("input", function QueryWriteRaiseQueryComponent_div_11_Template_input_input_20_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onSubjectInput()); });
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(21, "div", 13)(22, "div", 14)(23, "label", 19);
    i0.ɵɵtext(24);
    i0.ɵɵpipe(25, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(26, "div", 20);
    i0.ɵɵtext(27);
    i0.ɵɵpipe(28, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(29, QueryWriteRaiseQueryComponent_div_11_p_29_Template, 6, 6, "p", 21);
    i0.ɵɵelementStart(30, "textarea", 22);
    i0.ɵɵtext(31, "          ");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(32, "div", 13)(33, "fieldset", 23)(34, "legend")(35, "label", 24);
    i0.ɵɵtext(36);
    i0.ɵɵpipe(37, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵtemplate(38, QueryWriteRaiseQueryComponent_div_11_p_38_Template, 6, 6, "p", 25);
    i0.ɵɵelementStart(39, "div", 26)(40, "div", 27);
    i0.ɵɵelement(41, "input", 28);
    i0.ɵɵelementStart(42, "label", 29);
    i0.ɵɵtext(43);
    i0.ɵɵpipe(44, "rpxTranslate");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(45, "div", 27);
    i0.ɵɵelement(46, "input", 30);
    i0.ɵɵelementStart(47, "label", 31);
    i0.ɵɵtext(48);
    i0.ɵɵpipe(49, "rpxTranslate");
    i0.ɵɵelementEnd()()()();
    i0.ɵɵtemplate(50, QueryWriteRaiseQueryComponent_div_11_ng_container_50_Template, 9, 7, "ng-container", 32);
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("formGroup", ctx_r0.formGroup);
    i0.ɵɵadvance(8);
    i0.ɵɵproperty("content", i0.ɵɵpipeBind1(10, 23, ctx_r0.serviceMessage));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(43, _c0, ctx_r0.submitted && ctx_r0.formGroup.get("subject").hasError("required")));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(15, 25, "Query subject"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 27, "The subject should be a summary of your query"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.submitted && (ctx_r0.formGroup.get("subject").hasError("required") || ctx_r0.formGroup.get("subject").hasError("maxlength")));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(45, _c0, ctx_r0.submitted && ctx_r0.formGroup.get("body").hasError("required")));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(25, 29, "Query detail"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(28, 31, "Include as many details as possible so case workers can respond to your query"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.submitted && ctx_r0.formGroup.get("body").hasError("required"));
    i0.ɵɵadvance();
    i0.ɵɵclassProp("govuk-textarea--error", ctx_r0.submitted && ctx_r0.formGroup.get("body").hasError("required"));
    i0.ɵɵproperty("formControlName", "body");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(47, _c0, ctx_r0.submitted && ctx_r0.formGroup.get("isHearingRelated").hasError("required")));
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(37, 33, "Is the query hearing related?"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.submitted && ctx_r0.formGroup.get("isHearingRelated").hasError("required"));
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("checked", ctx_r0.formGroup.get("isHearingRelated").value === true)("value", true);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind3(44, 35, "Is the query hearing related?", null, "Yes"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("checked", ctx_r0.formGroup.get("isHearingRelated").value === false)("value", false);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind3(49, 39, "Is the query hearing related?", null, "No"), " ");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.formGroup.get("isHearingRelated").value);
} }
export class QueryWriteRaiseQueryComponent {
    queryManagementService;
    route;
    formGroup;
    submitted;
    caseDetails;
    showForm;
    serviceMessage;
    queryCreateContext;
    eventData = null;
    queryItem;
    validate;
    triggerSubmission;
    queryDataCreated = new EventEmitter();
    raiseQueryErrorMessage = RaiseQueryErrorMessage;
    eventCompletionParams;
    messageId;
    constructor(queryManagementService, route) {
        this.queryManagementService = queryManagementService;
        this.route = route;
    }
    ngOnChanges() {
        this.messageId = this.route.snapshot.params.dataid;
        const isCollectionDataSet = this.setCaseQueriesCollectionData();
        if (isCollectionDataSet) {
            if (this.triggerSubmission) {
                const data = this.generateCaseQueriesCollectionData();
                this.queryDataCreated.emit(data);
            }
        }
    }
    onSubjectInput() {
        const control = this.formGroup.get('subject');
        const value = control?.value;
        if (value && value.length > 200) {
            control?.setValue(value.substring(0, 200));
        }
    }
    getSubjectErrorMessage() {
        const control = this.formGroup.get('subject');
        if (control.hasError('required')) {
            return this.raiseQueryErrorMessage.QUERY_SUBJECT;
        }
        if (control.hasError('maxlength')) {
            return this.raiseQueryErrorMessage.QUERY_SUBJECT_MAX_LENGTH;
        }
        return '';
    }
    setCaseQueriesCollectionData() {
        if (!this.eventData) {
            console.warn('Event data not available; skipping collection setup.');
            return false;
        }
        this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
        return true;
    }
    generateCaseQueriesCollectionData() {
        return this.queryManagementService.generateCaseQueriesCollectionData(this.formGroup, this.queryCreateContext, this.queryItem, this.messageId);
    }
    static ɵfac = function QueryWriteRaiseQueryComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryWriteRaiseQueryComponent)(i0.ɵɵdirectiveInject(i1.QueryManagementService), i0.ɵɵdirectiveInject(i2.ActivatedRoute)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRaiseQueryComponent, selectors: [["ccd-query-write-raise-query"]], inputs: { formGroup: "formGroup", submitted: "submitted", caseDetails: "caseDetails", showForm: "showForm", serviceMessage: "serviceMessage", queryCreateContext: "queryCreateContext", eventData: "eventData", queryItem: "queryItem", validate: "validate", triggerSubmission: "triggerSubmission" }, outputs: { queryDataCreated: "queryDataCreated" }, features: [i0.ɵɵNgOnChangesFeature], decls: 12, vars: 8, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-4"], [3, "caseDetails", 4, "ngIf"], ["class", "govuk-!-margin-bottom-4", 4, "ngIf"], [3, "caseDetails"], [1, "govuk-!-margin-bottom-4"], [3, "formGroup"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [3, "content"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], ["for", "subject", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "subject-hint", 1, "govuk-hint"], ["id", "subject-error", "class", "govuk-error-message", 4, "ngIf"], ["type", "text", "id", "subject", "formControlName", "subject", "maxlength", "200", "aria-describedby", "subject-error", 1, "govuk-input", 3, "input"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-hint", 1, "govuk-hint"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], [1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "isHearingRelated-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--inline"], [1, "govuk-radios__item"], ["id", "isHearingRelated-yes", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-yes", 1, "govuk-label", "govuk-radios__label"], ["id", "isHearingRelated-no", "name", "isHearingRelated", "type", "radio", "formControlName", "isHearingRelated", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "isHearingRelated-no", 1, "govuk-label", "govuk-radios__label"], [4, "ngIf"], ["id", "subject-error", 1, "govuk-error-message"], ["id", "body-error", 1, "govuk-error-message"], ["id", "isHearingRelated-error", 1, "govuk-error-message"], [1, "govuk-radios__conditional", "govuk-!-margin-top-1", 3, "ngClass"], ["role", "group", 1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--s"], ["id", "hearingDate-error", "class", "govuk-error-message", 4, "ngIf"], ["formControlName", "hearingDate"], ["id", "hearingDate-error", 1, "govuk-error-message"]], template: function QueryWriteRaiseQueryComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "div", 1);
            i0.ɵɵtext(3);
            i0.ɵɵpipe(4, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(5, "h1", 2);
            i0.ɵɵtext(6);
            i0.ɵɵpipe(7, "rpxTranslate");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(8, "div");
            i0.ɵɵtemplate(9, QueryWriteRaiseQueryComponent_ccd_query_case_details_header_9_Template, 1, 1, "ccd-query-case-details-header", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵelement(10, "hr");
            i0.ɵɵtemplate(11, QueryWriteRaiseQueryComponent_div_11_Template, 51, 49, "div", 4);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 4, "Raise a query"));
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 6, "Enter query details"));
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngIf", ctx.caseDetails);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.showForm);
        } }, encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryWriteRaiseQueryComponent, [{
        type: Component,
        args: [{ selector: 'ccd-query-write-raise-query', template: "<div>\n  <div class=\"govuk-!-margin-bottom-6\">\n    <div class=\"govuk-caption-l\">{{ 'Raise a query' | rpxTranslate }}</div>\n    <h1 class=\"govuk-heading-l govuk-!-margin-bottom-4\">{{ 'Enter query details' | rpxTranslate }}</h1>\n  </div>\n\n  <div>\n    <ccd-query-case-details-header [caseDetails]=\"caseDetails\" *ngIf=\"caseDetails\"></ccd-query-case-details-header>\n  </div>\n\n  <hr>\n\n  <div class=\"govuk-!-margin-bottom-4\" *ngIf=\"showForm\">\n    <div [formGroup]=\"formGroup\">\n      <div>\n        <div class=\"govuk-warning-text\">\n          <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n          <strong class=\"govuk-warning-text__text\">\n            <span class=\"govuk-visually-hidden\">Warning</span>\n            <ccd-markdown\n              [content]=\"serviceMessage | rpxTranslate\">\n            </ccd-markdown>\n          </strong>\n        </div>\n        <div class=\"govuk-form-group\" [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('subject').hasError('required')}\">\n          <div class=\"govuk-label-wrapper\">\n            <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"subject\">\n              {{ 'Query subject' | rpxTranslate }}\n            </label>\n          </div>\n          <div id=\"subject-hint\" class=\"govuk-hint\">\n            {{ 'The subject should be a summary of your query' | rpxTranslate }}\n          </div>\n          <p id=\"subject-error\" class=\"govuk-error-message\"\n            *ngIf=\"submitted && (formGroup.get('subject').hasError('required') || formGroup.get('subject').hasError('maxlength'))\">\n            <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }}</span>\n            {{ getSubjectErrorMessage() | rpxTranslate }}\n          </p>\n\n          <input type=\"text\"\n            id=\"subject\"\n            class=\"govuk-input\"\n            formControlName=\"subject\"\n            maxlength=\"200\"\n            (input)=\"onSubjectInput()\"\n            aria-describedby=\"subject-error\" />\n      </div>\n\n        <div class=\"govuk-form-group\"\n             [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('body').hasError('required')}\">\n          <div class=\"govuk-label-wrapper\">\n            <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"body\">\n              {{ 'Query detail' | rpxTranslate }}\n            </label>\n          </div>\n          <div id=\"body-hint\" class=\"govuk-hint\">\n            {{ 'Include as many details as possible so case workers can respond to your query' | rpxTranslate }}\n          </div>\n          <p id=\"body-error\" class=\"govuk-error-message\"\n              *ngIf=\"submitted && formGroup.get('body').hasError('required')\">\n            <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_BODY | rpxTranslate }}\n          </p>\n          <textarea [formControlName]=\"'body'\"\n                    id=\"body\" name=\"body\" rows=\"5\"\n                    aria-describedby=\"body-hint body-error\"\n                    class=\"govuk-textarea\"\n                    [class.govuk-textarea--error]=\"submitted && formGroup.get('body').hasError('required')\"\n          >\n          </textarea>\n      </div>\n\n      <div class=\"govuk-form-group\"\n           [ngClass]=\"{'govuk-form-group--error': submitted && formGroup.get('isHearingRelated').hasError('required')}\">\n        <fieldset class=\"govuk-fieldset\">\n          <legend>\n            <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\">\n              {{ 'Is the query hearing related?' | rpxTranslate }}\n            </label>\n          </legend>\n          <p id=\"isHearingRelated-error\" class=\"govuk-error-message\"\n              *ngIf=\"submitted && formGroup.get('isHearingRelated').hasError('required')\">\n            <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_HEARING_RELATED | rpxTranslate }}\n          </p>\n          <div class=\"govuk-radios govuk-radios--inline\" data-module=\"govuk-radios\">\n            <div class=\"govuk-radios__item\">\n              <input class=\"govuk-radios__input\" id=\"isHearingRelated-yes\" name=\"isHearingRelated\"\n                     type=\"radio\"\n                     formControlName=\"isHearingRelated\"\n                     [checked]=\"formGroup.get('isHearingRelated').value === true\" [value]=\"true\"\n              >\n              <label class=\"govuk-label govuk-radios__label\" for=\"isHearingRelated-yes\">\n                {{ 'Is the query hearing related?' | rpxTranslate: null : 'Yes' }}\n              </label>\n            </div>\n            <div class=\"govuk-radios__item\">\n              <input class=\"govuk-radios__input\" id=\"isHearingRelated-no\" name=\"isHearingRelated\"\n                     type=\"radio\"\n                     formControlName=\"isHearingRelated\"\n                     [checked]=\"formGroup.get('isHearingRelated').value === false\" [value]=\"false\"\n              >\n              <label class=\"govuk-label govuk-radios__label\" for=\"isHearingRelated-no\">\n                {{ 'Is the query hearing related?' | rpxTranslate: null : 'No' }}\n              </label>\n            </div>\n          </div>\n        </fieldset>\n\n        <ng-container *ngIf=\"formGroup.get('isHearingRelated').value\">\n          <div class=\"govuk-radios__conditional govuk-!-margin-top-1\"\n               [ngClass]=\"{'govuk-form-group--error': submitted &&\n               formGroup.get('isHearingRelated').value === true &&\n               formGroup.get('hearingDate').value === null}\">\n            <fieldset class=\"govuk-fieldset\" role=\"group\">\n              <legend>\n                <label class=\"govuk-label govuk-label--s\">\n                  {{ 'What is the date of the hearing?' | rpxTranslate }}\n                </label>\n              </legend>\n              <p id=\"hearingDate-error\" class=\"govuk-error-message\"\n                  *ngIf=\"submitted && formGroup.get('isHearingRelated').value === true && formGroup.get('hearingDate').value === null\">\n                <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ raiseQueryErrorMessage.QUERY_HEARING_DATE | rpxTranslate }}\n              </p>\n              <ccd-query-write-date-input formControlName=\"hearingDate\"></ccd-query-write-date-input>\n            </fieldset>\n          </div>\n        </ng-container>\n      </div>\n    </div>\n  </div>\n</div>\n" }]
    }], () => [{ type: i1.QueryManagementService }, { type: i2.ActivatedRoute }], { formGroup: [{
            type: Input
        }], submitted: [{
            type: Input
        }], caseDetails: [{
            type: Input
        }], showForm: [{
            type: Input
        }], serviceMessage: [{
            type: Input
        }], queryCreateContext: [{
            type: Input
        }], eventData: [{
            type: Input
        }], queryItem: [{
            type: Input
        }], validate: [{
            type: Input
        }], triggerSubmission: [{
            type: Input
        }], queryDataCreated: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRaiseQueryComponent, { className: "QueryWriteRaiseQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.ts", lineNumber: 19 }); })();
//# sourceMappingURL=data:application/json;base64, 