1CHARITABLE=window.CHARITABLE||{},function(e){var t=function(e){this.helper=e,t.prototype.get_gateway_config=function(){var e=this.helper.get_payment_method();return!!CHARITABLE_VARS.fee_relief.hasOwnProperty(e)&&CHARITABLE_VARS.fee_relief[e]},t.prototype.get_subtotal=function(){return this.helper.__proto__.hasOwnProperty("get_subtotal")?this.helper.get_subtotal():this.helper.get_amount()},t.prototype.get_fee=function(e){return void 0===e&&(e=!0),this.apply_fees(e)?this.get_total(e)-this.get_subtotal():0},t.prototype.get_total=function(e){void 0===e&&(e=!0);var t=this.get_subtotal(),a=0;if(!this.apply_fees(e))return t;void 0!==CHARITABLE_VARS.calculate_giftaid&&""!==CHARITABLE_VARS.calculate_giftaid&&this.helper.form.find('input[name="giftaid"]').is(":checked")&&(a=.25*t);var n=this.get_gateway_config(),o=(t+n.fixed)/((100-n.percentage)/100),i=t+parseFloat(n.fixed)+parseFloat(t*(.01*n.percentage));return o+=a,void 0===CHARITABLE_VARS.fee_relief_calculation_type||null===CHARITABLE_VARS.fee_relief_calculation_type||""===CHARITABLE_VARS.fee_relief_calculation_type||1!==CHARITABLE_VARS.fee_relief_calculation_type&&"1"!==CHARITABLE_VARS.fee_relief_calculation_type?0+parseFloat(o.toFixed(2)):0+parseFloat(i.toFixed(2))},t.prototype.apply_fees=function(e){void 0===e&&(e=!0);var t=this.get_gateway_config();return t&&t.enabled&&(!e||this.is_donor_paying_fee())},t.prototype.is_donor_paying_fee=function(){var e=this.helper.form.find('input[name="cover_fees"]');switch(e.attr("type")){case"hidden":return!0;case"checkbox":return e.is(":checked")}}},a=e("body");a.on("charitable:form:get_amount",(function(e,a){var n=new t(a);a.add_amount(n.get_fee())})),a.on("charitable:form:loaded",(function(e,n){if("make_donation"===n.form.find("[name=charitable_action]").val()){var o=new t(n),i=n.form.find("[name=cover_fees]").parent(),r=n.form.find(".charitable-donation-amount-custom"),_=n.form.find(".fee-relief .charitable-donation-total"),l=(n.form.find("#charitable_field_giftaid_element"),function(){a.trigger("charitable:form:amount:changed",n),a.trigger("charitable:form:total:changed",n)});a.on("charitable:form:amount:changed",(function(e,t){var a,n,_=o.get_gateway_config();_&&_.enabled&&0!==o.get_subtotal()?(a=t.get_payment_method(),n=t.form.find("label[for=gateway-"+a+"]").text(),subtotal=o.get_subtotal(),r.length&&(r.find(".gateway").text(n),r.find(".subtotal").html(t.format_amount(subtotal,CHARITABLE_VARS.currency_symbol)),r.find(".fee-amount").html(t.format_amount(o.get_fee(!1),CHARITABLE_VARS.currency_symbol))),i.find(".gateway").text(n),i.find(".fee-amount").html(t.format_amount(o.get_fee(!1),CHARITABLE_VARS.currency_symbol)),i.removeClass("charitable-hidden")):i.length&&i.addClass("charitable-hidden")})),a.on("charitable:form:total:changed",(function(e,t){0!==o.get_subtotal()?(_.find(".total-amount").text(t.format_amount(o.get_total(),CHARITABLE_VARS.currency_symbol)),_.removeClass("charitable-hidden")):_.addClass("charitable-hidden")})),a.on("change",'input[name="gateway"]',l),a.on("change",'input[name="cover_fees"]',l),a.on("change",'input[name="giftaid"]',l),CHARITABLE.hasOwnProperty("VersionCompare")&&-1!==CHARITABLE.VersionCompare("1.6.19")||(a.on("change",'input[name="donation_amount"]',l),a.on("change",'input[name="custom_donation_amount"]',l)),l()}}))}(jQuery);
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.