import{c as m,b as E,n as F,R as f,C as N,o as P}from"./index-bf3ffc0f.js";import{i as p}from"./gapSize-a2278ff3.js";const x=["wrap","nowrap","wrap-reverse"],u=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],y=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],V=(e,n)=>{const l={};return x.forEach(t=>{l[`${e}-wrap-${t}`]=n.wrap===t}),l},I=(e,n)=>{const l={};return y.forEach(t=>{l[`${e}-align-${t}`]=n.align===t}),l[`${e}-align-stretch`]=!n.align&&!!n.vertical,l},T=(e,n)=>{const l={};return u.forEach(t=>{l[`${e}-justify-${t}`]=n.justify===t}),l};function W(e,n){return m(Object.assign(Object.assign(Object.assign({},V(e,n)),I(e,n)),T(e,n)))}const _=e=>{const{componentCls:n}=e;return{[n]:{display:"flex","&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}},L=e=>{const{componentCls:n}=e;return{[n]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}},R=e=>{const{componentCls:n}=e,l={};return x.forEach(t=>{l[`${n}-wrap-${t}`]={flexWrap:t}}),l},z=e=>{const{componentCls:n}=e,l={};return y.forEach(t=>{l[`${n}-align-${t}`]={alignItems:t}}),l},A=e=>{const{componentCls:n}=e,l={};return u.forEach(t=>{l[`${n}-justify-${t}`]={justifyContent:t}}),l},D=()=>({}),J=E("Flex",e=>{const{paddingXS:n,padding:l,paddingLG:t}=e,s=F(e,{flexGapSM:n,flexGap:l,flexGapLG:t});return[_(s),L(s),R(s),z(s),A(s)]},D,{resetStyle:!1});var M=globalThis&&globalThis.__rest||function(e,n){var l={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(l[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(e);s{const{prefixCls:l,rootClassName:t,className:s,style:d,flex:g,gap:o,children:C,vertical:c=!1,component:S="div"}=e,h=M(e,["prefixCls","rootClassName","className","style","flex","gap","children","vertical","component"]),{flex:a,direction:b,getPrefixCls:j}=f.useContext(N),r=j("flex",l),[$,v,w]=J(r),O=c??(a==null?void 0:a.vertical),G=m(s,t,a==null?void 0:a.className,r,v,w,W(r,e),{[`${r}-rtl`]:b==="rtl",[`${r}-gap-${o}`]:p(o),[`${r}-vertical`]:O}),i=Object.assign(Object.assign({},a==null?void 0:a.style),d);return g&&(i.flex=g),o&&!p(o)&&(i.gap=o),$(f.createElement(S,Object.assign({ref:n,className:G,style:i},P(h,["justify","wrap","align"])),C))}),B=H;export{B as F};