"use strict";(async()=>{window.__ts__=window.__ts__||{};const e="https://storefront.trustshop.io",t="https://ts-media.syd1.cdn.digitaloceanspaces.com";window.__ts__={...window.__ts__,BASE_URL:e,BASE_MEDIA_URL:t,AI_SUMMARY_URL:"https://ts-review.trustshop.workers.dev/api",FALLBACK_THUMB:"https://asset.trustshop.io/fallback-video.png",loading:'
\n
\n
\n
',closeIcon:'\n \n ',uniqueID:{existingRatingId:new Set,generateUniqueId:e=>{let t;do{t=e+"-"+Math.random().toString(36).substr(2,9)}while(window.__ts__.uniqueID.existingRatingId.has(t));return window.__ts__.uniqueID.existingRatingId.add(t),t}},product_info:{},cartProduct:new Map([]),getProductLink(e){let t=window.shop_domain?`https://${window.shop_domain}`:`https://${window.Shopify.shop}`,o="/";if(window.Shopify?.routes?.root&&(o=window.Shopify.routes.root),e?.product_link)try{const i=new URL(e.product_link).pathname;return`${t}${o}${i?.replace("/","")}`}catch(i){try{return new URL(o+e?.product_link,t).toString()}catch(i){return t+o+e.product_link}}if(!e||!e.handle)return"#";try{return new URL(o+`products/${e.handle}`,t).toString()}catch(i){return`${t}${o}products/${e.handle}`}},el:(e,t=[],o="")=>{const i=document.createElement(e);return t&&i.classList.add(...t),o&&(i.innerHTML=o),i}},window.__ts__.corner={...window.__ts__?.corner??{},get elementRadius(){switch(window.__ts__?.globalSetting?.element_corners||"rounded"){case"rounded":return"8px";case"soft_corners":return"4px";case"curved":return"16px";default:return"0"}},get buttonRadius(){return`${window.__ts__?.globalSetting?.button_corner_radius??4}px`},get elementCssVariableName(){return"--trustshop-corner-element-radius"},get buttonCssVariableName(){return"--trustshop-corner-button-radius"},applyElementStyle(e){e.style.setProperty(this.elementCssVariableName,this.elementRadius)},applyButtonStyle(e){e.style.setProperty(this.buttonCssVariableName,this.buttonRadius)},applyStyle(e){window?.__ts__?.corner?.applyElementStyle(e),window?.__ts__?.corner?.applyButtonStyle(e)},get defineCSS(){return`${window?.__ts__?.corner?.elementCssVariableName}: ${window?.__ts__?.corner?.elementRadius}; ${window?.__ts__?.corner?.buttonCssVariableName}: ${window?.__ts__?.corner?.buttonRadius};`}};let o={small:"300",medium:"450",big:"600"};(()=>{const e=window.innerWidth;e>789||e<=789&&e>575||e<=575&&e>375?o={small:"300",medium:"450",big:"600"}:e<=375&&(o={small:"300",medium:"300",big:"450"})})(),window.__ts__.sendTrack=(e,t={})=>{if(window.amplitude)try{window.amplitude.track(e,{...t,group:"storefront"})}catch(e){console.error("amplitude event",e)}};const i=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;(()=>{if(!i())return;const e=document.querySelector("meta[name=viewport]");if(null!==e){let t=e.getAttribute("content"),o=/maximum\-scale=[0-9\.]+/g;t=o.test(t)?t.replace(o,"maximum-scale=1.0"):[t,"maximum-scale=1.0"].join(", "),e.setAttribute("content",t)}})();const n={ai_review_summary:!1,ai_review_tags:!1,write_a_review_button:!0,customer_profile_picture:!0,country:!0,verify_badge:!0,review_date:!0,button_helpful:!0,button_report:!0,no_review_border:!0,summary_star_icon:!0,summary_number_of_reviews:!0,summary_divider:!0,summary_text_1:!0,summary_text_2:!0,show_review_media:!0,image_galley_star_rating:!0,number_of_reviews:!0,media_size_on_galley:100,media_size_on_review:100,modal_all_medias:{filterList:{All:!0,Images:!0,Videos:!0,"5_star":!0,"4_star":!0,"3_star":!0,"2_star":!0,"1_star":!0},show_star_rating:!0,show_helpful_button:!0},detail:{show_review_media:!0,show_review_time:!0,show_purchase_items:!0,star_size:16},form_write_review:{show_product_info:!1,show_product_image:!0,show_add_photo_btn:!0,show_add_video_btn:!1,required_review_title:!1,star_size:32,review_ai_generation:!1,hide_review_title:!0,show_help_tooltip:!0,show_example:!0,show_option_name_selected:!0,show_option_name_display_format:{option_1:!0,option_2:!0,option_3:!0,option_4:!0},custom_style:{text_color:"#303030",text_style:{font_style:"normal",font_weight:"normal",text_decoration:"normal"}}},submitted_review_popup:{pending:{review_card:"default",headline_title_size:24,content_label_size:14,button_label_size:14},success:{review_card:"default",headline_title_size:24,content_label_size:14,button_label_size:14}}};window.__ts__.sectionShow=document.getElementById("trustshop-widget_box_section_show")&&document.getElementById("trustshop-widget_box_section_show").value?{...n,...JSON.parse(document.getElementById("trustshop-widget_box_section_show").value)}:n;const r={primary_color:"#3D4153",secondary_color:"#FFFFFF",title_text_color:"#3D4153",all_photos_button_color:"#005BD3",slide_button:"#FFFFFF",slide_arrow:"#4A4A4A",primary_text_color:"#3D4153",secondary_text_color:"#74788D",star_icon_color:"#FFB400",line_color:"#DEDFE6",filter_sort_background:"#F2F2F6",filter_sort_text:"#3D4153",rating_process_color:"#FFB400",rating_process_empty_color:"#E7E7E7",user_name_color:"#303030",load_more_color:"#3D4153",section_title_color:"#111111",page_no_review_star_color:"#FFB400",text_no_review_color:"#111111",call_to_action_color:"#3D4153",call_to_text_color:"#FFFFFF",border_color:"#CED6E2",bg_base_color:"#FFFFFF",bg_no_review_color:"#FFFFFF",reply_title_color:"#3D4153",reply_content_color:"#3D4153",reply_background_color:"#F6F6F6",modal_all_medias_headline_title:"#3D4153",modal_all_medias_close_button:"#FFFFFF",modal_all_medias_close_icon:"#000000",modal_all_medias_filter_label:"#3D4153",modal_all_medias_filter_background:"#f2f2f6",modal_all_medias_selected_filter_label:"#FFFFFF",modal_all_medias_selected_filter_background:"#3D4153",modal_all_medias_star_icon:"#FFFFFF",modal_all_medias_rating_background:"#000000",modal_all_medias_item_border:"#0C5132",modal_all_medias_navigate_button:"#FFFFFF",modal_all_medias_navigate_arrow:"#4A4A4A",modal_all_medias_review_media_background:"#1D1D1D",modal_all_medias_review_customer_name:"#303030",modal_all_medias_review_time:"#616161",modal_all_medias_review_star:"#FFB400",modal_all_medias_review_star_disable:"#D4D4D4",modal_all_medias_review_title:"#3d4153",modal_all_medias_review_content:"#3D4153",modal_all_medias_card_background:"#FFFFFF",modal_all_medias_review_background:"#F1F1F1",modal_detail_close_button:"#FFFFFF",modal_detail_close_icon:"#000000",modal_detail_customer_name:"#121212",modal_detail_review_time_title:"#74788D",modal_detail_review_star:"#FFB400",modal_detail_review_star_default:"#CCCCCC",modal_detail_review_star_field_background:"#F1F1F1",modal_detail_review_title:"#3D4153",modal_detail_review_content:"#303030",modal_detail_navigator_button:"#FFFFFF",modal_detail_navigator_arrow:"#303030",modal_detail_product_name:"#303030",modal_detail_product_price:"#303030",modal_detail_icon_title:"#74788D",modal_detail_selected_icon:"#1E4786",modal_detail_icon_background:"#F2F2F6",modal_detail_divider:"#F2F2F6",modal_detail_card_background:"#FFFFFF",modal_detail_preview_border:"#303030",modal_detail_add_to_cart_button:"#3D4153",modal_detail_add_to_cart_text:"#FFF",form_write_review_star_color:"#FFB400",form_write_review_star_empty_color:"#D4D4D4",modal_submitted_review_success_popup_background:"#FFFFFF",modal_submitted_review_success_popup_icon:"#28A52D",modal_submitted_review_success_popup_headline:"#3D4153",modal_submitted_review_success_popup_content:"#616161",modal_submitted_review_success_product_name:"#3D4153",modal_submitted_review_success_product_price:"#74788D",modal_submitted_review_success_customer_name:"#303030",modal_submitted_review_success_customer_email:"#616161",modal_submitted_review_success_review_card_background:"#FFFFFF",modal_submitted_review_success_review_card_title:"#3D4153",modal_submitted_review_success_review_card_content:"#3D4153",modal_submitted_review_success_review_card_border:"#DEDFE6",modal_submitted_review_success_star_active:"#FFB400",modal_submitted_review_success_star_disable:"#D4D4D4",modal_submitted_review_success_button_background:"#303030",modal_submitted_review_success_button_title:"#FFFFFF",modal_submitted_review_pending_popup_background:"#FFFFFF",modal_submitted_review_pending_popup_icon:"#FFB400",modal_submitted_review_pending_popup_headline:"#3D4153",modal_submitted_review_pending_popup_content:"#616161",modal_submitted_review_pending_product_name:"#3D4153",modal_submitted_review_pending_product_price:"#74788D",modal_submitted_review_pending_customer_name:"#303030",modal_submitted_review_pending_customer_email:"#616161",modal_submitted_review_pending_review_card_background:"#FFFFFF",modal_submitted_review_pending_review_card_title:"#3D4153",modal_submitted_review_pending_review_card_content:"#3D4153",modal_submitted_review_pending_review_card_border:"#DEDFE6",modal_submitted_review_pending_star_active:"#FFB400",modal_submitted_review_pending_star_disable:"#D4D4D4",modal_submitted_review_pending_button_background:"#303030",modal_submitted_review_pending_button_title:"#FFFFFF"};if(window.__ts__.globalSetting)return window.__ts__.globalSetting=window.__ts__.globalSetting,window.__ts__.globalSetting;const s={star_icon:{html:'',icon_number:1},button_corner_radius:4,element_corners:"rounded",review_name_format_selection:"customer",merchant_selection_format:"first_name_last_name",reviewer_avt_type:"single_color",single_color:"#FAD46E",avt_text_color:"#424242",gravatar_type:"identicon",review_date_format:"dd/mm/yyyy",currencySymbol:"",multi_lang:!1,show_translated:!1,verify_badge:{status:!1,icon:{icon_number:1,html:'\n \n \n ',color:"#29845A"},tooltip_text:"Verified buyer",display:{icon_only:!1,icon_tooltip:!0,icon_text:!1,text_color:"#111111"}}};let a=s;if(!document.getElementById("trustshop-global-display__setting")||!document.getElementById("trustshop-global-display__setting").value)return;let l=document.getElementById("trustshop-global-display__setting")&&document.getElementById("trustshop-global-display__setting").value,d=l?{...s,...JSON.parse(document.getElementById("trustshop-global-display__setting").value),star_icon:s.star_icon,verify_badge:s.verify_badge}:s;if(l&&""!==JSON.parse(document.getElementById("trustshop-global-display__setting").value).star_icon.trim()){const e=(new TextDecoder).decode(Uint8Array.from(atob(JSON.parse(document.getElementById("trustshop-global-display__setting").value).star_icon.trim()),(e=>e.charCodeAt(0))));d={...d,star_icon:JSON.parse(e)}}if(l&&""!==JSON.parse(document.getElementById("trustshop-global-display__setting").value).verify_badge.trim()){const e=(new TextDecoder).decode(Uint8Array.from(atob(JSON.parse(document.getElementById("trustshop-global-display__setting").value).verify_badge.trim()),(e=>e.charCodeAt(0))));d={...d,verify_badge:JSON.parse(e)}}a=d,window.__ts__.globalSetting=a,window.__ts__.globalSetting=window.__ts__.globalSetting,window.__ts__.starHtml=d.star_icon.html||s.star_icon.html;let _=document.getElementById("trustshop-css-variable");_||(_=document.createElement("style"),_.id="trustshop-css-variable",_.innerHTML+=`:root {${window?.__ts__?.corner?.defineCSS}}`,document.head.appendChild(_)),window.__ts__.complexRatingIcon=(e,t,o="#FFB400",i="#D2D2D2",n)=>{const r=window.__ts__.uniqueID.generateUniqueId("complex-rating"),s=`mask-${r}`,a=`gradient-${r}`;let l=e.querySelector("defs");l||(l=e.createElementNS("http://www.w3.org/2000/svg","defs"),e.documentElement.appendChild(l));const d=e.createElementNS("http://www.w3.org/2000/svg","linearGradient");d.id=a,d.setAttribute("x1","0%"),d.setAttribute("y1","0%"),d.setAttribute("x2","100%"),d.setAttribute("y2","0%");const _=e.createElementNS("http://www.w3.org/2000/svg","stop");_.setAttribute("offset",t/100),_.setAttribute("stop-color",o);const c=e.createElementNS("http://www.w3.org/2000/svg","stop");c.setAttribute("offset",t/100),c.setAttribute("stop-color",i),d.appendChild(_),d.appendChild(c);const u=e.createElementNS("http://www.w3.org/2000/svg","mask");u.id=s,u.setAttribute("maskUnits","userSpaceOnUse");const p=e.createElementNS("http://www.w3.org/2000/svg","g");p.setAttribute("fill","white");e.querySelectorAll("path").forEach((e=>{const t=e.cloneNode(!0);t.setAttribute("fill","white"),p.appendChild(t)})),u.appendChild(p),l.appendChild(d),l.appendChild(u);const m=e.createElementNS("http://www.w3.org/2000/svg","rect");return m.setAttribute("x",n.x||0),m.setAttribute("y",n.y||0),m.setAttribute("width",n.width||24),m.setAttribute("height",n.height||20),m.setAttribute("fill",`url(#${a})`),m.setAttribute("mask",`url(#${s})`),e.documentElement.appendChild(m),e},window.__ts__.ratingStar=(e,t="#FFB400",o="#D2D2D2",i,n="5_star")=>{const r=document.createElement("span");r.classList.add("trustshop","trustshop-rating-star--container");const s=new DOMParser;let a=s.parseFromString(window.__ts__.starHtml,"image/svg+xml"),l=null;const d=new XMLSerializer;if("1_star"===n){const i=e/5*100;if(a.querySelectorAll("path").length>1){if(!l){const e=a.documentElement?.cloneNode(!0);e.style.position="absolute",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.left="-9999px",document.body.appendChild(e),l=e.getBBox(),document.body.removeChild(e)}a=window.__ts__.complexRatingIcon(a,i,t,o,l)}else{const i=(e/5).toFixed(2),n=window.__ts__.uniqueID.generateUniqueId("rating"),r=a.querySelector("defs");if(r)r.innerHTML=`\n \n \n `;else{const e=a.createElementNS("http://www.w3.org/2000/svg","defs");e.innerHTML=`\n \n \n `,a.documentElement.appendChild(e)}a.querySelectorAll("path").forEach((e=>{e.setAttribute("fill",`url(#${n})`)}))}r.insertAdjacentHTML("beforeend",d.serializeToString(a))}else{const i=Math.trunc(e),n=a.querySelectorAll("path");[1,2,3,4,5].map(((_,c)=>{let u=s.parseFromString(window.__ts__.starHtml,"image/svg+xml");if(n.length>1){if(!l){const e=a.documentElement.cloneNode(!0);e.style.position="absolute",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.left="-9999px",document.body.appendChild(e),l=e.getBBox(),document.body.removeChild(e)}if(_<=i)u=window.__ts__.complexRatingIcon(u,100,t,o,l);else if(_===i+1){const n=100*(e-i);u=window.__ts__.complexRatingIcon(u,n,t,o,l)}else u=window.__ts__.complexRatingIcon(u,0,t,o,l)}else{const n=window.__ts__.uniqueID.generateUniqueId("rating"),r=u.querySelector("defs");if(_<=i){if(r)r.innerHTML=`\n \n \n `;else{const e=u.createElementNS("http://www.w3.org/2000/svg","defs");e.innerHTML=`\n \n \n `,u.documentElement.appendChild(e)}u.querySelectorAll("path").forEach((e=>{e.setAttribute("fill",`url(#${n})`)}))}else if(_===i+1){if(r)r.innerHTML=`\n \n \n `;else{const r=u.createElementNS("http://www.w3.org/2000/svg","defs");r.innerHTML=`\n \n \n `,u.documentElement.appendChild(r)}u.querySelectorAll("path").forEach((e=>{e.setAttribute("fill",`url(#${n})`)}))}else{if(r)r.innerHTML=`\n \n \n `;else{const e=u.createElementNS("http://www.w3.org/2000/svg","defs");e.innerHTML=`\n \n \n `,u.documentElement.appendChild(e)}u.querySelectorAll("path").forEach((e=>{e.setAttribute("fill",`url(#${n})`)}))}}r.insertAdjacentHTML("beforeend",d.serializeToString(u))}))}return i&&r.insertAdjacentHTML("beforeend",`${e?Number(e).toFixed(1):0}`),r},window.__ts__.ratingStarV2=(e,t="#FFB400",o="#D2D2D2",i,n="5_star",r={})=>{const s=Math.max(0,Math.min(5,Number(e)||0)),a=Math.round(s%1*100),l=Math.floor(e),d=e%1!=0,{size:_}=Object.assign(r,{size:16}),c=document.createElement("span");c.classList.add("trustshop","trustshop-rating-star-v2--container");const u=window.__ts__.parseSVGForStarRating(window.__ts__.starHtml),p=(e=!1,i)=>{let n="rating-icon",r=`style="width: ${_}px; height: ${_}px; --fill-color: ${t}; --empty-color: ${o};"`,s=u;return e?n+=i?" filled":" empty":i${u}`):n+=" empty",`${s}`};if("1_star"===n)c.insertAdjacentHTML("beforeend",p(!0,s));else for(let e=0;e<5;e++)c.insertAdjacentHTML("beforeend",p(!1,e));return i&&c.insertAdjacentHTML("beforeend",`${e?Number(e).toFixed(1):0}`),c},window.__ts__.parseSVGForFilling=(e,t={})=>{const{removeIndividualFills:o=!0,setCurrentColor:i=!0,preserveNone:n=!0,preserveTransparent:r=!0,removeSize:s=!1,newViewBox:a=null,newSize:l=null}=t,d=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg");if(!d)throw new Error("Invalid SVG string provided");if(s&&(d.removeAttribute("width"),d.removeAttribute("height")),l&&(l.width&&d.setAttribute("width",l.width),l.height&&d.setAttribute("height",l.height)),a&&d.setAttribute("viewBox",a),o||i){d.querySelectorAll("[fill]").forEach((e=>{const t=e.getAttribute("fill");n&&"none"===t||r&&"transparent"===t||o&&e.removeAttribute("fill")})),i&&d.setAttribute("fill","currentColor")}return(new XMLSerializer).serializeToString(d)},window.__ts__.parseSVGForStarRating=(e,t={})=>window.__ts__.parseSVGForFilling(e,{removeIndividualFills:!0,setCurrentColor:!0,preserveNone:!0,preserveTransparent:!0,removeSize:!0,...t}),window.__ts__.videoOverlay=(e="44px",t="44px")=>{const o=document.createElement("div");return o.classList.add("trustshop-video--overlay"),o.style.width=e,o.style.height=t,o.innerHTML='\n \n \n ',o},window.__ts__.imageRatingOverlay=e=>{const t=document.createElement("div");return t.classList.add("trustshop-rating--overlay"),t.innerHTML=`${window.__ts__.starHtml} ${e}`,t},window.__ts__.closeModalBtn=(e,t="#FFFFFF",o="#000000")=>{const i=document.createElement("button");return i.classList.add("trustshop-button","trustshop-close-modal--btn"),i.style.backgroundColor=t,i.innerHTML=`\n \n `,i.addEventListener("click",(t=>{t.preventDefault(),e()})),i},window.__ts__.formatDate=(e="dd/mm/yyyy",t)=>{const o=new Date(t),i=e=>e<10?`0${e}`:e,n=o.getFullYear(),r=i(o.getMonth()+1),s=i(o.getDate()),a=n.toString().slice(-2);return{"yyyy-mm-dd":`${n}-${r}-${s}`,"mm/dd/yyyy":`${r}/${s}/${n}`,"dd/mm/yyyy":`${s}/${r}/${n}`,"dd/mm/yy":`${s}/${r}/${a}`,"yyyy/mm/dd":`${n}/${r}/${s}`,"mmmm dd, yyyy":`${["January","February","March","April","May","June","July","August","September","October","November","December"][o.getMonth()]} ${s}, ${n}`,"mmm dd, yyyy":`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()]} ${s}, ${n}`}[e]},window.__ts__.handleImageUrl=(e,i)=>{const n=i?"/"+o[i]:"/public";return e.includes("http")?e.includes("/public")?e.split("/public").join(n):e.includes("imagedelivery")?e+n:e:t+"/"+e.split("/").slice(0,-1).join("/")+"/small-"+e.split("/").pop()},window.__ts__.fetchApi=async(e,t,o)=>{try{const i={method:t,headers:{"Content-Type":"application/json"}};"GET"!==t&&o&&(i.body=JSON.stringify(o));const n=await fetch(e,i);if(!n.ok)return console.error(`API Error: ${n.status} ${n.statusText} at ${e}`),null;const r=n.headers.get("content-type");return r&&r.includes("application/json")?await n.json():(console.error("API Error: Response is not JSON"),null)}catch(t){return console.error("Fetch API Error:",t,"URL:",e),null}},window.__ts__.colorVariable=(e,t,o,i)=>{const n=new Set;let r=document.getElementById("trustshop-css-variable");r||(r=document.createElement("style"),r.id="trustshop-css-variable",document.head.appendChild(r));let s=r.innerHTML,a=s.match(/:root\s*\{[^}]*\}/),l=a?a[0].replace(":root {","").replace("}","").trim():"";l.split(";").forEach((e=>{const[t]=e.split(":").map((e=>e.trim()));t.startsWith("--")&&n.add(t)}));let d=l?l+"\n":"";Object.entries(e).forEach((([r,s])=>{const a=`--trustshop-${o?o+"-":""}${r.replaceAll("_","-")}${i?"-"+i:""}`;n.has(a)||(d+=`${a}: ${t[r]&&""!==t[r]?t[r]:e[r]};\n`,n.add(a))})),a?r.innerHTML=s.replace(a[0],`:root {${d}}`):r.innerHTML+=`:root {${d}}\n`},window.__ts__.generateAvt=(e,t)=>{const o=window.__ts__.globalSetting.reviewer_avt_type,i=window.__ts__.globalSetting.single_color||"#FAD46E",n=window.__ts__.globalSetting.gravatar_type||"robohash",r=document.createElement("div");if(r.classList.add("trustshop","trustshop-author--avt"),"gravatar"===o){r.style.backgroundColor="#bec1c5";const e=`https://www.gravatar.com/avatar/${t}?d=${n}&size=35`;r.innerHTML=`avatar`}else{const t=e.split(/\s/),n=(t[0]?t[0].slice(0,1):"")+(t[1]?t[1].slice(0,1):"");if(r.innerHTML=`

${n.toUpperCase()}

`,"colorful"===o){const e=["1abc9c","16a085","c0392b","9b59b6","8e44ad","bdc3c7","34495e","95a5a6","f1c40f","f39c12","2ecc71","27ae60","d35400","3498db","2980b9","e74c3c","ec87bf","d870ad","f69785","9ba37e","b49255","a94136"];var s=e[Math.floor(Math.random()*e.length)];r.style.backgroundColor=`#${s}`}else r.style.backgroundColor=`${i||"#FAD46E"}`}return r.outerHTML},window.__ts__.verifiedBuyerBadge=e=>{const t=a.verify_badge,o=t?.display||s.verify_badge.display,i=t?.icon?.html.replaceAll("#3D4153",t?.icon?.color).replaceAll("white",e),n=document.createElement("div");if(n.classList.add("verify-badge--wrap"),o.icon_only)n.innerHTML=`
${i}
`;else if(o?.icon_text)n.innerHTML=`
${i}
${t?.tooltip_text}`;else if(o?.icon_tooltip){n.innerHTML=`
${i}
`;let e=document.getElementById("trustshop-verify-tooltip--container"),r=document.getElementById("trustshop-verify--tooltip");e||(e=document.createElement("div"),e.id="trustshop-verify-tooltip--container",r=document.createElement("div"),r.classList.add("trustshop--tooltip","verify-badge--tooltip"),r.id="trustshop-verify--tooltip",r.style.color=o.text_color,r.innerHTML=`\n ${t?.tooltip_text}`,e.appendChild(r),document.body.appendChild(e));const s=()=>{const e=n.getBoundingClientRect(),t=e.bottom,o=e.left+e.width/2;r.style.left=`${o}px`,r.style.top=`${t+8}px`,r.style.display="block"};n.addEventListener("mouseenter",(t=>{s(),e.style.display="block",window.addEventListener("scroll",s)})),n.addEventListener("mouseleave",(t=>{e.style.display="none",window.removeEventListener("scroll",s)}))}return n},window.__ts__.customerAuthor=(e,t,o,i,n,r,s,l="#FFFFFF",d)=>{d="merchant"===window.__ts__.globalSetting?.review_name_format_selection?"anonymous"===window.__ts__.globalSetting?.merchant_selection_format:d;const _=document.createElement("div");_.classList.add("trustshop-review--author"),s&&_.classList.add("has--wrap");let c=t||window.__ts__.label_content?.product_reviews?.anonymous||"Anonymous";d&&(c=window.__ts__.label_content?.product_reviews?.anonymous||"Anonymous"),_.innerHTML=`${e?window.__ts__.generateAvt(t,n):""}`;const u=document.createElement("div");return u.classList.add("trustshop-review--author_name"),u.innerHTML=`

${c}

`,a.verify_badge?.status&&r&&u.appendChild(window.__ts__.verifiedBuyerBadge(l)),o&&u.insertAdjacentHTML("beforeend",""+(i?`\n \n `:"")),_.appendChild(u),_},window.__ts__.productInfo=(e,t,o)=>{const i=document.createElement("a");return i.classList.add("trustshop-carousel-card--product-info"),i.href=window.__ts__.getProductLink({product_link:o}),i.target="_blank",i.addEventListener("click",(e=>{e.stopPropagation()})),i.innerHTML=`\n ${t}\n \n `,i};let c=!1;const u=()=>{c=!0,window.__ts__.colorSetting=document.getElementById("trustshop-widget_box_color_customize")&&document.getElementById("trustshop-widget_box_color_customize").value?{...r,...JSON.parse(document.getElementById("trustshop-widget_box_color_customize").value)}:r,window.__ts__.colorVariable(r,window.__ts__.colorSetting)};(async()=>{try{const e=await fetch("https://ipinfo.io/json"),t=await e.json();window.__ts__.userCountryCode=t.country?.toLocaleLowerCase()}catch(e){console.error("Error fetching country code:",e),window.__ts__.userCountryCode="gb"}})();(async()=>{const t="trustshop-user-language-code",o=window.localStorage?.getItem(t);if(o)window.__ts__.userLanguageCode=decodeURIComponent(o);else try{const o=await fetch(`${e}/current-language`),i=await o.json();if("string"!=typeof i||!i)return void(window.__ts__.userLanguageCode="en");window.__ts__.userLanguageCode=i,window.localStorage.setItem(t,encodeURIComponent(i))}catch(e){console.error("Error fetching country code:",e),window.__ts__.userLanguageCode="en"}})(),window.__ts__.fetchTranslation=async(t,o,i,n)=>{try{const[r,s]=await Promise.all([fetch(`${e}/translated`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,source_lang:i,target_lang:n}),method:"POST"}).then((e=>e.json())),fetch(`${e}/translated`,{headers:{"Content-Type":"application/json"},body:JSON.stringify({text:o.replaceAll(/\n/g,"
"),source_lang:i,target_lang:n}),method:"POST"}).then((e=>e.json()))]);return{title:r.error?t:r,content:s.error?o:s}}catch(e){return console.error("Error fetching data:",e),{title:null,content:null}}},window.__ts__.handleTranslate=async(e,t,o,i,n)=>{if(JSON.parse(e.getAttribute("translate"))){const o=e.getAttribute("data-origin-review--title"),r=e.getAttribute("data-origin-review--content");e.querySelector(`#review-title--${t}`).innerHTML=o,e.querySelector(`#review-content--${t}`).innerHTML=r,e.setAttribute("translate","false"),i.innerHTML=window.__ts__.label_content[n].see_translation}else{const r=e.getAttribute("translation--title"),s=e.getAttribute("translation--content");if(r||s)e.querySelector(`#review-title--${t}`).innerHTML=r,e.querySelector(`#review-content--${t}`).innerHTML=s;else{i.classList.add("translating");let n=await window.__ts__.fetchTranslation(o.title,o.content,o.language_code?o.language_code?.toLocaleLowerCase():"en",window.__ts__.userLanguageCode);i.classList.remove("translating"),e.setAttribute("translation--title",n.title),e.setAttribute("translation--content",n.content),e.setAttribute("data-origin-review--title",o.title),e.setAttribute("data-origin-review--content",o.content),e.querySelector(`#review-title--${t}`).innerHTML=n.title,e.querySelector(`#review-content--${t}`).innerHTML=n.content}e.setAttribute("translate","true"),i.innerHTML=window.__ts__.label_content[n].show_original}},window.__ts__.translateReviewBtn=(e,t,o,i,n)=>{const r=document.createElement("span");return r.classList.add("trustshop-translate-review--btn"),r.innerHTML=window.__ts__.label_content[n].see_translation,r.addEventListener("click",(async()=>{await window.__ts__.handleTranslate(e,t,o,r,n),i&&i()})),r},window.__ts__.popover=(e,t,o,i)=>{const n=()=>{const e=o.getBoundingClientRect(),t=e.top,n=e.bottom,r=e.left,s=window.innerHeight;i.style.left=r+"px",s-n<200?(i.style.bottom=s-t+"px",i.style.top="unset"):(i.style.top=n+"px",i.style.bottom="unset")};if(e){document.addEventListener("scroll",n),window.addEventListener("resize",n);const e=o.getBoundingClientRect(),r=e.top,s=e.bottom,a=e.left,l=window.innerHeight;i.style.width=e.width+"px",i.style.left=a+"px",l-s<200?(i.style.bottom=l-r+"px",i.style.top="unset"):(i.style.top=s+"px",i.style.bottom="unset"),t.classList.add("show")}else t.classList.remove("show"),document.removeEventListener("scroll",n),window.removeEventListener("resize",n)},window.__ts__.createCheckBoxInput=(e,t=void 0,o=1)=>{const i=window.__ts__.uniqueID.generateUniqueId("trustshop-checkbox-svg"),n=document.createElement("div");n.className="trustshop-checkbox";const r=document.createElement("span");r.className="checkbox";const s=document.createElement("input");s.type="checkbox",s.name=e,s.id=e,t?.(s);const a=document.createElementNS("http://www.w3.org/2000/svg","svg"),l=document.createElementNS("http://www.w3.org/2000/svg","use");l.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${i}`),l.classList.add("checkbox"),a.appendChild(l),r.append(s,a);const d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("xmlns","http://www.w3.org/2000/svg"),d.style.display="none";const _=document.createElementNS("http://www.w3.org/2000/svg","symbol");_.id=i,_.setAttribute("viewBox","0 0 22 22");const c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("fill","none"),c.setAttribute("stroke","currentColor"),c.setAttribute("d","M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"),_.appendChild(c),d.appendChild(_),n.append(r,d),n},window.__ts__.sentry={captureException:e=>Sentry&&"function"==typeof Sentry.captureException?Sentry.captureException(e):window.Sentry&&"function"==typeof window.Sentry.captureException?window.Sentry.captureException(e):void console.error("Sentry is not initialized or captureException is not a function."),testTriggerError:()=>{throw new Error("This is a test error for Sentry.")},testTriggerException:()=>{functionThatDoesNotExist()},testCaptureException:()=>{try{functionThatDoesNotExistWithCapture()}catch(e){window.__ts__.sentry.captureException(e)}}};const p={product_reviews:{text_customer_reviews:"Customer Reviews",text_reviews:"Reviews",text_review:"Review",text_based_on:"Based on",text_out_of:"out of",text_review_this_product:"Review this product",text_share_your_thoughts:"Share your thoughts with other customers",btn_write_a_review:"Write a review",all_photos:"All photos",text_images_from_reviews:"Images from reviews",label_filter_all:"All",label_filter_all_ratings:"All ratings",label_filter_most_helpful:"Most helpful",label_filter_highest_rating:"Highest rating",label_filter_lowest_rating:"Lowest rating",label_filter_oldest:"Oldest",label_filter_newest:"Newest",label_filter_media_first:"Photo/Video first",label_filter_review_with_videos:"Review with videos",label_filter_review_with_photos:"Review with photos",text_review_on:"Reviewed on",text_people_found_helpful:"people found this helpful",text_helpful:"Helpful",text_report:"Report",text_reply_from:"Reply from",anonymous:"Anonymous",name_display_tooltip:"If you choose anonymous, your name will be hidden from everyone",name_preview_help_text:"Your name will appear as",btn_load_more_review:"Load more reviews",no_review_text_no_review:"No reviews yet. Any feedback? Let us know",no_review_btn_write_first_review:"Write review",modal_write_title:"Ratings and Reviews",modal_write_text_reviews:"Reviews",modal_review_text_click_to_rate:"Click to rate",modal_review_add_photo_or_video:"Add photo or video",name_display_format:"Name display",option_name_display_format_1:"John Smith",option_name_display_format_2:"John S.",option_name_display_format_3:"J.S.",option_name_display_format_4:"Anonymous",modal_review_label_customer_name:"Your Name",modal_review_placeholder_customer_name:"Type your name here",modal_review_label_customer_email:"Your Email",modal_review_placeholder_customer_email:"Your email is private and is used to send you discount vouchers",modal_review_label_review_title:"Review Title",modal_review_placeholder_review_title:"Example: Easy to use",modal_review_label_review_content:"Write your review",modal_review_placeholder_review_content:"Tell other customers what you think about this product",modal_review_label_characters_remaining:"characters remaining",modal_review_label_review_media:"Upload media",modal_review_placeholder_click_here:"click here",modal_review_placeholder_upload_photo:"Click to upload photo or drag and drop",modal_review_placeholder_upload_video:"Click to upload video or drag and drop",modal_review_placeholder_upload_media:"Click to upload or drag and drop",modal_review_btn_back:"Back",modal_review_btn_submit_review:"Submit Review",modal_pending_review_title:"Pending Review",modal_pending_review_subtitle:"Your review has been sent successfully and will be reviewed to ensure it meets our guidelines and standards. Please allow us some time to thoroughly assess your review.",modal_pending_review_button:"Continue shopping",modal_success_review_title:"Review submitted successfully!",modal_success_review_subtitle:"Thank you for spending time sharing your experience and leaving feedback, it will be very beneficial for other customers.",modal_success_review_button:"Continue shopping",modal_report_title:"Report this review",modal_report_subtitle:"Thank you for taking the time to help {{ shopname }}.Your report is anonymous.",modal_report_option_1:"Review contains private information.",modal_report_option_2:"Review contains objectionable language.",modal_report_option_3:"Review contains advertising or spam.",modal_report_option_4:"Review contains violent and disgusting content.",modal_report_option_5:"Other violations.",modal_report_btn:"Report this review",modal_view_image_text_all_media:"All photos",text_medias_gallery:"Reviews gallery",text_all:"All",text_image:"Images",text_video:"Videos",no_media:"No medias uploaded yet!",no_image:"No images uploaded yet!",no_video:"No videos uploaded yet!",purchased_item:"Purchased item",view_product:"View product",required_input:"*Please fill out this field",required_email:"*Please enter a valid email address!",media_rule_size:"*Media size must be smaller than 50MB",photo_rule_size:"*Photo size must be smaller than 10MB",video_rule_size:"*Video size must be smaller than 50MB",media_rule_type:"*Image type must be .bmp, .jpeg or .png. Video type must be .mp4, .mov",media_upload_fail:"*Unable to upload the image. Please try again later",media_upload_duplicate:"*You have already uploaded this image",modal_review_btn_add_photo_subtitle:"Max file size: 10MB",modal_review_btn_add_video_subtitle:"Max file size: 50MB",modal_image_review_for:"Review for",modal_image_from_this_review:"Image from this review",see_translation:"See translation",show_original:"Show original",sort_by:"Sort by",max_file_size:"Max file size: 50MB",modal_confirm_discard_review_title:"Are you sure you want to discard this review?",modal_confirm_discard_review_content:"All content in this review form will be lost. This action cannot be undone. Do you want to proceed?",modal_confirm_discard_review_cancel_btn:"Cancel",modal_confirm_discard_review_discard_btn:"Discard",name_override_notice:"Your name will be hidden by the “{{name_display}}” setting.",modal_name_override_notice:"Your name will be hidden by the “{{name_display}}” setting.",modal_view_media_add_to_cart:"Add to cart",modal_view_media_atc_unavailable:"Unavailable",modal_view_media_atc_choose_options:"Choose options",modal_view_media_atc_toast_success:"Added to cart",modal_view_media_atc_toast_failure:"Can't add to cart",modal_view_media_atc_toast_sold_out:"Out of stock",modal_view_media_atc_toast_unavailable:"Item unavailable"},onepage_reviews:{header_title:"Ours customers love us",header_subtitle:"See what the community is saying about us",text_customer_reviews:"Customer Reviews",text_reviews:"Reviews",text_review:"Review",text_based_on:"Based on",text_out_of:"out of",text_review_this_product:"Review this product",text_share_your_thoughts:"Share your thoughts with other customers",btn_write_a_review:"Write a review",text_images_from_reviews:"Images from reviews",all_photos:"All photos",label_filter_all:"All",label_filter_most_helpful:"Most helpful",label_filter_highest_rating:"Highest rating",label_filter_lowest_rating:"Lowest rating",label_filter_oldest:"Oldest",label_filter_newest:"Newest",label_filter_media_first:"Photo/Video first",label_filter_review_with_videos:"Review with videos",label_filter_review_with_photos:"Review with photos",label_filter_stars_filter:"Star filter(1-5)",label_filter_all_ratings:"All ratings",text_review_on:"Review on",text_people_found_helpful:"people found this helpful",text_helpful:"Helpful",text_report:"Report",text_reply_from:"Reply from",anonymous:"Anonymous",btn_load_more_review:"Load more reviews",modal_view_image_text_all_media:"All photos",modal_all_media_title:"Reviews gallery",text_all:"All",text_image:"Images",text_video:"Videos",no_media:"No medias uploaded yet!",no_image:"No images uploaded yet!",no_video:"No videos uploaded yet!",purchased_item:"Purchased item",view_product:"View product",modal_report_title:"Report this review",modal_report_subtitle:"Thank you for taking the time to help {{ shopname }}.Your report is anonymous.",modal_report_option_1:"Review contains private information.",modal_report_option_2:"Review contains objectionable language.",modal_report_option_3:"Review contains advertising or spam.",modal_report_option_4:"Review contains violent and disgusting content.",modal_report_option_5:"Other violations.",modal_report_btn:"Report this review",modal_image_review_for:"Review for",modal_image_from_this_review:"Image from this review",modal_view_media_add_to_cart:"Add to cart",modal_view_media_atc_unavailable:"Unavailable",modal_view_media_atc_choose_options:"Choose options",modal_view_media_atc_toast_success:"Added to cart",modal_view_media_atc_toast_failure:"Can't add to cart",modal_view_media_atc_toast_sold_out:"Out of stock",modal_view_media_atc_toast_unavailable:"Item unavailable",see_translation:"See translation",show_original:"show original",text_medias_gallery:"Medias gallery",sort_by:"Sort by"},testimonial:{header_title:"Our customer loves us",header_subtitle:"Real feedback from our valued customers"},carousel:{header_title:"Feedback from our clients",header_subtitle:"See what the community is saying about us"},product_rating:{rating:"review",ratings:"reviews"}};window.__ts__.addToCart=async function(e,t,o,i=(()=>{})){this.review=t,this.cart=null,this.product=null,this.toastId=`trustshop-toast-${"function"==typeof crypto?.randomUUID?crypto.randomUUID():Math.random()}`,this.toastTimeout=null,this.labelElement=e.querySelector(".add-to-cart__label"),this.variantOptions=new Map([]);const n=e=>o?.[e]||p[e];return this.getButtonStyle=function(){return`\n --bg-color: ${window.__ts__.colorSetting.modal_detail_add_to_cart_button||r.modal_detail_add_to_cart_button};\n --text-color: ${window.__ts__.colorSetting.modal_detail_add_to_cart_text||r.modal_detail_add_to_cart_text};\n `},this.toast=(t,o="success")=>{const i={success:'',error:''};if(!e)return;if(!e.querySelector(`#${this.toastId}`)){let t=document.createElement("div");t.id=this.toastId,t.className="trustshop-modal-media__add-to-cart--toast",e?.appendChild(t)}const n=e.querySelector(`#${this.toastId}`);n&&(n.innerHTML=`
\n
${i[o]}
\n
${t}
\n
`,n.classList.add("show"),this.toastTimeout=setTimeout((()=>{n.classList.remove("show")}),2e3))},this.variantChooseDropdown=function(){if(!this.product||!this.product.variants)return null;const t=(e=new Map([]))=>this.product.variants.filter((t=>{let o=!0;return e?.forEach(((e,i)=>{o&&(o=t.options?.[i-1]===e)})),o})),o=()=>{r.querySelectorAll(".atc--select-field").forEach((e=>{const o=e.id,i=parseInt(o.replace("trustshop-act-variant-option--","")),n=this.variantOptions.get(i),r=e.querySelectorAll(".atc--select-option"),s=[];for(const e of r){const o=e?.dataset?.value;if(!o)continue;const r=t(new Map([...this.variantOptions,[i,o]])),a=r?.length&&r?.some((e=>e.available));(1!==i?!a:!(t(new Map([[i,n]]))?.some((e=>e.available))&&a))&&s.push(o)}e.dispatchEvent(new CustomEvent("disabled",{detail:{values:s}}))}))},r=document.createElement("div");r.classList.add("trustshop-modal-media--variant-choose-dropdown");for(const e of this.product?.options){const t=document.createElement("div");t.classList.add("trustshop-modal-media--variant-choose-field");const i=`trustshop-act-variant-option--${e.position}`,s=document.createElement("label");s.innerHTML=e.name,s.setAttribute("for",i),t.appendChild(s);const a=this.selectField(i,this.variantOptions.get(e.position),e.values?.map((e=>({label:e,value:e}))),(t=>{this.variantOptions.set(e.position,t);const i=this.findVariantId(),s=this.product.variants.find((e=>e.id===i)),a=r.querySelector(".trustshop-modal-media--variant-choose-submit"),l=a?.querySelector(".label");i&&s?.available?(a?.removeAttribute("disabled"),l&&(l.innerText=n("modal_view_media_add_to_cart"))):(a?.setAttribute("disabled","true"),l&&(l.innerText=n("modal_view_media_atc_unavailable"))),o()}));r.addEventListener("click",(e=>{a.dispatchEvent(new CustomEvent("hidden"))})),t.appendChild(a),r.appendChild(t)}const s=this.product.variants?.find((e=>e.available));s&&(this.variantOptions.clear(),s?.options?.forEach(((e,t)=>{this.triggerSelectField(`trustshop-act-variant-option--${t+1}`,e,r)}))),o();const a=document.createElement("button");a.type="button",a.classList.add("trustshop-modal-media__add-to-cart","trustshop-modal-media--variant-choose-submit"),a.style=this.getButtonStyle(),a.innerHTML=`\n \n ${n("modal_view_media_add_to_cart")}`,a.addEventListener("click",(async e=>{e.stopPropagation(),e.preventDefault(),a.setAttribute("disabled","true");const{disabled:t}=await this.handleAddToCart(e);this.closeVariantChooseDropdown(),t||a.removeAttribute("disabled"),i?.()})),r.appendChild(a),r.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),document?.getElementById("trustshop-view-detail--container")?.addEventListener("click",(e=>{this.closeVariantChooseDropdown()})),e.appendChild(r)},this.toggleVariantChooseDropdown=function(){e.querySelector(".trustshop-modal-media--variant-choose-dropdown").classList.toggle("show")},this.closeVariantChooseDropdown=function(){const t=e.querySelector(".trustshop-modal-media--variant-choose-dropdown");t?.classList?.remove("show")},this.selectField=function(e,t,o,i){const n=document.createElement("div");n.classList.add("atc--select-field"),n.id=e;const r=o.find((e=>e.value===t)),s=document.createElement("div");s.classList.add("atc--select-label"),s.innerText=r?r.label:"Select an option";const a=document.createElement("div");a.classList.add("atc--select-arrow"),a.innerHTML='',n.appendChild(s),n.appendChild(a),n.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=n.parentElement.querySelector(".atc--select-dropdown");t.classList.toggle("show"),document.querySelectorAll(".atc--select-field > .atc--select-dropdown.show").forEach((e=>{e!==t&&e.classList.remove("show")}))})),n.addEventListener("hidden",(e=>{l.classList.remove("show")})),n.addEventListener("selected",(e=>{const n=o.find((t=>t.value===e.detail?.value));s.innerText=n?n.label:"Select an option",i&&i?.(e.detail?.value);l.querySelectorAll(".atc--select-option").forEach((t=>{t.classList.remove("selected"),t.dataset.value===e.detail?.value&&t.classList.add("selected")})),t=n?n.value:e?.detail?.value})),n.addEventListener("disabled",(e=>{const t=e.detail?.values||[];l.querySelectorAll(".atc--select-option").forEach((e=>{e.classList.remove("disabled"),t.includes(e.dataset.value)&&e.classList.add("disabled")}))}));const l=document.createElement("div");return l.classList.add("atc--select-dropdown"),o.forEach((e=>{const o=document.createElement("div");o.classList.add("atc--select-option"),o.innerText=e.label,o.dataset.value=e.value,e.value===t&&o.classList.add("selected"),o.addEventListener("click",(i=>{i.stopPropagation(),i.preventDefault(),o.classList.contains("disabled")||(l.classList.remove("show"),t!==e.value&&n.dispatchEvent(new CustomEvent("selected",{detail:{value:e.value}})))})),l.appendChild(o)})),n.appendChild(l),document.addEventListener("click",(e=>{n.classList.remove("show")})),n},this.triggerSelectField=function(e,t,o=document){const i=o?.querySelector(`#${e}`);if(!i)return;const n=new CustomEvent("selected",{detail:{value:t}});i?.dispatchEvent(n)},this.fetch=async function(e,t,o={}){try{const i=await fetch(window.Shopify.routes.root+t,{method:e,headers:{"Content-Type":"application/json",Accept:"application/json"},...o});return{data:await i.json(),status:i.status}}catch(e){return null}},this.fetchProduct=async function(){if(!this.review?.product_handle)return null;const{data:e}=await this.fetch("GET",`products/${this.review?.product_handle}.js`);this.product=e},this.addItem=async function(e,t={}){return await this.fetch("POST","cart/add.js",{body:JSON.stringify({items:[{id:e,quantity:1}],sections_url:t?.sections&&""!==t?.sections?window.location.pathname:void 0,...t})})},this.cartKey=function(e){return e.find((e=>!!e.key))?.key},this.findVariantId=function(){return this.product&&this.product.variants?this.product.variants.find((e=>{let t=!0;return this.variantOptions.forEach(((o,i)=>{t&&(t=e.options?.[i-1]===o)})),t}))?.id:null},this.findHandler=function(){return"undefined"!=typeof publish&&"undefined"!=typeof PUB_SUB_EVENTS&&(document.querySelector("cart-notification")||document.querySelector("cart-drawer"))?"handler_publish":document.querySelector("add-to-cart-component")||document.querySelector("product-form-component")||document.querySelector("quick-add-component")||document.querySelector("quick-add-dialog")?"handler_event":"default"},this.handlerPublishTheme=async function(e,t){const o=document.querySelector("cart-notification")||document.querySelector("cart-drawer");if(!o)return;o.setActiveElement?.(document.activeElement);const i=await this.addItem(t,{sections:o?.getSectionsToRender()?.map((e=>e.id))?.join(",")}),{data:n,status:r}=i||{};if(200!==r||!n||n?.status)return publish(PUB_SUB_EVENTS.cartError,{source:"product-form",productVariantId:t,errors:n?.errors||n?.description,message:n?.message}),i;const s="undefined"!=typeof CartPerformance?CartPerformance.createStartingMarker("add:wait-for-subscribers"):void 0;publish(PUB_SUB_EVENTS.cartUpdate,{source:"product-form",productVariantId:t,cartData:n})?.then((()=>{s&&CartPerformance.measureFromMarker("add:wait-for-subscribers",s)})),n.key=this.cartKey(n.items)||n.key;const a=document.querySelector("quick-add-modal");return a?(document.body.addEventListener("modalClosed",(()=>{setTimeout((()=>{"undefined"!=typeof CartPerformance?CartPerformance.measure("add:paint-updated-sections",(()=>{o.renderContents(n)})):o.renderContents(n)}))}),{once:!0}),a.hide(!0)):"undefined"!=typeof CartPerformance?CartPerformance.measure("add:paint-updated-sections",(()=>{o.renderContents(n)})):o.renderContents(n),"undefined"!=typeof CartPerformance&&CartPerformance.measureFromEvent("add:user-action",e),o&&o.classList.contains("is-empty")&&o.classList.remove("is-empty"),i},this.handlerEventTheme=async function(e,t){document.querySelectorAll("add-to-cart-component")?.[0]?.handleClick(e);const o=await this.addItem(t),{data:i,status:n}=o||{};if(200!==n||!i||i?.status)return o;class r extends Event{constructor(e,t,o){super(r.eventName,{bubbles:!0}),this.detail={resource:e,sourceId:t,data:{...o}}}static eventName="cart:update"}const s=new r({},t,{didError:!0,source:"product-form-component",itemCount:Number(1),productId:this.product.id});return document.dispatchEvent(s),o},this.handlerDefault=async function(e,t){const o=await this.addItem(t),{data:i,status:n}=o||{};return 200!==n||!i||i?.status?i:o},this.handleAddToCart=async function(t){const o=e?.querySelector(`#${this.toastId}`);o&&this.toastTimeout&&(clearTimeout(this.toastTimeout),this.toastTimeout=null,o.classList.remove("show"));const r={disabled:!1,labelText:null};try{const e=this.findVariantId();if(!e)throw new Error("Cannot find product variant");const o={handler_event:this.handlerEventTheme,handler_publish:this.handlerPublishTheme,default:this.handlerDefault},i=o?.[this.findHandler()]||o.default,s=await(i?.apply(this,[t,e])),a=s?.data?.message||s?.data?.description||"Unable to add item to cart.";200===s?.status?this.toast(n("modal_view_media_atc_toast_success"),"success"):a.toLowerCase().includes("maximum quantity")?(this.toast(n("modal_view_media_atc_toast_unavailable"),"error"),r.disabled=!0):a.toLowerCase().includes("sold out")?(this.toast(n("modal_view_media_atc_toast_sold_out"),"error"),r.disabled=!0):(this.toast(n("modal_view_media_atc_toast_failure"),"error"),r.disabled=429===s?.status)}catch(e){this.toast(n("modal_view_media_atc_toast_failure"),"error"),console.error("Add to cart error",e)}return await(i?.()),r},window.__ts__.cartProduct?.has(this.review?.product_handle)?this.product=window.__ts__.cartProduct.get(this.review?.product_handle):(await this.fetchProduct(),window.__ts__.cartProduct.set(this.review?.product_handle,this.product),window.__ts__.sendTrack("add_to_cart_view")),this.hasVariantChoice=this.product?.variants?.length>1,e&&this.hasVariantChoice&&this.labelElement&&(e.classList.add("variant-choose"),this.labelElement.textContent=n("modal_view_media_atc_choose_options"),this.variantChooseDropdown()),e&&(e.addEventListener("click",(async t=>{if(t.preventDefault(),t.stopPropagation(),!this.hasVariantChoice){if("true"===e.getAttribute("disabled"))return;e.setAttribute("disabled","true");const{disabled:o,labelText:n}=await this.handleAddToCart(t);return n&&this.labelElement&&(this.labelElement.textContent=n),o||e?.removeAttribute?.("disabled"),i?.(),void window.__ts__.sendTrack("add_to_cart_click")}this.toggleVariantChooseDropdown(),window.__ts__.sendTrack("add_to_cart_click")})),e.style=this.getButtonStyle()),this};let m=!1;const w=(e,t)=>Object.entries(e).reduce(((e,[o,i])=>(e[o]="object"==typeof i&&null!==i?w(i,t?.[o]||{}):null===t[o]||""===t[o]?"":t?.[o]||i,e)),{}),h=async(e,t)=>{if(window.__ts__.globalSetting.multi_lang&&"false"!==window.__ts__.globalSetting.multi_lang){if(m)return;try{const e=window.Shopify.locale||"en";let t=await window.fetch(`https://asset.trustshop.io/locales/${e}.json`,{headers:{"Content-Type":"application/json"},method:"GET"});t=await t.json(),t.product_reviews?(m=!0,window.__ts__.label_content={...p,...w(p,t)}):window.__ts__.label_content=p}catch(e){console.error(e),window.__ts__.label_content=p}}else window.__ts__.label_content={...p,...window.__ts__.label_content,[e]:document.getElementById(t)&&document.getElementById(t).value?{...p[e],...w(p[e],JSON.parse(document.getElementById(t).value))}:p[e]}};await h(),window.__ts__.scriptLoading={product_reviews:!1,review_all_page:!1,testimonial:!1,carousel:!1,product_rating:!1,review_snippets:!1};const v=async()=>{if(console.log("1: ","handleShowWidgetBox"),document.getElementById("trustshop-get-product_info")&&JSON.parse(document.getElementById("trustshop-get-product_info").value)&&(window.__ts__.product_info=JSON.parse(document.getElementById("trustshop-get-product_info").value)),await h("product_reviews","trustshop-widget_box_label_content"),JSON.stringify(window.__ts__.sectionShow)===JSON.stringify(n)&&(window.__ts__.sectionShow=document.getElementById("trustshop-widget_box_section_show")&&document.getElementById("trustshop-widget_box_section_show").value?{...n,...JSON.parse(document.getElementById("trustshop-widget_box_section_show").value)}:n),c||u(),!window.__ts__.scriptLoading.product_reviews){if(window.trustshop_reviews&&window.trustshop_reviews.initReviews)return console.log("2: ","loaded"),void window.trustshop_reviews.initReviews();try{window.__ts__.scriptLoading.product_reviews=!0,await import(window.TS_BLOCK_ADDED.script.widget),console.log("3: ","import")}catch(e){console.error(e)}finally{window.__ts__.scriptLoading.product_reviews=!1}}},g=async()=>{if(c||u(),await h("product_reviews","trustshop-widget_box_label_content"),!window.__ts__.scriptLoading.testimonial)if(window.trustshop_testimonial)window.trustshop_testimonial();else try{window.__ts__.scriptLoading.testimonial=!0,await import(window.TS_BLOCK_ADDED.script.testimonial)}catch(e){console.error(e)}finally{window.__ts__.scriptLoading.testimonial=!1}},y=async()=>{if(c||u(),await h("product_reviews","trustshop-widget_box_label_content"),!window.__ts__.scriptLoading.carousel)if(window.trustshop_carousel)window.trustshop_carousel();else try{window.__ts__.scriptLoading.carousel=!0,await import(window.TS_BLOCK_ADDED.script.carousel)}catch(e){console.error(e)}finally{window.__ts__.scriptLoading.carousel=!1}},f=async()=>{if(!window.__ts__.scriptLoading.product_rating)if(window.trustshop_collection_rating&&window.trustshop_collection_rating.initCollectionRating)window.trustshop_collection_rating.initCollectionRating();else try{window.__ts__.scriptLoading.product_rating=!0,await import(window.TS_BLOCK_ADDED.script.rating)}catch(e){console.error(e)}finally{window.__ts__.scriptLoading.product_rating=!1}},b=async()=>{if(window.trustshop_rating)return window.trustshop_rating.productStarRating=document.getElementById("trustshop-product_rating")?{...window.trustshop_rating.productStarRating,...JSON.parse(document.getElementById("trustshop-product_rating").value)}:window.trustshop_rating.productStarRating,void window.trustshop_rating.initRating();await import(window.TS_BLOCK_ADDED.script.rating)},C=async()=>{if(c||u(),await h("onepage_reviews","trustshop-review-page-label_content"),!window.__ts__.scriptLoading.review_all_page)if(window.trustshop_onepage)window.trustshop_onepage.initReviews();else try{window.__ts__.scriptLoading.review_all_page=!0,await import(window.TS_BLOCK_ADDED.script.onePage)}catch(e){console.error(e)}finally{window.__ts__.scriptLoading.review_all_page=!1}},E=async()=>{if(c||u(),!window.__ts__.scriptLoading.review_snippets)if(window.trustshop_review_snippets)window.trustshop_review_snippets();else try{window.__ts__.scriptLoading.review_snippets=!0,await import(window.TS_BLOCK_ADDED.script.reviewSnippets)}catch(e){console.log(e)}finally{window.__ts__.scriptLoading.review_snippets=!1}},L=()=>{console.log("handleShowWidget"),document.getElementById("trustshop-review")&&""===document.getElementById("trustshop-review").innerHTML?.trim()&&v();const e=document.querySelectorAll(".trustshop-collection-rating--item"),t=Array.from(e).some((e=>!e.innerHTML||""===e.innerHTML.trim()));e.length>0&&t&&document.getElementById("trustshop-product-rating__color-customize")&&f(),document.getElementById("trustshop-review--summary")&&b(),document.getElementById("trustshop-testimonial")&&g(),document.getElementById("trustshop-carousel")&&y(),document.getElementById("trustshop-review-one--page")&&C(),document.getElementById("trustshop-review-snippets--container")&&E()};let S;L();const F=()=>{S&&S.disconnect(),S=new MutationObserver((function(e){e.forEach((function(e){document.getElementById("trustshop-review")&&""===document.getElementById("trustshop-review").innerHTML?.trim()&&v();const t=Array.from(e.addedNodes).some((e=>1===e.nodeType&&e.closest(".trustshop-collection-rating--item"))),o=Array.from(document.querySelectorAll(".trustshop-collection-rating--item")).some((e=>""===e.innerHTML?.trim()));!t&&o&&document.getElementById("trustshop-product-rating__color-customize")&&f();document.getElementById("trustshop-review--summary")&&""===document.getElementById("trustshop-review--summary").innerHTML?.trim()&&b();document.getElementById("trustshop-testimonial")&&""===document.getElementById("trustshop-testimonial").innerHTML?.trim()&&g();document.getElementById("trustshop-review-one--page")&&""===document.getElementById("trustshop-review-one--page").innerHTML?.trim()&&C();document.getElementById("trustshop-carousel")&&""===document.getElementById("trustshop-carousel").innerHTML?.trim()&&y();document.getElementById("trustshop-review-snippets--container")&&""===document.getElementById("trustshop-review-snippets--container").innerHTML?.trim()&&E()}))}));const e={childList:!0,subtree:!0,attributes:!0};document.body&&S.observe(document.body,e)};F();["DOMContentLoaded","load","popstate","pushstate","hashchange"].forEach((e=>{window.addEventListener(e,F)})),"complete"!==document.readyState&&"interactive"!==document.readyState||L(),setTimeout((()=>{L()}),1e3),window.addEventListener("pageshow",(e=>{e.persisted&&(window.__ts__.scriptLoading={product_reviews:!1,review_all_page:!1,testimonial:!1,carousel:!1,product_rating:!1,review_snippets:!1},L(),F())})),window.__ts__})();