trAvis - MANAGER
Edit File: SearchConsoleInline.CsiyAijz.js
import{a as v,u as M,f as w,g as A,r as x}from"./index.ByF2aI-G.js";import{u as P}from"./GoogleSearchConsole.DbaSUNjY.js";import{g as N}from"./params.B3T1WKlC.js";import{_ as T}from"./Actionable.Ds0bp1GR.js";import"./translations.Ur07Kmot.js";import{_ as I}from"./_plugin-vue_export-helper.BN1snXvA.js";import{_ as i,a as B}from"./default-i18n.DvLqo3S3.js";import{v as p,o as n,k as C,l as b,x as k,t as u,a as f,c as h,C as _,E as W,F as E,b as S}from"./runtime-dom.esm-bundler.DKw-RQqs.js";import{u as D}from"./WpTable.C8q3ixyf.js";import{C as U}from"./Index.CzfUkh0l.js";import{C as z}from"./Table.C8lx_e6O.js";import{c as O}from"./Caret.DMa7g0j7.js";const fe=()=>({validateLinksPerIndex:e=>{1>e.target.value&&(e.target.value=1),5e4<e.target.value&&(e.target.value=5e4)}}),R=t=>{if(!t)return"";if(t=t.trim().replace(" ","%20"),t=t.replace(/[^a-z0-9-~+_.?#=!&;,/:%@$|*'()[\]\\x80-\\xff]/gi,""),t==="")return t;if(t.toLowerCase().startsWith("mailto:")||["%0d","%0a","%0D","%0A"].forEach(r=>{t=t.replace(new RegExp(r,"g"),"")}),t=t.replace(";//","://"),t.includes("[")||t.includes("]")){const e=new URL(t);let r="";e.protocol?r+=e.protocol+"//":t[0]==="/"&&(r+="//"),e.username&&(r+=e.username),e.password&&(r+=":"+e.password),(e.username||e.password)&&(r+="@"),e.hostname&&(r+=e.hostname),e.port&&(r+=":"+e.port);const o=t.replace(r,""),s=o.replace("[","%5B").replace("]","%5D");t=t.replace(o,s)}return t},c="all-in-one-seo-pack",F={setup(){const{strings:t}=P(),e="sitemapErrorsTable",{pageNumber:r,processPagination:o,resultsPerPage:s}=D({changeItemsPerPageSlug:"searchConsoleSitemapErrors",fetchData:()=>Promise.resolve(),resultsPerPage:5,tableId:e});return{composableStrings:t,optionsStore:v(),pageNumber:r,processPagination:o,resultsPerPage:s,rootStore:M(),searchStatisticsStore:w(),settingsStore:A(),tableId:e}},components:{CoreAlertActionable:T,CoreModal:U,CoreWpTable:z,SvgCircleCheck:O},props:{display:{type:Boolean,default:!1},sitemaps:{type:Array,default:()=>[]}},data(){return{loading:!1,bulkOptions:[{label:i("Remove",c),value:"remove"},{label:i("Ignore",c),value:"ignore"}],strings:x(this.composableStrings,{aioseoHasFoundSomeErrorsInSitemaps:B(i("%1$s has found some errors in sitemaps that were previously submitted to Google Search Console. Since %1$s manages your sitemaps, these additional sitemaps can be removed.",c),"AIOSEO"),allErrorsResolved:i("All errors have been resolved",c),removeSitemap:i("Remove",c),ignoreSitemap:i("Ignore",c),viewDetails:i("Details",c),sitemapErrors:i("Sitemap Errors",c),thereAreSitemapsWithErrors:i("There are sitemaps with errors",c)})}},computed:{totals(){return{page:1,pages:Math.ceil(this.searchStatisticsStore.sitemapsWithErrors.length/this.resultsPerPage),total:this.searchStatisticsStore.sitemapsWithErrors.length}},rows(){const t=this.pageNumber===1?0:(this.pageNumber-1)*this.resultsPerPage;return this.searchStatisticsStore.sitemapsWithErrors.slice(t,t+this.resultsPerPage)},columns(){return[{slug:"sitemap",label:i("Sitemap",c)},{slug:"actions",label:i("Actions",c),width:"220px"}]}},methods:{escUrl:R,fetchData(){return Promise.resolve()},processBulkAction({action:t,selectedRows:e}){if(!e.length)return;const r=[];switch(Array.isArray(e)?e.forEach(o=>{r.push(this.rows[o].path)}):r.push(e.path),t){case"remove":this.loading=!0,this.searchStatisticsStore.deleteSitemap({sitemap:r}).finally(()=>{this.loading=!1});break;case"ignore":this.loading=!0,this.searchStatisticsStore.ignoreSitemap({sitemap:r}).finally(()=>{this.loading=!1});break}},deleteSitemap(t){this.loading=!0,this.searchStatisticsStore.deleteSitemap({sitemap:t}).finally(()=>{this.loading=!1})},ignoreSitemap(t){this.loading=!0,this.searchStatisticsStore.ignoreSitemap({sitemap:t}).finally(()=>{this.loading=!1})},canRemoveSitemap(t){return!this.rootStore.aioseo.data.sitemapUrls.includes(t.path)}}},L={class:"aioseo-modal-body"},V={key:0},H=["href"],Y=["onClick"],j=["href"],q=["onClick"],J={key:1,class:"no-errors"};function K(t,e,r,o,s,a){const m=p("core-alert-actionable"),y=p("core-wp-table"),g=p("svg-circle-check"),d=p("core-modal");return n(),C(d,{show:r.display,onClose:e[0]||(e[0]=l=>t.$emit("close")),classes:["aioseo-sitemaps-errors-modal"]},{headerTitle:b(()=>[k(u(s.strings.sitemapErrors),1)]),body:b(()=>[f("div",L,[o.searchStatisticsStore.sitemapsWithErrors.length>0?(n(),h("div",V,[_(m,{title:s.strings.thereAreSitemapsWithErrors,text:s.strings.aioseoHasFoundSomeErrorsInSitemaps,type:"yellow",size:"small"},null,8,["title","text"]),_(y,{id:o.tableId,columns:a.columns,rows:a.rows,"bulk-options":s.bulkOptions,totals:a.totals,showSearch:!1,loading:s.loading,onPaginate:o.processPagination,onProcessBulkAction:a.processBulkAction},{sitemap:b(({row:l})=>[f("a",{href:a.escUrl(l.path),target:"_blank",rel:"noopener"},u(l.path),9,H)]),actions:b(({row:l})=>[f("a",{href:"#",onClick:W(()=>a.ignoreSitemap(l.path),["prevent"])},u(s.strings.ignoreSitemap),9,Y),l.detailsUrl!==""?(n(),h(E,{key:0},[k(" | "),f("a",{href:a.escUrl(l.detailsUrl),target:"_blank",rel:"noopener"},u(s.strings.viewDetails),9,j)],64)):S("",!0),a.canRemoveSitemap(l)?(n(),h(E,{key:1},[k(" | "),f("a",{href:"#",class:"aioseo-sitemaps-errors-remove",onClick:W(()=>a.deleteSitemap(l.path),["prevent"])},u(s.strings.removeSitemap),9,q)],64)):S("",!0)]),_:1},8,["id","columns","rows","bulk-options","totals","loading","onPaginate","onProcessBulkAction"])])):(n(),h("div",J,[_(g),f("p",null,u(s.strings.allErrorsResolved),1)]))])]),_:1},8,["show"])}const G=I(F,[["render",K]]),Q="all-in-one-seo-pack",X={setup(){const{strings:t,redirectToGscSettings:e}=P();return{searchStatisticsStore:w(),settingsStore:A(),optionsStore:v(),composableStrings:t,redirectToGscSettings:e}},components:{CoreAlertActionable:T,SitemapsWithErrorsModal:G},data(){return{showErrorsModal:!1,strings:x(this.composableStrings,{yourSiteIsConnected:i("Your site is connected directly to Google Search Console and your sitemaps are in sync.",Q)})}},mounted(){this.showErrorsModal=!!N()["open-modal"]}},Z={class:"google-search-console-alerts"},$={key:1};function ee(t,e,r,o,s,a){var g,d;const m=p("core-alert-actionable"),y=p("sitemaps-with-errors-modal");return n(),h("div",Z,[!o.searchStatisticsStore.isConnected&&!((g=o.settingsStore.settings.dismissedAlerts)!=null&&g.searchConsoleNotConnected)?(n(),C(m,{key:0,title:s.strings.connectToGoogleToAddSitemaps,text:s.strings.aioseoCanNowVerify,button:s.strings.connectToGoogleSearchConsole,buttonType:"link",type:"yellow",size:"small","show-close":"",onClick:o.redirectToGscSettings,onCloseAlert:e[0]||(e[0]=()=>o.settingsStore.dismissAlert("searchConsoleNotConnected"))},null,8,["title","text","button","onClick"])):S("",!0),o.searchStatisticsStore.isConnected&&!((d=o.settingsStore.settings.dismissedAlerts)!=null&&d.searchConsoleSitemapErrors)?(n(),h("div",$,[o.searchStatisticsStore.sitemapsWithErrors.length>0?(n(),C(m,{key:0,title:s.strings.thereAreSitemapsWithErrors,text:s.strings.aioseoHasFoundSomeErrorsInSitemaps,button:s.strings.fixSitemapErrors,buttonType:"link",type:"yellow",size:"small","show-close":"",onCloseAlert:e[1]||(e[1]=()=>o.settingsStore.dismissAlert("searchConsoleSitemapErrors")),onClick:e[2]||(e[2]=()=>s.showErrorsModal=!0)},null,8,["title","text","button"])):S("",!0),_(y,{display:s.showErrorsModal,onClose:e[3]||(e[3]=l=>s.showErrorsModal=!1)},null,8,["display"])])):S("",!0)])}const _e=I(X,[["render",ee]]),te="all-in-one-seo-pack",se={setup(){const{strings:t,redirectToGscSettings:e}=P();return{optionsStore:v(),searchStatisticsStore:w(),settingsStore:A(),rootStore:M(),composableStrings:t,redirectToGscSettings:e}},components:{CoreAlertActionable:T,SitemapsWithErrorsModal:G},data(){return{showErrorsModal:!1,strings:x(this.composableStrings,{yourSiteIsConnected:i("Your site is connected directly to Google Search Console and your sitemaps are in sync.",te)})}},computed:{showIsConnected(){return this.searchStatisticsStore.isConnected&&this.optionsStore.internalOptions.internal.searchStatistics.site.verified}}},oe={class:"google-search-console-alerts-inline"};function re(t,e,r,o,s,a){var g,d;const m=p("core-alert-actionable"),y=p("sitemaps-with-errors-modal");return n(),h("div",oe,[a.showIsConnected?(n(),h(E,{key:0},[_(m,{text:s.strings.yourSiteIsConnected,type:"green",size:"small"},null,8,["text"]),o.searchStatisticsStore.sitemapsWithErrors.length>0&&((g=o.settingsStore.settings.dismissedAlerts)!=null&&g.searchConsoleSitemapErrors)?(n(),C(m,{key:0,text:s.strings.aioseoHasFoundSomeErrorsInSitemaps,button:s.strings.fixSitemapErrors,buttonType:"link",type:"yellow",size:"small",onClick:e[0]||(e[0]=()=>s.showErrorsModal=!0)},null,8,["text","button"])):S("",!0),_(y,{display:s.showErrorsModal,onClose:e[1]||(e[1]=l=>s.showErrorsModal=!1),sitemaps:o.searchStatisticsStore.sitemapsWithErrors},null,8,["display","sitemaps"])],64)):(d=o.settingsStore.settings.dismissedAlerts)!=null&&d.searchConsoleNotConnected?(n(),C(m,{key:1,text:s.strings.connectToGoogleToAddSitemaps,button:s.strings.connectToGoogleSearchConsole,buttonType:"link",type:"yellow",size:"small",onClick:o.redirectToGscSettings},null,8,["text","button","onClick"])):S("",!0)])}const ye=I(se,[["render",re]]);export{_e as S,ye as a,fe as u};