import u from"../../_util/cssinjs/Keyframes.mjs";import"../../_util/cssinjs/StyleContext.mjs";import"vue";import"../../_util/cssinjs/transformers/legacyLogicalProperties.mjs";import{resetComponent as g}from"../../style/index.mjs";import{initFadeMotion as m}from"../../style/motion/fade.mjs";import{initMotion as b}from"../../style/motion/motion.mjs";import"../../theme/internal.mjs";import f from"../util.mjs";import $ from"../../theme/util/genComponentStyleHook.mjs";import{merge as h}from"../../theme/util/statistic.mjs";const S=o=>{const{componentCls:r,floatButtonSize:t,motionDurationSlow:e,motionEaseInOutCirc:a}=o,n=`${r}-group`,s=new u("antFloatButtonMoveDownIn",{"0%":{transform:`translate3d(0, ${t}px, 0)`,transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),d=new u("antFloatButtonMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:`translate3d(0, ${t}px, 0)`,transformOrigin:"0 0",opacity:0}});return[{[`${n}-wrap`]:{...b(`${n}-wrap`,s,d,e,!0)}},{[`${n}-wrap`]:{[`
          &${n}-wrap-enter,
          &${n}-wrap-appear
        `]:{opacity:0,animationTimingFunction:a},[`&${n}-wrap-leave`]:{animationTimingFunction:a}}}]},B=o=>{const{antCls:r,componentCls:t,floatButtonSize:e,margin:a,borderRadiusLG:n,borderRadiusSM:s,badgeOffset:d,floatButtonBodyPadding:l}=o,i=`${t}-group`;return{[i]:{...g(o),zIndex:99,display:"block",border:"none",position:"fixed",width:e,height:"auto",boxShadow:"none",minHeight:e,insetInlineEnd:o.floatButtonInsetInlineEnd,insetBlockEnd:o.floatButtonInsetBlockEnd,borderRadius:n,[`${i}-wrap`]:{zIndex:-1,display:"block",position:"relative",marginBottom:a},[`&${i}-rtl`]:{direction:"rtl"},[t]:{position:"static"}},[`${i}-circle`]:{[`${t}-circle:not(:last-child)`]:{marginBottom:o.margin,[`${t}-body`]:{width:e,height:e,borderRadius:"50%"}}},[`${i}-square`]:{[`${t}-square`]:{borderRadius:0,padding:0,"&:first-child":{borderStartStartRadius:n,borderStartEndRadius:n},"&:last-child":{borderEndStartRadius:n,borderEndEndRadius:n},"&:not(:last-child)":{borderBottom:`${o.lineWidth}px ${o.lineType} ${o.colorSplit}`},[`${r}-badge`]:{[`${r}-badge-count`]:{top:-(l+d),insetInlineEnd:-(l+d)}}},[`${i}-wrap`]:{display:"block",borderRadius:n,boxShadow:o.boxShadowSecondary,[`${t}-square`]:{boxShadow:"none",marginTop:0,borderRadius:0,padding:l,"&:first-child":{borderStartStartRadius:n,borderStartEndRadius:n},"&:last-child":{borderEndStartRadius:n,borderEndEndRadius:n},"&:not(:last-child)":{borderBottom:`${o.lineWidth}px ${o.lineType} ${o.colorSplit}`},[`${t}-body`]:{width:o.floatButtonBodySize,height:o.floatButtonBodySize}}}},[`${i}-circle-shadow`]:{boxShadow:"none"},[`${i}-square-shadow`]:{boxShadow:o.boxShadowSecondary,[`${t}-square`]:{boxShadow:"none",padding:l,[`${t}-body`]:{width:o.floatButtonBodySize,height:o.floatButtonBodySize,borderRadius:s}}}}},y=o=>{const{antCls:r,componentCls:t,floatButtonBodyPadding:e,floatButtonIconSize:a,floatButtonSize:n,borderRadiusLG:s,badgeOffset:d,dotOffsetInSquare:l,dotOffsetInCircle:i}=o;return{[t]:{...g(o),border:"none",position:"fixed",cursor:"pointer",zIndex:99,display:"block",justifyContent:"center",alignItems:"center",width:n,height:n,insetInlineEnd:o.floatButtonInsetInlineEnd,insetBlockEnd:o.floatButtonInsetBlockEnd,boxShadow:o.boxShadowSecondary,"&-pure":{position:"relative",inset:"auto"},"&:empty":{display:"none"},[`${r}-badge`]:{width:"100%",height:"100%",[`${r}-badge-count`]:{transform:"translate(0, 0)",transformOrigin:"center",top:-d,insetInlineEnd:-d}},[`${t}-body`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",transition:`all ${o.motionDurationMid}`,[`${t}-content`]:{overflow:"hidden",textAlign:"center",minHeight:n,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:`${e/2}px ${e}px`,[`${t}-icon`]:{textAlign:"center",margin:"auto",width:a,fontSize:a,lineHeight:1}}}},[`${t}-rtl`]:{direction:"rtl"},[`${t}-circle`]:{height:n,borderRadius:"50%",[`${r}-badge`]:{[`${r}-badge-dot`]:{top:i,insetInlineEnd:i}},[`${t}-body`]:{borderRadius:"50%"}},[`${t}-square`]:{height:"auto",minHeight:n,borderRadius:s,[`${r}-badge`]:{[`${r}-badge-dot`]:{top:l,insetInlineEnd:l}},[`${t}-body`]:{height:"auto",borderRadius:s}},[`${t}-default`]:{backgroundColor:o.floatButtonBackgroundColor,transition:`background-color ${o.motionDurationMid}`,[`${t}-body`]:{backgroundColor:o.floatButtonBackgroundColor,transition:`background-color ${o.motionDurationMid}`,"&:hover":{backgroundColor:o.colorFillContent},[`${t}-content`]:{[`${t}-icon`]:{color:o.colorText},[`${t}-description`]:{display:"flex",alignItems:"center",lineHeight:`${o.fontSizeLG}px`,color:o.colorText,fontSize:o.fontSizeSM}}}},[`${t}-primary`]:{backgroundColor:o.colorPrimary,[`${t}-body`]:{backgroundColor:o.colorPrimary,transition:`background-color ${o.motionDurationMid}`,"&:hover":{backgroundColor:o.colorPrimaryHover},[`${t}-content`]:{[`${t}-icon`]:{color:o.colorTextLightSolid},[`${t}-description`]:{display:"flex",alignItems:"center",lineHeight:`${o.fontSizeLG}px`,color:o.colorTextLightSolid,fontSize:o.fontSizeSM}}}}}},L=$("FloatButton",o=>{const{colorTextLightSolid:r,colorBgElevated:t,controlHeightLG:e,marginXXL:a,marginLG:n,fontSize:s,fontSizeIcon:d,controlItemBgHover:l,paddingXXS:i,borderRadiusLG:p}=o,c=h(o,{floatButtonBackgroundColor:t,floatButtonColor:r,floatButtonHoverBackgroundColor:l,floatButtonFontSize:s,floatButtonIconSize:d*1.5,floatButtonSize:e,floatButtonInsetBlockEnd:a,floatButtonInsetInlineEnd:n,floatButtonBodySize:e-i*2,floatButtonBodyPadding:i,badgeOffset:i*1.5,dotOffsetInCircle:f(e/2),dotOffsetInSquare:f(p)});return[B(c),y(c),m(o),S(c)]});export{L as default};
