"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[4186,7338],{64186:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(86087),l=a(27723),i=a(99695),r=a(57338);const o=()=>{const{dataLoaded:e,pluginData:t,pluginActions:a,fetchOtherPluginsData:o,error:p}=(0,r.default)();return(0,n.useEffect)((()=>{e||o()}),[]),!e||p?(0,n.createElement)(i.default,{lines:"3",error:p}):(0,n.createElement)("div",{className:"cmplz-other-plugins-container"},t.map(((e,t)=>((e,t)=>(0,n.createElement)("div",{key:t,className:"cmplz-other-plugins-element cmplz-"+e.slug},(0,n.createElement)("a",{href:e.wordpress_url,target:"_blank",rel:"noopener noreferrer",title:e.title},(0,n.createElement)("div",{className:"cmplz-bullet"}),(0,n.createElement)("div",{className:"cmplz-other-plugins-content"},e.title)),(0,n.createElement)("div",{className:"cmplz-other-plugin-status"},"upgrade-to-premium"===e.pluginAction&&(0,n.createElement)("a",{target:"_blank",href:e.upgrade_url,rel:"noopener noreferrer"},(0,l.__)("Upgrade","complianz-gdpr")),"upgrade-to-premium"!==e.pluginAction&&"installed"!==e.pluginAction&&(0,n.createElement)("a",{href:"#",onClick:t=>a(e.slug,e.pluginAction,t)},e.pluginActionNice),"installed"===e.pluginAction&&(0,l.__)("Installed","complianz-gdpr"))))(e,t))))}},57338:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(81621),l=a(9588),i=a(27723);const r=(0,n.vt)(((e,t)=>({error:!1,dataLoaded:!1,pluginData:[],updatePluginData:(a,n)=>{let l=t().pluginData;l.forEach((function(e,t){e.slug===a&&(l[t]=n)})),e((e=>({dataLoaded:!0,pluginData:l})))},getPluginData:e=>t().pluginData.filter((t=>t.slug===e))[0],fetchOtherPluginsData:async()=>{const{pluginData:t,error:a}=await l.doAction("otherpluginsdata").then((e=>{let t=[];t=e.plugins;let a=e.error;return a||t.forEach((function(e,a){t[a].pluginActionNice=o(e.pluginAction)})),{pluginData:t,error:a}}));e((e=>({dataLoaded:!0,pluginData:t,error:a})))},pluginActions:(e,a,n)=>{n&&n.preventDefault();let i={};i.slug=e,i.pluginAction=a;let r=t().getPluginData(e);"download"===a?r.pluginAction="downloading":"activate"===a&&(r.pluginAction="activating"),r.pluginActionNice=o(r.pluginAction),t().updatePluginData(e,r),"installed"!==a&&"upgrade-to-premium"!==a&&l.doAction("plugin_actions",i).then((a=>{r=a,t().updatePluginData(e,r),t().pluginActions(e,r.pluginAction)}))}}))),o=e=>({download:(0,i.__)("Install","complianz-gdpr"),activate:(0,i.__)("Activate","complianz-gdpr"),activating:(0,i.__)("Activating...","complianz-gdpr"),downloading:(0,i.__)("Downloading...","complianz-gdpr"),"upgrade-to-premium":(0,i.__)("Downloading...","complianz-gdpr")}[e])}}]);