mk-sdk-git 1.1.34 → 1.1.36

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 CHANGED
@@ -1 +1 @@
1
- (()=>{var wr=Object.defineProperty;var S=(t,e)=>{for(var r in e)wr(t,r,{get:e[r],enumerable:!0})};var gt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},xr={},$=null;function wt(){if($)return $;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||xr.collectorUrl||gt.collectorUrl;return $={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||gt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||gt.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,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},$}function h(){return $||wt()}function f(...t){let e=h();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var re="_mk_vid",ne="_mk_sid",K=null,H=null;function Y(){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 oe(){if(K)return K;try{let t=localStorage.getItem(re);return t||(t="v_"+Y(),localStorage.setItem(re,t)),K=t,t}catch(t){return K="v_"+Y(),K}}function ie(){if(H)return H;try{let t=sessionStorage.getItem(ne);return t||(t="s_"+Y(),sessionStorage.setItem(ne,t)),H=t,t}catch(t){return H="s_"+Y(),H}}var ce=[/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],ae={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},xt=2e3;function le(t){for(let e=0;e<ce.length;e++)if(ce[e].test(t))return!0;return!1}function se(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>xt?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||le(r))continue;let n=t[r];if(ae[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>xt){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=br(n);continue}e[r]=n}return e}function br(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||le(r))continue;let n=t[r];if(ae[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>xt){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var Z=[],bt=null,M=null,_r=["off","pdp_tryon","pdp","all","tryon_engaged"],V,_t=null,Q="unknown",B=[],j=null;function de(){let t=h();return"mk_engaged_"+(t&&t.projectId||"")}function Ct(){if(j!==null)return j;try{j=localStorage.getItem(de())==="1"}catch(t){j=!1}return j}function pe(){if(!Ct()){j=!0;try{localStorage.setItem(de(),"1")}catch(t){}tt(!1)}}var Cr=/^purchase$/;function fe(t,e){if(V===void 0)return"hold";if(V==="off")return"drop";if(V==="all"||e&&Cr.test(e))return"collect";switch(V){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(Ct())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":Q==="available"?"collect":Q==="unavailable"?"drop":"hold";default:return"collect"}}function tt(t){if(!B.length)return;let e=[];for(let r of B){let n=fe(r._pt,r.name);n==="collect"?ye(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}B=e}function vt(t){V=_r.indexOf(t)>=0?t:"all",tt(!1)}function me(t){Q=t==="available"?"available":"unavailable",tt(!1)}function he(t){tt(!0),M=t,_t=t&&t.pageType||null,Q="unknown"}function u(t,e,r){if(!h().projectId){(u._pre=u._pre||[]).push({name:t,params:e,ts:r||Date.now()}),u._pre.length>50&&u._pre.shift();return}if(u._pre&&u._pre.length){let o=u._pre;u._pre=[];for(let i of o)ue(i.name,i.params,i.ts)}ue(t,e,r)}function ue(t,e,r){let n=fe(_t,t);if(n==="collect"){ye(t,e,r);return}if(n==="drop"){f("descartado (escopo)",t);return}B.push({name:t,params:e,ts:r||Date.now(),_pt:_t}),B.length>300&&B.shift()}function ye(t,e,r){let n=h(),o=se(e||{}),i="page_"+vr(t);if(Z.push({name:i,ts:r||Date.now(),params:o}),f("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:M?{pageType:M.pageType,platform:M.platform,url:M.url}:null},"*")}catch(c){}if(Z.length>=n.batchMaxSize){I();return}bt||(bt=setTimeout(()=>{bt=null,I()},n.batchIntervalMs))}function vr(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 I(t){if(Z.length===0)return;let e=h();if(!e.projectId||!e.collectorUrl)return;let r=Z.splice(0,50),n=JSON.stringify({product:e.product||void 0,visitorId:oe(),sessionId:ie(),engaged:Ct()||void 0,events:r,site:M||void 0}),o=e.collectorUrl+"/v1/track";try{fetch(o,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:n}).catch(()=>{})}catch(i){try{navigator.sendBeacon&&navigator.sendBeacon(o+"?projectId="+encodeURIComponent(e.projectId),new Blob([n],{type:"text/plain"}))}catch(c){}}}function ge(){try{window.addEventListener("pagehide",()=>I(!0)),window.addEventListener("beforeunload",()=>I(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&I(!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(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 we=["off","pdp_tryon","pdp","all","tryon_engaged"],kr="all",Sr=30*60*1e3,N=null;function O(){if(N)return N;let t=h();return!t.projectId||!t.apiUrl?(N=Promise.resolve(null),N):(N=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>e.ok?e.json():null).then(e=>e&&e.project||e||null).catch(()=>null),N)}function xe(t){let e=t&&t.analytic&&t.analytic.scope;return we.indexOf(e)>=0?e:kr}var be=t=>"mk_scope_"+t;function _e(t){try{let e=localStorage.getItem(be(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:we.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function Ce(t,e){try{localStorage.setItem(be(t),JSON.stringify({scope:e,exp:Date.now()+Sr}))}catch(r){}}var kt={};S(kt,{addToCart:()=>Lr,detect:()=>Ar,getCartSummary:()=>Pr,id:()=>Tr,openCartDrawer:()=>Mr,resolveSku:()=>Er});var Tr="shopify";function Ar(){return!!(window.Shopify||window.ShopifyAnalytics)}function Er(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var et=t=>String(t==null?"":t).trim().toLowerCase();async function Lr({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(d=>d.json())).variants||[],a=d=>[d.option1,d.option2,d.option3].concat(String(d.title||"").split("/")).map(et).filter(Boolean),s=(d,k)=>a(d).indexOf(et(k))>=0,p=d=>(!t||s(d,t))&&(!e||s(d,e)),m=null;if((t||e)&&(m=c.find(d=>p(d)&&d.available)||c.find(p)),!m&&r&&(m=c.find(d=>et(d.sku)===et(r))),m||(m=c.find(d=>d.available)||c[0]),!m)throw new Error("shopify: variante n\xE3o encontrada");let g=ve(),l=null;if(g&&typeof g.getSectionsToRender=="function")try{l=g.getSectionsToRender().map(d=>({id:d.id,selector:d.selector||"#"+d.id})).filter(d=>d.id)}catch(d){}let y={items:[{id:m.id,quantity:n||1}]};l&&l.length&&(y.sections=l.map(d=>d.id).join(","),y.sections_url=location.pathname);let x=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!x.ok)throw new Error("shopify: /cart/add.js HTTP "+x.status);let b=await x.json().catch(()=>({}));return g&&l&&b.sections&&Ir(g,l,b.sections),{platform:"shopify",variantId:m.id,size:m.title,sku:m.sku||null}}function ve(){return document.querySelector("cart-drawer, cart-notification")}function Ir(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 Pr(){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 Rr=["[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 jr(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function Mr(){let t=ve();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of Rr)try{if(e=[...document.querySelectorAll(r)].find(jr),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var Tt={};S(Tt,{addToCart:()=>Ur,detect:()=>Nr,getCartSummary:()=>Dr,id:()=>Br,resolveSku:()=>Or});var Br="hybris";function Nr(){return!!(window.ACC&&window.ACC.config)}function Or(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var ke=t=>String(t==null?"":t).trim().toLowerCase();async function Ur({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=>ke(y.textContent)===ke(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 p=new URLSearchParams;p.set("productCodePost",o),p.set("qty",String(e||1)),p.set("CSRFToken",a);let m=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:p.toString()});if(!m.ok)throw new Error("hybris: "+s+" HTTP "+m.status);let g=null,l=null;try{let y=await m.clone().json(),x=y&&y.cartData;x&&(g=St(x.total!=null?x.total:x.totalPrice),l=x.totalUnitCount!=null?Number(x.totalUnitCount):Array.isArray(x.products)?x.products.length:null)}catch(y){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:g,itemCount:l,currency:"BRL"}}function St(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 Dr(){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?St(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&&St(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var At={};S(At,{addToCart:()=>$r,detect:()=>Fr,getCartSummary:()=>Kr,id:()=>qr,resolveSku:()=>zr});var qr="vtex";function Fr(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function zr(){let t=window;return t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0]?{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"}:t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0]?{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"}:null}var rt=t=>String(t==null?"":t).trim().toLowerCase();async function $r({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=>rt(i.skuname)===rt(t)||i.dimensions&&Object.values(i.dimensions).some(c=>rt(c)===rt(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 Kr(){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 Et={};S(Et,{addToCart:()=>Gr,detect:()=>Jr,getCartSummary:()=>Xr,id:()=>Hr,resolveSku:()=>Wr,skipRedirect:()=>Vr});var Hr="nuvemshop",Vr=!0;function Jr(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function Wr(){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 nt=t=>String(t==null?"":t).trim().toLowerCase();async function Gr({size:t,quantity:e}){let r=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!r)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&r.querySelectorAll('select[name^="variation"]').forEach(i=>{let c=[...i.options].find(a=>nt(a.textContent).includes(nt(t))||nt(a.value)===nt(t));c&&(i.value=c.value,i.dispatchEvent(new Event("change",{bubbles:!0})))});let n=r.querySelector('[name="quantity"]');return n&&e&&(n.value=String(e)),await new Promise(i=>setTimeout(i,400)),typeof r.requestSubmit=="function"?r.requestSubmit():r.submit(),{platform:"nuvemshop",variantId:(r.querySelector('[name="variant_id"]')||{}).value||null}}function Xr(){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 Lt={};S(Lt,{addToCart:()=>en,detect:()=>Qr,getCartSummary:()=>rn,id:()=>Yr,resolveSku:()=>tn,skipRedirect:()=>Zr});var Yr="wake",Zr=!0;function Qr(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function tn(){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 Se=t=>String(t==null?"":t).trim().toLowerCase();async function en({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(c=>Se(c.getAttribute("attribute-value"))===Se(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 Te(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 rn(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?Te(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()}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){}try{let t=document.querySelectorAll('[class*="total" i],[class*="minicart" i],[class*="cart" i]');for(let e of t){let r=e.textContent||"";if(/total|subtotal/i.test(r)){let n=Te(r.match(/R\$[\s\d.,]+/));if(n)return{value:n,itemCount:null,currency:"BRL"}}}}catch(t){}return null}var Rt={};S(Rt,{addToCart:()=>ln,cartUrl:()=>cn,detect:()=>an,getCartSummary:()=>sn,id:()=>nn,openCartDrawer:()=>un,skipRedirect:()=>on});var It="/api/v2/front",Pt={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ae=t=>String(t==null?"":t).trim().toLowerCase(),nn="wapstore",on=!0,cn="/checkout/carrinho";function an(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Ee(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 ln({size:t,quantity:e}){let r=await fetch(It+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:Pt}).then(l=>l.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(l=>Ae(l.label)===Ae(t)):null;i=i||o.find(l=>l.selecionado)||o.find(l=>(l.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(l=>Object.assign({},l,{quantidade:String(e||l.quantidade||1)})),s=await fetch(It+"/checkout/cart",{method:"POST",headers:Pt,body:JSON.stringify({itens:a,tipo:c.tipo||"produto"})});if(!s.ok)throw new Error("wapstore: add HTTP "+s.status);let p=await s.json().catch(()=>({})),m=Ee(p),g={platform:"wapstore",idProduto:a[0]&&a[0].idProduto,size:i&&i.label||null};return m&&(g.cartValue=m.value,g.itemCount=m.itemCount,g.currency=m.currency),g}async function sn(){try{let t=await fetch(It+"/checkout/cart",{headers:Pt}).then(e=>e.json());return Ee(t)}catch(t){}return null}function un(){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 Mt={};S(Mt,{addToCart:()=>J,detect:()=>pn,id:()=>dn,resolveSku:()=>jt});var dn="generic";function pn(){return!0}function jt(){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 fn=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,mn=/continuar|como comprar|lista|desejos|favorito/i;async function J(){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&&fn.test(r)&&!mn.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 Ie=[kt,Tt,At,Et,Lt,Rt],hn=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],ot;function U(){return ot||(ot=Ie.find(t=>{try{return t.detect()}catch(e){return!1}})||Mt,ot)}function Pe(){let t=Ie.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of hn)try{if(r())return e}catch(n){}return null}function D(){let t=U();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return jt()}async function Re(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1},r=U();try{let n=r.addToCart?await r.addToCart(e):await J(e);return f("cart: adicionado",n),Bt(),Le(r,n,e.sku),n}catch(n){f('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await J(e);return Bt(),Le(r,o,e.sku),o}}async function Le(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)&&u("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 Nt(){let t=U();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function je(t){t=t||{};let e=U(),r={platform:e.id};try{let n=D();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 J(o),Bt();try{await Ot()}catch(i){}r.cart=await Nt(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function Bt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Ot(){let t=U(),e=h(),r=null;try{r=await O()}catch(i){}let n=r&&r.template&&r.template.cart||r&&r.cart||{},o=n.afterAdd||n.behavior||e.cartBehavior;if(o||(o=e.cartRedirect===!1?"none":"auto"),o==="none")return!1;if(o==="auto"||o==="drawer"){let i=n.openSelector||e.cartOpenSelector;if(i){let c=document.querySelector(i);if(c)return setTimeout(()=>{try{c.click()}catch(a){}},300),!1}else if(t&&t.openCartDrawer){let c=!1;try{c=t.openCartDrawer()}catch(a){}if(c)return!1}}return!0}function Me(){let t=U();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var yn=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced)/i,gn=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,wn=/\/checkout/i,xn=/\/(cart|carrinho|sacola|bag)(\/|$|\?|#)/i,bn=/\/(products?|produtos?|p)\//i,_n=/\/(collections?|categoria|categorias|c|departamento)\//i,Cn=/\/(search|busca|s)(\/|\?)/i;function Be(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=gn.test(t);try{let r=E();for(let n of r){let o=Array.isArray(n["@type"])?n["@type"]:[n["@type"]];if((o.includes("Order")||o.includes("Invoice"))&&!e)return"purchase";if(o.includes("Product"))return"pdp";if(o.includes("SearchResultsPage"))return"search";if(o.includes("CollectionPage")||o.includes("ItemList"))return"category"}}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":yn.test(t)&&!e?"purchase":wn.test(t)?"checkout":xn.test(t)?"cart":bn.test(t)?"pdp":_n.test(t)?"category":Cn.test(t)?"search":"other"}function Ne(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:vn()}}function vn(){return Pe()}var Ut={},kn=null,W=0,Oe=!1;function Ue(t){Oe||(Oe=!0,De(t),Sn(),Tn(),An(),En(),Ln(t))}function De(t){Ut={};let e=Be(),r=Ne(e);if(he(r),u("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 Sn(){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)),u("click",i)}catch(n){}},{capture:!0,passive:!0})}function Tn(){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&&!Ut[c]&&(Ut[c]=!0,u("scroll_depth",{depth:c}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function An(){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"),u("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function En(){let t=h();W=Date.now(),kn=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-W)/1e3);W=e,r>0&&r<60&&u("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-W)/1e3);e>0&&e<600&&u("engagement",{url:location.pathname,dwellSec:e})}W=Date.now()})}function Ln(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,De(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)}catch(n){}}function qt(){let t=D(),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||qe(),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)||qe(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function qe(){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=Dt(c!=null?String(c):"");if(a)return a}}catch(t){}return null}function P(){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 Ft(){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||P(),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||P(),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{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)){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||P(),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:P(),revenue:parseFloat(e.content)||null,source:"meta"};let r=In();if(r)return r;let n=P();return n?{orderId:n,revenue:null,source:"url"}:null}function In(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=Dt(n.length>1?n[n.length-1]:r);if(o)return{orderId:Fe(),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=Dt(n.value||n.textContent);if(o)return{orderId:Fe(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function Fe(){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 Dt(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 ze(){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 $e=!1,it=[/\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],Pn=[/^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 G(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function Ve(t){switch(t){case"pdp":{let e=qt();u("view_item",e||{sku:null});break}case"category":case"search":{let e=ze();u("view_item_list",e||{count:0});break}case"cart":Nt().then(e=>u("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>u("view_cart",{}));break;case"checkout":u("begin_checkout",{});break;case"purchase":Rn();break}}var Ke=500,He=16;function Rn(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,jn(o,i))};try{window.addEventListener("pagehide",()=>r(Ft(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=Ft();if(o&&o.revenue!=null)return r(o);if(e++>=He)return f("purchase: receita n\xE3o apareceu em "+Ke*He+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,Ke)};n()}function jn(t,e){if(t&&!t.orderId&&(t.orderId=P()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){f("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}else if($e)return;if($e=!0,u("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),f("purchase emitido",t),e)try{I(!0)}catch(r){}}function Je(){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((G([it[0]],i)||o&&G([it[1]],i)||o&&G([it[2]],i)||G(it.slice(3),i))&&(c=!0),c){t=r;let a=qt();u("add_to_cart",{via:"click",buttonText:i,sku:a?a.sku:null,price:a?a.price:null});return}o&&G(Pn,i)&&(t=r,u("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var ct={};S(ct,{available:()=>On,id:()=>Mn,iframeSrc:()=>Nn,modalSize:()=>Bn,onMounted:()=>Un});var Mn="mk-fashion",Bn={width:430,height:800};function Nn(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return h().appUrl+"/"+t+"/"+r}async function On(t,e){let r=h().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function Un(){}var zt={};S(zt,{available:()=>$n,id:()=>Dn,iframeSrc:()=>zn,modalSize:()=>qn,onMounted:()=>Wn});var Dn="mk-makeup",qn={width:1160,height:700};function Fn(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function zn(t){return Fn()+"/"+encodeURIComponent(t)}function $n(){return Promise.resolve({available:!0})}var Kn="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",at=null;function Hn(){return window.pulpoar?Promise.resolve(window.pulpoar):at||(at=new Promise(t=>{try{let e=document.createElement("script");e.src=Kn,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),at)}async function Vn(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 Jn(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 Wn(t,e){Hn().then(async r=>{if(!r){f("pulpoar: SDK n\xE3o carregou");return}let n=await Vn(e.identifier);if(f("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){f("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{f("pulpoar onAddToCart",o),e.handleAddToCart(Jn(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var Gn={"mk-fashion":ct,"mk-makeup":zt};function lt(t){return Gn[t]||ct}var A=null,T=null,ut=!1,dt=!1,q=null,We={},$t=null,st=0,v={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},Xn={gregory:"698c7e791d3129430f15dddd"};function Xe(t){return t?Xn[String(t).toLowerCase()]||t:null}async function F(t,e){let r=Xe(t),n=String(e||"").trim();return lt(h().product).available(r,n)}async function Ye(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await F(t,e)).available===!0}catch(r){return!1}}async function pt(t){if(t=t||{},ut)return;let e=Xe(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(We[n]!==!0){try{if(!(await F(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}We[n]=!0}let o=lt(h().product).modalSize||{width:430,height:800};q={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},dt=!1,tr(),Yn(q),ut=!0,st=Date.now(),u("modal_opened",{projectId:e,identifier:r})}function Ht(){if(!ut)return;let t=dt;if(dt=!1,Zn(),ut=!1,L("onClose"),u("modal_closed",{projectId:q&&q.projectId,identifier:q&&q.identifier}),t)try{Me()}catch(e){}}function Ze(t){try{let e=sr();if(!e)return;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 Yn(t){A=document.createElement("div"),A.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",Ze(!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;",T=document.createElement("iframe");let o=lt(h().product);T.src=o.iframeSrc(t.projectId,t.identifier),T.style.cssText="width:100%;height:100%;border:none;",T.setAttribute("allow","camera *; microphone *"),T.setAttribute("allowfullscreen","true"),e.appendChild(T),A.appendChild(e),document.body.appendChild(A);try{o.onMounted(T,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:er,track:u,fire:L})}catch(i){f("launcher.onMounted falhou",i&&i.message)}f("try-on modal aberto",T.src)}function Zn(){A&&A.parentNode&&A.parentNode.removeChild(A),A=null,T=null,Ze(!1)}var Ge=!1;function Qe(){tr()}function tr(){Ge||(Ge=!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":Ht();break;case"ready":L("onReady",n);break;case"product_loaded":L("onProductLoaded",n),u("product_loaded",Kt(n));break;case"interaction":{L("onInteraction",n),n&&n.method&&($t=n.method),u(Qn(n),Kt(n));break}case"add_to_cart":er(n,"tryon");break;case"generation_start":st=Date.now();break;case"generation_complete":L("onGenerationComplete",n),u("generation_complete",{method:n.method||$t||"unknown",durationMs:st?Date.now()-st:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":L("onError",n),u("generation_error",{method:$t||"unknown",error:n&&n.error});break}}))}function er(t,e){if(u("add_to_cart",Object.assign({via:e||"tryon"},Kt(t))),typeof v.onAddToCart=="function"){L("onAddToCart",t);return}Re(t).then(()=>Ot()).then(r=>{dt=!!r}).catch(()=>{})}function Qn(t){return t&&t.action,"interaction"}function Kt(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 L(t,e){if(typeof v[t]=="function")try{v[t](e)}catch(r){console.error("[mk-sdk]",r)}}function rr(t){v.onReady=t}function nr(t){v.onClose=t}function or(t){v.onAddToCart=t}function ir(t){v.onProductLoaded=t}function cr(t){v.onError=t}function ar(t){v.onInteraction=t}function lr(t){v.onGenerationComplete=t}var eo=767,ro=1024,no=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,oo=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function Vt(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 io(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&Vt(e)}catch(e){return!1}}function co(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function ao(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 Jt(t){if(!t||typeof t!="object")return null;if(t=ao(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])=>io(s.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||eo,i=Number(t.bpTablet)||ro,c=s=>(e.find(p=>p[0]===s)||[])[1],a=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let s of a){let p=c(s);if(p)return p}return e[0][1]}function ur(){let t=h(),e=Jt(t&&t.anchor);if(e&&e.selector)try{let n=document.querySelector(e.selector);if(n&&Vt(n))return{el:n,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(n){}let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=co(n);if(!(!o||o.length>40)&&!oo.test(o)&&no.test(o)&&Vt(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",Wt={none:"0",sm:"4px",md:"8px",pill:"9999px"},Gt={none:"0",sm:"4px",md:"8px",lg:"16px"},lo='<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>',so='<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 w(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 ft(t,e){let r=Number(e)>0?Number(e):24;return w("span",{style:`width:${r}px;height:${r}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:lo})}function dr(t){return w("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:so})}function mt(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function ht(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(w("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 uo(t){return t.subtext?w("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 pr(t,e){ht();let r=w("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[ft(t.textColor,t.iconSize),w("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return w("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:${mt(t)};border-radius:${t.borderRadiusPx};font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,uo(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 fo(t){return t.subtext?w("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),w("span",{text:t.subtext})]}):null}function mo(t,e){return w("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:${mt(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:[ft(t.textColor,t.iconSize),w("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;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){ht();let r=w("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&w("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&&w("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=w("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&w("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=w("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[fo(t),mo(t,e)]}),i=w("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return w("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:${_};`,children:[i]})}var yo={style:"gregory-black",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 Xt(t,e){let r=(e?t&&t.mobile:t&&t.desktop)||t&&t.desktop||t&&t.mobile||{},n={...yo,...r};return n.style==="gregory-card"&&e&&(n.style="gregory-black"),n.borderRadiusPx=Wt[n.borderRadius]!=null?Wt[n.borderRadius]:"0",n.cardBorderRadiusPx=Gt[n.cardBorderRadius]!=null?Gt[n.cardBorderRadius]:"0",n.fontSize=Number(n.fontSize)||14,n.iconSize=Number(n.iconSize)||24,n.borderWidth=Number(n.borderWidth)||0,n}var Yt={"gregory-black":pr,"gregory-card":fr},_i=Object.keys(Yt);function mr(t,e){return(Yt[t.style]||Yt["gregory-black"])(t,e)}function go(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var X=null;function sr(){return X}function wo(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 xo=/^(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)$/i;function bo(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>xo.test(e.split(":")[0].trim().toLowerCase())).join(";")}var yt=null,Zt=!1,Qt={},hr=!1,te=null;function yr(){return te||(te=O().then(t=>t&&t.template&&t.template.tryOnButton||null).catch(()=>null)),te}function _o(){if(hr)return;hr=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{yt&&z("pdp")},200)})}catch(e){}}function ee(){let t=X;if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}X=null,yt=null}var Co={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 vo(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 ko(t,e,r){let o=!Co[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(p){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+vo(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let p=t.getBoundingClientRect(),m=o.getBoundingClientRect(),g=e.offsetWidth,l=e.offsetHeight,y=p.top-m.top+o.scrollTop,x=p.left-m.left+o.scrollLeft,b=r||"top-left",d=y,k=x;b.indexOf("bottom")===0?d=y+p.height-l:(b.indexOf("middle")===0||b==="center")&&(d=y+(p.height-l)/2),b.indexOf("right")>=0?k=x+p.width-g:b.indexOf("center")>=0&&(k=x+(p.width-g)/2),e.style.top=d+"px",e.style.left=k+"px"}catch(p){}};i();let c=()=>i();window.addEventListener("resize",c);let a=setTimeout(i,600),s=setTimeout(i,1500);e.__mkCleanup=()=>{window.removeEventListener("resize",c),clearTimeout(a),clearTimeout(s)}}function So(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 z(t){let e=h();if(t!=="pdp"){ee();return}if(!e.projectId)return;if(!e._anchorFromPicker){let s=await yr();s&&s.anchor&&(e.anchor=s.anchor)}if(Zt)return;let r=D(),n=r&&r.value,o=!!e.forceButton,i=Jt(e.anchor),c=[n||"demo",i?[i.selector,i.position,i.mode,i.align,i.style].join("~"):"heuristic"].join("|"),a=X;if(!(a&&yt===c)){if(a&&ee(),!n&&!o){f("auto-mount: SKU n\xE3o resolvido na PDP");return}Zt=!0;try{let s=o;o||(Qt[n]||(Qt[n]=F(e.projectId,n).then(C=>!!(C&&C.available)).catch(()=>!1)),s=await Qt[n]);try{me(s?"available":"unavailable")}catch(C){}if(!s){f("auto-mount: produto sem try-on",n);return}let p=await yr(),m=window.matchMedia("(max-width: 767px)").matches,g=Xt(p,m),l=ur(),y=l&&l.mode||"flow",x=mr(g,()=>{let C=D(),R=C&&C.value||n||"";pe(),u("button_clicked",{sku:R,style:g.style,mode:y}),pt({projectId:e.projectId,identifier:R})}),b=document.createElement("div");b.id=go(),X=b,wo(b,{mode:"closed"}).appendChild(x),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(C=>{try{b.addEventListener(C,R=>{R.stopPropagation()},!1)}catch(R){}});let k=!1;if(l&&l.el&&l.el.parentNode&&(y==="overlay"?(ko(l.el,b,l.align),k=!0):(b.style.cssText="display:contents;",k=So(l.el,b,l.position))),k||(b.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(b)),l&&l.style){let C=bo(l.style);if(C)try{x.style.cssText+=";"+C}catch(R){}}yt=c,_o(),f("auto-mount: bot\xE3o injetado",{style:g.style,sku:n,anchorFound:!!l,position:l&&l.position,mode:y,forced:o}),u("button_rendered",{style:g.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!l,position:l?l.position:null,mode:y,forced:o})}finally{Zt=!1}}}function gr(){try{let t=h(),e={anchor:t.anchor,forceButton:t.forceButton};window.addEventListener("message",r=>{if(r.source!==window)return;let n=r.data;!n||!n.__mkCmd||(n.__mkCmd==="remount"||n.__mkCmd==="applyRecipe"?(t.anchor=n.anchor||null,t._anchorFromPicker=!0,t.forceButton=!0,z("pdp")):n.__mkCmd==="cancelPreview"&&(t.anchor=e.anchor,t._anchorFromPicker=!1,t.forceButton=e.forceButton,ee(),z("pdp")))})}catch(t){}}(function(){"use strict";try{let r=function(){try{ge(),gr(),Qe(),e.autoTrack!==!1&&(Ue((o,i)=>{Ve(o,i),z(o)}),Je()),f("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=wt();if(e.projectId){let o=_e(e.projectId);o&&vt(o),O().then(i=>{let c=xe(i);vt(c),Ce(e.projectId,c),f("escopo de coleta",c)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:pt,close:Ht,isAvailable:Ye,getAvailability:F,onReady:rr,onClose:nr,onAddToCart:or,onProductLoaded:ir,onError:cr,onInteraction:ar,onGenerationComplete:lr,testCart:je,_version:"0.1.0",_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 S=(t,e)=>{for(var r in e)wr(t,r,{get:e[r],enumerable:!0})};var gt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},xr={},K=null;function wt(){if(K)return K;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||xr.collectorUrl||gt.collectorUrl;return K={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||gt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||gt.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,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},K}function h(){return K||wt()}function f(...t){let e=h();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var re="_mk_vid",ne="_mk_sid",$=null,H=null;function Y(){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 oe(){if($)return $;try{let t=localStorage.getItem(re);return t||(t="v_"+Y(),localStorage.setItem(re,t)),$=t,t}catch(t){return $="v_"+Y(),$}}function ie(){if(H)return H;try{let t=sessionStorage.getItem(ne);return t||(t="s_"+Y(),sessionStorage.setItem(ne,t)),H=t,t}catch(t){return H="s_"+Y(),H}}var ce=[/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],ae={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},xt=2e3;function le(t){for(let e=0;e<ce.length;e++)if(ce[e].test(t))return!0;return!1}function se(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>xt?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||le(r))continue;let n=t[r];if(ae[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>xt){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=br(n);continue}e[r]=n}return e}function br(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||le(r))continue;let n=t[r];if(ae[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>xt){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var Z=[],bt=null,M=null,_r=["off","pdp_tryon","pdp","all","tryon_engaged"],V,_t=null,Q="unknown",B=[],j=null;function de(){let t=h();return"mk_engaged_"+(t&&t.projectId||"")}function Ct(){if(j!==null)return j;try{j=localStorage.getItem(de())==="1"}catch(t){j=!1}return j}function pe(){if(!Ct()){j=!0;try{localStorage.setItem(de(),"1")}catch(t){}tt(!1)}}var Cr=/^purchase$/;function fe(t,e){if(V===void 0)return"hold";if(V==="off")return"drop";if(V==="all"||e&&Cr.test(e))return"collect";switch(V){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(Ct())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":Q==="available"?"collect":Q==="unavailable"?"drop":"hold";default:return"collect"}}function tt(t){if(!B.length)return;let e=[];for(let r of B){let n=fe(r._pt,r.name);n==="collect"?ye(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}B=e}function vt(t){V=_r.indexOf(t)>=0?t:"all",tt(!1)}function me(t){Q=t==="available"?"available":"unavailable",tt(!1)}function he(t){tt(!0),M=t,_t=t&&t.pageType||null,Q="unknown"}function u(t,e,r){if(!h().projectId){(u._pre=u._pre||[]).push({name:t,params:e,ts:r||Date.now()}),u._pre.length>50&&u._pre.shift();return}if(u._pre&&u._pre.length){let o=u._pre;u._pre=[];for(let i of o)ue(i.name,i.params,i.ts)}ue(t,e,r)}function ue(t,e,r){let n=fe(_t,t);if(n==="collect"){ye(t,e,r);return}if(n==="drop"){f("descartado (escopo)",t);return}B.push({name:t,params:e,ts:r||Date.now(),_pt:_t}),B.length>300&&B.shift()}function ye(t,e,r){let n=h(),o=se(e||{}),i="page_"+vr(t);if(Z.push({name:i,ts:r||Date.now(),params:o}),f("queued",t,o),n.observe)try{window.postMessage({__mkpixel:!0,event:{name:i,params:o},site:M?{pageType:M.pageType,platform:M.platform,url:M.url}:null},"*")}catch(c){}if(Z.length>=n.batchMaxSize){I();return}bt||(bt=setTimeout(()=>{bt=null,I()},n.batchIntervalMs))}function vr(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 I(t){if(Z.length===0)return;let e=h();if(!e.projectId||!e.collectorUrl)return;let r=Z.splice(0,50),n=JSON.stringify({product:e.product||void 0,visitorId:oe(),sessionId:ie(),engaged:Ct()||void 0,events:r,site:M||void 0}),o=e.collectorUrl+"/v1/track";try{fetch(o,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:n}).catch(()=>{})}catch(i){try{navigator.sendBeacon&&navigator.sendBeacon(o+"?projectId="+encodeURIComponent(e.projectId),new Blob([n],{type:"text/plain"}))}catch(c){}}}function ge(){try{window.addEventListener("pagehide",()=>I(!0)),window.addEventListener("beforeunload",()=>I(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&I(!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(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 we=["off","pdp_tryon","pdp","all","tryon_engaged"],kr="all",Sr=30*60*1e3,N=null;function O(){if(N)return N;let t=h();return!t.projectId||!t.apiUrl?(N=Promise.resolve(null),N):(N=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>e.ok?e.json():null).then(e=>e&&e.project||e||null).catch(()=>null),N)}function xe(t){let e=t&&t.analytic&&t.analytic.scope;return we.indexOf(e)>=0?e:kr}var be=t=>"mk_scope_"+t;function _e(t){try{let e=localStorage.getItem(be(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:we.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function Ce(t,e){try{localStorage.setItem(be(t),JSON.stringify({scope:e,exp:Date.now()+Sr}))}catch(r){}}var kt={};S(kt,{addToCart:()=>Lr,detect:()=>Ar,getCartSummary:()=>Pr,id:()=>Tr,openCartDrawer:()=>Mr,resolveSku:()=>Er});var Tr="shopify";function Ar(){return!!(window.Shopify||window.ShopifyAnalytics)}function Er(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var et=t=>String(t==null?"":t).trim().toLowerCase();async function Lr({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(d=>d.json())).variants||[],a=d=>[d.option1,d.option2,d.option3].concat(String(d.title||"").split("/")).map(et).filter(Boolean),s=(d,k)=>a(d).indexOf(et(k))>=0,p=d=>(!t||s(d,t))&&(!e||s(d,e)),m=null;if((t||e)&&(m=c.find(d=>p(d)&&d.available)||c.find(p)),!m&&r&&(m=c.find(d=>et(d.sku)===et(r))),m||(m=c.find(d=>d.available)||c[0]),!m)throw new Error("shopify: variante n\xE3o encontrada");let g=ve(),l=null;if(g&&typeof g.getSectionsToRender=="function")try{l=g.getSectionsToRender().map(d=>({id:d.id,selector:d.selector||"#"+d.id})).filter(d=>d.id)}catch(d){}let y={items:[{id:m.id,quantity:n||1}]};l&&l.length&&(y.sections=l.map(d=>d.id).join(","),y.sections_url=location.pathname);let x=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(!x.ok)throw new Error("shopify: /cart/add.js HTTP "+x.status);let b=await x.json().catch(()=>({}));return g&&l&&b.sections&&Ir(g,l,b.sections),{platform:"shopify",variantId:m.id,size:m.title,sku:m.sku||null}}function ve(){return document.querySelector("cart-drawer, cart-notification")}function Ir(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 Pr(){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 Rr=["[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"];function jr(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function Mr(){let t=ve();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of Rr)try{if(e=[...document.querySelectorAll(r)].find(jr),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var Tt={};S(Tt,{addToCart:()=>Dr,detect:()=>Nr,getCartSummary:()=>Ur,id:()=>Br,resolveSku:()=>Or});var Br="hybris";function Nr(){return!!(window.ACC&&window.ACC.config)}function Or(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var ke=t=>String(t==null?"":t).trim().toLowerCase();async function Dr({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=>ke(y.textContent)===ke(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 p=new URLSearchParams;p.set("productCodePost",o),p.set("qty",String(e||1)),p.set("CSRFToken",a);let m=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:p.toString()});if(!m.ok)throw new Error("hybris: "+s+" HTTP "+m.status);let g=null,l=null;try{let y=await m.clone().json(),x=y&&y.cartData;x&&(g=St(x.total!=null?x.total:x.totalPrice),l=x.totalUnitCount!=null?Number(x.totalUnitCount):Array.isArray(x.products)?x.products.length:null)}catch(y){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:g,itemCount:l,currency:"BRL"}}function St(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 Ur(){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?St(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&&St(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var At={};S(At,{addToCart:()=>Kr,detect:()=>Fr,getCartSummary:()=>$r,id:()=>qr,resolveSku:()=>zr});var qr="vtex";function Fr(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0)}function zr(){let t=window;return t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0]?{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"}:t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0]?{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"}:null}var rt=t=>String(t==null?"":t).trim().toLowerCase();async function Kr({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=>rt(i.skuname)===rt(t)||i.dimensions&&Object.values(i.dimensions).some(c=>rt(c)===rt(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 $r(){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 Et={};S(Et,{addToCart:()=>Gr,detect:()=>Jr,getCartSummary:()=>Xr,id:()=>Hr,resolveSku:()=>Wr,skipRedirect:()=>Vr});var Hr="nuvemshop",Vr=!0;function Jr(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function Wr(){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 nt=t=>String(t==null?"":t).trim().toLowerCase();async function Gr({size:t,quantity:e}){let r=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!r)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&r.querySelectorAll('select[name^="variation"]').forEach(i=>{let c=[...i.options].find(a=>nt(a.textContent).includes(nt(t))||nt(a.value)===nt(t));c&&(i.value=c.value,i.dispatchEvent(new Event("change",{bubbles:!0})))});let n=r.querySelector('[name="quantity"]');return n&&e&&(n.value=String(e)),await new Promise(i=>setTimeout(i,400)),typeof r.requestSubmit=="function"?r.requestSubmit():r.submit(),{platform:"nuvemshop",variantId:(r.querySelector('[name="variant_id"]')||{}).value||null}}function Xr(){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 Lt={};S(Lt,{addToCart:()=>en,detect:()=>Qr,getCartSummary:()=>rn,id:()=>Yr,openCartDrawer:()=>on,resolveSku:()=>tn,skipRedirect:()=>Zr});var Yr="wake",Zr=!0;function Qr(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function tn(){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 Se=t=>String(t==null?"":t).trim().toLowerCase();async function en({size:t,quantity:e}){if(t){let i=[...document.querySelectorAll("input[attribute-value]")].find(c=>Se(c.getAttribute("attribute-value"))===Se(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 Te(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 rn(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?Te(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=nn());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 nn(){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=Te(r);if(n)return n}}}catch(t){}return null}function on(){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 Rt={};S(Rt,{addToCart:()=>un,cartUrl:()=>ln,detect:()=>sn,getCartSummary:()=>dn,id:()=>cn,openCartDrawer:()=>pn,skipRedirect:()=>an});var It="/api/v2/front",Pt={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ae=t=>String(t==null?"":t).trim().toLowerCase(),cn="wapstore",an=!0,ln="/checkout/carrinho";function sn(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Ee(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 un({size:t,quantity:e}){let r=await fetch(It+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:Pt}).then(l=>l.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(l=>Ae(l.label)===Ae(t)):null;i=i||o.find(l=>l.selecionado)||o.find(l=>(l.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(l=>Object.assign({},l,{quantidade:String(e||l.quantidade||1)})),s=await fetch(It+"/checkout/cart",{method:"POST",headers:Pt,body:JSON.stringify({itens:a,tipo:c.tipo||"produto"})});if(!s.ok)throw new Error("wapstore: add HTTP "+s.status);let p=await s.json().catch(()=>({})),m=Ee(p),g={platform:"wapstore",idProduto:a[0]&&a[0].idProduto,size:i&&i.label||null};return m&&(g.cartValue=m.value,g.itemCount=m.itemCount,g.currency=m.currency),g}async function dn(){try{let t=await fetch(It+"/checkout/cart",{headers:Pt}).then(e=>e.json());return Ee(t)}catch(t){}return null}function pn(){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 Mt={};S(Mt,{addToCart:()=>J,detect:()=>mn,id:()=>fn,resolveSku:()=>jt});var fn="generic";function mn(){return!0}function jt(){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 hn=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,yn=/continuar|como comprar|lista|desejos|favorito/i;async function J(){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&&hn.test(r)&&!yn.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 Ie=[kt,Tt,At,Et,Lt,Rt],gn=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],ot;function D(){return ot||(ot=Ie.find(t=>{try{return t.detect()}catch(e){return!1}})||Mt,ot)}function Pe(){let t=Ie.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of gn)try{if(r())return e}catch(n){}return null}function U(){let t=D();if(t.id!=="generic"&&t.resolveSku)try{let e=t.resolveSku();if(e)return e}catch(e){}return jt()}async function Re(t){t=t||{};let e={size:t.size||t.selectedSize||t.tamanho||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1},r=D();try{let n=r.addToCart?await r.addToCart(e):await J(e);return f("cart: adicionado",n),Bt(),Le(r,n,e.sku),n}catch(n){f('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await J(e);return Bt(),Le(r,o,e.sku),o}}async function Le(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)&&u("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 Nt(){let t=D();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function je(t){t=t||{};let e=D(),r={platform:e.id};try{let n=U();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 J(o),Bt();try{await Ot()}catch(i){}r.cart=await Nt(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function Bt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Ot(){let t=D(),e=h(),r=null;try{r=await O()}catch(i){}let n=r&&r.template&&r.template.cart||r&&r.cart||{},o=n.afterAdd||n.behavior||e.cartBehavior;if(o||(o=e.cartRedirect===!1?"none":"auto"),o==="none")return!1;if(o==="auto"||o==="drawer"){let i=n.openSelector||e.cartOpenSelector;if(i){let c=document.querySelector(i);if(c)return setTimeout(()=>{try{c.click()}catch(a){}},300),!1}else if(t&&t.openCartDrawer){let c=!1;try{c=t.openCartDrawer()}catch(a){}if(c)return!1}}return!0}function Me(){let t=D();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var wn=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced)/i,xn=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,bn=/\/checkout/i,_n=/\/(cart|carrinho|sacola|bag)(\/|$|\?|#)/i,Cn=/\/(products?|produtos?|p)\//i,vn=/\/(collections?|categoria|categorias|c|departamento)\//i,kn=/\/(search|busca|s)(\/|\?)/i;function Be(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=xn.test(t);try{let r=E();for(let n of r){let o=Array.isArray(n["@type"])?n["@type"]:[n["@type"]];if((o.includes("Order")||o.includes("Invoice"))&&!e)return"purchase";if(o.includes("Product"))return"pdp";if(o.includes("SearchResultsPage"))return"search";if(o.includes("CollectionPage")||o.includes("ItemList"))return"category"}}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":wn.test(t)&&!e?"purchase":bn.test(t)?"checkout":_n.test(t)?"cart":Cn.test(t)?"pdp":vn.test(t)?"category":kn.test(t)?"search":"other"}function Ne(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:Sn()}}function Sn(){return Pe()}var Dt={},Tn=null,W=0,Oe=!1;function De(t){Oe||(Oe=!0,Ue(t),An(),En(),Ln(),In(),Pn(t))}function Ue(t){Dt={};let e=Be(),r=Ne(e);if(he(r),u("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 An(){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)),u("click",i)}catch(n){}},{capture:!0,passive:!0})}function En(){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&&!Dt[c]&&(Dt[c]=!0,u("scroll_depth",{depth:c}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function Ln(){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"),u("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function In(){let t=h();W=Date.now(),Tn=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-W)/1e3);W=e,r>0&&r<60&&u("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-W)/1e3);e>0&&e<600&&u("engagement",{url:location.pathname,dwellSec:e})}W=Date.now()})}function Pn(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,Ue(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)}catch(n){}}function qt(){let t=U(),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||qe(),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)||qe(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function qe(){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=Ut(c!=null?String(c):"");if(a)return a}}catch(t){}return null}function P(){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 Ft(){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||P(),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||P(),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{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)){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||P(),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:P(),revenue:parseFloat(e.content)||null,source:"meta"};let r=Rn();if(r)return r;let n=P();return n?{orderId:n,revenue:null,source:"url"}:null}function Rn(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=Ut(n.length>1?n[n.length-1]:r);if(o)return{orderId:Fe(),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=Ut(n.value||n.textContent);if(o)return{orderId:Fe(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function Fe(){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 Ut(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 ze(){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 Ke=!1,it=[/\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],jn=[/^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 G(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function Ve(t){switch(t){case"pdp":{let e=qt();u("view_item",e||{sku:null});break}case"category":case"search":{let e=ze();u("view_item_list",e||{count:0});break}case"cart":Nt().then(e=>u("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>u("view_cart",{}));break;case"checkout":u("begin_checkout",{});break;case"purchase":Mn();break}}var $e=500,He=16;function Mn(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,Bn(o,i))};try{window.addEventListener("pagehide",()=>r(Ft(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=Ft();if(o&&o.revenue!=null)return r(o);if(e++>=He)return f("purchase: receita n\xE3o apareceu em "+$e*He+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,$e)};n()}function Bn(t,e){if(t&&!t.orderId&&(t.orderId=P()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){f("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}else if(Ke)return;if(Ke=!0,u("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),f("purchase emitido",t),e)try{I(!0)}catch(r){}}function Je(){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((G([it[0]],i)||o&&G([it[1]],i)||o&&G([it[2]],i)||G(it.slice(3),i))&&(c=!0),c){t=r;let a=qt();u("add_to_cart",{via:"click",buttonText:i,sku:a?a.sku:null,price:a?a.price:null});return}o&&G(jn,i)&&(t=r,u("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var ct={};S(ct,{available:()=>Un,id:()=>Nn,iframeSrc:()=>Dn,modalSize:()=>On,onMounted:()=>qn});var Nn="mk-fashion",On={width:430,height:800};function Dn(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return h().appUrl+"/"+t+"/"+r}async function Un(t,e){let r=h().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function qn(){}var zt={};S(zt,{available:()=>Hn,id:()=>Fn,iframeSrc:()=>$n,modalSize:()=>zn,onMounted:()=>Xn});var Fn="mk-makeup",zn={width:1160,height:700};function Kn(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function $n(t){return Kn()+"/"+encodeURIComponent(t)}function Hn(){return Promise.resolve({available:!0})}var Vn="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",at=null;function Jn(){return window.pulpoar?Promise.resolve(window.pulpoar):at||(at=new Promise(t=>{try{let e=document.createElement("script");e.src=Vn,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),at)}async function Wn(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 Gn(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 Xn(t,e){Jn().then(async r=>{if(!r){f("pulpoar: SDK n\xE3o carregou");return}let n=await Wn(e.identifier);if(f("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){f("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{f("pulpoar onAddToCart",o),e.handleAddToCart(Gn(o),"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var Yn={"mk-fashion":ct,"mk-makeup":zt};function lt(t){return Yn[t]||ct}var A=null,T=null,ut=!1,dt=!1,q=null,We={},Kt=null,st=0,v={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},Zn={gregory:"698c7e791d3129430f15dddd"};function Xe(t){return t?Zn[String(t).toLowerCase()]||t:null}async function F(t,e){let r=Xe(t),n=String(e||"").trim();return lt(h().product).available(r,n)}async function Ye(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await F(t,e)).available===!0}catch(r){return!1}}async function pt(t){if(t=t||{},ut)return;let e=Xe(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(We[n]!==!0){try{if(!(await F(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(i){alert("Produto nao encontrado ou indisponivel.");return}We[n]=!0}let o=lt(h().product).modalSize||{width:430,height:800};q={projectId:e,identifier:r,width:t.width||o.width,height:t.height||o.height},dt=!1,tr(),Qn(q),ut=!0,st=Date.now(),u("modal_opened",{projectId:e,identifier:r})}function Ht(){if(!ut)return;let t=dt;if(dt=!1,to(),ut=!1,L("onClose"),u("modal_closed",{projectId:q&&q.projectId,identifier:q&&q.identifier}),t)try{Me()}catch(e){}}function Ze(t){try{let e=sr();if(!e)return;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 Qn(t){A=document.createElement("div"),A.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",Ze(!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;",T=document.createElement("iframe");let o=lt(h().product);T.src=o.iframeSrc(t.projectId,t.identifier),T.style.cssText="width:100%;height:100%;border:none;",T.setAttribute("allow","camera *; microphone *"),T.setAttribute("allowfullscreen","true"),e.appendChild(T),A.appendChild(e),document.body.appendChild(A);try{o.onMounted(T,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:er,track:u,fire:L})}catch(i){f("launcher.onMounted falhou",i&&i.message)}f("try-on modal aberto",T.src)}function to(){A&&A.parentNode&&A.parentNode.removeChild(A),A=null,T=null,Ze(!1)}var Ge=!1;function Qe(){tr()}function tr(){Ge||(Ge=!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":Ht();break;case"ready":L("onReady",n);break;case"product_loaded":L("onProductLoaded",n),u("product_loaded",$t(n));break;case"interaction":{L("onInteraction",n),n&&n.method&&(Kt=n.method),u(eo(n),$t(n));break}case"add_to_cart":er(n,"tryon");break;case"generation_start":st=Date.now();break;case"generation_complete":L("onGenerationComplete",n),u("generation_complete",{method:n.method||Kt||"unknown",durationMs:st?Date.now()-st:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":L("onError",n),u("generation_error",{method:Kt||"unknown",error:n&&n.error});break}}))}function er(t,e){if(u("add_to_cart",Object.assign({via:e||"tryon"},$t(t))),typeof v.onAddToCart=="function"){L("onAddToCart",t);return}Re(t).then(()=>Ot()).then(r=>{dt=!!r}).catch(()=>{})}function eo(t){return t&&t.action,"interaction"}function $t(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 L(t,e){if(typeof v[t]=="function")try{v[t](e)}catch(r){console.error("[mk-sdk]",r)}}function rr(t){v.onReady=t}function nr(t){v.onClose=t}function or(t){v.onAddToCart=t}function ir(t){v.onProductLoaded=t}function cr(t){v.onError=t}function ar(t){v.onInteraction=t}function lr(t){v.onGenerationComplete=t}var no=767,oo=1024,io=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,co=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function Vt(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 ao(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&Vt(e)}catch(e){return!1}}function lo(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function so(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 Jt(t){if(!t||typeof t!="object")return null;if(t=so(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])=>ao(s.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||no,i=Number(t.bpTablet)||oo,c=s=>(e.find(p=>p[0]===s)||[])[1],a=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let s of a){let p=c(s);if(p)return p}return e[0][1]}function ur(){let t=h(),e=Jt(t&&t.anchor);if(e&&e.selector)try{let n=document.querySelector(e.selector);if(n&&Vt(n))return{el:n,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(n){}let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=lo(n);if(!(!o||o.length>40)&&!co.test(o)&&io.test(o)&&Vt(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",Wt={none:"0",sm:"4px",md:"8px",pill:"9999px"},Gt={none:"0",sm:"4px",md:"8px",lg:"16px"},uo='<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>',po='<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 w(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 ft(t,e){let r=Number(e)>0?Number(e):24;return w("span",{style:`width:${r}px;height:${r}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:uo})}function dr(t){return w("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:po})}function mt(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function ht(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(w("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 fo(t){return t.subtext?w("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 pr(t,e){ht();let r=w("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[ft(t.textColor,t.iconSize),w("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return w("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:${mt(t)};border-radius:${t.borderRadiusPx};font-family:${_};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,fo(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 ho(t){return t.subtext?w("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),w("span",{text:t.subtext})]}):null}function yo(t,e){return w("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:${mt(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:[ft(t.textColor,t.iconSize),w("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;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){ht();let r=w("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&w("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&&w("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=w("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&w("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=w("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[ho(t),yo(t,e)]}),i=w("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return w("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:${_};`,children:[i]})}var wo={style:"gregory-black",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 Xt(t,e){let r=(e?t&&t.mobile:t&&t.desktop)||t&&t.desktop||t&&t.mobile||{},n={...wo,...r};return n.style==="gregory-card"&&e&&(n.style="gregory-black"),n.borderRadiusPx=Wt[n.borderRadius]!=null?Wt[n.borderRadius]:"0",n.cardBorderRadiusPx=Gt[n.cardBorderRadius]!=null?Gt[n.cardBorderRadius]:"0",n.fontSize=Number(n.fontSize)||14,n.iconSize=Number(n.iconSize)||24,n.borderWidth=Number(n.borderWidth)||0,n}var Yt={"gregory-black":pr,"gregory-card":fr},vi=Object.keys(Yt);function mr(t,e){return(Yt[t.style]||Yt["gregory-black"])(t,e)}function xo(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var X=null;function sr(){return X}function bo(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 _o=/^(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)$/i;function Co(t){return!t||typeof t!="string"?"":t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>_o.test(e.split(":")[0].trim().toLowerCase())).join(";")}var yt=null,Zt=!1,Qt={},hr=!1,te=null;function yr(){return te||(te=O().then(t=>t&&t.template&&t.template.tryOnButton||null).catch(()=>null)),te}function vo(){if(hr)return;hr=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{yt&&z("pdp")},200)})}catch(e){}}function ee(){let t=X;if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}X=null,yt=null}var ko={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 So(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 To(t,e,r){let o=!ko[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(p){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+So(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let p=t.getBoundingClientRect(),m=o.getBoundingClientRect(),g=e.offsetWidth,l=e.offsetHeight,y=p.top-m.top+o.scrollTop,x=p.left-m.left+o.scrollLeft,b=r||"top-left",d=y,k=x;b.indexOf("bottom")===0?d=y+p.height-l:(b.indexOf("middle")===0||b==="center")&&(d=y+(p.height-l)/2),b.indexOf("right")>=0?k=x+p.width-g:b.indexOf("center")>=0&&(k=x+(p.width-g)/2),e.style.top=d+"px",e.style.left=k+"px"}catch(p){}};i();let c=()=>i();window.addEventListener("resize",c);let a=setTimeout(i,600),s=setTimeout(i,1500);e.__mkCleanup=()=>{window.removeEventListener("resize",c),clearTimeout(a),clearTimeout(s)}}function Ao(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 z(t){let e=h();if(t!=="pdp"){ee();return}if(!e.projectId)return;if(!e._anchorFromPicker){let s=await yr();s&&s.anchor&&(e.anchor=s.anchor)}if(Zt)return;let r=U(),n=r&&r.value,o=!!e.forceButton,i=Jt(e.anchor),c=[n||"demo",i?[i.selector,i.position,i.mode,i.align,i.style].join("~"):"heuristic"].join("|"),a=X;if(!(a&&yt===c)){if(a&&ee(),!n&&!o){f("auto-mount: SKU n\xE3o resolvido na PDP");return}Zt=!0;try{let s=o;o||(Qt[n]||(Qt[n]=F(e.projectId,n).then(C=>!!(C&&C.available)).catch(()=>!1)),s=await Qt[n]);try{me(s?"available":"unavailable")}catch(C){}if(!s){f("auto-mount: produto sem try-on",n);return}let p=await yr(),m=window.matchMedia("(max-width: 767px)").matches,g=Xt(p,m),l=ur(),y=l&&l.mode||"flow",x=mr(g,()=>{let C=U(),R=C&&C.value||n||"";pe(),u("button_clicked",{sku:R,style:g.style,mode:y}),pt({projectId:e.projectId,identifier:R})}),b=document.createElement("div");b.id=xo(),X=b,bo(b,{mode:"closed"}).appendChild(x),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(C=>{try{b.addEventListener(C,R=>{R.stopPropagation()},!1)}catch(R){}});let k=!1;if(l&&l.el&&l.el.parentNode&&(y==="overlay"?(To(l.el,b,l.align),k=!0):(b.style.cssText="display:contents;",k=Ao(l.el,b,l.position))),k||(b.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(b)),l&&l.style){let C=Co(l.style);if(C)try{x.style.cssText+=";"+C}catch(R){}}yt=c,vo(),f("auto-mount: bot\xE3o injetado",{style:g.style,sku:n,anchorFound:!!l,position:l&&l.position,mode:y,forced:o}),u("button_rendered",{style:g.style,sku:n||null,skuSource:r&&r.source,anchorFound:!!l,position:l?l.position:null,mode:y,forced:o})}finally{Zt=!1}}}function gr(){try{let t=h(),e={anchor:t.anchor,forceButton:t.forceButton};window.addEventListener("message",r=>{if(r.source!==window)return;let n=r.data;!n||!n.__mkCmd||(n.__mkCmd==="remount"||n.__mkCmd==="applyRecipe"?(t.anchor=n.anchor||null,t._anchorFromPicker=!0,t.forceButton=!0,z("pdp")):n.__mkCmd==="cancelPreview"&&(t.anchor=e.anchor,t._anchorFromPicker=!1,t.forceButton=e.forceButton,ee(),z("pdp")))})}catch(t){}}(function(){"use strict";try{let r=function(){try{ge(),gr(),Qe(),e.autoTrack!==!1&&(De((o,i)=>{Ve(o,i),z(o)}),Je()),f("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=wt();if(e.projectId){let o=_e(e.projectId);o&&vt(o),O().then(i=>{let c=xe(i);vt(c),Ce(e.projectId,c),f("escopo de coleta",c)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:pt,close:Ht,isAvailable:Ye,getAvailability:F,onReady:rr,onClose:nr,onAddToCart:or,onProductLoaded:ir,onError:cr,onInteraction:ar,onGenerationComplete:lr,testCart:je,_version:"0.1.0",_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(o));return t&&d.test(t.v)&&t.exp>Date.now()?t.v:null}catch(u){return null}};var m=a;if(window.__mkBooted)return;window.__mkBooted=!0;var o="mk_sdk_v",i=10*60*1e3,d=/^\d+\.\d+\.\d+$/,e=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),s=a()||"1.1.34",n=document.createElement("script");if(n.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+s+"/dist/mk-core.js",n.async=!0,e&&e.attributes)for(var r=0;r<e.attributes.length;r++){var c=e.attributes[r];c.name.indexOf("data-")===0&&n.setAttribute(c.name,c.value)}(document.head||document.documentElement).appendChild(n),fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var u=t&&t.version;d.test(u)&&localStorage.setItem(o,JSON.stringify({v:u,exp:Date.now()+i}))}).catch(function(){})}catch(a){}})();})();
1
+ (()=>{(function(){try{let a=function(){try{var t=JSON.parse(localStorage.getItem(o));return t&&d.test(t.v)&&t.exp>Date.now()?t.v:null}catch(u){return null}};var m=a;if(window.__mkBooted)return;window.__mkBooted=!0;var o="mk_sdk_v",i=10*60*1e3,d=/^\d+\.\d+\.\d+$/,e=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),s=a()||"1.1.36",n=document.createElement("script");if(n.src="https://cdn.jsdelivr.net/npm/mk-sdk-git@"+s+"/dist/mk-core.js",n.async=!0,e&&e.attributes)for(var r=0;r<e.attributes.length;r++){var c=e.attributes[r];c.name.indexOf("data-")===0&&n.setAttribute(c.name,c.value)}(document.head||document.documentElement).appendChild(n),fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var u=t&&t.version;d.test(u)&&localStorage.setItem(o,JSON.stringify({v:u,exp:Date.now()+i}))}).catch(function(){})}catch(a){}})();})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mk-sdk-git",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "description": "SDK de tracking de e-commerce + try-on da MetaKosmos (core tracker, roda em todas as páginas)",
5
5
  "main": "dist/mk-sdk.js",
6
6
  "files": [
@@ -85,16 +85,16 @@ export async function getCartSummary() {
85
85
  } catch (_) { return null; }
86
86
  }
87
87
 
88
- // Seletores comuns de gatilho da sacola lateral em temas Shopify (mais específico
89
- // → mais genérico). O último (`a[href="/cart"]`) degrada graciosamente: em tema
90
- // com drawer abre a sacola, sem drawer só navega pro /cart (= o redirect de antes).
88
+ // Gatilhos de sacola lateral IN-PLACE (abrem o drawer sem navegar). NÃO incluir
89
+ // `a[href="/cart"]`: em temas SEM drawer (ex.: zerezes, custom) ele navega — e
90
+ // clicar durante o provador mataria o modal/NPS. Sem gatilho openCartDrawer
91
+ // devolve false e o chamador redireciona pro /cart no FECHAMENTO do provador.
91
92
  const CART_TOGGLES = [
92
93
  '[data-cart-drawer-toggle]', '[data-action="open-cart-drawer"]', '[data-action="open-cart"]',
93
94
  '.js-cart-drawer-open', '.js-drawer-open-cart', '.cart-drawer-toggle', '.js-cart-toggle',
94
95
  '[aria-controls="CartDrawer"]', '[aria-controls="cart-drawer"]',
95
96
  '#cart-icon-bubble', '#lk-cart-icon',
96
- '.header__cart', '.site-header__cart', '.cart-link', '.header-cart',
97
- 'a[href="/cart"]', 'a[href$="/cart"]'
97
+ '.header__cart', '.site-header__cart', '.cart-link', '.header-cart'
98
98
  ];
99
99
  function isVis(el) {
100
100
  try { const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0 && getComputedStyle(el).visibility !== 'hidden'; }
@@ -77,17 +77,43 @@ export async function getCartSummary() {
77
77
  await new Promise((r) => setTimeout(r, 700));
78
78
  value = read();
79
79
  }
80
+ // tema sem .mc-subtotal (ex.: Gregory): acha o "Total R$ X" certo
81
+ if (value == null) value = readTotalLeaf();
80
82
  const qtyEl = document.querySelector('.mc-products__count, [class*="mc-"][class*="count" i], [class*="minicart" i] [class*="count" i]');
81
83
  const itemCount = qtyEl ? (parseInt(String(qtyEl.textContent || '').replace(/\D/g, ''), 10) || null) : null;
82
84
  if (value != null) return { value, itemCount, currency: 'BRL' };
83
85
  } catch (_) {}
84
- // fallback best-effort: qualquer elemento de "total" com R$
86
+ return null;
87
+ }
88
+
89
+ // Procura "Total R$ X" num elemento ENXUTO do mini-cart, ignorando ruído como
90
+ // "Faltam R$ X p/ frete grátis" / descontos. Validado na Gregory (R$ 498,00).
91
+ function readTotalLeaf() {
85
92
  try {
86
- const els = document.querySelectorAll('[class*="total" i],[class*="minicart" i],[class*="cart" i]');
87
- for (const el of els) {
88
- const t = el.textContent || '';
89
- if (/total|subtotal/i.test(t)) { const v = parseMoney(t.match(/R\$[\s\d.,]+/)); if (v) return { value: v, itemCount: null, currency: 'BRL' }; }
93
+ const scope = document.querySelector('[class*="mini-cart" i], .mini-cart') || document;
94
+ for (const el of scope.querySelectorAll('div,span,p,li,strong,b')) {
95
+ if (el.children.length > 2) continue;
96
+ const t = (el.textContent || '').replace(/\s+/g, ' ').trim();
97
+ if (!/R\$/.test(t) || /frete|faltam|gr[aá]tis|desconto|economi/i.test(t)) continue;
98
+ if (/^(sub)?total\b/i.test(t)) { const v = parseMoney(t); if (v) return v; }
90
99
  }
91
100
  } catch (_) {}
92
101
  return null;
93
102
  }
103
+
104
+ // Abre o mini-cart lateral após o add. setCartDivVisibility() é TOGGLE (sem
105
+ // argumento) — então só dispara se estiver FECHADO (painel .mini-cart com largura
106
+ // 0), senão fecharia. loadMiniCart() atualiza o conteúdo antes (reflete o item
107
+ // adicionado via addOrCreateCheckout). Validado ao vivo na Gregory (340px, c/ item).
108
+ export function openCartDrawer() {
109
+ if (typeof window.setCartDivVisibility !== 'function') return false;
110
+ try { if (typeof window.loadMiniCart === 'function') window.loadMiniCart(); } catch (_) {}
111
+ setTimeout(() => {
112
+ try {
113
+ const mc = document.querySelector('[class*="mini-cart" i], .mini-cart');
114
+ if (mc && mc.getBoundingClientRect().width > 0) return; // já aberto → não togglar
115
+ window.setCartDivVisibility();
116
+ } catch (_) {}
117
+ }, 350);
118
+ return true;
119
+ }