define(['exports', 'preact/jsx-runtime', 'preact/compat', './useComponentTheme-5aa41a8f', './useFocus-4194fc59', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', './useFormFieldContext-8196183c', './useId-c9578d26', './TabbableModeContext-a9c97640', './useTabbableMode-dc440317', './useInteractionStyle-ee1dc0c0', './useTranslationBundle-7c40cb58', './CheckboxRadioContext-6a0fead0', './Check-03759769', './RadioButtonOff-cc49ced4', './RadioButtonOn-37b2fe31', './HiddenAccessible-037ef42d', './RadioItemContext-70878de8', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', 'preact/hooks', './Flex-590160eb', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-733ade2f', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-30886397', 'css!./IconStyle.styles.css', './IconButton-368fba34', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-2e19d8de', './logger-0f873e29', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './InputGroupContext-372087af', './Popup-3e2566da', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './IconUserAssistance-e496ab70', './UNSAFE_RadioItem/themes/RadioIconContract.css', './UNSAFE_RadioItem/themes/redwood/RadioIconTheme', './UNSAFE_RadioItem/themes/redwood/RadioTheme'], (function(e,s,o,t,a,n,i,d,c,l,r,u,m,b,h,p,S,y,C,x,F,A,R,T,f,g,U,I,v,B,w,M,E,_,N,j,k,L,V,D,H,O,P,z,G,$,q,J,K,Q,W,X,Y,Z){"use strict";e.RadioItem=({value:e,children:n,...d})=>{const{isReadonly:r,isDisabled:F}=i.useFormContext(),{isDisabled:A,isReadonly:R}=c.useFormFieldContext(),{name:T,value:f,onCommit:g}=x.useRadioSetContext(),{isFocusRingShown:U}=h.useCheckboxRadioContext(),{index:I}=x.useRadioItemContext(),{isTabbable:v}=u.useTabbableMode(),B=l.useId(),{isFocus:w,focusProps:M}=a.useFocus(),E=o.createRef(),_=f===e,N=A??F,j=R??r,{interactionProps:k,applyActiveStyle:L}=m.useInteractionStyle(),{classes:V,styles:{valueLabelStyle:D}}=t.useComponentTheme(Z.RadioRedwoodTheme,{disabled:N?"isDisabled":"notDisabled",focused:w&&U?"isFocused":""}),{classes:H}=t.useComponentTheme(Y.RadioIconRedwoodTheme,{disabled:N?"isDisabled":"notDisabled",selected:_?"isSelected":"notSelected",readonly:j?"isReadonly":"notReadonly",active:L?"isActive":"notActive"});o.useEffect((()=>{w&&U&&E?.current?.scrollIntoView({block:"nearest"})}),[w,U,E]);const{assistiveText:O,helpSourceLink:P}=d,z=!(N||j||!O&&!P),G=z?`${B}-help-available`:void 0,$=z?`${B}-icon-ua`:void 0,q=b.useTranslationBundle("@oracle/oraclejet-preact").formControl_helpAvailable(),J=j?_?p.SvgCheck:S.SvgRadioButtonOff:_?y.SvgRadioButtonOn:S.SvgRadioButtonOff,K=!1!==v&&(0===I&&!f||_)?0:-1;return s.jsx("div",{children:s.jsxs("label",{class:V,ref:E,children:[s.jsxs(C.HiddenAccessible,{children:[s.jsx("input",{type:"radio",name:T,id:B,value:e,...!j&&!N&&{onChange:s=>{s.stopPropagation(),g?.({previousValue:f,value:e})}},checked:_,disabled:N,"aria-describedby":G,tabIndex:K,...M}),z&&s.jsx(C.HiddenAccessible,{id:G,isHidden:!0,children:q})]}),s.jsx("span",{"aria-hidden":"true",class:H,...k,children:s.jsx(J,{size:X.radioIconVars.iconSize,color:"currentColor"})}),s.jsxs("span",{class:D,children:[s.jsx("span",{...k,children:n}),z&&s.jsx(W.IconUserAssistance,{...d,isTabbable:v&&w,id:$})]})]})})}}));
//# sourceMappingURL=RadioItem-1a02d3dc.js.map
