var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { CaseEditComponent } from '../case-edit/case-edit.component';
import { Router } from '@angular/router';
var CaseEditConfirmComponent = /** @class */ (function () {
    function CaseEditConfirmComponent(caseEdit, router) {
        this.caseEdit = caseEdit;
        this.router = router;
        this.triggerText = 'Close and return to details view';
        this.formGroup = new FormControl();
        this.eventTrigger = this.caseEdit.eventTrigger;
        if (this.caseEdit.confirmation) {
            this.confirmation = this.caseEdit.confirmation;
            this.caseId = this.caseEdit.confirmation.getCaseId();
        }
        else {
            this.router.navigate(['/']);
        }
    }
    CaseEditConfirmComponent.prototype.submit = function () {
        this.caseEdit.submitted.emit({ caseId: this.confirmation.getCaseId(), status: this.confirmation.getStatus() });
    };
    CaseEditConfirmComponent.prototype.getCaseId = function () {
        return (this.caseEdit.caseDetails ? this.caseEdit.caseDetails.case_id : '');
    };
    CaseEditConfirmComponent = __decorate([
        Component({
            template: "\n    <!-- Current Page && Event trigger name -->\n    <h1 class=\"heading-h1\">{{ eventTrigger.name}}</h1>\n\n    <!-- Case ID -->\n    <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">\n      #{{ getCaseId() | ccdCaseReference}}\n    </h2>\n\n    <form [formGroup]=\"formGroup\" (submit)=\"submit()\">\n      <div id=\"confirmation-header\" *ngIf=\"confirmation.getHeader()\">\n        <ccd-markdown [content]=\"confirmation.getHeader()\"></ccd-markdown>\n      </div>\n      <div id=\"confirmation-body\" *ngIf=\"confirmation.getBody()\">\n        <ccd-markdown [content]=\"confirmation.getBody()\"></ccd-markdown>\n      </div>\n      <button type=\"submit\" class=\"button\" data-ng-click=\"submit()\">{{this.triggerText}}</button>\n    </form>\n  ",
            styles: ["\n    #fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#ffffff;text-align:center}#confirmation-body{width:630px;background-color:#ffffff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}\n  "]
        }),
        __metadata("design:paramtypes", [CaseEditComponent, Router])
    ], CaseEditConfirmComponent);
    return CaseEditConfirmComponent;
}());
export { CaseEditConfirmComponent };
//# sourceMappingURL=case-edit-confirm.component.js.map