1 line
No EOL
1.7 KiB
JavaScript
1 line
No EOL
1.7 KiB
JavaScript
(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var o=0;o<t.length;o++){var c=t[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,n(c.key),c)}}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var c=o.call(t,"string");if("object"!=e(c))return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.els={}}var n,o;return n=e,(o=[{key:"init",value:function(){this.cacheEls(),this.bindEvents()}},{key:"cacheEls",value:function(){this.els.ce4wpConsent=document.getElementById("ce4wp_no_consent"),this.els.wcCheckoutNonce=document.getElementById("woocommerce-process-checkout-nonce")}},{key:"bindEvents",value:function(){var e=this;this.els.ce4wpConsent&&"function"==typeof this.els.ce4wpConsent.addEventListener&&this.els.ce4wpConsent.addEventListener("click",(function(t){t.preventDefault(),window.setTimeout((function(){e.noConsentCaptureGuestCheckout()}),1500)}))}},{key:"noConsentCaptureGuestCheckout",value:function(){var e=this;wp.ajax.send("ce4wp_abandoned_checkouts_no_consent_checkout",{data:{nonce:this.els.wcCheckoutNonce.value},success:function(){e.els.ce4wpConsent.parentElement.style.display="none"}})}}])&&t(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),e}())).init()})(); |