1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{Bo as t,Gi as n,Hi as r,Jn as i,Uo as a,Xr as o,Ya as s,Yr as c,Zr as l,_r as u,ea as d,fa as f,gr as p,ia as m,io as h,ls as g,ra as _,ta as v,ua as y,vi as b,ws as x,xi as S,zi as C}from"./hooks-DHnN4Bv4.js";import{a as w}from"./form-4k43wPKg.js";import{n as T,t as E}from"./useBubbleLock-Bv5hbv92.js";var D=e(g());_(),p();var O=e(x()),k=O.createContext(null),A=k.Provider,j=O.createContext(null),M=j.Provider;a(),s(),d();var N=e=>{let{componentCls:t,antCls:r}=e,i=`${t}-group`;return{[i]:Object.assign(Object.assign({},n(e)),{display:`inline-block`,fontSize:0,[`&${i}-rtl`]:{direction:`rtl`},[`&${i}-block`]:{display:`flex`},[`${r}-badge ${r}-badge-count`]:{zIndex:1},[`> ${r}-badge:not(:first-child) > ${r}-button-wrapper`]:{borderInlineStart:`none`}})}},P=e=>{let{componentCls:t,wrapperMarginInlineEnd:i,colorPrimary:a,radioSize:o,motionDurationSlow:s,motionDurationMid:c,motionEaseInOutCirc:l,colorBgContainer:u,colorBorder:d,lineWidth:f,colorBgContainerDisabled:p,colorTextDisabled:m,paddingXS:g,dotColorDisabled:_,lineType:v,radioColor:y,radioBgColor:b,calc:x}=e,S=`${t}-inner`,C=x(o).sub(x(4).mul(2)),w=x(1).mul(o).equal({unit:!0});return{[`${t}-wrapper`]:Object.assign(Object.assign({},n(e)),{display:`inline-flex`,alignItems:`baseline`,marginInlineStart:0,marginInlineEnd:i,cursor:`pointer`,"&:last-child":{marginInlineEnd:0},[`&${t}-wrapper-rtl`]:{direction:`rtl`},"&-disabled":{cursor:`not-allowed`,color:e.colorTextDisabled},"&::after":{display:`inline-block`,width:0,overflow:`hidden`,content:`"\\a0"`},"&-block":{flex:1,justifyContent:`center`},[`${t}-checked::after`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,width:`100%`,height:`100%`,border:`${h(f)} ${v} ${a}`,borderRadius:`50%`,visibility:`hidden`,opacity:0,content:`""`},[t]:Object.assign(Object.assign({},n(e)),{position:`relative`,display:`inline-block`,outline:`none`,cursor:`pointer`,alignSelf:`center`,borderRadius:`50%`}),[`${t}-wrapper:hover &, 2 &:hover ${S}`]:{borderColor:a},[`${t}-input:focus-visible + ${S}`]:r(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:`visible`},[`${t}-inner`]:{"&::after":{boxSizing:`border-box`,position:`absolute`,insetBlockStart:`50%`,insetInlineStart:`50%`,display:`block`,width:w,height:w,marginBlockStart:x(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:x(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:y,borderBlockStart:0,borderInlineStart:0,borderRadius:w,transform:`scale(0)`,opacity:0,transition:`all ${s} ${l}`,content:`""`},boxSizing:`border-box`,position:`relative`,insetBlockStart:0,insetInlineStart:0,display:`block`,width:w,height:w,backgroundColor:u,borderColor:d,borderStyle:`solid`,borderWidth:f,borderRadius:`50%`,transition:`all ${c}`},[`${t}-input`]:{position:`absolute`,inset:0,zIndex:1,cursor:`pointer`,opacity:0},[`${t}-checked`]:{[S]:{borderColor:a,backgroundColor:b,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${s} ${l}`}}},[`${t}-disabled`]:{cursor:`not-allowed`,[S]:{backgroundColor:p,borderColor:d,cursor:`not-allowed`,"&::after":{backgroundColor:_}},[`${t}-input`]:{cursor:`not-allowed`},[`${t}-disabled + span`]:{color:m,cursor:`not-allowed`},[`&${t}-checked`]:{[S]:{"&::after":{transform:`scale(${x(C).div(o).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:g,paddingInlineEnd:g}})}},F=e=>{let{buttonColor:t,controlHeight:n,componentCls:i,lineWidth:a,lineType:o,colorBorder:s,motionDurationMid:c,buttonPaddingInline:l,fontSize:u,buttonBg:d,fontSizeLG:f,controlHeightLG:p,controlHeightSM:m,paddingXS:g,borderRadius:_,borderRadiusSM:v,borderRadiusLG:y,buttonCheckedBg:b,buttonSolidCheckedColor:x,colorTextDisabled:S,colorBgContainerDisabled:C,buttonCheckedBgDisabled:w,buttonCheckedColorDisabled:T,colorPrimary:E,colorPrimaryHover:D,colorPrimaryActive:O,buttonSolidCheckedBg:k,buttonSolidCheckedHoverBg:A,buttonSolidCheckedActiveBg:j,calc:M}=e;return{[`${i}-button-wrapper`]:{position:`relative`,display:`inline-block`,height:n,margin:0,paddingInline:l,paddingBlock:0,color:t,fontSize:u,lineHeight:h(M(n).sub(M(a).mul(2)).equal()),background:d,border:`${h(a)} ${o} ${s}`,borderBlockStartWidth:M(a).add(.02).equal(),borderInlineEndWidth:a,cursor:`pointer`,transition:[`color ${c}`,`background ${c}`,`box-shadow ${c}`].join(`,`),a:{color:t},[`> ${i}-button`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:`100%`,height:`100%`},"&:not(:last-child)":{marginInlineEnd:M(a).mul(-1).equal()},"&:first-child":{borderInlineStart:`${h(a)} ${o} ${s}`,borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_},"&:first-child:last-child":{borderRadius:_},[`${i}-group-large &`]:{height:p,fontSize:f,lineHeight:h(M(p).sub(M(a).mul(2)).equal()),"&:first-child":{borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y}},[`${i}-group-small &`]:{height:m,paddingInline:M(g).sub(a).equal(),paddingBlock:0,lineHeight:h(M(m).sub(M(a).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:`relative`,color:E},"&:has(:focus-visible)":r(e),[`${i}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:`none`},[`&-checked:not(${i}-button-wrapper-disabled)`]:{zIndex:1,color:E,background:b,borderColor:E,"&::before":{backgroundColor:E},"&:first-child":{borderColor:E},"&:hover":{color:D,borderColor:D,"&::before":{backgroundColor:D}},"&:active":{color:O,borderColor:O,"&::before":{backgroundColor:O}}},[`${i}-group-solid &-checked:not(${i}-button-wrapper-disabled)`]:{color:x,background:k,borderColor:k,"&:hover":{color:x,background:A,borderColor:A},"&:active":{color:x,background:j,borderColor:j}},"&-disabled":{color:S,backgroundColor:C,borderColor:s,cursor:`not-allowed`,"&:first-child, &:hover":{color:S,backgroundColor:C,borderColor:s}},[`&-disabled${i}-button-wrapper-checked`]:{color:T,backgroundColor:w,borderColor:s,boxShadow:`none`},"&-block":{flex:1,textAlign:`center`}}}},I=C(`Radio`,e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r=`0 0 0 ${h(n)} ${t}`,i=v(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[N(i),P(i),F(i)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:i,fontSizeLG:a,colorText:o,colorBgContainer:s,colorTextDisabled:c,
2controlItemBgActiveDisabled:l,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e,h=a;return{radioSize:h,dotSize:t?h-8:h-(4+i)*2,dotColorDisabled:c,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:s,buttonCheckedBg:s,buttonColor:o,buttonCheckedBgDisabled:l,buttonCheckedColorDisabled:c,buttonPaddingInline:n-i,wrapperMarginInlineEnd:r,radioColor:t?d:m,radioBgColor:t?s:d}},{unitless:{radioSize:!0,dotSize:!0}}),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},R=O.forwardRef((e,n)=>{var r,a;let s=O.useContext(k),c=O.useContext(j),{getPrefixCls:u,direction:d,radio:p}=O.useContext(f),m=O.useRef(null),h=t(n,m),{isFormItemInput:g}=O.useContext(i),_=t=>{var n,r;(n=e.onChange)==null||n.call(e,t),(r=s==null?void 0:s.onChange)==null||r.call(s,t)},{prefixCls:v,className:x,rootClassName:S,children:C,style:w,title:A}=e,M=L(e,[`prefixCls`,`className`,`rootClassName`,`children`,`style`,`title`]),N=u(`radio`,v),P=((s==null?void 0:s.optionType)||c)===`button`,F=P?`${N}-button`:N,R=b(N),[z,B,V]=I(N,R),H=Object.assign({},M),U=O.useContext(y);s&&(H.name=s.name,H.onChange=_,H.checked=e.value===s.value,H.disabled=(r=H.disabled)==null?s.disabled:r),H.disabled=(a=H.disabled)==null?U:a;let W=(0,D.default)(`${F}-wrapper`,{[`${F}-wrapper-checked`]:H.checked,[`${F}-wrapper-disabled`]:H.disabled,[`${F}-wrapper-rtl`]:d===`rtl`,[`${F}-wrapper-in-form-item`]:g,[`${F}-wrapper-block`]:!!(s!=null&&s.block)},p==null?void 0:p.className,x,S,B,V,R),[G,K]=E(H.onClick);return z(O.createElement(o,{component:`Radio`,disabled:H.disabled},O.createElement(`label`,{className:W,style:Object.assign(Object.assign({},p==null?void 0:p.style),w),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:A,onClick:G},O.createElement(T,Object.assign({},H,{className:(0,D.default)(H.className,{[l]:!P}),type:`radio`,prefixCls:F,ref:h,onClick:K})),C===void 0?null:O.createElement(`span`,{className:`${F}-label`},C))))}),z=O.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=O.useContext(f),{name:a}=O.useContext(i),o=u(w(a)),{prefixCls:s,className:l,rootClassName:d,options:p,buttonStyle:h=`outline`,disabled:g,children:_,size:v,style:y,id:x,optionType:C,name:T=o,defaultValue:E,value:k,block:j=!1,onChange:M,onMouseEnter:N,onMouseLeave:P,onFocus:F,onBlur:L}=e,[z,B]=m(E,{value:k}),V=O.useCallback(t=>{let n=z,r=t.target.value;`value`in e||B(r),r!==n&&(M==null||M(t))},[z,B,M]),H=n(`radio`,s),U=`${H}-group`,W=b(H),[G,K,q]=I(H,W),J=_;p&&p.length>0&&(J=p.map(e=>typeof e==`string`||typeof e==`number`?O.createElement(R,{key:e.toString(),prefixCls:H,disabled:g,value:e,checked:z===e},e):O.createElement(R,{key:`radio-group-value-options-${e.value}`,prefixCls:H,disabled:e.disabled||g,value:e.value,checked:z===e.value,title:e.title,style:e.style,className:e.className,id:e.id,required:e.required},e.label)));let Y=c(v),X=(0,D.default)(U,`${U}-${h}`,{[`${U}-${Y}`]:Y,[`${U}-rtl`]:r===`rtl`,[`${U}-block`]:j},l,d,K,q,W),Z=O.useMemo(()=>({onChange:V,value:z,disabled:g,name:T,optionType:C,block:j}),[V,z,g,T,C,j]);return G(O.createElement(`div`,Object.assign({},S(e,{aria:!0,data:!0}),{className:X,style:y,onMouseEnter:N,onMouseLeave:P,onFocus:F,onBlur:L,id:x,ref:t}),O.createElement(A,{value:Z},J)))}),B=O.memo(z),V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},H=O.forwardRef((e,t)=>{let{getPrefixCls:n}=O.useContext(f),{prefixCls:r}=e,i=V(e,[`prefixCls`]),a=n(`radio`,r);return O.createElement(M,{value:`button`},O.createElement(R,Object.assign({prefixCls:a},i,{type:`radio`,ref:t})))}),U=R;U.Button=H,U.Group=B,U.__ANT_RADIO=!0;export{U as t}; 3//# sourceMappingURL=radio-BQ-9v-Y6.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.