"use strict";var e=require("@gem-sdk/core"),t=require("./common.js"),o=require("../../product-images/common/productFeaturedImage.js");const s=["right","left","inside-left","inside-right"],i={desktop:{shape:"square",shapeValue:"1/1",width:"20%",height:void 0,shapeLinked:!0}},r=t=>{let o={};return["desktop","mobile","tablet"].forEach(i=>{let r=e.getResponsiveValueByScreen(t,i),n=s.includes(r);o=n?{...o,[i]:!0}:{...o,[i]:!1}}),o};exports.HORIZONTAL_LAYOUT=s,exports.checkDisplayGalleryByWidth=t=>{let o={desktop:!0,tablet:!0,mobile:!0};return["desktop","mobile","tablet"].forEach(s=>{let i=e.getResponsiveValueByScreen(t.shapeByLayout,s)?.width??"100%",r=0!==parseInt(i);o={...o,[s]:r}}),o},exports.getAllowDotConfig=()=>({desktop:!0,tablet:!0,mobile:!0}),exports.getCarouselVerticalConfigByPosition=r,exports.getDotStyleConfig=()=>({desktop:"none",tablet:"none",mobile:"none"}),exports.getEditorMinHeightClass=(t,o,s)=>{let i=r(o),n=e.getResponsiveValueByScreen(s,t);return i[t]&&"outside"===n?"!gp-min-h-0":"!gp-min-h-full"},exports.getMinHeightByPosition=(t,o)=>{let s=r(t),i={};return["desktop","mobile","tablet"].forEach(t=>{let r=e.getResponsiveValueByScreen(o,t),n="desktop"===t?"":`${t}:`;i[`${n}!gp-min-h-0`]=!!s[t]&&"outside"===r,i[`${n}!gp-min-h-full`]=!(s[t]&&"outside"===r)}),e.cls({...i})},exports.getSettingMinWidthForCarouselItem=t=>{let s={};return["desktop","mobile","tablet"].forEach(i=>{let r=e.getResponsiveValueByScreen(t.position,i),n=o.convertUnitToNumber(e.getResponsiveValueByScreen(t.spacing,i),5),a=e.getResponsiveValueByScreen(t.shapeByLayout,i)?.width,l="100%";if("bottom-center"===r||"inside-bottom"===r){let e=100/o.convertUnitToNumber(a,20);l=a?.includes("px")?a:a?.includes("%")?`calc(${a} - ${(e-1)*n/e}px)`:"100%"}s={...s,[i]:l}}),s},exports.getSettingWidthForCarouselItem=t=>{let o={};return["desktop","mobile","tablet"].forEach(s=>{let i=e.getResponsiveValueByScreen(t.position,s),r=e.getResponsiveValueByScreen(t.shapeByLayout,s)?.width;o={...o,[s]:"bottom-center"===i&&r?.includes("px")?r:"100%"}}),o},exports.getSettingWidthForGridItem=t=>{let o={};return["desktop","mobile","tablet"].forEach(s=>{let i=e.getResponsiveValueByScreen(t.shapeByLayout,s)?.width,r=e.getResponsiveValueByScreen(t.itemSpacing,s),n=0;i?.includes("%")&&(n=100/parseInt(i)),o={...o,[s]:n?`calc(${i} - ${r} * ${n-1} / ${n})`:i}}),o},exports.getShapeByLayout=(t,o)=>{let s={};return["desktop","mobile","tablet"].forEach(r=>{let n=e.getResponsiveValueByScreen(o,r);switch(n){case"bottom-center":case"bottom-left":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeForBottom,r)};break;case"inside-bottom":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeForInsideBottom??i,r)};break;case"left":case"right":s={...s,[r]:e.getResponsiveValueByScreen(t.shape,r)};break;case"inside-left":case"inside-right":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeForInside??i,r)};break;case"only-feature":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeForFtOnly,r)};break;case"one-col":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeFor1Col,r)};break;case"two-col":s={...s,[r]:e.getResponsiveValueByScreen(t.shapeFor2Col,r)}}}),s},exports.getSliderPerShowConfig=(t,o)=>{let s={desktop:"auto",tablet:"auto",mobile:"auto"};return["desktop","mobile","tablet"].forEach(i=>{let r=e.getResponsiveValueByScreen(o,i),n=e.getResponsiveValueByScreen(t,i)?.width,a="auto";n?.includes("%")&&(a=100>parseInt(n)?100/parseInt(n):"auto"),s={...s,[i]:"bottom-center"===r||"inside-bottom"===r?a:"auto"}}),s},exports.getZoomDisplay=o=>t.getDisplayStyle(t=>!e.getResponsiveValueByScreen(o,t),"flex"),exports.sizeSettingDefaultForNewLayout=i;
