1(()=>{var e={83871:e=>{class t{constructor(){this.config=window.fusAjaxConfig||{},this.init()}init(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>this.bindEvents())):this.bindEvents()}bindEvents(){document.addEventListener("submit",(e=>{e.target.matches(this.config.selectors?.form||".fus-ajax-form")&&this.handleAjaxSubmit(e)})),document.addEventListener("submit",(e=>{const t=this.config.selectors?.fallbackForm||".fus-form:not(.fus-ajax-form)";e.target.matches(t)&&this.handleFallbackSubmit(e)}))}handleAjaxSubmit(e){e.preventDefault();const t=e.target,s=t.querySelector(this.config.selectors?.submitBtn||'input[type="submit"], button[type="submit"]'),r=t.closest(".fus-login-form-wrap, .fus-register-form-wrap")?.querySelector(".fus-message")||t.parentElement.querySelector(".fus-message"),n=s.value||s.textContent,o=t.querySelector('input[name="fus_action"]'),a=o?.value;if(!a)return void this.showMessage(r,"error","Invalid form action");if(!this.config.ajaxUrl)return console.warn("fusAjaxConfig not available, falling back to regular form submission"),t.classList.remove("fus-ajax-form"),void t.submit();this.setLoadingState(s,!0,n),this.clearMessages(r);const i=new FormData(t),c=new URLSearchParams;c.append("action","fus_"+a),c.append("nonce",this.config.nonce);for(const[e,t]of i.entries())c.append(e,t);fetch(this.config.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:c}).then((e=>{if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()})).then((e=>{e.success?this.handleSuccess(t,r,e.data):this.handleError(t,r,e.data)})).catch((e=>{console.error("AJAX error:",e),this.handleError(t,r,{message:this.config.messages?.networkError||"Network error occurred"})})).finally((()=>{this.setLoadingState(s,!1,n)}))}handleSuccess(e,t,s){this.showMessage(t,"success",s.message),e.reset(),this.dispatchCustomEvent("fus:login:success",{form:e,data:s}),s.redirect?setTimeout((()=>{window.location.href=s.redirect}),1500):setTimeout((()=>{window.location.reload()}),1500)}handleError(e,t,s){const r=s.message||this.config.messages?.error||"An error occurred";this.showMessage(t,"error",r),this.dispatchCustomEvent("fus:login:error",{form:e,data:s})}showMessage(e,t,s){e&&(e.className=e.className.replace(/\b(error|success)\b/g,""),e.classList.add(t),e.innerHTML=`<p>${s}</p>`,e.style.display="block",e.classList.add("show"),e.scrollIntoView({behavior:"smooth",block:"center"}))}clearMessages(e){e&&(e.classList.remove("error","success","show"),e.innerHTML="",e.style.display="none")}setLoadingState(e,t,s){if(e)if(t){e.disabled=!0;const t=this.config.messages?.processing||"Processing...";"input"===e.tagName.toLowerCase()?e.value=t:e.textContent=t,e.classList.add("loading")}else e.disabled=!1,"input"===e.tagName.toLowerCase()?e.value=s:e.textContent=s,e.classList.remove("loading")}handleFallbackSubmit(e){const t=e.target.querySelector(this.config.selectors?.submitBtn||'input[type="submit"], button[type="submit"]'),s=t?.value||t?.textContent;t&&this.config.messages?.processing&&this.setLoadingState(t,!0,s)}dispatchCustomEvent(e,t){const s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});document.dispatchEvent(s)}async triggerLogin(e){return this.triggerAction("login",e)}async triggerRegister(e){return this.triggerAction("register",e)}async triggerAction(e,t){if(!this.config.ajaxUrl)throw new Error("AJAX not available");const s=new URLSearchParams;s.append("action","fus_"+e),s.append("nonce",this.config.nonce);for(const[e,r]of Object.entries(t))s.append(e,r);try{const e=await fetch(this.config.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=await e.json();if(t.success)return t.data;throw new Error(t.data?.message||"Action failed")}catch(e){throw console.error("API error:",e),e}}addFormValidation(e,t){if(!(e instanceof HTMLFormElement))return;const s=(e,t)=>{const s=e.value.trim();let r=!0,n="";t.required&&!s?(r=!1,n=t.requiredMessage||`${e.name} is required`):t.pattern&&!t.pattern.test(s)?(r=!1,n=t.patternMessage||`Invalid ${e.name} format`):t.minLength&&s.length<t.minLength&&(r=!1,n=t.minLengthMessage||`${e.name} must be at least ${t.minLength} characters`),e.classList.toggle("error",!r);let o=e.parentNode.querySelector(".field-error");return r?o&&o.remove():(o||(o=document.createElement("div"),o.className="field-error",e.parentNode.appendChild(o)),o.textContent=n),r};Object.entries(t).forEach((([t,r])=>{const n=e.querySelector(`[name="${t}"]`);n&&(n.addEventListener("blur",(()=>s(n,r))),n.addEventListener("input",(()=>{n.classList.contains("error")&&s(n,r)})))}
1)),e.addEventListener("submit",(r=>{let n=!0;Object.entries(t).forEach((([t,r])=>{const o=e.querySelector(`[name="${t}"]`);o&&!s(o,r)&&(n=!1)})),n||(r.preventDefault(),r.stopPropagation())}))}}const s=new t;window.fusLoginRegister=s,e.exports&&(e.exports=t)}},t={};function s(r){var n=t[r];if(void 0!==n)return n.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,s),o.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";s(83871)})()})();
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.