import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { AbstractFieldWriteComponent } from '../base-field/abstract-field-write.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "./money-gbp-input.component";
import * as i4 from "../utils/field-label.pipe";
import * as i5 from "../utils/first-error.pipe";
import * as i6 from "../utils/is-mandatory.pipe";
import * as i7 from "rpx-xui-translation";
const _c0 = a0 => ({ "form-group-error": a0 });
function WriteMoneyGbpFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "ccdFieldLabel");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.caseField));
} }
function WriteMoneyGbpFieldComponent_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 9);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.caseField.hint_text));
} }
function WriteMoneyGbpFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 10);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "ccdFirstError");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r0.moneyGbpControl.errors, ctx_r0.caseField.label));
} }
export class WriteMoneyGbpFieldComponent extends AbstractFieldWriteComponent {
    moneyGbpControl;
    ngOnInit() {
        this.moneyGbpControl = this.registerControl(new FormControl(this.caseField.value));
    }
    static ɵfac = /*@__PURE__*/ (() => { let ɵWriteMoneyGbpFieldComponent_BaseFactory; return function WriteMoneyGbpFieldComponent_Factory(__ngFactoryType__) { return (ɵWriteMoneyGbpFieldComponent_BaseFactory || (ɵWriteMoneyGbpFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(WriteMoneyGbpFieldComponent)))(__ngFactoryType__ || WriteMoneyGbpFieldComponent); }; })();
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteMoneyGbpFieldComponent, selectors: [["ccd-write-money-gbp-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 13, consts: [[1, "form-group", "bottom-30", 3, "ngClass"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [1, "form-money"], [1, "form-currency"], [3, "id", "name", "mandatory", "formControl"], [1, "form-label"], [1, "form-hint"], [1, "error-message"]], template: function WriteMoneyGbpFieldComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "label", 1);
            i0.ɵɵtemplate(2, WriteMoneyGbpFieldComponent_span_2_Template, 3, 3, "span", 2);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(3, WriteMoneyGbpFieldComponent_span_3_Template, 3, 3, "span", 3)(4, WriteMoneyGbpFieldComponent_span_4_Template, 3, 4, "span", 4);
            i0.ɵɵelementStart(5, "div", 5)(6, "span", 6);
            i0.ɵɵtext(7, "\u00A3");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(8, "ccd-money-gbp-input", 7);
            i0.ɵɵpipe(9, "ccdIsMandatory");
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c0, !ctx.moneyGbpControl.valid && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched)));
            i0.ɵɵadvance();
            i0.ɵɵproperty("for", ctx.id());
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.caseField.label);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.caseField.hint_text);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.moneyGbpControl.errors && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched));
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("id", ctx.id())("name", ctx.id())("mandatory", i0.ɵɵpipeBind1(9, 9, ctx.caseField))("formControl", ctx.moneyGbpControl);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.NgControlStatus, i2.FormControlDirective, i3.MoneyGbpInputComponent, i4.FieldLabelPipe, i5.FirstErrorPipe, i6.IsMandatoryPipe, i7.RpxTranslatePipe], encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteMoneyGbpFieldComponent, [{
        type: Component,
        args: [{ selector: 'ccd-write-money-gbp-field', template: "<div class=\"form-group bottom-30\" [ngClass]=\"{'form-group-error': !moneyGbpControl.valid && (moneyGbpControl.dirty || moneyGbpControl.touched)}\">\n\n  <label [for]=\"id()\">\n    <span class=\"form-label\" *ngIf=\"caseField.label\">{{caseField | ccdFieldLabel}}</span>\n  </label>\n  <span class=\"form-hint\" *ngIf=\"caseField.hint_text\">{{caseField.hint_text | rpxTranslate}}</span>\n  <span class=\"error-message\" *ngIf=\"moneyGbpControl.errors && (moneyGbpControl.dirty || moneyGbpControl.touched)\">{{moneyGbpControl.errors | ccdFirstError:caseField.label}}</span>\n\n  <div class=\"form-money\">\n    <span class=\"form-currency\">&#163;</span>\n    <ccd-money-gbp-input [id]=\"id()\"\n                         [name]=\"id()\"\n                         [mandatory]=\"caseField | ccdIsMandatory\"\n                         [formControl]=\"moneyGbpControl\"></ccd-money-gbp-input>\n  </div>\n\n</div>\n" }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteMoneyGbpFieldComponent, { className: "WriteMoneyGbpFieldComponent", filePath: "lib/shared/components/palette/money-gbp/write-money-gbp-field.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid3JpdGUtbW9uZXktZ2JwLWZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NjZC1jYXNlLXVpLXRvb2xraXQvc3JjL2xpYi9zaGFyZWQvY29tcG9uZW50cy9wYWxldHRlL21vbmV5LWdicC93cml0ZS1tb25leS1nYnAtZmllbGQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9jb21wb25lbnRzL3BhbGV0dGUvbW9uZXktZ2JwL3dyaXRlLW1vbmV5LWdicC1maWVsZC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdDLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLDhDQUE4QyxDQUFDOzs7Ozs7Ozs7OztJQ0N2RiwrQkFBaUQ7SUFBQSxZQUE2Qjs7SUFBQSxpQkFBTzs7O0lBQXBDLGNBQTZCO0lBQTdCLDREQUE2Qjs7O0lBRWhGLCtCQUFvRDtJQUFBLFlBQXNDOztJQUFBLGlCQUFPOzs7SUFBN0MsY0FBc0M7SUFBdEMsc0VBQXNDOzs7SUFDMUYsZ0NBQWlIO0lBQUEsWUFBMEQ7O0lBQUEsaUJBQU87OztJQUFqRSxjQUEwRDtJQUExRCxpR0FBMEQ7O0FERTdLLE1BQU0sT0FBTywyQkFBNE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