PageSourceSearch

https://ltamerica.org/wp-content/plugins/charitable-pro/assets/js/charitable.min.js?ver=1.8.18.1

js ltamerica.org collected 2026-10-02 14:34:18 UTC 55,290 bytes, 1 lines download raw bytes

1CHARITABLE=window.CHARITABLE||{};(function(exports,$){var Donation_Form=function(form){this.errors=[];this.pending_processes=[];this.form=form;this.pause_processing=false;this.submit_processing=false;this.current_xhr=null;this.total=0;this.prevent_scroll_to_top=false;var self=this;var $body=$("body");var on_click_terms=function(){self.form.find(".charitable-terms-text").addClass("active");return false};var on_input_custom_amount=function(){var $li=$(this).closest("li");if($li.hasClass("selected")){return}$li.parents(".charitable-donation-form").find(".donation-amount.selected").removeClass("selected");$li.addClass("selected").find("input[name=donation_amount]").prop("checked",true).trigger("change");trigger_amount_change_events()};var trigger_amount_change_events=function(){$body.trigger("charitable:form:amount:changed",self);$body.trigger("charitable:form:total:changed",self)};var on_change_custom_donation_amount=function(){var unformatted=self.unformat_amount($(this).val());if($.trim(unformatted)>0){$(this).val(self.format_amount(unformatted))}trigger_amount_change_events()};var sync_session_donation_amount=function($radio){if(!$radio||!$radio.length){return}if($radio.attr("data-recurring")||$radio.closest(".charitable-recurring-donation-options, .recurring-donation-options").length){return}var value=$radio.val();if("custom"!==value&&isNaN(parseFloat(value))){return}var $form=$radio.closest(".charitable-donation-form");if(!$form.length){return}$form.find("input[type=hidden][name=donation_amount]").val(value)};var on_select_donation_amount=function(){var $li=$(this).closest("li");if($li.hasClass("selected")){return}$li.parents(".charitable-donation-form").find(".donation-amount.selected").removeClass("selected");var $radio=$li.addClass("selected").find("[name=donation_amount]");$radio.prop("checked",true);sync_session_donation_amount($radio);if($li.hasClass("custom-donation-amount")){$li.find("input.custom-donation-input").focus()}trigger_amount_change_events()};var on_change_donation_amount_highlight=function(){var $li=$(this).closest(".donation-amount");if(!$li.length||$li.hasClass("selected")){return}$li.parents(".charitable-donation-form").find(".donation-amount.selected").removeClass("selected");$li.addClass("selected");sync_session_donation_amount($(this))};var on_change_payment_gateway=function(){var selectedGateway=$(this).val();self.hide_inactive_payment_methods();self.show_active_payment_methods(selectedGateway);if(selectedGateway==="square"||selectedGateway==="square_core"){setTimeout(function(){window.dispatchEvent(new Event("resize"))},100)}};var on_click_change_amount_link=function(){$(this).parent().addClass("charitable-hidden");$("#charitable_stripe_express_checkout_field").hide();$(".charitable-payment-divider").hide()};var on_submit=function(event){var helper=event.data.helper;if(helper.form.data("use-ajax")==="1"||helper.form.data("use-ajax")===1){event.preventDefault();event.stopPropagation();event.stopImmediatePropagation()}if(helper.submit_processing){event.preventDefault();event.stopPropagation();event.stopImmediatePropagation();return false}helper.submit_processing=true;helper.show_processing();if(false===helper.validate()){helper.cancel_processing();return false}if(false!==helper.pause_processing){return false}if(1!==helper.form.data("use-ajax")){return true}maybe_process(helper,function(){$body.trigger("charitable:form:process",helper)});return false};var maybe_process=function(helper,callback){if(!helper.waiting()){if(helper.get_errors().length>0){helper.cancel_processing()}else{callback()}return}setTimeout(maybe_process,500,helper,callback)};var process_donation=function(event,helper){var form=helper.form;var data;var processSettings={type:"POST",dataType:"json",url:CHARITABLE_VARS.ajaxurl,timeout:0,xhrFields:{withCredentials:true}};var hasFiles=form.find('input[type="file"]').length>0;if(hasFiles){var formData=new FormData(form[0]);formData.append("action","make_donation");var charitableAction=formData.get("charitable_action");if(charitableAction){formData.append("form_action",charitableAction);formData.delete("charitable_action")}processSettings.data=formData;processSettings.processData=false;processSettings.contentType=false}else{data=helper.get_data();data.action="make_donation";data.form_action=data.charitable_action;delete data.charitable_action;processSettings.data=data}var xhr=$.ajax(processSettings);helper.current_xhr=xhr;xhr.done(function(response){$body.trigger("charitable:form:processed",[response,helper]);if(response.success){$body.trigger("charitable:donation:success",[response,helper]);maybe_process(helper,function(){window.location.href=response.redirect_to})}else{helper.cancel_processing(response.errors);if(response.donation_id){helper.set_donation_id(response.donation_id)}}}).fail(function(response,textStatus,errorThrown){if(window.console&&window.console.log){console.log(response)}helper.cancel_processing([CHARITABLE_VARS.error_unknown])}).always(function(){helper.current_xhr=null});return false};var init=function(){self.form.data("charitable-donation-form",self);self.form.on("click",".donation-amount",on_select_donation_amount);self.form.on("change","input[name=donation_amount]",on_change_donation_amount_highlight);self.form.on("input","input.custom-donation-input",on_input_custom_amount);self.form.on("click",".charitable-terms-link",on_click_terms);self.form.on("blur",".custom-donation-input",on_change_custom_donation_amount);self.ensure_session_amount_selected();
1self.form.find(".donation-amount input:checked").each(function(){$(this).closest("li").addClass("selected")});if(self.get_all_payment_methods().length){self.hide_inactive_payment_methods();var defaultGateway=self.get_payment_method();if(defaultGateway){self.show_active_payment_methods(defaultGateway)}self.form.on("change","#charitable-gateway-selector input[name=gateway]",on_change_payment_gateway);self.form.on("charitable:gateway:changed",function(event,gatewayId){var $radio=self.form.find('input[name=gateway][value="'+gatewayId+'"]');if($radio.length){$radio.prop("checked",true);on_change_payment_gateway.call($radio[0])}})}self.form.on("click",".change-donation",on_click_change_amount_link);self.form.on("submit",{helper:self},on_submit);if(false===CHARITABLE.forms_initialized){$body.on("charitable:form:process",process_donation);$body.trigger("charitable:form:initialize",self);CHARITABLE.forms_initialized=true}$body.trigger("charitable:form:loaded",self)};init()};Donation_Form.prototype.ensure_session_amount_selected=function(){var $sessionAmount=this.form.find(".charitable-your-donation-amount");if($sessionAmount.length){var amountText=$sessionAmount.find("strong").text();var amount=accounting.unformat(amountText,CHARITABLE_VARS.currency_format_decimal_sep);if(amount>0){var $matchingRadio=this.form.find('input[name="donation_amount"][value="'+amount+'"]');if($matchingRadio.length){$matchingRadio.prop("checked",true);$matchingRadio.closest("li").addClass("selected")}else{var $customRadio=this.form.find('input[name="donation_amount"][value="custom"]');var $customInput=this.form.find("input.custom-donation-input");if($customRadio.length&&$customInput.length){$customRadio.prop("checked",true);$customRadio.closest("li").addClass("selected");$customInput.val(amountText)}}}}};Donation_Form.prototype.get_input=function(field){return this.form.find("[name="+field+"]")};Donation_Form.prototype.get_email=function(){return this.form.find("[name=email]").val()};Donation_Form.prototype.is_recurring_donation=function(){var recurring=this.form.find("[name=recurring_donation]:checked, [name=recurring_donation][type=hidden]");return recurring.length&&"once"!==recurring.val()};Donation_Form.prototype.get_suggested_amount=function(){var $recurring_checked=this.form.find("[name=recurring_donation]:checked");var $recurring_hidden=this.form.find("input[type=hidden][name=recurring_donation]");var recurring_donation=$recurring_checked.val()||$recurring_hidden.val()||"once";var value=null;var $checked=null;var debug_enabled=typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.debug&&CHARITABLE_VARS.form_debug;if(debug_enabled){console.log("[Charitable Debug] get_suggested_amount() called");console.log("[Charitable Debug] recurring_donation value:",recurring_donation);console.log("[Charitable Debug] $recurring_checked found:",$recurring_checked.length);console.log("[Charitable Debug] $recurring_hidden found:",$recurring_hidden.length,$recurring_hidden.val())}var $session_amount_display=this.form.find(".charitable-your-donation-amount");var is_session_state=$session_amount_display.length>0;if("once"===recurring_donation){if(is_session_state){var $hidden_input=this.form.find("input[type=hidden][name=donation_amount]");if($hidden_input.length>0){var hidden_value=$hidden_input.val();if(hidden_value&&hidden_value!=="custom"&&hidden_value!=="recurring-custom"){value=hidden_value}}}if(!value||value==="custom"||value==="recurring-custom"){var $active_section=this.form.find(".charitable-donation-options.active");if($active_section.length){var $all_in_active=$active_section.find("[name=donation_amount]:checked");$checked=$all_in_active.filter(function(){var $radio=$(this);return"recurring-custom"!==$radio.val()&&!$radio.attr("data-recurring")});if($checked.length>0){value=$checked.first().val()}}if(!value||value==="custom"||value==="recurring-custom"){var $all_checked_radios=this.form.find("[name=donation_amount]:checked");$checked=$all_checked_radios.filter(function(){var $radio=$(this);var $closest_section=$radio.closest(".charitable-donation-options");var is_recurring_section=$closest_section.hasClass("charitable-recurring-donation-options")||$closest_section.hasClass("recurring-donation-options");var is_active_section=$closest_section.hasClass("active");return"recurring-custom"!==$radio.val()&&!$radio.attr("data-recurring")&&(is_active_section||!is_recurring_section)});if($checked.length>0){value=$checked.first().val()}else if(!is_session_state){var $donation_options=this.form.find(".charitable-donation-options");var is_options_hidden=$donation_options.length>0&&$donation_options.hasClass("charitable-hidden");if(is_options_hidden){var $hidden_input_fallback=this.form.find("input[type=hidden][name=donation_amount]");
1if($hidden_input_fallback.length>0){var hidden_value_fallback=$hidden_input_fallback.val();if(hidden_value_fallback&&hidden_value_fallback!=="custom"&&hidden_value_fallback!=="recurring-custom"){value=hidden_value_fallback}}}}}}}else{if(debug_enabled){console.log("[Charitable Debug] In RECURRING branch")}var $all_checked_radios=this.form.find("[name=donation_amount]:checked");if(debug_enabled){console.log("[Charitable Debug] Checked radios found:",$all_checked_radios.length)}if($all_checked_radios.length>0){$checked=$all_checked_radios;value=$checked.first().val();if(debug_enabled){console.log("[Charitable Debug] Using checked radio value:",value)}}else{var $fallback_input=this.form.find("input[type=hidden][name=donation_amount_fallback]");if(debug_enabled){console.log("[Charitable Debug] Fallback input found:",$fallback_input.length)}if($fallback_input.length>0){var fallback_value=$fallback_input.val();if(debug_enabled){console.log("[Charitable Debug] Fallback value:",fallback_value)}if(fallback_value&&fallback_value!=="custom"&&fallback_value!=="recurring-custom"&&parseFloat(fallback_value)>0){value=fallback_value;$checked=$fallback_input;if(debug_enabled){console.log("[Charitable Debug] Using fallback value:",value)}}}if(!value){if(debug_enabled){console.log("[Charitable Debug] No fallback value, checking hidden donation_amount")}var $donation_options=this.form.find(".charitable-donation-options");var is_options_hidden=$donation_options.length>0&&$donation_options.hasClass("charitable-hidden");if(debug_enabled){console.log("[Charitable Debug] Options hidden:",is_options_hidden)}if(is_options_hidden){var $hidden_input=this.form.find("input[type=hidden][name=donation_amount]");if($hidden_input.length>0){var hidden_value=$hidden_input.val();if(hidden_value&&hidden_value!=="custom"&&hidden_value!=="recurring-custom"){value=hidden_value;$checked=$hidden_input}}}}}}if(!value||value==="custom"||value==="recurring-custom"){if(debug_enabled){console.log("[Charitable Debug] No valid value found, returning 0. value was:",value)}return 0}var amount=accounting.unformat(value,CHARITABLE_VARS.currency_format_decimal_sep);if(debug_enabled){console.log("[Charitable Debug] Unformatted amount:",amount,"from value:",value)}if(isNaN(amount)||!isFinite(amount)){if(debug_enabled){console.log("[Charitable Debug] Amount is NaN or not finite, returning 0")}amount=0}if(debug_enabled){console.log("[Charitable Debug] FINAL get_suggested_amount returning:",amount)}return amount||0};Donation_Form.prototype.get_custom_amount=function(){var input=this.form.find(".charitable-donation-options.active input.custom-donation-input,.charitable-donation-options.active input.custom-donation-amount");if(0===input.length){input=this.form.find("input.custom-donation-input")}var $recurring_checked=this.form.find("[name=recurring_donation]:checked");var $recurring_hidden=this.form.find("input[type=hidden][name=recurring_donation]");var recurring_donation=$recurring_checked.val()||$recurring_hidden.val()||"once";if("once"===recurring_donation){input=input.filter(function(){var $input=$(this);return"custom_recurring_donation_amount"!==$input.attr("name")})}var value=input.val();var amount=accounting.unformat(value,CHARITABLE_VARS.currency_format_decimal_sep);if(!(amount>0)&&"once"===recurring_donation){var $session_type=this.form.find("input[type=hidden][name=donation_amount]");if($session_type.length&&"custom"===$session_type.val()){var session_amount=accounting.unformat(this.form.find("input[type=hidden][name=custom_donation_amount]").val(),CHARITABLE_VARS.currency_format_decimal_sep);if(session_amount>0){amount=session_amount}}}return amount};Donation_Form.prototype.get_subtotal=function(){var suggested=this.get_suggested_amount();var custom=this.get_custom_amount();var $custom_radio=this.form.find('[name=donation_amount][value="custom"]:checked');if($custom_radio.length&&custom>0){return custom}var total=suggested||custom;return total||0};Donation_Form.prototype.get_amount=function(){this.total=this.get_subtotal();this.form.trigger("charitable:form:get_amount",this);return this.total};Donation_Form.prototype.add_amount=function(add){this.total+=add};Donation_Form.prototype.remove_amount=function(remove){this.total-=remove};Donation_Form.prototype.get_description=function(){return this.form.find("[name=description]").val()||""};Donation_Form.prototype.get_cc_number=function(){return this.form.find("#charitable_field_cc_number input").val()||""};Donation_Form.prototype.get_cc_cvc=function(){return this.form.find("#charitable_field_cc_cvc input").val()||""};Donation_Form.prototype.get_cc_expiry_month=function(){return this.form.find("#charitable_field_cc_expiration select.month").val()||""};Donation_Form.prototype.get_cc_expiry_year=function(){return this.form.find("#charitable_field_cc_expiration select.year").val()||""};Donation_Form.prototype.clear_cc_fields=function(){this.form.find("#charitable_field_cc_number input, #charitable_field_cc_name input, #charitable_field_cc_cvc input, #charitable_field_cc_expiration select").removeAttr("name")};Donation_Form.prototype.get_payment_method=function(){return this.form.find("[type=hidden][name=gateway], [name=gateway]:checked").val()||""};Donation_Form.prototype.get_all_payment_methods=function(){return this.form.find("#charitable-gateway-selector input[name=gateway]")};Donation_Form.prototype.hide_inactive_payment_methods=function(){var active=this.get_payment_method();var fields=this.form.find(".charitable-gateway-fields[data-gateway!="+active+"]");fields.hide();fields.find("input[required],select[required],textarea[required]").attr("data-required",1).attr("required",fal
1se)};Donation_Form.prototype.show_active_payment_methods=function(active){var active=active||this.get_payment_method();var fields=this.form.find(".charitable-gateway-fields[data-gateway="+active+"]");fields.show();fields.find("[data-required]").attr("required",true)};Donation_Form.prototype.format_amount=function(price,symbol){if(typeof symbol==="undefined")symbol="";return accounting.formatMoney(price,{symbol:symbol,decimal:CHARITABLE_VARS.currency_format_decimal_sep,thousand:CHARITABLE_VARS.currency_format_thousand_sep,precision:CHARITABLE_VARS.currency_format_num_decimals,format:CHARITABLE_VARS.currency_format}).trim()};Donation_Form.prototype.unformat_amount=function(price){return Math.abs(parseFloat(accounting.unformat(price,CHARITABLE_VARS.currency_format_decimal_sep)))};Donation_Form.prototype.add_error=function(message){if(message&&message.trim().length>0){this.errors.push(message)}};Donation_Form.prototype.get_errors=function(){return this.errors};Donation_Form.prototype.get_error_message=function(){return this.errors.join(" ")};Donation_Form.prototype.print_errors=function(errors){var e=errors||this.errors,i=0,count=e.length,output="",error_notice_donation_display=typeof CHARITABLE_VARS.error_notice_donation_display==="undefined"?"top":CHARITABLE_VARS.error_notice_donation_display;e=e.filter(function(error){return error&&error.trim().length>0});count=e.length;if(0===count){return}if(this.form.find(".charitable-form-errors").length){this.form.find(".charitable-form-errors").remove()}output+='<div class="charitable-form-errors charitable-notice"><ul class="errors"><li>';output+=e.join("</li><li>");output+="</li></ul></div>";if(error_notice_donation_display==="bottom"){this.form.append(output)}else{this.form.prepend(output)}};Donation_Form.prototype.clear_errors=function(){this.errors=[];if(this.form.find(".charitable-form-errors").length){this.form.find(".charitable-form-errors").remove()}};Donation_Form.prototype.waiting=function(){return this.pending_processes.length>0};Donation_Form.prototype.add_pending_process=function(process){var index=this.pending_processes.indexOf(process);return-1===index?this.pending_processes.push(process)-1:index};Donation_Form.prototype.remove_pending_process=function(index){this.pending_processes.splice(index,1)};Donation_Form.prototype.remove_pending_process_by_name=function(process){var index=this.pending_processes.indexOf(process);return-1!==index&&this.remove_pending_process(index)};Donation_Form.prototype.show_processing=function(){this.form.find(".charitable-form-processing").show();this.form.find('button[name="donate"]').hide()};Donation_Form.prototype.hide_processing=function(){this.form.find(".charitable-form-processing").hide();this.form.find('button[name="donate"]').show();this.submit_processing=false;this.pause_processing=false;if(this.current_xhr){this.current_xhr.abort();this.current_xhr=null}};Donation_Form.prototype.reset_if_stuck=function(){var $spinner=this.form.find(".charitable-form-processing");var $button=this.form.find('button[name="donate"]');var isStuck=($spinner.is(":visible")||$spinner.css("display")!=="none")&&($button.is(":hidden")||$button.css("display")==="none");if(isStuck){this.hide_processing();return true}return false};Donation_Form.prototype.scroll_to_top=function(){if(this.prevent_scroll_to_top){this.prevent_scroll_to_top=false;return}var $modal=this.form.parents(".charitable-modal");if($modal.length){$modal.scrollTop(0)}else{window.scrollTo(this.form.offset().left,this.form.offset().top)}};Donation_Form.prototype.cancel_processing=function(errors){this.hide_processing();this.print_errors(errors);var error_notice_donation_display=typeof CHARITABLE_VARS.error_notice_donation_display==="undefined"?"top":CHARITABLE_VARS.error_notice_donation_display;if(""===error_notice_donation_display||"top"===error_notice_donation_display){this.scroll_to_top()}this.form.trigger("charitable:form:cancelled",this)};Donation_Form.prototype.set_donation_id=function(donation_id){this.form.find("[name=ID]").val(donation_id)};Donation_Form.prototype.get_data=function(){return this.form.serializeArray().reduce(function(obj,item){if("[]"===item.name.slice(-2)){var name=item.name.slice(0,-2);if(!obj.hasOwnProperty(name)){obj[name]=[]}
1obj[name].push(item.value)}else{obj[item.name]=item.value}return obj},{})};Donation_Form.prototype.get_required_fields=function(){var fields=this.form.find(".charitable-fieldset .required-field").not("#charitable-gateway-fields .required-field"),method=this.get_payment_method();if(""!==method){var gateway_fields=this.form.find("[data-gateway="+method+"] .required-field");if(gateway_fields.length){fields=$.merge(fields,gateway_fields)}}return fields};Donation_Form.prototype.subtotal_exceeds_maximum=function(){var subtotal=this.get_subtotal();var maximum=CHARITABLE_VARS.maximum_donation;if(""===maximum||null===maximum||undefined===maximum){return false}var maximumFloat=parseFloat(maximum);if(isNaN(maximumFloat)||maximumFloat<=0){return false}return subtotal>maximumFloat};Donation_Form.prototype.is_valid_amount=function(){var minimum=parseFloat(CHARITABLE_VARS.minimum_donation);if(this.subtotal_exceeds_maximum()){return false}return minimum>0||CHARITABLE_VARS.permit_0_donation?this.get_subtotal()>=minimum:this.get_subtotal()>minimum};Donation_Form.prototype.validate_amount=function(){var subtotal=this.get_subtotal();var minimum=parseFloat(CHARITABLE_VARS.minimum_donation);var isValid=this.is_valid_amount();if(false===isValid){if(subtotal>0&&this.subtotal_exceeds_maximum()&&CHARITABLE_VARS.error_max_exceeded){this.add_error(CHARITABLE_VARS.error_max_exceeded)}else if(CHARITABLE_VARS.error_invalid_amount){this.add_error(CHARITABLE_VARS.error_invalid_amount)}return false}return true};Donation_Form.prototype.validate_required_fields=function(){var missing_fields=[];var is_visual_form=this.form.hasClass("charitable-visual-donation-form")||this.form.closest(".charitable-visual-donation-form").length>0;this.get_required_fields().each(function(index){var $field=$(this);if(is_visual_form&&!$field.is(":visible")){return true}var $input=$field.find("input, select, textarea");var input_type=$input.attr("type")||"no-type";var input_name=$input.attr("name")||"no-name";var input_value=$input.val()||"";var field_id=$field.attr("id")||"no-id";var field_label="";var $label=$field.find("label");if($label.length>0){field_label=$label.clone().find(".required").remove().end().text().trim()}if($field.find(".iti__tel-input").length>0){var $iti_input=$field.find(".iti__tel-input");$input=$iti_input;input_type=$iti_input.attr("type")||"tel";input_name=$iti_input.attr("name")||"iti-field";input_value=$iti_input.val()||""}var is_empty=false;if(input_type==="radio"&&input_name==="donation_amount"){var checked_radio=$('input[name="donation_amount"]:checked');var checked_value=checked_radio.val()||"";if(checked_radio.length===0||checked_value===""){is_empty=true;missing_fields.push({field_id:field_id,input_name:input_name,input_type:input_type,field_label:field_label||"Donation Amount",category:"donation_amount"})}}else{if(""===input_value){is_empty=true;var category="regular";if(input_type==="email"){category="email"}else if(input_type==="tel"||input_name.indexOf("phone")!==-1){category="phone"}else if(input_name.indexOf("address")!==-1||input_name.indexOf("city")!==-1||input_name.indexOf("state")!==-1||input_name.indexOf("postcode")!==-1){category="address"}else if(is_visual_form&&$field.closest(".charitable-conditional-field").length>0){category="conditional"}missing_fields.push({field_id:field_id,input_name:input_name,input_type:input_type,field_label:field_label||input_name.replace(/_/g," ").replace(/\b\w/g,function(l){return l.toUpperCase()}),category:category})}}});if(missing_fields.length>0){var error_message=this.generate_missing_fields_message(missing_fields);this.add_error(error_message);return false}return true};Donation_Form.prototype.generate_missing_fields_message=function(missing_fields){if(missing_fields.length===0){return CHARITABLE_VARS.error_required_fields}var donation_amount_missing=[];var regular_fields_missing=[];var conditional_fields_missing=[];missing_fields.forEach(function(field){if(field.category==="donation_amount"){donation_amount_missing.push(field)}else if(field.category==="conditional"){conditional_fields_missing.push(field)}else{regular_fields_missing.push(field)}});var message_parts=[];if(donation_amount_missing.length>0){message_parts.push("Please select a donation amount")}if(conditional_fields_missing.length>0){var conditional_labels=conditional_fields_missing.map(function(field){return field.field_label});if(conditional_labels.length===1){message_parts.push("Please complete the required field: "+conditional_labels[0])}else{message_parts.push("Please complete the required fields: "+conditional_labels.join(", "))}}if(regular_fields_missing.length>0){var field_labels=regular_fields_missing.map(function(field){return field.field_label});if(field_labels.length===1){message_parts.push("Please fill out: "+field_labels[0])}else{message_parts.push("Please fill out: "+field_labels.join(", "))}}if(message_parts.length===1){return message_parts[0]+"."}else if(message_parts.length===2){return message_parts.join(" and ")+"."}else{var last_part=message_parts.pop();return message_parts.join(", ")+", and "+last_part+"."}};Donation_Form.prototype.validate=function(){this.clear_errors();this.validate_amount();this.validate_required_fields();this.validate_phone_fields();this.form.trigger("charitable:form:validate",this);return this.errors.length===0};Donation_Form.prototype.validate_phone_fields=function(){var self=this;var isValid=true;this.form.find('input[data-rule-smart-phone-field="true"]').each(function(){if(!CHARITABLE.PhoneField.validateSmart($(this))){isValid=false}});this.form.find('input[data-rule-us-phone-field="true"]').each(function(){if(!CHARITABLE.PhoneField.validateUS($(this))){isValid=false}});if(!isValid){this.add_error("Please correct the phone number errors.")}return isValid};exports.Donation_Form=Donation_Form})(CHARITABLE,jQuery);(function(exports,$){var Toggle=function(){var hide_target=function(){get_target($(this)).addClass("charitable-hidden")};var get_target=function($el){var target=$el.data("charitable-toggle");if(target[0]!=="."&&target[0]!=="#"){target="#"+target}return $(target)};var on_toggle=function(){var $this=$(this),$target=get_target($this);$target.toggleClass("charitable-hidden",function(){if($this.is(":checkbox")){return!$this.is(":checked")}return false===$target.hasClass("charitable-hidden")}());return false};var init=function(){$("[data-charitable-toggle]").each(hide_target)};$("body").on("click","[data-charitable-toggle]",on_toggle);if(exports.content_loading){var timer=setInterval(function(){if(false===exports.content_loading){init();clearInterval(timer)}},500)}return init};exports.Toggle=Toggle()})(CHARITABLE,jQuery);CHARITABLE.VersionCompare=function(version,compare){compare=compare||CHARITABLE_VARS.version;if(typeof version+typeof compare!="stringstring")return false;var a=version.split("."),b=compare.split("."),i=0,len=Math.max(a.length,b.length);for(;i<len;i++){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i])){return 1}else if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i])){return-1}}return 0};(function(exports,$){CHARITABLE.ResetSuggestedDonations=function(){if($(".charitable-donation-options").length===0){return false}$('ul.donation-amounts input[type="radio"]').each(function(){if($(this).is(":checked")){$(this).closest("li").addClass("selected")}else{$(this).closest("li").removeClass("selected")}});$("input.custom-donation-input").each(function(){var $input=$(this);var $radio=$input.closest(".custom-donation-amount").find('input[type="radio"]');var value=$input.val();if(value&&value.trim()!==""){$radio.prop("checked",true);$radio.closest("li").addClass("selected")}})}})(CHARITABLE,jQuery);(function(exports,$){var CampaignPagination=function(){var self=this;var init=function(){$(document).on("click",".charitable-campaigns-pagination .page-numbers",function(e){if($(this).hasClass("current")){return}e.preventDefault();e.stopPropagation();var $link=$(this);var $container=$link.closest(".charitable-campaigns-shortcode");if($container.hasClass("charitable-loading")){return}$container.addClass("charitable-loading");var shortcodeAtts=$container.data("shortcode-atts");var page=1;if($link.hasClass("next")){var currentPage=parseInt($container.find(".page-numbers.current").text())||1;page=currentPage+1}else if($link.hasClass("prev")){var currentPage=parseInt($container.find(".page-numbers.current").text())||1;page=currentPage-1}else{page=parseInt($link.text())||1}$.ajax({url:CHARITABLE_VARS.ajaxurl,type:"POST",data:{action:"charitable_load_campaigns_page",nonce:CHARITABLE_VARS.nonce,page:page,shortcode_atts:shortcodeAtts},success:function(response){if(response.success){$container.find(".campaign-loop").html(response.data.campaigns);var $pagination=$(response.data.pagination);$pagination.find("a.page-numbers").each(function(){var $this=$(this);var href=$this.attr("href");var pageNum=href.match(/paged=(\d+)/);if(pageNum){$this.attr("href","#");$this.data("page",pageNum[1])}});$container.find(".charitable-campaigns-pagination").html($pagination);$container.data("current-page",response.data.current_page);$container.find(".page-numbers").removeClass("current");$container.find(".page-numbers").each(function(){var $this=$(this);if($this.text()==response.data.current_page){$this.addClass("current")}})}else{console.error("Error loading campaigns:",response.data.message)}},error:function(xhr,status,error){console.error("AJAX error:",error)},complete:function(){$container.removeClass("charitable-loading")}})})};init()};new CampaignPagination})(window,jQuery);(function(exports,$){var PhoneField={init:function(){this.initSmartFields();this.initUSFields()},initSmartFields:function(){var $smartFields=$('input[data-rule-smart-phone-field="true"]');if($smartFields.length===0){return}if(typeof intlTelInput==="undefined"){var isDebug=function(){return typeof wpchar!=="undefined"&&wpchar.isDebug&&wpchar.isDebug()||window.location.hash&&"#charitabledebug"===window.location.hash};if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("intlTelInput library n
1ot loaded","PhoneField")}else{console.warn("intlTelInput library not loaded")}}return}var utilsScriptUrl=typeof charitable_phone_vars!=="undefined"&&charitable_phone_vars.utils_script_url?charitable_phone_vars.utils_script_url:false;$smartFields.each(function(){var $input=$(this);var initialCountry="us";var $countryField=$("#charitable_field_country_element");if($countryField.length&&$countryField.val()){initialCountry=$countryField.val().toLowerCase()}else if(typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.country){initialCountry=CHARITABLE_VARS.country.toLowerCase()}var itiOptions={initialCountry:initialCountry,preferredCountries:["us","ca","gb"],separateDialCode:false};if(utilsScriptUrl){itiOptions.utilsScript=utilsScriptUrl}var iti=intlTelInput($input[0],itiOptions);$input.data("iti",iti)})},initUSFields:function(){var $usFields=$('input[data-rule-us-phone-field="true"]');var isDebug=function(){return typeof wpchar!=="undefined"&&wpchar.isDebug&&wpchar.isDebug()||window.location.hash&&"#charitabledebug"===window.location.hash};if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("[PhoneField] initUSFields called, found fields: "+$usFields.length,"PhoneField")}else{console.log("[PhoneField] initUSFields called, found fields:",$usFields.length)}}if($usFields.length===0){return}if(typeof $.fn.inputmask==="undefined"){if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("[PhoneField] jQuery inputmask library not loaded","PhoneField")}else{console.warn("[PhoneField] jQuery inputmask library not loaded")}}return}if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("[PhoneField] Inputmask library loaded, initializing fields","PhoneField")}else{console.log("[PhoneField] Inputmask library loaded, initializing fields")}}$usFields.each(function(){var $input=$(this);var mask=$input.attr("data-inputmask")||$input.data("inputmask")||"(999) 999-9999";if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("[PhoneField] Initializing inputmask on field: "+$input.attr("id")+" with mask: "+mask,"PhoneField")}else{console.log("[PhoneField] Initializing inputmask on field:",$input.attr("id"),"with mask:",mask)}}if($input[0]&&$input[0].inputmask){if(isDebug()){if(typeof wpchar!=="undefined"&&wpchar.debug){wpchar.debug("[PhoneField] Field already has inputmask instance, skipping","PhoneField")}else{console.log("[PhoneField] Field already has inputmask instance, skipping")}}return}setTimeout(function(){try{if(typeof $.fn.inputmask!=="undefined"){if($input[0]&&$input[0].inputmask){console.log("[PhoneField] Field initialized during delay, skipping");return}$input.removeAttr("data-inputmask");console.log("[PhoneField] Applying mask pattern:",mask);$input.inputmask(mask);console.log("[PhoneField] Inputmask initialized successfully on:",$input.attr("id"))}else{console.error("[PhoneField] Inputmask library not available when trying to initialize")}}catch(e){console.error("[PhoneField] Error initializing inputmask:",e)}},100)})},validateSmart:function($input){var iti=$input.data("iti");if(!iti){return true}if(typeof intlTelInputUtils==="undefined"){return true}var countryCode=iti.getSelectedCountryData().iso2;var isValid=intlTelInputUtils.isValidNumber($input.val(),countryCode);if(!isValid){$input.addClass("charitable-field-error");var errorMsg="Please enter a valid phone number.";if($input.next(".charitable-field-error-message").length===0){$input.after('<span class="charitable-field-error-message">'+errorMsg+"</span>")}return false}else{$input.removeClass("charitable-field-error");$input.next(".charitable-field-error-message").remove();return true}},validateUS:function($input){var value=$input.val().replace(/\D/g,"");var isValid=value.length===10;if(!isValid){$input.addClass("charitable-field-error");var errorMsg="Please enter a valid US phone number (10 digits).";if($input.next(".charitable-field-error-message").length===0){$input.after('<span class="charitable-field-error-message">'+errorMsg+"</span>")}return false}else{$input.removeClass("charitable-field-error");$input.next(".charitable-field-error-message").remove();return true}}};exports.PhoneField=PhoneField})(CHARITABLE,jQuery);(function($){CHARITABLE.forms_initialized=false;CHARITABLE.forms=[];CHARITABLE.reset_stuck_forms=function(){var resetCount=0;
1CHARITABLE.forms.forEach(function(formInstance){if(formInstance&&typeof formInstance.reset_if_stuck==="function"){if(formInstance.reset_if_stuck()){resetCount++}}});$(".charitable-donation-form").each(function(){var $form=$(this);var $spinner=$form.find(".charitable-form-processing");var $button=$form.find('button[name="donate"]');var isStuck=($spinner.is(":visible")||$spinner.css("display")!=="none")&&($button.is(":hidden")||$button.css("display")==="none");if(isStuck){$spinner.hide();$button.show();resetCount++}});return resetCount};$(document).ready(function(){$("html").addClass("js");window.CHARITABLE_FORM_BOOTED=true;var forms=[];$(".charitable-donation-form").each(function(){var formInstance=new CHARITABLE.Donation_Form($(this));forms.push(formInstance);CHARITABLE.forms.push(formInstance)});CHARITABLE.reset_stuck_forms();CHARITABLE.Toggle();CHARITABLE.ResetSuggestedDonations();CHARITABLE.PhoneField.init()});(function(){window.addEventListener("pageshow",function(event){if(event.persisted){setTimeout(function(){CHARITABLE.reset_stuck_forms()},100)}});window.addEventListener("popstate",function(event){setTimeout(function(){CHARITABLE.reset_stuck_forms()},100)});$(document).on("elementor/popup/show",function(){setTimeout(function(){CHARITABLE.reset_stuck_forms()},100)});$(document).on("click",".ue-tab-btn, .r-tabs-anchor, [data-content-id]",function(){setTimeout(function(){CHARITABLE.reset_stuck_forms()},200)})})()})(jQuery);(function($){var GatewayTabHandler=function(){this.initialized=false;this.isModalContext=function(){var $container=$("#charitable-gateway-tabs");if(!$container.length){return false}var donationFormDisplay=typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.donation_form_display?CHARITABLE_VARS.donation_form_display:"separate_page";var $modalContainer=$container.closest(".lean-modal, .charitable-modal");if($modalContainer.length>0){return true}var $modalDialog=$container.closest('[role="dialog"]');if($modalDialog.length>0){return true}var currentUrl=window.location.href;var donationSlug=typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.campaign_donation_slug?CHARITABLE_VARS.campaign_donation_slug:"donate";var donationSlugs=donationSlug==="donate"?["donate"]:[donationSlug,"donate"];for(var i=0;i<donationSlugs.length;i++){if(currentUrl.indexOf("/"+donationSlugs[i]+"/")!==-1||currentUrl.indexOf("/"+donationSlugs[i])!==-1){return false}}return false};this.init=function(){if(this.initialized){return}this.setupTabs();this.handleOverflow();this.bindEvents();this.setupPaymentMethodErrorDetection();this.initialized=true};this.setupTabs=function(){var $container=$("#charitable-gateway-tabs");if(!$container.length){return}var $tabList=$container.find("#charitable-gateway-selector");var $tabs=$tabList.find(".charitable-gateway-tab");
1if(!$container.find(".charitable-gateway-dropdown-wrapper").length){var $dropdownWrapper=$('<div class="charitable-gateway-dropdown-wrapper" style="display: none;">'+'<button type="button" class="charitable-gateway-dropdown-toggle" aria-expanded="false" aria-label="More payment methods">'+"<span>⋯</span>"+"</button>"+'<ul class="charitable-gateway-dropdown-list" style="display: none;"></ul>'+"</div>");$tabList.after($dropdownWrapper)}};this.handleOverflow=function(){var $container=$("#charitable-gateway-tabs");if(!$container.length){return}var $tabList=$container.find("#charitable-gateway-selector");var $tabs=$tabList.find(".charitable-gateway-tab");var $dropdownWrapper=$container.find(".charitable-gateway-dropdown-wrapper");var $dropdownList=$dropdownWrapper.find(".charitable-gateway-dropdown-list");var dropdownHasTabs=$dropdownList.find(".charitable-gateway-tab").length>0;if(dropdownHasTabs&&$dropdownWrapper.is(":visible")){return}$tabs.each(function(){var $tab=$(this);if($tab.parent().hasClass("charitable-gateway-dropdown-list")){$tabList.append($tab)}});$dropdownWrapper.hide();$dropdownList.hide();var maxVisibleTabs=typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.gateway_max_visible_tabs?CHARITABLE_VARS.gateway_max_visible_tabs:4;var isModal=this.isModalContext();var serverModalSetting=typeof CHARITABLE_VARS!=="undefined"&&CHARITABLE_VARS.donation_form_display==="modal";if(isModal&&serverModalSetting){maxVisibleTabs=Math.max(maxVisibleTabs,6)}else if(serverModalSetting&&!isModal){maxVisibleTabs=4}else{}if($tabs.length<=maxVisibleTabs){return}var containerWidth=$tabList.width();if(containerWidth<=10){setTimeout(function(){this.handleOverflow()}.bind(this),100);return}var visibleTabs=[];var overflowTabs=[];$tabs.each(function(index){var $tab=$(this);var tabWidth=$tab.outerWidth(true);var availableWidth=containerWidth-56;var currentWidth=visibleTabs.reduce(function(sum,tab){return sum+tab.width},0);if(visibleTabs.length>=maxVisibleTabs){overflowTabs.push($tab)}else if(currentWidth+tabWidth<=availableWidth){visibleTabs.push({element:$tab,width:tabWidth})}else{overflowTabs.push($tab)}});if(overflowTabs.length>0){if(overflowTabs.length===$tabs.length){var tabsToKeep=Math.min(2,maxVisibleTabs);var tabsToMove=overflowTabs.slice(tabsToKeep);tabsToMove.forEach(function($tab){$dropdownList.append($tab)});if(tabsToMove.length>0){$dropdownWrapper.show()}}else{overflowTabs.forEach(function($tab){$dropdownList.append($tab)});$dropdownWrapper.show()}}else{}};this.bindEvents=function(){var self=this;$(document).on("change",'.charitable-gateway-tab input[type="radio"]',function(){var $radio=$(this);var $tab=$radio.closest(".charitable-gateway-tab");var gatewayId=$radio.val();var $dropdownList=$tab.closest(".charitable-gateway-dropdown-list");var $tabList=$("#charitable-gateway-selector");if($dropdownList.length){var $mainTabs=$tabList.find(".charitable-gateway-tab");var $lastMainTab=$mainTabs.last();$tab.insertAfter($lastMainTab);$dropdownList.append($lastMainTab);$dropdownList.removeClass("show").css("display","none");$dropdownList.parent().find(".charitable-gateway-dropdown-toggle").attr("aria-expanded","false")}$(".charitable-gateway-tab").removeClass("active");$tab.addClass("active");$radio.trigger("charitable:gateway:changed",[gatewayId])});$(document).on("click",".charitable-gateway-dropdown-toggle",function(e){e.preventDefault();var $toggle=$(this);var $dropdownList=$toggle.parent().find(".charitable-gateway-dropdown-list");var isExpanded=$toggle.attr("aria-expanded")==="true";if(isExpanded){$dropdownList.removeClass("show").css("display","none");$toggle.attr("aria-expanded","false")}else{$dropdownList.addClass("show").css("display","block");$toggle.attr("aria-expanded","true")}});$(document).on("click",function(e){if(!$(e.target).closest(".charitable-gateway-dropdown-wrapper").length){$(".charitable-gateway-dropdown-list").hide();$(".charitable-gateway-dropdown-toggle").attr("aria-expanded","false")}});var resizeTimeout;$(window).on("resize",function(){clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){self.handleOverflow()},250)});$(document).on("charitable:form:initialize",function(){setTimeout(function(){self.handleOverflow()},100)});$(document).on("leanModal:onOpen",function(){self.handleModalInit()});$(document).on("show.bs.modal shown.bs.modal",function(){self.handleModalInit()});$(document).on("click",'[data-modal], [href*="#modal"], .charitable-modal-trigger',function(){setTimeout(function(){self.handleModalInit()},100)});$(document).on("click",".charitable-donate-button",function(){setTimeout(function(){self.handleModalInit()},100)});$(document).on("charitable:modal:loaded",function(){self.handleModalInit()})};this.refresh=function(){this.handleOverflow()};this.handleModalInit=function(){var $container=$("#charitable-gateway-tabs");if($container.length){var $dropdownWrapper=$container.find(".charitable-gateway-dropdown-wrapper");var $dropdownList=$dropdownWrapper.find(".charitable-gateway-dropdown-list");var $tabList=$container.find("#charitable-gateway-selector");$dropdownList.find(".charitable-gateway-tab").each(function(){$tabList.append($(this))});$dropdownWrapper.hide();$dropdownList.hide()}setTimeout(function(){this.handleOverflow()}.bind(this),400)};this.setupPaymentMethodErrorDetection=function(){var self=this;var errorShown={square_core:false,stripe_ach_direct_debit:false};function isLocalEnvironment(){var hostname=window.location.hostname;var protocol=window.location.protocol;return hostname==="localhost"||hostname==="127.0.0.1"||hostname==="0.0.0.0"||protocol==="file:"||hostname.includes(".local")||hostname.includes(".test")||hostname.includes(".dev")}function isHttpsRequired(){return window.location.protocol!=="https:"&&(window.location.hostname!=="localhost"&&window.location.hostname!=="127.0.0.1")}function checkPaymentMethodAvailability(){var isLocal=isLocalEnvironment();var needsHttps=isHttpsRequired();setTimeout(function(){var $squareContainer=$("#charitable-square-wallet-buttons");var $squareCardContainer=$("#square-card-container");if($squareContainer.length||$squareCardContainer.length){var squareLoaded=$squareContainer.find("button").length>0||$squareCardContainer.find("iframe").length>0||$squareCardContainer.find("div[data-elements-stable-field-name]").length>0;if(!squareLoaded&&!errorShown.square_core){errorShown.square_core=true;self.showPaymentMethodError("square_core",isLocal,needsHttps)}}},2e3);setTimeout(function(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");var $achGatewayFields=$("#charitable-gateway-fields-stripe_ach_direct_debit");if($achContainer.length){var isGatewayVisible=$achGatewayFields.is(":visible")&&$achGatewayFields.css("display")!=="none";var achLoaded=$achContainer.find("iframe").length>0||$achContainer.find("div[data-elements-stable-field-name]").length>0;var containerHeight=$achContainer.height();var hasHeight=containerHeight>0;var isVisible=$achContainer.is(":visible");var computedDisplay=$achContainer.css("display");var computedVisibility=$achContainer.css("visibility");if(isGatewayVisible){var shouldShowError=false;var errorReason="";if(!achLoaded){shouldShowError=true;errorReason="ACH element not loaded (no iframe found)"}else if(!hasHeight&&!isVisible&&computedDisplay==="none"){shouldShowError=true;errorReason="ACH container hidden and has zero height"}else if(!hasHeight&&isVisible){return}if(shouldShowError&&!errorShown.stripe_ach_direct_debit){errorShown.stripe_ach_direct_debit=true;self.showPaymentMethodError("stripe_ach_direct_debit",isLocal,needsHttps)}}else{}}},3e3)}this.showPaymentMethodError=function(gatewayId,isLocal,needsHttps){var $tab=$('.charitable-gateway-tab[data-gateway-id="'+gatewayId+'"]');var $fields=$("#charitable-gateway-fields-"+gatewayId);if($tab.length&&$fields.length){var errorMessage="";var errorClass="charitable-payment-method-error";if(gatewayId==="square_core"){errorMessage="Square payment is currently unavailable. Please try another payment method."}
1else if(gatewayId==="stripe_ach_direct_debit"){errorMessage="ACH Direct Debit is currently unavailable. Please try another payment method.";$("#charitable_stripe_ach_direct_debit_field").hide()}if(isLocal){errorMessage+="<br><small>Note: This payment method requires HTTPS and may not work in local development environments.</small>";errorClass+=" local-environment"}else if(needsHttps){errorMessage+="<br><small>Note: This payment method requires a secure HTTPS connection.</small>";errorClass+=" https-required"}var $errorDiv=$('<div class="'+errorClass+'">'+errorMessage+"</div>");$fields.prepend($errorDiv);$tab.addClass("payment-method-error");var $dropdownTab=$('.charitable-gateway-dropdown-list .charitable-gateway-tab[data-gateway-id="'+gatewayId+'"]');if($dropdownTab.length){$dropdownTab.addClass("payment-method-error")}}};$(document).on("click",".charitable-gateway-tab",function(){var $tab=$(this);var gatewayId=$tab.data("gateway-id");var $fields=$("#charitable-gateway-fields-"+gatewayId);if($fields.find(".charitable-payment-method-error").length>0){$fields.find(".charitable-payment-method-error").show()}});$(document).on("click",".charitable-gateway-dropdown-list .charitable-gateway-tab",function(){var $tab=$(this);var gatewayId=$tab.data("gateway-id");var $fields=$("#charitable-gateway-fields-"+gatewayId);if($fields.find(".charitable-payment-method-error").length>0){$fields.find(".charitable-payment-method-error").show()}});setTimeout(checkPaymentMethodAvailability,3e3);$(document).on("charitable:form:loaded",function(){setTimeout(checkPaymentMethodAvailability,2e3)});function removeIframeTitles(){$(".charitable-gateway-tab iframe").removeAttr("title");$(".charitable-gateway-tab .StripeElement iframe").removeAttr("title");$(".charitable-gateway-tab #charitable_stripe_ach_direct_debit_field iframe").removeAttr("title")}setInterval(removeIframeTitles,1e3);setInterval(function(){var isLocal=isLocalEnvironment();var needsHttps=isHttpsRequired();var $achContainer=$("#charitable_stripe_ach_direct_debit_field");var $achGatewayFields=$("#charitable-gateway-fields-stripe_ach_direct_debit");if($achContainer.length){var isGatewayVisible=$achGatewayFields.is(":visible")&&$achGatewayFields.css("display")!=="none";if(isGatewayVisible){var containerHeight=$achContainer.height();var hasIframe=$achContainer.find("iframe").length>0;var isVisible=$achContainer.is(":visible");var computedDisplay=$achContainer.css("display");if((containerHeight===0||!hasIframe)&&!errorShown.stripe_ach_direct_debit){if(isVisible===false||computedDisplay==="none"){$achContainer.show();$achContainer[0].offsetHeight;setTimeout(function(){var newHeight=$achContainer.height();var newVisible=$achContainer.is(":visible");if(newHeight===0||!$achContainer.find("iframe").length){errorShown.stripe_ach_direct_debit=true;self.showPaymentMethodError("stripe_ach_direct_debit",isLocal,needsHttps)}},1e3)}else{errorShown.stripe_ach_direct_debit=true;self.showPaymentMethodError("stripe_ach_direct_debit",isLocal,needsHttps)}}}else{}}},5e3);setInterval(function(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");var $achGatewayFields=$("#charitable-gateway-fields-stripe_ach_direct_debit");if($achContainer.length){var isGatewayVisible=$achGatewayFields.is(":visible")&&$achGatewayFields.css("display")!=="none";if(isGatewayVisible){var isVisible=$achContainer.is(":visible");var computedDisplay=$achContainer.css("display");var hasIframe=$achContainer.find("iframe").length>0;var containerHeight=$achContainer.height();if((!isVisible||computedDisplay==="none")&&hasIframe&&containerHeight>0){$achContainer.show();$achContainer[0].offsetHeight}}else{}}},2e3);function checkACHCSSConflicts(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");if($achContainer.length){var computedStyles=window.getComputedStyle($achContainer[0]);var $parents=$achContainer.parents();$parents.each(function(index){var $parent=$(this);var parentDisplay=$parent.css("display");var parentVisibility=$parent.css("visibility");var parentOpacity=$parent.css("opacity");if(parentDisplay==="none"||parentVisibility==="hidden"||parentOpacity==="0"){}});var conflictingRules=[];var allStyles=document.styleSheets;for(var i=0;i<allStyles.length;i++){try{var rules=allStyles[i].cssRules||allStyles[i].rules;if(rules){for(var j=0;j<rules.length;j++){var rule=rules[j];if(rule.selectorText&&(rule.selectorText.includes("#charitable_stripe_ach_direct_debit_field")||rule.selectorText.includes(".StripeElement")||rule.selectorText.includes('[id*="ach"]'))){conflictingRules.push({selector:rule.selectorText,display:rule.style.display,visibility:rule.style.visibility,opacity:rule.style.opacity,source:allStyles[i].href||"inline"})}}}}catch(e){continue}}if(conflictingRules.length>0){}}}setTimeout(checkACHCSSConflicts,4e3);function clearACHErrorIfFixed(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");var $errorMessage=$(".charitable-payment-method-error");var $errorTab=$('.charitable-gateway-tab.payment-method-error[data-gateway-id="stripe_ach_direct_debit"]');
1if($achContainer.length&&$errorMessage.length&&$errorTab.length){var isVisible=$achContainer.is(":visible");var hasIframe=$achContainer.find("iframe").length>0;var containerHeight=$achContainer.height();if(isVisible&&hasIframe&&containerHeight>0){$errorMessage.remove();$errorTab.removeClass("payment-method-error");errorShown.stripe_ach_direct_debit=false}}}setInterval(clearACHErrorIfFixed,3e3);function clearACHErrorOnSelection(){var $achGatewayFields=$("#charitable-gateway-fields-stripe_ach_direct_debit");var $errorMessage=$(".charitable-payment-method-error");var $errorTab=$('.charitable-gateway-tab.payment-method-error[data-gateway-id="stripe_ach_direct_debit"]');if($achGatewayFields.is(":visible")&&$achGatewayFields.css("display")!=="none"){if($errorMessage.length&&$errorTab.length){$errorMessage.remove();$errorTab.removeClass("payment-method-error");errorShown.stripe_ach_direct_debit=false}}}setInterval(clearACHErrorOnSelection,1e3);$(document).on("click",'.charitable-gateway-tab[data-gateway-id="stripe_ach_direct_debit"]',function(){setTimeout(function(){clearACHErrorOnSelection()},100)});function setupACHContainerWatcher(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");if($achContainer.length){var observer=new MutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.type==="attributes"&&mutation.attributeName==="style"){var $target=$(mutation.target);var isVisible=$target.is(":visible");var computedDisplay=$target.css("display");if(!isVisible||computedDisplay==="none"){var hasIframe=$target.find("iframe").length>0;if(hasIframe){$target.show();$target[0].offsetHeight}}}})});observer.observe($achContainer[0],{attributes:true,attributeFilter:["style","class"]})}}setTimeout(setupACHContainerWatcher,5e3);function handleACHCSSEffects(){var $achContainer=$("#charitable_stripe_ach_direct_debit_field");var $achGatewayFields=$("#charitable-gateway-fields-stripe_ach_direct_debit");if($achContainer.length){var isGatewayVisible=$achGatewayFields.is(":visible")&&$achGatewayFields.css("display")!=="none";if(isGatewayVisible){var computedStyles=window.getComputedStyle($achContainer[0]);var transition=computedStyles.transition;var animation=computedStyles.animation;var opacity=computedStyles.opacity;var transform=computedStyles.transform;if(transition!=="none"||animation!=="none"){$achContainer.css({opacity:"1",visibility:"visible"});$achContainer.addClass("ach-transition-protected")}if(opacity==="0"||transform.includes("scale(0)")||transform.includes("translateY(-100%)")){$achContainer.css({opacity:"1",transform:"none"})}}else{}}}setInterval(handleACHCSSEffects,4e3)}};function initMiniWidgetRedirectParams(){var urlParams=new URLSearchParams(window.location.search);var amount=urlParams.get("amount");var period=urlParams.get("period");if(!amount&&!period){return}var $form=$("#charitable-donation-form, .charitable-donation-form").first();if(!$form.length){return}if(amount){var numAmount=parseFloat(amount);if(numAmount>0){var $preset=$form.find('input[type="radio"][name="donation_amount"]').filter(function(){return parseFloat(this.value)===numAmount});if($preset.length){if(!$preset.is(":checked")){$preset.prop("checked",true).trigger("change")}else{$preset.trigger("change")}}else{var $custom=$form.find('#donation-amount-custom, input[name="custom_donation_amount"]').first();if($custom.length){var $otherRadio=$form.find('input[type="radio"][value="custom"]').first();if($otherRadio.length&&!$otherRadio.is(":checked")){$otherRadio.prop("checked",true).trigger("change")}$custom.val(numAmount).trigger("input")}}}}if(period&&"once"!==period){var $recurringRadio=$form.find('input[name="recurring_donation"]').filter(function(){return"once"!==this.value}).first();if($recurringRadio.length&&!$recurringRadio.is(":checked")){$recurringRadio.prop("checked",true).trigger("change")}}}$(document).ready(function(){CHARITABLE.GatewayTabs=new GatewayTabHandler;CHARITABLE.GatewayTabs.init();initMiniWidgetRedirectParams();setInterval(function(){if(CHARITABLE.GatewayTabs&&CHARITABLE.GatewayTabs.isModalContext()){var $container=$("#charitable-gateway-tabs");if($container.length&&$container.find(".charitable-gateway-dropdown-wrapper").is(":visible")){var $dropdownList=$container.find(".charitable-gateway-dropdown-list");var $tabList=$container.find("#charitable-gateway-selector");if($dropdownList.find(".charitable-gateway-tab").length===$tabList.find(".charitable-gateway-tab").length+$dropdownList.find(".charitable-gateway-tab").length){CHARITABLE.GatewayTabs.handleModalInit()}}}},2e3)});$(document).on("charitable:form:loaded",function(){if(CHARITABLE.GatewayTabs){CHARITABLE.GatewayTabs.init()}})})(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.