Current File : /dom405686/wp-content/plugins/wordpress-seo/js/dist/block-editor.js
(()=>{var e={465(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"}))});e.exports=o},818(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},998(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},1609(e){"use strict";e.exports=window.React},2127(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4z",clipRule:"evenodd"}))});e.exports=o},2485(e,t){var s;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var n=typeof s;if("string"===n||"number"===n)e.push(s);else if(Array.isArray(s)){if(s.length){var i=o.apply(null,s);i&&e.push(i)}}else if("object"===n){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){e.push(s.toString());continue}for(var a in s)r.call(s,a)&&s[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(s=function(){return o}.apply(t,[]))||(e.exports=s)}()},2509(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"}))});e.exports=o},2514(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"}))});e.exports=o},2580(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"}))});e.exports=o},2863(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"}))});e.exports=o},3041(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{d:"M15 8a3 3 0 10-2.977-2.63l-4.94 2.47a3 3 0 100 4.319l4.94 2.47a3 3 0 10.895-1.789l-4.94-2.47a3.027 3.027 0 000-.74l4.94-2.47C13.456 7.68 14.19 8 15 8z"}))});e.exports=o},3473(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"}))});e.exports=o},3560(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"}))});e.exports=o},4719(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.exports=o},5011(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"}))});e.exports=o},5074(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=o},5169(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{d:"M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z"}))});e.exports=o},5547(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{d:"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z"}))});e.exports=o},5687(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=o},6702(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});e.exports=o},6883(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"}),r.createElement("path",{fillRule:"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"}))});e.exports=o},7219(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});e.exports=o},7651(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"}))});e.exports=o},7656(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}))});e.exports=o},8290(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"}))});e.exports=o},8393(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"}))});e.exports=o},8738(e,t,s){const r=s(1609),o=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))});e.exports=o}},t={};function s(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,s),n.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.data,r=window.wp.url,o=window.wp.editor,n=window.wp.element,i=window.wp.i18n,a=window.wp.plugins,l=window.wp.richText,c=window.yoast.externals.contexts,d=window.yoast.externals.redux,u=window.lodash;function p(){return(0,u.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1})}const h=window.yoast.propTypes;var m=s.n(h);const y=window.yoast.styledComponents;var g=s.n(y);const f=window.ReactJSXRuntime,x=g().svg`
width: ${e=>e.size}px;
height: ${e=>e.size}px;
&&& path {
fill: ${e=>e.color};
}
&&& circle.yoast-icon-readability-score {
fill: ${e=>e.readabilityScoreColor};
display: ${e=>e.isContentAnalysisActive?"inline":"none"};
}
&&& circle.yoast-icon-seo-score {
fill: ${e=>e.seoScoreColor};
display: ${e=>e.isKeywordAnalysisActive?"inline":"none"};
}
`,w=({readabilityScoreColor:e="#000000",isContentAnalysisActive:t=!1,seoScoreColor:s="#000000",isKeywordAnalysisActive:r=!1,size:o=20,color:n="#000001",...i})=>(0,f.jsxs)(x,{readabilityScoreColor:e,isContentAnalysisActive:t,seoScoreColor:s,isKeywordAnalysisActive:r,size:o,color:n,...i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 646.66 456.27",children:[(0,f.jsx)("path",{d:"M73,405.26a68.53,68.53,0,0,1-12.82-4c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92q-2.64-2-5.08-4.19a68.26,68.26,0,0,1-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24q-1.84-2.73-3.44-5.64a68.26,68.26,0,0,1-8.29-32.55V142.13a68.29,68.29,0,0,1,8.29-32.55,58.6,58.6,0,0,1,3.44-5.64,57.53,57.53,0,0,1,4-5.27A69.64,69.64,0,0,1,48.56,85.42,56.06,56.06,0,0,1,54.2,82,67.78,67.78,0,0,1,73,75.09,69.79,69.79,0,0,1,86.75,73.7H256.41L263,55.39H86.75A86.84,86.84,0,0,0,0,142.13V338.22A86.83,86.83,0,0,0,86.75,425H98.07V406.65H86.75A68.31,68.31,0,0,1,73,405.26ZM368.55,60.85l-1.41-.53L360.73,77.5l1.41.53a68.58,68.58,0,0,1,8.66,4,58.65,58.65,0,0,1,5.65,3.43A69.49,69.49,0,0,1,391,98.67c1.4,1.68,2.72,3.46,3.95,5.27s2.39,3.72,3.44,5.64a68.32,68.32,0,0,1,8.29,32.55V406.65H233.55l-.44.76c-3.07,5.37-6.26,10.48-9.49,15.19L222,425H425V142.13A87.19,87.19,0,0,0,368.55,60.85Z",fill:"#000001"}),(0,f.jsx)("path",{d:"M303.66,0l-96.8,268.87-47.58-149H101.1l72.72,186.78a73.61,73.61,0,0,1,0,53.73c-7.07,18.07-19.63,39.63-54.36,46l-1.56.29v49.57l2-.08c29-1.14,51.57-10.72,70.89-30.14,19.69-19.79,36.55-50.52,53-96.68L366.68,0Z",fill:"#000001"}),(0,f.jsx)("circle",{className:"yoast-icon-readability-score",cx:"561.26",cy:"142.43",r:"85.04",fill:"#000001",stroke:"#181716",strokeMiterlimit:"10",strokeWidth:"0.72"}),(0,f.jsx)("circle",{className:"yoast-icon-seo-score",cx:"561.26",cy:"341.96",r:"85.04",fill:"#000001",stroke:"#181716",strokeMiterlimit:"10",strokeWidth:"0.72"})]});w.propTypes={readabilityScoreColor:m().string,isContentAnalysisActive:m().bool,seoScoreColor:m().string,isKeywordAnalysisActive:m().bool,size:m().number,color:m().string};const b=w,v=window.wp.components,k=window.yoast.uiLibrary;function j(e){return void 0===e.length?e:(0,u.flatten)(e).sort((e,t)=>void 0===e.props.renderPriority?1:e.props.renderPriority-t.props.renderPriority)}var _=s(6702),S=s.n(_);const C=(e,t)=>{try{return(0,n.createInterpolateElement)(e,t)}catch(t){return console.error("Error in translation for:",e,t),e}};m().string.isRequired;var T=s(2514),R=s.n(T),E=s(818),I=s.n(E);m().string.isRequired,m().string.isRequired,m().shape({src:m().string.isRequired,width:m().string,height:m().string}).isRequired,m().shape({value:m().bool.isRequired,status:m().string.isRequired,set:m().func.isRequired}).isRequired,m().string,m().string,m().string;const L=({handleRefreshClick:e,supportLink:t})=>(0,f.jsxs)("div",{className:"yst-flex yst-gap-2",children:[(0,f.jsx)(k.Button,{onClick:e,children:(0,i.__)("Refresh this page","wordpress-seo")}),(0,f.jsx)(k.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,i.__)("Contact support","wordpress-seo")})]});L.propTypes={handleRefreshClick:m().func.isRequired,supportLink:m().string.isRequired};const A=({handleRefreshClick:e,supportLink:t})=>(0,f.jsxs)("div",{className:"yst-grid yst-grid-cols-1 yst-gap-y-2",children:[(0,f.jsx)(k.Button,{className:"yst-order-last",onClick:e,children:(0,i.__)("Refresh this page","wordpress-seo")}),(0,f.jsx)(k.Button,{variant:"secondary",as:"a",href:t,target:"_blank",rel:"noopener",children:(0,i.__)("Contact support","wordpress-seo")})]});A.propTypes={handleRefreshClick:m().func.isRequired,supportLink:m().string.isRequired};const N=({error:e,children:t=null})=>(0,f.jsxs)("div",{role:"alert",className:"yst-max-w-screen-sm yst-p-8 yst-space-y-4",children:[(0,f.jsx)(k.Title,{children:(0,i.__)("Something went wrong. An unexpected error occurred.","wordpress-seo")}),(0,f.jsx)("p",{children:(0,i.__)("We're very sorry, but it seems like the following error has interrupted our application:","wordpress-seo")}),(0,f.jsx)(k.Alert,{variant:"error",children:(null==e?void 0:e.message)||(0,i.__)("Undefined error message.","wordpress-seo")}),(0,f.jsx)("p",{children:(0,i.__)("Unfortunately, this means that any unsaved changes in this section will be lost. You can try and refresh this page to resolve the problem. If this error still occurs, please get in touch with our support team, and we'll get you all the help you need!","wordpress-seo")}),t]});N.propTypes={error:m().object.isRequired,children:m().node},N.VerticalButtons=A,N.HorizontalButtons=L;m().string,m().node.isRequired,m().node.isRequired,m().node,m().oneOf(Object.keys({lg:{grid:"yst-grid lg:yst-grid-cols-3 lg:yst-gap-12",col1:"yst-col-span-1",col2:"lg:yst-mt-0 lg:yst-col-span-2"},xl:{grid:"yst-grid xl:yst-grid-cols-3 xl:yst-gap-12",col1:"yst-col-span-1",col2:"xl:yst-mt-0 xl:yst-col-span-2"},"2xl":{grid:"yst-grid 2xl:yst-grid-cols-3 2xl:yst-gap-12",col1:"yst-col-span-1",col2:"2xl:yst-mt-0 2xl:yst-col-span-2"}}));var P=s(1609),M=s.n(P);const O=window.ReactDOM;var F,D,q;(D=F||(F={})).Pop="POP",D.Push="PUSH",D.Replace="REPLACE",function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(q||(q={})),new Set(["lazy","caseSensitive","path","id","index","children"]),Error;const B=["post","put","patch","delete"],$=(new Set(B),["get",...B]);new Set($),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred"),P.Component,P.startTransition,new Promise(()=>{}),P.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(ac){}var U,W,H,K;new Map,P.startTransition,O.flushSync,P.useId,"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,(K=U||(U={})).UseScrollRestoration="useScrollRestoration",K.UseSubmit="useSubmit",K.UseSubmitFetcher="useSubmitFetcher",K.UseFetcher="useFetcher",K.useViewTransitionState="useViewTransitionState",(H=W||(W={})).UseFetcher="useFetcher",H.UseFetchers="useFetchers",H.UseScrollRestoration="useScrollRestoration",m().string.isRequired,m().string;const Y=({href:e,children:t=null,...s})=>(0,f.jsxs)(k.Link,{target:"_blank",rel:"noopener noreferrer",...s,href:e,children:[t,(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]});Y.propTypes={href:m().string.isRequired,children:m().node};var z=s(8738),V=s.n(z);(0,i.__)("Create optimized SEO titles & meta descriptions in seconds","wordpress-seo"),(0,i.__)("Apply AI suggestions to improve content in 1 click","wordpress-seo"),(0,i.__)("Manage redirects with ease and without extra plugins","wordpress-seo"),(0,i.__)("Optimize pages for multiple keywords with guidance","wordpress-seo"),(0,i.__)("Add product details to help your listings stand out","wordpress-seo"),(0,i.__)("Make sure search engines show the right version of your product page","wordpress-seo"),(0,i.__)("Create optimized SEO titles & meta descriptions with AI","wordpress-seo"),(0,i.__)("Bulk AI-generated alt text for product images","wordpress-seo"),(0,i.__)("Generate SEO optimized metadata in seconds with AI","wordpress-seo"),(0,i.__)("Make your articles visible, be seen in Google News","wordpress-seo"),(0,i.__)("Built to get found by search, AI, and real users","wordpress-seo"),(0,i.__)("Easy Local SEO. Show up in Google Maps results","wordpress-seo"),(0,i.__)("Internal links and redirect management, easy","wordpress-seo"),(0,i.__)("Access to friendly help when you need it, day or night","wordpress-seo");var G=s(2485),X=s.n(G);var Z;function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Q.apply(null,arguments)}m().string.isRequired,m().object.isRequired,m().func.isRequired,m().bool.isRequired,s(3473);const J=e=>P.createElement("svg",Q({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),Z||(Z=P.createElement("path",{fill:"#CD82AB",d:"M10.989 6.74 7.885.98v.002L7.882.98 4.778 6.74 0 3.32l1.126 7.702H14.64l1.126-7.703L10.99 6.74z"})));m().string.isRequired,m().object,m().func.isRequired,m().bool.isRequired,m().string.isRequired,m().object.isRequired,m().string.isRequired,m().func.isRequired,m().bool.isRequired;var ee=s(5074),te=s.n(ee);m().bool.isRequired,m().func,m().func,m().string.isRequired,m().string.isRequired,m().string.isRequired,m().string.isRequired;const se=window.yoast.reactHelmet,re="_yoast_wpseo_title",oe="_yoast_wpseo_metadesc",ne="_yoast_wpseo_focuskw",ie="_yoast_wpseo_schema_article_type",ae="_yoast_wpseo_schema_page_type",le="request",ce="success",de="error",ue="idle",pe="loading",he="success",me="error",ye="showPlay",ge="askPermission",fe="isPlaying",xe=({videoId:e,thumbnail:t,wistiaEmbedPermission:s,className:r=""})=>{const[o,a]=(0,n.useState)(s.value?fe:ye),l=(0,n.useCallback)(()=>a(fe),[a]),c=(0,n.useCallback)(()=>{s.value?l():a(ge)},[s.value,l,a]),d=(0,n.useCallback)(()=>a(ye),[a]),u=(0,n.useCallback)(()=>{s.set(!0),l()},[s.set,l]);return(0,f.jsxs)(f.Fragment,{children:[s.value&&(0,f.jsx)(se.Helmet,{children:(0,f.jsx)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})}),(0,f.jsxs)("div",{className:X()("yst-relative yst-w-full yst-h-0 yst-pt-[47.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white",r),children:[o===ye&&(0,f.jsx)("button",{type:"button",className:"yst-absolute yst-inset-0 yst-button yst-p-0 yst-border-none yst-bg-white yst-transition-opacity yst-duration-1000 yst-opacity-100",onClick:c,children:(0,f.jsx)("img",{className:"yst-w-full yst-h-auto yst-object-contain",alt:"",loading:"lazy",decoding:"async",...t})}),o===ge&&(0,f.jsxs)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white",children:[(0,f.jsxs)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center",children:[s.status===pe&&(0,f.jsx)(k.Spinner,{}),s.status!==pe&&(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */
(0,i.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo"),"Yoast SEO","Wistia")]}),(0,f.jsxs)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4",children:[(0,f.jsx)(k.Button,{type:"button",variant:"secondary",onClick:d,disabled:s.status===pe,children:(0,i.__)("Deny","wordpress-seo")}),(0,f.jsx)(k.Button,{type:"button",variant:"primary",onClick:u,disabled:s.status===pe,children:(0,i.__)("Allow","wordpress-seo")})]})]}),s.value&&o===fe&&(0,f.jsxs)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-right-0",children:[null===e&&(0,f.jsx)(k.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,f.jsx)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`})]})]})]})};xe.propTypes={videoId:m().string.isRequired,thumbnail:m().shape({src:m().string.isRequired,width:m().string,height:m().string}).isRequired,wistiaEmbedPermission:m().shape({value:m().bool.isRequired,status:m().string.isRequired,set:m().func.isRequired}).isRequired,hasPadding:m().bool},s(5687),m().bool.isRequired,m().func.isRequired,m().func,m().string;const we="yoast-seo/ai-generator",be="yoast-seo/editor",ve="google",ke="social",je="twitter",_e="title",Se="description",Ce="post",Te="term",Re={post:"title",term:"term_title"},Ee=(0,u.mapValues)(Re,e=>`%%${e}%%`),Ie={idle:"idle",loading:"loading",success:"success",error:"error"},Le="success",Ae="error",Ne="abort",Pe=({children:e})=>(0,f.jsx)("p",{className:"yst-mt-2",children:e});Pe.propTypes={children:m().node.isRequired};const Me=()=>(0,t.useSelect)(e=>{const t=e(be);return{commonErrorsLink:t.selectLink("https://yoa.st/ai-common-errors"),supportLink:t.selectAdminLink("?page=wpseo_page_support")}},[]),Oe=(0,i.__)("Something went wrong","wordpress-seo"),Fe=({linkStoreName:e=be})=>{const s=(0,t.useSelect)(t=>t(e).selectLink("https://yoa.st/ai-common-errors"),[e]),r=(0,t.useSelect)(t=>t(e).selectAdminLink("?page=wpseo_page_support"),[e]);return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,i.__)("Please try again later. If this issue persists, you can learn more about possible reasons for this error on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,f.jsx)(Y,{variant:"error",href:s}),a2:(0,f.jsx)(Y,{variant:"error",href:r})})})};Fe.propTypes={linkStoreName:m().string};const De=({linkStoreName:e=be,className:t=""})=>(0,f.jsxs)(k.Alert,{variant:"error",className:t,children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:Oe}),(0,f.jsx)(Fe,{linkStoreName:e})]});De.propTypes={linkStoreName:m().string,className:m().string};const qe=(0,i.__)("Not enough content","wordpress-seo"),Be=()=>{const{commonErrorsLink:e,supportLink:t}=Me();return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,i.__)("Please add more content to ensure a valuable AI suggestion. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,f.jsx)(Y,{variant:"error",href:e}),a2:(0,f.jsx)(Y,{variant:"error",href:t})})})},$e=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:qe}),(0,f.jsx)(Be,{})]}),Ue=(0,i.__)("SEO analysis required","wordpress-seo"),We=()=>{const e=(0,t.useSelect)(e=>e(be).selectAdminLink("?page=wpseo_page_settings#/site-features#card-wpseo-keyword_analysis_active"),[]);return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(
/**
* translators:
* %1$s expands to Yoast SEO.
* %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
* %4$s expands to Yoast AI.
*/
/**
* translators:
* %1$s expands to Yoast SEO.
* %2$s and %3$s expand to an opening and closing anchor tag, respectively, that links to the settings page.
* %4$s expands to Yoast AI.
*/
(0,i.__)("%4$s requires the SEO analysis to be enabled. To enable it, please navigate to %2$sSite features%3$s in %1$s, turn on the SEO analysis, and click 'Save changes'. If it's disabled in your WordPress user profile, access your profile and enable it there. Please contact your administrator if you don't have access to these settings.","wordpress-seo"),"Yoast SEO","<a>","</a>","Yoast AI"),{a:(0,f.jsx)(Y,{variant:"error",href:e})})})},He=(0,i.__)("You've reached the Yoast AI rate limit","wordpress-seo"),Ke=()=>{const e=(0,t.useSelect)(e=>e(be).selectLink("https://yoa.st/ai-generator-rate-limit-help"),[]);return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,i.__)("You might have reached your Yoast AI rate limit for a specific time frame or your sparks limit for this month. If you have reached your rate limit, please reduce the frequency of your requests to continue using Yoast AI features. Our %1$shelp article%2$s provides guidance on effectively planning and pacing your requests for an optimized workflow.","wordpress-seo"),"<a>","</a>"),{a:(0,f.jsx)(Y,{variant:"error",href:e})})})},Ye=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:He}),(0,f.jsx)(Ke,{})]}),ze=window.wp.apiFetch;var Ve=s.n(ze);const Ge=(0,i.__)("Subscription required","wordpress-seo"),Xe=({invalidSubscriptions:e=[]})=>{const{newYoastWooLink:s,activateYoastWooLink:r,newPremiumLink:o,activatePremiumLink:n}=(0,t.useSelect)(e=>{const t=e(be);return{newYoastWooLink:t.selectLink("https://yoa.st/ai-generator-new-yoast-woocommerce"),activateYoastWooLink:t.selectLink("https://yoa.st/ai-generator-activate-yoast-woocommerce"),newPremiumLink:t.selectLink("https://yoa.st/ai-generator-new-premium"),activatePremiumLink:t.selectLink("https://yoa.st/ai-generator-activate-premium")}},[]);let a,l,c;return e.includes("Yoast WooCommerce SEO")?(a="Yoast WooCommerce SEO",l=r,c=s):e.includes("Yoast SEO Premium")&&(a="Yoast SEO Premium",l=n,c=o),a?(0,f.jsx)(Pe,{children:C((0,i.sprintf)(
/**
* translators:
* %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
* %2$s expands to MyYoast.
* %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
* %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
**/
/**
* translators:
* %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO.
* %2$s expands to MyYoast.
* %3$s and %4$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
* %5$s and %6$s expand to an opening and closing anchor tag, respectively, to get a new subscription.
**/
(0,i.__)("To access this feature, you need an active %1$s subscription. Please %3$sactivate your subscription in %2$s%4$s or %5$sget a new %1$s subscription%6$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),a,"MyYoast","<Activate>","</Activate>","<New>","</New>"),{Activate:(0,f.jsx)(Y,{variant:"error",href:l}),New:(0,f.jsx)(Y,{variant:"error",href:c})})}):(0,f.jsx)(Pe,{children:C((0,i.sprintf)(
/**
* translators:
* %1$s expands to MyYoast.
* %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
**/
/**
* translators:
* %1$s expands to MyYoast.
* %2$s and %3$s expand to an opening and closing anchor tag, respectively, to activate your subscription.
**/
(0,i.__)("To access this feature, you need an active subscription. Please %2$sactivate your subscription in %1$s%3$s. Afterward, refresh this page. It may take up to 30 seconds for the feature to function correctly.","wordpress-seo"),"MyYoast","<Activate>","</Activate>"),{Activate:(0,f.jsx)(Y,{variant:"error",href:n})})})};Xe.propTypes={invalidSubscriptions:m().arrayOf(m().string)};const Ze=({invalidSubscriptions:e=[]})=>{const s=(0,t.useSelect)(e=>e(we).selectBustSubscriptionCacheEndpoint(),[]),{onClose:r}=(0,k.useModalContext)(),o=(0,n.useCallback)(async()=>{try{await Ve()({path:s,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:Ge}),(0,f.jsx)(Xe,{invalidSubscriptions:e})]}),(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(k.Button,{variant:"secondary",onClick:r,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(k.Button,{variant:"primary",onClick:o,children:(0,i.__)("Refresh page","wordpress-seo")})]})]})};Ze.propTypes={invalidSubscriptions:m().arrayOf(m().string)};const Qe=(0,i.__)("Connection timeout","wordpress-seo"),Je=()=>{const{commonErrorsLink:e,supportLink:t}=Me();return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,i.__)("It seems that a connection timeout has occurred. Please check your internet connection and try again later. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,f.jsx)(Y,{variant:"error",href:e}),a2:(0,f.jsx)(Y,{variant:"error",href:t})})})},et=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:Qe}),(0,f.jsx)(Je,{})]}),tt=(0,i.__)("Usage policy violation","wordpress-seo"),st=()=>{const e=(0,t.useSelect)(e=>e(be).selectAdminLink("?page=wpseo_page_support"),[]);return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */ /* translators: %1$s, %2$s, %3$s, %4$s are anchor tags. %5$s expands to OpenAI. */
(0,i.__)("Due to %5$s's strict ethical guidelines and %1$susage policies%2$s, we cannot generate suggestions for the content on this page. If you intend to use AI, kindly avoid the use of explicit, violent, copyrighted, or sexually explicit content. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>","OpenAI"),{a1:(0,f.jsx)(Y,{variant:"error",href:"https://openai.com/policies/usage-policies"}),a2:(0,f.jsx)(Y,{variant:"error",href:e})})})},rt=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:tt}),(0,f.jsx)(st,{})]}),ot=(0,i.__)("Something went wrong","wordpress-seo"),nt=({errorMessage:e=""})=>{const s=(0,t.useSelect)(e=>e(be).selectAdminLink("?page=wpseo_page_support"),[]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Pe,{children:(0,i.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */
(0,i.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,i.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,f.jsx)(Y,{variant:"error",href:s})})})]})};nt.propTypes={errorMessage:m().string};const it=({errorMessage:e=""})=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:ot}),(0,f.jsx)(nt,{errorMessage:e})]});it.propTypes={errorMessage:m().string};const at=(0,i.__)("Something went wrong","wordpress-seo"),lt=()=>{const e=(0,t.useSelect)(e=>e(be).selectAdminLink("plugins.php"),[]);return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */ /* translators: %1$s expands to Yoast SEO Premium. %2$s expands to an opening link tag. %3$s expands to a closing link tag. */
(0,i.__)("The version of %1$s is outdated. Please upgrade %1$s %2$shere%3$s!","wordpress-seo"),"Yoast SEO Premium","<a>","</a>"),{a:(0,f.jsx)(Y,{variant:"error",href:e})})})},ct=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:at}),(0,f.jsx)(lt,{})]}),dt=({children:e})=>(0,f.jsx)(k.Modal.Description,{as:"div",className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:e}),ut=({children:e})=>(0,f.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e}),pt=({onClose:e,...t})=>(0,f.jsx)(k.Button,{variant:"secondary",onClick:e,...t,children:(0,i.__)("Close","wordpress-seo")}),ht=({isOpen:e,title:t,onClose:s=u.noop,children:r})=>{const o=(0,k.useSvgAria)();return(0,f.jsx)(k.Modal,{isOpen:e,onClose:s,children:(0,f.jsx)(k.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,i.__)("Dismiss","wordpress-seo"),children:(0,f.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,f.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,f.jsx)(te(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...o})}),(0,f.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,f.jsx)(k.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:t}),r]})]})})})},mt=({showActions:e=!1,onRetry:t,onClose:s})=>(0,f.jsxs)(ut,{children:[(0,f.jsx)(pt,{onClose:s}),e&&(0,f.jsx)(k.Button,{variant:"primary",onClick:t,children:(0,i.__)("Try again","wordpress-seo")})]});mt.propTypes={showActions:m().bool,onRetry:m().func.isRequired,onClose:m().func.isRequired};const yt=({isOpen:e=!0,showActions:t=!1,onRetry:s=u.noop,onClose:r=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:Oe,onClose:r,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Fe,{})}),(0,f.jsx)(mt,{showActions:t,onRetry:s,onClose:r})]});yt.propTypes={isOpen:m().bool,showActions:m().bool,onRetry:m().func,onClose:m().func};const gt=({isOpen:e=!0,showActions:t=!1,onRetry:s=u.noop,onClose:r=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:Qe,onClose:r,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Je,{})}),(0,f.jsx)(mt,{showActions:t,onRetry:s,onClose:r})]});gt.propTypes={isOpen:m().bool,showActions:m().bool,onRetry:m().func,onClose:m().func};const ft=({errorMessage:e="",isOpen:t=!0,showActions:s=!1,onRetry:r=u.noop,onClose:o=u.noop})=>(0,f.jsxs)(ht,{isOpen:t,title:ot,onClose:o,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(nt,{errorMessage:e})}),(0,f.jsx)(mt,{showActions:s,onRetry:r,onClose:o})]});ft.propTypes={errorMessage:m().string,isOpen:m().bool,showActions:m().bool,onRetry:m().func,onClose:m().func};const xt=({isOpen:e=!0,onClose:t=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:qe,onClose:t,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Be,{})}),(0,f.jsx)(ut,{children:(0,f.jsx)(pt,{onClose:t})})]});xt.propTypes={isOpen:m().bool,onClose:m().func};const wt=({isOpen:e=!0,onClose:t=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:tt,onClose:t,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(st,{})}),(0,f.jsx)(ut,{children:(0,f.jsx)(pt,{onClose:t})})]});wt.propTypes={isOpen:m().bool,onClose:m().func};const bt=({isOpen:e=!0,onClose:t=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:He,onClose:t,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Ke,{})}),(0,f.jsx)(ut,{children:(0,f.jsx)(pt,{onClose:t})})]});bt.propTypes={isOpen:m().bool,onClose:m().func};const vt=({isOpen:e=!0,onClose:t=u.noop})=>(0,f.jsxs)(ht,{isOpen:e,title:at,onClose:t,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(lt,{})}),(0,f.jsx)(ut,{children:(0,f.jsx)(pt,{onClose:t})})]});vt.propTypes={isOpen:m().bool,onClose:m().func};const kt=({invalidSubscriptions:e=[],isOpen:s=!0,onClose:r=u.noop})=>{const o=(0,t.useSelect)(e=>e(we).selectBustSubscriptionCacheEndpoint(),[]),a=(0,n.useCallback)(async()=>{try{await Ve()({path:o,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[o]);return(0,f.jsxs)(ht,{isOpen:s,title:Ge,onClose:r,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Xe,{invalidSubscriptions:e})}),(0,f.jsxs)(ut,{children:[(0,f.jsx)(pt,{onClose:r}),(0,f.jsx)(k.Button,{variant:"primary",onClick:a,children:(0,i.__)("Refresh page","wordpress-seo")})]})]})};kt.propTypes={invalidSubscriptions:m().arrayOf(m().string),isOpen:m().bool,onClose:m().func};const jt=({isOpen:e=!0,onClose:t=u.noop})=>{const s=(0,n.useCallback)(()=>window.location.reload(),[]);return(0,f.jsxs)(ht,{isOpen:e,title:Ue,onClose:t,children:[(0,f.jsx)(dt,{children:(0,f.jsx)(We,{})}),(0,f.jsxs)(ut,{children:[(0,f.jsx)(pt,{onClose:t}),(0,f.jsx)(k.Button,{variant:"primary",onClick:s,children:(0,i.__)("Refresh page","wordpress-seo")})]})]})};jt.propTypes={isOpen:m().bool,onClose:m().func};const _t=(0,i.__)("Yoast AI cannot reach your site","wordpress-seo"),St=()=>{const{commonErrorsLink:e,supportLink:t}=Me();return(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */ /* translators: %1$s and %3$s expand to an opening tag. %2$s and %4$s expand to a closing tag. */
(0,i.__)("To use this feature, your site must be publicly accessible. This applies to both test sites and instances where your REST API is password-protected. Please ensure your site is accessible to the public and try again. Learn more on our page about %1$scommon AI feature problems and errors%2$s. In case you need further help, please %3$scontact our support team%4$s.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,f.jsx)(Y,{variant:"error",href:e}),a2:(0,f.jsx)(Y,{variant:"error",href:t})})})},Ct=({learnMoreUrl:e=""})=>(0,f.jsx)(Pe,{children:C((0,i.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
(0,i.__)("%1$sLearn more about connecting with MyYoast.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,f.jsx)(Y,{variant:"error",href:e})})});Ct.propTypes={learnMoreUrl:m().string};const Tt=()=>{const e=(0,k.useSvgAria)(),{commonErrorsLink:s,supportLink:r}=(0,t.useSelect)(e=>{const t=e(be);return{commonErrorsLink:t.selectLink("https://yoa.st/ai-common-errors"),supportLink:t.selectAdminLink("?page=wpseo_page_support")}},[]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(dt,{children:(0,f.jsx)(Pe,{children:(0,i.__)("This feature requires a publicly accessible site. Check that your site (including any password-protected REST APIs or test environments) is visible to the public, then try again.","wordpress-seo")})}),(0,f.jsxs)(ut,{children:[(0,f.jsxs)(k.Button,{as:"a",href:r,target:"_blank",rel:"noopener noreferrer",variant:"secondary",children:[(0,i.__)("Still need help?","wordpress-seo"),(0,f.jsx)(S(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 yst-text-slate-400 rtl:yst-rotate-[270deg]",...e}),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}),(0,f.jsxs)(k.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(I(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-180",...e})]})]})]})},Rt=({isAvailable:e,canConnect:t,connectUrl:s,learnMoreUrl:r},o,n)=>e&&t&&s?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(dt,{children:[(0,f.jsx)(Pe,{children:(0,i.__)("This feature requires a publicly accessible site. Connect to MyYoast to use Yoast AI even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,f.jsx)(Ct,{learnMoreUrl:r})]}),(0,f.jsxs)(ut,{children:[(0,f.jsx)(pt,{onClose:o}),(0,f.jsxs)(k.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,i.__)("Connect to MyYoast","wordpress-seo"),(0,f.jsx)(S(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-[270deg]",...n}),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]}):e&&!t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(dt,{children:[(0,f.jsx)(Pe,{children:(0,i.__)("Your site isn't publicly accessible. Ask your site administrator to connect to MyYoast. They can find it on the Integrations page in Yoast SEO. This allows Yoast AI to work even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,f.jsx)(Ct,{learnMoreUrl:r})]}),(0,f.jsx)(ut,{children:(0,f.jsx)(pt,{onClose:o})})]}):(0,f.jsx)(Tt,{}),Et=({isOpen:e=!0,onClose:s=u.noop})=>{const r=(0,k.useSvgAria)(),o=(0,t.useSelect)(e=>e(we).selectMyyoastConnection(),[]);return(0,f.jsx)(ht,{isOpen:e,title:_t,onClose:s,children:Rt(o,s,r)})};Et.propTypes={isOpen:m().bool,onClose:m().func};const It=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:s,termsOfServiceLink:r,imageLink:o,linkStoreName:a})=>{const{onClose:l,initialFocus:c}=(0,k.useModalContext)(),[d,u]=(0,k.useToggleState)(!1),[p,h]=(0,n.useState)(!1),m=(0,n.useMemo)(()=>({src:o,width:"432",height:"244"}),[o]),y=C((0,i.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */
(0,i.__)("I approve the %1$sTerms of Service%2$s & %3$sPrivacy Policy%4$s of the Yoast AI service. This includes consenting to the collection and use of data to improve user experience.","wordpress-seo"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,f.jsx)(Y,{href:r}),a2:(0,f.jsx)(Y,{href:s})}),[g,x]=(0,k.useToggleState)(!1),w=(0,n.useCallback)(async()=>{x();const t=await e();h(!1===t),x()},[e]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:(0,f.jsx)("div",{className:"yst-relative yst-w-full",children:(0,f.jsx)("img",{className:"yst-w-full yst-h-auto yst-rounded-md yst-drop-shadow-md",alt:"",loading:"lazy",decoding:"async",...m})})}),(0,f.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,f.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,f.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:(0,i.sprintf)(/* translators: %s expands to Yoast AI. */ /* translators: %s expands to Yoast AI. */
(0,i.__)("Grant consent for %s","wordpress-seo"),"Yoast AI")}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:C((0,i.sprintf)(/* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */ /* translators: %1$s is a break tag; %2$s and %3$s are anchor tag; %4$s is the arrow icon. */
(0,i.__)("Enable AI-powered SEO! Use all Yoast AI features to boost your efficiency. Just give us the green light. %1$s%2$sLearn more%3$s%4$s","wordpress-seo"),"<br/>","<a>","<ArrowNarrowRightIcon />","</a>"),{a:(0,f.jsx)(Y,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,f.jsx)(I(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"}),br:(0,f.jsx)("br",{})})})]}),(0,f.jsx)("div",{className:"yst-flex yst-w-full yst-mt-6",children:(0,f.jsx)("hr",{className:"yst-w-full yst-text-gray-200"})}),(0,f.jsxs)("div",{className:"yst-flex yst-items-start yst-mt-4",children:[(0,f.jsx)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:d,value:d?"true":"false",onChange:u,className:"yst-checkbox__input",ref:c}),(0,f.jsx)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500",children:y})]}),p&&(0,f.jsx)(De,{className:"yst-mt-3",linkStoreName:a}),(0,f.jsx)("div",{className:"yst-w-full yst-flex yst-mt-4",children:(0,f.jsxs)(k.Button,{as:"button",className:"yst-grow",size:"large",disabled:!d||p,onClick:w,children:[g&&!p&&(0,f.jsx)(k.Spinner,{className:"yst-me-2"}),(0,i.__)("Grant consent","wordpress-seo")]})}),(0,f.jsx)(k.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:l,children:(0,i.__)("Close","wordpress-seo")})]})]})};It.propTypes={onGiveConsent:m().func.isRequired,learnMoreLink:m().string.isRequired,privacyPolicyLink:m().string.isRequired,termsOfServiceLink:m().string.isRequired,imageLink:m().string.isRequired,linkStoreName:m().string.isRequired};const Lt={termsOfService:"https://yoa.st/ai-generator-terms-of-service",privacyPolicy:"https://yoa.st/ai-generator-privacy-policy",learnMore:"https://yoa.st/ai-generator-learn-more"},At=({storeName:e,onConsentGranted:s,linkStoreName:r,links:o={}})=>{const i=(0,n.useMemo)(()=>({...Lt,...o}),[o]),{termsOfServiceLink:a,privacyPolicyLink:l,learnMoreLink:c,imageLink:d,endpoint:u}=(0,t.useSelect)(t=>{const s=t(r),o=t(e);return{termsOfServiceLink:s.selectLink(i.termsOfService),privacyPolicyLink:s.selectLink(i.privacyPolicy),learnMoreLink:s.selectLink(i.learnMore),imageLink:s.selectImageLink("ai-consent.jpg"),endpoint:o.selectAiGeneratorConsentEndpoint()}},[r,e,i]),{storeAiGeneratorConsent:p}=(0,t.useDispatch)(e),h=(0,n.useCallback)(async()=>{const e=await p(!0,u);return!1!==e&&s(),e},[p,s,u]);return(0,f.jsx)(It,{termsOfServiceLink:a,privacyPolicyLink:l,learnMoreLink:c,imageLink:d,onGiveConsent:h,linkStoreName:r})};At.propTypes={storeName:m().string.isRequired,onConsentGranted:m().func.isRequired,linkStoreName:m().string.isRequired,links:m().shape({termsOfService:m().string,privacyPolicy:m().string,learnMore:m().string})};const Nt=window.yoast.componentsNew,Pt=window.yoast.styleGuide,Mt=window.yoast.analysis;function Ot(e){switch(e){case"loading":return{icon:"loading-spinner",color:Pt.colors.$color_green_medium_light};case"not-set":return{icon:"seo-score-none",color:Pt.colors.$color_score_icon};case"noindex":return{icon:"seo-score-none",color:Pt.colors.$color_noindex};case"good":return{icon:"seo-score-good",color:Pt.colors.$color_green_medium};case"ok":return{icon:"seo-score-ok",color:Pt.colors.$color_ok};default:return{icon:"seo-score-bad",color:Pt.colors.$color_red}}}function Ft({target:e,children:t}){let s=e;return"string"==typeof e&&(s=document.getElementById(e)),s?(0,n.createPortal)(t,s):null}Ft.propTypes={target:m().oneOfType([m().string,m().object]).isRequired,children:m().node.isRequired};const Dt=({target:e,scoreIndicator:t})=>(0,f.jsx)(Ft,{target:e,children:(0,f.jsx)(Nt.SvgIcon,{...Ot(t)})});Dt.propTypes={target:m().string.isRequired,scoreIndicator:m().string.isRequired};const qt=Dt,Bt=({error:e})=>{const s=(0,n.useCallback)(()=>{var e,t;return null===(e=window)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.reload()},[]),r=(0,t.useSelect)(e=>e("yoast-seo/editor").selectLink("https://yoa.st/metabox-error-support"),[]),o=(0,t.useSelect)(e=>e("yoast-seo/editor").getPreference("isRtl",!1),[]);return(0,n.useEffect)(()=>{document.querySelectorAll('[id^="wpseo-meta-tab-"]').forEach(e=>{!function(e){const t=document.querySelector(`#${e}`);null!==t&&(t.style.opacity="0.5",t.style.pointerEvents="none",t.setAttribute("aria-disabled","true"),t.classList.contains("yoast-active-tab")&&t.classList.remove("yoast-active-tab"))}(e.id)})},[]),(0,f.jsx)(k.Root,{context:{isRtl:o},children:(0,f.jsxs)(N,{error:e,children:[(0,f.jsx)(N.HorizontalButtons,{supportLink:r,handleRefreshClick:s}),(0,f.jsx)(qt,{target:"wpseo-seo-score-icon",scoreIndicator:"not-set"}),(0,f.jsx)(qt,{target:"wpseo-readability-score-icon",scoreIndicator:"not-set"}),(0,f.jsx)(qt,{target:"wpseo-inclusive-language-score-icon",scoreIndicator:"not-set"})]})})};Bt.propTypes={error:m().object.isRequired};const $t=({theme:e,location:t,children:s})=>(0,f.jsx)(c.LocationProvider,{value:t,children:(0,f.jsx)(y.ThemeProvider,{theme:e,children:s})});$t.propTypes={theme:m().object.isRequired,location:m().oneOf(["sidebar","metabox","modal"]).isRequired,children:m().node.isRequired};const Ut=$t;function Wt({theme:e}){return(0,f.jsx)(Ut,{theme:e,location:"metabox",children:(0,f.jsx)(k.ErrorBoundary,{FallbackComponent:Bt,children:(0,f.jsx)(v.Slot,{name:"YoastMetabox",children:e=>j(e)})})})}const Ht=window.wp.compose;var Kt=s(5547),Yt=s.n(Kt);const zt=(e=null)=>(0,P.useMemo)(()=>{const t={role:"img","aria-hidden":"true"};return null!==e&&(t.focusable=e?"true":"false"),t},[e]),Vt=({className:e="",...t})=>(0,f.jsx)("span",{className:X()("yst-grow yst-overflow-hidden yst-overflow-ellipsis yst-whitespace-nowrap yst-font-wp","yst-text-[#555] yst-text-base yst-leading-[normal] yst-subpixel-antialiased yst-text-start",e),...t});Vt.displayName="MetaboxButton.Text",Vt.propTypes={className:m().string};const Gt=({className:e="",...t})=>(0,f.jsx)("button",{type:"button",className:X()("yst-flex yst-items-center yst-w-full yst-pt-4 yst-pb-4 yst-pe-4 yst-ps-6 yst-space-x-2 rtl:yst-space-x-reverse","yst-border-t yst-border-t-[rgb(0,0,0,0.2)] yst-rounded-none yst-transition-all hover:yst-bg-[#f0f0f0]","focus:yst-outline focus:yst-outline-[1px] focus:yst-outline-[color:#0066cd] focus:-yst-outline-offset-1 focus:yst-shadow-[0_0_3px_rgba(8,74,103,0.8)]",e),...t});Gt.propTypes={className:m().string},Gt.Text=Vt;const Xt=window.yoast.helpers,Zt=g().div`
min-width: 600px;
@media screen and ( max-width: 680px ) {
min-width: 0;
width: 86vw;
}
`,Qt=(g().div`
@media screen and ( min-width: 600px ) {
max-width: 420px;
}
`,g()(Nt.Icon)`
float: ${(0,Xt.getDirectionalStyle)("right","left")};
margin: ${(0,Xt.getDirectionalStyle)("0 0 16px 16px","0 16px 16px 0")};
&& {
width: 150px;
height: 150px;
@media screen and ( max-width: 680px ) {
width: 80px;
height: 80px;
}
}
`,({title:e="Yoast SEO",className:t="yoast yoast-gutenberg-modal",showYoastIcon:s=!0,children:r=null,additionalClassName:o="",...n})=>{const i=s?(0,f.jsx)("span",{className:"yoast-icon"}):null;return(0,f.jsx)(v.Modal,{title:e,className:`${t} ${o}`,icon:i,...n,children:r})});Qt.propTypes={title:m().node,className:m().string,showYoastIcon:m().bool,children:m().oneOfType([m().node,m().arrayOf(m().node)]),additionalClassName:m().string};const Jt=Qt;var es,ts;function ss(){return ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ss.apply(null,arguments)}const rs=e=>P.createElement("svg",ss({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 425 456.27"},e),es||(es=P.createElement("path",{d:"M73 405.26a66.79 66.79 0 0 1-6.54-1.7 64.75 64.75 0 0 1-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 0 1-5.08-4.19 69.21 69.21 0 0 1-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 0 1-3.44-5.64 68.29 68.29 0 0 1-8.29-32.55V142.13a68.26 68.26 0 0 1 8.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0 1 14.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0 1 73 75.09a68.75 68.75 0 0 1 13.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 0 0 0 142.13v196.09A86.84 86.84 0 0 0 86.75 425h11.32v-18.35H86.75A68.75 68.75 0 0 1 73 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 0 1 8.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 0 1 391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 0 1 8.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 0 0-56.45-81.28z"})),ts||(ts=P.createElement("path",{stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81,d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 0 1 0 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z"}))),os=({onClick:e,title:t,id:s="",subTitle:r="",suffixIcon:o=null,SuffixHeroIcon:n=null,prefixIcon:i=null,children:a=null})=>(0,f.jsx)("div",{className:"yoast components-panel__body",children:(0,f.jsx)("h2",{className:"components-panel__body-title",children:(0,f.jsxs)("button",{id:s,onClick:e,className:"components-button components-panel__body-toggle",type:"button",children:[i&&(0,f.jsx)("span",{className:"yoast-icon-span",style:{fill:`${i&&i.color||""}`},children:(0,f.jsx)(Nt.SvgIcon,{size:i.size,icon:i.icon})}),(0,f.jsxs)("span",{className:"yoast-title-container",children:[(0,f.jsx)("div",{className:"yoast-title",children:t}),(0,f.jsx)("div",{className:"yoast-subtitle",children:r})]}),a,o&&(0,f.jsx)(Nt.SvgIcon,{size:o.size,icon:o.icon}),n]})})}),ns=os;os.propTypes={onClick:m().func.isRequired,title:m().string.isRequired,id:m().string,subTitle:m().string,suffixIcon:m().object,SuffixHeroIcon:m().element,prefixIcon:m().object,children:m().node};const is=window.moment;var as=s.n(is);async function ls(e,t,s,r=200){try{const o=await e();return!!o&&(o.status===r?t(o):s(o))}catch(e){console.error(e.message)}}async function cs(e){try{return await Ve()(e)}catch(e){return e.error&&e.status?e:e instanceof Response&&await e.json()}}async function ds(e){return(0,u.isArray)(e)||(e=[e]),await cs({path:"yoast/v1/wincher/keyphrases/track",method:"POST",data:{keyphrases:e}})}const us=({data:e,mapChartDataToTableData:t=null,dataTableCaption:s,dataTableHeaderLabels:r,isDataTableVisuallyHidden:o=!0})=>e.length!==r.length?(0,f.jsx)("p",{children:(0,i.__)("The number of headers and header labels don't match.","wordpress-seo")}):(0,f.jsx)("div",{className:o?"screen-reader-text":null,children:(0,f.jsxs)("table",{children:[(0,f.jsx)("caption",{children:s}),(0,f.jsx)("thead",{children:(0,f.jsx)("tr",{children:r.map((e,t)=>(0,f.jsx)("th",{children:e},t))})}),(0,f.jsx)("tbody",{children:(0,f.jsx)("tr",{children:e.map((e,s)=>(0,f.jsx)("td",{children:t(e.y)},s))})})]})});us.propTypes={data:m().arrayOf(m().shape({x:m().number,y:m().number})).isRequired,mapChartDataToTableData:m().func,dataTableCaption:m().string.isRequired,dataTableHeaderLabels:m().array.isRequired,isDataTableVisuallyHidden:m().bool};const ps=us,hs=({data:e,width:t,height:s,fillColor:r=null,strokeColor:o="#000000",strokeWidth:i=1,className:a="",mapChartDataToTableData:l=null,dataTableCaption:c,dataTableHeaderLabels:d,isDataTableVisuallyHidden:u=!0})=>{const p=Math.max(1,Math.max(...e.map(e=>e.x))),h=Math.max(1,Math.max(...e.map(e=>e.y))),m=s-i,y=e.map(e=>`${e.x/p*t},${m-e.y/h*m+i}`).join(" "),g=`0,${m+i} `+y+` ${t},${m+i}`;return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)("svg",{width:t,height:s,viewBox:`0 0 ${t} ${s}`,className:a,role:"img","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("polygon",{fill:r,points:g}),(0,f.jsx)("polyline",{fill:"none",stroke:o,strokeWidth:i,strokeLinejoin:"round",strokeLinecap:"round",points:y})]}),l&&(0,f.jsx)(ps,{data:e,mapChartDataToTableData:l,dataTableCaption:c,dataTableHeaderLabels:d,isDataTableVisuallyHidden:u})]})};hs.propTypes={data:m().arrayOf(m().shape({x:m().number,y:m().number})).isRequired,width:m().number.isRequired,height:m().number.isRequired,fillColor:m().string,strokeColor:m().string,strokeWidth:m().number,className:m().string,mapChartDataToTableData:m().func,dataTableCaption:m().string.isRequired,dataTableHeaderLabels:m().array.isRequired,isDataTableVisuallyHidden:m().bool};const ms=hs,ys=()=>(0,f.jsxs)("p",{className:"yoast-wincher-seo-performance-modal__loading-message",children:[(0,i.__)("Tracking the ranking position…","wordpress-seo")," ",(0,f.jsx)(Nt.SvgIcon,{icon:"loading-spinner"})]}),gs=g()(Nt.SvgIcon)`
margin-left: 2px;
flex-shrink: 0;
rotate: ${e=>e.isImproving?"-90deg":"90deg"};
`,fs=g().span`
color: ${e=>e.isImproving?"#69AB56":"#DC3332"};
font-size: 13px;
font-weight: 600;
line-height: 20px;
margin-right: 2px;
margin-left: 12px;
`,xs=g().td`
padding-right: 0 !important;
& > div {
margin: 0px;
}
`,ws=g().td`
padding-left: 2px !important;
`,bs=g().td.attrs({className:"yoast-table--nopadding"})`
& > div {
justify-content: center;
}
`,vs=g().div`
display: flex;
align-items: center;
& > a {
box-sizing: border-box;
}
`,ks=g().button`
background: none;
color: inherit;
border: none;
padding: 0;
font: inherit;
cursor: pointer;
outline: inherit;
display: flex;
align-items: center;
`,js=g().tr`
background-color: ${e=>e.isEnabled?"#FFFFFF":"#F9F9F9"} !important;
`;function _s(e){return Math.round(100*e)}function Ss({chartData:e={}}){if((0,u.isEmpty)(e)||(0,u.isEmpty)(e.position))return"?";const t=function(e){return Array.from({length:e.position.history.length},(e,t)=>t+1).map(e=>(0,i.sprintf)((0,i._n)("%d day","%d days",e,"wordpress-seo"),e))}(e),s=e.position.history.map((e,t)=>({x:t,y:31-e.value}));return(0,f.jsx)(ms,{width:66,height:24,data:s,strokeWidth:1.8,strokeColor:"#498afc",fillColor:"#ade3fc",mapChartDataToTableData:_s,dataTableCaption:(0,i.__)("Keyphrase position in the last 90 days on a scale from 0 to 30.","wordpress-seo"),dataTableHeaderLabels:t})}function Cs({keyphrase:e,isEnabled:t,toggleAction:s,isLoading:r}){return r?(0,f.jsx)(Nt.SvgIcon,{icon:"loading-spinner"}):(0,f.jsx)(Nt.Toggle,{id:`toggle-keyphrase-tracking-${e}`,className:"wincher-toggle",isEnabled:t,onSetToggleState:s,showToggleStateLabel:!1})}function Ts(e){return!e||!e.position||e.position.value>30?"> 30":e.position.value}Ss.propTypes={chartData:m().object};const Rs=({rowData:e={}})=>{var t;if(null==e||null===(t=e.position)||void 0===t||!t.change)return(0,f.jsx)(Ss,{chartData:e});const s=e.position.change<0;return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(Ss,{chartData:e}),(0,f.jsx)(fs,{isImproving:s,children:Math.abs(e.position.change)}),(0,f.jsx)(gs,{icon:"caret-right",color:s?"#69AB56":"#DC3332",size:"14px",isImproving:s})]})};function Es({rowData:e,websiteId:t,keyphrase:s,onSelectKeyphrases:r}){const o=(0,n.useCallback)(()=>{r([s])},[r,s]),a=!(0,u.isEmpty)(e),l=e&&e.updated_at&&as()(e.updated_at)>=as()().subtract(7,"days"),c=e?`https://app.wincher.com/websites/${t}/keywords?serp=${e.id}&utm_medium=plugin&utm_source=yoast&referer=yoast&partner=yoast`:null;return a?l?(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("td",{children:(0,f.jsxs)(vs,{children:[Ts(e),(0,f.jsx)(Nt.ButtonStyledLink,{variant:"secondary",href:c,style:{height:28,marginLeft:12},rel:"noopener",target:"_blank",children:(0,i.__)("View","wordpress-seo")})]})}),(0,f.jsx)("td",{className:"yoast-table--nopadding",children:(0,f.jsx)(ks,{type:"button",onClick:o,children:(0,f.jsx)(Rs,{rowData:e})})}),(0,f.jsx)("td",{children:(d=e.updated_at,as()(d).fromNow())})]}):(0,f.jsx)("td",{className:"yoast-table--nopadding",colSpan:"3",children:(0,f.jsx)(ys,{})}):(0,f.jsx)("td",{className:"yoast-table--nopadding",colSpan:"3",children:(0,f.jsx)("i",{children:(0,i.__)("Activate tracking to show the ranking position","wordpress-seo")})});var d}function Is({keyphrase:e,rowData:t={},onTrackKeyphrase:s=u.noop,onUntrackKeyphrase:r=u.noop,isFocusKeyphrase:o=!1,isDisabled:i=!1,isLoading:a=!1,websiteId:l="",isSelected:c,onSelectKeyphrases:d}){var p;const h=!(0,u.isEmpty)(t),m=!(0,u.isEmpty)(null==t||null===(p=t.position)||void 0===p?void 0:p.history),y=(0,n.useCallback)(()=>{i||(h?r(e,t.id):s(e))},[e,s,r,h,t,i]),g=(0,n.useCallback)(()=>{d(t=>c?t.filter(t=>t!==e):t.concat(e))},[d,c,e]);return(0,f.jsxs)(js,{isEnabled:h,children:[(0,f.jsx)(xs,{children:m&&(0,f.jsx)(Nt.Checkbox,{id:"select-"+e,onChange:g,checked:c,label:""})}),(0,f.jsxs)(ws,{children:[e,o&&(0,f.jsx)("span",{children:"*"})]}),Es({rowData:t,websiteId:l,keyphrase:e,onSelectKeyphrases:d}),(0,f.jsx)(bs,{children:Cs({keyphrase:e,isEnabled:h,toggleAction:y,isLoading:a})})]})}Rs.propTypes={rowData:m().object},Is.propTypes={rowData:m().object,keyphrase:m().string.isRequired,onTrackKeyphrase:m().func,onUntrackKeyphrase:m().func,isFocusKeyphrase:m().bool,isDisabled:m().bool,isLoading:m().bool,websiteId:m().string,isSelected:m().bool.isRequired,onSelectKeyphrases:m().func.isRequired};const Ls=(0,Xt.makeOutboundLink)(),As=g().span`
display: block;
font-style: italic;
@media (min-width: 782px) {
display: inline;
position: absolute;
${(0,Xt.getDirectionalStyle)("right","left")}: 8px;
}
`,Ns=g().div`
width: 100%;
overflow-y: auto;
`,Ps=g().th`
pointer-events: ${e=>e.isDisabled?"none":"initial"};
padding-right: 0 !important;
& > div {
margin: 0px;
}
`,Ms=g().th`
padding-left: 2px !important;
`,Os=e=>{const t=(0,n.useRef)();return(0,n.useEffect)(()=>{t.current=e}),t.current},Fs=({addTrackedKeyphrase:e,isLoggedIn:t=!1,isNewlyAuthenticated:s=!1,keyphrases:r=[],newRequest:o,removeTrackedKeyphrase:a,setRequestFailed:l,setKeyphraseLimitReached:c,setRequestSucceeded:d,setTrackedKeyphrases:p,setHasTrackedAll:h,trackAll:m=!1,trackedKeyphrases:y=null,websiteId:g="",permalink:x,focusKeyphrase:w="",startAt:b=null,selectedKeyphrases:v,onSelectKeyphrases:k})=>{const j=(0,n.useRef)(),_=(0,n.useRef)(),S=(0,n.useRef)(!1),[C,T]=(0,n.useState)([]),R=(0,n.useCallback)(e=>{const t=e.toLowerCase();return y&&!(0,u.isEmpty)(y)&&Object.prototype.hasOwnProperty.call(y,t)?y[t]:null},[y]),E=(0,n.useMemo)(()=>async()=>{await ls(()=>{var e;return _.current&&_.current.abort(),_.current="undefined"==typeof AbortController?null:new AbortController,async function(e=null,t=null,s=null,r){return await cs({path:"yoast/v1/wincher/keyphrases",method:"POST",data:{keyphrases:e,permalink:s,startAt:t},signal:r})}(r,b,x,null===(e=_.current)||void 0===e?void 0:e.signal)},e=>{d(e),p(e.results)},e=>{l(e)})},[d,l,p,r,x,b]),I=(0,n.useCallback)(async t=>{const s=(Array.isArray(t)?t:[t]).map(e=>e.toLowerCase());T(e=>[...e,...s]),await ls(()=>ds(s),t=>{d(t),e(t.results),E()},e=>{400===e.status&&e.limit&&c(e.limit),l(e)},201),T(e=>(0,u.without)(e,...s))},[d,l,c,e,E]),L=(0,n.useCallback)(async(e,t)=>{e=e.toLowerCase(),T(t=>[...t,e]),await ls(()=>async function(e){return await cs({path:"yoast/v1/wincher/keyphrases/untrack",method:"DELETE",data:{keyphraseID:e}})}(t),t=>{d(t),a(e)},e=>{l(e)}),T(t=>(0,u.without)(t,e))},[d,a,l]),A=(0,n.useCallback)(async e=>{o(),await I(e)},[o,I]),N=Os(x),P=Os(r),M=Os(b),O=x&&b;(0,n.useEffect)(()=>{t&&O&&(x!==N||(0,u.difference)(r,P).length||b!==M)&&E()},[t,x,N,r,P,E,O,b,M]),(0,n.useEffect)(()=>{if(t&&m&&null!==y){const e=r.filter(e=>!R(e));e.length&&I(e),h()}},[t,m,y,I,h,R,r]),(0,n.useEffect)(()=>{s&&!S.current&&(E(),S.current=!0)},[s,E]),(0,n.useEffect)(()=>{if(t&&!(0,u.isEmpty)(y))return(0,u.filter)(y,e=>(0,u.isEmpty)(e.updated_at)).length>0&&(j.current=setInterval(()=>{E()},1e4)),()=>{clearInterval(j.current)}},[t,y,E]);const F=t&&null===y,D=(0,n.useMemo)(()=>(0,u.isEmpty)(y)?[]:Object.values(y).filter(e=>{var t;return!(0,u.isEmpty)(null==e||null===(t=e.position)||void 0===t?void 0:t.history)}).map(e=>e.keyword),[y]),q=(0,n.useMemo)(()=>v.length>0&&D.length>0&&D.every(e=>v.includes(e)),[v,D]),B=(0,n.useCallback)(()=>{k(q?[]:D)},[k,q,D]),$=(0,n.useMemo)(()=>(0,u.orderBy)(r,[e=>Object.values(y||{}).map(e=>e.keyword).includes(e)],["desc"]),[r,y]);return r&&!(0,u.isEmpty)(r)&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(Ns,{children:(0,f.jsxs)("table",{className:"yoast yoast-table",children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)(Ps,{isDisabled:0===D.length,children:(0,f.jsx)(Nt.Checkbox,{id:"select-all",onChange:B,checked:q,label:""})}),(0,f.jsx)(Ms,{scope:"col",abbr:(0,i.__)("Keyphrase","wordpress-seo"),children:(0,i.__)("Keyphrase","wordpress-seo")}),(0,f.jsx)("th",{scope:"col",abbr:(0,i.__)("Position","wordpress-seo"),children:(0,i.__)("Position","wordpress-seo")}),(0,f.jsx)("th",{scope:"col",abbr:(0,i.__)("Position over time","wordpress-seo"),children:(0,i.__)("Position over time","wordpress-seo")}),(0,f.jsx)("th",{scope:"col",abbr:(0,i.__)("Last updated","wordpress-seo"),children:(0,i.__)("Last updated","wordpress-seo")}),(0,f.jsx)("th",{scope:"col",abbr:(0,i.__)("Tracking","wordpress-seo"),children:(0,i.__)("Tracking","wordpress-seo")})]})}),(0,f.jsx)("tbody",{children:$.map((e,s)=>(0,f.jsx)(Is,{keyphrase:e,onTrackKeyphrase:A,onUntrackKeyphrase:L,rowData:R(e),isFocusKeyphrase:e===w.trim().toLowerCase(),websiteId:g,isDisabled:!t,isLoading:F||C.indexOf(e.toLowerCase())>=0,isSelected:v.includes(e),onSelectKeyphrases:k},`trackable-keyphrase-${s}`))})]})}),(0,f.jsxs)("p",{style:{marginBottom:0,position:"relative"},children:[(0,f.jsx)(Ls,{href:wpseoAdminGlobalL10n["links.wincher.login"],children:(0,i.sprintf)(/* translators: %s expands to Wincher */ /* translators: %s expands to Wincher */
(0,i.__)("Get more insights over at %s","wordpress-seo"),"Wincher")}),(0,f.jsx)(As,{children:(0,i.__)("* focus keyphrase","wordpress-seo")})]})]})};Fs.propTypes={addTrackedKeyphrase:m().func.isRequired,isLoggedIn:m().bool,isNewlyAuthenticated:m().bool,keyphrases:m().array,newRequest:m().func.isRequired,removeTrackedKeyphrase:m().func.isRequired,setRequestFailed:m().func.isRequired,setKeyphraseLimitReached:m().func.isRequired,setRequestSucceeded:m().func.isRequired,setTrackedKeyphrases:m().func.isRequired,setHasTrackedAll:m().func.isRequired,trackAll:m().bool,trackedKeyphrases:m().object,websiteId:m().string,permalink:m().string.isRequired,focusKeyphrase:m().string,startAt:m().string,selectedKeyphrases:m().arrayOf(m().string).isRequired,onSelectKeyphrases:m().func.isRequired};const Ds=Fs,qs=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getWincherWebsiteId:t,getWincherTrackableKeyphrases:s,getWincherLoginStatus:r,getWincherPermalink:o,getFocusKeyphrase:n,isWincherNewlyAuthenticated:i,shouldWincherTrackAll:a}=e("yoast-seo/editor");return{focusKeyphrase:n(),keyphrases:s(),isLoggedIn:r(),trackAll:a(),websiteId:t(),isNewlyAuthenticated:i(),permalink:o()}}),(0,t.withDispatch)(e=>{const{setWincherNewRequest:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherSetKeyphraseLimitReached:o,setWincherTrackedKeyphrases:n,setWincherTrackingForKeyphrase:i,setWincherTrackAllKeyphrases:a,unsetWincherTrackingForKeyphrase:l}=e("yoast-seo/editor");return{newRequest:()=>{t()},setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},setKeyphraseLimitReached:e=>{o(e)},addTrackedKeyphrase:e=>{i(e)},removeTrackedKeyphrase:e=>{l(e)},setTrackedKeyphrases:e=>{n(e)},setHasTrackedAll:()=>{a(!1)}}})])(Ds);class Bs{constructor(e,t={},s={}){this.url=e,this.origin=new URL(e).origin,this.eventHandlers=Object.assign({success:{type:"",callback:()=>{}},error:{type:"",callback:()=>{}}},t),this.options=Object.assign({height:570,width:340,title:""},s),this.popup=null,this.createPopup=this.createPopup.bind(this),this.messageHandler=this.messageHandler.bind(this),this.getPopup=this.getPopup.bind(this)}createPopup(){const{height:e,width:t,title:s}=this.options,r=["top="+(window.top.outerHeight/2+window.top.screenY-e/2),"left="+(window.top.outerWidth/2+window.top.screenX-t/2),"width="+t,"height="+e,"resizable=1","scrollbars=1","status=0"];this.popup&&!this.popup.closed||(this.popup=window.open(this.url,s,r.join(","))),this.popup&&this.popup.focus(),window.addEventListener("message",this.messageHandler,!1)}async messageHandler(e){const{data:t,source:s,origin:r}=e;r===this.origin&&this.popup===s&&(t.type===this.eventHandlers.success.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.success.callback(t)),t.type===this.eventHandlers.error.type&&(this.popup.close(),window.removeEventListener("message",this.messageHandler,!1),await this.eventHandlers.error.callback(t)))}getPopup(){return this.popup}isClosed(){return!this.popup||this.popup.closed}focus(){this.isClosed()||this.popup.focus()}}const $s=()=>(0,f.jsx)(Nt.Alert,{type:"info",children:(0,i.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */
(0,i.__)("Automatic tracking of keyphrases is enabled. Your keyphrase(s) will automatically be tracked by %s when you publish your post.","wordpress-seo"),"Wincher")}),Us=()=>(0,f.jsx)(Nt.Alert,{type:"success",children:(0,i.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */
(0,i.__)("You have successfully connected to %s! You can now track the SEO performance for the keyphrase(s) of this page.","wordpress-seo"),"Wincher")}),Ws=()=>(0,f.jsx)(Nt.Alert,{type:"info",children:(0,i.sprintf)(/* translators: %s: Expands to "Wincher". */ /* translators: %s: Expands to "Wincher". */
(0,i.__)("%s is currently tracking the ranking position(s) of your page. This may take a few minutes. Please wait or check back later.","wordpress-seo"),"Wincher")}),Hs=(0,Xt.makeOutboundLink)(),Ks=(0,Xt.makeOutboundLink)(),Ys=()=>{const e=(0,i.sprintf)(/* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */ /* translators: %1$s expands to a link to Wincher, %2$s expands to a link to the keyphrase tracking article on Yoast.com */
(0,i.__)("With %1$s you can track the ranking position of your page in the search results based on your keyphrase(s). %2$s","wordpress-seo"),"<wincherLink/>","<wincherReadMoreLink/>");return(0,f.jsx)("p",{children:C(e,{wincherLink:(0,f.jsx)(Hs,{href:wpseoAdminGlobalL10n["links.wincher.website"],children:"Wincher"}),wincherReadMoreLink:(0,f.jsx)(Ks,{href:wpseoAdminL10n["shortlinks.wincher.seo_performance"],children:(0,i.__)("Read more about keyphrase tracking with Wincher","wordpress-seo")})})})},zs=(0,Xt.makeOutboundLink)(),Vs=({limit:e=10})=>{const t=(0,i.sprintf)(/* translators: %1$d expands to the amount of allowed keyphrases on a free account, %2$s expands to a link to Wincher plans. */ /* translators: %1$d expands to the amount of allowed keyphrases on a free account, %2$s expands to a link to Wincher plans. */
(0,i.__)("You've reached the maximum amount of %1$d keyphrases you can add to your Wincher account. If you wish to add more keyphrases, please %2$s.","wordpress-seo"),e,"<UpdateWincherPlanLink/>");return(0,f.jsx)(Nt.Alert,{type:"error",children:C(t,{UpdateWincherPlanLink:(0,f.jsx)(zs,{href:wpseoAdminGlobalL10n["links.wincher.pricing"],children:(0,i.sprintf)(/* translators: %s : Expands to "Wincher". */ /* translators: %s : Expands to "Wincher". */
(0,i.__)("upgrade your %s plan","wordpress-seo"),"Wincher")})})})};Vs.propTypes={limit:m().number};const Gs=Vs,Xs=()=>(0,f.jsx)(Nt.Alert,{type:"error",children:(0,i.__)("No keyphrase has been set. Please set a keyphrase first.","wordpress-seo")}),Zs=()=>(0,f.jsx)(Nt.Alert,{type:"error",children:(0,i.__)("Before you can track your SEO performance make sure to set either the post’s title and save it as a draft or manually set the post’s slug.","wordpress-seo")}),Qs=({onReconnect:e,className:t=""})=>{const s=(0,i.sprintf)(/* translators: %s expands to a link to open the Wincher login popup. */ /* translators: %s expands to a link to open the Wincher login popup. */
(0,i.__)("It seems like something went wrong when retrieving your website's data. Please %s and try again.","wordpress-seo"),"<reconnectToWincher/>","Wincher");return(0,f.jsx)(Nt.Alert,{type:"error",className:t,children:C(s,{reconnectToWincher:(0,f.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),e()},children:(0,i.sprintf)(/* translators: %s : Expands to "Wincher". */ /* translators: %s : Expands to "Wincher". */
(0,i.__)("reconnect to %s","wordpress-seo"),"Wincher")})})})};Qs.propTypes={onReconnect:m().func.isRequired,className:m().string};const Js=Qs,er=()=>(0,f.jsx)(Nt.Alert,{type:"error",children:(0,i.__)("Something went wrong while tracking the ranking position(s) of your page. Please try again later.","wordpress-seo")}),tr=g().p`
color: ${Pt.colors.$color_pink_dark};
font-size: 14px;
font-weight: 700;
margin: 13px 0 10px;
`,sr=g()(Nt.SvgIcon)`
margin-right: 5px;
vertical-align: middle;
`,rr=g().button`
position: absolute;
top: 9px;
right: 9px;
border: none;
background: none;
cursor: pointer;
`,or=g().p`
font-size: 13px;
font-weight: 500;
margin: 10px 0 13px;
`,nr=g().div`
position: relative;
background: ${e=>e.isTitleShortened?"#f5f7f7":"transparent"};
border: 1px solid #c7c7c7;
border-left: 4px solid${Pt.colors.$color_pink_dark};
padding: 0 16px;
margin-bottom: 1.5em;
`,ir=({limit:e,usage:t,isTitleShortened:s=!1,isFreeAccount:r=!1})=>{const o=(0,i.sprintf)(
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
(0,i.__)("Your are tracking %1$s out of %2$s keyphrases included in your free account.","wordpress-seo"),t,e),n=(0,i.sprintf)(
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
(0,i.__)("Your are tracking %1$s out of %2$s keyphrases included in your account.","wordpress-seo"),t,e),a=r?o:n,l=(0,i.sprintf)(
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
/* Translators: %1$s expands to the number of used keywords.
* %2$s expands to the account keywords limit.
*/
(0,i.__)("Keyphrases tracked: %1$s/%2$s","wordpress-seo"),t,e),c=s?l:a;return(0,f.jsxs)(tr,{children:[s&&(0,f.jsx)(sr,{icon:"exclamation-triangle",color:Pt.colors.$color_pink_dark,size:"14px"}),c]})};ir.propTypes={limit:m().number.isRequired,usage:m().number.isRequired,isTitleShortened:m().bool,isFreeAccount:m().bool};const ar=(0,Xt.makeOutboundLink)(),lr=({discount:e,months:t})=>{const s=(0,f.jsx)(ar,{href:wpseoAdminGlobalL10n["links.wincher.upgrade"],style:{fontWeight:600},children:(0,i.sprintf)(/* Translators: %s : Expands to "Wincher". */ /* Translators: %s : Expands to "Wincher". */
(0,i.__)("Click here to upgrade your %s plan","wordpress-seo"),"Wincher")});if(!e||!t)return(0,f.jsx)(or,{children:s});const r=100*e,o=(0,i.sprintf)(
/* Translators: %1$s expands to upgrade account link.
* %2$s expands to the upgrade discount value.
* %3$s expands to the upgrade discount duration e.g. 2 months.
*/
/* Translators: %1$s expands to upgrade account link.
* %2$s expands to the upgrade discount value.
* %3$s expands to the upgrade discount duration e.g. 2 months.
*/
(0,i.__)("%1$s and get an exclusive %2$s discount for %3$s month(s).","wordpress-seo"),"<wincherAccountUpgradeLink/>",r+"%",t);return(0,f.jsx)(or,{children:C(o,{wincherAccountUpgradeLink:s})})};lr.propTypes={discount:m().number,months:m().number};const cr=({onClose:e=null,isTitleShortened:t=!1,trackingInfo:s=null})=>{const r=(()=>{const[e,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{e||async function(){return await cs({path:"yoast/v1/wincher/account/upgrade-campaign",method:"GET"})}().then(e=>t(e))},[e]),e})();if(null===s)return null;const{limit:o,usage:a}=s;if(!(o&&a/o>=.8))return null;const l=Boolean(null==r?void 0:r.discount);return(0,f.jsxs)(nr,{isTitleShortened:t,children:[e&&(0,f.jsx)(rr,{type:"button","aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close the upgrade callout","wordpress-seo"),onClick:e,children:(0,f.jsx)(Nt.SvgIcon,{icon:"times-circle",color:Pt.colors.$color_pink_dark,size:"14px"})}),(0,f.jsx)(ir,{...s,isTitleShortened:t,isFreeAccount:l}),(0,f.jsx)(lr,{discount:null==r?void 0:r.discount,months:null==r?void 0:r.months})]})};cr.propTypes={onClose:m().func,isTitleShortened:m().bool,trackingInfo:m().object};const dr=cr,ur=window.yoast["chart.js"],pr="label";function hr(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function mr(e,t){e.labels=t}function yr(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pr;const r=[];e.datasets=t.map(t=>{const o=e.datasets.find(e=>e[s]===t[s]);return o&&t.data&&!r.includes(o)?(r.push(o),Object.assign(o,t),o):{...t}})}function gr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pr;const s={labels:[],datasets:[]};return mr(s,e.labels),yr(s,e.datasets,t),s}function fr(e,t){const{height:s=150,width:r=300,redraw:o=!1,datasetIdKey:n,type:i,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...p}=e,h=(0,P.useRef)(null),m=(0,P.useRef)(),y=()=>{h.current&&(m.current=new ur.Chart(h.current,{type:i,data:gr(a,n),options:l&&{...l},plugins:c}),hr(t,m.current))},g=()=>{hr(t,null),m.current&&(m.current.destroy(),m.current=null)};return(0,P.useEffect)(()=>{!o&&m.current&&l&&function(e,t){const s=e.options;s&&t&&Object.assign(s,t)}(m.current,l)},[o,l]),(0,P.useEffect)(()=>{!o&&m.current&&mr(m.current.config.data,a.labels)},[o,a.labels]),(0,P.useEffect)(()=>{!o&&m.current&&a.datasets&&yr(m.current.config.data,a.datasets,n)},[o,a.datasets]),(0,P.useEffect)(()=>{m.current&&(o?(g(),setTimeout(y)):m.current.update(u))},[o,l,a.labels,a.datasets,u]),(0,P.useEffect)(()=>{m.current&&(g(),setTimeout(y))},[i]),(0,P.useEffect)(()=>(y(),()=>g()),[]),P.createElement("canvas",Object.assign({ref:h,role:"img",height:s,width:r},p),d)}const xr=(0,P.forwardRef)(fr);function wr(e,t){return ur.Chart.register(t),(0,P.forwardRef)((t,s)=>P.createElement(xr,Object.assign({},t,{ref:s,type:e})))}const br=wr("line",ur.LineController),vr={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};ur._adapters._date.override("function"==typeof as()?{_id:"moment",formats:function(){return vr},parse:function(e,t){return"string"==typeof e&&"string"==typeof t?e=as()(e,t):e instanceof as()||(e=as()(e)),e.isValid()?e.valueOf():null},format:function(e,t){return as()(e).format(t)},add:function(e,t,s){return as()(e).add(t,s).valueOf()},diff:function(e,t,s){return as()(e).diff(as()(t),s)},startOf:function(e,t,s){return e=as()(e),"isoWeek"===t?(s=Math.trunc(Math.min(Math.max(0,s),6)),e.isoWeekday(s).startOf("day").valueOf()):e.startOf(t).valueOf()},endOf:function(e,t){return as()(e).endOf(t).valueOf()}}:{}),Math.PI,Number.POSITIVE_INFINITY,Math.log10,Math.sign,"undefined"==typeof window||window.requestAnimationFrame,new Map,Object.create(null),Object.create(null),Number.EPSILON;const kr=["top","right","bottom","left"];function jr(e,t,s){const r={};s=s?"-"+s:"";for(let o=0;o<4;o++){const n=kr[o];r[n]=parseFloat(e[t+"-"+n+s])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}!function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}}(),ur.Chart.register(ur.CategoryScale,ur.LineController,ur.LineElement,ur.PointElement,ur.LinearScale,ur.TimeScale,ur.Legend,ur.Tooltip);const _r=["#ff983b","#ffa3f7","#3798ff","#ff3b3b","#acce81","#b51751","#3949ab","#26c6da","#ccb800","#de66ff","#4db6ac","#ffab91","#45f5f1","#77f210","#90a4ae","#ffd54f","#006b5e","#8ec7d2","#b1887c","#cc9300"];function Sr({datasets:e,isChartShown:t,keyphrases:s}){if(!t)return null;const r=(0,n.useMemo)(()=>Object.fromEntries([...s].sort().map((e,t)=>[e,_r[t%_r.length]])),[s]),o=e.map(e=>{const t=r[e.label];return{...e,data:e.data.map(({datetime:e,value:t})=>({x:e,y:t})),lineTension:0,pointRadius:1,pointHoverRadius:4,borderWidth:2,pointHitRadius:6,backgroundColor:t,borderColor:t}}).filter(e=>!1!==e.selected);return(0,f.jsx)(br,{height:100,data:{datasets:o},options:{plugins:{legend:{display:!0,position:"bottom",labels:{color:"black",usePointStyle:!0,boxHeight:7,boxWidth:7},onClick:u.noop},tooltip:{enabled:!0,callbacks:{title:e=>as()(e[0].raw.x).utc().format("YYYY-MM-DD")},titleAlign:"center",mode:"xPoint",position:"nearest",usePointStyle:!0,boxHeight:7,boxWidth:7,boxPadding:2}},scales:{x:{bounds:"ticks",type:"time",time:{unit:"day",minUnit:"day"},grid:{display:!1},ticks:{autoSkipPadding:50,maxRotation:0,color:"black"}},y:{bounds:"ticks",offset:!0,reverse:!0,ticks:{precision:0,color:"black"},max:31}}}})}ur.Interaction.modes.xPoint=(e,t,s,r)=>{const o=function(e,t){if("native"in e)return e;const{canvas:s,currentDevicePixelRatio:r}=t,o=(h=s).ownerDocument.defaultView.getComputedStyle(h,null),n="border-box"===o.boxSizing,i=jr(o,"padding"),a=jr(o,"border","width"),{x:l,y:c,box:d}=function(e,t){const s=e.touches,r=s&&s.length?s[0]:e,{offsetX:o,offsetY:n}=r;let i,a,l=!1;if(((e,t,s)=>(e>0||t>0)&&(!s||!s.shadowRoot))(o,n,e.target))i=o,a=n;else{const e=t.getBoundingClientRect();i=r.clientX-e.left,a=r.clientY-e.top,l=!0}return{x:i,y:a,box:l}}(e,s),u=i.left+(d&&a.left),p=i.top+(d&&a.top);var h;let{width:m,height:y}=t;return n&&(m-=i.width+a.width,y-=i.height+a.height),{x:Math.round((l-u)/m*s.width/r),y:Math.round((c-p)/y*s.height/r)}}(t,e);let n=[];if(ur.Interaction.evaluateInteractionItems(e,"x",o,(e,t,s)=>{e.inXRange(o.x,r)&&n.push({element:e,datasetIndex:t,index:s})}),0===n.length)return n;const i=n.reduce((e,t)=>Math.abs(o.x-e.element.x)<Math.abs(o.x-t.element.x)?e:t).element.x;return n=n.filter(e=>e.element.x===i),n.some(e=>Math.abs(e.element.y-o.y)<10)?n:[]},Sr.propTypes={datasets:m().arrayOf(m().shape({label:m().string.isRequired,data:m().arrayOf(m().shape({datetime:m().string.isRequired,value:m().number.isRequired})).isRequired,selected:m().bool})).isRequired,isChartShown:m().bool.isRequired,keyphrases:m().array.isRequired};const Cr=({response:e,onLogin:t})=>[401,403,404].includes(e.status)?(0,f.jsx)(Js,{onReconnect:t}):(0,f.jsx)(er,{});Cr.propTypes={response:m().object.isRequired,onLogin:m().func.isRequired};const Tr=({isSuccess:e,response:t={},allKeyphrasesMissRanking:s,onLogin:r,keyphraseLimitReached:o,limit:n})=>o?(0,f.jsx)(Gs,{limit:n}):(0,u.isEmpty)(t)||e?s?(0,f.jsx)(Ws,{}):null:(0,f.jsx)(Cr,{response:t,onLogin:r});Tr.propTypes={isSuccess:m().bool.isRequired,allKeyphrasesMissRanking:m().bool.isRequired,response:m().object,onLogin:m().func.isRequired,keyphraseLimitReached:m().bool.isRequired,limit:m().number.isRequired};let Rr=null;const Er=async({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:r,addTrackedKeyphrase:o,setKeyphraseLimitReached:n})=>{if(Rr&&!Rr.isClosed())return void Rr.focus();const{url:i}=await async function(){return await cs({path:"yoast/v1/wincher/authorization-url",method:"GET"})}();Rr=new Bs(i,{success:{type:"wincher:oauth:success",callback:i=>(async({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:r,addTrackedKeyphrase:o,setKeyphraseLimitReached:n},i)=>{await ls(()=>async function(e){const{code:t,websiteId:s}=e;return await cs({path:"yoast/v1/wincher/authenticate",method:"POST",data:{code:t,websiteId:s}})}(i),async a=>{e(!0,!0,i.websiteId.toString()),t(a);const l=(Array.isArray(r)?r:[r]).map(e=>e.toLowerCase());await ls(()=>ds(l),e=>{t(e),o(e.results)},e=>{400===e.status&&e.limit&&n(e.limit),s(e)},201);const c=Rr.getPopup();c&&c.close()},async e=>s(e))})({onAuthentication:e,setRequestSucceeded:t,setRequestFailed:s,keyphrases:r,addTrackedKeyphrase:o,setKeyphraseLimitReached:n},i)},error:{type:"wincher:oauth:error",callback:()=>e(!1,!1)}},{title:"Wincher_login",width:500,height:700}),Rr.createPopup()},Ir=e=>e.isLoggedIn?null:(0,f.jsx)("p",{children:(0,f.jsx)(Nt.NewButton,{onClick:e.onLogin,variant:"primary",children:(0,i.sprintf)(/* translators: %s expands to Wincher */ /* translators: %s expands to Wincher */
(0,i.__)("Connect with %s","wordpress-seo"),"Wincher")})});Ir.propTypes={isLoggedIn:m().bool.isRequired,onLogin:m().func.isRequired};const Lr=g().div`
p {
margin: 1em 0;
}
`,Ar=g().div`
${e=>e.isDisabled&&"\n\t\topacity: .5;\n\t\tpointer-events: none;\n\t"};
`,Nr=g().div`
font-weight: var(--yoast-font-weight-bold);
color: var(--yoast-color-label);
font-size: var(--yoast-font-size-default);
`,Pr=g().div.attrs({className:"yoast-field-group"})`
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14px;
`,Mr=g().div`
margin: 8px 0;
`,Or=as().utc().startOf("day"),Fr=[{name:(0,i.__)("Last day","wordpress-seo"),value:as()(Or).subtract(1,"days").format(),defaultIndex:1},{name:(0,i.__)("Last week","wordpress-seo"),value:as()(Or).subtract(1,"week").format(),defaultIndex:2},{name:(0,i.__)("Last month","wordpress-seo"),value:as()(Or).subtract(1,"month").format(),defaultIndex:3},{name:(0,i.__)("Last year","wordpress-seo"),value:as()(Or).subtract(1,"year").format(),defaultIndex:0}],Dr=({onSelect:e,selected:t=null,options:s,isLoggedIn:r})=>r?s.length<1?null:(0,f.jsx)("select",{className:"components-select-control__input",id:"wincher-period-picker",value:(null==t?void 0:t.value)||s[0].value,onChange:e,children:s.map(e=>(0,f.jsx)("option",{value:e.value,children:e.name},e.name))}):null;Dr.propTypes={onSelect:m().func.isRequired,selected:m().object,options:m().array.isRequired,isLoggedIn:m().bool.isRequired};const qr=({trackedKeyphrases:e=null,isLoggedIn:t,keyphrases:s,shouldTrackAll:r,permalink:o,historyDaysLimit:a=0})=>{if(!o&&t)return(0,f.jsx)(Zs,{});if(0===s.length)return(0,f.jsx)(Xs,{});const l=as()(Or).subtract(a,"days"),c=Fr.filter(e=>as()(e.value).isSameOrAfter(l)),d=(0,u.orderBy)(c,e=>e.defaultIndex,"desc")[0],[p,h]=(0,n.useState)(d),[m,y]=(0,n.useState)([]),g=m.length>0,x=(0,Ht.usePrevious)(e);(0,n.useEffect)(()=>{if(!(0,u.isEmpty)(e)&&(0,u.difference)(Object.keys(e),Object.keys(x||[])).length){const t=Object.values(e).map(e=>e.keyword);y(t)}},[e,x]),(0,n.useEffect)(()=>{h(d)},[null==d?void 0:d.name]);const w=(0,n.useCallback)(e=>{const t=Fr.find(t=>t.value===e.target.value);t&&h(t)},[h]),b=(0,n.useMemo)(()=>(0,u.isEmpty)(m)||(0,u.isEmpty)(e)?[]:Object.values(e).filter(e=>{var t;return!(null==e||null===(t=e.position)||void 0===t||!t.history)}).map(e=>{var t;return{label:e.keyword,data:e.position.history,selected:m.includes(e.keyword)&&!(0,u.isEmpty)(null===(t=e.position)||void 0===t?void 0:t.history)}}),[m,e]);return(0,f.jsxs)(Ar,{isDisabled:!t,children:[(0,f.jsx)("p",{children:(0,i.__)("You can enable / disable tracking the SEO performance for each keyphrase below.","wordpress-seo")}),t&&r&&(0,f.jsx)($s,{}),(0,f.jsx)(Pr,{children:(0,f.jsx)(Dr,{selected:p,onSelect:w,options:c,isLoggedIn:t})}),(0,f.jsx)(Mr,{children:(0,f.jsx)(Sr,{isChartShown:g,datasets:b,keyphrases:s})}),(0,f.jsx)(qs,{startAt:null==p?void 0:p.value,selectedKeyphrases:m,onSelectKeyphrases:y,trackedKeyphrases:e})]})};function Br({trackedKeyphrases:e=null,addTrackedKeyphrase:t,isLoggedIn:s=!1,isNewlyAuthenticated:r=!1,keyphrases:o=[],response:a={},shouldTrackAll:l=!1,permalink:c="",allKeyphrasesMissRanking:d,isSuccess:u,keyphraseLimitReached:p,limit:h,setRequestSucceeded:m,setRequestFailed:y,setKeyphraseLimitReached:g,onAuthentication:x}){const w=(0,n.useCallback)(()=>{Er({onAuthentication:x,setRequestSucceeded:m,setRequestFailed:y,keyphrases:o,addTrackedKeyphrase:t,setKeyphraseLimitReached:g})},[Er,x,m,y,o,t,g]),b=(e=>{const[t,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{e&&!t&&async function(){return await cs({path:"yoast/v1/wincher/account/limit",method:"GET"})}().then(e=>s(e))},[t]),t})(s);return(0,f.jsxs)(Lr,{children:[r&&(0,f.jsx)(Us,{}),s&&(0,f.jsx)(dr,{trackingInfo:b}),(0,f.jsxs)(Nr,{children:[(0,i.__)("SEO performance","wordpress-seo"),(0,f.jsx)(Nt.HelpIcon,{linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about the SEO performance feature.","wordpress-seo")})]}),(0,f.jsx)(Ys,{}),(0,f.jsx)(Ir,{isLoggedIn:s,onLogin:w}),(0,f.jsx)(Tr,{isSuccess:u,response:a,allKeyphrasesMissRanking:d,keyphraseLimitReached:p,limit:h,onLogin:w}),(0,f.jsx)(qr,{trackedKeyphrases:e,isLoggedIn:s,keyphrases:o,shouldTrackAll:l,permalink:c,historyDaysLimit:(null==b?void 0:b.historyDays)||31})]})}qr.propTypes={trackedKeyphrases:m().object,keyphrases:m().array.isRequired,isLoggedIn:m().bool.isRequired,shouldTrackAll:m().bool.isRequired,permalink:m().string.isRequired,historyDaysLimit:m().number},Br.propTypes={trackedKeyphrases:m().object,addTrackedKeyphrase:m().func.isRequired,isLoggedIn:m().bool,isNewlyAuthenticated:m().bool,keyphrases:m().array,response:m().object,shouldTrackAll:m().bool,permalink:m().string,allKeyphrasesMissRanking:m().bool.isRequired,isSuccess:m().bool.isRequired,keyphraseLimitReached:m().bool.isRequired,limit:m().number.isRequired,setRequestSucceeded:m().func.isRequired,setRequestFailed:m().func.isRequired,setKeyphraseLimitReached:m().func.isRequired,onAuthentication:m().func.isRequired};const $r=(0,Ht.compose)([(0,t.withSelect)(e=>{const{isWincherNewlyAuthenticated:t,getWincherKeyphraseLimitReached:s,getWincherLimit:r,getWincherLoginStatus:o,getWincherRequestIsSuccess:n,getWincherRequestResponse:i,getWincherTrackableKeyphrases:a,getWincherTrackedKeyphrases:l,getWincherAllKeyphrasesMissRanking:c,getWincherPermalink:d,shouldWincherAutomaticallyTrackAll:u}=e("yoast-seo/editor");return{keyphrases:a(),trackedKeyphrases:l(),allKeyphrasesMissRanking:c(),isLoggedIn:o(),isNewlyAuthenticated:t(),isSuccess:n(),keyphraseLimitReached:s(),limit:r(),response:i(),shouldTrackAll:u(),permalink:d()}}),(0,t.withDispatch)(e=>{const{setWincherWebsiteId:t,setWincherRequestSucceeded:s,setWincherRequestFailed:r,setWincherTrackingForKeyphrase:o,setWincherSetKeyphraseLimitReached:n,setWincherLoginStatus:i}=e("yoast-seo/editor");return{setRequestSucceeded:e=>{s(e)},setRequestFailed:e=>{r(e)},addTrackedKeyphrase:e=>{o(e)},setKeyphraseLimitReached:e=>{n(e)},onAuthentication:(e,s,r)=>{t(r),i(e,s)}}})])(Br),Ur=g()(Yt())`
width: 18px;
height: 18px;
margin: 3px;
`;function Wr({keyphrases:e,onNoKeyphraseSet:t,onOpen:s,location:r}){if(!e.length){let e=document.querySelector("#focus-keyword-input-metabox");return e||(e=document.querySelector("#focus-keyword-input-sidebar")),e.focus(),void t()}s(r)}function Hr({location:e="",whichModalOpen:t="none",shouldCloseOnClickOutside:s=!0,keyphrases:r,onNoKeyphraseSet:o,onOpen:a,onClose:l}){const c=(0,n.useCallback)(()=>{Wr({keyphrases:r,onNoKeyphraseSet:o,onOpen:a,location:e})},[Wr,r,o,a,e]),d=(0,i.__)("Track SEO performance","wordpress-seo"),u=zt();return(0,f.jsxs)(n.Fragment,{children:[t===e&&(0,f.jsx)(Jt,{title:d,onRequestClose:l,icon:(0,f.jsx)(rs,{}),additionalClassName:"yoast-wincher-seo-performance-modal yoast-gutenberg-modal__no-padding",shouldCloseOnClickOutside:s,children:(0,f.jsx)(Zt,{className:"yoast-gutenberg-modal__content yoast-wincher-seo-performance-modal__content",children:(0,f.jsx)($r,{})})}),"sidebar"===e&&(0,f.jsx)(ns,{id:`wincher-open-button-${e}`,title:d,SuffixHeroIcon:(0,f.jsx)(Ur,{className:"yst-text-slate-500",...u}),onClick:c}),"metabox"===e&&(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsxs)(Gt,{id:`wincher-open-button-${e}`,onClick:c,children:[(0,f.jsx)(Gt.Text,{children:d}),(0,f.jsx)(Yt(),{className:"yst-h-5 yst-w-5 yst-text-slate-500",...u})]})})]})}Hr.propTypes={location:m().string,whichModalOpen:m().oneOf(["none","metabox","sidebar","postpublish"]),shouldCloseOnClickOutside:m().bool,keyphrases:m().array.isRequired,onNoKeyphraseSet:m().func.isRequired,onOpen:m().func.isRequired,onClose:m().func.isRequired};const Kr=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getWincherModalOpen:t,getWincherTrackableKeyphrases:s}=e("yoast-seo/editor");return{keyphrases:s(),whichModalOpen:t()}}),(0,t.withDispatch)(e=>{const{setWincherOpenModal:t,setWincherDismissModal:s,setWincherNoKeyphrase:r}=e("yoast-seo/editor");return{onOpen:e=>{t(e)},onClose:()=>{s()},onNoKeyphraseSet:()=>{r()}}})])(Hr),Yr=window.yoast.externals.components;function zr(){return(0,Ht.createHigherOrderComponent)(function(e){return(0,Ht.pure)(function(t){const s=(0,n.useContext)(c.LocationContext);return(0,n.createElement)(e,{...t,location:s})})},"withLocation")}const Vr=(0,Ht.compose)([(0,t.withSelect)(e=>{const{isCornerstoneContent:t}=e("yoast-seo/editor");return{isCornerstone:t(),learnMoreUrl:wpseoAdminL10n["shortlinks.cornerstone_content_info"]}}),(0,t.withDispatch)(e=>{const{toggleCornerstoneContent:t}=e("yoast-seo/editor");return{onChange:t}}),zr()])(Yr.CollapsibleCornerstone),Gr=window.yoast.searchMetadataPreviews,Xr=g()(Nt.StyledSection)`
&${Nt.StyledSectionBase} {
padding: 0;
& ${Nt.StyledHeading} {
${(0,Xt.getDirectionalStyle)("padding-left","padding-right")}: 20px;
margin-left: ${(0,Xt.getDirectionalStyle)("0","20px")};
}
}
`,Zr=({children:e=null,title:t="",icon:s="",hasPaperStyle:r=!0,shoppingData:o=null})=>(0,f.jsx)(Xr,{headingLevel:3,headingText:t,headingIcon:s,headingIconColor:"#555",hasPaperStyle:r,shoppingData:o,children:e});Zr.propTypes={children:m().element,title:m().string,icon:m().string,hasPaperStyle:m().bool,shoppingData:m().object};const Qr=Zr,Jr=window.wp.sanitize;function eo(e,t,s="",r=!1){return{type:"SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLE",name:e,value:"string"==typeof t?(0,Xt.decodeHTML)(t):t,label:s,hidden:r}}function to(e){return e.charAt(0).toUpperCase()+e.slice(1)}const{stripHTMLTags:so}=Xt.strings,ro=["slug","content","contentImage","snippetPreviewImageURL"];function oo(e,t="_"){return e.replace(/\s/g,t)}function no(e,t=156){return(e=(e=(0,Jr.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}const io=function(e){const t=(0,u.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,u.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,u.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],u.identity);return{url:e.url,title:so(t(e.title)),description:so(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?so(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:so(s("data_page_title",e.title)),description:so(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?so(s("data_page_title",e.filteredSEOTitle)):""}},ao=(0,u.memoize)((e,t)=>0===e?u.noop:(0,u.debounce)(s=>t(s,e),500)),lo=function(e,t){let s=0;return t.shortenedBaseUrl&&"string"==typeof t.shortenedBaseUrl&&(s=t.shortenedBaseUrl.length),e.url=e.url.replace(/\s+/g,"-"),"-"===e.url[e.url.length-1]&&(e.url=e.url.slice(0,-1)),"-"===e.url[s]&&(e.url=e.url.slice(0,s)+e.url.slice(s+1)),io(e)},co=(0,Ht.compose)([(0,t.withSelect)(function(e){const{getBaseUrlFromSettings:t,getDateFromSettings:s,getFocusKeyphrase:r,getRecommendedReplaceVars:o,getReplaceVars:n,getShoppingData:i,getSiteIconUrlFromSettings:a,getSnippetEditorData:l,getSnippetEditorMode:c,getSnippetEditorPreviewImageUrl:d,getSnippetEditorWordsToHighlight:u,isCornerstoneContent:p,getIsTerm:h,getContentLocale:m,getSiteName:y}=e("yoast-seo/editor"),g=n();return g.forEach(e=>{""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(e.value="%%"+e.name+"%%")}),{baseUrl:t(),data:l(),date:s(),faviconSrc:a(),keyword:r(),mobileImageSrc:d(),mode:c(),recommendedReplacementVariables:o(),replacementVariables:g,shoppingData:i(),wordsToHighlight:u(),isCornerstone:p(),isTaxonomy:h(),locale:m(),siteName:y()}}),(0,t.withDispatch)(function(e,t,{select:s}){const{updateData:r,switchMode:o,updateAnalysisData:n,findCustomFields:i}=e("yoast-seo/editor"),a=e("core/editor"),l=s("yoast-seo/editor").getPostId();return{onChange:(e,t)=>{switch(e){case"mode":o(t);break;case"slug":r({slug:t}),a&&a.editPost({slug:t});break;default:r({[e]:t})}},onChangeAnalysisData:n,onReplacementVariableSearchChange:ao(l,i)}})])(e=>(0,f.jsx)(c.LocationConsumer,{children:t=>(0,f.jsx)(Qr,{icon:"eye",hasPaperStyle:e.hasPaperStyle,children:(0,f.jsx)(f.Fragment,{children:(0,f.jsx)(Gr.SnippetEditor,{...e,descriptionPlaceholder:(0,i.__)("Please provide a meta description by editing the snippet below.","wordpress-seo"),mapEditorDataToPreview:lo,showCloseButton:!1,idSuffix:t})})})})),uo=(0,t.withSelect)(e=>{const{getWarningMessage:t}=e("yoast-seo/editor");return{message:t()}})(Nt.Warning),po=window.yoast.featureFlag,ho=g()(Nt.Collapsible)`
h2 > button {
padding-left: 24px;
padding-top: 16px;
&:hover {
background-color: #f0f0f0;
}
}
div[class^="collapsible_content"] {
padding: 24px 0;
margin: 0 24px;
border-top: 1px solid rgba(0,0,0,0.2);
}
`,mo=(0,Xt.getDirectionalStyle)("right: 16px","left: 24px"),yo=g().h2`
// wrapInHeading's resets, as longhands so the icon's lane below can override one side.
margin: 0 !important;
padding-block: 0 !important;
padding-inline-start: 0 !important;
font-size: ${e=>e.headingProps.fontSize} !important;
font-weight: ${e=>e.headingProps.fontWeight} !important;
color: ${e=>e.headingProps.color} !important;
${Nt.StyledTitle} {
font-weight: ${e=>e.headingProps.fontWeight};
color: ${e=>e.headingProps.color};
}
position: relative;
display: flex;
align-items: center;
// The suffix icon's lane, so the title and the link shrink before reaching it.
padding-inline-end: 48px !important;
&:hover {
background-color: #f0f0f0;
}
// The link's wrapper, above the button's overlay so the link stays clickable.
> span {
position: relative;
z-index: 1;
flex: 0 0 auto;
}
${Nt.StyledIconsButton} {
flex: 0 1 auto;
min-width: 0;
width: auto;
/*
* Restates the shared h2 > button padding instead of inheriting a selector this heading does not
* own. Physical on purpose: the collapsibles it has to line up with are padded physically too.
*/
padding-block-start: 16px;
${(0,Xt.getDirectionalStyle)("padding-left: 24px","padding-right: 16px")};
// The help link brings its own leading gap, so the button ends at its title.
padding-inline-end: 0;
// Only the heading paints the hover, so it covers the row in one even color.
background-color: transparent;
&:hover {
background-color: transparent;
}
&::after {
content: "";
position: absolute;
inset: 0;
}
/*
* The ring moves to the overlay, because on the button it would frame the title alone. It cannot
* be reused: elsewhere it is the browser's own, which no pseudo-element can draw. Colors from Button.js.
*/
&:focus {
outline: none;
box-shadow: none;
}
&:focus::after {
outline: 1px solid ${Pt.colors.$color_blue};
outline-offset: -1px;
box-shadow: 0 0 3px ${(0,Pt.rgba)(Pt.colors.$color_blue_dark,.8)};
}
> svg:last-child {
position: absolute;
${mo};
top: 50%;
transform: translateY(-50%);
margin: 0;
}
}
`,go=({initialIsOpen:e=!1,id:t=null,HeaderHelpLink:s=null,headingProps:r=Nt.Collapsible.defaultProps.headingProps,...o})=>{const i=(0,n.useRef)(s);i.current=s;const a=(0,n.useRef)(r);a.current=r;const l=Boolean(s),c=(0,n.useMemo)(()=>l?function(e){const t=i.current;return(0,f.jsxs)(yo,{headingProps:a.current,children:[(0,f.jsx)(Nt.StyledIconsButton,{...e}),(0,f.jsx)("span",{children:(0,f.jsx)(t,{})})]})}:null,[l]);return(0,f.jsx)(ho,{hasPadding:!0,hasSeparator:!0,initialIsOpen:e,id:t,headingProps:r,...c?{Heading:c}:{},...o})};go.propTypes={initialIsOpen:m().bool,id:m().string,HeaderHelpLink:m().elementType,headingProps:m().shape({level:m().number,fontSize:m().string,fontWeight:m().string,color:m().string})};const fo=go,xo=()=>{const e=(0,t.useSelect)(e=>e("yoast-seo/editor").getEstimatedReadingTime(),[]),s=(0,n.useMemo)(()=>(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-estimated_reading_time",""),[]);return(0,f.jsx)(Nt.InsightsCard,{amount:e,unit:(0,i._n)("minute","minutes",e,"wordpress-seo"),title:(0,i.__)("Reading time","wordpress-seo"),linkTo:s
/* translators: Hidden accessibility text. */,linkText:(0,i.__)("Learn more about reading time","wordpress-seo")})},wo=(0,Xt.makeOutboundLink)();function bo(e,t){return-1===e?(0,i.__)("Your text should be slightly longer to calculate your Flesch reading ease score.","wordpress-seo"):(0,i.sprintf)(
/* Translators: %1$s expands to the numeric Flesch reading ease score,
%2$s expands to the easiness of reading (e.g. 'easy' or 'very difficult') */
/* Translators: %1$s expands to the numeric Flesch reading ease score,
%2$s expands to the easiness of reading (e.g. 'easy' or 'very difficult') */
(0,i.__)("The copy scores %1$s in the test, which is considered %2$s to read.","wordpress-seo"),e,function(e){switch(e){case Mt.DIFFICULTY.NO_DATA:return(0,i.__)("no data","wordpress-seo");case Mt.DIFFICULTY.VERY_EASY:return(0,i.__)("very easy","wordpress-seo");case Mt.DIFFICULTY.EASY:return(0,i.__)("easy","wordpress-seo");case Mt.DIFFICULTY.FAIRLY_EASY:return(0,i.__)("fairly easy","wordpress-seo");case Mt.DIFFICULTY.OKAY:return(0,i.__)("okay","wordpress-seo");case Mt.DIFFICULTY.FAIRLY_DIFFICULT:return(0,i.__)("fairly difficult","wordpress-seo");case Mt.DIFFICULTY.DIFFICULT:return(0,i.__)("difficult","wordpress-seo");case Mt.DIFFICULTY.VERY_DIFFICULT:return(0,i.__)("very difficult","wordpress-seo")}}(t))}const vo=()=>{let e=(0,t.useSelect)(e=>e("yoast-seo/editor").getFleschReadingEaseScore(),[]);const s=(0,n.useMemo)(()=>(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-flesch_reading_ease",""),[]),r=(0,t.useSelect)(e=>e("yoast-seo/editor").getFleschReadingEaseDifficulty(),[e]),o=(0,n.useMemo)(()=>{const t=(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-flesch_reading_ease_article","");return function(e,t,s){const r=function(e){switch(e){case Mt.DIFFICULTY.FAIRLY_DIFFICULT:case Mt.DIFFICULTY.DIFFICULT:case Mt.DIFFICULTY.VERY_DIFFICULT:return(0,i.__)("Try to make shorter sentences, using less difficult words to improve readability","wordpress-seo");case Mt.DIFFICULTY.NO_DATA:return(0,i.__)("Continue writing to get insight into the readability of your text!","wordpress-seo");default:return(0,i.__)("Good job!","wordpress-seo")}}(t);return(0,f.jsxs)("span",{children:[bo(e,t)," ",t>=Mt.DIFFICULTY.FAIRLY_DIFFICULT?(0,f.jsx)(wo,{href:s,children:r+"."}):r]})}(e,r,t)},[e,r]);return-1===e&&(e="?"),(0,f.jsx)(Nt.InsightsCard,{amount:e,unit:(0,i.__)("out of 100","wordpress-seo"),title:(0,i.__)("Flesch reading ease","wordpress-seo"),linkTo:s
/* translators: Hidden accessibility text. */,linkText:(0,i.__)("Learn more about Flesch reading ease","wordpress-seo"),description:o})},ko=({data:e=[],itemScreenReaderText:t="",className:s="",...r})=>{const o=(0,n.useMemo)(()=>{var t,s;return null!==(t=null===(s=(0,u.maxBy)(e,"number"))||void 0===s?void 0:s.number)&&void 0!==t?t:0},[e]);return(0,f.jsx)("ul",{className:X()("yoast-data-model",s),...r,children:e.map(({name:e,number:s})=>(0,f.jsxs)("li",{style:{"--yoast-width":s/o*100+"%"},children:[e,(0,f.jsx)("span",{children:s}),t&&(0,f.jsx)("span",{className:"screen-reader-text",children:(0,i.sprintf)(t,s)})]},`${e}_dataItem`))})};ko.propTypes={data:m().arrayOf(m().shape({name:m().string.isRequired,number:m().number.isRequired})),itemScreenReaderText:m().string,className:m().string};const jo=ko,_o=(0,Xt.makeOutboundLink)(),So=({location:e})=>{const s=(0,t.useSelect)(e=>{var t,s;return null===(t=null===(s=e("yoast-seo-premium/editor"))||void 0===s?void 0:s.getPreference("isProminentWordsAvailable",!1))||void 0===t||t},[]),o=(0,t.useSelect)(e=>e("yoast-seo/editor").getPreference("shouldUpsell",!1),[]),a=(0,n.useMemo)(()=>(0,u.get)(window,`wpseoAdminL10n.shortlinks-insights-upsell-${e}-prominent_words`,""),[e]),l=(0,n.useMemo)(()=>{const e=(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-keyword_research_link","");return C((0,i.sprintf)(
// translators: %1$s and %2$s are replaced by opening and closing <a> tags.
// translators: %1$s and %2$s are replaced by opening and closing <a> tags.
(0,i.__)("Read our %1$sultimate guide to keyword research%2$s to learn more about keyword research and keyword strategy.","wordpress-seo"),"<a>","</a>"),{a:(0,f.jsx)(_o,{href:e})})},[]),d=(0,n.useMemo)(()=>C((0,i.sprintf)(
// translators: %1$s expands to a starting `b` tag, %1$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`.
// translators: %1$s expands to a starting `b` tag, %1$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`.
(0,i.__)("With %1$s%3$s%2$s, this section will show you which words occur most often in your text. By checking these prominent words against your intended keyword(s), you'll know how to edit your text to be more focused.","wordpress-seo"),"<b>","</b>","Yoast SEO Premium"),{b:(0,f.jsx)("b",{})}),[]),p=(0,t.useSelect)(e=>{var t,s;return null!==(t=null===(s=e("yoast-seo-premium/editor"))||void 0===s?void 0:s.getProminentWords())&&void 0!==t?t:[]},[]),h=(0,n.useMemo)(()=>{const e=(0,i.sprintf)(
// translators: %1$s expands to Yoast SEO Premium.
// translators: %1$s expands to Yoast SEO Premium.
(0,i.__)("Get %s to enjoy the benefits of prominent words","wordpress-seo"),"Yoast SEO Premium").split(/\s+/);return e.map((t,s)=>({name:t,number:e.length-s}))},[]),m=(0,n.useMemo)(()=>o?h:p.map(({word:e,occurrence:t})=>({name:e,number:t})),[p,h]);if(!s)return null;const{locationContext:y}=(0,c.useRootContext)();return(0,f.jsxs)("div",{className:"yoast-prominent-words",children:[(0,f.jsx)("div",{className:"yoast-field-group__title",children:(0,f.jsx)("b",{children:(0,i.__)("Prominent words","wordpress-seo")})}),!o&&(0,f.jsx)("p",{children:0===m.length?(0,i.__)("Once you add a bit more copy, we'll give you a list of words that occur the most in the content. These give an indication of what your content focuses on.","wordpress-seo"):(0,i.__)("The following words occur the most in the content. These give an indication of what your content focuses on. If the words differ a lot from your topic, you might want to rewrite your content accordingly.","wordpress-seo")}),o&&(0,f.jsx)("p",{children:d}),o&&(0,f.jsxs)(_o,{href:(0,r.addQueryArgs)(a,{context:y}),"data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",className:"yoast-button yoast-button-upsell",children:[(0,i.sprintf)(
// translators: %s expands to `Premium` (part of add-on name).
// translators: %s expands to `Premium` (part of add-on name).
(0,i.__)("Unlock with %s","wordpress-seo"),"Premium"),(0,f.jsx)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})]}),(0,f.jsx)("p",{children:l}),(0,f.jsx)(jo,{data:m,itemScreenReaderText:/* translators: Hidden accessibility text; %d expands to the number of occurrences. */ /* translators: Hidden accessibility text; %d expands to the number of occurrences. */
(0,i.__)("%d occurrences","wordpress-seo"),"aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Prominent words","wordpress-seo"),className:o?"yoast-data-model--upsell":null})]})};So.propTypes={location:m().string.isRequired};const Co=So,To=()=>{const e=(0,t.useSelect)(e=>e("yoast-seo/editor").getTextLength(),[]),s=(0,n.useMemo)(()=>(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-word_count",""),[]);let r=(0,i._n)("word","words",e.count,"wordpress-seo"),o=(0,i.__)("Word count","wordpress-seo"),a=(0,i.__)("Learn more about word count","wordpress-seo");return"character"===e.unit&&(r=(0,i._n)("character","characters",e.count,"wordpress-seo"),o=(0,i.__)("Character count","wordpress-seo"),
/* translators: Hidden accessibility text. */
a=(0,i.__)("Learn more about character count","wordpress-seo")),(0,f.jsx)(Nt.InsightsCard,{amount:e.count,unit:r,title:o,linkTo:s,linkText:a})},Ro=(0,Xt.makeOutboundLink)(),Eo=({location:e})=>{const t=(0,n.useMemo)(()=>(0,u.get)(window,`wpseoAdminL10n.shortlinks-insights-upsell-${e}-text_formality`,""),[e]),s=(0,n.useMemo)(()=>C((0,i.sprintf)(
// Translators: %1$s expands to a starting `b` tag, %2$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`.
// Translators: %1$s expands to a starting `b` tag, %2$s expands to a closing `b` tag and %3$s expands to `Yoast SEO Premium`.
(0,i.__)("%1$s%3$s%2$s will help you assess the formality level of your text.","wordpress-seo"),"<b>","</b>","Yoast SEO Premium"),{b:(0,f.jsx)("b",{})}),[]);return(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{children:s}),(0,f.jsxs)(Ro,{href:t,className:"yoast-button yoast-button-upsell",children:[(0,i.sprintf)(
// Translators: %s expands to `Premium` (part of add-on name).
// Translators: %s expands to `Premium` (part of add-on name).
(0,i.__)("Unlock with %s","wordpress-seo"),"Premium"),(0,f.jsx)("span",{"aria-hidden":"true",className:"yoast-button-upsell__caret"})]})]})})};Eo.propTypes={location:m().string.isRequired};const Io=Eo,Lo=({location:e,name:s})=>{const r=(0,t.useSelect)(e=>e("yoast-seo/editor").isFormalitySupported(),[]),o=p().isPremium,n=o?(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-text_formality_info_premium",""):(0,u.get)(window,"wpseoAdminL10n.shortlinks-insights-text_formality_info_free",""),a=(0,i.__)("Read more about text formality.","wordpress-seo");return r?(0,f.jsxs)("div",{className:"yoast-text-formality",children:[(0,f.jsxs)("div",{className:"yoast-field-group__title",children:[(0,f.jsx)("b",{children:(0,i.__)("Text formality","wordpress-seo")}),(0,f.jsx)(Nt.HelpIcon,{linkTo:n,linkText:a})]}),o?(0,f.jsx)(v.Slot,{name:s}):(0,f.jsx)(Io,{location:e})]}):null};Lo.propTypes={location:m().string.isRequired,name:m().string.isRequired};const Ao=Lo,No=({location:e="metabox"})=>{const s=(0,t.useSelect)(e=>e("yoast-seo/editor").isFleschReadingEaseAvailable(),[]);return(0,f.jsxs)(fo,{title:(0,i.__)("Insights","wordpress-seo"),id:`yoast-insights-collapsible-${e}`,className:"yoast-insights",children:[(0,f.jsx)(Co,{location:e}),(0,f.jsxs)("div",{children:[s&&(0,f.jsx)("div",{className:"yoast-insights-row",children:(0,f.jsx)(vo,{})}),(0,f.jsxs)("div",{className:"yoast-insights-row yoast-insights-row--columns",children:[(0,f.jsx)(xo,{}),(0,f.jsx)(To,{})]}),(0,po.isFeatureEnabled)("TEXT_FORMALITY")&&(0,f.jsx)(Ao,{location:e,name:"YoastTextFormalityMetabox"})]})]})};No.propTypes={location:m().string};const Po=No;var Mo=s(465),Oo=s.n(Mo),Fo=s(7656),Do=s.n(Fo);const qo=({isOpen:e,onClose:s,id:r,upsellLink:o,title:a="",description:l="",benefits:c=[],note:d="",ctbId:u="",modalTitle:p})=>{const{isBlackFriday:h,isWooCommerceActive:m,isProductEntity:y,isWooSEOActive:g}=(0,t.useSelect)(e=>{const t=e("yoast-seo/editor");return{isProductEntity:t.getIsProductEntity(),isWooCommerceActive:t.getIsWooCommerceActive(),isBlackFriday:t.isPromotionActive("black-friday-promotion"),isWooSEOActive:t.getIsWooSeoActive()}},[]),x=(0,n.useMemo)(()=>m&&y,[m,y]),w=(0,n.useRef)(null);return(0,f.jsx)(k.Modal,{isOpen:e,onClose:s,id:r,initialFocus:w,children:(0,f.jsx)(k.Modal.Panel,{className:"yst-max-w-md yst-p-0",hasCloseButton:!1,children:(0,f.jsxs)(k.Modal.Container,{children:[(0,f.jsxs)(k.Modal.Container.Header,{className:"yst-p-6 yst-border-b-slate-200 yst-border-b yst-flex yst-justify-start yst-gap-3 yst-items-center",children:[x?(0,f.jsx)(Do(),{className:"yst-text-woo-light yst-w-6 yst-h-6 yst-scale-x-[-1]"}):(0,f.jsx)(rs,{className:"yst-fill-primary-500 yst-w-5 yst-h-5"}),(0,f.jsx)(k.Modal.Title,{as:"h3",className:X()(x?"yst-text-woo-light":"yst-text-primary-500","yst-text-base yst-font-normal"),children:p}),(0,f.jsx)(k.Modal.CloseButton,{className:"yst-top-2",onClick:s,screenReaderText:(0,i.__)("Close modal","wordpress-seo")})]}),(0,f.jsxs)(k.Modal.Container.Content,{className:"yst-p-0",children:[h&&(0,f.jsx)("div",{className:"yst-flex yst-font-semibold yst-items-center yst-text-lg yst-content-between yst-bg-black yst-text-amber-300 yst-h-9 yst-border-amber-300 yst-border-y yst-border-x-0 yst-border-solid yst-px-6",children:(0,f.jsx)("div",{className:"yst-mx-auto",children:(0,i.__)("BLACK FRIDAY | 30% OFF","wordpress-seo")})}),(0,f.jsxs)("div",{className:"yst-py-6 yst-px-12",children:[(0,f.jsx)(k.Title,{as:"h3",className:"yst-mb-1 yst-leading-5 yst-text-sm yst-font-medium yst-text-slate-800",children:a}),(0,f.jsx)("p",{className:"yst-mb-2",children:l}),Array.isArray(c)&&c.length>0&&(0,f.jsx)("ul",{className:"yst-my-2",children:c.map((e,t)=>(0,f.jsxs)("li",{className:"yst-flex yst-gap-1 yst-mb-2",children:[(0,f.jsx)(V(),{className:"yst-mr-1 yst-text-green-500 yst-w-[19.5px] yst-h-[19.5px] yst-flex-shrink-0"}),(0,f.jsx)("p",{className:"yst-text-slate-600",children:e})]},`${r}-upsell-benefit-${t}`))}),"function"==typeof c&&c(),(0,f.jsxs)("div",{className:"yst-text-center",children:[(0,f.jsxs)(k.Button,{as:"a",variant:"upsell",className:"yst-my-2 yst-gap-1.5 yst-w-full",href:o,target:"_blank","data-action":"load-nfd-ctb","data-ctb-id":u,ref:w,children:[(0,f.jsx)(R(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,i.sprintf)(/* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */ /* translators: %s expands to 'Yoast SEO Premium' or 'Yoast Woocommerce SEO'. */
(0,i.__)("Explore %s","wordpress-seo"),x&&!g?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Opens in a new tab","wordpress-seo")})]}),(0,f.jsx)("div",{className:"yst-italic yst-text-slate-500 yst-mt-1",children:d})]})]})]})]})})})},Bo=()=>{const[e,,,t,s]=(0,k.useToggleState)(!1),{locationContext:o}=(0,c.useRootContext)(),n=(0,k.useSvgAria)(),a=o.includes("sidebar"),l=o.includes("metabox"),d=a?"sidebar":"metabox",u=wpseoAdminL10n[a?"shortlinks.upsell.sidebar.internal_linking_suggestions":"shortlinks.upsell.metabox.internal_linking_suggestions"];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qo,{isOpen:e,onClose:s,id:`yoast-internal-linking-suggestions-upsell-${d}`,upsellLink:(0,r.addQueryArgs)(u,{context:o}),modalTitle:(0,i.__)("Add smarter internal links with Premium","wordpress-seo"),title:(0,i.__)("Connect related content without the guesswork","wordpress-seo"),description:C((0,i.sprintf)(/* translators: %s expands to be tag. */ /* translators: %s expands to be tag. */
(0,i.__)("Optimize for up to 5 keyphrases to shape your content around different themes, audiences, and angles. %sScans your content to:","wordpress-seo"),"<br />"),{br:(0,f.jsx)("br",{})}),benefits:[(0,i.__)("Suggest internal links based on your content’s main topics","wordpress-seo"),(0,i.__)("Build relevant internal links faster","wordpress-seo"),(0,i.__)("Strengthen your site’s structure","wordpress-seo"),(0,i.__)("Keep visitors exploring longer","wordpress-seo")],note:(0,i.__)("Upgrade to link your content with ease","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"}),a&&(0,f.jsx)(ns,{id:"yoast-internal-linking-suggestions-sidebar-modal-open-button",title:(0,i.__)("Internal linking suggestions","wordpress-seo"),onClick:t,children:(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsx)(k.Badge,{size:"small",variant:"upsell",children:(0,f.jsx)(Oo(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...n})})})}),l&&(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsxs)(Gt,{id:"yoast-internal-linking-suggestions-metabox-modal-open-button",onClick:t,children:[(0,f.jsx)(Gt.Text,{children:(0,i.__)("Internal linking suggestions","wordpress-seo")}),(0,f.jsxs)(k.Badge,{size:"small",variant:"upsell",children:[(0,f.jsx)(Oo(),{className:"yst-w-2.5 yst-h-2.5 yst-me-1 yst-shrink-0",...n}),(0,f.jsx)("span",{children:"Premium"})]})]})})]})},$o=({children:e})=>(0,f.jsx)("div",{children:e});$o.propTypes={renderPriority:m().number.isRequired,children:m().node.isRequired};const Uo=$o,Wo=({noIndex:e,onNoIndexChange:t,editorContext:s,isPrivateBlog:r=!1})=>{const o=(e=>{const t=(0,i.__)("No","wordpress-seo"),s=(0,i.__)("Yes","wordpress-seo"),r=e.noIndex?t:s;return window.wpseoScriptData.isPost?[{name:(0,i.sprintf)(/* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ /* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */
(0,i.__)("%1$s (current default for %2$s)","wordpress-seo"),r,e.postTypeNamePlural),value:"0"},{name:t,value:"1"},{name:s,value:"2"}]:[{name:(0,i.sprintf)(/* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */ /* translators: %1$s translates to "yes" or "no", %2$s translates to the content type label in plural form */
(0,i.__)("%1$s (current default for %2$s)","wordpress-seo"),r,e.postTypeNamePlural),value:"default"},{name:s,value:"index"},{name:t,value:"noindex"}]})(s);return(0,f.jsx)(c.LocationConsumer,{children:s=>{const a=(0,Xt.join)(["yoast-meta-robots-noindex",s]),l=`${a}-input`;return(0,f.jsxs)(n.Fragment,{children:[r&&(0,f.jsx)(Nt.Alert,{type:"warning",children:(0,i.__)("Even though you can set the meta robots setting here, the entire site is set to noindex in the sitewide privacy settings, so these settings won't have an effect.","wordpress-seo")}),(0,f.jsx)(Nt.SingleSelect,{label:(0,i.__)("Allow search engines to show this content in search results?","wordpress-seo"),onChange:t,id:a,inputId:l,options:o,selected:e,linkTo:wpseoAdminL10n["shortlinks.advanced.allow_search_engines"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about the no-index setting on our help page.","wordpress-seo")})]})}})};Wo.propTypes={noIndex:m().string.isRequired,onNoIndexChange:m().func.isRequired,editorContext:m().object.isRequired,isPrivateBlog:m().bool};const Ho=({noFollow:e,onNoFollowChange:t})=>(0,f.jsx)(c.LocationConsumer,{children:s=>{const r=(0,Xt.join)(["yoast-meta-robots-nofollow",s]);return(0,f.jsx)(Nt.RadioButtonGroup,{id:r,options:[{value:"0",label:"Yes"},{value:"1",label:"No"}],label:(0,i.__)("Should search engines follow links on this content?","wordpress-seo"),groupName:r,onChange:t,selected:e,linkTo:wpseoAdminL10n["shortlinks.advanced.follow_links"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about the no-follow setting on our help page.","wordpress-seo")})}});Ho.propTypes={noFollow:m().string.isRequired,onNoFollowChange:m().func.isRequired};const Ko=({advanced:e,onAdvancedChange:t})=>(0,f.jsx)(c.LocationConsumer,{children:s=>{const r=(0,Xt.join)(["yoast-meta-robots-advanced",s]),o=`${r}-input`;return(0,f.jsx)(Nt.MultiSelect,{label:(0,i.__)("Meta robots advanced","wordpress-seo"),onChange:t,id:r,inputId:o,options:[{name:(0,i.__)("No Image Index","wordpress-seo"),value:"noimageindex"},{name:(0,i.__)("No Archive","wordpress-seo"),value:"noarchive"},{name:(0,i.__)("No Snippet","wordpress-seo"),value:"nosnippet"}],selected:e,linkTo:wpseoAdminL10n["shortlinks.advanced.meta_robots"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about advanced meta robots settings on our help page.","wordpress-seo")})}});Ko.propTypes={advanced:m().array.isRequired,onAdvancedChange:m().func.isRequired};const Yo=({breadcrumbsTitle:e,onBreadcrumbsTitleChange:t})=>(0,f.jsx)(c.LocationConsumer,{children:s=>(0,f.jsx)(Nt.TextInput,{label:(0,i.__)("Breadcrumbs Title","wordpress-seo"),id:(0,Xt.join)(["yoast-breadcrumbs-title",s]),onChange:t,value:e,linkTo:wpseoAdminL10n["shortlinks.advanced.breadcrumbs_title"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about the breadcrumbs title setting on our help page.","wordpress-seo")})});Yo.propTypes={breadcrumbsTitle:m().string.isRequired,onBreadcrumbsTitleChange:m().func.isRequired};const zo=({canonical:e,onCanonicalChange:t})=>(0,f.jsx)(c.LocationConsumer,{children:s=>(0,f.jsx)(Nt.TextInput,{label:(0,i.__)("Canonical URL","wordpress-seo"),id:(0,Xt.join)(["yoast-canonical",s]),onChange:t,value:e,linkTo:"https://yoa.st/canonical-url",linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about canonical URLs on our help page.","wordpress-seo")})});zo.propTypes={canonical:m().string.isRequired,onCanonicalChange:m().func.isRequired};const Vo=({noIndex:e,canonical:t,onNoIndexChange:s,onCanonicalChange:r,onLoad:o,isLoading:i,editorContext:a,isBreadcrumbsDisabled:l,advanced:c=[],onAdvancedChange:d=u.noop,noFollow:p="",onNoFollowChange:h=u.noop,breadcrumbsTitle:m="",onBreadcrumbsTitleChange:y=u.noop,isPrivateBlog:g=!1})=>{(0,n.useEffect)(()=>{setTimeout(()=>{i&&o()})});const x={noIndex:e,onNoIndexChange:s,editorContext:a,isPrivateBlog:g},w={noFollow:p,onNoFollowChange:h},b={advanced:c,onAdvancedChange:d},v={breadcrumbsTitle:m,onBreadcrumbsTitleChange:y},k={canonical:t,onCanonicalChange:r};return i?null:(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(Wo,{...x}),a.isPost&&(0,f.jsx)(Ho,{...w}),a.isPost&&(0,f.jsx)(Ko,{...b}),!l&&(0,f.jsx)(Yo,{...v}),(0,f.jsx)(zo,{...k})]})};Vo.propTypes={noIndex:m().string.isRequired,canonical:m().string.isRequired,onNoIndexChange:m().func.isRequired,onCanonicalChange:m().func.isRequired,onLoad:m().func.isRequired,isLoading:m().bool.isRequired,editorContext:m().object.isRequired,isBreadcrumbsDisabled:m().bool.isRequired,isPrivateBlog:m().bool,advanced:m().array,onAdvancedChange:m().func,noFollow:m().string,onNoFollowChange:m().func,breadcrumbsTitle:m().string,onBreadcrumbsTitleChange:m().func};const Go=Vo,Xo=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getNoIndex:t,getNoFollow:s,getAdvanced:r,getBreadcrumbsTitle:o,getCanonical:n,getIsLoading:i,getEditorContext:a,getPreferences:l}=e("yoast-seo/editor"),{isBreadcrumbsDisabled:c,isPrivateBlog:d}=l();return{noIndex:t(),noFollow:s(),advanced:r(),breadcrumbsTitle:o(),canonical:n(),isLoading:i(),editorContext:a(),isBreadcrumbsDisabled:c,isPrivateBlog:d}}),(0,t.withDispatch)(e=>{const{setNoIndex:t,setNoFollow:s,setAdvanced:r,setBreadcrumbsTitle:o,setCanonical:n,loadAdvancedSettingsData:i}=e("yoast-seo/editor");return{onNoIndexChange:t,onNoFollowChange:s,onAdvancedChange:r,onBreadcrumbsTitleChange:o,onCanonicalChange:n,onLoad:i}})])(Go),Zo=g().p`
color: #606770;
flex-shrink: 0;
font-size: 12px;
line-height: 16px;
overflow: hidden;
padding: 0;
text-overflow: ellipsis;
text-transform: uppercase;
white-space: nowrap;
margin: 0;
position: ${e=>"landscape"===e.mode?"relative":"static"};
`,Qo=e=>{const{siteUrl:t}=e;return(0,f.jsxs)(P.Fragment,{children:[(0,f.jsx)("span",{className:"screen-reader-text",children:t}),(0,f.jsx)(Zo,{"aria-hidden":"true",children:(0,f.jsx)("span",{children:t})})]})},Jo=window.yoast.socialMetadataForms,en=g().img`
&& {
max-width: ${e=>e.width}px;
height: ${e=>e.height}px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: none;
}
`,tn=g().img`
&& {
height: 100%;
position: absolute;
width: 100%;
object-fit: cover;
}
`,sn=g().div`
padding-bottom: ${e=>e.aspectRatio}%;
`,rn=({imageProps:e,width:t,height:s,imageMode:r="landscape"})=>"landscape"===r?(0,f.jsx)(sn,{aspectRatio:e.aspectRatio,children:(0,f.jsx)(tn,{src:e.src,alt:e.alt})}):(0,f.jsx)(en,{src:e.src,alt:e.alt,width:t,height:s,imageProperties:e});function on(e,t,s){return"landscape"===s?{widthRatio:t.width/e.landscapeWidth,heightRatio:t.height/e.landscapeHeight}:"portrait"===s?{widthRatio:t.width/e.portraitWidth,heightRatio:t.height/e.portraitHeight}:{widthRatio:t.width/e.squareWidth,heightRatio:t.height/e.squareHeight}}function nn(e,t){return t.widthRatio<=t.heightRatio?{width:Math.round(e.width/t.widthRatio),height:Math.round(e.height/t.widthRatio)}:{width:Math.round(e.width/t.heightRatio),height:Math.round(e.height/t.heightRatio)}}async function an(e,t,s=!1){const r=await function(e){return new Promise((t,s)=>{const r=new Image;r.onload=()=>{t({width:r.width,height:r.height})},r.onerror=s,r.src=e})}(e);let o=s?"landscape":"square";"Facebook"===t&&(o=(0,Jo.determineFacebookImageMode)(r));const n=function(e){return"Twitter"===e?Jo.TWITTER_IMAGE_SIZES:Jo.FACEBOOK_IMAGE_SIZES}(t),i=function(e,t,s){return"square"===s&&t.width===t.height?{width:e.squareWidth,height:e.squareHeight}:nn(t,on(e,t,s))}(n,r,o);return{mode:o,height:i.height,width:i.width}}async function ln(e,t,s=!1){try{return{imageProperties:await an(e,t,s),status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}}const cn=g().div`
position: relative;
${e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`};
overflow: hidden;
background-color: ${Pt.colors.$color_white};
`,dn=g().div`
box-sizing: border-box;
max-width: ${Jo.FACEBOOK_IMAGE_SIZES.landscapeWidth}px;
height: ${Jo.FACEBOOK_IMAGE_SIZES.landscapeHeight}px;
background-color: ${Pt.colors.$color_grey};
border-style: dashed;
border-width: 1px;
// We're not using standard colors to increase contrast for accessibility.
color: #006DAC;
// We're not using standard colors to increase contrast for accessibility.
background-color: #f1f1f1;
display: flex;
justify-content: center;
align-items: center;
text-decoration: underline;
font-size: 14px;
cursor: pointer;
`;class un extends P.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await ln(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:Jo.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:Jo.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:Jo.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:Jo.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:Jo.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:Jo.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,f.jsx)(dn,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,i.__)("Select image","wordpress-seo")});const s=this.retrieveContainerDimensions(e.mode);return(0,f.jsx)(cn,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,f.jsx)(rn,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:Jo.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}un.propTypes={src:m().string,alt:m().string,onImageLoaded:m().func,onImageClick:m().func,onMouseEnter:m().func,onMouseLeave:m().func},un.defaultProps={src:"",alt:"",onImageLoaded:u.noop,onImageClick:u.noop,onMouseEnter:u.noop,onMouseLeave:u.noop};const pn=un,hn=g().span`
line-height: ${20}px;
min-height : ${20}px;
color: #1d2129;
font-weight: 600;
overflow: hidden;
font-size: 16px;
margin: 3px 0 0;
letter-spacing: normal;
white-space: normal;
flex-shrink: 0;
cursor: pointer;
display: -webkit-box;
-webkit-line-clamp: ${e=>e.lineCount};
-webkit-box-orient: vertical;
overflow: hidden;
`,mn=g().p`
line-height: ${16}px;
min-height : ${16}px;
color: #606770;
font-size: 14px;
padding: 0;
text-overflow: ellipsis;
margin: 3px 0 0 0;
display: -webkit-box;
cursor: pointer;
-webkit-line-clamp: ${e=>e.lineCount};
-webkit-box-orient: vertical;
overflow: hidden;
@media all and ( max-width: ${e=>e.maxWidth} ) {
display: none;
}
`,yn=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},gn=g().div`
box-sizing: border-box;
display: flex;
flex-direction: ${e=>"landscape"===e.mode?"column":"row"};
background-color: #f2f3f5;
max-width: 527px;
`,fn=g().div`
box-sizing: border-box;
background-color: #f2f3f5;
margin: 0;
padding: 10px 12px;
position: relative;
border-bottom: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"};
border-top: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"};
border-right: ${e=>"landscape"===e.mode?"":"1px solid #dddfe2"};
border: ${e=>"landscape"===e.mode?"1px solid #dddfe2":""};
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: ${e=>"landscape"===e.mode?"flex-start":"center"};
font-size: 12px;
overflow: hidden;
`;class xn extends P.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=M().createRef(),this.onImageLoaded=this.onImageLoaded.bind(this),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}onImageLoaded(e){this.setState({imageMode:e})}getTitleLineCount(){return this.facebookTitleRef.current.offsetHeight/20}maybeSetMaxLineCount(){const{imageMode:e,maxLineCount:t}=this.state,s="landscape"===e?2:5;s!==t&&this.setState({maxLineCount:s})}maybeSetDescriptionLineCount(){const{descriptionLineCount:e,maxLineCount:t,imageMode:s}=this.state,r=this.getTitleLineCount();let o=t-r;"portrait"===s&&(o=5===r?0:4),o!==e&&this.setState({descriptionLineCount:o})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){const{imageMode:e,maxLineCount:t,descriptionLineCount:s}=this.state;return(0,f.jsxs)(gn,{id:"facebookPreview",mode:e,children:[(0,f.jsx)(pn,{src:this.props.imageUrl||this.props.imageFallbackUrl,alt:this.props.alt,onImageLoaded:this.onImageLoaded,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,f.jsxs)(fn,{mode:e,children:[(0,f.jsx)(Qo,{siteUrl:this.props.siteUrl,mode:e}),(0,f.jsx)(hn,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:t,children:this.props.title}),s>0&&(0,f.jsx)(mn,{maxWidth:yn(e),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:s,children:this.props.description})]})]})}}xn.propTypes={siteUrl:m().string.isRequired,title:m().string.isRequired,description:m().string,imageUrl:m().string,imageFallbackUrl:m().string,alt:m().string,onSelect:m().func,onImageClick:m().func,onMouseHover:m().func},xn.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}};const wn=xn,bn=g().div`
text-transform: lowercase;
color: rgb(83, 100, 113);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
fill: currentcolor;
display: flex;
flex-direction: row;
align-items: flex-end;
`,vn=e=>(0,f.jsx)(bn,{children:(0,f.jsx)("span",{children:e.siteUrl})}),kn=(e,t=!0)=>e?`\n\t\t\tmax-width: ${Jo.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${t?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${Jo.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${t?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,jn=g().div`
position: relative;
box-sizing: content-box;
overflow: hidden;
background-color: #e1e8ed;
flex-shrink: 0;
${e=>kn(e.isLarge)}
`,Sn=g().div`
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
max-width: 100%;
margin: 0;
padding: 1em;
text-align: center;
font-size: 1rem;
${e=>kn(e.isLarge,!1)}
`,Cn=g()(Sn)`
${e=>e.isLarge&&`height: ${Jo.TWITTER_IMAGE_SIZES.landscapeHeight}px;`}
border-top-left-radius: 14px;
${e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius"}: 14px;
border-style: dashed;
border-width: 1px;
// We're not using standard colors to increase contrast for accessibility.
color: #006DAC;
// We're not using standard colors to increase contrast for accessibility.
background-color: #f1f1f1;
text-decoration: underline;
font-size: 14px;
cursor: pointer;
`;class Tn extends M().Component{constructor(e){super(e),this.state={status:"loading"},this.socialMedium="Twitter",this.handleTwitterImage=this.handleTwitterImage.bind(this),this.setState=this.setState.bind(this)}async handleTwitterImage(){if(null===this.props.src)return;const e=await ln(this.props.src,this.socialMedium,this.props.isLarge);this.setState(e)}componentDidUpdate(e){e.src!==this.props.src&&this.handleTwitterImage()}componentDidMount(){this.handleTwitterImage()}render(){const{status:e,imageProperties:t}=this.state;return"loading"===e||""===this.props.src||"errored"===e?(0,f.jsx)(Cn,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,i.__)("Select image","wordpress-seo")}):(0,f.jsx)(jn,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,f.jsx)(rn,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:Jo.TWITTER_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode})})}}Tn.propTypes={isLarge:m().bool.isRequired,src:m().string,alt:m().string,onImageClick:m().func,onMouseEnter:m().func,onMouseLeave:m().func},Tn.defaultProps={src:"",alt:"",onMouseEnter:u.noop,onImageClick:u.noop,onMouseLeave:u.noop};const Rn=g().div`
display: flex;
flex-direction: column;
padding: 12px;
justify-content: center;
margin: 0;
box-sizing: border-box;
flex: auto;
min-width: 0px;
gap:2px;
> * {
line-height:20px;
min-height:20px;
font-size:15px;
}
`,En=e=>(0,f.jsx)(Rn,{children:e.children}),In=g().p`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
color: rgb(15, 20, 25);
cursor: pointer;
`,Ln=g().p`
max-height: 55px;
overflow: hidden;
text-overflow: ellipsis;
margin: 0;
color: rgb(83, 100, 113);
display: -webkit-box;
cursor: pointer;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
@media all and ( max-width: ${Jo.TWITTER_IMAGE_SIZES.landscapeWidth}px ) {
display: none;
}
`,An=g().div`
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
font-size: 15px;
font-weight: 400;
line-height: 20px;
max-width: 507px;
border: 1px solid #E1E8ED;
box-sizing: border-box;
border-radius: 14px;
color: #292F33;
background: #FFFFFF;
text-overflow: ellipsis;
display: flex;
&:hover {
background: #f5f8fa;
border: 1px solid rgba(136,153,166,.5);
}
`,Nn=g()(An)`
flex-direction: column;
max-height: 370px;
`,Pn=g()(An)`
flex-direction: row;
height: 125px;
`;class Mn extends P.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){const{isLarge:e,imageUrl:t,imageFallbackUrl:s,alt:r,title:o,description:n,siteUrl:i}=this.props,a=e?Nn:Pn;return(0,f.jsxs)(a,{id:"twitterPreview",children:[(0,f.jsx)(Tn,{src:t||s,alt:r,isLarge:e,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),(0,f.jsxs)(En,{children:[(0,f.jsx)(vn,{siteUrl:i}),(0,f.jsx)(In,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,children:o}),(0,f.jsx)(Ln,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,children:n})]})]})}}Mn.propTypes={siteUrl:m().string.isRequired,title:m().string.isRequired,description:m().string,isLarge:m().bool,imageUrl:m().string,imageFallbackUrl:m().string,alt:m().string,onSelect:m().func,onImageClick:m().func,onMouseHover:m().func},Mn.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0};const On=Mn,Fn=window.yoast.replacementVariableEditor;class Dn extends P.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?wn:On,this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},()=>this.setEditorFocus(e))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}render(){const{onDescriptionChange:e,onTitleChange:t,onSelectImageClick:s,onRemoveImageClick:r,socialMediumName:o,imageWarnings:n,siteUrl:i,description:a,descriptionInputPlaceholder:l,descriptionPreviewFallback:c,imageUrl:d,imageFallbackUrl:u,alt:p,title:h,titleInputPlaceholder:m,titlePreviewFallback:y,replacementVariables:g,recommendedReplacementVariables:x,applyReplacementVariables:w,onReplacementVariableSearchChange:b,isPremium:v,isLarge:k,socialPreviewLabel:j,idSuffix:_,activeMetaTabId:S}=this.props,C=w({title:h||y,description:a||c});return(0,f.jsxs)(M().Fragment,{children:[j&&(0,f.jsx)(Nt.SimulatedLabel,{children:j}),(0,f.jsx)(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:s,siteUrl:i,title:C.title,description:C.description,imageUrl:d,imageFallbackUrl:u,alt:p,isLarge:k,activeMetaTabId:S}),(0,f.jsx)(Jo.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:o,title:h,titleInputPlaceholder:m,onRemoveImageClick:r,imageSelected:!!d,imageUrl:d,imageFallbackUrl:u,onTitleChange:t,onSelectImageClick:s,description:a,descriptionInputPlaceholder:l,imageWarnings:n,replacementVariables:g,recommendedReplacementVariables:x,onReplacementVariableSearchChange:b,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:v,setEditorRef:this.setEditorRef,idSuffix:_})]})}}Dn.propTypes={title:m().string.isRequired,onTitleChange:m().func.isRequired,description:m().string.isRequired,onDescriptionChange:m().func.isRequired,imageUrl:m().string.isRequired,imageFallbackUrl:m().string.isRequired,onSelectImageClick:m().func.isRequired,onRemoveImageClick:m().func.isRequired,socialMediumName:m().string.isRequired,alt:m().string,isPremium:m().bool,imageWarnings:m().array,isLarge:m().bool,siteUrl:m().string,descriptionInputPlaceholder:m().string,titleInputPlaceholder:m().string,descriptionPreviewFallback:m().string,titlePreviewFallback:m().string,replacementVariables:Fn.replacementVariablesShape,recommendedReplacementVariables:Fn.recommendedReplacementVariablesShape,applyReplacementVariables:m().func,onReplacementVariableSearchChange:m().func,socialPreviewLabel:m().string,idSuffix:m().string,activeMetaTabId:m().string},Dn.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""};const qn={},Bn=(e,t,{log:s=console.warn}={})=>{qn[e]||(qn[e]=!0,s(t))},$n=(e,t=u.noop)=>{const s={};for(const r in e)Object.hasOwn(e,r)&&Object.defineProperty(s,r,{set:s=>{e[r]=s,t("set",r,s)},get:()=>(t("get",r),e[r])});return s};$n({squareWidth:125,squareHeight:125,landscapeWidth:506,landscapeHeight:265,aspectRatio:50.2},(e,t)=>Bn(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`)),$n({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,t)=>Bn(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.`));const Un=g().div`
max-width: calc(527px + 1.5rem);
`,Wn=e=>{const t="X"===e.socialMediumName?(0,i.__)("X share preview","wordpress-seo"):(0,i.__)("Social share preview","wordpress-seo"),{locationContext:s}=(0,k.useRootContext)();return(0,f.jsx)(k.Root,{children:(0,f.jsx)(Un,{children:(0,f.jsx)(k.FeatureUpsell,{shouldUpsell:!0,variant:"card",cardLink:(0,r.addQueryArgs)(wpseoAdminL10n["shortlinks.upsell.social_preview."+e.socialMediumName.toLowerCase()],{context:s}),cardText:(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),"data-action":"load-nfd-ctb","data-ctb-id":"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",children:(0,f.jsxs)("div",{className:"yst-grayscale yst-opacity-50",children:[(0,f.jsx)(k.Label,{children:t}),(0,f.jsx)(wn,{title:"",description:"",siteUrl:"",imageUrl:"",imageFallbackUrl:"",alt:"",onSelect:u.noop,onImageClick:u.noop,onMouseHover:u.noop})]})})})})};Wn.propTypes={socialMediumName:m().oneOf(["Social","Twitter","X"]).isRequired};const Hn=Wn;class Kn extends n.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},()=>this.setEditorFocus(e))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}render(){const{onDescriptionChange:e,onTitleChange:t,onSelectImageClick:s,onRemoveImageClick:r,socialMediumName:o,imageWarnings:i,description:a,descriptionInputPlaceholder:l,imageUrl:c,imageFallbackUrl:d,alt:u,title:p,titleInputPlaceholder:h,replacementVariables:m,recommendedReplacementVariables:y,onReplacementVariableSearchChange:g,isPremium:x,location:w}=this.props;return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(Hn,{socialMediumName:o}),(0,f.jsx)(Jo.SocialMetadataPreviewForm,{onDescriptionChange:e,socialMediumName:o,title:p,titleInputPlaceholder:h,onRemoveImageClick:r,imageSelected:!!c,imageUrl:c,imageFallbackUrl:d,imageAltText:u,onTitleChange:t,onSelectImageClick:s,description:a,descriptionInputPlaceholder:l,imageWarnings:i,replacementVariables:m,recommendedReplacementVariables:y,onReplacementVariableSearchChange:g,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:x,setEditorRef:this.setEditorRef,idSuffix:w})]})}}Kn.propTypes={title:m().string.isRequired,onTitleChange:m().func.isRequired,description:m().string.isRequired,onDescriptionChange:m().func.isRequired,imageUrl:m().string.isRequired,imageFallbackUrl:m().string,onSelectImageClick:m().func.isRequired,onRemoveImageClick:m().func.isRequired,socialMediumName:m().string.isRequired,isPremium:m().bool,imageWarnings:m().array,descriptionInputPlaceholder:m().string,titleInputPlaceholder:m().string,replacementVariables:Fn.replacementVariablesShape,recommendedReplacementVariables:Fn.recommendedReplacementVariablesShape,onReplacementVariableSearchChange:m().func,location:m().string,alt:m().string},Kn.defaultProps={imageWarnings:[],imageFallbackUrl:"",recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,descriptionInputPlaceholder:"",titleInputPlaceholder:"",onReplacementVariableSearchChange:null,location:"",alt:""};const Yn=Kn,zn=(e,t,s)=>{const[r,o]=(0,n.useState)(!1),a=(0,i.sprintf)(
/* Translators: %1$s expands to the jpg format, %2$s expands to the png format,
%3$s expands to the webp format, %4$s expands to the gif format. */
/* Translators: %1$s expands to the jpg format, %2$s expands to the png format,
%3$s expands to the webp format, %4$s expands to the gif format. */
(0,i.__)("No image was found that we can automatically set as your social image. Please use %1$s, %2$s, %3$s or %4$s formats to ensure it displays correctly on social media.","wordpress-seo"),"JPG","PNG","WEBP","GIF");return(0,n.useEffect)(()=>{o(""===t&&e.toLowerCase().endsWith(".avif"))},[e,t]),r?[a]:s},Vn=({isPremium:e,onLoad:t,location:s,imageFallbackUrl:r="",imageUrl:o="",imageWarnings:i=[],...a})=>{const[l,c]=(0,n.useState)(""),d=zn(r,o,i),u=(0,n.useCallback)(e=>{c(e.detail.metaTabId)},[c]);(0,n.useEffect)(()=>(setTimeout(t),window.addEventListener("YoastSEO:metaTabChange",u),()=>{window.removeEventListener("YoastSEO:metaTabChange",u)}),[]);const p={isPremium:e,onLoad:t,location:s,imageFallbackUrl:r,imageUrl:o,imageWarnings:d,activeMetaTabId:l,...a};return e?(0,f.jsx)(v.Slot,{name:`YoastFacebookPremium${s.charAt(0).toUpperCase()+s.slice(1)}`,fillProps:p}):(0,f.jsx)(Yn,{...p})};Vn.propTypes={isPremium:m().bool.isRequired,onLoad:m().func.isRequired,location:m().string.isRequired,imageFallbackUrl:m().string,imageUrl:m().string,imageWarnings:m().array};const Gn=Vn;function Xn(e){(function(e){const t=window.wp.media();return t.on("select",()=>{const s=t.state().get("selection").first();var r;e({type:(r=s.attributes).subtype,width:r.width,height:r.height,url:r.url,id:r.id,sizes:r.sizes,alt:r.alt||r.title||r.name})}),t})(e).open()}const Zn=()=>{Xn(e=>(0,t.dispatch)("yoast-seo/editor").setFacebookPreviewImage((e=>{const{width:t,height:s}=e,r=(0,Jo.determineFacebookImageMode)({width:t,height:s}),o=Jo.FACEBOOK_IMAGE_SIZES[r+"Width"],n=Jo.FACEBOOK_IMAGE_SIZES[r+"Height"],i=Object.values(e.sizes).find(e=>e.width>=o&&e.height>=n);return{url:i?i.url:e.url,id:e.id,warnings:(0,Xt.validateFacebookImage)(e),alt:e.alt||""}})(e)))},Qn=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getFacebookDescription:t,getDescription:s,getFacebookTitle:r,getSeoTitle:o,getFacebookImageUrl:n,getImageFallback:i,getFacebookWarnings:a,getRecommendedReplaceVars:l,getReplaceVars:c,getSiteUrl:d,getSeoTitleTemplate:u,getSeoTitleTemplateNoFallback:h,getSocialTitleTemplate:m,getSeoDescriptionTemplate:y,getSocialDescriptionTemplate:g,getReplacedExcerpt:f,getFacebookAltText:x}=e("yoast-seo/editor");return{imageUrl:n(),imageFallbackUrl:i(),recommendedReplacementVariables:l(),replacementVariables:c(),description:t(),descriptionPreviewFallback:g()||s()||y()||f()||"",title:r(),titlePreviewFallback:m()||o()||h()||u()||"",imageWarnings:a(),siteUrl:d(),isPremium:!!p().isPremium,titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"Social",alt:x()}}),(0,t.withDispatch)((e,t,{select:s})=>{const{setFacebookPreviewTitle:r,setFacebookPreviewDescription:o,clearFacebookPreviewImage:n,loadFacebookPreviewData:i,findCustomFields:a}=e("yoast-seo/editor"),l=s("yoast-seo/editor").getPostId();return{onSelectImageClick:Zn,onRemoveImageClick:n,onDescriptionChange:o,onTitleChange:r,onLoad:i,onReplacementVariableSearchChange:ao(l,a)}}),zr()])(Gn),Jn=({isPremium:e,onLoad:t,location:s,imageFallbackUrl:r="",imageUrl:o="",imageWarnings:i=[],...a})=>{const l=zn(r,o,i);(0,n.useEffect)(()=>{setTimeout(t)},[]);const c={isPremium:e,onLoad:t,location:s,imageFallbackUrl:r,imageUrl:o,imageWarnings:l,...a};return e?(0,f.jsx)(v.Slot,{name:`YoastTwitterPremium${s.charAt(0).toUpperCase()+s.slice(1)}`,fillProps:c}):(0,f.jsx)(Yn,{...c})};Jn.propTypes={isPremium:m().bool.isRequired,onLoad:m().func.isRequired,location:m().string.isRequired,imageFallbackUrl:m().string,imageUrl:m().string,imageWarnings:m().array};const ei=Jn,ti=()=>{Xn(e=>(0,t.dispatch)("yoast-seo/editor").setTwitterPreviewImage((e=>{const t="summary"!==(0,u.get)(window,"wpseoScriptData.metabox.twitterCardType")?"landscape":"square",s=Jo.TWITTER_IMAGE_SIZES[t+"Width"],r=Jo.TWITTER_IMAGE_SIZES[t+"Height"],o=Object.values(e.sizes).find(e=>e.width>=s&&e.height>=r);return{url:o?o.url:e.url,id:e.id,warnings:(0,Xt.validateTwitterImage)(e),alt:e.alt||""}})(e)))},si=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getTwitterDescription:t,getTwitterTitle:s,getTwitterImageUrl:r,getFacebookImageUrl:o,getFacebookTitle:n,getFacebookDescription:i,getDescription:a,getSeoTitle:l,getTwitterWarnings:c,getTwitterImageType:d,getImageFallback:u,getRecommendedReplaceVars:h,getReplaceVars:m,getSiteUrl:y,getSeoTitleTemplate:g,getSeoTitleTemplateNoFallback:f,getSocialTitleTemplate:x,getSeoDescriptionTemplate:w,getSocialDescriptionTemplate:b,getReplacedExcerpt:v,getTwitterAltText:k}=e("yoast-seo/editor");return{imageUrl:r(),imageFallbackUrl:o()||u(),recommendedReplacementVariables:h(),replacementVariables:m(),description:t(),descriptionPreviewFallback:b()||i()||a()||w()||v()||"",title:s(),titlePreviewFallback:x()||n()||l()||f()||g()||"",imageWarnings:c(),siteUrl:y(),isPremium:!!p().isPremium,isLarge:"summary"!==d(),titleInputPlaceholder:"",descriptionInputPlaceholder:"",socialMediumName:"X",alt:k()}}),(0,t.withDispatch)((e,t,{select:s})=>{const{setTwitterPreviewTitle:r,setTwitterPreviewDescription:o,clearTwitterPreviewImage:n,loadTwitterPreviewData:i,findCustomFields:a}=e("yoast-seo/editor"),l=s("yoast-seo/editor").getPostId();return{onSelectImageClick:ti,onRemoveImageClick:n,onDescriptionChange:o,onTitleChange:r,onLoad:i,onReplacementVariableSearchChange:ao(l,a)}}),zr()])(ei),ri=g().legend`
margin: 16px 0;
padding: 0;
color: ${Pt.colors.$color_headings};
font-size: 12px;
font-weight: 300;
`,oi=g().legend`
margin: 0 0 16px;
padding: 0;
color: ${Pt.colors.$color_headings};
font-size: 12px;
font-weight: 300;
`,ni=(0,Xt.makeOutboundLink)(g().a`
display: inline-block;
position: relative;
outline: none;
text-decoration: none;
border-radius: 100%;
width: 24px;
height: 24px;
margin: -4px 0;
vertical-align: middle;
color: ${Pt.colors.$color_help_text};
&:hover,
&:focus {
color: ${Pt.colors.$color_snippet_focus};
}
// Overwrite the default blue active color for links.
&:active {
color: ${Pt.colors.$color_help_text};
}
&::before {
position: absolute;
top: 0;
left: 0;
padding: 2px;
content: "\f223";
}
`),ii=g()(ni)`
margin-block: 0;
margin-inline: 8px 0;
`,ai=()=>(0,f.jsx)(ii,{href:wpseoAdminL10n["shortlinks.social_previews_info"],className:"dashicons",children:(0,f.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about social previews","wordpress-seo")})}),li=g().div`
padding: 16px;
`,ci=({useOpenGraphData:e,useTwitterData:t})=>(0,f.jsxs)(n.Fragment,{children:[t&&e&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)(fo,{hasSeparator:!1
/* translators: Social media appearance refers to a preview of how a page will be represented on social media. */,title:(0,i.__)("Social media appearance","wordpress-seo"),initialIsOpen:!0,HeaderHelpLink:ai,children:[(0,f.jsx)(oi,{children:(0,i.__)("Determine how your post should look on social media like Facebook, X, Instagram, WhatsApp, Threads, LinkedIn, Slack, and more.","wordpress-seo")}),(0,f.jsx)(Qn,{}),(0,f.jsx)(ri,{children:(0,i.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below. If you leave these settings untouched, the 'Social media appearance' settings mentioned above will also be applied for sharing on X.","wordpress-seo")})]}),(0,f.jsx)(fo,{title:(0,i.__)("X appearance","wordpress-seo"),hasSeparator:!0,initialIsOpen:!1,children:(0,f.jsx)(si,{})})]}),e&&!t&&(0,f.jsxs)(li,{children:[(0,f.jsxs)(oi,{children:[(0,i.__)("Determine how your post should look on social media like Facebook, X, Instagram, WhatsApp, Threads, LinkedIn, Slack, and more.","wordpress-seo"),(0,f.jsx)(ai,{})]}),(0,f.jsx)(Qn,{})]}),!e&&t&&(0,f.jsxs)(li,{children:[(0,f.jsx)(oi,{children:(0,i.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below.","wordpress-seo")}),(0,f.jsx)(si,{})]})]});ci.propTypes={useOpenGraphData:m().bool.isRequired,useTwitterData:m().bool.isRequired};const di=ci,ui=(0,t.withSelect)(e=>{const{getPreferences:t}=e("yoast-seo/editor"),{useOpenGraphData:s,useTwitterData:r}=t();return{useOpenGraphData:s,useTwitterData:r}})(di);function pi({target:e}){return(0,f.jsx)(Ft,{target:e,children:(0,f.jsx)(ui,{})})}pi.propTypes={target:m().string.isRequired};const hi=({link:e,text:t})=>(0,f.jsxs)(k.Root,{children:[(0,f.jsx)("p",{children:t}),(0,f.jsxs)(k.Button,{href:e,as:"a",className:"yst-gap-2 yst-mb-5 yst-mt-2",variant:"upsell",target:"_blank",rel:"noopener",children:[(0,f.jsx)(R(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-shrink-0"}),(0,i.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO")]})]});hi.propTypes={link:m().string.isRequired,text:m().string.isRequired};const mi=hi,yi=(0,Xt.makeOutboundLink)(),gi=g().div`
padding: 16px;
`,fi="yoast-seo/editor";function xi({location:e,show:t}){return t?(0,f.jsxs)(Nt.Alert,{type:"info",children:[(0,i.sprintf)(/* translators: %s Expands to "Yoast News SEO" */ /* translators: %s Expands to "Yoast News SEO" */
(0,i.__)("Are you working on a news article? %s helps you optimize your site for Google News.","wordpress-seo"),"Yoast News SEO")+" ",(0,f.jsx)(yi,{href:window.wpseoAdminL10n[`shortlinks.upsell.${e}.news`],children:(0,i.sprintf)(/* translators: %s: Expands to "Yoast News SEO". */ /* translators: %s: Expands to "Yoast News SEO". */
(0,i.__)("Buy %s now!","wordpress-seo"),"Yoast News SEO")})]}):null}xi.propTypes={show:m().bool.isRequired,location:m().string.isRequired};const wi=(e,s,r)=>{const o=(0,t.useSelect)(e=>e(fi).getIsProduct(),[]),n=(0,t.useSelect)(e=>e(fi).getIsWooSeoActive(),[]),a=o&&n?{name:(0,i.__)("Item Page","wordpress-seo"),value:"ItemPage"}:e.find(e=>e.value===s);return[{name:(0,i.sprintf)(/* translators: %1$s expands to the plural name of the current post type, %2$s expands to the current site wide default. */ /* translators: %1$s expands to the plural name of the current post type, %2$s expands to the current site wide default. */
(0,i.__)("Default for %1$s (%2$s)","wordpress-seo"),r,a?a.name:""),value:""},...e]},bi=(e,t)=>C((e=>(0,i.sprintf)(/* translators: %1$s expands to the plural name of the current post type, %2$s and %3$s expand to a link to the Settings page */ /* translators: %1$s expands to the plural name of the current post type, %2$s and %3$s expand to a link to the Settings page */
(0,i.__)("You can change the default type for %1$s under Content types in the %2$sSettings%3$s.","wordpress-seo"),e,"<link>","</link>"))(e),{link:(0,f.jsx)("a",{href:t,target:"_blank",rel:"noreferrer"})}),vi=({helpTextTitle:e,helpTextLink:t,helpTextDescription:s})=>(0,f.jsx)(Nt.FieldGroup,{label:e,linkTo:t,linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about structured data with Schema.org","wordpress-seo"),description:s});vi.propTypes={helpTextTitle:m().string.isRequired,helpTextLink:m().string.isRequired,helpTextDescription:m().string.isRequired};const ki=({schemaPageTypeChange:e=u.noop,schemaPageTypeSelected:s=null,pageTypeOptions:r,schemaArticleTypeChange:o=u.noop,schemaArticleTypeSelected:a=null,articleTypeOptions:l,showArticleTypeInput:c,additionalHelpTextLink:d,helpTextLink:p,helpTextTitle:h,helpTextDescription:m,postTypeName:y,displayFooter:g=!1,defaultPageType:x,defaultArticleType:w,location:b,isNewsEnabled:v=!1})=>{const k=wi(r,x,y),j=wi(l,w,y),_=(0,t.useSelect)(e=>e(fi).selectLink("https://yoa.st/product-schema-metabox"),[]),S=(0,t.useSelect)(e=>e(fi).getIsWooSeoUpsell(),[]),[C,T]=(0,n.useState)(a),R=(0,i.__)("Want your products stand out in search results with rich results like price, reviews and more?","wordpress-seo"),E=(0,t.useSelect)(e=>e(fi).getIsProduct(),[]),I=(0,t.useSelect)(e=>e(fi).getIsWooSeoActive(),[]),L=(0,t.useSelect)(e=>e(fi).selectAdminLink("?page=wpseo_page_settings"),[]),A=E&&I,N=(0,n.useCallback)((e,t)=>{T(t)},[]);return(0,n.useEffect)(()=>{N(null,a)},[a]),(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(vi,{helpTextLink:p,helpTextTitle:h,helpTextDescription:m}),(0,f.jsx)(Nt.FieldGroup,{label:(0,i.__)("What type of page or content is this?","wordpress-seo"),linkTo:d,linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about page or content types","wordpress-seo")}),S&&(0,f.jsx)(mi,{link:_,text:R}),(0,f.jsx)(Nt.Select,{id:(0,Xt.join)(["yoast-schema-page-type",b]),options:k,label:(0,i.__)("Page type","wordpress-seo"),onChange:e,selected:A?"ItemPage":s,disabled:A}),c&&(0,f.jsx)(Nt.Select,{id:(0,Xt.join)(["yoast-schema-article-type",b]),options:j,label:(0,i.__)("Article type","wordpress-seo"),onChange:o,selected:a,onOptionFocus:N}),(0,f.jsx)(xi,{location:b,show:!v&&(P=C,M=w,"NewsArticle"===P||""===P&&"NewsArticle"===M)}),g&&!A&&(0,f.jsx)("p",{children:bi(y,L)}),A&&(0,f.jsx)("p",{children:(0,i.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
(0,i.__)("You have %1$s activated on your site, automatically setting the Page type for your products to 'Item Page'. As a result, the Page type selection is disabled.","wordpress-seo"),"Yoast WooCommerce SEO")})]});var P,M},ji=m().arrayOf(m().shape({name:m().string,value:m().string}));ki.propTypes={schemaPageTypeChange:m().func,schemaPageTypeSelected:m().string,pageTypeOptions:ji.isRequired,schemaArticleTypeChange:m().func,schemaArticleTypeSelected:m().string,articleTypeOptions:ji.isRequired,showArticleTypeInput:m().bool.isRequired,additionalHelpTextLink:m().string.isRequired,helpTextLink:m().string.isRequired,helpTextTitle:m().string.isRequired,helpTextDescription:m().string.isRequired,postTypeName:m().string.isRequired,displayFooter:m().bool,defaultPageType:m().string.isRequired,defaultArticleType:m().string.isRequired,location:m().string.isRequired,isNewsEnabled:m().bool};const _i=({isMetabox:e,showArticleTypeInput:t=!1,articleTypeLabel:s="",additionalHelpTextLink:r="",pageTypeLabel:o,helpTextLink:i,helpTextTitle:a,helpTextDescription:l,postTypeName:c,displayFooter:d=!1,loadSchemaArticleData:u,loadSchemaPageData:p,location:h,...m})=>{const y=(0,f.jsx)(ki,{showArticleTypeInput:t,articleTypeLabel:s,additionalHelpTextLink:r,pageTypeLabel:o,helpTextLink:i,helpTextTitle:a,helpTextDescription:l,postTypeName:c,displayFooter:d,loadSchemaArticleData:u,loadSchemaPageData:p,location:h,...m});return e?(0,n.createPortal)((0,f.jsx)(gi,{children:y}),document.getElementById("wpseo-meta-section-schema")):y};_i.propTypes={isMetabox:m().bool.isRequired,showArticleTypeInput:m().bool,articleTypeLabel:m().string,additionalHelpTextLink:m().string,pageTypeLabel:m().string.isRequired,helpTextLink:m().string.isRequired,helpTextTitle:m().string.isRequired,helpTextDescription:m().string.isRequired,postTypeName:m().string.isRequired,displayFooter:m().bool,loadSchemaArticleData:m().func.isRequired,loadSchemaPageData:m().func.isRequired,location:m().string.isRequired};const Si=_i,Ci=window.wp.hooks,Ti=()=>Boolean((0,u.get)(window,"wpseoScriptData.disableMetaboxInBlockEditor",!1)),Ri=(e,s,r="")=>{var o;return Ti()?((e,s="")=>{var r,o;return null!==(r=null===(o=(0,t.select)("core/editor").getEditedPostAttribute("meta"))||void 0===o?void 0:o[e])&&void 0!==r?r:s})(e,r):null!==(o=null==s?void 0:s.value)&&void 0!==o?o:r},Ei=new Map;(0,Ci.addFilter)("editor.preSavePost","yoast/deferred-meta",(e,t)=>{var s;if(0===Ei.size||null!=t&&t.isAutosave)return e;const r=Object.fromEntries(Ei);return Ei.clear(),{...e,meta:{...null!==(s=e.meta)&&void 0!==s?s:{},...r}}});const Ii=(e,s,r,o=!1)=>{Ti()?o?(e=>{const s=(0,t.select)("core/editor").getEditedPostAttribute("meta");if(!s)return;const r=Object.fromEntries(Object.entries(e).filter(([e,t])=>s[e]!==String(t)));if(0===Object.keys(r).length)return;const o=(0,t.select)("core/editor").getCurrentPostType(),n=(0,t.select)("core/editor").getCurrentPostId();(0,t.dispatch)("core").editEntityRecord("postType",o,n,{meta:r},{undoIgnore:!0})})({[e]:r}):((e,s)=>{const r=String(s);Ei.delete(e),((e,s)=>{const r=(0,t.select)("core/editor").getEditedPostAttribute("meta");return!r||r[e]===String(s)})(e,r)||(0,t.dispatch)("core/editor").editPost({meta:{[e]:r}})})(e,r):s&&(s.value=r)};class Li{static get articleTypeInput(){return document.getElementById("yoast_wpseo_schema_article_type")}static get defaultArticleType(){return(0,u.get)(window,"wpseoScriptData.metabox.schema.defaultArticleType","")}static get articleType(){return Ri(ie,Li.articleTypeInput,"")}static set articleType(e){Ii(ie,Li.articleTypeInput,e)}static get pageTypeInput(){return document.getElementById("yoast_wpseo_schema_page_type")}static get defaultPageType(){return(0,u.get)(window,"wpseoScriptData.metabox.schema.defaultPageType","")}static get pageType(){return Ri(ae,Li.pageTypeInput,"")}static set pageType(e){Ii(ae,Li.pageTypeInput,e)}static get showArticleInput(){return Boolean((0,u.get)(window,"wpseoScriptData.metabox.schema.showArticleInput",!1))}}const Ai=e=>{(0,n.useEffect)(()=>{e.loadSchemaPageData(),Li.showArticleInput&&e.loadSchemaArticleData()},[]);const{pageTypeOptions:t,articleTypeOptions:s}=window.wpseoScriptData.metabox.schema,r={articleTypeLabel:(0,i.__)("Article type","wordpress-seo"),pageTypeLabel:(0,i.__)("Page type","wordpress-seo"),postTypeName:window.wpseoAdminL10n.postTypeNamePlural,helpTextTitle:(0,i.__)("Yoast SEO automatically describes your pages using schema.org","wordpress-seo"),helpTextDescription:(0,i.__)("This helps search engines understand your website and your content. You can change some of your settings for this page below.","wordpress-seo"),showArticleTypeInput:Li.showArticleInput,pageTypeOptions:t,articleTypeOptions:s},o={...e,...r,...(a=e.location,"metabox"===a?{helpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.metabox.schema.page_type"],isMetabox:!0}:{helpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.explanation"],additionalHelpTextLink:wpseoAdminL10n["shortlinks.sidebar.schema.page_type"],isMetabox:!1})};var a;return(0,f.jsx)(Si,{...o})};Ai.propTypes={displayFooter:m().bool.isRequired,schemaPageTypeSelected:m().string.isRequired,schemaArticleTypeSelected:m().string.isRequired,defaultArticleType:m().string.isRequired,defaultPageType:m().string.isRequired,loadSchemaPageData:m().func.isRequired,loadSchemaArticleData:m().func.isRequired,schemaPageTypeChange:m().func.isRequired,schemaArticleTypeChange:m().func.isRequired,location:m().string.isRequired};const Ni=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getPreferences:t,getPageType:s,getDefaultPageType:r,getArticleType:o,getDefaultArticleType:n}=e("yoast-seo/editor"),{displaySchemaSettingsFooter:i,isNewsEnabled:a}=t();return{displayFooter:i,isNewsEnabled:a,schemaPageTypeSelected:s(),schemaArticleTypeSelected:o(),defaultArticleType:n(),defaultPageType:r()}}),(0,t.withDispatch)(e=>{const{setPageType:t,setArticleType:s,getSchemaPageData:r,getSchemaArticleData:o}=e("yoast-seo/editor");return{loadSchemaPageData:r,loadSchemaArticleData:o,schemaPageTypeChange:t,schemaArticleTypeChange:s}}),zr()])(Ai),Pi=window.yoast.relatedKeyphraseSuggestions;function Mi({requestLimitReached:e,isSuccess:t,response:s,requestHasData:r,relatedKeyphrases:o}){return e?"requestLimitReached":!t&&function(e){return"invalid_json"===(null==e?void 0:e.code)||"fetch_error"===(null==e?void 0:e.code)||!(0,u.isEmpty)(e)&&"error"in e}(s)?"requestFailed":r?function(e){return e&&e.length>=4}(o)?"maxRelatedKeyphrases":null:"requestEmpty"}function Oi({keyphrase:e="",relatedKeyphrases:t=[],renderAction:s=null,requestLimitReached:r=!1,countryCode:o,setCountry:i,newRequest:a,response:l={},isRtl:c=!1,userLocale:d="en_US",isPending:u=!1,isSuccess:p=!1,requestHasData:h=!0,isPremium:m=!1,semrushUpsellLink:y="",premiumUpsellLink:g=""}){var x,w;const[b,v]=(0,n.useState)(o),j=(0,n.useCallback)(async()=>{a(o,e),v(o)},[o,e,a]);return(0,f.jsxs)(k.Root,{context:{isRtl:c},children:[!r&&!m&&(0,f.jsx)(Pi.PremiumUpsell,{url:g,className:"yst-mb-4"}),!r&&(0,f.jsx)(Pi.CountrySelector,{countryCode:o,activeCountryCode:b,onChange:i,onClick:j,className:"yst-mb-4",userLocale:d.split("_")[0]}),!u&&(0,f.jsx)(Pi.UserMessage,{variant:Mi({requestLimitReached:r,isSuccess:p,response:l,requestHasData:h,relatedKeyphrases:t}),upsellLink:y}),(0,f.jsx)(Pi.KeyphrasesTable,{relatedKeyphrases:t,columnNames:null==l||null===(x=l.results)||void 0===x?void 0:x.columnNames,data:null==l||null===(w=l.results)||void 0===w?void 0:w.rows,isPending:u,renderButton:s,className:"yst-mt-4"})]})}Oi.propTypes={keyphrase:m().string,relatedKeyphrases:m().array,renderAction:m().func,requestLimitReached:m().bool,countryCode:m().string.isRequired,setCountry:m().func.isRequired,newRequest:m().func.isRequired,response:m().object,isRtl:m().bool,userLocale:m().string,isPending:m().bool,isSuccess:m().bool,requestHasData:m().bool,isPremium:m().bool,semrushUpsellLink:m().string,premiumUpsellLink:m().string};const Fi=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getFocusKeyphrase:t,getSEMrushSelectedCountry:s,getSEMrushRequestLimitReached:o,getSEMrushRequestResponse:n,getSEMrushRequestIsSuccess:i,getSEMrushIsRequestPending:a,getSEMrushRequestHasData:l,getPreference:c,getIsPremium:d,selectLinkParams:u}=e("yoast-seo/editor");return{keyphrase:t(),countryCode:s(),requestLimitReached:o(),response:n(),isSuccess:i(),isPending:a(),requestHasData:l(),isRtl:c("isRtl",!1),userLocale:c("userLocale","en_US"),isPremium:d(),semrushUpsellLink:(0,r.addQueryArgs)("https://yoa.st/semrush-prices",u()),premiumUpsellLink:(0,r.addQueryArgs)("https://yoa.st/413",u())}}),(0,t.withDispatch)(e=>{const{setSEMrushChangeCountry:t,setSEMrushNewRequest:s}=e("yoast-seo/editor");return{setCountry:e=>{t(e)},newRequest:(e,t)=>{s(e,t)}}})])(Oi),Di=({isOpen:e,closeModal:t,id:s,upsellLink:r})=>(0,f.jsx)(qo,{isOpen:e,onClose:t,id:s,upsellLink:r,title:(0,i.__)("Cover more search intent with related keyphrases","wordpress-seo"),description:(0,i.__)("Optimize for up to 5 keyphrases to shape your content around different themes, audiences, and angles - helping it get discovered by a wider audience.","wordpress-seo"),note:(0,i.__)("Fine-tune your content for every audience","wordpress-seo"),modalTitle:(0,i.__)("Add more keyphrases with Premium","wordpress-seo"),ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2"}),qi=()=>{const[e,,,t,s]=(0,k.useToggleState)(!1),o=(0,n.useContext)(c.LocationContext),{locationContext:a}=(0,c.useRootContext)(),l=(0,k.useSvgAria)(),d=wpseoAdminL10n["sidebar"===o.toLowerCase()?"shortlinks.upsell.sidebar.additional_button":"shortlinks.upsell.metabox.additional_button"];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Di,{isOpen:e,closeModal:s,upsellLink:(0,r.addQueryArgs)(d,{context:a}),id:`yoast-additional-keyphrases-modal-${o}`}),"sidebar"===o&&(0,f.jsx)(ns,{id:"yoast-additional-keyphrase-modal-open-button",title:(0,i.__)("Add related keyphrase","wordpress-seo"),prefixIcon:{icon:"plus",color:Pt.colors.$color_grey_medium_dark},onClick:t,children:(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsx)(k.Badge,{size:"small",variant:"upsell",children:(0,f.jsx)(Oo(),{className:"yst-w-2.5 yst-h-2.5 yst-shrink-0",...l})})})}),"metabox"===o&&(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsxs)(Gt,{id:"yoast-additional-keyphrase-metabox-modal-open-button",onClick:t,children:[(0,f.jsx)(Nt.SvgIcon,{icon:"plus",color:Pt.colors.$color_grey_medium_dark}),(0,f.jsx)(Gt.Text,{children:(0,i.__)("Add related keyphrase","wordpress-seo")}),(0,f.jsxs)(k.Badge,{size:"small",variant:"upsell",children:[(0,f.jsx)(Oo(),{className:"yst-w-2.5 yst-h-2.5 yst-me-1 yst-shrink-0",...l}),(0,f.jsx)("span",{children:"Premium"})]})]})})]})};var Bi=s(998),$i=s.n(Bi);const Ui=({store:e="yoast-seo/editor",location:s="sidebar"})=>{const o="black-friday-promotion",a=(0,t.useSelect)(t=>t(e).getIsPremium(),[e]),l=(0,t.useSelect)(t=>t(e).selectLinkParams(),[e]),c=(0,t.useSelect)(t=>t(e).isPromotionActive(o),[e]),d=(0,t.useSelect)(t=>t(e).getIsWooCommerceActive(),[e]),u=(0,t.useSelect)(t=>t(e).isAlertDismissed(o),[e]),p=(0,n.useCallback)(()=>{(0,t.dispatch)(e).dismissAlert(o)},[e,o]),h=(0,r.addQueryArgs)("https://yoa.st/black-friday-sale",l),m=(0,k.useSvgAria)();return a||!c||u?null:(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsxs)("div",{className:X()("yst-border yst-rounded-lg yst-p-4 yst-max-w-md yst-relative yst-shadow-sm yst-mt-2",d?"yst-border-woo-light":"yst-border-primary-200"),children:[(0,f.jsxs)(k.Badge,{size:"small",className:"yst-text-[10px] yst-bg-black yst-text-amber-300 yst-absolute yst--top-2",children:[(0,i.__)("BLACK FRIDAY","wordpress-seo")," "]}),(0,f.jsxs)("button",{className:"yst-absolute yst-top-4 yst-end-4",onClick:p,children:[(0,f.jsx)($i(),{className:"yst-w-4 yst-text-slate-400 yst-shrink-0 yst--mt-0.5"}),(0,f.jsx)("div",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Dismiss","wordpress-seo")})]}),(0,f.jsxs)("div",{className:X()("sidebar"===s?"":"yst-flex yst-justify-between yst-gap-3"),children:[(0,f.jsxs)("div",{className:d?"yst-text-woo-light":"yst-text-primary-500",children:[(0,f.jsx)("div",{className:"yst-text-2xl yst-font-bold",children:(0,i.__)("30% OFF","wordpress-seo")}),(0,f.jsx)("div",{className:"yst-flex yst-gap-2 yst-font-semibold yst-text-tiny",children:d?(0,f.jsxs)(f.Fragment,{children:["Yoast WooCommerce SEO ",(0,f.jsx)(Do(),{className:"yst-w-4 yst-scale-x-[-1]",...m})]}):(0,f.jsxs)(f.Fragment,{children:[" Yoast SEO Premium ",(0,f.jsx)(J,{className:"yst-w-4",...m})]})})]}),(0,f.jsx)("div",{className:"yst-flex yst-items-end",children:(0,f.jsxs)(k.Button,{as:"a",className:X()("sidebar"===s?"yst-w-full":"yst-w-[140px]","yst-flex yst-gap-1 yst-w-[140px] yst-h-7 yst-mt-4"),variant:"upsell",href:h,target:"_blank",rel:"noreferrer",children:[(0,i.__)("Buy now!","wordpress-seo"),(0,f.jsx)(I(),{className:"yst-w-4 rtl:yst-rotate-180",...m})]})})]})]})})};function Wi(){return window.wpseoScriptData&&"1"===window.wpseoScriptData.isBlockEditor}Ui.propTypes={store:m().string,location:m().oneOf(["sidebar","metabox"]),inEditorIntro:m().bool};const Hi=()=>{const{editorMode:e,activeAIButtonId:s}=(0,t.useSelect)(e=>({editorMode:e("core/edit-post").getEditorMode(),activeAIButtonId:e("yoast-seo/editor").getActiveAIFixesButton()}),[]),{setMarkerStatus:r}=(0,t.useDispatch)("yoast-seo/editor");(0,n.useEffect)(()=>(r("visual"===e&&s||"text"===e?"disabled":"enabled"),()=>{r("disabled")}),[e,s])},Ki="yoast-seo/content-planner",Yi="idle",zi="consent",Vi="content-suggestions",Gi="content-outline",Xi={errorCode:null,errorIdentifier:null,errorMessage:null,missingLicenses:[]},Zi="yoast-seo-tailwind-css",Qi=(0,Ht.compose)([(0,t.withDispatch)(e=>{const{setFeatureModalStatus:t}=e(Ki);return{setFeatureModalStatus:t}})])(({location:e,setFeatureModalStatus:s})=>{const r=(0,n.useCallback)(()=>{s(Yi)},[s]),o=(0,t.useSelect)(e=>e(Ki).selectIsMinPostsMet(),[]),a="yoast-content-planner-min-posts-notice-"+e;return(0,f.jsx)(k.Root,{children:(0,f.jsxs)("div",{className:X()("metabox"===e&&"yst-flex yst-items-center yst-gap-3"),children:[(0,f.jsx)(k.Button,{variant:"ai-secondary",onClick:r,disabled:!o,"aria-describedby":o?null:a,className:"sidebar"===e?"yst-w-full":"",children:(0,i.__)("Get content suggestions","wordpress-seo")}),!o&&(0,f.jsx)("span",{id:a,className:X()("yst-text-sm yst-text-slate-500 yst-italic","sidebar"===e&&"yst-flex yst-mt-1 yst-justify-center"),children:(0,i.__)("Available after 5 published posts","wordpress-seo")})]})})});var Ji;function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ea.apply(null,arguments)}const ta=e=>P.createElement("svg",ea({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 54 24"},e),Ji||(Ji=P.createElement("path",{fill:"currentColor",d:"M17.854 5.72c-4.173 0-5.842 2.798-5.842 5.913 0 3.116 1.645 6.036 5.842 6.036 4.196 0 5.831-2.93 5.824-5.846-.01-3.551-1.809-6.104-5.824-6.104v.001zm-2.528 6.09c.101-4.169 3.306-4.165 4.377-2.672.976 1.36 1.176 6.013-1.85 5.98-1.392-.016-2.486-.956-2.527-3.309zm36.371 2.968V8.74h2.161V6.117h-2.16V2.951H48.36v3.166h-1.694V8.74h1.694v5.696c0 3.239 2.26 5.162 4.643 5.56l.997-2.68c-1.39-.176-2.29-1.214-2.303-2.537zm-16.84-.957v-4.54c0-.165-.01-.32-.026-.472-.29-3.668-5.503-3.66-9.54-2.252l1.166 2.346c2.63-1.248 4.203-.926 4.753-.311.014.016.028.031.04.048l.005.007c.28.379.213.975.213 1.445-3.436 0-7.093.455-7.093 4.22 0 2.862 3.59 4.703 7.34 1.976l.556 1.341h3.215c-.286-1.575-.63-2.925-.63-3.808h.002zm-3.362-.025c-2.643 2.955-5.064.174-2.585-1.04.73-.248 1.72-.26 2.585-.26v1.3zm8.492-4.759c0-1.118 1.792-1.64 4.619-.351l.977-2.371c-3.804-1.15-8.998-1.252-9.033 2.722-.016 1.905 1.208 2.93 2.969 3.585 1.22.453 2.98.687 2.975 1.657-.006 1.268-2.736 1.463-5.221-.243l-1.004 2.572c3.39 1.686 9.692 1.733 9.66-2.49-.034-4.176-5.94-3.46-5.94-5.08h-.002zM10.638 0 5.783 13.471 3.46 6.196H0l3.872 9.935c.33.846.33 1.784 0 2.63-.433 1.11-1.153 2.057-2.908 2.294V24c3.418 0 5.265-2.1 6.913-6.699L14.337 0h-3.7z"}))),sa=({children:e})=>(0,f.jsxs)("div",{className:"yst-p-4 yst-flex yst-flex-col yst-gap-3",children:[(0,f.jsx)(ta,{className:"yst-w-14 yst-text-primary-500"}),e]}),ra=({withPromptForContentSuggestions:e,className:t})=>(0,f.jsx)("p",{className:X()("yst-text-slate-600 yst-my-0",t),children:e?(0,i.__)("Optimize your content for discovery or get new content suggestions.","wordpress-seo"):(0,i.__)("Optimize your content for discovery.","wordpress-seo")}),oa=()=>{const e=(0,k.useSvgAria)(),{isWooSeoUpsell:s,upsellLink:r}=(0,t.useSelect)(e=>{const t=e("yoast-seo/editor");return{isWooSeoUpsell:t.getIsWooSeoUpsell(),upsellLink:t.selectLink("https://yoa.st/product-google-preview-metabox")}},[]);if(!s)return null;const o=[(0,i.__)("Product schema for price, reviews, and availability","wordpress-seo"),(0,i.__)("GTIN and SKU assessments","wordpress-seo"),(0,i.__)("Image alt text assessments","wordpress-seo"),(0,i.__)("Bulk AI-generated alt text for product images","wordpress-seo")];return(0,f.jsx)("div",{className:"yst-root",children:(0,f.jsxs)("div",{id:"woo-seo-product-upsell-ad",className:"yst-bg-white yst-border yst-border-woo-light yst-border-opacity-30 yst-rounded-lg yst-shadow-md yst-p-4",children:[(0,f.jsxs)(k.Title,{as:"h3",size:"4",className:"yst-text-woo-light yst-text-base yst-leading-6 yst-font-medium yst-mb-2 yst-flex yst-gap-2",children:["Yoast WooCommerce SEO",(0,f.jsx)(Do(),{className:"yst-w-4 yst-scale-x-[-1]",...e})]}),(0,f.jsx)("p",{children:(0,i.__)("Get ecommerce schema, product-specific assessments, and AI-generated image alt text, all in one plan.","wordpress-seo")}),(0,f.jsx)("ul",{className:"yst-mt-2 yst-flex yst-flex-col yst-gap-1",children:o.map(t=>(0,f.jsxs)("li",{className:"yst-flex yst-items-start yst-gap-2",children:[(0,f.jsx)(V(),{className:"yst-w-[18px] yst-h-[18px] yst-mt-px yst-shrink-0 yst-text-green-500",...e}),t]},t))}),(0,f.jsxs)(k.Button,{variant:"upsell",size:"small",as:"a",href:r,target:"_blank",rel:"noopener noreferrer",className:"yst-mt-4","data-action":"load-nfd-ctb","data-ctb-id":"5b32250e-e6f0-44ae-ad74-3cefc8e427f9",children:[(0,f.jsx)(R(),{className:"yst-w-4 yst-me-1.5",...e}),(0,i.sprintf)(/* translators: %s expands to Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast WooCommerce SEO. */
(0,i.__)("Get %s","wordpress-seo"),"Yoast WooCommerce SEO")]})]})})},na=(ia=Ui,e=>!(()=>{var e,s;const r=(0,t.select)("yoast-seo/editor").getIsPremium(),o=(0,t.select)("yoast-seo/editor").getWarningMessage();return(r&&null!==(e=null===(s=(0,t.select)("yoast-seo-premium/editor"))||void 0===s?void 0:s.getMetaboxWarning())&&void 0!==e?e:[]).length>0||o.length>0})()&&(0,f.jsx)(ia,{...e}));var ia;function aa({settings:e}){const{isTerm:s,isPost:r,isAiFeatureActive:o}=(0,t.useSelect)(e=>({isTerm:e("yoast-seo/editor").getIsTerm(),isPost:"post"===e("yoast-seo/editor").getPostType(),isAiFeatureActive:e("yoast-seo/editor").getPreference("isAiFeatureActive")}),[]),a=Wi();return a&&Hi(),(0,f.jsx)(f.Fragment,{children:(0,f.jsxs)(v.Fill,{name:"YoastMetabox",children:[(0,f.jsx)(Uo,{renderPriority:0,children:(0,f.jsx)(uo,{})},"warning"),(0,f.jsx)(Uo,{renderPriority:1,children:(0,f.jsxs)(sa,{children:[(0,f.jsx)(na,{location:"metabox"}),(0,f.jsx)(ra,{withPromptForContentSuggestions:o&&a&&r}),r&&a&&o&&(0,f.jsx)(Qi,{location:"metabox"}),(0,f.jsx)(oa,{})]})},"editor-intro"),e.isKeywordAnalysisActive&&(0,f.jsxs)(Uo,{renderPriority:8,children:[(0,f.jsx)(Yr.TopicInputs,{isSEMrushIntegrationActive:e.isSEMrushIntegrationActive}),!window.wpseoScriptData.metabox.isPremium&&(0,f.jsx)(v.Fill,{name:"YoastRelatedKeyphrases",children:(0,f.jsx)(Fi,{})})]},"keyword-input"),(0,f.jsx)(Uo,{renderPriority:9,children:(0,f.jsx)(fo,{id:"yoast-snippet-editor-metabox",title:(0,i.__)("Search appearance","wordpress-seo"),initialIsOpen:!0,children:(0,f.jsx)(co,{hasPaperStyle:!1})})},"search-appearance"),e.isContentAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:10,children:(0,f.jsx)(Yr.ReadabilityAnalysis,{shouldUpsell:e.shouldUpsell})},"readability-analysis"),e.isKeywordAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:20,children:(0,f.jsx)(n.Fragment,{children:(0,f.jsx)(Yr.SeoAnalysis,{shouldUpsell:e.shouldUpsell})})},"seo-analysis"),e.isInclusiveLanguageAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:21,children:(0,f.jsx)(Yr.InclusiveLanguageAnalysis,{})},"inclusive-language-analysis"),e.isKeywordAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:22,children:e.shouldUpsell&&(0,f.jsx)(qi,{})},"additional-keywords-upsell"),e.isKeywordAnalysisActive&&e.isWincherIntegrationActive&&(0,f.jsx)(Uo,{renderPriority:23,children:(0,f.jsx)(Kr,{location:"metabox"})},"wincher-seo-performance"),e.shouldUpsell&&!s&&(0,f.jsx)(Uo,{renderPriority:25,children:(0,f.jsx)(Bo,{})},"internal-linking-suggestions-upsell"),e.isCornerstoneActive&&(0,f.jsx)(Uo,{renderPriority:30,children:(0,f.jsx)(Vr,{})},"cornerstone"),e.displayAdvancedTab&&(0,f.jsx)(Uo,{renderPriority:40,children:(0,f.jsx)(fo,{id:"collapsible-advanced-settings",title:(0,i.__)("Advanced","wordpress-seo"),children:(0,f.jsx)(Xo,{})})},"advanced"),e.displaySchemaSettings&&(0,f.jsx)(Uo,{renderPriority:50,children:(0,f.jsx)(Ni,{})},"schema"),a&&(0,f.jsx)(Uo,{renderPriority:24,children:(0,f.jsx)(Yr.ContentBlocks,{})},"content-blocks"),(0,f.jsx)(Uo,{renderPriority:-1,children:(0,f.jsx)(pi,{target:"wpseo-section-social"})},"social"),e.isInsightsEnabled&&(0,f.jsx)(Uo,{renderPriority:52,children:(0,f.jsx)(Po,{location:"metabox"})},"insights")]})})}aa.propTypes={settings:m().object.isRequired};const la=(0,Ht.compose)([(0,t.withSelect)((e,t)=>{const{getPreferences:s}=e("yoast-seo/editor");return{settings:s(),store:t.store}})])(aa);function ca({target:e,store:t,theme:s}){return(0,f.jsxs)(Ft,{target:e,children:[(0,f.jsx)(Wt,{store:t,theme:s}),(0,f.jsx)(la,{store:t,theme:s})]})}ca.propTypes={target:m().string.isRequired,store:m().object.isRequired,theme:m().object.isRequired};const da=({error:e})=>{const s=(0,n.useCallback)(()=>{var e,t;return null===(e=window)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.reload()},[]),r=(0,t.useSelect)(e=>e("yoast-seo/editor").selectLink("https://yoa.st/sidebar-error-support"),[]),o=(0,t.useSelect)(e=>e("yoast-seo/editor").getPreference("isRtl",!1),[]);return(0,f.jsx)(k.Root,{context:{isRtl:o},children:(0,f.jsx)(N,{error:e,children:(0,f.jsx)(N.VerticalButtons,{supportLink:r,handleRefreshClick:s})})})};function ua({theme:e}){return(0,f.jsx)(Ut,{theme:e,location:"sidebar",children:(0,f.jsx)(k.ErrorBoundary,{FallbackComponent:da,children:(0,f.jsx)(v.Slot,{name:"YoastSidebar",children:e=>j(e)})})})}function pa({score:e,label:t,scoreValue:s=""}){return(0,f.jsxs)("div",{className:"yoast-analysis-check",children:[(0,f.jsx)(Nt.SvgIcon,{...Ot(e)}),(0,f.jsxs)("span",{children:[" ",t," ",s&&(0,f.jsx)("strong",{children:s})]})]})}function ha({checklist:e,onClick:t}){const s=e.every(e=>"good"===e.score);return(0,f.jsxs)(n.Fragment,{children:[e.map(e=>(0,f.jsx)(pa,{...e},e.label)),(0,f.jsx)("br",{}),!s&&(0,f.jsx)(k.Root,{children:(0,f.jsx)(k.Button,{variant:"secondary",size:"small",onClick:t,children:(0,i.__)("Improve your post with Yoast SEO","wordpress-seo")})})]})}function ma(e){return(0,u.isNil)(e)||(e/=10),function(e){switch(e){case"feedback":return{className:"na",screenReaderText:(0,i.__)("Not available","wordpress-seo"),screenReaderReadabilityText:(0,i.__)("Not available","wordpress-seo"),screenReaderInclusiveLanguageText:(0,i.__)("Not available","wordpress-seo")};case"bad":return{className:"bad",screenReaderText:(0,i.__)("Needs improvement","wordpress-seo"),screenReaderReadabilityText:(0,i.__)("Needs improvement","wordpress-seo"),screenReaderInclusiveLanguageText:(0,i.__)("Needs improvement","wordpress-seo")};case"ok":return{className:"ok",screenReaderText:(0,i.__)("OK SEO score","wordpress-seo"),screenReaderReadabilityText:(0,i.__)("OK","wordpress-seo"),screenReaderInclusiveLanguageText:(0,i.__)("Potentially non-inclusive","wordpress-seo")};case"good":return{className:"good",screenReaderText:(0,i.__)("Good SEO score","wordpress-seo"),screenReaderReadabilityText:(0,i.__)("Good","wordpress-seo"),screenReaderInclusiveLanguageText:(0,i.__)("Good","wordpress-seo")};default:return{className:"loading",screenReaderText:"",screenReaderReadabilityText:"",screenReaderInclusiveLanguageText:""}}}(Mt.interpreters.scoreToRating(e))}function ya(e,t){const{isKeywordAnalysisActive:s}=t.getPreferences();if(s){const s=ma(t.getReadabilityResults().overallScore);e.push({label:(0,i.__)("Readability analysis:","wordpress-seo"),score:s.className,scoreValue:s.screenReaderReadabilityText})}}function ga(e,t){const{isContentAnalysisActive:s}=t.getPreferences();if(s){const s=ma(t.getResultsForFocusKeyword().overallScore),r=p().isPremium;e.push({label:r?(0,i.__)("Premium SEO analysis:","wordpress-seo"):(0,i.__)("SEO analysis:","wordpress-seo"),score:s.className,scoreValue:s.screenReaderReadabilityText})}}function fa(e,t){const{isInclusiveLanguageAnalysisActive:s}=t.getPreferences();if(s){const s=ma(t.getInclusiveLanguageResults().overallScore);e.push({label:(0,i.__)("Inclusive language:","wordpress-seo"),score:s.className,scoreValue:s.screenReaderInclusiveLanguageText})}}da.propTypes={error:m().object.isRequired},pa.propTypes={score:h.string.isRequired,label:h.string.isRequired,scoreValue:h.string},ha.propTypes={checklist:m().array.isRequired,onClick:m().func.isRequired};const xa=(()=>{let e=[];return t=>{const s=t("yoast-seo/editor"),r=[];return ga(r,s),ya(r,s),fa(r,s),r.push(...Object.values(s.getChecklistItems())),r.length===e.length&&r.every((t,s)=>t.label===e[s].label&&t.score===e[s].score&&t.scoreValue===e[s].scoreValue)?{checklist:e}:(e=r,{checklist:r})}})(),wa=(0,Ht.compose)([(0,t.withSelect)(xa),(0,t.withDispatch)(function(e){const{openGeneralSidebar:t}=e("core/edit-post");return{onClick:()=>{t("yoast-seo/seo-sidebar")}}})])(ha),ba=(0,Ht.compose)([(0,t.withSelect)(e=>{const t=e("yoast-seo/editor"),s=ma(t.getResultsForFocusKeyword().overallScore),r=ma(t.getReadabilityResults().overallScore),{isKeywordAnalysisActive:o,isContentAnalysisActive:n}=t.getPreferences();let i,a;switch(r.className){case"good":i=Pt.colors.$color_good;break;case"ok":i=Pt.colors.$color_ok;break;default:i=Pt.colors.$color_bad}switch(s.className){case"good":a=Pt.colors.$color_good;break;case"ok":a=Pt.colors.$color_ok;break;default:a=Pt.colors.$color_bad}return{readabilityScoreColor:i,seoScoreColor:a,isKeywordAnalysisActive:o,isContentAnalysisActive:n}})])(b);var va;function ka(){return ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ka.apply(null,arguments)}const ja=e=>P.createElement("svg",ka({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 1600 1600"},e),va||(va=P.createElement("g",{fill:"none",fillRule:"evenodd"},P.createElement("path",{fill:"#1877f2",d:"M1600 800a800 800 0 1 0-925 790v-559H472V800h203V624c0-201 119-311 302-311 88 0 179 15 179 15v197h-101c-99 0-130 62-130 125v150h222l-36 231H925v559a800 800 0 0 0 675-790"}),P.createElement("path",{fill:"#fff",d:"M1147 800H925V650c0-63 31-125 130-125h101V328s-91-15-179-15c-183 0-302 110-302 311v176H472v231h203v559a806 806 0 0 0 250 0v-559h186z"}))));var _a;function Sa(){return Sa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},Sa.apply(null,arguments)}const Ca=e=>P.createElement("svg",Sa({xmlns:"http://www.w3.org/2000/svg",fill:"current","aria-hidden":"true",viewBox:"0 0 1200 1227"},e),_a||(_a=P.createElement("path",{d:"M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026zM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026z"})));function Ta({permalink:e}){const t=encodeURI(e);return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)("div",{children:(0,i.__)("Share your post!","wordpress-seo")}),(0,f.jsxs)("ul",{className:"yoast-seo-social-share-buttons",children:[(0,f.jsx)("li",{children:(0,f.jsxs)("a",{href:"https://www.facebook.com/sharer/sharer.php?u="+t,target:"_blank",rel:"noopener noreferrer",children:[(0,f.jsx)(ja,{}),(0,i.__)("Facebook","wordpress-seo"),(0,f.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]})}),(0,f.jsx)("li",{children:(0,f.jsxs)("a",{href:"https://twitter.com/share?url="+t,target:"_blank",rel:"noopener noreferrer",className:"x-share",children:[(0,f.jsx)(Ca,{}),(0,i.__)("X","wordpress-seo"),(0,f.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]})})]})]})}Ta.propTypes={permalink:m().string.isRequired};const Ra=(0,Ht.compose)([(0,t.withSelect)(e=>({permalink:e("core/editor").getPermalink()}))])(Ta);var Ea=s(7651),Ia=s.n(Ea);const La=e=>{var s,r;const o=null===(s=(0,t.useDispatch)("core/edit-post"))||void 0===s?void 0:s.openGeneralSidebar,i=null===(r=(0,t.useDispatch)("core/editor"))||void 0===r?void 0:r.closePublishSidebar,{openEditorModal:a}=(0,t.useDispatch)("yoast-seo/editor");return(0,n.useCallback)(()=>{i(),o("yoast-seo/seo-sidebar"),e&&a("yoast-search-appearance-modal")},[i,o,a])};function Aa({isSeoDataDefault:e}){const s=(0,t.select)("yoast-seo/editor").getPostType(),r=(0,n.useMemo)(()=>(null==e?void 0:e.isAllTitlesDefault)||!1,[e]),o=(0,n.useMemo)(()=>(null==e?void 0:e.isAllDescriptionsDefault)||!1,[e]),a=(0,n.useMemo)(()=>"post"===s&&(r||o),[s,r,o]),l=(0,n.useMemo)(()=>r&&o?(0,i.__)("custom SEO titles and meta descriptions","wordpress-seo"):r?(0,i.__)("custom SEO titles","wordpress-seo"):o?(0,i.__)("custom meta descriptions","wordpress-seo"):void 0,[r,o]),c=(0,n.useMemo)(()=>r&&o?(0,i.__)("quick optimized SEO titles and meta descriptions","wordpress-seo"):r?(0,i.__)("quick optimized SEO titles","wordpress-seo"):o?(0,i.__)("quick optimized meta descriptions","wordpress-seo"):void 0,[r,o]),d=(0,n.useMemo)(()=>(0,i.sprintf)(/* translators: %1$s expands to "custom SEO titles" or "custom meta descriptions" or both. */ /* translators: %1$s expands to "custom SEO titles" or "custom meta descriptions" or both. */
(0,i.__)("Stand out in the search results and attract more visitors by adding %1$s.","wordpress-seo"),l),[l]),u=(0,n.useMemo)(()=>C((0,i.sprintf)(
/* translators: %1$s, %2$s expands to strong tags. %3$s, %4$s expands to emphasis tags.
%5$s expands to "quick optimized SEO titles" or "quick optimized meta descriptions" or both */
/* translators: %1$s, %2$s expands to strong tags. %3$s, %4$s expands to emphasis tags.
%5$s expands to "quick optimized SEO titles" or "quick optimized meta descriptions" or both */
(0,i.__)("%1$sPro tip%2$s: Use %3$sAI Generate%4$s for %5$s.","wordpress-seo"),"<strong>","</strong>","<em>","</em>",c),{strong:(0,f.jsx)("strong",{}),em:(0,f.jsx)("em",{})}),[c]),p=(0,n.useMemo)(()=>r?o?[]:(0,Ci.applyFilters)("yoast.replacementVariableEditor.additionalButtons",[],{fieldId:"yoast-google-preview-pre-publish",type:"title"}):[],[r,o]),h=(0,n.useMemo)(()=>o?(0,Ci.applyFilters)("yoast.replacementVariableEditor.additionalButtons",[],{fieldId:"yoast-google-preview-pre-publish",type:"description"}):[],[r,o]),m=La(!0),y=(0,n.useCallback)(()=>{m()},[m]);return a&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-1 yst-mb-[-25px]",children:[(0,f.jsx)(Ia(),{className:"yst-w-4 yst-h-4 yst-text-amber-500"}),(0,f.jsx)("h4",{children:(0,i.__)("Default SEO data detected","wordpress-seo")})]}),(0,f.jsx)("p",{children:d}),p.length+h.length>0&&(0,f.jsx)("p",{children:u}),(0,f.jsx)(v.Slot,{name:"yoast.replacementVariableEditor.additionalButtons.yoast-google-preview-pre-publish"}),p.map((e,t)=>(0,f.jsx)(n.Fragment,{children:e},`additional-button-pre-publish-sidebar-title-${t}`)),h.map((e,t)=>(0,f.jsx)(n.Fragment,{children:e},`additional-button-pre-publish-sidebar-description-${t}`)),(0,f.jsx)(k.Root,{children:(0,f.jsx)(k.Button,{variant:"secondary",size:"small",className:"yst-mt-2",onClick:y,children:(0,i.__)("Write custom SEO data","wordpress-seo")})})]})}function Na({checklist:e,onClick:t,isSeoDataDefault:s}){let r;return r=e.every(e=>"good"===e.score)?(0,i.__)("We've analyzed your post. Everything looks good. Well done!","wordpress-seo"):(0,i.__)("We've analyzed your post. There is still room for improvement!","wordpress-seo"),(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(c.LocationProvider,{value:"pre-publish",children:[(0,f.jsx)("p",{children:r}),(0,f.jsx)(ha,{checklist:e,onClick:t}),(0,f.jsx)(Aa,{isSeoDataDefault:s})]})})}Aa.propTypes={isSeoDataDefault:m().object.isRequired},Na.propTypes={checklist:m().array.isRequired,onClick:m().func.isRequired,isSeoDataDefault:m().object.isRequired};const Pa=(()=>{let e=null;return t=>{const s=t("yoast-seo/editor"),r=[];!function(e,t){t.getFocusKeyphrase()||e.push({label:(0,i.__)("No focus keyword was entered","wordpress-seo"),score:"bad"})}(r,s),ga(r,s),ya(r,s),fa(r,s),r.push(...Object.values(s.getChecklistItems()));const o=function(e){const{isRecentTitlesDefault:t,isRecentDescriptionsDefault:s}=e.getPreferences(),r=e.getSnippetEditorData(),o=e.getSeoTitleTemplate(),n=e.getSeoDescriptionTemplate(),i=r.title.trim()===o.trim(),a=r.description.trim()===n.trim();return{isAllTitlesDefault:t&&i,isAllDescriptionsDefault:s&&a}}(s);return null!==e&&r.length===e.checklist.length&&r.every((t,s)=>t.label===e.checklist[s].label&&t.score===e.checklist[s].score&&t.scoreValue===e.checklist[s].scoreValue)&&o.isAllTitlesDefault===e.isSeoDataDefault.isAllTitlesDefault&&o.isAllDescriptionsDefault===e.isSeoDataDefault.isAllDescriptionsDefault||(e={checklist:r,isSeoDataDefault:o}),e}})(),Ma=(0,Ht.compose)([(0,t.withSelect)(Pa),(0,t.withDispatch)(function(e){const{closePublishSidebar:t,openGeneralSidebar:s}=e("core/edit-post");return{onClick:()=>{t(),s("yoast-seo/seo-sidebar")}}})])(Na),Oa=(0,Ht.compose)([(0,t.withSelect)((e,t)=>{const{isAlertDismissed:s}=e(t.store||"yoast-seo/editor");return{isAlertDismissed:s(t.alertKey)}}),(0,t.withDispatch)((e,t)=>{const{dismissAlert:s}=e(t.store||"yoast-seo/editor");return{onDismissed:()=>s(t.alertKey)}})]),Fa=({children:e,id:t,hasIcon:s=!0,title:r,image:o=null,isAlertDismissed:n,onDismissed:a,className:l=""})=>n?null:(0,f.jsxs)("div",{id:t,className:X()("notice-yoast yoast is-dismissible",l),children:[(0,f.jsxs)("div",{className:"notice-yoast__container",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"notice-yoast__header",children:[s&&(0,f.jsx)("span",{className:"yoast-icon"}),(0,f.jsx)("h2",{className:"notice-yoast__header-heading yoast-notice-migrated-header",children:r})]}),(0,f.jsx)("div",{className:"notice-yoast-content",children:(0,f.jsx)("p",{children:e})})]}),o&&(0,f.jsx)(o,{height:"60"})]}),(0,f.jsx)("button",{type:"button",className:"notice-dismiss",onClick:a,children:(0,f.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Dismiss this notice.","wordpress-seo")})})]});Fa.propTypes={children:m().node.isRequired,id:m().string.isRequired,hasIcon:m().bool,title:m().any.isRequired,image:m().elementType,isAlertDismissed:m().bool.isRequired,onDismissed:m().func.isRequired,className:m().string};const Da=Oa(Fa),qa="trustpilot-review-notification",Ba="yoast-seo/editor",$a=()=>{const e=(0,t.useSelect)(e=>e(Ba).getIsPremium(),[]),s=(0,t.useSelect)(e=>e(Ba).isAlertDismissed(qa),[]),{overallScore:r}=(0,t.useSelect)(e=>e(Ba).getResultsForFocusKeyword(),[]),{dismissAlert:o}=(0,t.useDispatch)(Ba),i=(0,n.useCallback)(()=>o(qa),[o]),[a,l]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{var e;"good"===(null===(e=ma(r))||void 0===e?void 0:e.className)&&l(!0)},[r]),{shouldShow:!e&&!s&&a,dismiss:i}},Ua=(0,Xt.makeOutboundLink)(),Wa=e=>{const{shouldShow:s,dismiss:r}=$a(),{locationContext:o}=(0,c.useRootContext)(),n=(0,t.useSelect)(e=>e(Ba).selectLink("https://yoa.st/trustpilot-review",{context:o}),[o]);return(0,f.jsxs)(Fa,{alertKey:qa,store:Ba,id:qa,title:(0,i.__)("Show Yoast SEO some love!","wordpress-seo"),hasIcon:!1,isAlertDismissed:!s,onDismissed:r,className:"yst-m-0",...e,children:[(0,i.__)("Happy with the plugin?","wordpress-seo")," ",(0,f.jsx)(Ua,{href:n,rel:"noopener noreferrer",children:(0,i.__)("Leave a quick review","wordpress-seo")}),"."]})},Ha=({store:e="yoast-seo/editor",image:s=null,url:r,...o})=>(0,t.useSelect)(t=>t(e).getIsPremium())?null:(0,f.jsxs)(Da,{alertKey:"webinar-promo-notification",store:e,id:"webinar-promo-notification",title:(0,i.__)("Ready to boost your online visibility?","wordpress-seo"),image:s,url:r,...o,children:[C((0,i.sprintf)(/* translators: 1: bold open tag; 2: "FREE"; 3: bold close tag; 4: "Yoast SEO". */ /* translators: 1: bold open tag; 2: "FREE"; 3: bold close tag; 4: "Yoast SEO". */
(0,i.__)("Access our %1$s%2$s%3$s webinars and podcasts to get started with %4$s and build the foundational skills and confidence needed for sustainable success.","wordpress-seo"),"<strong>","FREE","</strong>","Yoast SEO"),{strong:(0,f.jsx)("strong",{})})," ",(0,f.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",children:(0,i.__)("Sign up today!","wordpress-seo")})]});Ha.propTypes={store:m().string,image:m().elementType,url:m().string.isRequired};const Ka=Ha,Ya=(e="yoast-seo/editor")=>{const s=(0,t.select)(e).isPromotionActive("black-friday-promotion"),r=(0,t.select)(e).isAlertDismissed("black-friday-promotion");return!s||r};var za=s(5169),Va=s.n(za);const Ga=({id:e,postTypeName:t,children:s,title:r,isOpen:o,open:a,close:l,shouldCloseOnClickOutside:d=!0,showChangesWarning:u=!0,SuffixHeroIcon:p=null,titleHelpLink:h=null})=>(0,f.jsxs)(n.Fragment,{children:[o&&(0,f.jsx)(c.LocationProvider,{value:"modal",children:(0,f.jsxs)(Jt,{title:h?(0,f.jsxs)(f.Fragment,{children:[r,h]}):r,contentLabel:h?r:null,onRequestClose:l,additionalClassName:"yoast-collapsible-modal yoast-post-settings-modal",id:"id",shouldCloseOnClickOutside:d,children:[(0,f.jsx)("div",{className:"yoast-content-container",children:(0,f.jsx)("div",{className:"yoast-modal-content",children:s})}),(0,f.jsxs)("div",{className:"yoast-notice-container",children:[(0,f.jsx)("hr",{}),(0,f.jsxs)("div",{className:"yoast-button-container",children:[u&&(0,f.jsx)("p",{children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */
(0,i.sprintf)((0,i.__)("Make sure to save your %s for changes to take effect","wordpress-seo"),t)}),(0,f.jsx)("button",{className:"yoast-button yoast-button--primary yoast-button--post-settings-modal",type:"button",onClick:l,children:/* Translators: %s translates to the Post Label in singular form */ /* Translators: %s translates to the Post Label in singular form */
(0,i.sprintf)((0,i.__)("Return to your %s","wordpress-seo"),t)})]})]})]})}),(0,f.jsx)(ns,{id:e+"-open-button",title:r,SuffixHeroIcon:p,suffixIcon:p?null:{size:"20px",icon:"pencil-square"},onClick:a})]});Ga.propTypes={id:m().string.isRequired,postTypeName:m().string.isRequired,children:m().oneOfType([m().node,m().arrayOf(m().node)]).isRequired,title:m().string.isRequired,isOpen:m().bool.isRequired,open:m().func.isRequired,close:m().func.isRequired,shouldCloseOnClickOutside:m().bool,showChangesWarning:m().bool,SuffixHeroIcon:m().element,titleHelpLink:m().element};const Xa=Ga,Za=(0,Ht.compose)([(0,t.withSelect)((e,t)=>{const{getPostOrPageString:s,getIsModalOpen:r}=e("yoast-seo/editor");return{postTypeName:s(),isOpen:r(t.id)}}),(0,t.withDispatch)((e,t)=>{const{openEditorModal:s,closeEditorModal:r}=e("yoast-seo/editor");return{open:()=>s(t.id),close:r}})])(Xa),Qa=g()(Va())`
width: 18px;
height: 18px;
margin: 3px;
`,Ja=({location:e="sidebar"})=>{const s=(0,t.useSelect)(e=>e("yoast-seo/editor").getIsElementorEditor(),[]),r=(0,t.useSelect)(e=>e("yoast-seo/editor").isFleschReadingEaseAvailable(),[]),o=zt();return(0,f.jsx)(Za,{title:(0,i.__)("Insights","wordpress-seo"),id:`yoast-insights-modal-${e}`,shouldCloseOnClickOutside:!s,showChangesWarning:!1,SuffixHeroIcon:(0,f.jsx)(Qa,{className:"yst-text-slate-500",...o}),children:(0,f.jsxs)("div",{className:"yoast-insights yoast-modal-content--columns",children:[(0,f.jsx)(Co,{location:e}),(0,f.jsxs)("div",{children:[r&&(0,f.jsx)("div",{className:"yoast-insights-row",children:(0,f.jsx)(vo,{})}),(0,f.jsxs)("div",{className:"yoast-insights-row yoast-insights-row--columns",children:[(0,f.jsx)(xo,{}),(0,f.jsx)(To,{})]}),(0,po.isFeatureEnabled)("TEXT_FORMALITY")&&(0,f.jsx)(Ao,{location:e,name:"YoastTextFormalityMetabox"})]})]})})};Ja.propTypes={location:m().string};const el=Ja;var tl=s(8290),sl=s.n(tl);class rl{constructor(e){this.refresh=e,this.loaded=!1,this.preloadThreshold=3e3,this.plugins={},this.modifications={},this._registerPlugin=this._registerPlugin.bind(this),this._ready=this._ready.bind(this),this._reloaded=this._reloaded.bind(this),this._registerModification=this._registerModification.bind(this),this._registerAssessment=this._registerAssessment.bind(this),this._applyModifications=this._applyModifications.bind(this),setTimeout(this._pollLoadingPlugins.bind(this),1500)}_registerPlugin(e,t){return(0,u.isString)(e)?(0,u.isUndefined)(t)||(0,u.isObject)(t)?!1===this._validateUniqueness(e)?(console.error("Failed to register plugin. Plugin with name "+e+" already exists"),!1):(this.plugins[e]=t,!0):(console.error("Failed to register plugin "+e+". Expected parameters `options` to be a object."),!1):(console.error("Failed to register plugin. Expected parameter `pluginName` to be a string."),!1)}_ready(e){return(0,u.isString)(e)?(0,u.isUndefined)(this.plugins[e])?(console.error("Failed to modify status for plugin "+e+". The plugin was not properly registered."),!1):(this.plugins[e].status="ready",!0):(console.error("Failed to modify status for plugin "+e+". Expected parameter `pluginName` to be a string."),!1)}_reloaded(e){return(0,u.isString)(e)?(0,u.isUndefined)(this.plugins[e])?(console.error("Failed to reload Content Analysis for plugin "+e+". The plugin was not properly registered."),!1):(this.refresh(),!0):(console.error("Failed to reload Content Analysis for "+e+". Expected parameter `pluginName` to be a string."),!1)}_registerModification(e,t,s,r){if(!(0,u.isString)(e))return console.error("Failed to register modification for plugin "+s+". Expected parameter `modification` to be a string."),!1;if(!(0,u.isFunction)(t))return console.error("Failed to register modification for plugin "+s+". Expected parameter `callable` to be a function."),!1;if(!(0,u.isString)(s))return console.error("Failed to register modification for plugin "+s+". Expected parameter `pluginName` to be a string."),!1;if(!1===this._validateOrigin(s))return console.error("Failed to register modification for plugin "+s+". The integration has not finished loading yet."),!1;const o={callable:t,origin:s,priority:(0,u.isNumber)(r)?r:10};return(0,u.isUndefined)(this.modifications[e])&&(this.modifications[e]=[]),this.modifications[e].push(o),!0}_registerAssessment(e,t,s,r){return(0,u.isString)(t)?(0,u.isObject)(s)?(0,u.isString)(r)?(t=r+"-"+t,e.addAssessment(t,s),!0):(console.error("Failed to register assessment for plugin "+r+". Expected parameter `pluginName` to be a string."),!1):(console.error("Failed to register assessment for plugin "+r+". Expected parameter `assessment` to be a function."),!1):(console.error("Failed to register test for plugin "+r+". Expected parameter `name` to be a string."),!1)}_applyModifications(e,t,s){let r=this.modifications[e];return!(0,u.isArray)(r)||r.length<1||(r=this._stripIllegalModifications(r),r.sort((e,t)=>e.priority-t.priority),(0,u.forEach)(r,function(r){const o=r.callable(t,s);typeof o==typeof t?t=o:console.error("Modification with name "+e+" performed by plugin with name "+r.origin+" was ignored because the data that was returned by it was of a different type than the data we had passed it.")})),t}_pollLoadingPlugins(e){e=(0,u.isUndefined)(e)?0:e,!0===this._allReady()?(this.loaded=!0,this.refresh()):e>=this.preloadThreshold?(this._pollTimeExceeded(),this.loaded=!0,this.refresh()):(e+=50,setTimeout(this._pollLoadingPlugins.bind(this,e),50))}_allReady(){return(0,u.reduce)(this.plugins,function(e,t){return e&&"ready"===t.status},!0)}_pollTimeExceeded(){(0,u.forEach)(this.plugins,function(e,t){(0,u.isUndefined)(e.options)||"ready"===e.options.status||(console.error("Error: Plugin "+t+". did not finish loading in time."),delete this.plugins[t])})}_stripIllegalModifications(e){return(0,u.forEach)(e,(t,s)=>{!1===this._validateOrigin(t.origin)&&delete e[s]}),e}_validateOrigin(e){return"ready"===this.plugins[e].status}_validateUniqueness(e){return(0,u.isUndefined)(this.plugins[e])}}let ol=null;const nl=()=>{if(null===ol){const e=(0,t.dispatch)("yoast-seo/editor").runAnalysis;ol=window.YoastSEO.app&&window.YoastSEO.app.pluggable?window.YoastSEO.app.pluggable:new rl(e)}return ol},il=(e,t,s)=>nl().loaded?nl()._applyModifications(e,t,s):t,{stripHTMLTags:al}=Xt.strings,ll=(e,s)=>{const r=(0,t.select)("yoast-seo/editor").getSnippetEditorTemplates();""===e.title&&(e.title=r.title),""===e.description&&(e.description=r.description);let o=0;return s.shortenedBaseUrl&&"string"==typeof s.shortenedBaseUrl&&(o=s.shortenedBaseUrl.length),e.url=e.url.replace(/\s+/g,"-"),"-"===e.url[e.url.length-1]&&(e.url=e.url.slice(0,-1)),"-"===e.url[o]&&(e.url=e.url.slice(0,o)+e.url.slice(o+1)),{url:e.url,title:al(il("data_page_title",e.title)),description:al(il("data_meta_desc",e.description)),filteredSEOTitle:al(il("data_page_title",e.filteredSEOTitle))}},cl=({isLoading:e,onLoad:t,location:s,...r})=>((0,n.useEffect)(()=>{setTimeout(()=>{e&&t()})}),e?null:(0,f.jsx)(Qr,{icon:"eye",hasPaperStyle:r.hasPaperStyle,children:(0,f.jsx)(Gr.SnippetEditor,{...r,descriptionPlaceholder:(0,i.__)("Please provide a meta description by editing the snippet below.","wordpress-seo"),mapEditorDataToPreview:ll,showCloseButton:!1,idSuffix:s})}));cl.propTypes={isLoading:m().bool.isRequired,onLoad:m().func.isRequired,hasPaperStyle:m().bool.isRequired,location:m().string.isRequired};const dl=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getBaseUrlFromSettings:t,getDateFromSettings:s,getEditorDataImageUrl:r,getFocusKeyphrase:o,getRecommendedReplaceVars:n,getSiteIconUrlFromSettings:i,getSnippetEditorData:a,getSnippetEditorIsLoading:l,getSnippetEditorMode:c,getSnippetEditorWordsToHighlight:d,isCornerstoneContent:u,getContentLocale:p,getSiteName:h,getReplaceVars:m}=e("yoast-seo/editor");return{baseUrl:t(),data:a(),date:s(),faviconSrc:i(),isLoading:l(),keyword:o(),mobileImageSrc:r(),mode:c(),recommendedReplacementVariables:n(),replacementVariables:m(),wordsToHighlight:d(),isCornerstone:u(),locale:p(),siteName:h()}}),(0,t.withDispatch)(e=>{const{updateData:t,switchMode:s,updateAnalysisData:r,loadSnippetEditorData:o}=e("yoast-seo/editor");return{onChange:(e,r)=>{switch(e){case"mode":s(r);break;case"slug":t({slug:r});break;default:t({[e]:r})}},onChangeAnalysisData:r,onLoad:o}}),zr()])(cl),ul=g()(sl())`
width: 18px;
height: 18px;
margin: 3px;
`,pl=()=>{const e=zt(),s=(0,t.useSelect)(e=>e("yoast-seo/editor").getIsElementorEditor(),[]);return(0,f.jsxs)(Za,{title:(0,i.__)("Search appearance","wordpress-seo"),id:"yoast-search-appearance-modal",shouldCloseOnClickOutside:!1,SuffixHeroIcon:(0,f.jsx)(ul,{className:"yst-text-slate-500",...e}),children:[!0===s&&(0,f.jsx)(dl,{showCloseButton:!1,hasPaperStyle:!1}),!1===s&&(0,f.jsx)(co,{showCloseButton:!1,hasPaperStyle:!1})]})};var hl=s(3041),ml=s.n(hl);const yl=g()(Nt.Collapsible)`
h2 > button {
padding-left: 0;
padding-top: 16px;
&:hover {
background-color: #f0f0f0;
}
}
div[class^="collapsible_content"] {
padding: 24px 0;
margin: 0 24px;
border-top: 1px solid rgba(0,0,0,0.2);
}
`,gl=e=>(0,f.jsx)(yl,{hasPadding:!1,hasSeparator:!0,...e}),fl=g()(ml())`
width: 18px;
height: 18px;
margin: 3px;
`,xl=e=>{const{useOpenGraphData:t,useTwitterData:s}=e;if(!t&&!s)return;const r=zt();return(0
/* translators: Social media appearance refers to a preview of how a page will be represented on social media. */,f.jsxs)(Za,{title:(0,i.__)("Social media appearance","wordpress-seo"),id:"yoast-social-appearance-modal",shouldCloseOnClickOutside:!1,SuffixHeroIcon:(0,f.jsx)(fl,{className:"yst-text-slate-500",...r}),titleHelpLink:t?(0,f.jsx)(ai,{}):null,children:[t&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(oi,{children:(0,i.__)("Determine how your post should look on social media like Facebook, X, Instagram, WhatsApp, Threads, LinkedIn, Slack, and more.","wordpress-seo")}),(0,f.jsx)(Qn,{}),s&&(0,f.jsx)(ri,{children:(0,i.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below. If you leave these settings untouched, the 'Social media appearance' settings mentioned above will also be applied for sharing on X.","wordpress-seo")})]}),t&&s&&(0,f.jsx)(gl,{title:(0,i.__)("X appearance","wordpress-seo"),hasSeparator:!0,initialIsOpen:!1,children:(0,f.jsx)(si,{})}),!t&&s&&(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(oi,{children:(0,i.__)("To customize the appearance of your post specifically for X, please fill out the 'X appearance' settings below.","wordpress-seo")}),(0,f.jsx)(si,{})]})]})};xl.propTypes={useOpenGraphData:m().bool.isRequired,useTwitterData:m().bool.isRequired};const wl=xl,bl=({title:e,children:t,id:s=null,prefixIcon:r=null,subTitle:o="",hasBetaBadgeLabel:i=!1,hasNewBadgeLabel:a=!1,buttonId:l=null,renderNewBadgeLabel:c=()=>{},initialIsOpen:d=!1})=>{const[u,p]=(0,n.useState)(d),h=(0,n.useRef)(null);(0,n.useEffect)(()=>{d&&h.current&&h.current.focus()},[]);const m=(0,n.useCallback)(()=>{p(e=>!e)},[p]);return(0,f.jsxs)("div",{id:s,className:"yoast components-panel__body "+(u?"is-opened":""),children:[(0,f.jsx)("h2",{className:"components-panel__body-title",children:(0,f.jsxs)("button",{ref:h,onClick:m,className:"components-button components-panel__body-toggle",type:"button",id:l,children:[(0,f.jsx)("span",{className:"yoast-icon-span",style:{fill:`${r&&r.color||""}`},children:r&&(0,f.jsx)(Nt.SvgIcon,{icon:r.icon,color:r.color,size:r.size})}),!a&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"yoast-title-container",children:[(0,f.jsx)("div",{className:"yoast-title",children:e}),o&&(0,f.jsx)("div",{className:"yoast-subtitle",children:o})]}),i&&(0,f.jsx)(Nt.BetaBadge,{})]}),a&&(0,f.jsxs)("div",{className:"yst-flex-grow yst-flex yst-items-center yst-gap-2",children:[(0,f.jsxs)("span",{className:"yst-overflow-x-hidden yst-leading-normal",children:[(0,f.jsx)("div",{className:"yoast-title",children:e}),o&&(0,f.jsx)("div",{className:"yoast-subtitle",children:o})]}),c()]}),(0,f.jsx)("span",{className:"yoast-chevron","aria-hidden":"true"})]})}),u&&t]})},vl=bl;function kl({settings:e}){const s=(({webinarIntroUrl:e})=>{const{shouldShow:t}=$a(),s=(e=>{for(const t of e)if(null!=t&&t.getIsEligible())return t;return null})([{getIsEligible:()=>t,component:Wa},{getIsEligible:Ya,component:t=>(0,f.jsx)(Ka,{hasIcon:!1,image:null,url:e,className:"yst-m-0",...t})},{getIsEligible:()=>!0,component:e=>(0,f.jsx)(Ui,{...e})}]);return(null==s?void 0:s.component)||null})({webinarIntroUrl:(0,u.get)(window,"wpseoScriptData.webinarIntroBlockEditorUrl","https://yoa.st/webinar-intro-block-editor")}),{isAiFeatureActive:r,isPost:o}=(0,t.useSelect)(e=>({isAiFeatureActive:e("yoast-seo/editor").getPreference("isAiFeatureActive"),isPost:"post"===e("yoast-seo/editor").getPostType()}),[]),a=Wi();return a&&Hi(),(0,f.jsx)(n.Fragment,{children:(0,f.jsxs)(v.Fill,{name:"YoastSidebar",children:[(0,f.jsx)(Uo,{renderPriority:0,children:(0,f.jsx)(uo,{})},"warning"),(0,f.jsx)(Uo,{renderPriority:1,children:(0,f.jsxs)(sa,{children:[s&&(0,f.jsx)(s,{}),(0,f.jsx)(ra,{withPromptForContentSuggestions:r&&o}),o&&r&&(0,f.jsx)(Qi,{location:"sidebar"})]})},"editor-intro"),e.isKeywordAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:8,children:(0,f.jsx)(Yr.TopicInputs,{isSEMrushIntegrationActive:e.isSEMrushIntegrationActive})},"keyword-input"),e.isKeywordAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:10,children:(0,f.jsx)(n.Fragment,{children:(0,f.jsx)(Yr.SeoAnalysis,{shouldUpsell:e.shouldUpsell})})},"seo"),e.isContentAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:20,children:(0,f.jsx)(Yr.ReadabilityAnalysis,{shouldUpsell:e.shouldUpsell})},"readability"),e.isInclusiveLanguageAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:21,children:(0,f.jsx)(Yr.InclusiveLanguageAnalysis,{})},"inclusive-language-analysis"),e.isKeywordAnalysisActive&&(0,f.jsx)(Uo,{renderPriority:22,children:e.shouldUpsell&&(0,f.jsx)(qi,{})},"additional-keywords-upsell"),e.isKeywordAnalysisActive&&e.isWincherIntegrationActive&&(0,f.jsx)(Uo,{renderPriority:23,children:(0,f.jsx)(Kr,{location:"sidebar"})}),e.shouldUpsell&&(0,f.jsx)(Uo,{renderPriority:25,children:(0,f.jsx)(Bo,{})},"internal-linking-suggestions-upsell"),(0,f.jsx)(Uo,{renderPriority:26,children:(0,f.jsx)(pl,{})},"search-appearance"),(e.useOpenGraphData||e.useTwitterData)&&(0,f.jsx)(Uo,{renderPriority:27,children:(0,f.jsx)(wl,{useOpenGraphData:e.useOpenGraphData,useTwitterData:e.useTwitterData})},"social-appearance"),e.displaySchemaSettings&&(0,f.jsx)(Uo,{renderPriority:28,children:(0,f.jsx)(vl,{title:(0,i.__)("Schema","wordpress-seo"),children:(0,f.jsx)(Ni,{})})},"schema"),a&&(0,f.jsx)(Uo,{renderPriority:29,children:(0,f.jsx)(Yr.ContentBlocks,{})},"content-blocks"),e.displayAdvancedTab&&(0,f.jsx)(Uo,{renderPriority:30,children:(0,f.jsx)(vl,{title:(0,i.__)("Advanced","wordpress-seo"),children:(0,f.jsx)(Xo,{})})},"advanced"),e.isCornerstoneActive&&(0,f.jsx)(Uo,{renderPriority:31,children:(0,f.jsx)(Vr,{})},"cornerstone"),e.isInsightsEnabled&&(0,f.jsx)(Uo,{renderPriority:32,children:(0,f.jsx)(el,{location:"sidebar"})})]})})}bl.propTypes={title:m().string.isRequired,children:m().oneOfType([m().node,m().arrayOf(m().node)]).isRequired,id:m().string,prefixIcon:m().object,subTitle:m().string,hasBetaBadgeLabel:m().bool,hasNewBadgeLabel:m().bool,buttonId:m().string,renderNewBadgeLabel:m().func,initialIsOpen:m().bool},kl.propTypes={settings:m().object.isRequired};const jl=(0,t.withSelect)((e,t)=>{const{getPreferences:s}=e("yoast-seo/editor");return{settings:s(),store:t.store}})(kl);function _l({trackAll:e=u.noop,hasTrackedKeyphrases:t=!1}){return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(Nt.FieldGroup,{label:(0,i.__)("SEO performance","wordpress-seo"),linkTo:wpseoAdminL10n["shortlinks.wincher.seo_performance"],linkText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about the SEO performance feature.","wordpress-seo"),wrapperClassName:"yoast-field-group yoast-wincher-post-publish"}),(0,f.jsx)(Ys,{}),t&&(0,f.jsx)("p",{children:(0,i.__)("Tracking has already been enabled for one or more keyphrases of this page. Clicking the button below will enable tracking for all of its keyphrases.","wordpress-seo")}),(0,f.jsx)("div",{className:"yoast",children:(0,f.jsx)(Nt.NewButton,{variant:"secondary",small:!0,onClick:e,children:(0,i.__)("Track all keyphrases on this page","wordpress-seo")})}),(0,f.jsx)(Kr,{location:"postpublish"})]})}_l.propTypes={trackAll:m().func,hasTrackedKeyphrases:m().bool};const Sl=(0,Ht.compose)([(0,t.withSelect)(e=>{const{getWincherTrackedKeyphrases:t,hasWincherTrackedKeyphrases:s}=e("yoast-seo/editor");return{trackedKeyphrases:t(),hasTrackedKeyphrases:s()}}),(0,t.withDispatch)(e=>{const{setWincherOpenModal:t,setWincherTrackAllKeyphrases:s}=e("yoast-seo/editor");return{trackAll:()=>{s(!0),t("postpublish")}}})])(_l);window.wp.annotations;const Cl=/(<([a-z]|\/)[^<>]+>)/gi,{htmlEntitiesRegex:Tl}=Mt.helpers.htmlEntities,Rl=e=>{let t=0;return(0,u.forEachRight)(e,e=>{const[s]=e;let r=s.length;/^<\/?br/.test(s)&&(r-=1),t+=r}),t},El="<yoastmark class='yoast-text-mark'>",Il="</yoastmark>",Ll='<yoastmark class="yoast-text-mark">';function Al(e,t,s,r,o){const n=r.clientId,i=(0,l.create)({html:e,multilineTag:s.multilineTag,multilineWrapperTag:s.multilineWrapperTag}).text;return(0,u.flatMap)(o,s=>{let o;return o=s.hasBlockPosition&&s.hasBlockPosition()?function(e,t,s,r,o){if(t===e.getBlockClientId()){let t=e.getBlockPositionStart(),n=e.getBlockPositionEnd();if(e.isMarkForFirstBlockSection()){const e=((e,t,s)=>{const r="yoast/faq-block"===s?'<strong class="schema-faq-question">':'<strong class="schema-how-to-step-name">';return{blockStartOffset:e-=r.length,blockEndOffset:t-=r.length}})(t,n,s);t=e.blockStartOffset,n=e.blockEndOffset}if(r.slice(t,n)===o.slice(t,n))return[{startOffset:t,endOffset:n}];const i=((e,t,s)=>{const r=s.slice(0,e),o=s.slice(0,t),n=((e,t,s,r)=>{const o=[...e.matchAll(Cl)];s-=Rl(o);const n=[...t.matchAll(Cl)];return{blockStartOffset:s,blockEndOffset:r-=Rl(n)}})(r,o,e,t),i=((e,t,s,r)=>{let o=[...e.matchAll(Tl)];return(0,u.forEachRight)(o,e=>{const[,t]=e;s-=t.length}),o=[...t.matchAll(Tl)],(0,u.forEachRight)(o,e=>{const[,t]=e;r-=t.length}),{blockStartOffset:s,blockEndOffset:r}})(r,o,e=n.blockStartOffset,t=n.blockEndOffset);return{blockStartOffset:e=i.blockStartOffset,blockEndOffset:t=i.blockEndOffset}})(t,n,r);return[{startOffset:i.blockStartOffset,endOffset:i.blockEndOffset}]}return[]}(s,n,r.name,e,i):function(e,t){const s=t.getOriginal().replace(/(<([^>]+)>)/gi,""),r=t.getMarked().replace(/(<(?!\/?yoastmark)[^>]+>)/gi,""),o=function(e,t,s=!0){const r=[];if(0===e.length)return r;let o,n=0;for(s||(t=t.toLowerCase(),e=e.toLowerCase());(o=e.indexOf(t,n))>-1;)r.push(o),n=o+t.length;return r}(e,s);if(0===o.length)return[];const n=function(e){let t=e.indexOf(El);const s=t>=0;s||(t=e.indexOf(Ll));let r=null;const o=[];for(;t>=0;){if(r=(e=s?e.replace(El,""):e.replace(Ll,"")).indexOf(Il),r<t)return[];e=e.replace(Il,""),o.push({startOffset:t,endOffset:r}),t=s?e.indexOf(El):e.indexOf(Ll),r=null}return o}(r),i=[];return n.forEach(e=>{o.forEach(r=>{const o=r+e.startOffset;let n=r+e.endOffset;0===e.startOffset&&e.endOffset===t.getOriginal().length&&(n=r+s.length),i.push({startOffset:o,endOffset:n})})}),i}(i,s),o?o.map(e=>({...e,block:n,richTextIdentifier:t})):[]})}const Nl=e=>e[0].toUpperCase()+e.slice(1),Pl=(e,t,s,r,o)=>(e=e.map(e=>{const n=`${e.id}-${o[0]}`,i=`${e.id}-${o[1]}`,a=Nl(o[0]),l=Nl(o[1]),c=e[`json${a}`],d=e[`json${l}`],{marksForFirstSection:u,marksForSecondSection:p}=((e,t)=>({marksForFirstSection:e.filter(e=>e.hasBlockPosition&&e.hasBlockPosition()?e.getBlockAttributeId()===t.id&&e.isMarkForFirstBlockSection():e),marksForSecondSection:e.filter(e=>e.hasBlockPosition&&e.hasBlockPosition()?e.getBlockAttributeId()===t.id&&!e.isMarkForFirstBlockSection():e)}))(t,e),h=Al(c,n,s,r,u),m=Al(d,i,s,r,p);return h.concat(m)}),(0,u.flattenDeep)(e)),Ml="yoast";let Ol=[];const Fl={"core/paragraph":[{key:"content"}],"core/list":[{key:"values",multilineTag:"li",multilineWrapperTag:["ul","ol"]}],"core/list-item":[{key:"content"}],"core/heading":[{key:"content"}],"core/audio":[{key:"caption"}],"core/embed":[{key:"caption"}],"core/gallery":[{key:"caption"}],"core/image":[{key:"caption"}],"core/table":[{key:"caption"}],"core/video":[{key:"caption"}],"yoast/faq-block":[{key:"questions"}],"yoast/how-to-block":[{key:"steps"},{key:"jsonDescription"}]};function Dl(){const e=Ol.shift();e&&((0,t.dispatch)("core/annotations").__experimentalAddAnnotation(e),ql())}function ql(){(0,u.isFunction)(window.requestIdleCallback)?window.requestIdleCallback(Dl,{timeout:1e3}):setTimeout(Dl,150)}function Bl(){const e=(0,t.select)("core/block-editor").getSelectedBlock(),s=(0,t.select)("yoast-seo/editor").getActiveMarker();if(!e||!s)return;var r;r=e.clientId,(0,t.select)("core/annotations").__experimentalGetAnnotations().filter(e=>e.blockClientId===r&&e.source===Ml).forEach(e=>{(0,t.dispatch)("core/annotations").__experimentalRemoveAnnotation(e.id)});const o=(0,t.select)("yoast-seo/editor").getResultById(s);if(void 0===o)return;const n=o.marks;var i;i=((e,t)=>{return(0,u.flatMap)((s=e.name,Fl.hasOwnProperty(s)?Fl[s]:[]),s=>"yoast/faq-block"===e.name?((e,t,s)=>{const r=t.attributes[e.key];return 0===r.length?[]:Pl(r,s,e,t,["question","answer"])})(s,e,t):"yoast/how-to-block"===e.name?((e,t,s)=>{const r=t.attributes[e.key];if(r&&0===r.length)return[];const o=[];return"steps"===e.key&&o.push(Pl(r,s,e,t,["name","text"])),"jsonDescription"===e.key&&(s=s.filter(e=>e.hasBlockPosition&&e.hasBlockPosition()?!e.getBlockAttributeId():e),o.push(Al(r,"description",e,t,s))),(0,u.flattenDeep)(o)})(s,e,t):function(e,t,s){const r=e.key,o=((e,t)=>{const s=e.attributes[t];return"string"==typeof s?s:(s||"").toString()})(t,r);return Al(o,r,e,t,s)}(s,e,t));var s})(e,n),Ol=i.map(e=>({blockClientId:e.block,source:Ml,richTextIdentifier:e.richTextIdentifier,range:{start:e.startOffset,end:e.endOffset}})),ql()}const $l=window.wp.htmlEntities;function Ul({value:e,onChange:t}){var s;const[r,o]=(0,n.useState)(Boolean(null==e?void 0:e.cssClasses)),a=`${(0,Ht.useInstanceId)(Ul,"css-classes-setting")}-input`;return(0,n.useEffect)(()=>{o(Boolean(null==e?void 0:e.cssClasses))},[null==e?void 0:e.cssClasses]),(0,f.jsxs)(v.__experimentalVStack,{spacing:"2",children:[(0,f.jsx)(v.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Additional CSS class(es)","wordpress-seo"),checked:r,onChange:s=>{o(s),s||t({...e,cssClasses:""})}}),r&&(0,f.jsx)(v.__experimentalInputControl,{__next40pxDefaultSize:!0,id:a,label:(0,i.__)("Additional CSS class(es)","wordpress-seo"),hideLabelFromVision:!0,value:null!==(s=null==e?void 0:e.cssClasses)&&void 0!==s?s:"",onChange:s=>{const r=(null!=s?s:"").replace(/,/g," ").replace(/\s+/g," ");t({...e,cssClasses:r})},onBlur:()=>{var s;const r=(null!==(s=null==e?void 0:e.cssClasses)&&void 0!==s?s:"").trim();r!==(null==e?void 0:e.cssClasses)&&t({...e,cssClasses:r})},placeholder:(0,i.__)("Separate multiple classes with spaces","wordpress-seo"),help:(0,i.__)("Separate multiple classes with spaces.","wordpress-seo")})]})}function Wl({isActive:e=!1,activeAttributes:t={},addingLink:s=!1,value:o={},onChange:a=u.noop,speak:c,stopAddingLink:d,contentRef:p={}}){const h=(0,n.useMemo)(u.uniqueId,[s]),[m,y]=(0,n.useState)(),g=(0,l.useAnchor)({editableContentElement:p.current,settings:{...zl,isActive:e}}),x=(0,l.getActiveFormat)(o,"core/link"),w=e=>{var t;const{formats:s,start:r,text:o}=e,n=null==x||null===(t=x.attributes)||void 0===t?void 0:t.url;let i=r,a=r;const l=e=>{var t;return null===(t=s[e])||void 0===t?void 0:t.some(e=>{var t;return"core/link"===(null==e?void 0:e.type)&&(null==e||null===(t=e.attributes)||void 0===t?void 0:t.url)===n})};for(!l(i)&&i>0&&l(i-1)&&(i--,a=i);i>0&&l(i-1);)i--;for(;a<((null==o?void 0:o.length)||0)&&l(a);)a++;return{start:i,end:a}};let b="";if(e&&x){const{start:e,end:t}=w(o);e<t&&(b=o.text.substring(e,t))}else o.start!==o.end&&(b=(0,l.getTextContent)((0,l.slice)(o)));const k={url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,noFollow:t.rel&&t.rel.split(" ").includes("nofollow"),sponsored:t.rel&&t.rel.split(" ").includes("sponsored"),title:b,className:t.class,cssClasses:t.class,...m},j=e=>k.url===e.url&&(k.opensInNewTab!==e.opensInNewTab||k.noFollow!==e.noFollow||k.sponsored!==e.sponsored||k.cssClasses!==e.cssClasses),_=e=>{if("number"==typeof e||"string"==typeof e)return String(e)},S=(0,f.jsx)(ni,{href:window.wpseoAdminL10n["shortlinks.nofollow_sponsored"],className:"dashicons",children:(0,f.jsx)("span",{className:"screen-reader-text",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about marking a link as nofollow or sponsored.","wordpress-seo")})}),T=C((0,i.sprintf)(
// translators: %1$s and %2$s are opening and closing code tags, %3$s is a help link.
// translators: %1$s and %2$s are opening and closing code tags, %3$s is a help link.
(0,i.__)("Search engines should ignore this link (mark as %1$snofollow%2$s)%3$s","wordpress-seo"),"<code>","</code>","<helplink />"),{code:(0,f.jsx)("code",{}),helplink:S}),R=C((0,i.sprintf)(
// translators: %1$s and %2$s are opening and closing code tags, %3$s is a help link.
// translators: %1$s and %2$s are opening and closing code tags, %3$s is a help link.
(0,i.__)("This is a sponsored link or advert (mark as %1$ssponsored%2$s)%3$s","wordpress-seo"),"<code>","</code>","<helplink />"),{code:(0,f.jsx)("code",{}),helplink:S}),E=[{id:"opensInNewTab",title:(0,i.__)("Open in new tab","wordpress-seo")},{id:"noFollow",title:T},{id:"sponsored",title:R},{id:"cssClasses",title:(0,i.__)("Additional CSS class(es)","wordpress-seo"),render:(e,t,s)=>(0,f.jsx)(Ul,{value:t,onChange:s},e.id)}],{__experimentalLinkControl:I}=window.wp.blockEditor;return(0,f.jsx)(v.Popover,{anchor:g,focusOnMount:!!s&&"firstElement",onClose:d,position:"bottom center",placement:"bottom",shift:!0,children:(0,f.jsx)(I,{value:k,onChange:t=>{var s;t={...m,...t};const n=j(t);if((e=>j(e)&&!e.url)(t=(e=>{var t;return j(t=e)&&!0===t.sponsored&&!0!==k.sponsored&&(e.noFollow=!0),(e=>j(e)&&!1===e.noFollow&&!1!==k.noFollow)(e)&&(e.sponsored=!1),e})(t)))return void y(t);const p=(0,r.prependHTTP)(t.url),h=function({url:e,type:t,id:s,opensInNewWindow:r,noFollow:o,sponsored:n,className:i}){const a={type:"core/link",attributes:{url:e}};t&&(a.attributes.type=t),s&&(a.attributes.id=s);let l=[];return r&&(a.attributes.target="_blank",l.push("noreferrer noopener")),n&&(l.push("sponsored"),l.push("nofollow")),o&&l.push("nofollow"),l.length>0&&(l=(0,u.uniq)(l),a.attributes.rel=l.join(" ")),i&&(a.attributes.class=i),a}({url:p,type:t.type,id:_(t.id),opensInNewWindow:t.opensInNewTab,noFollow:t.noFollow,sponsored:t.sponsored,className:null!==(s=t.cssClasses)&&void 0!==s?s:t.className});(0,l.isCollapsed)(o)&&!e?((e,t,s)=>{const r=((e,t)=>e.title?e.title:t)(t,s),n=(0,l.applyFormat)((0,l.create)({text:r}),e,0,r.length);a((0,l.insert)(o,n))})(h,t,p):((e,t)=>{const{start:s,end:r}=w(o),n=s<r?o.text.substring(s,r):"";let i;if(void 0!==t&&""!==t&&t!==n&&s<r){const n=(0,l.remove)(o,s,r);n.start=s,n.end=s;const a=(0,l.applyFormat)((0,l.create)({text:t}),e,0,t.length);i=(0,l.insert)(n,a)}else i=(0,l.applyFormat)(o,e),i.start=i.end;i.activeFormats=[],a(i)})(h,t.title),n||d(),(t=>{!function(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,r.getProtocol)(t);if(!(0,r.isValidProtocol)(e))return!1;if((0,u.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const s=(0,r.getAuthority)(t);if(!(0,r.isValidAuthority)(s))return!1;const o=(0,r.getPath)(t);if(o&&!(0,r.isValidPath)(o))return!1;const n=(0,r.getQueryString)(t);if(n&&!(0,r.isValidQueryString)(n))return!1;const i=(0,r.getFragment)(t);if(i&&!(0,r.isValidFragment)(i))return!1}return!((0,u.startsWith)(t,"#")&&!(0,r.isValidFragment)(t))}(t)?c((0,i.__)("Warning: the link has been inserted but may have errors. Please test it.","wordpress-seo"),"assertive"):c(e?(0,i.__)("Link edited.","wordpress-seo"):(0,i.__)("Link inserted.","wordpress-seo"),"assertive")})(p)},forceIsEditingLink:s,hasTextControl:!0,settings:E})},h)}Wl.propTypes={isActive:m().bool,activeAttributes:m().object,addingLink:m().bool,value:m().object,onChange:m().func,speak:m().func.isRequired,stopAddingLink:m().func.isRequired,contentRef:m().object};const Hl=(0,v.withSpokenMessages)(Wl),Kl="core/link",Yl=(0,i.__)("Link","wordpress-seo"),zl={name:Kl,title:Yl,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel",class:"class"},replaces:"core/link",__unstablePasteRule(e,{html:t,plainText:s}){if((0,l.isCollapsed)(e))return e;const o=(t||s).replace(/<[^>]+>/g,"").trim();return(0,r.isURL)(o)?(window.console.log("Created link:\n\n",o),(0,l.applyFormat)(e,{type:Kl,attributes:{url:(0,$l.decodeEntities)(o)}})):e},edit:(0,v.withSpokenMessages)(class extends n.Component{constructor(){super(...arguments),this.addLink=this.addLink.bind(this),this.stopAddingLink=this.stopAddingLink.bind(this),this.onRemoveFormat=this.onRemoveFormat.bind(this),this.state={addingLink:!1}}addLink(){const{value:e,onChange:t}=this.props,s=(0,l.getTextContent)((0,l.slice)(e));s&&(0,r.isURL)(s)?t((0,l.applyFormat)(e,{type:Kl,attributes:{url:s}})):s&&(0,r.isEmail)(s)?t((0,l.applyFormat)(e,{type:Kl,attributes:{url:`mailto:${s}`}})):this.setState({addingLink:!0})}stopAddingLink(){this.setState({addingLink:!1}),this.props.onFocus()}onRemoveFormat(){const{value:e,onChange:t,speak:s}=this.props;t((0,l.removeFormat)(e,Kl)),s((0,i.__)("Link removed.","wordpress-seo"),"assertive")}render(){const{isActive:e,activeAttributes:t,value:s,onChange:r}=this.props,{RichTextToolbarButton:o,RichTextShortcut:a}=window.wp.blockEditor;return(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(a,{type:"primary",character:"k",onUse:this.addLink}),(0,f.jsx)(a,{type:"primaryShift",character:"k",onUse:this.onRemoveFormat}),e&&(0,f.jsx)(o,{name:"link",icon:"editor-unlink",title:(0,i.__)("Unlink","wordpress-seo"),onClick:this.onRemoveFormat,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&(0,f.jsx)(o,{name:"link",icon:"admin-links",title:Yl,onClick:this.addLink,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(this.state.addingLink||e)&&(0,f.jsx)(Hl,{addingLink:this.state.addingLink,stopAddingLink:this.stopAddingLink,isActive:e,activeAttributes:t,value:s,onChange:r,contentRef:this.props.contentRef})]})}})},Vl=window.wp.domReady;var Gl=s.n(Vl);const Xl=window.wp.wordcount,Zl=({className:e})=>{const t=(0,k.useSvgAria)();return(0,f.jsxs)("span",{className:X()("yst-text-sm yst-flex yst-items-center yst-gap-1 yst-justify-center yst-text-slate-500 yst-italic",e),children:[(0,f.jsx)(k.GradientSparklesIcon,{className:"yst-h-3 yst-w-3",...t}),(0,i.__)("Using 1 spark","wordpress-seo")]})},Ql=(0,Ht.compose)([(0,t.withSelect)(e=>{const{selectFeatureModalStatus:t}=e(Ki),s=e("core/editor").getEditedPostContent(),{getIsPremium:r,selectLink:o}=e("yoast-seo/editor"),{isUsageCountLimitReached:n,selectPremiumSubscription:i}=e(we),a=i(),l=r();return{isEmptyPost:0===(0,Xl.count)(s,"words",{}),isOpen:t()===Yi,isPremium:l,upsellLink:o("https://yoa.st/content-planner-approve-modal"),learnMoreLink:o("https://yoa.st/content-planner-learn-more"),isUpsell:n()&&!a&&!l}}),(0,t.withDispatch)(e=>{const{closeModal:t,setFeatureModalStatus:s}=e(Ki);return{onClose:t,setStatus:s}})])(({isEmptyPost:e,isPremium:t,isUpsell:s,onClick:r,upsellLink:o,learnMoreLink:n,isOpen:a,onClose:l})=>{const{title:c,description:d}=((e,t)=>t?{title:(0,i.__)("You're out of free sparks","wordpress-seo"),description:(0,i.__)("Upgrade to keep finding content gaps, generating AI-powered titles and meta descriptions, and giving your content the best chance of being found.","wordpress-seo")}:e?{title:(0,i.__)("Looking for inspiration?","wordpress-seo"),description:(0,i.__)("The Yoast AI Content Planner identifies content gaps in your site structure and recommends topics that strengthen your topical authority.","wordpress-seo")}:{title:(0,i.__)("Get content suggestions","wordpress-seo"),description:C((0,i.sprintf)(
/* translators: %1$s and %4$s are opening and closing paragraph HTML tags respectively.
%2$s and %3$s are opening and closing italic HTML tags respectively. */
/* translators: %1$s and %4$s are opening and closing paragraph HTML tags respectively.
%2$s and %3$s are opening and closing italic HTML tags respectively. */
(0,i.__)("The Yoast AI Content Planner will analyze your site and recommend topics.%1$s%2$sNote: Applying a content suggestion will replace your current blogpost content & metadata.%3$s%4$s","wordpress-seo"),"<p>","<i>","</i>","</p>"),{i:(0,f.jsx)("i",{}),p:(0,f.jsx)("p",{className:"yst-mt-4"})})})(e,s),u=(0,k.useSvgAria)();return(0,f.jsx)(k.Modal,{isOpen:a,onClose:l,children:(0,f.jsxs)(k.Modal.Panel,{className:"yst-text-center yst-w-96",closeButtonScreenReaderText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close modal","wordpress-seo"),children:[(0,f.jsx)("div",{className:"yst-w-12 yst-h-12 yst-rounded-full yst-bg-ai-100 yst-flex yst-items-center yst-justify-center yst-mx-auto yst-mb-4",children:(0,f.jsx)(k.GradientSparklesIcon,{className:"yst-h-6 yst-w-6",...u})}),(0,f.jsx)(k.Modal.Title,{className:"yst-text-slate-900 yst-font-medium yst-text-lg yst-mb-2",children:c}),(0,f.jsx)(k.Modal.Description,{as:"div",className:"yst-text-slate-600 yst-text-sm yst-mb-6 yst-mx-10",children:d}),!t&&!s&&(0,f.jsx)(Zl,{className:"yst-mb-2"}),s?(0,f.jsxs)(k.Button,{variant:"upsell",as:"a",href:o,target:"_blank",className:"yst-w-full",rel:"noopener noreferrer",children:[(0,f.jsx)(R(),{className:"yst-w-4 yst-h-4 yst-me-2 yst-shrink-0",...u}),(0,i.sprintf)(/* translators: %s is the name of the premium product, Yoast SEO Premium. */ /* translators: %s is the name of the premium product, Yoast SEO Premium. */
(0,i.__)("Unlock with %s","wordpress-seo"),"Yoast SEO Premium"),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}):(0,f.jsxs)(k.Button,{onClick:r,variant:"ai-primary",className:"yst-w-full",children:[" ",(0,i.__)("Get content suggestions","wordpress-seo")," "]}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-sm",children:(0,f.jsxs)(k.Link,{as:Y,href:n,variant:"primary",className:"yst-inline yst-no-underline yst-font-medium",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(I(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]})})]})})}),Jl=t=>{const s=[];return t.forEach(({heading:t,contentNotes:r})=>{s.push((0,e.createBlock)("core/heading",{content:t,level:2})),s.push((0,e.createBlock)("yoast-seo/content-suggestion",{suggestions:r})),s.push((0,e.createBlock)("core/paragraph"))}),s},ec=["_formal","_informal","_ao90"],tc=e=>{for(const t of ec)if(e.endsWith(t))return e.slice(0,-t.length);return e},sc=e=>({bottom:`calc( (${e+"px"} - 100vh) / 2 + 32px )`}),rc=()=>{const{endpoint:e,postType:s,contentLocale:r,editorApiValue:o,recentContent:i,selectContentOutlineCache:a}=(0,t.useSelect)(e=>({endpoint:e(Ki).selectContentOutlineEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),recentContent:e(Ki).selectRecentContent(),selectContentOutlineCache:e(Ki).selectContentOutlineCache}),[]),{fetchContentOutline:l,restoreContentOutlineFromCache:c,setFeatureModalStatus:d}=(0,t.useDispatch)(Ki);return(0,n.useCallback)(t=>{const n=a(t.id);if(n)return c({suggestion:t,outline:n}),void d(Gi);const u=tc(r).replace("_","-");l({endpoint:e,postType:s,language:u,editor:o,recentContent:i,suggestion:{...t}})},[e,s,r,o,i,l,c,a,d])},oc=()=>{const{endpoint:e,postType:s,contentLocale:r,editorApiValue:o,isUsageCountLimitReached:i,usageCountEndpoint:a,hasValidPremiumSubscription:l,isPremium:c}=(0,t.useSelect)(e=>({endpoint:e(Ki).selectContentSuggestionsEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),usageCountEndpoint:e(we).selectUsageCountEndpoint(),isUsageCountLimitReached:e(we).isUsageCountLimitReached(),hasValidPremiumSubscription:e(we).selectPremiumSubscription(),isPremium:e("yoast-seo/editor").getIsPremium()}),[]),{fetchContentPlannerSuggestions:d,setFeatureModalStatus:u,setContentSuggestionsStatus:p,setSuggestionsError:h}=(0,t.useDispatch)(Ki),{fetchUsageCount:m,addUsageCount:y}=(0,t.useDispatch)(we);return(0,n.useCallback)(async()=>{if(c&&!l)return u(Vi),void h({errorCode:402,errorIdentifier:"PAYMENT_REQUIRED",missingLicenses:["Yoast SEO Premium"]});if(i&&!l)return void u(Yi);u(Vi),p(pe);const{payload:t}=await m({endpoint:a,isWooProductEntity:!1});if((429===(null==t?void 0:t.errorCode)&&"USAGE_LIMIT_REACHED"===(null==t?void 0:t.errorIdentifier)||t.count>=t.limit)&&!l)return u(Yi),void p(ue);const n=tc(r).replace("_","-");d({endpoint:e,postType:s,language:n,editor:o}),y()},[e,s,r,o,i,l,c,a,d,y,m,u,p,h])};function nc(...e){return e.filter(Boolean).join(" ")}function ic(e,t,...s){if(e in t){let r=t[e];return"function"==typeof r?r(...s):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ic),r}var ac,lc,cc=((lc=cc||{})[lc.None=0]="None",lc[lc.RenderStrategy=1]="RenderStrategy",lc[lc.Static=2]="Static",lc),dc=((ac=dc||{})[ac.Unmount=0]="Unmount",ac[ac.Hidden=1]="Hidden",ac);function uc({ourProps:e,theirProps:t,slot:s,defaultTag:r,features:o,visible:n=!0,name:i}){let a=hc(t,e);if(n)return pc(a,s,r,i);let l=null!=o?o:0;if(2&l){let{static:e=!1,...t}=a;if(e)return pc(t,s,r,i)}if(1&l){let{unmount:e=!0,...t}=a;return ic(e?0:1,{0:()=>null,1:()=>pc({...t,hidden:!0,style:{display:"none"}},s,r,i)})}return pc(a,s,r,i)}function pc(e,t={},s,r){var o;let{as:n=s,children:i,refName:a="ref",...l}=gc(e,["unmount","static"]),c=void 0!==e.ref?{[a]:e.ref}:{},d="function"==typeof i?i(t):i;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let u={};if(t){let e=!1,s=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&s.push(r);e&&(u["data-headlessui-state"]=s.join(" "))}if(n===P.Fragment&&Object.keys(yc(l)).length>0){if(!(0,P.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"));let e=nc(null==(o=d.props)?void 0:o.className,l.className),t=e?{className:e}:{};return(0,P.cloneElement)(d,Object.assign({},hc(d.props,yc(gc(l,["ref"]))),u,c,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let s of e)null!=s&&("function"==typeof s?s(t):s.current=t)}}}(d.ref,c.ref),t))}return(0,P.createElement)(n,Object.assign({},gc(l,["ref"]),n!==P.Fragment&&c,n!==P.Fragment&&u),d)}function hc(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},s={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=s[e]||(s[e]=[]),s[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(s).map(e=>[e,void 0])));for(let e in s)Object.assign(t,{[e](t,...r){let o=s[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function mc(e){var t;return Object.assign((0,P.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function yc(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function gc(e,t=[]){let s=Object.assign({},e);for(let e of t)e in s&&delete s[e];return s}let fc=(0,P.createContext)(null);fc.displayName="OpenClosedContext";var xc=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(xc||{});function wc(){return(0,P.useContext)(fc)}function bc({value:e,children:t}){return P.createElement(fc.Provider,{value:e},t)}var vc=Object.defineProperty,kc=(e,t,s)=>(((e,t,s)=>{t in e?vc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!=typeof t?t+"":t,s),s);let jc=new class{constructor(){kc(this,"current",this.detect()),kc(this,"handoffState","pending"),kc(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},_c=(e,t)=>{jc.isServer?(0,P.useEffect)(e,t):(0,P.useLayoutEffect)(e,t)};function Sc(){let e=(0,P.useRef)(!1);return _c(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Cc(e){let t=(0,P.useRef)(e);return _c(()=>{t.current=e},[e]),t}function Tc(){let[e,t]=(0,P.useState)(jc.isHandoffComplete);return e&&!1===jc.isHandoffComplete&&t(!1),(0,P.useEffect)(()=>{!0!==e&&t(!0)},[e]),(0,P.useEffect)(()=>jc.handoff(),[]),e}let Rc=function(e){let t=Cc(e);return P.useCallback((...e)=>t.current(...e),[t])},Ec=Symbol();function Ic(...e){let t=(0,P.useRef)(e);(0,P.useEffect)(()=>{t.current=e},[e]);let s=Rc(e=>{for(let s of t.current)null!=s&&("function"==typeof s?s(e):s.current=e)});return e.every(e=>null==e||(null==e?void 0:e[Ec]))?void 0:s}function Lc(){let e=[],t=[],s={enqueue(e){t.push(e)},addEventListener:(e,t,r,o)=>(e.addEventListener(t,r,o),s.add(()=>e.removeEventListener(t,r,o))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return s.add(()=>cancelAnimationFrame(t))},nextFrame:(...e)=>s.requestAnimationFrame(()=>s.requestAnimationFrame(...e)),setTimeout(...e){let t=setTimeout(...e);return s.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}(()=>{t.current&&e[0]()}),s.add(()=>{t.current=!1})},add:t=>(e.push(t),()=>{let s=e.indexOf(t);if(s>=0){let[t]=e.splice(s,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return s}function Ac(e,...t){e&&t.length>0&&e.classList.add(...t)}function Nc(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Pc(){let[e]=(0,P.useState)(Lc);return(0,P.useEffect)(()=>()=>e.dispose(),[e]),e}function Mc({container:e,direction:t,classes:s,onStart:r,onStop:o}){let n=Sc(),i=Pc(),a=Cc(t);_c(()=>{let t=Lc();i.add(t.dispose);let l=e.current;if(l&&"idle"!==a.current&&n.current)return t.dispose(),r.current(a.current),t.add(function(e,t,s,r){let o=s?"enter":"leave",n=Lc(),i=void 0!==r?function(e){let t={called:!1};return(...s)=>{if(!t.called)return t.called=!0,e(...s)}}(r):()=>{};"enter"===o&&(e.removeAttribute("hidden"),e.style.display="");let a=ic(o,{enter:()=>t.enter,leave:()=>t.leave}),l=ic(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ic(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Nc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ac(e,...a,...c),n.nextFrame(()=>{Nc(e,...c),Ac(e,...l),function(e,t){let s=Lc();if(!e)return s.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[n,i]=[r,o].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t});if(n+i!==0){let r=s.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();s.add(()=>t()),s.dispose}(e,()=>(Nc(e,...a),Ac(e,...t.entered),i()))}),n.dispose}(l,s.current,"enter"===a.current,()=>{t.dispose(),o.current(a.current)})),t.dispose},[t])}function Oc(e=""){return e.split(" ").filter(e=>e.trim().length>1)}let Fc=(0,P.createContext)(null);Fc.displayName="TransitionContext";var Dc,qc=((Dc=qc||{}).Visible="visible",Dc.Hidden="hidden",Dc);let Bc=(0,P.createContext)(null);function $c(e){return"children"in e?$c(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function Uc(e,t){let s=Cc(e),r=(0,P.useRef)([]),o=Sc(),n=Pc(),i=Rc((e,t=dc.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(ic(t,{[dc.Unmount](){r.current.splice(i,1)},[dc.Hidden](){r.current[i].state="hidden"}}),n.microTask(()=>{var e;!$c(r)&&o.current&&(null==(e=s.current)||e.call(s))}))}),a=Rc(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>i(e,dc.Unmount)}),l=(0,P.useRef)([]),c=(0,P.useRef)(Promise.resolve()),d=(0,P.useRef)({enter:[],leave:[],idle:[]}),u=Rc((e,s,r)=>{l.current.splice(0),t&&(t.chains.current[s]=t.chains.current[s].filter(([t])=>t!==e)),null==t||t.chains.current[s].push([e,new Promise(e=>{l.current.push(e)})]),null==t||t.chains.current[s].push([e,new Promise(e=>{Promise.all(d.current[s].map(([e,t])=>t)).then(()=>e())})]),"enter"===s?c.current=c.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(s)):r(s)}),p=Rc((e,t,s)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=l.current.shift())||e()}).then(()=>s(t))});return(0,P.useMemo)(()=>({children:r,register:a,unregister:i,onStart:u,onStop:p,wait:c,chains:d}),[a,i,r,u,p,d,c])}function Wc(){}Bc.displayName="NestingContext";let Hc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Kc(e){var t;let s={};for(let r of Hc)s[r]=null!=(t=e[r])?t:Wc;return s}let Yc=cc.RenderStrategy,zc=mc(function(e,t){let{beforeEnter:s,afterEnter:r,beforeLeave:o,afterLeave:n,enter:i,enterFrom:a,enterTo:l,entered:c,leave:d,leaveFrom:u,leaveTo:p,...h}=e,m=(0,P.useRef)(null),y=Ic(m,t),g=h.unmount?dc.Unmount:dc.Hidden,{show:f,appear:x,initial:w}=function(){let e=(0,P.useContext)(Fc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[b,v]=(0,P.useState)(f?"visible":"hidden"),k=function(){let e=(0,P.useContext)(Bc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:j,unregister:_}=k,S=(0,P.useRef)(null);(0,P.useEffect)(()=>j(m),[j,m]),(0,P.useEffect)(()=>{if(g===dc.Hidden&&m.current)return f&&"visible"!==b?void v("visible"):ic(b,{hidden:()=>_(m),visible:()=>j(m)})},[b,m,j,_,f,g]);let C=Cc({enter:Oc(i),enterFrom:Oc(a),enterTo:Oc(l),entered:Oc(c),leave:Oc(d),leaveFrom:Oc(u),leaveTo:Oc(p)}),T=function(e){let t=(0,P.useRef)(Kc(e));return(0,P.useEffect)(()=>{t.current=Kc(e)},[e]),t}({beforeEnter:s,afterEnter:r,beforeLeave:o,afterLeave:n}),R=Tc();(0,P.useEffect)(()=>{if(R&&"visible"===b&&null===m.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,b,R]);let E=w&&!x,I=!R||E||S.current===f?"idle":f?"enter":"leave",L=Rc(e=>ic(e,{enter:()=>T.current.beforeEnter(),leave:()=>T.current.beforeLeave(),idle:()=>{}})),A=Rc(e=>ic(e,{enter:()=>T.current.afterEnter(),leave:()=>T.current.afterLeave(),idle:()=>{}})),N=Uc(()=>{v("hidden"),_(m)},k);Mc({container:m,classes:C,direction:I,onStart:Cc(e=>{N.onStart(m,e,L)}),onStop:Cc(e=>{N.onStop(m,e,A),"leave"===e&&!$c(N)&&(v("hidden"),_(m))})}),(0,P.useEffect)(()=>{!E||(g===dc.Hidden?S.current=null:S.current=f)},[f,E,b]);let M=h,O={ref:y};return x&&f&&jc.isServer&&(M={...M,className:nc(h.className,...C.current.enter,...C.current.enterFrom)}),P.createElement(Bc.Provider,{value:N},P.createElement(bc,{value:ic(b,{visible:xc.Open,hidden:xc.Closed})},uc({ourProps:O,theirProps:M,defaultTag:"div",features:Yc,visible:"visible"===b,name:"Transition.Child"})))}),Vc=mc(function(e,t){let{show:s,appear:r=!1,unmount:o,...n}=e,i=(0,P.useRef)(null),a=Ic(i,t);Tc();let l=wc();if(void 0===s&&null!==l&&(s=ic(l,{[xc.Open]:!0,[xc.Closed]:!1})),![!0,!1].includes(s))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=(0,P.useState)(s?"visible":"hidden"),u=Uc(()=>{d("hidden")}),[p,h]=(0,P.useState)(!0),m=(0,P.useRef)([s]);_c(()=>{!1!==p&&m.current[m.current.length-1]!==s&&(m.current.push(s),h(!1))},[m,s]);let y=(0,P.useMemo)(()=>({show:s,appear:r,initial:p}),[s,r,p]);(0,P.useEffect)(()=>{if(s)d("visible");else if($c(u)){let e=i.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")},[s,u]);let g={unmount:o};return P.createElement(Bc.Provider,{value:u},P.createElement(Fc.Provider,{value:y},uc({ourProps:{...g,as:P.Fragment,children:P.createElement(zc,{ref:a,...g,...n})},theirProps:{},defaultTag:P.Fragment,features:Yc,visible:"visible"===c,name:"Transition"})))}),Gc=mc(function(e,t){let s=null!==(0,P.useContext)(Fc),r=null!==wc();return P.createElement(P.Fragment,null,!s&&r?P.createElement(Vc,{ref:t,...e}):P.createElement(zc,{ref:t,...e}))}),Xc=Object.assign(Vc,{Child:Gc,Root:Vc});const Zc=()=>(0,f.jsxs)(k.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:_t}),(0,f.jsx)(St,{})]}),Qc=({errorCode:e,errorIdentifier:s="",errorMessage:r="",missingLicenses:o=[],onRetry:n=u.noop})=>{const{onClose:a}=(0,k.useModalContext)();if((0,t.useSelect)(e=>e("yoast-seo/editor").getIsPremium(),[])&&(402===e||429===e&&"USAGE_LIMIT_REACHED"===s)){const e=o.length>0?o:["Yoast SEO Premium"];return(0,f.jsx)(Ze,{invalidSubscriptions:e})}let l;switch(e){case 400:switch(s){case"SITE_UNREACHABLE":l=(0,f.jsx)(Zc,{});break;case"WP_HTTP_REQUEST_ERROR":l=(0,f.jsx)(it,{errorMessage:r});break;default:l=(0,f.jsx)(De,{})}break;case 408:l=(0,f.jsx)(et,{});break;case 429:l=(0,f.jsx)(Ye,{});break;default:l=(0,f.jsx)(De,{})}return(0,f.jsxs)(f.Fragment,{children:[l,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(k.Button,{variant:"secondary",onClick:a,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(k.Button,{variant:"primary",onClick:n,children:(0,i.__)("Try again","wordpress-seo")})]})]})};Qc.propTypes={errorCode:m().number.isRequired,errorIdentifier:m().string,errorMessage:m().string,missingLicenses:m().arrayOf(m().string),onRetry:m().func};var Jc=s(2580),ed=s.n(Jc),td=s(2509),sd=s.n(td),rd=s(8393),od=s.n(rd),nd=s(5011),id=s.n(nd);const ad={informational:{classes:"yst-bg-blue-200 yst-text-blue-900",calloutClasses:"yst-bg-blue-50 yst-border-blue-200",calloutTextClasses:"yst-text-blue-900",Icon:ed(),label:(0,i.__)("Informational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find an answer to a specific question.","wordpress-seo")},navigational:{classes:"yst-bg-violet-200 yst-text-violet-900",calloutClasses:"yst-bg-violet-50 yst-border-violet-200",calloutTextClasses:"yst-text-violet-900",Icon:od(),label:(0,i.__)("Navigational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find a specific page or site.","wordpress-seo")},commercial:{classes:"yst-bg-amber-200 yst-text-amber-900",calloutClasses:"yst-bg-amber-50 yst-border-amber-200",calloutTextClasses:"yst-text-amber-900",Icon:sd(),label:(0,i.__)("Commercial","wordpress-seo"),tooltip:(0,i.__)("The user wants to investigate brands or services.","wordpress-seo")},transactional:{classes:"yst-bg-green-200 yst-text-green-900",calloutClasses:"yst-bg-green-50 yst-border-green-200",calloutTextClasses:"yst-text-green-900",Icon:id(),label:(0,i.__)("Transactional","wordpress-seo"),tooltip:(0,i.__)("The user wants to complete an action (conversion).","wordpress-seo")}},ld=({intent:e,className:t,tooltipPosition:s="top-right",cursor:r="default"})=>{const o=ad[e],i=(0,k.useSvgAria)(),a=`intent-tooltip-${e}-${(0,n.useId)()}`;if(!o)return(0,f.jsx)(k.Badge,{children:e});const{Icon:l}=o,c="pointer"===r?"yst-cursor-pointer":"yst-cursor-default";return(0,f.jsxs)(k.TooltipContainer,{children:[(0,f.jsx)(k.TooltipTrigger,{as:"span",ariaDescribedby:a,className:"yst-inline-flex yst-w-fit",children:(0,f.jsxs)(k.Badge,{className:X()("yst-relative yst-flex yst-items-center yst-gap-1 yst-w-fit",c,o.classes,t),children:[(0,f.jsx)(l,{className:X()("yst-w-3",o.classes),...i})," ",o.label]})}),(0,f.jsx)(k.TooltipWithContext,{id:a,className:"yst-max-w-48 yst-z-50 yst-text-center",position:s,children:o.tooltip})]})},cd=({suggestion:e,onClick:t})=>{const{intent:s,title:r,explanation:o}=e,i=(0,n.useCallback)(()=>t(e),[t,e]);return(0,f.jsxs)("button",{type:"button",onClick:i,className:"hover:yst-bg-slate-50 yst-group yst-text-start yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",children:[(0,f.jsx)(ld,{intent:s,className:"yst-mb-2",cursor:"pointer"}),(0,f.jsx)("div",{className:"yst-font-medium yst-text-sm yst-mb-2 yst-text-slate-800 group-hover:yst-text-slate-900",children:(0,f.jsx)("span",{className:"group-hover:yst-border-b group-hover:yst-border-slate-900",children:r})}),(0,f.jsx)("p",{className:"yst-text-slate-600",children:o})]})},dd=()=>(0,f.jsxs)("div",{className:"yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm",children:[(0,f.jsxs)("div",{className:"yst-px-2 yst-py-1 yst-bg-white yst-inline-flex yst-gap-1 yst-items-center yst-justify-start yst-mb-2 yst-rounded-3xl yst-border yst-border-slate-300",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-2 yst-h-2 yst-rounded-full"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-20 yst-h-3 yst-rounded"})]}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-64 yst-h-[18px] yst-rounded yst-mb-3"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-full yst-h-[13px] yst-rounded yst-mb-2"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-2/3 yst-h-[13px] yst-rounded"})]}),ud=({suggestions:e,onSuggestionClick:t})=>(0,f.jsxs)("div",{children:[(0,f.jsx)(k.Modal.Description,{className:"yst-mb-4",children:(0,i.__)("Select a suggestion to generate a structured outline for your post.","wordpress-seo")}),e.map((e,s)=>(0,f.jsx)(cd,{suggestion:e,onClick:t},`suggestion-${s}`))]}),pd=()=>{const e=(0,k.useSvgAria)(),[t,s]=(0,n.useState)(0),[r,o]=(0,n.useState)(!0),[a,l]=(0,n.useState)(!0),c=[(0,i.__)("Analyzing your site content…","wordpress-seo"),(0,i.__)("Composing your content suggestions…","wordpress-seo"),(0,i.__)("Writing compelling headlines…","wordpress-seo")],d=(0,n.useRef)(null);return(0,n.useEffect)(()=>{const e=setInterval(()=>{o(!1),d.current=setTimeout(()=>{s(e=>(e+1)%c.length),o(!0)},300)},3e3);return()=>{clearInterval(e),clearTimeout(d.current)}},[]),(0,n.useEffect)(()=>{const e=setInterval(()=>{l(e=>!e)},1e3);return()=>clearInterval(e)},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-items-center yst-pb-8",children:[(0,f.jsx)(ta,{className:"yst-w-24 yst-mb-2 yst-mt-6 yst-transition-colors yst-duration-1000 "+(a?"yst-text-primary-300":"yst-text-primary-500"),...e}),(0,f.jsxs)(k.Modal.Description,{className:"yst-italic yst-text-slate-500 yst-transition-opacity yst-duration-300 "+(r?"yst-opacity-100":"yst-opacity-0"),children:[(0,f.jsx)("span",{className:"yst-sr-only",children:" Yoast "}),c[t]]})]}),(0,f.jsxs)("div",{className:"yst-relative",children:[[...Array(5)].map((e,t)=>(0,f.jsx)(dd,{},t)),(0,f.jsx)("div",{className:"yst-absolute yst-inset-0 yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity","aria-hidden":"true"})]})]})},hd=(0,Ht.compose)([(0,t.withSelect)(e=>{const{selectSuggestions:t,selectSuggestionsStatus:s,selectSuggestionsError:r}=e(Ki);return{suggestions:t(),status:s(),error:r()}})])(({status:e,onSuggestionClick:t=u.noop,suggestions:s,error:r,closeButtonRef:o})=>{const i=oc(),a=e===pe,l=e===he;return(0,n.useEffect)(()=>{null!=o&&o.current&&o.current.focus()},[a]),(0,f.jsx)(k.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsxs)("div",{className:"yst-relative","aria-live":"polite",children:[(0,f.jsx)(Xc,{as:"div",show:a,enter:"yst-transition-opacity yst-duration-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300 yst-absolute yst-top-0 yst-left-0 yst-right-0",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(pd,{})}),(0,f.jsx)(Xc,{as:"div",show:l,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(ud,{suggestions:s,onSuggestionClick:t})}),e===me&&(0,f.jsx)(Qc,{errorCode:r.errorCode,errorIdentifier:r.errorIdentifier,errorMessage:r.errorMessage,missingLicenses:r.missingLicenses,onRetry:i})]})})});var md=s(4719),yd=s.n(md);const gd=({intent:e,description:t})=>{const s=ad[e],r=s?s.calloutClasses:"yst-bg-slate-50 yst-border-slate-200",o=s?s.calloutTextClasses:"yst-text-slate-900";return(0,f.jsxs)("div",{role:"note",className:X()("yst-border yst-rounded-md yst-p-4 yst-flex yst-flex-col yst-gap-2",r),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2",children:[(0,f.jsx)(ld,{intent:e,tooltipPosition:"bottom-right"}),(0,f.jsx)("span",{className:X()("yst-font-medium yst-text-sm",o),children:(0,i.__)("Why this content?","wordpress-seo")})]}),(0,f.jsx)("p",{className:X()("yst-text-sm",o),children:t})]})},fd=({children:e,className:t,dragProps:s,buttonProps:r})=>{const o=(0,k.useSvgAria)();return(0,f.jsx)("li",{...s,children:(0,f.jsxs)("button",{type:"button",className:X()("yst-h-10 yst-w-full yst-border yst-rounded-md yst-shadow yst-flex yst-items-center yst-gap-3 yst-px-3 yst-select-none",t),...r,children:[(0,f.jsxs)("svg",{className:"yst-w-2.5 yst-h-4 yst-shrink-0",viewBox:"0 0 10 16",fill:"currentColor",...o,children:[(0,f.jsx)("circle",{cx:"2",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"14",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"14",r:"1.5"})]}),(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-gap-3 yst-flex-1 yst-min-w-0",children:e})]})})},xd=({heading:e,index:t,dragOverIndex:s,onDragStart:r,onDragOver:o,onDrop:a,onDragEnd:l,onMoveUp:c,onMoveDown:d,totalItems:u,onAnnounce:p})=>{const h=(0,n.useCallback)(e=>r(e,t),[r,t]),m=(0,n.useCallback)(e=>o(e,t),[o,t]),y=(0,n.useCallback)(e=>a(e,t),[a,t]),g=(0,n.useCallback)(s=>{s.altKey&&("ArrowUp"===s.key&&t>0&&(s.preventDefault(),c(t),p(e,t)),"ArrowDown"===s.key&&t<u-1&&(s.preventDefault(),d(t),p(e,t+2)))},[t,u,c,d,p,e]),x={draggable:"true",onDragStart:h,onDragOver:m,onDrop:y,onDragEnd:l};return(0,f.jsxs)(fd,{className:X()("yst-bg-slate-50 yst-text-slate-400 yst-border-slate-300 yst-text-sm yst-cursor-grab yst-transition-all focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",s===t&&"yst-border-primary-500 yst-border-2"),buttonProps:{onKeyDown:g},dragProps:x,children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-500",children:"H2"}),(0,f.jsx)("span",{className:"yst-text-slate-600",children:e}),(0,f.jsx)("span",{className:"yst-sr-only",children:(0,i.sprintf)(/* translators: Hidden accessibility text. 1: current position, 2: total items. */ /* translators: Hidden accessibility text. 1: current position, 2: total items. */
(0,i.__)("Position %1$d out of %2$d. Use Alt+Arrow Up/Down to reorder.","wordpress-seo"),t+1,u)})]})},wd=()=>(0,f.jsxs)(fd,{className:"yst-bg-white yst-text-slate-300 yst-border-slate-200",buttonProps:{disabled:!0},dragProps:{"aria-hidden":!0},children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3.5 yst-w-5 yst-rounded yst-shrink-0"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3.5 yst-w-32 yst-rounded"})]}),bd=({categoryName:e,isEnabled:t,isLoading:s})=>s?(0,f.jsx)("div",{className:"yst-inline-flex yst-items-center yst-w-20 yst-h-5 yst-px-2 yst-py-1 yst-rounded-full yst-border yst-border-slate-300",children:(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-16 yst-h-3 yst-rounded"})}):t&&e?(0,f.jsx)(k.Badge,{variant:"plain",className:"yst-w-fit",children:e}):null,vd=({category:e,isEnabled:t=!1,onToggle:s=u.noop,isLoading:r=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-3 yst-max-w-sm yst-mb-6",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-1.5",children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-justify-between",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Suggest category","wordpress-seo")}),(0,f.jsx)(k.Toggle,{id:"suggest-category-toggle",checked:t,onChange:s,disabled:r,screenReaderLabel:(0,i.__)("Suggest category","wordpress-seo")})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Adds post to an existing category, when applicable.","wordpress-seo")})]}),(0,f.jsx)(bd,{categoryName:null==e?void 0:e.name,isEnabled:t,isLoading:r})]}),kd=()=>(0,f.jsxs)("div",{className:"yst-flex yst-items-end yst-justify-between yst-mb-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Blog post structure","wordpress-seo")}),(0,f.jsx)("span",{className:"yst-text-xs yst-text-slate-500",children:(0,i.__)("Drag to reorder","wordpress-seo")})]}),jd=({value:e,date:t="",locale:s,isCornerstone:r})=>{const{actual:o,score:n,max:i}=(0,Gr.getDescriptionProgress)(e,t,r,!1,s),a=Math.min(o/i*100,100);return(0,f.jsx)("div",{className:"yst-w-full yst-h-1.5 yst-bg-slate-200 yst-rounded-full yst-overflow-hidden","aria-hidden":"true",children:(0,f.jsx)("div",{className:"yst-h-full yst-rounded-full yst-transition-all yst-duration-300",style:{width:`${a}%`,backgroundColor:(0,Gr.getProgressColor)(n)}})})},_d=({label:e,multiline:t=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:e}),(0,f.jsx)("div",{className:X()("yst-bg-white yst-border yst-border-slate-300 yst-rounded-md yst-shadow-sm yst-px-3 yst-py-2",t?"yst-min-h-20 yst-flex yst-flex-col yst-gap-1":"yst-h-10 yst-flex yst-items-center"),children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-1/2 yst-h-4 yst-rounded"})]}):(0,f.jsx)(k.SkeletonLoader,{className:"yst-w-1/3 yst-h-4 yst-rounded"})})]}),Sd=()=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(vd,{isLoading:!0}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(_d,{label:(0,i.__)("Focus Keyphrase","wordpress-seo")}),(0,f.jsx)(_d,{label:(0,i.__)("Title","wordpress-seo")}),(0,f.jsx)(_d,{label:(0,i.__)("Meta description","wordpress-seo"),multiline:!0})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(kd,{}),(0,f.jsx)("ul",{"aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Blog post structure","wordpress-seo"),"aria-busy":!0,className:"yst-list-none yst-p-0 yst-m-0 yst-flex yst-flex-col yst-gap-2",children:Array.from({length:4}).map((e,t)=>(0,f.jsx)(wd,{},`structure-row-skeleton-${t}`))})]})]}),Cd=(0,Ht.compose)([(0,t.withSelect)(e=>{const{selectSuggestion:t,selectContentOutline:s,selectContentOutlineStatus:r,selectFeatureModalStatus:o,selectContentOutlineError:n}=e(Ki),{getIsPremium:i}=e("yoast-seo/editor"),{isCornerstoneContent:a,getDateFromSettings:l,getContentLocale:c}=e("yoast-seo/editor");return{suggestion:t(),outline:s(),status:r(),error:n(),isPremium:i(),isActive:o()===Gi,locale:c(),date:l(),isCornerstone:a()}}),(0,t.withDispatch)(e=>{const{setFeatureModalStatus:t,saveOutlineEditsToCache:s,setSuggestion:r}=e(Ki);return{onBackToSuggestions:(e,o)=>{s({id:e.id,structure:o}),r(e),t(Vi)}}})])(({status:e,onBackToSuggestions:s,onApplyOutline:r,suggestion:o,error:a,isCornerstone:l,date:c,locale:d,closeButtonRef:u})=>{const p=e===pe,h=rc(),m=(0,n.useCallback)(()=>h(o),[h,o]),[y,g]=(0,n.useState)(!0),[x,w]=(0,n.useState)(o.keyphrase),[b,v]=(0,n.useState)(o.title),[j,_]=(0,n.useState)(o.meta_description),{structure:S,dragOverIndex:C,reorderMessage:T,handleAnnounce:R,handleDragStart:E,handleDragOver:I,handleDrop:L,handleDragEnd:A,handleMoveUp:N,handleMoveDown:P}=(()=>{const e=(0,t.useSelect)(e=>e(Ki).selectContentOutline(),[]),[s,r]=(0,n.useState)(e),[o,a]=(0,n.useState)(null),[l,c]=(0,n.useState)(""),d=(0,n.useRef)(null),u=(0,n.useCallback)((e,t)=>{c((0,i.sprintf)(/* translators: 1: heading text, 2: new 1-based position, 3: total items. */ /* translators: 1: heading text, 2: new 1-based position, 3: total items. */
(0,i.__)("H2 %1$s moved to position %2$d of %3$d.","wordpress-seo"),e,t,s.length))},[s.length]);(0,n.useEffect)(()=>{r(e),c(""),a(null),d.current=null},[e]);const p=(0,n.useCallback)((e,t)=>{d.current=t,e.dataTransfer.effectAllowed="move"},[]),h=(0,n.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",a(t)},[]),m=(0,n.useCallback)((e,t)=>{e.preventDefault();const s=d.current;null!==s&&s!==t?(r(e=>{const r=[...e],[o]=r.splice(s,1),n=s<t?t-1:t;return r.splice(n,0,o),r}),a(null),d.current=null):a(null)},[]),y=(0,n.useCallback)(()=>{a(null),d.current=null},[]),g=(0,n.useCallback)(e=>{r(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e-1,0,r),s})},[]),f=(0,n.useCallback)(e=>{r(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e+1,0,r),s})},[]);return{structure:s,dragOverIndex:o,reorderMessage:l,handleAnnounce:u,handleDragStart:p,handleDragOver:h,handleDrop:m,handleDragEnd:y,handleMoveUp:g,handleMoveDown:f}})(),M=(0,n.useCallback)(e=>I(e,S.length),[I,S.length]),O=(0,n.useCallback)(e=>L(e,S.length),[L,S.length]);(0,n.useEffect)(()=>{w(o.keyphrase),v(o.title),_(o.meta_description)},[o]),(0,n.useEffect)(()=>{null!=u&&u.current&&u.current.focus()},[p]);const F=(0,n.useCallback)(e=>w(e.target.value),[]),D=(0,n.useCallback)(e=>v(e.target.value),[]),q=(0,n.useCallback)(e=>_(e.target.value),[]),B=(0,n.useCallback)(()=>{g(e=>!e)},[]),$=(0,n.useCallback)(()=>{s({...o,title:b,keyphrase:x,meta_description:j},S)},[s,o,b,x,j,S]),U=(0,n.useCallback)(()=>{r({title:b,metaDescription:j,focusKeyphrase:x,category:y?o.category:{name:"",id:-1},structure:S})},[r,b,j,x,y,o.category,S]),W=Boolean(o.category&&-1!==o.category.id);return e===me?(0,f.jsx)(k.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsx)(Qc,{errorCode:a.errorCode,errorIdentifier:a.errorIdentifier,errorMessage:a.errorMessage,missingLicenses:a.missingLicenses,onRetry:m})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(k.Modal.Container.Content,{className:"yst-overflow-y-auto yst-pt-6 yst-px-6 yst-pb-0 yst-m-0 yst-relative","aria-busy":p,children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-6",children:[(0,f.jsx)(gd,{intent:o.intent,description:o.explanation}),(0,f.jsx)(k.Modal.Description,{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Review and customize your content outline before adding it to your post","wordpress-seo")}),(0,f.jsx)("hr",{className:"yst-border-slate-200"}),(0,f.jsx)(Xc,{as:"div",show:p,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(Sd,{})}),(0,f.jsxs)(Xc,{as:"div",show:!p,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:[W&&(0,f.jsx)(vd,{category:o.category,isEnabled:y,onToggle:B}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(k.TextField,{id:"content-outline-focus-keyphrase",label:(0,i.__)("Focus Keyphrase","wordpress-seo"),value:x,onChange:F}),(0,f.jsx)(k.TextField,{id:"content-outline-title",label:(0,i.__)("Title","wordpress-seo"),value:b,onChange:D}),(0,f.jsxs)("div",{children:[(0,f.jsx)(k.TextareaField,{id:"content-outline-meta-description",label:(0,i.__)("Meta description","wordpress-seo"),value:j,onChange:q,className:"yst-mb-2"}),(0,f.jsx)(jd,{value:j,date:c,locale:d,isCornerstone:l})]})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(kd,{}),(0,f.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:"yst-sr-only",children:T}),(0,f.jsx)("ul",{"aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Blog post structure","wordpress-seo"),className:"yst-flex yst-flex-col yst-gap-2 yst-list-none yst-p-0 yst-m-0",children:S.map((e,t)=>(0,f.jsx)(xd,{index:t,heading:e.heading,dragOverIndex:C,onDragStart:E,onDragOver:I,onDrop:L,onDragEnd:A,onMoveUp:N,onMoveDown:P,totalItems:S.length,onAnnounce:R},e.id))}),(0,f.jsx)("div",{className:"yst-h-8",onDragOver:M,onDrop:O})]})]})]}),(0,f.jsx)("div",{className:X()(p?"yst-sticky":"yst-hidden","-yst-left-6 -yst-right-6 yst-bottom-0 yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity"),"aria-hidden":"true"})]}),(0,f.jsxs)(k.Modal.Container.Footer,{className:"yst-flex yst-items-center yst-justify-between yst-p-6 yst-border-t yst-border-slate-200",children:[(0,f.jsxs)(k.Button,{variant:"secondary",onClick:$,className:"yst-flex yst-items-center yst-gap-1.5",disabled:p,children:[(0,f.jsx)(yd(),{className:"yst-w-4 yst-h-4"}),(0,i.__)("Content suggestions","wordpress-seo")]}),(0,f.jsx)(k.Button,{variant:"ai-primary",onClick:U,className:"[&>.yst-button--sparkles-icon]:yst-hidden yst-ps-3",disabled:p,children:(0,i.__)("Add outline to post","wordpress-seo")})]})]})}),Td="yst-mt-1 yst-mb-3",Rd="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",Ed=({onClose:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:Td,children:(0,i.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,f.jsx)("div",{className:Rd,children:(0,f.jsx)(k.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,i.__)("Got it!","wordpress-seo")})})]}),Id=({onClose:e,upsellLink:t,isWooProductEntity:s=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const o=(0,k.useSvgAria)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:Td,children:(0,i.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
(0,i.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,f.jsxs)("div",{className:Rd,children:[(0,f.jsx)(k.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsxs)(k.Button,{as:"a",size:"small",variant:"upsell",href:t,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r,children:[(0,f.jsx)(R(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...o}),(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
(0,i.__)("Unlock with %1$s","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},Ld=({className:e=""})=>{const{isUsageCountLimitReached:s,usageCount:r,usageCountLimit:o,premiumUpsellLink:a,wooUpsellLink:l,isWooProductEntity:c,hasValidPremiumSubscription:d,hasValidWooSubscription:u}=(0,t.useSelect)(e=>{const t=e(we),s=e(be);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),premiumUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:s.getIsWooProductEntity(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),p=(0,n.useMemo)(()=>d&&!c||c&&u&&d,[d,c,u]),[h,,m,,y]=(0,k.useToggleState)(r===o),g=Math.max(0,o-r);(0,n.useEffect)(()=>{m(p&&r===o||!p&&g<=5)},[r,o,p,s]);const x=(0,n.useMemo)(()=>c?l:a,[c,l,a]),w=(0,n.useMemo)(()=>c&&!u,[c,u]);return h&&(0,f.jsx)(k.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,i.__)("Close","wordpress-seo"),title:p?(0,i.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
(0,i._n)("You've used %s spark this month.","You've used %s sparks this month.",r,"wordpress-seo"),r):g<=5&&!s?(0,i.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
(0,i._n)("%s free spark left!","%s free sparks left!",g,"wordpress-seo"),g):(0,i.__)("You're out of free sparks!","wordpress-seo"),size:p?"default":"large",children:p?(0,f.jsx)(Ed,{onClose:y}):(0,f.jsx)(Id,{onClose:y,upsellLink:x,isWooUpsell:w})})};let Ad,Nd=!1;const Pd="\\–\\-\\(\\)_\\[\\]’‘“”〝〞〟‟„\"'.?!:;,¿¡«»‹›—×+&۔؟،؛。。!‼?⁇⁉⁈‥…・ー、〃〄〆〇〈〉《》「」『』【】〒〓〔〕〖〗〘〙〚〛〜〝〞〟〠〶〼〽{}|~⦅⦆「」、[]・¥$%@&'()*/:;<>\\\<>";Pd.split(""),new RegExp("^["+Pd+"]+"),new RegExp("["+Pd+"]+$");const Md=new RegExp("["+Pd+"#$%&*+/=@^`{|}~ -¿–-⁊ -₠-⃀]","g"),Od=e=>{const t={...e};return""!==e.value||["title","excerpt","excerpt_only"].includes(e.name)||(t.value="%%"+e.name+"%%"),t.badge=`<badge>${e.label}</badge>`,t},Fd={editType:_e,previewType:ve,postType:"post",contentType:Ce},Dd=(0,n.createContext)(Fd),qd=(Dd.Provider,()=>(0,n.useContext)(Dd)),Bd=()=>(0,n.useContext)(c.LocationContext),$d=e=>{const t=(0,n.useRef)(null);return(0,n.useCallback)(s=>{(0,u.attempt)(()=>t.current&&t.current.disconnect()),null!==s&&(t.current=new ResizeObserver(t=>{(0,u.forEach)(t,t=>e(t))}),t.current.observe(s))},[e])},Ud=({errorCode:e,errorIdentifier:t="",isOpen:s=!0,invalidSubscriptions:r=[],showActions:o=!1,onRetry:n=u.noop,errorMessage:i="",onClose:a=u.noop})=>{if("SEO_ANALYSIS_INACTIVE"===t)return(0,f.jsx)(jt,{isOpen:s,onClose:a});if(402===e||429===e&&"USAGE_LIMIT_REACHED"===t)return(0,f.jsx)(kt,{isOpen:s,invalidSubscriptions:r,onClose:a});switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,f.jsx)(wt,{isOpen:s,onClose:a});case"NOT_ENOUGH_CONTENT":return(0,f.jsx)(xt,{isOpen:s,onClose:a});case"SITE_UNREACHABLE":return(0,f.jsx)(Et,{isOpen:s,onClose:a});case"WP_HTTP_REQUEST_ERROR":return(0,f.jsx)(ft,{isOpen:s,errorMessage:i,showActions:o,onRetry:n,onClose:a});default:return(0,f.jsx)(yt,{isOpen:s,showActions:o,onRetry:n,onClose:a})}case 408:return(0,f.jsx)(gt,{isOpen:s,showActions:o,onRetry:n,onClose:a});case 429:return(0,f.jsx)(bt,{isOpen:s,onClose:a});case 410:return(0,f.jsx)(vt,{isOpen:s,onClose:a});default:return(0,f.jsx)(yt,{isOpen:s,showActions:o,onRetry:n,onClose:a})}};Ud.propTypes={errorCode:m().number.isRequired,errorIdentifier:m().string,isOpen:m().bool,invalidSubscriptions:m().arrayOf(m().string),showActions:m().bool,onRetry:m().func,errorMessage:m().string,onClose:m().func};var Wd=s(2863),Hd=s.n(Wd);const Kd=window.yoast.aiFrontend,Yd=window.yoast.reduxJsToolkit,zd="usageCount",Vd="fetchUsageCount",Gd=`${Vd}/${ce}`,Xd=`${Vd}/${de}`,Zd={errorCode:null,errorIdentifier:null,errorMessage:null},Qd=(0,Yd.createSlice)({name:zd,initialState:{status:ue,count:0,limit:10,endpoint:"",error:Zd},reducers:{addUsageCount:(e,{payload:t=1})=>{e.count+=t},setUsageCount:(e,{payload:t})=>{e.count=t},setUsageCountEndpoint:(e,{payload:t})=>{e.endpoint=t},setUsageCountLimit:(e,{payload:t})=>{e.limit=t}},extraReducers:e=>{e.addCase(`${Vd}/${le}`,e=>{e.status=pe,e.error=Zd}),e.addCase(Gd,(e,{payload:t})=>{e.status=he,e.count=t.count,e.limit=t.limit,e.error=Zd}),e.addCase(`${Vd}/${de}`,(e,{payload:t})=>{e.status=me,e.error={errorCode:502,...t}})}}),Jd=(Qd.getInitialState,{selectUsageCountStatus:e=>(0,u.get)(e,[zd,"status"],Qd.getInitialState()),selectUsageCount:e=>(0,u.get)(e,[zd,"count"],Qd.getInitialState().count),selectUsageCountLimit:e=>(0,u.get)(e,[zd,"limit"],Qd.getInitialState().limit),selectUsageCountEndpoint:e=>(0,u.get)(e,[zd,"endpoint"],Qd.getInitialState().endpoint),selectUsageCountError:e=>(0,u.get)(e,[zd,"error"],Qd.getInitialState().error)});Jd.selectUsageCountRemaining=(0,Yd.createSelector)([Jd.selectUsageCount,Jd.selectUsageCountLimit],(e,t)=>Math.max(t-e,0)),Jd.isUsageCountLimitReached=(0,Yd.createSelector)([Jd.selectUsageCount,Jd.selectUsageCountLimit,Jd.selectUsageCountError],(e,t,s)=>429===s.errorCode||e>=t),Qd.actions,Qd.reducer;const eu=({onStartGenerating:e})=>(0,f.jsx)(At,{storeName:we,linkStoreName:be,onConsentGranted:e});eu.propTypes={onStartGenerating:m().func.isRequired};var tu=s(7219),su=s.n(tu);const ru=/(?<start><\/badge>|^(?!<badge>))(?<wrap>[\s\S]+?)(?<end><badge>|$)/g,ou=({total:e,current:t,onNavigate:s,disabled:r=!1,...o})=>(0,f.jsxs)("div",{className:"yst-flex yst-justify-between yst-gap-x-2 yst-items-start",children:[(0,f.jsx)("p",{className:"yst-text-slate-500 yst-text-xxs yst-mt-1",children:(0,i.__)("Text generated by AI may be offensive or inaccurate.","wordpress-seo")}),e>1&&(0,f.jsx)(k.Pagination,{className:"yst-shrink-0",current:t,total:e,onNavigate:s,disabled:r,variant:"text"
/* translators: Hidden accessibility text. */,screenReaderTextPrevious:(0,i.__)("Previous","wordpress-seo")
/* translators: Hidden accessibility text. */,screenReaderTextNext:(0,i.__)("Next","wordpress-seo"),...o})]}),nu=({height:e,onFatalError:s})=>{const[r,o]=(0,n.useState)(""),{onClose:a}=(0,k.useModalContext)(),{editType:l,previewType:c,contentType:d}=qd(),p=(()=>{const{editType:e,previewType:t}=qd();let s="SEO";switch(t){case ke:s="social";break;case je:s="X"}switch(e){case _e:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
(0,i.__)("Generated %s titles","wordpress-seo"),s);case Se:return t===ve&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
(0,i.__)("Generated %s descriptions","wordpress-seo"),s)}})(),h=(()=>{const{editType:e,previewType:t}=qd();let s="SEO";switch(t){case ke:s="social";break;case je:s="X"}switch(e){case _e:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
(0,i.__)("Apply %s title","wordpress-seo"),s);case Se:return t===ve&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
(0,i.__)("Apply %s description","wordpress-seo"),s)}})(),m=Bd(),{suggestions:y,fetchSuggestions:g,setSelectedSuggestion:x}=Pu(),w=Iu(),{addAppliedSuggestion:b,addUsageCount:v}=(0,t.useDispatch)(we),{isUsageCountLimitReached:j,isWooProductEntity:_,hasValidPremiumSubscription:S,hasValidWooSubscription:T}=(0,t.useSelect)(e=>{const t=e(we),s=e(be);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),R=(0,n.useMemo)(()=>y.status===Ie.loading||!(T||!j||!_)||!(S||!j),[S,j,y.status,_,T]),E=(0,k.usePrevious)(e),I=y.status===Ie.success?e:E,{bottom:L}=sc(I),[A,N]=(0,n.useState)(!1),P=(0,n.useCallback)(e=>{N(e.target.offsetHeight!==e.target.scrollHeight)},[N]),M=$d(P),O=Ou(),F=(()=>{const e=(()=>{const{previewType:e}=qd();return(0,n.useMemo)(()=>{switch(e){case ve:return()=>(0,t.select)(be).getSnippetEditorData().description;case ke:return(0,t.select)(be).getFacebookDescriptionOrFallback;case je:return(0,t.select)(be).getTwitterDescriptionOrFallback;default:return(0,u.constant)("")}},[e])})();return(0,n.useMemo)(e,[e])})(),D=(()=>{const e=(0,t.useSelect)(e=>e(be).getReplaceVars(),[]),s=(0,n.useMemo)(()=>e.map(Od),[e]);return(0,n.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:o=!0,editType:n=_e,contentType:i=Ce}={})=>{for(const o of s)e=e.replace(new RegExp("%%"+(0,u.escapeRegExp)(o.name)+"%%","g"),(0,u.get)(r,o.name,o[t]));return i===Te&&(e=e.replace(" Archives","")),o?((e,t=_e)=>{const s=io({title:"",description:"",[t]:Mt.languageProcessing.stripSpaces(e)});return(0,u.get)(s,t,e)})(e,n):e},[s])})(),q=(0,n.useMemo)(()=>l===_e?{[Re[d]]:y.selected}:{},[l,d,y.selected]),B=(0,n.useMemo)(()=>D(O,{overrides:q,contentType:d}),[D,O,l,d,y.selected]),$=(0,n.useMemo)(()=>D(O,{overrides:{...q,sep:"",sitename:""},contentType:d}),[D,O,l,d,y.selected]),U=(0,n.useMemo)(()=>l===Se?y.selected:D(F,{editType:Se}),[D,F,l,y.selected]),W=(0,n.useCallback)(e=>D(O,{overrides:{[Re[d]]:e},key:"badge",applyPluggable:!1,contentType:d}),[D,O,d]),{currentPage:H,setCurrentPage:K,isOnLastPage:Y,totalPages:z,getItemsOnCurrentPage:V}=(({totalItems:e=0,perPage:t=5})=>{const[s,r]=(0,n.useState)(1),o=(0,n.useMemo)(()=>Math.ceil(e/t),[e,t]),i=(0,n.useMemo)(()=>s*t,[s,t]),a=(0,n.useMemo)(()=>i-t,[i,t]),l=(0,n.useMemo)(()=>1===s,[s]),c=(0,n.useMemo)(()=>s===o,[s,o]),d=(0,n.useCallback)(()=>{s>1&&r(s-1)},[s,r]),p=(0,n.useCallback)(()=>{s<o&&r(s+1)},[s,r,o]),h=(0,n.useCallback)(e=>(0,u.slice)(e,a,i),[a,i]);return{currentPage:s,setCurrentPage:r,totalPages:o,isOnFirstPage:l,isOnLastPage:c,previousPage:d,nextPage:p,firstOnPage:a,lastOnPage:i,getItemsOnCurrentPage:h}})({totalItems:y.status===Ie.loading||y.status===Ie.error?y.entities.length+5:y.entities.length,perPage:5}),G=(0,n.useMemo)(()=>(0,u.map)(V(y.entities),e=>{let t=e;return l===_e&&(t=W(e),t=t.replace(ru,(e,t,s,r,o,n,{start:i,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${i}${a}${l}`:`${i}<span>${c}</span>${l}`}),t=C(t,{badge:(0,f.jsx)(k.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,f.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:t}}),[y.entities,V,l,W]),X=(0,n.useMemo)(()=>y.status!==Ie.error||y.status===Ie.error&&!Y,[y.status,Y]),Z=(0,n.useMemo)(()=>y.status===Ie.loading&&Y,[y.status,Y]),Q=(0,n.useMemo)(()=>y.status===Ie.error&&Y,[y.status,Y]),J=(0,n.useCallback)(()=>{R||(K(y.status===Ie.error?z:z+1),g().then(e=>{e===Le&&v()}))},[g,y.status,z,K,x,j]),ee=Lu(),te=La(!0),se=(0,n.useCallback)(()=>{const e=l===_e?O.replace(new RegExp(Ee[d]+"( Archives)?"),y.selected):y.selected;ee(e),b({editType:l,previewType:c,suggestion:y.selected}),a(),"pre-publish"===m&&te()},[ee,l,c,y.selected,O,a,b,te,m]);((e,t=[])=>{const s=(0,n.useRef)(!1);(0,n.useEffect)(()=>{s.current||(s.current=!0,e().finally(()=>{s.current=!1}))},[e,t])})(()=>""===r?g().then(e=>{o(e),e===Le&&v()}):Promise.resolve(),[r,v,g]);const re=r===Ae||y.status===Ie.error&&402===y.error.code;return(0,n.useEffect)(()=>{var e,t,r,o,n,i,a,l;re&&s({errorCode:null!==(e=null===(t=y.error)||void 0===t?void 0:t.code)&&void 0!==e?e:0,errorIdentifier:null!==(r=null===(o=y.error)||void 0===o?void 0:o.errorIdentifier)&&void 0!==r?r:"",invalidSubscriptions:null!==(n=null===(i=y.error)||void 0===i?void 0:i.missingLicenses)&&void 0!==n?n:[],errorMessage:null!==(a=null===(l=y.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[re,y.error,s]),re?null:(0,f.jsxs)(n.Fragment,{children:[(0,f.jsxs)(k.Modal.Container.Content,{ref:M,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,f.jsx)(w,{title:B,description:U,status:y.status,titleForLength:$,showPreviewSkeleton:""===r,showLengthProgress:!Z}),X&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,f.jsx)(k.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:p}),(0,f.jsx)(k.Button,{variant:"ai-secondary",size:"small",onClick:y.status===Ie.loading?u.noop:J,isLoading:y.status===Ie.loading,disabled:R,children:(0,i.__)("Generate 5 more","wordpress-seo")})]}),Z?(0,f.jsx)(_u,{idSuffix:m,suggestionClassNames:l===_e?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ku,{idSuffix:m,suggestions:G,selected:y.selected,onChange:x}),(0,f.jsx)(ou,{current:H,total:z,onNavigate:K,disabled:y.status===Ie.loading||Q})]})]}),Q&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"yst-mt-8"}),(0,f.jsx)(wu,{errorCode:y.error.code,errorIdentifier:y.error.errorIdentifier,invalidSubscriptions:y.error.missingLicenses,errorMessage:y.error.message}),(0,f.jsx)(ou,{current:H,total:z,onNavigate:K,disabled:y.status===Ie.loading})]})]}),(0,f.jsxs)(k.Modal.Container.Footer,{children:[A&&(0,f.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,f.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,f.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,f.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,f.jsx)(k.Button,{variant:"secondary",onClick:a,children:(0,i.__)("Close","wordpress-seo")})}),(0,f.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,f.jsxs)(k.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:se,disabled:""===y.selected||y.status===Ie.loading||Q,children:[(0,f.jsx)(su(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),h]})}),(0,f.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,f.jsx)(k.Button,{variant:"secondary",onClick:a,className:"yst-w-full sm:yst-w-auto",children:(0,i.__)("Close","wordpress-seo")})})]})]}),(0,f.jsxs)(k.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:L},position:"bottom-left",children:[y.status!==Ie.loading&&(0,f.jsx)(Ld,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(y.status===Ie.success||y.status===Ie.loading)&&(0,f.jsx)(Cu,{})]})]})};nu.propTypes={height:m().number.isRequired,onFatalError:m().func.isRequired};const iu=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:s,wooUpsellLink:r,isWooCommerceActive:o,isProductPost:a,learnMoreLink:l,imageLink:c,wistiaEmbedPermissionValue:d,wistiaEmbedPermissionStatus:u,isUsageCountLimitReached:p,activateFreeSparksEndpoint:h}=(0,t.useSelect)(e=>{const t=e(we),s=e(be);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:s.getIsWooCommerceActive(),isProductPost:s.getIsProduct(),learnMoreLink:s.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:s.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:t.isUsageCountLimitReached(),activateFreeSparksEndpoint:t.selectFreeSparksActiveEndpoint()}},[]),{onClose:m,initialFocus:y}=(0,k.useModalContext)(),{title:g,upsellLabel:x,upsellLink:w,ctbId:b,newToText:v}=Fu({premium:s,woo:r}),j=(0,n.useMemo)(()=>o&&a,[o,a]),_=(0,n.useMemo)(()=>({src:c,width:"432",height:"244"}),[c]),{setWistiaEmbedPermission:S}=(0,t.useDispatch)(be),{activateFreeSparks:T}=(0,t.useDispatch)(we),E=(0,n.useMemo)(()=>({value:d,status:u,set:S}),[d,u,S]),L=(0,n.useCallback)(()=>{T({endpoint:h}),e()},[T,h,m,e]),A={a:(0,f.jsx)(Y,{href:l,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,f.jsx)(I(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,f.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,f.jsx)(xe,{videoId:"vmrahpfjxp",thumbnail:_,wistiaEmbedPermission:E}),(0,f.jsx)(k.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,f.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,f.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon"}),v]})})]}),(0,f.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,f.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,f.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:g}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:C(j?(0,i.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
(0,i.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for product titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"):(0,i.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
(0,i.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),A)})]}),p&&(0,f.jsx)(k.Alert,{className:"yst-my-4",children:(0,i.sprintf)(/* translators: %s is for Yoast SEO Premium. */ /* translators: %s is for Yoast SEO Premium. */
(0,i.__)("Oh no! Its seems like you're out of free Sparks. Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),"Yoast SEO Premium")}),(0,f.jsxs)("div",{className:X()("yst-w-full yst-flex yst-flex-col",p?"yst-mt-0":"yst-mt-6"),children:[(0,f.jsxs)(k.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:w,target:"_blank",ref:y,"data-action":"load-nfd-ctb","data-ctb-id":b,children:[(0,f.jsx)(R(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),x,(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!p&&(0,f.jsx)(k.Button,{variant:"ai-secondary",onClick:L,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,i.__)("Try for free","wordpress-seo")})]}),(0,f.jsx)(k.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:m,children:(0,i.__)("Close","wordpress-seo")})]})]})},au=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,panelRef:r,title:o,aiModalHelperLink:n,children:a})=>{const l=(0,k.useSvgAria)();return(0,f.jsx)(k.Modal,{className:"yst-ai-modal",isOpen:e,onClose:t,children:(0,f.jsx)(k.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:s,children:(0,f.jsxs)(k.Modal.Container,{children:[(0,f.jsxs)(k.Modal.Container.Header,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,f.jsx)(k.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:o}),(0,f.jsx)(k.Link,{id:"ai-modal-learn-more",href:n,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener"
/* translators: Hidden accessibility text. */,"aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(Hd(),{...l,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)(k.Badge,{variant:"info",children:(0,i.__)("Beta","wordpress-seo")})]}),(0,f.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),a]})})})},lu=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,children:r})=>(0,f.jsx)(k.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:t,children:(0,f.jsx)(k.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:s,children:r})}),cu={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"};(({onUseAi:e})=>{const[s,r]=(0,n.useState)(cu.inactive),{editType:o,previewType:a}=qd(),l=Bd(),c=(()=>{const{editType:e,previewType:t}=qd();switch(t){case ke:return e===Se?(0,i.__)("AI social description generator","wordpress-seo"):(0,i.__)("AI social title generator","wordpress-seo");case je:return e===Se?(0,i.__)("AI X description generator","wordpress-seo"):(0,i.__)("AI X title generator","wordpress-seo");default:return e===Se?(0,i.__)("AI description generator","wordpress-seo"):(0,i.__)("AI title generator","wordpress-seo")}})(),{hasConsent:d,promptContentInitialized:u,currentSubscriptions:p,usageCountStatus:h,usageCount:m,usageCountLimit:y,usageCountEndpoint:g,hasValidPremiumSubscription:x,hasValidWooSubscription:w,focusKeyphrase:b,isPremium:v,isSeoAnalysisActive:j,aiModalHelperLink:_,isWooProductEntity:S,isFreeSparksActive:C,isWooSeoActive:T}=(0,t.useSelect)(e=>{const t=e(we),s=e(be);return{hasConsent:t.selectHasAiGeneratorConsent(),promptContentInitialized:t.selectPromptContentInitialized(),currentSubscriptions:t.selectProductSubscriptions(),usageCountStatus:t.selectUsageCountStatus(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),usageCountEndpoint:t.selectUsageCountEndpoint(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription(),focusKeyphrase:s.getFocusKeyphrase(),isPremium:s.getIsPremium(),isWooSeoActive:s.getIsWooSeoActive(),isSeoAnalysisActive:s.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:s.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:s.getIsWooProductEntity(),isFreeSparksActive:e(we).selectIsFreeSparksActive()}},[]),{fetchUsageCount:R}=(0,t.useDispatch)(we),{closeEditorModal:E}=(0,t.useDispatch)(be),I=(0,i.__)("Close modal","wordpress-seo"),[L,A]=(0,n.useState)(!1),[N,P]=(0,n.useState)(0),M=(0,n.useCallback)(e=>P(e.borderBoxSize[0].blockSize),[P]),O=$d(M),[F,D]=(0,n.useState)(null),q=(0,n.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const r=(e=>{const s=(0,t.select)(be),r=[];return((e,t)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!t.premiumSubscription)(s,e)&&r.push("Yoast SEO Premium"),((e,t)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!t.wooCommerceSubscription)(s,e)&&r.push("Yoast WooCommerce SEO"),r})(e);return r.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:r,errorMessage:""}:s?(()=>{var e,s;const r=(0,t.select)(we);if(r.selectUsageCountStatus()!==me)return null;const o=r.selectUsageCountError();return{errorCode:o.errorCode,errorIdentifier:null!==(e=o.errorIdentifier)&&void 0!==e?e:"",invalidSubscriptions:[],errorMessage:null!==(s=o.errorMessage)&&void 0!==s?s:""}})():{errorCode:0,errorIdentifier:"SEO_ANALYSIS_INACTIVE",invalidSubscriptions:[],errorMessage:""}},[]),B=(0,n.useCallback)(()=>{r(cu.inactive)},[]),$=(0,n.useCallback)(()=>D(null),[]),U=(0,n.useCallback)(()=>{D(null),r(cu.generate)},[]),W=(0,n.useCallback)(()=>{D(q({currentSubscriptions:p,isSeoAnalysisActive:j})),r(cu.inactive)},[q,p,j]),H=(0,n.useCallback)(e=>{D(e),r(cu.inactive)},[]),K={onClose:B,closeButtonScreenReaderText:I},Y=(0,n.useCallback)(()=>!(0===b.replace(Md,"").trim().length),[b]),z=La(!1),V=(0,n.useCallback)(()=>{E(),"pre-publish"===l&&z(),setTimeout(()=>(e=>{const t=`focus-keyword-input-${["modal","pre-publish"].includes(e)?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(l),0)},[E,l,z]),G=(0,n.useCallback)(()=>S?w&&x:x,[x,w,S]),X=(0,n.useCallback)(async()=>{if(e(),!j)return void W();if(!Y())return r(cu.inactive),void V();const t=G();if(!t&&v&&T&&S)return void W();if(!t&&v&&!S)return void W();if(!d&&(C||t))return void r(cu.askConsent);A(!0);const{type:s,payload:o}=await R({endpoint:g,isWooProductEntity:S}),n=429===(null==o?void 0:o.errorCode)&&!(null!=o&&o.errorIdentifier)&&0===(null==o?void 0:o.missingLicenses.length),i=429===(null==o?void 0:o.errorCode)&&"USAGE_LIMIT_REACHED"===(null==o?void 0:o.errorIdentifier)||o.count>=o.limit;A(!1),n?W():403!==(null==o?void 0:o.errorCode)||!C&&!t?s!==Xd||429===(null==o?void 0:o.errorCode)||403===(null==o?void 0:o.errorCode)?s===Xd&&429===(null==o?void 0:o.errorCode)&&t?W():!t&&!C||!t&&i?r(cu.upsell):(t&&d&&r(cu.generate),!t&&C&&!i&&d&&r(cu.generate)):W():r(cu.askConsent)},[e,v,C,d,j,Y,V,W,g,R,T,S,L]),Z=(0,n.useCallback)(async()=>{const{type:e,payload:t}=await R({endpoint:g,isWooProductEntity:S}),s=429===(null==t?void 0:t.errorCode)||t.count>=t.limit,o=G();!s||o?e!==Xd?r(cu.generate):W():r(cu.upsell)},[r,W,g,R,G,S]),Q=(0,n.useCallback)(()=>{r(d?cu.generate:cu.askConsent)},[r,d]),J=(0,n.useMemo)(()=>"google"===a?"title"===o?(0,i.__)("Generate SEO title","wordpress-seo"):(0,i.__)("Generate meta description","wordpress-seo"):"social"===a||"twitter"===a?"title"===o?(0,i.__)("Generate social title","wordpress-seo"):(0,i.__)("Generate social description","wordpress-seo"):void 0,[a,o]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(k.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${o}__${l}`,onClick:X,disabled:h===pe||!u,isLoading:L&&h===pe,children:J}),(0,f.jsxs)(lu,{...K,isOpen:[cu.askConsent,cu.upsell].includes(s),children:[s===cu.askConsent&&(0,f.jsx)(eu,{onStartGenerating:Z}),s===cu.upsell&&(0,f.jsx)(iu,{onActivateFreeSparks:Q})]}),(0,f.jsx)(au,{...K,isOpen:s===cu.generate,aiModalHelperLink:_,panelRef:O,title:c,children:s===cu.generate&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kd.UsageCounter,{limit:y,requests:m,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:v,mentionResetInTooltip:v}),(0,f.jsx)(nu,{height:N,onFatalError:H})]})}),F&&(0,f.jsx)(Ud,{isOpen:!0,errorCode:F.errorCode,errorIdentifier:F.errorIdentifier,invalidSubscriptions:F.invalidSubscriptions,errorMessage:F.errorMessage,showActions:!0,onRetry:U,onClose:$})]})}).propTypes={onUseAi:m().func.isRequired};const du=({title:e,description:s,status:r,titleForLength:o,showPreviewSkeleton:a,showLengthProgress:l})=>{const c=(0,t.useSelect)(e=>e(be).getSnippetEditorMode(),[]),[d,u]=(0,n.useState)(c),{editType:p}=qd(),h=Bd(),m=Mu({editType:p,title:o,description:s});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Gr.ModeSwitcher,{onChange:u,active:d,id:`yst-ai-google-preview-mode-switcher-${h}`,disabled:r===Ie.loading}),a?(0,f.jsx)(hu,{}):(0,f.jsx)(pu,{mode:d,title:e,description:s}),(0,f.jsxs)("div",{className:"yst-pt-4",children:[(0,f.jsx)(k.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:p===_e?(0,i.__)("SEO title width","wordpress-seo"):(0,i.__)("Meta description length","wordpress-seo")}),(0,f.jsx)(mu,{className:"yst-mt-2",progress:l?m.actual:0,min:0,max:m.max,score:m.score})]})]})};du.propTypes={title:m().string.isRequired,description:m().string.isRequired,status:m().oneOf(Object.keys(Ie)).isRequired,titleForLength:m().string.isRequired,showPreviewSkeleton:m().bool.isRequired,showLengthProgress:m().bool.isRequired};const uu=/mobi/i,pu=({mode:e,title:s,description:r})=>{var o,i;const a=(0,t.useSelect)(e=>e(be).getBaseUrlFromSettings(),[]),l=(0,t.useSelect)(e=>e(be).getSnippetEditorData().slug||"",[]),c=(0,t.useSelect)(e=>e(be).getDateFromSettings(),[]),d=(0,t.useSelect)(e=>e(be).getFocusKeyphrase(),[]),p=(0,t.useSelect)(e=>e(be).getSnippetEditorPreviewImageUrl(),[]),h=(0,t.useSelect)(e=>e(be).getSiteIconUrlFromSettings(),[]),m=(0,t.useSelect)(e=>e(be).getShoppingData(),[]),y=(0,t.useSelect)(e=>e(be).getSnippetEditorWordsToHighlight(),[]),g=(0,t.useSelect)(e=>e(be).getSiteName(),[]),x=(0,t.useSelect)(e=>e(be).getContentLocale(),[]),w=(0,n.useMemo)(()=>a+l,[a,l]),b=(0,n.useMemo)(()=>{var e,t;return uu.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)},[null===(o=window)||void 0===o||null===(i=o.navigator)||void 0===i?void 0:i.userAgent]);return(0,f.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${b?" yst-user-agent__mobile":""}`,children:(0,f.jsx)(Gr.SnippetPreview,{title:s,description:r,mode:e,url:w,keyword:d,date:c,faviconSrc:h,mobileImageSrc:p,wordsToHighlight:y,siteName:g,locale:x,shoppingData:m,onMouseUp:u.noop})})};pu.propTypes={mode:m().oneOf(Object.keys({mobile:"mobile",desktop:"desktop"})).isRequired,title:m().string.isRequired,description:m().string.isRequired};const hu=()=>(0,f.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,f.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),mu=({className:e="",progress:t,max:s,score:r})=>{const o=(0,n.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(r),[r]);return(0,f.jsx)(k.ProgressBar,{className:X()("yst-length-progress-bar",o,e),progress:t,min:0,max:s})};mu.propTypes={className:m().string,progress:m().number.isRequired,max:m().number.isRequired,score:m().number.isRequired};const yu=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(k.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("Social preview","wordpress-seo")})}),s?(0,f.jsx)(fu,{}):(0,f.jsx)(gu,{title:e,description:t})]});yu.propTypes={title:m().string.isRequired,description:m().string.isRequired,showPreviewSkeleton:m().bool.isRequired};const gu=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(be).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(be).getFacebookImageUrl(),[]),n=(0,t.useSelect)(e=>e(be).getEditorDataImageFallback(),[]),i=(0,t.useSelect)(e=>e(be).getFacebookAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(wn,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:n,alt:i,onSelect:u.noop,onImageClick:u.noop,onMouseHover:u.noop})})};gu.propTypes={title:m().string.isRequired,description:m().string.isRequired};const fu=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),xu=({children:e,onRetry:t})=>{const{onClose:s}=(0,k.useModalContext)();return(0,f.jsxs)(n.Fragment,{children:[e,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(k.Button,{variant:"secondary",onClick:s,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(k.Button,{variant:"primary",onClick:t,children:(0,i.__)("Try again","wordpress-seo")})]})]})};xu.propTypes={children:m().node.isRequired,onRetry:m().func.isRequired};const wu=({errorCode:e,errorIdentifier:t,invalidSubscriptions:s=[],showActions:r=!1,onRetry:o=u.noop,errorMessage:n=""})=>{switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,f.jsx)(rt,{});case"NOT_ENOUGH_CONTENT":return(0,f.jsx)($e,{});case"SITE_UNREACHABLE":return(0,f.jsx)(Zc,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,f.jsx)(xu,{onRetry:o,children:(0,f.jsx)(it,{errorMessage:n})}):(0,f.jsx)(it,{errorMessage:n});default:return r?(0,f.jsx)(xu,{onRetry:o,children:(0,f.jsx)(De,{})}):(0,f.jsx)(De,{})}case 402:return(0,f.jsx)(Ze,{invalidSubscriptions:s});case 408:return r?(0,f.jsx)(xu,{onRetry:o,children:(0,f.jsx)(et,{})}):(0,f.jsx)(et,{});case 429:return"USAGE_LIMIT_REACHED"===t?(0,f.jsx)(Ze,{invalidSubscriptions:s}):(0,f.jsx)(Ye,{});case 410:return(0,f.jsx)(ct,{});default:return r?(0,f.jsx)(xu,{onRetry:o,children:(0,f.jsx)(De,{})}):(0,f.jsx)(De,{})}};wu.propTypes={errorCode:m().number.isRequired,errorIdentifier:m().string.isRequired,invalidSubscriptions:m().array,showActions:m().bool,onRetry:m().func,errorMessage:m().string};const bu=m().shape({value:m().string.isRequired,label:m().node.isRequired}),vu=({id:e,name:t,suggestion:s,isChecked:r,onChange:o})=>{const i=(0,n.useCallback)(()=>o(s.value),[s,o]);return(0,f.jsxs)("label",{htmlFor:e,className:X()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",r&&"yst-z-10 yst-border-primary-500"),children:[(0,f.jsx)("input",{type:"radio",id:e,name:t,className:"yst-radio__input",value:s.value,checked:r,onChange:i}),(0,f.jsx)("div",{className:X()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!r&&"yst-text-slate-600"),children:s.label})]})};vu.propTypes={id:m().string.isRequired,name:m().string.isRequired,suggestion:bu.isRequired,isChecked:m().bool.isRequired,onChange:m().func.isRequired};const ku=({idSuffix:e,suggestions:t,selected:s,onChange:r})=>(0,f.jsx)("div",{children:(0,f.jsx)(k.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:t.map((t,o)=>(0,f.jsx)(vu,{id:`yst-ai-suggestions-radio-${e}__${o}`,name:`ai-suggestion__${e}`,isChecked:t.value===s,onChange:r,suggestion:t},`yst-ai-suggestions-radio-${e}__${o}`))})});ku.propTypes={idSuffix:m().string.isRequired,suggestions:m().arrayOf(bu).isRequired,selected:m().string.isRequired,onChange:m().func.isRequired};const ju=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],_u=({suggestionClassNames:e=ju})=>(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,t)=>(0,f.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,f.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,s)=>(0,f.jsx)(k.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${t}__${s}`))})]},`yst-ai-suggestion-radio-skeleton__${t}`))});_u.propTypes={suggestionClassNames:m().arrayOf(m().arrayOf(m().string))};const Su="ai_generator_tip_notification",Cu=()=>{const e=(0,t.useSelect)(e=>e(be).isAlertDismissed(Su),[]),s=(0,t.useSelect)(e=>e(be).getEditorDataContent(),[]),r=(0,t.useSelect)(e=>e(be).getIsWooProductEntity(),[]),[o,,,a]=(0,k.useToggleState)(!1),{editType:l,contentType:c}=qd(),{dismissAlert:d}=(0,t.useDispatch)(be),u=(0,n.useCallback)(()=>{d(Su)},[d]),p=(0,n.useMemo)(()=>l===Se?(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo")
/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[l]),h=(0,n.useMemo)(()=>((e,t)=>e||t===Te?150:300)(r,c),[c,r]),m=(0,n.useMemo)(()=>(e=>Mt.languageProcessing.sanitizeString(e||"").length)(s),[s]);return e||o||m>h?null:(0,f.jsxs)(k.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,i.__)("Dismiss","wordpress-seo"),children:[C((0,i.sprintf)(p,"<span>","</span>"),{span:(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,f.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,f.jsx)(k.Button,{type:"button",variant:"tertiary",onClick:u,children:(0,i.__)("Don’t show again","wordpress-seo")}),(0,f.jsx)(k.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:a,children:(0,i.__)("Dismiss","wordpress-seo")})]})]})},Tu=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(k.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("X preview","wordpress-seo")})}),s?(0,f.jsx)(Eu,{}):(0,f.jsx)(Ru,{title:e,description:t})]});Tu.propTypes={title:m().string.isRequired,description:m().string.isRequired,showPreviewSkeleton:m().bool.isRequired};const Ru=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(be).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(be).getTwitterImageUrl(),[]),n=(0,t.useSelect)(e=>e(be).getFacebookImageUrl(),[]),i=(0,t.useSelect)(e=>e(be).getEditorDataImageFallback(),[]),a=(0,t.useSelect)(e=>e(be).getTwitterImageType(),[]),l=(0,t.useSelect)(e=>e(be).getTwitterAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(On,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:n||i,isLarge:"summary"!==a,alt:l,onSelect:u.noop,onImageClick:u.noop,onMouseHover:u.noop})})};Ru.propTypes={title:m().string.isRequired,description:m().string.isRequired};const Eu=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(k.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]});m().number.isRequired,m().string,m().string,m().object.isRequired,m().bool;const Iu=()=>{const{previewType:e}=qd();switch(e){case ke:return yu;case je:return Tu;default:return du}},Lu=()=>{const{editType:e}=qd();switch(e){case _e:return(()=>{const{previewType:e}=qd(),{updateData:s,setFacebookPreviewTitle:r,setTwitterPreviewTitle:o}=(0,t.useDispatch)(be);return(0,n.useMemo)(()=>{switch(e){case ve:return e=>s({title:e});case ke:return r;case je:return o;default:return u.noop}},[e,s,r,o])})();case Se:return(()=>{const{previewType:e}=qd(),{updateData:s,setFacebookPreviewDescription:r,setTwitterPreviewDescription:o}=(0,t.useDispatch)(be);return(0,n.useMemo)(()=>{switch(e){case ve:return e=>s({description:e});case ke:return r;case je:return o;default:return u.noop}},[e,s,r,o])})();default:return u.noop}},Au=(0,Yd.createSlice)({name:"suggestions",initialState:{status:Ie.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=Ie.loading},setSuccess:(e,{payload:t})=>{e.status=Ie.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=Ie.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),Nu=e=>{switch(e){case ke:return"Facebook";case je:return"Twitter";default:return"Google"}},Pu=()=>{const[e,s]=(0,n.useReducer)(Au.reducer,Au.getInitialState()),{editType:r,previewType:o,postType:i,contentType:a}=qd(),l=(0,t.useSelect)(e=>e(we).selectPromptContent(),[]),c=(0,t.useSelect)(e=>e(we).selectGetSuggestionsEndpoint(),[]),{contentLocale:d,focusKeyphrase:p,isWooCommerceActive:h,isGutenberg:m,isElementor:y}=(0,t.useSelect)(e=>({contentLocale:e(be).getContentLocale(),focusKeyphrase:e(be).getFocusKeyphrase(),isWooCommerceActive:e(be).getIsWooCommerceActive(),isGutenberg:e(be).getIsBlockEditor(),isElementor:e(be).getIsElementorEditor()}),[]);let g,f=Mt.languageProcessing.helpers.processExactMatchRequest(p).keyphrase;f.length>191&&(f=f.slice(0,191)),g=y?"elementor":m?"gutenberg":"classic";const x=((e,t,s,r)=>{const o=e===Se?"meta-description":"seo-title";let n=((e,t)=>{if(e)switch(t){case"product":return"product-";case"product_cat":case"product_tag":return"product-taxonomy-"}return""})(t,s);return n&&t||r!==Te||(n="taxonomy-"),`${n}${o}`})(r,h,i,a);return{suggestions:e,fetchSuggestions:(0,n.useCallback)(async(e=!0)=>{s(Au.actions.setLoading());const{status:t,payload:r}=await(async({endpoint:e,data:t})=>{let s;const r=1e3*(0,u.get)(window,"wpseoAiGenerator.requestTimeout",30);try{Ad&&Ad.abort(),Ad=new AbortController,Nd=!1,s=setTimeout(()=>{Nd=!0,Ad.abort()},r);const o=await Ve()({path:e,method:"POST",data:t,parse:!1,signal:Ad.signal}),n=await o.json();return{status:Le,payload:n}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return Nd?{status:Ae,payload:{message:"timeout",code:408}}:{status:Ne};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:Ae,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}})({endpoint:c,canAbort:e,data:{type:x,prompt_content:l,focus_keyphrase:f,platform:Nu(o),language:tc(d).replace("_","-"),editor:g}});switch(t){case Ne:break;case Ae:s(Au.actions.setError(r));break;case Le:s(Au.actions.setSuccess(r))}return t},[s]),setSelectedSuggestion:(0,n.useCallback)(e=>s(Au.actions.setSelected(e)),[s])}},Mu=({editType:e,title:s,description:r})=>{const o=(0,t.useSelect)(e=>e(be).getDateFromSettings(),[]),i=(0,t.useSelect)(e=>e(be).getContentLocale(),[]),a=(0,t.useSelect)(e=>e(be).isCornerstoneContent(),[]),l=(0,t.useSelect)(e=>e(be).getIsTerm(),[]);return(0,n.useMemo)(()=>e===Se?(0,Gr.getDescriptionProgress)(r,o,a,l,i):(0,Gr.getTitleProgress)(s),[e,s,r,o,a,l,i])},Ou=()=>{const{editType:e,previewType:s,contentType:r}=qd(),o=(()=>{const{previewType:e}=qd();return(0,n.useMemo)(()=>{switch(e){case ve:return()=>(0,t.select)(be).getSnippetEditorData().title;case ke:return(0,t.select)(be).getFacebookTitleOrFallback;case je:return(0,t.select)(be).getTwitterTitleOrFallback;default:return(0,u.constant)("")}},[e])})(),i=(0,t.useSelect)(t=>t(we).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,n.useMemo)(()=>{let t=o();return e===Se?t:(i&&(t=t.replace(i,Ee[r])),((e,t)=>e.includes(Ee[t])?e:Ee[t])(t,r))},[e,o])},Fu=e=>{const{isWooProductEntity:s,isProductPost:r,hasValidWooSubscription:o}=(0,t.useSelect)(e=>{var t;const s=e(be),r=e(we);return{isWooProductEntity:s.getIsWooProductEntity(),isProductPost:s.getIsProduct(),hasValidWooSubscription:null!==(t=null==r?void 0:r.selectWooCommerceSubscription())&&void 0!==t&&t}},[]);return(0,n.useMemo)(()=>{const t={upsellLink:e.premium,upsellLabel:(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,i.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return s&&(r&&(t.title=(0,i.__)("Generate product titles & descriptions with AI!","wordpress-seo")),o||(t.newToText="Yoast WooCommerce SEO",t.upsellLabel=(0,i.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),t.upsellLink=e.woo,t.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),t},[s,r,e.premium,e.woo])},Du=({onConfirm:e,isOpen:t,onClose:s})=>{const r=(0,k.useSvgAria)();return(0,f.jsx)(k.Modal,{isOpen:t,onClose:s,className:"yst-flex yst-items-center yst-justify-center",children:(0,f.jsxs)(k.Modal.Panel,{closeButtonScreenReaderText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close replace content confirmation","wordpress-seo"),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-start",children:[(0,f.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,f.jsx)(te(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...r})}),(0,f.jsxs)("div",{className:"yst-ms-4 yst-text-start",children:[(0,f.jsx)(k.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3",children:(0,i.__)("Replace existing content with this outline?","wordpress-seo")}),(0,f.jsx)(k.Modal.Description,{className:"yst-text-sm yst-text-slate-500",children:(0,i.__)("This will replace everything in your post with the generated outline and content notes. You can revert this action by clicking the 'undo' button in the Gutenberg editor.","wordpress-seo")})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-row yst-justify-end yst-gap-3 yst-mt-6",children:[(0,f.jsx)(k.Button,{type:"button",variant:"secondary",onClick:s,children:(0,i.__)("Cancel","wordpress-seo")}),(0,f.jsx)(k.Button,{type:"button",variant:"error",onClick:e,children:(0,i.__)("Replace content","wordpress-seo")})]})]})})},qu=(0,Ht.compose)([(0,t.withSelect)(e=>{const{selectFeatureModalStatus:t,selectSuggestionsStatus:s,selectContentOutlineStatus:r}=e(Ki),o=e("core/editor").getEditedPostContent(),{getIsPremium:n,selectLink:i}=e("yoast-seo/editor"),{selectUsageCount:a,selectUsageCountLimit:l,selectUsageCountStatus:c}=e(we);return{isEmptyPost:0===(0,Xl.count)(o,"words",{}),isPremium:n(),status:t(),modalHelpLink:i("https://yoa.st/ai-content-planner-help-button-modal"),usageCount:a(),usageCountLimit:l(),contentSuggestionsStatus:s(),contentOutlineStatus:r(),usageCountStatus:c()}}),(0,t.withDispatch)(e=>{const{closeModal:t}=e(Ki);return{onClose:t}})])(({onClose:e,isEmptyPost:t,isPremium:s,status:r,modalHelpLink:o,usageCount:a,usageCountLimit:l,contentSuggestionsStatus:c,contentOutlineStatus:d,usageCountStatus:u,openReplaceContentModal:p,setHasVisitedReplace:h,editedOutlineRef:m,handleApplyOutline:y,isReplaceModalOpen:g=!1,onCloseReplace:x})=>{const w=rc(),b=r===zi,v=(0,k.useSvgAria)(),j=(0,n.useRef)(null),_=r===Vi,S=c===me,C=r===Gi,T=d===me,[R,E]=(0,n.useState)(0),I=(0,n.useCallback)(e=>E(e.borderBoxSize[0].blockSize),[E]),L=$d(I),{bottom:A}=sc(R),N=(0,n.useCallback)(e=>{w(e)},[w]),P=(0,n.useCallback)(e=>{m.current=e,t?y():(h(!0),p())},[t,y,p,h]),M=/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close content suggestions modal","wordpress-seo"),O=/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close content outline modal","wordpress-seo");return(0,f.jsx)(k.Modal,{isOpen:!b&&(_||C),onClose:e,children:(0,f.jsxs)(k.Modal.Panel,{ref:L,className:"yst-p-0 yst-max-w-2xl yst-overflow-visible",hasCloseButton:!1,children:[(0,f.jsx)(k.Modal.CloseButton,{ref:j,screenReaderText:_?M:O}),(0,f.jsxs)(k.Modal.Container,{children:[(0,f.jsxs)(k.Modal.Container.Header,{className:"yst-flex yst-items-center yst-gap-2 yst-pe-14 yst-py-6 yst-ps-6 yst-border-b yst-border-slate-200",children:[(0,f.jsx)(rs,{className:"yst-fill-primary-500 yst-w-4 yst-mb-[1px]",...v}),(0,f.jsx)(k.Modal.Title,{size:"2",children:_?(0,i.__)("Content suggestions","wordpress-seo"):(0,i.__)("Content outline","wordpress-seo")}),(0,f.jsx)(k.Link,{href:o,variant:"primary",className:"yst-no-underline",target:"_blank",rel:"noopener noreferrer","aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(Hd(),{...v,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)("span",{className:"yst-flex-grow"}),(0,f.jsx)(k.Badge,{size:"small",children:(0,i.__)("Beta","wordpress-seo")}),(_&&!S||C&&!T)&&(0,f.jsx)(Kd.UsageCounter,{className:"yst-relative yst-flex yst-items-center",limit:l,requests:a,mentionBetaInTooltip:s,mentionResetInTooltip:s,isSkeleton:c===pe||u===pe})]}),_&&(0,f.jsx)(hd,{onSuggestionClick:N,closeButtonRef:j}),C&&(0,f.jsx)(Cd,{onApplyOutline:P,closeButtonRef:j})]}),(0,f.jsx)(k.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:A},position:"bottom-left",children:c===he&&!T&&(0,f.jsx)(Ld,{})}),(0,f.jsx)(Du,{isOpen:g,onConfirm:y,onClose:x})]})})}),Bu=({hasConsent:e})=>{const s=(0,t.useSelect)(e=>e(Ki).selectFeatureModalStatus(),[]),{setFeatureModalStatus:r,closeModal:o}=(0,t.useDispatch)(Ki),[a,l]=(0,n.useState)(!1),[c,d,,u]=(0,k.useToggleState)(!1),p=(0,n.useRef)(null),h=(({editedOutlineRef:e})=>{const{editPost:s}=(0,t.useDispatch)("core/editor"),{closeModal:r,setBannerDismissed:o}=(0,t.useDispatch)(Ki);return(0,n.useCallback)(()=>{var n;const i=e.current,a=(0,t.select)(Ki).selectContentOutline(),l=(0,t.select)(Ki).selectSuggestion(),c=i?{title:i.title,metaDescription:i.metaDescription,focusKeyphrase:i.focusKeyphrase,category:i.category}:{title:l.title,metaDescription:l.meta_description,focusKeyphrase:l.keyphrase,category:l.category},d=i?i.structure:a,u={title:c.title,blocks:Jl(d),meta:{[re]:c.title,[oe]:c.metaDescription,[ne]:c.focusKeyphrase}};null!==(n=c.category)&&void 0!==n&&n.id&&-1!==c.category.id&&(u.categories=[c.category.id]),s(u),o(),r()},[s,r,o])})({editedOutlineRef:p}),m=oc(),y=s===zi,g=(0,n.useCallback)(()=>{e?m():r(zi)},[e,r,m]);(0,n.useEffect)(()=>{s||l(!1)},[s]);const x=c&&a;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ql,{onClick:g}),(0,f.jsx)(qu,{editedOutlineRef:p,handleApplyOutline:h,openReplaceContentModal:u,setHasVisitedReplace:l,isReplaceModalOpen:x,onCloseReplace:d}),(0,f.jsx)(k.Modal,{isOpen:y,onClose:o,className:"yst-introduction-modal",children:(0,f.jsx)(k.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Close modal","wordpress-seo"),children:(0,f.jsx)(At,{storeName:we,linkStoreName:be,onConsentGranted:m})})})]})},$u=window.wp.blockEditor;var Uu=s(6883),Wu=s.n(Uu),Hu=s(2127),Ku=s.n(Hu);const Yu=({contentNotes:e})=>{const t=(0,k.useSvgAria)();return(0,f.jsxs)("div",{className:"yst-bg-slate-50 yst-font-sans yst-rounded-sm yst-shadow-sm yst-border yst-border-solid yst-border-slate-200 yst-p-4",children:[(0,f.jsxs)("div",{className:"yst-text-slate-500 yst-text-xs yst-flex yst-items-center yst-mb-4",children:[(0,f.jsx)(Wu(),{className:"yst-inline-block yst-w-3 yst-h-3 yst-me-1 yst-shrink-0",...t}),(0,f.jsx)("span",{className:"yst-text-xs yst-leading-3",children:(0,i.__)("Only visible to you","wordpress-seo")})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"yst-flex yst-justify-start yst-items-center yst-gap-2 yst-mb-1 yst-ps-4",children:[(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-justify-center yst-w-4 yst-h-4 yst-bg-ai-500 yst-rounded-[1.5px]",children:(0,f.jsx)(Ku(),{className:"yst-w-3 yst-h-3 yst-shrink-0 yst-text-white yst-flex yst-items-center yst-justify-center",...t})}),(0,f.jsx)("h3",{className:"yst-text-slate-800 yst-text-sm yst-leading-5 yst-font-medium yst-m-0",children:(0,i.__)("Content notes","wordpress-seo")})]}),e.length>0&&(0,f.jsx)("ul",{className:"yst-text-sm yst-text-slate-600 yst-font-normal yst-my-0 yst-ps-5 yst-leading-5 yst-list-none",children:e.map((e,t)=>(0,f.jsxs)("li",{className:"yst-flex yst-justify-start yst-gap-2",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"•"}),e]},`${t}-${e}`))})]})]})};(0,e.getBlockType)("yoast-seo/content-suggestion")||(0,e.registerBlockType)("yoast-seo/content-suggestion",{apiVersion:3,title:(0,i.__)("Content Suggestion","wordpress-seo"),category:"text",supports:{inserter:!1},transforms:{to:[{type:"block",blocks:["core/list"],transform:({suggestions:t})=>(0,e.createBlock)("core/list",{},t.map(t=>(0,e.createBlock)("core/list-item",{content:t})))}]},attributes:{title:{type:"string",default:""},suggestions:{type:"array",items:{type:"string"},default:[]}},edit:({attributes:e})=>{const t=(0,n.useRef)(null),s=(0,$u.useBlockProps)({ref:t});return(0,n.useEffect)(()=>{var e,s;const r=null!==(e=null===(s=t.current)||void 0===s?void 0:s.ownerDocument)&&void 0!==e?e:document;if(r===window.document||r.getElementById("yoast-seo-tailwind-css"))return;const o=window.document.getElementById("yoast-seo-tailwind-css");if(!o)return;const n=r.createElement("link");n.id="yoast-seo-tailwind-css",n.rel="stylesheet",n.href=o.href,r.head.appendChild(n)},[]),(0,f.jsx)("div",{...s,children:(0,f.jsx)(Yu,{contentNotes:e.suggestions})})},save:()=>null});const zu=e=>{const t=document.getElementById(e);t&&(t.value="1")},Vu=()=>{const e=document.getElementById("yoast_wpseo_is_content_planner_banner_dismissed");return null===e||"1"===e.value},Gu={aborted:!0};async function Xu({path:e,method:t="GET",data:s,abortController:r}){const o=r||new AbortController;let n=!1;const i=1e3*(0,u.get)(window,"wpseoContentPlanner.requestTimeout",30),a=setTimeout(()=>{n=!0,o.abort()},i);try{const r=await Ve()(function(e,t,s,r){const o={path:e,method:t,parse:!1,signal:r.signal};return s&&(o.data=s),o}(e,t,s,o));return await r.json()}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw function(e){if(e)throw{errorCode:408,errorIdentifier:"",errorMessage:"timeout"}}(n),Gu;throw await async function(e){const t=await async function(e){try{return await e.json()}catch(e){return{}}}(e);return{errorCode:e.status||502,errorIdentifier:t.errorIdentifier||t.code||"",errorMessage:t.message||"",missingLicenses:t.missingLicenses||[]}}(e)}finally{clearTimeout(a)}}const Zu=e=>{var t,s;let r=(0,u.isObject)(e)?e:{};(0,u.isString)(e)&&(r={message:e});const o={...r,errorMessage:(null===(t=r)||void 0===t?void 0:t.errorMessage)||(null===(s=r)||void 0===s?void 0:s.message)};return(0,u.mapValues)({errorCode:502,errorIdentifier:"",errorMessage:"",missingLicenses:[]},(e,t)=>o[t]||e)},Qu="contentSuggestions",Ju="fetchContentPlannerSuggestions",ep=(0,Yd.createSlice)({name:Qu,initialState:{endpoint:"",status:ue,suggestions:[],recentContent:[],error:Xi},reducers:{setContentSuggestionsStatus:(e,{payload:t})=>{e.status=t},setSuggestion:(e,{payload:t})=>{const s=e.suggestions.findIndex(e=>e.id===t.id);-1!==s&&(e.suggestions[s]=t)},setSuggestionsError:(e,{payload:t})=>{e.status=me,e.suggestions=[],e.error=Zu(t)}},extraReducers:e=>{e.addCase(`${Ju}/${le}`,e=>{e.status=pe,e.suggestions=[],e.recentContent=[],e.error=Xi}),e.addCase(`${Ju}/${ce}`,(e,{payload:t})=>{e.status=he,e.suggestions=t.suggestions,e.recentContent=t.recentContent,e.error=Xi}),e.addCase(`${Ju}/${de}`,(e,{payload:t})=>{e.status=me,e.error=Zu(t)})}}),tp=ep.getInitialState,sp={selectContentSuggestionsEndpoint:e=>(0,u.get)(e,[Qu,"endpoint"],ep.getInitialState().endpoint),selectSuggestionsStatus:e=>(0,u.get)(e,[Qu,"status"],ep.getInitialState().status),selectSuggestions:e=>(0,u.get)(e,[Qu,"suggestions"],ep.getInitialState().suggestions),selectRecentContent:e=>(0,u.get)(e,[Qu,"recentContent"],ep.getInitialState().recentContent),selectSuggestionsError:e=>(0,u.get)(e,[Qu,"error"],ep.getInitialState().error)},rp={...ep.actions,fetchContentPlannerSuggestions:function*({endpoint:e,postType:t,language:s,editor:r}){yield{type:`${Ju}/${le}`};try{const o=(e=>{const t=(0,u.get)(e,"suggestions",null);if(!(0,u.isArray)(t))throw new Error("Invalid suggestions response: expected an array of suggestions.");return{suggestions:t.map(e=>({title:e.title,intent:e.intent,keyphrase:e.keyphrase,meta_description:e.meta_description,category:e.category,explanation:e.explanation,id:`suggestion-${e.keyphrase}-${e.title}`})),recentContent:(0,u.get)(e,"recent_content",[])}})(yield{type:Ju,payload:{endpoint:e,postType:t,language:s,editor:r}});return{type:`${Ju}/${ce}`,payload:o}}catch(e){if(null!=e&&e.aborted)return;return{type:`${Ju}/${de}`,payload:e}}}},op={[Ju]:async({payload:e})=>Xu({path:(0,r.addQueryArgs)(e.endpoint,{post_type:e.postType,language:e.language,editor:e.editor})})},np=ep.reducer,ip="contentOutline",ap="fetchContentOutline",lp={suggestion:null,outline:[],cache:{},endpoint:"",status:ue,error:Xi},cp=(0,Yd.createSlice)({name:ip,initialState:lp,reducers:{setSuggestionForOutline:(e,{payload:t})=>{e.suggestion=t},restoreContentOutlineFromCache:(e,{payload:t})=>{const{suggestion:s,outline:r}=t;e.suggestion=s,e.outline=r,e.status=he,e.error=Xi},saveOutlineEditsToCache:(e,{payload:t})=>{const{id:s,structure:r}=t;s&&(e.cache[s]=r),e.suggestion=null,e.outline=[],e.status=ue,e.error=Xi}},extraReducers:e=>{e.addCase(`${ap}/${le}`,(e,{payload:t})=>{e.status=pe,e.suggestion=t.suggestion,e.error=Xi}),e.addCase(`${ap}/${ce}`,(e,{payload:t})=>{e.status=he;const s=t.outline.map((e,t)=>{var s,r;const o=null!==(s=e.subheading_text)&&void 0!==s?s:"";return{id:`${t}-${o}`,heading:o,contentNotes:null!==(r=e.content_notes)&&void 0!==r?r:[]}});e.outline=s}),e.addCase(`${ap}/${de}`,(e,{payload:t})=>{e.status=me,e.error=Zu(t)}),e.addCase(`${Ju}/${le}`,e=>({...lp,endpoint:e.endpoint}))}}),dp=cp.getInitialState,up={selectContentOutlineEndpoint:e=>(0,u.get)(e,[ip,"endpoint"],cp.getInitialState().endpoint),selectContentOutlineStatus:e=>(0,u.get)(e,[ip,"status"],cp.getInitialState().status),selectContentOutline:e=>(0,u.get)(e,[ip,"outline"],cp.getInitialState().outline),selectContentOutlineError:e=>(0,u.get)(e,[ip,"error"],cp.getInitialState().error),selectSuggestion:e=>(0,u.get)(e,[ip,"suggestion"],cp.getInitialState().suggestion),selectContentOutlineCache:(e,t)=>(0,u.get)(e,[ip,"cache",t],null)},pp={...cp.actions,fetchContentOutline:function*({endpoint:e,postType:t,language:s,editor:r,suggestion:o,recentContent:n}){yield{type:`${ap}/${le}`,payload:{suggestion:o}};try{const i=yield{type:ap,payload:{endpoint:e,postType:t,language:s,editor:r,recentContent:n,...o}};yield{type:`${ap}/${ce}`,payload:i}}catch(e){if(null!=e&&e.aborted)return;yield{type:`${ap}/${de}`,payload:e}}}},hp={[ap]:async({payload:e})=>Xu({method:"POST",path:e.endpoint,data:{post_type:e.postType,language:e.language,editor:e.editor,title:e.title,intent:e.intent,explanation:e.explanation,keyphrase:e.keyphrase,meta_description:e.meta_description,category:e.category,recent_content:e.recentContent}})},mp=cp.reducer,yp="modal",gp=(0,Yd.createSlice)({name:yp,initialState:{isOpen:!1,featureModalStatus:null},reducers:{closeModal:()=>gp.getInitialState(),setFeatureModalStatus:(e,{payload:t})=>{e.featureModalStatus=t}},extraReducers:e=>{e.addCase(`${ap}/${le}`,e=>{e.featureModalStatus=Gi}),e.addCase(`${Ju}/${le}`,e=>{e.featureModalStatus=Vi})}}),fp=gp.getInitialState,xp=gp.reducer,wp={...gp.actions},bp={selectFeatureModalStatus:e=>(0,u.get)(e,[yp,"featureModalStatus"],gp.getInitialState().featureModalStatus)},vp="availability",kp=(0,Yd.createSlice)({name:vp,initialState:{minPostsMet:!1},reducers:{}}),jp=kp.getInitialState,_p=kp.reducer,Sp={...kp.actions},Cp={selectIsMinPostsMet:e=>(0,u.get)(e,[vp,"minPostsMet"],kp.getInitialState().minPostsMet)},Tp="banner",Rp="dismissBannerPermanently",Ep=(0,Yd.createSlice)({name:Tp,initialState:{isBannerDismissed:!1,isBannerRendered:!1,isBannerPermanentlyDismissed:!1,bannerPermanentDismissalEndpoint:""},reducers:{setBannerRendered:e=>{e.isBannerRendered=!0},setBannerDismissed:e=>{e.isBannerDismissed=!0},setBannerPermanentlyDismissed:e=>{e.isBannerPermanentlyDismissed=!0}}}),Ip=Ep.getInitialState,Lp=Ep.reducer,Ap={[Rp]:({endpoint:e})=>Ve()({path:e,method:"POST",data:{is_dismissed:!0}}).catch(u.noop)},Np={setBannerRendered:()=>(zu("yoast_wpseo_is_content_planner_banner_rendered"),Ep.actions.setBannerRendered()),setBannerDismissed:()=>(zu("yoast_wpseo_is_content_planner_banner_dismissed"),Ep.actions.setBannerDismissed()),setBannerPermanentlyDismissed:()=>Ep.actions.setBannerPermanentlyDismissed(),dismissBannerPermanently:function*(e){e&&(yield Ep.actions.setBannerPermanentlyDismissed(),yield{type:Rp,endpoint:e})}},Pp={selectIsBannerDismissed:e=>(0,u.get)(e,[Tp,"isBannerDismissed"],Ep.getInitialState().isBannerDismissed),selectIsBannerRendered:e=>(0,u.get)(e,[Tp,"isBannerRendered"],Ep.getInitialState().isBannerRendered),selectIsBannerPermanentlyDismissed:e=>(0,u.get)(e,[Tp,"isBannerPermanentlyDismissed"],Ep.getInitialState().isBannerPermanentlyDismissed),selectBannerPermanentDismissalEndpoint:e=>(0,u.get)(e,[Tp,"bannerPermanentDismissalEndpoint"],Ep.getInitialState().bannerPermanentDismissalEndpoint)};var Mp=s(3560),Op=s.n(Mp);const Fp=({isPremium:e,onDismiss:t,onDismissPermanently:s,onClick:r,learnMoreLink:o})=>{const n=(0,k.useSvgAria)();return(0,f.jsx)(k.Root,{children:(0,f.jsxs)("div",{role:"group","aria-label":/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
(0,i.__)("Content suggestions banner","wordpress-seo"),className:"yst-z-50 yst-relative yst-p-4 yst-ai-gradient-border yst-rounded-lg",children:[(0,f.jsxs)(k.DropdownMenu,{as:"span",className:"yst-absolute yst-top-4 yst-end-4",children:[(0,f.jsx)(k.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:(0,i.__)("Open banner options","wordpress-seo"),className:"yst-float-end"}),(0,f.jsxs)(k.DropdownMenu.List,{className:"yst-mt-8 yst-w-56",children:[(0,f.jsxs)(k.DropdownMenu.ButtonItem,{className:"yst-text-slate-600 yst-border-b yst-border-slate-200 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:t,children:[(0,f.jsx)($i(),{className:"yst-w-4 yst-text-slate-400 yst-shrink-0",...n}),(0,i.__)("Remove for this post","wordpress-seo")]}),(0,f.jsxs)(k.DropdownMenu.ButtonItem,{className:"yst-text-red-500 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:s,children:[(0,f.jsx)(Op(),{className:"yst-w-4 yst-shrink-0",...n}),(0,i.__)("Remove for all posts","wordpress-seo")]})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2 yst-mb-1 yst-pe-8",children:[(0,f.jsx)(k.GradientSparklesIcon,{className:"yst-h-4 yst-w-4",...n}),(0,f.jsxs)("p",{className:"yst-grow yst-text-slate-800 yst-font-medium",children:[" ",(0,i.__)("Stuck on what to write next?","wordpress-seo")]})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600 yst-mb-1 yst-max-w-xl",children:(0,i.__)("Let Yoast AI Content Planner analyze your content and suggest high-impact topics that fill content gaps and strengthen your SEO strategy.","wordpress-seo")}),(0,f.jsxs)(k.Link,{as:Y,href:o,variant:"primary",className:"yst-font-medium yst-no-underline",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(I(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]}),(0,f.jsxs)("div",{className:"yst-mt-1 yst-flex yst-justify-end yst-gap-2 yst-items-center",children:[!e&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Zl,{}),(0,f.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,f.jsx)(k.Button,{variant:"ai-primary",onClick:r,children:(0,i.__)("Get content suggestions","wordpress-seo")})]})]})})},Dp=window.wp.dom;const qp=({BlockListBlock:e,props:s,hasConsent:r})=>{const{isNewPost:o,isBannerDismissed:i,isBannerRendered:a,isBannerPermanentlyDismissed:l,bannerPermanentDismissalEndpoint:c,isPremium:d,minPostsMet:u,learnMoreLink:p}=(0,t.useSelect)(e=>{const t=e(Ki);return{isNewPost:e("core/editor").isEditedPostNew(),isBannerDismissed:t.selectIsBannerDismissed(),isBannerRendered:t.selectIsBannerRendered(),isBannerPermanentlyDismissed:t.selectIsBannerPermanentlyDismissed(),bannerPermanentDismissalEndpoint:t.selectBannerPermanentDismissalEndpoint(),isPremium:e(be).getIsPremium(),minPostsMet:e(Ki).selectIsMinPostsMet(),learnMoreLink:e(be).selectLink("https://yoa.st/content-planner-learn-more")}},[]),{setFeatureModalStatus:h,setBannerDismissed:m,setBannerRendered:y,dismissBannerPermanently:g}=(0,t.useDispatch)(Ki),x=oc(),w=(0,n.useRef)(null),b=!l&&!i&&(o||a)&&u,v=(0,n.useCallback)(()=>{m()},[m]),k=(0,n.useCallback)(()=>{g(c)},[g,c]),j=(0,n.useCallback)(()=>{r?x():h(zi)},[r,x,h]);return(0,n.useEffect)(()=>{b&&!a&&y()},[b,a,y]),(0,n.useEffect)(()=>{var e;const t=null===(e=w.current)||void 0===e?void 0:e.ownerDocument;if(!t||t===window.document||t.getElementById(Zi))return;const s=window.document.getElementById(Zi);if(!s)return;const r=t.createElement("link");r.id=Zi,r.rel="stylesheet",r.href=s.href,t.head.appendChild(r)},[b]),(0,n.useEffect)(()=>{var e;if(!b)return;const t=null===(e=w.current)||void 0===e?void 0:e.ownerDocument;if(!t)return;function s(e){!function(e,t){!t.defaultPrevented&&e&&(["ArrowDown","ArrowUp"].includes(t.key)?function(e,t){const s=e.querySelector("[role='menu']");s&&(s===t.target||s.contains(t.target))&&t.preventDefault()}(e,t):"Tab"===t.key&&function(e,t){const s=(e=>e.shiftKey?Dp.focus.tabbable.findPrevious:Dp.focus.tabbable.findNext)(t),r=s(t.target);r&&((e,t,s)=>e.contains(t)||e.contains(s))(e,t.target,r)&&(t.preventDefault(),r.focus())}(e,t))}(w.current,e)}const r=e=>{(function(e,t){const s=null==e?void 0:e.querySelector(".yst-dropdown-menu__icon-trigger[aria-expanded='true']"),r=s&&e.querySelector("[role='menu']");return Boolean(r)&&!s.contains(t.target)&&!r.contains(t.target)})(w.current,e)&&w.current.querySelector(".yst-dropdown-menu__icon-trigger").click()};return t.addEventListener("keydown",s,{capture:!0}),t.addEventListener("mousedown",r,{capture:!0}),()=>{t.removeEventListener("keydown",s,{capture:!0}),t.removeEventListener("mousedown",r,{capture:!0})}},[b]),(0,f.jsxs)(f.Fragment,{children:[b&&(0,f.jsx)("div",{ref:w,className:"wp-block","data-block":"yoast-content-planner-banner",children:(0,f.jsx)(Fp,{isPremium:d,onDismiss:v,onDismissPermanently:k,onClick:j,learnMoreLink:p})}),(0,f.jsx)(e,{...s})]})},Bp=(0,Ht.createHigherOrderComponent)(e=>function(s){const{isFirstBlock:r,isEditingTemplate:o}=(0,t.useSelect)(e=>{const t=e("core/editor"),r=t.getCurrentPostType();return{isFirstBlock:e("core/block-editor").getBlockOrder()[0]===s.clientId,isEditingTemplate:"wp_template"===r||"wp_template_part"===r||"template-locked"===t.getRenderingMode()}},[s.clientId]),i=(0,t.useSelect)(e=>(0,u.isObject)(e(we)),[]),a=(0,t.useSelect)(e=>{var t,s;return null!==(t=null===(s=e(we))||void 0===s?void 0:s.selectHasAiGeneratorConsent())&&void 0!==t&&t}),l=(0,n.useCallback)(()=>(0,f.jsx)(e,{...s}),[e,s]);return r&&i&&!o?(0,f.jsx)(k.ErrorBoundary,{FallbackComponent:l,children:(0,f.jsx)(qp,{BlockListBlock:e,props:s,hasConsent:a})}):(0,f.jsx)(e,{...s})},"withYoastContentPlannerBanner"),$p=()=>{const s=(0,n.useRef)(!1),{isNewPost:r,postType:o,blocks:i,minPostsMet:a,isBannerRendered:l,hasBlockTemplate:c}=(0,t.useSelect)(e=>{const t=e("core/editor"),s=t.getCurrentPostType(),r=e("core").getPostType(s);return{isNewPost:t.isEditedPostNew(),postType:s,blocks:e("core/block-editor").getBlocks(),minPostsMet:e(Ki).selectIsMinPostsMet(),isBannerRendered:e(Ki).selectIsBannerRendered(),hasBlockTemplate:Array.isArray(null==r?void 0:r.template)&&r.template.length>0}},[]),d=(0,t.useSelect)(e=>(0,u.isObject)(e(we)),[]),p=(0,t.useSelect)(e=>{var t,s;return null!==(t=null===(s=e(we))||void 0===s?void 0:s.selectHasAiGeneratorConsent())&&void 0!==t&&t}),{insertBlock:h}=(0,t.useDispatch)("core/block-editor");return function(){const{yoastTitle:e,yoastMetaDesc:s,yoastFocusKw:r,isPost:o,titleTemplate:i,descTemplate:a}=(0,t.useSelect)(e=>{const t=e("core/editor"),s=t.getEditedPostAttribute("meta"),{title:r,description:o}=e("yoast-seo/editor").getSnippetEditorTemplates();return{yoastTitle:null==s?void 0:s[re],yoastMetaDesc:null==s?void 0:s[oe],yoastFocusKw:null==s?void 0:s[ne],isPost:"post"===t.getCurrentPostType(),titleTemplate:r,descTemplate:o}},[]),{updateData:l,setFocusKeyword:c}=(0,t.useDispatch)("yoast-seo/editor");(0,n.useEffect)(()=>{if(!o)return;const t={title:i,description:a};e&&(t.title=e),s&&(t.description=s),l(t),c(r||"")},[o,e,s,r,i,a])}(),(0,n.useEffect)(()=>{!s.current&&r&&"post"===o&&a&&!c&&(s.current=function(t,s,r){return!!r||(0===t.length?(s((0,e.createBlock)("core/paragraph"),0,void 0,!1),!1):-1!==t.findIndex(e=>"core/paragraph"===e.name))}(i,h,l))},[i,r,o,h,a,c]),d?(0,f.jsx)(k.ErrorBoundary,{FallbackComponent:u.noop,children:(0,f.jsx)(Bu,{hasConsent:p})}):null};function Up(){Gl()(()=>{var e;((e={})=>{(0,t.register)((e=>(0,t.createReduxStore)(Ki,{actions:{...rp,...pp,...wp,...Sp,...Np},selectors:{...sp,...up,...bp,...Cp,...Pp},controls:{...op,...hp,...Ap},initialState:(0,u.merge)({},{[Qu]:tp(),[ip]:dp(),[yp]:fp(),[vp]:jp(),[Tp]:Ip()},e),reducer:(0,t.combineReducers)({[Qu]:np,[ip]:mp,[yp]:xp,[vp]:_p,[Tp]:Lp})}))(e))})({[Qu]:{endpoint:(0,u.get)(window,"wpseoContentPlanner.endpoints.getSuggestions","")},[ip]:{endpoint:(0,u.get)(window,"wpseoContentPlanner.endpoints.getOutline","")},[vp]:{minPostsMet:(0,u.get)(window,"wpseoContentPlanner.minPostsMet",!1)},[Tp]:{isBannerDismissed:Vu(),isBannerRendered:"1"===(null===(e=document.getElementById("yoast_wpseo_is_content_planner_banner_rendered"))||void 0===e?void 0:e.value),isBannerPermanentlyDismissed:(0,u.get)(window,"wpseoContentPlanner.isBannerPermanentlyDismissed",!1),bannerPermanentDismissalEndpoint:(0,u.get)(window,"wpseoContentPlanner.endpoints.bannerPermanentDismissal","")}}),(0,Ci.addFilter)("editor.BlockListBlock","yoast/content-planner-banner",Bp)}),(0,a.registerPlugin)("yoast-content-planner",{render:$p})}function Wp(e){return(0,u.get)(e,"editorContext.postType")}const Hp=(0,Yd.createSelector)([Wp],e=>"product"===e),Kp=(0,Yd.createSelector)([Wp],e=>["product_cat","product_tag"].includes(e)),Yp=(0,Yd.createSelector)([Hp,Kp],(e,t)=>e||t),zp=(e,t,s=null)=>(0,u.get)(e,`preferences.${t}`,s),Vp=e=>zp(e,"isWooCommerceActive",!1),Gp=e=>zp(e,"isWooCommerceSeoActive",!1);function Xp(){const e=p();return(0,u.get)(e,"contentLocale","en_US")}(0,Yd.createSelector)([Gp,Vp,Yp],(e,t,s)=>!e&&t&&s),(0,Yd.createSelector)([Gp,Vp,Kp],(e,t,s)=>!e&&t&&s),(0,Yd.createSelector)([Yp,Vp],(e,t)=>t&&e);const{updateReplacementVariable:Zp,updateData:Qp,hideReplacementVariables:Jp,setContentImage:eh,updateSettings:th,setEditorDataContent:sh,setEditorDataTitle:rh,setEditorDataExcerpt:oh,setEditorDataImageUrl:nh,setEditorDataSlug:ih}=d.actions,ah=globalThis.jQuery;window.yoast=window.yoast||{},window.yoast.initEditorIntegration=function(s){(function(s){const r=p(),l=r.isPremium?"Yoast SEO Premium":"Yoast SEO",d=(0,f.jsx)(b,{});(0,e.updateCategory)("yoast-structured-data-blocks",{icon:d}),(0,e.updateCategory)("yoast-internal-linking-blocks",{icon:d}),(0,e.updateCategory)("yoast-ai-blocks",{icon:d});const u={isRtl:r.isRtl},h=s.getState().preferences,m=h.isKeywordAnalysisActive||h.isContentAnalysisActive,y=h.isKeywordAnalysisActive&&h.isWincherIntegrationActive;!function(){var e;const s="yoast-seo/document-panel",r=null===(e=(0,t.select)("core/preferences"))||void 0===e?void 0:e.get("core","openPanels");var o;r&&!r.includes(s)&&(null===(o=(0,t.dispatch)("core/editor"))||void 0===o||o.toggleEditorPanelOpened(s))}();const g={locationContext:"block-sidebar"},x={locationContext:"block-metabox"};(0,a.registerPlugin)("yoast-seo",{render:()=>(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(o.PluginSidebarMoreMenuItem,{target:"seo-sidebar",icon:(0,f.jsx)(ba,{}),children:l}),(0,f.jsx)(o.PluginSidebar,{name:"seo-sidebar",title:l,children:(0,f.jsx)(c.Root,{context:g,children:(0,f.jsx)(ua,{store:s,theme:u})})}),(0,f.jsxs)(n.Fragment,{children:[(0,f.jsx)(jl,{store:s,theme:u}),(0,f.jsx)(c.Root,{context:x,children:(0,f.jsx)(ca,{target:"wpseo-metabox-root",store:s,theme:u})})]}),m&&(0,f.jsx)(o.PluginPrePublishPanel,{className:"yoast-seo-sidebar-panel",title:(0,i.__)("Yoast SEO","wordpress-seo"),initialOpen:!0,icon:(0,f.jsx)(n.Fragment,{}),children:(0,f.jsx)(Ma,{})}),(0,f.jsxs)(o.PluginPostPublishPanel,{className:"yoast-seo-sidebar-panel",title:(0,i.__)("Yoast SEO","wordpress-seo"),initialOpen:!0,icon:(0,f.jsx)(n.Fragment,{}),children:[(0,f.jsx)(Ra,{}),y&&(0,f.jsx)(Sl,{})]}),m&&(0,f.jsx)(o.PluginDocumentSettingPanel,{name:"document-panel",className:"yoast-seo-sidebar-panel",title:(0,i.__)("Yoast SEO","wordpress-seo"),icon:(0,f.jsx)(n.Fragment,{}),children:(0,f.jsx)(wa,{})})]}),icon:(0,f.jsx)(ba,{})})})(s),function(){if("function"==typeof(0,u.get)(window,"wp.blockEditor.__experimentalLinkControl")){const e=(0,t.select)("core/rich-text").getFormatType("core/link"),s=(0,t.select)("core/rich-text").getFormatType("core/unknown");void 0!==s&&(0,t.dispatch)("core/rich-text").removeFormatTypes("core/unknown"),[zl].forEach(({name:s,replaces:r,...o})=>{if(r&&(0,t.dispatch)("core/rich-text").removeFormatTypes(r),s){const t=e&&"core/link"===s?{...e,...o}:o;(0,l.registerFormatType)(s,t)}}),void 0!==s&&(0,l.registerFormatType)("core/unknown",s)}else console.warn((0,i.__)("Marking links with nofollow/sponsored has been disabled for WordPress installs < 5.4.","wordpress-seo")+" "+(0,i.sprintf)(
// translators: %1$s expands to Yoast SEO.
// translators: %1$s expands to Yoast SEO.
(0,i.__)("Please upgrade your WordPress version or install the Gutenberg plugin to get this %1$s feature.","wordpress-seo"),"Yoast SEO"))}(),function(e){(0,t.select)("core/editor")&&(0,t.select)("core/block-editor")&&(0,u.isFunction)((0,t.select)("core/block-editor").getBlocks)&&(0,t.select)("core/annotations")&&(0,u.isFunction)((0,t.dispatch)("core/annotations").__experimentalAddAnnotation)&&e.dispatch(d.actions.setMarkerStatus("enabled"))}(s),(()=>{var e;const s=null===(e=(0,t.select)("yoast-seo-premium/editor"))||void 0===e?void 0:e.getIsAiFeatureEnabled;return s?s():Boolean(window.wpseoAdminL10n.isAiFeatureActive)})()&&Up();const h=(0,r.getQueryArg)(window.location.href,"yoast-tab");"readability"!==h&&"seo"!==h||(0,t.dispatch)("core/edit-post").openGeneralSidebar("yoast-seo/seo-sidebar")},window.yoast.EditorData=class{constructor(e,t){this._refresh=e,this._store=t,this._data={},this.getPostAttribute=this.getPostAttribute.bind(this),this.refreshYoastSEO=this.refreshYoastSEO.bind(this)}initialize(e,t=[]){var s,r;this._data=this.getInitialData(e),s=this._data,r=this._store,(0,u.forEach)(s,(e,t)=>{ro.includes(t)||r.dispatch(eo(t,e))}),this._store.dispatch(Jp(t)),this.subscribeToGutenberg(),this.subscribeToYoastSEO()}getInitialData(e){const t=this.collectGutenbergData();return e=function(e,t){if(!e.custom_taxonomies)return e;const s={};return(0,u.forEach)(e.custom_taxonomies,(e,t)=>{const{name:r,label:o,descriptionName:n,descriptionLabel:i}=function(e){const t=oo(e);return{name:"ct_"+t,label:to(e+" (custom taxonomy)"),descriptionName:"ct_desc_"+t,descriptionLabel:to(e+" description (custom taxonomy)")}}(t),a="string"==typeof e.name?(0,Xt.decodeHTML)(e.name):e.name,l="string"==typeof e.description?(0,Xt.decodeHTML)(e.description):e.description;s[r]={value:a,label:o},s[n]={value:l,label:i}}),t.dispatch(function(e){return{type:"SNIPPET_EDITOR_UPDATE_REPLACEMENT_VARIABLES_BATCH",updatedVariables:e}}(s)),(0,u.omit)({...e},"custom_taxonomies")}(e=function(e,t){return e.custom_fields?((0,u.forEach)(e.custom_fields,(e,s)=>{const{name:r,label:o}=function(e){return{name:"cf_"+oo(e),label:to(e+" (custom field)")}}(s);t.dispatch(eo(r,e,o))}),(0,u.omit)({...e},"custom_fields")):e}(e,this._store),this._store),{...e,...t}}setRefresh(e){this._refresh=e}isShallowEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e.hasOwnProperty(s)&&(!(s in t)||e[s]!==t[s]))return!1;return!0}getMediaById(e){return this._coreDataSelect||(this._coreDataSelect=(0,t.select)("core")),this._coreDataSelect.getMedia(e)}getPostAttribute(e){return this._coreEditorSelect||(this._coreEditorSelect=(0,t.select)("core/editor")),this._coreEditorSelect.getEditedPostAttribute(e)}getSlug(){if("auto-draft"===this.getPostAttribute("status"))return"";let e=this.getPostAttribute("generated_slug")||"";"auto-draft"===e&&(e="");const t=this.getPostAttribute("slug")||e;try{return decodeURI(t)}catch(e){return t}}getPostBaseUrl(){const e=(0,t.select)("core/editor").getPermalinkParts();if(null===e||null==e||!e.prefix)return window.wpseoScriptData.metabox.base_url;let s=e.prefix;if((0,t.select)("core/editor").isEditedPostNew())try{const e=new URL(s);s=e.origin+e.pathname}catch(e){}return s.endsWith("/")||(s+="/"),s}collectGutenbergData(){let s=(0,t.select)("core/editor").getEditedPostContent();const r=(0,t.select)("core/editor").getEditorBlocks();1===r.length&&"core/freeform"===r[0].name&&(s=(0,e.getBlockContent)(r[0]));const o=this.calculateContentImage(s),n=this.getPostAttribute("excerpt")||"";return{content:s,title:this.getPostAttribute("title")||"",slug:this.getSlug(),excerpt:n||no(s,"ja"===Xp()?80:156),excerpt_only:n,snippetPreviewImageURL:this.getFeaturedImage()||o,contentImage:o,baseUrl:this.getPostBaseUrl()}}getFeaturedImage(){const e=this.getPostAttribute("featured_media");if(e){const t=this.getMediaById(e);if(t)return t.source_url}return null}calculateContentImage(e){const t=Mt.languageProcessing.imageInText(e);if(0===t.length)return"";const s=ah.parseHTML(t.join(""));for(const e of s)if(e.src)return e.src;return""}handleEditorChange(e){this._data.content!==e.content&&this._store.dispatch(sh(e.content)),this._data.title!==e.title&&(this._store.dispatch(rh(e.title)),this._store.dispatch(Zp("title",e.title))),this._data.excerpt!==e.excerpt&&(this._store.dispatch(oh(e.excerpt)),this._store.dispatch(Zp("excerpt",e.excerpt)),this._store.dispatch(Zp("excerpt_only",e.excerpt_only))),this._data.slug!==e.slug&&(this._store.dispatch(ih(e.slug)),this._store.dispatch(Qp({slug:e.slug}))),this._data.snippetPreviewImageURL!==e.snippetPreviewImageURL&&(this._store.dispatch(nh(e.snippetPreviewImageURL)),this._store.dispatch(Qp({snippetPreviewImageURL:e.snippetPreviewImageURL}))),this._data.contentImage!==e.contentImage&&this._store.dispatch(eh(e.contentImage)),this._data.baseUrl!==e.baseUrl&&this._store.dispatch(th({baseUrl:e.baseUrl}))}reapplyMarkers(){const{getActiveMarker:e,getMarkerPauseStatus:s}=(0,t.select)("yoast-seo/editor"),r=e(),o=s();r&&!o&&Bl()}refreshYoastSEO(){const e=this.collectGutenbergData();!this.isShallowEqual(this._data,e)&&(this.handleEditorChange(e),this._data=e,this._refresh())}areNewAnalysisResultsAvailable(){const e=(0,t.select)("yoast-seo/editor"),s=e.getReadabilityResults(),r=e.getResultsForFocusKeyword();return(this._previousReadabilityResults!==s||this._previousSeoResults!==r)&&(this._previousReadabilityResults=s,this._previousSeoResults=r,!0)}onNewAnalysisResultsAvailable(){this.reapplyMarkers()}subscribeToGutenberg(){this._previousRenderingMode=(0,t.select)("core/editor").getRenderingMode&&(0,t.select)("core/editor").getRenderingMode(),this.subscriber=(0,u.debounce)(()=>{const e=(0,t.select)("core/editor").getRenderingMode&&(0,t.select)("core/editor").getRenderingMode();if(e!==this._previousRenderingMode)return this._previousRenderingMode=e,void this._refresh();this.refreshYoastSEO()},500),(0,t.subscribe)(this.subscriber)}subscribeToYoastSEO(){this.yoastSubscriber=()=>{this.areNewAnalysisResultsAvailable()&&this.onNewAnalysisResultsAvailable()},(0,t.subscribe)(this.yoastSubscriber)}getData(){return this._data}}})()})();
Distinguish Your Business From The Rest With The People That Make Up Your Team
We go Beyond a Resume to find high value, committed people
ready, willing, and able to add true value toward your organization's mission.
The right people make or break your business
We focus on resolving two types of challenges surrounding staffing and recruiting at Beyond a Resume: The first challenge comes when a business continues to grow, but does not have the full-time, internal, talent acquisition resources to hire the right people or talent necessary to keep up with their rate of progression as a company.
The second is a business that has a dedicated internal Human Resources Team, but requires outsourced assistance when the volume of people and talent needed exceeds short term internal capacity, OR the position(s) they seek to fill demand a specific skill set that is difficult to find, requiring added bandwidth.
In nearly any line of business, growth is a challenge in and of itself. Yet, the real problems arise in managing growth to ensure your progress remains profitable, sustainable, and repeatable. The biggest factor in this equation is usually found in your people. When you have the right people, success is unlimited. On the other hand, when you don’t have the right people in place or are having trouble finding enough of the right people, failure or stagnation is imminent.
The frustration that comes with the process of “hiring” can bring you to new levels of stress as the time cost involved eats away at your production elsewhere. If you have experienced this in the past, or are currently struggling with this issue, you’re certainly not alone. You may simply need the right partner to take the worst parts of this process off your plate so you can concentrate on your responsibilities, while we work diligently to reduce the noise and deliver only the ideal candidates worth your time and attention.
People can make or break your business and we go Beyond a Resume to find high value, committed people ready, willing, and able to add true value.