"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@gem-sdk/core"),t=require("../../helpers.js"),s=require("../common/helpers.js");exports.default=({setting:a,advanced:d})=>{let{widgetType:i,align:r,version:l,appBlockId:c,productSetting:o}=a??{},p={"review-widget":`
    {% if request.page_type == "product" %}
      <div style="display:block" id="seal-review-widget"></div>
    {% else %}
      {% assign productSelected = product | default: all_products['${o?.productHandle}'] %}
      <div style="display:block" class="custom-vstar-review-widget" data-product-id="{{ productSelected.id }}" data-product-title="{{ productSelected.title }}" data-product-image="{{ productSelected.images[0] }}"></div>    
    {% endif %}
    `,"star-rating-widget":'<div class="custom-vstar-rating-widget" data-product-id="{{product.id}}"></div>',"text-carousel":'<div id="trustoo-text-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',"barrage-carousel":'<div id="trustoo-barrage-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>',"card-carousel":'<div id="trustoo-card-carousel-widget" style="display:block;max-width:1200px;margin:0 auto"></div>',"photo-carousel":'<div id="trustoo-photo-carousel" style="display:block;max-width:1200px;margin:0 auto" data-type="block"></div>'};return l?"v2"===l?s.getLiquidForAppBlock(c,r,d?.cssClass):e.template`
    <div>
      {% if '${i}' == 'starRatingInList' %}
        {% if request.page_type != 'product' %}
          <div class="custom-vstar-rating-widget" product-id="{{ product.id }}"></div>
        {% else %}
          <div class="custom-vstar-rating-widget" data-product-id="{{ product.id }}" style="width:100%"></div>
        {% endif %}
      {% else %}
        <span id="seal_shop_id" style="display: none">{{ shop.id }}</span>
        <span id="seal_product_id" style="display: none">{{ product.id }}</span>
        <span id="seal_product" style="display: none">{{ product | json | escape }}</span>
        {% assign widget = '${i}' %}
        {% case widget %}
          {% when "starRating" %}
            <div id="seal-star-rating-widget" data-star-size="16" data-font-size="14" class="vstar-star"></div>
            <script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="https://cdn.shopify.com/extensions/da25a851-7e4c-4ab7-9a2d-0b3d699025b5/trustoo-product-ali-reviews-7/assets/star-rating-widget.min.js" defer="defer"></script>
          {% when "reviews" %}
            <div id="seal-review-widget"></div>
            <link ${t.getSettingPreloadData('class="gps-link" delay',"href")}="https://cdn.shopify.com/extensions/0519f63f-61ca-467d-975d-a60b2cc82088/7.3.0/assets/star-rating.css" rel="stylesheet" type="text/css" media="all">
        {% endcase %}
      {% endif %}
    </div>
  `:e.template`
  <div
    class="${d?.cssClass}"
    style="${{...e.makeStyleResponsive("ta",r)}}"
  >
    ${i&&p?.[i]}
    <script ${t.getSettingPreloadData('class="gps-link" delay',"src")}="https://cdn.vstar.app/static/dist/js/swiper-reviews.min.js" defer="defer"></script>
    <link ${t.getSettingPreloadData('class="gps-link" delay',"href")}="https://cdn.vstar.app/static/css/swiper-reviews.min.css" rel="stylesheet" type="text/css" media="all">
  </div>
  `};
