(()=>{var e={362:()=>{}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var d=t[r]={exports:{}};return e[r](d,d.exports,n),d.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r);n(362);document.addEventListener("DOMContentLoaded",(function(){var e=document.querySelector(".ddfw-newsletter-form");e&&e.addEventListener("submit",(function(t){t.preventDefault();var n=new FormData(e).get("email"),r=document.getElementById("ddfw-newsletter-submit"),o=document.getElementById("ddfw-newsletter-message");o.textContent="",o.className="ddfw-newsletter-message",r.disabled=!0,r.textContent=ddfwDashboardObject.i18n.subscribing||"Subscribing...",fetch(ddfwDashboardObject.ajax.ajaxUrl,{method:"POST",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),body:"action=ddfw_newsletter_subscribe&nonce=".concat(ddfwDashboardObject.ajax.ajaxNonce,"&email=").concat(encodeURIComponent(n))}).then((function(e){return e.json()})).then((function(t){r.disabled=!1,r.textContent=ddfwDashboardObject.i18n.subscribe||"Subscribe",t.success?(o.textContent=t.data.message,o.classList.add("ddfw-newsletter-success"),e.reset(),setTimeout((function(){window.location.reload()}),2e3)):(o.textContent=t.data.message,o.classList.add("ddfw-newsletter-error"))})).catch((function(e){r.disabled=!1,r.textContent=ddfwDashboardObject.i18n.subscribe||"Subscribe",console.log(e),o.textContent=ddfwDashboardObject.i18n.subscriptionError||"An error occurred. Please try again.",o.classList.add("ddfw-newsletter-error")}))}))}))})();for(var o in r)this[o]=r[o];r.__esModule&&Object.defineProperty(this,"__esModule",{value:!0})})();