import{r as t,c as i,h as e,H as s,g as a}from"./p-52e3bb32.js";import{r}from"./p-ffe5c0e8.js";const o=class{constructor(e){t(this,e),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 e(s,{key:"32ecef2c08cd9f37a95d782d8f0e631ad4037c69"},e("div",{key:"1d4606fe5a994d4b79113568349147874d15b6ad",class:{"digi-form-radiogroup":!0}},e("digi-util-mutation-observer",{key:"1facc76b33e1b65428b5205ee074af6ae511bc74",onAfOnChange:t=>this.radiobuttonChangeListener(t)},e("slot",{key:"7b006ed18743cf5fdf7c432b80674b753a347aa7"}))))}get hostElement(){return a(this)}static get watchers(){return{afValue:["OnAfValueChange"],value:["OnValueChange"]}}};o.style="";export{o as digi_form_radiogroup}