import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "primeng/inplace";
import * as i2 from "primeng/button";
export class SsnComponent {
    constructor() { }
    ngOnInit() {
    }
    formatSsn(ssn) {
        if (ssn.length == 9) {
            return ssn.substr(0, 3) + '-' + ssn.substr(3, 2) + '-' + ssn.substr(5, 4);
        }
        else {
            return ssn;
        }
    }
    maskSsn(ssn) {
        return 'XXX-XX-' + (ssn.length == 9 ? ssn.substr(5, 4) : ssn.substr(7, 4));
    }
    static { this.ɵfac = function SsnComponent_Factory(t) { return new (t || SsnComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SsnComponent, selectors: [["app-ssn"]], inputs: { ssn: "ssn" }, decls: 6, vars: 2, consts: [["closable", "true", "closeIcon", "pi pi-eye-slash"], ["pInplaceDisplay", ""], ["pButton", "", "type", "button", "icon", "pi pi-eye"], ["pInplaceContent", ""]], template: function SsnComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "p-inplace", 0)(1, "span", 1);
            i0.ɵɵtext(2);
            i0.ɵɵelement(3, "button", 2);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "span", 3);
            i0.ɵɵtext(5);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate1(" ", ctx.maskSsn(ctx.ssn), " ");
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate1(" ", ctx.formatSsn(ctx.ssn), " ");
        } }, dependencies: [i1.Inplace, i2.ButtonDirective], styles: ["button.ui-button[_ngcontent-%COMP%]{background-color:var(--ion-color-medium)!important;border:1px solid white!important;font-size:x-small}[_nghost-%COMP%]     p-inplace .p-button.p-button-icon-only{height:1.75rem!important;width:1.75rem!important}[_nghost-%COMP%]     p-inplace .p-button{background-color:var(--ion-color-medium)!important;border:1px solid white!important;font-size:x-small}[_nghost-%COMP%]     p-inplace .pi{font-size:1rem!important}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SsnComponent, [{
        type: Component,
        args: [{ selector: 'app-ssn', template: "<p-inplace closable=\"true\" closeIcon=\"pi pi-eye-slash\">\r\n    <span pInplaceDisplay>\r\n        {{maskSsn(ssn)}}\r\n        <button pButton type=\"button\" icon=\"pi pi-eye\" ></button>\r\n    </span>\r\n    <span pInplaceContent>\r\n        {{formatSsn(ssn)}}\r\n    </span>\r\n</p-inplace>", styles: ["button.ui-button{background-color:var(--ion-color-medium)!important;border:1px solid white!important;font-size:x-small}:host ::ng-deep p-inplace .p-button.p-button-icon-only{height:1.75rem!important;width:1.75rem!important}:host ::ng-deep p-inplace .p-button{background-color:var(--ion-color-medium)!important;border:1px solid white!important;font-size:x-small}:host ::ng-deep p-inplace .pi{font-size:1rem!important}\n"] }]
    }], () => [], { ssn: [{
            type: Input,
            args: ['ssn']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SsnComponent, { className: "SsnComponent", filePath: "lib\\components\\ssn\\ssn.component.ts", lineNumber: 8 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3NuLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZXVzYS1hcHAtbGliL3NyYy9saWIvY29tcG9uZW50cy9zc24vc3NuLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1yZXVzYS1hcHAtbGliL3NyYy9saWIvY29tcG9uZW50cy9zc24vc3NuLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFVLE1BQU0sZUFBZSxDQUFDOzs7O0FBT3pELE1BQU0sT0FBTyxZ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