"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core");const JudgemeReviews=({setting:e,advanced:d})=>{let{widgetType:a,align:s}=e??{};return core.template`
    <div
      class="${d?.cssClass}"
      style="${{...core.makeStyleResponsive("ta",s)}}"
    >
      <div>
        {% assign widget = '${a}' %}
        {% case widget %}
          {% when "single_product_preview_badge" %}
            <div style='{{ jm_style }}' class='jdgm-widget jdgm-preview-badge' data-product-title='{{ product.title | escape }}' data-id='{{ product.id }}'>
              {{ product.metafields.judgeme.badge }}
            </div>
          {% when "review_widget" %}
            {% assign has_legacy = false %}
            {% if product.metafields.judgeme.widget.size > 20 %}
            {% assign has_legacy = true %}
            {% endif %}
              <div style='clear:both'></div>
              <div id='judgeme_product_reviews' class='jdgm-widget jdgm-review-widget' data-product-title='{{ product.title | escape }}' data-id='{{ product.id }}' data-product-id='{{ product.id }}' data-widget='review' data-auto-install='false' data-shop-reviews-count='{{ shop.metafields.judgeme.shop_reviews_count | default: 0 | escape }}' data-entry-point='review_widget.js' data-entry-key='review-widget/main.js'>
                {% if has_legacy %}
                <div class='jdgm-legacy-widget-content' style='display: none;'>{{ product.metafields.judgeme.widget }}</div>
                {% endif %}
              </div>
              {% if product.metafields.judgeme.review_widget_data %}
                <script>jdgm.data ||= {}; jdgm.data.reviewWidget ||= {}; jdgm.data.reviewWidget[{{ product.id }}] = {{ product.metafields.judgeme.review_widget_data }}</script>
              {% endif %}
          {% when "reviews_carousel" %}
            <div class='jdgm-carousel-wrapper'>
              {% assign jm_metafields = shop.metafields.judgeme %}
              <div class='jdgm-carousel-title-and-link'>
                <h2 class='jdgm-carousel-title'>Let customers speak for us</h2>
                <span class='jdgm-all-reviews-rating-wrapper' href='javascript:void(0)'>
                  <span style='display:block'  data-score='{{ jm_metafields.all_reviews_rating }}' class='jdgm-all-reviews-rating' aria-label='{{ jm_metafields.all_reviews_rating }} stars' tabindex='0' role='img'></span>
                  <span style='display: block' class='jdgm-carousel-number-of-reviews' data-number-of-reviews='{{ jm_metafields.all_reviews_count }}'>
                    from {{ shop.metafields.judgeme.all_reviews_count }} reviews
                  </span>
                </span>
              </div>
              {{ jm_metafields.featured_carousel }}
            </div>
          {% when "reviews_text" %}
            <div style='text-align: center'>
              <div class='jdgm-widget jdgm-all-reviews-text'>
                <a href='javascript:void(0)'>
                  <span data-score='{{ shop.metafields.judgeme.all_reviews_rating }}' class='jdgm-all-reviews-rating'></span>
                  <span class='jdgm-all-reviews-text__text' data-score='{{ shop.metafields.judgeme.all_reviews_rating }}' data-number-of-reviews='{{ shop.metafields.judgeme.all_reviews_count }}'>
                    Customers rate us {{ shop.metafields.judgeme.all_reviews_rating | round: 1 }}/5 based on {{ shop.metafields.judgeme.all_reviews_count }} reviews.
                  </span>
                </a>
              </div>
            </div>
          {% when "section_for_medals" %}
            {{ shop.metafields.judgeme.medals }}
          {% when "ugc_media_grid" %}
            <div class='jdgm-widget jdgm-ugc-media-wrapper'>
              {{ shop.metafields.judgeme.ugc_media_grid }}
            </div>
          {% when "verified_reviews_count_badge" %}
            <div style='clear:both'></div>
            <div style='text-align: center'>
              <a class='jdgm-verified-count-badget' href='javascript:void(0)'>
                {{ shop.metafields.judgeme.verified_badge }}
              </a>
            </div>
        {% endcase %}
      </div>
    </div>
  `};exports.default=JudgemeReviews;
