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

  `};
