import{roundedArrow as _}from"./roundedArrow.mjs";function d(r,a=""){return r.map(t=>`${a}${t}`).join(",")}const g=8;function $(r){const a=g,{sizePopupArrow:t,contentRadius:o,borderRadiusOuter:w,limitVerticalRadius:f}=r,n=t/2-Math.ceil(w*(Math.sqrt(2)-1)),p=(o>12?o+2:12)-n,l=f?a-n:p;return{dropdownArrowOffset:p,dropdownArrowOffsetVertical:l}}function b(r,a){const{componentCls:t,sizePopupArrow:o,marginXXS:w,borderRadiusXS:f,borderRadiusOuter:n,boxShadowPopoverArrow:p}=r,{colorBg:l,showArrowCls:c,contentRadius:u=r.borderRadiusLG,limitVerticalRadius:h}=a,{dropdownArrowOffsetVertical:m,dropdownArrowOffset:i}=$({sizePopupArrow:o,contentRadius:u,borderRadiusOuter:n,limitVerticalRadius:h}),s=o/2+w;return{[t]:{[`${t}-arrow`]:[{position:"absolute",zIndex:1,display:"block",..._(o,f,n,l,p),"&:before":{background:l}}],[[`&-placement-top ${t}-arrow`,`&-placement-topLeft ${t}-arrow`,`&-placement-topRight ${t}-arrow`].join(",")]:{bottom:0,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},[`&-placement-topLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:i}},[`&-placement-topRight ${t}-arrow`]:{right:{_skip_check_:!0,value:i}},[[`&-placement-bottom ${t}-arrow`,`&-placement-bottomLeft ${t}-arrow`,`&-placement-bottomRight ${t}-arrow`].join(",")]:{top:0,transform:"translateY(-100%)"},[`&-placement-bottom ${t}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},[`&-placement-bottomLeft ${t}-arrow`]:{left:{_skip_check_:!0,value:i}},[`&-placement-bottomRight ${t}-arrow`]:{right:{_skip_check_:!0,value:i}},[[`&-placement-left ${t}-arrow`,`&-placement-leftTop ${t}-arrow`,`&-placement-leftBottom ${t}-arrow`].join(",")]:{right:{_skip_check_:!0,value:0},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop ${t}-arrow`]:{top:m},[`&-placement-leftBottom ${t}-arrow`]:{bottom:m},[[`&-placement-right ${t}-arrow`,`&-placement-rightTop ${t}-arrow`,`&-placement-rightBottom ${t}-arrow`].join(",")]:{left:{_skip_check_:!0,value:0},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right ${t}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop ${t}-arrow`]:{top:m},[`&-placement-rightBottom ${t}-arrow`]:{bottom:m},[d(["&-placement-topLeft","&-placement-top","&-placement-topRight"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingBottom:s},[d(["&-placement-bottomLeft","&-placement-bottom","&-placement-bottomRight"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingTop:s},[d(["&-placement-leftTop","&-placement-left","&-placement-leftBottom"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingRight:{_skip_check_:!0,value:s}},[d(["&-placement-rightTop","&-placement-right","&-placement-rightBottom"].map(e=>e+=":not(&-arrow-hidden)"),c)]:{paddingLeft:{_skip_check_:!0,value:s}}}}}export{g as MAX_VERTICAL_CONTENT_RADIUS,b as default,$ as getArrowOffset};
