PageSourceSearch

https://www.charitywater.org/vite/assets/RateLimitedRecaptchaForm-CaEskmj_.js

js charitywater.org collected 2026-10-01 07:15:08 UTC 1,601 bytes, 2 lines download raw bytes

1import{aR as i}from"./store-hHMBOSZG.js";const c=()=>({form:null,widgetId:null,submitting:!1,recaptchaError:null,recaptchaLoaded:!1,init:function(){this.form=this.$el.closest("form"),window.grecaptcha&&this.createWidget(),this.form.addEventListener("htmx:afterRequest",t=>{t.detail.xhr.status==418?this.loadRecaptchaAndExecute():t.detail.xhr.status==422&&(this.recaptchaError="Sorry, Something went wrong. Please reload the page and try again.",i(()=>{this.submitting=!1}))})},submit:function(){if(!$(this.form).parsley().validate())return!1;this.submitting=!0,window.htmx.trigger(this.form,"submit")},loadRecaptchaAndExecute:async function(){if(this.recaptchaLoaded){grecaptcha.reset(this.widgetId),grecaptcha.execute(this.widgetId);return}if(window.grecaptcha===void 0){const t=document.createElement("script");t.src="https://www.google.com/recaptcha/api.js?render=explicit",t.async=!0,t.defer=!0,t.onload=async()=>{await this.createWidget(),grecaptcha.execute(this.widgetId)},document.body.appendChild(t)}else await this.createWidget(),grecaptcha.execute(this.widgetId)},createWidget:function(){return new Promise(t=>{const e=document.createElement("div");grecaptcha.ready(()=>{this.widgetId=grecaptcha.render(e,{sitekey:recaptchaV2SiteKey,size:"invisible",badge:"inline",callback:a=>this.onCaptchaSuccess(a)}),this.form.appendChild(e),this.recaptchaLoaded=!0,t()})})},onCaptchaSuccess:function(t){this.form.setAttribute("hx-vals",JSON.stringify({"recaptcha[token]":t})),window.htmx.trigger(this.form,"submit")}});export{c as default};
2//# sourceMappingURL=RateLimitedRecaptchaForm-CaEskmj_.js.map

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.