"use strict";const getTemplateByWidget=t=>{let a={"main-widget":mainWidget(t),carousel:carousel(t),"full-page":fullPage(t),"visual-gallery":visualGallery(t),"wall-photos":wallPhotos(t),"site-badge":siteBadge(t),"badge-single":badgeImage(t),"badge-double":badgeImage(t),"badge-ribbon":badgeImage(t),"product-rating":productRating(t),"instagram-feed":instagramFeed(t),"checkout-reviews":checkoutReviews(t),"single-highlight":singleHighlight(t),"top-rated":topRated(t),"star-rating-badge":starRatingBadge()},e=t?.widgetType??"main-widget";return a[e]},mainWidget=t=>{let{limitQuestions:a="1",mainWidgetAnimation:e=!1,offset:d=150,mobileOffset:i=150,excludeTags:r="",includeTags:l="",search:o="",linkify:s=!0}=t??{};return`
    <div id="stamped-main-widget"
      data-product-id="{{ product.id }}"
      data-name="{{ product.title | escape }}"
      data-url="{{ shop.url }}{{ product.url }}"
      data-image-url="{{ product.featured_image | product_img_url: "large" |replace: '?', '%3F' | replace: '&','%26'}}"
      data-description="{{ product.description | escape }}"
      data-product-sku="{{product.handle}}"
      data-product-type="{{product.type}}"
      data-offset="${d}"
      data-search="${o}"
      data-linkify="${s}"
      data-tags-include="${l}"
      data-tags-exclude="${r}"
      data-offset-mobile="${i}"
      data-take-questions="${a}"
      data-animation="${e}">
    </div>
  `},starRatingBadge=()=>`
  <span 
    class="stamped-product-reviews-badge" 
    data-id="{{ product.id }}"
    data-product-sku="{{ product.handle }}" 
    data-product-type="{{product.type}}" 
    data-product-title="{{product.title}}" 
    style="display:block;">
  </span>
  `,carousel=t=>{let{widgetType:a,carouselTitle:e="",autoSlide:d=!1,autoSlideInterval:i="",limitResults:r="",titleColor:l="",starColor:o="",textColor:s="",linkColor:g=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-take="${r}"
      data-title="${e}"
      data-auto-play="${d}"
      data-style-color-star="${o}"
      data-style-color-text="${s}"
      data-style-color-link="${g}"
      data-style-color-title="${l}"
      data-widget-type="${a}"
      data-auto-play-speed="${i}"
      ${filterAttributes(t)}>
    </div>
  `},fullPage=t=>{let{widgetType:a,showProductImage:e=!1,limitResults:d="",starColor:i="",verifiedColor:r="",textColor:l="",linkColor:o=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-take="${d}"
      data-widget-type="${a}"
      data-style-color-star="${i}"
      data-style-color-text="${l}"
      data-style-color-link="${o}"
      data-product-image="${e}"
      data-style-color-verified="${r}"
      ${filterAttributes(t)}>
    </div>
  `},visualGallery=t=>{let{widgetType:a,visualGalleryType:e="feed",carouselHeight:d="",autoSlide:i=!1,autoSlideInterval:r="",starColor:l="",hoverColor:o="",hoverOpacity:s=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-auto-play="${i}"
      data-widget-type="${a}"
      data-height="${d}"
      data-feed-type="${e}"
      data-style-color-star="${l}"
      data-style-color-hover="${o}"
      data-auto-play-speed="${r}"
      data-style-color-hover-opacity="${s?.split("%")[0]}"
      ${filterAttributes(t)}>
    </div>
  `},wallPhotos=t=>{let{widgetType:a,starColor:e=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-widget-type="${a}"
      data-color-stars="${e}"
      ${filterAttributes(t)}>
    </div>
  `},siteBadge=t=>{let{widgetType:a,siteBadgeType:e="badge",badgeOuterColor:d="",badgeInnerColor:i="",badgeRibbonColor:r="",textColor:l="",starColor:o="",siteBadgeText:s="",siteBadgeHeight:g="",siteBadgeTextSize:p=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-widget-type="${a}"
      data-badge-type="${e}"
      data-color-outer="${d}"
      data-color-inner="${i}"
      data-color-ribbon="${r}"
      data-color-text="${l}"
      data-color-stars="${o}"
      data-title="${s}"
      data-title-size="${p}"
      data-height="${g}"
      ${filterAttributes(t)}>
    </div>
  `},singleHighlight=t=>`
    <div id="stamped-reviews-widget"
      ${filterAttributes(t)}>
    </div>
  `,topRated=t=>{let{widgetType:a,starColor:e="",linkColor:d=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-widget-type="${a}
      data-color-link="${d}"
      data-color-stars="${e}">
    </div>
  `},instagramFeed=t=>{let{widgetType:a,instagramFeedType:e="",autoSlide:d=!1,autoSlideInterval:i="",carouselHeight:r="",limitResults:l="",hoverOpacity:o="",hoverColor:s=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-widget-type="${a}"
      data-feed-type="${e}"
      data-height="${r}"
      data-auto-play="${d}"
      data-auto-play-speed="${i}"
      data-color-hover="${s}"
      data-color-hover-opacity="${o}"
      data-take="${l}"
      ${filterAttributes(t)}>
    </div>
  `},checkoutReviews=t=>{let{widgetType:a,productIds:e="",checkoutReviewsStyle:d="box",checkoutReviewsTitle:i="",timeAgo:r=!1,textColor:l="",linkColor:o=""}=t??{};return`
    <div id="stamped-reviews-widget"
      data-widget-type="${a}"
      data-product-ids="${e}"
      data-style="${d}"
      data-title="${i}"
      data-color-text="${l}"
      data-color-link="${o}"
      data-timeago="${r}">
    </div>
  `},productRating=t=>{let{publicKey:a="",storeHash:e="",productId:d="",imageWidth:i="",imageHeight:r=""}=t??{},l=`https://stamped.io/inc/image/badges.png?apikey=${a}&sId=${e}&productId=${d}`;return`<img src="${l}" width="${i}" height="${r}">`},badgeImage=t=>{let{widgetType:a,publicKey:e="",storeHash:d="",labelFront:i="",labelBack:r="",imageWidth:l="",imageHeight:o=""}=t??{},s={"badge-single":"badge1","badge-double":"badge2","badge-ribbon":"badge3"}[a],g=`https://stamped.io/inc/image/badges.png?apikey=${e}&sId=${d}&type=${s}&label1=${i}&label2=${r}`;return`<img src="${g}" width="${l}" height="${o}">`},filterAttributes=t=>{let{reviewIds:a="",productIds:e="",productType:d="",productVendor:i="",tags:r="",limitWords:l="",minimumRating:o="",minimumCharacters:s="",fillEmpty:g=!1,random:p=!1,withPhotos:$=!1}=t??{};return`
    data-product-tags="${r}"
    data-fill-random="${p}"
    data-review-ids="${a}"
    data-fill-empty="${g}"
    data-with-photos="${$}"
    data-product-ids="${e}"
    data-limit-words="${l}"
    data-min-rating="${o}"
    data-min-length="${s}"
    data-product-brand="${i}"
    data-product-category="${d}"
  `};exports.getTemplateByWidget=getTemplateByWidget;
