mk-sdk-git 1.1.73 → 1.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mk-core.js +1 -1
- package/dist/mk-sdk.js +1 -1
- package/package.json +1 -1
- package/src/platforms/vtex.js +47 -16
package/dist/mk-core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var Vr=Object.defineProperty;var v=(t,e)=>{for(var r in e)Vr(t,r,{get:e[r],enumerable:!0})};var Pt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Wr={},Y=null;function Mt(){if(Y)return Y;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(a){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Wr.collectorUrl||Pt.collectorUrl;return Y={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||Pt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||Pt.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,cartRedirect:!(window.__MK&&window.__MK.cartRedirect===!1),cartBehavior:window.__MK&&window.__MK.cartBehavior||null,cartOpenSelector:window.__MK&&window.__MK.cartOpenSelector||null,autoTrack:e("data-mk-no-autotrack")===null,batchIntervalMs:window.__MK&&window.__MK.batchIntervalMs||8e3,batchMaxSize:window.__MK&&window.__MK.batchMaxSize||20,engagementIntervalMs:15e3},Y}function g(){return Y||Mt()}function w(...t){let e=g();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var ke="_mk_vid",Se="_mk_sid",Z=null,Q=null;function st(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Te(){if(Z)return Z;try{let t=localStorage.getItem(ke);return t||(t="v_"+st(),localStorage.setItem(ke,t)),Z=t,t}catch(t){return Z="v_"+st(),Z}}function Ae(){if(Q)return Q;try{let t=sessionStorage.getItem(Se);return t||(t="s_"+st(),sessionStorage.setItem(Se,t)),Q=t,t}catch(t){return Q="s_"+st(),Q}}var Ee=[/email/i,/e-?mail/i,/cpf/i,/cnpj/i,/phone/i,/telefone/i,/celular/i,/address/i,/endereco/i,/cep/i,/zip/i,/card/i,/cartao/i,/cvv/i,/password/i,/senha/i,/token/i,/\bnome\b/i,/fullname/i,/firstname/i,/lastname/i,/sobrenome/i,/birth/i,/nascimento/i,/rg\b/i],Le={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},jt=2e3;function Ie(t){for(let e=0;e<Ee.length;e++)if(Ee[e].test(t))return!0;return!1}function Re(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>jt?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Ie(r))continue;let n=t[r];if(Le[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>jt){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Jr(n);continue}e[r]=n}return e}function Jr(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Ie(r))continue;let n=t[r];if(Le[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>jt){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var ut=[],Ot=null,z=null,Nt="1.1.73",Gr=["off","pdp_tryon","pdp","all","tryon_engaged"],tt,Bt=null,F="unknown",U=[],D=null;function Me(){let t=g();return"mk_engaged_"+(t&&t.projectId||"")}function qt(){if(D!==null)return D;try{D=localStorage.getItem(Me())==="1"}catch(t){D=!1}return D}function Dt(){if(!qt()){D=!0;try{localStorage.setItem(Me(),"1")}catch(t){}dt(!1)}}var Xr=/^purchase$/;function je(t,e){if(tt===void 0)return"hold";if(tt==="off")return"drop";if(tt==="all"||e&&Xr.test(e))return"collect";switch(tt){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(qt())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":F==="available"?"collect":F==="unavailable"?"drop":"hold";default:return"collect"}}function dt(t){if(!U.length)return;let e=[];for(let r of U){let n=je(r._pt,r.name);n==="collect"?Ne(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}U=e}function zt(t){tt=Gr.indexOf(t)>=0?t:"all",dt(!1)}function Oe(t){F=t==="available"?"available":"unavailable",dt(!1)}function Be(t){dt(!0),z=t,Bt=t&&t.pageType||null,F="unknown"}function p(t,e,r){if(!g().projectId){(p._pre=p._pre||[]).push({name:t,params:e,ts:r||Date.now()}),p._pre.length>50&&p._pre.shift();return}if(p._pre&&p._pre.length){let o=p._pre;p._pre=[];for(let i of o)Pe(i.name,i.params,i.ts)}Pe(t,e,r)}function Pe(t,e,r){let n=je(Bt,t);if(n==="collect"){Ne(t,e,r);return}if(n==="drop"){w("descartado (escopo)",t);return}U.push({name:t,params:e,ts:r||Date.now(),_pt:Bt}),U.length>300&&U.shift()}function Ne(t,e,r){let n=g(),o=Re(e||{}),i="page_"+Yr(t);if(ut.push({name:i,ts:r||Date.now(),params:o}),w("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:z?{pageType:z.pageType,platform:z.platform,url:z.url}:null},"*")}catch(a){}if(ut.length>=n.batchMaxSize){j();return}Ot||(Ot=setTimeout(()=>{Ot=null,j()},n.batchIntervalMs))}function Yr(t){if(typeof t!="string"||!t)return"unknown";let e=t.replace(/^on/,"");return e=e.replace(/[A-Z]/g,(r,n)=>(n>0?"_":"")+r.toLowerCase()),e.indexOf("page_")===0&&(e=e.slice(5)),e}function j(t){if(ut.length===0)return;let e=g();if(!e.projectId||!e.collectorUrl)return;let r=ut.splice(0,50),n=F==="available"?!0:F==="unavailable"?!1:void 0,o=JSON.stringify({product:e.product||void 0,sdkVersion:Nt,visitorId:Te(),sessionId:Ae(),engaged:qt()||void 0,tryonAvailable:n,events:r,site:z||void 0}),i=e.collectorUrl+"/v1/track";try{fetch(i,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:o}).catch(()=>{})}catch(a){try{navigator.sendBeacon&&navigator.sendBeacon(i+"?projectId="+encodeURIComponent(e.projectId),new Blob([o],{type:"text/plain"}))}catch(c){}}}function qe(){try{window.addEventListener("pagehide",()=>j(!0)),window.addEventListener("beforeunload",()=>j(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&j(!0)})}catch(t){}}function E(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(a){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let a of i){if(!a||!a["@type"])continue;let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];(!t||t.some(l=>c.includes(l)))&&e.push(a)}}}catch(r){}return e}var De=["off","pdp_tryon","pdp","all","tryon_engaged"],Zr="all",Qr=30*60*1e3,O=null;function K(){if(O)return O;let t=g();return!t.projectId||!t.apiUrl?(O=Promise.resolve(null),O):(O=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>{if(!e.ok)throw new Error("http "+e.status);return e.json()}).then(e=>e&&e.project||e||null).catch(()=>(O=null,null)),O)}function ze(t){let e=t&&t.analytic&&t.analytic.scope;return De.indexOf(e)>=0?e:Zr}var Ue=t=>"mk_scope_"+t;function Fe(t){try{let e=localStorage.getItem(Ue(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:De.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function Ke(t,e){try{localStorage.setItem(Ue(t),JSON.stringify({scope:e,exp:Date.now()+Qr}))}catch(r){}}var Kt={};v(Kt,{addToCart:()=>mn,detect:()=>un,getCartSummary:()=>fn,id:()=>ln,openCartDrawer:()=>hn,resolveSku:()=>dn,skipRedirect:()=>sn});var pt={};v(pt,{addToCart:()=>rn,detect:()=>en,getCartSummary:()=>Ft,id:()=>tn,openCartDrawer:()=>cn,resolveSku:()=>Ut});var tn="shopify";function en(){return!!(window.Shopify||window.ShopifyAnalytics)}function Ut(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var ft=t=>String(t==null?"":t).trim().toLowerCase();async function rn({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let a=(await fetch("/products/"+o+".js").then(f=>f.json())).variants||[],c=f=>[f.option1,f.option2,f.option3].concat(String(f.title||"").split("/")).map(ft).filter(Boolean),l=(f,A)=>c(f).indexOf(ft(A))>=0,s=f=>(!t||l(f,t))&&(!e||l(f,e)),u=null;if((t||e)&&(u=a.find(f=>s(f)&&f.available)||a.find(s)),!u&&r&&(u=a.find(f=>ft(f.sku)===ft(r))),u||(u=a.find(f=>f.available)||a[0]),!u)throw new Error("shopify: variante n\xE3o encontrada");let h=$e(),d=null;if(h&&typeof h.getSectionsToRender=="function")try{d=h.getSectionsToRender().map(f=>({id:f.id,selector:f.selector||"#"+f.id})).filter(f=>f.id)}catch(f){}let y={items:[{id:u.id,quantity:n||1}]};d&&d.length&&(y.sections=d.map(f=>f.id).join(","),y.sections_url=location.pathname);let m=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!m.ok)throw new Error("shopify: /cart/add.js HTTP "+m.status);let b=await m.json().catch(()=>({}));return h&&d&&b.sections&&nn(h,d,b.sections),{platform:"shopify",variantId:u.id,size:u.title,sku:u.sku||null}}function $e(){return document.querySelector("cart-drawer, cart-notification")}function nn(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let c=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=c?c.innerHTML:null}let a=document.querySelector(n.selector);a&&i!=null&&(a.innerHTML=i)}catch(i){}}}async function Ft(){try{let t=await fetch("/cart.js",{headers:{Accept:"application/json"}}).then(e=>e.json());return{value:(Number(t.total_price)||0)/100,itemCount:Number(t.item_count)||0,currency:t.currency||null}}catch(t){return null}}var on=["[data-cart-drawer-toggle]",'[data-action="open-cart-drawer"]','[data-action="open-cart"]',".js-cart-drawer-open",".js-drawer-open-cart",".cart-drawer-toggle",".js-cart-toggle",'[aria-controls="CartDrawer"]','[aria-controls="cart-drawer"]',"#cart-icon-bubble","#lk-cart-icon",".header__cart",".site-header__cart",".cart-link",".header-cart",'a[href="/cart"]','a[href$="/cart"]'];function an(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function cn(){let t=$e();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of on)try{if(e=[...document.querySelectorAll(r)].find(an),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var ln="zerezes",sn=!0;function un(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var dn=Ut,fn=Ft;function pn(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function mn(){let t=pn();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function hn(){return!0}var Ht={};v(Ht,{addToCart:()=>bn,detect:()=>gn,getCartSummary:()=>xn,id:()=>yn,resolveSku:()=>wn});var yn="hybris";function gn(){return!!(window.ACC&&window.ACC.config)}function wn(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var He=t=>String(t==null?"":t).trim().toLowerCase();async function bn({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(y=>y.getAttribute&&y.getAttribute("data-code")),n=t?r.find(y=>He(y.textContent)===He(t)):null;n||(n=r.find(y=>y.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),a=i&&i.querySelector('[name="CSRFToken"]'),c=a&&a.value,l=i&&i.getAttribute("action")||"/cart/add";if(!c)throw new Error("hybris: CSRFToken n\xE3o encontrado");let s=new URLSearchParams;s.set("productCodePost",o),s.set("qty",String(e||1)),s.set("CSRFToken",c);let u=await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:s.toString()});if(!u.ok)throw new Error("hybris: "+l+" HTTP "+u.status);let h=null,d=null;try{let y=await u.clone().json(),m=y&&y.cartData;m&&(h=$t(m.total!=null?m.total:m.totalPrice),d=m.totalUnitCount!=null?Number(m.totalUnitCount):Array.isArray(m.products)?m.products.length:null)}catch(y){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:h,itemCount:d,currency:"BRL"}}function $t(t){if(t==null||t==="")return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?parseFloat(e.replace(/\./g,"").replace(",",".")):parseFloat(e.replace(/,/g,""));return Number.isFinite(r)?r:null}async function xn(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(a=>a.ok?a.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?$t(r.textContent):null,o=e.querySelector(".mini-badge"),i=o?parseInt(o.textContent,10)||0:null;return n==null&&i==null?null:{value:n,itemCount:i,currency:"BRL"}}catch(t){}try{let t=[".minicart-total .price",".js-cart-total",".cart-total",".total-price",".grand-total"];for(let e of t){let r=document.querySelector(e),n=r&&$t(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var Vt={};v(Vt,{addToCart:()=>kn,detect:()=>vn,getCartSummary:()=>Sn,id:()=>_n,resolveSku:()=>Cn});var _n="vtex";function vn(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function Cn(){let t=window;if(t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0])return{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"};if(t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0])return{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"};try{let e=document.querySelector('meta[property="product:sku"]'),r=e&&(e.getAttribute("content")||"").trim();if(r)return{value:String(r),source:"vtex/og-sku"}}catch(e){}return null}var mt=t=>String(t==null?"":t).trim().toLowerCase();async function kn({size:t,quantity:e}){let r=window.skuJson_0&&window.skuJson_0.skus||[];if(!r.length)throw new Error("vtex: skuJson_0 indispon\xEDvel");let n=i=>mt(i.skuname)===mt(t)||i.dimensions&&Object.values(i.dimensions).some(a=>mt(a)===mt(t)),o=t?r.find(i=>n(i)&&i.available)||r.find(n):null;if(o||(o=r.find(i=>i.available)||r[0]),!o)throw new Error("vtex: variante n\xE3o encontrada");if(window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart)return await window.vtexjs.checkout.addToCart([{id:parseInt(o.sku,10),quantity:e||1,seller:"1"}]),{platform:"vtex",skuId:o.sku,size:o.skuname||t};throw new Error("vtex: vtexjs.checkout indispon\xEDvel")}function Sn(){try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}return null}var Wt={};v(Wt,{addToCart:()=>In,detect:()=>En,getCartSummary:()=>Pn,id:()=>Tn,openCartDrawer:()=>Rn,resolveSku:()=>Ln,skipRedirect:()=>An});var Tn="nuvemshop",An=!0;function En(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function Ln(){try{let t=window.LS,e=t&&t.variants||[],r=document.querySelector('[name="variant_id"]'),n=r&&r.value?e.find(o=>String(o.id)===String(r.value)):null;if(n||(n=e.find(o=>o.available!==!1&&o.sku)||e.find(o=>o.sku)||e[0]),n&&n.sku)return{value:String(n.sku),source:"nuvemshop/variant"};if(t&&t.product&&t.product.sku)return{value:String(t.product.sku),source:"nuvemshop/product"}}catch(t){}return null}var ht=t=>String(t==null?"":t).trim().toLowerCase();async function In({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let c=String(r).replace(/["\\]/g,""),l=document.querySelector('[data-product-id="'+c+'"]'),s=l&&l.querySelector("form[action]"),u=s&&s.getAttribute("action")||"/comprar/",h=window.LS;if(h&&typeof h.addToCartEnhanced=="function")try{let m=document.createElement("form");m.setAttribute("action",u),m.setAttribute("method","post");let b=document.createElement("input");return b.type="hidden",b.name="add_to_cart",b.value=c,m.appendChild(b),document.body.appendChild(m),h.addToCartEnhanced(m),setTimeout(()=>{try{m.remove()}catch(f){}},3e3),{platform:"nuvemshop",productId:c,via:"gallery-enhanced"}}catch(m){}let d=!1,y=null;try{let b=await(await fetch(u,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(c)+"&quantity="+(e||1)})).json().catch(()=>({}));d=!!b.success,y=b.error_code||null}catch(m){}return{platform:"nuvemshop",productId:c,via:"gallery",added:d,reason:y}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(c=>{let l=[...c.options].find(s=>ht(s.textContent).includes(ht(t))||ht(s.value)===ht(t));l&&(c.value=l.value,c.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(c=>setTimeout(c,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(c=>setTimeout(c,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function Rn(){try{if([...document.querySelectorAll('#ajax-cart-details, .modal-cart, [class*="cart-modal" i], [class*="modal-cart" i]')].find(o=>{try{return o.getBoundingClientRect().width>0&&getComputedStyle(o).display!=="none"}catch(i){return!1}}))return!0;let r=[...document.querySelectorAll('[data-toggle="#modal-cart"], [data-toggle*="cart" i], #ajax-cart a.js-modal-open, .cart-summary a.js-modal-open, .js-toggle-cart')],n=r.find(o=>{let i=o.getBoundingClientRect();return i.width>0&&i.height>0})||r[0];if(n)return setTimeout(()=>{try{n.click()}catch(o){}},300),!0;if(window.LS&&typeof window.LS.toggleCart=="function")return setTimeout(()=>{try{window.LS.toggleCart()}catch(o){}},300),!0}catch(t){}return!1}function Pn(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,a)=>i+(Number(a.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var Jt={};v(Jt,{addToCart:()=>Nn,detect:()=>On,getCartSummary:()=>qn,id:()=>Mn,openCartDrawer:()=>zn,resolveSku:()=>Bn,skipRedirect:()=>jn});var Mn="wake",jn=!0;function On(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function Bn(){try{let t=document.querySelector('input[name="product-id"], [data-product-id]'),e=t?t.value||t.getAttribute("data-product-id"):null;if(e)return{value:String(e).trim(),source:"wake/product-id"};let r=(location.pathname||"").match(/-(\d+)\/?(?:[?#]|$)/);if(r)return{value:r[1],source:"wake/url"}}catch(t){}return null}var Ve=t=>String(t==null?"":t).trim().toLowerCase();async function Nn({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(a=>Ve(a.getAttribute("attribute-value"))===Ve(t));if(i){try{i.checked=!0}catch(a){}try{typeof window.selectAttribute=="function"?window.selectAttribute(i):i.click()}catch(a){}await new Promise(a=>setTimeout(a,600))}}let r=document.querySelector('[name="product-variant-id"]'),n=r&&r.value;if(!n)throw new Error("wake: product-variant-id n\xE3o encontrado");if(typeof window.addOrCreateCheckout!="function")throw new Error("wake: addOrCreateCheckout indispon\xEDvel");if(!await window.addOrCreateCheckout([{productVariantId:Number(n),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:n,size:t||null}}function We(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}async function qn(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?We(o.textContent):null},e=t();if(e==null&&typeof window.loadMiniCart=="function"){try{window.loadMiniCart()}catch(o){}await new Promise(o=>setTimeout(o,700)),e=t()}e==null&&(e=Dn());let r=document.querySelector('.mc-products__count, [class*="mc-"][class*="count" i], [class*="minicart" i] [class*="count" i]'),n=r&&parseInt(String(r.textContent||"").replace(/\D/g,""),10)||null;if(e!=null)return{value:e,itemCount:n,currency:"BRL"}}catch(t){}return null}function Dn(){try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart')||document;for(let e of t.querySelectorAll("div,span,p,li,strong,b")){if(e.children.length>2)continue;let r=(e.textContent||"").replace(/\s+/g," ").trim();if(!(!/R\$/.test(r)||/frete|faltam|gr[aá]tis|desconto|economi/i.test(r))&&/^(sub)?total\b/i.test(r)){let n=We(r);if(n)return n}}}catch(t){}return null}function zn(){if(typeof window.setCartDivVisibility!="function")return!1;try{typeof window.loadMiniCart=="function"&&window.loadMiniCart()}catch(t){}return setTimeout(()=>{try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart');if(t&&t.getBoundingClientRect().width>0)return;window.setCartDivVisibility()}catch(t){}},350),!0}var Yt={};v(Yt,{addToCart:()=>Hn,cartUrl:()=>Kn,detect:()=>$n,getCartSummary:()=>Vn,id:()=>Un,openCartDrawer:()=>Wn,skipRedirect:()=>Fn});var Gt="/api/v2/front",Xt={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Je=t=>String(t==null?"":t).trim().toLowerCase(),Un="wapstore",Fn=!0,Kn="/checkout/carrinho";function $n(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Ge(t){if(!t||typeof t!="object")return null;let e=t.subtotal&&t.subtotal.valor;return e==null?null:{value:e,itemCount:t.quantidadeItens!=null?t.quantidadeItens:null,currency:"BRL"}}async function Hn({size:t,quantity:e}){let r=await fetch(Gt+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:Xt}).then(d=>d.json()),n=(r&&(r.produto||r.data||r)||{}).conteudo||{},o=n.atributos&&n.atributos.simples&&n.atributos.simples.valores||[];if(!o.length)throw new Error("wapstore: sem variante de compra (atributos.simples)");let i=t?o.find(d=>Je(d.label)===Je(t)):null;i=i||o.find(d=>d.selecionado)||o.find(d=>(d.estoque||0)>0)||o[0];let a=i&&i.carrinho;if(!a||!a.itens||!a.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let c=a.itens.map(d=>Object.assign({},d,{quantidade:String(e||d.quantidade||1)})),l=await fetch(Gt+"/checkout/cart",{method:"POST",headers:Xt,body:JSON.stringify({itens:c,tipo:a.tipo||"produto"})});if(!l.ok)throw new Error("wapstore: add HTTP "+l.status);let s=await l.json().catch(()=>({})),u=Ge(s),h={platform:"wapstore",idProduto:c[0]&&c[0].idProduto,size:i&&i.label||null};return u&&(h.cartValue=u.value,h.itemCount=u.itemCount,h.currency=u.currency),h}async function Vn(){try{let t=await fetch(Gt+"/checkout/cart",{headers:Xt}).then(e=>e.json());return Ge(t)}catch(t){}return null}function Wn(){try{let t=document.querySelector(".common-sheet.side-cart, .side-cart");if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('.button-cart, [class*="button-cart"]');if(e)return e.click(),!0}catch(t){}return!1}var Zt={};v(Zt,{addToCart:()=>eo,detect:()=>Yn,getCartSummary:()=>ro,id:()=>Jn,openCartDrawer:()=>no,resolveSku:()=>Zn,skipRedirect:()=>Gn});var Xe=t=>String(t==null?"":t).trim().toLowerCase(),Jn="linx",Gn=!0;function Xn(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function Yn(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function Zn(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function Qn(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}function to(t){if(t==null||t==="")return!1;let e=Xe(t),r=e.replace(/\D/g,""),n=[...document.querySelectorAll('input[type="radio"]')].filter(i=>/aro|tamanho|grade|numera|size|variant/i.test(i.name||i.id||"")),o=n.find(i=>Xe(i.value)===e)||(r?n.find(i=>String(i.value).replace(/\D/g,"")===r):null);if(!o)return!1;try{o.checked||(o.checked=!0),(o.labels&&o.labels[0]||null||o).click(),o.dispatchEvent(new Event("change",{bubbles:!0}))}catch(i){}return!0}async function eo(t){t=t||{};let e=Qn();if(!e)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.size!=null&&t.size!==""&&(to(t.size),await new Promise(r=>setTimeout(r,1100))),e.click(),await new Promise(r=>setTimeout(r,1400)),{platform:"linx"}}function ro(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=Xn(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function no(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var te={};v(te,{addToCart:()=>et,detect:()=>io,id:()=>oo,resolveSku:()=>Qt});var oo="generic";function io(){return!0}function Qt(){let t=E(["Product"]);if(t[0]){let e=t[0],r=e.sku||e.mpn||e.gtin13||e.productID;if(r)return{value:String(r),source:"jsonld"}}try{let e=document.querySelector('[itemprop="sku"]');if(e){let r=e.getAttribute("content")||(e.textContent||"").trim();if(r)return{value:String(r),source:"microdata"}}}catch(e){}try{let e=window.konfidencyData;if(e&&e.product&&e.product.variants&&e.product.variants[0])return{value:String(e.product.variants[0]),source:"konfidency"}}catch(e){}return null}var ao=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,co=/continuar|como comprar|lista|desejos|favorito/i;async function et(){let t=document.querySelectorAll("button,[role=button],input[type=submit]");for(let e of t){let r=(e.textContent||e.value||"").replace(/\s+/g," ").trim();if(r&&r.length<40&&ao.test(r)&&!co.test(r))try{return e.click(),{platform:"native-click",clicked:r}}catch(n){}}return{platform:"none",error:"bot\xE3o de carrinho nativo n\xE3o encontrado"}}var Ze=[Kt,pt,Ht,Vt,Wt,Jt,Yt,Zt],lo=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],yt;function $(){return yt||(yt=Ze.find(t=>{try{return t.detect()}catch(e){return!1}})||te,yt)}function Qe(){let t=Ze.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of lo)try{if(r())return e}catch(n){}return null}function H(){let t=$();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return Qt()}async function tr(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||t.aro||t.ringSize||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null},r=$();try{let n=r.addToCart?await r.addToCart(e):await et(e);return w("cart: adicionado",n),ee(),Ye(r,n,e.sku),n}catch(n){w('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await et(e);return ee(),Ye(r,o,e.sku),o}}async function Ye(t,e,r){try{let n=null;e&&e.cartValue!=null?n={value:e.cartValue,itemCount:e.itemCount!=null?e.itemCount:null,currency:e.currency||null}:t&&t.getCartSummary&&(n=await t.getCartSummary()),n&&n.value!=null&&(n.value>0||(n.itemCount||0)>0)&&p("cart_value",{via:"tryon",value:n.value,itemCount:n.itemCount!=null?n.itemCount:null,currency:n.currency||null,sku:r||null})}catch(n){}}async function re(){let t=$();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function er(t){t=t||{};let e=$(),r={platform:e.id};try{let n=H();r.sku=n&&n.value||null;let o={size:t.size||null,color:t.color||null,sku:r.sku,quantity:t.quantity||1};r.added=e.addToCart?await e.addToCart(o):await et(o),ee();try{await ne()}catch(i){}r.cart=await re(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function ee(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function ne(t){if(t&&t.drawerHandled)return!1;let e=$(),r=g(),n=null;try{n=await K()}catch(a){}let o=n&&n.template&&n.template.cart||n&&n.cart||{},i=o.afterAdd||o.behavior||r.cartBehavior;if(i||(i=r.cartRedirect===!1?"none":"auto"),i==="none")return!1;if(i==="auto"||i==="drawer"){let a=o.openSelector||r.cartOpenSelector;if(a){let c=document.querySelector(a);if(c)return setTimeout(()=>{try{c.click()}catch(l){}},300),!1}else if(e&&e.openCartDrawer){let c=!1;try{c=e.openCartDrawer()}catch(l){}if(c)return!1}}return!0}function rr(){let t=$();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var so=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced|checkout\/[^?#]*success)/i,uo=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,fo=/\/checkout/i,po=/\/(cart|carrinho|sacola|bag|comprar)(\/|$|\?|#)/i,nr=/\/(products?|produtos?|p)\//i,mo=/\/(collections?|categoria|categorias|c|departamento)\//i,ho=/\/(search|busca|s)(\/|\?)/i;function or(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=uo.test(t);try{let r=E(),n=0,o=!1,i=!1;for(let a of r){let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];if((c.includes("Order")||c.includes("Invoice"))&&!e)return"purchase";c.includes("SearchResultsPage")&&(o=!0),(c.includes("CollectionPage")||c.includes("ItemList"))&&(i=!0),c.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return nr.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":so.test(t)&&!e?"purchase":fo.test(t)?"checkout":po.test(t)?"cart":nr.test(t)?"pdp":mo.test(t)?"category":ho.test(t)?"search":"other"}function ir(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let a=r.get(i);a&&(o[i.replace("utm_","")]=a)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:yo()}}function yo(){return Qe()}var oe={},go=null,rt=0,ar=!1;function cr(t){ar||(ar=!0,lr(t),wo(),bo(),xo(),_o(),vo(t))}function lr(t){oe={};let e=or(),r=ir(e);if(Be(r),p("view",{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:e}),typeof t=="function")try{t(e,r)}catch(n){}}function wo(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let c=0;c<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");c++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},a=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(a||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),p("click",i)}catch(n){}},{capture:!0,passive:!0})}function bo(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let a of t)i>=a&&!oe[a]&&(oe[a]=!0,p("scroll_depth",{depth:a}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function xo(){document.body&&document.body.addEventListener("submit",t=>{try{let e=t.target;if(!e||e.tagName!=="FORM"||e.querySelector('input[type="password"], input[name*="card"], input[name*="cpf"]'))return;let r="other",n=(e.className||"").toLowerCase(),o=(e.action||"").toLowerCase();e.querySelector('input[type="search"], input[name="q"], input[name="s"]')?r="search":/newsletter|subscribe|mailchimp/.test(n+o)?r="newsletter":/contact|contato/.test(n+o)&&(r="contact"),p("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function _o(){let t=g();rt=Date.now(),go=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-rt)/1e3);rt=e,r>0&&r<60&&p("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-rt)/1e3);e>0&&e<600&&p("engagement",{url:location.pathname,dwellSec:e})}rt=Date.now()})}function vo(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,lr(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}catch(n){}}function ae(){let t=H(),e=E(["Product"]);if(e.length>0){let o=e[0],i=Array.isArray(o.offers)?o.offers[0]:o.offers;return{sku:t?t.value:o.sku||o.mpn||o.gtin13||o.productID||null,skuSource:t?t.source:null,name:typeof o.name=="string"?o.name:null,price:i&&parseFloat(i.price||i.lowPrice)||null||sr(),currency:i?i.priceCurrency:null,brand:o.brand?typeof o.brand=="string"?o.brand:o.brand.name:null,category:o.category||null}}let r=o=>{let i=document.querySelector('meta[property="og:'+o+'"], meta[property="product:'+o+'"]');return i?i.getAttribute("content"):null},n=o=>{let i=document.querySelector('[itemprop="'+o+'"]');return i?i.getAttribute("content")||(i.textContent||"").trim():null};if(t||r("type")==="product"||r("price:amount")||n("name")){let o=n("price")||r("price:amount"),i=o&&parseFloat(String(o).replace(",","."))||null;return{sku:t?t.value:null,skuSource:t?t.source:null,name:n("name")||r("title")||document.title||null,price:(i&&i>0?i:null)||sr(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function sr(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,a=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,c=ie(a!=null?String(a):"");if(c)return c}}catch(t){}return null}function L(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function gt(){let t=E(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||L(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||L(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{let o=window.LS&&window.LS.order;if(o&&o.total!=null){let i=Number(o.total),a=window.LS.currency&&window.LS.currency.code||"BRL";return{orderId:String(o.number||o.id||L()||""),revenue:Number.isFinite(i)?i/100:null,currency:a,source:"nuvemshop"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],a=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(a&&(i.event==="purchase"||a.purchase||a.transaction_id)){let c=a.purchase&&a.purchase.actionField,l=parseFloat(c&&(c.revenue||c.value)||a.value||a.revenue);return{orderId:c&&(c.id||c.transaction_id)||a.transaction_id||a.transactionId||L(),revenue:Number.isFinite(l)?l:null,currency:a.currency||a.currencyCode||c&&c.currency||null,itemCount:(a.purchase&&a.purchase.products||a.items||a.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:L(),revenue:parseFloat(e.content)||null,source:"meta"};let r=Co();if(r)return r;let n=L();return n?{orderId:n,revenue:null,source:"url"}:null}function Co(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=ie(n.length>1?n[n.length-1]:r);if(o)return{orderId:ur(),revenue:o,currency:(n.length>1?n[0]:null)||null,source:"dom"}}let e=[".order-total","#order-total",".total-price",".order__total","[data-order-total]",".summary-total",".grand-total"];for(let r of e){let n=document.querySelector(r);if(n){let o=ie(n.value||n.textContent);if(o)return{orderId:ur(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function ur(){try{let t=document.querySelector(".orderID");if(t&&(t.value||t.getAttribute("value")))return t.value||t.getAttribute("value");let r=(document.body.innerText||"").match(/(?:pedido|order|n[º°o]\.?)\s*#?\s*([A-Z0-9-]{4,})/i);return r?r[1]:null}catch(t){return null}}function ie(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r;e.indexOf(",")>e.indexOf(".")?r=e.replace(/\./g,"").replace(",","."):r=e.replace(/,/g,"");let n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function dr(){let t=E(["ItemList","CollectionPage"]);if(t.length===0)return null;let e=t[0],r=e.itemListElement||e.mainEntity&&e.mainEntity.itemListElement||[],n=[];for(let o of r.slice(0,50)){let i=o.item||o;i&&(i.sku||i.productID||i.name)&&n.push(i.sku||i.productID||i.name)}return n.length>0?{count:n.length,skus:n.slice(0,20)}:null}var bt=!1,wt=[/\b(adicionar|adic\.?|colocar|incluir|jogar)\b.{0,30}\b(carrinho|sacola|sacolinha|bag)\b/i,/\bcomprar\b(?!\s+(em|por|sem))/i,/\bcomprar\s*$/i,/^add\s+to\s+(cart|bag)\b/i,/^buy\s+(now|it|this)\b/i,/^(sacolinha|carrinho|sacola)$/i],ko=[/^finalizar(\s+(compra|pedido|pagamento))?\b/i,/^(fechar|confirmar)\s+(compra|pedido|pagamento)\b/i,/^pagar(\s+(agora|pedido))?\b/i,/^(complete|place)\s+(purchase|order)\b/i,/^checkout$/i];function nt(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function hr(t){switch(t){case"pdp":{let e=ae();p("view_item",e||{sku:null});break}case"category":case"search":{let e=dr();p("view_item_list",e||{count:0});break}case"cart":re().then(e=>p("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>p("view_cart",{}));break;case"checkout":p("begin_checkout",{});break;case"purchase":So();break}}var fr=500,pr=30;function So(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,yr(o,i))};try{window.addEventListener("pagehide",()=>r(gt(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=gt();if(o&&o.revenue!=null)return r(o);if(e++>=pr)return w("purchase: receita n\xE3o apareceu em "+fr*pr+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,fr)};n()}function yr(t,e){if(!bt){if(t&&!t.orderId&&(t.orderId=L()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){w("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}if(bt=!0,p("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),w("purchase emitido",t),e)try{j(!0)}catch(r){}}}var mr=!1;function gr(){if(mr)return;mr=!0;let t=r=>{try{if(!r||typeof r!="object")return!1;let n=r.ecommerce||r.ecommerce_data&&r.ecommerce_data.ecommerce;return n?r.event==="purchase"||r.event==="transaction"||!!n.purchase||n.transaction_id!=null:!1}catch(n){return!1}},e=r=>{bt||!t(r)||setTimeout(()=>{if(!bt)try{yr(gt(),!0)}catch(n){}},0)};try{let r=window.dataLayer=window.dataLayer||[];for(let o=0;o<r.length;o++)e(r[o]);let n=r.push;r.push=function(){let o=n.apply(this,arguments);try{for(let i=0;i<arguments.length;i++)e(arguments[i])}catch(i){}return o}}catch(r){}}function wr(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let c=0;c<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");c++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let a=!1;if((nt([wt[0]],i)||o&&nt([wt[1]],i)||o&&nt([wt[2]],i)||nt(wt.slice(3),i))&&(a=!0),a){t=r;let c=ae();p("add_to_cart",{via:"click",buttonText:i,sku:c?c.sku:null,price:c?c.price:null});return}o&&nt(ko,i)&&(t=r,p("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var xt={};v(xt,{available:()=>Lo,id:()=>To,iframeSrc:()=>Eo,modalSize:()=>Ao,onMounted:()=>Io});var To="mk-fashion",Ao={width:430,height:800};function Eo(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return g().appUrl+"/"+t+"/"+r}async function Lo(t,e){let r=g().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function Io(){}var ce={};v(ce,{available:()=>Oo,id:()=>Ro,iframeSrc:()=>jo,modalSize:()=>Po,onMounted:()=>Do});var Ro="mk-makeup",Po={width:1160,height:700};function Mo(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function jo(t){return Mo()+"/"+encodeURIComponent(t)}async function Oo(t,e){let r=window.__MK&&window.__MK.pulpoarProjectKey||t;if(!r)return{available:!0};let n=await br(e)||e;if(!n)return{available:!0};try{let i=String(g().collectorUrl||"").replace(/\/+$/,"")+"/v1/makeup/availability/"+encodeURIComponent(r)+"?slug="+encodeURIComponent(n),a=await fetch(i).then(c=>c.json());return w("pulpoar availability",a),{available:!(a&&a.available===!1)}}catch(o){return w("pulpoar availability erro",o&&o.message),{available:!0}}}var Bo="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",_t=null;function No(){return window.pulpoar?Promise.resolve(window.pulpoar):_t||(_t=new Promise(t=>{try{let e=document.createElement("script");e.src=Bo,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),_t)}async function br(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(l=>l.json())).variants||[],a=n?i.find(l=>String(l.id)===String(n)):null;if(a&&a.sku)return a.sku;let c=i.find(l=>l.available)||i[0];if(c&&c.sku)return c.sku}}}catch(e){}return t||null}function qo(t){let e=Array.isArray(t)?t[0]:t;return!e||typeof e!="object"?{quantity:1}:{sku:e.sku||e.slug||e.key||e.variant_key||e.barcode||null,color:e.color||e.shade||e.colorName||null,size:e.size||null,quantity:1}}function Do(t,e){No().then(async r=>{if(!r){w("pulpoar: SDK n\xE3o carregou");return}let n=await br(e.identifier);if(w("pulpoar variante p/ cat\xE1logo",n),n)try{r.applyVariantsWithCatalog([String(n)],o=>{e.track("product_loaded",{via:"makeup",applied:Array.isArray(o)?o.length:0})})}catch(o){w("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{w("pulpoar onAddToCart",o),e.handleAddToCart(qo(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var zo={"mk-fashion":xt,"mk-makeup":ce};function vt(t){return zo[t]||xt}var S=null,k=null,kt=!1,St=!1,R=null,xr={},le=null,Ct=0,C={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},Uo={gregory:"698c7e791d3129430f15dddd"};function vr(t){return t?Uo[String(t).toLowerCase()]||t:null}async function B(t,e){let r=vr(t),n=String(e||"").trim();return vt(g().product).available(r,n)}async function Cr(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await B(t,e)).available===!0}catch(r){return!1}}async function ot(t){if(t=t||{},kt)return;let e=vr(t.projectId||t.projectid||t.store),r=String(t.identifier||t.sku||"").trim();if(!e||!r){console.error("[mk-sdk] open: projectId e identifier obrigatorios");return}let n=e+":"+r;if(xr[n]!==!0){try{if(!(await B(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}xr[n]=!0}let o=vt(g().product).modalSize||{width:430,height:800};R={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},St=!1,Tr(),Fo(R),kt=!0,Ct=Date.now(),p("modal_opened",{projectId:e,identifier:r})}function ue(){if(!kt)return;let t=St;if(St=!1,Ko(),kt=!1,I("onClose"),p("modal_closed",{projectId:R&&R.projectId,identifier:R&&R.identifier}),t)try{rr()}catch(e){}}function kr(t){try{Or().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function Fo(t){S=document.createElement("div"),S.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",kr(!0);let e=document.createElement("div"),r=typeof t.width=="number"?t.width+"px":t.width,n=typeof t.height=="number"?t.height+"px":t.height;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:12px;overflow:hidden;background:#fff;",k=document.createElement("iframe");let o=vt(g().product);k.src=o.iframeSrc(t.projectId,t.identifier),k.style.cssText="width:100%;height:100%;border:none;",k.setAttribute("allow","camera *; microphone *"),k.setAttribute("allowfullscreen","true"),e.appendChild(k),S.appendChild(e),document.body.appendChild(S);try{o.onMounted(k,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:Ar,track:p,fire:I})}catch(i){w("launcher.onMounted falhou",i&&i.message)}w("try-on modal aberto",k.src)}function Ko(){S&&S.parentNode&&S.parentNode.removeChild(S),S=null,k=null,kr(!1)}var _r=!1;function Sr(){Tr()}function Tr(){_r||(_r=!0,window.addEventListener("message",t=>{let e=t.data;if(!e||e.source!=="mkfashion-app")return;let r=e.action,n=e.data||{};switch(r){case"close_request":ue();break;case"ready":I("onReady",n);break;case"product_loaded":I("onProductLoaded",n),p("product_loaded",se(n));break;case"interaction":{I("onInteraction",n),n&&n.method&&(le=n.method),p($o(n),se(n));break}case"add_to_cart":Ar(n,"tryon");break;case"generation_start":Ct=Date.now();break;case"generation_complete":I("onGenerationComplete",n),p("generation_complete",{method:n.method||le||"unknown",durationMs:Ct?Date.now()-Ct:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":I("onError",n),p("generation_error",{method:le||"unknown",error:n&&n.error});break}}))}function Ar(t,e){if(p("add_to_cart",Object.assign({via:e||"tryon"},se(t))),typeof C.onAddToCart=="function"){I("onAddToCart",t);return}let r=Object.assign({productId:R&&R.identifier},t);tr(r).then(n=>ne(n)).then(n=>{St=!!n}).catch(()=>{})}function $o(t){return t&&t.action,"interaction"}function se(t){if(!t||typeof t!="object")return t;let e={};for(let r in t){if(r==="imageUrl"||r==="image"||r==="product"){r==="product"&&t[r]?(e.productSku=t[r].sku||null,e.productName=t[r].name||null):e[r+"Present"]=!!t[r];continue}e[r]=t[r]}return e}function I(t,e){if(typeof C[t]=="function")try{C[t](e)}catch(r){console.error("[mk-sdk]",r)}}function Er(t){C.onReady=t}function Lr(t){C.onClose=t}function Ir(t){C.onAddToCart=t}function Rr(t){C.onProductLoaded=t}function Pr(t){C.onError=t}function Mr(t){C.onInteraction=t}function jr(t){C.onGenerationComplete=t}var Vo=767,Wo=1024,Jo=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,Go=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function de(t){try{let e=t.getBoundingClientRect();if(e.width<=0||e.height<=0)return!1;let r=getComputedStyle(t);return r.display!=="none"&&r.visibility!=="hidden"&&r.opacity!=="0"}catch(e){return!1}}function Xo(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&de(e)}catch(e){return!1}}function Yo(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function Zo(t){if(!t||typeof t!="object"||t.selector)return t;let e=!1;if(["mobile","tablet","desktop"].forEach(n=>{let o=t[n];o&&o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"&&(e=!0)}),!e)return t;let r={};return["mobile","tablet","desktop"].forEach(n=>{let o=t[n];if(o){if(o.selector){r[n]=o;return}if(o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"){let i=o.anchor[n]||o.anchor.desktop||o.anchor.mobile||o.anchor.tablet;i&&i.selector&&(r[n]=i)}}}),["bpMobile","bpTablet","breakpoint"].forEach(n=>{t[n]!=null&&(r[n]=t[n])}),r}function Tt(t){if(!t||typeof t!="object")return null;if(t=Zo(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(l=>l[1]&&l[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,l])=>Xo(l.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||Vo,i=Number(t.bpTablet)||Wo,a=l=>(e.find(s=>s[0]===l)||[])[1],c=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let l of c){let s=a(l);if(s)return s}return e[0][1]}function fe(t){let e=Tt(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&de(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function Br(){let t=g(),e=fe(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=Yo(n);if(!(!o||o.length>40)&&!Go.test(o)&&Jo.test(o)&&de(n))return{el:n,position:"afterend",mode:"flow",style:"",selector:null}}return null}var _="'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",pe={none:"0",sm:"4px",md:"8px",pill:"9999px"},me={none:"0",sm:"4px",md:"8px",lg:"16px"},Qo='<svg viewBox="0 0 17.5263 20.6862" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%"><g><path d="M8.49995 12.1862C10.1568 12.1862 11.5 10.8431 11.5 9.18622C11.5 7.52936 10.1568 6.18622 8.49995 6.18622C6.8431 6.18622 5.49995 7.52936 5.49995 9.18622C5.49995 10.8431 6.8431 12.1862 8.49995 12.1862Z" stroke="currentColor" shape-rendering="crispEdges"/><path d="M0.5 9.11152C0.5 6.56953 0.5 5.29894 1.1099 4.38664C1.375 3.9902 1.71424 3.65088 2.10821 3.38809C2.6945 2.9958 3.42899 2.85564 4.55351 2.80588C5.09013 2.80588 5.55183 2.39949 5.65687 1.87284C5.73715 1.48708 5.94572 1.14138 6.24735 0.894155C6.54898 0.646934 6.92516 0.51336 7.31231 0.516006H9.9734C10.7779 0.516006 11.4709 1.08412 11.6288 1.87284C11.7339 2.39949 12.1956 2.80588 12.7322 2.80588C13.8559 2.85564 12.9129 4.67413 13.5 5.06559C13.8949 5.32932 15.1484 3.80355 15.5 4.02647C16.1099 4.93876 16.7857 6.56953 16.7857 9.11152C16.7857 11.6535 16.7857 12.9233 16.1758 13.8364C15.9107 14.2328 15.5715 14.5722 15.1775 14.835C14.2647 15.4445 12.9936 15.4445 10.4522 15.4445H6.83351C4.29213 15.4445 3.02103 15.4445 2.10821 14.835C1.71446 14.5718 1.3755 14.2322 1.11071 13.8356C0.933802 13.5672 0.803519 13.2698 0.725557 12.9564" stroke="currentColor" stroke-linecap="round"/><path d="M12.676 0.607931C12.9446 -0.178095 14.0307 -0.2019 14.3491 0.536515L14.3761 0.60838L14.7385 1.66839C14.8216 1.91149 14.9559 2.13395 15.1322 2.32076C15.3086 2.50757 15.5229 2.65439 15.7608 2.75131L15.8583 2.78769L16.9183 3.14971C17.7044 3.41831 17.7282 4.50437 16.9902 4.82283L16.9183 4.84978L15.8583 5.21225C15.6151 5.29526 15.3926 5.42947 15.2057 5.60582C15.0188 5.78218 14.8719 5.99657 14.7749 6.23453L14.7385 6.33155L14.3765 7.39201C14.1079 8.17803 13.0219 8.20184 12.7039 7.46387L12.676 7.39201L12.314 6.332C12.231 6.08881 12.0968 5.86627 11.9204 5.67938C11.744 5.49249 11.5297 5.3456 11.2917 5.24863L11.1947 5.21225L10.1347 4.85022C9.34817 4.58163 9.32437 3.49557 10.0628 3.17756L10.1347 3.14971L11.1947 2.78769C11.4378 2.70462 11.6602 2.57039 11.847 2.39404C12.0339 2.21769 12.1807 2.00333 12.2776 1.76541L12.314 1.66839L12.676 0.607931Z" fill="currentColor"/></g></svg>',qr='<svg viewBox="0 0 11.6122 12.7248" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:12px;height:12px"><path d="M4.09055 2.01133C4.43939 0.9905 5.84989 0.959583 6.26347 1.91858L6.29847 2.01192L6.76922 3.38858C6.8771 3.7043 7.05144 3.99321 7.28047 4.23583C7.5095 4.47845 7.7879 4.66912 8.09689 4.795L8.22347 4.84225L9.60014 5.31242C10.621 5.66125 10.6519 7.07175 9.69347 7.48533L9.60014 7.52033L8.22347 7.99108C7.90764 8.09889 7.61862 8.2732 7.3759 8.50223C7.13318 8.73127 6.94241 9.0097 6.81647 9.31875L6.76922 9.44475L6.29905 10.822C5.95022 11.8428 4.53972 11.8737 4.12672 10.9153L4.09055 10.822L3.62039 9.44533C3.51258 9.12951 3.33827 8.84048 3.10924 8.59776C2.8802 8.35504 2.60177 8.16427 2.29272 8.03833L2.16672 7.99108L0.790054 7.52092C-0.231363 7.17208 -0.26228 5.76158 0.69672 5.34858L0.790054 5.31242L2.16672 4.84225C2.48244 4.73437 2.77135 4.56003 3.01397 4.331C3.25658 4.10197 3.44726 3.82357 3.57314 3.51458L3.62039 3.38858L4.09055 2.01133ZM9.86147 0C9.9706 0 10.0775 0.0306123 10.1701 0.0883584C10.2627 0.146104 10.3373 0.228668 10.3853 0.326667L10.4133 0.394917L10.6175 0.993417L11.2166 1.19758C11.3259 1.23474 11.4218 1.30353 11.492 1.39523C11.5623 1.48693 11.6037 1.59741 11.611 1.71268C11.6184 1.82795 11.5914 1.94281 11.5334 2.04271C11.4755 2.14261 11.3891 2.22305 11.2854 2.27383L11.2166 2.30183L10.6181 2.506L10.4139 3.10508C10.3767 3.21442 10.3078 3.31024 10.2161 3.38041C10.1244 3.45058 10.0139 3.49194 9.89859 3.49925C9.78333 3.50656 9.66849 3.47949 9.56863 3.42147C9.46876 3.36345 9.38837 3.27709 9.33764 3.17333L9.30964 3.10508L9.10547 2.50658L8.50639 2.30242C8.39702 2.26526 8.30115 2.19647 8.23092 2.10477C8.16069 2.01307 8.11926 1.90259 8.11189 1.78732C8.10452 1.67205 8.13153 1.55719 8.18951 1.45729C8.24749 1.35739 8.33381 1.27695 8.43755 1.22617L8.50639 1.19817L9.10489 0.994L9.30905 0.394917C9.34839 0.279665 9.42281 0.179613 9.52187 0.108791C9.62094 0.0379686 9.73969 -0.0000730808 9.86147 0Z" fill="currentColor"/></svg>';function x(t,e={}){let r=document.createElement(t);if(e.style&&(r.style.cssText=e.style),e.text!=null&&(r.textContent=e.text),e.html!=null&&(r.innerHTML=e.html),e.attrs)for(let n in e.attrs)r.setAttribute(n,e.attrs[n]);if(e.on)for(let n in e.on)r.addEventListener(n,e.on[n]);if(e.children)for(let n of e.children)n&&r.appendChild(n);return r}function Dr(t){return x("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:qr})}var At=t=>'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">'+t+"</svg>",Nr={camera:Qo,sparkle:qr.replace("width:12px;height:12px","width:100%;height:100%"),shirt:At('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),face:At('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),glasses:At('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),wand:At('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')};function V(t,e,r){let n=Number(r)>0?Number(r):24;return x("span",{style:`width:${n}px;height:${n}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${e};flex-shrink:0;`,html:Nr[t]||Nr.camera})}function W(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function Et(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(x("link",{attrs:{id:"mk-jakarta-font",rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap"}}))}catch(t){}}function ti(t){return t.subtext?x("span",{style:`display:flex;align-items:center;justify-content:center;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,text:t.subtext}):null}function zr(t,e){Et();let r=x("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[V(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px;width:100%;max-width:238px;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};font-family:${_};font-size:${t.fontSize}px;cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,ti(t)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function ri(t){return t.subtext?x("span",{style:`display:flex;align-items:center;gap:4px;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:600;font-size:10px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,children:[Dr(t.badgeTextColor),x("span",{text:t.subtext})]}):null}function ni(t,e){return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};filter:drop-shadow(0 0 6px rgba(0,0,0,0.08));font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[V(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Ur(t,e){Et();let r=x("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;letter-spacing:1px;text-transform:uppercase;color:${t.cardTitleColor};line-height:1.2;`}),t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:12px;max-width:177px;line-height:1.2;color:${t.cardTextColor};`})]}),n=x("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&x("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=x("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[ri(t),ni(t,e)]}),i=x("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};font-size:${t.fontSize}px;`,children:[i]})}function Fr(t,e){let r=Number(t.iconSize)>0?Number(t.iconSize):24;return x("button",{attrs:{type:"button","aria-label":t.text||"Provar virtualmente"},style:`display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[V(t.icon,t.textColor,r)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}var ai={style:"gregory-black",icon:"camera",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md"};function he(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function it(t,e){let r={...ai,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=pe[r.borderRadius]!=null?pe[r.borderRadius]:"0",r.cardBorderRadiusPx=me[r.cardBorderRadius]!=null?me[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var ye={"gregory-black":zr,"gregory-card":Ur,"gregory-icon":Fr},ma=Object.keys(ye).concat("none");function Kr(t,e){return t&&t.style==="none"?null:(ye[t.style]||ye["gregory-black"])(t,e)}function ci(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var N=null,P=[];function Or(){return[N].concat(P).filter(Boolean)}function li(t,e){let r;try{r=document.createElement("iframe"),r.setAttribute("aria-hidden","true"),r.style.cssText="display:none!important;width:0;height:0;border:0;position:absolute;left:-9999px;",(document.body||document.documentElement).appendChild(r);let n=r.contentWindow&&r.contentWindow.Element&&r.contentWindow.Element.prototype&&r.contentWindow.Element.prototype.attachShadow;if(typeof n=="function"){let o=n.call(t,e);return r.remove(),o}}catch(n){}try{r&&r.remove()}catch(n){}return t.attachShadow(e)}var si=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height|font-size)$/i;function ui(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>si.test(e.split(":")[0].trim().toLowerCase())).join(";")}var It=null,ge=!1,we=0,J={},$r=!1,at=null;function M(){return at||(at=K().then(t=>t?he(t.template&&t.template.tryOnButton||null)||{__loaded:!0}:(at=null,null)).catch(()=>(at=null,null))),at}function di(){if($r)return;$r=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{It&&T("pdp")},200)})}catch(e){}}function xe(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function Lt(){xe(N),P.forEach(xe),N=null,P=[],It=null}var fi={IMG:1,INPUT:1,VIDEO:1,CANVAS:1,EMBED:1,OBJECT:1,IFRAME:1,BR:1,HR:1,SELECT:1,TEXTAREA:1,SVG:1};function pi(t){switch(t){case"top-center":return"top:0;left:50%;transform:translateX(-50%);";case"top-right":return"top:0;right:0;";case"middle-left":return"top:50%;left:0;transform:translateY(-50%);";case"center":return"top:50%;left:50%;transform:translate(-50%,-50%);";case"middle-right":return"top:50%;right:0;transform:translateY(-50%);";case"bottom-left":return"bottom:0;left:0;";case"bottom-center":return"bottom:0;left:50%;transform:translateX(-50%);";case"bottom-right":return"bottom:0;right:0;";case"top-left":default:return"top:0;left:0;"}}function mi(t,e,r){let o=!fi[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(u){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+pi(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let u=t.getBoundingClientRect(),h=o.getBoundingClientRect(),d=e.offsetWidth,y=e.offsetHeight,m=u.top-h.top+o.scrollTop,b=u.left-h.left+o.scrollLeft,f=r||"top-left",A=m,X=b;f.indexOf("bottom")===0?A=m+u.height-y:(f.indexOf("middle")===0||f==="center")&&(A=m+(u.height-y)/2),f.indexOf("right")>=0?X=b+u.width-d:f.indexOf("center")>=0&&(X=b+(u.width-d)/2),e.style.top=A+"px",e.style.left=X+"px"}catch(u){}};i();let a=()=>i();window.addEventListener("resize",a);let c=setTimeout(i,600),l=setTimeout(i,1500),s=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){s=new ResizeObserver(()=>i());try{s.observe(t)}catch(u){}try{s.observe(o)}catch(u){}}}catch(u){}e.__mkCleanup=()=>{window.removeEventListener("resize",a),clearTimeout(c),clearTimeout(l);try{t.removeEventListener("load",i)}catch(u){}try{s&&s.disconnect()}catch(u){}}}function hi(t,e,r){e.style.cssText="position:absolute;z-index:100;",document.body.appendChild(e);let n=()=>{try{let l=t.getBoundingClientRect(),s=e.offsetWidth,u=e.offsetHeight,h=r||"top-left",d=l.top+window.scrollY,y=l.left+window.scrollX;h.indexOf("bottom")===0?d=l.bottom+window.scrollY-u:(h.indexOf("middle")===0||h==="center")&&(d=l.top+window.scrollY+(l.height-u)/2),h.indexOf("right")>=0?y=l.right+window.scrollX-s:h.indexOf("center")>=0&&(y=l.left+window.scrollX+(l.width-s)/2),e.style.top=Math.round(d)+"px",e.style.left=Math.round(y)+"px"}catch(l){}};n();let o=()=>n();window.addEventListener("resize",o);let i=setTimeout(n,600),a=setTimeout(n,1500),c=null;try{t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",n,{once:!0});let l=t.querySelector&&t.querySelector("img");if(l&&!l.complete&&l.addEventListener("load",n,{once:!0}),typeof ResizeObserver=="function"){c=new ResizeObserver(()=>n());try{c.observe(t)}catch(s){}}}catch(l){}e.__mkCleanup=()=>{window.removeEventListener("resize",o),clearTimeout(i),clearTimeout(a);try{c&&c.disconnect()}catch(l){}}}function yi(t,e,r){try{return t.insertAdjacentElement(r||"afterend",e),!0}catch(n){try{return t.parentNode.insertBefore(e,t.nextSibling),!0}catch(o){return!1}}}async function T(t){let e=g();if(t!=="pdp"){Lt();return}if(!e.projectId)return;if(!e._anchorFromPicker){let s=await M();if(s&&s.main&&(e.anchor=s.main),s&&s.anchors&&(e.anchors=s.anchors),s&&s.cards&&(e.cards=s.cards),!e.forceButton&&!(s&&s.main)){Lt(),s===null&&we<3&&(we++,setTimeout(()=>T(t),1500));return}we=0}if(ge)return;let r=H(),n=r&&r.value,o=!!e.forceButton,i=s=>s?[s.selector,s.position,s.mode,s.align,s.style].join("~"):"heuristic",a=Array.isArray(e.anchors)?e.anchors:[],c=[n||"demo",i(Tt(e.anchor))].concat(a.map(s=>i(Tt(s)))).join("|"),l=N;if(!(l&&It===c)){if(l&&Lt(),!n&&!o){w("auto-mount: SKU n\xE3o resolvido na PDP");return}ge=!0;try{let s=o;o||(J[n]||(J[n]=B(e.projectId,n).then(b=>!!(b&&b.available)).catch(()=>!1)),s=await J[n]);try{Oe(s?"available":"unavailable")}catch(b){}if(!s){w("auto-mount: produto sem try-on",n);return}let u=await M(),h=window.matchMedia("(max-width: 767px)").matches,d=it(u&&u.main||{},h),y=()=>{let b=H(),f=b&&b.value||n||"";Dt(),p("button_clicked",{sku:f,style:d.style}),ot({projectId:e.projectId,identifier:f})},m=Br();N=_e(m,d,y),P=[];for(let b=0;b<a.length;b++){let f=a[b],A=fe(f);if(!A)continue;let X=u&&u.anchors&&u.anchors[b]||f,Ce=_e(A,it(X,h),y);Ce&&P.push(Ce)}It=c,di(),w("auto-mount: bot\xE3o",{style:d.style,sku:n,mounted:!!N,extras:P.length,forced:o}),(N||P.length)&&p("button_rendered",{style:d.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!m,position:m?m.position:null,mode:m?m.mode:null,extras:P.length,forced:o})}finally{ge=!1}}}function _e(t,e,r){let n=t&&t.mode||"flow",o=Kr(e,r);if(!o)return null;let i=document.createElement("div");i.id=ci(),li(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(l=>{try{i.addEventListener(l,s=>{s.stopPropagation()},!1)}catch(s){}});let c=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(t.detached?hi(t.el,i,t.align):mi(t.el,i,t.align),c=!0):(i.style.cssText="display:contents;",c=yi(t.el,i,t.position))),c||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let l=ui(t.style);if(l){if(n==="overlay"){let s=l.match(/(?:^|;)\s*z-index\s*:\s*([^;]+)/i);if(s)try{i.style.zIndex=s[1].trim()}catch(u){}}try{o.style.cssText+=";"+l}catch(s){}}}return i}function Hr(){try{let t=g(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton},r={},n=i=>({desktop:i,tablet:i,mobile:i}),o=(i,a,c)=>{i=i||{};let l=d=>a===d?c:r[d];t.anchor=l("primary")?n(l("primary")):i.main||null;let s=Array.isArray(i.anchors)?i.anchors:[],u=s.length;Object.keys(r).concat(a?[a]:[]).forEach(d=>{d&&d.indexOf("extra-")===0&&(u=Math.max(u,(parseInt(d.slice(6),10)||0)+1))});let h=[];for(let d=0;d<u;d++){let y=l("extra-"+d);h[d]=y?n(y):s[d]||null}t.anchors=h,t._anchorFromPicker=!0,t.forceButton=!0};window.addEventListener("message",i=>{if(i.source!==window)return;let a=i.data;if(!(!a||!a.__mkCmd)){if(a.__mkCmd==="getButtons"){M().then(c=>{let l=c&&Array.isArray(c.anchors)?c.anchors.length:0;try{window.postMessage({__mkButtons:{extras:l,hasMain:!!(c&&c.main)}},"*")}catch(s){}});return}if(a.__mkCmd==="previewSlot"){M().then(c=>{o(c,a.slot||"primary",a.live),T("pdp")});return}if(a.__mkCmd==="saveSlot"){a.slot&&a.live&&(r[a.slot]=a.live),M().then(c=>{o(c),T("pdp")});return}if(a.__mkCmd==="galleryPreview"){t.cards=a.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,G(),Rt("category");return}if(a.__mkCmd==="applyRecipe"){M().then(c=>{o(c),a.cards!==void 0&&(t.cards=a.cards||null),T("pdp"),t.cards&&(G(),Rt("category"))});return}if(a.__mkCmd==="cancelPreview"){Object.keys(r).length?M().then(c=>{o(c),T("pdp")}):(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,Lt(),G(),T("pdp"));return}}})}catch(t){}}var q=null,ct=null,ve=null,lt=new Map;function gi(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function wi(t,e,r){if(lt.has(t))return;let n=!!g().forceButton,o=gi(t,e);if(!o&&!n)return;let i=n;if(i||(J[o]||(J[o]=B(g().projectId,o).then(u=>!!(u&&u.available)).catch(()=>!1)),i=await J[o]),!i||lt.has(t)||!t.isConnected)return;let c={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.injectStyle||e.style||"",detached:!0},s=_e(c,r,()=>{Dt(),p("button_clicked",{sku:o,gallery:!0,style:r.style}),ot({projectId:g().projectId,identifier:o})});s&&(lt.set(t,s),p("button_rendered",{gallery:!0,sku:o,style:r.style}))}function be(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,q.observe(e))})}catch(e){}}function G(){if(q){try{q.disconnect()}catch(t){}q=null}if(ct){try{ct.disconnect()}catch(t){}ct=null}clearTimeout(ve),lt.forEach(t=>xe(t)),lt.clear()}async function Rt(t){let e=g();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){G();return}if(!e.projectId)return;let r=await M(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){G();return}if(q){be(n);return}if(typeof IntersectionObserver!="function")return;let o=it(n,window.matchMedia("(max-width: 767px)").matches);if(o.style==="none"){G();return}q=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(q.unobserve(a.target),wi(a.target,n,o))},{rootMargin:"300px"}),be(n);try{ct=new MutationObserver(()=>{clearTimeout(ve),ve=setTimeout(()=>be(n),250)}),ct.observe(document.body,{childList:!0,subtree:!0})}catch(i){}w("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{qe(),Hr(),Sr(),e.autoTrack!==!1&&(cr((o,i)=>{hr(o,i),T(o),Rt(o)}),wr(),gr()),w("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=Mt();if(e.projectId){let o=Fe(e.projectId);o&&zt(o),K().then(i=>{let a=ze(i);zt(a),Ke(e.projectId,a),w("escopo de coleta",a)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:ot,close:ue,isAvailable:Cr,getAvailability:B,onReady:Er,onClose:Lr,onAddToCart:Ir,onProductLoaded:Rr,onError:Pr,onInteraction:Mr,onGenerationComplete:jr,testCart:er,_version:Nt,_isMkSdk:!0};typeof window!="undefined"&&(window.mk=n)}catch(e){typeof console!="undefined"&&console.error("[mk-sdk] boot fatal",e)}})();})();
|
|
1
|
+
(()=>{var Wr=Object.defineProperty;var v=(t,e)=>{for(var r in e)Wr(t,r,{get:e[r],enumerable:!0})};var Pt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Jr={},Y=null;function Mt(){if(Y)return Y;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(c){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Jr.collectorUrl||Pt.collectorUrl;return Y={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||Pt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||Pt.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,cartRedirect:!(window.__MK&&window.__MK.cartRedirect===!1),cartBehavior:window.__MK&&window.__MK.cartBehavior||null,cartOpenSelector:window.__MK&&window.__MK.cartOpenSelector||null,autoTrack:e("data-mk-no-autotrack")===null,batchIntervalMs:window.__MK&&window.__MK.batchIntervalMs||8e3,batchMaxSize:window.__MK&&window.__MK.batchMaxSize||20,engagementIntervalMs:15e3},Y}function g(){return Y||Mt()}function w(...t){let e=g();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var ke="_mk_vid",Se="_mk_sid",Z=null,Q=null;function st(){return typeof crypto!="undefined"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Te(){if(Z)return Z;try{let t=localStorage.getItem(ke);return t||(t="v_"+st(),localStorage.setItem(ke,t)),Z=t,t}catch(t){return Z="v_"+st(),Z}}function Ae(){if(Q)return Q;try{let t=sessionStorage.getItem(Se);return t||(t="s_"+st(),sessionStorage.setItem(Se,t)),Q=t,t}catch(t){return Q="s_"+st(),Q}}var Le=[/email/i,/e-?mail/i,/cpf/i,/cnpj/i,/phone/i,/telefone/i,/celular/i,/address/i,/endereco/i,/cep/i,/zip/i,/card/i,/cartao/i,/cvv/i,/password/i,/senha/i,/token/i,/\bnome\b/i,/fullname/i,/firstname/i,/lastname/i,/sobrenome/i,/birth/i,/nascimento/i,/rg\b/i],Ee={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},jt=2e3;function Ie(t){for(let e=0;e<Le.length;e++)if(Le[e].test(t))return!0;return!1}function Re(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>jt?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Ie(r))continue;let n=t[r];if(Ee[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>jt){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Gr(n);continue}e[r]=n}return e}function Gr(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||Ie(r))continue;let n=t[r];if(Ee[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>jt){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var ut=[],Ot=null,z=null,Nt="1.1.74",Xr=["off","pdp_tryon","pdp","all","tryon_engaged"],tt,Bt=null,F="unknown",U=[],D=null;function Me(){let t=g();return"mk_engaged_"+(t&&t.projectId||"")}function qt(){if(D!==null)return D;try{D=localStorage.getItem(Me())==="1"}catch(t){D=!1}return D}function Dt(){if(!qt()){D=!0;try{localStorage.setItem(Me(),"1")}catch(t){}dt(!1)}}var Yr=/^purchase$/;function je(t,e){if(tt===void 0)return"hold";if(tt==="off")return"drop";if(tt==="all"||e&&Yr.test(e))return"collect";switch(tt){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(qt())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":F==="available"?"collect":F==="unavailable"?"drop":"hold";default:return"collect"}}function dt(t){if(!U.length)return;let e=[];for(let r of U){let n=je(r._pt,r.name);n==="collect"?Ne(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}U=e}function zt(t){tt=Xr.indexOf(t)>=0?t:"all",dt(!1)}function Oe(t){F=t==="available"?"available":"unavailable",dt(!1)}function Be(t){dt(!0),z=t,Bt=t&&t.pageType||null,F="unknown"}function p(t,e,r){if(!g().projectId){(p._pre=p._pre||[]).push({name:t,params:e,ts:r||Date.now()}),p._pre.length>50&&p._pre.shift();return}if(p._pre&&p._pre.length){let o=p._pre;p._pre=[];for(let i of o)Pe(i.name,i.params,i.ts)}Pe(t,e,r)}function Pe(t,e,r){let n=je(Bt,t);if(n==="collect"){Ne(t,e,r);return}if(n==="drop"){w("descartado (escopo)",t);return}U.push({name:t,params:e,ts:r||Date.now(),_pt:Bt}),U.length>300&&U.shift()}function Ne(t,e,r){let n=g(),o=Re(e||{}),i="page_"+Zr(t);if(ut.push({name:i,ts:r||Date.now(),params:o}),w("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:z?{pageType:z.pageType,platform:z.platform,url:z.url}:null},"*")}catch(c){}if(ut.length>=n.batchMaxSize){j();return}Ot||(Ot=setTimeout(()=>{Ot=null,j()},n.batchIntervalMs))}function Zr(t){if(typeof t!="string"||!t)return"unknown";let e=t.replace(/^on/,"");return e=e.replace(/[A-Z]/g,(r,n)=>(n>0?"_":"")+r.toLowerCase()),e.indexOf("page_")===0&&(e=e.slice(5)),e}function j(t){if(ut.length===0)return;let e=g();if(!e.projectId||!e.collectorUrl)return;let r=ut.splice(0,50),n=F==="available"?!0:F==="unavailable"?!1:void 0,o=JSON.stringify({product:e.product||void 0,sdkVersion:Nt,visitorId:Te(),sessionId:Ae(),engaged:qt()||void 0,tryonAvailable:n,events:r,site:z||void 0}),i=e.collectorUrl+"/v1/track";try{fetch(i,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:o}).catch(()=>{})}catch(c){try{navigator.sendBeacon&&navigator.sendBeacon(i+"?projectId="+encodeURIComponent(e.projectId),new Blob([o],{type:"text/plain"}))}catch(a){}}}function qe(){try{window.addEventListener("pagehide",()=>j(!0)),window.addEventListener("beforeunload",()=>j(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&j(!0)})}catch(t){}}function L(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(c){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let c of i){if(!c||!c["@type"])continue;let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];(!t||t.some(s=>a.includes(s)))&&e.push(c)}}}catch(r){}return e}var De=["off","pdp_tryon","pdp","all","tryon_engaged"],Qr="all",tn=30*60*1e3,O=null;function K(){if(O)return O;let t=g();return!t.projectId||!t.apiUrl?(O=Promise.resolve(null),O):(O=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>{if(!e.ok)throw new Error("http "+e.status);return e.json()}).then(e=>e&&e.project||e||null).catch(()=>(O=null,null)),O)}function ze(t){let e=t&&t.analytic&&t.analytic.scope;return De.indexOf(e)>=0?e:Qr}var Ue=t=>"mk_scope_"+t;function Fe(t){try{let e=localStorage.getItem(Ue(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:De.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function Ke(t,e){try{localStorage.setItem(Ue(t),JSON.stringify({scope:e,exp:Date.now()+tn}))}catch(r){}}var Kt={};v(Kt,{addToCart:()=>hn,detect:()=>dn,getCartSummary:()=>pn,id:()=>sn,openCartDrawer:()=>yn,resolveSku:()=>fn,skipRedirect:()=>un});var pt={};v(pt,{addToCart:()=>nn,detect:()=>rn,getCartSummary:()=>Ft,id:()=>en,openCartDrawer:()=>ln,resolveSku:()=>Ut});var en="shopify";function rn(){return!!(window.Shopify||window.ShopifyAnalytics)}function Ut(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var ft=t=>String(t==null?"":t).trim().toLowerCase();async function nn({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let c=(await fetch("/products/"+o+".js").then(f=>f.json())).variants||[],a=f=>[f.option1,f.option2,f.option3].concat(String(f.title||"").split("/")).map(ft).filter(Boolean),s=(f,A)=>a(f).indexOf(ft(A))>=0,l=f=>(!t||s(f,t))&&(!e||s(f,e)),u=null;if((t||e)&&(u=c.find(f=>l(f)&&f.available)||c.find(l)),!u&&r&&(u=c.find(f=>ft(f.sku)===ft(r))),u||(u=c.find(f=>f.available)||c[0]),!u)throw new Error("shopify: variante n\xE3o encontrada");let h=$e(),d=null;if(h&&typeof h.getSectionsToRender=="function")try{d=h.getSectionsToRender().map(f=>({id:f.id,selector:f.selector||"#"+f.id})).filter(f=>f.id)}catch(f){}let y={items:[{id:u.id,quantity:n||1}]};d&&d.length&&(y.sections=d.map(f=>f.id).join(","),y.sections_url=location.pathname);let m=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!m.ok)throw new Error("shopify: /cart/add.js HTTP "+m.status);let b=await m.json().catch(()=>({}));return h&&d&&b.sections&&on(h,d,b.sections),{platform:"shopify",variantId:u.id,size:u.title,sku:u.sku||null}}function $e(){return document.querySelector("cart-drawer, cart-notification")}function on(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let a=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=a?a.innerHTML:null}let c=document.querySelector(n.selector);c&&i!=null&&(c.innerHTML=i)}catch(i){}}}async function Ft(){try{let t=await fetch("/cart.js",{headers:{Accept:"application/json"}}).then(e=>e.json());return{value:(Number(t.total_price)||0)/100,itemCount:Number(t.item_count)||0,currency:t.currency||null}}catch(t){return null}}var cn=["[data-cart-drawer-toggle]",'[data-action="open-cart-drawer"]','[data-action="open-cart"]',".js-cart-drawer-open",".js-drawer-open-cart",".cart-drawer-toggle",".js-cart-toggle",'[aria-controls="CartDrawer"]','[aria-controls="cart-drawer"]',"#cart-icon-bubble","#lk-cart-icon",".header__cart",".site-header__cart",".cart-link",".header-cart",'a[href="/cart"]','a[href$="/cart"]'];function an(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function ln(){let t=$e();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of cn)try{if(e=[...document.querySelectorAll(r)].find(an),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var sn="zerezes",un=!0;function dn(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var fn=Ut,pn=Ft;function mn(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function hn(){let t=mn();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function yn(){return!0}var Ht={};v(Ht,{addToCart:()=>xn,detect:()=>wn,getCartSummary:()=>_n,id:()=>gn,resolveSku:()=>bn});var gn="hybris";function wn(){return!!(window.ACC&&window.ACC.config)}function bn(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var He=t=>String(t==null?"":t).trim().toLowerCase();async function xn({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(y=>y.getAttribute&&y.getAttribute("data-code")),n=t?r.find(y=>He(y.textContent)===He(t)):null;n||(n=r.find(y=>y.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),c=i&&i.querySelector('[name="CSRFToken"]'),a=c&&c.value,s=i&&i.getAttribute("action")||"/cart/add";if(!a)throw new Error("hybris: CSRFToken n\xE3o encontrado");let l=new URLSearchParams;l.set("productCodePost",o),l.set("qty",String(e||1)),l.set("CSRFToken",a);let u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:l.toString()});if(!u.ok)throw new Error("hybris: "+s+" HTTP "+u.status);let h=null,d=null;try{let y=await u.clone().json(),m=y&&y.cartData;m&&(h=$t(m.total!=null?m.total:m.totalPrice),d=m.totalUnitCount!=null?Number(m.totalUnitCount):Array.isArray(m.products)?m.products.length:null)}catch(y){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:h,itemCount:d,currency:"BRL"}}function $t(t){if(t==null||t==="")return null;if(typeof t=="number")return Number.isFinite(t)?t:null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?parseFloat(e.replace(/\./g,"").replace(",",".")):parseFloat(e.replace(/,/g,""));return Number.isFinite(r)?r:null}async function _n(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(c=>c.ok?c.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?$t(r.textContent):null,o=e.querySelector(".mini-badge"),i=o?parseInt(o.textContent,10)||0:null;return n==null&&i==null?null:{value:n,itemCount:i,currency:"BRL"}}catch(t){}try{let t=[".minicart-total .price",".js-cart-total",".cart-total",".total-price",".grand-total"];for(let e of t){let r=document.querySelector(e),n=r&&$t(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var Vt={};v(Vt,{addToCart:()=>Sn,detect:()=>Cn,getCartSummary:()=>Tn,id:()=>vn,resolveSku:()=>Ve});var vn="vtex";function Cn(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function Ve(){let t=window;if(t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0])return{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"};if(t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0])return{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"};try{let e=document.querySelector('meta[property="product:sku"]'),r=e&&(e.getAttribute("content")||"").trim();if(r)return{value:String(r),source:"vtex/og-sku"}}catch(e){}return null}var mt=t=>String(t==null?"":t).trim().toLowerCase();async function kn(t,e){let r=location.origin,n=await fetch(r+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(l=>l.json()),o=n&&n.orderFormId;if(!o)throw new Error("vtex: orderFormId indispon\xEDvel");let i=await fetch(r+"/api/checkout/pub/orderForm/"+encodeURIComponent(o)+"/items",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"include",body:JSON.stringify({orderItems:[{id:parseInt(t,10),quantity:e||1,seller:"1"}]})}).then(l=>l.json()),c=i&&typeof i.value=="number"?i.value/100:null,a=Array.isArray(i&&i.items)?i.items.reduce((l,u)=>l+(Number(u.quantity)||1),0):null,s=i&&i.storePreferencesData&&i.storePreferencesData.currencyCode||"BRL";return{platform:"vtex",skuId:String(t),cartValue:c,itemCount:a,currency:s}}async function Sn(t){t=t||{};let{size:e,sku:r,quantity:n}=t,o=window.skuJson_0&&window.skuJson_0.skus||[];if(o.length&&window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart){let a=l=>mt(l.skuname)===mt(e)||l.dimensions&&Object.values(l.dimensions).some(u=>mt(u)===mt(e)),s=e?o.find(l=>a(l)&&l.available)||o.find(a):null;if(s||(s=o.find(l=>l.available)||o[0]),!s)throw new Error("vtex: variante n\xE3o encontrada");return await window.vtexjs.checkout.addToCart([{id:parseInt(s.sku,10),quantity:n||1,seller:"1"}]),{platform:"vtex",skuId:s.sku,size:s.skuname||e}}let i=Ve(),c=r||i&&i.value||null;if(!c)throw new Error("vtex: skuId n\xE3o resolvido (IO)");return kn(c,n)}async function Tn(){try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}try{let t=await fetch(location.origin+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(e=>e.json());if(t&&typeof t.value=="number"){let e=(t.items||[]).reduce((r,n)=>r+(Number(n.quantity)||1),0);return{value:t.value/100,itemCount:e,currency:t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL"}}}catch(t){}return null}var Wt={};v(Wt,{addToCart:()=>Rn,detect:()=>En,getCartSummary:()=>Mn,id:()=>An,openCartDrawer:()=>Pn,resolveSku:()=>In,skipRedirect:()=>Ln});var An="nuvemshop",Ln=!0;function En(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function In(){try{let t=window.LS,e=t&&t.variants||[],r=document.querySelector('[name="variant_id"]'),n=r&&r.value?e.find(o=>String(o.id)===String(r.value)):null;if(n||(n=e.find(o=>o.available!==!1&&o.sku)||e.find(o=>o.sku)||e[0]),n&&n.sku)return{value:String(n.sku),source:"nuvemshop/variant"};if(t&&t.product&&t.product.sku)return{value:String(t.product.sku),source:"nuvemshop/product"}}catch(t){}return null}var ht=t=>String(t==null?"":t).trim().toLowerCase();async function Rn({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let a=String(r).replace(/["\\]/g,""),s=document.querySelector('[data-product-id="'+a+'"]'),l=s&&s.querySelector("form[action]"),u=l&&l.getAttribute("action")||"/comprar/",h=window.LS;if(h&&typeof h.addToCartEnhanced=="function")try{let m=document.createElement("form");m.setAttribute("action",u),m.setAttribute("method","post");let b=document.createElement("input");return b.type="hidden",b.name="add_to_cart",b.value=a,m.appendChild(b),document.body.appendChild(m),h.addToCartEnhanced(m),setTimeout(()=>{try{m.remove()}catch(f){}},3e3),{platform:"nuvemshop",productId:a,via:"gallery-enhanced"}}catch(m){}let d=!1,y=null;try{let b=await(await fetch(u,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(a)+"&quantity="+(e||1)})).json().catch(()=>({}));d=!!b.success,y=b.error_code||null}catch(m){}return{platform:"nuvemshop",productId:a,via:"gallery",added:d,reason:y}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(a=>{let s=[...a.options].find(l=>ht(l.textContent).includes(ht(t))||ht(l.value)===ht(t));s&&(a.value=s.value,a.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(a=>setTimeout(a,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(a=>setTimeout(a,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function Pn(){try{if([...document.querySelectorAll('#ajax-cart-details, .modal-cart, [class*="cart-modal" i], [class*="modal-cart" i]')].find(o=>{try{return o.getBoundingClientRect().width>0&&getComputedStyle(o).display!=="none"}catch(i){return!1}}))return!0;let r=[...document.querySelectorAll('[data-toggle="#modal-cart"], [data-toggle*="cart" i], #ajax-cart a.js-modal-open, .cart-summary a.js-modal-open, .js-toggle-cart')],n=r.find(o=>{let i=o.getBoundingClientRect();return i.width>0&&i.height>0})||r[0];if(n)return setTimeout(()=>{try{n.click()}catch(o){}},300),!0;if(window.LS&&typeof window.LS.toggleCart=="function")return setTimeout(()=>{try{window.LS.toggleCart()}catch(o){}},300),!0}catch(t){}return!1}function Mn(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,c)=>i+(Number(c.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var Jt={};v(Jt,{addToCart:()=>qn,detect:()=>Bn,getCartSummary:()=>Dn,id:()=>jn,openCartDrawer:()=>Un,resolveSku:()=>Nn,skipRedirect:()=>On});var jn="wake",On=!0;function Bn(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function Nn(){try{let t=document.querySelector('input[name="product-id"], [data-product-id]'),e=t?t.value||t.getAttribute("data-product-id"):null;if(e)return{value:String(e).trim(),source:"wake/product-id"};let r=(location.pathname||"").match(/-(\d+)\/?(?:[?#]|$)/);if(r)return{value:r[1],source:"wake/url"}}catch(t){}return null}var We=t=>String(t==null?"":t).trim().toLowerCase();async function qn({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(c=>We(c.getAttribute("attribute-value"))===We(t));if(i){try{i.checked=!0}catch(c){}try{typeof window.selectAttribute=="function"?window.selectAttribute(i):i.click()}catch(c){}await new Promise(c=>setTimeout(c,600))}}let r=document.querySelector('[name="product-variant-id"]'),n=r&&r.value;if(!n)throw new Error("wake: product-variant-id n\xE3o encontrado");if(typeof window.addOrCreateCheckout!="function")throw new Error("wake: addOrCreateCheckout indispon\xEDvel");if(!await window.addOrCreateCheckout([{productVariantId:Number(n),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:n,size:t||null}}function Je(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}async function Dn(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?Je(o.textContent):null},e=t();if(e==null&&typeof window.loadMiniCart=="function"){try{window.loadMiniCart()}catch(o){}await new Promise(o=>setTimeout(o,700)),e=t()}e==null&&(e=zn());let r=document.querySelector('.mc-products__count, [class*="mc-"][class*="count" i], [class*="minicart" i] [class*="count" i]'),n=r&&parseInt(String(r.textContent||"").replace(/\D/g,""),10)||null;if(e!=null)return{value:e,itemCount:n,currency:"BRL"}}catch(t){}return null}function zn(){try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart')||document;for(let e of t.querySelectorAll("div,span,p,li,strong,b")){if(e.children.length>2)continue;let r=(e.textContent||"").replace(/\s+/g," ").trim();if(!(!/R\$/.test(r)||/frete|faltam|gr[aá]tis|desconto|economi/i.test(r))&&/^(sub)?total\b/i.test(r)){let n=Je(r);if(n)return n}}}catch(t){}return null}function Un(){if(typeof window.setCartDivVisibility!="function")return!1;try{typeof window.loadMiniCart=="function"&&window.loadMiniCart()}catch(t){}return setTimeout(()=>{try{let t=document.querySelector('[class*="mini-cart" i], .mini-cart');if(t&&t.getBoundingClientRect().width>0)return;window.setCartDivVisibility()}catch(t){}},350),!0}var Yt={};v(Yt,{addToCart:()=>Vn,cartUrl:()=>$n,detect:()=>Hn,getCartSummary:()=>Wn,id:()=>Fn,openCartDrawer:()=>Jn,skipRedirect:()=>Kn});var Gt="/api/v2/front",Xt={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ge=t=>String(t==null?"":t).trim().toLowerCase(),Fn="wapstore",Kn=!0,$n="/checkout/carrinho";function Hn(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Xe(t){if(!t||typeof t!="object")return null;let e=t.subtotal&&t.subtotal.valor;return e==null?null:{value:e,itemCount:t.quantidadeItens!=null?t.quantidadeItens:null,currency:"BRL"}}async function Vn({size:t,quantity:e}){let r=await fetch(Gt+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:Xt}).then(d=>d.json()),n=(r&&(r.produto||r.data||r)||{}).conteudo||{},o=n.atributos&&n.atributos.simples&&n.atributos.simples.valores||[];if(!o.length)throw new Error("wapstore: sem variante de compra (atributos.simples)");let i=t?o.find(d=>Ge(d.label)===Ge(t)):null;i=i||o.find(d=>d.selecionado)||o.find(d=>(d.estoque||0)>0)||o[0];let c=i&&i.carrinho;if(!c||!c.itens||!c.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let a=c.itens.map(d=>Object.assign({},d,{quantidade:String(e||d.quantidade||1)})),s=await fetch(Gt+"/checkout/cart",{method:"POST",headers:Xt,body:JSON.stringify({itens:a,tipo:c.tipo||"produto"})});if(!s.ok)throw new Error("wapstore: add HTTP "+s.status);let l=await s.json().catch(()=>({})),u=Xe(l),h={platform:"wapstore",idProduto:a[0]&&a[0].idProduto,size:i&&i.label||null};return u&&(h.cartValue=u.value,h.itemCount=u.itemCount,h.currency=u.currency),h}async function Wn(){try{let t=await fetch(Gt+"/checkout/cart",{headers:Xt}).then(e=>e.json());return Xe(t)}catch(t){}return null}function Jn(){try{let t=document.querySelector(".common-sheet.side-cart, .side-cart");if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('.button-cart, [class*="button-cart"]');if(e)return e.click(),!0}catch(t){}return!1}var Zt={};v(Zt,{addToCart:()=>ro,detect:()=>Zn,getCartSummary:()=>no,id:()=>Gn,openCartDrawer:()=>oo,resolveSku:()=>Qn,skipRedirect:()=>Xn});var Ye=t=>String(t==null?"":t).trim().toLowerCase(),Gn="linx",Xn=!0;function Yn(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function Zn(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function Qn(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function to(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}function eo(t){if(t==null||t==="")return!1;let e=Ye(t),r=e.replace(/\D/g,""),n=[...document.querySelectorAll('input[type="radio"]')].filter(i=>/aro|tamanho|grade|numera|size|variant/i.test(i.name||i.id||"")),o=n.find(i=>Ye(i.value)===e)||(r?n.find(i=>String(i.value).replace(/\D/g,"")===r):null);if(!o)return!1;try{o.checked||(o.checked=!0),(o.labels&&o.labels[0]||null||o).click(),o.dispatchEvent(new Event("change",{bubbles:!0}))}catch(i){}return!0}async function ro(t){t=t||{};let e=to();if(!e)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.size!=null&&t.size!==""&&(eo(t.size),await new Promise(r=>setTimeout(r,1100))),e.click(),await new Promise(r=>setTimeout(r,1400)),{platform:"linx"}}function no(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=Yn(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function oo(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var te={};v(te,{addToCart:()=>et,detect:()=>co,id:()=>io,resolveSku:()=>Qt});var io="generic";function co(){return!0}function Qt(){let t=L(["Product"]);if(t[0]){let e=t[0],r=e.sku||e.mpn||e.gtin13||e.productID;if(r)return{value:String(r),source:"jsonld"}}try{let e=document.querySelector('[itemprop="sku"]');if(e){let r=e.getAttribute("content")||(e.textContent||"").trim();if(r)return{value:String(r),source:"microdata"}}}catch(e){}try{let e=window.konfidencyData;if(e&&e.product&&e.product.variants&&e.product.variants[0])return{value:String(e.product.variants[0]),source:"konfidency"}}catch(e){}return null}var ao=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,lo=/continuar|como comprar|lista|desejos|favorito/i;async function et(){let t=document.querySelectorAll("button,[role=button],input[type=submit]");for(let e of t){let r=(e.textContent||e.value||"").replace(/\s+/g," ").trim();if(r&&r.length<40&&ao.test(r)&&!lo.test(r))try{return e.click(),{platform:"native-click",clicked:r}}catch(n){}}return{platform:"none",error:"bot\xE3o de carrinho nativo n\xE3o encontrado"}}var Qe=[Kt,pt,Ht,Vt,Wt,Jt,Yt,Zt],so=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],yt;function $(){return yt||(yt=Qe.find(t=>{try{return t.detect()}catch(e){return!1}})||te,yt)}function tr(){let t=Qe.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of so)try{if(r())return e}catch(n){}return null}function H(){let t=$();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return Qt()}async function er(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||t.aro||t.ringSize||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null},r=$();try{let n=r.addToCart?await r.addToCart(e):await et(e);return w("cart: adicionado",n),ee(),Ze(r,n,e.sku),n}catch(n){w('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await et(e);return ee(),Ze(r,o,e.sku),o}}async function Ze(t,e,r){try{let n=null;e&&e.cartValue!=null?n={value:e.cartValue,itemCount:e.itemCount!=null?e.itemCount:null,currency:e.currency||null}:t&&t.getCartSummary&&(n=await t.getCartSummary()),n&&n.value!=null&&(n.value>0||(n.itemCount||0)>0)&&p("cart_value",{via:"tryon",value:n.value,itemCount:n.itemCount!=null?n.itemCount:null,currency:n.currency||null,sku:r||null})}catch(n){}}async function re(){let t=$();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function rr(t){t=t||{};let e=$(),r={platform:e.id};try{let n=H();r.sku=n&&n.value||null;let o={size:t.size||null,color:t.color||null,sku:r.sku,quantity:t.quantity||1};r.added=e.addToCart?await e.addToCart(o):await et(o),ee();try{await ne()}catch(i){}r.cart=await re(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function ee(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function ne(t){if(t&&t.drawerHandled)return!1;let e=$(),r=g(),n=null;try{n=await K()}catch(c){}let o=n&&n.template&&n.template.cart||n&&n.cart||{},i=o.afterAdd||o.behavior||r.cartBehavior;if(i||(i=r.cartRedirect===!1?"none":"auto"),i==="none")return!1;if(i==="auto"||i==="drawer"){let c=o.openSelector||r.cartOpenSelector;if(c){let a=document.querySelector(c);if(a)return setTimeout(()=>{try{a.click()}catch(s){}},300),!1}else if(e&&e.openCartDrawer){let a=!1;try{a=e.openCartDrawer()}catch(s){}if(a)return!1}}return!0}function nr(){let t=$();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var uo=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced|checkout\/[^?#]*success)/i,fo=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,po=/\/checkout/i,mo=/\/(cart|carrinho|sacola|bag|comprar)(\/|$|\?|#)/i,or=/\/(products?|produtos?|p)\//i,ho=/\/(collections?|categoria|categorias|c|departamento)\//i,yo=/\/(search|busca|s)(\/|\?)/i;function ir(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=fo.test(t);try{let r=L(),n=0,o=!1,i=!1;for(let c of r){let a=Array.isArray(c["@type"])?c["@type"]:[c["@type"]];if((a.includes("Order")||a.includes("Invoice"))&&!e)return"purchase";a.includes("SearchResultsPage")&&(o=!0),(a.includes("CollectionPage")||a.includes("ItemList"))&&(i=!0),a.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return or.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":uo.test(t)&&!e?"purchase":po.test(t)?"checkout":mo.test(t)?"cart":or.test(t)?"pdp":ho.test(t)?"category":yo.test(t)?"search":"other"}function cr(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let c=r.get(i);c&&(o[i.replace("utm_","")]=c)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:go()}}function go(){return tr()}var oe={},wo=null,rt=0,ar=!1;function lr(t){ar||(ar=!0,sr(t),bo(),xo(),_o(),vo(),Co(t))}function sr(t){oe={};let e=ir(),r=cr(e);if(Be(r),p("view",{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:e}),typeof t=="function")try{t(e,r)}catch(n){}}function bo(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let a=0;a<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");a++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},c=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(c||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),p("click",i)}catch(n){}},{capture:!0,passive:!0})}function xo(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let c of t)i>=c&&!oe[c]&&(oe[c]=!0,p("scroll_depth",{depth:c}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function _o(){document.body&&document.body.addEventListener("submit",t=>{try{let e=t.target;if(!e||e.tagName!=="FORM"||e.querySelector('input[type="password"], input[name*="card"], input[name*="cpf"]'))return;let r="other",n=(e.className||"").toLowerCase(),o=(e.action||"").toLowerCase();e.querySelector('input[type="search"], input[name="q"], input[name="s"]')?r="search":/newsletter|subscribe|mailchimp/.test(n+o)?r="newsletter":/contact|contato/.test(n+o)&&(r="contact"),p("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function vo(){let t=g();rt=Date.now(),wo=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-rt)/1e3);rt=e,r>0&&r<60&&p("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-rt)/1e3);e>0&&e<600&&p("engagement",{url:location.pathname,dwellSec:e})}rt=Date.now()})}function Co(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,sr(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}catch(n){}}function ce(){let t=H(),e=L(["Product"]);if(e.length>0){let o=e[0],i=Array.isArray(o.offers)?o.offers[0]:o.offers;return{sku:t?t.value:o.sku||o.mpn||o.gtin13||o.productID||null,skuSource:t?t.source:null,name:typeof o.name=="string"?o.name:null,price:i&&parseFloat(i.price||i.lowPrice)||null||ur(),currency:i?i.priceCurrency:null,brand:o.brand?typeof o.brand=="string"?o.brand:o.brand.name:null,category:o.category||null}}let r=o=>{let i=document.querySelector('meta[property="og:'+o+'"], meta[property="product:'+o+'"]');return i?i.getAttribute("content"):null},n=o=>{let i=document.querySelector('[itemprop="'+o+'"]');return i?i.getAttribute("content")||(i.textContent||"").trim():null};if(t||r("type")==="product"||r("price:amount")||n("name")){let o=n("price")||r("price:amount"),i=o&&parseFloat(String(o).replace(",","."))||null;return{sku:t?t.value:null,skuSource:t?t.source:null,name:n("name")||r("title")||document.title||null,price:(i&&i>0?i:null)||ur(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function ur(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,c=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,a=ie(c!=null?String(c):"");if(a)return a}}catch(t){}return null}function E(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function gt(){let t=L(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||E(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||E(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{let o=window.LS&&window.LS.order;if(o&&o.total!=null){let i=Number(o.total),c=window.LS.currency&&window.LS.currency.code||"BRL";return{orderId:String(o.number||o.id||E()||""),revenue:Number.isFinite(i)?i/100:null,currency:c,source:"nuvemshop"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],c=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(c&&(i.event==="purchase"||c.purchase||c.transaction_id)){let a=c.purchase&&c.purchase.actionField,s=parseFloat(a&&(a.revenue||a.value)||c.value||c.revenue);return{orderId:a&&(a.id||a.transaction_id)||c.transaction_id||c.transactionId||E(),revenue:Number.isFinite(s)?s:null,currency:c.currency||c.currencyCode||a&&a.currency||null,itemCount:(c.purchase&&c.purchase.products||c.items||c.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:E(),revenue:parseFloat(e.content)||null,source:"meta"};let r=ko();if(r)return r;let n=E();return n?{orderId:n,revenue:null,source:"url"}:null}function ko(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=ie(n.length>1?n[n.length-1]:r);if(o)return{orderId:dr(),revenue:o,currency:(n.length>1?n[0]:null)||null,source:"dom"}}let e=[".order-total","#order-total",".total-price",".order__total","[data-order-total]",".summary-total",".grand-total"];for(let r of e){let n=document.querySelector(r);if(n){let o=ie(n.value||n.textContent);if(o)return{orderId:dr(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function dr(){try{let t=document.querySelector(".orderID");if(t&&(t.value||t.getAttribute("value")))return t.value||t.getAttribute("value");let r=(document.body.innerText||"").match(/(?:pedido|order|n[º°o]\.?)\s*#?\s*([A-Z0-9-]{4,})/i);return r?r[1]:null}catch(t){return null}}function ie(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r;e.indexOf(",")>e.indexOf(".")?r=e.replace(/\./g,"").replace(",","."):r=e.replace(/,/g,"");let n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function fr(){let t=L(["ItemList","CollectionPage"]);if(t.length===0)return null;let e=t[0],r=e.itemListElement||e.mainEntity&&e.mainEntity.itemListElement||[],n=[];for(let o of r.slice(0,50)){let i=o.item||o;i&&(i.sku||i.productID||i.name)&&n.push(i.sku||i.productID||i.name)}return n.length>0?{count:n.length,skus:n.slice(0,20)}:null}var bt=!1,wt=[/\b(adicionar|adic\.?|colocar|incluir|jogar)\b.{0,30}\b(carrinho|sacola|sacolinha|bag)\b/i,/\bcomprar\b(?!\s+(em|por|sem))/i,/\bcomprar\s*$/i,/^add\s+to\s+(cart|bag)\b/i,/^buy\s+(now|it|this)\b/i,/^(sacolinha|carrinho|sacola)$/i],So=[/^finalizar(\s+(compra|pedido|pagamento))?\b/i,/^(fechar|confirmar)\s+(compra|pedido|pagamento)\b/i,/^pagar(\s+(agora|pedido))?\b/i,/^(complete|place)\s+(purchase|order)\b/i,/^checkout$/i];function nt(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function yr(t){switch(t){case"pdp":{let e=ce();p("view_item",e||{sku:null});break}case"category":case"search":{let e=fr();p("view_item_list",e||{count:0});break}case"cart":re().then(e=>p("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>p("view_cart",{}));break;case"checkout":p("begin_checkout",{});break;case"purchase":To();break}}var pr=500,mr=30;function To(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,gr(o,i))};try{window.addEventListener("pagehide",()=>r(gt(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=gt();if(o&&o.revenue!=null)return r(o);if(e++>=mr)return w("purchase: receita n\xE3o apareceu em "+pr*mr+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,pr)};n()}function gr(t,e){if(!bt){if(t&&!t.orderId&&(t.orderId=E()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){w("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}if(bt=!0,p("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),w("purchase emitido",t),e)try{j(!0)}catch(r){}}}var hr=!1;function wr(){if(hr)return;hr=!0;let t=r=>{try{if(!r||typeof r!="object")return!1;let n=r.ecommerce||r.ecommerce_data&&r.ecommerce_data.ecommerce;return n?r.event==="purchase"||r.event==="transaction"||!!n.purchase||n.transaction_id!=null:!1}catch(n){return!1}},e=r=>{bt||!t(r)||setTimeout(()=>{if(!bt)try{gr(gt(),!0)}catch(n){}},0)};try{let r=window.dataLayer=window.dataLayer||[];for(let o=0;o<r.length;o++)e(r[o]);let n=r.push;r.push=function(){let o=n.apply(this,arguments);try{for(let i=0;i<arguments.length;i++)e(arguments[i])}catch(i){}return o}}catch(r){}}function br(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let a=0;a<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");a++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let c=!1;if((nt([wt[0]],i)||o&&nt([wt[1]],i)||o&&nt([wt[2]],i)||nt(wt.slice(3),i))&&(c=!0),c){t=r;let a=ce();p("add_to_cart",{via:"click",buttonText:i,sku:a?a.sku:null,price:a?a.price:null});return}o&&nt(So,i)&&(t=r,p("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var xt={};v(xt,{available:()=>Io,id:()=>Ao,iframeSrc:()=>Eo,modalSize:()=>Lo,onMounted:()=>Ro});var Ao="mk-fashion",Lo={width:430,height:800};function Eo(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return g().appUrl+"/"+t+"/"+r}async function Io(t,e){let r=g().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function Ro(){}var ae={};v(ae,{available:()=>Bo,id:()=>Po,iframeSrc:()=>Oo,modalSize:()=>Mo,onMounted:()=>zo});var Po="mk-makeup",Mo={width:1160,height:700};function jo(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function Oo(t){return jo()+"/"+encodeURIComponent(t)}async function Bo(t,e){let r=window.__MK&&window.__MK.pulpoarProjectKey||t;if(!r)return{available:!0};let n=await xr(e)||e;if(!n)return{available:!0};try{let i=String(g().collectorUrl||"").replace(/\/+$/,"")+"/v1/makeup/availability/"+encodeURIComponent(r)+"?slug="+encodeURIComponent(n),c=await fetch(i).then(a=>a.json());return w("pulpoar availability",c),{available:!(c&&c.available===!1)}}catch(o){return w("pulpoar availability erro",o&&o.message),{available:!0}}}var No="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",_t=null;function qo(){return window.pulpoar?Promise.resolve(window.pulpoar):_t||(_t=new Promise(t=>{try{let e=document.createElement("script");e.src=No,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),_t)}async function xr(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(s=>s.json())).variants||[],c=n?i.find(s=>String(s.id)===String(n)):null;if(c&&c.sku)return c.sku;let a=i.find(s=>s.available)||i[0];if(a&&a.sku)return a.sku}}}catch(e){}return t||null}function Do(t){let e=Array.isArray(t)?t[0]:t;return!e||typeof e!="object"?{quantity:1}:{sku:e.sku||e.slug||e.key||e.variant_key||e.barcode||null,color:e.color||e.shade||e.colorName||null,size:e.size||null,quantity:1}}function zo(t,e){qo().then(async r=>{if(!r){w("pulpoar: SDK n\xE3o carregou");return}let n=await xr(e.identifier);if(w("pulpoar variante p/ cat\xE1logo",n),n)try{r.applyVariantsWithCatalog([String(n)],o=>{e.track("product_loaded",{via:"makeup",applied:Array.isArray(o)?o.length:0})})}catch(o){w("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{w("pulpoar onAddToCart",o),e.handleAddToCart(Do(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var Uo={"mk-fashion":xt,"mk-makeup":ae};function vt(t){return Uo[t]||xt}var S=null,k=null,kt=!1,St=!1,R=null,_r={},le=null,Ct=0,C={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},Fo={gregory:"698c7e791d3129430f15dddd"};function Cr(t){return t?Fo[String(t).toLowerCase()]||t:null}async function B(t,e){let r=Cr(t),n=String(e||"").trim();return vt(g().product).available(r,n)}async function kr(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await B(t,e)).available===!0}catch(r){return!1}}async function ot(t){if(t=t||{},kt)return;let e=Cr(t.projectId||t.projectid||t.store),r=String(t.identifier||t.sku||"").trim();if(!e||!r){console.error("[mk-sdk] open: projectId e identifier obrigatorios");return}let n=e+":"+r;if(_r[n]!==!0){try{if(!(await B(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}_r[n]=!0}let o=vt(g().product).modalSize||{width:430,height:800};R={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},St=!1,Ar(),Ko(R),kt=!0,Ct=Date.now(),p("modal_opened",{projectId:e,identifier:r})}function ue(){if(!kt)return;let t=St;if(St=!1,$o(),kt=!1,I("onClose"),p("modal_closed",{projectId:R&&R.projectId,identifier:R&&R.identifier}),t)try{nr()}catch(e){}}function Sr(t){try{Br().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function Ko(t){S=document.createElement("div"),S.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",Sr(!0);let e=document.createElement("div"),r=typeof t.width=="number"?t.width+"px":t.width,n=typeof t.height=="number"?t.height+"px":t.height;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:12px;overflow:hidden;background:#fff;",k=document.createElement("iframe");let o=vt(g().product);k.src=o.iframeSrc(t.projectId,t.identifier),k.style.cssText="width:100%;height:100%;border:none;",k.setAttribute("allow","camera *; microphone *"),k.setAttribute("allowfullscreen","true"),e.appendChild(k),S.appendChild(e),document.body.appendChild(S);try{o.onMounted(k,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:Lr,track:p,fire:I})}catch(i){w("launcher.onMounted falhou",i&&i.message)}w("try-on modal aberto",k.src)}function $o(){S&&S.parentNode&&S.parentNode.removeChild(S),S=null,k=null,Sr(!1)}var vr=!1;function Tr(){Ar()}function Ar(){vr||(vr=!0,window.addEventListener("message",t=>{let e=t.data;if(!e||e.source!=="mkfashion-app")return;let r=e.action,n=e.data||{};switch(r){case"close_request":ue();break;case"ready":I("onReady",n);break;case"product_loaded":I("onProductLoaded",n),p("product_loaded",se(n));break;case"interaction":{I("onInteraction",n),n&&n.method&&(le=n.method),p(Ho(n),se(n));break}case"add_to_cart":Lr(n,"tryon");break;case"generation_start":Ct=Date.now();break;case"generation_complete":I("onGenerationComplete",n),p("generation_complete",{method:n.method||le||"unknown",durationMs:Ct?Date.now()-Ct:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":I("onError",n),p("generation_error",{method:le||"unknown",error:n&&n.error});break}}))}function Lr(t,e){if(p("add_to_cart",Object.assign({via:e||"tryon"},se(t))),typeof C.onAddToCart=="function"){I("onAddToCart",t);return}let r=Object.assign({productId:R&&R.identifier},t);er(r).then(n=>ne(n)).then(n=>{St=!!n}).catch(()=>{})}function Ho(t){return t&&t.action,"interaction"}function se(t){if(!t||typeof t!="object")return t;let e={};for(let r in t){if(r==="imageUrl"||r==="image"||r==="product"){r==="product"&&t[r]?(e.productSku=t[r].sku||null,e.productName=t[r].name||null):e[r+"Present"]=!!t[r];continue}e[r]=t[r]}return e}function I(t,e){if(typeof C[t]=="function")try{C[t](e)}catch(r){console.error("[mk-sdk]",r)}}function Er(t){C.onReady=t}function Ir(t){C.onClose=t}function Rr(t){C.onAddToCart=t}function Pr(t){C.onProductLoaded=t}function Mr(t){C.onError=t}function jr(t){C.onInteraction=t}function Or(t){C.onGenerationComplete=t}var Wo=767,Jo=1024,Go=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,Xo=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function de(t){try{let e=t.getBoundingClientRect();if(e.width<=0||e.height<=0)return!1;let r=getComputedStyle(t);return r.display!=="none"&&r.visibility!=="hidden"&&r.opacity!=="0"}catch(e){return!1}}function Yo(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&de(e)}catch(e){return!1}}function Zo(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function Qo(t){if(!t||typeof t!="object"||t.selector)return t;let e=!1;if(["mobile","tablet","desktop"].forEach(n=>{let o=t[n];o&&o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"&&(e=!0)}),!e)return t;let r={};return["mobile","tablet","desktop"].forEach(n=>{let o=t[n];if(o){if(o.selector){r[n]=o;return}if(o.mkAnchor===1&&o.anchor&&typeof o.anchor=="object"){let i=o.anchor[n]||o.anchor.desktop||o.anchor.mobile||o.anchor.tablet;i&&i.selector&&(r[n]=i)}}}),["bpMobile","bpTablet","breakpoint"].forEach(n=>{t[n]!=null&&(r[n]=t[n])}),r}function Tt(t){if(!t||typeof t!="object")return null;if(t=Qo(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(s=>s[1]&&s[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,s])=>Yo(s.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||Wo,i=Number(t.bpTablet)||Jo,c=s=>(e.find(l=>l[0]===s)||[])[1],a=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let s of a){let l=c(s);if(l)return l}return e[0][1]}function fe(t){let e=Tt(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&de(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function Nr(){let t=g(),e=fe(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=Zo(n);if(!(!o||o.length>40)&&!Xo.test(o)&&Go.test(o)&&de(n))return{el:n,position:"afterend",mode:"flow",style:"",selector:null}}return null}var _="'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",pe={none:"0",sm:"4px",md:"8px",pill:"9999px"},me={none:"0",sm:"4px",md:"8px",lg:"16px"},ti='<svg viewBox="0 0 17.5263 20.6862" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%"><g><path d="M8.49995 12.1862C10.1568 12.1862 11.5 10.8431 11.5 9.18622C11.5 7.52936 10.1568 6.18622 8.49995 6.18622C6.8431 6.18622 5.49995 7.52936 5.49995 9.18622C5.49995 10.8431 6.8431 12.1862 8.49995 12.1862Z" stroke="currentColor" shape-rendering="crispEdges"/><path d="M0.5 9.11152C0.5 6.56953 0.5 5.29894 1.1099 4.38664C1.375 3.9902 1.71424 3.65088 2.10821 3.38809C2.6945 2.9958 3.42899 2.85564 4.55351 2.80588C5.09013 2.80588 5.55183 2.39949 5.65687 1.87284C5.73715 1.48708 5.94572 1.14138 6.24735 0.894155C6.54898 0.646934 6.92516 0.51336 7.31231 0.516006H9.9734C10.7779 0.516006 11.4709 1.08412 11.6288 1.87284C11.7339 2.39949 12.1956 2.80588 12.7322 2.80588C13.8559 2.85564 12.9129 4.67413 13.5 5.06559C13.8949 5.32932 15.1484 3.80355 15.5 4.02647C16.1099 4.93876 16.7857 6.56953 16.7857 9.11152C16.7857 11.6535 16.7857 12.9233 16.1758 13.8364C15.9107 14.2328 15.5715 14.5722 15.1775 14.835C14.2647 15.4445 12.9936 15.4445 10.4522 15.4445H6.83351C4.29213 15.4445 3.02103 15.4445 2.10821 14.835C1.71446 14.5718 1.3755 14.2322 1.11071 13.8356C0.933802 13.5672 0.803519 13.2698 0.725557 12.9564" stroke="currentColor" stroke-linecap="round"/><path d="M12.676 0.607931C12.9446 -0.178095 14.0307 -0.2019 14.3491 0.536515L14.3761 0.60838L14.7385 1.66839C14.8216 1.91149 14.9559 2.13395 15.1322 2.32076C15.3086 2.50757 15.5229 2.65439 15.7608 2.75131L15.8583 2.78769L16.9183 3.14971C17.7044 3.41831 17.7282 4.50437 16.9902 4.82283L16.9183 4.84978L15.8583 5.21225C15.6151 5.29526 15.3926 5.42947 15.2057 5.60582C15.0188 5.78218 14.8719 5.99657 14.7749 6.23453L14.7385 6.33155L14.3765 7.39201C14.1079 8.17803 13.0219 8.20184 12.7039 7.46387L12.676 7.39201L12.314 6.332C12.231 6.08881 12.0968 5.86627 11.9204 5.67938C11.744 5.49249 11.5297 5.3456 11.2917 5.24863L11.1947 5.21225L10.1347 4.85022C9.34817 4.58163 9.32437 3.49557 10.0628 3.17756L10.1347 3.14971L11.1947 2.78769C11.4378 2.70462 11.6602 2.57039 11.847 2.39404C12.0339 2.21769 12.1807 2.00333 12.2776 1.76541L12.314 1.66839L12.676 0.607931Z" fill="currentColor"/></g></svg>',Dr='<svg viewBox="0 0 11.6122 12.7248" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:12px;height:12px"><path d="M4.09055 2.01133C4.43939 0.9905 5.84989 0.959583 6.26347 1.91858L6.29847 2.01192L6.76922 3.38858C6.8771 3.7043 7.05144 3.99321 7.28047 4.23583C7.5095 4.47845 7.7879 4.66912 8.09689 4.795L8.22347 4.84225L9.60014 5.31242C10.621 5.66125 10.6519 7.07175 9.69347 7.48533L9.60014 7.52033L8.22347 7.99108C7.90764 8.09889 7.61862 8.2732 7.3759 8.50223C7.13318 8.73127 6.94241 9.0097 6.81647 9.31875L6.76922 9.44475L6.29905 10.822C5.95022 11.8428 4.53972 11.8737 4.12672 10.9153L4.09055 10.822L3.62039 9.44533C3.51258 9.12951 3.33827 8.84048 3.10924 8.59776C2.8802 8.35504 2.60177 8.16427 2.29272 8.03833L2.16672 7.99108L0.790054 7.52092C-0.231363 7.17208 -0.26228 5.76158 0.69672 5.34858L0.790054 5.31242L2.16672 4.84225C2.48244 4.73437 2.77135 4.56003 3.01397 4.331C3.25658 4.10197 3.44726 3.82357 3.57314 3.51458L3.62039 3.38858L4.09055 2.01133ZM9.86147 0C9.9706 0 10.0775 0.0306123 10.1701 0.0883584C10.2627 0.146104 10.3373 0.228668 10.3853 0.326667L10.4133 0.394917L10.6175 0.993417L11.2166 1.19758C11.3259 1.23474 11.4218 1.30353 11.492 1.39523C11.5623 1.48693 11.6037 1.59741 11.611 1.71268C11.6184 1.82795 11.5914 1.94281 11.5334 2.04271C11.4755 2.14261 11.3891 2.22305 11.2854 2.27383L11.2166 2.30183L10.6181 2.506L10.4139 3.10508C10.3767 3.21442 10.3078 3.31024 10.2161 3.38041C10.1244 3.45058 10.0139 3.49194 9.89859 3.49925C9.78333 3.50656 9.66849 3.47949 9.56863 3.42147C9.46876 3.36345 9.38837 3.27709 9.33764 3.17333L9.30964 3.10508L9.10547 2.50658L8.50639 2.30242C8.39702 2.26526 8.30115 2.19647 8.23092 2.10477C8.16069 2.01307 8.11926 1.90259 8.11189 1.78732C8.10452 1.67205 8.13153 1.55719 8.18951 1.45729C8.24749 1.35739 8.33381 1.27695 8.43755 1.22617L8.50639 1.19817L9.10489 0.994L9.30905 0.394917C9.34839 0.279665 9.42281 0.179613 9.52187 0.108791C9.62094 0.0379686 9.73969 -0.0000730808 9.86147 0Z" fill="currentColor"/></svg>';function x(t,e={}){let r=document.createElement(t);if(e.style&&(r.style.cssText=e.style),e.text!=null&&(r.textContent=e.text),e.html!=null&&(r.innerHTML=e.html),e.attrs)for(let n in e.attrs)r.setAttribute(n,e.attrs[n]);if(e.on)for(let n in e.on)r.addEventListener(n,e.on[n]);if(e.children)for(let n of e.children)n&&r.appendChild(n);return r}function zr(t){return x("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:Dr})}var At=t=>'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">'+t+"</svg>",qr={camera:ti,sparkle:Dr.replace("width:12px;height:12px","width:100%;height:100%"),shirt:At('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),face:At('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),glasses:At('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),wand:At('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')};function V(t,e,r){let n=Number(r)>0?Number(r):24;return x("span",{style:`width:${n}px;height:${n}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${e};flex-shrink:0;`,html:qr[t]||qr.camera})}function W(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function Lt(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(x("link",{attrs:{id:"mk-jakarta-font",rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap"}}))}catch(t){}}function ei(t){return t.subtext?x("span",{style:`display:flex;align-items:center;justify-content:center;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,text:t.subtext}):null}function Ur(t,e){Lt();let r=x("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[V(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px;width:100%;max-width:238px;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};font-family:${_};font-size:${t.fontSize}px;cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,ei(t)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function ni(t){return t.subtext?x("span",{style:`display:flex;align-items:center;gap:4px;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:600;font-size:10px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,children:[zr(t.badgeTextColor),x("span",{text:t.subtext})]}):null}function oi(t,e){return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};filter:drop-shadow(0 0 6px rgba(0,0,0,0.08));font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[V(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Fr(t,e){Lt();let r=x("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;letter-spacing:1px;text-transform:uppercase;color:${t.cardTitleColor};line-height:1.2;`}),t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:12px;max-width:177px;line-height:1.2;color:${t.cardTextColor};`})]}),n=x("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&x("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=x("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[ni(t),oi(t,e)]}),i=x("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};font-size:${t.fontSize}px;`,children:[i]})}function Kr(t,e){let r=Number(t.iconSize)>0?Number(t.iconSize):24;return x("button",{attrs:{type:"button","aria-label":t.text||"Provar virtualmente"},style:`display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${t.bgColor};border:${W(t)};border-radius:${t.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[V(t.icon,t.textColor,r)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}var ai={style:"gregory-black",icon:"camera",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md"};function he(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function it(t,e){let r={...ai,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=pe[r.borderRadius]!=null?pe[r.borderRadius]:"0",r.cardBorderRadiusPx=me[r.cardBorderRadius]!=null?me[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var ye={"gregory-black":Ur,"gregory-card":Fr,"gregory-icon":Kr},hc=Object.keys(ye).concat("none");function $r(t,e){return t&&t.style==="none"?null:(ye[t.style]||ye["gregory-black"])(t,e)}function li(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var N=null,P=[];function Br(){return[N].concat(P).filter(Boolean)}function si(t,e){let r;try{r=document.createElement("iframe"),r.setAttribute("aria-hidden","true"),r.style.cssText="display:none!important;width:0;height:0;border:0;position:absolute;left:-9999px;",(document.body||document.documentElement).appendChild(r);let n=r.contentWindow&&r.contentWindow.Element&&r.contentWindow.Element.prototype&&r.contentWindow.Element.prototype.attachShadow;if(typeof n=="function"){let o=n.call(t,e);return r.remove(),o}}catch(n){}try{r&&r.remove()}catch(n){}return t.attachShadow(e)}var ui=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height|font-size)$/i;function di(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>ui.test(e.split(":")[0].trim().toLowerCase())).join(";")}var It=null,ge=!1,we=0,J={},Hr=!1,ct=null;function M(){return ct||(ct=K().then(t=>t?he(t.template&&t.template.tryOnButton||null)||{__loaded:!0}:(ct=null,null)).catch(()=>(ct=null,null))),ct}function fi(){if(Hr)return;Hr=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{It&&T("pdp")},200)})}catch(e){}}function xe(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function Et(){xe(N),P.forEach(xe),N=null,P=[],It=null}var pi={IMG:1,INPUT:1,VIDEO:1,CANVAS:1,EMBED:1,OBJECT:1,IFRAME:1,BR:1,HR:1,SELECT:1,TEXTAREA:1,SVG:1};function mi(t){switch(t){case"top-center":return"top:0;left:50%;transform:translateX(-50%);";case"top-right":return"top:0;right:0;";case"middle-left":return"top:50%;left:0;transform:translateY(-50%);";case"center":return"top:50%;left:50%;transform:translate(-50%,-50%);";case"middle-right":return"top:50%;right:0;transform:translateY(-50%);";case"bottom-left":return"bottom:0;left:0;";case"bottom-center":return"bottom:0;left:50%;transform:translateX(-50%);";case"bottom-right":return"bottom:0;right:0;";case"top-left":default:return"top:0;left:0;"}}function hi(t,e,r){let o=!pi[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(u){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+mi(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let u=t.getBoundingClientRect(),h=o.getBoundingClientRect(),d=e.offsetWidth,y=e.offsetHeight,m=u.top-h.top+o.scrollTop,b=u.left-h.left+o.scrollLeft,f=r||"top-left",A=m,X=b;f.indexOf("bottom")===0?A=m+u.height-y:(f.indexOf("middle")===0||f==="center")&&(A=m+(u.height-y)/2),f.indexOf("right")>=0?X=b+u.width-d:f.indexOf("center")>=0&&(X=b+(u.width-d)/2),e.style.top=A+"px",e.style.left=X+"px"}catch(u){}};i();let c=()=>i();window.addEventListener("resize",c);let a=setTimeout(i,600),s=setTimeout(i,1500),l=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){l=new ResizeObserver(()=>i());try{l.observe(t)}catch(u){}try{l.observe(o)}catch(u){}}}catch(u){}e.__mkCleanup=()=>{window.removeEventListener("resize",c),clearTimeout(a),clearTimeout(s);try{t.removeEventListener("load",i)}catch(u){}try{l&&l.disconnect()}catch(u){}}}function yi(t,e,r){e.style.cssText="position:absolute;z-index:100;",document.body.appendChild(e);let n=()=>{try{let s=t.getBoundingClientRect(),l=e.offsetWidth,u=e.offsetHeight,h=r||"top-left",d=s.top+window.scrollY,y=s.left+window.scrollX;h.indexOf("bottom")===0?d=s.bottom+window.scrollY-u:(h.indexOf("middle")===0||h==="center")&&(d=s.top+window.scrollY+(s.height-u)/2),h.indexOf("right")>=0?y=s.right+window.scrollX-l:h.indexOf("center")>=0&&(y=s.left+window.scrollX+(s.width-l)/2),e.style.top=Math.round(d)+"px",e.style.left=Math.round(y)+"px"}catch(s){}};n();let o=()=>n();window.addEventListener("resize",o);let i=setTimeout(n,600),c=setTimeout(n,1500),a=null;try{t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",n,{once:!0});let s=t.querySelector&&t.querySelector("img");if(s&&!s.complete&&s.addEventListener("load",n,{once:!0}),typeof ResizeObserver=="function"){a=new ResizeObserver(()=>n());try{a.observe(t)}catch(l){}}}catch(s){}e.__mkCleanup=()=>{window.removeEventListener("resize",o),clearTimeout(i),clearTimeout(c);try{a&&a.disconnect()}catch(s){}}}function gi(t,e,r){try{return t.insertAdjacentElement(r||"afterend",e),!0}catch(n){try{return t.parentNode.insertBefore(e,t.nextSibling),!0}catch(o){return!1}}}async function T(t){let e=g();if(t!=="pdp"){Et();return}if(!e.projectId)return;if(!e._anchorFromPicker){let l=await M();if(l&&l.main&&(e.anchor=l.main),l&&l.anchors&&(e.anchors=l.anchors),l&&l.cards&&(e.cards=l.cards),!e.forceButton&&!(l&&l.main)){Et(),l===null&&we<3&&(we++,setTimeout(()=>T(t),1500));return}we=0}if(ge)return;let r=H(),n=r&&r.value,o=!!e.forceButton,i=l=>l?[l.selector,l.position,l.mode,l.align,l.style].join("~"):"heuristic",c=Array.isArray(e.anchors)?e.anchors:[],a=[n||"demo",i(Tt(e.anchor))].concat(c.map(l=>i(Tt(l)))).join("|"),s=N;if(!(s&&It===a)){if(s&&Et(),!n&&!o){w("auto-mount: SKU n\xE3o resolvido na PDP");return}ge=!0;try{let l=o;o||(J[n]||(J[n]=B(e.projectId,n).then(b=>!!(b&&b.available)).catch(()=>!1)),l=await J[n]);try{Oe(l?"available":"unavailable")}catch(b){}if(!l){w("auto-mount: produto sem try-on",n);return}let u=await M(),h=window.matchMedia("(max-width: 767px)").matches,d=it(u&&u.main||{},h),y=()=>{let b=H(),f=b&&b.value||n||"";Dt(),p("button_clicked",{sku:f,style:d.style}),ot({projectId:e.projectId,identifier:f})},m=Nr();N=_e(m,d,y),P=[];for(let b=0;b<c.length;b++){let f=c[b],A=fe(f);if(!A)continue;let X=u&&u.anchors&&u.anchors[b]||f,Ce=_e(A,it(X,h),y);Ce&&P.push(Ce)}It=a,fi(),w("auto-mount: bot\xE3o",{style:d.style,sku:n,mounted:!!N,extras:P.length,forced:o}),(N||P.length)&&p("button_rendered",{style:d.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!m,position:m?m.position:null,mode:m?m.mode:null,extras:P.length,forced:o})}finally{ge=!1}}}function _e(t,e,r){let n=t&&t.mode||"flow",o=$r(e,r);if(!o)return null;let i=document.createElement("div");i.id=li(),si(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(s=>{try{i.addEventListener(s,l=>{l.stopPropagation()},!1)}catch(l){}});let a=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(t.detached?yi(t.el,i,t.align):hi(t.el,i,t.align),a=!0):(i.style.cssText="display:contents;",a=gi(t.el,i,t.position))),a||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let s=di(t.style);if(s){if(n==="overlay"){let l=s.match(/(?:^|;)\s*z-index\s*:\s*([^;]+)/i);if(l)try{i.style.zIndex=l[1].trim()}catch(u){}}try{o.style.cssText+=";"+s}catch(l){}}}return i}function Vr(){try{let t=g(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton},r={},n=i=>({desktop:i,tablet:i,mobile:i}),o=(i,c,a)=>{i=i||{};let s=d=>c===d?a:r[d];t.anchor=s("primary")?n(s("primary")):i.main||null;let l=Array.isArray(i.anchors)?i.anchors:[],u=l.length;Object.keys(r).concat(c?[c]:[]).forEach(d=>{d&&d.indexOf("extra-")===0&&(u=Math.max(u,(parseInt(d.slice(6),10)||0)+1))});let h=[];for(let d=0;d<u;d++){let y=s("extra-"+d);h[d]=y?n(y):l[d]||null}t.anchors=h,t._anchorFromPicker=!0,t.forceButton=!0};window.addEventListener("message",i=>{if(i.source!==window)return;let c=i.data;if(!(!c||!c.__mkCmd)){if(c.__mkCmd==="getButtons"){M().then(a=>{let s=a&&Array.isArray(a.anchors)?a.anchors.length:0;try{window.postMessage({__mkButtons:{extras:s,hasMain:!!(a&&a.main)}},"*")}catch(l){}});return}if(c.__mkCmd==="previewSlot"){M().then(a=>{o(a,c.slot||"primary",c.live),T("pdp")});return}if(c.__mkCmd==="saveSlot"){c.slot&&c.live&&(r[c.slot]=c.live),M().then(a=>{o(a),T("pdp")});return}if(c.__mkCmd==="galleryPreview"){t.cards=c.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,G(),Rt("category");return}if(c.__mkCmd==="applyRecipe"){M().then(a=>{o(a),c.cards!==void 0&&(t.cards=c.cards||null),T("pdp"),t.cards&&(G(),Rt("category"))});return}if(c.__mkCmd==="cancelPreview"){Object.keys(r).length?M().then(a=>{o(a),T("pdp")}):(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,Et(),G(),T("pdp"));return}}})}catch(t){}}var q=null,at=null,ve=null,lt=new Map;function wi(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function bi(t,e,r){if(lt.has(t))return;let n=!!g().forceButton,o=wi(t,e);if(!o&&!n)return;let i=n;if(i||(J[o]||(J[o]=B(g().projectId,o).then(u=>!!(u&&u.available)).catch(()=>!1)),i=await J[o]),!i||lt.has(t)||!t.isConnected)return;let a={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.injectStyle||e.style||"",detached:!0},l=_e(a,r,()=>{Dt(),p("button_clicked",{sku:o,gallery:!0,style:r.style}),ot({projectId:g().projectId,identifier:o})});l&&(lt.set(t,l),p("button_rendered",{gallery:!0,sku:o,style:r.style}))}function be(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,q.observe(e))})}catch(e){}}function G(){if(q){try{q.disconnect()}catch(t){}q=null}if(at){try{at.disconnect()}catch(t){}at=null}clearTimeout(ve),lt.forEach(t=>xe(t)),lt.clear()}async function Rt(t){let e=g();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){G();return}if(!e.projectId)return;let r=await M(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){G();return}if(q){be(n);return}if(typeof IntersectionObserver!="function")return;let o=it(n,window.matchMedia("(max-width: 767px)").matches);if(o.style==="none"){G();return}q=new IntersectionObserver(i=>{for(let c of i)c.isIntersecting&&(q.unobserve(c.target),bi(c.target,n,o))},{rootMargin:"300px"}),be(n);try{at=new MutationObserver(()=>{clearTimeout(ve),ve=setTimeout(()=>be(n),250)}),at.observe(document.body,{childList:!0,subtree:!0})}catch(i){}w("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{qe(),Vr(),Tr(),e.autoTrack!==!1&&(lr((o,i)=>{yr(o,i),T(o),Rt(o)}),br(),wr()),w("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=Mt();if(e.projectId){let o=Fe(e.projectId);o&&zt(o),K().then(i=>{let c=ze(i);zt(c),Ke(e.projectId,c),w("escopo de coleta",c)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:ot,close:ue,isAvailable:kr,getAvailability:B,onReady:Er,onClose:Ir,onAddToCart:Rr,onProductLoaded:Pr,onError:Mr,onInteraction:jr,onGenerationComplete:Or,testCart:rr,_version:Nt,_isMkSdk:!0};typeof window!="undefined"&&(window.mk=n)}catch(e){typeof console!="undefined"&&console.error("[mk-sdk] boot fatal",e)}})();})();
|
package/dist/mk-sdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{(function(){try{let a=function(){try{var t=JSON.parse(localStorage.getItem(s));return t&&u.test(t.v)&&t.exp>Date.now()?t.v:null}catch(e){return null}},n=function(t){if(!d){d=!0;var e=document.createElement("script");if(e.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+t+"/dist/mk-core.js",e.async=!0,r&&r.attributes)for(var c=0;c<r.attributes.length;c++){var i=r.attributes[c];i.name.indexOf("data-")===0&&e.setAttribute(i.name,i.value)}(document.head||document.documentElement).appendChild(e)}};var l=a,f=n;if(window.__mkBooted)return;window.__mkBooted=!0;var s="mk_sdk_v",v=10*60*1e3,_=700,u=/^\d+\.\d+\.\d+$/,r=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),d=!1,o=a()||"1.1.
|
|
1
|
+
(()=>{(function(){try{let a=function(){try{var t=JSON.parse(localStorage.getItem(s));return t&&u.test(t.v)&&t.exp>Date.now()?t.v:null}catch(e){return null}},n=function(t){if(!d){d=!0;var e=document.createElement("script");if(e.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+t+"/dist/mk-core.js",e.async=!0,r&&r.attributes)for(var c=0;c<r.attributes.length;c++){var i=r.attributes[c];i.name.indexOf("data-")===0&&e.setAttribute(i.name,i.value)}(document.head||document.documentElement).appendChild(e)}};var l=a,f=n;if(window.__mkBooted)return;window.__mkBooted=!0;var s="mk_sdk_v",v=10*60*1e3,_=700,u=/^\d+\.\d+\.\d+$/,r=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),d=!1,o=a()||"1.1.74",m=setTimeout(function(){n(o)},_);fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var e=t&&t.version;if(u.test(e))try{localStorage.setItem(s,JSON.stringify({v:e,exp:Date.now()+v}))}catch(c){}clearTimeout(m),n(u.test(e)?e:o)}).catch(function(){clearTimeout(m),n(o)})}catch(a){}})();})();
|
package/package.json
CHANGED
package/src/platforms/vtex.js
CHANGED
|
@@ -24,27 +24,51 @@ export function resolveSku() {
|
|
|
24
24
|
|
|
25
25
|
const norm = (s) => String(s == null ? '' : s).trim().toLowerCase();
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
27
|
+
// VTEX IO (React): sem vtexjs/skuJson_0 — adiciona via a API REST de orderForm
|
|
28
|
+
// (pega/cria o orderForm do usuário e dá POST no item). skuId = id NUMÉRICO do SKU.
|
|
29
|
+
async function ioAddToCart(skuId, quantity) {
|
|
30
|
+
const base = location.origin;
|
|
31
|
+
const of = await fetch(base + '/api/checkout/pub/orderForm', { headers: { accept: 'application/json' }, credentials: 'include' }).then((r) => r.json());
|
|
32
|
+
const ofId = of && of.orderFormId;
|
|
33
|
+
if (!ofId) throw new Error('vtex: orderFormId indisponível');
|
|
34
|
+
const updated = await fetch(base + '/api/checkout/pub/orderForm/' + encodeURIComponent(ofId) + '/items', {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
37
|
+
credentials: 'include',
|
|
38
|
+
body: JSON.stringify({ orderItems: [{ id: parseInt(skuId, 10), quantity: quantity || 1, seller: '1' }] })
|
|
39
|
+
}).then((r) => r.json());
|
|
40
|
+
const value = (updated && typeof updated.value === 'number') ? updated.value / 100 : null;
|
|
41
|
+
const items = Array.isArray(updated && updated.items) ? updated.items.reduce((n, i) => n + (Number(i.quantity) || 1), 0) : null;
|
|
42
|
+
const cur = (updated && updated.storePreferencesData && updated.storePreferencesData.currencyCode) || 'BRL';
|
|
43
|
+
return { platform: 'vtex', skuId: String(skuId), cartValue: value, itemCount: items, currency: cur };
|
|
44
|
+
}
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
export async function addToCart(opts) {
|
|
47
|
+
opts = opts || {};
|
|
48
|
+
const { size, sku, quantity } = opts;
|
|
49
|
+
const skus = (window.skuJson_0 && window.skuJson_0.skus) || [];
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
// VTEX Legacy (CMS/portal): skuJson_0 + vtexjs.checkout (mapeia tamanho → skuId)
|
|
52
|
+
if (skus.length && window.vtexjs && window.vtexjs.checkout && window.vtexjs.checkout.addToCart) {
|
|
53
|
+
const matchSize = (s) => norm(s.skuname) === norm(size)
|
|
54
|
+
|| (s.dimensions && Object.values(s.dimensions).some((d) => norm(d) === norm(size)));
|
|
55
|
+
let chosen = size ? (skus.find((s) => matchSize(s) && s.available) || skus.find(matchSize)) : null;
|
|
56
|
+
if (!chosen) chosen = skus.find((s) => s.available) || skus[0];
|
|
57
|
+
if (!chosen) throw new Error('vtex: variante não encontrada');
|
|
58
|
+
await window.vtexjs.checkout.addToCart([{ id: parseInt(chosen.sku, 10), quantity: quantity || 1, seller: '1' }]);
|
|
59
|
+
return { platform: 'vtex', skuId: chosen.sku, size: chosen.skuname || size };
|
|
41
60
|
}
|
|
42
|
-
|
|
61
|
+
|
|
62
|
+
// VTEX IO: skuId = o que veio do provador (sku) ou o resolveSku da PDP (OG meta cru).
|
|
63
|
+
const skuRes = resolveSku();
|
|
64
|
+
const skuId = sku || (skuRes && skuRes.value) || null;
|
|
65
|
+
if (!skuId) throw new Error('vtex: skuId não resolvido (IO)');
|
|
66
|
+
return ioAddToCart(skuId, quantity);
|
|
43
67
|
}
|
|
44
68
|
|
|
45
|
-
// Total do carrinho
|
|
46
|
-
//
|
|
47
|
-
export function getCartSummary() {
|
|
69
|
+
// Total do carrinho. Legacy: vtexjs.checkout.orderForm. IO: API REST de orderForm.
|
|
70
|
+
// (CENTAVOS → /100.)
|
|
71
|
+
export async function getCartSummary() {
|
|
48
72
|
try {
|
|
49
73
|
const of = window.vtexjs && window.vtexjs.checkout && window.vtexjs.checkout.orderForm;
|
|
50
74
|
if (of && typeof of.value === 'number') {
|
|
@@ -53,5 +77,12 @@ export function getCartSummary() {
|
|
|
53
77
|
return { value: of.value / 100, itemCount: items, currency: cur };
|
|
54
78
|
}
|
|
55
79
|
} catch (_) {}
|
|
80
|
+
try {
|
|
81
|
+
const o = await fetch(location.origin + '/api/checkout/pub/orderForm', { headers: { accept: 'application/json' }, credentials: 'include' }).then((r) => r.json());
|
|
82
|
+
if (o && typeof o.value === 'number') {
|
|
83
|
+
const items = (o.items || []).reduce((n, i) => n + (Number(i.quantity) || 1), 0);
|
|
84
|
+
return { value: o.value / 100, itemCount: items, currency: (o.storePreferencesData && o.storePreferencesData.currencyCode) || 'BRL' };
|
|
85
|
+
}
|
|
86
|
+
} catch (_) {}
|
|
56
87
|
return null;
|
|
57
88
|
}
|