/* empty css                   */import{N as D}from"./drawer._JpF86-g.js";import{N as I}from"./header-icon.BTfknGvJ.js";function y(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(p,N,n){const{__:m}=p.wp.i18n,i=n(".adt-pfp-admin-notice");let o=0;const _=function(e){const t=n(this),a=t.closest(".adt-pfp-admin-notice, .adt-notification-drawer__item");if(a.length===0)return;const d=a.hasClass("adt-notification-drawer__item"),s=t.attr("href"),c=s&&s!=="#",f=t.attr("target")==="_blank",r=a.data("notice-type");if(t.data("response")||t.hasClass("notice-dismiss")){if(c&&f){w(t,a,d);return}e.preventDefault(),w(t,a,d);return}if(r==="addon_install"){e.preventDefault();const l=n.Event("adt:addon-install");l.addonData={softwareKey:t.data("addon_software_key"),nonce:t.data("nonce"),button:t,container:a,isDrawerItem:d},n(document).trigger(l);return}if(r==="plugin_recommendation"){e.preventDefault(),h(t,a,d);return}(!c||s==="#")&&e.preventDefault()},h=(e,t,a)=>{const d=e.data("plugin_slug"),s=e.data("nonce"),c=t.attr("id")||t.data("notice-id"),f=t.data("nonce");if(!d||!s)return;const r=e.text();e.text(m("Installing...","woo-product-feed-pro")).prop("disabled",!0).addClass("disabled"),n.ajax({url:p.ajaxurl,type:"POST",data:{action:"adt_install_activate_plugin",plugin_slug:d,silent:!0,nonce:s},success:l=>{l.success?(e.text(m("Installed","woo-product-feed-pro")),c&&f&&n.post(p.ajaxurl,{action:"adt_pfp_dismiss_admin_notice",notice_id:c,nonce:f,response:"installed"}),u(t,a)):e.text(r).prop("disabled",!1).removeClass("disabled")},error:()=>{e.text(r).prop("disabled",!1).removeClass("disabled")}})},w=(e,t,a)=>{const d=e.data("response")||"dismissed",s=t.attr("id")||t.data("notice-id"),c=t.data("nonce");if(!s||!c)return;const f=e.hasClass("with-loading"),r=e.data("loading-text");f&&r?t.empty().append(n("<p>").text(r)):t.fadeOut("fast"),n.post(p.ajaxurl,{action:"adt_pfp_dismiss_admin_notice",notice_id:s,response:d,nonce:c},l=>{l.success&&l.redirect?window.location.href=l.redirect:u(t,a)})},u=(e,t)=>{e.fadeOut(200,()=>{e.remove(),t&&g()})},g=()=>{const e=window.adtNotificationDrawer;e&&typeof e.updateBadgeCount=="function"&&(e.updateBadgeCount(),e.checkIfEmpty())},v=()=>{n(document).on("click",".adt-pfp-admin-notice button, .adt-pfp-admin-notice a, .adt-pfp-admin-notice .notice-dismiss",_),n(document).on("click",".adt-notification-drawer__item a, .adt-notification-drawer__item button",_)},x=()=>{i.length>1&&(i.hide(),i.eq(o).show(),n(".adt-notice-nav-prev").on("click",t=>{t.preventDefault(),i.eq(o).fadeOut(200,()=>{o=(o-1+i.length)%i.length,i.eq(o).fadeIn(200)})}),n(".adt-notice-nav-next").on("click",t=>{t.preventDefault(),i.eq(o).fadeOut(200,()=>{o=(o+1)%i.length,i.eq(o).fadeIn(200)})}))};n(document).ready(()=>{if(n("#adt-notification-drawer").length>0){const e=new D,t=new I(e);window.adtNotificationDrawer=e,window.adtNotificationHeaderIcon=t}window.adtNotificationUtils={removeNotification:u,updateDrawerState:g},v(),x()})})(window,document,jQuery);export{y as __vite_legacy_guard};
