mk-sdk-git 1.1.120 → 1.1.121

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 Rn=Object.defineProperty;var C=(t,e)=>{for(var r in e)Rn(t,r,{get:e[r],enumerable:!0})};var Yt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Pn={},nt=null;function Zt(){if(nt)return nt;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(a){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Pn.collectorUrl||Yt.collectorUrl;return nt={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||Yt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||Yt.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,modalWidth:window.__MK&&window.__MK.modalWidth||null,modalHeight:window.__MK&&window.__MK.modalHeight||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},nt}function w(){return nt||Zt()}function g(...t){let e=w();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var Je="_mk_vid",Xe="_mk_sid",ot=null,it=null;function xt(){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 vt(){if(ot)return ot;try{let t=localStorage.getItem(Je);return t||(t="v_"+xt(),localStorage.setItem(Je,t)),ot=t,t}catch(t){return ot="v_"+xt(),ot}}function Ye(){if(it)return it;try{let t=sessionStorage.getItem(Xe);return t||(t="s_"+xt(),sessionStorage.setItem(Xe,t)),it=t,t}catch(t){return it="s_"+xt(),it}}var H=[],Ze=!1;function Qt(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return(e>>>0)/4294967296}function Mn(){let t=typeof navigator!="undefined"&&navigator.userAgent||"";return/iPad|Tablet|PlayBook|Silk/i.test(t)||/Android/i.test(t)&&!/Mobile/i.test(t)?"tablet":/Mobi|Android|iPhone|iPod|Windows Phone|BlackBerry/i.test(t)?"mobile":"desktop"}function On(){try{return localStorage.getItem("_mk_seen")?!0:(localStorage.setItem("_mk_seen",String(Date.now())),!1)}catch(t){return!1}}function jn(t,e){let r=t.product||"mk-fashion";return r==="ambos"||r===(e||"mk-fashion")}function Bn(t,e){let r=t.targeting||{};return!(Array.isArray(r.device)&&r.device.length&&r.device.indexOf(e.device)<0||r.audience==="new"&&e.returning||r.audience==="returning"&&!e.returning)}function zn(t,e){let r=t.traffic==null?100:Number(t.traffic);return r>=100?!0:r<=0?!1:Qt(e+"|"+t.id+"|t")*100<r}function qn(t,e){let r=(t.variants||[]).filter(a=>a&&a.key),n=r.reduce((a,c)=>a+(Number(c.weight)||0),0);if(n<=0)return null;let o=Qt(e+"|"+t.id)*n,i=0;for(let a=0;a<r.length;a++)if(i+=Number(r[a].weight)||0,o<i)return r[a];return r[r.length-1]}function Nn(t,e,r){let n="mk_exp_"+e+"_"+t.id,o=c=>(t.variants||[]).filter(l=>l&&l.key===c)[0]||null,i=null;try{i=localStorage.getItem(n)}catch(c){}if(i&&o(i))return o(i);let a=qn(t,r);if(a)try{localStorage.setItem(n,a.key)}catch(c){}return a}function bt(t,e,r){if(Ze)return;Ze=!0;let n=t&&Array.isArray(t.experiments)?t.experiments:[];if(!n.length)return;let o=vt(),i={device:Mn(),returning:On()},a=n.filter(d=>d&&d.status==="running"&&jn(d,r)&&Bn(d,i)&&zn(d,o));if(!a.length){g("[A/B] "+n.length+" experimento(s) configurado(s); nenhum eleg\xEDvel p/ este visitante (status/targeting/tr\xE1fego/produto)");return}let c=a.filter(d=>d.coexist==="exclusive"),l;if(c.length){let d=Math.min(c.length-1,Math.floor(Qt(o+"|excl")*c.length));l=[c[d]]}else l=a;for(let d=0;d<l.length;d++){let s=l[d],f=Nn(s,e||"",o);f&&H.push({exp:s.id,var:f.key,control:!!f.control,overrides:f.overrides||{}})}H.length&&g("[A/B] variante(s) ativa(s):",te())}function Qe(){return H.map(t=>({exp:t.exp,var:t.var}))}function te(){return H.map(t=>({exp:t.exp,variant:t.var,control:t.control,holdout:!!(t.overrides&&t.overrides.holdout)}))}function tr(){try{let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r&&(r.indexOf("mk_exp_")===0||r==="_mk_vid"||r==="_mk_seen")&&t.push(r)}t.forEach(e=>{try{localStorage.removeItem(e)}catch(r){}}),g("[A/B] reset \u2014 "+t.length+" chave(s) apagada(s); recarregando p/ re-sortear")}catch(t){}try{typeof location!="undefined"&&location.reload&&location.reload()}catch(t){}}function at(){let t={holdout:!1,tryOnButton:null,modalWidth:null,modalHeight:null};for(let e=0;e<H.length;e++){let r=H[e];if(r.control)continue;let n=r.overrides||{};n.holdout&&(t.holdout=!0),n.tryOnButton&&(t.tryOnButton=n.tryOnButton),n.modalWidth&&(t.modalWidth=n.modalWidth),n.modalHeight&&(t.modalHeight=n.modalHeight)}return t}var er=[/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],rr={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},ee=2e3;function nr(t){for(let e=0;e<er.length;e++)if(er[e].test(t))return!0;return!1}function re(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>ee?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||nr(r))continue;let n=t[r];if(rr[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>ee){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Dn(n);continue}e[r]=n}return e}function Dn(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||nr(r))continue;let n=t[r];if(rr[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>ee){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var _t=[],ne=null,W=null,ie="1.1.120",Fn=["off","pdp_tryon","pdp","all","tryon_engaged"],ct,oe=null,J="unknown",G=[],V=null;function ir(){let t=w();return"mk_engaged_"+(t&&t.projectId||"")}function ae(){if(V!==null)return V;try{V=localStorage.getItem(ir())==="1"}catch(t){V=!1}return V}function lt(){if(!ae()){V=!0;try{localStorage.setItem(ir(),"1")}catch(t){}kt(!1)}}var Un=/^purchase(_diag)?$/;function ar(t,e){if(ct===void 0)return"hold";if(ct==="off")return"drop";if(ct==="all"||e&&Un.test(e))return"collect";switch(ct){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(ae())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":J==="available"?"collect":J==="unavailable"?"drop":"hold";default:return"collect"}}function kt(t){if(!G.length)return;let e=[];for(let r of G){let n=ar(r._pt,r.name);n==="collect"?sr(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}G=e}function ce(t){ct=Fn.indexOf(t)>=0?t:"all",kt(!1)}function cr(t){J=t==="available"?"available":"unavailable",kt(!1)}function lr(t){kt(!0),W=t,oe=t&&t.pageType||null,J="unknown"}function y(t,e,r){if(!w().projectId){(y._pre=y._pre||[]).push({name:t,params:e,ts:r||Date.now()}),y._pre.length>50&&y._pre.shift();return}if(y._pre&&y._pre.length){let o=y._pre;y._pre=[];for(let i of o)or(i.name,i.params,i.ts)}or(t,e,r)}function or(t,e,r){let n=ar(oe,t);if($n(t,e,n),n==="collect"){sr(t,e,r);return}if(n==="drop"){g("descartado (escopo)",t);return}G.push({name:t,params:e,ts:r||Date.now(),_pt:oe}),G.length>300&&G.shift()}function $n(t,e,r){if(w().observe)try{window.postMessage({__mkpixel:!0,event:{name:"page_"+ur(t),params:re(e||{})},site:W?{pageType:W.pageType,platform:W.platform,url:W.url}:null,gate:r},"*")}catch(o){}}function sr(t,e,r){let n=w(),o=re(e||{}),i="page_"+ur(t);if(_t.push({name:i,ts:r||Date.now(),params:o}),g("queued",t,o),_t.length>=n.batchMaxSize){N();return}ne||(ne=setTimeout(()=>{ne=null,N()},n.batchIntervalMs))}function ur(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 N(t){if(_t.length===0)return;let e=w();if(!e.projectId||!e.collectorUrl)return;let r=_t.splice(0,50),n=J==="available"?!0:J==="unavailable"?!1:void 0,o=Qe(),i=JSON.stringify({product:e.product||void 0,sdkVersion:ie,experiments:o.length?o:void 0,visitorId:vt(),sessionId:Ye(),engaged:ae()||void 0,tryonAvailable:n,events:r,site:W||void 0}),a=e.collectorUrl+"/v1/track";try{fetch(a,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:i}).catch(()=>{})}catch(c){try{navigator.sendBeacon&&navigator.sendBeacon(a+"?projectId="+encodeURIComponent(e.projectId),new Blob([i],{type:"text/plain"}))}catch(l){}}}function dr(){try{window.addEventListener("pagehide",()=>N(!0)),window.addEventListener("beforeunload",()=>N(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&N(!0)})}catch(t){}}function T(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(a){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let a of i){if(!a||!a["@type"])continue;let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];(!t||t.some(l=>c.includes(l)))&&e.push(a)}}}catch(r){}return e}var fr=["off","pdp_tryon","pdp","all","tryon_engaged"],Kn="all",Hn=30*60*1e3,D=null;function X(){if(D)return D;let t=w();return!t.projectId||!t.apiUrl?(D=Promise.resolve(null),D):(D=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>{if(!e.ok)throw new Error("http "+e.status);return e.json()}).then(e=>e&&e.project||e||null).catch(()=>(D=null,null)),D)}function pr(t){let e=t&&t.analytic&&t.analytic.scope;return fr.indexOf(e)>=0?e:Kn}var mr=t=>"mk_scope_"+t;function hr(t){try{let e=localStorage.getItem(mr(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:fr.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function yr(t,e){try{localStorage.setItem(mr(t),JSON.stringify({scope:e,exp:Date.now()+Hn}))}catch(r){}}var ue={};C(ue,{addToCart:()=>io,detect:()=>eo,getCartSummary:()=>no,id:()=>Qn,openCartDrawer:()=>ao,resolveSku:()=>ro,skipRedirect:()=>to});var St={};C(St,{addToCart:()=>Gn,detect:()=>Wn,getCartSummary:()=>se,id:()=>Vn,openCartDrawer:()=>Zn,resolveSku:()=>le});var Vn="shopify";function Wn(){return!!(window.Shopify||window.ShopifyAnalytics)}function le(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var Ct=t=>String(t==null?"":t).trim().toLowerCase();async function Gn({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let a=(await fetch("/products/"+o+".js").then(p=>p.json())).variants||[],c=p=>[p.option1,p.option2,p.option3].concat(String(p.title||"").split("/")).map(Ct).filter(Boolean),l=(p,b)=>c(p).indexOf(Ct(b))>=0,d=p=>(!t||l(p,t))&&(!e||l(p,e)),s=null;if((t||e)&&(s=a.find(p=>d(p)&&p.available)||a.find(d)),!s&&r&&(s=a.find(p=>Ct(p.sku)===Ct(r))),s||(s=a.find(p=>p.available)||a[0]),!s)throw new Error("shopify: variante n\xE3o encontrada");let f=gr(),u=null;if(f&&typeof f.getSectionsToRender=="function")try{u=f.getSectionsToRender().map(p=>({id:p.id,selector:p.selector||"#"+p.id})).filter(p=>p.id)}catch(p){}let m={items:[{id:s.id,quantity:n||1}]};u&&u.length&&(m.sections=u.map(p=>p.id).join(","),m.sections_url=location.pathname);let h=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!h.ok)throw new Error("shopify: /cart/add.js HTTP "+h.status);let x=await h.json().catch(()=>({}));return f&&u&&x.sections&&Jn(f,u,x.sections),{platform:"shopify",variantId:s.id,size:s.title,sku:s.sku||null}}function gr(){return document.querySelector("cart-drawer, cart-notification")}function Jn(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let c=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=c?c.innerHTML:null}let a=document.querySelector(n.selector);a&&i!=null&&(a.innerHTML=i)}catch(i){}}}async function se(){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 Xn=["[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 Yn(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function Zn(){let t=gr();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of Xn)try{if(e=[...document.querySelectorAll(r)].find(Yn),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var Qn="zerezes",to=!0;function eo(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var ro=le,no=se;function oo(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function io(){let t=oo();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function ao(){return!0}var fe={};C(fe,{addToCart:()=>uo,detect:()=>lo,getCartSummary:()=>fo,id:()=>co,resolveSku:()=>so});var co="hybris";function lo(){return!!(window.ACC&&window.ACC.config)}function so(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var wr=t=>String(t==null?"":t).trim().toLowerCase();async function uo({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(m=>m.getAttribute&&m.getAttribute("data-code")),n=t?r.find(m=>wr(m.textContent)===wr(t)):null;n||(n=r.find(m=>m.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),a=i&&i.querySelector('[name="CSRFToken"]'),c=a&&a.value,l=i&&i.getAttribute("action")||"/cart/add";if(!c)throw new Error("hybris: CSRFToken n\xE3o encontrado");let d=new URLSearchParams;d.set("productCodePost",o),d.set("qty",String(e||1)),d.set("CSRFToken",c);let s=await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:d.toString()});if(!s.ok)throw new Error("hybris: "+l+" HTTP "+s.status);let f=null,u=null;try{let m=await s.clone().json(),h=m&&m.cartData;h&&(f=de(h.total!=null?h.total:h.totalPrice),u=h.totalUnitCount!=null?Number(h.totalUnitCount):Array.isArray(h.products)?h.products.length:null)}catch(m){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:f,itemCount:u,currency:"BRL"}}function de(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 fo(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(a=>a.ok?a.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?de(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&&de(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var pe={};C(pe,{addToCart:()=>_o,addToCartBatch:()=>ko,detect:()=>mo,getCartSummary:()=>kr,getFsCartStore:()=>It,id:()=>po,openCartDrawer:()=>go,resolveSku:()=>Et,resolveSkuCandidates:()=>ho});var po="vtex";function mo(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0||window.__RUNTIME__||window.vtexaf||document.querySelector('link[href*="vtexassets"], script[src*="vtexassets"], link[href*="vteximg"], script[src*="vteximg"], img[src*="vteximg"]'))}function Et(){let t=window;if(t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0])return{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"};if(t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0])return{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"};try{let e=document.querySelector('meta[property="product:sku"]'),r=e&&(e.getAttribute("content")||"").trim();if(r)return{value:String(r),source:"vtex/og-sku"}}catch(e){}return null}function ho(){let t=[],e=yo();e&&t.push({value:e,source:"vtex/productReference"});let r=Et();return r&&r.value&&r.value!==e&&t.push(r),t}var At={path:null,value:null};function yo(){try{if(At.path===location.pathname&&At.value)return At.value;let t=(location.pathname.match(/^\/([^/]+)\/p/)||[])[1];if(!t)return null;let e=Lt(function(r){let n=r&&r.product;if(!n||n.linkText!==t)return null;let o=n.productReference;return typeof o=="string"&&o.trim()?o.trim():null});return e&&(At={path:location.pathname,value:e}),e||null}catch(t){return null}}var Tt=t=>String(t==null?"":t).trim().toLowerCase(),I;function It(){if(I!==void 0)return I;I=null;try{let t=Object.keys(window).find(o=>/^webpackChunk/.test(o));if(!t||!window[t]||typeof window[t].push!="function")return I;let e=null;try{window[t].push([["mk-cart-"+Math.random().toString(36).slice(2)],{},o=>{e=o}])}catch(o){}if(!e||!e.m)return I;let r=null;for(let o in e.m)try{let i=e.m[o].toString();if(i.indexOf("cart-storage")>=0&&i.indexOf("addToCart")>=0&&i.indexOf("toggleCart")>=0){r=o;break}}catch(i){}if(r==null)return I;let n=e(r);for(let o in n)try{let i=n[o];if(typeof i=="function"&&typeof i.getState=="function"){let a=i.getState();if(a&&typeof a.addToCart=="function"&&Array.isArray(a.items)){I=i;break}}}catch(i){}}catch(t){I=null}return I}function xr(t){try{let e=t&&t.totalizers||[];if(!e.length)return null;let r=e.reduce((n,o)=>n+(Number(o&&o.value)||0),0);return r>0?r/100:null}catch(e){return null}}async function vr(t,e){let r=It();if(!r)return null;let n=(Array.isArray(t)?t:[t]).map(l=>String(l)).filter(Boolean);if(!n.length||typeof r.getState().addToCart!="function")return null;let i=!1;for(let l=0;l<n.length;l++){let d=l===n.length-1;try{await r.getState().addToCart({id:n[l],seller:"1"},"mk-tryon",e||1,d),i=!0}catch(s){}}if(!i)return null;let a=r.getState(),c=(a.items||[]).reduce((l,d)=>l+(Number(d&&d.quantity)||1),0);return{platform:"vtex",skuId:n.join(","),itemCount:c||null,cartValue:xr(a),currency:a.currencyCode||"BRL",drawerHandled:!0}}function go(){try{let e=It();if(e){let r=e.getState();if(r&&r.cartOpen)return!0;if(typeof e.setState=="function")return e.setState({cartOpen:!0}),!0;if(r&&typeof r.toggleCart=="function")return r.toggleCart(),!0}}catch(e){}let t=['[data-testid="cart-toggle"]','button[aria-label="Abrir carrinho de compras"]','[class*="minicart" i] button','button[class*="minicart" i]','[class*="miniCart" i] button',".vtexsc-cart",".fn-minicart","#header-cart",'[class*="cartIcon" i]','[aria-label*="carrinho" i]','[aria-label*="sacola" i]','[data-testid*="cart" i] button'];for(let e of t)try{let r=document.querySelector(e);if(r)return r.click(),!0}catch(r){}return!1}async function br(t,e){let r=Array.isArray(t)?t:[t],n=r.map(f=>({id:parseInt(f,10),quantity:e||1,seller:"1"})).filter(f=>Number.isFinite(f.id));if(!n.length)throw new Error("vtex: nenhum skuId v\xE1lido");let o=location.origin,i=await fetch(o+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(f=>f.json()),a=i&&i.orderFormId;if(!a)throw new Error("vtex: orderFormId indispon\xEDvel");let c=await fetch(o+"/api/checkout/pub/orderForm/"+encodeURIComponent(a)+"/items",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"include",body:JSON.stringify({orderItems:n})}).then(f=>f.json()),l=c&&typeof c.value=="number"?c.value/100:null,d=Array.isArray(c&&c.items)?c.items.reduce((f,u)=>f+(Number(u.quantity)||1),0):null,s=c&&c.storePreferencesData&&c.storePreferencesData.currencyCode||"BRL";return{platform:"vtex",skuId:r.map(String).join(","),cartValue:l,itemCount:d,currency:s}}function Lt(t){try{var e=function(f){if(!f)return null;for(var u in f)if(u.indexOf("__reactFiber$")===0)return f[u];return null},r=document.querySelector('[class*="add-to-cart-button" i]')||document.querySelector('[class*="minicart" i]')||document.querySelector('[class*="product" i]')||document.body,n=e(r);if(!n)for(var o=document.querySelectorAll("div,button"),i=0;i<o.length&&i<3e3&&!n;i++)n=e(o[i]);if(!n)return null;for(var a=n;a&&a.return;)a=a.return;var c=null,l=new Set,d=0,s=function(f){if(!(!f||l.has(f)||d>3e4||c!=null)){l.add(f),d++;try{var u=[];f.memoizedProps&&(u.push(f.memoizedProps),f.memoizedProps.value&&u.push(f.memoizedProps.value));for(var m=f.memoizedState,h=0;m&&h<40;)m.memoizedState&&typeof m.memoizedState=="object"&&u.push(m.memoizedState),m=m.next,h++;for(var x=0;x<u.length;x++){var p=t(u[x]);if(p!=null){c=p;return}}}catch(b){}s(f.child),s(f.sibling)}};return s(a),c}catch(f){return null}}function wo(){return Lt(function(t){return t&&typeof t.addItems=="function"?t.addItems:null})}var xo=t=>/^\d+$/.test(String(t==null?"":t).trim());function vo(){var t=(location.pathname.match(/^\/([^/]+)\/p/)||[])[1];return t?Lt(function(e){var r=e&&e.product;if(!r||r.linkText!==t)return null;var n=Array.isArray(r.items)&&r.items[0];return n&&n.itemId?String(n.itemId):null}):null}function bo(t){if(!t)return null;var e=String(t).trim().toLowerCase(),r=function(i){var a=(i.variations||[]).find(function(c){return/tamanho|size|talla/i.test(c.name||"")});return a?String((a.values||[])[0]||"").trim().toLowerCase():null},n=Lt(function(i){return i&&i.product&&Array.isArray(i.product.items)&&i.product.items[0]&&i.product.items[0].itemId&&Array.isArray(i.product.items[0].variations)?i.product.items:null});if(!n)return null;var o=n.find(function(i){return r(i)===e});return o?String(o.itemId):null}async function _r(t,e){var r=wo();if(typeof r!="function")return null;var n=(Array.isArray(t)?t:[t]).map(i=>({id:String(i),quantity:e||1,seller:"1"})).filter(i=>i.id);if(!n.length)return null;try{r(n)}catch(i){return null}await new Promise(i=>setTimeout(i,600));let o=null;try{o=await kr()}catch(i){}return{platform:"vtex",skuId:n.map(i=>i.id).join(","),cartValue:o?o.value:null,itemCount:o?o.itemCount:null,currency:o&&o.currency||"BRL"}}async function _o(t){t=t||{};let{size:e,sku:r,quantity:n}=t,o=window.skuJson_0&&window.skuJson_0.skus||[];if(o.length&&window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart){let l=s=>Tt(s.skuname)===Tt(e)||s.dimensions&&Object.values(s.dimensions).some(f=>Tt(f)===Tt(e)),d=e?o.find(s=>l(s)&&s.available)||o.find(l):null;if(d||(d=o.find(s=>s.available)||o[0]),!d)throw new Error("vtex: variante n\xE3o encontrada");return await window.vtexjs.checkout.addToCart([{id:parseInt(d.sku,10),quantity:n||1,seller:"1"}]),{platform:"vtex",skuId:d.sku,size:d.skuname||e}}let i=e&&bo(e)||(xo(r)?String(r).trim():null)||(Et()||{}).value||vo()||null;if(!i)throw new Error("vtex: skuId n\xE3o resolvido (IO)");let a=await vr(i,n);if(a)return a;let c=await _r(i,n);return c||br(i,n)}async function ko(t){let e=(t||[]).map(o=>o&&(o.sku||(Et()||{}).value)).filter(Boolean);if(!e.length)throw new Error("vtex: nenhum skuId pro batch");let r=await vr(e,1);if(r)return Object.assign({count:e.length},r);let n=await _r(e,1);return n?Object.assign({count:e.length},n):window.skuJson_0&&window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart?(await window.vtexjs.checkout.addToCart(e.map(o=>({id:parseInt(o,10),quantity:1,seller:"1"}))),{platform:"vtex",count:e.length}):br(e,1)}async function kr(){try{let t=It();if(t){let e=t.getState(),r=xr(e),n=(e.items||[]).reduce((o,i)=>o+(Number(i&&i.quantity)||1),0);if(r!=null||n)return{value:r,itemCount:n,currency:e.currencyCode||"BRL"}}}catch(t){}try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}try{let t=await fetch(location.origin+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(e=>e.json());if(t&&typeof t.value=="number"){let e=(t.items||[]).reduce((r,n)=>r+(Number(n.quantity)||1),0);return{value:t.value/100,itemCount:e,currency:t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL"}}}catch(t){}return null}var me={};C(me,{addToCart:()=>Eo,detect:()=>Ao,getCartSummary:()=>Lo,id:()=>Co,openCartDrawer:()=>Io,resolveSku:()=>To,skipRedirect:()=>So});var Co="nuvemshop",So=!0;function Ao(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function To(){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 Rt=t=>String(t==null?"":t).trim().toLowerCase();async function Eo({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let c=String(r).replace(/["\\]/g,""),l=document.querySelector('[data-product-id="'+c+'"]'),d=l&&l.querySelector("form[action]"),s=d&&d.getAttribute("action")||"/comprar/",f=window.LS;if(f&&typeof f.addToCartEnhanced=="function")try{let h=document.createElement("form");h.setAttribute("action",s),h.setAttribute("method","post");let x=document.createElement("input");return x.type="hidden",x.name="add_to_cart",x.value=c,h.appendChild(x),document.body.appendChild(h),f.addToCartEnhanced(h),setTimeout(()=>{try{h.remove()}catch(p){}},3e3),{platform:"nuvemshop",productId:c,via:"gallery-enhanced"}}catch(h){}let u=!1,m=null;try{let x=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(c)+"&quantity="+(e||1)})).json().catch(()=>({}));u=!!x.success,m=x.error_code||null}catch(h){}return{platform:"nuvemshop",productId:c,via:"gallery",added:u,reason:m}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(c=>{let l=[...c.options].find(d=>Rt(d.textContent).includes(Rt(t))||Rt(d.value)===Rt(t));l&&(c.value=l.value,c.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(c=>setTimeout(c,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(c=>setTimeout(c,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function Io(){try{if([...document.querySelectorAll('#ajax-cart-details, .modal-cart, [class*="cart-modal" i], [class*="modal-cart" i]')].find(o=>{try{return o.getBoundingClientRect().width>0&&getComputedStyle(o).display!=="none"}catch(i){return!1}}))return!0;let r=[...document.querySelectorAll('[data-toggle="#modal-cart"], [data-toggle*="cart" i], #ajax-cart a.js-modal-open, .cart-summary a.js-modal-open, .js-toggle-cart')],n=r.find(o=>{let i=o.getBoundingClientRect();return i.width>0&&i.height>0})||r[0];if(n)return setTimeout(()=>{try{n.click()}catch(o){}},300),!0;if(window.LS&&typeof window.LS.toggleCart=="function")return setTimeout(()=>{try{window.LS.toggleCart()}catch(o){}},300),!0}catch(t){}return!1}function Lo(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,a)=>i+(Number(a.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var he={};C(he,{addToCart:()=>zo,detect:()=>Mo,getCartSummary:()=>qo,id:()=>Ro,openCartDrawer:()=>Do,resolveSizes:()=>Bo,resolveSku:()=>Oo,skipRedirect:()=>Po});var Ro="wake",Po=!0;function Mo(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function Oo(){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 Cr=t=>String(t==null?"":t).trim().toLowerCase(),jo=t=>/^\d{1,3}([.,]\d)?$/.test(t)||/^(PP|P|M|G|GG|XG|XGG|XXG|EG|EGG|UN|U)$/i.test(t);function Bo(){try{let t=[];for(let e of document.querySelectorAll("input[attribute-value]")){if(e.disabled)continue;let r=String(e.getAttribute("attribute-value")||"").trim();r&&jo(r)&&!t.includes(r)&&t.push(r)}return t}catch(t){return[]}}var Pt=()=>{var t,e;return((t=document.querySelector("[add-to-cart-button]"))==null?void 0:t.value)||((e=document.querySelector('[name="product-variant-id"]'))==null?void 0:e.value)||null};async function zo({size:t,quantity:e}){let r=null;if(t){let o=[...document.querySelectorAll("input[attribute-value]")].find(i=>Cr(i.getAttribute("attribute-value"))===Cr(t));if(o){let i=Pt();try{o.checked=!0}catch(a){}try{typeof window.selectAttribute=="function"?window.selectAttribute(o):o.click()}catch(a){}for(let a=0;a<12;a++){await new Promise(l=>setTimeout(l,250));let c=Pt();if(c&&/^\d+$/.test(c)&&c!==i){r=c;break}}r||(r=Pt())}}if(r||(r=Pt()),!r)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(r),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:r,size:t||null}}function Sr(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 qo(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?Sr(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=No());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 No(){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=Sr(r);if(n)return n}}}catch(t){}return null}function Do(){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 we={};C(we,{addToCart:()=>Ho,cartUrl:()=>$o,detect:()=>Ko,getCartSummary:()=>Vo,id:()=>Fo,openCartDrawer:()=>Wo,skipRedirect:()=>Uo});var ye="/api/v2/front",ge={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Ar=t=>String(t==null?"":t).trim().toLowerCase(),Fo="wapstore",Uo=!0,$o="/checkout/carrinho";function Ko(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Tr(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 Ho({size:t,quantity:e}){let r=await fetch(ye+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:ge}).then(u=>u.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(u=>Ar(u.label)===Ar(t)):null;i=i||o.find(u=>u.selecionado)||o.find(u=>(u.estoque||0)>0)||o[0];let a=i&&i.carrinho;if(!a||!a.itens||!a.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let c=a.itens.map(u=>Object.assign({},u,{quantidade:String(e||u.quantidade||1)})),l=await fetch(ye+"/checkout/cart",{method:"POST",headers:ge,body:JSON.stringify({itens:c,tipo:a.tipo||"produto"})});if(!l.ok)throw new Error("wapstore: add HTTP "+l.status);let d=await l.json().catch(()=>({})),s=Tr(d),f={platform:"wapstore",idProduto:c[0]&&c[0].idProduto,size:i&&i.label||null};return s&&(f.cartValue=s.value,f.itemCount=s.itemCount,f.currency=s.currency),f}async function Vo(){try{let t=await fetch(ye+"/checkout/cart",{headers:ge}).then(e=>e.json());return Tr(t)}catch(t){}return null}function Wo(){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 xe={};C(xe,{addToCart:()=>ei,detect:()=>Yo,getCartSummary:()=>ri,id:()=>Go,openCartDrawer:()=>ni,resolveSku:()=>Zo,skipRedirect:()=>Jo});var Er=t=>String(t==null?"":t).trim().toLowerCase(),Go="linx",Jo=!0;function Xo(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function Yo(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function Zo(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function Qo(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}function ti(t){if(t==null||t==="")return!1;let e=Er(t),r=e.replace(/\D/g,""),n=[...document.querySelectorAll('input[type="radio"]')].filter(i=>/aro|tamanho|grade|numera|size|variant/i.test(i.name||i.id||"")),o=n.find(i=>Er(i.value)===e)||(r?n.find(i=>String(i.value).replace(/\D/g,"")===r):null);if(!o)return!1;try{o.checked||(o.checked=!0),(o.labels&&o.labels[0]||null||o).click(),o.dispatchEvent(new Event("change",{bubbles:!0}))}catch(i){}return!0}async function ei(t){t=t||{};let e=Qo();if(!e)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.size!=null&&t.size!==""&&(ti(t.size),await new Promise(r=>setTimeout(r,1100))),e.click(),await new Promise(r=>setTimeout(r,1400)),{platform:"linx"}}function ri(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=Xo(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function ni(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var be={};C(be,{addToCart:()=>si,cartUrl:()=>ai,detect:()=>ci,getCartSummary:()=>ui,id:()=>oi,openCartDrawer:()=>gi,resolveOrder:()=>hi,resolveSku:()=>Ir,skipRedirect:()=>ii});var oi="magazord",ii=!0,ai="/checkout/cart";function ci(){try{if(document.querySelector('script[src*="zordcdn.com.br"], script[src*="magazord.com.br"], link[href*="magazord.com.br"]'))return!0}catch(t){}return!1}function Ir(){try{let n=(window.dataLayer||[]).filter(o=>o&&o.PageType==="ProductPage"&&o.sku).pop();if(n&&n.sku)return{value:String(n.sku),source:"magazord/dataLayer"}}catch(n){}let e=T(["Product"])[0],r=e&&(e.sku||e.mpn||e.productID);return r?{value:String(r),source:"jsonld"}:null}function ve(t){let e=[];try{t.querySelectorAll('a[href*="/checkout/cart"], a[href*="/carrinho"]').forEach(r=>{let n=Array.from(r.querySelectorAll("*")).find(o=>o.children.length===0&&/^\d+$/.test((o.textContent||"").trim()));n&&e.push(n)})}catch(r){}return e}function li(t){let e=t||1;ve(document).forEach(r=>{r.textContent=String((parseInt(r.textContent.trim(),10)||0)+e)}),fetch("/checkout/cart").then(r=>r.ok?r.text():null).then(r=>{if(!r)return;let n=new DOMParser().parseFromString(r,"text/html"),o=ve(n);if(!o.length)return;let i=parseInt(o[0].textContent.trim(),10);isNaN(i)||ve(document).forEach(a=>{a.textContent=String(i)})}).catch(()=>{})}async function si({sku:t,quantity:e}){let r=t||(Ir()||{}).value;if(!r)throw new Error("magazord: sku n\xE3o resolvido");let n=new URLSearchParams;n.set("produtos[0][codigo]",r),n.set("produtos[0][quantidade]",String(e||1)),n.set("produtos[0][deposito]","1"),n.set("source[source]","Produto"),n.set("source[codigoOrigem]","");let o=await fetch("/checkout/cart?operation=AddMultiples",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest",Accept:"application/json, text/javascript, */*"},body:n.toString()});if(!o.ok)throw new Error("magazord: add HTTP "+o.status);let i=(await o.text()).trim();if(i==="false"||/erro|error|indispon/i.test(i))throw new Error("magazord: add rejeitado ("+i.slice(0,60)+")");try{li(e||1)}catch(a){}return{platform:"magazord",skuId:r}}async function ui(){try{let t=document;if(!/\/checkout\/cart/i.test(location.pathname||"")){let a=await fetch("/checkout/cart",{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!a.ok)return null;t=new DOMParser().parseFromString(await a.text(),"text/html")}let e=di(t),r=e.reduce((a,c)=>a+(parseInt(c.quantity,10)||0),0)||null,n=pi(t),o=e.reduce((a,c)=>a+(Number(c.price)||0)*(parseInt(c.quantity,10)||1),0),i=n!=null?n:o>0?o:null;return i==null&&!r?null:{value:i,itemCount:r,currency:"BRL"}}catch(t){return null}}function di(t){try{if(t===document&&Array.isArray(window.dataLayer)){let r=window.dataLayer.filter(n=>n&&Array.isArray(n.cartItems)).pop();if(r)return r.cartItems}let e=t.querySelectorAll("script:not([src])");for(let r=0;r<e.length;r++){let n=e[r].textContent||"",o=n.indexOf('"cartItems"');if(o<0)continue;let i=fi(n,o);if(i)return i}}catch(e){}return[]}function fi(t,e){let r=t.indexOf("[",e);if(r<0)return null;let n=0,o=!1,i=!1;for(let a=r;a<t.length;a++){let c=t[a];if(o)i?i=!1:c==="\\"?i=!0:c==='"'&&(o=!1);else if(c==='"')o=!0;else if(c==="[")n++;else if(c==="]"&&--n===0)try{return JSON.parse(t.slice(r,a+1))}catch(l){return null}}return null}function pi(t){let e=[".value-content .value",".cart-total .value",".resumo-carrinho .total",'[class*="valor-total" i]'];for(let r=0;r<e.length;r++)try{let n=t.querySelector(e[r]);if(n){let o=mi(n.textContent);if(o)return o}}catch(n){}return null}function mi(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?e.replace(/\./g,"").replace(",","."):e.replace(/,/g,""),n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function hi(){try{let t=null;try{let n=document.documentElement.outerHTML.match(/["']transaction_?id["']\s*:\s*["']?([\w-]{4,})["']?/i);n&&(t=n[1])}catch(n){}let e=[".total-wrapper .valor",".valor-detalhe",".item-purchase .value",".value-content .value",'[class*="total-wrapper" i] .valor','[class*="valor-total" i]','[class*="total-pedido" i]'],r=null;for(let n=0;n<e.length;n++)try{document.querySelectorAll(e[n]).forEach(o=>{let i=yi(o.textContent);i!=null&&i<1e7&&(r==null||i>r)&&(r=i)})}catch(o){}return r==null&&!t?null:{orderId:t||null,revenue:r,currency:"BRL",source:"magazord"}}catch(t){return null}}function yi(t){let e=String(t||"").match(/(\d{1,3}(?:\.\d{3})*|\d+),(\d{2})(?!\d)/);if(!e)return null;let r=parseFloat(e[1].replace(/\./g,"")+"."+e[2]);return Number.isFinite(r)&&r>0?r:null}function gi(){try{let t=document.querySelector('[class*="carrinho-rapido" i], .side-cart, [class*="mini-cart" i]');if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('a[href*="/checkout/cart"], [class*="carrinho-rapido" i] a, [class*="header" i] [class*="cart" i] a, .button-cart');if(e)return e.click(),!0}catch(t){}return!1}var ke={};C(ke,{addToCart:()=>F,detect:()=>xi,id:()=>wi,resolveSku:()=>_e});var wi="generic";function xi(){return!0}function _e(){let t=T(["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 vi=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,bi=/continuar|como comprar|lista|desejos|favorito/i;async function F(){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&&vi.test(r)&&!bi.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 Lr=[ue,St,fe,pe,me,he,we,xe,be],_i=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],Ce;function S(){if(Ce)return Ce;let t=Lr.find(e=>{try{return e.detect()}catch(r){return!1}});return t&&(Ce=t),t||ke}function Rr(){let t=Lr.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of _i)try{if(r())return e}catch(n){}return null}function Y(){let t=S();if(t.id!=="generic"&&t.resolveSku){try{let e=t.resolveSku();if(e)return e}catch(e){}if(t.id==="vtex"&&window.__RUNTIME__)return{value:null,source:"vtex/pending"}}return _e()}function Ae(){let t=S();if(t.id!=="generic"&&typeof t.resolveSkuCandidates=="function")try{let r=t.resolveSkuCandidates();if(Array.isArray(r)&&r.length)return r.filter(n=>n&&n.value)}catch(r){}let e=Y();return e&&e.value?[e]:[]}function Pr(){let t=S();if(t&&typeof t.resolveSizes=="function")try{let e=t.resolveSizes();if(Array.isArray(e))return e}catch(e){}return[]}function Mr(t){return t=t||{},{size:t.size||t.selectedSize||t.tamanho||t.aro||t.ringSize||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null}}async function Or(t){if(t=t||{},Array.isArray(t.items)&&t.items.length)return ki(t.items);let e=Mr(t),r=S();try{let n=r.addToCart?await r.addToCart(e):await F(e);return g("cart: adicionado",n),Mt(),Se(r,n,e.sku),n}catch(n){g('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await F(e);return Mt(),Se(r,o,e.sku),o}}async function ki(t){let e=t.map(Mr),r=S(),n=null;try{if(r.addToCartBatch)n=await r.addToCartBatch(e);else for(let o of e)try{n=r.addToCart?await r.addToCart(o):await F(o)}catch(i){}}catch(o){g('cart: batch do adapter "'+r.id+'" falhou \u2014 fallback',o&&o.message);for(let i of e)try{n=await F(i)}catch(a){}}return g("cart: "+e.length+" itens adicionados",n),Mt(),Se(r,n,null),n}async function Se(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)&&y("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 Te(){let t=S();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function jr(t){t=t||{};let e=S(),r={platform:e.id};try{let n=Y();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 F(o),Mt();try{await Ee()}catch(i){}r.cart=await Te(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function Mt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Ee(t){if(t&&t.drawerHandled)return!1;let e=S(),r=w(),n=null;try{n=await X()}catch(a){}let o=n&&n.template&&n.template.cart||n&&n.cart||{},i=o.afterAdd||o.behavior||r.cartBehavior;if(i||(i=r.cartRedirect===!1?"none":"auto"),i==="none")return!1;if(i==="auto"||i==="drawer"){let a=o.openSelector||r.cartOpenSelector;if(a){let c=document.querySelector(a);if(c)return setTimeout(()=>{try{c.click()}catch(l){}},300),!1}else if(e&&e.openCartDrawer){let c=!1;try{c=e.openCartDrawer()}catch(l){}if(c)return!1}}return!0}function Br(){let t=S();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var Ci=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced|checkout\/[^?#]*success)/i,Si=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,Ai=/\/checkout/i,Ti=/\/checkout\/(cart|carrinho|sacola|basket|bag)(\/|$|\?|#)/i,Ei=/\/checkout\/(done|sucesso|obrigado|confirmacao|concluido|finalizado|thank[_-]?you)(\/|$|\?|#)/i,Ii=/\/(cart|carrinho|sacola|bag|comprar)(\/|$|\?|#)/i,zr=/\/(products?|produtos?|p)(\/|$|\?|#)/i,Li=/\/(collections?|categoria|categorias|c|departamento)\//i,Ri=/\/(search|busca|s)(\/|\?)/i;function qr(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=Si.test(t);try{let r=T(),n=0,o=!1,i=!1;for(let a of r){let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];if((c.includes("Order")||c.includes("Invoice"))&&!e)return"purchase";c.includes("SearchResultsPage")&&(o=!0),(c.includes("CollectionPage")||c.includes("ItemList"))&&(i=!0),c.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return zr.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":Ci.test(t)&&!e||Ei.test(t)&&!e?"purchase":Ti.test(t)?"cart":Ai.test(t)?"checkout":Ii.test(t)?"cart":zr.test(t)?"pdp":Li.test(t)?"category":Ri.test(t)?"search":"other"}function Nr(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let a=r.get(i);a&&(o[i.replace("utm_","")]=a)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:Pi()}}function Pi(){return Rr()}var Ie={},Mi=null,st=0,Dr=!1;function Fr(t){Dr||(Dr=!0,Ur(t),Oi(),ji(),Bi(),zi(),qi(t))}function Ur(t){Ie={};let e=qr(),r=Nr(e);if(lr(r),y("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 Oi(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let c=0;c<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");c++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},a=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(a||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),y("click",i)}catch(n){}},{capture:!0,passive:!0})}function ji(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let a of t)i>=a&&!Ie[a]&&(Ie[a]=!0,y("scroll_depth",{depth:a}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function Bi(){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"),y("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function zi(){let t=w();st=Date.now(),Mi=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-st)/1e3);st=e,r>0&&r<60&&y("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-st)/1e3);e>0&&e<600&&y("engagement",{url:location.pathname,dwellSec:e})}st=Date.now()})}function qi(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,Ur(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}catch(n){}}function Re(){let t=Y(),e=T(["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||$r(),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)||$r(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function $r(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,a=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,c=Le(a!=null?String(a):"");if(c)return c}}catch(t){}return null}function L(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function Ot(){try{let o=S();if(o&&typeof o.resolveOrder=="function"){let i=o.resolveOrder();if(i&&(i.revenue!=null||i.orderId))return i}}catch(o){}let t=T(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||L(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||L(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{let o=window.LS&&window.LS.order;if(o&&o.total!=null){let i=Number(o.total),a=window.LS.currency&&window.LS.currency.code||"BRL";return{orderId:String(o.number||o.id||L()||""),revenue:Number.isFinite(i)?i/100:null,currency:a,source:"nuvemshop"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],a=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(!a&&i&&(i.event==="purchase"||i.transaction_id!=null||i.transactionId!=null)){let c=parseFloat(i.value!=null?i.value:i.revenue),l=i.transaction_id||i.transactionId;if(Number.isFinite(c)||l!=null)return{orderId:l||L(),revenue:Number.isFinite(c)?c:null,currency:i.currency||i.currencyCode||null,itemCount:Array.isArray(i.items)?i.items.length:null,source:"datalayer_flat"}}if(a&&(i.event==="purchase"||a.purchase||a.transaction_id)){let c=a.purchase&&a.purchase.actionField,l=parseFloat(c&&(c.revenue||c.value)||a.value||a.revenue);return{orderId:c&&(c.id||c.transaction_id)||a.transaction_id||a.transactionId||L(),revenue:Number.isFinite(l)?l:null,currency:a.currency||a.currencyCode||c&&c.currency||null,itemCount:(a.purchase&&a.purchase.products||a.items||a.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:L(),revenue:parseFloat(e.content)||null,source:"meta"};let r=Ni();if(r)return r;let n=L();return n?{orderId:n,revenue:null,source:"url"}:null}function Ni(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=Le(n.length>1?n[n.length-1]:r);if(o)return{orderId:Kr(),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=Le(n.value||n.textContent);if(o)return{orderId:Kr(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function Kr(){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 Le(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 Hr(){let t=T(["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 Di=/(valor|total|subtotal|price|preco|revenue|amount|value|frete|desconto|qtd|quant|count|item|order|pedido|transaction|txid|codigo|numero|id)/i,Fi=/R\$\s*[\d.]+,\d{2}/;function Ui(t,e){if(typeof t=="number"&&isFinite(t)||typeof t=="boolean")return t;if(typeof t=="string"){let r=t.trim();if(!r||r.length>40)return;if(/^[R$\s]*-?[\d.]+([,.]\d+)?%?$/.test(r)||/id|pedido|order|transaction|codigo|numero/i.test(e)&&/^[\w-]{1,32}$/.test(r)&&r.indexOf("@")<0)return r}}function $i(){let t=[];try{let e=window.dataLayer;if(!Array.isArray(e))return t;for(let r=0;r<e.length&&t.length<30;r++){let n=e[r];if(!n||typeof n!="object"||Array.isArray(n))continue;let o={event:n.event||n.PageType||n.pageType||null,keys:[],nums:{}},i=n.ecommerce||n.ecommerce_data&&n.ecommerce_data.ecommerce;i&&typeof i=="object"&&(o.ecommerceKeys=Object.keys(i).slice(0,20));for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&(o.keys.length<25&&o.keys.push(a),Di.test(a))){let c=Ui(n[a],a);c!==void 0&&(o.nums[a]=c)}t.push(o)}}catch(e){}return t}function Ki(){let t=[];try{let e=document.querySelectorAll("*");for(let r=0;r<e.length&&r<6e3&&t.length<15;r++){let n=e[r];if(n.children.length)continue;let o=(n.textContent||"").match(Fi);if(!o)continue;let i=((n.className||"")+" | "+(n.parentElement&&n.parentElement.className||"")+" | "+(n.id||"")).toString().trim().slice(0,70);t.push({money:o[0],ctx:i})}}catch(e){}return t}function Hi(){let t={};try{let e=document.documentElement.outerHTML,r=/"(valor[A-Za-z]*|total[A-Za-z]*|subtotal|frete|desconto|orderId|idPedido|codigoPedido|numeroPedido|transaction_?id|revenue|amount)"\s*:\s*"?(-?[\d.,]{1,15})"?/gi,n,o=0;for(;(n=r.exec(e))&&o<25;)t[n[1]]===void 0&&(t[n[1]]=n[2],o++)}catch(e){}return t}function Vi(){let t=[];try{let e=document.querySelectorAll('script[type="application/ld+json"]');for(let r=0;r<e.length&&t.length<8;r++){let n;try{n=JSON.parse(e[r].textContent)}catch(i){continue}let o=Array.isArray(n)?n:[n];for(let i=0;i<o.length&&t.length<8;i++){let a=o[i];!a||typeof a!="object"||t.push({type:a["@type"]||null,keys:Object.keys(a).slice(0,15)})}}}catch(e){}return t}function Vr(){let t=[];return["Zord","Shopify","LS","vtex","__RUNTIME__","wc","magazord","VTEX"].forEach(e=>{try{window[e]&&t.push(e)}catch(r){}}),{diag:"order",path:(location.pathname||"").slice(0,120),dl:$i(),jsonld:Vi(),money:Ki(),htmlKeys:Hi(),globals:t}}var Bt=!1,jt=[/\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],Wi=[/^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 ut(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function Xr(t){switch(t){case"pdp":{let e=Re();y("view_item",e||{sku:null});break}case"category":case"search":{let e=Hr();y("view_item_list",e||{count:0});break}case"cart":Te().then(e=>y("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>y("view_cart",{}));break;case"checkout":y("begin_checkout",{});break;case"purchase":Gi();break}}var Wr=500,Gr=30;function Gi(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,Yr(o,i))};try{window.addEventListener("pagehide",()=>r(Ot(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=Ot();if(o&&o.revenue!=null)return r(o);if(e++>=Gr)return g("purchase: receita n\xE3o apareceu em "+Wr*Gr+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,Wr)};n()}function Yr(t,e){if(!Bt){if(t&&!t.orderId&&(t.orderId=L()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){g("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}if(Bt=!0,y("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),!t||t.revenue==null)try{y("purchase_diag",Vr())}catch(r){}if(g("purchase emitido",t),e)try{N(!0)}catch(r){}}}var Jr=!1;function Zr(){if(Jr)return;Jr=!0;let t=r=>{try{if(!r||typeof r!="object")return!1;if(r.event==="purchase"||r.event==="transaction"||r.transaction_id!=null||r.transactionId!=null)return!0;let n=r.ecommerce||r.ecommerce_data&&r.ecommerce_data.ecommerce;return n?!!n.purchase||n.transaction_id!=null:!1}catch(n){return!1}},e=r=>{Bt||!t(r)||setTimeout(()=>{if(!Bt)try{Yr(Ot(),!0)}catch(n){}},0)};try{let r=window.dataLayer=window.dataLayer||[];for(let o=0;o<r.length;o++)e(r[o]);let n=r.push;r.push=function(){let o=n.apply(this,arguments);try{for(let i=0;i<arguments.length;i++)e(arguments[i])}catch(i){}return o}}catch(r){}}function Qr(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let c=0;c<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");c++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let a=!1;if((ut([jt[0]],i)||o&&ut([jt[1]],i)||o&&ut([jt[2]],i)||ut(jt.slice(3),i))&&(a=!0),a){t=r;let c=Re();y("add_to_cart",{via:"click",buttonText:i,sku:c?c.sku:null,price:c?c.price:null});return}o&&ut(Wi,i)&&(t=r,y("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var zt={};C(zt,{available:()=>Zi,id:()=>Ji,iframeSrc:()=>Yi,modalSize:()=>Xi,onMounted:()=>Qi});var Ji="mk-fashion",Xi={width:430,height:800};function Yi(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return w().appUrl+"/"+t+"/"+r}async function Zi(t,e){let r=w().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function Qi(){}var Pe={};C(Pe,{available:()=>aa,closeButton:()=>na,id:()=>ta,iframeSrc:()=>ia,modalSize:()=>ea,modalSizeMobile:()=>ra,onMounted:()=>sa});var ta="mk-makeup",ea={width:"80vw",height:"80vh"},ra={width:"100vw",height:"100dvh"},na=!0;function oa(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function ia(t,e){let r=window.__MK&&window.__MK.pulpoarIframeUrl;if(r){let o=String(r);return e!=null&&/\{sku\}|\{identifier\}/.test(o)&&(o=o.replace(/\{sku\}|\{identifier\}/g,encodeURIComponent(e))),o}let n=window.__MK&&window.__MK.pulpoarProjectKey||t;return oa()+"/"+encodeURIComponent(n)}async function aa(t,e){let r=window.__MK&&window.__MK.pulpoarProjectKey||t;if(!r)return{available:!0};let n=await en(e)||e;if(!n)return{available:!0};try{let i=String(w().collectorUrl||"").replace(/\/+$/,"")+"/v1/makeup/availability/"+encodeURIComponent(r)+"?slug="+encodeURIComponent(n);t&&(i+="&projectId="+encodeURIComponent(t));let a=await fetch(i).then(c=>c.json());return g("pulpoar availability",a),{available:!(a&&(a.available===!1||a.projectActive===!1))}}catch(o){return g("pulpoar availability erro",o&&o.message),{available:!0}}}var ca="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",qt=null;function la(){return window.pulpoar?Promise.resolve(window.pulpoar):qt||(qt=new Promise(t=>{try{let e=document.createElement("script");e.src=ca,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),qt)}async function en(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(l=>l.json())).variants||[],a=n?i.find(l=>String(l.id)===String(n)):null;if(a&&a.sku)return a.sku;let c=i.find(l=>l.available)||i[0];if(c&&c.sku)return c.sku}}}catch(e){}return t||null}function tn(t){return!t||typeof t!="object"?{quantity:1}:{sku:t.sku||t.slug||t.key||t.variant_key||t.barcode||null,color:t.color||t.shade||t.colorName||null,size:t.size||null,quantity:1}}function sa(t,e){la().then(async r=>{if(!r){g("pulpoar: SDK n\xE3o carregou");return}let n=await en(e.identifier);if(g("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){g("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{let i=(Array.isArray(o)?o:[o]).filter(a=>a&&typeof a=="object");if(g("pulpoar onAddToCart",i.length+" item(s)",i),i.length<=1){e.handleAddToCart(i.length?tn(i[0]):{quantity:1},"makeup");return}e.handleAddToCart({items:i.map(tn)},"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var ua={"mk-fashion":zt,"mk-makeup":Pe};function Nt(t){return ua[t]||zt}var P=null,R=null,Ft=!1,Ut=!1,j=null,rn={},Me=null,Dt=0,E={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},da={gregory:"698c7e791d3129430f15dddd"};function on(t){return t?da[String(t).toLowerCase()]||t:null}async function U(t,e){let r=on(t),n=String(e||"").trim();return Nt(w().product).available(r,n)}async function an(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await U(t,e)).available===!0}catch(r){return!1}}async function dt(t){if(t=t||{},Ft)return;let e=on(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(rn[n]!==!0){try{if(!(await U(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(d){alert("Produto nao encontrado ou indisponivel.");return}rn[n]=!0}let o=Nt(w().product),a=(window.innerWidth||0)<=768&&o.modalSizeMobile||o.modalSize||{width:430,height:800},c=w(),l=at();j={projectId:e,identifier:r,width:t.width||l.modalWidth||c.modalWidth||a.width,height:t.height||l.modalHeight||c.modalHeight||a.height},Ut=!1,sn(),fa(j),Ft=!0,Dt=Date.now(),lt(),y("modal_opened",{projectId:e,identifier:r})}function $t(){if(!Ft)return;let t=Ut;if(Ut=!1,pa(),Ft=!1,O("onClose"),y("modal_closed",{projectId:j&&j.projectId,identifier:j&&j.identifier}),t)try{Br()}catch(e){}}function cn(t){try{wn().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function fa(t){P=document.createElement("div"),P.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",cn(!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,o=String(t.width).indexOf("100v")>=0;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:"+(o?"0":"12px")+";overflow:hidden;background:#fff;",R=document.createElement("iframe");let i=Nt(w().product),a=i.iframeSrc(t.projectId,t.identifier);try{let c=Pr();c&&c.length&&(a+=(a.indexOf("?")>=0?"&":"?")+"sdkSizes="+encodeURIComponent(c.join(",")))}catch(c){}if(R.src=a,R.style.cssText="width:100%;height:100%;border:none;",R.setAttribute("allow","camera *; microphone *; web-share"),R.setAttribute("allowfullscreen","true"),e.appendChild(R),i.closeButton){let c=document.createElement("button");c.setAttribute("aria-label","Fechar"),c.setAttribute("type","button"),c.innerHTML='<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"><path d="M1.6 1.6l10.8 10.8M12.4 1.6L1.6 12.4" stroke="#111" stroke-width="2" stroke-linecap="round"/></svg>',c.style.cssText="position:absolute;top:8px;right:8px;z-index:2;width:32px;height:32px;padding:0;border:none;border-radius:50%;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 5px rgba(0,0,0,.3);",c.addEventListener("click",()=>{try{$t()}catch(l){}}),e.appendChild(c)}P.appendChild(e),document.body.appendChild(P);try{i.onMounted(R,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:un,track:y,fire:O})}catch(c){g("launcher.onMounted falhou",c&&c.message)}g("try-on modal aberto",R.src)}function pa(){P&&P.parentNode&&P.parentNode.removeChild(P),P=null,R=null,cn(!1)}var nn=!1;function ln(){sn()}function sn(){nn||(nn=!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":$t();break;case"ready":O("onReady",n);break;case"product_loaded":O("onProductLoaded",n),y("product_loaded",Oe(n));break;case"interaction":{O("onInteraction",n),n&&n.method&&(Me=n.method),y(ma(n),Oe(n));break}case"add_to_cart":un(n,"tryon");break;case"generation_start":Dt=Date.now();break;case"generation_complete":O("onGenerationComplete",n),y("generation_complete",{method:n.method||Me||"unknown",durationMs:Dt?Date.now()-Dt:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":O("onError",n),y("generation_error",{method:Me||"unknown",error:n&&n.error});break}}))}function un(t,e){if(y("add_to_cart",Object.assign({via:e||"tryon"},Oe(t))),typeof E.onAddToCart=="function"){O("onAddToCart",t);return}let r=Object.assign({productId:j&&j.identifier},t);Or(r).then(n=>Ee(n)).then(n=>{Ut=!!n}).catch(()=>{})}function ma(t){return t&&t.action,"interaction"}function Oe(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 O(t,e){if(typeof E[t]=="function")try{E[t](e)}catch(r){console.error("[mk-sdk]",r)}}function dn(t){E.onReady=t}function fn(t){E.onClose=t}function pn(t){E.onAddToCart=t}function mn(t){E.onProductLoaded=t}function hn(t){E.onError=t}function yn(t){E.onInteraction=t}function gn(t){E.onGenerationComplete=t}var ya=767,ga=1024,wa=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,xa=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function je(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 va(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&je(e)}catch(e){return!1}}function ba(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function _a(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 ft(t){if(!t||typeof t!="object")return null;if(t=_a(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(l=>l[1]&&l[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,l])=>va(l.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||ya,i=Number(t.bpTablet)||ga,a=l=>(e.find(d=>d[0]===l)||[])[1],c=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let l of c){let d=a(l);if(d)return d}return e[0][1]}function Kt(t){let e=ft(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&je(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function xn(){let t=w(),e=Kt(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=ba(n);if(!(!o||o.length>40)&&!xa.test(o)&&wa.test(o)&&je(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",Be={none:"0",sm:"4px",md:"8px",pill:"9999px"},ze={none:"0",sm:"4px",md:"8px",lg:"16px"},ka='<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>',bn='<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 v(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 _n(t){return v("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:bn})}var Ht=t=>'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">'+t+"</svg>",vn={camera:ka,sparkle:bn.replace("width:12px;height:12px","width:100%;height:100%"),shirt:Ht('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),face:Ht('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),glasses:Ht('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),wand:Ht('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')};function B(t,e,r){let n=Number(r)>0?Number(r):24;return v("span",{style:`width:${n}px;height:${n}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${e};flex-shrink:0;`,html:vn[t]||vn.camera})}function Z(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function Q(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(v("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 Ca(t){return t.subtext?v("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 kn(t,e){Q();let r=v("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[B(t.icon,t.textColor,t.iconSize),v("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return v("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:${Z(t)};border-radius:${t.borderRadiusPx};font-family:${_};font-size:${t.fontSize}px;cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,Ca(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 Aa(t){return t.subtext?v("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:[_n(t.badgeTextColor),v("span",{text:t.subtext})]}):null}function Ta(t,e){return v("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:${Z(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:[B(t.icon,t.textColor,t.iconSize),v("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Cn(t,e){Q();let r=v("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&v("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&&v("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=v("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&v("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=v("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[Aa(t),Ta(t,e)]}),i=v("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return v("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};font-size:${t.fontSize}px;`,children:[i]})}function Sn(t,e){let r=Number(t.iconSize)>0?Number(t.iconSize):24;return v("button",{attrs:{type:"button","aria-label":t.text||"Provar virtualmente"},style:`display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${t.bgColor};border:${Z(t)};border-radius:${t.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[B(t.icon,t.textColor,r)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function An(t,e){Q();let r=v("div",{style:"display:flex;flex-direction:column;gap:8px;width:fit-content;max-width:100%;",children:[v("div",{style:"display:flex;align-items:center;gap:8px;",children:[B(t.icon,t.cardTitleColor,t.iconSize),t.cardTitle&&v("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;letter-spacing:1px;color:${t.cardTitleColor};white-space:nowrap;line-height:1.2;`})]}),v("div",{style:`height:3px;width:100%;border-radius:9999px;background:linear-gradient(90deg, ${t.cardAccentFrom}, ${t.cardAccentTo});`})]}),n=t.cardDescription&&v("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:13px;line-height:1.4;color:${t.cardTextColor};`}),o=v("button",{attrs:{type:"button"},text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:1px;text-decoration:underline;text-underline-offset:4px;color:${t.cardCtaColor};background:transparent;border:none;padding:0;cursor:pointer;text-align:left;line-height:1.2;transition:opacity 0.2s ease;`,on:{mouseenter:i=>{i.currentTarget.style.opacity="0.7"},mouseleave:i=>{i.currentTarget.style.opacity="1"},click:i=>{try{i.preventDefault(),i.stopPropagation()}catch(a){}try{e&&e()}catch(a){}}}});return v("div",{style:`display:flex;flex-direction:column;align-items:flex-start;gap:24px;padding:20px;width:360px;max-width:100%;box-sizing:border-box;background:${t.cardBgColor};border:1px solid ${t.cardBorderColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};`,children:[r,n,o]})}var Ra={style:"gregory-black",icon:"camera",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md",cardCtaColor:"#1E1E1E",cardBorderColor:"#E5E0DA",cardAccentFrom:"#8A5A3C",cardAccentTo:"#E9DACB"};function Vt(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function pt(t,e){let r={...Ra,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=Be[r.borderRadius]!=null?Be[r.borderRadius]:"0",r.cardBorderRadiusPx=ze[r.cardBorderRadius]!=null?ze[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var qe={"gregory-black":kn,"gregory-card":Cn,"gregory-icon":Sn,"card-link":An},Qc=Object.keys(qe).concat("none");function Tn(t,e){return t&&t.style==="none"?null:(qe[t.style]||qe["gregory-black"])(t,e)}function Pa(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var M=null,z=[];function wn(){return[M].concat(z).filter(Boolean)}function Ma(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 Oa=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|align-self|justify-self|place-self|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height|font-size)$/i;function ja(t){return!t||typeof t!="string"?"":t.split(/[;\n\r]+/).map(e=>e.trim()).filter(Boolean).filter(e=>Oa.test(e.split(":")[0].trim().toLowerCase())).join(";")}var Jt=null,Ne=!1,De=0,Fe=0,Ue=0,tt={},En=!1,mt=null;function q(){return mt||(mt=X().then(t=>{if(!t)return mt=null,null;try{bt(t,w().projectId,w().product)}catch(e){}return Vt(t.template&&t.template.tryOnButton||null)||{__loaded:!0}}).catch(()=>(mt=null,null))),mt}var yt=null,Wt=null,$=null,Gt=typeof location!="undefined"?location.pathname:"";function Ba(t){let e=/<script[^>]+application\/ld\+json[^>]*>([\s\S]*?)<\/script>/gi,r;for(;r=e.exec(t);)try{let n=JSON.parse(r[1].trim()),o=Array.isArray(n)?n:[n];for(let i of o)if(i&&/product/i.test(i["@type"]||"")&&(i.sku||i.mpn))return String(i.sku||i.mpn)}catch(n){}return null}function Ke(){return $&&$.path===location.pathname&&$.value?{value:$.value,source:"url-fresh"}:Y()}function za(t){let e=[];try{e=Ae().map(r=>r&&r.value).filter(Boolean)}catch(r){}return t&&e.indexOf(t)<0&&e.push(t),e}async function qa(t,e){for(let r=0;r<e.length;r++){let n=e[r];if(tt[n]||(tt[n]=U(t,n).then(o=>!!(o&&o.available)).catch(()=>!1)),await tt[n])return n}return null}function Na(){yt||(Gt=location.pathname,yt=setInterval(()=>{try{if(M&&!M.isConnected){k("pdp");return}if(location.pathname!==Gt){Gt=location.pathname,$=null,fetch(location.href,{credentials:"same-origin"}).then(r=>r.ok?r.text():null).then(r=>{let n=r&&Ba(r);n&&($={path:location.pathname,value:n},Wt=n),k("pdp")}).catch(()=>k("pdp"));return}let t=Ke(),e=t&&t.value;e&&e!==Wt&&(Wt=e,k("pdp"))}catch(t){}},1500))}function Da(){yt&&(clearInterval(yt),yt=null),Wt=null,$=null,Gt=typeof location!="undefined"?location.pathname:""}function Fa(){if(En)return;En=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{Jt&&k("pdp")},200)})}catch(e){}}function He(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function ht(){He(M),z.forEach(He),M=null,z=[],Jt=null}var Ua={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 $a(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 Ka(t,e,r){let o=!Ua[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(s){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+$a(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let s=t.getBoundingClientRect(),f=o.getBoundingClientRect(),u=e.offsetWidth,m=e.offsetHeight,h=s.top-f.top+o.scrollTop,x=s.left-f.left+o.scrollLeft,p=r||"top-left",b=h,A=x;p.indexOf("bottom")===0?b=h+s.height-m:(p.indexOf("middle")===0||p==="center")&&(b=h+(s.height-m)/2),p.indexOf("right")>=0?A=x+s.width-u:p.indexOf("center")>=0&&(A=x+(s.width-u)/2),e.style.top=b+"px",e.style.left=A+"px"}catch(s){}};i();let a=()=>i();window.addEventListener("resize",a);let c=setTimeout(i,600),l=setTimeout(i,1500),d=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){d=new ResizeObserver(()=>i());try{d.observe(t)}catch(s){}try{d.observe(o)}catch(s){}}}catch(s){}e.__mkCleanup=()=>{window.removeEventListener("resize",a),clearTimeout(c),clearTimeout(l);try{t.removeEventListener("load",i)}catch(s){}try{d&&d.disconnect()}catch(s){}}}function Ha(t,e,r){e.style.cssText="position:absolute;z-index:100;",document.body.appendChild(e);let n=()=>{try{let u=t.getBoundingClientRect(),m=e.offsetWidth,h=e.offsetHeight,x=r||"top-left",p=u.top+window.scrollY,b=u.left+window.scrollX;x.indexOf("bottom")===0?p=u.bottom+window.scrollY-h:(x.indexOf("middle")===0||x==="center")&&(p=u.top+window.scrollY+(u.height-h)/2),x.indexOf("right")>=0?b=u.right+window.scrollX-m:x.indexOf("center")>=0&&(b=u.left+window.scrollX+(u.width-m)/2),e.style.top=Math.round(p)+"px",e.style.left=Math.round(b)+"px"}catch(u){}};n();let o=0,i=!1,a=()=>{o=Date.now()+450,!i&&(i=!0,function u(){n(),Date.now()<o?requestAnimationFrame(u):i=!1}())},c=()=>n();window.addEventListener("resize",c),window.addEventListener("scroll",a,!0);let l=setTimeout(n,600),d=setTimeout(n,1500),s=null,f=null;try{t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",n,{once:!0});let u=t.querySelector&&t.querySelector("img");if(u&&!u.complete&&u.addEventListener("load",n,{once:!0}),typeof ResizeObserver=="function"){s=new ResizeObserver(()=>n());try{s.observe(t)}catch(x){}}let m=t.parentElement,h=null;for(let x=0;x<8&&m;x++){let p=getComputedStyle(m);if(p.transform&&p.transform!=="none"||/swiper|slick|flick|carousel|glide|splide|slider/i.test((m.className||"").toString())){h=m;break}m=m.parentElement}h&&typeof MutationObserver=="function"&&(f=new MutationObserver(a),f.observe(h,{attributes:!0,attributeFilter:["style","class"]}))}catch(u){}e.__mkCleanup=()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",a,!0),clearTimeout(l),clearTimeout(d);try{s&&s.disconnect()}catch(u){}try{f&&f.disconnect()}catch(u){}}}function Va(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 k(t){let e=w(),r=null;if(t!=="pdp"){ht(),Da();return}if(!e.projectId)return;if(Na(),!e._anchorFromPicker){let s=await q(),f=at(),u=s&&s.main,m=s&&s.anchors,h=s&&s.cards;if(f&&f.tryOnButton){let p=Vt(f.tryOnButton)||{};p.main&&(u=Object.assign({},u||e.anchor||{},p.main),r=u),p.anchors&&(m=p.anchors),p.cards&&(h=p.cards)}u&&(e.anchor=u),m&&(e.anchors=m),h&&(e.cards=h);let x=!!(e.anchor&&(e.anchor.desktop||e.anchor.mobile||e.anchor.tablet||e.anchor.selector));if(!e.forceButton&&!(s&&s.main)&&!x){ht(),s===null&&De<3&&(De++,setTimeout(()=>k(t),1500));return}De=0}if(Ne)return;let n=Ke(),o=n&&n.value,i=!!e.forceButton,a=s=>s?[s.selector,s.position,s.mode,s.align,s.style].join("~"):"heuristic",c=Array.isArray(e.anchors)?e.anchors:[],l=[o||"demo",a(ft(e.anchor))].concat(c.map(s=>a(ft(s)))).join("|"),d=M;if(!(d&&d.isConnected&&Jt===l)){if(d&&ht(),!o&&!i){g("auto-mount: SKU n\xE3o resolvido na PDP"),Fe<10&&(Fe++,setTimeout(()=>k(t),800));return}if(Fe=0,!i&&e.anchor&&ft(e.anchor)&&!Kt(e.anchor)&&Ue<12){Ue++,setTimeout(()=>k(t),600);return}Ue=0,Ne=!0;try{let s=i,f=o;if(!i){let b=await qa(e.projectId,za(o));s=!!b,b&&(f=b)}try{cr(s?"available":"unavailable")}catch(b){}if(!s){g("auto-mount: produto sem try-on",o);return}if(at().holdout){ht(),g("auto-mount: holdout \u2014 bot\xE3o suprimido");return}let u=await q(),m=window.matchMedia("(max-width: 767px)").matches,h=pt(r||u&&u.main||e.anchor||{},m),x=()=>{let b=Ke(),A=b&&b.value||"",rt=!A||A===o?f||o||"":A;lt(),y("button_clicked",{sku:rt,style:h.style}),dt({projectId:e.projectId,identifier:rt})},p=xn();M=Ve(p,h,x),z=[];for(let b=0;b<c.length;b++){let A=c[b],rt=Kt(A);if(!rt)continue;let Ln=u&&u.anchors&&u.anchors[b]||A,Ge=Ve(rt,pt(Ln,m),x);Ge&&z.push(Ge)}Jt=l,Fa(),g("auto-mount: bot\xE3o",{style:h.style,sku:o,mounted:!!M,extras:z.length,forced:i}),(M||z.length)&&y("button_rendered",{style:h.style,sku:o||null,skuSource:n&&n.source,anchorFound:!!p,position:p?p.position:null,mode:p?p.mode:null,extras:z.length,forced:i})}finally{Ne=!1}}}function Ve(t,e,r){let n=t&&t.mode||"flow",o=Tn(e,r);if(!o)return null;let i=document.createElement("div");i.id=Pa(),Ma(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(l=>{try{i.addEventListener(l,d=>{d.stopPropagation()},!1)}catch(d){}});let c=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(t.detached?Ha(t.el,i,t.align):Ka(t.el,i,t.align),c=!0):(i.style.cssText="display:contents;",c=Va(t.el,i,t.position))),c||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let l=ja(t.style);if(l){if(n==="overlay"){let d=l.match(/(?:^|;)\s*z-index\s*:\s*([^;]+)/i);if(d)try{i.style.zIndex=d[1].trim()}catch(s){}}try{o.style.cssText+=";"+l}catch(d){}}}return i}function In(){try{let t=w(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton},r={},n=i=>({desktop:i,tablet:i,mobile:i}),o=(i,a,c)=>{i=i||{};let l=u=>a===u?c:r[u];t.anchor=l("primary")?n(l("primary")):i.main||null;let d=Array.isArray(i.anchors)?i.anchors:[],s=d.length;Object.keys(r).concat(a?[a]:[]).forEach(u=>{u&&u.indexOf("extra-")===0&&(s=Math.max(s,(parseInt(u.slice(6),10)||0)+1))});let f=[];for(let u=0;u<s;u++){let m=l("extra-"+u);f[u]=m?n(m):d[u]||null}t.anchors=f,t._anchorFromPicker=!0,t.forceButton=!0};window.addEventListener("message",i=>{if(i.source!==window)return;let a=i.data;if(!(!a||!a.__mkCmd)){if(a.__mkCmd==="getButtons"){q().then(c=>{let l=c&&Array.isArray(c.anchors)?c.anchors.length:0;try{window.postMessage({__mkButtons:{extras:l,hasMain:!!(c&&c.main)}},"*")}catch(d){}});return}if(a.__mkCmd==="previewSlot"){q().then(c=>{o(c,a.slot||"primary",a.live),k("pdp")});return}if(a.__mkCmd==="saveSlot"){a.slot&&a.live&&(r[a.slot]=a.live),q().then(c=>{o(c),k("pdp")});return}if(a.__mkCmd==="galleryPreview"){t.cards=a.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,et(),Xt("category");return}if(a.__mkCmd==="applyRecipe"){q().then(c=>{o(c),a.cards!==void 0&&(t.cards=a.cards||null),k("pdp"),t.cards&&(et(),Xt("category"))});return}if(a.__mkCmd==="cancelPreview"){Object.keys(r).length?q().then(c=>{o(c),k("pdp")}):(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,ht(),et(),k("pdp"));return}}})}catch(t){}}var K=null,gt=null,We=null,wt=new Map;function Wa(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function Ga(t,e,r){if(wt.has(t))return;let n=!!w().forceButton,o=Wa(t,e);if(!o&&!n)return;let i=n;if(i||(tt[o]||(tt[o]=U(w().projectId,o).then(s=>!!(s&&s.available)).catch(()=>!1)),i=await tt[o]),!i||wt.has(t)||!t.isConnected)return;let c={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.injectStyle||e.style||"",detached:!0},d=Ve(c,r,()=>{lt(),y("button_clicked",{sku:o,gallery:!0,style:r.style}),dt({projectId:w().projectId,identifier:o})});d&&(wt.set(t,d),y("button_rendered",{gallery:!0,sku:o,style:r.style}))}function $e(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,K.observe(e))})}catch(e){}}function et(){if(K){try{K.disconnect()}catch(t){}K=null}if(gt){try{gt.disconnect()}catch(t){}gt=null}clearTimeout(We),wt.forEach(t=>He(t)),wt.clear()}async function Xt(t){let e=w();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){et();return}if(!e.projectId)return;let r=await q(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){et();return}if(K){$e(n);return}if(typeof IntersectionObserver!="function")return;let o=pt(n,window.matchMedia("(max-width: 767px)").matches);if(o.style==="none"){et();return}K=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(K.unobserve(a.target),Ga(a.target,n,o))},{rootMargin:"300px"}),$e(n);try{gt=new MutationObserver(()=>{clearTimeout(We),We=setTimeout(()=>$e(n),250)}),gt.observe(document.body,{childList:!0,subtree:!0})}catch(i){}g("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{dr(),In(),ln(),e.autoTrack!==!1&&(Fr((o,i)=>{Xr(o,i),k(o),Xt(o)}),Qr(),Zr()),g("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=Zt();if(e.projectId){let o=hr(e.projectId);o&&ce(o),X().then(i=>{let a=pr(i);ce(a),yr(e.projectId,a),g("escopo de coleta",a);try{bt(i,e.projectId,e.product)}catch(c){}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:dt,close:$t,isAvailable:an,getAvailability:U,onReady:dn,onClose:fn,onAddToCart:pn,onProductLoaded:mn,onError:hn,onInteraction:yn,onGenerationComplete:gn,testCart:jr,experiments:te,resetExperiments:tr,_version:ie,_isMkSdk:!0};typeof window!="undefined"&&(window.mk=n)}catch(e){typeof console!="undefined"&&console.error("[mk-sdk] boot fatal",e)}})();})();
1
+ (()=>{var Dn=Object.defineProperty;var C=(t,e)=>{for(var r in e)Dn(t,r,{get:e[r],enumerable:!0})};var Qt={collectorUrl:"https://api-collector.mk3dlabs.com",appUrl:"https://mkfashion.mk3dlabs.com/visualizer",apiUrl:"https://mkfashion-new-api.mk3dlabs.com"},Fn={},it=null;function te(){if(it)return it;let t=null;try{t=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]')||document.querySelector('script[src*="mk-pixel"]')}catch(i){}let e=i=>{try{return t&&t.getAttribute(i)}catch(a){return null}},r=e("data-mk-project")||e("data-mk-client")||window.__MK&&(window.__MK.projectId||window.__MK.clientSlug)||null,n=e("data-mk-product")||window.__MK&&window.__MK.product||"mk-fashion",o=e("data-mk-collector")||window.__MK&&window.__MK.collectorUrl||Fn.collectorUrl||Qt.collectorUrl;return it={projectId:r,product:n,collectorUrl:o,appUrl:window.__MK&&window.__MK.appUrl||Qt.appUrl,apiUrl:window.__MK&&window.__MK.apiUrl||Qt.apiUrl,debug:!!(e("data-mk-debug")!==null||window.__MK&&window.__MK.debug||/[?&]mkdebug\b/.test(location.search)),observe:!!(window.__MK&&window.__MK.observe),forceButton:!!(window.__MK&&window.__MK.forceButton),anchor:window.__MK&&window.__MK.anchor||null,anchors:window.__MK&&window.__MK.anchors||null,cards:window.__MK&&window.__MK.cards||null,modalWidth:window.__MK&&window.__MK.modalWidth||null,modalHeight:window.__MK&&window.__MK.modalHeight||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},it}function w(){return it||te()}function g(...t){let e=w();e&&e.debug&&typeof console!="undefined"&&console.log("[mk-sdk]",...t)}var tr="_mk_vid",er="_mk_sid",at=null,ct=null;function bt(){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 _t(){if(at)return at;try{let t=localStorage.getItem(tr);return t||(t="v_"+bt(),localStorage.setItem(tr,t)),at=t,t}catch(t){return at="v_"+bt(),at}}function rr(){if(ct)return ct;try{let t=sessionStorage.getItem(er);return t||(t="s_"+bt(),sessionStorage.setItem(er,t)),ct=t,t}catch(t){return ct="s_"+bt(),ct}}var G=[],nr=!1;function ee(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return(e>>>0)/4294967296}function Un(){let t=typeof navigator!="undefined"&&navigator.userAgent||"";return/iPad|Tablet|PlayBook|Silk/i.test(t)||/Android/i.test(t)&&!/Mobile/i.test(t)?"tablet":/Mobi|Android|iPhone|iPod|Windows Phone|BlackBerry/i.test(t)?"mobile":"desktop"}function $n(){try{return localStorage.getItem("_mk_seen")?!0:(localStorage.setItem("_mk_seen",String(Date.now())),!1)}catch(t){return!1}}function Kn(t,e){let r=t.product||"mk-fashion";return r==="ambos"||r===(e||"mk-fashion")}function Hn(t,e){let r=t.targeting||{};return!(Array.isArray(r.device)&&r.device.length&&r.device.indexOf(e.device)<0||r.audience==="new"&&e.returning||r.audience==="returning"&&!e.returning)}function Vn(t,e){let r=t.traffic==null?100:Number(t.traffic);return r>=100?!0:r<=0?!1:ee(e+"|"+t.id+"|t")*100<r}function Wn(t,e){let r=(t.variants||[]).filter(a=>a&&a.key),n=r.reduce((a,c)=>a+(Number(c.weight)||0),0);if(n<=0)return null;let o=ee(e+"|"+t.id)*n,i=0;for(let a=0;a<r.length;a++)if(i+=Number(r[a].weight)||0,o<i)return r[a];return r[r.length-1]}function Gn(t,e,r){let n="mk_exp_"+e+"_"+t.id,o=c=>(t.variants||[]).filter(l=>l&&l.key===c)[0]||null,i=null;try{i=localStorage.getItem(n)}catch(c){}if(i&&o(i))return o(i);let a=Wn(t,r);if(a)try{localStorage.setItem(n,a.key)}catch(c){}return a}function kt(t,e,r){if(nr)return;nr=!0;let n=t&&Array.isArray(t.experiments)?t.experiments:[];if(!n.length)return;let o=_t(),i={device:Un(),returning:$n()},a=n.filter(d=>d&&d.status==="running"&&Kn(d,r)&&Hn(d,i)&&Vn(d,o));if(!a.length){g("[A/B] "+n.length+" experimento(s) configurado(s); nenhum eleg\xEDvel p/ este visitante (status/targeting/tr\xE1fego/produto)");return}let c=a.filter(d=>d.coexist==="exclusive"),l;if(c.length){let d=Math.min(c.length-1,Math.floor(ee(o+"|excl")*c.length));l=[c[d]]}else l=a;for(let d=0;d<l.length;d++){let s=l[d],f=Gn(s,e||"",o);f&&G.push({exp:s.id,var:f.key,control:!!f.control,overrides:f.overrides||{}})}G.length&&g("[A/B] variante(s) ativa(s):",re())}function or(){return G.map(t=>({exp:t.exp,var:t.var}))}function re(){return G.map(t=>({exp:t.exp,variant:t.var,control:t.control,holdout:!!(t.overrides&&t.overrides.holdout)}))}function ir(){try{let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r&&(r.indexOf("mk_exp_")===0||r==="_mk_vid"||r==="_mk_seen")&&t.push(r)}t.forEach(e=>{try{localStorage.removeItem(e)}catch(r){}}),g("[A/B] reset \u2014 "+t.length+" chave(s) apagada(s); recarregando p/ re-sortear")}catch(t){}try{typeof location!="undefined"&&location.reload&&location.reload()}catch(t){}}function lt(){let t={holdout:!1,tryOnButton:null,modalWidth:null,modalHeight:null};for(let e=0;e<G.length;e++){let r=G[e];if(r.control)continue;let n=r.overrides||{};n.holdout&&(t.holdout=!0),n.tryOnButton&&(t.tryOnButton=n.tryOnButton),n.modalWidth&&(t.modalWidth=n.modalWidth),n.modalHeight&&(t.modalHeight=n.modalHeight)}return t}var ar=[/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],cr={imageUrl:1,image:1,thumbnail:1,photo:1,imageBase64:1,src:1},ne=2e3;function lr(t){for(let e=0;e<ar.length;e++)if(ar[e].test(t))return!0;return!1}function oe(t){if(!t||typeof t!="object"||Array.isArray(t))return typeof t=="string"&&t.length>ne?t.slice(0,200)+"...[truncated "+t.length+"B]":t;let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||lr(r))continue;let n=t[r];if(cr[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>ne){e[r]=n.slice(0,200)+"...[truncated "+n.length+"B]";continue}if(n&&typeof n=="object"&&!Array.isArray(n)){e[r]=Jn(n);continue}e[r]=n}return e}function Jn(t){let e={};for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||lr(r))continue;let n=t[r];if(cr[r]){e[r+"Present"]=!!n;continue}if(typeof n=="string"&&n.length>ne){e[r]=n.slice(0,200)+"...[truncated]";continue}e[r]=n}return e}var Ct=[],ie=null,X=null,ce="1.1.121",Xn=["off","pdp_tryon","pdp","all","tryon_engaged"],st,ae=null,Z="unknown",Y=[],J=null;function ur(){let t=w();return"mk_engaged_"+(t&&t.projectId||"")}function le(){if(J!==null)return J;try{J=localStorage.getItem(ur())==="1"}catch(t){J=!1}return J}function U(){if(!le()){J=!0;try{localStorage.setItem(ur(),"1")}catch(t){}St(!1)}}var Yn=/^purchase(_diag)?$/;function dr(t,e){if(st===void 0)return"hold";if(st==="off")return"drop";if(st==="all"||e&&Yn.test(e))return"collect";switch(st){case"pdp":return t==="pdp"?"collect":"drop";case"tryon_engaged":if(le())return"collect";case"pdp_tryon":return t!=="pdp"?"drop":Z==="available"?"collect":Z==="unavailable"?"drop":"hold";default:return"collect"}}function St(t){if(!Y.length)return;let e=[];for(let r of Y){let n=dr(r._pt,r.name);n==="collect"?mr(r.name,r.params,r.ts):n==="hold"&&!t&&e.push(r)}Y=e}function se(t){st=Xn.indexOf(t)>=0?t:"all",St(!1)}function fr(t){Z=t==="available"?"available":"unavailable",St(!1)}function pr(t){St(!0),X=t,ae=t&&t.pageType||null,Z="unknown"}function y(t,e,r){if(!w().projectId){(y._pre=y._pre||[]).push({name:t,params:e,ts:r||Date.now()}),y._pre.length>50&&y._pre.shift();return}if(y._pre&&y._pre.length){let o=y._pre;y._pre=[];for(let i of o)sr(i.name,i.params,i.ts)}sr(t,e,r)}function sr(t,e,r){let n=dr(ae,t);if(Zn(t,e,n),n==="collect"){mr(t,e,r);return}if(n==="drop"){g("descartado (escopo)",t);return}Y.push({name:t,params:e,ts:r||Date.now(),_pt:ae}),Y.length>300&&Y.shift()}function Zn(t,e,r){if(w().observe)try{window.postMessage({__mkpixel:!0,event:{name:"page_"+hr(t),params:oe(e||{})},site:X?{pageType:X.pageType,platform:X.platform,url:X.url}:null,gate:r},"*")}catch(o){}}function mr(t,e,r){let n=w(),o=oe(e||{}),i="page_"+hr(t);if(Ct.push({name:i,ts:r||Date.now(),params:o}),g("queued",t,o),Ct.length>=n.batchMaxSize){F();return}ie||(ie=setTimeout(()=>{ie=null,F()},n.batchIntervalMs))}function hr(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 F(t){if(Ct.length===0)return;let e=w();if(!e.projectId||!e.collectorUrl)return;let r=Ct.splice(0,50),n=Z==="available"?!0:Z==="unavailable"?!1:void 0,o=or(),i=JSON.stringify({product:e.product||void 0,sdkVersion:ce,experiments:o.length?o:void 0,visitorId:_t(),sessionId:rr(),engaged:le()||void 0,tryonAvailable:n,events:r,site:X||void 0}),a=e.collectorUrl+"/v1/track";try{fetch(a,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-MK-Project-Id":e.projectId},body:i}).catch(()=>{})}catch(c){try{navigator.sendBeacon&&navigator.sendBeacon(a+"?projectId="+encodeURIComponent(e.projectId),new Blob([i],{type:"text/plain"}))}catch(l){}}}function yr(){try{window.addEventListener("pagehide",()=>F(!0)),window.addEventListener("beforeunload",()=>F(!0)),document.addEventListener("visibilitychange",()=>{document.hidden&&F(!0)})}catch(t){}}function A(t){let e=[];try{let r=document.querySelectorAll('script[type="application/ld+json"]');for(let n of r){let o;try{o=JSON.parse(n.textContent)}catch(a){continue}let i=[];Array.isArray(o)?i.push(...o):o["@graph"]?i.push(...o["@graph"]):i.push(o);for(let a of i){if(!a||!a["@type"])continue;let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];(!t||t.some(l=>c.includes(l)))&&e.push(a)}}}catch(r){}return e}var gr=["off","pdp_tryon","pdp","all","tryon_engaged"],Qn="all",to=30*60*1e3,$=null;function Q(){if($)return $;let t=w();return!t.projectId||!t.apiUrl?($=Promise.resolve(null),$):($=fetch(t.apiUrl+"/projects/"+t.projectId).then(e=>{if(!e.ok)throw new Error("http "+e.status);return e.json()}).then(e=>e&&e.project||e||null).catch(()=>($=null,null)),$)}function wr(t){let e=t&&t.analytic&&t.analytic.scope;return gr.indexOf(e)>=0?e:Qn}var vr=t=>"mk_scope_"+t;function xr(t){try{let e=localStorage.getItem(vr(t));if(!e)return null;let r=JSON.parse(e);return!r||typeof r.exp!="number"||r.exp<Date.now()?null:gr.indexOf(r.scope)>=0?r.scope:null}catch(e){return null}}function br(t,e){try{localStorage.setItem(vr(t),JSON.stringify({scope:e,exp:Date.now()+to}))}catch(r){}}var fe={};C(fe,{addToCart:()=>yo,detect:()=>fo,getCartSummary:()=>mo,id:()=>lo,nativeTryonButton:()=>uo,openCartDrawer:()=>go,resolveSku:()=>po,skipRedirect:()=>so});var At={};C(At,{addToCart:()=>no,detect:()=>ro,getCartSummary:()=>de,id:()=>eo,openCartDrawer:()=>co,resolveSku:()=>ue});var eo="shopify";function ro(){return!!(window.Shopify||window.ShopifyAnalytics)}function ue(){let t=window;return t.ShopifyAnalytics&&t.ShopifyAnalytics.meta&&t.ShopifyAnalytics.meta.product?{value:String(t.ShopifyAnalytics.meta.product.id),source:"shopify"}:null}var Tt=t=>String(t==null?"":t).trim().toLowerCase();async function no({size:t,color:e,sku:r,quantity:n}){let o=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(!o)throw new Error("shopify: sem handle de produto na URL (n\xE3o \xE9 PDP?)");let a=(await fetch("/products/"+o+".js").then(p=>p.json())).variants||[],c=p=>[p.option1,p.option2,p.option3].concat(String(p.title||"").split("/")).map(Tt).filter(Boolean),l=(p,b)=>c(p).indexOf(Tt(b))>=0,d=p=>(!t||l(p,t))&&(!e||l(p,e)),s=null;if((t||e)&&(s=a.find(p=>d(p)&&p.available)||a.find(d)),!s&&r&&(s=a.find(p=>Tt(p.sku)===Tt(r))),s||(s=a.find(p=>p.available)||a[0]),!s)throw new Error("shopify: variante n\xE3o encontrada");let f=_r(),u=null;if(f&&typeof f.getSectionsToRender=="function")try{u=f.getSectionsToRender().map(p=>({id:p.id,selector:p.selector||"#"+p.id})).filter(p=>p.id)}catch(p){}let m={items:[{id:s.id,quantity:n||1}]};u&&u.length&&(m.sections=u.map(p=>p.id).join(","),m.sections_url=location.pathname);let h=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!h.ok)throw new Error("shopify: /cart/add.js HTTP "+h.status);let v=await h.json().catch(()=>({}));return f&&u&&v.sections&&oo(f,u,v.sections),{platform:"shopify",variantId:s.id,size:s.title,sku:s.sku||null}}function _r(){return document.querySelector("cart-drawer, cart-notification")}function oo(t,e,r){for(let n of e){let o=r[n.id];if(o)try{let i=null;if(typeof t.getSectionInnerHTML=="function")i=t.getSectionInnerHTML(o,n.selector);else{let c=new DOMParser().parseFromString(o,"text/html").querySelector(n.selector);i=c?c.innerHTML:null}let a=document.querySelector(n.selector);a&&i!=null&&(a.innerHTML=i)}catch(i){}}}async function de(){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 io=["[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 ao(t){try{let e=t.getBoundingClientRect();return e.width>0&&e.height>0&&getComputedStyle(t).visibility!=="hidden"}catch(e){return!1}}function co(){let t=_r();if(t&&typeof t.open=="function")return setTimeout(()=>{try{t.open()}catch(r){}},200),!0;let e=null;for(let r of io)try{if(e=[...document.querySelectorAll(r)].find(ao),e)break}catch(n){}return e?(setTimeout(()=>{try{e.click()}catch(r){}},300),!0):!1}var lo="zerezes",so=!0,uo={selector:"vto-gallery-button",inner:"button"};function fo(){try{if(!(window.Shopify||window.ShopifyAnalytics))return!1;let t=window.Shopify&&window.Shopify.shop||"";return/(^|\.)zerezes\./i.test(location.hostname)||/cs-zerezes/i.test(t)}catch(t){return!1}}var po=ue,mo=de;function ho(){let t=[...document.querySelectorAll(".lens-selection__button, [data-has-lens-basket]")];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}async function yo(){let t=ho();if(!t)throw new Error("zerezes: bot\xE3o de sele\xE7\xE3o de lentes n\xE3o encontrado");try{window.postMessage({source:"mkfashion-app",action:"close_request"},"*")}catch(e){}return setTimeout(()=>{try{t.click()}catch(e){}},250),{platform:"zerezes",nativeFlow:"lens-selection"}}function go(){return!0}var me={};C(me,{addToCart:()=>bo,detect:()=>vo,getCartSummary:()=>_o,id:()=>wo,resolveSku:()=>xo});var wo="hybris";function vo(){return!!(window.ACC&&window.ACC.config)}function xo(){let t=(location.pathname||"").match(/\/p\/([^/?#]+)/);return t&&t[1]?{value:decodeURIComponent(t[1]),source:"hybris/url"}:null}var kr=t=>String(t==null?"":t).trim().toLowerCase();async function bo({size:t,quantity:e}){let r=[...document.querySelectorAll('.js-product-select-size, a[data-code], [class*="select-size"]')].filter(m=>m.getAttribute&&m.getAttribute("data-code")),n=t?r.find(m=>kr(m.textContent)===kr(t)):null;n||(n=r.find(m=>m.offsetParent!==null)||r[0]);let o=n&&n.getAttribute("data-code");if(!o)throw new Error("hybris: variante (data-code) n\xE3o encontrada");let i=document.getElementById("product--add-to-cart-form")||document.querySelector('form[action*="/cart/add"]'),a=i&&i.querySelector('[name="CSRFToken"]'),c=a&&a.value,l=i&&i.getAttribute("action")||"/cart/add";if(!c)throw new Error("hybris: CSRFToken n\xE3o encontrado");let d=new URLSearchParams;d.set("productCodePost",o),d.set("qty",String(e||1)),d.set("CSRFToken",c);let s=await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:d.toString()});if(!s.ok)throw new Error("hybris: "+l+" HTTP "+s.status);let f=null,u=null;try{let m=await s.clone().json(),h=m&&m.cartData;h&&(f=pe(h.total!=null?h.total:h.totalPrice),u=h.totalUnitCount!=null?Number(h.totalUnitCount):Array.isArray(h.products)?h.products.length:null)}catch(m){}return{platform:"hybris",productCode:o,size:n.textContent.trim(),cartValue:f,itemCount:u,currency:"BRL"}}function pe(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 _o(){try{let t=await fetch("/cart/async?nocache="+Date.now(),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(a=>a.ok?a.text():"");if(!t)return null;let e=new DOMParser().parseFromString(t,"text/html"),r=e.querySelector(".minicart-total .price")||e.querySelector(".floating-cart--cart-total"),n=r?pe(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&&pe(r.textContent);if(n)return{value:n,itemCount:null,currency:"BRL"}}}catch(t){}return null}var he={};C(he,{addToCart:()=>Po,addToCartBatch:()=>Mo,detect:()=>Co,getCartSummary:()=>Er,getFsCartStore:()=>Rt,id:()=>ko,openCartDrawer:()=>Ao,resolveSku:()=>Lt,resolveSkuCandidates:()=>So});var ko="vtex";function Co(){return!!(window.vtex||window.vtexjs||window.vtxctx||window.skuJson_0||window.__RUNTIME__||window.vtexaf||document.querySelector('link[href*="vtexassets"], script[src*="vtexassets"], link[href*="vteximg"], script[src*="vteximg"], img[src*="vteximg"]'))}function Lt(){let t=window;if(t.vtxctx&&t.vtxctx.skus&&t.vtxctx.skus[0])return{value:String(t.vtxctx.skus[0]),source:"vtex/vtxctx"};if(t.skuJson_0&&t.skuJson_0.skus&&t.skuJson_0.skus[0])return{value:String(t.skuJson_0.skus[0].sku),source:"vtex/skuJson"};try{let e=document.querySelector('meta[property="product:sku"]'),r=e&&(e.getAttribute("content")||"").trim();if(r)return{value:String(r),source:"vtex/og-sku"}}catch(e){}return null}function So(){let t=[],e=To();e&&t.push({value:e,source:"vtex/productReference"});let r=Lt();return r&&r.value&&r.value!==e&&t.push(r),t}var Et={path:null,value:null};function To(){try{if(Et.path===location.pathname&&Et.value)return Et.value;let t=(location.pathname.match(/^\/([^/]+)\/p/)||[])[1];if(!t)return null;let e=Pt(function(r){let n=r&&r.product;if(!n||n.linkText!==t)return null;let o=n.productReference;return typeof o=="string"&&o.trim()?o.trim():null});return e&&(Et={path:location.pathname,value:e}),e||null}catch(t){return null}}var It=t=>String(t==null?"":t).trim().toLowerCase(),I;function Rt(){if(I!==void 0)return I;I=null;try{let t=Object.keys(window).find(o=>/^webpackChunk/.test(o));if(!t||!window[t]||typeof window[t].push!="function")return I;let e=null;try{window[t].push([["mk-cart-"+Math.random().toString(36).slice(2)],{},o=>{e=o}])}catch(o){}if(!e||!e.m)return I;let r=null;for(let o in e.m)try{let i=e.m[o].toString();if(i.indexOf("cart-storage")>=0&&i.indexOf("addToCart")>=0&&i.indexOf("toggleCart")>=0){r=o;break}}catch(i){}if(r==null)return I;let n=e(r);for(let o in n)try{let i=n[o];if(typeof i=="function"&&typeof i.getState=="function"){let a=i.getState();if(a&&typeof a.addToCart=="function"&&Array.isArray(a.items)){I=i;break}}}catch(i){}}catch(t){I=null}return I}function Cr(t){try{let e=t&&t.totalizers||[];if(!e.length)return null;let r=e.reduce((n,o)=>n+(Number(o&&o.value)||0),0);return r>0?r/100:null}catch(e){return null}}async function Sr(t,e){let r=Rt();if(!r)return null;let n=(Array.isArray(t)?t:[t]).map(l=>String(l)).filter(Boolean);if(!n.length||typeof r.getState().addToCart!="function")return null;let i=!1;for(let l=0;l<n.length;l++){let d=l===n.length-1;try{await r.getState().addToCart({id:n[l],seller:"1"},"mk-tryon",e||1,d),i=!0}catch(s){}}if(!i)return null;let a=r.getState(),c=(a.items||[]).reduce((l,d)=>l+(Number(d&&d.quantity)||1),0);return{platform:"vtex",skuId:n.join(","),itemCount:c||null,cartValue:Cr(a),currency:a.currencyCode||"BRL",drawerHandled:!0}}function Ao(){try{let e=Rt();if(e){let r=e.getState();if(r&&r.cartOpen)return!0;if(typeof e.setState=="function")return e.setState({cartOpen:!0}),!0;if(r&&typeof r.toggleCart=="function")return r.toggleCart(),!0}}catch(e){}let t=['[data-testid="cart-toggle"]','button[aria-label="Abrir carrinho de compras"]','[class*="minicart" i] button','button[class*="minicart" i]','[class*="miniCart" i] button',".vtexsc-cart",".fn-minicart","#header-cart",'[class*="cartIcon" i]','[aria-label*="carrinho" i]','[aria-label*="sacola" i]','[data-testid*="cart" i] button'];for(let e of t)try{let r=document.querySelector(e);if(r)return r.click(),!0}catch(r){}return!1}async function Tr(t,e){let r=Array.isArray(t)?t:[t],n=r.map(f=>({id:parseInt(f,10),quantity:e||1,seller:"1"})).filter(f=>Number.isFinite(f.id));if(!n.length)throw new Error("vtex: nenhum skuId v\xE1lido");let o=location.origin,i=await fetch(o+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(f=>f.json()),a=i&&i.orderFormId;if(!a)throw new Error("vtex: orderFormId indispon\xEDvel");let c=await fetch(o+"/api/checkout/pub/orderForm/"+encodeURIComponent(a)+"/items",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"include",body:JSON.stringify({orderItems:n})}).then(f=>f.json()),l=c&&typeof c.value=="number"?c.value/100:null,d=Array.isArray(c&&c.items)?c.items.reduce((f,u)=>f+(Number(u.quantity)||1),0):null,s=c&&c.storePreferencesData&&c.storePreferencesData.currencyCode||"BRL";return{platform:"vtex",skuId:r.map(String).join(","),cartValue:l,itemCount:d,currency:s}}function Pt(t){try{var e=function(f){if(!f)return null;for(var u in f)if(u.indexOf("__reactFiber$")===0)return f[u];return null},r=document.querySelector('[class*="add-to-cart-button" i]')||document.querySelector('[class*="minicart" i]')||document.querySelector('[class*="product" i]')||document.body,n=e(r);if(!n)for(var o=document.querySelectorAll("div,button"),i=0;i<o.length&&i<3e3&&!n;i++)n=e(o[i]);if(!n)return null;for(var a=n;a&&a.return;)a=a.return;var c=null,l=new Set,d=0,s=function(f){if(!(!f||l.has(f)||d>3e4||c!=null)){l.add(f),d++;try{var u=[];f.memoizedProps&&(u.push(f.memoizedProps),f.memoizedProps.value&&u.push(f.memoizedProps.value));for(var m=f.memoizedState,h=0;m&&h<40;)m.memoizedState&&typeof m.memoizedState=="object"&&u.push(m.memoizedState),m=m.next,h++;for(var v=0;v<u.length;v++){var p=t(u[v]);if(p!=null){c=p;return}}}catch(b){}s(f.child),s(f.sibling)}};return s(a),c}catch(f){return null}}function Eo(){return Pt(function(t){return t&&typeof t.addItems=="function"?t.addItems:null})}var Io=t=>/^\d+$/.test(String(t==null?"":t).trim());function Lo(){var t=(location.pathname.match(/^\/([^/]+)\/p/)||[])[1];return t?Pt(function(e){var r=e&&e.product;if(!r||r.linkText!==t)return null;var n=Array.isArray(r.items)&&r.items[0];return n&&n.itemId?String(n.itemId):null}):null}function Ro(t){if(!t)return null;var e=String(t).trim().toLowerCase(),r=function(i){var a=(i.variations||[]).find(function(c){return/tamanho|size|talla/i.test(c.name||"")});return a?String((a.values||[])[0]||"").trim().toLowerCase():null},n=Pt(function(i){return i&&i.product&&Array.isArray(i.product.items)&&i.product.items[0]&&i.product.items[0].itemId&&Array.isArray(i.product.items[0].variations)?i.product.items:null});if(!n)return null;var o=n.find(function(i){return r(i)===e});return o?String(o.itemId):null}async function Ar(t,e){var r=Eo();if(typeof r!="function")return null;var n=(Array.isArray(t)?t:[t]).map(i=>({id:String(i),quantity:e||1,seller:"1"})).filter(i=>i.id);if(!n.length)return null;try{r(n)}catch(i){return null}await new Promise(i=>setTimeout(i,600));let o=null;try{o=await Er()}catch(i){}return{platform:"vtex",skuId:n.map(i=>i.id).join(","),cartValue:o?o.value:null,itemCount:o?o.itemCount:null,currency:o&&o.currency||"BRL"}}async function Po(t){t=t||{};let{size:e,sku:r,quantity:n}=t,o=window.skuJson_0&&window.skuJson_0.skus||[];if(o.length&&window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart){let l=s=>It(s.skuname)===It(e)||s.dimensions&&Object.values(s.dimensions).some(f=>It(f)===It(e)),d=e?o.find(s=>l(s)&&s.available)||o.find(l):null;if(d||(d=o.find(s=>s.available)||o[0]),!d)throw new Error("vtex: variante n\xE3o encontrada");return await window.vtexjs.checkout.addToCart([{id:parseInt(d.sku,10),quantity:n||1,seller:"1"}]),{platform:"vtex",skuId:d.sku,size:d.skuname||e}}let i=e&&Ro(e)||(Io(r)?String(r).trim():null)||(Lt()||{}).value||Lo()||null;if(!i)throw new Error("vtex: skuId n\xE3o resolvido (IO)");let a=await Sr(i,n);if(a)return a;let c=await Ar(i,n);return c||Tr(i,n)}async function Mo(t){let e=(t||[]).map(o=>o&&(o.sku||(Lt()||{}).value)).filter(Boolean);if(!e.length)throw new Error("vtex: nenhum skuId pro batch");let r=await Sr(e,1);if(r)return Object.assign({count:e.length},r);let n=await Ar(e,1);return n?Object.assign({count:e.length},n):window.skuJson_0&&window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.addToCart?(await window.vtexjs.checkout.addToCart(e.map(o=>({id:parseInt(o,10),quantity:1,seller:"1"}))),{platform:"vtex",count:e.length}):Tr(e,1)}async function Er(){try{let t=Rt();if(t){let e=t.getState(),r=Cr(e),n=(e.items||[]).reduce((o,i)=>o+(Number(i&&i.quantity)||1),0);if(r!=null||n)return{value:r,itemCount:n,currency:e.currencyCode||"BRL"}}}catch(t){}try{let t=window.vtexjs&&window.vtexjs.checkout&&window.vtexjs.checkout.orderForm;if(t&&typeof t.value=="number"){let e=t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL",r=(t.items||[]).reduce((n,o)=>n+(Number(o.quantity)||1),0);return{value:t.value/100,itemCount:r,currency:e}}}catch(t){}try{let t=await fetch(location.origin+"/api/checkout/pub/orderForm",{headers:{accept:"application/json"},credentials:"include"}).then(e=>e.json());if(t&&typeof t.value=="number"){let e=(t.items||[]).reduce((r,n)=>r+(Number(n.quantity)||1),0);return{value:t.value/100,itemCount:e,currency:t.storePreferencesData&&t.storePreferencesData.currencyCode||"BRL"}}}catch(t){}return null}var ye={};C(ye,{addToCart:()=>qo,detect:()=>Bo,getCartSummary:()=>Do,id:()=>Oo,openCartDrawer:()=>No,resolveSku:()=>zo,skipRedirect:()=>jo});var Oo="nuvemshop",jo=!0;function Bo(){return!!(window.LS&&(window.LS.cart||window.LS.addToCart))}function zo(){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 Mt=t=>String(t==null?"":t).trim().toLowerCase();async function qo({size:t,quantity:e,productId:r}){if(r&&!document.getElementById("product_form")){let c=String(r).replace(/["\\]/g,""),l=document.querySelector('[data-product-id="'+c+'"]'),d=l&&l.querySelector("form[action]"),s=d&&d.getAttribute("action")||"/comprar/",f=window.LS;if(f&&typeof f.addToCartEnhanced=="function")try{let h=document.createElement("form");h.setAttribute("action",s),h.setAttribute("method","post");let v=document.createElement("input");return v.type="hidden",v.name="add_to_cart",v.value=c,h.appendChild(v),document.body.appendChild(h),f.addToCartEnhanced(h),setTimeout(()=>{try{h.remove()}catch(p){}},3e3),{platform:"nuvemshop",productId:c,via:"gallery-enhanced"}}catch(h){}let u=!1,m=null;try{let v=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:"add_to_cart="+encodeURIComponent(c)+"&quantity="+(e||1)})).json().catch(()=>({}));u=!!v.success,m=v.error_code||null}catch(h){}return{platform:"nuvemshop",productId:c,via:"gallery",added:u,reason:m}}let n=document.getElementById("product_form")||document.querySelector('.js-product-form, form[action*="/comprar"]');if(!n)throw new Error("nuvemshop: #product_form n\xE3o encontrado");t&&n.querySelectorAll('select[name^="variation"]').forEach(c=>{let l=[...c.options].find(d=>Mt(d.textContent).includes(Mt(t))||Mt(d.value)===Mt(t));l&&(c.value=l.value,c.dispatchEvent(new Event("change",{bubbles:!0})))});let o=n.querySelector('[name="quantity"]');o&&e&&(o.value=String(e)),await new Promise(c=>setTimeout(c,400));let i=n.querySelector(".js-addtocart")||document.querySelector(".js-addtocart");return i?i.click():typeof n.requestSubmit=="function"?n.requestSubmit():n.submit(),await new Promise(c=>setTimeout(c,1200)),{platform:"nuvemshop",variantId:(n.querySelector('[name="variant_id"]')||{}).value||null}}function No(){try{if([...document.querySelectorAll('#ajax-cart-details, .modal-cart, [class*="cart-modal" i], [class*="modal-cart" i]')].find(o=>{try{return o.getBoundingClientRect().width>0&&getComputedStyle(o).display!=="none"}catch(i){return!1}}))return!0;let r=[...document.querySelectorAll('[data-toggle="#modal-cart"], [data-toggle*="cart" i], #ajax-cart a.js-modal-open, .cart-summary a.js-modal-open, .js-toggle-cart')],n=r.find(o=>{let i=o.getBoundingClientRect();return i.width>0&&i.height>0})||r[0];if(n)return setTimeout(()=>{try{n.click()}catch(o){}},300),!0;if(window.LS&&typeof window.LS.toggleCart=="function")return setTimeout(()=>{try{window.LS.toggleCart()}catch(o){}},300),!0}catch(t){}return!1}function Do(){try{let t=window.LS,e=t&&t.cart;if(!e)return null;let r=t.currency&&t.currency.code||"BRL",n=Array.isArray(e.items)?e.items.reduce((i,a)=>i+(Number(a.quantity)||1),0):Number(e.items)||0,o=e.subtotal!=null?Number(e.subtotal):null;return{value:o!=null?o/100:null,itemCount:n,currency:r}}catch(t){return null}}var ge={};C(ge,{addToCart:()=>Wo,detect:()=>$o,getCartSummary:()=>Go,id:()=>Fo,openCartDrawer:()=>Xo,resolveSizes:()=>Vo,resolveSku:()=>Ko,skipRedirect:()=>Uo});var Fo="wake",Uo=!0;function $o(){return!!(window.StorefrontClient||typeof window.addOrCreateCheckout=="function"||typeof window.addToCartClick=="function")}function Ko(){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 Ir=t=>String(t==null?"":t).trim().toLowerCase(),Ho=t=>/^\d{1,3}([.,]\d)?$/.test(t)||/^(PP|P|M|G|GG|XG|XGG|XXG|EG|EGG|UN|U)$/i.test(t);function Vo(){try{let t=[];for(let e of document.querySelectorAll("input[attribute-value]")){if(e.disabled)continue;let r=String(e.getAttribute("attribute-value")||"").trim();r&&Ho(r)&&!t.includes(r)&&t.push(r)}return t}catch(t){return[]}}var Ot=()=>{var t,e;return((t=document.querySelector("[add-to-cart-button]"))==null?void 0:t.value)||((e=document.querySelector('[name="product-variant-id"]'))==null?void 0:e.value)||null};async function Wo({size:t,quantity:e}){let r=null;if(t){let o=[...document.querySelectorAll("input[attribute-value]")].find(i=>Ir(i.getAttribute("attribute-value"))===Ir(t));if(o){let i=Ot();try{o.checked=!0}catch(a){}try{typeof window.selectAttribute=="function"?window.selectAttribute(o):o.click()}catch(a){}for(let a=0;a<12;a++){await new Promise(l=>setTimeout(l,250));let c=Ot();if(c&&/^\d+$/.test(c)&&c!==i){r=c;break}}r||(r=Ot())}}if(r||(r=Ot()),!r)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(r),quantity:e||1,customization:[]}]))throw new Error("wake: addOrCreateCheckout retornou false");return{platform:"wake",productVariantId:r,size:t||null}}function Lr(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 Go(){try{let t=()=>{let o=document.querySelector(".mc-subtotal__value")||document.querySelector(".mc-subtotal");return o?Lr(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=Jo());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 Jo(){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=Lr(r);if(n)return n}}}catch(t){}return null}function Xo(){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 xe={};C(xe,{addToCart:()=>ei,cartUrl:()=>Qo,detect:()=>ti,getCartSummary:()=>ri,id:()=>Yo,openCartDrawer:()=>ni,skipRedirect:()=>Zo});var we="/api/v2/front",ve={"Content-Type":"application/json",Accept:"application/json","App-Token":"wapstore"},Rr=t=>String(t==null?"":t).trim().toLowerCase(),Yo="wapstore",Zo=!0,Qo="/checkout/carrinho";function ti(){try{if(document.querySelector('script[src*="/tema/"][src*="/dist/assets/"]')||/(?:^|;\s*)produto\/visitado=/.test(document.cookie))return!0}catch(t){}return!1}function Pr(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 ei({size:t,quantity:e}){let r=await fetch(we+"/url/product/detail?url="+encodeURIComponent(location.pathname),{headers:ve}).then(u=>u.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(u=>Rr(u.label)===Rr(t)):null;i=i||o.find(u=>u.selecionado)||o.find(u=>(u.estoque||0)>0)||o[0];let a=i&&i.carrinho;if(!a||!a.itens||!a.itens.length)throw new Error("wapstore: variante sem payload de carrinho");let c=a.itens.map(u=>Object.assign({},u,{quantidade:String(e||u.quantidade||1)})),l=await fetch(we+"/checkout/cart",{method:"POST",headers:ve,body:JSON.stringify({itens:c,tipo:a.tipo||"produto"})});if(!l.ok)throw new Error("wapstore: add HTTP "+l.status);let d=await l.json().catch(()=>({})),s=Pr(d),f={platform:"wapstore",idProduto:c[0]&&c[0].idProduto,size:i&&i.label||null};return s&&(f.cartValue=s.value,f.itemCount=s.itemCount,f.currency=s.currency),f}async function ri(){try{let t=await fetch(we+"/checkout/cart",{headers:ve}).then(e=>e.json());return Pr(t)}catch(t){}return null}function ni(){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 be={};C(be,{addToCart:()=>di,detect:()=>ci,getCartSummary:()=>fi,id:()=>oi,openCartDrawer:()=>pi,resolveSku:()=>li,skipRedirect:()=>ii});var Mr=t=>String(t==null?"":t).trim().toLowerCase(),oi="linx",ii=!0;function ai(t){if(t==null)return null;let e=String(t).match(/([\d.]+,\d{2}|\d+(?:\.\d{2})?)/),r=(e?e[1]:String(t)).replace(/[^\d.,]/g,"");if(!r)return null;let n=r.indexOf(",")>r.indexOf(".")?parseFloat(r.replace(/\./g,"").replace(",",".")):parseFloat(r.replace(/,/g,""));return Number.isFinite(n)&&n>0?n:null}function ci(){return typeof window.carrinhoLateral=="function"&&typeof window.addToCart=="function"}function li(){try{let t=(location.pathname.match(/-p(\d+)\/?(?:[?#]|$)/)||[])[1];if(t)return{value:t,source:"linx/url-pid"};let e=(String(document.body.className||"").match(/context-product-(\d+)/)||[])[1];if(e)return{value:e,source:"linx/context"}}catch(t){}return null}function si(){let t=[...document.querySelectorAll('.add-to-cart, [data-action="add-to-cart"]')];return t.find(e=>{let r=e.getBoundingClientRect();return r.width>0&&r.height>0})||t[0]||null}function ui(t){if(t==null||t==="")return!1;let e=Mr(t),r=e.replace(/\D/g,""),n=[...document.querySelectorAll('input[type="radio"]')].filter(i=>/aro|tamanho|grade|numera|size|variant/i.test(i.name||i.id||"")),o=n.find(i=>Mr(i.value)===e)||(r?n.find(i=>String(i.value).replace(/\D/g,"")===r):null);if(!o)return!1;try{o.checked||(o.checked=!0),(o.labels&&o.labels[0]||null||o).click(),o.dispatchEvent(new Event("change",{bubbles:!0}))}catch(i){}return!0}async function di(t){t=t||{};let e=si();if(!e)throw new Error("linx: bot\xE3o .add-to-cart n\xE3o encontrado");return t.size!=null&&t.size!==""&&(ui(t.size),await new Promise(r=>setTimeout(r,1100))),e.click(),await new Promise(r=>setTimeout(r,1400)),{platform:"linx"}}function fi(){try{let t=document.querySelector("#mini-cart");if(!t)return null;let e=null;for(let n of t.querySelectorAll("div,span,p,li,strong,b,td")){if(n.children.length>2)continue;let o=(n.textContent||"").replace(/\s+/g," ").trim();if(/^(sub)?total\b/i.test(o)&&/R\$/.test(o)&&(e=ai(o),e))break}if(e==null)return null;let r=(t.textContent||"").match(/cont[ée]m\s+(\d+)\s+ite/i);return{value:e,itemCount:r?parseInt(r[1],10):null,currency:"BRL"}}catch(t){}return null}function pi(){try{let e=typeof window.carrinhoLateral=="function"?window.carrinhoLateral():null;if(e&&typeof e.openCart=="function"){try{typeof e.fetchHTML=="function"&&e.fetchHTML()}catch(r){}return setTimeout(()=>{try{e.openCart()}catch(r){}},400),!0}}catch(e){}let t=document.querySelector("#mini-cart");if(t){try{t.classList.add("open")}catch(e){}return!0}return!1}var ke={};C(ke,{addToCart:()=>vi,cartUrl:()=>yi,detect:()=>gi,getCartSummary:()=>xi,id:()=>mi,openCartDrawer:()=>Ai,resolveOrder:()=>Si,resolveSku:()=>Or,skipRedirect:()=>hi});var mi="magazord",hi=!0,yi="/checkout/cart";function gi(){try{if(document.querySelector('script[src*="zordcdn.com.br"], script[src*="magazord.com.br"], link[href*="magazord.com.br"]'))return!0}catch(t){}return!1}function Or(){try{let n=(window.dataLayer||[]).filter(o=>o&&o.PageType==="ProductPage"&&o.sku).pop();if(n&&n.sku)return{value:String(n.sku),source:"magazord/dataLayer"}}catch(n){}let e=A(["Product"])[0],r=e&&(e.sku||e.mpn||e.productID);return r?{value:String(r),source:"jsonld"}:null}function _e(t){let e=[];try{t.querySelectorAll('a[href*="/checkout/cart"], a[href*="/carrinho"]').forEach(r=>{let n=Array.from(r.querySelectorAll("*")).find(o=>o.children.length===0&&/^\d+$/.test((o.textContent||"").trim()));n&&e.push(n)})}catch(r){}return e}function wi(t){let e=t||1;_e(document).forEach(r=>{r.textContent=String((parseInt(r.textContent.trim(),10)||0)+e)}),fetch("/checkout/cart").then(r=>r.ok?r.text():null).then(r=>{if(!r)return;let n=new DOMParser().parseFromString(r,"text/html"),o=_e(n);if(!o.length)return;let i=parseInt(o[0].textContent.trim(),10);isNaN(i)||_e(document).forEach(a=>{a.textContent=String(i)})}).catch(()=>{})}async function vi({sku:t,quantity:e}){let r=t||(Or()||{}).value;if(!r)throw new Error("magazord: sku n\xE3o resolvido");let n=new URLSearchParams;n.set("produtos[0][codigo]",r),n.set("produtos[0][quantidade]",String(e||1)),n.set("produtos[0][deposito]","1"),n.set("source[source]","Produto"),n.set("source[codigoOrigem]","");let o=await fetch("/checkout/cart?operation=AddMultiples",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest",Accept:"application/json, text/javascript, */*"},body:n.toString()});if(!o.ok)throw new Error("magazord: add HTTP "+o.status);let i=(await o.text()).trim();if(i==="false"||/erro|error|indispon/i.test(i))throw new Error("magazord: add rejeitado ("+i.slice(0,60)+")");try{wi(e||1)}catch(a){}return{platform:"magazord",skuId:r}}async function xi(){try{let t=document;if(!/\/checkout\/cart/i.test(location.pathname||"")){let a=await fetch("/checkout/cart",{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!a.ok)return null;t=new DOMParser().parseFromString(await a.text(),"text/html")}let e=bi(t),r=e.reduce((a,c)=>a+(parseInt(c.quantity,10)||0),0)||null,n=ki(t),o=e.reduce((a,c)=>a+(Number(c.price)||0)*(parseInt(c.quantity,10)||1),0),i=n!=null?n:o>0?o:null;return i==null&&!r?null:{value:i,itemCount:r,currency:"BRL"}}catch(t){return null}}function bi(t){try{if(t===document&&Array.isArray(window.dataLayer)){let r=window.dataLayer.filter(n=>n&&Array.isArray(n.cartItems)).pop();if(r)return r.cartItems}let e=t.querySelectorAll("script:not([src])");for(let r=0;r<e.length;r++){let n=e[r].textContent||"",o=n.indexOf('"cartItems"');if(o<0)continue;let i=_i(n,o);if(i)return i}}catch(e){}return[]}function _i(t,e){let r=t.indexOf("[",e);if(r<0)return null;let n=0,o=!1,i=!1;for(let a=r;a<t.length;a++){let c=t[a];if(o)i?i=!1:c==="\\"?i=!0:c==='"'&&(o=!1);else if(c==='"')o=!0;else if(c==="[")n++;else if(c==="]"&&--n===0)try{return JSON.parse(t.slice(r,a+1))}catch(l){return null}}return null}function ki(t){let e=[".value-content .value",".cart-total .value",".resumo-carrinho .total",'[class*="valor-total" i]'];for(let r=0;r<e.length;r++)try{let n=t.querySelector(e[r]);if(n){let o=Ci(n.textContent);if(o)return o}}catch(n){}return null}function Ci(t){if(!t)return null;let e=String(t).replace(/[^\d.,]/g,"");if(!e)return null;let r=e.indexOf(",")>e.indexOf(".")?e.replace(/\./g,"").replace(",","."):e.replace(/,/g,""),n=parseFloat(r);return Number.isFinite(n)&&n>0?n:null}function Si(){try{let t=null;try{let n=document.documentElement.outerHTML.match(/["']transaction_?id["']\s*:\s*["']?([\w-]{4,})["']?/i);n&&(t=n[1])}catch(n){}let e=[".total-wrapper .valor",".valor-detalhe",".item-purchase .value",".value-content .value",'[class*="total-wrapper" i] .valor','[class*="valor-total" i]','[class*="total-pedido" i]'],r=null;for(let n=0;n<e.length;n++)try{document.querySelectorAll(e[n]).forEach(o=>{let i=Ti(o.textContent);i!=null&&i<1e7&&(r==null||i>r)&&(r=i)})}catch(o){}return r==null&&!t?null:{orderId:t||null,revenue:r,currency:"BRL",source:"magazord"}}catch(t){return null}}function Ti(t){let e=String(t||"").match(/(\d{1,3}(?:\.\d{3})*|\d+),(\d{2})(?!\d)/);if(!e)return null;let r=parseFloat(e[1].replace(/\./g,"")+"."+e[2]);return Number.isFinite(r)&&r>0?r:null}function Ai(){try{let t=document.querySelector('[class*="carrinho-rapido" i], .side-cart, [class*="mini-cart" i]');if(t&&t.getBoundingClientRect().width>0)return!0;let e=document.querySelector('a[href*="/checkout/cart"], [class*="carrinho-rapido" i] a, [class*="header" i] [class*="cart" i] a, .button-cart');if(e)return e.click(),!0}catch(t){}return!1}var Se={};C(Se,{addToCart:()=>K,detect:()=>Ii,id:()=>Ei,resolveSku:()=>Ce});var Ei="generic";function Ii(){return!0}function Ce(){let t=A(["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 Li=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora/i,Ri=/continuar|como comprar|lista|desejos|favorito/i;async function K(){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&&Li.test(r)&&!Ri.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 jr=[fe,At,me,he,ye,ge,xe,be,ke],Pi=[["woocommerce",()=>!!(window.wc_add_to_cart_params||window.woocommerce_params)],["lojaintegrada",()=>!!window.LojaIntegrada]],Te;function S(){if(Te)return Te;let t=jr.find(e=>{try{return e.detect()}catch(r){return!1}});return t&&(Te=t),t||Se}function Br(){let t=jr.find(e=>{try{return e.detect()}catch(r){return!1}});if(t)return t.id;for(let[e,r]of Pi)try{if(r())return e}catch(n){}return null}function j(){let t=S();if(t.id!=="generic"&&t.resolveSku){try{let e=t.resolveSku();if(e)return e}catch(e){}if(t.id==="vtex"&&window.__RUNTIME__)return{value:null,source:"vtex/pending"}}return Ce()}function Ee(){let t=S();if(t.id!=="generic"&&typeof t.resolveSkuCandidates=="function")try{let r=t.resolveSkuCandidates();if(Array.isArray(r)&&r.length)return r.filter(n=>n&&n.value)}catch(r){}let e=j();return e&&e.value?[e]:[]}function zr(){let t=S();return t&&t.nativeTryonButton||null}function qr(){let t=S();if(t&&typeof t.resolveSizes=="function")try{let e=t.resolveSizes();if(Array.isArray(e))return e}catch(e){}return[]}function Nr(t){return t=t||{},{size:t.size||t.selectedSize||t.tamanho||t.aro||t.ringSize||null,color:t.color||t.selectedColor||t.colour||t.cor||null,sku:t.sku||t.identifier||t.selectedIdentifier||null,quantity:t.quantity||1,productId:t.productId||null}}async function Dr(t){if(t=t||{},Array.isArray(t.items)&&t.items.length)return Mi(t.items);let e=Nr(t),r=S();try{let n=r.addToCart?await r.addToCart(e):await K(e);return g("cart: adicionado",n),jt(),Ae(r,n,e.sku),n}catch(n){g('cart: adapter "'+r.id+'" falhou \u2014 fallback clique nativo',n&&n.message);let o=await K(e);return jt(),Ae(r,o,e.sku),o}}async function Mi(t){let e=t.map(Nr),r=S(),n=null;try{if(r.addToCartBatch)n=await r.addToCartBatch(e);else for(let o of e)try{n=r.addToCart?await r.addToCart(o):await K(o)}catch(i){}}catch(o){g('cart: batch do adapter "'+r.id+'" falhou \u2014 fallback',o&&o.message);for(let i of e)try{n=await K(i)}catch(a){}}return g("cart: "+e.length+" itens adicionados",n),jt(),Ae(r,n,null),n}async function Ae(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)&&y("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 Ie(){let t=S();if(t&&t.getCartSummary)try{return await t.getCartSummary()}catch(e){}return null}async function Fr(t){t=t||{};let e=S(),r={platform:e.id};try{let n=j();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 K(o),jt();try{await Le()}catch(i){}r.cart=await Ie(),r.ok=!0}catch(n){r.ok=!1,r.error=n&&n.message||String(n)}return r}function jt(){["cart:refresh","cart:updated","cart:build","ajaxProduct:added","product:added-to-cart"].forEach(t=>{try{document.dispatchEvent(new CustomEvent(t))}catch(e){}})}async function Le(t){if(t&&t.drawerHandled)return!1;let e=S(),r=w(),n=null;try{n=await Q()}catch(a){}let o=n&&n.template&&n.template.cart||n&&n.cart||{},i=o.afterAdd||o.behavior||r.cartBehavior;if(i||(i=r.cartRedirect===!1?"none":"auto"),i==="none")return!1;if(i==="auto"||i==="drawer"){let a=o.openSelector||r.cartOpenSelector;if(a){let c=document.querySelector(a);if(c)return setTimeout(()=>{try{c.click()}catch(l){}},300),!1}else if(e&&e.openCartDrawer){let c=!1;try{c=e.openCartDrawer()}catch(l){}if(c)return!1}}return!0}function Ur(){let t=S();if(t&&t.skipRedirect)return;let e=t&&t.cartUrl||"/cart";setTimeout(()=>{try{window.location.href=e}catch(r){}},250)}var Oi=/\/(thank[_-]?you|orders?\/|pedido[_-]?(confirmado|realizado|finalizado|sucesso)|sucesso|order[_-]?confirmation|compra[_-]?(finalizada|concluida)|orderplaced|checkout\/[^?#]*success)/i,ji=/\/(my[_-]?account|minha[_-]?conta|account|conta|customer|cliente|profile|perfil|wishlist|favoritos)(\/|$)/i,Bi=/\/checkout/i,zi=/\/checkout\/(cart|carrinho|sacola|basket|bag)(\/|$|\?|#)/i,qi=/\/checkout\/(done|sucesso|obrigado|confirmacao|concluido|finalizado|thank[_-]?you)(\/|$|\?|#)/i,Ni=/\/(cart|carrinho|sacola|bag|comprar)(\/|$|\?|#)/i,$r=/\/(products?|produtos?|p)(\/|$|\?|#)/i,Di=/\/(collections?|categoria|categorias|c|departamento)\//i,Fi=/\/(search|busca|s)(\/|\?)/i;function Kr(){try{if(window.__mkPageType)return window.__mkPageType}catch(r){}let t=(location.pathname||"").toLowerCase(),e=ji.test(t);try{let r=A(),n=0,o=!1,i=!1;for(let a of r){let c=Array.isArray(a["@type"])?a["@type"]:[a["@type"]];if((c.includes("Order")||c.includes("Invoice"))&&!e)return"purchase";c.includes("SearchResultsPage")&&(o=!0),(c.includes("CollectionPage")||c.includes("ItemList"))&&(i=!0),c.includes("Product")&&n++}if(o)return"search";if(i)return"category";if(n===1)return"pdp";if(n>1)return $r.test(t)?"pdp":"category"}catch(r){}return t==="/"||t===""||t==="/home"||t==="/index.html"?"home":Oi.test(t)&&!e||qi.test(t)&&!e?"purchase":zi.test(t)?"cart":Bi.test(t)?"checkout":Ni.test(t)?"cart":$r.test(t)?"pdp":Di.test(t)?"category":Fi.test(t)?"search":"other"}function Hr(t){let e=null;try{let r=new URLSearchParams(location.search),n=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],o={};for(let i of n){let a=r.get(i);a&&(o[i.replace("utm_","")]=a)}Object.keys(o).length&&(e=o)}catch(r){}return{url:location.href,pathname:location.pathname,referrer:document.referrer||null,title:document.title||null,pageType:t,utm:e,userAgent:navigator.userAgent,language:navigator.language,viewport:window.innerWidth+"x"+window.innerHeight,platform:Ui()}}function Ui(){return Br()}var Re={},$i=null,ut=0,Vr=!1;function Wr(t){Vr||(Vr=!0,Gr(t),Ki(),Hi(),Vi(),Wi(),Gi(t))}function Gr(t){Re={};let e=Kr(),r=Hr(e);if(pr(r),y("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 Ki(){if(!document.body)return;let t={A:1,BUTTON:1,INPUT:1,SELECT:1,TEXTAREA:1},e=0;document.body.addEventListener("click",r=>{try{let n=Date.now();if(n-e<100)return;e=n;let o=r.target;for(let c=0;c<5&&o&&o!==document.body&&!(t[o.tagName]||o.getAttribute&&o.getAttribute("role")==="button");c++)o=o.parentElement;if(!o||!t[o.tagName]&&!(o.getAttribute&&o.getAttribute("role")==="button"))return;let i={tag:o.tagName},a=o.tagName==="INPUT"||o.tagName==="TEXTAREA"?o.value:o.textContent;i.text=(a||"").replace(/\s+/g," ").trim().substring(0,100),o.href&&(i.href=String(o.href).substring(0,500)),o.id&&(i.id=o.id),o.className&&typeof o.className=="string"&&(i.classes=o.className.trim().substring(0,200)),y("click",i)}catch(n){}},{capture:!0,passive:!0})}function Hi(){let t=[25,50,75,100],e=null,r=()=>{try{let n=window.scrollY||document.documentElement.scrollTop||0,o=Math.max(document.body&&document.body.scrollHeight||0,document.documentElement&&document.documentElement.scrollHeight||0);if(o<=0)return;let i=Math.min(100,Math.floor((n+window.innerHeight)/o*100));for(let a of t)i>=a&&!Re[a]&&(Re[a]=!0,y("scroll_depth",{depth:a}))}catch(n){}};r(),window.addEventListener("scroll",()=>{e||(e=setTimeout(()=>{e=null,r()},250))},{passive:!0})}function Vi(){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"),y("form_submit",{form_id:e.id||"",form_type:r})}catch(e){}},{capture:!0})}function Wi(){let t=w();ut=Date.now(),$i=setInterval(()=>{if(document.hidden)return;let e=Date.now(),r=Math.round((e-ut)/1e3);ut=e,r>0&&r<60&&y("engagement",{url:location.pathname,dwellSec:r})},t.engagementIntervalMs),document.addEventListener("visibilitychange",()=>{if(document.hidden){let e=Math.round((Date.now()-ut)/1e3);e>0&&e<600&&y("engagement",{url:location.pathname,dwellSec:e})}ut=Date.now()})}function Gi(t){let e=location.href,r=()=>{location.href!==e&&(e=location.href,Gr(t))};try{let n=history.pushState,o=history.replaceState;history.pushState=function(){n.apply(this,arguments),setTimeout(r,0)},history.replaceState=function(){o.apply(this,arguments),setTimeout(r,0)},window.addEventListener("popstate",r),window.addEventListener("hashchange",r)}catch(n){}}function Me(){let t=j(),e=A(["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||Jr(),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)||Jr(),currency:n("priceCurrency")||r("price:currency")||null,brand:n("brand")||null,category:null}}return null}function Jr(){try{let t=window.dataLayer;if(!Array.isArray(t))return null;for(let e=t.length-1;e>=0;e--){let r=t[e];if(!r||typeof r!="object")continue;let n=r.ecommerce||r,o=n&&n.items||null,i=n&&n.detail&&n.detail.products||n&&n.products||r.products||null,a=Array.isArray(o)&&o[0]&&o[0].price||Array.isArray(i)&&i[0]&&i[0].price||null,c=Pe(a!=null?String(a):"");if(c)return c}}catch(t){}return null}function L(){try{let t=location.pathname+location.search,e=t.match(/order[_-]?confirmation\/([\w-]+)/i)||t.match(/[?&]order[_-]?id=([\w-]+)/i)||t.match(/\/orders?\/([\w-]{4,})/i)||t.match(/pedido[_-]?(?:confirmado|realizado|finalizado)?\/([\w-]+)/i);return e?e[1]:null}catch(t){return null}}function Bt(){try{let o=S();if(o&&typeof o.resolveOrder=="function"){let i=o.resolveOrder();if(i&&(i.revenue!=null||i.orderId))return i}}catch(o){}let t=A(["Order","Invoice"]);if(t.length>0){let o=t[0],i=o.totalPaymentDue?parseFloat(o.totalPaymentDue.price):parseFloat(o.price||o.total);return{orderId:o.orderNumber||o.confirmationNumber||o.identifier||L(),revenue:Number.isFinite(i)?i:null,currency:o.totalPaymentDue&&o.totalPaymentDue.priceCurrency||o.priceCurrency||null,source:"jsonld"}}try{let o=window.Shopify&&window.Shopify.checkout;if(o&&o.total_price!=null){let i=parseFloat(o.total_price);return{orderId:(o.order_id!=null?String(o.order_id):null)||o.token||L(),revenue:Number.isFinite(i)?i:null,currency:o.currency||null,itemCount:Array.isArray(o.line_items)?o.line_items.length:null,source:"shopify"}}}catch(o){}try{let o=window.LS&&window.LS.order;if(o&&o.total!=null){let i=Number(o.total),a=window.LS.currency&&window.LS.currency.code||"BRL";return{orderId:String(o.number||o.id||L()||""),revenue:Number.isFinite(i)?i/100:null,currency:a,source:"nuvemshop"}}}catch(o){}try{if(Array.isArray(window.dataLayer))for(let o=window.dataLayer.length-1;o>=0;o--){let i=window.dataLayer[o],a=i&&i.ecommerce||i&&i.ecommerce_data&&i.ecommerce_data.ecommerce;if(!a&&i&&(i.event==="purchase"||i.transaction_id!=null||i.transactionId!=null)){let c=parseFloat(i.value!=null?i.value:i.revenue),l=i.transaction_id||i.transactionId;if(Number.isFinite(c)||l!=null)return{orderId:l||L(),revenue:Number.isFinite(c)?c:null,currency:i.currency||i.currencyCode||null,itemCount:Array.isArray(i.items)?i.items.length:null,source:"datalayer_flat"}}if(a&&(i.event==="purchase"||a.purchase||a.transaction_id)){let c=a.purchase&&a.purchase.actionField,l=parseFloat(c&&(c.revenue||c.value)||a.value||a.revenue);return{orderId:c&&(c.id||c.transaction_id)||a.transaction_id||a.transactionId||L(),revenue:Number.isFinite(l)?l:null,currency:a.currency||a.currencyCode||c&&c.currency||null,itemCount:(a.purchase&&a.purchase.products||a.items||a.products||[]).length||null,source:"datalayer"}}}}catch(o){}let e=document.querySelector('meta[property="order:total"], meta[name="order-total"]');if(e&&e.content)return{orderId:L(),revenue:parseFloat(e.content)||null,source:"meta"};let r=Ji();if(r)return r;let n=L();return n?{orderId:n,revenue:null,source:"url"}:null}function Ji(){try{let t=document.querySelector(".orderTotalPrice");if(t){let r=String(t.value||t.getAttribute("value")||t.textContent||"").trim(),n=r.split(/\s+/),o=Pe(n.length>1?n[n.length-1]:r);if(o)return{orderId:Xr(),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=Pe(n.value||n.textContent);if(o)return{orderId:Xr(),revenue:o,source:"dom"}}}return null}catch(t){return null}}function Xr(){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 Pe(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 Yr(){let t=A(["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 Xi=/(valor|total|subtotal|price|preco|revenue|amount|value|frete|desconto|qtd|quant|count|item|order|pedido|transaction|txid|codigo|numero|id)/i,Yi=/R\$\s*[\d.]+,\d{2}/;function Zi(t,e){if(typeof t=="number"&&isFinite(t)||typeof t=="boolean")return t;if(typeof t=="string"){let r=t.trim();if(!r||r.length>40)return;if(/^[R$\s]*-?[\d.]+([,.]\d+)?%?$/.test(r)||/id|pedido|order|transaction|codigo|numero/i.test(e)&&/^[\w-]{1,32}$/.test(r)&&r.indexOf("@")<0)return r}}function Qi(){let t=[];try{let e=window.dataLayer;if(!Array.isArray(e))return t;for(let r=0;r<e.length&&t.length<30;r++){let n=e[r];if(!n||typeof n!="object"||Array.isArray(n))continue;let o={event:n.event||n.PageType||n.pageType||null,keys:[],nums:{}},i=n.ecommerce||n.ecommerce_data&&n.ecommerce_data.ecommerce;i&&typeof i=="object"&&(o.ecommerceKeys=Object.keys(i).slice(0,20));for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&(o.keys.length<25&&o.keys.push(a),Xi.test(a))){let c=Zi(n[a],a);c!==void 0&&(o.nums[a]=c)}t.push(o)}}catch(e){}return t}function ta(){let t=[];try{let e=document.querySelectorAll("*");for(let r=0;r<e.length&&r<6e3&&t.length<15;r++){let n=e[r];if(n.children.length)continue;let o=(n.textContent||"").match(Yi);if(!o)continue;let i=((n.className||"")+" | "+(n.parentElement&&n.parentElement.className||"")+" | "+(n.id||"")).toString().trim().slice(0,70);t.push({money:o[0],ctx:i})}}catch(e){}return t}function ea(){let t={};try{let e=document.documentElement.outerHTML,r=/"(valor[A-Za-z]*|total[A-Za-z]*|subtotal|frete|desconto|orderId|idPedido|codigoPedido|numeroPedido|transaction_?id|revenue|amount)"\s*:\s*"?(-?[\d.,]{1,15})"?/gi,n,o=0;for(;(n=r.exec(e))&&o<25;)t[n[1]]===void 0&&(t[n[1]]=n[2],o++)}catch(e){}return t}function ra(){let t=[];try{let e=document.querySelectorAll('script[type="application/ld+json"]');for(let r=0;r<e.length&&t.length<8;r++){let n;try{n=JSON.parse(e[r].textContent)}catch(i){continue}let o=Array.isArray(n)?n:[n];for(let i=0;i<o.length&&t.length<8;i++){let a=o[i];!a||typeof a!="object"||t.push({type:a["@type"]||null,keys:Object.keys(a).slice(0,15)})}}}catch(e){}return t}function Zr(){let t=[];return["Zord","Shopify","LS","vtex","__RUNTIME__","wc","magazord","VTEX"].forEach(e=>{try{window[e]&&t.push(e)}catch(r){}}),{diag:"order",path:(location.pathname||"").slice(0,120),dl:Qi(),jsonld:ra(),money:ta(),htmlKeys:ea(),globals:t}}var qt=!1,zt=[/\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],na=[/^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 dt(t,e){for(let r=0;r<t.length;r++)if(t[r].test(e))return!0;return!1}function rn(t){switch(t){case"pdp":{let e=Me();y("view_item",e||{sku:null});break}case"category":case"search":{let e=Yr();y("view_item_list",e||{count:0});break}case"cart":Ie().then(e=>y("view_cart",e&&e.value!=null?{value:e.value,itemCount:e.itemCount,currency:e.currency}:{})).catch(()=>y("view_cart",{}));break;case"checkout":y("begin_checkout",{});break;case"purchase":oa();break}}var Qr=500,tn=30;function oa(){let t=!1,e=0,r=(o,i)=>{t||(t=!0,nn(o,i))};try{window.addEventListener("pagehide",()=>r(Bt(),!0),{once:!0})}catch(o){}let n=()=>{if(t)return;let o=Bt();if(o&&o.revenue!=null)return r(o);if(e++>=tn)return g("purchase: receita n\xE3o apareceu em "+Qr*tn+"ms \u2014 emitindo sem valor"),r(o);setTimeout(n,Qr)};n()}function nn(t,e){if(!qt){if(t&&!t.orderId&&(t.orderId=L()),t&&t.orderId){let r="_mk_purch_"+t.orderId;try{if(sessionStorage.getItem(r)){g("purchase j\xE1 contado",t.orderId);return}sessionStorage.setItem(r,"1")}catch(n){}}if(qt=!0,y("purchase",t||{revenue:null,_note:"no_order_data_extracted"}),!t||t.revenue==null)try{y("purchase_diag",Zr())}catch(r){}if(g("purchase emitido",t),e)try{F(!0)}catch(r){}}}var en=!1;function on(){if(en)return;en=!0;let t=r=>{try{if(!r||typeof r!="object")return!1;if(r.event==="purchase"||r.event==="transaction"||r.transaction_id!=null||r.transactionId!=null)return!0;let n=r.ecommerce||r.ecommerce_data&&r.ecommerce_data.ecommerce;return n?!!n.purchase||n.transaction_id!=null:!1}catch(n){return!1}},e=r=>{qt||!t(r)||setTimeout(()=>{if(!qt)try{nn(Bt(),!0)}catch(n){}},0)};try{let r=window.dataLayer=window.dataLayer||[];for(let o=0;o<r.length;o++)e(r[o]);let n=r.push;r.push=function(){let o=n.apply(this,arguments);try{for(let i=0;i<arguments.length;i++)e(arguments[i])}catch(i){}return o}}catch(r){}}function an(){if(!document.body)return;let t=0;document.body.addEventListener("click",e=>{try{let r=Date.now();if(r-t<150)return;let n=e.target;for(let c=0;c<5&&n&&n!==document.body&&!(n.tagName==="BUTTON"||n.tagName==="A"||n.getAttribute&&n.getAttribute("role")==="button");c++)n=n.parentElement;if(!n)return;let o=n.tagName!=="A",i=(n.textContent||"").replace(/\s+/g," ").trim();if(!i||i.length>80)return;let a=!1;if((dt([zt[0]],i)||o&&dt([zt[1]],i)||o&&dt([zt[2]],i)||dt(zt.slice(3),i))&&(a=!0),a){t=r;let c=Me();y("add_to_cart",{via:"click",buttonText:i,sku:c?c.sku:null,price:c?c.price:null});return}o&&dt(na,i)&&(t=r,y("begin_checkout",{via:"click",buttonText:i}))}catch(r){}},{capture:!0,passive:!0})}var Nt={};C(Nt,{available:()=>la,id:()=>ia,iframeSrc:()=>ca,modalSize:()=>aa,onMounted:()=>sa});var ia="mk-fashion",aa={width:430,height:800};function ca(t,e){let r=encodeURIComponent(e).replace(/\./g,"%2E");return w().appUrl+"/"+t+"/"+r}async function la(t,e){let r=w().apiUrl+"/availability/"+t+"?sku="+encodeURIComponent(e),n=await fetch(r);if(!n.ok)throw new Error("availability HTTP "+n.status);return n.json()}function sa(){}var Oe={};C(Oe,{available:()=>ya,closeButton:()=>pa,id:()=>ua,iframeSrc:()=>ha,modalSize:()=>da,modalSizeMobile:()=>fa,onMounted:()=>va});var ua="mk-makeup",da={width:"80vw",height:"80vh"},fa={width:"100vw",height:"100dvh"},pa=!0;function ma(){return window.__MK&&window.__MK.pulpoarUrl||"https://plugin.pulpoar.com/vto"}function ha(t,e){let r=window.__MK&&window.__MK.pulpoarIframeUrl;if(r){let o=String(r);return e!=null&&/\{sku\}|\{identifier\}/.test(o)&&(o=o.replace(/\{sku\}|\{identifier\}/g,encodeURIComponent(e))),o}let n=window.__MK&&window.__MK.pulpoarProjectKey||t;return ma()+"/"+encodeURIComponent(n)}async function ya(t,e){let r=window.__MK&&window.__MK.pulpoarProjectKey||t;if(!r)return{available:!0};let n=await ln(e)||e;if(!n)return{available:!0};try{let i=String(w().collectorUrl||"").replace(/\/+$/,"")+"/v1/makeup/availability/"+encodeURIComponent(r)+"?slug="+encodeURIComponent(n);t&&(i+="&projectId="+encodeURIComponent(t));let a=await fetch(i).then(c=>c.json());return g("pulpoar availability",a),{available:!(a&&(a.available===!1||a.projectActive===!1))}}catch(o){return g("pulpoar availability erro",o&&o.message),{available:!0}}}var ga="https://cdn.jsdelivr.net/npm/@pulpoar/plugin-sdk@latest/dist/index.iife.js",Dt=null;function wa(){return window.pulpoar?Promise.resolve(window.pulpoar):Dt||(Dt=new Promise(t=>{try{let e=document.createElement("script");e.src=ga,e.async=!0,e.onload=()=>t(window.pulpoar||null),e.onerror=()=>t(null),(document.head||document.documentElement).appendChild(e)}catch(e){t(null)}}),Dt)}async function ln(t){try{if(window.Shopify||window.ShopifyAnalytics){let e=(location.pathname.split("/products/")[1]||"").split(/[?#]/)[0];if(e){let r=window.ShopifyAnalytics&&window.ShopifyAnalytics.meta,n=new URLSearchParams(location.search).get("variant")||r&&r.selectedVariantId,i=(await fetch("/products/"+e+".js").then(l=>l.json())).variants||[],a=n?i.find(l=>String(l.id)===String(n)):null;if(a&&a.sku)return a.sku;let c=i.find(l=>l.available)||i[0];if(c&&c.sku)return c.sku}}}catch(e){}return t||null}function cn(t){return!t||typeof t!="object"?{quantity:1}:{sku:t.sku||t.slug||t.key||t.variant_key||t.barcode||null,color:t.color||t.shade||t.colorName||null,size:t.size||null,quantity:1}}function va(t,e){wa().then(async r=>{if(!r){g("pulpoar: SDK n\xE3o carregou");return}let n=await ln(e.identifier);if(g("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){g("pulpoar applyVariantsWithCatalog falhou",o&&o.message)}try{r.onReady(()=>e.fire("onReady",{}))}catch(o){}try{r.onAddToCart(o=>{let i=(Array.isArray(o)?o:[o]).filter(a=>a&&typeof a=="object");if(g("pulpoar onAddToCart",i.length+" item(s)",i),i.length<=1){e.handleAddToCart(i.length?cn(i[0]):{quantity:1},"makeup");return}e.handleAddToCart({items:i.map(cn)},"makeup")})}catch(o){}try{r.onGoToProduct(o=>e.fire("onGoToProduct",o))}catch(o){}})}var xa={"mk-fashion":Nt,"mk-makeup":Oe};function Ft(t){return xa[t]||Nt}var P=null,R=null,$t=!1,Kt=!1,z=null,sn={},je=null,Ut=0,E={onReady:null,onClose:null,onAddToCart:null,onProductLoaded:null,onError:null,onInteraction:null,onGenerationComplete:null},ba={gregory:"698c7e791d3129430f15dddd"};function dn(t){return t?ba[String(t).toLowerCase()]||t:null}async function H(t,e){let r=dn(t),n=String(e||"").trim();return Ft(w().product).available(r,n)}async function fn(t,e){e||(e=t,t="698c7e791d3129430f15dddd");try{return(await H(t,e)).available===!0}catch(r){return!1}}async function ft(t){if(t=t||{},$t)return;let e=dn(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(sn[n]!==!0){try{if(!(await H(e,r)).available){alert("Produto nao disponivel para prova virtual.");return}}catch(d){alert("Produto nao encontrado ou indisponivel.");return}sn[n]=!0}let o=Ft(w().product),a=(window.innerWidth||0)<=768&&o.modalSizeMobile||o.modalSize||{width:430,height:800},c=w(),l=lt();z={projectId:e,identifier:r,width:t.width||l.modalWidth||c.modalWidth||a.width,height:t.height||l.modalHeight||c.modalHeight||a.height},Kt=!1,hn(),_a(z),$t=!0,Ut=Date.now(),U(),y("modal_opened",{projectId:e,identifier:r})}function Ht(){if(!$t)return;let t=Kt;if(Kt=!1,ka(),$t=!1,B("onClose"),y("modal_closed",{projectId:z&&z.projectId,identifier:z&&z.identifier}),t)try{Ur()}catch(e){}}function pn(t){try{Cn().forEach(e=>{t?(e.dataset.mkPrevDisplay===void 0&&(e.dataset.mkPrevDisplay=e.style.display),e.style.display="none"):(e.style.display=e.dataset.mkPrevDisplay||"",delete e.dataset.mkPrevDisplay)})}catch(e){}}function _a(t){P=document.createElement("div"),P.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:2147483647;",pn(!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,o=String(t.width).indexOf("100v")>=0;e.style.cssText="position:relative;width:"+r+";height:"+n+";max-width:100vw;max-height:100dvh;border-radius:"+(o?"0":"12px")+";overflow:hidden;background:#fff;",R=document.createElement("iframe");let i=Ft(w().product),a=i.iframeSrc(t.projectId,t.identifier);try{let c=qr();c&&c.length&&(a+=(a.indexOf("?")>=0?"&":"?")+"sdkSizes="+encodeURIComponent(c.join(",")))}catch(c){}if(R.src=a,R.style.cssText="width:100%;height:100%;border:none;",R.setAttribute("allow","camera *; microphone *; web-share"),R.setAttribute("allowfullscreen","true"),e.appendChild(R),i.closeButton){let c=document.createElement("button");c.setAttribute("aria-label","Fechar"),c.setAttribute("type","button"),c.innerHTML='<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true"><path d="M1.6 1.6l10.8 10.8M12.4 1.6L1.6 12.4" stroke="#111" stroke-width="2" stroke-linecap="round"/></svg>',c.style.cssText="position:absolute;top:8px;right:8px;z-index:2;width:32px;height:32px;padding:0;border:none;border-radius:50%;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 5px rgba(0,0,0,.3);",c.addEventListener("click",()=>{try{Ht()}catch(l){}}),e.appendChild(c)}P.appendChild(e),document.body.appendChild(P);try{i.onMounted(R,{projectId:t.projectId,identifier:t.identifier,handleAddToCart:yn,track:y,fire:B})}catch(c){g("launcher.onMounted falhou",c&&c.message)}g("try-on modal aberto",R.src)}function ka(){P&&P.parentNode&&P.parentNode.removeChild(P),P=null,R=null,pn(!1)}var un=!1;function mn(){hn()}function hn(){un||(un=!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":B("onReady",n);break;case"product_loaded":B("onProductLoaded",n),y("product_loaded",Be(n));break;case"interaction":{B("onInteraction",n),n&&n.method&&(je=n.method),y(Ca(n),Be(n));break}case"add_to_cart":yn(n,"tryon");break;case"generation_start":Ut=Date.now();break;case"generation_complete":B("onGenerationComplete",n),y("generation_complete",{method:n.method||je||"unknown",durationMs:Ut?Date.now()-Ut:null,success:n.success!==!1,imageUrlPresent:!!n.imageUrl});break;case"generation_error":B("onError",n),y("generation_error",{method:je||"unknown",error:n&&n.error});break}}))}function yn(t,e){if(y("add_to_cart",Object.assign({via:e||"tryon"},Be(t))),typeof E.onAddToCart=="function"){B("onAddToCart",t);return}let r=Object.assign({productId:z&&z.identifier},t);Dr(r).then(n=>Le(n)).then(n=>{Kt=!!n}).catch(()=>{})}function Ca(t){return t&&t.action,"interaction"}function Be(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 B(t,e){if(typeof E[t]=="function")try{E[t](e)}catch(r){console.error("[mk-sdk]",r)}}function gn(t){E.onReady=t}function wn(t){E.onClose=t}function vn(t){E.onAddToCart=t}function xn(t){E.onProductLoaded=t}function bn(t){E.onError=t}function _n(t){E.onInteraction=t}function kn(t){E.onGenerationComplete=t}var Ta=767,Aa=1024,Ea=/(adicionar\s*(à|a|ao)?\s*(sacola|carrinho|cesta|bolsa))|adicionar ao carrinho|add to (cart|bag)|comprar agora|^comprar$|finalizar compra|eu quero/i,Ia=/continuar|como comprar|lista|desejos|favorito|looks|cupom/i;function ze(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 La(t){if(!t)return!1;try{let e=document.querySelector(t);return!!e&&ze(e)}catch(e){return!1}}function Ra(t){return(t.tagName==="INPUT"?t.value||"":t.textContent||"").replace(/\s+/g," ").trim()}function Pa(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 pt(t){if(!t||typeof t!="object")return null;if(t=Pa(t),t.selector)return t;let e=[["mobile",t.mobile],["tablet",t.tablet],["desktop",t.desktop]].filter(l=>l[1]&&l[1].selector);if(e.length===0)return null;if(e.length===1)return e[0][1];let r=e.filter(([,l])=>La(l.selector));if(r.length===1)return r[0][1];let n=window.innerWidth||1024,o=Number(t.bpMobile)||Number(t.breakpoint)||Ta,i=Number(t.bpTablet)||Aa,a=l=>(e.find(d=>d[0]===l)||[])[1],c=n<=o?["mobile","tablet","desktop"]:n<=i?["tablet","desktop","mobile"]:["desktop","tablet","mobile"];for(let l of c){let d=a(l);if(d)return d}return e[0][1]}function Vt(t){let e=pt(t);if(e&&e.selector)try{let r=document.querySelector(e.selector);if(r&&ze(r))return{el:r,position:e.position||"afterend",mode:e.mode||"flow",style:e.style||"",align:e.align||"top-left",selector:e.selector}}catch(r){}return null}function Sn(){let t=w(),e=Vt(t&&t.anchor);if(e)return e;let r=document.querySelectorAll('button, [role="button"], a.btn, a.button, input[type="submit"], input[type="button"]');for(let n of r){let o=Ra(n);if(!(!o||o.length>40)&&!Ia.test(o)&&Ea.test(o)&&ze(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",qe={none:"0",sm:"4px",md:"8px",pill:"9999px"},Ne={none:"0",sm:"4px",md:"8px",lg:"16px"},Ma='<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>',An='<svg viewBox="0 0 11.6122 12.7248" fill="none" xmlns="http://www.w3.org/2000/svg" style="display:block;width:12px;height:12px"><path d="M4.09055 2.01133C4.43939 0.9905 5.84989 0.959583 6.26347 1.91858L6.29847 2.01192L6.76922 3.38858C6.8771 3.7043 7.05144 3.99321 7.28047 4.23583C7.5095 4.47845 7.7879 4.66912 8.09689 4.795L8.22347 4.84225L9.60014 5.31242C10.621 5.66125 10.6519 7.07175 9.69347 7.48533L9.60014 7.52033L8.22347 7.99108C7.90764 8.09889 7.61862 8.2732 7.3759 8.50223C7.13318 8.73127 6.94241 9.0097 6.81647 9.31875L6.76922 9.44475L6.29905 10.822C5.95022 11.8428 4.53972 11.8737 4.12672 10.9153L4.09055 10.822L3.62039 9.44533C3.51258 9.12951 3.33827 8.84048 3.10924 8.59776C2.8802 8.35504 2.60177 8.16427 2.29272 8.03833L2.16672 7.99108L0.790054 7.52092C-0.231363 7.17208 -0.26228 5.76158 0.69672 5.34858L0.790054 5.31242L2.16672 4.84225C2.48244 4.73437 2.77135 4.56003 3.01397 4.331C3.25658 4.10197 3.44726 3.82357 3.57314 3.51458L3.62039 3.38858L4.09055 2.01133ZM9.86147 0C9.9706 0 10.0775 0.0306123 10.1701 0.0883584C10.2627 0.146104 10.3373 0.228668 10.3853 0.326667L10.4133 0.394917L10.6175 0.993417L11.2166 1.19758C11.3259 1.23474 11.4218 1.30353 11.492 1.39523C11.5623 1.48693 11.6037 1.59741 11.611 1.71268C11.6184 1.82795 11.5914 1.94281 11.5334 2.04271C11.4755 2.14261 11.3891 2.22305 11.2854 2.27383L11.2166 2.30183L10.6181 2.506L10.4139 3.10508C10.3767 3.21442 10.3078 3.31024 10.2161 3.38041C10.1244 3.45058 10.0139 3.49194 9.89859 3.49925C9.78333 3.50656 9.66849 3.47949 9.56863 3.42147C9.46876 3.36345 9.38837 3.27709 9.33764 3.17333L9.30964 3.10508L9.10547 2.50658L8.50639 2.30242C8.39702 2.26526 8.30115 2.19647 8.23092 2.10477C8.16069 2.01307 8.11926 1.90259 8.11189 1.78732C8.10452 1.67205 8.13153 1.55719 8.18951 1.45729C8.24749 1.35739 8.33381 1.27695 8.43755 1.22617L8.50639 1.19817L9.10489 0.994L9.30905 0.394917C9.34839 0.279665 9.42281 0.179613 9.52187 0.108791C9.62094 0.0379686 9.73969 -0.0000730808 9.86147 0Z" fill="currentColor"/></svg>';function x(t,e={}){let r=document.createElement(t);if(e.style&&(r.style.cssText=e.style),e.text!=null&&(r.textContent=e.text),e.html!=null&&(r.innerHTML=e.html),e.attrs)for(let n in e.attrs)r.setAttribute(n,e.attrs[n]);if(e.on)for(let n in e.on)r.addEventListener(n,e.on[n]);if(e.children)for(let n of e.children)n&&r.appendChild(n);return r}function En(t){return x("span",{style:`width:12px;height:12px;display:inline-flex;align-items:center;justify-content:center;color:${t};flex-shrink:0;`,html:An})}var Wt=t=>'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" style="display:block;width:100%;height:100%">'+t+"</svg>",Tn={camera:Ma,sparkle:An.replace("width:12px;height:12px","width:100%;height:100%"),shirt:Wt('<path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z"/>'),face:Wt('<path d="M3 7V5a2 2 0 0 1 2-2h2"/><path d="M17 3h2a2 2 0 0 1 2 2v2"/><path d="M21 17v2a2 2 0 0 1-2 2h-2"/><path d="M7 21H5a2 2 0 0 1-2-2v-2"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01"/><path d="M15 9h.01"/>'),glasses:Wt('<circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2"/><path d="M2.5 13 5 7c.7-1.3 1.4-2 3-2"/><path d="M21.5 13 19 7c-.7-1.3-1.5-2-3-2"/>'),wand:Wt('<path d="m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"/><path d="m14 7 3 3"/><path d="M5 6v4"/><path d="M19 14v4"/><path d="M10 2v2"/><path d="M7 8H3"/><path d="M21 16h-4"/><path d="M11 3H9"/>')};function q(t,e,r){let n=Number(r)>0?Number(r):24;return x("span",{style:`width:${n}px;height:${n}px;padding:2px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:${e};flex-shrink:0;`,html:Tn[t]||Tn.camera})}function tt(t){return t.borderWidth>0&&t.borderColor?`${t.borderWidth}px solid ${t.borderColor}`:"none"}function et(){if(!document.getElementById("mk-jakarta-font"))try{document.head.appendChild(x("link",{attrs:{id:"mk-jakarta-font",rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap"}}))}catch(t){}}function Oa(t){return t.subtext?x("span",{style:`display:flex;align-items:center;justify-content:center;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,text:t.subtext}):null}function In(t,e){et();let r=x("span",{style:"display:inline-flex;align-items:center;gap:4px;",children:[q(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;text-transform:uppercase;letter-spacing:2px;color:${t.textColor};white-space:nowrap;text-align:center;line-height:1;`})]});return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px;width:100%;max-width:238px;box-sizing:border-box;background:${t.bgColor};border:${tt(t)};border-radius:${t.borderRadiusPx};font-family:${_};font-size:${t.fontSize}px;cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[r,Oa(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 Ba(t){return t.subtext?x("span",{style:`display:flex;align-items:center;gap:4px;padding:4px;background:${t.badgeBgColor};font-family:${_};font-weight:600;font-size:10px;text-transform:uppercase;color:${t.badgeTextColor};line-height:1;white-space:nowrap;`,children:[En(t.badgeTextColor),x("span",{text:t.subtext})]}):null}function za(t,e){return x("button",{attrs:{type:"button"},style:`display:flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px 8px 8px;width:100%;margin-top:auto;box-sizing:border-box;background:${t.bgColor};border:${tt(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:[q(t.icon,t.textColor,t.iconSize),x("span",{text:t.text,style:`font-family:${_};font-weight:700;font-size:inherit;color:${t.textColor};white-space:nowrap;line-height:1;`})],on:{mouseenter:r=>{r.currentTarget.style.opacity="0.85"},mouseleave:r=>{r.currentTarget.style.opacity="1"},click:r=>{try{r.preventDefault(),r.stopPropagation()}catch(n){}try{e&&e()}catch(n){}}}})}function Ln(t,e){et();let r=x("div",{style:"display:flex;flex-direction:column;gap:4px;",children:[t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;letter-spacing:1px;text-transform:uppercase;color:${t.cardTitleColor};line-height:1.2;`}),t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:12px;max-width:177px;line-height:1.2;color:${t.cardTextColor};`})]}),n=x("div",{style:"display:flex;flex-direction:column;justify-content:space-between;gap:16px;flex:1 1 0;min-width:0;",children:[r,t.cardFooter&&x("p",{text:t.cardFooter,style:`margin:0;font-family:${_};font-weight:400;font-size:10px;color:${t.cardTextColor};line-height:1.2;`})]}),o=x("div",{style:"display:flex;flex-direction:column;align-items:flex-end;flex:1 1 0;min-width:0;",children:[Ba(t),za(t,e)]}),i=x("div",{style:"display:flex;gap:16px;align-items:stretch;width:100%;flex:1;box-sizing:border-box;",children:[n,o]});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;padding:12px;width:100%;max-width:402px;min-height:140px;box-sizing:border-box;background:${t.cardBgColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};font-size:${t.fontSize}px;`,children:[i]})}function Rn(t,e){let r=Number(t.iconSize)>0?Number(t.iconSize):24;return x("button",{attrs:{type:"button","aria-label":t.text||"Provar virtualmente"},style:`display:inline-flex;align-items:center;justify-content:center;padding:8px;box-sizing:border-box;background:${t.bgColor};border:${tt(t)};border-radius:${t.borderRadiusPx};cursor:pointer;transition:opacity 0.2s ease;line-height:1;-webkit-appearance:none;appearance:none;`,children:[q(t.icon,t.textColor,r)],on:{mouseenter:n=>{n.currentTarget.style.opacity="0.85"},mouseleave:n=>{n.currentTarget.style.opacity="1"},click:n=>{try{n.preventDefault(),n.stopPropagation()}catch(o){}try{e&&e()}catch(o){}}}})}function Pn(t,e){et();let r=x("div",{style:"display:flex;flex-direction:column;gap:8px;width:fit-content;max-width:100%;",children:[x("div",{style:"display:flex;align-items:center;gap:8px;",children:[q(t.icon,t.cardTitleColor,t.iconSize),t.cardTitle&&x("p",{text:t.cardTitle,style:`margin:0;font-family:${_};font-weight:700;font-size:16px;text-transform:uppercase;letter-spacing:1px;color:${t.cardTitleColor};white-space:nowrap;line-height:1.2;`})]}),x("div",{style:`height:3px;width:100%;border-radius:9999px;background:linear-gradient(90deg, ${t.cardAccentFrom}, ${t.cardAccentTo});`})]}),n=t.cardDescription&&x("p",{html:t.cardDescription,style:`margin:0;font-family:${_};font-weight:400;font-size:13px;line-height:1.4;color:${t.cardTextColor};`}),o=x("button",{attrs:{type:"button"},text:t.text,style:`font-family:${_};font-weight:700;font-size:${t.fontSize}px;text-transform:uppercase;letter-spacing:1px;text-decoration:underline;text-underline-offset:4px;color:${t.cardCtaColor};background:transparent;border:none;padding:0;cursor:pointer;text-align:left;line-height:1.2;transition:opacity 0.2s ease;`,on:{mouseenter:i=>{i.currentTarget.style.opacity="0.7"},mouseleave:i=>{i.currentTarget.style.opacity="1"},click:i=>{try{i.preventDefault(),i.stopPropagation()}catch(a){}try{e&&e()}catch(a){}}}});return x("div",{style:`display:flex;flex-direction:column;align-items:flex-start;gap:24px;padding:20px;width:360px;max-width:100%;box-sizing:border-box;background:${t.cardBgColor};border:1px solid ${t.cardBorderColor};border-radius:${t.cardBorderRadiusPx};font-family:${_};`,children:[r,n,o]})}var Fa={style:"gregory-black",icon:"camera",text:"Provar Virtualmente",fontSize:14,iconSize:24,subtext:"",bgColor:"#1E1E1E",textColor:"#FFFFFF",badgeBgColor:"#C51A1B",badgeTextColor:"#FFFFFF",borderRadius:"md",borderColor:"#1E1E1E",borderWidth:0,cardTitle:"",cardDescription:"",cardFooter:"",cardBgColor:"#F6F6F6",cardTitleColor:"#1E1E1E",cardTextColor:"#717171",cardBorderRadius:"md",cardCtaColor:"#1E1E1E",cardBorderColor:"#E5E0DA",cardAccentFrom:"#8A5A3C",cardAccentTo:"#E9DACB"};function Gt(t){if(!t)return null;let e=Array.isArray(t.anchors)?t.anchors:[];if(t.version===2||t.main)return{version:2,main:t.main||{},anchors:e,cards:t.cards||null};let r=t.desktop||t.tablet||t.mobile||{},n=t.anchor||{};return{version:2,main:Object.assign({},r,{desktop:n.desktop,tablet:n.tablet,mobile:n.mobile,bpMobile:n.bpMobile,bpTablet:n.bpTablet}),anchors:e,cards:t.cards||null}}function mt(t,e){let r={...Fa,...t||{}};return r.style==="gregory-card"&&e&&(r.style="gregory-black"),r.borderRadiusPx=qe[r.borderRadius]!=null?qe[r.borderRadius]:"0",r.cardBorderRadiusPx=Ne[r.cardBorderRadius]!=null?Ne[r.cardBorderRadius]:"0",r.fontSize=Number(r.fontSize)||14,r.iconSize=Number(r.iconSize)||24,r.borderWidth=Number(r.borderWidth)||0,r}var De={"gregory-black":In,"gregory-card":Ln,"gregory-icon":Rn,"card-link":Pn},fl=Object.keys(De).concat("none");function Mn(t,e){return t&&t.style==="none"?null:(De[t.style]||De["gregory-black"])(t,e)}var M=null,ht=null,Fe=null,On=!1;function Ue(){try{let t=j();return t&&t.value||null}catch(t){return null}}function Ua(t,e){try{let r=e?t.querySelector(e):t;if(!r)return!1;let n=r.getBoundingClientRect();return n.width>0&&n.height>0}catch(r){return!1}}function $a(){try{let t=document.querySelectorAll(M.selector);for(let e=0;e<t.length;e++)if(Ua(t[e],M.inner))return!0}catch(t){}return!1}function jn(){if(!M)return;let t=location.pathname+"|"+(Ue()||"");if(t===Fe||!$a())return;Fe=t;let e=Ue();y("button_rendered",{style:"native",sku:e||null,selector:M.selector}),g("native-button: rendered (bot\xE3o do tema vis\xEDvel)",{sku:e,selector:M.selector})}function Ka(t){if(M)try{let e=t.target;if(!(e&&e.closest&&e.closest(M.selector)))return;let n=Ue();U(),y("button_clicked",{style:"native",sku:n||null}),g("native-button: clicked",{sku:n})}catch(e){}}function Bn(){let t=zr();if(!t||!t.selector){$e();return}if(M=t,!On){On=!0;try{document.addEventListener("click",Ka,!0)}catch(e){}}ht||(jn(),ht=setInterval(jn,1500))}function $e(){M=null,ht&&(clearInterval(ht),ht=null),Fe=null}function Ha(){return"abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)]+Math.random().toString(36).slice(2,11)}var O=null,N=[];function Cn(){return[O].concat(N).filter(Boolean)}function Va(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 Wa=/^(transform|transform-origin|margin|margin-(top|right|bottom|left)|align-self|justify-self|place-self|position|inset|top|right|bottom|left|z-index|width|min-width|max-width|height|min-height|max-height|font-size)$/i;function Ga(t){return!t||typeof t!="string"?"":t.split(/[;\n\r]+/).map(e=>e.trim()).filter(Boolean).filter(e=>Wa.test(e.split(":")[0].trim().toLowerCase())).join(";")}var Yt=null,Ke=!1,He=0,Ve=0,We=0,rt={},zn=!1,yt=null;function D(){return yt||(yt=Q().then(t=>{if(!t)return yt=null,null;try{kt(t,w().projectId,w().product)}catch(e){}return Gt(t.template&&t.template.tryOnButton||null)||{__loaded:!0}}).catch(()=>(yt=null,null))),yt}var wt=null,Jt=null,V=null,Xt=typeof location!="undefined"?location.pathname:"";function Ja(t){let e=/<script[^>]+application\/ld\+json[^>]*>([\s\S]*?)<\/script>/gi,r;for(;r=e.exec(t);)try{let n=JSON.parse(r[1].trim()),o=Array.isArray(n)?n:[n];for(let i of o)if(i&&/product/i.test(i["@type"]||"")&&(i.sku||i.mpn))return String(i.sku||i.mpn)}catch(n){}return null}function Je(){return V&&V.path===location.pathname&&V.value?{value:V.value,source:"url-fresh"}:j()}function Xa(t){let e=[];try{e=Ee().map(r=>r&&r.value).filter(Boolean)}catch(r){}return t&&e.indexOf(t)<0&&e.push(t),e}async function Ya(t,e){for(let r=0;r<e.length;r++){let n=e[r];if(rt[n]||(rt[n]=H(t,n).then(o=>!!(o&&o.available)).catch(()=>!1)),await rt[n])return n}return null}function Za(){wt||(Xt=location.pathname,wt=setInterval(()=>{try{if(O&&!O.isConnected){k("pdp");return}if(location.pathname!==Xt){Xt=location.pathname,V=null,fetch(location.href,{credentials:"same-origin"}).then(r=>r.ok?r.text():null).then(r=>{let n=r&&Ja(r);n&&(V={path:location.pathname,value:n},Jt=n),k("pdp")}).catch(()=>k("pdp"));return}let t=Je(),e=t&&t.value;e&&e!==Jt&&(Jt=e,k("pdp"))}catch(t){}},1500))}function Qa(){wt&&(clearInterval(wt),wt=null),Jt=null,V=null,Xt=typeof location!="undefined"?location.pathname:""}function tc(){if(zn)return;zn=!0;let t=null;try{window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(()=>{Yt&&k("pdp")},200)})}catch(e){}}function Xe(t){if(t){if(typeof t.__mkCleanup=="function")try{t.__mkCleanup()}catch(e){}t.parentNode&&t.parentNode.removeChild(t)}}function gt(){Xe(O),N.forEach(Xe),O=null,N=[],Yt=null}var ec={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 rc(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 nc(t,e,r){let o=!ec[t.tagName]?t:t.parentElement||document.body;try{getComputedStyle(o).position==="static"&&(o.style.position="relative")}catch(s){}if(o===t){e.style.cssText="position:absolute;z-index:2147483000;"+rc(r),t.appendChild(e);return}e.style.cssText="position:absolute;z-index:2147483000;",o.appendChild(e);let i=()=>{try{let s=t.getBoundingClientRect(),f=o.getBoundingClientRect(),u=e.offsetWidth,m=e.offsetHeight,h=s.top-f.top+o.scrollTop,v=s.left-f.left+o.scrollLeft,p=r||"top-left",b=h,T=v;p.indexOf("bottom")===0?b=h+s.height-m:(p.indexOf("middle")===0||p==="center")&&(b=h+(s.height-m)/2),p.indexOf("right")>=0?T=v+s.width-u:p.indexOf("center")>=0&&(T=v+(s.width-u)/2),e.style.top=b+"px",e.style.left=T+"px"}catch(s){}};i();let a=()=>i();window.addEventListener("resize",a);let c=setTimeout(i,600),l=setTimeout(i,1500),d=null;try{if(t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",i,{once:!0}),typeof ResizeObserver=="function"){d=new ResizeObserver(()=>i());try{d.observe(t)}catch(s){}try{d.observe(o)}catch(s){}}}catch(s){}e.__mkCleanup=()=>{window.removeEventListener("resize",a),clearTimeout(c),clearTimeout(l);try{t.removeEventListener("load",i)}catch(s){}try{d&&d.disconnect()}catch(s){}}}function oc(t,e,r){e.style.cssText="position:absolute;z-index:100;",document.body.appendChild(e);let n=()=>{try{let u=t.getBoundingClientRect(),m=e.offsetWidth,h=e.offsetHeight,v=r||"top-left",p=u.top+window.scrollY,b=u.left+window.scrollX;v.indexOf("bottom")===0?p=u.bottom+window.scrollY-h:(v.indexOf("middle")===0||v==="center")&&(p=u.top+window.scrollY+(u.height-h)/2),v.indexOf("right")>=0?b=u.right+window.scrollX-m:v.indexOf("center")>=0&&(b=u.left+window.scrollX+(u.width-m)/2),e.style.top=Math.round(p)+"px",e.style.left=Math.round(b)+"px"}catch(u){}};n();let o=0,i=!1,a=()=>{o=Date.now()+450,!i&&(i=!0,function u(){n(),Date.now()<o?requestAnimationFrame(u):i=!1}())},c=()=>n();window.addEventListener("resize",c),window.addEventListener("scroll",a,!0);let l=setTimeout(n,600),d=setTimeout(n,1500),s=null,f=null;try{t.tagName==="IMG"&&!t.complete&&t.addEventListener("load",n,{once:!0});let u=t.querySelector&&t.querySelector("img");if(u&&!u.complete&&u.addEventListener("load",n,{once:!0}),typeof ResizeObserver=="function"){s=new ResizeObserver(()=>n());try{s.observe(t)}catch(v){}}let m=t.parentElement,h=null;for(let v=0;v<8&&m;v++){let p=getComputedStyle(m);if(p.transform&&p.transform!=="none"||/swiper|slick|flick|carousel|glide|splide|slider/i.test((m.className||"").toString())){h=m;break}m=m.parentElement}h&&typeof MutationObserver=="function"&&(f=new MutationObserver(a),f.observe(h,{attributes:!0,attributeFilter:["style","class"]}))}catch(u){}e.__mkCleanup=()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",a,!0),clearTimeout(l),clearTimeout(d);try{s&&s.disconnect()}catch(u){}try{f&&f.disconnect()}catch(u){}}}function ic(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 k(t){let e=w(),r=null;if(t!=="pdp"){gt(),Qa(),$e();return}if(!e.projectId)return;if(Za(),Bn(),!e._anchorFromPicker){let s=await D(),f=lt(),u=s&&s.main,m=s&&s.anchors,h=s&&s.cards;if(f&&f.tryOnButton){let p=Gt(f.tryOnButton)||{};p.main&&(u=Object.assign({},u||e.anchor||{},p.main),r=u),p.anchors&&(m=p.anchors),p.cards&&(h=p.cards)}u&&(e.anchor=u),m&&(e.anchors=m),h&&(e.cards=h);let v=!!(e.anchor&&(e.anchor.desktop||e.anchor.mobile||e.anchor.tablet||e.anchor.selector));if(!e.forceButton&&!(s&&s.main)&&!v){gt(),s===null&&He<3&&(He++,setTimeout(()=>k(t),1500));return}He=0}if(Ke)return;let n=Je(),o=n&&n.value,i=!!e.forceButton,a=s=>s?[s.selector,s.position,s.mode,s.align,s.style].join("~"):"heuristic",c=Array.isArray(e.anchors)?e.anchors:[],l=[o||"demo",a(pt(e.anchor))].concat(c.map(s=>a(pt(s)))).join("|"),d=O;if(!(d&&d.isConnected&&Yt===l)){if(d&&gt(),!o&&!i){g("auto-mount: SKU n\xE3o resolvido na PDP"),Ve<10&&(Ve++,setTimeout(()=>k(t),800));return}if(Ve=0,!i&&e.anchor&&pt(e.anchor)&&!Vt(e.anchor)&&We<12){We++,setTimeout(()=>k(t),600);return}We=0,Ke=!0;try{let s=i,f=o;if(!i){let b=await Ya(e.projectId,Xa(o));s=!!b,b&&(f=b)}try{fr(s?"available":"unavailable")}catch(b){}if(!s){g("auto-mount: produto sem try-on",o);return}if(lt().holdout){gt(),g("auto-mount: holdout \u2014 bot\xE3o suprimido");return}let u=await D(),m=window.matchMedia("(max-width: 767px)").matches,h=mt(r||u&&u.main||e.anchor||{},m),v=()=>{let b=Je(),T=b&&b.value||"",ot=!T||T===o?f||o||"":T;U(),y("button_clicked",{sku:ot,style:h.style}),ft({projectId:e.projectId,identifier:ot})},p=Sn();O=Ye(p,h,v),N=[];for(let b=0;b<c.length;b++){let T=c[b],ot=Vt(T);if(!ot)continue;let Nn=u&&u.anchors&&u.anchors[b]||T,Qe=Ye(ot,mt(Nn,m),v);Qe&&N.push(Qe)}Yt=l,tc(),g("auto-mount: bot\xE3o",{style:h.style,sku:o,mounted:!!O,extras:N.length,forced:i}),(O||N.length)&&y("button_rendered",{style:h.style,sku:o||null,skuSource:n&&n.source,anchorFound:!!p,position:p?p.position:null,mode:p?p.mode:null,extras:N.length,forced:i})}finally{Ke=!1}}}function Ye(t,e,r){let n=t&&t.mode||"flow",o=Mn(e,r);if(!o)return null;let i=document.createElement("div");i.id=Ha(),Va(i,{mode:"closed"}).appendChild(o),["click","mousedown","mouseup","pointerdown","pointerup","touchstart"].forEach(l=>{try{i.addEventListener(l,d=>{d.stopPropagation()},!1)}catch(d){}});let c=!1;if(t&&t.el&&t.el.parentNode&&(n==="overlay"?(t.detached?oc(t.el,i,t.align):nc(t.el,i,t.align),c=!0):(i.style.cssText="display:contents;",c=ic(t.el,i,t.position))),c||(i.style.cssText="position:fixed;left:16px;bottom:16px;z-index:2147483000;",document.body.appendChild(i)),t&&t.style){let l=Ga(t.style);if(l){if(n==="overlay"){let d=l.match(/(?:^|;)\s*z-index\s*:\s*([^;]+)/i);if(d)try{i.style.zIndex=d[1].trim()}catch(s){}}try{o.style.cssText+=";"+l}catch(d){}}}return i}function qn(){try{let t=w(),e={anchor:t.anchor,anchors:t.anchors,cards:t.cards,forceButton:t.forceButton},r={},n=i=>({desktop:i,tablet:i,mobile:i}),o=(i,a,c)=>{i=i||{};let l=u=>a===u?c:r[u];t.anchor=l("primary")?n(l("primary")):i.main||null;let d=Array.isArray(i.anchors)?i.anchors:[],s=d.length;Object.keys(r).concat(a?[a]:[]).forEach(u=>{u&&u.indexOf("extra-")===0&&(s=Math.max(s,(parseInt(u.slice(6),10)||0)+1))});let f=[];for(let u=0;u<s;u++){let m=l("extra-"+u);f[u]=m?n(m):d[u]||null}t.anchors=f,t._anchorFromPicker=!0,t.forceButton=!0};window.addEventListener("message",i=>{if(i.source!==window)return;let a=i.data;if(!(!a||!a.__mkCmd)){if(a.__mkCmd==="getButtons"){D().then(c=>{let l=c&&Array.isArray(c.anchors)?c.anchors.length:0;try{window.postMessage({__mkButtons:{extras:l,hasMain:!!(c&&c.main)}},"*")}catch(d){}});return}if(a.__mkCmd==="previewSlot"){D().then(c=>{o(c,a.slot||"primary",a.live),k("pdp")});return}if(a.__mkCmd==="saveSlot"){a.slot&&a.live&&(r[a.slot]=a.live),D().then(c=>{o(c),k("pdp")});return}if(a.__mkCmd==="galleryPreview"){t.cards=a.cards||null,t._anchorFromPicker=!0,t.forceButton=!0,nt(),Zt("category");return}if(a.__mkCmd==="applyRecipe"){D().then(c=>{o(c),a.cards!==void 0&&(t.cards=a.cards||null),k("pdp"),t.cards&&(nt(),Zt("category"))});return}if(a.__mkCmd==="cancelPreview"){Object.keys(r).length?D().then(c=>{o(c),k("pdp")}):(t.anchor=e.anchor,t.anchors=e.anchors,t.cards=e.cards,t._anchorFromPicker=!1,t.forceButton=e.forceButton,gt(),nt(),k("pdp"));return}}})}catch(t){}}var W=null,vt=null,Ze=null,xt=new Map;function ac(t,e){try{if(e.skuAttr){let o=e.skuSelector?t.querySelector(e.skuSelector):t,i=o&&o.getAttribute(e.skuAttr);if(i)return String(i).trim()}if(e.skuSelector&&!e.skuAttr){let o=t.querySelector(e.skuSelector),i=o&&(o.getAttribute("content")||o.textContent||"").trim();if(i)return i}let r=t.querySelector(e.linkSelector||"a[href]"),n=r&&r.getAttribute("href");if(n){let o=n.match(/-p(\d+)|[?&]variant=(\d+)|\/produtos?\/([\w-]+)|\/products?\/([\w-]+)|-(\d+)(?:[/?#]|$)/);if(o)return o[1]||o[2]||o[3]||o[4]||o[5]}}catch(r){}return null}async function cc(t,e,r){if(xt.has(t))return;let n=!!w().forceButton,o=ac(t,e);if(!o&&!n)return;let i=n;if(i||(rt[o]||(rt[o]=H(w().projectId,o).then(s=>!!(s&&s.available)).catch(()=>!1)),i=await rt[o]),!i||xt.has(t)||!t.isConnected)return;let c={el:e.anchorWithin&&t.querySelector(e.anchorWithin)||t,mode:e.mode||"overlay",align:e.align||"top-left",position:e.position||"afterbegin",style:e.injectStyle||e.style||"",detached:!0},d=Ye(c,r,()=>{U(),y("button_clicked",{sku:o,gallery:!0,style:r.style}),ft({projectId:w().projectId,identifier:o})});d&&(xt.set(t,d),y("button_rendered",{gallery:!0,sku:o,style:r.style}))}function Ge(t){try{document.querySelectorAll(t.cardSelector).forEach(e=>{e.__mkCard||(e.__mkCard=!0,W.observe(e))})}catch(e){}}function nt(){if(W){try{W.disconnect()}catch(t){}W=null}if(vt){try{vt.disconnect()}catch(t){}vt=null}clearTimeout(Ze),xt.forEach(t=>Xe(t)),xt.clear()}async function Zt(t){let e=w();if(t==="pdp"||t==="cart"||t==="checkout"||t==="purchase"){nt();return}if(!e.projectId)return;let r=await D(),n=e.cards||r&&r.cards||null;if(!n||!n.cardSelector){nt();return}if(W){Ge(n);return}if(typeof IntersectionObserver!="function")return;let o=mt(n,window.matchMedia("(max-width: 767px)").matches);if(o.style==="none"){nt();return}W=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(W.unobserve(a.target),cc(a.target,n,o))},{rootMargin:"300px"}),Ge(n);try{vt=new MutationObserver(()=>{clearTimeout(Ze),Ze=setTimeout(()=>Ge(n),250)}),vt.observe(document.body,{childList:!0,subtree:!0})}catch(i){}g("auto-mount galeria ativa",{cardSelector:n.cardSelector})}(function(){"use strict";try{let r=function(){try{yr(),qn(),mn(),e.autoTrack!==!1&&(Wr((o,i)=>{rn(o,i),k(o),Zt(o)}),an(),on()),g("mk-sdk iniciado",{projectId:e.projectId,collectorUrl:e.collectorUrl})}catch(o){e.debug&&console.error("[mk-sdk] init erro",o)}},e=te();if(e.projectId){let o=xr(e.projectId);o&&se(o),Q().then(i=>{let a=wr(i);se(a),br(e.projectId,a),g("escopo de coleta",a);try{kt(i,e.projectId,e.product)}catch(c){}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();let n={open:ft,close:Ht,isAvailable:fn,getAvailability:H,onReady:gn,onClose:wn,onAddToCart:vn,onProductLoaded:xn,onError:bn,onInteraction:_n,onGenerationComplete:kn,testCart:Fr,experiments:re,resetExperiments:ir,_version:ce,_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 i=function(){try{var t=JSON.parse(localStorage.getItem(s));return t&&o.test(t.v)&&t.exp>Date.now()?t.v:null}catch(e){return null}},v=function(t){var e="https://cdn.jsdelivr.net/npm/";try{var r=(n&&n.src||"").match(/^(https?:\/\/.+?\/)mk-sdk-git@[^/]+\/dist\/mk-sdk\.js/);r&&(e=r[1])}catch(u){}return e+"mk-sdk-git@"+t+"/dist/mk-core.js"},c=function(t){if(!d){d=!0;var e=document.createElement("script");if(e.src=v(t),e.async=!0,n&&n.attributes)for(var r=0;r<n.attributes.length;r++){var u=n.attributes[r];u.name.indexOf("data-")===0&&e.setAttribute(u.name,u.value)}(document.head||document.documentElement).appendChild(e)}};var l=i,h=v,k=c;if(window.__mkBooted)return;window.__mkBooted=!0;var s="mk_sdk_v",_=10*60*1e3,f=700,o=/^\d+\.\d+\.\d+$/,n=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),d=!1,a=i()||"1.1.120",m=setTimeout(function(){c(a)},f);fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var e=t&&t.version;if(o.test(e))try{localStorage.setItem(s,JSON.stringify({v:e,exp:Date.now()+_}))}catch(r){}clearTimeout(m),c(o.test(e)?e:a)}).catch(function(){clearTimeout(m),c(a)})}catch(i){}})();})();
1
+ (()=>{(function(){try{let i=function(){try{var t=JSON.parse(localStorage.getItem(s));return t&&o.test(t.v)&&t.exp>Date.now()?t.v:null}catch(e){return null}},v=function(t){var e="https://cdn.jsdelivr.net/npm/";try{var r=(n&&n.src||"").match(/^(https?:\/\/.+?\/)mk-sdk-git@[^/]+\/dist\/mk-sdk\.js/);r&&(e=r[1])}catch(u){}return e+"mk-sdk-git@"+t+"/dist/mk-core.js"},c=function(t){if(!d){d=!0;var e=document.createElement("script");if(e.src=v(t),e.async=!0,n&&n.attributes)for(var r=0;r<n.attributes.length;r++){var u=n.attributes[r];u.name.indexOf("data-")===0&&e.setAttribute(u.name,u.value)}(document.head||document.documentElement).appendChild(e)}};var l=i,h=v,k=c;if(window.__mkBooted)return;window.__mkBooted=!0;var s="mk_sdk_v",_=10*60*1e3,f=700,o=/^\d+\.\d+\.\d+$/,n=document.currentScript||document.querySelector("script[data-mk-project]")||document.querySelector('script[src*="mk-sdk"]'),d=!1,a=i()||"1.1.121",m=setTimeout(function(){c(a)},f);fetch("https://api-collector.mk3dlabs.com/v1/sdk/version").then(function(t){return t.ok?t.json():null}).then(function(t){var e=t&&t.version;if(o.test(e))try{localStorage.setItem(s,JSON.stringify({v:e,exp:Date.now()+_}))}catch(r){}clearTimeout(m),c(o.test(e)?e:a)}).catch(function(){clearTimeout(m),c(a)})}catch(i){}})();})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mk-sdk-git",
3
- "version": "1.1.120",
3
+ "version": "1.1.121",
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": [
@@ -74,6 +74,14 @@ export function resolveSkuCandidates() {
74
74
  return r && r.value ? [r] : [];
75
75
  }
76
76
 
77
+ /** Botão de try-on NATIVO do tema (declarado pelo adapter; ex.: Zerezes).
78
+ * { selector, inner } | null — usado pelo nativeButton.js pra coleta passiva
79
+ * (button_rendered/button_clicked) quando o botão é da LOJA, não da SDK. */
80
+ export function nativeTryonButton() {
81
+ const plat = currentPlatform();
82
+ return (plat && plat.nativeTryonButton) || null;
83
+ }
84
+
77
85
  /** Tamanhos da PDP pela plataforma ativa (só as que definem resolveSizes; ex.: Wake).
78
86
  * Passado pro provador (query sdkSizes) como FALLBACK quando o backend não traz
79
87
  * tamanho — ex.: Wake Storefront novo. [] pra plataformas sem resolveSizes. */
@@ -14,6 +14,13 @@ import * as shopify from './shopify.js';
14
14
  export const id = 'zerezes';
15
15
  export const skipRedirect = true; // o fluxo de lentes assume a navegação; nunca vai pro /cart sozinho
16
16
 
17
+ // Botão de provador NATIVO do tema (<vto-gallery-button>, renderizado pelo Liquid
18
+ // em toda PDP; revelado por disponibilidade + CSS do teste A/B da própria loja).
19
+ // A SDK não desenha botão aqui (recipe main.style 'none') — só OBSERVA este
20
+ // elemento pra coleta (tryon/nativeButton.js): rendered quando ganha caixa,
21
+ // clicked no clique. O <button> interno é quem recebe display:none/flex.
22
+ export const nativeTryonButton = { selector: 'vto-gallery-button', inner: 'button' };
23
+
17
24
  // SÓ a Zerezes (host zerezes.* ou shop Shopify cs-zerezes) — não pega outras lojas.
18
25
  export function detect() {
19
26
  try {
@@ -11,6 +11,7 @@ import { getAvailability, open } from './bridge.js';
11
11
  import { resolveAnchor, resolveAnchorObj, pickAnchorVariant } from './anchor.js';
12
12
  import { renderButton, normalizeButtonConfig, readTryOnButton } from './buttons/registry.js';
13
13
  import { getVariantOverride, initExperiments } from '../core/experiments.js';
14
+ import { ensureNativeButtonWatch, stopNativeButtonWatch } from './nativeButton.js';
14
15
 
15
16
  // Id do host ALEATÓRIO por inicialização — sem prefixo semântico (mk/tryon),
16
17
  // pra a loja não conseguir mirar nosso botão nem por id exato nem por prefixo
@@ -365,9 +366,10 @@ export async function maybeMountButton(pageType) {
365
366
  const cfg = getConfig();
366
367
  let _abMain = null; // teste A/B: main efetivo (recipe + override da variante), usado no render
367
368
 
368
- if (pageType !== 'pdp') { removeButton(); stopPdpVariantWatch(); return; }
369
+ if (pageType !== 'pdp') { removeButton(); stopPdpVariantWatch(); stopNativeButtonWatch(); return; }
369
370
  if (!cfg.projectId) return;
370
371
  ensurePdpVariantWatch(); // re-checa o botão quando a cor/variante muda in-page (ex.: Uappi, sem trocar URL)
372
+ ensureNativeButtonWatch(); // coleta passiva do botão NATIVO do tema (só plataformas que declaram; ex.: zerezes)
371
373
 
372
374
  // Posição: a DASHBOARD (template.tryOnButton.anchor) é a fonte da verdade e tem
373
375
  // precedência sobre o window.__MK.anchor inline da loja. O picker (runtime,
@@ -0,0 +1,96 @@
1
+ // nativeButton.js — coleta pro botão de try-on NATIVO do tema (não desenhado
2
+ // pela SDK). Plataformas onde a loja renderiza o próprio botão do provador
3
+ // (ex.: Zerezes, <vto-gallery-button> no Liquid) declaram `nativeTryonButton`
4
+ // no adapter; aqui a gente só OBSERVA — leitura passiva, nada é criado nem
5
+ // alterado no DOM, o fluxo nativo (modal de e-mail, open, lentes) segue intacto.
6
+ //
7
+ // • button_rendered {style:'native'} — quando o botão do tema fica VISÍVEL de
8
+ // fato (rect > 0 no elemento interno). A checagem é geométrica de propósito:
9
+ // pega tanto o gate de disponibilidade (classe .hidden do tema) quanto a
10
+ // variante de teste A/B da loja que revela via CSS (display:none → flex).
11
+ // No grupo de CONTROLE o elemento existe mas nunca ganha tamanho → nunca
12
+ // emite — o que separa as populações do A/B deles no NOSSO funil.
13
+ // • button_clicked {style:'native'} — clique dentro do botão (listener em
14
+ // CAPTURE no documento, pega antes de qualquer stopPropagation do tema).
15
+ //
16
+ // 1 button_rendered por produto/pageview (key = path+sku, mesmo espírito do
17
+ // automount); cliques emitem sempre. Polling leve (1.5s, igual pdpPoll) só
18
+ // enquanto na PDP — stopNativeButtonWatch() desliga fora dela.
19
+
20
+ import { log } from '../core/config.js';
21
+ import { track, markEngaged } from '../core/transport.js';
22
+ import { resolveSku } from '../ecommerce/extractors.js';
23
+ import { nativeTryonButton } from '../platforms/index.js';
24
+
25
+ let armed = null; // { selector, inner } quando observando (null = desligado)
26
+ let poll = null;
27
+ let renderedKey = null; // path|sku já emitido — 1 button_rendered por produto/pageview
28
+ let clickBound = false; // listener de clique é global e único (guard por `armed`)
29
+
30
+ function skuNow() {
31
+ try { const r = resolveSku(); return (r && r.value) || null; } catch (_) { return null; }
32
+ }
33
+
34
+ // Visível DE VERDADE: o elemento interno (o <button> do tema) tem caixa renderizada.
35
+ function isShown(el, innerSel) {
36
+ try {
37
+ const b = innerSel ? el.querySelector(innerSel) : el;
38
+ if (!b) return false;
39
+ const r = b.getBoundingClientRect();
40
+ return r.width > 0 && r.height > 0;
41
+ } catch (_) { return false; }
42
+ }
43
+
44
+ function anyShown() {
45
+ try {
46
+ const els = document.querySelectorAll(armed.selector);
47
+ for (let i = 0; i < els.length; i++) if (isShown(els[i], armed.inner)) return true;
48
+ } catch (_) {}
49
+ return false;
50
+ }
51
+
52
+ function tick() {
53
+ if (!armed) return;
54
+ const key = location.pathname + '|' + (skuNow() || '');
55
+ if (key === renderedKey) return; // já emitido pra este produto/pageview
56
+ if (!anyShown()) return; // ainda 0×0 (indisponível ou controle do A/B da loja)
57
+ renderedKey = key;
58
+ const sku = skuNow();
59
+ track('button_rendered', { style: 'native', sku: sku || null, selector: armed.selector });
60
+ log('native-button: rendered (botão do tema visível)', { sku, selector: armed.selector });
61
+ }
62
+
63
+ function onClickCapture(e) {
64
+ if (!armed) return;
65
+ try {
66
+ const t = e.target;
67
+ const hit = t && t.closest && t.closest(armed.selector);
68
+ if (!hit) return;
69
+ const sku = skuNow();
70
+ markEngaged(); // mesmo efeito do clique no botão próprio: marca o visitante (escopo tryon_engaged)
71
+ track('button_clicked', { style: 'native', sku: sku || null });
72
+ log('native-button: clicked', { sku });
73
+ } catch (_) {}
74
+ }
75
+
76
+ /** Liga a observação do botão nativo (idempotente; no-op se a plataforma não declara). */
77
+ export function ensureNativeButtonWatch() {
78
+ const decl = nativeTryonButton();
79
+ if (!decl || !decl.selector) { stopNativeButtonWatch(); return; }
80
+ armed = decl;
81
+ if (!clickBound) {
82
+ clickBound = true;
83
+ try { document.addEventListener('click', onClickCapture, true); } catch (_) {}
84
+ }
85
+ if (!poll) {
86
+ tick(); // checa já — o botão pode estar visível antes do 1º intervalo
87
+ poll = setInterval(tick, 1500);
88
+ }
89
+ }
90
+
91
+ /** Desliga fora da PDP (o listener de clique fica inerte via `armed`). */
92
+ export function stopNativeButtonWatch() {
93
+ armed = null;
94
+ if (poll) { clearInterval(poll); poll = null; }
95
+ renderedKey = null;
96
+ }