Files
2026-04-28 15:13:50 +02:00

2 lines
6.5 KiB
JavaScript

import{ay as Q,o as W,at as G,b as J,aq as K,f as a,i as S,j as o,T as B,ae as T,U as m,M as d,V as X,v as n,a0 as $,R as A,Q as f,S as Y,P as Z,r as c,n as tt,u as w}from"./vendor-vue-ui.de3ab35f.js";import{I as st}from"./app-core.ae890a3f.js";import{u as et}from"./PostTypes.bcb4ad24.js";import{u as ot}from"./Refresh.94db5563.js";import{_ as nt,a as at,b as it,c as lt,L as rt,u as ut}from"./Index.3216ad8e.js";import{u as pt}from"./WpTable.65c7870f.js";import{C as dt}from"./Tabs.b5aef6dd.js";import{S as ct,a as vt,b as gt}from"./InternalOutbound.dca1dd65.js";import{S as mt}from"./External.934835f7.js";import{S as ft}from"./Suggestion.94b951e4.js";import{S as kt}from"./Refresh.5f8f183c.js";import{_ as r,a as k}from"./vendor-other.7b559694.js";import"./vendor-lodash.8e35bd59.js";import"./Tooltip.ae7a1028.js";import"./_plugin-vue_export-helper.eefbdd86.js";import"./Table.199a0fd0.js";import"./Index.52399193.js";import"./Close.098d4b76.js";import"./Button.a549093d.js";import"./Slide.e6618126.js";import"./Download.aee86410.js";import"./EditablePhrase.136366c7.js";import"./Index.ab3bcf62.js";import"./Editor.10fec9a8.js";import"./vendor-quill.fa67f709.js";import"./Input.8918dec2.js";import"./Pencil.405b16d2.js";import"./Trash.d35f8063.js";import"./Caret.a017b70a.js";import"./Plus.97dee933.js";import"./postStatus.ff1bf93a.js";import"./Plus.d276bd63.js";import"./ScrollTo.f4df02aa.js";import"./ProBadge.fd60f711.js";import"./Information.278772ab.js";const bt={class:"aioseo-link-assistant-post-report"},_t={key:0,class:"header-container"},It={class:"first-row"},yt={class:"second-row"},ht={class:"first-column"},xt={class:"header"},St={key:1,class:"load-progress"},Tt={key:2,class:"header-container"},Lt={class:"first-row"},Rt={class:"second-row"},$t={class:"first-column"},wt={class:"header"},Pt={class:"actions"},Ct=["href"],Bt=["href"],At={class:"second-column"},fs={__name:"PostReport",setup(Ot){const i="aioseo-pro",b=st(),u=c(null),v=c(0),e=c({}),p=c("inbound-internal"),h=c("suggestions-inbound"),g=c(4),_=c(!1),I=c(!1),x={backToLinksReport:r("Back to Links Report",i),loadingHeader:r("Loading Link Suggestions. Please wait...",i),refresh:r("Refresh",i)},y=w(()=>({...e.value,links:b.postReport})),O=w(()=>k(r('Internal Links & Suggestions for "%1$s"',i),e.value.context.postTitle)),q=w(()=>[{slug:"inbound-internal",icon:ct,name:k("%1$s %2$s",e.value.links.inboundInternal.totals.total,r("Inbound Internal",i))},{slug:"outbound-internal",icon:vt,name:k("%1$s %2$s",e.value.links.outboundInternal.totals.total,r("Outbound Internal",i))},{slug:"affiliate",icon:gt,name:k("%1$s %2$s",e.value.links.affiliate.totals.total,r("Affiliate",i))},{slug:"external",icon:mt,name:k("%1$s %2$s",e.value.links.external.totals.total,r("External",i))},{slug:"link-suggestions",icon:ft,name:k("%1$s %2$s",e.value.links.suggestionsOutbound.totals.total+e.value.links.suggestionsInbound.totals.total,r("Link Suggestions",i))}]),L=Q(),P=()=>{L.push({name:"links-report"})},R=(s,t)=>{p.value=s,t&&(h.value=t)},C=()=>{_.value=!1,I.value&&tt(()=>{_.value=!0,2>g.value&&(g.value=4),g.value=g.value/2,setTimeout(C,g.value*1e3)})},{filter:D,processFetchTableData:M,processAdditionalFilters:N}=pt({fetchData:b.fetchPostReport}),{editPost:V,viewPost:z}=et(),{doRefresh:E,isPrioritizedPost:F,refreshLoading:H}=ot({post:e,postIndex:v,processAdditionalFilters:N,requestType:"postReport"}),{filteredSuggestionsOutbound:U}=ut();return W(()=>{const s=G();if(s.query){if(!s.query.postId){L.push({name:"links-report"});return}u.value=parseInt(s.query.postId),v.value=parseInt(s.query.postIndex),p.value=s.query.initialTab,h.value=s.query.initialSuggestionTab,e.value={ID:u.value,context:{postType:{singular:null}},links:{...b.postReport}}}}),J(()=>{b.resetPostReportState(),window.aioseoBus.$emit("updatingLinks",!0),_.value=!0,I.value=!0,setTimeout(C,g.value*1e3),D.value="all",M({postId:u.value}).then(s=>{s.body.links&&(e.value.links=s.body.links),s.body.context&&(e.value.context=s.body.context),b.postReport={...s.body.links}}).catch(s=>{console.error(s),L.push({name:"links-report"})}).finally(()=>{window.aioseoBus.$emit("updatingLinks",!1),_.value=!1,I.value=!1})}),(s,t)=>{const j=K("base-button");return a(),S("div",bt,[I.value?(a(),S("div",_t,[o("div",It,[o("a",{href:"#",onClick:B(P,["stop","prevent"])},[t[5]||(t[5]=T(" ← ",-1)),o("span",null,m(x.backToLinksReport),1)])]),o("div",yt,[o("div",ht,[o("span",xt,m(x.loadingHeader),1)])])])):d("",!0),_.value?(a(),S("div",St,[o("div",{class:"load-progress-value",style:X({animationDuration:g.value+"s"})},null,4)])):d("",!0),I.value?d("",!0):(a(),S("div",Tt,[o("div",Lt,[o("a",{href:"#",onClick:B(P,["prevent"])},[t[6]||(t[6]=T(" ← ",-1)),o("span",null,m(x.backToLinksReport),1)])]),o("div",Rt,[o("div",$t,[o("span",wt,m(O.value),1),o("div",Pt,[o("a",{class:"view-post-link",href:e.value.context.permalink,target:"_blank"},m(n(z)(e.value.context.postType.singular)),9,Ct),t[7]||(t[7]=T(" | ",-1)),o("a",{class:"edit-post-link",href:e.value.context.editLink,target:"_blank"},m(n(V)(e.value.context.postType.singular)),9,Bt)])]),o("div",At,[$(j,{type:"blue",tag:"button",loading:n(H),disabled:n(F),onClick:n(E)},{default:A(()=>[$(n(kt)),T(" "+m(x.refresh),1)]),_:1},8,["loading","disabled","onClick"])])])])),$(n(dt),{class:"link-tabs",internal:"",tabs:q.value,active:p.value,showSaveButton:!1,onChanged:t[0]||(t[0]=l=>R(l))},{"var-tab-icon":A(({tab:l})=>[(a(),f(Y(l.icon),{class:Z([{warning:l.warning}])},null,8,["class"]))]),_:1},8,["tabs","active"]),p.value==="outbound-internal"?(a(),f(n(nt),{key:3,post:y.value,postIndex:v.value,postId:u.value,"post-report":"",onOpenSuggestions:t[1]||(t[1]=l=>R("link-suggestions","suggestions-outbound"))},null,8,["post","postIndex","postId"])):d("",!0),p.value==="inbound-internal"?(a(),f(n(at),{key:4,post:y.value,postIndex:v.value,postId:u.value,"post-report":"",onOpenSuggestions:t[2]||(t[2]=l=>R("link-suggestions","suggestions-inbound"))},null,8,["post","postIndex","postId"])):d("",!0),p.value==="affiliate"?(a(),f(n(it),{key:5,post:y.value,postIndex:v.value,postId:u.value,"post-report":""},null,8,["post","postIndex","postId"])):d("",!0),p.value==="external"?(a(),f(n(lt),{key:6,post:y.value,postIndex:v.value,postId:u.value,"post-report":""},null,8,["post","postIndex","postId"])):d("",!0),p.value==="link-suggestions"?(a(),f(n(rt),{key:7,post:y.value,postIndex:v.value,postId:u.value,filteredSuggestionsOutbound:n(U)(e.value),initialTab:h.value,"post-report":"",onShowStandalone:t[3]||(t[3]=l=>s.showStandalone=!0),onSuggestionsTabChanged:t[4]||(t[4]=l=>h.value=l)},null,8,["post","postIndex","postId","filteredSuggestionsOutbound","initialTab"])):d("",!0)])}}};export{fs as default};