!function(){"use strict";var t={145:function(t,n,r){function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=Array(n);r<n;r++)e[r]=t[r];return e}r.d(n,{A:function(){return e}})},369:function(t,n,r){function e(t){if(Array.isArray(t))return t}r.d(n,{A:function(){return e}})},453:function(t,n,r){r.d(n,{A:function(){return u}});var e=r(369),o=r(986),i=r(800),c=r(562);function u(t,n){return(0,e.A)(t)||(0,o.A)(t,n)||(0,i.A)(t,n)||(0,c.A)()}},562:function(t,n,r){function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(n,{A:function(){return e}})},800:function(t,n,r){r.d(n,{A:function(){return o}});var e=r(145);function o(t,n){if(t){if("string"==typeof t)return(0,e.A)(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,e.A)(t,n):void 0}}},986:function(t,n,r){function e(t,n){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var e,o,i,c,u=[],a=!0,l=!1;try{if(i=(r=r.call(t)).next,0===n){if(Object(r)!==r)return;a=!1}else for(;!(a=(e=i.call(r)).done)&&(u.push(e.value),u.length!==n);a=!0);}catch(t){l=!0,o=t}finally{try{if(!a&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(l)throw o}}return u}}r.d(n,{A:function(){return e}})}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.d=function(t,n){for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var e=r(453);document.addEventListener("DOMContentLoaded",function(){var t=hostinger_reach_subscription_block_data.translations;document.querySelectorAll(".hostinger-reach-block-subscription-form").forEach(function(n){var r=n.querySelector(".reach-subscription-message");n.addEventListener("submit",function(o){o.preventDefault();var i=n.querySelector('button[type="submit"]'),c=new FormData(n),u={};c.forEach(function(t,n){if(n.includes(".")){var r=n.split("."),o=(0,e.A)(r,2),i=o[0],c=o[1];u[i]||(u[i]={}),u[i][c]=t}else u[n]=t}),i.disabled=!0,fetch(hostinger_reach_subscription_block_data.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":hostinger_reach_subscription_block_data.nonce},body:JSON.stringify(u)}).then(function(e){if(r.style.display="block",n.reset(),!e.ok)throw new Error(e.statusText);r.textContent=t.thanks,n.querySelector(".hostinger-reach-block-submit").style.display="none"}).catch(function(n){r.textContent=t.error,r.style.display="block",i.disabled=!1})})})})}();
//# sourceMappingURL=subscription-view.js.map