"use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");const getGalleryImageAspectWidth=e=>({desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width}),getGalleryImageAspectHeight=e=>({desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height}),getGalleryImageAspectRatio=(e,t)=>core.makeAspectRatio(t,getGalleryImageAspectWidth(e),getGalleryImageAspectHeight(e)),getCarouselVerticalConfigByPosition=e=>{let t=["desktop","mobile","tablet"],o={};return t.forEach(t=>{let r=core.getResponsiveValueByScreen(e,t),l="right"==r||"left"==r;o=l?{...o,[t]:!0}:{...o,[t]:!1}}),o},getZoomDisplay=e=>helpers.getDisplayStyle(t=>!core.getResponsiveValueByScreen(e,t),"flex"),getClassOverflowAndFlexWrapForGrid=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e,o);t={...t,[`${"desktop"===o?"":`${o}:`}!gp-flex-nowrap`]:"left"===r||"right"===r,[`${"desktop"===o?"":`${o}:`}gp-overflow-y-auto `]:"left"===r||"right"===r,[`${"desktop"===o?"":`${o}:`}!gp-items-end`]:"left"===r,[`${"desktop"===o?"":`${o}:`}!gp-items-start`]:"right"===r}}),t},getAllowDotConfig=()=>({desktop:!1,tablet:!1,mobile:!1}),getClassJustifyByPosition=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let r=core.getResponsiveValueByScreen(e,o);t={...t,[`${"desktop"===o?"":`${o}:`}!gp-justify-center`]:"bottom-center"===r}}),t},getStyleWidthForGridItem=(e,t,o)=>{let r={desktop:`${100/(e?.desktop||1)}%`,tablet:`${100/(e?.tablet||1)}%`,mobile:`${100/(e?.mobile||1)}%`},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(o,l);r={...r,[l]:`${"bottom-left"!==i&&"bottom-center"!==i&&i?"100%":`calc(${100/(e?.[l]||5)}% - ${helpers.convertUnitToNumber(t?.[l],5)*((e?.[l]||5)-1)/(e?.[l]||5)}px)`}`}}),core.makeStyleResponsive("w",r)},getStyleWidthForGallery=e=>{let t={desktop:!1,tablet:!1,mobile:!1},o=e?.width,r=["desktop","mobile","tablet"];return r.forEach(t=>{let r=core.getResponsiveValueByScreen(e?.galleryVisible,t),l=core.getResponsiveValueByScreen(e?.featureImageVisible,t),i=core.getResponsiveValueByScreen(e?.position,t),s=("left"===i||"right"===i)&&r&&l;o={...o,[t]:s?core.getResponsiveValueByScreen(e?.widthHorizontalLayout,t):core.getResponsiveValueByScreen(e?.width,t)}}),{...core.makeStyleResponsive("w",core.makeWidth(o,t))}},getDeviceProperty=(e,t)=>`--${e}${"desktop"===t?"":`-${t}`}`,getStyleGallerySpacing=(e,t)=>{let o={},r=["desktop","mobile","tablet"];return r.forEach(r=>{let l=core.getResponsiveValueByScreen(e,r),i=getDeviceProperty("mt",r),s=getDeviceProperty("mr",r),a=getDeviceProperty("ml",r);o="left"==l?{...o,[s]:core.getResponsiveValueByScreen(t,r),[i]:"0px",[a]:"0px"}:"right"==l?{...o,[a]:core.getResponsiveValueByScreen(t,r),[s]:"0px",[i]:"0px"}:{...o,[i]:core.getResponsiveValueByScreen(t,r),[s]:"0px",[a]:"0px"}}),o},getSliderPerShowConfig=(e,t)=>{let o={},r=["desktop","mobile","tablet"];return r.forEach(r=>{let l=core.getResponsiveValueByScreen(e,r),i=core.getResponsiveValueByScreen(t,r),s="left"===i||"right"===i;o={...o,[r]:s?"auto":l}}),o};exports.getAllowDotConfig=getAllowDotConfig,exports.getCarouselVerticalConfigByPosition=getCarouselVerticalConfigByPosition,exports.getClassJustifyByPosition=getClassJustifyByPosition,exports.getClassOverflowAndFlexWrapForGrid=getClassOverflowAndFlexWrapForGrid,exports.getGalleryImageAspectRatio=getGalleryImageAspectRatio,exports.getSliderPerShowConfig=getSliderPerShowConfig,exports.getStyleGallerySpacing=getStyleGallerySpacing,exports.getStyleWidthForGallery=getStyleWidthForGallery,exports.getStyleWidthForGridItem=getStyleWidthForGridItem,exports.getZoomDisplay=getZoomDisplay;
