import{makeStyleResponsive as e,getCornerCSSFromGlobal as t,composeBorderResponsive as l,composeTypographyStyle as o,getResponsiveStylePadding as i,getResponsiveStyleShadowWithoutState as a,getStyleShadow as r,makeStyle as s,composeBorderCss as n,composeCornerCss as d}from"@gem-sdk/core";import{generateTranslateByDevices as p,FLEX_ALIGN as b,getLabelPosition as g}from"./helpers.js";let getWrapperWidth=({width:t,leftImageWidth:l=0,rightImageWidth:o=0})=>{let i=e("w",{desktop:t?.desktop??"0",tablet:t?.tablet??t?.desktop??"0",mobile:t?.mobile??t?.tablet??t?.desktop??"0"});for(let e in i)i[e]="undefinedpx"!==i[e]&&i[e]?i[e]:`${Math.min(l,o)||900}px`;return i},getContainerStyles=({aspectRatio:l,builderData:o,allImagesLoaded:i=!0})=>({height:"auto",overflow:"hidden",position:"relative","box-sizing":"border-box",display:i?"block":"none",...e("aspect",l),...t(o?.advanced?.rounded)}),getOuterWrapperStyles=t=>{let l={desktop:b[t?.align?.desktop??"left"],tablet:b[t?.align?.tablet??t?.align?.desktop??"left"],mobile:b[t?.align?.mobile??t?.align?.tablet??t?.align?.desktop??"left"]};return{...e("jc",l)}},getLabelStyles=({type:t,styles:n,isHorizontal:d})=>{let b=d?{["left"===t?"left":"right"]:"8px"}:{["left"===t?"top":"bottom"]:"8px"},h=p({isHorizontal:d,labelPositionHoz:n?.labelPositionHoz,labelPositionVer:n?.labelPositionVer}),x=e=>g({position:e,isHorizontal:d,labelPositionHoz:n?.labelPositionHoz,labelPositionVer:n?.labelPositionVer});return e(d?"top":"left",x("topLeft")),{opacity:1,...b,...l(n?.labelBorder),...o(n?.typo),...e("t",h),...i(n?.labelPadding),...e(d?"top":"left",x("topLeft")),...e(d?"bottom":"right",x("bottomRight")),...a(n?.labelShadow,"box-shadow",n?.labelShadow),...r({styleAppliedFor:"text-shadow",value:n?.typo?.custom?.textShadow,isEnableShadow:n?.typo?.custom?.hasShadowText}),...e("bg",n?.labelBackgroundColor),...s({c:n?.labelTextColor??"#F9F9F9"})}},getImageStyles=({type:t,props:l})=>{let{styles:o,leftImageCss:i,rightImageCss:a}=l??{},r="left"===t?i:a;return{top:0,width:"100%",height:"100%",display:"block",position:"absolute",...r,...e("objf",o?.imageScale)}},getInnerBorderCss=(e,t)=>{let l=`
    #image-comparison-left-label-${t} div, #image-comparison-right-label-${t} div {
      ${n(e?.labelBorder?.desktop)}
      ${d(e?.labelRounded?.desktop)}
    }

    @media only screen and (max-width: 1024px) and (min-width: 768px) {
      #image-comparison-left-label-${t} div, #image-comparison-right-label-${t} div {
        ${n(e?.labelBorder?.tablet)}
        ${d(e?.labelRounded?.tablet)}
      }
    }

    @media only screen and (max-width: 767px) {
      #image-comparison-left-label-${t} div, #image-comparison-right-label-${t} div {
        ${n(e?.labelBorder?.mobile)}
        ${d(e?.labelRounded?.mobile)}
      }
    }
  `;return l},getLabelCustomCss=(e,t)=>getInnerBorderCss(e,t),getLazyPlaceholderStyle=t=>({"--pos":"static","--op":0,...e("aspect",t)}),getSliderCursorStyles=e=>{let{hover:t,isHorizontal:l}=e;return t?"pointer":l?"ew-resize":"ns-resize"},getSliderStyles=e=>({"z-index":2,display:"flex",position:"absolute","align-items":"center","justify-content":"center",cursor:getSliderCursorStyles(e),"flex-direction":e.isHorizontal?"column":"row",height:e.isHorizontal?"100%":`${e.handleSize}px`,width:e.isHorizontal?`${e.handleSize}px`:"100%"}),getLineStyles=e=>({display:"block",flex:"0 1 auto",background:e.sliderLineColor,"box-shadow":"0px 0px 4px 0px rgba(0, 0, 0, 0.40)",height:e.isHorizontal?"100%":`${e.sliderLineWidth}px`,width:e.isHorizontal?`${e.sliderLineWidth}px`:"100%"}),getHandleStyles=e=>({display:"flex",flex:"1 0 auto","align-items":"center","box-sizing":"border-box","justify-content":"center","border-radius":"100%",width:`${e.handleSize}px`,height:`${e.handleSize}px`,"box-shadow":"0px 0px 4px 0px rgba(0, 0, 0, 0.40)",transform:e.isHorizontal?"none":"rotate(90deg)",border:`${e.sliderLineWidth}px solid ${e.sliderLineColor}`}),getHandleCustomStyles=()=>({width:"auto",height:"auto",display:"flex",flex:"1 0 auto","align-items":"center","box-sizing":"border-box","justify-content":"center"}),getArrowStyles=e=>({filter:"drop-shadow(rgba(0, 0, 0, 0.4) 0px 0px 4px)",margin:"left"===e.type?"0 2px 0 0":"0 0 0 2px"});export{getArrowStyles,getContainerStyles,getHandleCustomStyles,getHandleStyles,getImageStyles,getInnerBorderCss,getLabelCustomCss,getLabelStyles,getLazyPlaceholderStyle,getLineStyles,getOuterWrapperStyles,getSliderCursorStyles,getSliderStyles,getWrapperWidth};
