import{defineComponent as x,computed as a,createVNode as s}from"vue";import{flattenChildren as y}from"../_util/props-util/index.mjs";import{withInstall as C}from"../_util/type.mjs";import p from"../config-provider/hooks/useConfigInject.mjs";import M from"./style/index.mjs";const S=()=>({prefixCls:String,type:{type:String,default:"horizontal"},dashed:{type:Boolean,default:!1},orientation:{type:String,default:"center"},plain:{type:Boolean,default:!1},orientationMargin:[String,Number]}),w=x({name:"ADivider",inheritAttrs:!1,compatConfig:{MODE:3},props:S(),setup(t,{slots:f,attrs:r}){const{prefixCls:i,direction:d}=p("divider",t),[g,o]=M(i),l=a(()=>t.orientation==="left"&&t.orientationMargin!=null),u=a(()=>t.orientation==="right"&&t.orientationMargin!=null),c=a(()=>{const{type:e,dashed:v,plain:$}=t,n=i.value;return{[n]:!0,[o.value]:!!o.value,[`${n}-${e}`]:!0,[`${n}-dashed`]:!!v,[`${n}-plain`]:!!$,[`${n}-rtl`]:d.value==="rtl",[`${n}-no-default-orientation-margin-left`]:l.value,[`${n}-no-default-orientation-margin-right`]:u.value}}),m=a(()=>{const e=typeof t.orientationMargin=="number"?`${t.orientationMargin}px`:t.orientationMargin;return{...l.value&&{marginLeft:e},...u.value&&{marginRight:e}}}),h=a(()=>t.orientation.length>0?`-${t.orientation}`:t.orientation);return()=>{const e=y(f.default?.());return g(s("div",{...r,class:[c.value,e.length?`${i.value}-with-text ${i.value}-with-text${h.value}`:"",r.class],role:"separator"},[e.length?s("span",{class:`${i.value}-inner-text`,style:m.value},[e]):null]))}}}),B=C(w);export{B as default,S as dividerProps};
