"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),Arrow_liquid=require("../arrow/Arrow.liquid.js"),Dots_liquid=require("../dot/Dots.liquid.js"),helpers=require("../arrow/common/helpers.js"),helpers$1=require("./common/helpers.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),attrs=require("./common/attrs.js"),helpers$2=require("../../../helpers.js");const Carousel=e=>{let{children:r,builderAttrs:s,builderProps:o,styles:t,isHiddenArrowWhenDisabled:l=!0,hiddenDotWhenOnlyOne:a,rootId:i,rawChildren:d,conditionAppendJs:c,productBadgeLiquid:n}=e,u=helpers.mappingNavigationCarousel(e.setting),p={...e,setting:u},{arrowButtonSize:$,arrowBackgroundColor:v,arrowGapToEachSide:g="16",roundedArrow:h,arrowIconSize:m,arrowCustomColor:S,arrowBorder:w,arrowShadow:q,showWhenHover:y}=u??{},{uniqueComponentId:C,loopConfig:f,arrowShowConfig:j,stateData:_}=helpers$1.getData(p),{rootClassRender:A,wrapperClassRender:D,wrapperInnerClass:k,sliderClass:P}=classes.getClass(p),{sliderWrapperStyle:E,rootStyleRender:I,wrapperStyleRender:b,wrapperInnerStyle:z}=styles.getStyle(p),{rootAttrRender:R,sliderAttr:x}=attrs.getAttr(p),G=()=>core.RenderIf(core.isLocalEnv,`<script ${helpers$2.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-carousel-v3-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$2.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-carousel-v3-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`),O=e=>{let r="next"===e;return Arrow_liquid.default({uid:o?.uid,componentId:C,custom:u?.arrowCustom??"",showArrow:j,arrowButtonSize:$||{},arrowIconSize:m||{},arrowBackgroundColor:v??"",arrowCustomColor:S,gapToEachSize:g,showWhenHover:y,arrowBorder:w||{},arrowCorner:h||{},arrowShadow:q||{},left:!r,onClick:e=>{e.stopPropagation()},vertical:u?.vertical,isHiddenWhenDisabled:l,rootId:i})},T=()=>core.template`
    ${d?.length?core.WrapRenderChildren({uid:o?.uid??"",customProps:d[0]?.customProps},d.map((e,r)=>{if(e)return core.template`${core.RenderChildren({...e,index:r,parentSettings:u,parentStyle:t,background:u?.background,parentUid:o?.uid})}`})):r??`<div>${helpers$2.getStaticLocale("Carousel","no_slider")}</div>`}`;return core.template`
    <gp-carousel-v3 gp-data='${_}' ${R} style="${I}" class="${A}">
      <div
        ${s}
        class="${D}"
        style="${b}"
      >
        <div class="${k}" style="${z}">
          ${n??""}
          ${O("prev")}
          <div ${x} style="${E}">
            <div class="${P}">
              ${T()}
            </div>
          </div>
          ${O("next")}
        </div>
        ${Dots_liquid.default({loop:f,showDots:u?.dot,dotStyle:u?.dotStyle,dotGapToCarousel:u?.dotGapToCarousel,dotSize:u?.dotSize,vertical:u?.vertical,uniqueComponentId:C,hiddenWhenOnlyOne:a})}
      </div>
    </gp-carousel-v3>
    ${c?`{% if ${c} %} ${G()} {% endif %}`:G()}

  `};exports.default=Carousel;
