(()=>{"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:()=>A,gw:()=>E,DW:()=>D,qS:()=>O,r4:()=>B,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],o=E("#trustoo-barrage-carousel",t.is_home_active,t.is_product_active);if(!o)return;C.barrageSpeed=1e3*t.speed;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 c=await C.request("getReviews",a);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 _=l.length;let w=null,g=null;let h="first";_>(C.isMobile?5:10)?(w=l.filter(((t,e)=>e%2==0)),g=l.filter(((t,e)=>e%2!=0))):w=l,g?p=s(g,t,"second"):h="single",u=s(w,t,h);let f="";if(1===t.is_show_description){const e=`${d.total_reviews}`;f=`
${r.card_carousel.barrage.desc.replace("{{total_rating}}",d.rating).replace("{{total_reviews}}",e)}
`}o.insertAdjacentHTML("beforeend",`\n
\n
\n\t\t${1===t.is_show_title?`
${r.card_carousel.barrage.title}
`:""}\n\t\t${f}\n
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t${u}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t${p?`
`:""}\n\t\t\t\t\n
\n\t\t\t\n
\n
\n
\n `);const m=M('#tt-carousel[data-type="barrage"] #tt-carousel-list'),y=parseInt(getComputedStyle(m).width);C.isMobile?C.columns[e]=_<=2?1:2:_<5&&_>=3?C.columns[e]=_-1:_<3&&(C.columns[e]=_);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="",o="";if(i.resources.length){const t=e.show_photos_option;if(1===t){const t=i.resources[0];o=(2===t.resource_type?t.thumb_src:t.src)||i.product_image_src}else 2===t&&(o=i.product_image_src)}else o=i.product_image_src;let a="",c=r;"single"!==s&&(c=2*r,"second"===s&&(c+=1)),a=o?`
`:B("noImage"),n+=`\n\t\t\t\t${a}\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
${O(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=E("#trustoo-photo-carousel",t.is_home_active,t.is_product_active);if(!n)return;const o={has_resource:1};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 a=await C.request("getReviews",o);let c=null,l=null;if(a[0])return;if(0===a[1].list.length)return;c=a[1].list,l=a[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 o=2===n.resource_type?n.thumb_src:n.src,a=2===n.resource_type?B("video"):"",c=`\n\t\t

\n\t\t ${a}\n\t\t
`;u+=`\n\t\t\n
\n\t\t
\n\t\t${c}
\n\t\t
\n\t\t\t
${s.author}
${1===s.verified_badge?r:""}
\n\t\t
${s.content}
\n\t\t
\n `}));let _="";if(1===t.is_show_description){const e=`${l.total_reviews}`;_=`${i.card_carousel.photo.desc.replace("{{total_rating}}",l.rating).replace("{{total_reviews}}",e)}
`}n.insertAdjacentHTML("beforeend",`\n
\n
\n\t\t${1===t.is_show_title?`
${i.card_carousel.photo.title}
`:""}\n\t\t${_}\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n ${u}\n\t\t\t
\n
\n
\n\t\t\t${d>C.columns[e]?`
${B("scrollBtn",v)}
\n\t\t\t
${B("scrollBtn",v)}
`:""}\n
\n
\n
\n
\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=E("#trustoo-card-carousel-widget",t.is_home_active,t.is_product_active);if(!n)return;const o={};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 a=await C.request("getReviews",o);let c=null,l=null;if(a[0])return;if(0===a[1].list.length)return;c=a[1].list,l=a[1].total_rating,C.reviewsLists[e]=c;const d=c.length;d