import{r as t,c as i,h as s,H as e,g as a}from"./p-52e3bb32.js";import{r}from"./p-ffe5c0e8.js";const o=class{constructor(s){t(this,s),this.afOnGroupChange=i(this,"afOnGroupChange",7),this.radiobuttons=void 0,this.afValue=void 0,this.value=void 0,this.afName=r("digi-form-radiogroup")}OnAfValueChange(t){this.value=t}OnValueChange(t){this.afValue=t,this.setRadiobuttons(t)}radiobuttonChangeListener(t){Array.from(this.radiobuttons).includes(t.target)&&(t.preventDefault(),this.afValue=t.detail.target.value,this.afOnGroupChange.emit(t))}componentDidLoad(){this.setRadiobuttons(this.value||this.afValue),this.value&&(this.afValue=this.value)}setRadiobuttons(t){this.radiobuttons=this.hostElement.querySelectorAll("digi-form-radiobutton"),this.radiobuttons.forEach((i=>{i.afName=this.afName,t&&i.afValue==t&&i.setAttribute("af-checked","true")}))}render(){return s(e,{key:"f08c5f7fef0959450fdfac51eb5f65d942f4c857"},s("div",{key:"f5a83a8d456f8d8e98bf1614720813d66f5db924",class:{"digi-form-radiogroup":!0}},s("digi-util-mutation-observer",{key:"d58acfea2c0554233188a6572a35f58312d24135",onAfOnChange:t=>this.radiobuttonChangeListener(t)},s("slot",{key:"6e6fc7086a86f8b5d0b57cd4ad4e8540b212da38"}))))}get hostElement(){return a(this)}static get watchers(){return{afValue:["OnAfValueChange"],value:["OnValueChange"]}}};o.style="";export{o as digi_form_radiogroup}