import { Component, EventEmitter, Input, Output } from '@angular/core';
import { CaseEditComponent } from '../../../case-edit';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "rpx-xui-translation";
const _c0 = (a0, a1, a2) => ["/", "cases", "case-details", a0, a1, a2, "tasks"];
export class CaseEventCompletionTaskCancelledComponent {
    context;
    notifyEventCompletionCancelled = new EventEmitter();
    caseId;
    jurisdiction;
    caseType;
    ngOnInit() {
        this.caseId = this.context.caseId;
        this.jurisdiction = this.context.task.jurisdiction;
        this.caseType = this.context.task.case_type_id;
    }
    onContinue() {
        // Removes task to complete so event completes without task
        this.context.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
        // may be able to remove this call below since it is now unneccesary
        this.notifyEventCompletionCancelled.emit(true);
    }
    static ɵfac = function CaseEventCompletionTaskCancelledComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEventCompletionTaskCancelledComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionTaskCancelledComponent, selectors: [["app-case-event-completion-task-cancelled"]], inputs: { context: "context" }, outputs: { notifyEventCompletionCancelled: "notifyEventCompletionCancelled" }, decls: 31, vars: 29, consts: [[1, "govuk-!-margin-9"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["href", "#"], [1, "govuk-form-group", "govuk-form-group--error"], [1, "govuk-heading-m"], [1, "form-group", "form-group-related"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-!-margin-right-2", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "routerLink"]], template: function CaseEventCompletionTaskCancelledComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2", 2);
            i0.ɵɵtext(3);
            i0.ɵɵpipe(4, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(5, "div", 3)(6, "ul", 4)(7, "li")(8, "a", 5);
            i0.ɵɵtext(9);
            i0.ɵɵpipe(10, "rpxTranslate");
            i0.ɵɵelementEnd()()()()();
            i0.ɵɵelementStart(11, "div", 6)(12, "h2", 7);
            i0.ɵɵtext(13);
            i0.ɵɵpipe(14, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(15, "p");
            i0.ɵɵtext(16);
            i0.ɵɵpipe(17, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(18, "p");
            i0.ɵɵtext(19);
            i0.ɵɵpipe(20, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(21, "p");
            i0.ɵɵtext(22);
            i0.ɵɵpipe(23, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(24, "div", 8)(25, "button", 9);
            i0.ɵɵlistener("click", function CaseEventCompletionTaskCancelledComponent_Template_button_click_25_listener() { return ctx.onContinue(); });
            i0.ɵɵtext(26);
            i0.ɵɵpipe(27, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(28, "a", 10);
            i0.ɵɵtext(29);
            i0.ɵɵpipe(30, "rpxTranslate");
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 9, "There is a problem"), " ");
            i0.ɵɵadvance(6);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 11, "Task cancelled/marked as done"));
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(14, 13, "Task cancelled/marked as done"));
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 15, "This task has been cancelled or marked as done."));
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(20, 17, "Click Continue to complete the event and save your progress."));
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 19, "Alternatively, click Cancel to return to the tasks tab without saving your progress."));
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(27, 21, "Continue"), " ");
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction3(25, _c0, ctx.jurisdiction, ctx.caseType, ctx.caseId));
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 23, "Cancel"), " ");
        } }, dependencies: [i1.RouterLink, i2.RpxTranslatePipe], encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventCompletionTaskCancelledComponent, [{
        type: Component,
        args: [{ selector: 'app-case-event-completion-task-cancelled', template: "<div class=\"govuk-!-margin-9\">\n  <div class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"error-summary\">\n    <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n      {{'There is a problem' | rpxTranslate}}\n    </h2>\n    <div class=\"govuk-error-summary__body\">\n      <ul class=\"govuk-list govuk-error-summary__list\">\n        <li>\n          <a href=\"#\">{{'Task cancelled/marked as done' | rpxTranslate}}</a>\n        </li>\n      </ul>\n    </div>\n  </div>\n\n  <div class=\"govuk-form-group govuk-form-group--error\">\n    <h2 class=\"govuk-heading-m\">{{'Task cancelled/marked as done' | rpxTranslate}}</h2>\n    <p>{{'This task has been cancelled or marked as done.' | rpxTranslate}}</p>\n    <p>{{'Click Continue to complete the event and save your progress.' | rpxTranslate}}</p>\n\n    <p>{{'Alternatively, click Cancel to return to the tasks tab without saving your progress.' | rpxTranslate}}</p>\n\n    <div class=\"form-group form-group-related\">\n      <button class=\"govuk-button govuk-!-margin-right-2\" data-module=\"govuk-button\" (click)=\"onContinue()\">\n        {{'Continue' | rpxTranslate}}\n      </button>\n      <a [routerLink]=\"['/', 'cases', 'case-details', jurisdiction, caseType, caseId, 'tasks']\"\n              class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n        {{'Cancel' | rpxTranslate}}\n      </a>\n    </div>\n  </div>\n</div>\n" }]
    }], null, { context: [{
            type: Input
        }], notifyEventCompletionCancelled: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskCancelledComponent, { className: "CaseEventCompletionTaskCancelledComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64, 