(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.jQuery;e.n(t)()(()=>{!function(){const e=document.getElementById("advads_overview_addons");e&&e.addEventListener("click",e=>{const t=e.target;if("a"===t.tagName.toLowerCase()&&t.classList.contains("disabled"))e.preventDefault();else if(t.classList.contains("button")&&t.classList.contains("subscribe")&&(e.preventDefault(),t.disabled=!0,t.classList.add("disabled"),wp.ajax.post("advads_newsletter",{nonce:t.dataset.nonce}).done(function(e){e&&(t.closest(".item-details").querySelector(".description").innerHTML=`<p style="font-weight: 600;">${e}</p>`)}).fail(function(e){try{t.closest(".item-details").querySelector(".description").innerHTML=`<p style="font-weight: 600;">${e.responseJSON.data.message}</p>`}catch(e){}})),t.classList.contains("button")&&t.classList.contains("installed")){const s="#activate-aaplugin_",n=t.href?t.href:"";if(-1!==n.indexOf(s)){e.preventDefault();const s=n.split("_");((e,t,s,n)=>{n.classList.add("disabled");const a=e.substring(e.indexOf("/")+1,e.indexOf("."));wp.ajax.post("advads_activate_addon",{_ajax_nonce:s,plugin:e,slug:a,name:t}).done(function(){n.className="button active disabled",n.innerText=window.advadstxt.active;const e=document.createElement("i");e.className="dashicons",e.style.cssText='content:"\\f147"',n.insertBefore(e,n.firstChild)}).fail(function(e){void 0!==e.errorMessage&&(n.closest(".cta").parentNode.querySelector(".description").innerText=e.errorMessage)})})(s[2],decodeURIComponent(s[3]),s[1],t)}}})}()})})();