2 lines
29 KiB
JavaScript
2 lines
29 KiB
JavaScript
import{aq as f,f as r,i as d,j as i,a0 as u,Q as v,M as m,T as y,O as P,ad as M,U as l,P as I,R as g,ae as S,u as z,r as tt,S as et,v as E,B as K,a4 as X,at as lt,aG as dt}from"./vendor-vue-ui.de3ab35f.js";import{d as H,w as ot,e as ut,b2 as it,b as q,j as st,h as U,bP as ft,S as mt,a as nt,$ as gt,g as _t,r as pt,F as ht,D as vt}from"./app-core.ae890a3f.js";/* empty css */import{C as bt,u as yt}from"./Tabs.b5aef6dd.js";import{C as St}from"./Index.52399193.js";import{G as kt,_ as Ct}from"./Header.9297ac06.js";import{C as Nt,a as wt}from"./LicenseKeyBar.e22888cd.js";import{S as Tt}from"./LogoGear.6afc7f21.js";import{S as Q}from"./Close.098d4b76.js";import{_ as w}from"./_plugin-vue_export-helper.eefbdd86.js";import{a as N,_ as c}from"./vendor-other.7b559694.js";import{S as Lt}from"./Logo.dc3ab371.js";import{S as Dt}from"./Support.2e4d4097.js";import{_ as at,C as Pt}from"./Button.a549093d.js";import{u as At}from"./Url.bb132bc9.js";import{S as rt,a as J}from"./Pencil.405b16d2.js";import{S as Bt}from"./Exclamation.fb17e636.js";import{S as xt}from"./Gear.9677fa66.js";import{T as R}from"./Slide.e6618126.js";import{m as Mt}from"./vendor-lodash.8e35bd59.js";const F="all-in-one-seo-pack",Ut={setup(){return{settingsStore:ot()}},components:{SvgAioseoLogoGear:Tt,SvgClose:Q},data(){return{strings:{boldText:N("<strong>%1$s %2$s</strong>","All in One SEO",c("Free",F)),url:H.getUpsellUrl("lite-upgrade-bar",null,"liteUpgrade"),linkText:N(c("upgrading to %1$s",F),"Pro")}}},computed:{link(){return N('<strong><a href="%1$s" target="_blank" class="text-white">%2$s</a> <a href="%1$s" target="_blank" class="text-white upgrade-arrow">→</a></strong>',this.strings.url,this.strings.linkText)},upgradeText(){return N(c("You're using %1$s. To unlock more features, consider %2$s",F),this.strings.boldText,this.link)}},methods:{processHideUpgradeBar(){document.body.classList.remove("aioseo-has-bar"),this.settingsStore.hideUpgradeBar()}},mounted(){document.body.classList.add("aioseo-has-bar")}},It={class:"aioseo-upgrade-bar"},Ht={class:"upgrade-text"},Ot=["innerHTML"];function Et(e,t,a,o,s,n){const h=f("svg-aioseo-logo-gear"),_=f("svg-close");return r(),d("div",It,[i("div",Ht,[u(h),i("div",{innerHTML:n.upgradeText},null,8,Ot)]),u(_,{onClick:n.processHideUpgradeBar},null,8,["onClick"])])}const zt=w(Ut,[["render",Et]]),qt={},Rt={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-description"};function Vt(e,t){return r(),d("svg",Rt,[...t[0]||(t[0]=[i("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z",fill:"currentColor"},null,-1)])])}const Gt=w(qt,[["render",Vt]]),jt={},Ft={viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aioseo-folder-open"};function Yt(e,t){return r(),d("svg",Ft,[...t[0]||(t[0]=[i("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z",fill:"currentColor"},null,-1)])])}const Wt=w(jt,[["render",Yt]]),C="all-in-one-seo-pack",Kt={setup(){return{licenseStore:st(),rootStore:q(),helpPanelStore:it(),settingsStore:ot(),links:H}},components:{CoreApiBar:wt,CoreLicenseKeyBar:Nt,CoreUpgradeBar:zt,SvgAioseoLogo:Lt,SvgClose:Q,SvgDescription:Gt,SvgFolderOpen:Wt,SvgSupport:Dt},data(){return{searchItem:null,strings:{close:c("Close",C),search:c("Search",C),viewAll:c("View All",C),docs:c("Docs",C),viewDocumentation:c("View Documentation",C),browseDocumentation:N(c("Browse documentation, reference material, and tutorials for %1$s.",C),"AIOSEO"),viewAllDocumentation:c("View All Documentation",C),getSupport:c("Get Support",C),submitTicket:c("Submit a ticket and our world class support team will be in touch soon.",C),submitSupportTicket:c("Submit a Support Ticket",C),upgradeToPro:c("Upgrade to Pro",C)}}},computed:{filteredDocs(){return this.searchItem!==""?Object.values(this.helpPanelStore.docs).filter(e=>this.searchItem!==null?e.title.toLowerCase().includes(this.searchItem.toLowerCase()):null):null}},methods:{inputSearch:function(e){ut(()=>{this.searchItem=e},1e3)},toggleSection:function(e){e.target.parentNode.parentNode.classList.toggle("opened")},toggleDocs:function(e){e.target.previousSibling.classList.toggle("opened"),e.target.style.display="none"},toggleModal(){document.getElementById("aioseo-help-modal").classList.toggle("visible"),document.body.classList.toggle("modal-open")},getCategoryDocs(e){return Object.values(this.helpPanelStore.docs).filter(t=>t.categories.flat().includes(e)?t:null)}}},Xt={id:"aioseo-help-modal",class:"aioseo-help"},Qt={class:"aioseo-help-header"},Jt={class:"logo"},Zt=["href"],$t=["title"],te={class:"help-content"},ee={id:"aioseo-help-search"},oe={id:"aioseo-help-result"},ie={class:"aioseo-help-docs"},se={class:"icon"},ne=["href"],ae={id:"aioseo-help-categories"},re={class:"aioseo-help-categories-toggle"},ce={class:"folder-open"},le={class:"title"},de={class:"aioseo-help-docs"},ue={class:"icon"},fe=["href"],me={class:"aioseo-help-additional-docs"},ge={class:"icon"},_e=["href"],pe={id:"aioseo-help-footer"},he={class:"aioseo-help-footer-block"},ve=["href"],be={class:"aioseo-help-footer-block"},ye=["href"];function Se(e,t,a,o,s,n){const h=f("core-upgrade-bar"),_=f("core-license-key-bar"),p=f("core-api-bar"),b=f("svg-aioseo-logo"),O=f("svg-close"),V=f("base-input"),x=f("svg-description"),G=f("svg-folder-open"),B=f("base-button"),ct=f("svg-support");return r(),d("div",Xt,[!o.rootStore.isPro&&o.settingsStore.settings.showUpgradeBar&&o.rootStore.pong?(r(),v(h,{key:0})):m("",!0),o.rootStore.isPro&&o.licenseStore.isUnlicensed&&o.rootStore.pong?(r(),v(_,{key:1})):m("",!0),o.rootStore.pong?m("",!0):(r(),v(p,{key:2})),i("div",Qt,[i("div",Jt,[o.licenseStore.isUnlicensed?(r(),d("a",{key:0,href:o.links.utmUrl("header-logo"),target:"_blank"},[u(b,{id:"aioseo-help-logo"})],8,Zt)):m("",!0),o.licenseStore.isUnlicensed?m("",!0):(r(),v(b,{key:1,id:"aioseo-help-logo"}))]),i("div",{id:"aioseo-help-close",title:s.strings.close,onClick:t[0]||(t[0]=y((...T)=>n.toggleModal&&n.toggleModal(...T),["stop"]))},[u(O)],8,$t)]),i("div",te,[i("div",ee,[u(V,{type:"text",size:"medium",placeholder:s.strings.search,"onUpdate:modelValue":t[1]||(t[1]=T=>n.inputSearch(T))},null,8,["placeholder"])]),i("div",oe,[i("ul",ie,[(r(!0),d(P,null,M(n.filteredDocs,(T,A)=>(r(),d("li",{key:A},[i("span",se,[u(x)]),i("a",{href:o.links.utmUrl("help-panel-doc","",T.url),rel:"noopener noreferrer",target:"_blank"},l(T.title),9,ne)]))),128))])]),i("div",ae,[i("ul",re,[(r(!0),d(P,null,M(o.helpPanelStore.categories,(T,A)=>(r(),d("li",{key:A,class:I(["aioseo-help-category",{opened:A==="getting-started"}])},[i("header",{onClick:t[2]||(t[2]=y(L=>n.toggleSection(L),["stop"]))},[i("span",ce,[u(G)]),i("span",le,l(T),1),t[4]||(t[4]=i("span",{class:"dashicons dashicons-arrow-right-alt2"},null,-1))]),i("ul",de,[(r(!0),d(P,null,M(n.getCategoryDocs(A).slice(0,5),(L,j)=>(r(),d("li",{key:j},[i("span",ue,[u(x)]),i("a",{href:o.links.utmUrl("help-panel-doc","",L.url),rel:"noopener noreferrer",target:"_blank"},l(L.title),9,fe)]))),128)),i("div",me,[(r(!0),d(P,null,M(n.getCategoryDocs(A).slice(5,n.getCategoryDocs(A).length),(L,j)=>(r(),d("li",{key:j},[i("span",ge,[u(x)]),i("a",{href:o.links.utmUrl("help-panel-doc","",L.url),rel:"noopener noreferrer",target:"_blank"},l(L.title),9,_e)]))),128))]),n.getCategoryDocs(A).length>=5?(r(),v(B,{key:0,class:"aioseo-help-docs-viewall gray medium",onClick:t[3]||(t[3]=y(L=>n.toggleDocs(L),["stop"]))},{default:g(()=>[S(l(s.strings.viewAll)+" "+l(T)+" "+l(s.strings.docs),1)]),_:2},1024)):m("",!0)])],2))),128))])]),i("div",pe,[i("div",he,[i("a",{href:o.links.utmUrl("help-panel-all-docs","","https://aioseo.com/docs/"),rel:"noopener noreferrer",target:"_blank"},[u(x),i("h3",null,l(s.strings.viewDocumentation),1),i("p",null,l(s.strings.browseDocumentation),1),u(B,{class:"aioseo-help-docs-viewall gray small"},{default:g(()=>[S(l(s.strings.viewAllDocumentation),1)]),_:1})],8,ve)]),i("div",be,[i("a",{href:!o.rootStore.isPro||!o.licenseStore.license.isActive?o.links.getUpsellUrl("help-panel","get-support","liteUpgrade"):o.links.utmUrl("help-panel-support","","https://aioseo.com/account/support/"),rel:"noopener noreferrer",target:"_blank"},[u(ct),i("h3",null,l(s.strings.getSupport),1),i("p",null,l(s.strings.submitTicket),1),o.rootStore.isPro&&o.licenseStore.license.isActive?(r(),v(B,{key:0,class:"aioseo-help-docs-support blue small"},{default:g(()=>[S(l(s.strings.submitSupportTicket),1)]),_:1})):m("",!0),!o.rootStore.isPro||!o.licenseStore.license.isActive?(r(),v(B,{key:1,class:"aioseo-help-docs-support green small"},{default:g(()=>[S(l(s.strings.upgradeToPro),1)]),_:1})):m("",!0)],8,ye)])])])])}const ke=w(Kt,[["render",Se]]),Y="all-in-one-seo-pack",Ce=()=>{const e={notifications:c("Notifications",Y),newNotifications:c("New Notifications",Y),activeNotifications:c("Active Notifications",Y)},t=tt(!1),a=U(),o=z(()=>t.value?a.dismissedNotificationsCount:a.activeNotificationsCount),s=z(()=>t.value?a.dismissedNotifications:a.activeNotifications),n=z(()=>t.value?e.notifications:e.newNotifications);return{dismissed:t,notificationTitle:n,notifications:s,notificationsCount:o,strings:e}},Ne=""+window.__aioseoDynamicImportPreload__("images/dannie-detective.b4823250.png"),we="all-in-one-seo-pack",Te={emits:["dismissed-notification"],setup(){const{button1Loading:e,button2Loading:t,getHref:a,getTagType:o,getTarget:s,processButtonClick:n}=At();return{button1Loading:e,button2Loading:t,getHref:a,getTagType:o,getTarget:s,notificationsStore:U(),processButtonClick:n,sanitizeString:mt}},components:{BaseButton:at,SvgCircleCheck:J,SvgCircleClose:rt,SvgCircleExclamation:Bt,SvgGear:xt,TransitionSlide:R},props:{notification:{type:Object,required:!0}},data(){return{active:!0,strings:{dismiss:c("Dismiss",we)}}},computed:{getIcon(){switch(this.notification.type){case"warning":return"svg-circle-exclamation";case"error":return"svg-circle-close";case"info":return"svg-gear";default:return"svg-circle-check"}},getDate(){return ft(this.notification.start)}},methods:{processDismissNotification(){this.active=!1,this.notificationsStore.dismissNotifications([this.notification.slug]),this.$emit("dismissed-notification")},getButtonType(e){switch(this.notification.notification_name){case"search-console-site-not-connected":case"search-console-site-not-verified":case"email-reports-enable-reminder":return e===1?"blue":"gray";default:return"gray"}}}},Le={class:"icon"},De={class:"body"},Pe={class:"title"},Ae={class:"date"},Be=["innerHTML"],xe={class:"actions"};function Me(e,t,a,o,s,n){const h=f("base-button"),_=f("transition-slide");return r(),v(_,{class:I(["aioseo-notification",[`aioseo-notification-${a.notification.notification_name}`]]),active:s.active},{default:g(()=>[i("div",null,[i("div",Le,[(r(),v(et(n.getIcon),{class:I(a.notification.type)},null,8,["class"]))]),i("div",De,[i("div",Pe,[i("div",null,l(o.sanitizeString(a.notification.title)),1),i("div",Ae,l(n.getDate),1)]),i("div",{class:"notification-content",innerHTML:a.notification.content},null,8,Be),i("div",xe,[a.notification.button1_label&&a.notification.button1_action?(r(),v(h,{key:0,size:"small",type:n.getButtonType(1),class:"aioseo-button1",tag:o.getTagType(a.notification.button1_action),href:o.getHref(a.notification.button1_action),target:o.getTarget(a.notification.button1_action),onClick:t[0]||(t[0]=p=>o.processButtonClick(a.notification.button1_action,1)),loading:o.button1Loading},{default:g(()=>[S(l(a.notification.button1_label),1)]),_:1},8,["type","tag","href","target","loading"])):m("",!0),a.notification.button2_label&&a.notification.button2_action?(r(),v(h,{key:1,size:"small",type:n.getButtonType(2),class:"aioseo-button2",tag:o.getTagType(a.notification.button2_action),href:o.getHref(a.notification.button2_action),target:o.getTarget(a.notification.button2_action),onClick:t[1]||(t[1]=p=>o.processButtonClick(a.notification.button2_action,2)),loading:o.button2Loading},{default:g(()=>[S(l(a.notification.button2_label),1)]),_:1},8,["type","tag","href","target","loading"])):m("",!0),a.notification.dismissed?m("",!0):(r(),d("a",{key:2,href:"#",class:"dismiss",onClick:t[2]||(t[2]=y((...p)=>n.processDismissNotification&&n.processDismissNotification(...p),["stop","prevent"]))},l(s.strings.dismiss),1))])])])]),_:1},8,["class","active"])}const Ue=w(Te,[["render",Me]]),k="all-in-one-seo-pack",Ie={emits:["dismissed-notification"],setup(){return{licenseStore:st(),notificationsStore:U(),optionsStore:nt(),rootStore:q()}},components:{SvgCircleCheck:J,TransitionSlide:R},props:{notification:{type:Object,required:!0}},data(){return{step:1,active:!0,strings:{dismiss:c("Dismiss",k),yesILoveIt:c("Yes, I love it!",k),notReally:c("Not Really...",k),okYouDeserveIt:c("Ok, you deserve it",k),nopeMaybeLater:c("Nope, maybe later",k),giveFeedback:c("Give feedback",k),noThanks:c("No thanks",k)}}},computed:{title(){switch(this.step){case 2:return c("That's Awesome!",k);case 3:return c("Help us improve",k);default:return N(c("Are you enjoying %1$s?",k),"AIOSEO")}},content(){switch(this.step){case 2:return c("Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?",k);case 3:return N(c("We're sorry to hear you aren't enjoying %1$s. We would love a chance to improve. Could you take a minute and let us know what we can do better?",k),"All in One SEO");default:return""}},feedbackUrl(){const e=this.rootStore.isPro?"pro":"lite";return H.utmUrl("notification-review-notice",this.rootStore.aioseo.version,"https://aioseo.com/plugin-feedback/?wpf7528_24="+encodeURIComponent(this.rootStore.aioseo.urls.home)+"&wpf7528_27="+e+"&wpf7528_28="+this.rootStore.aioseo.version)}},methods:{processDismissNotification(e=!1){this.active=!1,this.notificationsStore.dismissNotifications([this.notification.slug+(e?"-delay":"")]),this.$emit("dismissed-notification")}}},He={class:"icon"},Oe={class:"body"},Ee={class:"title"},ze=["innerHTML"],qe={class:"actions"};function Re(e,t,a,o,s,n){const h=f("svg-circle-check"),_=f("base-button"),p=f("transition-slide");return r(),v(p,{class:"aioseo-notification",active:s.active},{default:g(()=>[i("div",null,[i("div",He,[u(h,{class:"success"})]),i("div",Oe,[i("div",Ee,[i("div",null,l(n.title),1)]),i("div",{class:"notification-content",innerHTML:n.content},null,8,ze),i("div",qe,[s.step===1?(r(),d(P,{key:0},[u(_,{size:"small",type:"blue",onClick:t[0]||(t[0]=y(b=>s.step=2,["stop"]))},{default:g(()=>[S(l(s.strings.yesILoveIt),1)]),_:1}),u(_,{size:"small",type:"gray",onClick:t[1]||(t[1]=y(b=>s.step=3,["stop"]))},{default:g(()=>[S(l(s.strings.notReally),1)]),_:1})],64)):m("",!0),s.step===2?(r(),d(P,{key:1},[u(_,{tag:"a",href:"https://aioseo.com/aioseo-wordpress-rating",size:"small",type:"blue",target:"_blank",rel:"noopener noreferrer",onClick:t[2]||(t[2]=b=>n.processDismissNotification(!1))},{default:g(()=>[S(l(s.strings.okYouDeserveIt),1)]),_:1}),u(_,{size:"small",type:"gray",onClick:t[3]||(t[3]=y(b=>n.processDismissNotification(!0),["stop","prevent"]))},{default:g(()=>[S(l(s.strings.nopeMaybeLater),1)]),_:1})],64)):m("",!0),s.step===3?(r(),d(P,{key:2},[u(_,{tag:"a",href:n.feedbackUrl,size:"small",type:"blue",target:"_blank",rel:"noopener noreferrer",onClick:t[4]||(t[4]=b=>n.processDismissNotification(!1))},{default:g(()=>[S(l(s.strings.giveFeedback),1)]),_:1},8,["href"]),u(_,{size:"small",type:"gray",onClick:t[5]||(t[5]=y(b=>n.processDismissNotification(!1),["stop","prevent"]))},{default:g(()=>[S(l(s.strings.noThanks),1)]),_:1})],64)):m("",!0),a.notification.dismissed?m("",!0):(r(),d("a",{key:3,class:"dismiss",href:"#",onClick:t[6]||(t[6]=y(b=>n.processDismissNotification(!1),["stop","prevent"]))},l(s.strings.dismiss),1))])])])]),_:1},8,["active"])}const Ve=w(Ie,[["render",Re]]),D="all-in-one-seo-pack",Ge={emits:["dismissed-notification"],setup(){return{notificationsStore:U()}},components:{BaseButton:at,SvgCircleCheck:J,TransitionSlide:R},props:{notification:{type:Object,required:!0}},data(){return{active:!0,strings:{dismiss:c("Dismiss",D),yesILoveIt:c("Yes, I love it!",D),notReally:c("Not Really...",D),okYouDeserveIt:c("Ok, you deserve it",D),nopeMaybeLater:c("Nope, maybe later",D),giveFeedback:c("Give feedback",D),noThanks:c("No thanks",D)}}},computed:{title(){return N(c("Are you enjoying %1$s?",D),"AIOSEO")},content(){return N(c("Hey, we noticed you have been using %1$s for some time - that’s awesome! Could you please do us a BIG favor and give it a 5-star rating on WordPress to help us spread the word and boost our motivation?",D),"<strong>All in One SEO</strong>")}},methods:{processDismissNotification(e=!1){this.active=!1,this.notificationsStore.dismissNotifications([this.notification.slug+(e?"-delay":"")]),this.$emit("dismissed-notification")}}},je={class:"icon"},Fe={class:"body"},Ye={class:"title"},We=["innerHTML"],Ke={class:"actions"};function Xe(e,t,a,o,s,n){const h=f("svg-circle-check"),_=f("base-button"),p=f("transition-slide");return r(),v(p,{class:"aioseo-notification",active:s.active},{default:g(()=>[i("div",null,[i("div",je,[u(h,{class:"success"})]),i("div",Fe,[i("div",Ye,[i("div",null,l(n.title),1)]),i("div",{class:"notification-content",innerHTML:n.content},null,8,We),i("div",Ke,[u(_,{tag:"a",href:"https://aioseo.com/aioseo-wordpress-rating",size:"small",type:"blue",target:"_blank",rel:"noopener noreferrer",onClick:t[0]||(t[0]=b=>n.processDismissNotification(!1))},{default:g(()=>[S(l(s.strings.okYouDeserveIt),1)]),_:1}),u(_,{size:"small",type:"gray",onClick:t[1]||(t[1]=y(b=>n.processDismissNotification(!0),["stop","prevent"]))},{default:g(()=>[S(l(s.strings.nopeMaybeLater),1)]),_:1}),a.notification.dismissed?m("",!0):(r(),d("a",{key:0,class:"dismiss",href:"#",onClick:t[2]||(t[2]=y(b=>n.processDismissNotification(!1),["stop","prevent"]))},l(s.strings.dismiss),1))])])])]),_:1},8,["active"])}const Qe=w(Ge,[["render",Xe]]),Je={class:"icon"},Ze={class:"body"},$e={class:"title"},to=["innerHTML"],eo={class:"actions"},oo={__name:"UnlicensedAddons",props:{notification:{type:Object,required:!0}},setup(e){const t="all-in-one-seo-pack",a=e,o=q(),s=tt(!0),n={title:N(c("%1$s Addons Not Configured Properly",t),"AIOSEO"),learnMore:c("Learn More",t),upgrade:c("Upgrade",t)},h=z(()=>{let _="<ul>";return a.notification.addons.forEach(p=>{_+="<li><strong>AIOSEO - "+p.name+"</strong></li>"}),_+="</ul>",a.notification.message+_});return(_,p)=>{const b=f("base-button");return r(),v(E(R),{class:"aioseo-notification",active:s.value},{default:g(()=>[i("div",null,[i("div",Je,[u(E(rt),{class:"error"})]),i("div",Ze,[i("div",$e,[i("div",null,l(n.title),1)]),i("div",{class:"notification-content",innerHTML:h.value},null,8,to),i("div",eo,[u(b,{size:"small",type:"green",tag:"a",href:E(H).getUpsellUrl("notification-unlicensed-addons",null,E(o).isPro?"pricing":"liteUpgrade"),target:"_blank"},{default:g(()=>[S(l(n.upgrade),1)]),_:1},8,["href"])])])])]),_:1},8,["active"])}}},W="all-in-one-seo-pack",io={emits:["toggle-dismissed","dismissed-notification"],components:{CoreNotification:Ue,NotificationsReview:Ve,NotificationsReview2:Qe,NotificationsUnlicensedAddons:oo},props:{dismissedCount:{type:Number,required:!0},notifications:{type:Array,required:!0}},data(){return{dannieDetectiveImg:Ne,strings:{greatScott:c("Great Scott! Where'd they all go?",W),noNewNotifications:c("You have no new notifications.",W),seeDismissed:c("See Dismissed Notifications",W)}}},methods:{getAssetUrl:gt}},so={class:"aioseo-notification-cards"},no={key:"no-notifications"},ao={class:"no-notifications"},ro=["src"],co={class:"great-scott"},lo={class:"no-new-notifications"};function uo(e,t,a,o,s,n){return r(),d("div",so,[a.notifications.length?(r(!0),d(P,{key:0},M(a.notifications,h=>(r(),v(et(h.component?h.component:"core-notification"),{key:h.slug,notification:h,ref_for:!0,ref:"notification",onDismissedNotification:t[0]||(t[0]=_=>e.$emit("dismissed-notification"))},null,40,["notification"]))),128)):m("",!0),a.notifications.length?m("",!0):(r(),d("div",no,[K(e.$slots,"no-notifications",{},()=>[i("div",ao,[i("img",{alt:"Dannie the Detective",src:n.getAssetUrl(s.dannieDetectiveImg)},null,8,ro),i("div",co,l(s.strings.greatScott),1),i("div",lo,l(s.strings.noNewNotifications),1),a.dismissedCount?(r(),d("a",{key:0,href:"#",class:"dismiss",onClick:t[1]||(t[1]=y(h=>e.$emit("toggle-dismissed"),["stop","prevent"]))},l(s.strings.seeDismissed),1)):m("",!0)])])]))])}const fo=w(io,[["render",uo]]),Z="all-in-one-seo-pack",mo={setup(){const{dismissed:e,notificationTitle:t,notifications:a,notificationsCount:o,strings:s}=Ce();return{composableStrings:s,dismissed:e,notificationsStore:U(),notificationTitle:t,notifications:a,notificationsCount:o}},components:{CoreNotificationCards:fo,SvgClose:Q},data(){return{maxNotifications:Number.MAX_SAFE_INTEGER,currentPage:0,totalPages:1,strings:Mt(this.composableStrings,{dismissedNotifications:c("Dismissed Notifications",Z),dismissAll:c("Dismiss All",Z)})}},watch:{"notificationsStore.showNotifications"(e){e?(this.currentPage=0,this.setMaxNotifications(),this.addBodyClass()):this.removeBodyClass()},dismissed(){this.setMaxNotifications()},notifications(){this.setMaxNotifications()}},computed:{filteredNotifications(){return[...this.notifications].splice(this.currentPage===0?0:this.currentPage*this.maxNotifications,this.maxNotifications)},pages(){if(typeof this.totalPages!="number"||!isFinite(this.totalPages)||0>=this.totalPages)return 1;const e=[];for(let t=0;t<this.totalPages;t++)e.push({number:t+1});return e}},methods:{escapeListener(e){e.key==="Escape"&&this.notificationsStore.showNotifications&&this.notificationsStore.toggleNotifications()},addBodyClass(){document.body.classList.add("aioseo-show-notifications")},removeBodyClass(){document.body.classList.remove("aioseo-show-notifications")},documentClick(e){if(!this.notificationsStore.showNotifications)return;const t=e&&e.target?e.target:null,a=document.querySelector("#wp-admin-bar-aioseo-notifications");if(a&&(a===t||a.contains(t)))return;const o=document.querySelector("#toplevel_page_aioseo .wp-first-item"),s=document.querySelector("#toplevel_page_aioseo .wp-first-item .aioseo-menu-notification-indicator");if(o&&o.contains(s)&&(o===t||o.contains(t)))return;const n=this.$refs["aioseo-notifications"];n&&(n===t||n.contains(t))||this.notificationsStore.toggleNotifications()},notificationsLinkClick(e){e.preventDefault(),this.notificationsStore.toggleNotifications()},processDismissAllNotifications(){const e=[];this.notifications.forEach(t=>{e.push(t.slug)}),this.notificationsStore.dismissNotifications(e).then(()=>{this.setMaxNotifications()})},setMaxNotifications(){const e=this.currentPage;this.currentPage=0,this.totalPages=1,this.maxNotifications=Number.MAX_SAFE_INTEGER,this.$nextTick(async()=>{const a=Array.from(document.querySelectorAll(".notification-menu .aioseo-notification")).map(s=>{const n=window.getComputedStyle?getComputedStyle(s,null):s.currentStyle,h=parseInt(n.marginTop)||0,_=parseInt(n.marginBottom)||0;return s.offsetHeight+h+_}),o=document.querySelector(".notification-menu .aioseo-notification-cards");if(o&&0<a.length){let s=0,n=0;for(const h of a){if(n+=h,n>o.offsetHeight)break;s++}this.maxNotifications=s||1,isFinite(s)&&0<s&&(this.totalPages=Math.ceil(a.length/s))}this.currentPage=e>this.totalPages-1?this.totalPages-1:e})}},mounted(){document.addEventListener("keydown",this.escapeListener),document.addEventListener("mousedown",this.documentClick);const e=document.querySelector("#wp-admin-bar-aioseo-notifications .ab-item");e&&e.addEventListener("mousedown",this.notificationsLinkClick);const t=document.querySelector("#toplevel_page_aioseo .wp-first-item"),a=document.querySelector("#toplevel_page_aioseo .wp-first-item .aioseo-menu-notification-indicator");t&&a&&t.addEventListener("mousedown",this.notificationsLinkClick)}},go={class:"aioseo-notifications",ref:"aioseo-notifications"},_o={key:0,class:"notification-menu"},po={class:"notification-header"},ho={class:"new-notifications"},vo={class:"dismissed-notifications"},bo={key:0,class:"notification-footer"},yo={class:"pagination"},So=["onClick"],ko={key:0,class:"dismiss-all"};function Co(e,t,a,o,s,n){const h=f("svg-close"),_=f("core-notification-cards");return r(),d("div",go,[u(X,{name:"notifications-slide"},{default:g(()=>[o.notificationsStore.showNotifications?(r(),d("div",_o,[i("div",po,[i("span",ho,"("+l(o.notificationsCount)+") "+l(o.notificationTitle),1),i("div",vo,[!o.dismissed&&o.notificationsStore.dismissedNotificationsCount?(r(),d("a",{key:0,href:"#",onClick:t[0]||(t[0]=y(p=>o.dismissed=!0,["stop","prevent"]))},l(s.strings.dismissedNotifications),1)):m("",!0),o.dismissed&&o.notificationsStore.dismissedNotificationsCount?(r(),d("a",{key:1,href:"#",onClick:t[1]||(t[1]=y(p=>o.dismissed=!1,["stop","prevent"]))},l(s.strings.activeNotifications),1)):m("",!0)]),i("div",{onClick:t[2]||(t[2]=y((...p)=>o.notificationsStore.toggleNotifications&&o.notificationsStore.toggleNotifications(...p),["stop"]))},[u(h)])]),u(_,{class:"notification-cards",notifications:n.filteredNotifications,dismissedCount:o.notificationsStore.dismissedNotificationsCount,onToggleDismissed:t[3]||(t[3]=p=>o.dismissed=!o.dismissed)},null,8,["notifications","dismissedCount"]),s.totalPages>1||!o.dismissed&&o.notifications.length?(r(),d("div",bo,[i("div",yo,[s.totalPages>1?(r(!0),d(P,{key:0},M(n.pages,(p,b)=>(r(),d("div",{class:I(["page-number",{active:p.number===1+s.currentPage}]),key:b,onClick:y(O=>s.currentPage=p.number-1,["stop"])},l(p.number),11,So))),128)):m("",!0)]),o.dismissed?m("",!0):(r(),d("div",ko,[o.notifications.length?(r(),d("a",{key:0,href:"#",class:"dismiss",onClick:t[4]||(t[4]=y((...p)=>n.processDismissAllNotifications&&n.processDismissAllNotifications(...p),["stop","prevent"]))},l(s.strings.dismissAll),1)):m("",!0)]))])):m("",!0)])):m("",!0)]),_:1}),u(X,{name:"notifications-fade"},{default:g(()=>[o.notificationsStore.showNotifications?(r(),d("div",{key:0,onClick:t[5]||(t[5]=(...p)=>o.notificationsStore.toggleNotifications&&o.notificationsStore.toggleNotifications(...p)),class:"overlay"})):m("",!0)]),_:1})],512)}const No=w(mo,[["render",Co]]),$="all-in-one-seo-pack",wo={setup(){const e=lt(),{processSaveChanges:t}=yt();return{helpPanelStore:it(),notificationsStore:U(),optionsStore:nt(),processSaveChanges:t,rootStore:q(),route:e}},components:{CoreAlert:St,CoreHeader:Ct,CoreHelp:ke,CoreLoader:Pt,CoreMainTabs:bt,CoreNotifications:No,GridContainer:kt},props:{pageName:{type:String,required:!0},showTabs:{type:Boolean,default(){return!0}},showSaveButton:{type:Boolean,default(){return!0}},excludeTabs:{type:Array,default(){return[]}},containerClasses:{type:Array,default(){return[]}},disableTabs:{type:Boolean,default(){return!1}}},data(){return{tabsKey:0,isNavigating:!1,strings:{saveChanges:c("Save Changes",$)}}},watch:{excludeTabs(){this.tabsKey+=1},$route(){this.isNavigating=!0,setTimeout(()=>{this.isNavigating=!1},300)}},computed:{tabs(){return this.$router.options.routes.filter(e=>e.name&&e.meta&&e.meta.name).filter(e=>ht(e.meta.access)).filter(e=>!e.meta.license||vt.hasMinimumLevel(e.meta.license)).filter(e=>!(e.meta.display==="lite"&&this.rootStore.isPro||e.meta.display==="pro"&&!this.rootStore.isPro)).filter(e=>!this.excludeTabs.includes(e.name)).map(e=>({slug:e.name,name:e.meta.name,url:{name:e.name},access:e.meta.access,label:e.meta.label}))},shouldShowSaveButton(){if(this.$route&&this.$route.name){const e=this.$router.options.routes.find(t=>t.name===this.$route.name);if(e&&e.meta&&e.meta.hideSaveButton)return!1}return this.showSaveButton},errorSaving(){const e=this.roootStore.isPro?"https://aioseo.com/plugin/pro-support":"https://aioseo.com/plugin/lite-support";return N(c("Oops! It looks like an error occurred while saving the changes. Please try again or %1$scontact our support team%2$s.",$),'<a href="'+H.utmUrl("error-saving",this.rootStore.aioseo.page,e)+'" target="_blank">',"</a>")}},mounted(){_t().notifications&&(this.notificationsStore.showNotifications||this.notificationsStore.toggleNotifications(),setTimeout(()=>{pt("notifications")},500)),this.notificationsStore.force&&this.notificationsStore.active.length&&(this.notificationsStore.force=!1,this.notificationsStore.toggleNotifications())}},To={class:"aioseo-main"},Lo=["innerHTML"],Do={class:"aioseo-tab-content"},Po={class:"aioseo-loading-placeholder"},Ao={key:2,class:"save-changes"};function Bo(e,t,a,o,s,n){const h=f("core-notifications"),_=f("core-header"),p=f("core-alert"),b=f("core-main-tabs"),O=f("core-loader"),V=f("base-button"),x=f("grid-container"),G=f("core-help");return r(),d("div",null,[u(h),i("div",To,[u(_,{"page-name":a.pageName},null,8,["page-name"]),u(x,{class:I(a.containerClasses)},{default:g(()=>[o.optionsStore.saveError?(r(),v(p,{key:0,type:"red"},{default:g(()=>[i("div",{innerHTML:n.errorSaving},null,8,Lo)]),_:1})):m("",!0),a.showTabs?(r(),v(b,{key:s.tabsKey,tabs:n.tabs,showSaveButton:n.shouldShowSaveButton,"disable-tabs":a.disableTabs},{extra:g(()=>[K(e.$slots,"extra",{},void 0,!0)]),_:3},8,["tabs","showSaveButton","disable-tabs"])):m("",!0),i("div",Do,[(r(),v(dt,{onPending:t[0]||(t[0]=B=>s.isNavigating=!0),onResolve:t[1]||(t[1]=B=>s.isNavigating=!1)},{default:g(()=>[u(X,{name:"route-fade",mode:"out-in"},{default:g(()=>[K(e.$slots,"default",{},void 0,!0)]),_:3})]),fallback:g(()=>[i("div",Po,[u(O,{dark:""})])]),_:3}))]),n.shouldShowSaveButton&&!s.isNavigating?(r(),d("div",Ao,[u(V,{type:"blue",size:"medium",loading:o.rootStore.loading,onClick:t[2]||(t[2]=B=>o.processSaveChanges(o.route.name))},{default:g(()=>[S(l(s.strings.saveChanges),1)]),_:1},8,["loading"])])):m("",!0)]),_:3},8,["class"])]),o.helpPanelStore.docs&&Object.keys(o.helpPanelStore.docs).length?(r(),v(G,{key:0})):m("",!0)])}const Zo=w(wo,[["render",Bo],["__scopeId","data-v-9d9bea0a"]]);export{Zo as C,fo as a,Ce as u};
|