!function(){function t(){if(this.complete){var e=this.getAttribute("data-lazy-src");if(e&&this.src!==e)this.addEventListener("onload",t);else{var d=this.width,n=this.height;d&&d>0&&n&&n>0&&(this.setAttribute("width",d),this.setAttribute("height",n),i(this))}}else this.addEventListener("onload",t)}var e=function(){for(var e=document.querySelectorAll("img[data-recalc-dims]"),i=0;i0?(document.body.classList.remove("cart-is-empty"),document.body.classList.add("cart-not-empty")):(document.body.classList.add("cart-is-empty"),document.body.classList.remove("cart-not-empty"))}o&&o.forEach((function(o){var a;a=setInterval((function(){e&&(o.removeAttribute("aria-disabled"),clearInterval(a))}),500),o.addEventListener("click",(function(e){if(e.preventDefault(),"true"===o.getAttribute("aria-disabled"))return;o.setAttribute("aria-disabled","true");var a=o.closest("form");product_qty=a?a.querySelector("input[name=quantity]").value:1;var c={},n=o.dataset;for(const t in n)c[t]=n[t];c.quantity=product_qty,t(document.body).trigger("adding_to_cart",[o,c]);let i=!1;return t.ajax({type:"POST",url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),data:c,success:function(e){if(e){if(t(".tonal_add_to_cart_error").css("visibility","hidden"),e.error&&e.product_url.product_id){let o=".tonal_add_to_cart_error_"+e.product_url.product_id,a=t(o);return a.text(e.product_url.error_message),a.css("visibility","visible"),void(i=!0)}e.error&&e.product_url?window.location=e.product_url:(t(document.body).trigger("added_to_cart",[e.fragments,e.cart_hash,o]),r(e))}},complete:function(){o.removeAttribute("aria-disabled"),i||(o.classList.add("product-added"),o.textContent="Added",setTimeout((function(){o.classList.remove("product-added"),o.textContent="Add to Cart"}),3e3),t("#wooMiniCart").collapse("show"))}}),!1}))})),t(document).on("click","#wooMiniCart .link-remove",(function(e){e.preventDefault(),t("#wooMiniCart").addClass("disabled"),$btnremove=t(this),t.ajax({type:"POST",url:woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),data:{cart_item_key:$btnremove.data("cart_item_key")},success:function(e){e&&e.fragments?(t(document.body).trigger("removed_from_cart",[e.fragments,e.cart_hash,$btnremove]),t(".tonal_add_to_cart_error").css("visibility","hidden"),r(e),t("#wooMiniCart").removeClass("disabled")):window.location=$btnremove.attr("data-href")},error:function(){window.location=$btnremove.attr("data-href")},dataType:"json"})})),t(document).on("change input",".woocommerce-cart-form .mini_cart_item input.qty",(function(){t(this).prop("defaultValue")!==t(this).val()?t('.woocommerce-cart-form button[name="update_cart"]').attr("aria-disabled",!1):t('.woocommerce-cart-form button[name="update_cart"]').attr("aria-disabled",!0)})),t(document).on("submit",".widget_shopping_cart_content .woocommerce-cart-form",(function(e){e.preventDefault();var o=!1;if(this.querySelectorAll("input.qty").forEach((function(t){t.defaultValue!==t.value&&(o=!0)})),o){t("#wooMiniCart").addClass("disabled");var a=t(e.currentTarget);t(".woocommerce-cart-form").find(':input[name="update_cart"]').attr("aria-disabled",!0),t("").attr("type","hidden").attr("name","update_cart").attr("value","Update Cart").attr("class","cart_hidden_update_btn").appendTo(a),t.ajax({type:a.attr("method"),url:a.attr("action"),data:a.serialize(),dataType:"html",success:function(e){r(e),c(e),t("#wooMiniCart").removeClass("disabled")}})}}));var c=function(e){var o=t.parseHTML(e),a=t(".woocommerce-cart-form:not(.tonal-cart-page)",o),r=t(".woocommerce-mini-cart__total .woocommerce-Price-amount",o),c=i(t(".woocommerce-error, .woocommerce-message, .woocommerce-info",o));window.tonal_update_wc_div={html:o,new_form:a,new_totals:r,notices:c};let s=t(".woocommerce-cart-form");if(0!==s.length){if(0===a.length){var m=t(".cart-empty",o).closest(".woocommerce");t(".woocommerce-cart-form__contents").closest(".woocommerce").replaceWith(m),c.length>0&&d(c),t(document.body).trigger("wc_cart_emptied")}else s.replaceWith(a[0]),s.find(':input[name="update_cart"]').attr("aria-disabled",!0),c.length>0&&d(c),n(r[0]);t(document.body).trigger("updated_wc_div")}else window.location.reload()},n=function(e){t(".woocommerce-mini-cart__total .woocommerce-Price-amount").replaceWith(e),t(document.body).trigger("updated_cart_totals")},i=function(e){var o=[],a=e;return e.each((function(e){var r=t(this).text();void 0===o[r]?o[r]=!0:a.splice(e,1)})),a},d=function(e,o){o||(o=t(".widget_shopping_cart_content .woocommerce-notices-wrapper")),o.append(e),setTimeout((function(){o.empty()}),3e3)};t(document).on("show.bs.collapse","#wooMiniCart",(function(e){t("body").addClass("cart-open")})),t(document).on("hide.bs.collapse","#wooMiniCart",(function(e){t("body").removeClass("cart-open")})),t(document).on("click",".widget_shopping_cart_container",(function(e){e.target.classList.contains("widget_shopping_cart_container")&&t("#wooMiniCart").collapse("hide")}))}));; /*! * jQuery blockUI plugin * Version 2.70.0-2014.11.23 * Requires jQuery v1.7 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2013 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ !function(){"use strict";function e(p){p.fn._fadeIn=p.fn.fadeIn;var b=p.noop||function(){},h=/MSIE/.test(navigator.userAgent),k=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),y=(document.documentMode,"function"==typeof document.createElement("div").style.setExpression&&document.createElement("div").style.setExpression),m=(p.blockUI=function(e){o(window,e)},p.unblockUI=function(e){v(window,e)},p.growlUI=function(e,t,o,n){var i=p('
'),s=(e&&i.append("

"+e+"

"),t&&i.append("

"+t+"

"),o===undefined&&(o=3e3),function(e){p.blockUI({message:i,fadeIn:"undefined"!=typeof(e=e||{}).fadeIn?e.fadeIn:700,fadeOut:"undefined"!=typeof e.fadeOut?e.fadeOut:1e3,timeout:"undefined"!=typeof e.timeout?e.timeout:o,centerY:!1,showOverlay:!1,onUnblock:n,css:p.blockUI.defaults.growlCSS})});s(),i.css("opacity");i.on("mouseover",function(){s({fadeIn:0,timeout:3e4});var e=p(".blockMsg");e.stop(),e.fadeTo(300,1)}).on("mouseout",function(){p(".blockMsg").fadeOut(1e3)})},p.fn.block=function(e){var t;return this[0]===window?(p.blockUI(e),this):(t=p.extend({},p.blockUI.defaults,e||{}),this.each(function(){var e=p(this);t.ignoreIfBlocked&&e.data("blockUI.isBlocked")||e.unblock({fadeOut:0})}),this.each(function(){"static"==p.css(this,"position")&&(this.style.position="relative",p(this).data("blockUI.static",!0)),this.style.zoom=1,o(this,e)}))},p.fn.unblock=function(e){return this[0]===window?(p.unblockUI(e),this):this.each(function(){v(this,e)})},p.blockUI.version=2.7,p.blockUI.defaults={message:"

Please wait...

",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1},null),g=[];function o(e,o){var n=e==window,t=o&&o.message!==undefined?o.message:undefined;if(!(o=p.extend({},p.blockUI.defaults,o||{})).ignoreIfBlocked||!p(e).data("blockUI.isBlocked")){o.overlayCSS=p.extend({},p.blockUI.defaults.overlayCSS,o.overlayCSS||{}),f=p.extend({},p.blockUI.defaults.css,o.css||{}),o.onOverlayClick&&(o.overlayCSS.cursor="pointer"),u=p.extend({},p.blockUI.defaults.themedCSS,o.themedCSS||{}),t=t===undefined?o.message:t,n&&m&&v(window,{fadeOut:0}),t&&"string"!=typeof t&&(t.parentNode||t.jquery)&&(l=t.jquery?t[0]:t,d={},p(e).data("blockUI.history",d),d.el=l,d.parent=l.parentNode,d.display=l.style.display,d.position=l.style.position,d.parent&&d.parent.removeChild(l)),p(e).data("blockUI.onUnblock",o.onUnblock);var i,s,l=o.baseZ,d=h||o.forceIframe?p(''):p(''),a=o.theme?p(''):p(''),c=(o.theme&&n?(c=''):o.theme?(c=''):c=n?'':'',l=p(c),t&&(o.theme?(l.css(u),l.addClass("ui-widget-content")):l.css(f)),o.theme||a.css(o.overlayCSS),a.css("position",n?"fixed":"absolute"),(h||o.forceIframe)&&d.css("opacity",0),[d,a,l]),r=p(n?"body":e),u=(p.each(c,function(){this.appendTo(r)}),o.theme&&o.draggable&&p.fn.draggable&&l.draggable({handle:".ui-dialog-titlebar",cancel:"li"}),y&&(!p.support.boxModel||0 .blockUI"):s.find(">.blockUI"),t.cursorReset&&(1'),s(".woocommerce form input").filter(":password").parent("span").addClass("password-input"),s(".password-input").append(''),s(".show-password-input").on("click",function(){s(this).hasClass("display-password")?s(this).removeClass("display-password"):s(this).addClass("display-password"),s(this).hasClass("display-password")?s(this).siblings(['input[type="password"]']).prop("type","text"):s(this).siblings('input[type="text"]').prop("type","password")})});; document.addEventListener("focusin", function(event) { const elem = event && event.target && event.target.closest && event.target.closest("input,select,textarea,button,meter,progress"); if ( elem ) { window[ gtm4wp_datalayer_name ].push({ 'event' : 'gtm4wp.formElementEnter', 'inputID' : elem.getAttribute("id") || "(no input ID)", 'inputName' : elem.getAttribute("name") || "(no input name)", 'inputClass': elem.getAttribute("class") || "(no input class)", 'formID' : (elem.form && elem.form.getAttribute("id")) || "(no form ID)", 'formName' : (elem.form && elem.form.getAttribute("name")) || "(no form name)", 'formClass': (elem.form && elem.form.getAttribute("class")) || "(no form class)" }); } }, false); document.addEventListener("focusout", function(event) { const elem = event && event.target && event.target.closest && event.target.closest("input,select,textarea,button,meter,progress"); if ( elem ) { window[ gtm4wp_datalayer_name ].push({ 'event' : 'gtm4wp.formElementLeave', 'inputID' : elem.getAttribute("id") || "(no input ID)", 'inputName' : elem.getAttribute("name") || "(no input name)", 'inputClass': elem.getAttribute("class") || "(no input class)", 'formID' : (elem.form && elem.form.getAttribute("id")) || "(no form ID)", 'formName' : (elem.form && elem.form.getAttribute("name")) || "(no form name)", 'formClass': (elem.form && elem.form.getAttribute("class")) || "(no form class)" }); }; }, false); ; /*! This file is auto-generated */ window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o