PageSourceSearch

https://paragonthemes.com/wp-content/plugins/easy-digital-download…/build/js/frontend/checkout.js?ver=3.7.1

js paragonthemes.com collected 2026-09-24 08:51:32 UTC 11,664 bytes, 1 lines download raw bytes

1(()=>{var e={1669:e=>{"use strict";e.exports=jQuery},9672:()=>{const e=document.getElementById("edd_purchase_form");e&&e.addEventListener("change",(function(e){"edd_email"===e.target.name&&e.target.value&&function(e){var t=e.value;if(t){var d=new FormData;d.append("action","edd_check_email"),d.append("email",t),fetch(edd_global_vars.ajaxurl,{method:"POST",body:d}).then((function(e){return e.json()})).then((function(t){let d="",a="";t.success||(d=t.data?.message??"",a=t.data?.code??""),e.setCustomValidity(d),document.dispatchEvent(new CustomEvent("edd:checkout-email-check-complete",{detail:{emailField:e,code:a}})),e.reportValidity()}))}}(e.target)}))}},t={};function d(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,d),o.exports}(()=>{"use strict";var e,t=d(1669),a=d(1669);function n(){return globalThis.eddCartLoadingState||(globalThis.eddCartLoadingState={active:new Map,sequence:0,hideTimer:null,overlay:null}),globalThis.eddCartLoadingState}function o(){const e=n();if(e.overlay)return e.overlay;const t=document.createElement("div");t.className="edd-cart-loading",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.hidden=!0;const d=document.createElement("span");d.className="edd-cart-loading__spinner",t.appendChild(d);const a=document.createElement("span");return a.className="edd-cart-loading__label screen-reader-text",a.textContent="undefined"!=typeof edd_global_vars&&edd_global_vars.purchase_loading||"Loading",t.appendChild(a),document.body.appendChild(t),e.overlay=t,t}function r(e){document.dispatchEvent(new CustomEvent("edd:loading-changed",{bubbles:!0,detail:{loading:e,count:n().active.size}}))}function i(e,t,d){const a=n(),i=0===a.active.size,c=setTimeout((()=>{"undefined"!=typeof edd_global_vars&&edd_global_vars.showStoreErrors&&console.warn(`edd-cart-loading: token "${e}" timed out and was released.`),s(e)}),d);a.active.set(e,{source:t,timer:c}),i&&(function(){const e=n();clearTimeout(e.hideTimer),e.hideTimer=null,o().hidden=!1;const t=document.getElementById("edd_checkout_form_wrap");t&&t.setAttribute("aria-busy","true")}(),r(!0))}function c(e="unknown",{timeout:t=8e3}={}){const d=`${e}-${++n().sequence}`;return i(d,e,t),d}function s(e){const t=n(),d=t.active.get(e);d&&(clearTimeout(d.timer),t.active.delete(e),0===t.active.size&&(clearTimeout(t.hideTimer),t.hideTimer=setTimeout((()=>{!function(){o().hidden=!0;const e=document.getElementById("edd_checkout_form_wrap");e&&e.removeAttribute("aria-busy")}(),r(!1)}),120)))}function l(e,t){const d=c(e);let a;try{a=t()}catch(e){throw s(d),e}return Promise.resolve(a).finally((()=>s(d)))}function u(){return n().active.size>0}function _(){return[...n().active.keys()]}e=()=>{a(document.body).on("click",".edd_terms_links",(function(e){e.preventDefault();const t=a(this).parent();t.prev(".edd-terms").slideToggle(),t.find(".edd_terms_links").toggle()}))},function(t){t(e)}(t),d(9672);var m=d(1669);let p=0;function g(e){if("1"!=edd_global_vars.taxes_enabled)return;const t=document.getElementById("edd_checkout_cart");if(!t)return;let d=0;const a=document.querySelector(".edd_cart_amount"),n=a?a.dataset.total||a.textContent:0,o=t.getElementsByClassName("edd_cart_tax_amount");for(let e=0;e<o.length;e++)d=o[e].dataset.tax;const r=m("#edd_cc_address"),i=r.find("#billing_country").val(),l=r.find("#card_address").val(),u=r.find("#card_address_2").val(),_=r.find("#card_city").val(),g=r.find("#card_state").val();e||(e=g);const f={action:"edd_recalculate_taxes",card_address:l,card_address_2:u,card_city:_,card_zip:r.find("#card_zip").val(),state:e,billing_country:i,nonce:m("#edd-checkout-address-fields-nonce").val(),current_page:edd_global_vars.current_page,current_tax_amount:d},h=++p,v=c("taxes"),y=new Object;return y.postdata=f,m.ajax({type:"POST",data:f,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(e){h===p&&(e?.html&&m("#edd_checkout_cart_form").replaceWith(e.html),e&&m(".edd_cart_amount").html(e.total),y.response=e,m("body").trigger("edd_taxes_recalculated",[y]))}}).fail((function(e){console.log("Tax recalculation failed:",e),h===p&&(y.response={success:!1,error:!0,tax_raw:y.postdata.current_tax_amount||0,total_raw:n,debug_data:e},m("body").trigger("edd_taxes_recalculated",[y]))})).always((function(){s(v)}))}var f=d(1669);const h={edd_cart_item_added:"item_added",edd_cart_item_removed:"item_removed",edd_quantity_updated:"quantity_updated",edd_discount_applied:"discount_applied",edd_discount_removed:"discount_removed",edd_taxes_recalculated:"taxes_recalculated"};let v=null;window.recalculate_taxes=g,window.EDD_Checkout=function(e){let t,d,a,r,m;function p(d){d.preventDefault();const a=e("#edd-discount").val(),n=e("#edd_cc_address .edd-input, #edd_cc_address .edd-select").filter("[required]");if(""==a||a==edd_global_vars.enter_discount)return!1;const o={action:"edd_apply_discount",code:a,form:e("#edd_purchase_form").serialize(),current_page:edd_global_vars.current_page};e("#edd-discount-error-wrap").html("").hide();const r=c("discount-apply");return e.ajax({type:"POST",data:o,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){d?"valid"==d.msg?(e(".edd_cart_discount").html(d.html),e(".edd_cart_discount_row").show(),e(".edd_cart_amount").each((function(){e(this).text(d.total).data("subtotal",d.subtotal_raw).attr("data-subtotal",d.subtotal_raw).data("total",d.total_plain).attr("data-total",d.total_plain)})),e("#edd-discount",m).val(""),g(),"0.00"==d.total_plain?(e("#edd_cc_fields,#edd_cc_address,#edd_payment_mode_select").slideUp(),n.prop("required",!1),e('input[name="edd-gateway"]').val("manual")):(n.prop("required",!0),e("#edd_cc_fields,#edd_cc_address").slideDown()),e("#edd-purchase-button").val(d.complete_purchase),t.trigger("edd_discount_applied",[d])):(e("#edd-discount-error-wrap").html('<span class="edd_error">'+d.msg+"</span>"),e("#edd-discount-error-wrap").show(),t.trigger("edd_discount_invalid",[d])):(window.console&&window.console.log&&console.log(d),t.trigger("edd_discount_failed",[d])),s(r)}}).fail((function(e){s(r),window.console&&window.console.log&&console.log(e)})),!1}function y(d){const a={action:"edd_remove_discount",code:e(this).data("c
1ode"),current_page:edd_global_vars.current_page},n=c("discount-remove");return e.ajax({type:"POST",data:a,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){const a="0"+edd_global_vars.decimal_separator+"00";e(".edd_cart_amount").each((function(){edd_global_vars.currency_sign+a!=e(this).text()&&a+edd_global_vars.currency_sign!=e(this).text()||window.location.reload(),e(this).text(d.total).data("subtotal",d.subtotal_raw).attr("data-subtotal",d.subtotal_raw).data("total",d.total_plain).attr("data-total",d.total_plain)})),e(".edd_cart_discount").html(d.html),d.discounts&&0===d.discounts.length&&e(".edd_cart_discount_row").hide(),g(),e("#edd_cc_fields,#edd_cc_address").slideDown(),e("#edd-purchase-button").val(d.complete_purchase),t.trigger("edd_discount_removed",[d]),s(n)}}).fail((function(e){s(n),window.console&&window.console.log&&console.log(e)})),!1}function w(d){const a=e(this),n=a.val(),o=a.data("key"),r=a.closest(".edd_cart_item").data("download-id"),i=a.parent().find('input[name="edd-cart-download-'+o+'-options"]').val(),l=e("#edd_cc_address"),u={action:"edd_update_quantity",quantity:n,download_id:r,options:i,billing_country:l.find("#billing_country").val(),card_state:l.find("#card_state").val(),current_page:edd_global_vars.current_page},_=c("quantity-update");return e.ajax({type:"POST",data:u,dataType:"json",url:edd_global_vars.ajaxurl,xhrFields:{withCredentials:!0},success:function(d){e(".edd_cart_subtotal_amount").each((function(){e(this).text(d.subtotal)})),e(".edd_cart_tax_amount").each((function(){e(this).text(d.taxes).data("tax",d.taxes_raw).attr("data-tax",d.taxes_raw)})),e(".edd_cart_discount").html(d.discounts),e(".edd_cart_amount").each((function(){e(this).text(d.total).data("subtotal",d.subtotal_raw).attr("data-subtotal",d.subtotal_raw).data("total",d.total_raw).attr("data-total",d.total_raw)})),t.trigger("edd_quantity_updated",[d]),e("#edd-purchase-button").val(d.complete_purchase),s(_)}}).fail((function(e){s(_),window.console&&window.console.log&&console.log(e)})),!1}return{init:function(){t=e(document.body),d=e("#edd_purchase_form"),a=e(".edd_cart_amount"),r=a.text(),m=e("#edd_checkout_form_wrap"),function(){if(void 0===f||globalThis.eddCartEventsBridged)return;globalThis.eddCartEventsBridged=!0;const e=f(document.body);Object.keys(h).forEach((t=>{e.on(t,(()=>{return e=h[t],clearTimeout(v),void(v=setTimeout((()=>{document.dispatchEvent(new CustomEvent("edd:cart-updated",{detail:{type:e}}))}),50));var e}))}))}(),globalThis.eddCartLoadingInitialized||(globalThis.eddCartLoadingInitialized=!0,o(),globalThis.eddCartLoading={begin:c,end:s,withLoading:l,isLoading:u,getActiveTokens:_},document.addEventListener("edd:loading-start",(e=>{const t=e.detail?.token;t&&!n().active.has(t)&&i(t,e.detail?.source||"external",8e3)})),document.addEventListener("edd:loading-end",(e=>{e.detail?.token&&s(e.detail.token)}))),t.on("edd_gateway_loaded",(function(e){!function(e){const t=e.find(".card-number"),d=e.find(".card-cvc"),a=e.find(".card-expiry");t.length&&"function"==typeof t.payment&&(t.payment("formatCardNumber"),d.payment("formatCardCVC"),a.payment("formatCardExpiry"))}(d)})),t.on("keyup change",".edd-do-validate .card-number",(function(){!function(t){const d=t;d.validateCreditCard((function(t){const a=e(".card-type");null==t.card_type?(a.removeClass().addClass("off card-type"),d.removeClass("valid"),d.addClass("error")):(a.removeClass("off"),a.html((e=>{let t,d=e;return"amex"===e?(d="americanexpress",t=32):t=50,`\n    <svg\n      width=${t}\n      height=32\n      class="payment-icon icon-${d}"\n      role="img"\n    >\n      <use\n        href="#icon-${d}"\n        xlink:href="#icon-${d}">\n      </use>\n    </svg>`})(t.card_type.name)),a.addClass(t.card_type.name),t.length_valid&&t.luhn_valid?(d.addClass("valid"),d.removeClass("error")):(d.removeClass("valid"),d.addClass("error")))}))}(e(this))})),t.on("blur change",".card-name",(function(){const t=e(this);t.validateCreditCard((function(d){null!=d.card_type?(t.removeClass("valid").addClass("error"),e("#edd-purchase-button").attr("disabled","disabled")):(t.removeClass("error").addClass("val
1id"),e("#edd-purchase-button").removeAttr("disabled"))}))})),t.on("submit","#edd_payment_mode",(function(){if(0==e("#edd-gateway option:selected").val())return alert(edd_global_vars.no_gateway),!1})),t.on("click","#edd_payment_mode_select input",(function(){e("#edd_payment_mode_select label.edd-gateway-option-selected").removeClass("edd-gateway-option-selected"),e("#edd_payment_mode_select input:checked").parent().addClass("edd-gateway-option-selected")})),m.on("click",".edd-apply-discount",p),m.on("keypress","#edd-discount",(function(e){if("13"==e.keyCode)return!1})),m.on("keyup","#edd-discount",(function(e){"13"==e.keyCode&&m.find(".edd-apply-discount").trigger("click")})),t.on("click",".edd_discount_remove",y),t.on("click",".edd_discount_link",(function(t){t.preventDefault(),e(".edd_discount_link").parent().hide(),e("#edd-discount-code-wrap").show().find("#edd-discount").focus()})),t.find("#edd-discount-code-wrap").hide(),t.find("#edd_show_discount").show(),t.on("change",".edd-item-quantity",w),t.on("click",".edd-amazon-logout #Logout",(function(e){e.preventDefault(),amazon.Login.logout(),window.location=edd_amazon.checkoutUri}))},recalculate_taxes:g}}(window.jQuery),window.jQuery(document).ready(EDD_Checkout.init)})()})();

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.