"use strict";(self.webpackChunkwp_seopress=self.webpackChunkwp_seopress||[]).push([[968],{7328:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var a=n(6545),i=n(8975),l=n(9196),s=n.n(l),r=n(4221),o=n(2497),c=n(2196),d=n(9026);function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p.apply(this,arguments)}const y=e=>s().createElement("button",p({type:"button",className:"sp-icon-copy"},e)),m=({mainBarRef:e})=>{const t=(0,o.y)(),{data:n,mutate:p,abort:m}=(({postId:e})=>(0,d.V)((({postId:e})=>`${SEOPRESS_DATA.REST_URL}seopress/v1/posts/${e}/significant-keywords`)({postId:e}),{suspense:!0}))({postId:t});(0,l.useEffect)((()=>()=>{m()}),[]);const{actions:u}=(0,l.useContext)(r.u),g=(0,a.U2)(n,"suggestions",{}),k=g&&"object"==typeof g?Object.values(g):[];return s().createElement("div",{ref:e,tabIndex:"0"},s().createElement("p",{className:"description-alt desc-fb"},s().createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},s().createElement("path",{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"})),(0,c.i)({key:"layouts.internal_linking.description_1"})),s().createElement("p",null,(0,c.i)({key:"layouts.internal_linking.description_2"})),(0,a.xb)(k)&&s().createElement(s().Fragment,null,(0,c.i)({key:"layouts.internal_linking.no_suggestions"})),k.map(((e,t)=>s().createElement("div",{key:`keyword_${t}`},s().createElement("p",null,(0,c.i)({key:"layouts.internal_linking.matching"})," ",s().createElement("strong",null,e.word)),s().createElement("div",{style:{display:"flex",marginBottom:"15px",alignItems:"center"}},s().createElement(y,{onClick:async()=>{try{await(async e=>{if(navigator.clipboard&&window.isSecureContext)return void await navigator.clipboard.writeText(e);const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",document.body.appendChild(t),t.select();try{if(!document.execCommand("copy"))throw new Error("execCommand copy failed")}finally{document.body.removeChild(t)}})(e.permalink),u.setMessage((0,c.i)({key:"layouts.internal_linking.copied"}))}catch(e){u.setMessage((0,c.i)({key:"layouts.internal_linking.copy_failed"}),"error")}},"aria-label":(0,i.sprintf)((0,c.i)({key:"layouts.internal_linking.copy_link"}),e.title)},s().createElement("span",{className:"dashicons dashicons-admin-page","aria-hidden":"true",style:{padding:"5px",background:"var(--borderColorLight40)",borderRadius:"4px",width:"30px",height:"30px",display:"flex",alignItems:"center",lineHeight:"30px",justifyContent:"center"}})),s().createElement("a",{href:e.permalink,title:(0,c.i)({key:"layouts.internal_linking.open_link"}),target:"_blank",style:{marginRight:"10px",marginLeft:"10px",lineHeight:"30px"}},e.title),s().createElement("span",{className:"dashicons dashicons-external"}),s().createElement("a",{href:e.edit_link,target:"_blank",style:{textDecoration:"none"},title:(0,c.i)({key:"layouts.internal_linking.edit_link"})},s().createElement("span",{className:"dashicons dashicons-edit","aria-label":(0,i.sprintf)((0,c.i)({key:"layouts.internal_linking.edit_link_aria"}),e.title)})))))))}}}]);