define("radioGroup",["lodash","core","santaProps","textCommon"],function(a,b,c,d){"use strict";var e="radioButton";return{displayName:"RadioGroup",mixins:[b.compMixins.skinBasedComp,b.compMixins.runTimeCompData,d.textScaleMixin],statics:{useSantaTypes:true,behaviors:{change:{methodName:"validate"}}},propTypes:{compData:c.Types.Component.compData.isRequired,compProp:c.Types.Component.compProp.isRequired,isMobileView:c.Types.isMobileView},getInitialState:function(){return{$mobile:this.props.isMobileView?"mobile":"desktop"}},validate:function(){this.handleAction("validate");var a=this.props.compData.value||this.props.compData.defaultValue;var b=this.state.value||a;return this.props.compProp.required?Boolean(b):true},setRadioSelected:function(a,b,c){this.setState({value:a.value},function(){this.updateData({value:a.value});this.handleAction("change",c)}.bind(this))},createChildren:function(){return a.map(this.props.compData.options,this.createChildRadioButton)},createChildRadioButton:function(a,b){var c=this.props.compData.options.length;var d=b===c-1;var f={id:this.props.id+"radio"+b,ref:"radio"+b,text:this.props.compData.options[b].label,groupName:this.props.id,key:"radio"+b+a.label,onChange:this.setRadioSelected.bind(this,a,b),buttonSize:this.props.compProp.buttonSize,previewState:this.getComponentPreviewState(),"data-error":!this.validate(),textStyle:this.getFontSize(this.props),style:{}};if(!d){if(this.props.compProp.layout==="vertical"){f.style.marginBottom=this.props.compProp.buttonsMargin}else{f.style.marginRight=this.props.compProp.buttonsMargin}}var g=this.props.compData.value||this.props.compData.defaultValue;var h=this.state.value||g;if(h===a.value){f.checked=true}return this.createChildComponent(a,"wysiwyg.viewer.components.inputs.RadioButton",e,f)},getSkinProperties:function(){var a={};a[this.props.compProp.layout+"-axis"]=true;return{"":{className:this.classSet(a)},items:{children:this.createChildren()}}}}});