System.register(["./style.scss-legacy.CuQ5LUVl.js","./drawer-legacy.emUWq9g1.js","./header-icon-legacy.C_1R8Qp-.js"],function(t,e){"use strict";var a,n;return{setters:[null,t=>{a=t.N},t=>{n=t.N}],execute:function(){!function(t,e,i){const{__:o}=t.wp.i18n,d=i(".adt-pfp-admin-notice");let s=0;const c=function(t){const e=i(this),a=e.closest(".adt-pfp-admin-notice, .adt-notification-drawer__item");if(0===a.length)return;const n=a.hasClass("adt-notification-drawer__item"),o=e.attr("href"),d=o&&"#"!==o,s="_blank"===e.attr("target"),c=a.data("notice-type");if(e.data("response")||e.hasClass("notice-dismiss"))return d&&s||t.preventDefault(),void l(e,a,n);if("addon_install"===c){t.preventDefault();const o=i.Event("adt:addon-install");return o.addonData={softwareKey:e.data("addon_software_key"),nonce:e.data("nonce"),button:e,container:a,isDrawerItem:n},void i(document).trigger(o)}if("plugin_recommendation"===c)return t.preventDefault(),void r(e,a,n);d&&"#"!==o||t.preventDefault()},r=(e,a,n)=>{const d=e.data("plugin_slug"),s=e.data("nonce"),c=a.attr("id")||a.data("notice-id"),r=a.data("nonce");if(!d||!s)return;const l=e.text();e.text(o("Installing...","woo-product-feed-pro")).prop("disabled",!0).addClass("disabled"),i.ajax({url:t.ajaxurl,type:"POST",data:{action:"adt_install_activate_plugin",plugin_slug:d,silent:!0,nonce:s},success:d=>{d.success?(e.text(o("Installed","woo-product-feed-pro")),c&&r&&i.post(t.ajaxurl,{action:"adt_pfp_dismiss_admin_notice",notice_id:c,nonce:r,response:"installed"}),u(a,n)):e.text(l).prop("disabled",!1).removeClass("disabled")},error:()=>{e.text(l).prop("disabled",!1).removeClass("disabled")}})},l=(e,a,n)=>{const o=e.data("response")||"dismissed",d=a.attr("id")||a.data("notice-id"),s=a.data("nonce");if(!d||!s)return;const c=e.hasClass("with-loading"),r=e.data("loading-text");c&&r?a.empty().append(i("<p>").text(r)):a.fadeOut("fast"),i.post(t.ajaxurl,{action:"adt_pfp_dismiss_admin_notice",notice_id:d,response:o,nonce:s},t=>{t.success&&t.redirect?window.location.href=t.redirect:u(a,n)})},u=(t,e)=>{t.fadeOut(200,()=>{t.remove(),e&&p()})},p=()=>{const t=window.adtNotificationDrawer;t&&"function"==typeof t.updateBadgeCount&&(t.updateBadgeCount(),t.checkIfEmpty())};i(document).ready(()=>{if(i("#adt-notification-drawer").length>0){const t=new a,e=new n(t);window.adtNotificationDrawer=t,window.adtNotificationHeaderIcon=e}window.adtNotificationUtils={removeNotification:u,updateDrawerState:p},i(document).on("click",".adt-pfp-admin-notice button, .adt-pfp-admin-notice a, .adt-pfp-admin-notice .notice-dismiss",c),i(document).on("click",".adt-notification-drawer__item a, .adt-notification-drawer__item button",c),d.length>1&&(d.hide(),d.eq(s).show(),i(".adt-notice-nav-prev").on("click",t=>{t.preventDefault(),d.eq(s).fadeOut(200,()=>{s=(s-1+d.length)%d.length,d.eq(s).fadeIn(200)})}),i(".adt-notice-nav-next").on("click",t=>{t.preventDefault(),d.eq(s).fadeOut(200,()=>{s=(s+1)%d.length,d.eq(s).fadeIn(200)})}))})}(window,document,jQuery)}}});
