import{D as e,J as t,ct as n,g as r,gt as i,it as a,k as o,vn as s}from"./runtime-core.esm-bundler-DkysjgTd.js";import{r as c}from"./en_US-Cv9hrLhb.js";import{Tt as l,Y as u,l as d,t as f,u as p,vt as m}from"./useConfigInject-z_xeO0pP.js";import{n as h,t as g}from"./responsiveObserve-CPvTZIYq.js";import{t as _}from"./useFlexGapSupport-D07fCJnk.js";var v=Symbol(`rowContextKey`),y=e=>{i(v,e)},b=()=>t(v,{gutter:r(()=>void 0),wrap:r(()=>void 0),supportFlexGap:r(()=>void 0)}),x=e=>{let{componentCls:t}=e;return{[t]:{display:`flex`,flexFlow:`row wrap`,minWidth:0,"&::before, &::after":{display:`flex`},"&-no-wrap":{flexWrap:`nowrap`},"&-start":{justifyContent:`flex-start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`flex-end`},"&-space-between":{justifyContent:`space-between`},"&-space-around ":{justifyContent:`space-around`},"&-space-evenly ":{justifyContent:`space-evenly`},"&-top":{alignItems:`flex-start`},"&-middle":{alignItems:`center`},"&-bottom":{alignItems:`flex-end`}}}},S=e=>{let{componentCls:t}=e;return{[t]:{position:`relative`,maxWidth:`100%`,minHeight:1}}},C=(e,t)=>{let{componentCls:n,gridColumns:r}=e,i={};for(let e=r;e>=0;e--)e===0?(i[`${n}${t}-${e}`]={display:`none`},i[`${n}-push-${e}`]={insetInlineStart:`auto`},i[`${n}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-push-${e}`]={insetInlineStart:`auto`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`auto`},i[`${n}${t}-offset-${e}`]={marginInlineEnd:0},i[`${n}${t}-order-${e}`]={order:0}):(i[`${n}${t}-${e}`]={display:`block`,flex:`0 0 ${e/r*100}%`,maxWidth:`${e/r*100}%`},i[`${n}${t}-push-${e}`]={insetInlineStart:`${e/r*100}%`},i[`${n}${t}-pull-${e}`]={insetInlineEnd:`${e/r*100}%`},i[`${n}${t}-offset-${e}`]={marginInlineStart:`${e/r*100}%`},i[`${n}${t}-order-${e}`]={order:e});return i},w=(e,t)=>C(e,t),T=(e,t,n)=>({[`@media (min-width: ${t}px)`]:c({},w(e,n))}),E=p(`Grid`,e=>[x(e)]),D=p(`Grid`,e=>{let t=d(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[S(t),w(t,``),w(t,`-xs`),Object.keys(n).map(e=>T(t,n[e],e)).reduce((e,t)=>c(c({},e),t),{})]}),O=o({compatConfig:{MODE:3},name:`ARow`,inheritAttrs:!1,props:{align:u([String,Object]),justify:u([String,Object]),prefixCls:String,gutter:u([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}},setup(t,i){let{slots:o,attrs:u}=i,{prefixCls:d,direction:p}=f(`row`,t),[v,b]=E(d),x,S=h(),C=s({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),w=s({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),T=e=>r(()=>{if(typeof t[e]==`string`)return t[e];if(typeof t[e]!=`object`)return``;for(let n=0;n{x=S.value.subscribe(e=>{w.value=e;let n=t.gutter||0;(!Array.isArray(n)&&typeof n==`object`||Array.isArray(n)&&(typeof n[0]==`object`||typeof n[1]==`object`))&&(C.value=e)})}),a(()=>{S.value.unsubscribe(x)});let A=r(()=>{let e=[void 0,void 0],{gutter:n=0}=t;return(Array.isArray(n)?n:[n,void 0]).forEach((t,n)=>{if(typeof t==`object`)for(let r=0;rt.wrap)});let j=r(()=>m(d.value,{[`${d.value}-no-wrap`]:t.wrap===!1,[`${d.value}-${O.value}`]:O.value,[`${d.value}-${D.value}`]:D.value,[`${d.value}-rtl`]:p.value===`rtl`},u.class,b.value)),M=r(()=>{let e=A.value,t={},n=e[0]!=null&&e[0]>0?`${e[0]/-2}px`:void 0,r=e[1]!=null&&e[1]>0?`${e[1]/-2}px`:void 0;return n&&(t.marginLeft=n,t.marginRight=n),k.value?t.rowGap=`${e[1]}px`:r&&(t.marginTop=r,t.marginBottom=r),t});return()=>{var t;return v(e(`div`,l(l({},u),{},{class:j.value,style:c(c({},M.value),u.style)}),[(t=o.default)==null?void 0:t.call(o)]))}}});function k(e){return typeof e==`number`?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}var A=()=>({span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}),j=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`],M=o({compatConfig:{MODE:3},name:`ACol`,inheritAttrs:!1,props:A(),setup(t,n){let{slots:i,attrs:a}=n,{gutter:o,supportFlexGap:s,wrap:u}=b(),{prefixCls:d,direction:p}=f(`col`,t),[h,g]=D(d),_=r(()=>{let{span:e,order:n,offset:r,push:i,pull:o}=t,s=d.value,l={};return j.forEach(e=>{let n={},r=t[e];typeof r==`number`?n.span=r:typeof r==`object`&&(n=r||{}),l=c(c({},l),{[`${s}-${e}-${n.span}`]:n.span!==void 0,[`${s}-${e}-order-${n.order}`]:n.order||n.order===0,[`${s}-${e}-offset-${n.offset}`]:n.offset||n.offset===0,[`${s}-${e}-push-${n.push}`]:n.push||n.push===0,[`${s}-${e}-pull-${n.pull}`]:n.pull||n.pull===0,[`${s}-rtl`]:p.value===`rtl`})}),m(s,{[`${s}-${e}`]:e!==void 0,[`${s}-order-${n}`]:n,[`${s}-offset-${r}`]:r,[`${s}-push-${i}`]:i,[`${s}-pull-${o}`]:o},l,a.class,g.value)}),v=r(()=>{let{flex:e}=t,n=o.value,r={};if(n&&n[0]>0){let e=`${n[0]/2}px`;r.paddingLeft=e,r.paddingRight=e}if(n&&n[1]>0&&!s.value){let e=`${n[1]/2}px`;r.paddingTop=e,r.paddingBottom=e}return e&&(r.flex=k(e),u.value===!1&&!r.minWidth&&(r.minWidth=0)),r});return()=>{var t;return h(e(`div`,l(l({},a),{},{class:_.value,style:[v.value,a.style]}),[(t=i.default)==null?void 0:t.call(i)]))}}});export{O as n,M as t};