import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e3f64949.js";var balRadioGroupCss="@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.sc-bal-radio-group-h{display:inline-block;position:relative}.bal-select-button.sc-bal-radio-group-h{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;border:1px solid #d3dbeb;border-radius:100px;padding:5px}";var RadioGroup=function(){function e(e){var t=this;registerInstance(this,e);this.balChange=createEvent(this,"balChange",7);this.interface="radio";this.inverted=false;this.value="";this.onClick=function(e){var r=e.target&&e.target.closest("bal-radio");if(r&&!r.disabled){var a=t.value;var o=r.value;if(o!==a){t.value=o}}}}e.prototype.valueChanged=function(e,t){if(e!==t){this.sync();this.balChange.emit(e)}};e.prototype.componentWillLoad=function(){this.sync()};Object.defineProperty(e.prototype,"children",{get:function(){return Array.from(this.element.querySelectorAll("bal-radio"))},enumerable:false,configurable:true});e.prototype.sync=function(){var e=this;this.children.forEach((function(t){t.interface=e.interface;t.inverted=e.inverted;if(t.value===e.value){t.checked=true}else{t.checked=false}}))};e.prototype.render=function(){return h(Host,{role:"radiogroup",onClick:this.onClick,class:"bal-"+this.interface},h("slot",null))};Object.defineProperty(e.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return e}();RadioGroup.style=balRadioGroupCss;export{RadioGroup as bal_radio_group};