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