jQuery("#popupDatepicker").click(function(){jQuery(".ui-datepicker").addClass("popupCalendar")}),$(window).on("load",function(){}),$(document).ready(function(){var x=setInterval(function(){flashDealMethod()},1e3);window.pagename=="cart"&&IsFreeGiftProduct(),jQuery.getJSON("/cart.json",function(cart){var cartItems=cart.items;$.each(cartItems,function(index,item){if(item.properties!=null){var variant_id=item.properties.variant_id,quantity=item.quantity;$selector=$(".gift-checkbox-cart[data-variant_id="+variant_id+"]").closest("tr"),$(".gift-checkbox-cart[data-variant_id="+variant_id+"]").attr("checked",!0);var main_qty=$(".gift-checkbox-cart[data-variant_id="+variant_id+"]").closest("tr").find(".quantity-selector__value").val();fillGiftSelectbox($selector,main_qty),$selector.find(".gift-selectbox-cart").show(),$selector.find(".gift-selectbox-cart").val(quantity);var url=location.href,url_array=url.split("/"),url=location.href,url_array=url.split("/");typeof main_qty>"u"&&jQuery.inArray("cart",url_array)!==-1&&variant_id&&(main_qty=0),quantity>main_qty&&removeCartItem(item.key,main_qty)}})}),$(document).on("click",".popupCalendar",function(){$("#account-popover").attr("aria-hidden","false")}),$(document).mouseup(function(e){var container=$("#account-popover,.popupCalendar");!container.is(e.target)&&container.has(e.target).length===0&&($("#account-popover").attr("aria-hidden","true"),$(".ui-datepicker").removeClass("popupCalendar"))}),$("#giftWrap").change(function(){var main_qty=$("select[name='quantity'] option:selected").val();if(main_qty==null)var main_qty=$("input[name='quantity']").val();this.checked&&main_qty>1?$("#giftbox-inside-select").show():$("#giftbox-inside-select").hide()}),$(document).on("change","select[name='quantity'],input[name='quantity']",function(){var qty=$(this).find("option:selected").val();if(qty==null)var qty=$("input[name='quantity']").val();$("#giftWrap").is(":checked")?$("#giftbox-inside-select").show():$("#giftbox-inside-select").hide(),$("#giftbox-inside-select").html("");for(var i=1;i<=qty;i++)$("#giftbox-inside-select").append($("").attr("value",i).text(i));$("#giftbox-inside-select").val(1)}),$(document).on("change",".gift-checkbox-cart",function(){var $selector2=$(this).closest(".line-item--stack"),main_qty=$selector2.find(".quantity-selector__value").val();this.checked?(fillGiftSelectbox($selector2,main_qty),$selector2.find(".gift-selectbox-cart").show()):$selector2.find(".gift-selectbox-cart").hide(),updateGiftCart($(this))}),$(document).on("change",".gift-selectbox-cart",function(){var childQty=$(this).closest("tr").find("option:selected").val(),variant_id=$(this).closest("tr").attr("data-variant_id"),line=$(".line-item__property[data-gift_product="+variant_id+"]").closest("tr").index(),LineRank=parseInt(line)+1;$.ajax({type:"POST",url:"/cart/change.js",data:{line:LineRank,quantity:childQty},dataType:"json",success:function(data){location.reload()}})}),jQuery(document).on("click",".mini-cart__quantity-remove",function(e){var id=$(this).attr("data-line_id"),variant_id=$(this).closest(".mini-cart__line-item").attr("data-variant_id"),line=$(".mini-cart__property[data-gift_product="+variant_id+"]").closest(".mini-cart__line-item").index();line==-1&&removeCartItem(id);var LineRank=parseInt(line)+1;$.ajax({type:"POST",url:"/cart/change.js",data:{line:LineRank,quantity:0},dataType:"json",success:function(data){removeCartItem(id)}})})});function flashDealMethod(){$(".flashSaleDiscountLabel").each(function(index,item){var start_time=$(this).attr("data-starttime"),end_time=$(this).attr("data-endtime"),event=new Date,uktime=event.toLocaleString("en-GB",{timeZone:"Europe/London"});uktime=uktime.split(",");var curr_time=get24Hr(tConvert(uktime[1].trim())),start24Time=get24Hr(tConvert(start_time)),end24Time=get24Hr(tConvert(end_time));if(curr_time>=start24Time&&curr_time1&&(time=time.slice(1),time[5]=+time[0]<12?" AM":" PM",time[0]=+time[0]%12||12),time.join("")}function get24Hr(time){var hours=Number(time.match(/^(\d+)/)[1]),AMPM=time.match(/\s(.*)$/)[1];AMPM=="PM"&&hours<12&&(hours=hours+12),AMPM=="AM"&&hours==12&&(hours=hours-12);var minutes=Number(time.match(/:(\d+)/)[1]);return hours=hours*100+minutes,hours}jQuery(function(){jQuery("#register_newsletter").change(function(){if(jQuery(this).is(":checked")){var existingVal=document.getElementById("popupDatepicker").value;existingVal==""?jQuery("#customer-tags").val("newsletter"):jQuery("#customer-tags").val("newsletter,"+existingVal)}else{var existingVal=document.getElementById("popupDatepicker").value;jQuery("#customer-tags").val(existingVal)}})}),jQuery(function(){jQuery("#registerpage_newsletter").change(function(){if(jQuery(this).is(":checked")){var existingVal=document.getElementById("registrationDatepicker").value;existingVal==""?jQuery("#newsLetterTag").val("newsletter"):jQuery("#newsLetterTag").val("newsletter,"+existingVal)}else{var existingVal=document.getElementById("registrationDatepicker").value;jQuery("newsLetterTag").val(existingVal)}})}),jQuery(function(){jQuery("#register_newsletter_cart").change(function(){if(jQuery(this).is(":checked")){var existingVal=document.getElementById("cartDatepicker").value;existingVal==""?jQuery("#newsLetterTagCart").val("newsletter"):jQuery("#newsLetterTagCart").val("newsletter,"+existingVal)}else{var existingVal=document.getElementById("cartDatepicker").value;jQuery("#newsLetterTagCart").val(existingVal)}})}),document.addEventListener("product:added",function(event){var variant=event.detail.variant,quantity=event.detail.quantity;return event.preventDefault(),!1});var divs=["info","orders","referal","Menu3","Menu4"],visibleDivId=null,currentPage=window.location.href.split("#")[1];if(window.location.hash="",currentPage===void 0){var currentRoute=window.location.href.split("/")[3];if(currentRoute=="account"){var currentSubRoute=window.location.href.split("/")[4];currentSubRoute=="addresses"||currentSubRoute=="login"||currentSubRoute=="register"?currentPage=void 0:(currentSubRoute===void 0||currentSubRoute=="")&&(currentPage="info")}else currentPage=void 0}else if(currentPage==""||currentPage==null){var currentRoute=window.location.href.split("/")[3],currentSubRoute=window.location.href.split("/")[4];currentRoute=="account#"&¤tSubRoute===void 0?currentPage="info":currentPage=void 0}else if(currentPage!="orders")currentPage=void 0;else if(currentPage=="orders"){var currentSubRoute=window.location.href.split("/")[4];currentSubRoute!=null&¤tSubRoute.includes("login")&&(currentPage=void 0)}currentPage==""?toggleVisibility("info"):currentPage!==void 0&&toggleVisibility(currentPage);function toggleVisibility(divId){document.getElementById("account-selector").setAttribute("aria-hidden","false"),visibleDivId=null,visibleDivId===divId?visibleDivId=null:divId===void 0?(document.getElementById("account-selector").setAttribute("aria-hidden","true"),visibleDivId="info"):visibleDivId=divId,hideNonVisibleDivs()}function hideNonVisibleDivs(){var i,divId,div;for(i=0;i"u"){product_item=$(el).attr("data-product-data"),product_item=$.parseJSON(product_item);var setPriceFormat=product_item.price,sku=product_item.variants[0].sku}else{product_item=$.parseJSON(product_item);var setPriceFormat=product_item.price/100,sku=product_item.variants[0].sku}window.pagename!="cart"&&checkFreeProductPopup(setPriceFormat,product_item.id);var modal=document.getElementById("free-pop-choice");$("#free-pop-choice").attr("style").split(":")[1].trim()=="visible;"&&(modal.style.visibility="hidden",modal.classList.remove("show"));var moneyFormat=theme.moneyFormat,price=moneyFormat.replace("{{amount}}",setPriceFormat),curncy=GlobalE.Currency?GlobalE.Currency:window.yCurrencyCode;dataLayer.push({ecommerce:null}),dataLayer.push({event:"add_to_cart",ecommerce:{currencyCode:curncy,add:{products:[{name:product_item.title,id:product_item.id,price,nocurencyprice:setPriceFormat,brand:product_item.vendor,category:product_item.type,quantity:1,sku}]}}}),window.location.href.indexOf("cart")>=0&&setTimeout(function(){location.reload(!0)},2e3)}function onnotifyClick(el){var product_item=$(el).attr("data-product-data");product_item=$.parseJSON(product_item),dataLayer.push({ecommerce:null}),dataLayer.push({event:"notifyClick",ecommerce:{notifyClick:{products:[{name:product_item.title,id:product_item.id,sku:product_item.variants[0].sku}]}}})}function removeFromCartDataLayer(productData){dataLayer.push({ecommerce:null}),dataLayer.push({event:"removeFromCart",currency:GlobalE.Currency,ecommerce:{remove:{products:[{id:productData.attr("data-line_item-id"),price:productData.attr("data-line_item-price"),quantity:productData.attr("data-line_item-quantity")}]}}})}function removeCartItem(id,qty=0){$.ajax({type:"POST",url:"/cart/change.js",data:{id,quantity:qty},dataType:"json",success:function(data){location.reload()}})}function updateGiftCart($selector2){var totalGiftQtyCount=0,variant_id=$selector2.closest("tr").attr("data-variant_id"),title=$selector2.closest("tr").attr("data-variant_name"),sku=$selector2.closest("tr").attr("data-sku"),line=$(".line-item__property[data-gift_product="+variant_id+"]").closest("tr").index(),LineRank=parseInt(line)+1;if($selector2.closest("tr").find(".gift-checkbox-cart").is(":checked")){var childQty=$selector2.closest("tr").find("option:selected").val(),product_type=$selector2.closest("tr").find(".gift-checkbox-cart").attr("data-variant-type"),new_gift_id=$selector2.closest("tr").find(".gift-selectbox-cart").attr("data-child-id");$.ajax({type:"POST",url:"/cart/add.js",data:{id:new_gift_id,quantity:childQty,properties:{variant_id,For:title,REFSKU:sku}},dataType:"json",success:function(data){location.reload()}})}else{var childQty=0;$.ajax({type:"POST",url:"/cart/change.js",data:{line:LineRank,quantity:childQty},dataType:"json",success:function(data){location.reload()}})}}function fillGiftSelectbox($selector2,main_qty){$selector2.find(".gift-selectbox-cart").html("");for(var i=1;i<=main_qty;i++)$selector2.find(".gift-selectbox-cart").append($("").attr("value",i).text(i));$selector2.find(".gift-selectbox-cart").val(1)}function openPreOrderDetails(){var modal=document.getElementById("Mondomodel"),span=document.getElementsByClassName("close")[0];document.onload=setTimeout(function(){modal.style.display="block"},100),span.onclick=function(){modal.style.display="none"},window.onclick=function(event){event.target==modal&&(modal.style.display="none")}}function openGiftBoxDetails(){var modal=document.getElementById("giftBoxModal"),span=document.getElementsByClassName("close")[0];document.onload=setTimeout(function(){modal.style.display="block"},100),span.onclick=function(){modal.style.display="none"},window.onclick=function(event){event.target==modal&&(modal.style.display="none")}}$(document).on("click",".close",function(){$("#chaseBoxModal").hide(),$("#giftBoxModal").hide(),$("#free-pop-choice").hide(),$("#Mondomodel").hide()});function giftBoxBtnClose(){var modal=document.getElementById("giftBoxModal");modal.style.display="none"}$(document).on("click",".openChaseBoxClick",function(e){e.preventDefault();var modal=document.getElementById("chaseBoxModal"),span=document.getElementsByClassName("close")[0];return document.onload=setTimeout(function(){modal.style.display="block"},100),span.onclick=function(){modal.style.display="none"},window.onclick=function(event){event.target==modal&&(modal.style.display="none")},!1}),$(document).on("click",".openfreepopClick",function(e){e.preventDefault();var modal=document.getElementById("free-pop-choice"),span=document.getElementsByClassName("close-hide")[0];return document.onload=setTimeout(function(){modal.style.visibility="visible",modal.classList.add("show")},100),span.onclick=function(){modal.style.visibility="hidden",modal.classList.remove("show")},window.onclick=function(event){event.target==modal&&(modal.style.visibility="hidden",modal.classList.remove("show"))},!1});function chaseBoxBtnClose(){var modal=document.getElementById("chaseBoxModal");modal.style.display="none"}jQuery("#logOutUrl").on("click",function(event){event.preventDefault();var href=jQuery(this).attr("href"),target="";delete_cookie("cart"),setTimeout(function(){window.open(href,target||"_self")},150)}),jQuery.noConflict(),setTimeout(function(){jQuery(".customitems").each(function(){if(jQuery(this).data("country")!=""){var cntry=jQuery(this).data("country"),str1=window.Shopify.country;cntry.search(str1)>=0&&(jQuery(".product-item__action-list.button-stack",this).remove(),jQuery(".product-item__info-inner",this).after(""),console.log("Data Attr Country js = "+jQuery(this).data("country")))}})},3500);function checkFreeProductPopup(price,product_id){var freeProductArr=[];$(".freepopvalidate").each(function(){freeProductArr.push(jQuery(this).data("id"))});var setPriceFormat=price*100;jQuery.getJSON("/cart.json",function(cart){var totalCartValue=cart.total_price+setPriceFormat,cartProductArr=[],cartItems=cart.items,allfrecokie=getCookie("allfreepop"),isFreeProductInCart=!1,isFreePriceItem=!1,isFreeProductNotLabel=!1;$.each(cart.items,function(index,item){item.discounted_price||(isFreeProductInCart=!0)}),cartItems.push({product_id,price:setPriceFormat}),$.each(cartItems,function(index,item){var cart_product_id=item.product_id,line_single_price=item.price;cartProductArr.push(item.product_id),isFreeProductInCart||$.each(freeProductArr,function(index2,item2){if(cart_product_id==item2){var netCartValue=totalCartValue-line_single_price;isFreeProductNotLabel=!0,netCartValue>=window.freePopProductThresold&&(isFreePriceItem=!0)}})}),!isFreeProductNotLabel&&totalCartValue>=window.freePopProductThresold&&(isFreePriceItem=!0),isFreePriceItem&&!isFreeProductInCart&&allfrecokie==""&&($("#cart-freelabel").show(),shwoingFreePop())})}function shwoingFreePop(){var modal=document.getElementById("free-pop-choice");$("#free-pop-choice").attr("style").split(":")[1].trim()=="visible;"?(modal.style.visibility="hidden",modal.classList.remove("show")):document.onload=setTimeout(function(){modal.style.visibility="visible",modal.classList.add("show"),setCookie("allfreepop","1",1)},100),window.onclick=function(event){event.target==modal&&(modal.style.visibility="hidden",modal.classList.remove("show"))}}function getCookie(cname){for(var name=cname+"=",ca=document.cookie.split(";"),i=0;iarr2.includes(item))}function IsFreeGiftProduct(){var freeProductArr=[];$(".freepopvalidate").each(function(){freeProductArr.push(jQuery(this).data("id"))}),jQuery.getJSON("/cart.json",function(cart){var cartProductArr=[],isFreeProductInCart=!1,isFreePriceItem=!1,totalCartValue=cart.total_price;if($.each(cart.items,function(index,item){item.discounted_price||(isFreeProductInCart=!0)}),$.each(cart.items,function(index,item){var cart_product_id=item.product_id,line_single_price=item.price;cartProductArr.push(item.product_id),isFreeProductInCart||$.each(freeProductArr,function(index2,item2){if(cart_product_id==item2){var netCartValue=totalCartValue-line_single_price;netCartValue>window.freePopProductThresold&&(isFreePriceItem=!0)}})}),isFreePriceItem)$("#cart-freelabel").show();else{$("#cart-freelabel").hide();var isFreeProduct=findCommonElements3(freeProductArr,cartProductArr);isFreeProduct||$("#cart-freelabel").show()}var cartfreepop=getCookie("cartfreepop"),isFreeProduct=findCommonElements3(freeProductArr,cartProductArr);totalCartValue>=window.freePopProductThresold&&cartfreepop==""&&!isFreeProduct&&(setCookie("cartfreepop",1,1),shwoingFreePop())}),$(' Free').insertAfter($("#free-pop-choice .price"))} //# sourceMappingURL=/cdn/shop/t/5/assets/custom.js.map?v=125889794364248130181730948576