import{filterTruthy as e}from"../../../common/helpers.js";import{composeAdvanceStyle as t,makeStyleResponsive as o,composeTypographyStyle as r,makeGlobalSize as a,getStyleShadow as s,getGradientBgrStyleByDevice as h,getStyleBackgroundByDevice as i,getBorderRadiusStyle as c,getBorderStyle as l,composeSize as d,getCustomRadius as n,getSingleColorVariable as u}from"@gem-sdk/core";let v=t=>e(t),p=(e,r)=>{let{align:a}=e??{},{pos:s,d:h,op:i,right:c,top:l,left:d,bottom:n,z:u,margin:p,padding:b}=r??{},g=r?.["spacing-setting"],w=t({pos:s,d:h,op:i,right:c,top:l,left:d,bottom:n,z:u,margin:p,padding:b,"spacing-setting":g});return v({...w,...o("ta",a)})},b=(e,o,n)=>{let{border:u,rounded:p,hasBoxShadow:b,boxShadow:w}=o??{},{wrapperBorder:m,borderRadius:y,globalSize:S,boxShadowEmailHover:f,boxShadowEmailActive:$,roundedEmailHover:x,textColorActive:k,roundedEmailActive:A,textColorHover:E,borderEmailHover:F,borderEmailActive:j,backgroundColorV2Active:C,backgroundColorV2Hover:I}=n??{},{typography:T,size:q,background:z}=e??{},B=t({border:u,rounded:p,hasBoxShadow:b,boxShadow:w}),D=r(e?.typo,T),G=a(S);return v({...G?.width?.["--w"]?G.width:{"--w":"auto"},...G?.height?.["--h"]?G.height:{"--h":"auto"},...G.padding,...D,...q?.type?{}:d(q?.custom),...l(m),...c(y),...B,...s({value:w,styleAppliedFor:"box-shadow",isEnableShadow:b}),...i(z),...h(z),...s({value:$?.active,state:"focus",styleAppliedFor:"box-shadow",isEnableShadow:!0}),...s({value:f?.hover,state:"hover",styleAppliedFor:"box-shadow",isEnableShadow:!0}),"--hvr-c":E?.hover??"","--focus-c":k?.active??"",...g({state:"hover",borderStyle:F?.hover,background:I?.hover,radius:x?.hover}),...g({state:"focus",borderStyle:j?.active,background:C?.active,radius:A?.active})})},g=({state:e,borderStyle:t,background:o,radius:r})=>{let{border:a,width:s,color:h}=t??{},i={hover:"hvr",focus:"focus"}[e];return{...s&&{[`--${i}-bw`]:`${s}`},...a&&{[`--${i}-b`]:`${a} ${u(h)}`},...o&&{[`--${i}-bgc`]:`${u(o)}`},...n(e,r)}};export{p as composeContainerStyles,b as composeInnerStyles,g as generateStylesTarget};
