(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};t.d({},{t_:()=>M,AJ:()=>k,gw:()=>P,DW:()=>D,qS:()=>B,r4:()=>O,v:()=>C});async function e(t,e){if(M('#tt-carousel[data-type="barrage"]'))return;const{swiperStyle:i,lang:r}=C,n=C.columns[e],a=P("#trustoo-barrage-carousel",t.is_home_active,t.is_product_active);if(!a)return;C.barrageSpeed=1e3*t.speed;const o={sort_by:"commented-at-descending"};1===t.show_reviews?o.is_show_all=1:2===t.show_reviews?o.is_feature=1:5===t.show_reviews&&(C.productId?o.product_id=C.productId:o.is_show_all=1);const c=await C.request("getReviews",o);let l=null,d=null;if(c[0])return;if(0===c[1].list.length)return;l=c[1].list,d=c[1].total_rating,C.reviewsLists[e]=l;let u="",p="";const v=t;i.textContent+=`\n\t#tt-carousel{\n\t\t--title-color: ${v.title_color};\n\t\t--desc-color: ${v.description_color};\n\t\t--block-bg-color:${v.block_bg_color};\n\t\t--card-bg-color:${t.widget_layout_card_bg_color};\n\t\t--card-radius:${v.card_border_radius}px;\n\t\t--photo-radius: ${t.image_border_radius+"px"};\n\t}\n\t${D(v,"barrage")}\n\t`;const w=l.length;let _=null,g=null;let h="first";w>(C.isMobile?5:10)?(_=l.filter(((t,e)=>e%2==0)),g=l.filter(((t,e)=>e%2!=0))):_=l,g?p=s(g,t,"second"):h="single",u=s(_,t,h);let f="";if(1===t.is_show_description){const e=`${d.total_reviews}`;f=``}a.insertAdjacentHTML("beforeend",`\n `);const m=M('#tt-carousel[data-type="barrage"] #tt-carousel-list'),y=parseInt(getComputedStyle(m).width);C.isMobile?C.columns[e]=w<=2?1:2:w<5&&w>=3?C.columns[e]=w-1:w<3&&(C.columns[e]=w);const $=C.columns[e]-1,b=452*C.columns[e]+32*$;bt.style.width=b+"px"))}function s(t,e,s){return t.reduce(((t,i,r)=>{let n="",a="";if(i.resources.length){const t=e.show_photos_option;if(1===t){const t=i.resources[0];a=(2===t.resource_type?t.thumb_src:t.src)||i.product_image_src}else 2===t&&(a=i.product_image_src)}else a=i.product_image_src;let o="",c=r;"single"!==s&&(c=2*r,"second"===s&&(c+=1)),o=a?`review image`:O("noImage"),n+=`
\n\t\t\t\t${o}\n\t\t\t\t
`,n=`
${n}
`;return t+=`\n\t\t
\n
\n\t\t
\n\t\t${n}
\n\t\t
\n\t\t
${i.author}
\n\t\t\t
${B(i.star,C)}
\n\t\t
\n\t\t
${i.content}
\n\t\t
\n `}),"")}async function i(t,e){if(M('#tt-carousel[data-type="photo"]'))return;const{swiperStyle:s,lang:i}=C,r=C.columns[e],n=P("#trustoo-photo-carousel",t.is_home_active,t.is_product_active);if(!n)return;const a={has_resource:1};1===t.show_reviews?a.is_show_all=1:2===t.show_reviews?a.is_feature=1:5===t.show_reviews&&(C.productId?a.product_id=C.productId:a.is_show_all=1);const o=await C.request("getReviews",a);let c=null,l=null;if(o[0])return;if(0===o[1].list.length)return;c=o[1].list,l=o[1].total_rating,C.reviewsLists[e]=c;const d=c.length;let u="";const p=t;s.textContent+=`\n\t#tt-carousel[data-type=photo]{\n\t\t--btn-bg-color: ${p.scroll_bg_color};\n\t\t--title-color: ${p.title_color};\n\t\t--desc-color: ${p.description_color};\n\t\t--star-bg-color:${p.stars_bg_card_color||"#fff"};\n\t\t--block-bg-color:${p.block_bg_color||"#fff"};\n\t\t--card-radius:${p.card_border_radius}px;\n\t}\n\t#tt-carousel[data-type=photo] .resource-list{\n\t\theight: ${204*(1==p.photo_ratio?1:1.33)}px\n\t}\n\t${D(p,"photo")}\n\t`;const v=t.scroll_buttons_icon_color;c.forEach(((s,i)=>{let r="";1===t.is_show_verified_purchase&&1===s.verified_badge&&(r=C.badgeIconSvg);const n=s.resources[0];if(!n)return;const a=2===n.resource_type?n.thumb_src:n.src,o=2===n.resource_type?O("video"):"",c=`
\n\t\t${e}\n\t\t ${o}\n\t\t
`;u+=`\n\t\t
\n
\n\t\t
\n\t\t${c}
\n\t\t
${B(s.star,C)}
\n\t\t\t
${s.author}
${1===s.verified_badge?r:""}
\n\t\t
${s.content}
\n\t\t
\n `}));let w="";if(1===t.is_show_description){const e=`${l.total_reviews}`;w=``}n.insertAdjacentHTML("beforeend",`\n `)}async function r(t,e){if(M('#tt-carousel[data-type="primary"]'))return;let s="initial";const{swiperStyle:i}=C,r=C.columns[e],n=P("#trustoo-card-carousel-widget",t.is_home_active,t.is_product_active);if(!n)return;const a={};1===t.show_reviews?a.is_show_all=1:2===t.show_reviews?a.is_feature=1:5===t.show_reviews&&(C.productId?a.product_id=C.productId:a.is_show_all=1);const o=await C.request("getReviews",a);let c=null,l=null;if(o[0])return;if(0===o[1].list.length)return;c=o[1].list,l=o[1].total_rating,C.reviewsLists[e]=c;const d=c.length;d\n
\n
\n
\n
\n ':p="no-header";const _=t.scroll_buttons_icon_color;(1===t.is_home_active&&C.isHomePage||1===t.is_product_active&&C.isProPage)&&(s="1200px");let g=`\n \n `;n.insertAdjacentHTML("beforeend",g);const h=M(".tt-swiper-header"),f=w.card_carousel;if(k(".tt-review-verify").forEach((t=>t.textContent=w.verified_purchase)),1===t.is_show_header&&(M(".swiper-header-title",h).textContent=f.header_title,M(".swiper-header-rating",h).textContent+=" "+f.header_review_rating_text,M(".swiper-header-count",h).textContent+=" "+f.header_review_count_text),k(".tt-card .tt-review-verify").forEach((t=>t.textContent=w.verified_purchase)),1===t.is_show_header){const t=l.total_reviews.toLocaleString(),e=M(".tt-swiper-header .swiper-header-rating"),s=M(".tt-swiper-header .swiper-header-count");M(".swiper-header-stars",h).innerHTML=B(l.rating,C),e.textContent=l.rating+e.textContent,s.textContent=t+s.textContent}if(0===c.length)return;const m=document.querySelector("#tt-carousel[data-type=primary]");m.insertAdjacentHTML("beforeend",`
\n\t\t\t\n\t\t\t
\n\t\t\t
${O("scrollBtn",_)}
\n\t\t\t
${O("scrollBtn",_)}
\n\t\t`),c.length<=r&&m.classList.add("hide-btn");try{sessionStorage.setItem("trustoo_swiper_reviews",JSON.stringify(c))}catch(t){}k(".tt-card .tt-review-verify").forEach((t=>t.textContent=w.verified_purchase))}async function n(t,e){if(M('#tt-carousel[data-type="text"]'))return;const{swiperStyle:s,lang:i}=C,r=C.columns[e],n=P("#trustoo-text-carousel",t.is_home_active,t.is_product_active);if(!n)return;const a={sort_by:"commented-at-descending"};1===t.show_reviews?a.is_show_all=1:2===t.show_reviews?a.is_feature=1:5===t.show_reviews&&(C.productId?a.product_id=C.productId:a.is_show_all=1);const o=await C.request("getReviews",a);let c=null,l=null;if(o[0])return;if(0===o[1].list.length)return;c=o[1].list,l=o[1].total_rating,C.reviewsLists[e]=c;const d=c.length;let u="";const p=t;s.textContent+=`\n\t\t#tt-carousel[data-type=text]{\n\t\t\t--btn-bg-color: ${p.scroll_bg_color};\n\t\t\t--title-color: ${p.title_color};\n\t\t\t--desc-color: ${p.description_color};\n\t\t\t--block-bg-color:${p.block_bg_color};\n\t\t\t--card-bg-color:\n\t\t\t${1==t.is_show_card?t.widget_layout_card_bg_color:"none"};\n\t\t--card-shadow:\n\t\t\t${1==t.card_shadows_option&&1==t.is_show_card?"0px 2px 10px 0px rgba(0, 0, 0, 0.10);":"none"};\n\t\t\t--card-radius:${p.card_border_radius}px;\n\t\t\t--photo-radius: ${t.image_border_radius+"px"};\n\t\t}\n\t\t.tt-swiper .tt-swiper-header .vstar-star{\n\t\t\t--header-star-color:${p.header_star_color};\n\t\t\t--header-nostar-color:${p.header_disabled_star_color};\n\t\t}\n\t\t.tt-swiper-ring{\n\t\t\t--scroll-color:${p.scroll_buttons_icon_color}\n\t\t}\n\t\t${D(p,"text")}\n\t\t`;const v=["above","below"][t.photos_position-1];c.forEach(((e,s)=>{let i="";1===t.is_show_verified_purchase&&1===e.verified_badge&&(i=`
\n ${C.badgeIconSvg}
`);let r="";if(1===t.is_show_photos){let i="";if(e.resources.length){const s=t.show_photos_option;if(1===s){const t=e.resources[0];i=(2===t.resource_type?t.thumb_src:t.src)||e.product_image_src}else 2===s&&(i=e.product_image_src)}else i=e.product_image_src;let n="";n=i?`${s}`:O("noImage"),r=`
\n\t\t\t\t${n}\n\t\t\t
`}u+=`\n\t\t
\n
\n\t\t
\n\t\t
${O("comma",t.widget_layout_text_color)}
\n\t\t${"above"===v?r:""}\n\t\t
${e.content}
\n\t\t
${B(e.star,C)}
\n\t\t\t${"below"===v?r:""}\n\t\t\t
${e.author}
${1===e.verified_badge?i:""}
\n `}));let w="";if(1===t.is_show_description){const e=`${l.total_reviews}`;w=``}n.insertAdjacentHTML("beforeend",`\n `)}const a=1,o=3,c=4,l=1,d=2;let u=0,p={},v={},w=null;const _=p.carousel_type,g=_!==c,h=4===_?3e3:500;let f,m=3;const y=function(){let t=navigator.userAgent,e=/(?:Android)/.test(t),s=/(?:Firefox)/.test(t),i=/(?:iPad|PlayBook)/.test(t)||e&&!/(?:Mobile)/.test(t)||s&&/(?:Tablet)/.test(t),r=/(?:iPhone)/.test(t)&&!i;return e||r}();let $=0,b=0,x="";const C={isHomePage:!1,isProPage:!1,userSetting:{},isMobile:y,isMixReview:!0,revDetailInfo:{page:0,imageIndex:0},reviewsLists:[null,null,null,null],ratingData:null,env:"production",staticBaseUrl:"cdn.vstar.app",constructTime:new Date("2024-11-28 16:20:06").getTime()/1e3,source:"carousel",sortType:"image-descending",isSetTimer:!0,ratingIconSvg:"",badgeIconSvg:"",customStyleCode:"",lang:null,translateX:[0,0,0,0],tailX:[0,0,0,0],columns:[0,0,0,0],cardWidths:[0,0,0,0],timers:[null,null,null,null],request:null,canOtherPageExecute:!1,detailCloseCB:null,themeId:"undefined"!=typeof Shopify&&Shopify.theme&&Shopify.theme.id,isProductReviews:!1,normalSpeed:300,barrageSpeed:5e3,pageType:"",productId:null};function S(t,e){const s=t.dataset.index,i=C.cardWidths[s],r=C.tailX[s];let n=C.translateX[s];if(-n>r){const s=t.children[0].cloneNode(!0);n=i-r,startX=e-n,t.appendChild(s),t.children[0].remove()}else if(n>0){const s=Array.from(t.children).at(-1),r=s.cloneNode(!0);startX=e+i,n=-i,s.remove(),t.insertAdjacentElement("afterbegin",r)}C.translateX[s]=n,t.style.cssText=`transform:translate3d(${n}px,0,0);transition-duration: 0ms;`}function T(){I(),u=parseInt(getComputedStyle(swiper).width)/m,otherCardWidth=parseInt(getComputedStyle(swiper).width)/3,C.cardWidth=u,tailCritical=u*(b-m),b>m?(C.isSetTimer&&function(t,e){let s=C.timers[e];null===s&&M("#trustoo-mask")&&"none"===getComputedStyle(M("#trustoo-mask")).display&&(s=setInterval((()=>{g&&function(t,e,s){const i=C.cardWidths[e],r=C.translateX;s===l?(r[e]+=i,L(t,e)):s===d&&(r[e]-=i,L(t,e))}(t,e,d)}),3e3),C.timers[e]=s)}(),wrapper.classList.remove("hide-btn")):(C.isSetTimer&&function(t){const e=C.timers[t];e&&(clearInterval(e),C.timers[t]=null)}(),wrapper.classList.add("hide-btn")),L();let t=Math.round(Math.abs($)/u);t>=b-m&&(t=b-m),$=-t*u,swiper.style.cssText=`transform:translate3d(${$}px, 0, 0);transition-duration:500ms`}function I(){const t=window.innerWidth;let e,s=0;t<=550?s=e=1:t>=550&&t<968?s=e=2:t>=968&&t<1368?(e=C.settings[0].max_columns,s=3):t>=1368&&(e=C.settings[0].max_columns,s=4),C.columns=[e,s,s,4]}function L(t,e){let s=null,i=C.translateX[e];const r=C.tailX[e];-i>r?(s=-r,S(t)):i>0?(s=0,S(t)):t.style.cssText=`transform:translate3d(${i}px,0,0);`,null!==s&&(i=s,setTimeout((()=>{t.style.cssText=`transition-duration: ${h}ms;transform:translate3d(${i}px,0,0);`,C.translateX[e]=i}))),E()}function P(t,e,s){const i=Array.from(k(t)).find((t=>t.offsetParent));let r=!1;if(i)return i;const n=1===s;if((1===e&&C.isHomePage||n&&C.isProPage)&&(r=!0),!r)return null;if(C.wrapper)return C.wrapper;let a="beforebegin",o=null,c=null;if("undefined"!=typeof vstar_custom_info&&vstar_custom_info.custom_carousel_info&&(c=vstar_custom_info.custom_carousel_info.list.find((t=>(void 0===t.theme_id||t.theme_id===C.themeId)&&-1!==t.page.indexOf(x))),c&&(o=M(c.selector),a=c.position)),C.isProPage&&!o){const t=function(){let t="beforebegin",e=null;const s=M("#reviews-wrapper.trustoo-reviews-wrapper");if(s)e=s;else{const s=Array.from(k(".pagefly-review-widget-sealapp,.custom-vstar-review-widget,#seal-review-widget")).find((t=>t.offsetParent));s&&(e=s);let i=null;"undefined"!=typeof vstar_custom_info&&vstar_custom_info.get_move_review_info&&(i=vstar_custom_info.get_move_review_info.list.find((t=>(void 0===t.theme_id||t.theme_id===C.themeId)&&-1!==t.page.indexOf(x))),i&&(e=M(i.selector),t=i.position))}return{targetEle:e,position:t}}();o=t.targetEle,a=t.position}if(!o){let t=M("#shopify-section-footer,footer"),e=M("main"),s=M('.shopify-section[id$="__main"],#shopify-section-product-template');s?(o=s,a="afterend"):e&&(e.contains(t)?o=t:(o=e,a="afterend")),t&&(o?C.isHomePage&&(o=t,a="beforebegin"):o=t)}return o?(o.insertAdjacentHTML(a,'
'),C.wrapper=M("#tt-carousels-wrapper"),C.wrapper):void 0}function E(){const t=C.cardWidths[3],e=swiper.children[-$/t+m-1].firstElementChild.getAttribute("no");M("#tt-carousel .tt-swiper-ring.active").classList.remove("active"),"0"===e?M("#tt-carousel .tt-swiper-ring:first-child").classList.add("active"):e==b-1?M("#tt-carousel .tt-swiper-ring:last-child").classList.add("active"):M("#tt-carousel .tt-swiper-ring.middle").classList.add("active")}function M(t,e){let s;return s=e?e.querySelector(t):document.querySelector(t),s}function k(t,e){let s;return s=e?e.querySelectorAll(t):document.querySelectorAll(t),s}function A(t,e=!1){const{params:s,method:i="GET"}=t,r=t.res,n=t.rej;let a=new XMLHttpRequest;let o=e?t.url:"https://api.trustoo.io/api/v1/reviews/"+t.url,c="";"object"==typeof s&&(c=Object.keys(s).reduce(((t,e)=>t+"&"+e+"="+s[e]),"")),"POST"==i?(a.open(i,o,!0),c=c&&!isOss?c.slice(1):s,a.send(c)):"GET"==i&&(c&&(c=c.replace("&","?"),o+=c),a.open(i,o,!0),a.send()),a.onreadystatechange=()=>{if(4==a.readyState){let t=a.responseText;200==a.status||203==a.status?r&&r(t):n&&n({responseText:t,statusText:a.statusText})}}}function j(t,e,s){if("set"!==t)return JSON.parse(sessionStorage.getItem(e));try{sessionStorage.setItem(e,JSON.stringify(s))}catch(t){}}!async function(){if(window.TrustooCarouselExecuted)return;window.TrustooCarouselExecuted=!0,document.head.insertAdjacentHTML("beforeend",'');const t=M("#tt-swiper-style");C.swiperStyle=t;const s=M("#trustoo-carousel-script");if(window.ShopifyAnalytics&&(x=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta.page.pageType,f=window.ShopifyAnalytics&&ShopifyAnalytics.lib&&ShopifyAnalytics.lib.config&&ShopifyAnalytics.lib.config.Trekkie.defaultAttributes.shopId),x||(x=s.dataset.page,"index"===x&&(x="home")),C.isHomePage="index"===x||"home"===x,C.isProPage="product"===x,C.pageType=x,"undefined"!=typeof trustooBeforeExecute?trustooBeforeExecute(C,{}):setTimeout((()=>{"undefined"!=typeof trustooBeforeExecute&&trustooBeforeExecute(C,{})}),200),f||s&&(f=s.dataset.shop_id),M("#trustoo-card-carousel-widget,#trustoo-text-carousel,#trustoo-photo-carousel,#trustoo-barrage-carousel")&&(C.canOtherPageExecute=!0),!(C.isHomePage||C.isProPage||C.canOtherPageExecute))return void t.remove();const l={getSetting:{url:"get_card_carousel_settings",params:{shop_id:f}},getLang:{url:"get_customer_self_define_lang",params:{shop_id:f,lang:"en"}},getReviews:{url:"get_product_reviews",params:{shop_id:f}}};let d=await D("getSetting");if("undefined"!=typeof vstar_review_settings&&Object.assign(C.userSetting,vstar_review_settings),C.settings=d[1],p=d[1][0],v=p,!p)return;const u=C.settings.some((t=>C.isHomePage&&1===t.is_home_active||C.isProPage&&1===t.is_product_active)),_=document.querySelector("#trustoo-card-carousel-widget,#trustoo-photo-carousel,#trustoo-text-carousel,#trustoo-barrage-carousel");if(!u&&!_&&!C.canOtherPageExecute)return;const g=s.dataset.productId;Number(g)&&(C.productId=g),I();const h=p.review_date_format_type;C.userSetting.review_date_format_type=h,C.isSpecialRatingIcon=[4,9,12,14,15,16,18].includes(C.settings[0].rating_icon_type);let y={};const $=v.rating_icon_type||1,b=v.verified_icon_type||1,S=j("get","ttRatingIcons");if(S&&(y=JSON.parse(S),C.ratingIconSvg=y["star"+$],C.badgeIconSvg=y["badge"+b]),1===$&&(C.ratingIconSvg=O("star")),1===b&&(C.badgeIconSvg=O("verified")),!C.ratingIconSvg||!C.badgeIconSvg){const t="https://cdn.vstar.app/static/customer/icons.json";new Promise(((e,s)=>{A({url:t,res:e,rej:s},!0)})).then((t=>{const e=["star","rounded","spikes","surrounded","fire","heart","diamond","crown","trophy","shirt","skirt","bag","tie","cup","leaf","seedling","footprint","chef"][$-1];const s=JSON.parse(t);C.ratingIconSvg=s[e],C.badgeIconSvg=s["badge"+b],y["star"+$]=C.ratingIconSvg,y["badge"+b]=C.badgeIconSvg,j("set","ttRatingIcons",JSON.stringify(y)),k(".vstar-star .pending").forEach((t=>{t.innerHTML=C.ratingIconSvg,t.classList.remove("pending")})),k(".tt-swiper .user-verified").forEach((t=>t.insertAdjacentHTML("afterbegin",C.badgeIconSvg)))})).catch((()=>{C.ratingIconSvg=O("star"),C.badgeIconSvg=O("verified")}))}const L=await D("getLang");C.lang=JSON.parse(L[1].lang_json),t.textContent+=`\n\t.tt-swiper {\n\t\t\t--column:${m};\n\t\t\t--common-height: 0px;\n\t\t}\n\t${C.customStyleCode}\n\t`,C.request=D;const P=[r,n,i,e];function E(t){const e=C.settings[0].max_columns,s=Number(t.dataset.index)+1,i=t.dataset.index,r=t.dataset.count;let n=20,l=C.normalSpeed;s===a?n=12:s===c&&(n=32,l=C.barrageSpeed);const d=s!==c?{300:{slidesPerView:1},550:{slidesPerView:2},968:{slidesPerView:0==i?e:3},1368:{slidesPerView:0==i?e:4}}:void 0,u=!!(C.isSetTimer&&r>C.columns[i])&&{delay:s===c?0:3e3,pauseOnMouseEnter:!0};new Swiper(t.parentNode,{loop:!0,speed:l,spaceBetween:n,slidesPerView:C.columns[i],autoplay:u,breakpoints:d,centerInsufficientSlides:![a,c].includes(s),on:{afterInit:()=>{if(0==i){const e=t.closest("#tt-carousel");if(C.isProPage)if("undefined"==typeof Review)e.classList.remove("pending");else{const t=t=>{t&&(e.style.maxWidth=getComputedStyle(t).width),e.classList.remove("pending")},s=M("#vstar-reviews,#noreviews-wrapper");!1===Review.hasReviews?t(null):s?t(s):document.addEventListener("onTrustooReviewsEmbed",(()=>{const e=M("#vstar-reviews,#noreviews-wrapper");t(e)}))}else e.classList.remove("pending")}else t.closest("#tt-carousel").classList.remove("pending")}}}),function(t,e){const s=t.closest("#tt-carousel"),i=t.swiper,r=Number(e)+1;if([a,o].includes(r)){const t=M(".tt-swiper-pre",s),e=M(".tt-swiper-next",s);t&&(t.onclick=function(){i.slidePrev()}),e&&(e.onclick=function(){i.slideNext()})}else if(2===r){const t=M("#tt-swiper-ring-wrapper"),e=t.children;3===e.length&&(e[0].onclick=()=>{i.slidePrev()},e[2].onclick=()=>{i.slideNext()},i.on("slideChangeTransitionEnd",(function(){const s=this.slides.length-1;M(".tt-swiper-ring.active",t).classList.remove("active");const i=(this.realIndex+this.params.slidesPerView-1)%this.slides.length;i===s?e[2].classList.add("active"):0===i?e[0].classList.add("active"):e[1].classList.add("active")})))}const n=M("#tt-reviews-num[data-total-reviews]",s);n&&(n.style.cssText="text-decoration: underline;cursor: pointer;",n.onclick=()=>{document.dispatchEvent(R)});i.on("click",(t=>{t.clickedSlide&&function(t,e,s){document.body.classList.add("trustoo-open");const i=t.querySelector(".tt-card").getAttribute("no");C.revDetailInfo.no=i,C.revDetailInfo.imageIndex=0,C.isSetTimer&&(w=e,e.autoplay.stop());TTRevDetail.showTTReviewDetail(C,"",C.reviewsLists[s][i],"trustoo_swiper_review")}(t.clickedSlide,i,e)}))}(t.parentNode,i)}!async function(){const t=[];C.settings.forEach((async(e,s)=>{t.push(P[s](e,s))})),t.length&&function(){document.addEventListener("onTrustooDetailClose",(function(){C.isSetTimer&&w&&w.params.autoplay.enabled&&(w.autoplay.start(),w=null)}));const t=M(".tt-review-detail-js");if(t)"undefined"!=typeof TTRevDetail?TTRevDetail.insertTTReviewDetail(C):t.onload=()=>{TTRevDetail.insertTTReviewDetail(C)};else{const t=document.createElement("script");let e="";e="https://cdn.vstar.app/static/js/tt-review-detail.js?",e+=C.constructTime,t.setAttribute("src",e),t.setAttribute("defer",!0),t.className="tt-review-detail-js",t.onload=()=>{TTRevDetail.insertTTReviewDetail(C)},document.head.appendChild(t)}}();(function(){const t=document.createElement("link");return t.rel="stylesheet",t.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",document.head.appendChild(t),new Promise((t=>{const e=document.createElement("script");e.setAttribute("defer",!0),e.src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",document.head.appendChild(e),e.onload=t}))})().then((()=>{let e=0;t.forEach(((t,s)=>t.then((()=>{if(e++,3===s)k(`.tt-carousel-row .tt-swiper-container[data-index="${s}"]`).forEach((t=>E(t)));else{const t=M(`.tt-swiper-container[data-index="${s}"]`);t&&E(t)}if(4===e){"undefined"!=typeof trustooAfterExecute&&trustooAfterExecute(C,void 0);const t=new CustomEvent("onTTCarouselEmbed",{detail:{v:C},bubbles:!0,cancelable:!0});document.dispatchEvent(t)}}))))}))}();const B=document.createElement("link");function D(t,e){let i="";const r={...l[t]},n={...r.params};if("undefined"!=typeof vstar_review_settings&&(1===vstar_review_settings.auto_switch_language?i=Shopify.locale?Shopify.locale:"":1===vstar_review_settings.is_translate_review&&(i=vstar_review_settings.language)),"getReviews"===t){n.t=(new Date).getTime(),n.limit=30,n.page=1,n.sort_by=C.sortType,n.scene=3,i&&(n.lang=i),Object.assign(n,e);const t=s&&s.dataset.productId;C.isProductReviews&&Number(t)&&(n.product_id=t,n.is_show_all=0),r.params=n}else"getLang"===t&&(i?r.params.lang=i:C.settings[0].card_lang&&(r.params.lang=C.settings[0].card_lang));return new Promise(((t,e)=>{Object.assign(r,{res:t,rej:e}),A(r)})).then((t=>{if(-1===(t=JSON.parse(t)).code)throw new Error(t.message);return[null,t=t.data]})).catch((t=>[{error:t}]))}B.rel="stylesheet",B.href="https://cdn.vstar.app/static/css/index.css",document.head.appendChild(B),C.arrangeCards=T}();const R=new CustomEvent("onTTshowReviewsClick",{detail:{v:C},bubbles:!0,cancelable:!0});function O(t,e="#000"){let s="";switch(t){case"verified":s=`\n\t\t\t\n\t\t\t`;break;case"star":s='\n\t\t\t\n\t\t\t\n\t\t\t';break;case"scrollBtn":s=`\n\t\t\t\n\t\t\t\n\t\t`;break;case"next":s=`\n\t\t\n\t\t\n\t\t`;break;case"comma":s=`\n\t\t\t\n\t\t\t`;break;case"noImage":s='';break;case"video":s='\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t'}return s}function B(t,e){const s=e.ratingIconSvg;let i="";s||(i=" pending");const r=`
${s}
`,n=`
${s}
`;parseInt(t)||(t=0);for(var a="",o=Math.floor(t),c=0;co){a+=`
${s}
${s}
`,o++}for(c=o;c<5;c++)a+=n;return a}function D(t,e){const s=t;return`\n#tt-carousel[data-type=${e}]{\n\t--card-bg-color: ${1==s.is_show_card?s.widget_layout_card_bg_color:"none"};\n\t--text-color:${s.widget_layout_text_color};\n\t--badge-color:${s.widget_layout_badge_color};\n\t--button-color:${s.scroll_buttons_icon_color};\n}\n${s.font?`#tt-carousel[data-type=${e}] *{font-family: ${s.font}}`:""}\n#tt-carousel[data-type=${e}] .vstar-star{\n --star-color:${s.widget_layout_star_color};\n --nostar-color:${s.widget_layout_disabled_star_color};\n}\n#trustoo-review-detail{\n\t--star-color:${s.widget_layout_star_color};\n--nostar-color:${s.widget_layout_disabled_star_color};\n}`}})(); //# sourceMappingURL=swiper-reviews.min.js.map