!function(){if(Array.prototype.includes||(Array.prototype.includes=function(e){return!!~this.indexOf(e)}),window.addEventListener("pageshow",function(e){e.persisted&&setTimeout(function(){window.location.reload()},10)},!1),window.rterms=window.rterms||{},rterms.metafield=rterms.metafield||{},rterms.settings=rterms.settings||{},!(rterms.ran||rterms.settings.only_cart_page&&!window.location.pathname.match(/\/cart/))){rterms.checkouts=[],rterms.checkoutEvents=[],rterms.addedEvents=!1;var e="https://terms-relentless.herokuapp.com/statistics-event",t=rterms.checkoutEl||'[name="checkout"]:not([type="hidden"], .checkout-link__button, .tpo-btn-checkout, .cart-title-button), .cart--totals .cart--nav, a[href^="/checkout"]:not(.cart-count), a[href="/account/login"].cart__submit, button[type="submit"].btn-order, a.btn.cart__checkout, a.cart__submit, input.action_button[value="Checkout"], .wc-proceed-to-checkout button, #cart_form .buttons .btn-primary, a.cart_adev_o, [data-limoniapps-discountninja-checkoutlink], form > button.checkout-button, button.btn_checkout, button.checkout-btn, button[data-href="/checkout"], .cart__footer > .table_medium_up:nth-child(2), #cart-summary .cart-summary__section .btn--empty-cart, button.qsc2-checkout-button, .cd-checkout-section-container .cd-checkout-section-button, .cart__checkout-button:not([data-fp-open]), .rebuy-cart__checkout-button, redo-shopify-toggle, [name^="button-route"], [name^="button-route"] + small, small[button-without-protection-1], small[button-without-protection-2], small[button-without-protection-3], small[button-without-protection-4], #mu-checkout-button, .samitaWS-clone-checkout-button, .halo-sidebar-wrapper button#cart-sidebar-checkout';"zy08in-4c.myshopify.com"!==Shopify.shop&&(t+=", .meety-button-primary"),rterms.settings.cart_title_button&&"on"==rterms.settings.cart_title_button&&(t+=', [name="checkout"].cart-title-button');var r='[data-shopify="payment-button"], [tac-bin-override="true"], shopify-buy-it-now-button, [class*="shopify-payment-button"], gp-product-button[gp-data*="buy-now"]',o=!rterms._3lj2l&&rterms.metafield.precheck&&"on"===rterms.metafield.precheck,n=!rterms._3lj2l&&rterms.metafield.dynamic&&"on"===rterms.metafield.dynamic,i=!rterms._3lj2l&&rterms.metafield.optional&&"on"===rterms.metafield.optional,s=o||null,a="";window.location.pathname.match(/\/cart$/)||(a+=":not(.rterms-modal) > .terms-relentless { justify-content: flex-start !important; text-align: left !important; padding-left: 4px; }"),"left"===rterms.metafield.alignment?a+=".terms-relentless { justify-content: flex-start !important; text-align: left !important; }":"center"===rterms.metafield.alignment?a+=".terms-relentless { justify-content: center !important; text-align: center !important; }":"right"===rterms.metafield.alignment&&(a+=".terms-relentless { justify-content: flex-end !important; text-align: right !important; }");var c=document.createElement("style");c.innerHTML=a,rterms.ajaxCartStyle&&(c.innerHTML+=rterms.ajaxCartStyle),document.head.appendChild(c);var l=rterms.metafield.text;l||(l='I accept the terms of service.'),!l.match(/href="/)&&(l=(l=l.replace(/(terms and conditions|terms of service)/,'$1')).replace(/(privacy-policy)/,'$1')),rterms.checkout=function(e){if(e&&!e.isTrusted)return;document.querySelectorAll(".rterms-checkbox").forEach(function(e){e.checked&&function(e){var t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity}(e)&&(s=!0)}),s||(alert(rterms.metafield.alert_message||"Please select the terms of service"),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation(),setTimeout(function(){e.target&&(e.target.className=e.target.className.replace("btn--loading",""),e.target.disabled=!1)},500)))},rterms.ran=!0,window.ZapietCheckoutEnabled=!1,m(t,function(e){if(e.closest("cart-notification")&&window.location.pathname.match(/\/cart/))return;rterms.checkouts.push(e),!i&&(rterms.settings.cover||"on"==rterms.metafield.cover||window.Rebuy||window.preOrderAppProxy||window.opusRefreshCart||window.Route||window.routes_cart_url||window.CartBotScriptAppended||window.lbupsellToken||window.lbShopDomain||window.Spurit||window.discountNinja||window.ymq||window.redoStorefront||window.samitaWholesale||document.documentElement.innerHTML.match(/vtlsAebBundle/)||window.BOLD||window.Samita||window.affirmPublicApiKeyCartDrawer||window.zakekeBeforeAddToCart||window.RouteWidget||null!=window.noParcel||e.matches('[name^="button-route-"]')||"nextlevelwheels.myshopify.com"==Shopify.shop||[677].includes(window.Shopify.theme.theme_store_id))&&d(e);if(!i){var t=[];try{t=$._data(e).events.click,$._data(e).events.click=[]}catch(e){}rterms.checkoutEvents.push(t),setTimeout(function(){window.bndlr&&!i&&e.classList.add("bndlr-button-disabled")},1e3),window.ZapietWidgetConfig&&(window.customCheckoutValidation=rterms.checkout,setTimeout(function(){window.customCheckoutValidation=rterms.checkout},5e3)),e.addEventListener("click",rterms.checkout)}if(e.parentElement.closest(".cart--totals .cart--nav"))return;if(e.parentElement.querySelector(".terms-relentless"))return;if(rterms.settings.hide_in_drawer&&e.closest("#cart-notification-form, sidebar-drawer"))return;if(e.parentElement.parentElement&&e.parentElement.parentElement.querySelector(".terms-relentless"))return;(function(e,t){setTimeout(function(){var r=e;e.previousElementSibling&&e.previousElementSibling.previousElementSibling&&e.previousElementSibling.previousElementSibling.previousElementSibling&&"cart__shipping"===e.previousElementSibling.previousElementSibling.previousElementSibling.className&&(r=e.previousElementSibling.previousElementSibling),e.previousElementSibling&&(e.previousElementSibling.href&&e.previousElementSibling.href.match(/\/cart$/)||e.previousElementSibling.name&&"update"===e.previousElementSibling.name)&&(r=e.previousElementSibling),e.parentElement.querySelector('input[value="Update Cart"]')&&(r=e.parentElement.querySelector('input[value="Update Cart"]'));var o,n=e.parentElement.parentElement.querySelector('[href="/cart"]');if(!n&&e.parentElement.previousElementSibling&&(n=e.parentElement.previousElementSibling.querySelector('[href="/cart"]')),!rterms.settings.ignore_cart_button&&n){var i=n.getBoundingClientRect().top,s=e.getBoundingClientRect().top;n.innerHTML&&i&&s&&i<=s&&(r=n)}(o=e.closest("[data-cart-drawer] .push-btn, .buy-buttons.buy-buttons--compact, .cart__ctas-container .cart__ctas"))&&(r=o),t(r)})})(e,function(e){if(!e.parentElement.querySelector(".terms-relentless")){var t=document.createElement("div");t.className="terms-relentless",t.innerHTML='",rterms.metafield.spacing_top&&(t.style.marginTop=rterms.metafield.spacing_top+"px"),rterms.metafield.spacing_right&&(t.style.marginRight=rterms.metafield.spacing_right+"px"),rterms.metafield.spacing_bottom&&(t.style.marginBottom=rterms.metafield.spacing_bottom+"px"),rterms.metafield.spacing_left&&(t.style.marginLeft=rterms.metafield.spacing_left+"px"),rterms.settings.belowCheckout?e.after(t):e.before(t),window.Shopify&&Shopify.theme&&Shopify.theme.name&&Shopify.theme.schema_name&&("Blockshop"==Shopify.theme.name||["Stretch","Yuva","Prestige","Booster Premium","Essence","Ignite"].includes(Shopify.theme.schema_name))||rterms.settings.disableLayoutFix||(t.parentNode.style.display="block")}}),setTimeout(function(){o&&document.querySelectorAll('.rterms-checkbox:not([id^="rterms-modal"])').forEach(function(e){e.closest(".rterms-modal")||e.checked||(e.click(),!rterms._3lj2l&&rterms.metafield.date&&"on"===rterms.metafield.date&&u())})},100)}),!i&&n&&(m(".dynamic-checkout__content",d),m(r,function(e){if(d(e).classList.add("rterms-trigger-modal"),document.querySelector(".rterms-shadow"))return;var t=document.createElement("div");t.classList.add("rterms-shadow"),t.innerHTML='
'+(rterms.metafield.alert_message||"Please select the terms of service")+'
",document.body.appendChild(t)})),8===Math.floor(9*Math.random())&&p(e,{type:"POST",body:{shop:Shopify.shop,event:"terms_views"}},function(e){console.log(e)}),document.body.addEventListener("click",function(t){if(t.target.matches(".rterms-checkbox"))if(t.target.checked){t.isTrusted&&(s=!0),t.target.matches(".rterms-modal .rterms-checkbox")&&setTimeout(function(){var e=t.target.closest(".rterms-shadow");e&&e.classList.remove("rterms-modal-open");var o=document.querySelectorAll(r);o&&o.forEach(function(e){var t=e.querySelectorAll('[role="button"], [type="button"]');t.length&&t.forEach(function(e){e.click()})})},700),rterms.addedEvents||(rterms.addedEvents=!0,rterms.checkouts.forEach(function(e){try{$._data(e).events.click=rterms.checkoutEvents.shift()}catch(e){}}));var n=document.querySelectorAll(".rterms-disable");(t.isTrusted||o)&&n.forEach(function(e){e.classList.contains("rterms-trigger-modal")||(e.style.pointerEvents="none")}),!rterms._3lj2l&&rterms.metafield.date&&"on"===rterms.metafield.date&&u(),8===Math.floor(9*Math.random())&&p(e,{type:"POST",body:{shop:Shopify.shop,event:"terms_clicks"}},function(e){console.log(e)}),rterms.checkouts.forEach(function(e){e.classList.remove("bndlr-button-disabled")}),t.target&&t.target.checked&&(window.customCheckoutValidation=null)}else{s=!1;var a=document.querySelectorAll(".rterms-checkbox");if(a)for(var c=0;c{for(let o of r)if(o.addedNodes.length)for(let r of o.addedNodes)if(r.matches){r.matches(e)&&(r.hasAttribute("data-route-cloned-button")&&document.querySelectorAll(".terms-relentless").forEach(function(e){e.remove()}),t(r));var n=r.querySelectorAll(e);n.length&&n.forEach(function(e){t(e)})}}).observe(document.body,{childList:!0,subtree:!0})}}function d(e){var t=document.createElement("div");return t.classList.add("rterms-disable"),e.parentElement.style.position="relative",e.parentNode.insertBefore(t,e),setInterval(function(){var r=e.parentNode?e.parentNode.getBoundingClientRect().top:0,o=e.parentNode?e.getBoundingClientRect().top:0;if(t.style.top=Math.abs(r-o)+"px",t.style.left=e.offsetLeft+"px",t.style.width=(e.offsetWidth||200)+"px",t.style.height=(e.offsetHeight||75)+"px",t.style.margin="0",e.parentNode){var n=window.getComputedStyle(e.parentNode);n.textAlign&&"right"===n.textAlign&&(t.style.right="0")}},1e3),t}function u(){var e=new Date;if(rterms.metafield.timeZone&&e.toLocaleString){var t=e.toLocaleString("en-US",{timeZone:rterms.metafield.timeZone});e=t+" "+rterms.metafield.timeZone}else e=e.toString();p(window.Shopify.routes.root+"cart/update.js",{type:"POST",body:{attributes:{"Terms Accepted At":e}},headers:{"Content-Type":"application/json"}})}function p(e,t,r,o){if(!window.XMLHttpRequest)return o("no xhr");var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==this.readyState)if(200==this.status)try{r(JSON.parse(this.response))}catch(e){o&&o(e)}else o&&o(this.status)},n.open(t.type,e,!0);var i=t.headers&&t.headers["Content-Type"]||"application/x-www-form-urlencoded";n.setRequestHeader("Content-Type",i);var s="";if("application/x-www-form-urlencoded"===i){for(var a in t.body)s+=encodeURIComponent(a)+"="+encodeURIComponent(t.body[a])+"&";s=s.slice(0,-1)}else s=JSON.stringify(t.body);n.send(s)}}();