import{makeStyleResponsive as e,DEVICES as t,parseValueWithUnit as r,getSingleColorVariable as o,removeNullUndefined as l}from"@gem-sdk/core";let n=(t,r)=>{if(!t)return{};let o=h(e=>a(r,e));return{...e("bg",o)}},a=(e,t)=>{let r=e?.[t];return o(r??e?.desktop)},d=t=>{if(!t)return{};let r=c(e=>i(t,e)),o=c(e=>s(t,e)),n=c(e=>$(t,e)),a=l({...e("bc",r),...e("bw",o),...e("bs",n)});return a},i=(e,t)=>e?.[t]?.color,s=(e,t)=>e?.[t]?.width,$=(e,t)=>e?.[t]?.border,u=(t,r)=>{if(!t)return{};let o=["btlr","btrr","bblr","bbrr"].reduce((o,n)=>({...o,...l(e(n,p(n,t,r)))}),{});return o},p=(e,t,r)=>c(o=>b({corner:e,cornerProps:t,device:o,shapeRadius:r})),b=e=>{let{cornerProps:t,device:r,corner:o,shapeRadius:l}=e,n=t?.[r]?.[o],a=t?.desktop?.[o],d=l?.[o];return n??a??d},f=e=>{let l={};for(let n of t){let t=e[n]||e.desktop;if(!t)continue;let{angle:a,distance:d,blur:i,color:s,enable:$}=t;if(!a||!d||!i||!s||!1===$)continue;let{unit:u}=r(`${d}`),p=`${Math.cos(parseFloat(`${a}`)*Math.PI/180)*parseFloat(`${d}`)}${u}`,b=`${Math.sin(parseFloat(`${a}`)*Math.PI/180)*parseFloat(`${d}`)}${u}`;l[n]=`drop-shadow(${p} ${b} ${i} ${o(s)})`}return l},c=e=>t.reduce((t,r)=>({...t,[r]:e(r)}),{}),h=e=>t.reduce((t,r)=>({...t,[r]:e(r)}),{}),m=(e,t)=>{if(!t)return"";let r=f(t);return`
     ${e} {
      filter: ${r.desktop};
      transition: filter 0.3s ease;
    }

    @media only screen and (max-width: 1024px) and (min-width: 768px) {
      ${e} {
        filter: ${r.tablet||r.desktop};
      }
    }

    @media only screen and (max-width: 767px) {
      ${e} {
        filter: ${r.mobile||r.tablet||r.desktop};
      }
    }
  `};export{m as generateShadowCSS,n as getStyleBackground,d as getStyleBorder,u as getStyleCornerRadius};
