1(function(){"use strict";if(window.PGMugPromotionV104Installed)return;window.PGMugPromotionV104Installed=!0;var cfg=window.PGMugPromotionV104||{},country=String(cfg.country||"").toUpperCase(),isUS=country==="US",isUK=country==="GB"||country==="UK";if(!isUK&&!isUS)return;var threshold=isUS?"$86":"\xA365",mugValue=isUS?"$39.99":"\xA329.99",message="Free matching mug when you spend "+threshold,lastTrigger=null;function mugIcon(className){return'<svg class="'+className+'" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><path d="M12 8c1.1 3.9 3.4 6.2 7.3 7.3C15.4 16.4 13.1 18.7 12 22.6 10.9 18.7 8.6 16.4 4.7 15.3 8.6 14.2 10.9 11.9 12 8Z" fill="#C49A52"/><circle cx="21.5" cy="11.5" r="2" fill="#D98C97"/><path d="M18.5 20.5h27v24.2A9.3 9.3 0 0 1 36.2 54h-8.4a9.3 9.3 0 0 1-9.3-9.3V20.5Z" fill="#FFFDFB" stroke="#C49A52" stroke-width="3.4"/><path d="M19.5 21h25" stroke="#C49A52" stroke-width="4" stroke-linecap="round"/><path d="M45.5 27h3.6a7.8 7.8 0 0 1 0 15.6h-3.6" fill="none" stroke="#C49A52" stroke-width="4" stroke-linecap="round"/><g fill="#D98C97"><ellipse cx="32" cy="40" rx="5.4" ry="4.7"/><circle cx="26.2" cy="34.2" r="2.5"/><circle cx="30.8" cy="31.8" r="2.5"/><circle cx="35.8" cy="32.1" r="2.5"/><circle cx="39.6" cy="34.8" r="2.5"/></g><path d="M22 26.5h19" stroke="#1F2A3C" stroke-width="1.5" stroke-linecap="round" opacity=".55"/></svg>'}function removeOldPromoLayers(){document.querySelectorAll(".pg-mug-announcement-v104,.pg-mug-home-feature-v104,.pg-mug-product-note-v104").forEach(function(el){el.remove()})}function useExistingAnnouncement(){var root=document.querySelector("#new_announce,.new_swiper_announce");if(root){var target=root.querySelector(".announce-bar__message");target&&(target.textContent=message,target.style.textTransform="none",target.style.letterSpacing="normal")}}function eligiblePortraitPage(){var path=String(window.location.pathname||"").toLowerCase();return/\/products\//.test(path)?!/(mug|phone-case|phone_case|cushion|blanket|first-in-line|first_in_line|express-2-day|onward-package-protection|change-of-photo|gift-card|gift_card|digital-image-download|digital_download)/.test(path):!1}function buildBadge(context){var button=document.createElement("button");return button.type="button",button.className="pg-mug-badge-v104 pg-mug-badge-v104--"+context,button.setAttribute("aria-haspopup","dialog"),button.setAttribute("aria-controls","pg-mug-dialog-v104"),button.setAttribute("aria-label",message+". Tap for details."),button.innerHTML='<span class="pg-mug-badge-v104__mark">'+mugIcon("pg-mug-badge-v104__icon")+'</span><span class="pg-mug-badge-v104__label">Free mug</span><small>'+threshold+"</small>",button.addEventListener("click",function(){openDialog(button)}),button}function positionProductBadge(){var host=document.querySelector(".pg-mug-product-overlay-host-v104"),badge=document.querySelector(".pg-mug-badge-v104--product"),gallery=host&&host.querySelector(".product_gallery");if(!(!host||!badge||!gallery)){var hostRect=host.getBoundingClientRect(),galleryRect=gallery.getBoundingClientRect();if(!(!galleryRect.width||!galleryRect.height)){var pad=window.innerWidth<=798?12:16,badgeSize=badge.offsetWidth||(window.innerWidth<=798?74:86),top=galleryRect.bottom-hostRect.top-badgeSize-pad,right=hostRect.right-galleryRect.right+pad;badge.style.top=Math.max(pad,top)+"px",badge.style.right=Math.max(pad,right)+"px",badge.style.bottom="auto",badge.style.left="auto"}}}function addProductBadge(){if(eligiblePortraitPage()){var existing=document.querySelector(".pg-mug-badge-v104--product");if(existing){positionProductBadge();return}var host=document.querySelector(".product__images"),gallery=host&&host.querySelector(".product_gallery");!host||!gallery||(host.classList.add("pg-mug-product-overlay-host-v104"),host.appendChild(buildBadge("product")),window.requestAnimationFrame(positionProductBadge))}}function addHomeBadge(){if(!document.querySelector(".pg-mug-badge-v104--home")){var hero=document.querySelector(".pg-home-hero__inner");hero&&(hero.classList.add("pg-mug-badge-host-v104"),hero.appendChild(buildBadge("home")))}}function ensureDialog(){var dialog=document.getElementById("pg-mug-dialog-v104");return dialog||(dialog=document.createElement("div"),dialog.id="pg-mug-dialog-v104",dialog.className="pg-mug-dialog-v104",dialog.hidden=!0,dialog.innerHTML='<div class="pg-mug-dialog-v104__backdrop" data-pg-mug-close></div><div class="pg-mug-dialog-v104__panel" role="dialog" aria-modal="true" aria-labelledby="pg-mug-dialog-title-v104"><button type="button" class="pg-mug-dialog-v104__close" data-pg-mug-close aria-label="Close">\xD7</button><div class="pg-mug-dialog-v104__mark">'+mugIcon("pg-mug-dialog-v104__icon")+'</div><p class="pg-mug-dialog-v104__eyebrow">A little extra on us</p><h2 id="pg-mug-dialog-title-v104">Free matching mug</h2><p class="pg-mug-dialog-v104__lead">Spend '+threshold+" or more and you can claim a free matching mug worth "+mugValue+' in your cart.</p><div class="pg-mug-dialog-v104__details"><span>Same artwork</span><span>No code needed</span><span>Claim in your cart</span></div><p class="pg-mug-dialog-v104__aside">Same excellent face. Different vessel.</p></div>',document.body.appendChild(dialog),dialog.querySelectorAll("[data-pg-mug-close]").forEach(function(el){el.addEventListener("click",closeDialog)}),document.addEventListener("keydown",function(event){event.key==="Escape"&&!dialog.hidden&&closeDialog()}),dialog)}function openDialog(trigger){lastTrigger=trigger;var dialog=ensureDialog();dialog.hidden=!1,document.documentElement.classList.add("pg-mug-dialog-open-v104");var close=dialog.querySelector(".pg-mug-dialog-v104__close");close&&close.focus()}function closeDialog(){var dialog=document.getElementById("pg-mug-dialog-v104");dialog&&(dialog.hidden=!0,document.documentElement.classList.remove("pg-mug-dialog-open-v104"),lastTrigger&&document.body.contains(lastTrigger)&&lastTrigger.focus())}function rewardProp(item,key){return item&&item.properties&&item.properties[key]!=null?String(item.properties[key]):""}function rewardLinePrice(item){return Number(item&&item.final_line_price!=null?item.final_line_price:item&&item.line_price||0)}function rewardQty(item){return Math.max(1,Number(item&&item.quantity||1))}function isRewardLine(item){var id=Number(item&&item.variant_id);return id===51255823335676||id===51223262560508||id===51223262593276||!!rewardProp(item,"_pg_reward")||!!rewardProp(item,"_pg_reward_v101")}function isProtectionLine(item){return!item||isRewardLine(item)?!1:/onward|checkout\s*\+|checkoutplus|checkout-plus|order protection/.test([item.title,item.product_title,item.product_type,item.vendor,rewardProp(item,"_pg_protection"),rewardProp(item,"Protection")].join(" ").toLowerCase())}function isPaidMugLine(item){return!!item&&!isRewardLine(item)&&(Number(item.variant_id)===51255831331068||rewardProp(item,"_pg_upsell_type")==="mug")}function ukMugSpend(cart){var total=Number(cart&&cart.total_price||0);
1(cart&&cart.items||[]).forEach(function(item){(isRewardLine(item)||isProtectionLine(item))&&(total-=rewardLinePrice(item))}),total=Math.max(0,total);var converted=(cart&&cart.items||[]).some(function(item){return Number(item&&item.variant_id)===51255823335676&&rewardProp(item,"_pg_converted_paid_mug")==="true"}),paidMug=(cart&&cart.items||[]).find(isPaidMugLine);return!converted&&paidMug&&(total-=Math.round(rewardLinePrice(paidMug)/rewardQty(paidMug))),Math.max(0,total)}function correctUkRewardProgress(cart){if(!(!isUK||!cart)){var spend=ukMugSpend(cart),thresholds=[0,6500,9500,12e3],pct=0;if(spend>=thresholds[thresholds.length-1])pct=100;else for(var i=1;i<thresholds.length;i+=1)if(spend<thresholds[i]){var span=thresholds[i]-thresholds[i-1],part=span>0?(spend-thresholds[i-1])/span:0;pct=(i-1+Math.max(0,Math.min(1,part)))/(thresholds.length-1)*100;break}document.querySelectorAll(".pg-reward-rail__fill").forEach(function(fill){fill.style.width=Math.max(0,Math.min(100,pct))+"%"})}}function init(){removeOldPromoLayers(),useExistingAnnouncement(),ensureDialog(),addHomeBadge(),addProductBadge(),document.addEventListener("pg:cart-synchronised",function(event){event&&event.detail&&event.detail.cart&&correctUkRewardProgress(event.detail.cart)}),window.addEventListener("resize",positionProductBadge,{passive:!0}),window.addEventListener("load",positionProductBadge,{once:!0});var tries=0,timer=window.setInterval(function(){tries+=1,removeOldPromoLayers(),useExistingAnnouncement(),addHomeBadge(),addProductBadge(),positionProductBadge(),tries>=32&&window.clearInterval(timer)},250);if(window.MutationObserver&&eligiblePortraitPage()){var gallery=document.querySelector(".product_gallery");gallery&&new MutationObserver(function(){window.requestAnimationFrame(positionProductBadge)}).observe(gallery,{attributes:!0,subtree:!0,attributeFilter:["class","style"]})}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init,{once:!0}):init()})(); 2//# sourceMappingURL=/cdn/shop/t/424/assets/pg-mug-promotion-v104.js.map?v=25074018586842222331790980997
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.