{"version":3,"file":"primeng-radiobutton.mjs","sources":["../../src/app/components/radiobutton/radiobutton.ts","../../src/app/components/radiobutton/primeng-radiobutton.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Injectable, Injector, Input, NgModule, OnDestroy, OnInit, Output, ViewChild, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { LicenseManager } from 'primeng/api';\n\nexport const RADIO_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RadioButton),\n multi: true\n};\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RadioControlRegistry {\n private accessors: any[] = [];\n\n add(control: NgControl, accessor: RadioButton) {\n this.accessors.push([control, accessor]);\n }\n\n remove(accessor: RadioButton) {\n this.accessors = this.accessors.filter((c) => {\n return c[1] !== accessor;\n });\n }\n\n select(accessor: RadioButton) {\n this.accessors.forEach((c) => {\n if (this.isSameGroup(c, accessor) && c[1] !== accessor) {\n c[1].writeValue(accessor.value);\n }\n });\n }\n\n private isSameGroup(controlPair: [NgControl, RadioButton], accessor: RadioButton): boolean {\n if (!controlPair[0].control) {\n return false;\n }\n\n return controlPair[0].control.root === accessor.control.control.root && controlPair[1].name === accessor.name;\n }\n}\n\n@Component({\n selector: 'p-radioButton',\n template: `\n