(()=>{function e(e,t){const{elementWithPrice:n,lowestPrice:r}=e;let[o,s]=v(r);const{secondBlock:c,secondMsgBase:i,checkWarehouseFix:a}=z;if(s<2||Number.isNaN(s)){if(!z.secondBlock||"1"!==(null==q?void 0:q.initialnofparcelas))return;[t=D,o,s]=[D,"",0]}let l=A(J,t,o,s);c&&i&&(l=p(r,l));const u=n.closest("div"),{display:d,fontSize:f,textAlign:m,flexDirection:g}=getComputedStyle(u);a&&(u.style.display="block"),"0px"==f&&(u.style.fontSize="initial"),d.includes("flex")&&"row"==g&&"center"==m&&(u.style.justifyContent="center"),u.style.flexWrap="wrap!important",u.append(l)}function t(o=document.body,c=!1){const i=function(e,t){var n;const r=F("[data-scala]");if(r.length)return[...r];const o=e[T](" :is([class*='price'i],[class*='money'],[class*='sale']):not([class*='price-facet'])"),s=[];let c,i;for(let a=0;a0&&(t=Math.min(t,e))}return t}(r);return isFinite(s)?e.concat({elementWithPrice:t,lowestPrice:s}):e}let c=null;const i="[data-cart-subtotal],.ajax-cart__subtotal .money, .total span.price, .h1.cart-subtotal--price, .mini-cart__recap-price-line > span:last-of-type, .totals__subtotal-value,.cart-drawer .totals__total-value, .t4s-cart__totalPrice,cart-drawer .cart_total",a=["click","mouseenter"];function l(){const e=I("[href='/cart'], cart-drawer-component, .cart-icon, .cart-link, .header__cart-toggle,.header__btn-cart, .header__icon--cart, .header-cart");[...F("[action^='/cart/add']"),e].forEach(e=>{a.forEach(t=>null==e?void 0:e.addEventListener(t,f,{passive:!0}))})}let u=0,d=0;function f(e){const t=e.currentTarget,n=I(i);if(L.contains(c))return void a.forEach(e=>null==t?void 0:t.removeEventListener(e,f));if(!(null==n?void 0:n.textContent))return null==t||t.removeEventListener(e.type,f),void("click"==e.type&&u<10&&(u++,d=setTimeout(()=>f(e),300)));clearTimeout(d);const r=O({baseMsg:!0,includesCurrency:j(n.textContent)}),o=R.test(n.textContent),s=U(n.textContent,o),[l,m]=v(s);c=A(G,r,l,m),s>0&&m>=2&&(n.append(c),n.style.flexWrap="wrap",z.secondBlock&&z.secondMsgBase&&(c=p(s,c)));F(".ajax-cart--mini-cart, .mini-cart, .cart-popup-content, .popup-cart,.cart-drawer, #t4s-mini_cart").forEach(e=>function(e,t){new MutationObserver((n,r)=>{if(r.disconnect(),!e.contains(c)){const e=I(i);if(!(null==e?void 0:e.textContent))return;let n=e.textContent;if(n=U(n,t),n>0){const[t,r]=v(n);if(r<2||Number.isNaN(r))return;c=A(G,z.blockMsgBase,t,r),z.secondBlock&&z.secondMsgBase&&(c=p(n,c)),e.append(c),e.style.flexWrap="wrap"}}r.observe(e,N)}).observe(e,N)}(e,o))}function p(e,t){const n=null==q?void 0:q.initialnofparcelas,r=z.secondMsgBase.cloneNode(!0),[o,s]=v(e,!0);if(s<(1==Number.parseInt(null!=n?n:"2")?1:2)||Number.isNaN(s))return t;const c=A("parcelator2",r,o,+s);return t.append(c),t}function m(e=-1){var t;const{mountedMsg:n,secondBlock:r,firstBlock:o,secondMsgBase:s}=z,{myPrice:c,myPriceCur:i,splitPrices:a,splitPricesCur:l,initialnofparcelas:u,divisorArr:d}=q;if(!(r&&o&&s&&u))return;if(!n)return;const f=null==(t=n.textContent)?void 0:t.includes(V.shopCurrencyIsoCode);if(z.mountedSndMsg||(z.mountedSndMsg=A("parcelator2",s,f?i:c,+u)),e>-1){const t=K(a),n=K(d),r=K(l),o=t[e],c=r[e],i=n[e];if(z.mountedSndMsg=A("parcelator2",s,f?c:o,+i),!o||+o<=0)return void z.mountedSndMsg.remove()}L.contains(z.mountedSndMsg)&&z.mountedSndMsg.remove(),n.append(z.mountedSndMsg)}function v(e,t=!1){const{minPrice:n,maxPrice:r}=V,{jurosName:o,jurosArr:s,minInstallmentPrice:c}=t?q:V,i=t?null==q?void 0:q.initialnofparcelas:V.nParcelas,{discount:a}=null!=q?q:{};if(eparseInt(r))return["",NaN];if(t&&[s,i,c,a].some(e=>!e))return["",NaN];const l=parseFloat(a),u=.002945*e,d=null==o?void 0:o.includes("mercadoPago"),f=s.split(","),p=+c;let m=+i;const v=parseFloat(f[m-1]);let g=v>0?e*v:e;if(t){if(1==m){const t=e*parseFloat(a)/100;return[z.formatter.format(t).trim(),1]}g*=l}d&&v>1&&(g-=u);let h=g/m;if(h1&&(r-=u),h=r/m}h/=100;return[z.formatter.format(h).trim(),m]}function g(){const e=F("[class*='total'i],[id*='total'i],[data-subtotal],.cart-recap__price-line-price"),{priceToMatch:t,priceToMatchCur:n}=V,r=[...e].findLast(e=>e.offsetParent&&[t,n].some(t=>{var n;return null==(n=e.textContent)?void 0:n.includes(t)}));if(!r)return;const o=O({baseMsg:!1,includesCurrency:j(r.textContent)});z.mountedMsg=A(G,o);if(getComputedStyle(r).display.includes("flex")){const e=r.closest("div");e.style.alignItems="flex-start",e.style.flexWrap="wrap"}m(),r.append(z.mountedMsg),W("load",()=>{r&&function(e){let t=e.closest("form");(null==t?void 0:t.classList.value.includes("Cart Cart--expanded"))&&(t=t.parentElement);if(!t&&(t=e.closest(".shopify-section, [class^='cart__footer']"),!t))return;const n=`.${G}`;if(!document.contains(e)||!I(n))return void g();const r=function(){var r;this.disconnect();if(!t[_](n)){let t=Object.values(e.classList).join(".");if(t)t=`.${t}`;else for(const r of e.attributes){const e=r.value?`=${r.value}`:"";t+=` [${r.name}${e}]`}const n=`${e.tagName}:is(${t})`,o=I(n);if(!o)return;const s=getComputedStyle(o);let c=null!=(r=o.textContent)?r:"0";if(c=U(c,R.test(c)),c>0){const e=O({baseMsg:!0,includesCurrency:j(o.textContent)}),[t,n]=v(c);if(n<2)return;let r=A(G,e,t,n);if(s.display.includes("flex")){o.closest("div").style.flexWrap="wrap",r.classList.add("sc-w-full")}z.secondBlock&&z.secondMsgBase&&(r=p(c,r)),o.append(r)}}this.observe(t,N)};new MutationObserver(r).observe(t,N)}(r)})}function h(e){return 1==e.childElementCount?e.firstElementChild:e}function y(e){var t,n;const{comparePrice:r,comparePriceCur:o}=V;let s=e.parentElement;if(s.matches("[data-pf-type='ProductPrice2']"))return s;if(b(s)||b(e))return e;const c=L.createElement("span");c.append(D),c.setAttribute("id",`${H}Position`),s.append(c);const i="center"==getComputedStyle(e).textAlign;let a,l=s;for(;!a;){const n=[...l.children];if(a=null!=(t=n.find(e=>e.innerText.includes(r)||e.innerText.includes(o)))?t:n.find(e=>{var t,n;return(null==(t=e.textContent)?void 0:t.includes(r))||(null==(n=e.textContent)?void 0:n.includes(o))}),l=l.parentElement,b(l)){a=e;break}}let u=x(e,i);const d=x(a,i);d.x80;for(c.remove(),p&&(s=s.closest("div, ul, form"));!s.contains(a);)if(s=s.parentElement,b(s))return e;const m=function(e){const t=/cc-animate|loading|pt-price|price h4-style on-sale/,n=e.classList.value;if(t.test(n))return"price h4-style on-sale"==n?e.parentElement.parentElement:e.parentElement;return null}(s);return null!=(n=null!=m?m:s)?n:e}function b(e){return!(!(null==e?void 0:e[_]("form"))&&!(null==e?void 0:e.matches("form")))}function x(e,t){let{x:n,y:r,width:o}=e.getBoundingClientRect();return t&&(n+=o/2),{x:n,y:r}}function C(){var e,t,n;const{priceToMatch:r,priceToMatchCur:o,productTitle:s}=V,c=null!=(e=I("div[data-pf-type*='ProductPrice'] [data-product-type='price']"))?e:I("[data-pf-type*='ProductPrice']");if(c)return c;const i=[...F(":is(span,p,ins,sale-price,[data-pr-price]):not([class^='sc-'],.money-subtotal)")];let a=i.filter(e=>{var t;return null==(t=e.textContent)?void 0:t.includes(r)});if(a.length||(a=i.filter(e=>{var t;return null==(t=e.textContent)?void 0:t.includes(o)})),a.length||(a=[...F("div,[class*='price'],strong")].filter(e=>{var t;return!e.childElementCount&&(null==(t=e.textContent)?void 0:t.includes(r))})),a.length>1){const e=/sc-|tag|label|badge|savings|sticky|mini-cart|CartItem|button|quantity-break/i,t="[class*='sticky-cart'i],[class*='sticky-atc'],[class*='cart-sticky'i],[id*='stickyprice'i],[id*='sticky_add_to_cart'],cart-drawer,.product-quick-add,sticky-atc,.minicart,.mini_cart_wrap,#shopify-section-announcement,predictive-search";a=a.filter(n=>{const r=`${n.parentElement.classList.value} ${n.parentElement.parentElement.classList.value}`;return!n[_]("form, button")&&!e.test(r)&&!n.closest(t)})}if(a.length||(a=i.filter(e=>{var t;return null==(t=e.textContent)?void 0:t.includes(o)})),a.length<2)return a.pop();let l=[...F(" :is(main,body) h2")].find(e=>e.textContent==s);if(!l){const e=[...F(":is(main, body) :is(h1,h2), [data-pf-type='ProductTitle'], h3.product-single__title > a, [id^='ProductInformation'] :is(h1,h2,h3,h4,h5,h6,p)")];l=null!=(n=null!=(t=e.find(e=>e.textContent==s))?t:e.find(e=>{var t;return null==(t=e.textContent)?void 0:t.includes(s)}))?n:e.find(e=>{var t;return null==(t=e.textContent)?void 0:t.includes(s.trim().replace(/\s+/g," "))})}if(!l)return void(window.scalaerror="missingtitle");const{x:u,y:d}=x(l),{scrollX:f,scrollY:p}=window;let m=a.pop(),v=x(m);for(const g of a){const{x:e,y:t}=x(g),{x:n}=g.offsetParent?x(g.offsetParent):{x:0};if(t+p<=0||e+f<=0||n<0)continue;0==v.y&&(m=g,v={x:e,y:t});Math.abs(e-u)+Math.abs(t-d){const n=R.test(t),r=U(t,n);return r>0&&(e.push(r),y&&!n&&e.push(r+y)),e},[]),x=u.findIndex(e=>{const t=U(e,!0);return b.findIndex(e=>e==t)>-1});if(-1==x)return;const C=u[x],M=d[x],w=null!=(n=f[x])?n:0;let S;if(S=+w<2?A(Z,D.cloneNode()):A(Z,z.blockMsgBase,M,+w),L.contains(z.mountedMsg))return z.mountedMsg.replaceWith(S),z.mountedMsg=S,null==(r=z.scalaTabela)||r.refresh(x),m(x),!0;let E=e;for(;!E.firstElementChild;)E=E.parentElement;const k=P.targetParent;let N=k;return L.contains(k)||(N=null!=(o=Array.from(E[T]("span, ul")).filter(e=>{var t;return(null==(t=e.textContent)?void 0:t.includes(C))&&e.offsetParent}).pop())?o:E.closest("ul, div")),N?(N.insertAdjacentElement("afterend",S),z.mountedMsg=S,null==(s=z.scalaTabela)||s.refresh(x,z.mountedMsg),m(x),!0):void 0}};function M(e=!1){var t;const n=C();if(!n)return;const r=j(n.textContent);let o=O({baseMsg:!1,includesCurrency:r});(Number.parseInt(V.myPrice)<=0||z.hideFirstShowSnd)&&(o=D);const s=A(Z,o);let c=z.isOnSale?y(n):n.parentElement;if(b(c)&&(c=n),"UL"==c.tagName?c.after(s):c.append(s),z.mountedMsg=s,w(c),m(),e)return;let i=null!=(t=c.closest("[data-scala-observe], product-price"))?t:c.closest("section, div:not([class*='price'])");if(!i)for(i=c.offsetParent;!i[_]("span");)i=i.offsetParent;z.observeTarget=i,z.productObserver=new MutationObserver(P.start(c,r)),window.customElements.get("scala-tabela")?S():W("scalaTableDefined",S,{once:!0}),W("load",E,{once:!0})}function w(e){const{display:t,flexFlow:n,fontSize:r}=getComputedStyle(e);"0px"==r&&(e.style.fontSize="initial"),t.includes("flex")&&(n.includes("column")?z.mountedMsg&&(z.mountedMsg.style.order="999"):e.style.flexFlow="wrap")}function S(){z.scalaTabela=L.createElement("scala-tabela"),z.scalaTabela.mount(z.mountedMsg)}function E(e,t=!1){var n;if(!L.contains(z.observeTarget)||!L.contains(null!=(n=z.mountedMsg)?n:null))return M(!0),z.scalaTabela&&z.scalaTabela.mount(z.mountedMsg),void(t||E(e,!0));k(),z.productObserver.observe(z.observeTarget,N)}function k(){const e=I(V.recommendation);e&&(e.innerText&&t(e),new MutationObserver((n,r)=>{r.disconnect();e[_](X)||t(e),r.observe(e,N)}).observe(e,N))}const N={childList:!0,subtree:!0,attributes:!1},_="querySelector",T="querySelectorAll",B="getElementById",L=document,I=L[_].bind(document),F=L[T].bind(L),W=window.addEventListener.bind(window);function A(e,t,n,r){const o=t.cloneNode(!0),s=o[_]("#parcela"),c=o[_]("#parcelas");n&&s&&(s.outerHTML=n),r&&c&&(c.outerHTML=r.toString());const i=Y.cloneNode();return i.classList.add(e),i.append(o),i}function O({baseMsg:e,includesCurrency:t}){let{blockMsgBase:n,msgWithPriceCur:r,msgWithPrice:o}=z;return e||(n=t?r:o),n}function j(e){return null==e?void 0:e.includes(V.shopCurrencyIsoCode)}const D=L.createElement("p"),R=/\d[,|.]\d{2}([\s]|[A-Z]{3}|$)/;function U(e,t){var n;const r=null!=(n=null==e?void 0:e.split(V.currencySymbol).map(e=>e.replace(z.removeSeparators,"").trim()).filter(e=>!isNaN(parseInt(e))).join())?n:null;if(!r)return 0;const o=t?1:100;return parseInt(r)*o}var z={},V={},q={};const H="parcelator",X="#"+H,Y=L.createElement("span");Y.setAttribute("id",H);const Z=`${H}Product`,G=`${H}Cart`,J=`${H}Collection`;function K(e=""){return e.split("|").slice(0,-1)}W("DOMContentLoaded",function(){z=function(){const e="false",t=L[B](`${H}attr`),n=L[B](`${H}attr2`);V=t.dataset;let{myPrice:r=e,comparePrice:o=e,shopLocale:s=Shopify.locale,shopCurrencyIsoCode:c,moneyFormat:i}=V;const[a,l,u]=[...t.content.children].map(h);s=s.padEnd(5,`-${c.slice(0,2)}`),"BRL"==c&&(s="pt-BR");const d=null==i?void 0:i.includes("amount_no_decimals");return{formatter:new Intl.NumberFormat(s,{style:"currency",currency:c,currencyDisplay:"narrowSymbol",minimumFractionDigits:d?0:void 0,maximumFractionDigits:d?0:void 0}),shopLocale:s,blockMsgBase:a,removeSeparators:new RegExp(`[,|.|+|${c}]`,"g"),msgWithPrice:l,msgWithPriceCur:u,shouldShowPrice:r!=e,isOnSale:o!=e,recursion:0,firstBlock:t,secondBlock:n,checkWarehouseFix:!!I(".price-list")}}(),q=function(e){if(!e.secondBlock)return{};const t=e.secondBlock.dataset,[n,r]=[...e.secondBlock.content.children].map(h);return e.secondMsg=r,e.secondMsgBase=n,t}(z);const{template:e,priceToMatch:n}=V,{shouldShowPrice:r}=z;switch(!0){case e.includes("product"):r||"1"!=(null==q?void 0:q.initialnofparcelas)||(z.hideFirstShowSnd=!0),!r&&"1"!=(null==q?void 0:q.initialnofparcelas)||I("parcelatorProduct")||M(),l();break;case e.includes("cart"):r&&Number.parseFloat(n)>0&&g();break;default:I("template[data-hide-collection]")||function(){"function"==typeof $&&$(L).ajaxComplete(()=>{t()});t(L.body,!0)}(),l()}},{once:!0})})();