var __defProp=Object.defineProperty,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__publicField=(t,e,n)=>(__defNormalProp(t,"symbol"!=typeof e?e+"":e,n),n);!function(){"use strict";var t,e;(e=t||(t={})).FIRST_PARTY="firstParty",e.THIRD_PARTY="thirdParty";const n=Object.freeze({markWidgetLoaded:t=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:loaded`)},markWidgetStart:(t,e)=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:start`,{detail:e})},markWidgetEnd:(t,e)=>{"undefined"!=typeof window&&window.performance&&window.performance.mark&&window.performance.mark(`yotpo:${t}:end`,{detail:e})}}),i={};class o{constructor(t){__publicField(this,"analyticsLoadingPromise"),this.getYotpoAnalytics(t)}async trackCustomWidgetAction(t,e,n,i){return this.trackWidgetEvent(t,e,n,i)}async trackClickedOn(t,e,n){return this.trackWidgetEvent("clicked_on",t,e,n)}async trackError(t,e,n){return this.trackWidgetEvent("error",t,e,n)}async trackFilterResults(t,e,n){return this.trackWidgetEvent("filter_results",t,e,n)}async trackHidden(t,e,n){return this.trackWidgetEvent("hidden",t,e,n)}async trackHook(t,e,n){return this.trackWidgetEvent("hook",t,e,n)}async trackHovered(t,e,n){return this.trackWidgetEvent("hovered",t,e,n)}async trackLoaded(t,e,n){return this.trackWidgetEvent("loaded",t,e,n)}async trackShown(t,e,n){return this.trackWidgetEvent("shown",t,e,n)}async trackWidgetLoaded(t,e,n){const i=await this.analyticsLoadingPromise;return i?i.trackWidgetLoaded(t,e,n):Promise.resolve(!1)}createYotpoAnalyticsWithRetries(t,e,n){t<=0?e(!1):void 0!==window.Yotpo&&window?.yotpoWidgetsContainer?.Analytics&&window?.yotpoWidgetsContainer?.AnalyticsTools?e(!0):setTimeout((()=>{t-=1,this.createYotpoAnalyticsWithRetries(t,e,n)}),50)}getYotpoAnalytics(t){return this.analyticsLoadingPromise||(this.analyticsLoadingPromise=new Promise(((t,e)=>{this.createYotpoAnalyticsWithRetries(10,t,e)})).then((e=>e?window.yotpoWidgetsContainer.AnalyticsTools.WidgetsAnalyticsFactory(t):null))),this.analyticsLoadingPromise}async trackWidgetEvent(t,e,n,i){const o=await this.analyticsLoadingPromise;return o?o?.trackWidgetEvent(t,e,n,i):Promise.resolve(!1)}}class r{}__publicField(r,"category","star-ratings-widget");var s=Object.defineProperty,a=(t,e,n)=>(((t,e,n)=>{e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);function l(t){if(v(t)){const e={};for(let n=0;n{if(t){const n=t.split(d);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}function m(t){let e="";if(S(t))e=t;else if(v(t))for(let n=0;np(t,e)))}const h=Object.assign,g=Object.prototype.hasOwnProperty,y=(t,e)=>g.call(t,e),v=Array.isArray,w=t=>"[object Map]"===O(t),b=t=>t instanceof Date,S=t=>"string"==typeof t,k=t=>"symbol"==typeof t,_=t=>null!==t&&"object"==typeof t,x=Object.prototype.toString,O=t=>x.call(t),L=t=>S(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,R=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},T=/-(\w)/g,C=R((t=>t.replace(T,((t,e)=>e?e.toUpperCase():"")))),E=/\B([A-Z])/g,P=R((t=>t.replace(E,"-$1").toLowerCase())),A=t=>{const e=parseFloat(t);return isNaN(e)?t:e};function F(t,e){(e=e||undefined)&&e.active&&e.effects.push(t)}const B=t=>{const e=new Set(t);return e.w=0,e.n=0,e},j=t=>(t.w&W)>0,I=t=>(t.n&W)>0,M=new WeakMap;let D=0,W=1;const $=[];let N;const U=Symbol(""),z=Symbol("");class V{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],F(this,n)}run(){if(!this.active)return this.fn();if(!$.includes(this))try{return $.push(N=this),G.push(K),K=!0,W=1<<++D,D<=30?(({deps:t})=>{if(t.length)for(let e=0;e{const{deps:e}=t;if(e.length){let n=0;for(let i=0;i0?$[t-1]:void 0}}stop(){this.active&&(H(this),this.onStop&&this.onStop(),this.active=!1)}}function H(t){const{deps:e}=t;if(e.length){for(let n=0;n{("length"===e||e>=i)&&a.push(t)}));else switch(void 0!==n&&a.push(s.get(n)),e){case"add":v(t)?L(n)&&a.push(s.get("length")):(a.push(s.get(U)),w(t)&&a.push(s.get(z)));break;case"delete":v(t)||(a.push(s.get(U)),w(t)&&a.push(s.get(z)));break;case"set":w(t)&&a.push(s.get(U))}if(1===a.length)a[0]&&X(a[0]);else{const t=[];for(const e of a)e&&t.push(...e);X(B(t))}}function X(t,e){for(const n of v(t)?t:[...t])(n!==N||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const Q=function(t,e){const n=Object.create(null),i=t.split(",");for(let o=0;o!!n[t.toLowerCase()]:t=>!!n[t]}("__proto__,__v_isRef,__isVue"),tt=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(k)),et=ot(),nt=ot(!0),it=function(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=ft(this);for(let e=0,o=this.length;e{t[e]=function(...t){G.push(K),K=!1;const n=ft(this)[e].apply(this,t);return q(),n}})),t}();function ot(t=!1,e=!1){return function(n,i,o){if("__v_isReactive"===i)return!t;if("__v_isReadonly"===i)return t;if("__v_raw"===i&&o===(t?e?dt:ct:e?lt:at).get(n))return n;const r=v(n);if(!t&&r&&y(it,i))return Reflect.get(it,i,o);const s=Reflect.get(n,i,o);return(k(i)?tt.has(i):Q(i))||(t||Z(n,0,i),e)?s:ht(s)?r&&L(i)?s:s.value:_(s)?t?function(t){return pt(t,!0,st,null,ct)}(s):mt(s):s}}const rt={get:et,set:function(t=!1){return function(e,n,i,o){let r=e[n];if(!t&&!function(t){return!(!t||!t.__v_isReadonly)}(i)&&(i=ft(i),r=ft(r),!v(e)&&ht(r)&&!ht(i)))return r.value=i,!0;const s=v(e)&&L(n)?Number(n)!Object.is(t,e))(i,r)&&J(e,"set",n,i):J(e,"add",n,i)),a}}(),deleteProperty:function(t,e){const n=y(t,e);t[e];const i=Reflect.deleteProperty(t,e);return i&&n&&J(t,"delete",e,void 0),i},has:function(t,e){const n=Reflect.has(t,e);return(!k(e)||!tt.has(e))&&Z(t,0,e),n},ownKeys:function(t){return Z(t,0,v(t)?"length":U),Reflect.ownKeys(t)}},st={get:nt,set:(t,e)=>!0,deleteProperty:(t,e)=>!0},at=new WeakMap,lt=new WeakMap,ct=new WeakMap,dt=new WeakMap;function ut(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>O(t).slice(8,-1))(t))}function mt(t){return t&&t.__v_isReadonly?t:pt(t,!1,rt,null,at)}function pt(t,e,n,i,o){if(!_(t)||t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=o.get(t);if(r)return r;const s=ut(t);if(0===s)return t;const a=new Proxy(t,2===s?i:n);return o.set(t,a),a}function ft(t){const e=t&&t.__v_raw;return e?ft(e):t}function ht(t){return Boolean(t&&!0===t.__v_isRef)}Promise.resolve();let gt=!1;const yt=[],vt=Promise.resolve(),wt=t=>vt.then(t),bt=t=>{yt.includes(t)||yt.push(t),gt||(gt=!0,wt(St))},St=()=>{for(const t of yt)t();yt.length=0,gt=!1},kt=/^(spellcheck|draggable|form|list|type)$/,_t=({el:t,get:e,effect:n,arg:i,modifiers:o})=>{let r;"class"===i&&(t._class=t.className),n((()=>{let n=e();if(i)(null==o?void 0:o.camel)&&(i=C(i)),xt(t,i,n,r);else{for(const e in n)xt(t,e,n[e],r&&r[e]);for(const e in r)(!n||!(e in n))&&xt(t,e,null)}r=n}))},xt=(t,e,n,i)=>{if("class"===e)t.setAttribute("class",m(t._class?[t._class,n]:n)||"");else if("style"===e){n=l(n);const{style:e}=t;if(n)if(S(n))n!==i&&(e.cssText=n);else{for(const t in n)Lt(e,t,n[t]);if(i&&!S(i))for(const t in i)null==n[t]&&Lt(e,t,"")}else t.removeAttribute("style")}else t instanceof SVGElement||!(e in t)||kt.test(e)?"true-value"===e?t._trueValue=n:"false-value"===e?t._falseValue=n:null!=n?t.setAttribute(e,n):t.removeAttribute(e):(t[e]=n,"value"===e&&(t._value=n))},Ot=/\s*!important$/,Lt=(t,e,n)=>{v(n)?n.forEach((n=>Lt(t,e,n))):e.startsWith("--")?t.setProperty(e,n):Ot.test(n)?t.setProperty(P(e),n.replace(Ot,""),"important"):t[e]=n},Rt=(t,e)=>{const n=t.getAttribute(e);return null!=n&&t.removeAttribute(e),n},Tt=(t,e,n,i)=>{t.addEventListener(e,n,i)},Ct=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Et=["ctrl","shift","alt","meta"],Pt={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>Et.some((n=>t[`${n}Key`]&&!e[n]))},At=({el:t,get:e,exp:n,arg:i,modifiers:o})=>{if(!i)return;let r=Ct.test(n)?e(`(e => ${n}(e))`):e(`($event => { ${n} })`);if("vue:mounted"!==i){if("vue:unmounted"===i)return()=>r();if(o){"click"===i&&(o.right&&(i="contextmenu"),o.middle&&(i="mouseup"));const t=r;r=e=>{if(!("key"in e)||P(e.key)in o){for(const t in o){const n=Pt[t];if(n&&n(e,o))return}return t(e)}}}Tt(t,i,r,o)}else wt(r)},Ft=({el:t,get:e,effect:n})=>{n((()=>{t.textContent=Bt(e())}))},Bt=t=>null==t?"":_(t)?JSON.stringify(t,null,2):String(t),jt=t=>"_value"in t?t._value:t.value,It=(t,e)=>{const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e},Mt=t=>{t.target.composing=!0},Dt=t=>{const e=t.target;e.composing&&(e.composing=!1,Wt(e,"input"))},Wt=(t,e)=>{const n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)},$t=Object.create(null),Nt=(t,e,n)=>Ut(t,`return(${e})`,n),Ut=(t,e,n)=>{const i=$t[e]||($t[e]=zt(e));try{return i(t,n)}catch(o){}},zt=t=>{try{return new Function("$data","$el",`with($data){${t}}`)}catch(e){return()=>{}}},Vt={bind:_t,on:At,show:({el:t,get:e,effect:n})=>{const i=t.style.display;n((()=>{t.style.display=e()?i:"none"}))},text:Ft,html:({el:t,get:e,effect:n})=>{n((()=>{t.innerHTML=e()}))},model:({el:t,exp:e,get:n,effect:i,modifiers:o})=>{const r=t.type,s=n(`(val) => { ${e} = val }`),{trim:a,number:l="number"===r}=o||{};if("SELECT"===t.tagName){const e=t;Tt(t,"change",(()=>{const t=Array.prototype.filter.call(e.options,(t=>t.selected)).map((t=>l?A(jt(t)):jt(t)));s(e.multiple?t:t[0])})),i((()=>{const t=n(),i=e.multiple;for(let n=0,o=e.options.length;n-1:o.selected=t.has(r);else if(p(jt(o),t))return void(e.selectedIndex!==n&&(e.selectedIndex=n))}!i&&-1!==e.selectedIndex&&(e.selectedIndex=-1)}))}else if("checkbox"===r){let e;Tt(t,"change",(()=>{const e=n(),i=t.checked;if(v(e)){const n=jt(t),o=f(e,n),r=-1!==o;if(i&&!r)s(e.concat(n));else if(!i&&r){const t=[...e];t.splice(o,1),s(t)}}else s(It(t,i))})),i((()=>{const i=n();v(i)?t.checked=f(i,jt(t))>-1:i!==e&&(t.checked=p(i,It(t,!0))),e=i}))}else if("radio"===r){let e;Tt(t,"change",(()=>{s(jt(t))})),i((()=>{const i=n();i!==e&&(t.checked=p(i,jt(t)))}))}else{const e=t=>a?t.trim():l?A(t):t;Tt(t,"compositionstart",Mt),Tt(t,"compositionend",Dt),Tt(t,(null==o?void 0:o.lazy)?"change":"input",(()=>{t.composing||s(e(t.value))})),a&&Tt(t,"change",(()=>{t.value=t.value.trim()})),i((()=>{if(t.composing)return;const i=t.value,o=n();document.activeElement===t&&e(i)===o||i!==o&&(t.value=o)}))}},effect:({el:t,ctx:e,exp:n,effect:i})=>{wt((()=>i((()=>Ut(e.scope,n,t)))))}},Ht=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Yt=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Kt=/^\(|\)$/g,Gt=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,qt=(t,e,n)=>{const i=e.match(Ht);if(!i)return;const o=t.nextSibling,r=t.parentElement,s=new Text("");r.insertBefore(s,t),r.removeChild(t);const a=i[2].trim();let l,c,d,u,m=i[1].trim().replace(Kt,"").trim(),p=!1,f="key",h=t.getAttribute(f)||t.getAttribute(f=":key")||t.getAttribute(f="v-bind:key");h&&(t.removeAttribute(f),"key"===f&&(h=JSON.stringify(h))),(u=m.match(Yt))&&(m=m.replace(Yt,"").trim(),c=u[1].trim(),u[2]&&(d=u[2].trim())),(u=m.match(Gt))&&(l=u[1].split(",").map((t=>t.trim())),p="["===m[0]);let g,y,w,b=!1;const S=(t,e,i,o)=>{const r={};l?l.forEach(((t,n)=>r[t]=e[p?n:t])):r[m]=e,o?(c&&(r[c]=o),d&&(r[d]=i)):c&&(r[c]=i);const s=se(n,r),a=h?Nt(s.scope,h):i;return t.set(a,i),s.key=a,s},k=(e,n)=>{const i=new le(t,e);return i.key=e.key,i.insert(r,n),i};return n.effect((()=>{const t=Nt(n.scope,a),e=w;if([y,w]=(t=>{const e=new Map,n=[];if(v(t))for(let i=0;ik(t,s))),b=!0})),o},Zt=({el:t,ctx:{scope:{$refs:e}},get:n,effect:i})=>{let o;return i((()=>{const i=n();e[i]=t,o&&i!==o&&delete e[o],o=i})),()=>{o&&delete e[o]}},Jt=/^(?:v-|:|@)/,Xt=/\.([\w-]+)/g;let Qt=!1;const te=(t,e)=>{const n=t.nodeType;if(1===n){const n=t;if(n.hasAttribute("v-pre"))return;let i;if(Rt(n,"v-cloak"),i=Rt(n,"v-if"))return((t,e,n)=>{const i=t.parentElement,o=new Comment("v-if");i.insertBefore(o,t);const r=[{exp:e,el:t}];let s,a;for(;(s=t.nextElementSibling)&&(a=null,""===Rt(s,"v-else")||(a=Rt(s,"v-else-if")));)i.removeChild(s),r.push({exp:a,el:s});const l=t.nextSibling;i.removeChild(t);let c,d=-1;const u=()=>{c&&(i.insertBefore(o,c.el),c.remove(),c=void 0)};return n.effect((()=>{for(let t=0;t{let n=t.firstChild;for(;n;)n=te(n,e)||n.nextSibling},ne=(t,e,n,i)=>{let o,r,s;if(":"===(e=e.replace(Xt,((t,e)=>((s||(s={}))[e]=!0,""))))[0])o=_t,r=e.slice(1);else if("@"===e[0])o=At,r=e.slice(1);else{const t=e.indexOf(":"),n=t>0?e.slice(2,t):e.slice(2);o=Vt[n]||i.dirs[n],r=t>0?e.slice(t+1):void 0}o&&(o===_t&&"ref"===r&&(o=Zt),ie(t,o,n,i,r,s),t.removeAttribute(e))},ie=(t,e,n,i,o,r)=>{const s=e({el:t,get:(e=n)=>Nt(i.scope,e,t),effect:i.effect,ctx:i,exp:n,arg:o,modifiers:r});s&&i.cleanups.push(s)},oe=(t,e)=>{if("#"!==e[0])t.innerHTML=e;else{const n=document.querySelector(e);t.appendChild(n.content.cloneNode(!0))}},re=t=>{const e={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...t,scope:t?t.scope:mt({}),dirs:t?t.dirs:{},effects:[],blocks:[],cleanups:[],effect:t=>{if(Qt)return bt(t),t;const n=function(t,e){t.effect&&(t=t.effect.fn);const n=new V(t);e&&(h(n,e),e.scope&&F(n,e.scope)),(!e||!e.lazy)&&n.run();const i=n.run.bind(n);return i.effect=n,i}(t,{scheduler:()=>bt(n)});return e.effects.push(n),n}};return e},se=(t,e={})=>{const n=t.scope,i=Object.create(n);Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)),i.$refs=Object.create(n.$refs);const o=mt(new Proxy(i,{set:(t,e,i,r)=>r!==o||t.hasOwnProperty(e)?Reflect.set(t,e,i,r):Reflect.set(n,e,i)}));return ae(o),{...t,scope:o}},ae=t=>{for(const e of Object.keys(t))"function"==typeof t[e]&&(t[e]=t[e].bind(t))};class le{constructor(t,e,n=!1){a(this,"template"),a(this,"ctx"),a(this,"key"),a(this,"parentCtx"),a(this,"isFragment"),a(this,"start"),a(this,"end"),this.isFragment=t instanceof HTMLTemplateElement,n?this.template=t:this.isFragment?this.template=t.content.cloneNode(!0):this.template=t.cloneNode(!0),n?this.ctx=e:(this.parentCtx=e,e.blocks.push(this),this.ctx=re(e)),te(this.template,this.ctx)}get el(){return this.start||this.template}insert(t,e=null){if(this.isFragment)if(this.start){let n,i=this.start;for(;i&&(n=i.nextSibling,t.insertBefore(i,e),i!==this.end);)i=n}else this.start=new Text(""),this.end=new Text(""),t.insertBefore(this.end,e),t.insertBefore(this.start,this.end),t.insertBefore(this.template,this.end);else t.insertBefore(this.template,e)}remove(){if(this.parentCtx&&((t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)})(this.parentCtx.blocks,this),this.start){const t=this.start.parentNode;let e,n=this.start;for(;n&&(e=n.nextSibling,t.removeChild(n),n!==this.end);)n=e}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach((t=>{t.teardown()})),this.ctx.effects.forEach(Y),this.ctx.cleanups.forEach((t=>t()))}}const ce=t=>t.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),de=t=>{const e=re();if(t&&(e.scope=mt(t),ae(e.scope),t.$delimiters)){const[n,i]=e.delimiters=t.$delimiters;e.delimitersRE=new RegExp(ce(n)+"([^]+?)"+ce(i),"g")}let n;return e.scope.$s=Bt,e.scope.$nextTick=wt,e.scope.$refs=Object.create(null),{directive(t,n){return n?(e.dirs[t]=n,this):e.dirs[t]},mount(t){if("string"==typeof t&&!(t=document.querySelector(t)))return;let i;return i=(t=t||document.documentElement).hasAttribute("v-scope")?[t]:[...t.querySelectorAll("[v-scope]")].filter((t=>!t.matches("[v-scope] [v-scope]"))),i.length||(i=[t]),n=i.map((t=>new le(t,e,!0))),this},unmount(){n.forEach((t=>t.teardown()))}}},ue=document.currentScript;ue&&ue.hasAttribute("init")&&de().mount();var me=(t=>(t.PRODUCT="product",t.CATEGORY="collection",t.HOME="index",t.CART="cart",t.PRODUCT_GRID="product-grid",t))(me||{}),pe=(t=>(t.SUMMARY="summary",t.REVIEWS="reviews",t))(pe||{});const fe=(t,e)=>{if(void 0!==t&&""!==t)switch(typeof t){case"string":return["true","false"].includes(t)?"true"===t:t;case"boolean":return t}return e},he=t=>{const e=t["data-yotpo-section-id"];return e.includes(me.CATEGORY)||e.includes(me.HOME)||e.includes(me.CART)||e.includes(me.PRODUCT_GRID)},ge=["view-alignment","bottom-line-enable","bottom-line-text","view-text-color","rating-score-enable"],ye=t=>null==t,ve=t=>"true"===t||"false"===t?"true"===t:t,we=(t,e)=>t.hasOwnProperty("getter")?t.getter(e):e,be=(t,e,n)=>t.hasOwnProperty("getter")?t.getter(e,n):n,Se=(t,e)=>{if(!t.hasOwnProperty("getIdAttribute"))throw new Error(`No getIdAttribute method was specified for regex item "${t}"`);const n=[],i=new RegExp(t.regex);for(const o in e)if(o.match(i)){let i=ve(e[o]);i=be(t,o,e[o]);const{id:r,attribute:s}=t.getIdAttribute(o)||{};if(!ye(r)&&s){const e=n.find((t=>t.id===r));e?e[s]=i:n.push({...t.defaults,id:r,[s]:i})}}return n};class ke{static mapValuesToKeys(t,e,n=!0){const i={};for(const o in t){let r;const s=t[o];if(s.key){const t=s.key.toLowerCase();r=s.default,e[t]&&(r=ve(e[t])),r=we(s,r)}else if("regex"===s.type)r=Se(s,e);else{if(""===s.key&&n)throw new Error(`No key was specified for "${o}"`);r=!s.hasOwnProperty("key")&&s.hasOwnProperty("default")?s.default:ke.mapValuesToKeys(s,e)}i[o]=r}return i}static defaults(t){return ke.mapValuesToKeys(t,{})}static getCustomizationKeys(t){const e={};for(const n in t){let i;const o=t[n];i=o.key?o.key.toLowerCase():ke.getCustomizationKeys(o),e[n]=i}return e}}const _e={MOBILE:"S",TABLET:"SM",LAPTOP:"M",DESKTOP:"L"},xe="#2e4f7c",Oe="#e7721b",Le="#555555",Re="#FFFFFF";const Te=new class{calcDisplayType(t){return _e[t]}};class Ce{getDeviceType(){return Ce.isMobileDevice()?"MOBILE":Ce.deviceTypeByWidth()}static isMobileDevice(){return!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/\bAndroid(?:.+)Mobile\b/i)||navigator.userAgent.match(/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i)||navigator.userAgent.match(/\bokhttp\b/i)||navigator.userAgent.match(/\bWindows(?:.+)ARM\b/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/BB10/i)||navigator.userAgent.match(/Opera Mini/i)||navigator.userAgent.match(/\b(CriOS|Chrome)(?:.+)Mobile/i)||navigator.userAgent.match(/Mobile(?:.+)Firefox\b/i)||navigator.userAgent.match(/Windows Phone/i))}static deviceTypeByWidth(){return window.innerWidth<480?"MOBILE":window.innerWidth<1440?"LAPTOP":"DESKTOP"}}const Ee=new Ce;var Pe={},Ae={},Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.emptyFont=void 0;Fe.emptyFont={url:"",family:"",weight:"",style:""},Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.FontService=void 0;var Be=Fe;function je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Ie(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"#";return this.getFontParts(t,e).family}},{key:"getFontUrl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#";return this.getFontParts(t,e).url}},{key:"getFontWeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return this.getFontParts(t,e).weight}},{key:"getFontStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return this.getFontParts(t,e).style}},{key:"getPixelFontSize",value:function(t){return t?"px"===(t=t.toString()).slice(-2)?t:t+"px":""}},{key:"loadFont",value:function(t,e){var n=document.createElement("style"),i="";t.url.includes("fonts.googleapis.com/css")?i="@import url('".concat(t.url,"');"):t.url&&(i='\n @font-face {\n font-family: "'.concat(t.family,"\";\n src: url('").concat(t.url,"');\n }")),n.innerHTML=i,e.appendChild(n)}},{key:"calulcateMobileFontSize",value:function(t){var e=.8*parseInt(t,10);return e<=14?14:e}},{key:"getFontParts",value:function(e,n){if(!e)return Be.emptyFont;n||(n=2===e.split("#").length?"#":"|");var i=e.split(n);if(1==i.length)return Ie(Ie({},Be.emptyFont),{},{family:i[0]});var o=i[1];return Ie(Ie({},t.getFontStyleParts(i[0])),{},{url:o})}},{key:"getFontStyleParts",value:function(t){var e=t.split("@");if(1==e.length)return{family:t,style:"",weight:""};var n=e[0],i=e[1],o=null!==i.match(/i$/);return{weight:o?i.substring(0,i.length-1):i,style:o?"italic":"normal",family:n}}}],(n=null)&&De(e.prototype,n),i&&De(e,i),t}();Ae.FontService=We,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ae;Object.keys(e).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[n]}})}));var n=Fe;Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}))}(Pe);var $e={};Object.defineProperty($e,"__esModule",{value:!0});var Ne=$e.ObjectUtils=void 0;function Ue(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ze(t){for(var e=1;e"+t,"text/html").body.textContent}},{key:"deepMerge",value:function(){for(var e={},n=arguments.length,i=new Array(n),o=0;o{if(!t)return e;return t.includes("#")?t:Ze(t,e)},Ze=(t,e)=>{if(!t)return e;const n=t.match(/\d+/g)||[];let[i,o,r,s]=n;return i=i.toString(16),o=o.toString(16),r=r.toString(16),s=Math.round(255*s).toString(16),1==i.length&&(i="0"+i),1==o.length&&(o="0"+o),1==r.length&&(r="0"+r),1==s.length&&(s="0"+s),`#${i}${o}${r}${s}`},Je=t=>{const e={isMobileOverride:{default:!1,key:"is-mobile"},primaryColor:{default:xe,key:"view-primary-color"},starsColor:{default:Oe,key:"view-stars-color"},textColor:{default:Le,key:"view-text-color"},alignment:{default:"left",key:"view-alignment"},primaryFont:{font:{family:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Pe.FontService.getFontFamily(t,"|")},url:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Pe.FontService.getFontUrl(t,"|")},weight:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Pe.FontService.getFontWeight(t)},style:{default:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",key:"view-primary-font",getter:t=>Pe.FontService.getFontStyle(t)}}},previewHtmlContainer:{key:"view-preview-html-container",default:""}},n=Ne.removeEmptyFields(t),i={deviceType:"DESKTOP",displayType:"L",primaryColor:qe(n["view-primary-color"],xe),starsColor:qe(n["view-stars-color"],Oe),emptyStarsColor:Re,textColor:qe(n["view-text-color"],Le),alignment:fe(t["view-alignment"],"left"),primaryFont:{font:{family:"'Nunito Sans'",url:"Nunito Sans@400|https://cdn-widgetsrepository.yotpo.com/web-fonts/css/nunito_sans/v1/nunito_sans_400.css",weight:"400",style:"normal",size:"14"}},previewHtmlContainer:fe(n["view-preview-html-container"],"")},o=ke.mapValuesToKeys(e,n);return null!=!n["is-mobile"]?(o.deviceType=Ee.getDeviceType(),o.displayType=Te.calcDisplayType(o.deviceType)):n["is-mobile"].toLowerCase()&&(o.deviceType="MOBILE",o.displayType="S"),{...i,...o}};let Xe;const Qe=new Uint8Array(16);function tn(){if(!Xe&&(Xe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xe(Qe)}const en=[];for(let En=0;En<256;++En)en.push((En+256).toString(16).slice(1));const nn={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function on(t,e,n){if(nn.randomUUID&&!e&&!t)return nn.randomUUID();const i=(t=t||{}).random||(t.rng||tn)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=i[t];return e}return function(t,e=0){return(en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]).toLowerCase()}(i)}const rn="enabled";var sn=(t=>(t.CONTENT_OFFLOAD="feature_use_content_offload",t.BOTTOM_LINE_SYNDICATION="feature_reviews_bottom_line_syndication",t.BOTTOM_LINE_SYNDICATION_SETTINGS_TEXT="feature_reviews_ugc_widgets_reviews_bottom_line_syndication_settings_bottom_line_syndication_text",t.REVIEWS_SUMMARY="feature_reviews_summary",t))(sn||{});class an{constructor(t,e,n={},i={},o="",r="",s="",a="",l={}){__publicField(this,"store"),__publicField(this,"config"),__publicField(this,"actions"),this.createStore(t,e,n,i,o,r,s,a,l)}awaitSummaryButtonAppear(){let t,e=1;const n=setInterval((()=>{t=document.querySelector("#yotpo-summary"),(t||e>=7)&&(clearInterval(n),this.store.mainWidgetSummaryButtonLoaded=!!t),e++}),250*e)}async awaitInitComplete(){let t=1;for(;!this.store&&t<=3;)await new Promise((e=>setTimeout(e,3e3*t))),t++;return Promise.resolve()}getStore(){return{store:this.store,config:this.config,actions:this.actions}}getConfig(){return{config:this.config,actions:this.actions}}createConfig(t,e,n={},i={},o="",r="",s="",a="",l={}){const c=[`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`,`yotpo_stars_gradient_${Math.random()}`];return{element:t,productId:r||"4713994911841",sectionId:n["data-yotpo-section-id"],storeId:o,sessionId:on(),instanceId:s,instanceVersionId:a,startLoadDate:l.startLoadDate||new Date,widgetUuid:e,showBottomLine:fe(n["bottom-line-enable"],!0),showText:fe(n["bottom-line-enable"],!0),showRatingScore:fe(n["rating-score-enable"],!1),enableEmptyState:fe(n["empty-state-enable"],!0),bottomLineText:n["bottom-line-text"]||"{{reviews_count}} Reviews",bottomLineClickEnableSummaryFeatureOn:fe(n["bottom-line-click-enable-summary-feature-on"],!0),bottomLineClickEnableSummaryFeatureOff:fe(n["bottom-line-click-enable-summary-feature-off"],!0),bottomLineClickScrollTo:fe(n["bottom-line-click-scroll-to"],pe.SUMMARY),enableAddReview:fe(n["add-review-enable"],!1),buttonText:fe(n["write-a-review-text"],"Write a review"),isReadOnly:fe(n["mode-read-only"],!1),isPreview:fe(n["mode-preview"],!1),isEmptyState:fe(n["mode-empty-state"],!1),isLoading:fe(n["mode-is-loading"],!1),isCategoryPage:he(n),rtl:fe(n.rtl,!1),showSummaryLink:!he(n)&&fe(n["star-rating-reviews-summary-toggle-enable"],!0),summaryButtonText:fe(n["summary-link-text"],"See reviews summary"),showSummaryButtonIcon:fe(n["summary-show-link-icon"],!1),staticContent:i,starsIds:c,...Je(n)}}createActions(){const t=this.config.isPreview||this.config.isReadOnly,e={widget_instance_id:this.config.instanceId,instance_version_id:this.config.instanceVersionId,product_id:this.config.productId,device_type:this.config.deviceType,widget_location:ln(this.config.sectionId)},s=(t=>{const e=(t=>{const{guid:e,category:n}=t;return`${e}_${n}`})(t);return i[e]||(i[e]=new o(t)),i[e]})({guid:this.config.storeId,defaultContext:e,widgetUuid:this.config.widgetUuid,category:r.category,preventEvents:t});this.actions=(t=this)=>({showEmptyState:()=>t.config.enableEmptyState&&(0===t.store.totalReviews||t.config.isEmptyState)&&t.store.bottomlineLoaded,getBottomLineText:()=>t.config.bottomLineText.replace("{{reviews_count}}",t.store.totalReviews.toString()).replace("Reviews",""+(1==t.store.totalReviews?"Review":"Reviews")),getBottomLineSyndicationText:()=>(t.config.staticContent[sn.BOTTOM_LINE_SYNDICATION_SETTINGS_TEXT]||"({{syndicated_reviews_count}} in other languages)").replace("{{syndicated_reviews_count}}",t.store.totalSyndicatedReviews.toString()),showBottomLineSyndication:()=>!t.config.isCategoryPage&&t.config.showBottomLine&&t.config.staticContent[sn.BOTTOM_LINE_SYNDICATION]===rn&&t.store?.totalSyndicatedReviews>0,isReviewsSummaryShown:()=>!!document.getElementById("yotpo-star-rating-reviews-summary"),isRTL:()=>t.config.rtl,trackAppShown(t){s.trackShown("app",void 0,{app_load_duration:t.appLoadDuration,bottom_line_syndication:t.showBottomLineSyndication})},trackReviewsSummaryShown(t){s.trackShown("reviews summary",void 0,{reviews_summary:t.isReviewsSummaryShown})},trackError(t){s.trackError(t.label,void 0,{error_message:t.errorMessage})},trackClicked(t){s.trackClickedOn(t.label,t.property,t.context||{})},async trackWidgetLoaded(e){if(!t.config.enableEmptyState&&0===t.store.totalReviews)return;const i={...e.context,status:"ok",empty_state:t.config.enableEmptyState&&0===t.store.totalReviews};n.markWidgetEnd(r.category,t.config.widgetUuid),s.trackWidgetLoaded("widget","widget",i)}})}async createStore(t,e,n={},i={},o="",r="",s="",a="",l={}){this.config=this.createConfig(t,e,n,i,o,r,s,a,l),this.store=mt(this.getReactiveState()),this.createActions()}getReactiveState(){return{sequence:0,analyticsLoaded:!1,bottomlineLoaded:!1,mainWidgetSummaryButtonLoaded:!1,averageScore:0,totalReviews:0,totalSyndicatedReviews:0,commit(t,e){switch(t){case"loaded":this.bottomlineLoaded=e;break;case"totalReviews":this.totalReviews=e;break;case"totalSyndicatedReviews":this.totalSyndicatedReviews=e;break;case"mainWidgetSummaryButtonLoaded":this.mainWidgetSummaryButtonLoaded=e;break;case"averageScore":this.averageScore=parseFloat(e.toFixed(1));break;case"sequence":this.sequence=e}},storeLoaded:!0}}}function ln(t){switch(t){case me.PRODUCT:return"PRODUCT";case me.CART:return"CART";case me.CATEGORY:return"CATEGORY";case me.HOME:return"HOMEPAGE";default:return"OTHER"}}var cn={};function dn(t){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(cn,"__esModule",{value:!0});cn.HttpService=void 0;function un(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function mn(t){for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:"json";return this.restFactory({url:this.BASE_URL+t,method:gn.POST,headers:e,body:n,contentType:i})}},{key:"getAsset",value:function(t,e){return this.restFactory({url:this.PREVIEW_DATA_PATH+t,method:gn.GET,headers:e})}},{key:"restFactory",value:function(t){var e=this,n=t.url,i=t.method,o=t.contentType,r=void 0===o?"json":o,s=t.body,a=t.headers,l=new Date,c=this.getPreparedFetchOptions({method:i,contentType:r,headers:a,body:s});return this.fetchData(n,c).then((function(t){return e.hydrateWithMetadata(t,l)})).catch((function(t){throw e.hydrateWithMetadata(t,l)}))}},{key:"prepareBody",value:function(t){if(null!=t)return"string"==typeof t||t instanceof Blob||t instanceof FormData||t instanceof ArrayBuffer||t instanceof URLSearchParams||t instanceof ReadableStream?t:JSON.stringify(t)}},{key:"getPreparedFetchOptions",value:function(t){var e=t.method,n=t.contentType,i=void 0===n?"json":n,o=t.body,r=t.headers;return{method:e,headers:mn({Accept:"application/json","Content-Type":"application/".concat(i)},r),credentials:"omit",body:this.prepareBody(o),redirect:"follow"}}},{key:"hydrateWithMetadata",value:function(t,e){var n=new Date;return mn(mn({},t),{},{config:{yometadata:{startTime:e,endTime:n,duration:n.getTime()-e.getTime()}}})}},{key:"fetchData",value:function(t,e){return fetch(t,e).catch((function(t){return Promise.reject({data:null,status:{code:null,message:null==t?void 0:t.message}})})).then((function(t){return t.json().then((function(e){if(null!=t&&t.ok)return{data:e,status:{code:t.status,message:t.statusText}};throw{data:null,status:{code:t.status,message:null==e?void 0:e.message}}}))}))}}],n&&fn(e.prototype,n),i&&fn(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();const vn=new(cn.HttpService=yn)("https://api-cdn.yotpo.com",""),wn={get:(t,e)=>vn.get(t,e)};const bn=new class{getBottomLineData(t,e){const n=`/v3/storefront/store/${t}/product/${e}/ratings`;return wn.get(n)}};const Sn=new class{async fetchBottomLineData(t,e,n){const i=n();t.commit("loaded",!1);const o=fe(e.isReadOnly,!1),r=fe(e.isPreview,!1),s=fe(e.isEmptyState,!1);if(o||r){const e=s?0:25,n=s?0:4.5,i=s?0:10;return t.commit("totalReviews",e),t.commit("averageScore",n),t.commit("totalSyndicatedReviews",i),void t.commit("loaded",!0)}const a=e.storeId??"",l=e.productId??"";bn.getBottomLineData(a,l).then((e=>{t.commit("totalReviews",e.data.bottomline.totalReviews),t.commit("averageScore",e.data.bottomline.averageScore),t.commit("totalSyndicatedReviews",e.data.bottomline.totalReviews-e.data.bottomline.totalOrganicReviews),i.trackWidgetLoaded({context:{bottom_lines_api:e.config.yometadata.duration,bottom_line_syndication:i.showBottomLineSyndication()}})})).catch((t=>{const e=t.response?.data?.status?.message??"Failed to fetch bottom lines";i.trackError({label:"get_bottom_lines_error",errorMessage:e}),i.trackWidgetLoaded({context:{bottom_lines_api:0}})})).finally((()=>{t.commit("loaded",!0)}))}},kn=t=>{t.effect((()=>{const e=t.get().callback,n=new IntersectionObserver((t=>{t.find((t=>t.isIntersecting||t.intersectionRatio>0))&&(e(),n.disconnect())}),{threshold:[0]}),i=t.el?t.el:null;i&&n.observe(i)}))},_n='\n\n',xn=t=>!(!t||"object"!=typeof t)&&("bottomline"in t&&"object"==typeof t.bottomline);class On{constructor(t,e){this.init(t,e)}async init(t,e){const{store:n,config:i,actions:o}=t.getStore(),r=i.isReadOnly?document.getElementsByClassName("widget-placeholder-container"):i.element,s=o(),a=(t=>{if(!t?.length)return null;try{const e=JSON.parse(t);return xn(e)?e:null}catch{return null}})(e);a&&i.staticContent[sn.CONTENT_OFFLOAD]===rn?(n.commit("totalReviews",a.bottomline.totalReviews),n.commit("averageScore",a.bottomline.averageScore),n.commit("loaded",!0),s.trackWidgetLoaded({context:{bottom_lines_api:0}})):await Sn.fetchBottomLineData(n,i,o);const l=document.head||document.getElementsByTagName("head")[0],c=l.getElementsByClassName("yotpo-reviews-star-ratings-widget-css");if(!c||0==c.length){const t=document.createElement("style");t.setAttribute("class","yotpo-reviews-star-ratings-widget-css"),l.appendChild(t),t.appendChild(document.createTextNode("\n.yotpo-reviews-star-ratings-widget {\ndisplay: flex;\n a:empty, article:empty, div:empty, dl:empty, h1:empty, h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, p:empty, section:empty, ul:empty {\n display: block;\n }\n}\n[v-cloak] {\n\tdisplay: none;\n}\n\n.yotpo-star-rating-reviews-summary-text:hover {\n cursor: pointer;\n}\n\n.yotpo-widget-clear {\n animation: none;\n animation-delay: 0;\n animation-direction: normal;\n animation-duration: 0;\n animation-fill-mode: none;\n animation-iteration-count: 1;\n animation-name: none;\n animation-play-state: running;\n animation-timing-function: ease;\n backface-visibility: visible;\n background: 0;\n background-attachment: scroll;\n background-clip: border-box;\n background-color: transparent;\n background-image: none;\n background-origin: padding-box;\n background-position: 0 0;\n background-position-x: 0;\n background-position-y: 0;\n background-repeat: repeat;\n background-size: auto auto;\n border: 0;\n border-style: none;\n border-width: medium;\n border-color: inherit;\n border-bottom: 0;\n border-bottom-color: inherit;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-bottom-style: none;\n border-bottom-width: medium;\n border-collapse: separate;\n border-image: none;\n border-left: 0;\n border-left-color: inherit;\n border-left-style: none;\n border-left-width: medium;\n border-radius: 0;\n border-right: 0;\n border-right-color: inherit;\n border-right-style: none;\n border-right-width: medium;\n border-spacing: 0;\n border-top: 0;\n border-top-color: inherit;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n border-top-style: none;\n border-top-width: medium;\n bottom: auto;\n box-shadow: none;\n box-sizing: content-box;\n caption-side: top;\n clear: none;\n clip: auto;\n color: inherit;\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-rule-color: currentColor;\n column-rule-style: none;\n column-rule-width: none;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n cursor: auto;\n direction: ltr;\n display: inline;\n empty-cells: show;\n float: none;\n font: normal;\n font-family: var(--primary-font-family);\n font-style: var(--primary-font-style);\n font-weight: var(--primary-font-weight);\n font-size: medium;\n font-variant: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n line-height: normal;\n list-style: none;\n list-style-image: none;\n list-style-position: outside;\n list-style-type: disc;\n margin: 0;\n margin-bottom: 0;\n margin-left: 0;\n margin-right: 0;\n margin-top: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 0;\n outline: 0;\n outline-color: invert;\n outline-style: none;\n outline-width: medium;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n padding-bottom: 0;\n padding-left: 0;\n padding-right: 0;\n padding-top: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: inherit;\n text-align-last: auto;\n text-decoration: none;\n text-decoration-color: inherit;\n text-decoration-line: none;\n text-decoration-style: solid;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-style: flat;\n transition: none;\n transition-delay: 0s;\n transition-duration: 0s;\n transition-property: none;\n transition-timing-function: ease;\n unicode-bidi: normal;\n vertical-align: baseline;\n visibility: visible;\n white-space: normal;\n word-break: normal;\n widows: 0;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n}\n\n.sr-only {\n clip: rect(0 0 0 0) !important;\n position: absolute !important;\n}\n"))}if(r.length&&i.isReadOnly)for(let u=0;us.showBottomLineSyndication(),isReviewsSummaryShown:()=>s.isReviewsSummaryShown(),enableAddReview(){const t=this.config.enableAddReview;return!0===t||"true"===t},isScrollOnClick(){const t=this.isReviewsSummaryFeatureOn()?this.config.bottomLineClickEnableSummaryFeatureOn:this.config.bottomLineClickEnableSummaryFeatureOff;return!0===t||"true"===t},showAverageScore(){return this.showRatingScore()&&!this.methods.showEmptyState()},averageScoreColor(){return this.config.starsColor},textColor(){return this.config.textColor},primaryFontFamily(){return this.config.primaryFont.font.family},primaryFontStyle(){return this.config.primaryFont.font.style},alignment(){return this.config.alignment},primaryFontWeight(){return this.config.primaryFont.font.weight},getAverageScoreLabel(){return`${this.store.averageScore} out of 5 star rating`},getAverageScoreLabelWithReviews(){return`${this.getAverageScoreLabel()}. ${this.methods.getBottomLineText()}`},getAdaSpanId(){return`${this.config.productId}-ada-star-ratings-text`},showVerticalReviewsNumberBorder(){const t=this.showBottomLine(),e=this.showRatingScore(),n=this.methods.showEmptyState(),i=this.shouldBreakTextLine();return t&&e&&!n&&!i},showAddReview(){return this.methods.showEmptyState()&&this.enableAddReview()},showNewReviewBtnBorder(){return this.showAddReview()&&!this.shouldBreakTextLine()},showSummaryLink(){return this.isReviewsSummaryFeatureOn()&&this.config.showSummaryLink&&this.store?.totalReviews&&(this.store.mainWidgetSummaryButtonLoaded||this.config.isPreview||this.config.isReadOnly)},showSummaryIcon(){return this.config.showSummaryButtonIcon},gradientId(t){return this.config.starsIds[t-1]},gradientUrl(t){return`url('#${this.gradientId(t)}')`},fillPercent(t){return`${100*this.fill(t)}%`},starDimensions(){return"MOBILE"===this.config.deviceType?14:15},summaryStarDimensions(){return"MOBILE"===this.config.deviceType?16:17},fill(t){return t<=this.store.averageScore+.25?1:t<=this.store.averageScore+.75?.51:0},getStarContainerClass(t){const e=this.fill(t);return`star-container ${1===e?"yotpo-sr-star-full":.51===e?"yotpo-sr-star-half":"yotpo-sr-star-empty"}`},getStarRatingsClass(){const t=`yotpo-display-${this.config.displayType.toLowerCase()}`;return["yotpo-star-ratings-widget-override-css",`yotpo-device-${this.config.deviceType.toLowerCase()}`,t]},getBreakBottomlineAlignment(){switch(this.alignment()){case"left":default:return"flex-start";case"center":return"center";case"right":return"flex-end"}},shouldBreakTextLine(){return(this.methods.getBottomLineText().length>5||"MOBILE"===this.config.deviceType)&&"product"!==this.config.sectionId},getScrollPanelStyle(){const t={display:"flex","align-items":this.getBreakBottomlineAlignment(),"flex-flow":"row wrap"};return this.shouldBreakTextLine()?Object.assign(t,{"flex-direction":"column",gap:"4px"}):t},isRTL(){return this.config.rtl},getSummaryStyle(){return t=this.shouldBreakTextLine(),e=this.getBreakBottomlineAlignment(),n=this.showAverageScore(),i=this.isRTL(),o=this.isScrollOnClick(),t?{display:"flex","flex-direction":"column","align-items":e,gap:n?"6px":"4px","margin-right":"0px",direction:i?"rtl":"ltr",cursor:o?"pointer":"initial"}:{display:"flex","flex-direction":"row","align-items":e,direction:i?"rtl":"ltr",cursor:o?"pointer":"initial"};var t,e,n,i,o},getReviewsSummaryStyle(){return{display:"flex","flex-direction":"row","font-family":this.config.primaryFont.font.family,"font-style":this.config.primaryFont.font.style,"font-weight":this.config.primaryFont.font.weight,"font-size":"16px","line-height":"28px",gap:"5px","text-decoration":"underline",cursor:"pointer",height:"28px","align-items":"center"}},getReviewsSummaryIconStyle:()=>({"align-items":"center",display:"flex"}),getReviewsSummaryTextStyle:()=>({"padding-top":"3px"}),getVerticalBorderStyle(){return{display:"flex","align-self":"center","justify-self":"center",height:"11px","border-right":"1px solid black","margin-right":(t=this.isRTL())?"0":"12px","margin-left":t?"12px":"0"};var t},getYotpoBottomlineStyle:()=>({display:"flex"}),getYotpoBottomlineTextStyle(){const t={"white-space":"nowrap","font-size":"16px","text-align":"start","font-family":this.primaryFontFamily(),"font-style":this.primaryFontStyle(),"font-weight":this.primaryFontWeight(),color:this.textColor(),"padding-top":"2px","line-height":"28px"};return this.showSummaryLink()&&Object.assign(t,{"padding-right":"10px"}),t},getBottomLineLeftPanelStyle(){return t=this.averageScoreColor(),e=this.primaryFontFamily(),n=this.primaryFontStyle(),i=this.primaryFontWeight(),o=this.isRTL(),r=this.showVerticalReviewsNumberBorder(),{display:"flex","align-self":"center",color:t,"font-family":e,"font-style":n,"font-weight":i,"font-size":"16px","margin-left":o?"0":"8px","margin-right":o?"8px":"0","margin-bottom":"1px","padding-top":r?"3px":"2px"};var t,e,n,i,o,r},getStarsStyle(){return t=this.shouldBreakTextLine(),e=this.isRTL(),t?{display:"flex","flex-direction":"row","align-items":"center","margin-left":"0",height:"28px"}:{display:"flex","flex-direction":"row","margin-left":e?"10px":"0","margin-right":e?"0":"10px","align-items":"center",height:"28px"};var t,e},getBottomLineNewReview(){return t=this.primaryFontFamily(),e=this.primaryFontStyle(),n=this.primaryFontWeight(),i=this.textColor(),{"white-space":"nowrap","font-size":"16px","line-height":"18px","text-align":"start","font-family":t,"font-style":e,"font-weight":n,color:i,"margin-left":"10px","border-left":"1px solid","padding-left":"10px",cursor:"pointer","margin-top":"7px"};var t,e,n,i},getStarContainerStyle(t){const e={display:"flex","flex-direction":"row"};if(5!==t){e[this.isRTL()?"margin-left":"margin-right"]="3.5px"}return this.isRTL()&&(e.transform="scaleX(-1)"),e},starRatingClick(){if(this.isScrollOnClick())if(this.config.bottomLineClickScrollTo==pe.SUMMARY&&this.isReviewsSummaryShown())this.clickOnReviewsSummary();else{const t=document.querySelector("#yotpo-reviews-main-widget");null!=t&&(this.methods.trackClicked({label:"widget",property:"reviews"}),t.scrollIntoView({behavior:"smooth"}))}},clickOnPostNewReview(){const t=document.querySelector(".yotpo-new-review-btn");null!=t&&(t.click(),this.methods.trackClicked({label:"widget",property:"write_review_button"}))},clickOnReviewsSummary(){const t=document.querySelector("#yotpo-summary");null!=t&&(t.click(),this.methods.trackClicked({label:"reviews_summary",property:"reviews"}))},triggerShownEvent(){if(!this.store.bottomlineLoaded||0===this.store.totalReviews&&!this.config.enableEmptyState)return;const t=(new Date).getTime()-this.config.startLoadDate.getTime();this.methods.trackAppShown({appLoadDuration:t,showBottomLineSyndication:this.showBottomLineSyndication(),isReviewsSummaryShown:this.isReviewsSummaryShown()})},triggerReviewsSummaryShownEvent(){this.methods.trackReviewsSummaryShown({isReviewsSummaryShown:this.isReviewsSummaryShown()})},setIntersection(){return{callback:this.triggerShownEvent}},setReviewsSummaryIntersection(){return{callback:this.triggerReviewsSummaryShownEvent}},setStyle(){return{display:"flex","justify-content":this.alignment(),"flex-direction":"row","margin-bottom":"5px"}},isReviewsSummaryFeatureOn(){return this.config.staticContent[sn.REVIEWS_SUMMARY]==rn}});if(d.directive("intersection",kn),r.length&&i.isReadOnly)for(let u=0;u{if(e.url&&(e.url.endsWith(".css")||Ln.some((t=>e.url.includes(t))))){const n=t.createElement("style");n.classList.add(Rn);let i="";i=`@import url('${e.url}');`,n.innerHTML=i,t.head.appendChild(n)}else{if(!e.url)return;((t,e,n)=>{const i=t.createElement("style");i.innerHTML=`\n @font-face {\n font-family: "${e.family}";\n src: url('${e.url}');\n font-display: swap;\n }`,i.classList.add(Rn),n?n.appendChild(i):t.head.appendChild(i)})(t,e,n)}};class Cn{constructor(){__publicField(this,"element"),__publicField(this,"instanceId"),__publicField(this,"productId"),__publicField(this,"merchantData"),__publicField(this,"staticContent"),__publicField(this,"overridenCustomizations"),__publicField(this,"instaceVersionId"),__publicField(this,"startLoadDate"),__publicField(this,"areFontsLoaded"),__publicField(this,"widgetUuid"),__publicField(this,"preloadedBottomline"),__publicField(this,"removedExistingWidget",!1),__publicField(this,"firstLoad",!0)}init(t){if(this.widgetUuid=on(),n.markWidgetStart(r.category,this.widgetUuid),this.startLoadDate=new Date,!t.element.classList.contains("yotpo-widget-instance"))return;{this.element=t.element,this.firstLoad=!this.element.getAttribute("data-yotpo-widget-uuid");const e=this.element.querySelector(".yotpo-reviews-star-ratings-widget");e&&(this.element.removeChild(e),this.removedExistingWidget=!0)}this.instanceId=this.element.getAttribute("data-yotpo-instance-id")||"",this.productId=this.element.getAttribute("data-yotpo-product-id")||this.element.getAttribute("data-yotpo-cart-product-id")||"",this.preloadedBottomline=yotpoWidgetsContainer.guids?.[t.merchantData.guid]?.data?.[this.productId]?.preloadedBottomline||"",this.instaceVersionId=t.metadata.instanceVersionId||"",this.merchantData=t.merchantData,this.staticContent=t.metadata.staticContent,this.areFontsLoaded=t.areFontsLoaded;const e=this.getLowerCaseKeysMap(t.metadata.customizations);this.overridenCustomizations=this.getCustomizations(e)}run(){if(void 0===this.element||null===this.element||!this.firstLoad&&!this.removedExistingWidget)return;if(this.element.setAttribute("data-yotpo-widget-uuid",this.widgetUuid),this.overridenCustomizations["mode-read-only"]){const t=document.createElement("div"),e=document.createElement("style");fe(this.overridenCustomizations["product-page-preview"],!0)&&!fe(this.overridenCustomizations["other-pages-preview"],!1)?(t.innerHTML=this.overridenCustomizations["view-preview-html-container"]||'
',e.innerHTML=this.overridenCustomizations["view-preview-style"]):(t.innerHTML=this.overridenCustomizations["view-preview-catalog-page-html-container"]||'
',e.innerHTML=this.overridenCustomizations["view-preview-catalog-page-style"]),document.getElementsByTagName("head")[0].appendChild(e),this.element.parentNode&&this.element.parentNode.appendChild(t)}const t=new an(this.element,this.widgetUuid,this.overridenCustomizations,this.staticContent,this.merchantData.guid,this.productId,this.instanceId,this.instaceVersionId,{startLoadDate:this.startLoadDate});t.awaitInitComplete().then((()=>{const{config:e}=t.getConfig();if(!this.areFontsLoaded){const t={family:e.primaryFont.font.family,url:e.primaryFont.font.url};n=document,i=this.element.parentElement,(o=[t])&&o.forEach((t=>Tn(n,t,i)))}var n,i,o;this.element.parentNode&&this.overridenCustomizations["mode-read-only"]&&this.element.parentNode.removeChild(this.element),t.awaitSummaryButtonAppear(),new On(t,this.preloadedBottomline)}))}getLowerCaseKeysMap(t){const e={};return Object.keys(t).forEach((n=>{e[n.toLowerCase()]=t[n]})),e}getCustomizations(t){const e=this.getQueryParams(),n=this.getElementAttributes();(t={...t,...n,...e})["mode-read-only"]&&(fe(t["product-page-preview"],!0)&&!fe(t["other-pages-preview"],!1)?t["data-yotpo-section-id"]=me.PRODUCT:t["data-yotpo-section-id"]=me.CATEGORY);return this.overrideCustomizationsBySection(t)}getElementAttributes(){const t={};for(let e=0,n=this.element.attributes,i=n.length;e{if(!t.includes(e)){const t=e.split("="),i=decodeURIComponent(t[0]).toLowerCase(),o=decodeURIComponent(t.length>1?t[1]:"");n[i]=o}})),n}overrideCustomizationsBySection(t){const e={};return t["data-yotpo-section-id"]||=me.PRODUCT,ge.forEach((n=>{he(t)?e[n]=t[`${n}-category`]:e[n]=t[`${n}-product`],delete t[`${n}-product`],delete t[`${n}-category`],e[n]||=t[n]})),he(t)&&(e["add-review-enable"]=!1,e["bottom-line-click-enable-summary-feature-on"]=!1,e["bottom-line-click-enable-summary-feature-off"]=!1),{...t,...e}}}"undefined"!=typeof yotpoWidgetsContainer&&(n.markWidgetLoaded(r.category),yotpoWidgetsContainer.ReviewsStarRatingsWidget=()=>new Cn)}();