import { Component, EventEmitter, Input, Output } from '@angular/core';
import { NotificationBannerType } from './enums';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function NotificationBannerComponent_div_0_ng_container_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(1, "svg", 10);
    i0.ɵɵelement(2, "path", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
function NotificationBannerComponent_div_0_ng_container_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(1, "svg", 10);
    i0.ɵɵelement(2, "path", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
function NotificationBannerComponent_div_0_ng_container_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(1, "svg", 10);
    i0.ɵɵelement(2, "path", 12);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
function NotificationBannerComponent_div_0_ng_container_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(1, "svg", 10);
    i0.ɵɵelement(2, "path", 13);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
function NotificationBannerComponent_div_0_a_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 14);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵpropertyInterpolate("href", ctx_r0.notificationBannerConfig.linkUrl, i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.notificationBannerConfig.linkText);
} }
function NotificationBannerComponent_div_0_a_13_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 15);
    i0.ɵɵlistener("click", function NotificationBannerComponent_div_0_a_13_Template_a_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); ctx_r0.onLinkClick(ctx_r0.notificationBannerConfig.triggerOutputEventText); return i0.ɵɵresetView($event.preventDefault()); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.notificationBannerConfig.linkText);
} }
function NotificationBannerComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(4, "div", 4)(5, "p", 5);
    i0.ɵɵelementContainerStart(6, 6);
    i0.ɵɵtemplate(7, NotificationBannerComponent_div_0_ng_container_7_Template, 3, 0, "ng-container", 7)(8, NotificationBannerComponent_div_0_ng_container_8_Template, 3, 0, "ng-container", 7)(9, NotificationBannerComponent_div_0_ng_container_9_Template, 3, 0, "ng-container", 7)(10, NotificationBannerComponent_div_0_ng_container_10_Template, 3, 0, "ng-container", 7);
    i0.ɵɵelementContainerEnd();
    i0.ɵɵtext(11);
    i0.ɵɵtemplate(12, NotificationBannerComponent_div_0_a_12_Template, 2, 2, "a", 8)(13, NotificationBannerComponent_div_0_a_13_Template, 2, 1, "a", 9);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", ctx_r0.notificationBannerConfig.headerClass);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", ctx_r0.notificationBannerConfig.headingText, " ");
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngSwitch", ctx_r0.notificationBannerConfig.bannerType);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.notificationBannerType.WARNING);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.notificationBannerType.ERROR);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.notificationBannerType.SUCCESS);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngSwitchCase", ctx_r0.notificationBannerType.INFORMATION);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r0.notificationBannerConfig.description, " ");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.notificationBannerConfig.showLink && !ctx_r0.notificationBannerConfig.triggerOutputEvent);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.notificationBannerConfig.showLink && ctx_r0.notificationBannerConfig.triggerOutputEvent);
} }
export class NotificationBannerComponent {
    notificationBannerConfig;
    linkClicked = new EventEmitter();
    get notificationBannerType() {
        return NotificationBannerType;
    }
    onLinkClick(triggerOutputEventText) {
        this.linkClicked.emit(triggerOutputEventText);
    }
    static ɵfac = function NotificationBannerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NotificationBannerComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NotificationBannerComponent, selectors: [["ccd-notification-banner"]], inputs: { notificationBannerConfig: "notificationBannerConfig" }, outputs: { linkClicked: "linkClicked" }, decls: 1, vars: 1, consts: [["class", "govuk-notification-banner", "role", "region", "aria-labelledby", "govuk-notification-banner-title", "data-module", "govuk-notification-banner", 3, "ngClass", 4, "ngIf"], ["role", "region", "aria-labelledby", "govuk-notification-banner-title", "data-module", "govuk-notification-banner", 1, "govuk-notification-banner", 3, "ngClass"], [1, "govuk-notification-banner__header"], ["id", "govuk-notification-banner-title", 1, "govuk-notification-banner__title"], [1, "govuk-notification-banner__content"], [1, "govuk-notification-banner__heading"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "govuk-notification-banner__link", 3, "href", 4, "ngIf"], ["class", "govuk-notification-banner__link", "href", "#", 3, "click", 4, "ngIf"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "36", "width", "36", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], ["d", "M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"], ["d", "M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n          C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"], [1, "govuk-notification-banner__link", 3, "href"], ["href", "#", 1, "govuk-notification-banner__link", 3, "click"]], template: function NotificationBannerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, NotificationBannerComponent_div_0_Template, 14, 10, "div", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.notificationBannerConfig);
        } }, dependencies: [i1.NgClass, i1.NgIf, i1.NgSwitch, i1.NgSwitchCase], styles: [".govuk-notification-banner[_ngcontent-%COMP%]   .govuk-notification-banner__content[_ngcontent-%COMP%]   .govuk-notification-banner__heading[_ngcontent-%COMP%]{margin-left:0;max-width:900px}.govuk-notification-banner[_ngcontent-%COMP%]   .govuk-notification-banner__content[_ngcontent-%COMP%]   .govuk-notification-banner__heading[_ngcontent-%COMP%]   .govuk-notification-banner__link[_ngcontent-%COMP%]{margin-left:10px}.notification-banner-information[_ngcontent-%COMP%], .notification-banner-error[_ngcontent-%COMP%]{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning[_ngcontent-%COMP%]{background-color:#912b88;border:5px solid #912b88}.notification-banner-success[_ngcontent-%COMP%]{background-color:#006435;border:5px solid #006435}"] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NotificationBannerComponent, [{
        type: Component,
        args: [{ selector: 'ccd-notification-banner', template: "<div *ngIf=\"notificationBannerConfig\"\n  class=\"govuk-notification-banner\"\n  [ngClass]=\"notificationBannerConfig.headerClass\"\n  role=\"region\"\n  aria-labelledby=\"govuk-notification-banner-title\"\n  data-module=\"govuk-notification-banner\">\n\n  <div class=\"govuk-notification-banner__header\">\n    <h2 class=\"govuk-notification-banner__title\" id=\"govuk-notification-banner-title\">\n      {{notificationBannerConfig.headingText}}\n    </h2>\n  </div>\n  <div class=\"govuk-notification-banner__content\">\n    <p class=\"govuk-notification-banner__heading\">\n      <ng-container [ngSwitch]=\"notificationBannerConfig.bannerType\">\n        <ng-container *ngSwitchCase=\"notificationBannerType.WARNING\">\n          <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n            xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n            <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n          </svg>\n        </ng-container>\n        <ng-container *ngSwitchCase=\"notificationBannerType.ERROR\">\n          <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n            xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n            <path d=\"M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z\"></path>\n          </svg>\n        </ng-container>\n        <ng-container *ngSwitchCase=\"notificationBannerType.SUCCESS\">\n          <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n            xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n            <path d=\"M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z\"></path>\n          </svg>\n        </ng-container>\n        <ng-container *ngSwitchCase=\"notificationBannerType.INFORMATION\">\n          <svg class=\"hmcts-banner__icon\" fill=\"currentColor\" role=\"presentation\" focusable=\"false\"\n            xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\" height=\"36\" width=\"36\">\n            <path d=\"M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n          C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z\"></path>\n          </svg>\n        </ng-container>\n      </ng-container>\n      {{notificationBannerConfig.description}}\n      <a *ngIf=\"notificationBannerConfig.showLink && !notificationBannerConfig.triggerOutputEvent\"\n        class=\"govuk-notification-banner__link\"\n        href=\"{{notificationBannerConfig.linkUrl}}\">{{notificationBannerConfig.linkText}}</a>\n      <a *ngIf=\"notificationBannerConfig.showLink && notificationBannerConfig.triggerOutputEvent\"\n        class=\"govuk-notification-banner__link\"\n        href=\"#\"\n        (click)=\"onLinkClick(notificationBannerConfig.triggerOutputEventText); $event.preventDefault()\">{{notificationBannerConfig.linkText}}</a>\n    </p>\n  </div>\n</div>\n", styles: [".govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading{margin-left:0;max-width:900px}.govuk-notification-banner .govuk-notification-banner__content .govuk-notification-banner__heading .govuk-notification-banner__link{margin-left:10px}.notification-banner-information,.notification-banner-error{background-color:#d4351c;border:5px solid #d4351c}.notification-banner-warning{background-color:#912b88;border:5px solid #912b88}.notification-banner-success{background-color:#006435;border:5px solid #006435}\n"] }]
    }], null, { notificationBannerConfig: [{
            type: Input
        }], linkClicked: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NotificationBannerComponent, { className: "NotificationBannerComponent", filePath: "lib/components/banners/notification-banner/notification-banner.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64, 