import{makeStyle as e,makeStyleResponsive as t,makeGlobalSize as r,getSingleColorVariable as o,composeBorderResponsive as l,composeRadiusResponsive as i,getResponsiveStyleShadowWithoutState as n,getStyleShadow as a,makeLineClamp as d,getGlobalColorStyle as y,getGlobalColorStateStyle as h,composeTypographyStyle as s,getStyleBackgroundByDevice as p,getGradientBgrStyleByDevice as c,filterHoverVariables as u}from"@gem-sdk/core";import{formatThickness as g}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(r,o)=>{let l={...e({mr:r?.spacing,mb:r?.spacing}),...t("ta",r?.align),...o,"--dynamic-source-color":"#F4F4F4"};return filterTruthyStyles(l)},getContainerStyle=(e,r)=>{let{tagWidth:o}=r??{},l={...t("jc",e?.align),...o};return filterTruthyStyles(l)},getTextStyle=(S,w)=>{let m=r(w?.globalSize),b=[S?.lineThrough&&"line-through",S?.typo?.attrs?.underline&&"underline"].filter(Boolean),f={...m?.width?.["--w"]?m.width:{"--w":"100%"},...e({tdc:o(S?.lineColor?.normal),tdt:g(S?.thickness)}),...l(S?.shapeBorder),...i(S?.shapeRounded),...n(S?.shapeBoxShadow,"box-shadow",S?.shapeBoxShadow),...a({value:S?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:S?.typo?.custom?.hasShadowText}),...t("ta",S?.textAlign),...t("line-clamp",d(S?.lineClamp,S?.hasLineClamp)),...S?.textColor?y(S.textColor):h("c",S?.color),...s(S?.typo,S?.typography),"word-break":"break-word",...p(w?.background),...m.padding,...c(w?.background,{desktop:!0,tablet:!0,mobile:!0}),overflow:"hidden",...S?.opacityPrice&&{opacity:`${S?.opacityPrice}%`},...e({tdl:b.join(" ")})};return S?.enableHoverEffect?filterTruthyStyles(f):u(f)},getTextStyleInline=e=>{let t={...s(e?.typo),"word-break":"break-word",overflow:"hidden"};return filterTruthyStyles(t)};export{getContainerStyle,getStyle,getTextStyle,getTextStyleInline};
