import{B as te,a as K,e as P}from"./chunk-A32B57A4.js";import{w as Y,x as Z,y as $}from"./chunk-4EQLHXW7.js";import{l as X,s as ie}from"./chunk-KADRYNDC.js";import{C as J,j as q,m as W,p as z,y as H}from"./chunk-Z5RJRCWC.js";import{Ac as g,Ad as Q,Eb as p,Gd as U,Ja as d,Jc as R,Ka as c,Kc as j,Lc as D,Ob as E,Pa as N,Pb as S,Pc as y,Rc as A,Sa as f,Sc as L,Tb as M,bd as T,dc as r,ec as l,fd as _,gd as O,ic as C,qc as h,ra as I,rc as m,sa as B,sc as F,ta as V,ud as G,wc as v,zb as a,zc as b,zd as k}from"./chunk-JSJB5BKT.js";import{e as ee}from"./chunk-SZAW6ZBW.js";function se(o,s){if(o&1){let e=v();h(0,"label",7),b("click",function(i){d(e);let n=g();return c(n.select(i))}),A(1),m()}if(o&2){let e=g(),t=y(3);C(e.labelStyleClass),l("ngClass",_(6,re,t.checked,e.disabled,e.focused)),r("for",e.inputId)("data-pc-section","label"),a(),L(e.label)}}var oe,ne,ae,re,le,ue,de,Ne,ce=ee(()=>{J();J();U();U();te();$();$();ie();oe=["input"],ne=(o,s,e,t)=>({"p-radiobutton p-component":!0,"p-radiobutton-checked":o,"p-radiobutton-disabled":s,"p-radiobutton-focused":e,"p-variant-filled":t}),ae=(o,s,e)=>({"p-radiobutton-box":!0,"p-highlight":o,"p-disabled":s,"p-focus":e}),re=(o,s,e)=>({"p-radiobutton-label":!0,"p-radiobutton-label-active":o,"p-disabled":s,"p-radiobutton-label-focus":e});le={provide:K,useExisting:I(()=>de),multi:!0},ue=(()=>{class o{accessors=[];add(e,t){this.accessors.push([e,t])}remove(e){this.accessors=this.accessors.filter(t=>t[1]!==e)}select(e){this.accessors.forEach(t=>{this.isSameGroup(t,e)&&t[1]!==e&&t[1].writeValue(e.value)})}isSameGroup(e,t){return e[0].control?e[0].control.root===t.control.control.root&&e[1].name===t.name:!1}static \u0275fac=function(t){return new(t||o)};static \u0275prov=B({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),de=(()=>{class o{cd;injector;registry;config;value;formControlName;name;disabled;label;variant="outlined";tabindex;inputId;ariaLabelledBy;ariaLabel;style;styleClass;labelStyleClass;autofocus;onClick=new f;onFocus=new f;onBlur=new f;inputViewChild;onModelChange=()=>{};onModelTouched=()=>{};checked;focused;control;constructor(e,t,i,n){this.cd=e,this.injector=t,this.registry=i,this.config=n}ngOnInit(){this.control=this.injector.get(P),this.checkName(),this.registry.add(this.control,this)}handleClick(e,t,i){this.disabled||(this.select(e),i&&t.focus())}select(e){this.disabled||(this.inputViewChild.nativeElement.checked=!0,this.checked=!0,this.onModelChange(this.value),this.registry.select(this),this.onClick.emit({originalEvent:e,value:this.value}))}writeValue(e){this.checked=e==this.value,this.inputViewChild&&this.inputViewChild.nativeElement&&(this.inputViewChild.nativeElement.checked=this.checked),this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}onInputFocus(e){this.focused=!0,this.onFocus.emit(e)}onInputBlur(e){this.focused=!1,this.onModelTouched(),this.onBlur.emit(e)}focus(){this.inputViewChild.nativeElement.focus()}ngOnDestroy(){this.registry.remove(this)}checkName(){this.name&&this.formControlName&&this.name!==this.formControlName&&this.throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)}throwNameError(){throw new Error(`
          If you define both a name and a formControlName attribute on your radio button, their values
          must match. Ex: <p-radioButton formControlName="food" name="food"></p-radioButton>
        `)}static \u0275fac=function(t){return new(t||o)(p(G),p(N),p(ue),p(X))};static \u0275cmp=E({type:o,selectors:[["p-radioButton"]],viewQuery:function(t,i){if(t&1&&R(oe,5),t&2){let n;j(n=D())&&(i.inputViewChild=n.first)}},hostAttrs:[1,"p-element"],inputs:{value:"value",formControlName:"formControlName",name:"name",disabled:[2,"disabled","disabled",k],label:"label",variant:"variant",tabindex:[2,"tabindex","tabindex",Q],inputId:"inputId",ariaLabelledBy:"ariaLabelledBy",ariaLabel:"ariaLabel",style:"style",styleClass:"styleClass",labelStyleClass:"labelStyleClass",autofocus:[2,"autofocus","autofocus",k]},outputs:{onClick:"onClick",onFocus:"onFocus",onBlur:"onBlur"},standalone:!1,features:[T([le])],decls:7,vars:30,consts:[["input",""],[3,"click","ngStyle","ngClass"],[1,"p-hidden-accessible"],["type","radio","pAutoFocus","",3,"focus","blur","checked","disabled","value","autofocus"],[3,"ngClass"],[1,"p-radiobutton-icon"],[3,"class","ngClass","click",4,"ngIf"],[3,"click","ngClass"]],template:function(t,i){if(t&1){let n=v();h(0,"div",1),b("click",function(u){d(n);let x=y(3);return c(i.handleClick(u,x,!0))}),h(1,"div",2)(2,"input",3,0),b("focus",function(u){return d(n),c(i.onInputFocus(u))})("blur",function(u){return d(n),c(i.onInputBlur(u))}),m()(),h(4,"div",4),F(5,"span",5),m()(),M(6,se,2,10,"label",6)}t&2&&(C(i.styleClass),l("ngStyle",i.style)("ngClass",O(21,ne,i.checked,i.disabled,i.focused,i.variant==="filled"||i.config.inputStyle()==="filled")),r("data-pc-name","radiobutton")("data-pc-section","root"),a(),r("data-pc-section","hiddenInputWrapper"),a(),l("checked",i.checked)("disabled",i.disabled)("value",i.value)("autofocus",i.autofocus),r("id",i.inputId)("name",i.name)("aria-labelledby",i.ariaLabelledBy)("aria-label",i.ariaLabel)("tabindex",i.tabindex)("data-pc-section","hiddenInput"),a(2),l("ngClass",_(26,ae,i.checked,i.disabled,i.focused)),r("data-pc-section","input"),a(),r("data-pc-section","icon"),a(),l("ngIf",i.label))},dependencies:[q,W,z,Y],encapsulation:2,changeDetection:0})}return o})(),Ne=(()=>{class o{static \u0275fac=function(t){return new(t||o)};static \u0275mod=S({type:o});static \u0275inj=V({imports:[H,Z]})}return o})()});export{de as a,Ne as b,ce as c};
