import{clearFix as e,genFocusStyle as t,resetComponent as n}from"../../style/index.mjs";import r from"../../theme/util/genComponentStyleHook.mjs";import{merge as i}from"../../theme/util/statistic.mjs";import{initFadeMotion as a}from"../../style/motion/fade.mjs";import{initZoomMotion as o}from"../../style/motion/zoom.mjs";function s(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}var c=e=>{let{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}${e.antCls}-zoom-enter, ${t}${e.antCls}-zoom-appear`]:{transform:`none`,opacity:0,animationDuration:e.motionDurationSlow,userSelect:`none`},[`${t}${e.antCls}-zoom-leave ${t}-content`]:{pointerEvents:`none`},[`${t}-mask`]:{...s(`fixed`),zIndex:e.zIndexPopupBase,height:`100%`,backgroundColor:e.colorBgMask,[`${t}-hidden`]:{display:`none`}},[`${t}-wrap`]:{...s(`fixed`),overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`}}},{[`${t}-root`]:a(e)}]},l=e=>{let{componentCls:r}=e;return[{[`${r}-root`]:{[`${r}-wrap`]:{zIndex:e.zIndexPopupBase,position:`fixed`,inset:0,overflow:`auto`,outline:0,WebkitOverflowScrolling:`touch`},[`${r}-wrap-rtl`]:{direction:`rtl`},[`${r}-centered`]:{textAlign:`center`,"&::before":{display:`inline-block`,width:0,height:`100%`,verticalAlign:`middle`,content:`""`},[r]:{top:0,display:`inline-block`,paddingBottom:0,textAlign:`start`,verticalAlign:`middle`}},[`@media (max-width: ${e.screenSMMax})`]:{[r]:{maxWidth:`calc(100vw - 16px)`,margin:`${e.marginXS} auto`},[`${r}-centered`]:{[r]:{flex:1}}}}},{[r]:{...n(e),pointerEvents:`none`,position:`relative`,top:100,width:`auto`,maxWidth:`calc(100vw - ${e.margin*2}px)`,margin:`0 auto`,paddingBottom:e.paddingLG,[`${r}-title`]:{margin:0,color:e.modalHeadingColor,fontWeight:e.fontWeightStrong,fontSize:e.modalHeaderTitleFontSize,lineHeight:e.modalHeaderTitleLineHeight,wordWrap:`break-word`},[`${r}-content`]:{position:`relative`,backgroundColor:e.modalContentBg,backgroundClip:`padding-box`,border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadowSecondary,pointerEvents:`auto`,padding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`},[`${r}-close`]:{position:`absolute`,top:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,insetInlineEnd:(e.modalHeaderCloseSize-e.modalCloseBtnSize)/2,zIndex:e.zIndexPopupBase+10,padding:0,color:e.modalCloseColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:`none`,background:`transparent`,borderRadius:e.borderRadiusSM,width:e.modalConfirmIconSize,height:e.modalConfirmIconSize,border:0,outline:0,cursor:`pointer`,transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:`block`,fontSize:e.fontSizeLG,fontStyle:`normal`,lineHeight:`${e.modalCloseBtnSize}px`,textAlign:`center`,textTransform:`none`,textRendering:`auto`},"&:hover":{color:e.modalIconHoverColor,backgroundColor:e.wireframe?`transparent`:e.colorFillContent,textDecoration:`none`},"&:active":{backgroundColor:e.wireframe?`transparent`:e.colorFillContentHover},...t(e)},[`${r}-header`]:{color:e.colorText,background:e.modalHeaderBg,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`,marginBottom:e.marginXS},[`${r}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:`break-word`},[`${r}-footer`]:{textAlign:`end`,background:e.modalFooterBg,marginTop:e.marginSM,[`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]:{marginBottom:0,marginInlineStart:e.marginXS}},[`${r}-open`]:{overflow:`hidden`}}},{[`${r}-pure-panel`]:{top:`auto`,padding:0,display:`flex`,flexDirection:`column`,[`${r}-content,
          ${r}-body,
          ${r}-confirm-body-wrapper`]:{display:`flex`,flexDirection:`column`,flex:`auto`},[`${r}-confirm-body`]:{marginBottom:`auto`}}}]},u=t=>{let{componentCls:n}=t,r=`${n}-confirm`;return{[r]:{"&-rtl":{direction:`rtl`},[`${t.antCls}-modal-header`]:{display:`none`},[`${r}-body-wrapper`]:{...e()},[`${r}-body`]:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,[`${r}-title`]:{flex:`0 0 100%`,display:`block`,overflow:`hidden`,color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.modalHeaderTitleFontSize,lineHeight:t.modalHeaderTitleLineHeight,[`+ ${r}-content`]:{marginBlockStart:t.marginXS,flexBasis:`100%`,maxWidth:`calc(100% - ${t.modalConfirmIconSize+t.marginSM}px)`}},[`${r}-content`]:{color:t.colorText,fontSize:t.fontSize},[`> ${t.iconCls}`]:{flex:`none`,marginInlineEnd:t.marginSM,fontSize:t.modalConfirmIconSize,[`+ ${r}-title`]:{flex:1},[`+ ${r}-title + ${r}-content`]:{marginInlineStart:t.modalConfirmIconSize+t.marginSM}}},[`${r}-btns`]:{textAlign:`end`,marginTop:t.marginSM,[`${t.antCls}-btn + ${t.antCls}-btn`]:{marginBottom:0,marginInlineStart:t.marginXS}}},[`${r}-error ${r}-body > ${t.iconCls}`]:{color:t.colorError},[`${r}-warning ${r}-body > ${t.iconCls},
        ${r}-confirm ${r}-body > ${t.iconCls}`]:{color:t.colorWarning},[`${r}-info ${r}-body > ${t.iconCls}`]:{color:t.colorInfo},[`${r}-success ${r}-body > ${t.iconCls}`]:{color:t.colorSuccess},[`${n}-zoom-leave ${n}-btns`]:{pointerEvents:`none`}}},d=e=>{let{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:`rtl`,[`${t}-confirm-body`]:{direction:`rtl`}}}}},f=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-confirm`;return{[t]:{[`${t}-content`]:{padding:0},[`${t}-header`]:{padding:e.modalHeaderPadding,borderBottom:`${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`,marginBottom:0},[`${t}-body`]:{padding:e.modalBodyPadding},[`${t}-footer`]:{padding:`${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`,borderTop:`${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`,borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`,marginTop:0}},[r]:{[`${n}-modal-body`]:{padding:`${e.padding*2}px ${e.padding*2}px ${e.paddingLG}px`},[`${r}-body`]:{[`> ${e.iconCls}`]:{marginInlineEnd:e.margin,[`+ ${r}-title + ${r}-content`]:{marginInlineStart:e.modalConfirmIconSize+e.margin}}},[`${r}-btns`]:{marginTop:e.marginLG}}}},p=r(`Modal`,e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5,a=i(e,{modalBodyPadding:e.paddingLG,modalHeaderBg:e.colorBgElevated,modalHeaderPadding:`${t}px ${e.paddingLG}px`,modalHeaderBorderWidth:e.lineWidth,modalHeaderBorderStyle:e.lineType,modalHeaderTitleLineHeight:r,modalHeaderTitleFontSize:n,modalHeaderBorderColorSplit:e.colorSplit,modalHeaderCloseSize:r*n+t*2,modalContentBg:e.colorBgElevated,modalHeadingColor:e.colorTextHeading,modalCloseColor:e.colorTextDescription,modalFooterBg:`transparent`,modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterPaddingVertical:e.paddingXS,modalFooterPaddingHorizontal:e.padding,modalFooterBorderWidth:e.lineWidth,modalConfirmTitleFontSize:e.fontSizeLG,modalIconHoverColor:e.colorIconHover,modalConfirmIconSize:e.fontSize*e.lineHeight,modalCloseBtnSize:e.controlHeightLG*.55});return[l(a),u(a),d(a),c(a),e.wireframe&&f(a),o(a,`zoom`)]});export{p as default,c as genModalMaskStyle};