const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/responsiveObserve.js"),i=require("../_util/hooks/useFlexGapSupport.js"),a=require("./context.js"),o=require("./style/index.js");let s=require("vue");var c=()=>({align:e.someType([String,Object]),justify:e.someType([String,Object]),prefixCls:String,gutter:e.someType([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}}),l=(0,s.defineComponent)({compatConfig:{MODE:3},name:`ARow`,inheritAttrs:!1,props:c(),setup(e,{slots:c,attrs:l}){let{prefixCls:u,direction:d}=n.default(`row`,e),[f,p]=o.useRowStyle(u),m,h=r.default(),g=(0,s.ref)({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),_=(0,s.ref)({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),v=t=>(0,s.computed)(()=>{if(typeof e[t]==`string`)return e[t];if(typeof e[t]!=`object`)return``;for(let n=0;n<r.responsiveArray.length;n++){let i=r.responsiveArray[n];if(!_.value[i])continue;let a=e[t][i];if(a!==void 0)return a}return``}),y=v(`align`),b=v(`justify`),x=i.default();(0,s.onMounted)(()=>{m=h.value.subscribe(t=>{_.value=t;let n=e.gutter||0;(!Array.isArray(n)&&typeof n==`object`||Array.isArray(n)&&(typeof n[0]==`object`||typeof n[1]==`object`))&&(g.value=t)})}),(0,s.onBeforeUnmount)(()=>{h.value.unsubscribe(m)});let S=(0,s.computed)(()=>{let t=[void 0,void 0],{gutter:n=0}=e;return(Array.isArray(n)?n:[n,void 0]).forEach((e,n)=>{if(typeof e==`object`)for(let i=0;i<r.responsiveArray.length;i++){let a=r.responsiveArray[i];if(g.value[a]&&e[a]!==void 0){t[n]=e[a];break}}else t[n]=e}),t});a.default({gutter:S,supportFlexGap:x,wrap:(0,s.computed)(()=>e.wrap)});let C=(0,s.computed)(()=>t.default(u.value,{[`${u.value}-no-wrap`]:e.wrap===!1,[`${u.value}-${b.value}`]:b.value,[`${u.value}-${y.value}`]:y.value,[`${u.value}-rtl`]:d.value===`rtl`},l.class,p.value)),w=(0,s.computed)(()=>{let e=S.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),x.value?t.rowGap=`${e[1]}px`:r&&(t.marginTop=r,t.marginBottom=r),t});return()=>f((0,s.createVNode)(`div`,{...l,class:C.value,style:{...w.value,...l.style}},[c.default?.()]))}});exports.default=l,exports.rowProps=c;