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

    @media only screen and (max-width: 767px) {
      #image-comparison-left-label-${t} div, #image-comparison-right-label-${t} div {
        ${core.composeBorderCss(e?.labelBorder?.mobile)}
        ${core.composeCornerCss(e?.labelRounded?.mobile)}
      }
    }
  `;return o},getLabelCustomCss=(e,t)=>getInnerBorderCss(e,t),getLazyPlaceholderStyle=e=>({"--pos":"static","--op":0,...core.makeStyleResponsive("aspect",e)}),getSliderCursorStyles=e=>{let{hover:t,isHorizontal:o}=e;return t?"pointer":o?"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"});exports.getArrowStyles=getArrowStyles,exports.getContainerStyles=getContainerStyles,exports.getHandleCustomStyles=getHandleCustomStyles,exports.getHandleStyles=getHandleStyles,exports.getImageStyles=getImageStyles,exports.getInnerBorderCss=getInnerBorderCss,exports.getLabelCustomCss=getLabelCustomCss,exports.getLabelStyles=getLabelStyles,exports.getLazyPlaceholderStyle=getLazyPlaceholderStyle,exports.getLineStyles=getLineStyles,exports.getOuterWrapperStyles=getOuterWrapperStyles,exports.getSliderCursorStyles=getSliderCursorStyles,exports.getSliderStyles=getSliderStyles,exports.getWrapperWidth=getWrapperWidth;
