{"ast":null,"code":"import * as i0 from '@angular/core';\nimport { forwardRef, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nconst _c0 = function (a0, a1, a2) {\n return {\n \"p-checkbox-label-active\": a0,\n \"p-disabled\": a1,\n \"p-checkbox-label-focus\": a2\n };\n};\n\nfunction TriStateCheckbox_label_6_Template(rf, ctx) {\n if (rf & 1) {\n const _r3 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"label\", 7);\n i0.ɵɵlistener(\"click\", function TriStateCheckbox_label_6_Template_label_click_0_listener($event) {\n i0.ɵɵrestoreView(_r3);\n const ctx_r2 = i0.ɵɵnextContext();\n\n const _r0 = i0.ɵɵreference(3);\n\n return ctx_r2.onClick($event, _r0);\n });\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction3(3, _c0, ctx_r1.value != null, ctx_r1.disabled, ctx_r1.focused));\n i0.ɵɵattribute(\"for\", ctx_r1.inputId);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(ctx_r1.label);\n }\n}\n\nconst _c1 = function (a1, a2) {\n return {\n \"p-checkbox p-component\": true,\n \"p-checkbox-disabled\": a1,\n \"p-checkbox-focused\": a2\n };\n};\n\nconst _c2 = function (a0, a1, a2) {\n return {\n \"p-highlight\": a0,\n \"p-disabled\": a1,\n \"p-focus\": a2\n };\n};\n\nconst TRISTATECHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TriStateCheckbox),\n multi: true\n};\n\nclass TriStateCheckbox {\n constructor(cd) {\n this.cd = cd;\n this.checkboxTrueIcon = 'pi pi-check';\n this.checkboxFalseIcon = 'pi pi-times';\n this.onChange = new EventEmitter();\n\n this.onModelChange = () => {};\n\n this.onModelTouched = () => {};\n }\n\n onClick(event, input) {\n if (!this.disabled && !this.readonly) {\n this.toggle(event);\n this.focused = true;\n input.focus();\n }\n }\n\n onKeydown(event) {\n if (event.keyCode == 32) {\n event.preventDefault();\n }\n }\n\n onKeyup(event) {\n if (event.keyCode == 32 && !this.readonly) {\n this.toggle(event);\n event.preventDefault();\n }\n }\n\n toggle(event) {\n if (this.value == null || this.value == undefined) this.value = true;else if (this.value == true) this.value = false;else if (this.value == false) this.value = null;\n this.onModelChange(this.value);\n this.onChange.emit({\n originalEvent: event,\n value: this.value\n });\n }\n\n onFocus() {\n this.focused = true;\n }\n\n onBlur() {\n this.focused = false;\n this.onModelTouched();\n }\n\n registerOnChange(fn) {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn) {\n this.onModelTouched = fn;\n }\n\n writeValue(value) {\n this.value = value;\n this.cd.markForCheck();\n }\n\n setDisabledState(disabled) {\n this.disabled = disabled;\n this.cd.markForCheck();\n }\n\n}\n\nTriStateCheckbox.ɵfac = function TriStateCheckbox_Factory(t) {\n return new (t || TriStateCheckbox)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef));\n};\n\nTriStateCheckbox.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: TriStateCheckbox,\n selectors: [[\"p-triStateCheckbox\"]],\n hostAttrs: [1, \"p-element\"],\n inputs: {\n disabled: \"disabled\",\n name: \"name\",\n ariaLabelledBy: \"ariaLabelledBy\",\n tabindex: \"tabindex\",\n inputId: \"inputId\",\n style: \"style\",\n styleClass: \"styleClass\",\n label: \"label\",\n readonly: \"readonly\",\n checkboxTrueIcon: \"checkboxTrueIcon\",\n checkboxFalseIcon: \"checkboxFalseIcon\"\n },\n outputs: {\n onChange: \"onChange\"\n },\n features: [i0.ɵɵProvidersFeature([TRISTATECHECKBOX_VALUE_ACCESSOR])],\n decls: 7,\n vars: 21,\n consts: [[3, \"ngStyle\", \"ngClass\"], [1, \"p-hidden-accessible\"], [\"type\", \"text\", \"inputmode\", \"none\", 3, \"name\", \"readonly\", \"disabled\", \"keyup\", \"keydown\", \"focus\", \"blur\"], [\"input\", \"\"], [\"role\", \"checkbox\", 1, \"p-checkbox-box\", 3, \"ngClass\", \"click\"], [1, \"p-checkbox-icon\", 3, \"ngClass\"], [\"class\", \"p-checkbox-label\", 3, \"ngClass\", \"click\", 4, \"ngIf\"], [1, \"p-checkbox-label\", 3, \"ngClass\", \"click\"]],\n template: function TriStateCheckbox_Template(rf, ctx) {\n if (rf & 1) {\n const _r4 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"div\", 0);\n i0.ɵɵelementStart(1, \"div\", 1);\n i0.ɵɵelementStart(2, \"input\", 2, 3);\n i0.ɵɵlistener(\"keyup\", function TriStateCheckbox_Template_input_keyup_2_listener($event) {\n return ctx.onKeyup($event);\n })(\"keydown\", function TriStateCheckbox_Template_input_keydown_2_listener($event) {\n return ctx.onKeydown($event);\n })(\"focus\", function TriStateCheckbox_Template_input_focus_2_listener() {\n return ctx.onFocus();\n })(\"blur\", function TriStateCheckbox_Template_input_blur_2_listener() {\n return ctx.onBlur();\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(4, \"div\", 4);\n i0.ɵɵlistener(\"click\", function TriStateCheckbox_Template_div_click_4_listener($event) {\n i0.ɵɵrestoreView(_r4);\n\n const _r0 = i0.ɵɵreference(3);\n\n return ctx.onClick($event, _r0);\n });\n i0.ɵɵelement(5, \"span\", 5);\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵtemplate(6, TriStateCheckbox_label_6_Template, 2, 7, \"label\", 6);\n }\n\n if (rf & 2) {\n i0.ɵɵclassMap(ctx.styleClass);\n i0.ɵɵproperty(\"ngStyle\", ctx.style)(\"ngClass\", i0.ɵɵpureFunction2(14, _c1, ctx.disabled, ctx.focused));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"name\", ctx.name)(\"readonly\", ctx.readonly)(\"disabled\", ctx.disabled);\n i0.ɵɵattribute(\"id\", ctx.inputId)(\"tabindex\", ctx.tabindex)(\"aria-labelledby\", ctx.ariaLabelledBy);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction3(17, _c2, ctx.value != null, ctx.disabled, ctx.focused));\n i0.ɵɵattribute(\"aria-checked\", ctx.value === true);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngClass\", ctx.value === true ? ctx.checkboxTrueIcon : ctx.value === false ? ctx.checkboxFalseIcon : \"\");\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx.label);\n }\n },\n directives: [i1.NgStyle, i1.NgClass, i1.NgIf],\n encapsulation: 2,\n changeDetection: 0\n});\n\n(function () {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(TriStateCheckbox, [{\n type: Component,\n args: [{\n selector: 'p-triStateCheckbox',\n template: `\n