learndash.forms=learndash.forms||{},learndash.forms.radio=learndash.forms.radio||{},((e,t,s)=>{s.classes={item:"ld-form__field-radio-container",selectedItem:"ld--selected",wrapper:"ld-form__field-group"},s.selectors={item:`.${s.classes.item}`,selectedItem:`.${s.classes.selectedItem}`,wrapper:`.${s.classes.wrapper}`},s.initRadioButton=e=>{const r=e=>{const r=e.target;let d=r;r.classList.contains(s.classes.item)||(d=r.closest(s.selectors.item),d||(d=r.querySelector(s.selectors.item)));const c=d.closest(s.selectors.wrapper);if(!c||!d)return;const o=c.querySelector(s.selectors.selectedItem),a=d.querySelector('input[type="radio"]'),l=o?.querySelector('input[type="radio"]'),i=a?.id,n=l?.id;i&&i!==n&&(o&&l&&(o.classList.remove(s.classes.selectedItem),l.checked=!1,l.removeAttribute("checked")),a&&(d.classList.add(s.classes.selectedItem),a.checked=!0,a.setAttribute("checked","checked")),t.dispatchEvent(new CustomEvent("learndashRadioButtonChange",{detail:{newId:i,newInput:a,newItem:d,oldId:n,oldInput:l,oldItem:o,wrapper:c}})))};e.addEventListener("click",r),e.addEventListener("touchstart",r)},t.addEventListener("DOMContentLoaded",(()=>{t.querySelectorAll(s.selectors.item).forEach((e=>{s.initRadioButton(e)}))}))})(window,document,learndash.forms.radio);