{"version":3,"file":"primeng-radiobutton.umd.js","sources":["../../src/app/components/radiobutton/radiobutton.ts","../../src/app/components/radiobutton/primeng-radiobutton.ts"],"sourcesContent":["import {NgModule,Component,Input,Output,ElementRef,EventEmitter,forwardRef,ViewChild,ChangeDetectorRef,ChangeDetectionStrategy, Injectable, Injector, OnInit, OnDestroy} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor, NgControl} from '@angular/forms';\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