"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../../carousel/components/item/CarouselItem.liquid.js"),r=require("../../../carousel/components/root/Carousel.liquid.js"),o=require("./common/helpers.js"),i=require("./common/classes.js"),s=require("./common/styles.js"),d=require("../../../helpers.js"),u=require("./ProductListCarouselItem.liquid.js");exports.default=l=>{let{builderProps:a,advanced:c,productSrc:n,productListId:p}=l,{carouselConfigSetting:m,carouselConfigStyle:f}=o.getData(l),{carouselItemStyle:g}=s.getStyle(l),{carouselClass:_}=i.getClass(l);return e.template`
    ${r.default({advanced:c,builderProps:{...a},rootAttrs:{"items-repeat":"true"},rootId:`product-list-carousel-${a?.uid}`,rootClass:_,setting:m,styles:f,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: "${a?.uid}" | append: product.id -%}
        ${t.default({builderProps:{...a},style:g,parentId:`product-list-carousel-${a?.uid} gp-child-item-${a?.uid}`,parentStyle:f,background:m?.background,children:`
            ${u.default({...l})}
          `})}
        {%- endif -%}
        {% endfor %}
        {%- if count == 0 and ${p.length} == 0 -%}
          {% if '${n}' == 'RelatedProduct' -%}
              <div>${d.getStaticLocale("ProductList","no_related_products")}</div>
            {% else %}
              <div>${d.getStaticLocale("ProductList","no_products_found")}</div>
          {%- endif -%}
        {%- endif -%}
      `})}
  `};
