"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),CarouselItem_liquid=require("../../../carousel/components/item/CarouselItem.liquid.js"),Carousel_liquid=require("../../../carousel/components/root/Carousel.liquid.js"),helpers=require("./common/helpers.js"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers$1=require("../../../helpers.js"),ProductListCarouselItem_liquid=require("./ProductListCarouselItem.liquid.js");const ProductListCarouselLayout=e=>{let{builderProps:t,advanced:r,productSrc:s,productListId:o}=e,{carouselConfigSetting:i,carouselConfigStyle:u}=helpers.getData(e),{carouselItemStyle:l}=styles.getStyle(e),{carouselClass:d}=classes.getClass(e);return core.template`
    ${Carousel_liquid.default({advanced:r,builderProps:{...t},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${t?.uid}`,rootClass:d,setting:i,styles:u,children:`
        {%- assign count = 0 -%}
        {%- for product in products limit: limit -%}
        {%- if product.id != empty -%}
        {%- assign count = count | plus: 1 -%}
        {%- assign variant = product.selected_or_first_available_variant -%}
        {%- assign product_form_id = 'product-form-' | append: "${t?.uid}" | append: product.id -%}
        ${CarouselItem_liquid.default({builderProps:{...t},style:l,parentId:`product-list-carousel-${t?.uid} gp-child-item-${t?.uid}`,parentStyle:u,background:i?.background,children:`
            ${ProductListCarouselItem_liquid.default({...e})}
          `})}
        {%- endif -%}
        {% endfor %}
        {%- if count == 0 and ${o.length} == 0 -%}
          {% if '${s}' == 'RelatedProduct' -%}
              <div>${helpers$1.getStaticLocale("ProductList","no_related_products")}</div>
            {% else %}
              <div>${helpers$1.getStaticLocale("ProductList","no_products_found")}</div>
          {%- endif -%}
        {%- endif -%}
      `})}
  `};exports.default=ProductListCarouselLayout;
