import{template as e,makeStyleResponsive as a}from"@gem-sdk/core";import{FERA_VERSION as t}from"../../types.js";let getTemplateByWidget=e=>e?.feraVersion===t.V3?liquidTemplateFeraV3(e):liquidTemplateFeraV2(e),liquidTemplateFeraV2=t=>{let r=e`class="gp-flex gp-items-center" style="${{...a("jc",t?.align)}}"`;switch(t?.widgetType){case"productReviews":return`<div ${r} data-fera-container="${t?.productReviewsCode}" data-product_id="{{ product.id }}"></div>`;case"testimonialCarousel":return`<div ${r} data-fera-container="${t?.testimonialCarouselCode}"></div>`;case"allReviews":return`<div ${r} data-fera-container="${t?.allReviewsCode}"></div>`;case"averageStoreRatingBadge":return`<div ${r} data-fera-container="${t?.averageStoreRatingBadgeCode}"></div>`;case"inStoreMedia":return`<div ${r} data-fera-container="${t?.inStoreMediaCode}"></div>`;case"averageRatingBadge":return`<div ${r} data-fera-container="${t?.averageRatingBadgeCode}" data-product_id="{{ product.id }}"></div>`;case"productPageMedia":return`<div ${r} data-fera-container="${t?.productPageMediaCode}" data-product_id="{{ product.id }}"></div>`}return""},liquidTemplateFeraV3=t=>{let r=e`class="gp-flex gp-items-center" style="${{...a("jc",t?.align)}}"`;switch(t?.widgetTypeV3){case"productReviews":return`<div ${r} class="gp-flex gp-items-center" data-fera-container="product_reviews" data-product-id="{{ product.id }}"></div>`;case"testimonialCarousel":return`<div ${r} data-fera-widget="testimonial_carousel"></div>`;case"allReviews":return`<div ${r} data-fera-container="all_reviews"></div>`;case"mediaGallery":return`<div ${r} data-fera-container="store_customer_media"></div>`;case"productCollectionRating":return'<div data-fera-widget="product_collection_rating" data-rating-count="{{ product.metafields.reviews.rating_count }}" data-rating-average="{{ product.metafields.reviews.rating.value }}" data-product-id="{{ product.id }}"></div>';case"productDetailRating":return`<div ${r} data-fera-container="product_reviews_summary" data-product-id="{{ product.id }}"></div>`;case"otherWidget":return`${t?.otherWidgetCode}`}return""};export{getTemplateByWidget};
